Telephone events (RFC2833)

Name

Telephone events (RFC2833) -- 

Synopsis


#include <telephonyevents.h>


struct      telephone_event;
gint        rtp_session_telephone_events_supported
                                            (RtpSession *session);
mblk_t*     rtp_session_create_telephone_event_packet
                                            (RtpSession *session,
                                             int start);
gint        rtp_session_add_telephone_event (RtpSession *session,
                                             mblk_t *packet,
                                             guchar event,
                                             gint end,
                                             guchar volume,
                                             guint16 duration);
gint        rtp_session_read_telephone_event
                                            (RtpSession *session,
                                             mblk_t *packet,
                                             telephone_event_t **tab);
gint        rtp_session_send_dtmf           (RtpSession *session,
                                             gchar dtmf,
                                             guint32 userts);

Description

Details

struct telephone_event

struct telephone_event
{
#ifdef WORDS_BIGENDIAN
	guchar event;
	guchar E:1;
	guchar R:1;
	guchar volume:6;
	guint16 duration;
#else
	guint16 duration;
	guchar R:1;
	guchar E:1;
	guchar volume:6;
	guchar event;
#endif
};


rtp_session_telephone_events_supported ()

gint        rtp_session_telephone_events_supported
                                            (RtpSession *session);

Tells whether telephony events payload type is supported within the context of the rtp session.


rtp_session_create_telephone_event_packet ()

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().


rtp_session_add_telephone_event ()

gint        rtp_session_add_telephone_event (RtpSession *session,
                                             mblk_t *packet,
                                             guchar event,
                                             gint end,
                                             guchar volume,
                                             guint16 duration);

Adds a named telephony event to a rtp packet previously allocated using rtp_session_create_telephone_event_packet().


rtp_session_read_telephone_event ()

gint        rtp_session_read_telephone_event
                                            (RtpSession *session,
                                             mblk_t *packet,
                                             telephone_event_t **tab);

Reads telephony events from a rtp packet. *tab points to the beginning of the event buffer.


rtp_session_send_dtmf ()

gint        rtp_session_send_dtmf           (RtpSession *session,
                                             gchar dtmf,
                                             guint32 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.