마스터Q&A 안드로이드는 안드로이드 개발자들의 질문과 답변을 위한 지식 커뮤니티 사이트입니다. 안드로이드펍에서 운영하고 있습니다. [사용법, 운영진]

SipProfile.Builder 에서 parseException 에러가 뜨는데 도와주세요 ㅜㅜ

0 추천

안녕하세요 android.net.sip을 이용해서 시그널링을 하려고 하는데 계속 에러가 나오네요. 
developer.android.com에서 나온 sip가이드로 만든 소스인데 뭐가 문제인지 parseException에러가 나오는데 linphone에서 제공하는 sip서버에 계정을 등록해도 계속 같은 에러가 나오네요

 

package com.example.jw.siptest2;

import android.app.Activity;
import android.app.PendingIntent;
import android.content.Intent;
import android.net.ParseException;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.net.sip.*;


public class MyActivity extends Activity {
    public SipManager mSipManager = null;
    public SipProfile mSipProfile = null;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_my);

        if(mSipManager==null){
            mSipManager = mSipManager.newInstance(this);
        }

        if(mSipProfile != null){
            closeLocalProfile();
        }

            try {

                SipProfile.Builder builder = new SipProfile.Builder("sip:jungwoon90@sip.linphone.org");
                builder.setPassword("xtintin");
                mSipProfile = builder.build();

                Intent intent = new Intent();
                intent.setAction("android.SipDemo.INCOMING_CALL");
                PendingIntent pendingIntent = PendingIntent.getBroadcast(this, 0, intent, Intent.FILL_IN_DATA);
                mSipManager.open(mSipProfile, pendingIntent, null);

                mSipManager.setRegistrationListener(mSipProfile.getUriString(), new SipRegistrationListener() {

                    public void onRegistering(String localProfileUri) {
                        //updateStatus("Registering with SIP Server...");
                    }

                    public void onRegistrationDone(String localProfileUri, long expiryTime) {
                        //updateStatus("Ready");
                    }

                    public void onRegistrationFailed(String localProfileUri, int errorCode, String errorMessage) {
                        //updateStatus("Registration failed.  Please check settings.");
                    }
                });
            }
            catch (ParseException e) {
                e.printStackTrace();
            }
            catch (SipException e) {
                e.printStackTrace();
            }

    }

    public void closeLocalProfile() {
        if (mSipManager == null) {
            return;
        }
        try {
            if (mSipProfile != null) {
                mSipManager.close(mSipProfile.getUriString());
            }
        } catch (Exception ee) {
            Log.d("WalkieTalkieActivity/onDestroy", "Failed to close local profile.", ee);
        }
    }




}

 

 

 

byJW (210 포인트) 님이 2014년 8월 2일 질문

답변 달기

· 글에 소스 코드 보기 좋게 넣는 법
· 질문에 대해 추가적인 질문이나 의견이 있으면 답변이 아니라 댓글로 달아주시기 바랍니다.
표시할 이름 (옵션):
개인정보: 당신의 이메일은 이 알림을 보내는데만 사용됩니다.
스팸 차단 검사:
스팸 검사를 다시 받지 않으려면 로그인하거나 혹은 가입 하세요.
...