Changeset 2855 for pjproject/trunk/pjsip/src/pjsip/sip_dialog.c
- Timestamp:
- Aug 5, 2009 6:41:23 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/src/pjsip/sip_dialog.c
r2394 r2855 44 44 pj_bool_t pjsip_include_allow_hdr_in_dlg = PJSIP_INCLUDE_ALLOW_HDR_IN_DLG; 45 45 46 /* Contact header string */ 47 static const pj_str_t HCONTACT = { "Contact", 7 }; 46 48 47 49 PJ_DEF(pj_bool_t) pjsip_method_creates_dialog(const pjsip_method *m) … … 211 213 212 214 /* Init local contact. */ 213 dlg->local.contact = pjsip_contact_hdr_create(dlg->pool);214 215 pj_strdup_with_null(dlg->pool, &tmp, 215 216 local_contact ? local_contact : local_uri); 216 dlg->local.contact ->uri = pjsip_parse_uri(dlg->pool, tmp.ptr, tmp.slen,217 PJSIP_PARSE_URI_AS_NAMEADDR);218 if (!dlg->local.contact ->uri) {217 dlg->local.contact = pjsip_parse_hdr(dlg->pool, &HCONTACT, tmp.ptr, 218 tmp.slen, NULL); 219 if (!dlg->local.contact) { 219 220 status = PJSIP_EINVALIDURI; 220 221 goto on_error; … … 391 392 pj_str_t tmp; 392 393 393 dlg->local.contact = pjsip_contact_hdr_create(dlg->pool);394 394 pj_strdup_with_null(dlg->pool, &tmp, contact); 395 dlg->local.contact ->uri = pjsip_parse_uri(dlg->pool, tmp.ptr, tmp.slen,396 PJSIP_PARSE_URI_AS_NAMEADDR);397 if (!dlg->local.contact ->uri) {395 dlg->local.contact = pjsip_parse_hdr(dlg->pool, &HCONTACT, tmp.ptr, 396 tmp.slen, NULL); 397 if (!dlg->local.contact) { 398 398 status = PJSIP_EINVALIDURI; 399 399 goto on_error; … … 1226 1226 st_code==485) 1227 1227 { 1228 pj_str_t hcontact = { "Contact", 7 };1229 1230 1228 /* Add contact header only if one is not present. */ 1231 1229 if (pjsip_msg_find_hdr(tdata->msg, PJSIP_H_CONTACT, NULL) == 0 && 1232 pjsip_msg_find_hdr_by_name(tdata->msg, & hcontact, NULL) == 0)1230 pjsip_msg_find_hdr_by_name(tdata->msg, &HCONTACT, NULL) == 0) 1233 1231 { 1234 1232 hdr = (pjsip_hdr*) pjsip_hdr_clone(tdata->pool,
Note: See TracChangeset
for help on using the changeset viewer.