2017-09-14 130 views
0

如何在本地服務器上執行Pjsip Android中的呼叫?禁止呼叫連接Android Pjsip SIP庫

我用 的User-Agent:Pjsua2的Android 2.6 - svn的

我做成功registraion之後,席力圖召,但它拋出禁止(503) 我Registraion代碼:

 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", "*", "[email protected]", 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默認客戶端,如si p:本地主機和其他sip提供者,如linphone,但被我們的服務器禁止。 請專家幫忙。

+0

請張貼您的日誌的禁止響應消息。 – NandhaKumar

+0

我能夠連接它與本地也但語音不是來自任何一方,然後我在亞馬遜設置相同,呼籲不與我們的客戶端連接獲取請求超時錯誤,同時工作其他客戶端,請諮詢。 –

+0

如果要在**本地服務器**上建立呼叫,則必須在同一LAN上連接設備和本地服務器。 – NandhaKumar

回答

0

非常感謝我自己,我終於拿到3天后鍛鍊的解決方案, 有缺失端口號對我的亞馬遜的服務器,讓我可以連接之間的SIP結束作出吮吸電話。