[svn-commits] bbryant: branch 1.6.0 r129042 - in /branches/1.6.0: ./ channels/chan_sip.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Tue Jul 8 09:43:31 CDT 2008


Author: bbryant
Date: Tue Jul  8 09:43:30 2008
New Revision: 129042

URL: http://svn.digium.com/view/asterisk?view=rev&rev=129042
Log:
Merged revisions 127621 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

........
r127621 | bbryant | 2008-07-02 17:16:29 -0500 (Wed, 02 Jul 2008) | 1 line

Update transport= in sip so that the option is not broken from a recent commit.
........

Modified:
    branches/1.6.0/   (props changed)
    branches/1.6.0/channels/chan_sip.c

Propchange: branches/1.6.0/
------------------------------------------------------------------------------
Binary property 'trunk-merged' - no diff available.

Modified: branches/1.6.0/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/channels/chan_sip.c?view=diff&rev=129042&r1=129041&r2=129042
==============================================================================
--- branches/1.6.0/channels/chan_sip.c (original)
+++ branches/1.6.0/channels/chan_sip.c Tue Jul  8 09:43:30 2008
@@ -19941,15 +19941,25 @@
 	for (; v || ((v = alt) && !(alt=NULL)); v = v->next) {
 		if (handle_common_options(&peerflags[0], &mask[0], v))
 			continue;
-		if (!strcasecmp(v->name, "transport")) {
-			if (!strcasecmp(v->value, "udp")) 
-				peer->transports &= SIP_TRANSPORT_UDP;
-			else if (!strcasecmp(v->value, "tcp"))
-				peer->transports &= SIP_TRANSPORT_TCP;
-			else if (!strcasecmp(v->value, "tls"))
-				peer->transports &= SIP_TRANSPORT_TLS;
-			if (!peer->socket.type) /*!< The first transport listed should be used for outgoing */
-				peer->socket.type = peer->transports;
+		if (!strcasecmp(v->name, "transport") && !ast_strlen_zero(v->value)) {
+			char *val = ast_strdupa(v->value);
+			char *trans;
+
+			while ((trans = strsep(&val, ","))) {
+				trans = ast_skip_blanks(trans);
+
+				if (!strncasecmp(trans, "udp", 3)) 
+					peer->transports |= SIP_TRANSPORT_UDP;
+				else if (!strncasecmp(trans, "tcp", 3))
+					peer->transports |= SIP_TRANSPORT_TCP;
+				else if (!strncasecmp(trans, "tls", 3))
+					peer->transports |= SIP_TRANSPORT_TLS;
+				else
+					ast_log(LOG_NOTICE, "'%s' is not a valid transport type. if no other is specified, udp will be used.\n", trans);
+
+				if (!peer->socket.type) /*!< The first transport listed should be used for outgoing */
+					peer->socket.type = peer->transports;
+			}
 		} else if (realtime && !strcasecmp(v->name, "regseconds")) {
 			ast_get_time_t(v->value, &regseconds, 0, NULL);
 		} else if (realtime && !strcasecmp(v->name, "ipaddr") && !ast_strlen_zero(v->value) ) {




More information about the svn-commits mailing list