summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2007-02-01 00:24:50 +0000
committerJoshua Colp <jcolp@digium.com>2007-02-01 00:24:50 +0000
commit493126cf0cdd73a87c1ced0228047da0dcb96c81 (patch)
treea9d05092c80289a7837d08a0d5be08a29cdaec14 /main
parentfa66a0bf039c175af505103e81ca2ee24a89f09e (diff)
Merged revisions 53052 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r53052 | file | 2007-01-31 18:24:20 -0600 (Wed, 31 Jan 2007) | 2 lines When going on hold have the side that was put on hold reinvite back to Asterisk. When going off hold have the side that was taken off hold reinvited back to the other party. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@53053 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main')
-rw-r--r--main/rtp.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/main/rtp.c b/main/rtp.c
index d0738e3a3..9bbab8abc 100644
--- a/main/rtp.c
+++ b/main/rtp.c
@@ -2832,7 +2832,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 */
@@ -2951,6 +2951,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 {