Index: /pjproject/trunk/pjsip-apps/src/pocketpj/PocketPJ.rc
===================================================================
--- /pjproject/trunk/pjsip-apps/src/pocketpj/PocketPJ.rc	(revision 1855)
+++ /pjproject/trunk/pjsip-apps/src/pocketpj/PocketPJ.rc	(revision 1856)
@@ -98,5 +98,5 @@
 END
 
-IDD_SETTING DIALOG DISCARDABLE  0, 0, 140, 119
+IDD_SETTING DIALOG DISCARDABLE  0, 0, 140, 127
 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
 CAPTION "PocketPJ Settings.."
@@ -112,14 +112,17 @@
                     WS_TABSTOP,7,65,47,10
     EDITTEXT        IDC_STUN_SRV,56,64,77,12,ES_AUTOHSCROLL
-    CONTROL         "ICE",IDC_ICE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,80,
+    CONTROL         "ICE",IDC_ICE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,79,
                     27,10
     CONTROL         "SRTP",IDC_SRTP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,47,
-                    80,33,10
+                    79,33,10
     CONTROL         "PUBLISH",IDC_PUBLISH,"Button",BS_AUTOCHECKBOX | 
-                    WS_TABSTOP,85,80,43,10
+                    WS_TABSTOP,85,79,43,10
     EDITTEXT        IDC_DNS,38,49,78,12,ES_AUTOHSCROLL
     LTEXT           "DNS:",IDC_STATIC,8,50,30,9
-    PUSHBUTTON      "OK",IDOK,17,98,50,14
-    PUSHBUTTON      "Cancel",IDCANCEL,73,98,50,14
+    PUSHBUTTON      "OK",IDOK,17,106,50,14
+    PUSHBUTTON      "Cancel",IDCANCEL,73,106,50,14
+    CONTROL         "Suppress echo, tail:",IDC_ECHO_SUPPRESS,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,7,92,79,10
+    EDITTEXT        IDC_EC_TAIL,89,91,33,12,ES_AUTOHSCROLL
 END
 
@@ -190,5 +193,5 @@
         RIGHTMARGIN, 133
         TOPMARGIN, 7
-        BOTTOMMARGIN, 112
+        BOTTOMMARGIN, 120
     END
 END
Index: /pjproject/trunk/pjsip-apps/src/pocketpj/PocketPJ.vcc
===================================================================
--- /pjproject/trunk/pjsip-apps/src/pocketpj/PocketPJ.vcc	(revision 1855)
+++ /pjproject/trunk/pjsip-apps/src/pocketpj/PocketPJ.vcc	(revision 1856)
@@ -13,6 +13,6 @@
 
 ResourceCount=5
-Resource2=IDD_POCKETPJ_DIALOG
-Resource3=IDD_SETTING
+Resource2=IDD_SETTING
+Resource3=IDD_POCKETPJ_DIALOG
 Resource4=IDR_ACC_MENU
 Resource1=IDR_MAINFRAME
@@ -67,5 +67,5 @@
 Type=1
 Class=CSettingsDlg
-ControlCount=15
+ControlCount=17
 Control1=IDC_STATIC,static,1342308352
 Control2=IDC_DOMAIN,edit,1350631552
@@ -83,4 +83,6 @@
 Control14=IDOK,button,1342242816
 Control15=IDCANCEL,button,1342242816
+Control16=IDC_ECHO_SUPPRESS,button,1342242819
+Control17=IDC_EC_TAIL,edit,1350631552
 
 [CLS:CSettingsDlg]
@@ -91,4 +93,4 @@
 Filter=D
 VirtualFilter=dWC
-LastObject=CSettingsDlg
+LastObject=IDC_ECHO_SUPPRESS
 
