Index: pjproject/trunk/pjsip-apps/src/pjsua/pjsua_app.c
===================================================================
--- pjproject/trunk/pjsip-apps/src/pjsua/pjsua_app.c	(revision 1625)
+++ pjproject/trunk/pjsip-apps/src/pjsua/pjsua_app.c	(revision 1626)
@@ -58,4 +58,6 @@
     unsigned		    codec_cnt;
     pj_str_t		    codec_arg[32];
+    unsigned		    codec_dis_cnt;
+    pj_str_t                codec_dis[32];
     pj_bool_t		    null_audio;
     unsigned		    wav_count;
@@ -130,4 +132,6 @@
     puts  ("  --publish           Send presence PUBLISH for this account");
     puts  ("  --use-100rel        Require reliable provisional response (100rel)");
+    puts  ("  --auto-update-nat=N Where N is 0 or 1 to enable/disable SIP traversal behind");
+    puts  ("                      symmetric NAT (default 1)");
     puts  ("  --next-cred         Add another credentials");
     puts  ("");
@@ -163,4 +167,5 @@
     puts  ("  --use-ice           Enable ICE (default:no)");
     puts  ("  --add-codec=name    Manually add codec (default is to enable all)");
+    puts  ("  --dis-codec=name    Disable codec (can be specified multiple times)");
     puts  ("  --clock-rate=N      Override sound device clock rate");
     puts  ("  --null-audio        Use NULL audio device");
@@ -198,4 +203,5 @@
     puts  ("  --duration=SEC      Set maximum call duration (default:no limit)");
     puts  ("  --norefersub        Suppress event subscription when transfering calls");
+    puts  ("  --use-compact-form  Minimize SIP message size");
 
     puts  ("");
@@ -389,4 +395,5 @@
 	   OPT_TLS_NEG_TIMEOUT,
 	   OPT_CAPTURE_DEV, OPT_PLAYBACK_DEV,
+	   OPT_AUTO_UPDATE_NAT,OPT_USE_COMPACT_FORM,OPT_DIS_CODEC
     };
     struct pj_getopt_option long_options[] = {
@@ -413,4 +420,6 @@
 	{ "id",		1, 0, OPT_ID},
 	{ "contact",	1, 0, OPT_CONTACT},
+	{ "auto-update-nat",	1, 0, OPT_AUTO_UPDATE_NAT},
+        { "use-compact-form",	0, 0, OPT_USE_COMPACT_FORM},
 	{ "realm",	1, 0, OPT_REALM},
 	{ "username",	1, 0, OPT_USERNAME},
@@ -434,4 +443,5 @@
 	{ "use-ice",    0, 0, OPT_USE_ICE},
 	{ "add-codec",  1, 0, OPT_ADD_CODEC},
+	{ "dis-codec",  1, 0, OPT_DIS_CODEC},
 	{ "complexity",	1, 0, OPT_COMPLEXITY},
 	{ "quality",	1, 0, OPT_QUALITY},
@@ -661,4 +671,23 @@
 	    break;
 
+	case OPT_AUTO_UPDATE_NAT:   /* OPT_AUTO_UPDATE_NAT */
+            cur_acc->auto_update_nat  = pj_strtoul(pj_cstr(&tmp, pj_optarg));
+	    break;
+
+	case OPT_USE_COMPACT_FORM:
+	    /* enable compact form - from Ticket #342 */
+            {
+		extern pj_bool_t pjsip_use_compact_form;
+		extern pj_bool_t pjsip_include_allow_hdr_in_dlg;
+		extern pj_bool_t pjmedia_add_rtpmap_for_static_pt;
+
+		pjsip_use_compact_form = PJ_TRUE;
+		/* do not transmit Allow header */
+		pjsip_include_allow_hdr_in_dlg = PJ_FALSE;
+		/* Do not include rtpmap for static payload types (<96) */
+		pjmedia_add_rtpmap_for_static_pt = PJ_FALSE;
+            }
+	    break;
+
 	case OPT_NEXT_ACCOUNT: /* Add more account. */
 	    cfg->acc_cnt++;
@@ -785,4 +814,8 @@
 		return -1;
 	    }
+	    break;
+
+	case OPT_DIS_CODEC:
+            cfg->codec_dis[cfg->codec_dis_cnt++] = pj_str(pj_optarg);
 	    break;
 
@@ -1071,4 +1104,12 @@
     }
 
+    /*  */
+    //if (acc_cfg->auto_update_nat)
+    {
+	pj_ansi_sprintf(line, "--auto-update-nat %i\n",
+			(int)acc_cfg->auto_update_nat);
+	pj_strcat2(result, line);
+    }
+
     /* Proxy */
     for (i=0; i<acc_cfg->proxy_cnt; ++i) {
@@ -1119,4 +1160,5 @@
     pj_str_t cfg;
     char line[128];
+    extern pj_bool_t pjsip_use_compact_form;
 
     PJ_UNUSED_ARG(max);
@@ -1367,4 +1409,10 @@
 	pj_strcat2(&cfg, line);
     }
+    /* Disable codec */
+    for (i=0; i<config->codec_dis_cnt; ++i) {
+	pj_ansi_sprintf(line, "--dis-codec %s\n",
+		    config->codec_dis[i].ptr);
+	pj_strcat2(&cfg, line);
+    }
 
     pj_strcat2(&cfg, "\n#\n# User agent:\n#\n");
@@ -1394,4 +1442,8 @@
     }
 
+    if (pjsip_use_compact_form)
+    {
+	pj_strcat2(&cfg, "--use-compact-form\n");
+    }
 
     pj_strcat2(&cfg, "\n#\n# Buddies:\n#\n");
@@ -3489,4 +3541,9 @@
     }
 
+    /* Optionally disable some codec */
+    for (i=0; i<app_config.codec_dis_cnt; ++i) {
+	pjsua_codec_set_priority(&app_config.codec_dis[i],PJMEDIA_CODEC_PRIO_DISABLED);
+    }
+
     /* Add RTP transports */
     status = pjsua_media_transports_create(&app_config.rtp_cfg);
