]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Minor backport of revision 59083 in trunk. Don't queue an unhold frame up if the...
authorJoshua Colp <jcolp@digium.com>
Mon, 7 May 2007 21:26:58 +0000 (21:26 +0000)
committerJoshua Colp <jcolp@digium.com>
Mon, 7 May 2007 21:26:58 +0000 (21:26 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@63283 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_sip.c

index 78d2ecd5f87c067501904ccb09ab82c1c42b8586..7b68cc27f108cd5a84e12f5f1bb26e4e3b2f417a 100644 (file)
@@ -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 */