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);
}
}
Aggregations