Index: /pjproject/trunk/pjsip-apps/src/pocketpj/PocketPJDlg.cpp
===================================================================
--- /pjproject/trunk/pjsip-apps/src/pocketpj/PocketPJDlg.cpp	(revision 1855)
+++ /pjproject/trunk/pjsip-apps/src/pocketpj/PocketPJDlg.cpp	(revision 1856)
@@ -179,5 +179,10 @@
     media_cfg.thread_cnt = 1;
     media_cfg.enable_ice = m_Cfg.m_UseIce;
-    
+
+    if (m_Cfg.m_EchoSuppress) {
+	media_cfg.ec_options = PJMEDIA_ECHO_SIMPLE;
+	media_cfg.ec_tail_len = m_Cfg.m_EcTail;
+    }
+
     // Init
     PopUp_Modify(POPUP_REGISTRATION, POPUP_EL_TITLE3, "Initializing..");
Index: /pjproject/trunk/pjsip-apps/src/pocketpj/SettingsDlg.cpp
===================================================================
--- /pjproject/trunk/pjsip-apps/src/pocketpj/SettingsDlg.cpp	(revision 1855)
+++ /pjproject/trunk/pjsip-apps/src/pocketpj/SettingsDlg.cpp	(revision 1856)
@@ -25,4 +25,6 @@
 #define REG_BUDDY_CNT	_T("BuddyCnt")
 #define REG_BUDDY_X	_T("Buddy%u")
+#define REG_ENABLE_EC	_T("EnableEC")
+#define REG_EC_TAIL	_T("ECTail")
 
 
@@ -70,8 +72,12 @@
     if (key.QueryValue(dwordVal, REG_USE_STUN) == ERROR_SUCCESS) {
 	m_UseStun = dwordVal != 0;
+    } else {
+	m_UseStun = 0;
     }
 
     if (key.QueryValue(dwordVal, REG_USE_ICE) == ERROR_SUCCESS) {
 	m_UseIce = dwordVal != 0;
+    } else {
+	m_UseIce = 0;
     }
 
@@ -79,4 +85,6 @@
     if (key.QueryValue(dwordVal, REG_USE_SRTP) == ERROR_SUCCESS) {
 	m_UseSrtp = dwordVal != 0;
+    } else {
+	m_UseSrtp = 0;
     }
 
@@ -85,4 +93,18 @@
     if (key.QueryValue(dwordVal, REG_USE_PUBLISH) == ERROR_SUCCESS) {
 	m_UsePublish = dwordVal != 0;
+    }
+
+    cbData = sizeof(dwordVal);
+    if (key.QueryValue(dwordVal, REG_ENABLE_EC) == ERROR_SUCCESS) {
+	m_EchoSuppress = dwordVal != 0;
+    } else {
+	m_EchoSuppress = 0;
+    }
+
+    cbData = sizeof(dwordVal);
+    if (key.QueryValue(dwordVal, REG_EC_TAIL) == ERROR_SUCCESS) {
+	m_EcTail = dwordVal;
+    } else {
+	m_EcTail = 2;
     }
 
@@ -128,7 +150,10 @@
     key.SetValue(m_UsePublish, REG_USE_PUBLISH);
 
+    key.SetValue(m_EchoSuppress, REG_ENABLE_EC);
+    key.SetValue(m_EcTail, REG_EC_TAIL);
+
     key.SetValue(m_BuddyList.GetSize(), REG_BUDDY_CNT);
 
-    unsigned i;
+    int i;
     for (i=0; i<m_BuddyList.GetSize(); ++i) {
 	CString entry;
@@ -158,4 +183,6 @@
 	m_User = _T("");
 	m_Dns = _T("");
+	m_EchoSuppress = FALSE;
+	m_EcTail = _T("");
 	//}}AFX_DATA_INIT
 
@@ -169,4 +196,9 @@
 	m_User	    = m_Cfg.m_User;
 	m_Dns	    = m_Cfg.m_DNS;
+	m_EchoSuppress = m_Cfg.m_EchoSuppress;
+
+	CString s;
+	s.Format(_T("%d"), m_Cfg.m_EcTail);
+	m_EcTail    = s;
 }
 
