简体   繁体   中英

Call Transferring in Pjsip Android returns 403 Forbidden

My Voip Application using pjsua returns 403 Frobidden on Call Transferring REFER request.

The Call transferring code is as follows,

public void transferTo(String destination) throws Exception {

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

        CallOpParam param = new CallOpParam();

        currentCall.xfer(transferString, param);
        }

The response logs are as folows,

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

I/System.out: Via: 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: From: ;tag=2b62b4a4-31c4-42d4-b848-755d5f6e2a13

I/System.out: To: ;tag=sbc04074wqgc46y

I/System.out: Contact:

I/System.out: Call-ID: asbcyf4y5uw9ufr2yqf979gy2uguwr7e7f2f@10.191.54.18

I/System.out: CSeq: 13241 REFER

I/System.out: Event: refer

I/System.out: Expires: 600

I/System.out: Supported: replaces, 100rel, timer, norefersub

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

I/System.out: Allow-Events: presence, message-summary, refer

I/System.out: Refer-To: sip:123456789@domain

I/System.out: Referred-By:

I/System.out: User-Agent: Pjsua2 Android 2.9

I/System.out: Content-Length: 0

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

I/System.out: 14:04:11.804 evsub0x8e7fbc1.....Subscription state changed NULL --> SENT

I/System.out: 14:04:11.926 pjsua_core.c..RX 348 bytes Response msg 403/REFER/cseq=13241 (rdata0x8df74014) from UDP 218.248.233:142:5060:

I/System.out: SIP/2.0 403 Forbidden

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

I/System.out: Call-ID: asbcyf4y5uw9ufr2yqf979gy2uguwr7e7f2f@10.191.54.18

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

I/System.out: To: ;tag=sbc04074wqgc46y

I/System.out: CSeq: 13241 REFER

I/System.out: Content-Length: 0

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

I/System.out: 14:04:11.928 evsub0x8e7fbc1....Subscription state changed SENT --> TERMINATED

I/System.out: 14:04:11.929 pjsua_call.c......Xfer client subscription terminated

I/System.out: 14:04:12.086 pjsua_core.c.TX 358 bytes Response msg 500/INVITE/cseq=1 (tdta0x8e0dc064) to UDP 212.129.25.1:5074:


Use this code its works for me fine.

 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);
            }
       }

Thanks, Happy coding...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM