Pjsip Android 中的呼叫转移返回 403 Forbidden

Posted

技术标签:

【中文标题】Pjsip Android 中的呼叫转移返回 403 Forbidden【英文标题】:Call Transferring in Pjsip Android returns 403 Forbidden 【发布时间】:2020-03-04 21:14:53 【问题描述】:

我使用 pjsua 的 Voip 应用程序在呼叫转移 REFER 请求时返回 403 Frobidden。

呼叫转移代码如下,

public void transferTo(String destination) throws Exception 

        String transferString = "sip:" + destination + "@" + SipPreferenceManager.getDomain(context);

        CallOpParam param = new CallOpParam();

        currentCall.xfer(transferString, param);
        

响应日志如下,

I/System.out: REFER sip:xxx.xxx.xxx.xxx:5060;TRC=ffffffff-ffffffff;Dpt=ed2a-200 SIP/2.0

I/System.out:通过:SIP/2.0/UDP 25.45.1.121:5060;rport;branch=z9hG4bKPj1bb70192-a6be-4a2d-89bb-4bafc03af55d

I/System.out:Max-Forwards:70

I/System.out:来自:;tag=2b62b4a4-31c4-42d4-b848-755d5f6e2a13

I/System.out:收件人:;tag=sbc04074wqgc46y

I/System.out:联系人:

I/System.out:呼叫 ID:asbcyf4y5uw9ufr2yqf979gy2uguwr7e7f2f@10.191.54.18

I/System.out: CSeq: 13241 REFER

I/System.out:事件:参考

I/System.out:过期:600

I/System.out:支持:replaces、100rel、timer、norefersub

I/System.out:接受:message/sipfrag;version=2.0

I/System.out:允许事件:存在、消息摘要、参考

I/System.out:参考:sip:123456789@domain

I/System.out:引用者:

I/System.out:用户代理:Pjsua2 android 2.9

I/System.out:内容长度:0

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

I/System.out: 14:04:11.804 evsub0x8e7fbc1 .....订阅状态已更改 NULL --> SENT

I/System.out: 14:04:11.926 pjsua_core.c !.RX 348 字节响应消息 来自 UDP 218.248.233.142:5060 的 403/REFER/cseq=13241 (rdata0x8df74014):

I/System.out:SIP/2.0 403 禁止

I/System.out:通过:SIP/2.0/UDP 25.45.1.121:5060;branch=z9hG4bKPj1bb70192-a6be-4a2d-89bb-4bafc03af55d;rport=5060

I/System.out:呼叫 ID:asbcyf4y5uw9ufr2yqf979gy2uguwr7e7f2f@10.191.54.18

I/System.out:来自:;tag=2b62b4a4-31c4-42d4-b848-755d5f6e2a13

I/System.out:收件人:;tag=sbc04074wqgc46y

I/System.out: CSeq: 13241 REFER

I/System.out:内容长度:0

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

I/System.out: 14:04:11.928 evsub0x8e7fbc1 ....订阅状态已更改 SENT --> TERMINATED

I/System.out: 14:04:11.929 pjsua_call.c ......Xfer 客户端订阅终止

I/System.out:14:04:12.086 pjsua_core.c .TX 358 字节响应消息 500/INVITE/cseq=1 (tdta0x8e0dc064) 到 UDP 212.129.25.1:5074:


【问题讨论】:

【参考方案1】:

使用此代码对我来说很好。

 if (currentCall != null) 
        CallOpParam prm = new CallOpParam();
        prm.setStatusCode(pjsip_status_code.PJSIP_SC_OK);
        try 
        currentCall.xfer("sip:" + transferNumber + "@" + serverAddress, prm);
         
         catch (Exception e) 
            System.out.println(e);
            
       

谢谢,编码愉快...

【讨论】:

它对我不起作用..你是否实施了电话会议? 是的,我正在实施电话会议和呼叫转移。

以上是关于Pjsip Android 中的呼叫转移返回 403 Forbidden的主要内容,如果未能解决你的问题,请参考以下文章

Android呼叫转移跳转到拨号盘 “#”号显示不出来

SIP中呼叫转移(tranfer)是怎么回事?请大虾指点,还有VOIP怎么与PSTN和移动网通信的呢???

如何使用Qt和C ++的“接口类”来传递两个线程

联通手机号设置呼叫转移相关信息

Pjsip 在多线程中调用它的函数时在 android 上崩溃

如何在 android 设备上使用 pjsip G.729 编解码的功能