Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/219.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android pjsua2示例应用程序传出呼叫通过TCP连接获得403禁止响应_Android_Sip_Pjsip_Pjsua2 - Fatal编程技术网

Android pjsua2示例应用程序传出呼叫通过TCP连接获得403禁止响应

Android pjsua2示例应用程序传出呼叫通过TCP连接获得403禁止响应,android,sip,pjsip,pjsua2,Android,Sip,Pjsip,Pjsua2,我已经在pjsua示例应用程序中成功注册了我的sip客户端,并且正在通过UDP接收传入呼叫。但当我试图打一个呼出的电话时,它会被403禁止错误断开。创建的连接是TCP 我验证了目标uri。格式如下: sip:移动电话-number@sip-服务器ip:端口 以下是我的makeCall代码: 公共void makeCall(视图){ 此时将显示调用活动。日志如下所示 --------- beginning of system some media and call related initia

我已经在pjsua示例应用程序中成功注册了我的sip客户端,并且正在通过UDP接收传入呼叫。但当我试图打一个呼出的电话时,它会被403禁止错误断开。创建的连接是TCP

我验证了目标uri。格式如下:

sip:移动电话-number@sip-服务器ip:端口

以下是我的makeCall代码:

公共void makeCall(视图){

此时将显示调用活动。日志如下所示

  --------- beginning of system
some media and call related initializations
I/System.out: 17:52:37.581 tcpc0x93d09414  ...TCP client transport created
I/System.out: 17:52:37.583 tcpc0x93d09414  ...TCP transport 192.168.43.167:58160 is connecting to <sip-server-ip>:5060...
I/System.out: 17:52:37.584   pjsua_core.c  ...TX 1443 bytes Request msg INVITE/cseq=20547 (tdta0xa8dc0064) to TCP <sip-server-ip>:5060:
I/System.out: INVITE sip:<mobile-number>@<sip-server-ip> SIP/2.0
I/System.out: Via: SIP/2.0/TCP 192.168.43.167:58160;rport;branch=z9hG4bKPj3f2aec57-9f79-46f5-bf03-9f9cb9d482ca;alias
I/System.out: Max-Forwards: 70
I/System.out: From: sip:<sip-account-number>@<sip-server-ip>;tag=90b152c8-fd44-41a3-9851-482da18ee67a
I/System.out: To: sip:<mobile-number>@<sip-server-ip>
I/System.out: Contact: <sip:sip-account-number@25.16.198.109:6000;ob>
I/System.out: Call-ID: c891a91e-054f-426d-810e-3ac2ba55e4f5
I/System.out: CSeq: 20547 INVITE
I/System.out: Route: <sip:sip-server-ip;lr>
I/System.out: Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, INFO, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS
I/System.out: Supported: replaces, 100rel, timer, norefersub
I/System.out: Session-Expires: 1800

**some more logs here**

I/System.out: 17:52:37.762   pjsua_core.c  .RX 374 bytes Response msg 100/INVITE/cseq=20547 (rdata0x93d095e0) from TCP <sip-server-ip>:5060:

I/System.out: SIP/2.0 100 Trying

I/System.out: Via: SIP/2.0/TCP 192.168.43.167:58160;branch=z9hG4bKPj3f2aec57-9f79-46f5-bf03-9f9cb9d482ca;received=137.97.99.211;rport=58160;alias

I/System.out: Call-ID: c891a91e-054f-426d-810e-3ac2ba55e4f5

I/System.out: From: <sip:sip-account-number>@sip-server-ip>;tag=90b152c8-fd44-41a3-9851-482da18ee67a

I/System.out: To: <sip:mobile-number@sip-server-ip>

I/System.out: CSeq: 20547 INVITE

I/System.out: Content-Length: 0

I/System.out: --end msg--

I/System.out: 17:52:37.766   pjsua_core.c  .RX 368 bytes Response msg 403/INVITE/cseq=20547 (rdata0x93d095e0) from TCP <sip-server-ip>:5060:

I/System.out: SIP/2.0 403 Forbidden

I/System.out: Via: SIP/2.0/TCP 192.168.43.167:58160;branch=z9hG4bKPj3f2aec57-9f79-46f5-bf03-9f9cb9d482ca;rport;alias

I/System.out: Call-ID: c891a91e-054f-426d-810e-3ac2ba55e4f5

I/System.out: From: <sip:sip-account-number@sip-server-ip>;tag=90b152c8-fd44-41a3-9851-482da18ee67a

I/System.out: To: <sip:sip-account-number@sip-server-ip>;tag=sbc0909b28y79co

I/System.out: CSeq: 20547 INVITE

I/System.out: Content-Length: 0

I/System.out: --end msg--
-----------系统开始
一些与媒体和呼叫相关的初始化
I/System.out:17:52:37.581 tcpc0x93d09414…已创建TCP客户端传输
I/System.out:17:52:37.583 tcpc0x93d09414…TCP传输192.168.43.167:58160正在连接到:5060。。。
I/System.out:17:52:37.584 pjsua_core.c…发送1443字节请求消息INVITE/cseq=20547(tdta0xa8dc0064)到TCP:5060:
I/System.out:INVITE sip:@sip/2.0
I/System.out:Via:SIP/2.0/TCP 192.168.43.167:58160;rport;branch=z9hG4bKPj3f2aec57-9f79-46f5-bf03-9f9cb9d482ca;别名
I/System.out:最大转发:70
I/System.out:From:sip:@;标签=90b152c8-fd44-41a3-9851-482da18ee67a
I/System.out:至:sip:@
I/System.out:联系方式:
I/System.out:呼叫ID:c891a91e-054f-426d-810e-3ac2ba55e4f5
I/System.out:CSeq:20547邀请
I/System.out:路线:
I/System.out:允许:PRACK、INVITE、ACK、BYE、CANCEL、UPDATE、INFO、SUBSCRIBE、NOTIFY、reference、MESSAGE、OPTIONS
I/System.out:支持:替换、100rel、计时器、norefersub
I/System.out:会话到期:1800
**这里还有一些日志**
I/System.out:17:52:37.762 pjsua_core.c.RX 374字节响应消息100/INVITE/cseq=20547(rdata0x93d095e0)来自TCP:5060:
I/System.out:SIP/2.0
I/System.out:Via:SIP/2.0/TCP 192.168.43.167:58160;branch=z9hG4bKPj3f2aec57-9f79-46f5-bf03-9f9cb9d482ca;received=137.97.99.211;rport=58160;别名
I/System.out:呼叫ID:c891a91e-054f-426d-810e-3ac2ba55e4f5
I/System.out:From:@sip server ip>;tag=90b152c8-fd44-41a3-9851-482da18ee67a
I/System.out:至:
I/System.out:CSeq:20547邀请
I/System.out:内容长度:0
I/System.out:--结束消息--
I/System.out:17:52:37.766 pjsua_core.c.RX 368字节响应消息403/INVITE/cseq=20547(rdata0x93d095e0)来自TCP:5060:
I/System.out:SIP/2.0 403禁止
I/System.out:Via:SIP/2.0/TCP 192.168.43.167:58160;分支=z9hG4bKPj3f2aec57-9f79-46f5-bf03-9f9cb9d482ca;rport;别名
I/System.out:呼叫ID:c891a91e-054f-426d-810e-3ac2ba55e4f5
I/System.out:From:;标签=90b152c8-fd44-41a3-9851-482da18ee67a
I/System.out:To:;标签=sbc0909b28y79co
I/System.out:CSeq:20547邀请
I/System.out:内容长度:0
I/System.out:--结束消息--

在不断尝试之后,我自己解决了它。在pjsip pjsua中,在我们设置的帐户配置期间

accountConfigurationg.getNatConfig().setIceEnabled(true)

因此,许多数据被传递到服务器,如rtcp有效负载等。因此,库自动使用更可靠的TCP连接

accountConfigurationg.getNatConfig().setIceEnabled(false); 这将停止发送如此多的数据,因此呼叫将成功建立

  --------- beginning of system
some media and call related initializations
I/System.out: 17:52:37.581 tcpc0x93d09414  ...TCP client transport created
I/System.out: 17:52:37.583 tcpc0x93d09414  ...TCP transport 192.168.43.167:58160 is connecting to <sip-server-ip>:5060...
I/System.out: 17:52:37.584   pjsua_core.c  ...TX 1443 bytes Request msg INVITE/cseq=20547 (tdta0xa8dc0064) to TCP <sip-server-ip>:5060:
I/System.out: INVITE sip:<mobile-number>@<sip-server-ip> SIP/2.0
I/System.out: Via: SIP/2.0/TCP 192.168.43.167:58160;rport;branch=z9hG4bKPj3f2aec57-9f79-46f5-bf03-9f9cb9d482ca;alias
I/System.out: Max-Forwards: 70
I/System.out: From: sip:<sip-account-number>@<sip-server-ip>;tag=90b152c8-fd44-41a3-9851-482da18ee67a
I/System.out: To: sip:<mobile-number>@<sip-server-ip>
I/System.out: Contact: <sip:sip-account-number@25.16.198.109:6000;ob>
I/System.out: Call-ID: c891a91e-054f-426d-810e-3ac2ba55e4f5
I/System.out: CSeq: 20547 INVITE
I/System.out: Route: <sip:sip-server-ip;lr>
I/System.out: Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, INFO, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS
I/System.out: Supported: replaces, 100rel, timer, norefersub
I/System.out: Session-Expires: 1800

**some more logs here**

I/System.out: 17:52:37.762   pjsua_core.c  .RX 374 bytes Response msg 100/INVITE/cseq=20547 (rdata0x93d095e0) from TCP <sip-server-ip>:5060:

I/System.out: SIP/2.0 100 Trying

I/System.out: Via: SIP/2.0/TCP 192.168.43.167:58160;branch=z9hG4bKPj3f2aec57-9f79-46f5-bf03-9f9cb9d482ca;received=137.97.99.211;rport=58160;alias

I/System.out: Call-ID: c891a91e-054f-426d-810e-3ac2ba55e4f5

I/System.out: From: <sip:sip-account-number>@sip-server-ip>;tag=90b152c8-fd44-41a3-9851-482da18ee67a

I/System.out: To: <sip:mobile-number@sip-server-ip>

I/System.out: CSeq: 20547 INVITE

I/System.out: Content-Length: 0

I/System.out: --end msg--

I/System.out: 17:52:37.766   pjsua_core.c  .RX 368 bytes Response msg 403/INVITE/cseq=20547 (rdata0x93d095e0) from TCP <sip-server-ip>:5060:

I/System.out: SIP/2.0 403 Forbidden

I/System.out: Via: SIP/2.0/TCP 192.168.43.167:58160;branch=z9hG4bKPj3f2aec57-9f79-46f5-bf03-9f9cb9d482ca;rport;alias

I/System.out: Call-ID: c891a91e-054f-426d-810e-3ac2ba55e4f5

I/System.out: From: <sip:sip-account-number@sip-server-ip>;tag=90b152c8-fd44-41a3-9851-482da18ee67a

I/System.out: To: <sip:sip-account-number@sip-server-ip>;tag=sbc0909b28y79co

I/System.out: CSeq: 20547 INVITE

I/System.out: Content-Length: 0

I/System.out: --end msg--