Hi,

Do you uncheck "Use random ports" in Settings > Network?



*Bùi Đình Cường*

*Email:* [email protected]
*Skype:* cuongdinhbui
*Mobile:* (84) 981 931 458
________________________________________

2016-04-27 16:31 GMT+07:00 Eugene Punsal Lozada <
[email protected]>:

> Implemented similar requirement just a few hours ago and the following
> worked for me when I switched the port for tls from 5061 to 443
>
> //I'm using the default one
>
> LinphoneProxyConfig proxyCfg = core.getDefaultProxyConfig();
>
> proxyCfg.edit();
>
> //do other proxy configurations
>
> //Value of this is for me is "sip:some.domain.com:443;transport=tls"
>
> proxyCfg.setRoute(sipProfile.getProxy());
> proxyCfg.setProxy(sipProfile.getProxy());
>
> core.addProxyConfig(proxyCfg);
> core.setDefaultProxyConfig(proxyCfg);
> proxyCfg.done();
>
>
> On Wed, Apr 27, 2016 at 5:24 PM, J Alex Antony Vijay <
> [email protected]> wrote:
>
>> 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 <[email protected]> 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 <[email protected]>
>>> 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 <[email protected]>
>>>> 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
>>>>> [email protected]
>>>>> https://lists.nongnu.org/mailman/listinfo/linphone-developers
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>>
>>>> Regards,
>>>> J Alex Antony Vijay.
>>>>
>>>> _______________________________________________
>>>> Linphone-developers mailing list
>>>> [email protected]
>>>> https://lists.nongnu.org/mailman/listinfo/linphone-developers
>>>>
>>>>
>>>
>>
>>
>> --
>>
>> Regards,
>> J Alex Antony Vijay.
>>
>> _______________________________________________
>> Linphone-developers mailing list
>> [email protected]
>> https://lists.nongnu.org/mailman/listinfo/linphone-developers
>>
>>
>
> _______________________________________________
> Linphone-developers mailing list
> [email protected]
> https://lists.nongnu.org/mailman/listinfo/linphone-developers
>
>
_______________________________________________
Linphone-users mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/linphone-users

Reply via email to