aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_skinny.c
diff options
context:
space:
mode:
authormvanbaak <mvanbaak@f38db490-d61c-443f-a65b-d21fe96a405b>2008-11-22 17:00:49 +0000
committermvanbaak <mvanbaak@f38db490-d61c-443f-a65b-d21fe96a405b>2008-11-22 17:00:49 +0000
commit85e6620f0a47f357e6da4b2426b45968c2884cb6 (patch)
treedbe6b5bc9fe73a465f21d2db6cfe4100a5e10001 /channels/chan_skinny.c
parent1c5456cbe6581d7b3453d98321b353a498e18f5b (diff)
Merged revisions 158694 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ........ r158694 | mvanbaak | 2008-11-22 17:57:11 +0100 (Sat, 22 Nov 2008) | 8 lines 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) ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.1@158701 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_skinny.c')
-rw-r--r--channels/chan_skinny.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/channels/chan_skinny.c b/channels/chan_skinny.c
index 2a16d0058..6ac36c9b5 100644
--- a/channels/chan_skinny.c
+++ b/channels/chan_skinny.c
@@ -3367,7 +3367,9 @@ static void *skinny_ss(void *data)
} 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);
@@ -3377,9 +3379,11 @@ static void *skinny_ss(void *data)
((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) {
@@ -3488,6 +3492,7 @@ static int skinny_hangup(struct ast_channel *ast)
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*/
if (AST_LIST_NEXT(sub, list)) {
transmit_lamp_indication(d, STIMULUS_LINE, l->instance, SKINNY_LAMP_BLINK);
@@ -3507,6 +3512,7 @@ static int skinny_hangup(struct ast_channel *ast)
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 */
}
}
@@ -4741,9 +4747,9 @@ static int handle_offhook_message(struct skinny_req *req, struct skinnysession *
if (sub && sub->outgoing) {
/* We're answering a ringing call */
ast_queue_control(sub->owner, AST_CONTROL_ANSWER);
- transmit_callstateonly(d, sub, SKINNY_CONNECTED);
+ transmit_callstate(d, l->instance, SKINNY_OFFHOOK, sub->callid);
transmit_tone(d, SKINNY_SILENCE, l->instance, sub->callid);
- transmit_callstate(d, l->instance, SKINNY_CONNECTED, sub->callid);
+ transmit_callstateonly(d, sub, SKINNY_CONNECTED);
transmit_selectsoftkeys(d, l->instance, sub->callid, KEYDEF_CONNECTED);
start_rtp(sub);
ast_setstate(sub->owner, AST_STATE_UP);