chan_pjsip: add a new function PJSIP_DTMF_MODE

This function is a replica of SIPDtmfMode, allowing the DTMF mode of a
PJSIP call to be modified on a per-call basis

ASTERISK-27085 #close

Change-Id: I20eef5da3e5d1d3e58b304416bc79683f87e7612
This commit is contained in:
Torrey Searle
2017-06-26 14:52:52 +02:00
committed by George Joseph
parent b3914df10b
commit 65c560894d
10 changed files with 294 additions and 37 deletions

View File

@@ -2889,4 +2889,31 @@ int ast_sip_set_tpselector_from_ep_or_uri(const struct ast_sip_endpoint *endpoin
int ast_sip_dlg_set_transport(const struct ast_sip_endpoint *endpoint, pjsip_dialog *dlg,
pjsip_tpselector *selector);
/*!
* \brief Convert the DTMF mode enum value into a string
* \since 13.18.0
*
* \param dtmf the dtmf mode
* \param buf Buffer to receive dtmf mode string
* \param buf_len Buffer length
*
* \retval 0 Success
* \retval -1 Failure
*
*/
int ast_sip_dtmf_to_str(const enum ast_sip_dtmf_mode dtmf,
char *buf, size_t buf_len);
/*!
* \brief Convert the DTMF mode name into an enum
* \since 13.18.0
*
* \param dtmf_mode dtmf mode as a string
*
* \retval >= 0 The enum value
* \retval -1 Failure
*
*/
int ast_sip_str_to_dtmf(const char *dtmf_mode);
#endif /* _RES_PJSIP_H */

View File

@@ -203,6 +203,8 @@ struct ast_sip_session {
unsigned int defer_end:1;
/*! Session end (remote hangup) requested while termination deferred */
unsigned int ended_while_deferred:1;
/*! DTMF mode to use with this session, from endpoint but can change */
enum ast_sip_dtmf_mode dtmf;
};
typedef int (*ast_sip_session_request_creation_cb)(struct ast_sip_session *session, pjsip_tx_data *tdata);