Search in sources :

Example 1 with HeaderAddress

use of javax.sip.header.HeaderAddress in project XobotOS by xamarin.

the class SipSessionGroup method createPeerProfile.

private static SipProfile createPeerProfile(HeaderAddress header) throws SipException {
    try {
        Address address = header.getAddress();
        SipURI uri = (SipURI) address.getURI();
        String username = uri.getUser();
        if (username == null)
            username = ANONYMOUS;
        int port = uri.getPort();
        SipProfile.Builder builder = new SipProfile.Builder(username, uri.getHost()).setDisplayName(address.getDisplayName());
        if (port > 0)
            builder.setPort(port);
        return builder.build();
    } catch (IllegalArgumentException e) {
        throw new SipException("createPeerProfile()", e);
    } catch (ParseException e) {
        throw new SipException("createPeerProfile()", e);
    }
}
Also used : HeaderAddress(javax.sip.header.HeaderAddress) Address(javax.sip.address.Address) SipProfile(android.net.sip.SipProfile) ParseException(java.text.ParseException) SipURI(javax.sip.address.SipURI) SipException(javax.sip.SipException) ListeningPoint(javax.sip.ListeningPoint)

Aggregations

SipProfile (android.net.sip.SipProfile)1 ParseException (java.text.ParseException)1 ListeningPoint (javax.sip.ListeningPoint)1 SipException (javax.sip.SipException)1 Address (javax.sip.address.Address)1 SipURI (javax.sip.address.SipURI)1 HeaderAddress (javax.sip.header.HeaderAddress)1