2011-02-01 23:07:54 +00:00
|
|
|
--- a/pjsip/src/pjsua-lib/pjsua_acc.c
|
|
|
|
+++ b/pjsip/src/pjsua-lib/pjsua_acc.c
|
2011-11-11 22:23:26 +00:00
|
|
|
@@ -511,7 +511,7 @@ PJ_DEF(pj_status_t) pjsua_acc_add_local(
|
2011-02-01 23:07:54 +00:00
|
|
|
"<sip:%s%.*s%s:%d%s>",
|
|
|
|
beginquote,
|
|
|
|
(int)t->local_name.host.slen,
|
|
|
|
- t->local_name.host.ptr,
|
|
|
|
+ t->local_name.host.slen ? t->local_name.host.ptr : "",
|
|
|
|
endquote,
|
|
|
|
t->local_name.port,
|
|
|
|
transport_param);
|
2011-11-11 22:23:26 +00:00
|
|
|
@@ -1327,19 +1327,19 @@ static pj_bool_t acc_check_nat_addr(pjsu
|
2011-02-01 23:07:54 +00:00
|
|
|
len = pj_ansi_snprintf(tmp, PJSIP_MAX_URL_SIZE,
|
2011-11-11 22:23:26 +00:00
|
|
|
"<sip:%.*s%s%s%.*s%s:%d;transport=%s%.*s%s>%.*s",
|
2011-02-01 23:07:54 +00:00
|
|
|
(int)acc->user_part.slen,
|
|
|
|
- acc->user_part.ptr,
|
|
|
|
+ acc->user_part.slen ? acc->user_part.ptr : "",
|
|
|
|
(acc->user_part.slen? "@" : ""),
|
|
|
|
beginquote,
|
|
|
|
(int)via_addr->slen,
|
|
|
|
- via_addr->ptr,
|
|
|
|
+ via_addr->slen ? via_addr->ptr : "",
|
|
|
|
endquote,
|
|
|
|
rport,
|
|
|
|
tp->type_name,
|
|
|
|
(int)acc->cfg.contact_uri_params.slen,
|
|
|
|
- acc->cfg.contact_uri_params.ptr,
|
|
|
|
+ acc->cfg.contact_uri_params.slen ? acc->cfg.contact_uri_params.ptr : "",
|
2011-11-11 22:23:26 +00:00
|
|
|
ob,
|
2011-02-01 23:07:54 +00:00
|
|
|
(int)acc->cfg.contact_params.slen,
|
|
|
|
- acc->cfg.contact_params.ptr);
|
|
|
|
+ acc->cfg.contact_params.slen ? acc->cfg.contact_params.ptr : "");
|
|
|
|
if (len < 1) {
|
|
|
|
PJ_LOG(1,(THIS_FILE, "URI too long"));
|
|
|
|
pj_pool_release(pool);
|
2011-11-11 22:23:26 +00:00
|
|
|
@@ -2467,23 +2467,23 @@ PJ_DEF(pj_status_t) pjsua_acc_create_uac
|
2011-02-01 23:07:54 +00:00
|
|
|
contact->slen = pj_ansi_snprintf(contact->ptr, PJSIP_MAX_URL_SIZE,
|
2011-11-11 22:23:26 +00:00
|
|
|
"%.*s%s<%s:%.*s%s%s%.*s%s:%d%s%.*s%s>%.*s",
|
2011-02-01 23:07:54 +00:00
|
|
|
(int)acc->display.slen,
|
|
|
|
- acc->display.ptr,
|
|
|
|
+ acc->display.slen ? acc->display.ptr : "",
|
|
|
|
(acc->display.slen?" " : ""),
|
|
|
|
(secure ? PJSUA_SECURE_SCHEME : "sip"),
|
|
|
|
(int)acc->user_part.slen,
|
|
|
|
- acc->user_part.ptr,
|
|
|
|
+ acc->user_part.slen ? acc->user_part.ptr : "",
|
|
|
|
(acc->user_part.slen?"@":""),
|
|
|
|
beginquote,
|
|
|
|
(int)local_addr.slen,
|
|
|
|
- local_addr.ptr,
|
|
|
|
+ local_addr.slen ? local_addr.ptr : "",
|
|
|
|
endquote,
|
|
|
|
local_port,
|
|
|
|
transport_param,
|
|
|
|
(int)acc->cfg.contact_uri_params.slen,
|
|
|
|
- acc->cfg.contact_uri_params.ptr,
|
|
|
|
+ acc->cfg.contact_uri_params.slen ? acc->cfg.contact_uri_params.ptr : "",
|
2011-11-11 22:23:26 +00:00
|
|
|
ob,
|
2011-02-01 23:07:54 +00:00
|
|
|
(int)acc->cfg.contact_params.slen,
|
|
|
|
- acc->cfg.contact_params.ptr);
|
|
|
|
+ acc->cfg.contact_params.slen ? acc->cfg.contact_params.ptr : "");
|
|
|
|
|
|
|
|
return PJ_SUCCESS;
|
|
|
|
}
|
2011-11-11 22:23:26 +00:00
|
|
|
@@ -2625,22 +2625,22 @@ PJ_DEF(pj_status_t) pjsua_acc_create_uas
|
2011-02-01 23:07:54 +00:00
|
|
|
contact->slen = pj_ansi_snprintf(contact->ptr, PJSIP_MAX_URL_SIZE,
|
|
|
|
"%.*s%s<%s:%.*s%s%s%.*s%s:%d%s%.*s>%.*s",
|
|
|
|
(int)acc->display.slen,
|
|
|
|
- acc->display.ptr,
|
|
|
|
+ acc->display.slen ? acc->display.ptr : "",
|
|
|
|
(acc->display.slen?" " : ""),
|
|
|
|
(secure ? PJSUA_SECURE_SCHEME : "sip"),
|
|
|
|
(int)acc->user_part.slen,
|
|
|
|
- acc->user_part.ptr,
|
|
|
|
+ acc->user_part.slen ? acc->user_part.ptr : "",
|
|
|
|
(acc->user_part.slen?"@":""),
|
|
|
|
beginquote,
|
|
|
|
(int)local_addr.slen,
|
|
|
|
- local_addr.ptr,
|
|
|
|
+ local_addr.slen ? local_addr.ptr : "",
|
|
|
|
endquote,
|
|
|
|
local_port,
|
|
|
|
transport_param,
|
|
|
|
(int)acc->cfg.contact_uri_params.slen,
|
|
|
|
- acc->cfg.contact_uri_params.ptr,
|
|
|
|
+ acc->cfg.contact_uri_params.slen ? acc->cfg.contact_uri_params.ptr : "",
|
|
|
|
(int)acc->cfg.contact_params.slen,
|
|
|
|
- acc->cfg.contact_params.ptr);
|
|
|
|
+ acc->cfg.contact_params.slen ? acc->cfg.contact_params.ptr : "");
|
|
|
|
|
|
|
|
return PJ_SUCCESS;
|
|
|
|
}
|