Changeset 1501 for pjproject/trunk/pjsip-apps/src/pjsua/pjsua_app.c
- Timestamp:
- Oct 16, 2007 1:34:14 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip-apps/src/pjsua/pjsua_app.c
r1500 r1501 1886 1886 1887 1887 /* 1888 * NAT type detection callback. 1889 */ 1890 static void on_nat_detect(const pj_stun_nat_detect_result *res) 1891 { 1892 if (res->status != PJ_SUCCESS) { 1893 pjsua_perror(THIS_FILE, "NAT detection failed", res->status); 1894 } else { 1895 PJ_LOG(3, (THIS_FILE, "NAT detected as %s", res->nat_type_name)); 1896 } 1897 } 1898 1899 1900 /* 1888 1901 * Print buddy list. 1889 1902 */ … … 2313 2326 2314 2327 2315 /* Callback upon NAT detection completion */2316 static void nat_detect_cb(void *user_data,2317 const pj_stun_nat_detect_result *res)2318 {2319 PJ_UNUSED_ARG(user_data);2320 2321 if (res->status != PJ_SUCCESS) {2322 pjsua_perror(THIS_FILE, "NAT detection failed", res->status);2323 } else {2324 PJ_LOG(3, (THIS_FILE, "NAT detected as %s", res->nat_type_name));2325 }2326 }2327 2328 2329 /*2330 * Detect NAT type.2331 */2332 static void detect_nat_type(void)2333 {2334 pj_status_t status;2335 2336 status = pjsua_detect_nat_type(NULL, &nat_detect_cb);2337 if (status != PJ_SUCCESS)2338 pjsua_perror(THIS_FILE, "Error", status);2339 }2340 2341 2342 2328 /* 2343 2329 * Main "user interface" loop. … … 2454 2440 2455 2441 case 'n': 2456 detect_nat_type();2442 pjsua_detect_nat_type(); 2457 2443 break; 2458 2444 … … 3308 3294 app_config.cfg.cb.on_call_transfer_status = &on_call_transfer_status; 3309 3295 app_config.cfg.cb.on_call_replaced = &on_call_replaced; 3296 app_config.cfg.cb.on_nat_detect = &on_nat_detect; 3310 3297 3311 3298 /* Initialize pjsua */ … … 3509 3496 return status; 3510 3497 } 3511 3512 if (app_config.cfg.stun_domain.slen || app_config.cfg.stun_host.slen)3513 detect_nat_type();3514 3498 3515 3499 console_app_main(&uri_arg);
Note: See TracChangeset
for help on using the changeset viewer.