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:
image

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:
astpp-2023-04-06_14.04.52.mp4

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ā€}ā€™;

Has anyone been able to resolve this issue? Iā€™ve tried to locate the XML containing ā€œuser-agent-string,ā€ but itā€™s not possible using the graphical interface.

Hello

change those files

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);