aboutsummaryrefslogtreecommitdiffstats
path: root/channels
diff options
context:
space:
mode:
authordvossel <dvossel@f38db490-d61c-443f-a65b-d21fe96a405b>2009-06-23 16:28:46 +0000
committerdvossel <dvossel@f38db490-d61c-443f-a65b-d21fe96a405b>2009-06-23 16:28:46 +0000
commit24e6e43cf98eec2bd33245f8e0a183acb603f2fc (patch)
tree1b3a97e6dc1a4e07859607fc213ceed73272647c /channels
parent4ba5b7c17f0d218c645c9f0fbfdba1ccf9e026a1 (diff)
MWI NOTIFY contains a wrong URI if Asterisk listens to non-standard port and transport
(closes issue #14659) Reported by: klaus3000 Patches: patch_chan_sip_fixMWIuri_1.4.txt uploaded by klaus3000 (license 65) mwi_port-transport_trunk.diff uploaded by dvossel (license 671) Tested by: dvossel, klaus3000 Review: https://reviewboard.asterisk.org/r/288/ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@202671 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_sip.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 0b0650e30..9498b6352 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -7636,8 +7636,16 @@ static int transmit_notify_with_mwi(struct sip_pvt *p, int newmsgs, int oldmsgs,
add_header(&req, "Content-Type", default_notifymime);
ast_build_string(&t, &maxbytes, "Messages-Waiting: %s\r\n", newmsgs ? "yes" : "no");
- ast_build_string(&t, &maxbytes, "Message-Account: sip:%s@%s\r\n",
+ /* if we listen to non-standard SIP port we have to specify the SIP port
+ in the URI, except domains are used - in this case the SRV records should be
+ used to redirect the client to the non-standard SIP port */
+ if ((ourport != STANDARD_SIP_PORT) && ast_strlen_zero(p->fromdomain)) {
+ ast_build_string(&t, &maxbytes, "Message-Account: sip:%s@%s:%d\r\n",
+ S_OR(vmexten, default_vmexten), ast_inet_ntoa(p->ourip), ourport);
+ } else {
+ ast_build_string(&t, &maxbytes, "Message-Account: sip:%s@%s\r\n",
S_OR(vmexten, default_vmexten), S_OR(p->fromdomain, ast_inet_ntoa(p->ourip)));
+ }
/* Cisco has a bug in the SIP stack where it can't accept the
(0/0) notification. This can temporarily be disabled in
sip.conf with the "buggymwi" option */