oRTP
0.24.0
|
Receiving and sending telephone events (RFC2833) More...
#include <ortp/rtpsession.h>
Go to the source code of this file.
Data Structures | |
struct | _telephone_event |
Macros | |
#define | TELEPHONY_EVENTS_ALLOCATED_SIZE (4*sizeof(telephone_event_t)) |
#define | TEV_DTMF_0 (0) |
#define | TEV_DTMF_1 (1) |
#define | TEV_DTMF_2 (2) |
#define | TEV_DTMF_3 (3) |
#define | TEV_DTMF_4 (4) |
#define | TEV_DTMF_5 (5) |
#define | TEV_DTMF_6 (6) |
#define | TEV_DTMF_7 (7) |
#define | TEV_DTMF_8 (8) |
#define | TEV_DTMF_9 (9) |
#define | TEV_DTMF_STAR (10) |
#define | TEV_DTMF_POUND (11) |
#define | TEV_DTMF_A (12) |
#define | TEV_DTMF_B (13) |
#define | TEV_DTMF_C (14) |
#define | TEV_DTMF_D (15) |
#define | TEV_FLASH (16) |
Typedefs | |
typedef struct _telephone_event | telephone_event_t |
Functions | |
ORTP_PUBLIC int | rtp_session_telephone_events_supported (RtpSession *session) |
ORTP_PUBLIC int | rtp_session_send_telephone_events_supported (RtpSession *session) |
ORTP_PUBLIC int | rtp_session_recv_telephone_events_supported (RtpSession *session) |
ORTP_PUBLIC mblk_t * | rtp_session_create_telephone_event_packet (RtpSession *session, int start) |
ORTP_PUBLIC int | rtp_session_add_telephone_event (RtpSession *session, mblk_t *packet, uint8_t event, int end, uint8_t volume, uint16_t duration) |
ORTP_PUBLIC int | rtp_session_read_telephone_event (RtpSession *session, mblk_t *packet, telephone_event_t **tab) |
ORTP_PUBLIC int | rtp_session_send_dtmf (RtpSession *session, char dtmf, uint32_t userts) |
ORTP_PUBLIC int | rtp_session_send_dtmf2 (RtpSession *session, char dtmf, uint32_t userts, int duration) |
ORTP_PUBLIC void | rtp_session_check_telephone_events (RtpSession *session, mblk_t *m0) |
Receiving and sending telephone events (RFC2833)
ORTP_PUBLIC int rtp_session_add_telephone_event | ( | RtpSession * | session, |
mblk_t * | packet, | ||
uint8_t | event, | ||
int | end, | ||
uint8_t | volume, | ||
uint16_t | duration | ||
) |
session | a rtp session. |
packet | a rtp packet as a mblk_t |
event | the event type as described in rfc2833, ie one of the TEV_* macros. |
end | a boolean to indicate if the end bit should be set. (end of tone) |
volume | the volume of the telephony tone, as described in rfc2833 |
duration | the duration of the telephony tone, in timestamp unit. |
Adds a named telephony event to a rtp packet previously allocated using rtp_session_create_telephone_event_packet().
Referenced by rtp_session_send_dtmf2().
ORTP_PUBLIC mblk_t* rtp_session_create_telephone_event_packet | ( | RtpSession * | session, |
int | start | ||
) |
Allocates a new rtp packet to be used to add named telephony events. The application can use then rtp_session_add_telephone_event() to add named events to the packet. Finally the packet has to be sent with rtp_session_sendm_with_ts().
session | a rtp session. |
start | boolean to indicate if the marker bit should be set. |
References _PayloadType::clock_rate, and rtp_session_get_send_payload_type().
Referenced by rtp_session_send_dtmf2().
ORTP_PUBLIC int rtp_session_read_telephone_event | ( | RtpSession * | session, |
mblk_t * | packet, | ||
telephone_event_t ** | tab | ||
) |
Reads telephony events from a rtp packet. * points to the beginning of the event buffer.
session | a rtp session from which telephony events are received. |
packet | a rtp packet as a mblk_t. |
tab | the address of a pointer. |
ORTP_PUBLIC int rtp_session_recv_telephone_events_supported | ( | RtpSession * | session | ) |
Tells whether telephone event payload type is supported for receiving within the context of the rtp session.
session | a rtp session |
Referenced by rtp_session_set_recv_profile().
ORTP_PUBLIC int rtp_session_send_dtmf | ( | RtpSession * | session, |
char | dtmf, | ||
uint32_t | userts | ||
) |
This functions creates telephony events packets for dtmf and sends them. It uses rtp_session_create_telephone_event_packet() and rtp_session_add_telephone_event() to create them and finally rtp_session_sendm_with_ts() to send them.
session | a rtp session |
dtmf | a character meaning the dtmf (ex: '1', '#' , '9' ...) |
userts | the timestamp |
References rtp_session_send_dtmf2().
ORTP_PUBLIC int rtp_session_send_dtmf2 | ( | RtpSession * | session, |
char | dtmf, | ||
uint32_t | userts, | ||
int | duration | ||
) |
A variation of rtp_session_send_dtmf() with duration specified.
session | a rtp session |
dtmf | a character meaning the dtmf (ex: '1', '#' , '9' ...) |
userts | the timestamp |
duration | duration of the dtmf in timestamp units |
References rtp_session_add_telephone_event(), rtp_session_create_telephone_event_packet(), and rtp_session_sendm_with_ts().
Referenced by rtp_session_send_dtmf().
ORTP_PUBLIC int rtp_session_send_telephone_events_supported | ( | RtpSession * | session | ) |
Tells whether telephone event payload type is supported for send within the context of the rtp session.
session | a rtp session |
Referenced by rtp_session_set_send_profile().
ORTP_PUBLIC int rtp_session_telephone_events_supported | ( | RtpSession * | session | ) |
Tells whether telephony events payload type is supported within the context of the rtp session.
session | a rtp session |
Referenced by rtp_session_set_profile().