[asterisk-commits] mvanbaak: trunk r158694 - /trunk/channels/chan_skinny.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sat Nov 22 10:57:12 CST 2008


Author: mvanbaak
Date: Sat Nov 22 10:57:11 2008
New Revision: 158694

URL: http://svn.digium.com/view/asterisk?view=rev&rev=158694
Log:
dont send reorder tone after a device is hungup if a dialout is abandoned or failed.
Without this reorder tone will play after hangup and both wedhorn's and my wife have threatened to use an axe on our asterisk box

(closes issue #13948)
Reported by: wedhorn
Patches:
	switch.diff uploaded by wedhorn (license 30)

Modified:
    trunk/channels/chan_skinny.c

Modified: trunk/channels/chan_skinny.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_skinny.c?view=diff&rev=158694&r1=158693&r2=158694
==============================================================================
--- trunk/channels/chan_skinny.c (original)
+++ trunk/channels/chan_skinny.c Sat Nov 22 10:57:11 2008
@@ -3180,7 +3180,9 @@
 		} else if (res == 0) {
 			ast_debug(1, "Not enough digits (%s) (and no ambiguous match)...\n", d->exten);
 			memset(d->exten, 0, sizeof(d->exten));
-			transmit_tone(d, SKINNY_REORDER, l->instance, sub->callid);
+			if (l->hookstate == SKINNY_OFFHOOK) {
+				transmit_tone(d, SKINNY_REORDER, l->instance, sub->callid);
+			}
 			if (sub->owner && sub->owner->_state != AST_STATE_UP) {
 				ast_indicate(c, -1);
 				ast_hangup(c);
@@ -3190,9 +3192,11 @@
 			   ((d->exten[0] != '*') || (!ast_strlen_zero(d->exten) > 2))) {
 			ast_log(LOG_WARNING, "Can't match [%s] from '%s' in context %s\n", d->exten, c->cid.cid_num ? c->cid.cid_num : "<Unknown Caller>", c->context);
 			memset(d->exten, 0, sizeof(d->exten));
-			transmit_tone(d, SKINNY_REORDER, l->instance, sub->callid);
-			/* hang out for 3 seconds to let congestion play */
-			ast_safe_sleep(c, 3000);
+			if (l->hookstate == SKINNY_OFFHOOK) {
+				transmit_tone(d, SKINNY_REORDER, l->instance, sub->callid);
+				/* hang out for 3 seconds to let congestion play */
+				ast_safe_sleep(c, 3000);
+			}
 			break;
 		}
 		if (!timeout) {
@@ -3312,6 +3316,7 @@
 				transmit_closereceivechannel(d, sub);
 				transmit_stopmediatransmission(d, sub);
 				transmit_lamp_indication(d, STIMULUS_LINE, l->instance, SKINNY_LAMP_BLINK);
+				transmit_tone(d, SKINNY_SILENCE, l->instance, sub->callid);
 			} else {    /* we are killing a background sub on the line with other subs*/
 				ast_verb(4,"Killing inactive sub %d\n", sub->callid);
 				if (AST_LIST_NEXT(sub, list)) {
@@ -3332,6 +3337,7 @@
 				transmit_stopmediatransmission(d, sub);
 				transmit_speaker_mode(d, SKINNY_SPEAKEROFF);
 				transmit_ringer_mode(d, SKINNY_RING_OFF);
+				transmit_tone(d, SKINNY_SILENCE, l->instance, sub->callid);
 				/* we should check to see if we can start the ringer if another line is ringing */
 			}
 		}
@@ -4579,9 +4585,9 @@
 	if (sub && sub->outgoing) {
 		/* We're answering a ringing call */
 		ast_queue_control(sub->owner, AST_CONTROL_ANSWER);
+		transmit_callstate(d, l->instance, SKINNY_OFFHOOK, sub->callid);
+		transmit_tone(d, SKINNY_SILENCE, l->instance, sub->callid);
 		transmit_callstateonly(d, sub, SKINNY_CONNECTED);
-		transmit_tone(d, SKINNY_SILENCE, l->instance, sub->callid);
-		transmit_callstate(d, l->instance, SKINNY_CONNECTED, sub->callid);
 		transmit_selectsoftkeys(d, l->instance, sub->callid, KEYDEF_CONNECTED);
 		start_rtp(sub);
 		ast_setstate(sub->owner, AST_STATE_UP);




More information about the asterisk-commits mailing list