extra port param on the gxp2160 template?

Status
Not open for further replies.

nktech1135

Member
Dec 16, 2017
51
2
8
us
Hi all.
I'm running my fusion server on alternative ports but having a provisioning issue with the grandstream gxp2160 phones. If i set the device up manually everything works great.
However, if i set up the device in provisioning settings i get an extra :5060 added to the end of my sip server line like this.
Code:
    <!-- # SIP Server -->
    <!-- # String -->
    <P502>server:port:5060</P502>
As you can imagine registration to this string doesn't work. How can i get rid of the :5060 string? or customize it?

Thanks.
 

ad5ou

Active Member
Jun 12, 2018
884
196
43
Not sure which version of Fusionpbx you are using but the current templates have the correct information to specify port number.
Code:
 <!-- # SIP Server -->
    <!-- # String -->
{if $account.3.sip_transport != 'dns srv'}
    <P502>{$account.3.server_address}:{$account.3.sip_port}</P502>
{else}
    <P502>{$account.3.server_address}</P502>
{/if}
 

nktech1135

Member
Dec 16, 2017
51
2
8
us
Not sure which version of Fusionpbx you are using but the current templates have the correct information to specify port number.
Code:
 <!-- # SIP Server -->
    <!-- # String -->
{if $account.3.sip_transport != 'dns srv'}
    <P502>{$account.3.server_address}:{$account.3.sip_port}</P502>
{else}
    <P502>{$account.3.server_address}</P502>
{/if}

My templlate has these settings as well. i'm not sure that i understand the reasoning behind doing it this way, but could make it work if i knew Where {$account.3.sip_port} is defined?
Also, if you have time, would you mind explaining why the if statement is needed?
 

ad5ou

Active Member
Jun 12, 2018
884
196
43
The server address and sip port are assigned in the device setting page. The default sip port is pulled from "default settings" line_sip_port variable but can be edited to any valid port number in the device page. Some fields may not be visible by default, but it should look similar to:
1637013920546.png

The if statement tests if the transport type is NOT set for DNS SRV . DNS SRV will specify the correct port in the dns record so assigning the port directly could cause conflicting results. Based on the logic, when transport is set to DNS SRV, the P code only sets the server name. When the transport is set to UDP, TCP, or TLS, then the template will also set the correct port number as assigned in the "account.<line #>.sip_port" variable.
 

nktech1135

Member
Dec 16, 2017
51
2
8
us
Thanks for the screenshot, My device edit page didn't have the port param anymore for some reason. Updating fixed that issue.
 
Status
Not open for further replies.