From 29c90c2fa09603e313d5ccc5bb0500454cdbc50e Mon Sep 17 00:00:00 2001 From: Olle Johansson Date: Tue, 15 Apr 2008 20:26:05 +0000 Subject: [PATCH] Handle subscribe queues in all situations... Thanks to festr_ on irc for telling me about this bug. git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114148 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- channels/chan_sip.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 03f5ae091d..0f13438770 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -12973,7 +12973,12 @@ static void handle_response(struct sip_pvt *p, int resp, char *rest, struct sip_ /* ast_queue_hangup(p->owner); Disabled */ } else { if (!p->subscribed && !p->refer) - ast_set_flag(&p->flags[0], SIP_NEEDDESTROY); + ast_set_flag(&p->flags[0], SIP_NEEDDESTROY); + if (ast_test_flag(&p->flags[1], SIP_PAGE2_STATECHANGEQUEUE)) { + /* Ready to send the next state we have on queue */ + ast_clear_flag(&p->flags[1], SIP_PAGE2_STATECHANGEQUEUE); + cb_extensionstate((char *)p->context, (char *)p->exten, p->laststate, (void *) p); + } } } else if (sipmethod == SIP_BYE) ast_set_flag(&p->flags[0], SIP_NEEDDESTROY);