2017-08-05 191 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