1 --- a/pjsip/src/pjsua-lib/pjsua_acc.c
2 +++ b/pjsip/src/pjsua-lib/pjsua_acc.c
3 @@ -511,7 +511,7 @@ PJ_DEF(pj_status_t) pjsua_acc_add_local(
6 (int)t->local_name.host.slen,
7 - t->local_name.host.ptr,
8 + t->local_name.host.slen ? t->local_name.host.ptr : "",
12 @@ -1327,19 +1327,19 @@ static pj_bool_t acc_check_nat_addr(pjsu
13 len = pj_ansi_snprintf(tmp, PJSIP_MAX_URL_SIZE,
14 "<sip:%.*s%s%s%.*s%s:%d;transport=%s%.*s%s>%.*s",
15 (int)acc->user_part.slen,
17 + acc->user_part.slen ? acc->user_part.ptr : "",
18 (acc->user_part.slen? "@" : ""),
22 + via_addr->slen ? via_addr->ptr : "",
26 (int)acc->cfg.contact_uri_params.slen,
27 - acc->cfg.contact_uri_params.ptr,
28 + acc->cfg.contact_uri_params.slen ? acc->cfg.contact_uri_params.ptr : "",
30 (int)acc->cfg.contact_params.slen,
31 - acc->cfg.contact_params.ptr);
32 + acc->cfg.contact_params.slen ? acc->cfg.contact_params.ptr : "");
34 PJ_LOG(1,(THIS_FILE, "URI too long"));
35 pj_pool_release(pool);
36 @@ -2467,23 +2467,23 @@ PJ_DEF(pj_status_t) pjsua_acc_create_uac
37 contact->slen = pj_ansi_snprintf(contact->ptr, PJSIP_MAX_URL_SIZE,
38 "%.*s%s<%s:%.*s%s%s%.*s%s:%d%s%.*s%s>%.*s",
39 (int)acc->display.slen,
41 + acc->display.slen ? acc->display.ptr : "",
42 (acc->display.slen?" " : ""),
43 (secure ? PJSUA_SECURE_SCHEME : "sip"),
44 (int)acc->user_part.slen,
46 + acc->user_part.slen ? acc->user_part.ptr : "",
47 (acc->user_part.slen?"@":""),
51 + local_addr.slen ? local_addr.ptr : "",
55 (int)acc->cfg.contact_uri_params.slen,
56 - acc->cfg.contact_uri_params.ptr,
57 + acc->cfg.contact_uri_params.slen ? acc->cfg.contact_uri_params.ptr : "",
59 (int)acc->cfg.contact_params.slen,
60 - acc->cfg.contact_params.ptr);
61 + acc->cfg.contact_params.slen ? acc->cfg.contact_params.ptr : "");
65 @@ -2625,22 +2625,22 @@ PJ_DEF(pj_status_t) pjsua_acc_create_uas
66 contact->slen = pj_ansi_snprintf(contact->ptr, PJSIP_MAX_URL_SIZE,
67 "%.*s%s<%s:%.*s%s%s%.*s%s:%d%s%.*s>%.*s",
68 (int)acc->display.slen,
70 + acc->display.slen ? acc->display.ptr : "",
71 (acc->display.slen?" " : ""),
72 (secure ? PJSUA_SECURE_SCHEME : "sip"),
73 (int)acc->user_part.slen,
75 + acc->user_part.slen ? acc->user_part.ptr : "",
76 (acc->user_part.slen?"@":""),
80 + local_addr.slen ? local_addr.ptr : "",
84 (int)acc->cfg.contact_uri_params.slen,
85 - acc->cfg.contact_uri_params.ptr,
86 + acc->cfg.contact_uri_params.slen ? acc->cfg.contact_uri_params.ptr : "",
87 (int)acc->cfg.contact_params.slen,
88 - acc->cfg.contact_params.ptr);
89 + acc->cfg.contact_params.slen ? acc->cfg.contact_params.ptr : "");