Changeset 3923 for pjproject/trunk/pjsip-apps/src/vidgui/vidgui.cpp
- Timestamp:
- Dec 26, 2011 9:03:13 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip-apps/src/vidgui/vidgui.cpp
r3733 r3923 31 31 #define THIS_FILE "vidgui.cpp" 32 32 33 /////////////////////////////////////////////////////////////////////////// 34 // 35 // SETTINGS 36 // 37 38 // 33 39 // These configure SIP registration 34 #define SIP_DOMAIN NULL 35 //#define SIP_DOMAIN "pjsip.org" 40 // 41 #define USE_REGISTRATION 0 42 #define SIP_DOMAIN "pjsip.org" 36 43 #define SIP_USERNAME "vidgui" 37 44 #define SIP_PASSWORD "secret" 38 #define SIP_PORT 5060 39 45 #define SIP_PORT 5084 46 #define SIP_TCP 1 47 48 // 49 // NAT helper settings 50 // 51 #define USE_ICE 1 52 #define USE_STUN 0 53 #define STUN_SRV "stun.pjsip.org" 54 55 // 56 // Devices settings 57 // 40 58 #define DEFAULT_CAP_DEV PJMEDIA_VID_DEFAULT_CAPTURE_DEV 41 59 //#define DEFAULT_CAP_DEV 1 42 60 #define DEFAULT_REND_DEV PJMEDIA_VID_DEFAULT_RENDER_DEV 61 62 63 // 64 // End of Settings 65 /////////////////////////////////////////////////////////////////////////// 66 43 67 44 68 MainWin *MainWin::theInstance_; … … 327 351 pjsua_call_get_info(call_id, &ci); 328 352 329 if (currentCall_ == -1 && ci.state < PJSIP_INV_STATE_DISCONNECTED) { 353 if (currentCall_ == -1 && ci.state < PJSIP_INV_STATE_DISCONNECTED && 354 ci.role == PJSIP_ROLE_UAC) 355 { 330 356 emit signalNewCall(call_id, false); 331 357 } … … 436 462 ua_cfg.cb.on_incoming_call = &::on_incoming_call; 437 463 ua_cfg.cb.on_call_media_state = &::on_call_media_state; 464 #if USE_STUN 465 ua_cfg.stun_srv_cnt = 1; 466 ua_cfg.stun_srv[0] = pj_str((char*)STUN_SRV); 467 #endif 438 468 439 469 pjsua_logging_config log_cfg; … … 443 473 pjsua_media_config med_cfg; 444 474 pjsua_media_config_default(&med_cfg); 475 med_cfg.enable_ice = USE_ICE; 445 476 446 477 status = pjsua_init(&ua_cfg, &log_cfg, &med_cfg); … … 472 503 } 473 504 505 #if SIP_TCP 474 506 pjsua_transport_config tcp_cfg; 475 507 pjsua_transport_config_default(&tcp_cfg); … … 482 514 goto on_error; 483 515 } 516 #endif 484 517 485 518 // … … 488 521 pjsua_acc_config acc_cfg; 489 522 pjsua_acc_config_default(&acc_cfg); 490 #if SIP_DOMAIN491 acc_cfg.id = pj_str( "sip:" SIP_USERNAME "@" SIP_DOMAIN);523 #if USE_REGISTRATION 524 acc_cfg.id = pj_str( (char*)"<sip:" SIP_USERNAME "@" SIP_DOMAIN ">"); 492 525 acc_cfg.reg_uri = pj_str((char*) ("sip:" SIP_DOMAIN)); 493 526 acc_cfg.cred_count = 1; … … 496 529 acc_cfg.cred_info[0].username = pj_str((char*)SIP_USERNAME); 497 530 acc_cfg.cred_info[0].data = pj_str((char*)SIP_PASSWORD); 531 532 # if SIP_TCP 533 acc_cfg.proxy[acc_cfg.proxy_cnt++] = pj_str((char*) "<sip:" SIP_DOMAIN ";transport=tcp>"); 534 # endif 535 498 536 #else 499 537 char sip_id[80]; … … 506 544 #endif 507 545 508 acc_cfg.max_video_cnt = 1;509 546 acc_cfg.vid_cap_dev = DEFAULT_CAP_DEV; 510 547 acc_cfg.vid_rend_dev = DEFAULT_REND_DEV;
Note: See TracChangeset
for help on using the changeset viewer.