[asterisk-commits] branch crichter/0.3.0 r17107 - /team/crichter/0.3.0/channels/chan_zap.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Mon Apr 3 11:49:54 MST 2006


Author: crichter
Date: Mon Apr  3 13:49:51 2006
New Revision: 17107

URL: http://svn.digium.com/view/asterisk?rev=17107&view=rev
Log:
if the destination sends alerting instead of proceeding in hdlc mode we need to queue an answer anyway (read isn't called if they don't send frames, we may send frames but only when answered .. )

Modified:
    team/crichter/0.3.0/channels/chan_zap.c

Modified: team/crichter/0.3.0/channels/chan_zap.c
URL: http://svn.digium.com/view/asterisk/team/crichter/0.3.0/channels/chan_zap.c?rev=17107&r1=17106&r2=17107&view=diff
==============================================================================
--- team/crichter/0.3.0/channels/chan_zap.c (original)
+++ team/crichter/0.3.0/channels/chan_zap.c Mon Apr  3 13:49:51 2006
@@ -4493,6 +4493,7 @@
 	}
 	
 	if (p->subs[index].needanswer) {
+		ast_log(LOG_NOTICE,"Sending Answer\n");
 		/* Send answer frame if requested */
 		p->subs[index].needanswer = 0;
 		p->subs[index].f.frametype = AST_FRAME_CONTROL;
@@ -8825,6 +8826,7 @@
 					chanpos = -1;
 				}
 				if (chanpos > -1) {
+					struct ast_frame f = { AST_FRAME_CONTROL, };
 					chanpos = pri_fixup_principle(pri, chanpos, e->answer.call);
 					if (chanpos < 0) {
 						ast_log(LOG_WARNING, "Answer requested on channel %d/%d not in use on span %d\n", 
@@ -8863,9 +8865,17 @@
 						} else if (pri->pvts[chanpos]->confirmanswer) {
 							ast_log(LOG_DEBUG, "Waiting on answer confirmation on channel %d!\n", pri->pvts[chanpos]->channel);
 						} else {
+							if (pri->pvts[chanpos]->hdlc) {
+							ast_log(LOG_NOTICE,"HDLC based call need no ringing but answer\n");
+							pri->pvts[chanpos]->subs[SUB_REAL].needringing=0;
+							f.subclass = AST_CONTROL_ANSWER;
+							zap_queue_frame(pri->pvts[chanpos], &f, pri);
+							} else {
 							pri->pvts[chanpos]->subs[SUB_REAL].needanswer =1;
 							/* Enable echo cancellation if it's not on already */
 							zt_enable_ec(pri->pvts[chanpos]);
+							}
+
 						}
 
 #ifdef SUPPORT_USERUSER



More information about the asterisk-commits mailing list