Since chan_sip is callback devicestate driven do not pass in actual states, pass in unknown so we get asked. Additionally do not pass in an actual device state value in ast_setstate since the channel may be callback driven.

(closes issue #13525)
Reported by: pj


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@163579 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Joshua Colp
2008-12-12 16:55:15 +00:00
parent 9b745b9883
commit 035a7552d6
2 changed files with 10 additions and 5 deletions

View File

@@ -4170,7 +4170,12 @@ int ast_setstate(struct ast_channel *chan, enum ast_channel_state state)
}
chan->_state = state;
ast_devstate_changed_literal(ast_state_chan2dev(state), name);
/* We have to pass AST_DEVICE_UNKNOWN here because it is entirely possible that the channel driver
* for this channel is using the callback method for device state. If we pass in an actual state here
* we override what they are saying the state is and things go amuck. */
ast_devstate_changed_literal(AST_DEVICE_UNKNOWN, name);
/* setstate used to conditionally report Newchannel; this is no more */
manager_event(EVENT_FLAG_CALL,
"Newstate",