Update transport= in sip so that the option is not broken from a recent commit.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@127621 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
parent
885d17506b
commit
6aa9419cfe
1 changed files with 19 additions and 9 deletions
|
@ -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) {
|
for (; v || ((v = alt) && !(alt=NULL)); v = v->next) {
|
||||||
if (handle_common_options(&peerflags[0], &mask[0], v))
|
if (handle_common_options(&peerflags[0], &mask[0], v))
|
||||||
continue;
|
continue;
|
||||||
if (!strcasecmp(v->name, "transport")) {
|
if (!strcasecmp(v->name, "transport") && !ast_strlen_zero(v->value)) {
|
||||||
if (!strcasecmp(v->value, "udp"))
|
char *val = ast_strdupa(v->value);
|
||||||
peer->transports &= SIP_TRANSPORT_UDP;
|
char *trans;
|
||||||
else if (!strcasecmp(v->value, "tcp"))
|
|
||||||
peer->transports &= SIP_TRANSPORT_TCP;
|
while ((trans = strsep(&val, ","))) {
|
||||||
else if (!strcasecmp(v->value, "tls"))
|
trans = ast_skip_blanks(trans);
|
||||||
peer->transports &= SIP_TRANSPORT_TLS;
|
|
||||||
|
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 */
|
if (!peer->socket.type) /*!< The first transport listed should be used for outgoing */
|
||||||
peer->socket.type = peer->transports;
|
peer->socket.type = peer->transports;
|
||||||
|
}
|
||||||
} else if (realtime && !strcasecmp(v->name, "regseconds")) {
|
} else if (realtime && !strcasecmp(v->name, "regseconds")) {
|
||||||
ast_get_time_t(v->value, ®seconds, 0, NULL);
|
ast_get_time_t(v->value, ®seconds, 0, NULL);
|
||||||
} else if (realtime && !strcasecmp(v->name, "ipaddr") && !ast_strlen_zero(v->value) ) {
|
} else if (realtime && !strcasecmp(v->name, "ipaddr") && !ast_strlen_zero(v->value) ) {
|
||||||
|
|
Loading…
Reference in a new issue