Changeset 2858 for pjproject/trunk/pjsip/src/pjsua-lib/pjsua_call.c
- Timestamp:
- Aug 11, 2009 12:42:38 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_call.c
r2752 r2858 480 480 /* Create the INVITE session: */ 481 481 options |= PJSIP_INV_SUPPORT_100REL; 482 options |= PJSIP_INV_SUPPORT_TIMER; 482 483 if (acc->cfg.require_100rel) 483 484 options |= PJSIP_INV_REQUIRE_100REL; 485 if (acc->cfg.require_timer) 486 options |= PJSIP_INV_REQUIRE_TIMER; 484 487 485 488 status = pjsip_inv_create_uac( dlg, offer, options, &inv); … … 489 492 } 490 493 494 /* Init Session Timers */ 495 { 496 pjsip_timer_setting timer_setting; 497 498 pjsip_timer_default_setting(&timer_setting); 499 timer_setting.sess_expires = acc->cfg.timer_se; 500 timer_setting.min_se = acc->cfg.timer_min_se; 501 502 status = pjsip_timer_init_session(inv, &timer_setting); 503 if (status != PJ_SUCCESS) { 504 pjsua_perror(THIS_FILE, "Session Timer init failed", status); 505 goto on_error; 506 } 507 } 491 508 492 509 /* Create and associate our data in the session. */ … … 806 823 /* Verify that we can handle the request. */ 807 824 options |= PJSIP_INV_SUPPORT_100REL; 825 options |= PJSIP_INV_SUPPORT_TIMER; 808 826 if (pjsua_var.acc[acc_id].cfg.require_100rel) 809 827 options |= PJSIP_INV_REQUIRE_100REL; 828 if (pjsua_var.acc[acc_id].cfg.require_timer) 829 options |= PJSIP_INV_REQUIRE_TIMER; 810 830 811 831 status = pjsip_inv_verify_request2(rdata, &options, offer, answer, NULL, … … 896 916 } 897 917 918 /* Init Session Timers */ 919 { 920 pjsip_timer_setting timer_setting; 921 922 pjsip_timer_default_setting(&timer_setting); 923 timer_setting.sess_expires = pjsua_var.acc[acc_id].cfg.timer_se; 924 timer_setting.min_se = pjsua_var.acc[acc_id].cfg.timer_min_se; 925 926 status = pjsip_timer_init_session(inv, &timer_setting); 927 if (status != PJ_SUCCESS) { 928 pjsua_perror(THIS_FILE, "Session Timer init failed", status); 929 status = pjsip_inv_end_session(inv, PJSIP_SC_INTERNAL_SERVER_ERROR, 930 NULL, &response); 931 if (status == PJ_SUCCESS && response) 932 status = pjsip_inv_send_msg(inv, response); 933 934 pjsua_media_channel_deinit(call->index); 935 936 PJSUA_UNLOCK(); 937 return PJ_TRUE; 938 } 939 } 940 898 941 /* Update NAT type of remote endpoint, only when there is SDP in 899 942 * incoming INVITE! … … 929 972 100, NULL, NULL, &response); 930 973 if (status != PJ_SUCCESS) { 931 pjsua_perror(THIS_FILE, "Unable to send answer to incoming INVITE", 932 status); 933 934 pjsip_dlg_respond(dlg, rdata, 500, NULL, NULL, NULL); 935 pjsip_inv_terminate(inv, 500, PJ_FALSE); 974 if (response == NULL) { 975 pjsua_perror(THIS_FILE, "Unable to send answer to incoming INVITE", 976 status); 977 pjsip_dlg_respond(dlg, rdata, 500, NULL, NULL, NULL); 978 pjsip_inv_terminate(inv, 500, PJ_FALSE); 979 } else { 980 pjsip_inv_send_msg(inv, response); 981 pjsip_inv_terminate(inv, PJSIP_ERRNO_TO_SIP_STATUS(status), 982 PJ_FALSE); 983 } 936 984 pjsua_media_channel_deinit(call->index); 937 985 PJSUA_UNLOCK();
Note: See TracChangeset
for help on using the changeset viewer.