Changeset 1495 for pjproject/trunk/pjsip-apps/src/pjsua/pjsua_app.c
- Timestamp:
- Oct 12, 2007 12:14:27 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip-apps/src/pjsua/pjsua_app.c
r1490 r1495 20 20 21 21 22 #define THIS_FILE "pjsua .c"22 #define THIS_FILE "pjsua_app.c" 23 23 #define NO_LIMIT (int)0x7FFFFFFF 24 24 … … 2308 2308 2309 2309 2310 /* Callback upon NAT detection completion */ 2311 static void nat_detect_cb(void *user_data, 2312 const pj_stun_nat_detect_result *res) 2313 { 2314 PJ_UNUSED_ARG(user_data); 2315 2316 if (res->status != PJ_SUCCESS) { 2317 pjsua_perror(THIS_FILE, "NAT detection failed", res->status); 2318 } else { 2319 PJ_LOG(3, (THIS_FILE, "NAT detected as %s", res->nat_type_name)); 2320 } 2321 } 2322 2323 2324 /* 2325 * Detect NAT type. 2326 */ 2327 static void detect_nat_type(void) 2328 { 2329 pj_status_t status; 2330 2331 status = pjsua_detect_nat_type(NULL, &nat_detect_cb); 2332 if (status != PJ_SUCCESS) 2333 pjsua_perror(THIS_FILE, "Error", status); 2334 } 2335 2336 2310 2337 /* 2311 2338 * Main "user interface" loop. … … 2421 2448 break; 2422 2449 2450 case 'n': 2451 detect_nat_type(); 2452 break; 2453 2423 2454 case 'i': 2424 2455 /* Send instant messaeg */ … … 3474 3505 } 3475 3506 3507 if (app_config.cfg.stun_domain.slen || app_config.cfg.stun_host.slen) 3508 detect_nat_type(); 3509 3476 3510 console_app_main(&uri_arg); 3477 3511
Note: See TracChangeset
for help on using the changeset viewer.