Changeset 1463 for pjproject/trunk/pjsip/src/pjsua-lib/pjsua_call.c
- Timestamp:
- Sep 30, 2007 4:50:27 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_call.c
r1452 r1463 221 221 PJ_EINVAL); 222 222 223 /* Options must be zero for now */224 PJ_ASSERT_RETURN(options == 0, PJ_EINVAL);225 226 223 /* Check arguments */ 227 224 PJ_ASSERT_RETURN(dest_uri, PJ_EINVAL); … … 323 320 324 321 /* Create the INVITE session: */ 325 326 status = pjsip_inv_create_uac( dlg, offer, 0, &inv); 322 #if PJSIP_HAS_100REL 323 options |= PJSIP_INV_SUPPORT_100REL; 324 #endif 325 if (acc->cfg.require_100rel) 326 options |= PJSIP_INV_REQUIRE_100REL; 327 328 status = pjsip_inv_create_uac( dlg, offer, options, &inv); 327 329 if (status != PJ_SUCCESS) { 328 330 pjsua_perror(THIS_FILE, "Invite session creation failed", status); … … 558 560 } 559 561 560 561 /* Verify that we can handle the request. */562 status = pjsip_inv_verify_request(rdata, &options, answer, NULL,563 pjsua_var.endpt, &response);564 if (status != PJ_SUCCESS) {565 566 /*567 * No we can't handle the incoming INVITE request.568 */569 570 if (response) {571 pjsip_response_addr res_addr;572 573 pjsip_get_response_addr(response->pool, rdata, &res_addr);574 pjsip_endpt_send_response(pjsua_var.endpt, &res_addr, response,575 NULL, NULL);576 577 } else {578 579 /* Respond with 500 (Internal Server Error) */580 pjsip_endpt_respond_stateless(pjsua_var.endpt, rdata, 500, NULL,581 NULL, NULL);582 }583 584 pjsua_media_channel_deinit(call->index);585 PJSUA_UNLOCK();586 return PJ_TRUE;587 }588 589 590 562 /* 591 563 * Get which account is most likely to be associated with this incoming … … 595 567 acc_id = call->acc_id = pjsua_acc_find_for_incoming(rdata); 596 568 569 /* Verify that we can handle the request. */ 570 #if PJSIP_HAS_100REL 571 options |= PJSIP_INV_SUPPORT_100REL; 572 #endif 573 if (pjsua_var.acc[acc_id].cfg.require_100rel) 574 options |= PJSIP_INV_REQUIRE_100REL; 575 576 status = pjsip_inv_verify_request(rdata, &options, answer, NULL, 577 pjsua_var.endpt, &response); 578 if (status != PJ_SUCCESS) { 579 580 /* 581 * No we can't handle the incoming INVITE request. 582 */ 583 if (response) { 584 pjsip_response_addr res_addr; 585 586 pjsip_get_response_addr(response->pool, rdata, &res_addr); 587 pjsip_endpt_send_response(pjsua_var.endpt, &res_addr, response, 588 NULL, NULL); 589 590 } else { 591 592 /* Respond with 500 (Internal Server Error) */ 593 pjsip_endpt_respond_stateless(pjsua_var.endpt, rdata, 500, NULL, 594 NULL, NULL); 595 } 596 597 pjsua_media_channel_deinit(call->index); 598 PJSUA_UNLOCK(); 599 return PJ_TRUE; 600 } 601 602 597 603 /* Get suitable Contact header */ 598 604 status = pjsua_acc_create_uas_contact(rdata->tp_info.pool, &contact, … … 626 632 627 633 /* Create invite session: */ 628 status = pjsip_inv_create_uas( dlg, rdata, answer, 0, &inv);634 status = pjsip_inv_create_uas( dlg, rdata, answer, options, &inv); 629 635 if (status != PJ_SUCCESS) { 630 636 pjsip_hdr hdr_list;
Note: See TracChangeset
for help on using the changeset viewer.