diff options
author | Mark Michelson <mmichelson@digium.com> | 2014-08-04 20:25:16 +0000 |
---|---|---|
committer | Mark Michelson <mmichelson@digium.com> | 2014-08-04 20:25:16 +0000 |
commit | ca725e1cf65469e34d38128841c820091a13fbbc (patch) | |
tree | e7ba366a3b442fd6c8ac211008653aec96f68a76 /channels/sip | |
parent | 1dce73d278a8378070e54262963eefd8cebe56ab (diff) |
Add the ability to retrieve the source port of a SIP call.
This adds the ability to call CHANNEL(recvport) on chan_sip
channels to see the port on which an INVITE was received.
ASTERISK-24040 #close
Reported by dtryba
Patches:
dialplan_functions.patch uploaded by dtryba (License #6628)
Review: https://reviewboard.asterisk.org/r/3781
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@419970 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels/sip')
-rw-r--r-- | channels/sip/dialplan_functions.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/channels/sip/dialplan_functions.c b/channels/sip/dialplan_functions.c index af69dac45..03770845a 100644 --- a/channels/sip/dialplan_functions.c +++ b/channels/sip/dialplan_functions.c @@ -76,6 +76,8 @@ int sip_acf_channel_read(struct ast_channel *chan, const char *funcname, char *p ast_copy_string(buf, ast_sockaddr_isnull(&p->sa) ? "" : ast_sockaddr_stringify_addr(&p->sa), buflen); } else if (!strcasecmp(args.param, "recvip")) { ast_copy_string(buf, ast_sockaddr_isnull(&p->recv) ? "" : ast_sockaddr_stringify_addr(&p->recv), buflen); + } else if (!strcasecmp(args.param, "recvport")) { + ast_copy_string(buf, ast_sockaddr_isnull(&p->recv) ? "" : ast_sockaddr_stringify_port(&p->recv), buflen); } else if (!strcasecmp(args.param, "from")) { ast_copy_string(buf, p->from, buflen); } else if (!strcasecmp(args.param, "uri")) { |