diff options
author | Benny Prijono <bennylp@teluu.com> | 2012-09-20 06:00:23 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2012-09-20 06:00:23 +0000 |
commit | c1da22781bc970d7948f35e5fa6ede7b54f45549 (patch) | |
tree | 238d85c1b6e1375c207486e9f2c2f22188ae49ca /pjsip/src/pjsip/sip_transport.c | |
parent | 8a001ec6f6a9c628eff9fbd9c9a478d127ed12d3 (diff) |
Fixed #1585: IPv6 support for SIP TCP and TLS transports and PJSUA-LIB v2
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@4262 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip/src/pjsip/sip_transport.c')
-rw-r--r-- | pjsip/src/pjsip/sip_transport.c | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/pjsip/src/pjsip/sip_transport.c b/pjsip/src/pjsip/sip_transport.c index 76a1eb11..0215a7b0 100644 --- a/pjsip/src/pjsip/sip_transport.c +++ b/pjsip/src/pjsip/sip_transport.c @@ -198,6 +198,13 @@ struct transport_names_t "TCP IPv6 transport", PJSIP_TRANSPORT_RELIABLE }, + { + PJSIP_TRANSPORT_TLS6, + 5061, + {"TLS", 3}, + "TLS IPv6 transport", + PJSIP_TRANSPORT_RELIABLE | PJSIP_TRANSPORT_SECURE + }, }; static void tp_state_callback(pjsip_transport *tp, @@ -1279,9 +1286,20 @@ PJ_DEF(pj_status_t) pjsip_tpmgr_find_local_addr2(pjsip_tpmgr *tpmgr, if (prm->local_if) { status = get_net_interface(f->type, &prm->dst_host, &tmp_str); - if (status != PJ_SUCCESS) - goto on_return; - pj_strdup(pool, &prm->ret_addr, &tmp_str); + if (status == PJ_SUCCESS) { + pj_strdup(pool, &prm->ret_addr, &tmp_str); + } else { + /* It could fail "normally" on certain cases, e.g. + * when connecting to IPv6 link local address, it + * will wail with EINVAL. + * In this case, fallback to use the default interface + * rather than failing the call. + */ + PJ_PERROR(5,(THIS_FILE, status, "Warning: unable to " + "determine local interface")); + pj_strdup(pool, &prm->ret_addr, &f->addr_name.host); + status = PJ_SUCCESS; + } } else { pj_strdup(pool, &prm->ret_addr, &f->addr_name.host); } |