diff options
author | file <file@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-03-10 13:32:58 +0000 |
---|---|---|
committer | file <file@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-03-10 13:32:58 +0000 |
commit | 3d8cd8f5ed77058239d066a1e3bb3c25a799551a (patch) | |
tree | 1b85af52e22e9eb7231e2d4fdede226d1af43cf8 /channels | |
parent | e1b974fff8f4d3ab160100c2752bed4a62f19136 (diff) |
If a port is specified when dialing a peer then use it.
(closes issue #14626)
Reported by: acunningham
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.0@180799 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r-- | channels/chan_sip.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 02338243f..176a80193 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -4175,6 +4175,11 @@ static int create_addr(struct sip_pvt *dialog, const char *opeer, int newdialog) } res = create_addr_from_peer(dialog, peer); unref_peer(peer); + if (!ast_strlen_zero(port)) { + if ((portno = atoi(port))) { + dialog->sa.sin_port = dialog->recv.sin_port = htons(portno); + } + } return res; } |