Ignore:
Timestamp:
Oct 12, 2007 12:14:27 PM (17 years ago)
Author:
bennylp
Message:

Ticket #399: Initial implementation of tool to perform NAT type detection/classification

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip-apps/src/pjsua_wince/pjsua_wince.cpp

    r1260 r1495  
    5757        // Use this to have the STUN server resolved normally 
    5858#   define STUN_DOMAIN  NULL 
    59 #   define STUN_SERVER  "stun.fwdnet.net" 
     59#   define STUN_SERVER  "192.168.0.2" 
    6060#elif 0 
    6161        // Use this to have the STUN server resolved with DNS SRV 
     
    516516 
    517517 
     518/* Callback upon NAT detection completion */ 
     519static void nat_detect_cb(void *user_data, 
     520                          const pj_stun_nat_detect_result *res) 
     521{ 
     522    PJ_UNUSED_ARG(user_data); 
     523 
     524    if (res->status != PJ_SUCCESS) { 
     525        char msg[250]; 
     526        pj_ansi_snprintf(msg, sizeof(msg), "NAT detection failed: %s", 
     527                         res->status_text); 
     528        SetCallStatus(msg, pj_ansi_strlen(msg)); 
     529    } else { 
     530        char msg[250]; 
     531        pj_ansi_snprintf(msg, sizeof(msg), "NAT type is %s", 
     532                         res->nat_type_name); 
     533        SetCallStatus(msg, pj_ansi_strlen(msg)); 
     534    } 
     535} 
     536 
    518537 
    519538BOOL InitInstance(HINSTANCE hInstance, int nCmdShow) 
     
    549568 
    550569    SetTimer(hMainWnd, ID_POLL_TIMER, 50, NULL); 
     570 
     571    pjsua_detect_nat_type(NULL, &nat_detect_cb); 
    551572    return TRUE; 
    552573} 
Note: See TracChangeset for help on using the changeset viewer.