FileDocCategorySizeDatePackage
SipProfile.javaAPI DocAndroid 5.1 API15344Thu Mar 12 22:22:52 GMT 2015android.net.sip

SipProfile

public class SipProfile extends Object implements Serializable, android.os.Parcelable, Cloneable
Defines a SIP profile, including a SIP account, domain and server information.

You can create a {@link SipProfile} using {@link SipProfile.Builder}. You can also retrieve one from a {@link SipSession}, using {@link SipSession#getLocalProfile} and {@link SipSession#getPeerProfile}.

Developer Guides

For more information about using SIP, read the Session Initiation Protocol developer guide.

Fields Summary
private static final long
serialVersionUID
private static final int
DEFAULT_PORT
private static final String
TCP
private static final String
UDP
private javax.sip.address.Address
mAddress
private String
mProxyAddress
private String
mPassword
private String
mDomain
private String
mProtocol
private String
mProfileName
private String
mAuthUserName
private int
mPort
private boolean
mSendKeepAlive
private boolean
mAutoRegistration
private transient int
mCallingUid
public static final Parcelable.Creator
CREATOR
Constructors Summary
private SipProfile()

    
private SipProfile(android.os.Parcel in)

        mAddress = (Address) in.readSerializable();
        mProxyAddress = in.readString();
        mPassword = in.readString();
        mDomain = in.readString();
        mProtocol = in.readString();
        mProfileName = in.readString();
        mSendKeepAlive = (in.readInt() == 0) ? false : true;
        mAutoRegistration = (in.readInt() == 0) ? false : true;
        mCallingUid = in.readInt();
        mPort = in.readInt();
        mAuthUserName = in.readString();
    
Methods Summary
public intdescribeContents()

        return 0;
    
public java.lang.StringgetAuthUserName()
Gets the username for authentication. If it is null, then the username is used in authentication instead.

return
the authentication username
see
#getUserName

        return mAuthUserName;
    
public booleangetAutoRegistration()
Gets the flag of 'Auto Registration'.

return
the flag of registering the profile automatically.

        return mAutoRegistration;
    
public intgetCallingUid()
Gets the calling process's Uid in the sip settings.

hide

        return mCallingUid;
    
public java.lang.StringgetDisplayName()
Gets the display name of the user.

return
the display name of the user

        return mAddress.getDisplayName();
    
public java.lang.StringgetPassword()
Gets the password.

return
the password

        return mPassword;
    
public intgetPort()
Gets the port number of the SIP server.

return
the port number of the SIP server

        return mPort;
    
public java.lang.StringgetProfileName()
Gets the (user-defined) name of the profile.

return
name of the profile

        return mProfileName;
    
public java.lang.StringgetProtocol()
Gets the protocol used to connect to the server.

return
the protocol

        return mProtocol;
    
public java.lang.StringgetProxyAddress()
Gets the network address of the server outbound proxy.

return
the network address of the server outbound proxy

        return mProxyAddress;
    
public booleangetSendKeepAlive()
Gets the flag of 'Sending keep-alive'.

return
the flag of sending SIP keep-alive messages.

        return mSendKeepAlive;
    
public javax.sip.address.AddressgetSipAddress()
Gets the SIP address of this profile.

return
the SIP address of this profile
hide

        return mAddress;
    
public java.lang.StringgetSipDomain()
Gets the SIP domain.

return
the SIP domain

        return mDomain;
    
public javax.sip.address.SipURIgetUri()
Gets the SIP URI of this profile.

return
the SIP URI of this profile
hide

        return (SipURI) mAddress.getURI();
    
public java.lang.StringgetUriString()
Gets the SIP URI string of this profile.

return
the SIP URI string of this profile

        // We need to return the sip uri domain instead of
        // the SIP URI with transport, port information if
        // the outbound proxy address exists.
        if (!TextUtils.isEmpty(mProxyAddress)) {
            return "sip:" + getUserName() + "@" + mDomain;
        }
        return getUri().toString();
    
public java.lang.StringgetUserName()
Gets the username.

return
the username

        return getUri().getUser();
    
private java.lang.ObjectreadResolve()

        // For compatibility.
        if (mPort == 0) mPort = DEFAULT_PORT;
        return this;
    
public voidsetCallingUid(int uid)
Sets the calling process's Uid in the sip service.

hide

        mCallingUid = uid;
    
public voidwriteToParcel(android.os.Parcel out, int flags)

        out.writeSerializable(mAddress);
        out.writeString(mProxyAddress);
        out.writeString(mPassword);
        out.writeString(mDomain);
        out.writeString(mProtocol);
        out.writeString(mProfileName);
        out.writeInt(mSendKeepAlive ? 1 : 0);
        out.writeInt(mAutoRegistration ? 1 : 0);
        out.writeInt(mCallingUid);
        out.writeInt(mPort);
        out.writeString(mAuthUserName);