简体   繁体   中英

Forbidden in Call connection Android Pjsip Sip library

How to perform call in Pjsip Android with local server?

I used User-Agent: Pjsua2 Android 2.6-svn

I made successful registraion after which i tried to call but it throws forbidden(503) My Registraion Code :

     AccountConfig accCfg = new AccountConfig();
        accCfg.setIdUri("sip:localhost");
        accCfg.getNatConfig().setIceEnabled(true);
        accCfg.getVideoConfig().setAutoTransmitOutgoing(true);
        accCfg.getVideoConfig().setAutoShowIncoming(true);
     //Like 123.12.12.23 
       accCfg.getRegConfig().setRegistrarUri("sip:172.16.4.124");

        AuthCredInfoVector creds = accCfg.getAuthCreds();
        creds.clear();
        if (username.length() != 0) {
           creds.add(new AuthCredInfo("Digest", "*", "abc@172.16.4.124", 0,
            "123"));
                    }
         StringVector proxies = accCfg.getSipConfig().getProxies();
                    proxies.clear();
                    if (proxy.length() != 0) {
                        proxies.add("sip:172.16.4.124");
                    }                                  
           accCfg.getSipConfig().setProxies(proxies);

        /* Enable ICE */
                    accCfg.getNatConfig().setIceEnabled(true);
                    try {
                        account.add(accCfg);
                    } catch (Exception e) {
                        e.printStackTrace();
                        Log.i(TAG, "Exception in Dialog");
                    }
                }

For Making call I used

public void makeCall(View view) {
    if (buddyListSelectedIdx == -1)
        return;

/* Only one call at anytime */
    if (currentCall != null) {
        return;
    }

    HashMap<String, String> item = (HashMap<String, String>) buddyListView.
            getItemAtPosition(buddyListSelectedIdx);
    String buddy_uri = item.get("uri");

    MyCall call = new MyCall(account, -1);
    SendInstantMessageParam param = new SendInstantMessageParam();
    param.setContent("Hello Pjsip");
    param.setContentType("text");


    CallOpParam prm = new CallOpParam(true);

    try {
        call.makeCall(buddy_uri, prm);
//            call.delete();
//            call.sendInstantMessage(param);
    } catch (Exception e) {
        e.printStackTrace();
        call.delete();
        return;
    }
    currentCall = call;
    showCallActivity();

}

I am able to connect call with sip default client like sip:localhost and other sip provider like linphone but getting forbidden with our server. Experts please help.

非常感谢自己,经过3天的锻炼后终于得到了解决方案,我的亚马逊服务器缺少端口号,使我得以连接并在connected饮之间进行了between饮呼叫。

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