简体   繁体   English

禁止在呼叫连接中使用Android Pjsip Sip库

[英]Forbidden in Call connection Android Pjsip Sip library

How to perform call in Pjsip Android with local server? 如何在具有本地服务器的Pjsip Android中执行呼叫?

I used User-Agent: Pjsua2 Android 2.6-svn 我使用了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 : 我成功进行了注册,之后尝试致电,但是它抛出了被禁止的(503)我的注册码:

     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. 我能够将sip默认客户端(如sip:localhost)和其他sip提供程序(如linphone)连接起来,但我们的服务器被禁止了。 Experts please help. 高手请帮忙。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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