aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2006-01-19 04:56:48 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2006-01-19 04:56:48 +0000
commitaf131944c7c43a1a33368de3a3e72c0c2aa0704c (patch)
tree9ee040b185a8bb4046a2d0890d5850ccff94fa24
parent883098eb8d9d0b2fab6be868968cd3ca1eb1d6c5 (diff)
fix Message-Account header to use the ip address if the fromdomain
isn't set (issue #6278) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@8242 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--channels/chan_sip.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index ae62104eb..3b631e490 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -5113,13 +5113,14 @@ static int transmit_notify_with_mwi(struct sip_pvt *p, int newmsgs, int oldmsgs,
char tmp[500];
char *t = tmp;
size_t maxbytes = sizeof(tmp);
+ char iabuf[INET_ADDRSTRLEN];
initreqprep(&req, p, SIP_NOTIFY);
add_header(&req, "Event", "message-summary");
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", !ast_strlen_zero(vmexten) ? vmexten : global_vmexten, p->fromdomain);
+ ast_build_string(&t, &maxbytes, "Message-Account: sip:%s@%s\r\n", !ast_strlen_zero(vmexten) ? vmexten : global_vmexten, ast_strlen_zero(p->fromdomain) ? ast_inet_ntoa(iabuf, sizeof(iabuf), p->ourip) : p->fromdomain);
ast_build_string(&t, &maxbytes, "Voice-Message: %d/%d (0/0)\r\n", newmsgs, oldmsgs);
if (t > tmp + sizeof(tmp))