Search in sources :

Example 1 with SipFactory

use of javax.sip.SipFactory in project XobotOS by xamarin.

the class SipSessionGroup method reset.

synchronized void reset(String localIp) throws SipException, IOException {
    mLocalIp = localIp;
    if (localIp == null)
        return;
    SipProfile myself = mLocalProfile;
    SipFactory sipFactory = SipFactory.getInstance();
    Properties properties = new Properties();
    properties.setProperty("javax.sip.STACK_NAME", getStackName());
    properties.setProperty("gov.nist.javax.sip.THREAD_POOL_SIZE", THREAD_POOL_SIZE);
    String outboundProxy = myself.getProxyAddress();
    if (!TextUtils.isEmpty(outboundProxy)) {
        Log.v(TAG, "outboundProxy is " + outboundProxy);
        properties.setProperty("javax.sip.OUTBOUND_PROXY", outboundProxy + ":" + myself.getPort() + "/" + myself.getProtocol());
    }
    SipStack stack = mSipStack = sipFactory.createSipStack(properties);
    try {
        SipProvider provider = stack.createSipProvider(stack.createListeningPoint(localIp, allocateLocalPort(), myself.getProtocol()));
        provider.addSipListener(this);
        mSipHelper = new SipHelper(stack, provider);
    } catch (InvalidArgumentException e) {
        throw new IOException(e.getMessage());
    } catch (TooManyListenersException e) {
        // must never happen
        throw new SipException("SipSessionGroup constructor", e);
    }
    Log.d(TAG, " start stack for " + myself.getUriString());
    stack.start();
    mCallReceiverSession = null;
    mSessionMap.clear();
    resetExternalAddress();
}
Also used : TooManyListenersException(java.util.TooManyListenersException) InvalidArgumentException(javax.sip.InvalidArgumentException) SipProfile(android.net.sip.SipProfile) SipFactory(javax.sip.SipFactory) SipStack(javax.sip.SipStack) IOException(java.io.IOException) Properties(java.util.Properties) SipException(javax.sip.SipException) SipProvider(javax.sip.SipProvider)

Aggregations

SipProfile (android.net.sip.SipProfile)1 IOException (java.io.IOException)1 Properties (java.util.Properties)1 TooManyListenersException (java.util.TooManyListenersException)1 InvalidArgumentException (javax.sip.InvalidArgumentException)1 SipException (javax.sip.SipException)1 SipFactory (javax.sip.SipFactory)1 SipProvider (javax.sip.SipProvider)1 SipStack (javax.sip.SipStack)1