]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
When going on hold have the side that was put on hold reinvite back to Asterisk....
authorJoshua Colp <jcolp@digium.com>
Thu, 1 Feb 2007 00:24:20 +0000 (00:24 +0000)
committerJoshua Colp <jcolp@digium.com>
Thu, 1 Feb 2007 00:24:20 +0000 (00:24 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@53052 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/rtp.c

index fdf4ed68ff281d56ca41e6b515e6fd4c9d9d0524..01b9e756de43c13fd6449b3bbfcd19a483c1ae83 100644 (file)
@@ -2746,7 +2746,7 @@ static enum ast_bridge_result bridge_native_loop(struct ast_channel *c0, struct
        int oldcodec0 = codec0, oldcodec1 = codec1;
        struct sockaddr_in ac1 = {0,}, vac1 = {0,}, ac0 = {0,}, vac0 = {0,};
        struct sockaddr_in t1 = {0,}, vt1 = {0,}, t0 = {0,}, vt0 = {0,};
-
+       
        /* Set it up so audio goes directly between the two endpoints */
 
        /* Test the first channel */
@@ -2864,6 +2864,19 @@ static enum ast_bridge_result bridge_native_loop(struct ast_channel *c0, struct
                        if ((fr->subclass == AST_CONTROL_HOLD) ||
                            (fr->subclass == AST_CONTROL_UNHOLD) ||
                            (fr->subclass == AST_CONTROL_VIDUPDATE)) {
+                               if (fr->subclass == AST_CONTROL_HOLD) {
+                                       /* If we someone went on hold we want the other side to reinvite back to us */
+                                       if (who == c0)
+                                               pr1->set_rtp_peer(c1, NULL, NULL, 0, 0);
+                                       else
+                                               pr0->set_rtp_peer(c0, NULL, NULL, 0, 0);
+                               } else if (fr->subclass == AST_CONTROL_UNHOLD) {
+                                       /* If they went off hold they should go back to being direct */
+                                       if (who == c0)
+                                               pr1->set_rtp_peer(c1, p0, vp0, codec0, ast_test_flag(p0, FLAG_NAT_ACTIVE));
+                                       else
+                                               pr0->set_rtp_peer(c0, p1, vp1, codec1, ast_test_flag(p1, FLAG_NAT_ACTIVE));
+                               }
                                ast_indicate_data(other, fr->subclass, fr->data, fr->datalen);
                                ast_frfree(fr);
                        } else {