aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjpeeler <jpeeler@f38db490-d61c-443f-a65b-d21fe96a405b>2010-02-04 23:20:21 +0000
committerjpeeler <jpeeler@f38db490-d61c-443f-a65b-d21fe96a405b>2010-02-04 23:20:21 +0000
commit754e06269f84b07dc1afc367acd60006b94ae358 (patch)
treed640b94d99e1ec8706874801cecb6924d7965296
parent142f1fa5c5bc6b4fbe553819378520341c86171e (diff)
Change channel state on local channels for busy,answer,ring.
Previously local channels channel state never changed. This became problematic when the state of the other side of the local channel was lost, for example during a masquerade. Changing the state of the local channel allows for the scenario to be detected when the channel state is set to ringing, but the peer isn't ringing. The specific problem scenario is described in 164201. Although this was noted on one of the issues, here is the tested dialplan verified to work: exten => 9700,1,Dial(Local/*9700@default&Local/#9700@default) exten => *9700,1,Set(GLOBAL(TESTCHAN)=${CHANNEL:0:${MATH(${LEN(${CHANNEL})}-1):0:2}}1) exten => *9700,n,wait(3) ;3 works, 1 did not exten => *9700,n,Dial(SIP/5001) exten => #9700,1,Wait(1) ;1 works, 3 did not exten => #9700,n,ChannelRedirect(${TESTCHAN},parkedcalls,701,1) (closes issue #14992) Reported by: davidw git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@244785 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--channels/chan_local.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/channels/chan_local.c b/channels/chan_local.c
index b39aeccd1..410151f1a 100644
--- a/channels/chan_local.c
+++ b/channels/chan_local.c
@@ -212,6 +212,38 @@ static int local_queue_frame(struct local_pvt *p, int isoutbound, struct ast_fra
}
if (other) {
+ if (f->frametype == AST_FRAME_CONTROL) {
+ switch (f->subclass) {
+ case AST_CONTROL_RINGING:
+ ast_setstate(other, AST_STATE_RINGING);
+ break;
+ case AST_CONTROL_ANSWER:
+ ast_setstate(other, AST_STATE_UP);
+ break;
+ case AST_CONTROL_BUSY:
+ ast_setstate(other, AST_STATE_BUSY);
+ break;
+
+ /* not going to handle these */
+ case AST_CONTROL_HANGUP:
+ case AST_CONTROL_RING:
+ case AST_CONTROL_TAKEOFFHOOK:
+ case AST_CONTROL_OFFHOOK:
+ case AST_CONTROL_CONGESTION:
+ case AST_CONTROL_FLASH:
+ case AST_CONTROL_WINK:
+ case AST_CONTROL_OPTION:
+ case AST_CONTROL_RADIO_KEY:
+ case AST_CONTROL_RADIO_UNKEY:
+ case AST_CONTROL_PROGRESS:
+ case AST_CONTROL_PROCEEDING:
+ case AST_CONTROL_HOLD:
+ case AST_CONTROL_UNHOLD:
+ case AST_CONTROL_VIDUPDATE:
+ case AST_CONTROL_SRCUPDATE:
+ break;
+ }
+ }
ast_queue_frame(other, f);
ast_channel_unlock(other);
}