linphone-developers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Linphone-developers] Changing the SIP port on Android


From: J Alex Antony Vijay
Subject: Re: [Linphone-developers] Changing the SIP port on Android
Date: Wed, 27 Apr 2016 14:54:09 +0530

Hi Nabeel,

    You have to set proxy and identity in "LinphoneProxyConfig" then try. it should work.


On Wed, Apr 27, 2016 at 2:40 PM, Nabeel <address@hidden> wrote:
Hi,

Thanks for the answer, but I tried the code below and the data is still being sent through port 5060, not the new port. Please let me know what I'm doing wrong:


LoginActivity.java  
 
 
saveCreatedAccount()
String forcedProxy = "";
            if (!TextUtils.isEmpty(forcedProxy)) {
                builder.setProxy(forcedProxy)
                        .setOutboundProxyEnabled(true)
                        .setAvpfRRInterval(5);
            }
            builder.setProxy("sip:" +   "domain.com:" + 5353);
            if(transport != null){
                builder.setTransport(transport);
            }
            mPrefs.setStunServer("ice.domain.com");
            mPrefs.setIceEnabled(true); 
 

LinphoneManager.java: 

public void initAccounts(LinphoneCore mLc,String username,String password, String domain) throws LinphoneCoreException {
  mLc.clearAuthInfos();
  mLc.clearProxyConfigs();

  LinphoneAuthInfo lAuthInfo =  LinphoneCoreFactory.instance().createAuthInfo(username, password, null, domain);
  mLc.addAuthInfo(lAuthInfo);
  String identity = "sip:" + username +"@" + domain;
  String proxy = "sip:" + domain;
  LinphoneAddress proxyAddr = LinphoneCoreFactory.instance().createLinphoneAddress(proxy);
  proxyAddr.setPort(5353);
  proxyAddr.setTransport(LinphoneAddress.TransportType.LinphoneTransportUdp);
  LinphoneProxyConfig proxycon = mLc.createProxyConfig(identity, proxyAddr.asStringUriOnly(), proxyAddr.asStringUriOnly(), true);
  mLc.addProxyConfig(proxycon);
  mLc.setDefaultProxyConfig(proxycon);
  LinphoneProxyConfig lDefaultProxyConfig = mLc.getDefaultProxyConfig();
  if (lDefaultProxyConfig != null) {
   //escape +
   lDefaultProxyConfig.setDialEscapePlus(false);
  } else if (LinphoneService.isReady()) {
   getLc().addListener(this);
  // this.registrationState(mLc, lDefaultProxyConfig, RegistrationState.RegistrationNone, null);
  }
 }

 

On 25 April 2016 at 04:21, J Alex Antony Vijay <address@hidden> wrote:
Hi Nabeel,

    Use below code to set SIP registration port:
LinphoneProxyConfig proxyConfig = linphoneCore.createProxyConfig(identity, linphoneAddress.asStringUriOnly(), null, true);
...
proxyConfig.setProxy("sip:" + domain + ":" + port);
...
...
linphoneCore.addProxyConfig(proxyConfig);


Create address and set transport port:
LinphoneAddress linphoneAddress = LinphoneCoreFactory.instance().createLinphoneAddress(identity);
linphoneAddress.setTransport(LinphoneAddress.TransportType.LinphoneTransportTcp);
linphoneAddress.setPort(port);



On Mon, Apr 25, 2016 at 7:46 AM, Nabeel <address@hidden> wrote:
Hi,

I have tried to change the SIP port on Android by adding this to the linphonerc files:
[sip]
sip_port=5353
However, on the server using tcpdump, I can see that the SIP messages are still being transferred on port 5060.
Please let me know how I can change the SIP port so that registration and messages to the server occur on a different port.

Nabeel



_______________________________________________
Linphone-developers mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/linphone-developers




--

Regards,
J Alex Antony Vijay.

_______________________________________________
Linphone-developers mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/linphone-developers





--

Regards,
J Alex Antony Vijay.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]