Changeset 2211 for pjproject/trunk/pjsip-apps/src/pocketpj/PocketPJDlg.cpp
- Timestamp:
- Aug 13, 2008 1:56:24 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip-apps/src/pocketpj/PocketPJDlg.cpp
r1964 r2211 81 81 BOOL CPocketPJDlg::Restart() 82 82 { 83 unsigned i; 83 84 pj_status_t status; 84 85 … … 179 180 media_cfg.thread_cnt = 1; 180 181 media_cfg.enable_ice = m_Cfg.m_UseIce; 182 media_cfg.no_vad = !m_Cfg.m_VAD; 181 183 182 184 if (m_Cfg.m_EchoSuppress) { … … 196 198 197 199 // Create one UDP transport 198 PopUp_Modify(POPUP_REGISTRATION, POPUP_EL_TITLE3, "Add transport..");200 PopUp_Modify(POPUP_REGISTRATION, POPUP_EL_TITLE3, "Adding UDP transport.."); 199 201 pjsua_transport_id transport_id; 200 202 pjsua_transport_config udp_cfg; … … 211 213 } 212 214 215 if (m_Cfg.m_TCP) { 216 // Create one TCP transport 217 PopUp_Modify(POPUP_REGISTRATION, POPUP_EL_TITLE3, "Adding TCP transport.."); 218 pjsua_transport_id transport_id; 219 pjsua_transport_config tcp_cfg; 220 221 pjsua_transport_config_default(&tcp_cfg); 222 tcp_cfg.port = 0; 223 status = pjsua_transport_create(PJSIP_TRANSPORT_TCP, 224 &tcp_cfg, &transport_id); 225 if (status != PJ_SUCCESS) { 226 Error(_T("Error creating TCP transport"), status); 227 pjsua_destroy(); 228 PopUp_Hide(POPUP_REGISTRATION); 229 return FALSE; 230 } 231 } 232 213 233 // Adjust codecs priority 214 234 pj_str_t tmp; 215 pjsua_codec_set_priority(pj_cstr(&tmp, "speex"), 0); 216 pjsua_codec_set_priority(pj_cstr(&tmp, "speex/8000"), 200); 217 pjsua_codec_set_priority(pj_cstr(&tmp, "GSM"), 180); 218 pjsua_codec_set_priority(pj_cstr(&tmp, "PCMU"), 160); 219 pjsua_codec_set_priority(pj_cstr(&tmp, "PCMA"), 150); 220 pjsua_codec_set_priority(pj_cstr(&tmp, "iLBC"), 0); 221 pjsua_codec_set_priority(pj_cstr(&tmp, "L16"), 0); 222 235 pjsua_codec_set_priority(pj_cstr(&tmp, "*"), 0); 236 for (i=0; i<(unsigned)m_Cfg.m_Codecs.GetSize(); ++i) { 237 CString codec = m_Cfg.m_Codecs.GetAt(i); 238 char tmp_nam[80]; 239 240 pj_unicode_to_ansi((LPCTSTR)codec, codec.GetLength(), 241 tmp_nam, sizeof(tmp_nam)); 242 pjsua_codec_set_priority(pj_cstr(&tmp, tmp_nam), 200-i); 243 } 223 244 224 245 // Start! … … 262 283 acc_cfg.publish_enabled = m_Cfg.m_UsePublish; 263 284 285 char route[80]; 286 if (m_Cfg.m_TCP) { 287 snprintf(route, sizeof(route), "<sip:%s;lr;transport=tcp>", domain); 288 acc_cfg.proxy[acc_cfg.proxy_cnt++] = pj_str(route); 289 } else { 290 snprintf(route, sizeof(route), "<sip:%s;lr>", domain); 291 acc_cfg.proxy[acc_cfg.proxy_cnt++] = pj_str(route); 292 } 293 264 294 status = pjsua_acc_add(&acc_cfg, PJ_TRUE, &m_PjsuaAccId); 265 295 if (status != PJ_SUCCESS) { … … 367 397 "Answer", "Hangup", 0); 368 398 pjsua_call_answer(0, 180, NULL, NULL); 399 if (m_Cfg.m_AutoAnswer) 400 OnPopUpButton(1); 369 401 break; 370 402 case PJSIP_INV_STATE_EARLY: /**< After response with To tag. */
Note: See TracChangeset
for help on using the changeset viewer.