Changeset 3305
- Timestamp:
- Sep 7, 2010 9:36:15 AM (14 years ago)
- Location:
- pjproject/trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip-apps/src/pjsua/pjsua_app.c
r3299 r3305 202 202 puts (" --use-srtp=N Use SRTP? 0:disabled, 1:optional, 2:mandatory,"); 203 203 puts (" 3:optional by duplicating media offer (def:0)"); 204 puts (" --srtp-secure=N SRTP require secure SIP? 0:no, 1:tls, 1:sips (def:1)");204 puts (" --srtp-secure=N SRTP require secure SIP? 0:no, 1:tls, 2:sips (def:1)"); 205 205 #endif 206 206 puts (" --registrar=url Set the URL of registrar server"); … … 223 223 puts (" --mwi Subscribe to message summary/waiting indication"); 224 224 puts (" --use-100rel Require reliable provisional response (100rel)"); 225 puts (" --use-timer Require SIP session timers"); 225 puts (" --use-timer=N Use SIP session timers? (default=1)"); 226 puts (" 0:inactive, 1:optional, 2:mandatory, 3:always"); 226 227 printf(" --timer-se=N Session timers expiration period, in secs (def:%d)\n", 227 228 PJSIP_SESS_TIMER_DEF_SE); … … 263 264 puts (" --tls-verify-client Verify client's certificate (default=no)"); 264 265 puts (" --tls-neg-timeout Specify TLS negotiation timeout (default=no)"); 265 puts (" --tls-srv-name Specify TLS server name for multi -hosting server (optional)");266 puts (" --tls-srv-name Specify TLS server name for multihosting server"); 266 267 267 268 puts (""); … … 654 655 #endif 655 656 { "set-qos", 0, 0, OPT_QOS}, 656 { "use-timer", 0, 0, OPT_TIMER},657 { "use-timer", 1, 0, OPT_TIMER}, 657 658 { "timer-se", 1, 0, OPT_TIMER_SE}, 658 659 { "timer-min-se", 1, 0, OPT_TIMER_MIN_SE}, … … 882 883 883 884 case OPT_TIMER: /** session timer */ 884 cur_acc->require_timer = PJ_TRUE; 885 cfg->cfg.require_timer = PJ_TRUE; 885 lval = pj_strtoul(pj_cstr(&tmp, pj_optarg)); 886 if (lval < 0 || lval > 3) { 887 PJ_LOG(1,(THIS_FILE, 888 "Error: expecting integer value 0-3 for --use-timer")); 889 return PJ_EINVAL; 890 } 891 cur_acc->use_timer = lval; 892 cfg->cfg.use_timer = lval; 886 893 break; 887 894 … … 1625 1632 1626 1633 /* Session Timer extension */ 1627 if (acc_cfg->require_timer) { 1628 pj_strcat2(result, "--use-timer\n"); 1634 if (acc_cfg->use_timer) { 1635 pj_ansi_sprintf(line, "--use-timer %d\n", 1636 acc_cfg->use_timer); 1637 pj_strcat2(result, line); 1629 1638 } 1630 1639 if (acc_cfg->timer_setting.min_se != 90) { … … 2104 2113 } 2105 2114 /* Session Timer extension */ 2106 if (config->cfg.require_timer) { 2107 pj_strcat2(&cfg, "--use-timer\n"); 2115 if (config->cfg.use_timer) { 2116 pj_ansi_sprintf(line, "--use-timer %d\n", 2117 config->cfg.use_timer); 2118 pj_strcat2(&cfg, line); 2108 2119 } 2109 2120 if (config->cfg.timer_setting.min_se != 90) { -
pjproject/trunk/pjsip/include/pjsua-lib/pjsua.h
r3304 r3305 887 887 888 888 889 /** 890 * This enumeration specifies the usage of SIP Session Timers extension. 891 */ 892 typedef enum pjsua_sip_timer_use 893 { 894 /** 895 * When this flag is specified, Session Timers will not be used in any 896 * session, except it is explicitly required in the remote request. 897 */ 898 PJSUA_SIP_TIMER_INACTIVE, 899 900 /** 901 * When this flag is specified, Session Timers will be used in all 902 * sessions whenever remote supports and uses it. 903 */ 904 PJSUA_SIP_TIMER_OPTIONAL, 905 906 /** 907 * When this flag is specified, Session Timers support will be 908 * a requirement for the remote to be able to establish a session. 909 */ 910 PJSUA_SIP_TIMER_REQUIRED, 911 912 /** 913 * When this flag is specified, Session Timers will always be used 914 * in all sessions, regardless whether remote supports/uses it or not. 915 */ 916 PJSUA_SIP_TIMER_ALWAYS 917 918 } pjsua_sip_timer_use; 889 919 890 920 … … 1034 1064 1035 1065 /** 1036 * Specify whether support for Session Timers should be required by1037 * default. Note that this setting can be further customized in account1038 * configuration (#pjsua_acc_config).1039 * 1040 * Default: PJ _FALSE1041 */ 1042 pj _bool_t require_timer;1066 * Specify the usage of Session Timers for all sessions. See the 1067 * #pjsua_sip_timer_use for possible values. Note that this setting can be 1068 * further customized in account configuration (#pjsua_acc_config). 1069 * 1070 * Default: PJSUA_SIP_TIMER_OPTIONAL 1071 */ 1072 pjsua_sip_timer_use use_timer; 1043 1073 1044 1074 /** … … 2099 2129 2100 2130 /** 2101 * Specify whether support for Session Timers should be required for all2102 * sessions of this account.2103 * 2104 * Default: PJ _FALSE2105 */ 2106 pj _bool_t require_timer;2131 * Specify the usage of Session Timers for all sessions. See the 2132 * #pjsua_sip_timer_use for possible values. 2133 * 2134 * Default: PJSUA_SIP_TIMER_OPTIONAL 2135 */ 2136 pjsua_sip_timer_use use_timer; 2107 2137 2108 2138 /** -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_acc.c
r3303 r3305 738 738 739 739 /* Session timer */ 740 acc->cfg. require_timer = cfg->require_timer;740 acc->cfg.use_timer = cfg->use_timer; 741 741 acc->cfg.timer_setting = cfg->timer_setting; 742 742 -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_call.c
r3304 r3305 494 494 /* Create the INVITE session: */ 495 495 options |= PJSIP_INV_SUPPORT_100REL; 496 options |= PJSIP_INV_SUPPORT_TIMER;497 496 if (acc->cfg.require_100rel) 498 497 options |= PJSIP_INV_REQUIRE_100REL; 499 if (acc->cfg.require_timer) 500 options |= PJSIP_INV_REQUIRE_TIMER; 498 if (acc->cfg.use_timer != PJSUA_SIP_TIMER_INACTIVE) { 499 options |= PJSIP_INV_SUPPORT_TIMER; 500 if (acc->cfg.use_timer == PJSUA_SIP_TIMER_REQUIRED) 501 options |= PJSIP_INV_REQUIRE_TIMER; 502 else if (acc->cfg.use_timer == PJSUA_SIP_TIMER_ALWAYS) 503 options |= PJSIP_INV_ALWAYS_USE_TIMER; 504 } 501 505 502 506 status = pjsip_inv_create_uac( dlg, offer, options, &inv); … … 840 844 if (pjsua_var.acc[acc_id].cfg.require_100rel) 841 845 options |= PJSIP_INV_REQUIRE_100REL; 842 if (pjsua_var.acc[acc_id].cfg.require_timer)843 options |= PJSIP_INV_REQUIRE_TIMER;844 846 if (pjsua_var.media_cfg.enable_ice) 845 847 options |= PJSIP_INV_SUPPORT_ICE; 848 if (pjsua_var.acc[acc_id].cfg.use_timer == PJSUA_SIP_TIMER_REQUIRED) 849 options |= PJSIP_INV_REQUIRE_TIMER; 850 else if (pjsua_var.acc[acc_id].cfg.use_timer == PJSUA_SIP_TIMER_ALWAYS) 851 options |= PJSIP_INV_ALWAYS_USE_TIMER; 846 852 847 853 status = pjsip_inv_verify_request2(rdata, &options, offer, answer, NULL, … … 909 915 pjsip_auth_clt_set_prefs(&dlg->auth_sess, 910 916 &pjsua_var.acc[acc_id].cfg.auth_pref); 917 918 /* Disable Session Timers if not prefered and the incoming INVITE request 919 * did not require it. 920 */ 921 if (pjsua_var.acc[acc_id].cfg.use_timer == PJSUA_SIP_TIMER_INACTIVE && 922 (options & PJSIP_INV_REQUIRE_TIMER) == 0) 923 { 924 options &= ~(PJSIP_INV_SUPPORT_TIMER); 925 } 911 926 912 927 /* Create invite session: */ -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_core.c
r3255 r3305 110 110 cfg->hangup_forked_call = PJ_TRUE; 111 111 112 cfg->use_timer = PJSUA_SIP_TIMER_OPTIONAL; 112 113 pjsip_timer_setting_default(&cfg->timer_setting); 113 114 } … … 172 173 cfg->allow_contact_rewrite = PJ_TRUE; 173 174 cfg->require_100rel = pjsua_var.ua_cfg.require_100rel; 174 cfg-> require_timer = pjsua_var.ua_cfg.require_timer;175 cfg->use_timer = pjsua_var.ua_cfg.use_timer; 175 176 cfg->timer_setting = pjsua_var.ua_cfg.timer_setting; 176 177 cfg->ka_interval = 15;
Note: See TracChangeset
for help on using the changeset viewer.