summaryrefslogtreecommitdiff
path: root/channels
diff options
context:
space:
mode:
authorSean Bright <sean@malleable.com>2009-02-02 01:41:29 +0000
committerSean Bright <sean@malleable.com>2009-02-02 01:41:29 +0000
commit2af8f59958c31c13178b3edf45aece97e1e589e4 (patch)
treec296f8c9aeee8520b931b855052a73026e2a9215 /channels
parent317e4e7313ed2aeeb441adf9310c1e9cf517f93d (diff)
The CID lookup feature wasn't actually working properly with dialog-info+xml
supporting devices. The devices (snoms, specifically) need to receive a SIP URI instead of just an extension. This adds that functionality. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@172778 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_sip.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index b99e92607..4055e79c0 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -10207,7 +10207,8 @@ static int transmit_state_notify(struct sip_pvt *p, int state, int full, int tim
ast_str_append(&tmp, 0, "<?xml version=\"1.0\"?>\n");
ast_str_append(&tmp, 0, "<dialog-info xmlns=\"urn:ietf:params:xml:ns:dialog-info\" version=\"%d\" state=\"%s\" entity=\"%s\">\n", p->dialogver++, full ? "full" : "partial", mto);
if ((state & AST_EXTENSION_RINGING) && sip_cfg.notifyringing) {
- const char *local_display = p->exten, *local_target = mto;
+ const char *local_display = p->exten;
+ char *local_target = mto;
/* There are some limitations to how this works. The primary one is that the
callee must be dialing the same extension that is being monitored. Simply dialing
@@ -10216,8 +10217,10 @@ static int transmit_state_notify(struct sip_pvt *p, int state, int full, int tim
struct ast_channel *caller = ast_channel_search_locked(find_calling_channel, p);
if (caller) {
+ int need = strlen(caller->cid.cid_num) + strlen(p->fromdomain) + sizeof("sip:@");
+ local_target = alloca(need);
+ snprintf(local_target, need, "sip:%s@%s", caller->cid.cid_num, p->fromdomain);
local_display = ast_strdupa(caller->cid.cid_name);
- local_target = ast_strdupa(caller->cid.cid_num);
ast_channel_unlock(caller);
caller = NULL;
}