summaryrefslogtreecommitdiff
path: root/channels/chan_pjsip.c
diff options
context:
space:
mode:
Diffstat (limited to 'channels/chan_pjsip.c')
-rw-r--r--channels/chan_pjsip.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/channels/chan_pjsip.c b/channels/chan_pjsip.c
index c542e149d..db0a69712 100644
--- a/channels/chan_pjsip.c
+++ b/channels/chan_pjsip.c
@@ -1701,7 +1701,7 @@ static int chan_pjsip_digit_begin(struct ast_channel *chan, char digit)
struct ast_sip_session_media *media = pvt->media[SIP_MEDIA_AUDIO];
int res = 0;
- switch (channel->session->endpoint->dtmf) {
+ switch (channel->session->dtmf) {
case AST_SIP_DTMF_RFC_4733:
if (!media || !media->rtp) {
return -1;
@@ -1821,7 +1821,7 @@ static int chan_pjsip_digit_end(struct ast_channel *ast, char digit, unsigned in
struct ast_sip_session_media *media = pvt->media[SIP_MEDIA_AUDIO];
int res = 0;
- switch (channel->session->endpoint->dtmf) {
+ switch (channel->session->dtmf) {
case AST_SIP_DTMF_AUTO_INFO:
{
if (!media || !media->rtp) {
@@ -2633,6 +2633,12 @@ static struct ast_custom_function media_offer_function = {
.write = pjsip_acf_media_offer_write
};
+static struct ast_custom_function dtmf_mode_function = {
+ .name = "PJSIP_DTMF_MODE",
+ .read = pjsip_acf_dtmf_mode_read,
+ .write = pjsip_acf_dtmf_mode_write
+};
+
static struct ast_custom_function session_refresh_function = {
.name = "PJSIP_SEND_SESSION_REFRESH",
.write = pjsip_acf_session_refresh_write,
@@ -2677,6 +2683,11 @@ static int load_module(void)
goto end;
}
+ if (ast_custom_function_register(&dtmf_mode_function)) {
+ ast_log(LOG_WARNING, "Unable to register PJSIP_DTMF_MODE dialplan function\n");
+ goto end;
+ }
+
if (ast_custom_function_register(&session_refresh_function)) {
ast_log(LOG_WARNING, "Unable to register PJSIP_SEND_SESSION_REFRESH dialplan function\n");
goto end;
@@ -2736,6 +2747,7 @@ static int load_module(void)
end:
ao2_cleanup(pjsip_uids_onhold);
pjsip_uids_onhold = NULL;
+ ast_custom_function_unregister(&dtmf_mode_function);
ast_custom_function_unregister(&media_offer_function);
ast_custom_function_unregister(&chan_pjsip_dial_contacts_function);
ast_custom_function_unregister(&session_refresh_function);
@@ -2758,6 +2770,7 @@ static int unload_module(void)
ast_sip_session_unregister_supplement(&chan_pjsip_ack_supplement);
ast_sip_session_unregister_supplement(&call_pickup_supplement);
+ ast_custom_function_unregister(&dtmf_mode_function);
ast_custom_function_unregister(&media_offer_function);
ast_custom_function_unregister(&chan_pjsip_dial_contacts_function);
ast_custom_function_unregister(&session_refresh_function);