[svn-commits] qwell: branch 1.4 r77894 - /branches/1.4/channels/chan_skinny.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu Aug 2 10:15:46 CDT 2007


Author: qwell
Date: Thu Aug  2 10:15:45 2007
New Revision: 77894

URL: http://svn.digium.com/view/asterisk?view=rev&rev=77894
Log:
Make sure that we show the correct extension if dialed from a macro
"From: 5555" rather than "From: s"

Issue 10358, initial patch by DEA, reworked by me to use S_OR, tested by sbisker

Modified:
    branches/1.4/channels/chan_skinny.c

Modified: branches/1.4/channels/chan_skinny.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/channels/chan_skinny.c?view=diff&rev=77894&r1=77893&r2=77894
==============================================================================
--- branches/1.4/channels/chan_skinny.c (original)
+++ branches/1.4/channels/chan_skinny.c Thu Aug  2 10:15:45 2007
@@ -2525,6 +2525,9 @@
 	struct skinny_line *l = sub->parent;
 	struct skinny_device *d = l->parent;
 	struct skinnysession *s = d->session;
+	char exten[AST_MAX_EXTENSION] = "";
+
+	ast_copy_string(exten, S_OR(ast->macroexten, ast->exten), sizeof(exten));
 
 	sub->cxmode = SKINNY_CX_SENDRECV;
 	if (!sub->rtp) {
@@ -2540,7 +2543,7 @@
 	/* order matters here...
 	   for some reason, transmit_callinfo must be before transmit_callstate,
 	   or you won't get keypad messages in some situations. */
-	transmit_callinfo(s, ast->cid.cid_name, ast->cid.cid_num, ast->exten, ast->exten, l->instance, sub->callid, 2);
+	transmit_callinfo(s, ast->cid.cid_name, ast->cid.cid_num, exten, exten, l->instance, sub->callid, 2);
 	transmit_callstate(s, l->instance, SKINNY_CONNECTED, sub->callid);
 	transmit_selectsoftkeys(s, l->instance, sub->callid, KEYDEF_CONNECTED);
 	transmit_displaypromptstatus(s, "Connected", 0, l->instance, sub->callid);
@@ -2719,6 +2722,9 @@
 	struct skinny_line *l = sub->parent;
 	struct skinny_device *d = l->parent;
 	struct skinnysession *s = d->session;
+	char exten[AST_MAX_EXTENSION] = "";
+
+	ast_copy_string(exten, S_OR(ast->macroexten, ast->exten), sizeof(exten));
 
 	if (skinnydebug)
 		ast_verbose(VERBOSE_PREFIX_3 "Asked to indicate '%s' condition on channel %s\n", control2str(ind), ast->name);
@@ -2728,9 +2734,9 @@
 			if (!sub->progress) {
 				transmit_tone(s, SKINNY_ALERT, l->instance, sub->callid);
 				transmit_callstate(s, l->instance, SKINNY_RINGOUT, sub->callid);
-				transmit_dialednumber(s, ast->exten, l->instance, sub->callid);
+				transmit_dialednumber(s, exten, l->instance, sub->callid);
 				transmit_displaypromptstatus(s, "Ring Out", 0, l->instance, sub->callid);
-				transmit_callinfo(s, ast->cid.cid_name, ast->cid.cid_num, ast->exten, ast->exten, l->instance, sub->callid, 2); /* 2 = outgoing from phone */
+				transmit_callinfo(s, ast->cid.cid_name, ast->cid.cid_num, exten, exten, l->instance, sub->callid, 2); /* 2 = outgoing from phone */
 				sub->ringing = 1;
 				break;
 			}
@@ -2759,7 +2765,7 @@
 			transmit_tone(s, SKINNY_ALERT, l->instance, sub->callid);
 			transmit_callstate(s, l->instance, SKINNY_PROGRESS, sub->callid);
 			transmit_displaypromptstatus(s, "Call Progress", 0, l->instance, sub->callid);
-			transmit_callinfo(s, ast->cid.cid_name, ast->cid.cid_num, ast->exten, ast->exten, l->instance, sub->callid, 2); /* 2 = outgoing from phone */
+			transmit_callinfo(s, ast->cid.cid_name, ast->cid.cid_num, exten, exten, l->instance, sub->callid, 2); /* 2 = outgoing from phone */
 			sub->progress = 1;
 			break;
 		}




More information about the svn-commits mailing list