summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Wedhorn <voip@facts.com.au>2013-01-21 07:26:04 +0000
committerDamien Wedhorn <voip@facts.com.au>2013-01-21 07:26:04 +0000
commitff32e094e54e4749380d08f11dd380e60f146593 (patch)
tree97a42bf7f04c0aac1637ec89cedb9710c351ea44
parent08e6ae82a6a994ab3432c72d76cf598efd272c2d (diff)
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) ........ Merged revisions 379677 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@379678 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-rw-r--r--channels/chan_skinny.c25
1 files changed, 6 insertions, 19 deletions
diff --git a/channels/chan_skinny.c b/channels/chan_skinny.c
index 01ed1b3e8..570bf2877 100644
--- a/channels/chan_skinny.c
+++ b/channels/chan_skinny.c
@@ -3125,25 +3125,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)
@@ -5265,6 +5246,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);
@@ -5308,6 +5292,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);