[asterisk-commits] may: branch may/ooh323_ipv6_direct_rtp r307716 - /team/may/ooh323_ipv6_direct...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sun Feb 13 04:54:58 CST 2011


Author: may
Date: Sun Feb 13 04:54:54 2011
New Revision: 307716

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=307716
Log:
add configuration parameters for directrtp

Modified:
    team/may/ooh323_ipv6_direct_rtp/addons/chan_ooh323.c

Modified: team/may/ooh323_ipv6_direct_rtp/addons/chan_ooh323.c
URL: http://svnview.digium.com/svn/asterisk/team/may/ooh323_ipv6_direct_rtp/addons/chan_ooh323.c?view=diff&rev=307716&r1=307715&r2=307716
==============================================================================
--- team/may/ooh323_ipv6_direct_rtp/addons/chan_ooh323.c (original)
+++ team/may/ooh323_ipv6_direct_rtp/addons/chan_ooh323.c Sun Feb 13 04:54:54 2011
@@ -187,6 +187,7 @@
 	int amaflags;
 	int progsent;			/* progress is sent */
 	int alertsent;			/* alerting is sent */
+	int directrtp;			/* direct rtp */
 	struct ast_dsp *vad;
 	struct OOH323Regex *rtpmask;	/* rtp ip regexp */
 	char rtpmaskstr[120];
@@ -219,6 +220,7 @@
 	char	    rtpmaskstr[120];
 	int	    rtdrcount, rtdrinterval;
 	int	    faststart, h245tunneling;
+	int	    directrtp;
 	struct ooh323_user *next;
 };
 
@@ -247,6 +249,7 @@
 	char	    rtpmaskstr[120];
 	int	    rtdrcount,rtdrinterval;
 	int	    faststart, h245tunneling;
+	int	    directrtp;
 	struct ooh323_peer *next;
 };
 
@@ -304,6 +307,7 @@
 static int  gTunneling = 1;
 static int  gBeMaster = 0;
 static int  gMediaWaitForConnect = 0;
+static int  gDirectRTP = 0;
 static int  gTOS = 0;
 static int  gRTPTimeout = 60;
 static char gAccountcode[80] = DEFAULT_H323ACCNT;
@@ -611,6 +615,7 @@
 		p->rtptimeout = peer->rtptimeout;
 		p->faststart = peer->faststart;
 		p->h245tunneling = peer->h245tunneling;
