Changeset 4218 for pjproject/trunk/pjsip-apps/src/pjsua/pjsua_app.c
- Timestamp:
- Aug 7, 2012 2:18:15 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip-apps/src/pjsua/pjsua_app.c
r4216 r4218 225 225 puts (""); 226 226 puts ("SIP Account options:"); 227 puts (" --use-ims Enable 3GPP/IMS related settings on this account");228 #if defined(PJMEDIA_HAS_SRTP) && (PJMEDIA_HAS_SRTP != 0)229 puts (" --use-srtp=N Use SRTP? 0:disabled, 1:optional, 2:mandatory,");230 puts (" 3:optional by duplicating media offer (def:0)");231 puts (" --srtp-secure=N SRTP require secure SIP? 0:no, 1:tls, 2:sips (def:1)");232 #endif233 227 puts (" --registrar=url Set the URL of registrar server"); 234 228 puts (" --id=url Set the URL of local ID (used in From header)"); 229 puts (" --realm=string Set realm"); 230 puts (" --username=string Set authentication username"); 231 puts (" --password=string Set authentication password"); 235 232 puts (" --contact=url Optionally override the Contact information"); 236 233 puts (" --contact-params=S Append the specified parameters S in Contact header"); … … 244 241 puts (" --reg-use-proxy=N Control the use of proxy settings in REGISTER."); 245 242 puts (" 0=no proxy, 1=outbound only, 2=acc only, 3=all (default)"); 246 puts (" --realm=string Set realm");247 puts (" --username=string Set authentication username");248 puts (" --password=string Set authentication password");249 243 puts (" --publish Send presence PUBLISH for this account"); 250 244 puts (" --mwi Subscribe to message summary/waiting indication"); 245 puts (" --use-ims Enable 3GPP/IMS related settings on this account"); 246 #if defined(PJMEDIA_HAS_SRTP) && (PJMEDIA_HAS_SRTP != 0) 247 puts (" --use-srtp=N Use SRTP? 0:disabled, 1:optional, 2:mandatory,"); 248 puts (" 3:optional by duplicating media offer (def:0)"); 249 puts (" --srtp-secure=N SRTP require secure SIP? 0:no, 1:tls, 2:sips (def:1)"); 250 #endif 251 251 puts (" --use-100rel Require reliable provisional response (100rel)"); 252 252 puts (" --use-timer=N Use SIP session timers? (default=1)"); … … 258 258 puts (" --auto-update-nat=N Where N is 0 or 1 to enable/disable SIP traversal behind"); 259 259 puts (" symmetric NAT (default 1)"); 260 puts (" --disable-stun Disable STUN for this account"); 260 261 puts (" --next-cred Add another credentials"); 261 262 puts (""); … … 590 591 #endif 591 592 OPT_AUTO_UPDATE_NAT,OPT_USE_COMPACT_FORM,OPT_DIS_CODEC, 592 OPT_ NO_FORCE_LR,593 OPT_DISABLE_STUN, OPT_NO_FORCE_LR, 593 594 OPT_TIMER, OPT_TIMER_SE, OPT_TIMER_MIN_SE, 594 595 OPT_VIDEO, OPT_EXTRA_AUDIO, … … 630 631 { "contact-uri-params",1,0, OPT_CONTACT_URI_PARAMS}, 631 632 { "auto-update-nat", 1, 0, OPT_AUTO_UPDATE_NAT}, 633 { "disable-stun",0,0, OPT_DISABLE_STUN}, 632 634 { "use-compact-form", 0, 0, OPT_USE_COMPACT_FORM}, 633 635 { "accept-redirect", 1, 0, OPT_ACCEPT_REDIRECT}, … … 1022 1024 break; 1023 1025 1026 case OPT_DISABLE_STUN: 1027 cur_acc->sip_stun_use = PJSUA_STUN_USE_DISABLED; 1028 cur_acc->media_stun_use = PJSUA_STUN_USE_DISABLED; 1029 break; 1030 1024 1031 case OPT_USE_COMPACT_FORM: 1025 1032 /* enable compact form - from Ticket #342 */ … … 1172 1179 1173 1180 case OPT_USE_ICE: 1174 cfg->media_cfg.enable_ice = PJ_TRUE; 1181 cfg->media_cfg.enable_ice = 1182 cur_acc->ice_cfg.enable_ice = PJ_TRUE; 1175 1183 break; 1176 1184 1177 1185 case OPT_ICE_REGULAR: 1178 cfg->media_cfg.ice_opt.aggressive = PJ_FALSE; 1186 cfg->media_cfg.ice_opt.aggressive = 1187 cur_acc->ice_cfg.ice_opt.aggressive = PJ_FALSE; 1179 1188 break; 1180 1189 1181 1190 case OPT_USE_TURN: 1182 cfg->media_cfg.enable_turn = PJ_TRUE; 1191 cfg->media_cfg.enable_turn = 1192 cur_acc->turn_cfg.enable_turn = PJ_TRUE; 1183 1193 break; 1184 1194 1185 1195 case OPT_ICE_MAX_HOSTS: 1186 cfg->media_cfg.ice_max_host_cands = my_atoi(pj_optarg); 1196 cfg->media_cfg.ice_max_host_cands = 1197 cur_acc->ice_cfg.ice_max_host_cands = my_atoi(pj_optarg); 1187 1198 break; 1188 1199 1189 1200 case OPT_ICE_NO_RTCP: 1190 cfg->media_cfg.ice_no_rtcp = PJ_TRUE; 1201 cfg->media_cfg.ice_no_rtcp = 1202 cur_acc->ice_cfg.ice_no_rtcp = PJ_TRUE; 1191 1203 break; 1192 1204 1193 1205 case OPT_TURN_SRV: 1194 cfg->media_cfg.turn_server = pj_str(pj_optarg); 1206 cfg->media_cfg.turn_server = 1207 cur_acc->turn_cfg.turn_server = pj_str(pj_optarg); 1195 1208 break; 1196 1209 1197 1210 case OPT_TURN_TCP: 1198 cfg->media_cfg.turn_conn_type = PJ_TURN_TP_TCP; 1211 cfg->media_cfg.turn_conn_type = 1212 cur_acc->turn_cfg.turn_conn_type = PJ_TURN_TP_TCP; 1199 1213 break; 1200 1214 1201 1215 case OPT_TURN_USER: 1202 cfg->media_cfg.turn_auth_cred.type = PJ_STUN_AUTH_CRED_STATIC; 1203 cfg->media_cfg.turn_auth_cred.data.static_cred.realm = pj_str("*"); 1204 cfg->media_cfg.turn_auth_cred.data.static_cred.username = pj_str(pj_optarg); 1216 cfg->media_cfg.turn_auth_cred.type = 1217 cur_acc->turn_cfg.turn_auth_cred.type = PJ_STUN_AUTH_CRED_STATIC; 1218 cfg->media_cfg.turn_auth_cred.data.static_cred.realm = 1219 cur_acc->turn_cfg.turn_auth_cred.data.static_cred.realm = pj_str("*"); 1220 cfg->media_cfg.turn_auth_cred.data.static_cred.username = 1221 cur_acc->turn_cfg.turn_auth_cred.data.static_cred.username = pj_str(pj_optarg); 1205 1222 break; 1206 1223 1207 1224 case OPT_TURN_PASSWD: 1208 cfg->media_cfg.turn_auth_cred.data.static_cred.data_type = PJ_STUN_PASSWD_PLAIN; 1209 cfg->media_cfg.turn_auth_cred.data.static_cred.data = pj_str(pj_optarg); 1225 cfg->media_cfg.turn_auth_cred.data.static_cred.data_type = 1226 cur_acc->turn_cfg.turn_auth_cred.data.static_cred.data_type = PJ_STUN_PASSWD_PLAIN; 1227 cfg->media_cfg.turn_auth_cred.data.static_cred.data = 1228 cur_acc->turn_cfg.turn_auth_cred.data.static_cred.data = pj_str(pj_optarg); 1210 1229 break; 1211 1230 … … 1576 1595 { 1577 1596 acfg->cred_count++; 1597 } 1598 1599 if (acfg->ice_cfg.enable_ice) { 1600 acfg->ice_cfg_use = PJSUA_ICE_CONFIG_USE_CUSTOM; 1601 } 1602 if (acfg->turn_cfg.enable_turn) { 1603 acfg->turn_cfg_use = PJSUA_TURN_CONFIG_USE_CUSTOM; 1578 1604 } 1579 1605 … … 1772 1798 if (acc_cfg->mwi_enabled) 1773 1799 pj_strcat2(result, "--mwi\n"); 1800 1801 if (acc_cfg->sip_stun_use != PJSUA_STUN_USE_DEFAULT || 1802 acc_cfg->media_stun_use != PJSUA_STUN_USE_DEFAULT) 1803 { 1804 pj_strcat2(result, "--disable-stun\n"); 1805 } 1806 1807 /* Media Transport*/ 1808 if (acc_cfg->ice_cfg.enable_ice) 1809 pj_strcat2(result, "--use-ice\n"); 1810 1811 if (acc_cfg->ice_cfg.ice_opt.aggressive == PJ_FALSE) 1812 pj_strcat2(result, "--ice-regular\n"); 1813 1814 if (acc_cfg->turn_cfg.enable_turn) 1815 pj_strcat2(result, "--use-turn\n"); 1816 1817 if (acc_cfg->ice_cfg.ice_max_host_cands >= 0) { 1818 pj_ansi_sprintf(line, "--ice_max_host_cands %d\n", 1819 acc_cfg->ice_cfg.ice_max_host_cands); 1820 pj_strcat2(result, line); 1821 } 1822 1823 if (acc_cfg->ice_cfg.ice_no_rtcp) 1824 pj_strcat2(result, "--ice-no-rtcp\n"); 1825 1826 if (acc_cfg->turn_cfg.turn_server.slen) { 1827 pj_ansi_sprintf(line, "--turn-srv %.*s\n", 1828 (int)acc_cfg->turn_cfg.turn_server.slen, 1829 acc_cfg->turn_cfg.turn_server.ptr); 1830 pj_strcat2(result, line); 1831 } 1832 1833 if (acc_cfg->turn_cfg.turn_conn_type == PJ_TURN_TP_TCP) 1834 pj_strcat2(result, "--turn-tcp\n"); 1835 1836 if (acc_cfg->turn_cfg.turn_auth_cred.data.static_cred.username.slen) { 1837 pj_ansi_sprintf(line, "--turn-user %.*s\n", 1838 (int)acc_cfg->turn_cfg.turn_auth_cred.data.static_cred.username.slen, 1839 acc_cfg->turn_cfg.turn_auth_cred.data.static_cred.username.ptr); 1840 pj_strcat2(result, line); 1841 } 1842 1843 if (acc_cfg->turn_cfg.turn_auth_cred.data.static_cred.data.slen) { 1844 pj_ansi_sprintf(line, "--turn-passwd %.*s\n", 1845 (int)acc_cfg->turn_cfg.turn_auth_cred.data.static_cred.data.slen, 1846 acc_cfg->turn_cfg.turn_auth_cred.data.static_cred.data.ptr); 1847 pj_strcat2(result, line); 1848 } 1774 1849 } 1775 1850 … … 1967 2042 } 1968 2043 #endif 1969 1970 /* Media Transport*/1971 if (config->media_cfg.enable_ice)1972 pj_strcat2(&cfg, "--use-ice\n");1973 1974 if (config->media_cfg.ice_opt.aggressive == PJ_FALSE)1975 pj_strcat2(&cfg, "--ice-regular\n");1976 1977 if (config->media_cfg.enable_turn)1978 pj_strcat2(&cfg, "--use-turn\n");1979 1980 if (config->media_cfg.ice_max_host_cands >= 0) {1981 pj_ansi_sprintf(line, "--ice_max_host_cands %d\n",1982 config->media_cfg.ice_max_host_cands);1983 pj_strcat2(&cfg, line);1984 }1985 1986 if (config->media_cfg.ice_no_rtcp)1987 pj_strcat2(&cfg, "--ice-no-rtcp\n");1988 1989 if (config->media_cfg.turn_server.slen) {1990 pj_ansi_sprintf(line, "--turn-srv %.*s\n",1991 (int)config->media_cfg.turn_server.slen,1992 config->media_cfg.turn_server.ptr);1993 pj_strcat2(&cfg, line);1994 }1995 1996 if (config->media_cfg.turn_conn_type == PJ_TURN_TP_TCP)1997 pj_strcat2(&cfg, "--turn-tcp\n");1998 1999 if (config->media_cfg.turn_auth_cred.data.static_cred.username.slen) {2000 pj_ansi_sprintf(line, "--turn-user %.*s\n",2001 (int)config->media_cfg.turn_auth_cred.data.static_cred.username.slen,2002 config->media_cfg.turn_auth_cred.data.static_cred.username.ptr);2003 pj_strcat2(&cfg, line);2004 }2005 2006 if (config->media_cfg.turn_auth_cred.data.static_cred.data.slen) {2007 pj_ansi_sprintf(line, "--turn-passwd %.*s\n",2008 (int)config->media_cfg.turn_auth_cred.data.static_cred.data.slen,2009 config->media_cfg.turn_auth_cred.data.static_cred.data.ptr);2010 pj_strcat2(&cfg, line);2011 }2012 2044 2013 2045 /* Media */
Note: See TracChangeset
for help on using the changeset viewer.