From: Joshua Colp Date: Mon, 7 May 2007 21:26:58 +0000 (+0000) Subject: Minor backport of revision 59083 in trunk. Don't queue an unhold frame up if the... X-Git-Tag: 1.4.5~218 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b50b92ab77571fe5c6debed003f2b3bf05a72b91;p=thirdparty%2Fasterisk.git Minor backport of revision 59083 in trunk. Don't queue an unhold frame up if the call was never on hold to begin with. git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@63283 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 78d2ecd5f8..7b68cc27f1 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -5234,7 +5234,7 @@ static int process_sdp(struct sip_pvt *p, struct sip_request *req) ast_set_write_format(p->owner, p->owner->writeformat); } - if (sin.sin_addr.s_addr && (!sendonly || sendonly == -1)) { + if (ast_test_flag(&p->flags[1], SIP_PAGE2_CALL_ONHOLD) && sin.sin_addr.s_addr && (!sendonly || sendonly == -1)) { ast_queue_control(p->owner, AST_CONTROL_UNHOLD); /* Activate a re-invite */ ast_queue_frame(p->owner, &ast_null_frame); @@ -5250,18 +5250,16 @@ static int process_sdp(struct sip_pvt *p, struct sip_request *req) } /* Manager Hold and Unhold events must be generated, if necessary */ - if (sin.sin_addr.s_addr && (!sendonly || sendonly == -1)) { - if (ast_test_flag(&p->flags[1], SIP_PAGE2_CALL_ONHOLD)) { - append_history(p, "Unhold", "%s", req->data); - if (global_callevents) - manager_event(EVENT_FLAG_CALL, "Unhold", - "Channel: %s\r\n" - "Uniqueid: %s\r\n", - p->owner->name, - p->owner->uniqueid); - if (global_notifyhold) - sip_peer_hold(p, 0); - } + if (ast_test_flag(&p->flags[1], SIP_PAGE2_CALL_ONHOLD) && sin.sin_addr.s_addr && (!sendonly || sendonly == -1)) { + append_history(p, "Unhold", "%s", req->data); + if (global_callevents) + manager_event(EVENT_FLAG_CALL, "Unhold", + "Channel: %s\r\n" + "Uniqueid: %s\r\n", + p->owner->name, + p->owner->uniqueid); + if (global_notifyhold) + sip_peer_hold(p, 0); ast_clear_flag(&p->flags[1], SIP_PAGE2_CALL_ONHOLD); /* Clear both flags */ } else if (!sin.sin_addr.s_addr || sendonly ) { /* No address for RTP, we're on hold */