diff options
Diffstat (limited to 'pjmedia/include/pjmedia')
-rw-r--r-- | pjmedia/include/pjmedia/errno.h | 5 | ||||
-rw-r--r-- | pjmedia/include/pjmedia/rtp.h | 20 | ||||
-rw-r--r-- | pjmedia/include/pjmedia/stream.h | 16 |
3 files changed, 41 insertions, 0 deletions
diff --git a/pjmedia/include/pjmedia/errno.h b/pjmedia/include/pjmedia/errno.h index 708f5e04..4fa26afd 100644 --- a/pjmedia/include/pjmedia/errno.h +++ b/pjmedia/include/pjmedia/errno.h @@ -354,6 +354,11 @@ PJ_BEGIN_DECL * RTP is not configured. */ #define PJMEDIA_RTP_ENOCONFIG (PJMEDIA_ERRNO_START+134) /* 220134 */ +/** + * @hideinitializer + * Invalid DTMF digit. + */ +#define PJMEDIA_RTP_EINDTMF (PJMEDIA_ERRNO_START+135) /* 220135 */ /************************************************************ diff --git a/pjmedia/include/pjmedia/rtp.h b/pjmedia/include/pjmedia/rtp.h index 3afc1307..34c576bd 100644 --- a/pjmedia/include/pjmedia/rtp.h +++ b/pjmedia/include/pjmedia/rtp.h @@ -122,6 +122,26 @@ struct pjmedia_rtp_ext_hdr typedef struct pjmedia_rtp_ext_hdr pjmedia_rtp_ext_hdr; +#pragma pack(1) + +/** + * Declaration for DTMF telephony-events (RFC2833). + */ +struct pjmedia_rtp_dtmf_event +{ + pj_uint8_t event; + pj_uint8_t e_vol; + pj_uint16_t duration; +}; + +/** + * @see pjmedia_rtp_dtmf_event + */ +typedef struct pjmedia_rtp_dtmf_event pjmedia_rtp_dtmf_event; + +#pragma pack() + + /** * A generic sequence number management, used by both RTP and RTCP. */ diff --git a/pjmedia/include/pjmedia/stream.h b/pjmedia/include/pjmedia/stream.h index 52b8008f..6a685e06 100644 --- a/pjmedia/include/pjmedia/stream.h +++ b/pjmedia/include/pjmedia/stream.h @@ -71,6 +71,8 @@ struct pjmedia_stream_info pjmedia_sock_info sock_info; /**< Media transport (RTP/RTCP sockets) */ pj_sockaddr_in rem_addr; /**< Remote RTP address */ pjmedia_codec_info fmt; /**< Codec format info. */ + unsigned tx_event_pt;/**< Outgoing pt for telephone-events. */ + unsigned rx_event_pt;/**< Incoming pt for telephone-events. */ pj_uint32_t ssrc; /**< RTP SSRC. */ int jb_min; /**< Jitter buffer min delay. */ int jb_max; /**< Jitter buffer max delay. */ @@ -183,6 +185,20 @@ PJ_DECL(pj_status_t) pjmedia_stream_pause( pjmedia_stream *stream, PJ_DECL(pj_status_t) pjmedia_stream_resume(pjmedia_stream *stream, pjmedia_dir dir); +/** + * Transmit DTMF to this stream. The DTMF will be transmitted uisng + * RTP telephone-events as described in RFC 2833. This operation is + * only valid for audio stream. + * + * @param stream The media stream. + * @param digit A single digit ('0123456789*#ABCD'). + * + * @return PJ_SUCCESS on success. + */ +PJ_DECL(pj_status_t) pjmedia_stream_dial_dtmf(pjmedia_stream *stream, + const pj_str_t *digit_char); + + /** * @} |