00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00027 #ifndef TELEPHONYEVENTS_H
00028 #define TELEPHONYEVENTS_H
00029
00030 #include <ortp/rtpsession.h>
00031
00032
00033 struct _telephone_event
00034 {
00035 #ifdef ORTP_BIGENDIAN
00036 uint32_t event:8;
00037 uint32_t E:1;
00038 uint32_t R:1;
00039 uint32_t volume:6;
00040 uint32_t duration:16;
00041 #else
00042 uint32_t event:8;
00043 uint32_t volume:6;
00044 uint32_t R:1;
00045 uint32_t E:1;
00046 uint32_t duration:16;
00047 #endif
00048 };
00049
00050 typedef struct _telephone_event telephone_event_t;
00051
00052 #ifdef __cplusplus
00053 extern "C" {
00054 #endif
00055
00056
00057
00058
00059
00060 int rtp_session_telephone_events_supported(RtpSession *session);
00061 int rtp_session_send_telephone_events_supported(RtpSession *session);
00062 int rtp_session_recv_telephone_events_supported(RtpSession *session);
00063
00064 mblk_t *rtp_session_create_telephone_event_packet(RtpSession *session, int start);
00065
00066 int rtp_session_add_telephone_event(RtpSession *session,
00067 mblk_t *packet, uint8_t event, int end, uint8_t volume, uint16_t duration);
00068
00069 int rtp_session_read_telephone_event(RtpSession *session,
00070 mblk_t *packet,telephone_event_t **tab);
00071
00072
00073 int rtp_session_send_dtmf(RtpSession *session, char dtmf, uint32_t userts);
00074 int rtp_session_send_dtmf2(RtpSession *session, char dtmf, uint32_t userts, int duration);
00075
00076 void rtp_session_check_telephone_events(RtpSession *session, mblk_t *m0);
00077
00078 #ifdef __cplusplus
00079 }
00080 #endif
00081
00082
00083 #define TELEPHONY_EVENTS_ALLOCATED_SIZE (4*sizeof(telephone_event_t))
00084
00085
00086 #define TEV_DTMF_0 (0)
00087 #define TEV_DTMF_1 (1)
00088 #define TEV_DTMF_2 (2)
00089 #define TEV_DTMF_3 (3)
00090 #define TEV_DTMF_4 (4)
00091 #define TEV_DTMF_5 (5)
00092 #define TEV_DTMF_6 (6)
00093 #define TEV_DTMF_7 (7)
00094 #define TEV_DTMF_8 (8)
00095 #define TEV_DTMF_9 (9)
00096 #define TEV_DTMF_STAR (10)
00097 #define TEV_DTMF_POUND (11)
00098 #define TEV_DTMF_A (12)
00099 #define TEV_DTMF_B (13)
00100 #define TEV_DTMF_C (14)
00101 #define TEV_DTMF_D (15)
00102 #define TEV_FLASH (16)
00103
00104
00105 #endif