[asterisk-commits] jrose: trunk r336311 - in /trunk: ./ channels/ include/asterisk/ main/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Sep 16 16:20:05 CDT 2011


Author: jrose
Date: Fri Sep 16 16:20:02 2011
New Revision: 336311

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=336311
Log:
Merged revisions 336307 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/10

................
  r336307 | jrose | 2011-09-16 16:09:20 -0500 (Fri, 16 Sep 2011) | 20 lines
  
  Merged revisions 336294 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.8
  
  ........
    r336294 | jrose | 2011-09-16 14:53:40 -0500 (Fri, 16 Sep 2011) | 13 lines
    
    Fix bad RTP media bridges in directmedia calls on peers separated by multiple Asterisk nodes.
    
    In a situation involving devices on separate Asterisk trunks, the remote RTP bridge would
    break when starting a call with directmedia. This patch queues a new type of control frame
    so that our RTP bridge loop can properly detect when these situations occur and check to see
    if peers need to be updated in order to send their media to the proper location.
    
    (Closes issue ASTERISK-18340)
    Reported by: Thomas Arimont
    (Closes issue ASTERISK-17725)
    Reported by: kwk
    Tested by: twilson, jrose
  ........
................

Modified:
    trunk/   (props changed)
    trunk/channels/chan_sip.c
    trunk/include/asterisk/frame.h
    trunk/main/channel.c
    trunk/main/rtp_engine.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-10-merged' - no diff available.

