[svn-commits] oej: branch oej/earlyrtpfix r47926 - in /team/oej/earlyrtpfix: apps/ channels...

svn-commits at lists.digium.com svn-commits at lists.digium.com
Wed Nov 22 05:43:53 MST 2006


Author: oej
Date: Wed Nov 22 06:43:52 2006
New Revision: 47926

URL: http://svn.digium.com/view/asterisk?view=rev&rev=47926
Log:
Peeking into the peer so that we can generate a proper 200 OK based on the peer's capabilities,
not our capabilities. The current behaviour breaks direct RTP setups.

Modified:
    team/oej/earlyrtpfix/apps/app_dial.c
    team/oej/earlyrtpfix/channels/chan_sip.c
    team/oej/earlyrtpfix/include/asterisk/channel.h

Modified: team/oej/earlyrtpfix/apps/app_dial.c
URL: http://svn.digium.com/view/asterisk/team/oej/earlyrtpfix/apps/app_dial.c?view=diff&rev=47926&r1=47925&r2=47926
==============================================================================
--- team/oej/earlyrtpfix/apps/app_dial.c (original)
+++ team/oej/earlyrtpfix/apps/app_dial.c Wed Nov 22 06:43:52 2006
@@ -579,6 +579,8 @@
 							       DIAL_NOFORWARDHTML);
 						ast_copy_string(c->dialcontext, "", sizeof(c->dialcontext));
 						ast_copy_string(c->exten, "", sizeof(c->exten));
+						/* Make sure the caller is aware of the formats of the callee */
+						in->peernativeformats = c->nativeformats;
 						/* Setup RTP early bridge if appropriate */
 						ast_rtp_early_bridge(in, peer);
 					}

Modified: team/oej/earlyrtpfix/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/oej/earlyrtpfix/channels/chan_sip.c?view=diff&rev=47926&r1=47925&r2=47926
==============================================================================
--- team/oej/earlyrtpfix/channels/chan_sip.c (original)
+++ team/oej/earlyrtpfix/channels/chan_sip.c Wed Nov 22 06:43:52 2006
@@ -3407,8 +3407,19 @@
 			if (option_debug > 1)
 				ast_log(LOG_DEBUG,"T38State change to %d on channel %s\n", p->t38.state, ast->name);
 			res = transmit_response_with_t38_sdp(p, "200 OK", &p->initreq, XMIT_CRITICAL);
-		} else 
+		} else  {
+			char buf[BUFSIZ];
+			if (option_debug > 2) {
+				if (ast->peernativeformats)
+					ast_log(LOG_DEBUG, "*** Peer native formats: %s\n", ast_getformatname_multiple(buf, sizeof(buf), ast->peernativeformats));
+				else
+					ast_log(LOG_DEBUG, "*** No peer native formats\n");
+				ast_log(LOG_DEBUG, "*** Our native formats: %s\n", ast_getformatname_multiple(buf, sizeof(buf), ast->nativeformats));
+			
+			}
 			res = transmit_response_with_sdp(p, "200 OK", &p->initreq, XMIT_CRITICAL);
+			
+		}
 	}
 	ast_mutex_unlock(&p->lock);
 	return res;

Modified: team/oej/earlyrtpfix/include/asterisk/channel.h
URL: http://svn.digium.com/view/asterisk/team/oej/earlyrtpfix/include/asterisk/channel.h?view=diff&rev=47926&r1=47925&r2=47926
==============================================================================
--- team/oej/earlyrtpfix/include/asterisk/channel.h (original)
+++ team/oej/earlyrtpfix/include/asterisk/channel.h Wed Nov 22 06:43:52 2006
@@ -419,6 +419,7 @@
 	struct ast_trans_pvt *readtrans;		/*!< Read translation path */
 	int rawreadformat;				/*!< Raw read format */
 	int rawwriteformat;				/*!< Raw write format */
+	int peernativeformats;				/*!< If we have a bridged peer, this is their formats */
 
 	struct ast_channel_spy_list *spies;		/*!< Chan Spy stuff */
 	struct ast_channel_whisper_buffer *whisper;	/*!< Whisper Paging buffer */



More information about the svn-commits mailing list