使用pjsua的我的Voip应用程序在“呼叫转移参考”请求中返回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:参考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:最大转发次数: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参考
I / System.out:事件:参考
I / System.out:有效期:600
I / System.out:支持:替换,100rel,计时器,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字节响应msg UDP 403.REFER / cseq = 13241(rdata0x8df74014)来自UDP 218.248.233.142:5060:
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参考
I / System.out:内容长度:0
I / System.out:--end msg-
I / System.out:14:04:11.928 evsub0x8e7fbc1 ....订阅状态已更改已发送->已终止
I / System.out:14:04:11.929 pjsua_call.c ...... Xfer客户端订阅已终止
I / System.out:14:04:12.086 pjsua_core.c .TX 358字节响应msg 500 / INVITE / cseq = 1(tdta0x8e0dc064)对UDP 212.129.25.1:5074:
答案 0 :(得分: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);
}
}
谢谢,祝您编程愉快...