[asterisk-commits] file: branch 1.4 r53052 - /branches/1.4/main/rtp.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Wed Jan 31 17:24:20 MST 2007


Author: file
Date: Wed Jan 31 18:24:20 2007
New Revision: 53052

URL: http://svn.digium.com/view/asterisk?view=rev&rev=53052
Log:
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.

Modified:
    branches/1.4/main/rtp.c

Modified: branches/1.4/main/rtp.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/main/rtp.c?view=diff&rev=53052&r1=53051&r2=53052
==============================================================================
--- branches/1.4/main/rtp.c (original)
+++ branches/1.4/main/rtp.c Wed Jan 31 18:24:20 2007
@@ -2746,7 +2746,7 @@
 	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 @@
 			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 {



More information about the asterisk-commits mailing list