Change User-Agent

Is it possible to change User-Agent string?

Yes @Bartosz, via sip-profile config

Can you give me parameter name/value example?

Its self explanatory, ‘user-agent-string’

I asked for example to ckeck problem. I used the same parameter in sip-profile:

And it doesn’t work:

User agent is still “ASTPP”.

it’s hard-coded in astpp lua files. I do not remember the exact file but it starts with astpp* or dialplan* lua file.

Hello @Bartosz
Please reload, rescan freeswitch. Or restart freeswitch and test it again.

@xserver You must be right that it is hardcoded.

@palak I tried to reload, rescan after adding parameter without success.

I found two problems / bugs:

  1. After adding parameter “user-agent-string” and restarting server I can’t establish any call. ASTPP registration of provider (termination side) fails and also registration of customer (originator side) fails too. After removing “user-agent-string” parameter from sip-profile everything is working fine.

  2. I made spelling mistake and instead of user-agent-string I added parameter user-agent-string’. Of course it is not effective but I’m not able to delete this parameter via ASTPP GUI.

@Bartosz The file name where its hard-coded is

web_interface/astpp/application/libraries/astpp/common.php - Line 164
web_interface/astpp/application/modules/freeswitch/libraries/freeswitch_form.php - Line 2002
freeswitch/fs/lib/astpp.xml.php - Line 2019

Try changing it , if that doesn’t work then you may try changing it in Database. Check the second line below.

INSERT INTO sip_profiles VALUES (1,‘default’,‘$${local_ip_v4}’,‘5060’,‘{"rtp_ip":"$${local_ip_v4}","dialplan":"XML","user-agent-string":"ASTPP","debug":"0","sip-trace":"no","tls":"false","inbound-reg-force-matching-username":"true","disable-transcoding":"true","all-reg-options-ping":"false","unregister-on-options-fail":"true","inbound-bypass-media":"false","inbound-proxy-media":"false","disable-transfer":"true","enable-100rel":"false","rtp-timeout-sec":"60","dtmf-duration":"2000","aggressive-nat-detection":"false","enable-timer":"false","minimum-session-expires":"120","session-timeout-pt":"1800","auth-calls":"true","apply-inbound-acl":"default"}’,‘2013-05-17 08:07:23’,‘0000-00-00 00:00:00’,0);

1 Like

@xserver thank you for your valueable reply :slight_smile:
but… if this setting can not be changed via ASTPP GIU then I must assume that is not possible. It will cause problem in future during updates and backup-recovery processes.
For current project I’m looking for sulution that I will recommend to customer without deep technical knowledge, so it must be fully configurable via GUI. Also it needs to be in affordable price because this is not very big project.

Hello @Bartosz ,
I have tried in our local community server, and it got delete. Please share any screenshot for it.

Here you are:

BTW. Video above shows also other bug. Look at the bottom (page pagination):

<< < Page 1 of 2 > >> 1-25 of 49 Records [25]

But actually GUI is showing all 49 records even that has limit to 25 and after page change (to second page) nothing happen beside change of text to “26-49 of 49 Records”.

Hello @Bartosz ,
The issue will be logged for it.
Though for now execute update query directly on the db table.
update sip_profiles set profie_data='{“rtp_ip”:“$${local_ip_v4}”,“dialplan”:“XML”,“user-agent-string”:“<<<REPLACE_YOUR_STRING>>>”,“debug”:“0”,“sip-trace”:“no”,“tls”:“false”,“inbound-reg-force-matching-username”:“true”,“disable-transcoding”:“true”,“all-reg-options-ping”:“false”,“unregister-on-options-fail”:“true”,“inbound-bypass-media”:“false”,“inbound-proxy-media”:“false”,“disable-transfer”:“true”,“enable-100rel”:“false”,“rtp-timeout-sec”:“60”,“dtmf-duration”:“2000”,“aggressive-nat-detection”:“false”,“enable-timer”:“false”,“minimum-session-expires”:“120”,“session-timeout-pt”:“1800”,“auth-calls”:“true”,“apply-inbound-acl”:“default”}’;