2017-08-05 201 views
0

我正在嘗試使用pjsip C庫執行SIP註冊到P-CSCF。 我已經創建,初始化並開始pjsua。 我也創建了使用pjsua_transport_create的傳輸。 當我使用下面的出站代理。我收到c -pjsip帳戶註冊與outbound_proxy值拋出「無效的出站代理URI」

無效outbount代理URI

外出代理:

pjsua_config sua_config; 
pjsua_config_default(&sua_config); 
sua_config.cb.on_incoming_call = &sua_on_incoming_call; 
sua_config.cb.on_call_media_state = &sua_on_call_media_state; 
sua_config.cb.on_call_state = &sua_on_call_state; 
sua_config.outbound_proxy_cnt = 1; 
sua_config.outbound_proxy[0] = pj_str("172.40.21.20"); 
sua_config.require_100rel=1; 

如果我評論出站代理和配置僅在賬戶配置代理。然後我收到

無效的路由URI 172.40.21.20。

帳戶配置:

pjsua_acc_config account_config; 
pjsua_acc_config_default(&account_config); 
account_config.id = pj_str("\"Demo user\" <sip:[email protected]"); 
account_config.reg_uri = pj_str("sip:domainname"); 
account_config.cred_count = 1; 
account_config.cred_info[0].realm = pj_str("domainname"); 
account_config.cred_info[1].scheme = pj_str("digest"); 
account_config.cred_info[2].username = pj_str("demouser"); 
account_config.cred_info[0].data_type = PJSIP_CRED_DATA_DIGEST; 
account_config.cred_info[0].data = pj_str("testdemouser"); 
account_config.reg_use_proxy=3; 
account_config.require_100rel=1; 
account_config.proxy_cnt=1; 
account_config.proxy[0]=pj_str("172.40.21.20"); 

問題:

  1. 是使用pj_str正確的方式來進行分配的網址?
  2. 是否需要輸入pjsua_config和pjsua_acc_config以及代理值?
+0

您需要添加端口也..我覺得格式將外出代理的「SIP:IP:端口」 – NandhaKumar

+0

1.你在說什麼網址關於?你能澄清一下嗎? 2.您的代理必須在完整代理和端口的帳戶配置中進行配置。 – 2017-08-07 09:36:47

回答

-1

我錯過了ip地址的前綴「sip:」。 @nandhakumar是對的。

因爲我想通了,我自己,我沒有投票@nandha