aboutsummaryrefslogtreecommitdiffstats
path: root/channels
diff options
context:
space:
mode:
authorbbryant <bbryant@f38db490-d61c-443f-a65b-d21fe96a405b>2008-07-02 22:16:29 +0000
committerbbryant <bbryant@f38db490-d61c-443f-a65b-d21fe96a405b>2008-07-02 22:16:29 +0000
commit983bb0e646bddde5da474f0e4ea7e79435e1edc3 (patch)
treef564f9e5fcf2be56362d1547f1796e3469303e34 /channels
parent2da25c2375d13755ffe7d2e3d9095311d2357e0d (diff)
Update transport= in sip so that the option is not broken from a recent commit.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@127621 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_sip.c28
1 files changed, 19 insertions, 9 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 8235d7ed0..bb6f454c4 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -21278,15 +21278,25 @@ static struct sip_peer *build_peer(const char *name, struct ast_variable *v, str
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) ) {