1

すでに数週間、Android用のrestcommを使用してSIPサービスにサインアップしようとしています。サードパーティ アプリケーション (cSipSimple) との接続を確認したところ、すべて正常に動作しました。しかし、restcommデモアプリと接続しようとすると、4秒後に毎回接続が落ちます。私のSDKのどこが悪いのですか、どうすれば正しく歌うことができますか?

SipProfile sipProfile = 新しい SipProfile();

        HashMap<String, Object> params = new HashMap<String, Object>();
        params.put("pref_proxy_ip", "my.server.ip");
        params.put("pref_proxy_port", "5060");
        params.put("pref_sip_user", "7879114");
        params.put("pref_sip_password", "EeFei2Fa");
        for (String key : params.keySet()) {
            if (key.equals("pref_proxy_ip")) {
                sipProfile.setRemoteIp((String) params.get(key));
            } else if (key.equals("pref_proxy_port")) {
                sipProfile.setRemotePort(Integer.parseInt((String) params.get(key)));
            } else if (key.equals("pref_sip_user")) {
                sipProfile.setSipUserName((String) params.get(key));
            } else if (key.equals("pref_sip_password")) {
                sipProfile.setSipPassword((String) params.get(key));
            }
        }

        final SipManager sipManager = new SipManager(sipProfile, true);

        Register registerRequest = new Register();

        final Request r = registerRequest.MakeRequest(sipManager, 100000, null);
            // Send the request statefully, through the client transaction.
        Thread thread = new Thread() {
            public void run() {
                try {
                    final ClientTransaction transaction = sipManager.sipProvider.getNewClientTransaction(r);
                    transaction.sendRequest();
                } catch (SipException e) {
                    e.printStackTrace();
                }
            }
        };
        thread.start(); 
4

1 に答える 1

1

@Vladislav、廃止され、直接使用することを意図していない SDK の低レベル機能を使用しています。SDK によって直接公開されている RestCommClient API を使用することをお勧めします。はるかに使いやすく、同じ機能とそれ以上の機能を提供します。

使用方法の例については、以下を確認してください。

https://github.com/RestComm/restcomm-android-sdk/blob/master/Examples/restcomm-helloworld/app/src/main/java/com/telestax/restcomm_helloworld/MainActivity.java

SIP サーバーの設定を次のように変更する必要があります。

https://github.com/RestComm/restcomm-android-sdk/blob/master/Examples/restcomm-helloworld/app/src/main/java/com/telestax/restcomm_helloworld/MainActivity.java#L99

そして、次からの着信側:

https://github.com/RestComm/restcomm-android-sdk/blob/master/Examples/restcomm-helloworld/app/src/main/java/com/telestax/restcomm_helloworld/MainActivity.java#L174

NAT を適切に処理できるように、メディアには Webrtc が使用されることに注意してください。これは、受信側も Webrtc を処理できる必要があることを意味します。Restcomm-Connectのように、メディエーションを処理するサーバーが中間にない限り。

詳細については、RestComm クライアント Android SDK クイック スタートを参照してください。

于 2016-05-10T09:20:58.647 に答える