[asterisk-commits] branch 1.2 r14522 - /branches/1.2/channels/chan_zap.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Thu Mar 23 14:44:37 MST 2006


Author: mattf
Date: Thu Mar 23 15:44:36 2006
New Revision: 14522

URL: http://svn.digium.com/view/asterisk?rev=14522&view=rev
Log:
Fix SETUP_ACK handling so that we change channels if so requested

Modified:
    branches/1.2/channels/chan_zap.c

Modified: branches/1.2/channels/chan_zap.c
URL: http://svn.digium.com/view/asterisk/branches/1.2/channels/chan_zap.c?rev=14522&r1=14521&r2=14522&view=diff
==============================================================================
--- branches/1.2/channels/chan_zap.c (original)
+++ branches/1.2/channels/chan_zap.c Thu Mar 23 15:44:36 2006
@@ -9031,15 +9031,19 @@
 					ast_log(LOG_WARNING, "Received SETUP_ACKNOWLEDGE on unconfigured channel %d/%d span %d\n", 
 						PRI_SPAN(e->setup_ack.channel), PRI_CHANNEL(e->setup_ack.channel), pri->span);
 				} else {
-					ast_mutex_lock(&pri->pvts[chanpos]->lock);
-					pri->pvts[chanpos]->setup_ack = 1;
-					/* Send any queued digits */
-					for (x=0;x<strlen(pri->pvts[chanpos]->dialdest);x++) {
-						ast_log(LOG_DEBUG, "Sending pending digit '%c'\n", pri->pvts[chanpos]->dialdest[x]);
-						pri_information(pri->pri, pri->pvts[chanpos]->call, 
-							pri->pvts[chanpos]->dialdest[x]);
-					}
-					ast_mutex_unlock(&pri->pvts[chanpos]->lock);
+					chanpos = pri_fixup_principle(pri, chanpos, e->ring.call);
+					if (chanpos > -1) {
+						ast_mutex_lock(&pri->pvts[chanpos]->lock);
+						pri->pvts[chanpos]->setup_ack = 1;
+						/* Send any queued digits */
+						for (x=0;x<strlen(pri->pvts[chanpos]->dialdest);x++) {
+							ast_log(LOG_DEBUG, "Sending pending digit '%c'\n", pri->pvts[chanpos]->dialdest[x]);
+							pri_information(pri->pri, pri->pvts[chanpos]->call, 
+								pri->pvts[chanpos]->dialdest[x]);
+						}
+						ast_mutex_unlock(&pri->pvts[chanpos]->lock);
+					} else
+						ast_log(LOG_WARNING, "Unable to move channel %d!\n", e->setup_ack.channel);
 				}
 				break;
 			case PRI_EVENT_NOTIFY:



More information about the asterisk-commits mailing list