diff options
author | Benny Prijono <bennylp@teluu.com> | 2011-09-07 11:28:45 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2011-09-07 11:28:45 +0000 |
commit | 364e4d7c76c7bad35ab74e875f86f998826b2da3 (patch) | |
tree | d7dcd3bb1959ed0686507c71da0360f7d993499e /pjsip | |
parent | 88e2a696e8b881f070db3f66772957f0a90008a1 (diff) |
Always enclose Contact URI with double quote to prevent invalid Contact URI if the display part of the AOR contains reserved characters. This fixes #1363
git-svn-id: http://svn.pjsip.org/repos/pjproject/branches/1.x@3742 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip')
-rw-r--r-- | pjsip/src/pjsua-lib/pjsua_acc.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/pjsip/src/pjsua-lib/pjsua_acc.c b/pjsip/src/pjsua-lib/pjsua_acc.c index 5398928f..851a6f11 100644 --- a/pjsip/src/pjsua-lib/pjsua_acc.c +++ b/pjsip/src/pjsua-lib/pjsua_acc.c @@ -2472,10 +2472,11 @@ PJ_DEF(pj_status_t) pjsua_acc_create_uac_contact( pj_pool_t *pool, /* Create the contact header */ contact->ptr = (char*)pj_pool_alloc(pool, PJSIP_MAX_URL_SIZE); contact->slen = pj_ansi_snprintf(contact->ptr, PJSIP_MAX_URL_SIZE, - "%.*s%s<%s:%.*s%s%s%.*s%s:%d%s%.*s%s>%.*s", + "%s%.*s%s<%s:%.*s%s%s%.*s%s:%d%s%.*s%s>%.*s", + (acc->display.slen?"\"" : ""), (int)acc->display.slen, acc->display.ptr, - (acc->display.slen?" " : ""), + (acc->display.slen?"\" " : ""), (secure ? PJSUA_SECURE_SCHEME : "sip"), (int)acc->user_part.slen, acc->user_part.ptr, @@ -2630,10 +2631,11 @@ PJ_DEF(pj_status_t) pjsua_acc_create_uas_contact( pj_pool_t *pool, /* Create the contact header */ contact->ptr = (char*) pj_pool_alloc(pool, PJSIP_MAX_URL_SIZE); contact->slen = pj_ansi_snprintf(contact->ptr, PJSIP_MAX_URL_SIZE, - "%.*s%s<%s:%.*s%s%s%.*s%s:%d%s%.*s>%.*s", + "%s%.*s%s<%s:%.*s%s%s%.*s%s:%d%s%.*s>%.*s", + (acc->display.slen?"\"" : ""), (int)acc->display.slen, acc->display.ptr, - (acc->display.slen?" " : ""), + (acc->display.slen?"\" " : ""), (secure ? PJSUA_SECURE_SCHEME : "sip"), (int)acc->user_part.slen, acc->user_part.ptr, |