Modified: trunk/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/trunk/channels/chan_sip.c?view=diff&rev=336311&r1=336310&r2=336311
==============================================================================
--- trunk/channels/chan_sip.c (original)
+++ trunk/channels/chan_sip.c Fri Sep 16 16:20:02 2011
@@ -20141,7 +20141,7 @@
 						"Channel: %s\r\nChanneltype: %s\r\nUniqueid: %s\r\nSIPcallid: %s\r\nSIPfullcontact: %s\r\nPeername: %s\r\n",
 						p->owner->name, "SIP", p->owner->uniqueid, p->callid, p->fullcontact, p->peername);
 			} else {	/* RE-invite */
-				ast_queue_frame(p->owner, &ast_null_frame);
+				ast_queue_control(p->owner, AST_CONTROL_UPDATE_RTP_PEER);
 			}
 		} else {
 			 /* It's possible we're getting an 200 OK after we've tried to disconnect
@@ -23024,6 +23024,7 @@
 				} else {
 					ast_set_flag(&p->flags[1], SIP_PAGE2_DIALOG_ESTABLISHED);
 					transmit_response_with_sdp(p, "200 OK", req, (reinvite ? XMIT_RELIABLE : (req->ignore ?  XMIT_UNRELIABLE : XMIT_CRITICAL)), p->session_modify == TRUE ? FALSE : TRUE, FALSE);
+					ast_queue_control(p->owner, AST_CONTROL_UPDATE_RTP_PEER);
 				}
 			}
 
@@ -29286,7 +29287,7 @@
 		memset(&p->tredirip, 0, sizeof(p->tredirip));
 		changed = 1;
 	}
-	if (cap && !(ast_format_cap_is_empty(cap) && !(ast_format_cap_identical(p->redircaps, cap)))) {
+	if (cap && !ast_format_cap_is_empty(cap) && !ast_format_cap_identical(p->redircaps, cap)) {
 		ast_format_cap_copy(p->redircaps, cap);
 		changed = 1;
 	}

Modified: trunk/include/asterisk/frame.h
URL: http://svnview.digium.com/svn/asterisk/trunk/include/asterisk/frame.h?view=diff&rev=336311&r1=336310&r2=336311
==============================================================================
--- trunk/include/asterisk/frame.h (original)
+++ trunk/include/asterisk/frame.h Fri Sep 16 16:20:02 2011
@@ -265,6 +265,7 @@
 	AST_CONTROL_END_OF_Q = 29,		/*!< Indicate that this position was the end of the channel queue for a softhangup. */
 	AST_CONTROL_INCOMPLETE = 30,	/*!< Indication that the extension dialed is incomplete */
 	AST_CONTROL_MCID = 31,			/*!< Indicate that the caller is being malicious. */
+	AST_CONTROL_UPDATE_RTP_PEER = 32, /*!< Interrupt the bridge and have it update the peer */
 };
 
 enum ast_frame_read_action {

Modified: trunk/main/channel.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/channel.c?view=diff&rev=336311&r1=336310&r2=336311
==============================================================================
--- trunk/main/channel.c (original)
+++ trunk/main/channel.c Fri Sep 16 16:20:02 2011
@@ -4345,6 +4345,7 @@
 	case AST_CONTROL_AOC:
 	case AST_CONTROL_END_OF_Q:
 	case AST_CONTROL_MCID:
+	case AST_CONTROL_UPDATE_RTP_PEER:
 		break;
 
 	case AST_CONTROL_INCOMPLETE:
@@ -4533,6 +4534,7 @@
 	case AST_CONTROL_AOC:
 	case AST_CONTROL_END_OF_Q:
 	case AST_CONTROL_MCID:
+	case AST_CONTROL_UPDATE_RTP_PEER:
 		/* Nothing left to do for these. */
 		res = 0;
 		break;

Modified: trunk/main/rtp_engine.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/rtp_engine.c?view=diff&rev=336311&r1=336310&r2=336311
==============================================================================
--- trunk/main/rtp_engine.c (original)
+++ trunk/main/rtp_engine.c Fri Sep 16 16:20:02 2011
@@ -1158,7 +1158,8 @@
 			    (fr->subclass.integer == AST_CONTROL_UNHOLD) ||
 			    (fr->subclass.integer == AST_CONTROL_VIDUPDATE) ||
 			    (fr->subclass.integer == AST_CONTROL_SRCUPDATE) ||
-			    (fr->subclass.integer == AST_CONTROL_T38_PARAMETERS)) {
+			    (fr->subclass.integer == AST_CONTROL_T38_PARAMETERS) ||
+				(fr->subclass.integer == AST_CONTROL_UPDATE_RTP_PEER)) {
 				if (fr->subclass.integer == AST_CONTROL_HOLD) {
 					/* If we someone went on hold we want the other side to reinvite back to us */
 					if (who == c0) {
@@ -1166,8 +1167,10 @@
 					} else {
 						glue0->update_peer(c0, NULL, NULL, NULL, 0, 0);
 					}
-				} else if (fr->subclass.integer == AST_CONTROL_UNHOLD) {
-					/* If they went off hold they should go back to being direct */
+				} else if (fr->subclass.integer == AST_CONTROL_UNHOLD ||
+					fr->subclass.integer == AST_CONTROL_UPDATE_RTP_PEER) {
+					/* If they went off hold they should go back to being direct, or if we have
+					 * been told to force a peer update, go ahead and do it. */
 					if (who == c0) {
 						glue1->update_peer(c1, instance0, vinstance0, tinstance0, cap0, 0);
 					} else {
@@ -1193,7 +1196,10 @@
 					glue0->get_codec(c1, cap1);
 					ast_format_cap_append(oldcap1, cap1);
 				}
-				ast_indicate_data(other, fr->subclass.integer, fr->data.ptr, fr->datalen);
+				/* Since UPDATE_BRIDGE_PEER is only used by the bridging code, don't forward it */
+				if (fr->subclass.integer != AST_CONTROL_UPDATE_RTP_PEER) {
+					ast_indicate_data(other, fr->subclass.integer, fr->data.ptr, fr->datalen);
+				}
 				ast_frfree(fr);
 			} else if (fr->subclass.integer == AST_CONTROL_CONNECTED_LINE) {
 				if (ast_channel_connected_line_macro(who, other, fr, other == c0, 1)) {




More information about the asterisk-commits mailing list