summaryrefslogtreecommitdiff
path: root/res/res_pjsip.c
diff options
context:
space:
mode:
authorKevin Harwell <kharwell@digium.com>2014-01-09 23:39:31 +0000
committerKevin Harwell <kharwell@digium.com>2014-01-09 23:39:31 +0000
commit04c5c39d56cc3fab31139ffba785421560073700 (patch)
tree26e2938c122c282c8a93d6bf55c8d8360ee62d01 /res/res_pjsip.c
parent51901aa2ed0a177ad7a2bca3e22be3c8d39bde25 (diff)
res_pjsip_messaging: potential for field values in from/to headers to be missing
Added in ability to specify display name format ("name" <sip:name@ipaddr:port>) for a given URI and made sure it was fully propagated to the outgoing message. Also made it so outoing messages in res_pjsip always send as "sip:". (closes issue ASTERISK-22924) Reported by: Anthony Messina Review: https://reviewboard.asterisk.org/r/3094/ ........ Merged revisions 405266 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@405267 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res/res_pjsip.c')
-rw-r--r--res/res_pjsip.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/res/res_pjsip.c b/res/res_pjsip.c
index 3bb73e6aa..e6f00a8e9 100644
--- a/res/res_pjsip.c
+++ b/res/res_pjsip.c
@@ -1383,8 +1383,7 @@ static int sip_dialog_create_from(pj_pool_t *pool, pj_str_t *from, const char *u
if (!ast_strlen_zero(domain)) {
from->ptr = pj_pool_alloc(pool, PJSIP_MAX_URL_SIZE);
from->slen = pj_ansi_snprintf(from->ptr, PJSIP_MAX_URL_SIZE,
- "<%s:%s@%s%s%s>",
- (pjsip_transport_get_flag_from_type(type) & PJSIP_TRANSPORT_SECURE) ? "sips" : "sip",
+ "<sip:%s@%s%s%s>",
user,
domain,
(type != PJSIP_TRANSPORT_UDP && type != PJSIP_TRANSPORT_UDP6) ? ";transport=" : "",
@@ -1408,8 +1407,7 @@ static int sip_dialog_create_from(pj_pool_t *pool, pj_str_t *from, const char *u
from->ptr = pj_pool_alloc(pool, PJSIP_MAX_URL_SIZE);
from->slen = pj_ansi_snprintf(from->ptr, PJSIP_MAX_URL_SIZE,
- "<%s:%s@%s%.*s%s:%d%s%s>",
- (pjsip_transport_get_flag_from_type(type) & PJSIP_TRANSPORT_SECURE) ? "sips" : "sip",
+ "<sip:%s@%s%.*s%s:%d%s%s>",
user,
(type & PJSIP_TRANSPORT_IPV6) ? "[" : "",
(int)local_addr.slen,
@@ -1536,8 +1534,7 @@ pjsip_dialog *ast_sip_create_dialog_uas(const struct ast_sip_endpoint *endpoint,
contact.ptr = pj_pool_alloc(rdata->tp_info.pool, PJSIP_MAX_URL_SIZE);
contact.slen = pj_ansi_snprintf(contact.ptr, PJSIP_MAX_URL_SIZE,
- "<%s:%s%.*s%s:%d%s%s>",
- (pjsip_transport_get_flag_from_type(type) & PJSIP_TRANSPORT_SECURE) ? "sips" : "sip",
+ "<sip:%s%.*s%s:%d%s%s>",
(type & PJSIP_TRANSPORT_IPV6) ? "[" : "",
(int)rdata->tp_info.transport->local_name.host.slen,
rdata->tp_info.transport->local_name.host.ptr,