summaryrefslogtreecommitdiff
path: root/pjsip/src/pjsip/sip_util.c
diff options
context:
space:
mode:
authorLiong Sauw Ming <ming@teluu.com>2011-10-24 09:28:13 +0000
committerLiong Sauw Ming <ming@teluu.com>2011-10-24 09:28:13 +0000
commit2068f13bc42cf3a47374aa2765f82724a5782028 (patch)
tree29fbeaa152ab51e59b650c0d7cd83a38111e1ecc /pjsip/src/pjsip/sip_util.c
parent1c72a42676e7aa0c2ae0734549050f738f3bdf02 (diff)
Re #1395: Backport of PJSIP 1.x branch into PJSIP 2.0 trunk
* Backport of r3557:r3832 TODO: ticket #1268 (Option for automatic/manual sending of RTCP SDES/BYE for the stream) for video stream. git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@3841 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip/src/pjsip/sip_util.c')
-rw-r--r--pjsip/src/pjsip/sip_util.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/pjsip/src/pjsip/sip_util.c b/pjsip/src/pjsip/sip_util.c
index bdf8fe6a..4f82a1a6 100644
--- a/pjsip/src/pjsip/sip_util.c
+++ b/pjsip/src/pjsip/sip_util.c
@@ -813,6 +813,8 @@ static pj_status_t get_dest_info(const pjsip_uri *target_uri,
if (PJSIP_URI_SCHEME_IS_SIPS(target_uri)) {
pjsip_uri *uri = (pjsip_uri*) target_uri;
const pjsip_sip_uri *url=(const pjsip_sip_uri*)pjsip_uri_get_uri(uri);
+ unsigned flag;
+
dest_info->flag |= (PJSIP_TRANSPORT_SECURE | PJSIP_TRANSPORT_RELIABLE);
if (url->maddr_param.slen)
pj_strdup(pool, &dest_info->addr.host, &url->maddr_param);
@@ -821,6 +823,18 @@ static pj_status_t get_dest_info(const pjsip_uri *target_uri,
dest_info->addr.port = url->port;
dest_info->type =
pjsip_transport_get_type_from_name(&url->transport_param);
+ /* Double-check that the transport parameter match.
+ * Sample case: sips:host;transport=tcp
+ * See https://trac.pjsip.org/repos/ticket/1319
+ */
+ flag = pjsip_transport_get_flag_from_type(dest_info->type);
+ if ((flag & dest_info->flag) != dest_info->flag) {
+ pjsip_transport_type_e t;
+
+ t = pjsip_transport_get_type_from_flag(dest_info->flag);
+ if (t != PJSIP_TRANSPORT_UNSPECIFIED)
+ dest_info->type = t;
+ }
} else if (PJSIP_URI_SCHEME_IS_SIP(target_uri)) {
pjsip_uri *uri = (pjsip_uri*) target_uri;
@@ -1390,6 +1404,9 @@ static void send_raw_resolver_callback( pj_status_t status,
pj_assert(addr->count != 0);
+ /* Avoid tdata destroyed by pjsip_tpmgr_send_raw(). */
+ pjsip_tx_data_add_ref(sraw_data->tdata);
+
data_len = sraw_data->tdata->buf.cur - sraw_data->tdata->buf.start;
status = pjsip_tpmgr_send_raw(pjsip_endpt_get_tpmgr(sraw_data->endpt),
addr->entry[0].type,