diff options
author | Benny Prijono <bennylp@teluu.com> | 2006-12-26 00:11:48 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2006-12-26 00:11:48 +0000 |
commit | 2fe9c7e503a9599ed0361e10bb6ba1c4bf311e4c (patch) | |
tree | 2c9692b2e847917e2ad7e6a364829943b1623ed0 /pjmedia/include | |
parent | 2c57eaea78b397d120cfe359ff5d8026dae17f60 (diff) |
Added DTMF callback support all the way to PJSUA API (ticket #48)
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@863 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjmedia/include')
-rw-r--r-- | pjmedia/include/pjmedia/session.h | 23 | ||||
-rw-r--r-- | pjmedia/include/pjmedia/stream.h | 21 |
2 files changed, 44 insertions, 0 deletions
diff --git a/pjmedia/include/pjmedia/session.h b/pjmedia/include/pjmedia/session.h index ad490669..b76e4de4 100644 --- a/pjmedia/include/pjmedia/session.h +++ b/pjmedia/include/pjmedia/session.h @@ -321,6 +321,29 @@ PJ_DECL(pj_status_t) pjmedia_session_get_dtmf( pjmedia_session *session, unsigned *size ); /** + * Set callback to be called upon receiving DTMF digits. If callback is + * registered, the stream will not buffer incoming DTMF but rather call + * the callback as soon as DTMF digit is received completely. + * + * @param session The media session. + * @param index The stream index. + * @param cb Callback to be called upon receiving DTMF digits. + * The DTMF digits will be given to the callback as + * ASCII digits. + * @param user_data User data to be returned back when the callback + * is called. + * + * @return PJ_SUCCESS on success. + */ +PJ_DECL(pj_status_t) +pjmedia_session_set_dtmf_callback(pjmedia_session *session, + unsigned index, + void (*cb)(pjmedia_stream*, + void *user_data, + int digit), + void *user_data); + +/** * Destroy media session. * * @param session The media session. diff --git a/pjmedia/include/pjmedia/stream.h b/pjmedia/include/pjmedia/stream.h index 7a02b72a..2f862f34 100644 --- a/pjmedia/include/pjmedia/stream.h +++ b/pjmedia/include/pjmedia/stream.h @@ -277,6 +277,27 @@ PJ_DECL(pj_status_t) pjmedia_stream_get_dtmf( pjmedia_stream *stream, /** + * Set callback to be called upon receiving DTMF digits. If callback is + * registered, the stream will not buffer incoming DTMF but rather call + * the callback as soon as DTMF digit is received completely. + * + * @param stream The media stream. + * @param cb Callback to be called upon receiving DTMF digits. + * The DTMF digits will be given to the callback as + * ASCII digits. + * @param user_data User data to be returned back when the callback + * is called. + * + * @return PJ_SUCCESS on success. + */ +PJ_DECL(pj_status_t) +pjmedia_stream_set_dtmf_callback(pjmedia_stream *stream, + void (*cb)(pjmedia_stream*, + void *user_data, + int digit), + void *user_data); + +/** * @} */ |