[asterisk-commits] oej: branch oej/sip-callpickup-1.2 r74022 - /team/oej/sip-callpickup-1.2/chan...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Jul 9 02:28:55 CDT 2007


Author: oej
Date: Mon Jul  9 02:28:54 2007
New Revision: 74022

URL: http://svn.digium.com/view/asterisk?view=rev&rev=74022
Log:
Clean up the pickup URI... Needs to be SIP compatible... Tss tss.

Modified:
    team/oej/sip-callpickup-1.2/channels/chan_sip.c

Modified: team/oej/sip-callpickup-1.2/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/oej/sip-callpickup-1.2/channels/chan_sip.c?view=diff&rev=74022&r1=74021&r2=74022
==============================================================================
--- team/oej/sip-callpickup-1.2/channels/chan_sip.c (original)
+++ team/oej/sip-callpickup-1.2/channels/chan_sip.c Mon Jul  9 02:28:54 2007
@@ -5334,17 +5334,23 @@
 			ast_build_string(&t, &maxbytes, "<dialog id=\"%s\">\n", p->exten);
 		ast_build_string(&t, &maxbytes, "<state>%s</state>\n", statestring);
 		if ((state & AST_EXTENSION_RINGING) && global_notifyringing) {
-			char *cid_name = "Call Pickup", *cid_num = ast_pickup_ext();
+			char *cid_name = "Call Pickup", *cid_num = NULL;
+			char pickup_uri[128];
 			if (cid) {
 				if (!ast_strlen_zero(cid->cid_name))
 					cid_name = cid->cid_name;
 				if (!ast_strlen_zero(cid->cid_num))
 					cid_name = cid->cid_num;
 			}
-			/* We use the pickup extension for remote-uri. The replaces header on the INVITE
+			/* If we can't find anything else, we use the pickup extension for remote-uri. 
+		   	   The replaces header on the INVITE
 			   will override this, but for phones that doesn't send replaces, the pickup
 			   extension is the next best thing
 			 */
+			if (cid_num == NULL) {
+				snprintf(pickup_uri, sizeof(pickup_uri), "sip:%s@%s", ast_pickup_ext, p->fromdomain);
+				cid_num = pickup_uri;
+			}
 			ast_build_string(&t, &maxbytes, "<remote><identity display=\"%s\"></identity>\n<target uri=\"%s\">\n"
 			                                "</target>\n</remote>\n", cid_name, cid_num);
 			ast_build_string(&t, &maxbytes, "<local>\n<target uri=\"%s\">\n"




More information about the asterisk-commits mailing list