簡體   English   中英

禁止在呼叫連接中使用Android Pjsip Sip庫

[英]Forbidden in Call connection Android Pjsip Sip library

如何在具有本地服務器的Pjsip Android中執行呼叫?

我使用了User-Agent:Pjsua2 Android 2.6-svn

我成功進行了注冊,之后嘗試致電,但是它拋出了被禁止的(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");
                    }
                }

我打過電話

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

}

我能夠將sip默認客戶端(如sip:localhost)和其他sip提供程序(如linphone)連接起來,但我們的服務器被禁止了。 高手請幫忙。

非常感謝自己,經過3天的鍛煉后終於得到了解決方案,我的亞馬遜服務器缺少端口號,使我得以連接並在connected飲之間進行了between飲呼叫。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM