Changeset 492 for pjproject/trunk/pjsip/src/pjsua-lib/pjsua_im.c
- Timestamp:
- Jun 6, 2006 6:40:40 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_im.c
r482 r492 186 186 pj_str_t from, to; 187 187 pjsip_accept_hdr *accept_hdr; 188 pjsip_contact_hdr *contact_hdr; 188 189 pjsip_msg *msg; 189 190 pj_status_t status; … … 222 223 NULL, NULL, NULL); 223 224 224 /* Build the From text. */ 225 /* For the source URI, we use Contact header if present, since 226 * Contact header contains the port number information. If this is 227 * not available, then use From header. 228 */ 225 229 from.ptr = pj_pool_alloc(rdata->tp_info.pool, PJSIP_MAX_URL_SIZE); 226 from.slen = pjsip_uri_print(PJSIP_URI_IN_FROMTO_HDR, 227 rdata->msg_info.from->uri, 228 from.ptr, PJSIP_MAX_URL_SIZE); 230 contact_hdr = pjsip_msg_find_hdr(rdata->msg_info.msg, 231 PJSIP_H_CONTACT, NULL); 232 if (contact_hdr) { 233 from.slen = pjsip_uri_print(PJSIP_URI_IN_CONTACT_HDR, 234 contact_hdr->uri, 235 from.ptr, PJSIP_MAX_URL_SIZE); 236 } else { 237 from.slen = pjsip_uri_print(PJSIP_URI_IN_FROMTO_HDR, 238 rdata->msg_info.from->uri, 239 from.ptr, PJSIP_MAX_URL_SIZE); 240 } 241 229 242 if (from.slen < 1) 230 243 from = pj_str("<--URI is too long-->"); … … 337 350 pj_bool_t is_typing) 338 351 { 352 const pj_str_t STR_CONTACT = { "Contact", 7 }; 339 353 pjsip_tx_data *tdata; 340 354 pj_status_t status; … … 351 365 352 366 367 /* Add accept header. */ 368 pjsip_msg_add_hdr( tdata->msg, 369 (pjsip_hdr*)pjsua_im_create_accept(tdata->pool)); 370 371 372 /* Add contact. */ 373 pjsip_msg_add_hdr( tdata->msg, (pjsip_hdr*) 374 pjsip_generic_string_hdr_create(tdata->pool, 375 &STR_CONTACT, 376 &pjsua.config.acc_config[acc_index].contact)); 377 378 353 379 /* Create "application/im-iscomposing+xml" msg body. */ 354 380 tdata->msg->body = pjsip_iscomposing_create_body( tdata->pool, is_typing,
Note: See TracChangeset
for help on using the changeset viewer.