@@ -185,4 +217,6 @@
 	DDX_Text(pDX, IDC_USER, m_User);
 	DDX_Text(pDX, IDC_DNS, m_Dns);
+	DDX_Check(pDX, IDC_ECHO_SUPPRESS, m_EchoSuppress);
+	DDX_Text(pDX, IDC_EC_TAIL, m_EcTail);
 	//}}AFX_DATA_MAP
 }
@@ -191,5 +225,6 @@
 BEGIN_MESSAGE_MAP(CSettingsDlg, CDialog)
 	//{{AFX_MSG_MAP(CSettingsDlg)
-		// NOTE: the ClassWizard will add message map macros here
+	ON_BN_CLICKED(IDC_STUN, OnStun)
+	ON_BN_CLICKED(IDC_ECHO_SUPPRESS, OnEchoSuppress)
 	//}}AFX_MSG_MAP
 END_MESSAGE_MAP()
@@ -204,14 +239,24 @@
     if (rc == IDOK) {
 	m_Cfg.m_Domain	    = m_Domain;
-	m_Cfg.m_UseIce	    = m_ICE;
+	m_Cfg.m_UseIce	    = m_ICE != 0;
 	m_Cfg.m_Password    = m_Passwd;
-	m_Cfg.m_UsePublish  = m_PUBLISH;
-	m_Cfg.m_UseSrtp	    = m_SRTP;
-	m_Cfg.m_UseStun	    = m_STUN;
+	m_Cfg.m_UsePublish  = m_PUBLISH != 0;
+	m_Cfg.m_UseSrtp	    = m_SRTP != 0;
+	m_Cfg.m_UseStun	    = m_STUN != 0;
 	m_Cfg.m_StunSrv	    = m_StunSrv;
 	m_Cfg.m_User	    = m_User;
 	m_Cfg.m_DNS	    = m_Dns;
+	m_Cfg.m_EchoSuppress= m_EchoSuppress != 0;
+	m_Cfg.m_EcTail	    = _ttoi(m_EcTail);
     }
 
     return rc;
 }
+
+void CSettingsDlg::OnStun() 
+{
+}
+
+void CSettingsDlg::OnEchoSuppress() 
+{
+}
Index: /pjproject/trunk/pjsip-apps/src/pocketpj/SettingsDlg.h
===================================================================
--- /pjproject/trunk/pjsip-apps/src/pocketpj/SettingsDlg.h	(revision 1855)
+++ /pjproject/trunk/pjsip-apps/src/pocketpj/SettingsDlg.h	(revision 1856)
@@ -22,4 +22,6 @@
     bool	m_UsePublish;
     CString	m_DNS;
+    bool	m_EchoSuppress;
+    DWORD	m_EcTail;
 
     CArray<CString,CString> m_BuddyList;
@@ -54,4 +56,6 @@
 	CString	m_User;
 	CString	m_Dns;
+	BOOL	m_EchoSuppress;
+	CString	m_EcTail;
 	//}}AFX_DATA
 
@@ -72,5 +76,6 @@
 	// Generated message map functions
 	//{{AFX_MSG(CSettingsDlg)
-		// NOTE: the ClassWizard will add member functions here
+	afx_msg void OnStun();
+	afx_msg void OnEchoSuppress();
 	//}}AFX_MSG
 	DECLARE_MESSAGE_MAP()
Index: /pjproject/trunk/pjsip-apps/src/pocketpj/resource.h
===================================================================
--- /pjproject/trunk/pjsip-apps/src/pocketpj/resource.h	(revision 1855)
+++ /pjproject/trunk/pjsip-apps/src/pocketpj/resource.h	(revision 1856)
@@ -34,5 +34,7 @@
 #define IDC_DNS                         1019
 #define IDC_TITLE3                      1020
+#define IDC_ECHO_SUPPRESS               1020
 #define IDC_BUTTON1                     1021
+#define IDC_EC_TAIL                     1021
 #define IDC_BUTTON2                     1022
 #define IDS_CAP_ONLINE                  32772
