From a45af3298319b54649abe00b5841f95cc9fe3ae7 Mon Sep 17 00:00:00 2001 From: Andre Nazario Date: Fri, 25 Aug 2017 23:06:10 -0300 Subject: chan_pjsip: Add tag info in CHANNEL function Create local_tag and remote_tag in CHANNEL info to get tag from From and To headers of a SIP dialog. ASTERISK-27220 Change-Id: I59b16c4b928896fcbde02ad88f0e98922b15d524 --- channels/pjsip/dialplan_functions.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'channels') diff --git a/channels/pjsip/dialplan_functions.c b/channels/pjsip/dialplan_functions.c index a382c4e0a..48b42ad00 100644 --- a/channels/pjsip/dialplan_functions.c +++ b/channels/pjsip/dialplan_functions.c @@ -393,9 +393,15 @@ The local URI. + + Tag in From header + The remote URI. + + Tag in To header + The current state of any T.38 fax on this channel. @@ -691,10 +697,18 @@ static int channel_read_pjsip(struct ast_channel *chan, const char *type, const pjsip_uri_print(PJSIP_URI_IN_FROMTO_HDR, dlg->local.info->uri, buf, buflen); buf_copy = ast_strdupa(buf); ast_escape_quoted(buf_copy, buf, buflen); + } else if (!strcmp(type, "local_tag")) { + ast_copy_pj_str(buf, &dlg->local.info->tag, buflen); + buf_copy = ast_strdupa(buf); + ast_escape_quoted(buf_copy, buf, buflen); } else if (!strcmp(type, "remote_uri")) { pjsip_uri_print(PJSIP_URI_IN_FROMTO_HDR, dlg->remote.info->uri, buf, buflen); buf_copy = ast_strdupa(buf); ast_escape_quoted(buf_copy, buf, buflen); + } else if (!strcmp(type, "remote_tag")) { + ast_copy_pj_str(buf, &dlg->remote.info->tag, buflen); + buf_copy = ast_strdupa(buf); + ast_escape_quoted(buf_copy, buf, buflen); } else if (!strcmp(type, "t38state")) { ast_copy_string(buf, t38state_to_string[channel->session->t38state], buflen); } else if (!strcmp(type, "local_addr")) { -- cgit v1.2.3