[asterisk-commits] seanbright: trunk r172778 - /trunk/channels/chan_sip.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sun Feb 1 19:41:30 CST 2009


Author: seanbright
Date: Sun Feb  1 19:41:29 2009
New Revision: 172778

URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=172778
Log:
I already fixed this in my branch, but never merged with trunk.  So here goes.

Modified:
    trunk/channels/chan_sip.c

Modified: trunk/channels/chan_sip.c
URL: http://svn.digium.com/svn-view/asterisk/trunk/channels/chan_sip.c?view=diff&rev=172778&r1=172777&r2=172778
==============================================================================
--- trunk/channels/chan_sip.c (original)
+++ trunk/channels/chan_sip.c Sun Feb  1 19:41:29 2009
@@ -10207,7 +10207,8 @@
 		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 @@
 				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;
 				}




More information about the asterisk-commits mailing list