Changeset 139 for pjproject/trunk/pjsip/src/pjsip/sip_ua_layer.c
- Timestamp:
- Feb 7, 2006 12:34:11 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/src/pjsip/sip_ua_layer.c
r127 r139 169 169 dlg = tsx->mod_data[mod_ua.mod.id]; 170 170 171 /* Must have the dialog instance! */ 172 PJ_ASSERT_ON_FAIL(dlg != NULL, return); 171 /* If dialog instance has gone, it could mean that the dialog 172 * may has been destroyed. 173 */ 174 if (dlg == NULL) 175 return; 173 176 174 177 /* Hand over the event to the dialog. */ … … 205 208 { 206 209 return &mod_ua.mod; 210 } 211 212 213 /* 214 * Get the endpoint where this UA is currently registered. 215 */ 216 PJ_DEF(pjsip_endpoint*) pjsip_ua_get_endpt(pjsip_user_agent *ua) 217 { 218 PJ_UNUSED_ARG(ua); 219 pj_assert(ua == &mod_ua.mod); 220 return mod_ua.endpt; 207 221 } 208 222 … … 461 475 pjsip_dialog *dlg; 462 476 477 /* Optimized path: bail out early if request doesn't have To tag */ 478 if (rdata->msg_info.to->tag.slen == 0) 479 return PJ_FALSE; 480 463 481 /* Lock user agent before looking up the dialog hash table. */ 464 482 pj_mutex_lock(mod_ua.mutex); … … 467 485 dlg_set = find_dlg_set_for_msg(rdata); 468 486 469 /* Bail out if dialog is not found. */ 487 /* If dialog is not found, respond with 481 (Call/Transaction 488 * Does Not Exist). 489 */ 470 490 if (dlg_set == NULL) { 471 /* Not ours. */491 /* Unable to find dialog. */ 472 492 pj_mutex_unlock(mod_ua.mutex); 473 return PJ_FALSE; 493 494 /* Respond with 481 . */ 495 pjsip_endpt_respond_stateless( mod_ua.endpt, rdata, 481, NULL, NULL, 496 NULL ); 497 return PJ_TRUE; 474 498 } 475 499 … … 531 555 /* Check if transaction is present. */ 532 556 tsx = pjsip_rdata_get_tsx(rdata); 533 if ( !tsx) {557 if (tsx) { 534 558 /* Check if dialog is present in the transaction. */ 535 559 dlg = pjsip_tsx_get_dlg(tsx);
Note: See TracChangeset
for help on using the changeset viewer.