+		p->directrtp = peer->directrtp;
 		if (peer->rtpmask && peer->rtpmaskstr[0]) {
 			p->rtpmask = peer->rtpmask;
 			ast_copy_string(p->rtpmaskstr, peer->rtpmaskstr, sizeof(p->rtpmaskstr));
@@ -642,6 +647,7 @@
 		p->rtdrcount = gRTDRCount;
 		p->faststart = gFastStart;
 		p->h245tunneling = gTunneling;
+		p->directrtp = gDirectRTP;
 
 		memcpy(&p->prefs, &gPrefs, sizeof(struct ast_codec_pref));
 		p->username = strdup(dest);
@@ -1747,6 +1753,7 @@
 		p->rtptimeout = user->rtptimeout;
 		p->h245tunneling = user->h245tunneling;
 		p->faststart = user->faststart;
+		p->directrtp = gDirectRTP;
 
 		if (p->faststart)
          		OO_SETFLAG(call->flags, OO_M_FASTSTART);
@@ -1773,6 +1780,7 @@
 	} else {
 	 if (!OO_TESTFLAG(p->flags,H323_DISABLEGK)) {
 		p->username = strdup(call->remoteIP);
+		p->directrtp = gDirectRTP;
 	} else {
 	  ast_mutex_unlock(&p->lock);
 	  ast_log(LOG_ERROR, "Unacceptable ip %s\n", call->remoteIP);
@@ -2186,6 +2194,7 @@
 		user->t38support = gT38Support;
 		user->faststart = gFastStart;
 		user->h245tunneling = gTunneling;
+		user->directrtp = gDirectRTP;
 		/* set default context */
 		ast_copy_string(user->context, gContext, sizeof(user->context));
 		ast_copy_string(user->accountcode, gAccountcode, sizeof(user->accountcode));
@@ -2207,6 +2216,8 @@
 				user->faststart = ast_true(v->value);
 			} else if (!strcasecmp(v->name, "h245tunneling")) {
 				user->h245tunneling = ast_true(v->value);
+			} else if (!strcasecmp(v->name, "directrtp") || !strcasecmp(v->name, "directmedia")) {
+				user->directrtp = ast_true(v->value);
 			} else if (!strcasecmp(v->name, "rtptimeout")) {
 				user->rtptimeout = atoi(v->value);
 				if (user->rtptimeout < 0)
@@ -2303,6 +2314,7 @@
 		peer->t38support = gT38Support;
 		peer->faststart = gFastStart;
 		peer->h245tunneling = gTunneling;
+		peer->directrtp = gDirectRTP;
       		peer->port = 1720;
 		if (0 == friend_type) {
 			peer->mFriend = 1;
@@ -2357,6 +2369,8 @@
 				peer->faststart = ast_true(v->value);
 			} else if (!strcasecmp(v->name, "h245tunneling")) {
 				peer->h245tunneling = ast_true(v->value);
+			} else if (!strcasecmp(v->name, "directrtp") || !strcasecmp(v->name, "directmedia")) {
+				peer->directrtp = ast_true(v->value);
 			} else if (!strcasecmp(v->name, "rtptimeout")) {
             			peer->rtptimeout = atoi(v->value);
             			if(peer->rtptimeout < 0)
@@ -2594,6 +2608,8 @@
 				ooH323EpEnableH245Tunneling();
 			else
 				ooH323EpDisableH245Tunneling();
+		} else if (!strcasecmp(v->name, "directrtp") || !strcasecmp(v->name, "directmedia")) {
+			gDirectRTP = ast_true(v->value);
 		} else if (!strcasecmp(v->name, "roundtrip")) {
 			sscanf(v->value, "%d,%d", &gRTDRCount, &gRTDRInterval);
       		} else if (!strcasecmp(v->name, "trybemaster")) {
@@ -2830,6 +2846,7 @@
       ast_cli(a->fd, "%-15.15s%s\n", "Name: ", peer->name);
       ast_cli(a->fd, "%s:%s,%s\n", "FastStart/H.245 Tunneling", peer->faststart?"yes":"no",
 					peer->h245tunneling?"yes":"no");
+      ast_cli(a->fd, "%-15s%s\n", "DirectRTP", peer->directrtp?"yes":"no");
       ast_cli(a->fd, "%-15.15s%s", "Format Prefs: ", "(");
       print_codec_to_cli(a->fd, &peer->prefs);
       ast_cli(a->fd, ")\n");
@@ -2975,6 +2992,7 @@
       ast_cli(a->fd, "%-15.15s%s\n", "Name: ", user->name);
       ast_cli(a->fd, "%s:%s,%s\n", "FastStart/H.245 Tunneling", user->faststart?"yes":"no",
 					user->h245tunneling?"yes":"no");
+      ast_cli(a->fd, "%-15s%s\n", "DirectRTP", user->directrtp?"yes":"no");
       ast_cli(a->fd, "%-15.15s%s", "Format Prefs: ", "(");
       print_codec_to_cli(a->fd, &user->prefs);
       ast_cli(a->fd, ")\n");
@@ -3129,6 +3147,7 @@
    ast_cli(a->fd, "%-20s%s\n", "CallerId", gCallerID);
    ast_cli(a->fd, "%-20s%s\n", "MediaWaitForConnect", 
       gMediaWaitForConnect?"yes":"no");
+   ast_cli(a->fd, "%-20s%s\n", "DirectRTP", gDirectRTP?"yes":"no");
 
 #if (0)
 		extern OOH323EndPoint gH323ep;
@@ -3824,7 +3843,7 @@
 
 	/* there must be checking of directmedia setting */
 
-	if (chan->_state != AST_STATE_UP && 0) {
+	if ((chan->_state != AST_STATE_UP && 0) || !p->directrtp) {
 		res = AST_RTP_GLUE_RESULT_LOCAL;
 	} else {
 		res = AST_RTP_GLUE_RESULT_REMOTE;




More information about the asterisk-commits mailing list