From 3db7711a63c69d8d6286f3f0cdeee854d3b9fe85 Mon Sep 17 00:00:00 2001 From: Damien Wedhorn Date: Mon, 21 Jan 2013 06:27:24 +0000 Subject: [PATCH] Fix device call logging issues in skinny Skinny device call logging (ie missed, place and received calls) has issues because the incorrect sequence of callstates is/can be sent to the device. This patch removes some extra callstate updates driven by forces external to skinny and ensures the needed intermediary callstate messages are sent. (closes issue ASTERISK-20964) Reported by: wedhorn Tested by: snuffy, myself Patches: ast11-skinny-calllog01.diff uploaded by wedhorn (license 5019) git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@379677 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- channels/chan_skinny.c | 25 ++++++------------------- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/channels/chan_skinny.c b/channels/chan_skinny.c index fd67706bae..c7015300b4 100644 --- a/channels/chan_skinny.c +++ b/channels/chan_skinny.c @@ -3108,25 +3108,6 @@ static void update_connectedline(struct skinny_subchannel *sub, const void *data SKINNY_DEBUG(DEBUG_SUB, 3, "Sub %d - Updating\n", sub->callid); send_callinfo(sub); - if (ast_channel_state(sub->owner) == AST_STATE_UP) { - transmit_callstate(d, l->instance, sub->callid, SKINNY_CONNECTED); - transmit_displaypromptstatus(d, "Connected", 0, l->instance, sub->callid); - } else { - if (sub->calldirection == SKINNY_INCOMING) { - transmit_callstate(d, l->instance, sub->callid, SKINNY_RINGIN); - transmit_displaypromptstatus(d, "Ring-In", 0, l->instance, sub->callid); - } else { - if (!sub->ringing) { - transmit_callstate(d, l->instance, sub->callid, SKINNY_RINGOUT); - transmit_displaypromptstatus(d, "Ring-Out", 0, l->instance, sub->callid); - sub->ringing = 1; - } else { - transmit_callstate(d, l->instance, sub->callid, SKINNY_PROGRESS); - transmit_displaypromptstatus(d, "Call Progress", 0, l->instance, sub->callid); - sub->progress = 1; - } - } - } } static void mwi_event_cb(const struct ast_event *event, void *userdata) @@ -5235,6 +5216,9 @@ static void setsubstate(struct skinny_subchannel *sub, int state) ast_log(LOG_WARNING, "Cannot set substate to SUBSTATE_RINGOUT from %s (on call-%d)\n", substate2str(sub->substate), sub->callid); return; } + if (sub->substate != SUBSTATE_PROGRESS) { + transmit_callstate(d, l->instance, sub->callid, SKINNY_PROGRESS); + } if (!d->earlyrtp) { transmit_start_tone(d, SKINNY_ALERT, l->instance, sub->callid); @@ -5278,6 +5262,9 @@ static void setsubstate(struct skinny_subchannel *sub, int state) sub->substate = SUBSTATE_CALLWAIT; break; case SUBSTATE_CONNECTED: + if (sub->substate == SUBSTATE_RINGIN) { + transmit_callstate(d, l->instance, sub->callid, SKINNY_OFFHOOK); + } if (sub->substate == SUBSTATE_HOLD) { ast_queue_control(sub->owner, AST_CONTROL_UNHOLD); transmit_connect(d, sub); -- 2.47.2