2013-12-09 28 views
1

我提出打造最新的樹幹,在Android PJSIP並得到眩暈錯誤:PJSIP的Android眩暈超時

12-10 00:19:25.340 21917-21917/I/pjsua﹕ pjsua version 2.1-svn for Linux-3.0.15/armv7l initialized 
12-10 00:19:25.345 21917-21917/I/pjsua﹕ PJSUA state changed: CREATED --> INIT 
12-10 00:19:25.345 21917-21917/I/pjsua﹕ Module "mod-default-handler" registered 
12-10 00:19:25.365 21917-21917/I/pjsua﹕ STUN mapped address found/changed: ip1:40865 
12-10 00:19:25.365 21917-21917/I/pjsua﹕ STUN resolution success, using ip1:3480, address is ip2:3480 
12-10 00:19:27.380 21917-21917/I/pjsua﹕ Error contacting STUN server: Received no response from STUN server (PJLIB_UTIL_ESTUNNOTRESPOND) [status=320010] 
12-10 00:19:27.380 21917-21917/I/pjsua﹕ Shutting down, flags=0... 
12-10 00:19:27.380 21917-21917/I/pjsua﹕ PJSUA state changed: INIT --> CLOSING 

同眩暈配置做工精細用相同的代碼(iOS和舊PJSIP樹幹):

my_config-> cfg.stun_srv_cnt = 3;

const char *stun = "ip1:3480"; 
if (stun && strlen(stun)) pj_strdup2_with_null(my_config->pool,&(my_config->cfg.stun_srv[0]),stun); 
const char *stun1 = "ip2:3480"; 
if (stun1 && strlen(stun1)) pj_strdup2_with_null(my_config->pool,&(my_config->cfg.stun_srv[1]),stun1); 
const char *stun2 = "ip3:3480"; 
if (stun2 && strlen(stun2)) pj_strdup2_with_null(my_config->pool,&(my_config->cfg.stun_srv[2]),stun2); 

ip1-3是我喜歡1.1.1.1

IP地址,我看起來怪怪的兩件事情:1。 根據日誌,STUN服務器發現IP地址,但後來不知什麼原因開始尋找再次 2.爲什麼pjsip lib不要嘗試下一個服務器,而只是停止庫。

我試着做my_config-> cfg.stun_ignore_failure = PJ_TRUE; 但沒有成功......

回答

1
Index: pjsip/sources/pjsip/src/pjsua-lib/pjsua_core.c 
=================================================================== 
--- pjsip.orig/sources/pjsip/src/pjsua-lib/pjsua_core.c 2013-03-31 19:06:27.202008510 +0200 
+++ pjsip/sources/pjsip/src/pjsua-lib/pjsua_core.c 2013-03-31 19:06:31.322008598 +0200 
@@ -1954,7 +1954,7 @@ 
      pj_ntohs(pjsua_var.stun_srv.ipv4.sin_port); 
    status = pjstun_get_mapped_addr2(&pjsua_var.cp.factory, &stun_opt, 
        1, &sock, &p_pub_addr->ipv4); 
- if (status != PJ_SUCCESS) { 
+ if (status != PJ_SUCCESS && !pjsua_var.ua_cfg.stun_ignore_failure) { 
     pjsua_perror(THIS_FILE, "Error contacting STUN server", status); 
     pj_sock_close(sock); 
     return status; 

感謝您雷吉斯從csipsimple ...