Changeset 1626
- Timestamp:
- Dec 9, 2007 3:41:10 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip-apps/src/pjsua/pjsua_app.c
r1620 r1626 58 58 unsigned codec_cnt; 59 59 pj_str_t codec_arg[32]; 60 unsigned codec_dis_cnt; 61 pj_str_t codec_dis[32]; 60 62 pj_bool_t null_audio; 61 63 unsigned wav_count; … … 130 132 puts (" --publish Send presence PUBLISH for this account"); 131 133 puts (" --use-100rel Require reliable provisional response (100rel)"); 134 puts (" --auto-update-nat=N Where N is 0 or 1 to enable/disable SIP traversal behind"); 135 puts (" symmetric NAT (default 1)"); 132 136 puts (" --next-cred Add another credentials"); 133 137 puts (""); … … 163 167 puts (" --use-ice Enable ICE (default:no)"); 164 168 puts (" --add-codec=name Manually add codec (default is to enable all)"); 169 puts (" --dis-codec=name Disable codec (can be specified multiple times)"); 165 170 puts (" --clock-rate=N Override sound device clock rate"); 166 171 puts (" --null-audio Use NULL audio device"); … … 198 203 puts (" --duration=SEC Set maximum call duration (default:no limit)"); 199 204 puts (" --norefersub Suppress event subscription when transfering calls"); 205 puts (" --use-compact-form Minimize SIP message size"); 200 206 201 207 puts (""); … … 389 395 OPT_TLS_NEG_TIMEOUT, 390 396 OPT_CAPTURE_DEV, OPT_PLAYBACK_DEV, 397 OPT_AUTO_UPDATE_NAT,OPT_USE_COMPACT_FORM,OPT_DIS_CODEC 391 398 }; 392 399 struct pj_getopt_option long_options[] = { … … 413 420 { "id", 1, 0, OPT_ID}, 414 421 { "contact", 1, 0, OPT_CONTACT}, 422 { "auto-update-nat", 1, 0, OPT_AUTO_UPDATE_NAT}, 423 { "use-compact-form", 0, 0, OPT_USE_COMPACT_FORM}, 415 424 { "realm", 1, 0, OPT_REALM}, 416 425 { "username", 1, 0, OPT_USERNAME}, … … 434 443 { "use-ice", 0, 0, OPT_USE_ICE}, 435 444 { "add-codec", 1, 0, OPT_ADD_CODEC}, 445 { "dis-codec", 1, 0, OPT_DIS_CODEC}, 436 446 { "complexity", 1, 0, OPT_COMPLEXITY}, 437 447 { "quality", 1, 0, OPT_QUALITY}, … … 661 671 break; 662 672 673 case OPT_AUTO_UPDATE_NAT: /* OPT_AUTO_UPDATE_NAT */ 674 cur_acc->auto_update_nat = pj_strtoul(pj_cstr(&tmp, pj_optarg)); 675 break; 676 677 case OPT_USE_COMPACT_FORM: 678 /* enable compact form - from Ticket #342 */ 679 { 680 extern pj_bool_t pjsip_use_compact_form; 681 extern pj_bool_t pjsip_include_allow_hdr_in_dlg; 682 extern pj_bool_t pjmedia_add_rtpmap_for_static_pt; 683 684 pjsip_use_compact_form = PJ_TRUE; 685 /* do not transmit Allow header */ 686 pjsip_include_allow_hdr_in_dlg = PJ_FALSE; 687 /* Do not include rtpmap for static payload types (<96) */ 688 pjmedia_add_rtpmap_for_static_pt = PJ_FALSE; 689 } 690 break; 691 663 692 case OPT_NEXT_ACCOUNT: /* Add more account. */ 664 693 cfg->acc_cnt++; … … 785 814 return -1; 786 815 } 816 break; 817 818 case OPT_DIS_CODEC: 819 cfg->codec_dis[cfg->codec_dis_cnt++] = pj_str(pj_optarg); 787 820 break; 788 821 … … 1071 1104 } 1072 1105 1106 /* */ 1107 //if (acc_cfg->auto_update_nat) 1108 { 1109 pj_ansi_sprintf(line, "--auto-update-nat %i\n", 1110 (int)acc_cfg->auto_update_nat); 1111 pj_strcat2(result, line); 1112 } 1113 1073 1114 /* Proxy */ 1074 1115 for (i=0; i<acc_cfg->proxy_cnt; ++i) { … … 1119 1160 pj_str_t cfg; 1120 1161 char line[128]; 1162 extern pj_bool_t pjsip_use_compact_form; 1121 1163 1122 1164 PJ_UNUSED_ARG(max); … … 1367 1409 pj_strcat2(&cfg, line); 1368 1410 } 1411 /* Disable codec */ 1412 for (i=0; i<config->codec_dis_cnt; ++i) { 1413 pj_ansi_sprintf(line, "--dis-codec %s\n", 1414 config->codec_dis[i].ptr); 1415 pj_strcat2(&cfg, line); 1416 } 1369 1417 1370 1418 pj_strcat2(&cfg, "\n#\n# User agent:\n#\n"); … … 1394 1442 } 1395 1443 1444 if (pjsip_use_compact_form) 1445 { 1446 pj_strcat2(&cfg, "--use-compact-form\n"); 1447 } 1396 1448 1397 1449 pj_strcat2(&cfg, "\n#\n# Buddies:\n#\n"); … … 3489 3541 } 3490 3542 3543 /* Optionally disable some codec */ 3544 for (i=0; i<app_config.codec_dis_cnt; ++i) { 3545 pjsua_codec_set_priority(&app_config.codec_dis[i],PJMEDIA_CODEC_PRIO_DISABLED); 3546 } 3547 3491 3548 /* Add RTP transports */ 3492 3549 status = pjsua_media_transports_create(&app_config.rtp_cfg);
Note: See TracChangeset
for help on using the changeset viewer.