Re: [SR-Users] Setting Kamailio User-Agent dynamically

2014-10-09 Thread Daniel-Constantin Mierla
Btw, there is a global parameter to disable server signatures: - http://www.kamailio.org/wiki/cookbooks/devel/core#server_signature According to the code, it affect USER-Agent when generating a request and Server header for replies. Turn it of and can get rid of the workaround with custom hea

Re: [SR-Users] Setting Kamailio User-Agent dynamically

2014-10-09 Thread Daniel-Constantin Mierla
Hello, On 09/10/14 13:19, Errol Samuels wrote: HI Daniel, Thanks for that. In my case I would need to use something like: user_agent_header = "X-Proxy: $ua" The only purpose of the above line is that Kamailio doesn't add an User-Agent header by itself, but this X-Proxy (which you can change

Re: [SR-Users] Setting Kamailio User-Agent dynamically

2014-10-09 Thread Errol Samuels
HI Daniel, Thanks for that. In my case I would need to use something like: user_agent_header = "X-Proxy: $ua" since we don't what to hardcode a specific value which would affect every device that is registering but rather $ua which would set the real UA of the device that is registering at that

Re: [SR-Users] Setting Kamailio User-Agent dynamically

2014-10-09 Thread Daniel-Constantin Mierla
I just commented on the other email you send, try with something like: user_agent_header="X-Proxy: xyz" Cheers, Daniel On 09/10/14 12:08, Errol Samuels wrote: Just found something interesting. I just commented out the "user_agent_header" in the Global section and restarted kamailio and now t

Re: [SR-Users] Setting Kamailio User-Agent dynamically

2014-10-09 Thread Daniel-Constantin Mierla
On 08/10/14 19:25, Errol Samuels wrote: I followed Daniel's instructions and made some progress but not 100% there yet. ---[Global section]-- user_agent_header="" ---[Main Routing Logic]--- # handle registrations if (is_method("REGISTER")) { $avp(

Re: [SR-Users] Setting Kamailio User-Agent dynamically

2014-10-09 Thread Errol Samuels
Just found something interesting. I just commented out the "user_agent_header" in the Global section and restarted kamailio and now the REGISTER message seems to be completely intact but now we have two occurrences of the User-Agent. I tried doing the remove_hf("User-Agent) but it doesn't seem to

Re: [SR-Users] Setting Kamailio User-Agent dynamically

2014-10-08 Thread Errol Samuels
I followed Daniel's instructions and made some progress but not 100% there yet. ---[Global section]-- user_agent_header="" ---[Main Routing Logic]--- # handle registrations if (is_method("REGISTER")) { $avp(new_user_agent) = $ua; } rou

Re: [SR-Users] Setting Kamailio User-Agent dynamically

2014-10-08 Thread Daniel-Constantin Mierla
Perhaps you can get it with adding User-Agent header to $uac_req(hdrs): $uac_req(hdrs)= $uac_req(hdrs) + "User-Agent: " + $ua + "\r\n"; And sent the global parameter: user_agent_header="" But then no local generated request has user agent, which probably is ok for you. There are still ways

Re: [SR-Users] Setting Kamailio User-Agent dynamically

2014-10-07 Thread SamyGo
No no, not like that, its a separate route and needs to be placed outside the other route[] { ... } On Tue, Oct 7, 2014 at 4:06 PM, Errol Samuels wrote: > Hi Sammy, > > Thanks for your response and the clarification. > > What I am actually trying to do is to pass the real User-Agent info for >

Re: [SR-Users] Setting Kamailio User-Agent dynamically

2014-10-07 Thread Errol Samuels
Hi Sammy, Thanks for your response and the clarification. What I am actually trying to do is to pass the real User-Agent info for each device as the Registration is fowarded to Freeswitch so using your code as an example instead of hardcoding the custom "User-Agent: My Server SIP Server" which wi

Re: [SR-Users] Setting Kamailio User-Agent dynamically

2014-10-07 Thread SamyGo
Hey Errol, What I get from Daniel's email is that you only need to add this route in your script and it will trigger itself automatically when "uac_req_send()" function is executed. event_route [tm:local-request] { # Handle locally generated requests xlog("L_INFO", "Routing locally generate

Re: [SR-Users] Setting Kamailio User-Agent dynamically

2014-10-07 Thread Errol Samuels
Thanks for your input Daniel but pardon my ignorance as I am not 100% clear where I need to add that event_route[tm:local-request]. Here is the point where the REGISTER is being sent to Freeswitch. So are you able to provide an example of where I send the real User-Agent of the device to Freeswit

Re: [SR-Users] Setting Kamailio User-Agent dynamically

2014-10-07 Thread Daniel-Constantin Mierla
You have to use event_route[tm:local-request] if you use uac module to send out new REGISTER. Cheers, Daniel On 03/10/14 18:32, Errol Samuels wrote: I also tried your last suggestion at the point when the registeris being forwarded to FS but it had no effect # Forward REGISTER to Freeswitch

Re: [SR-Users] Setting Kamailio User-Agent dynamically

2014-10-03 Thread Errol Samuels
I also tried your last suggestion at the point when the registeris being forwarded to FS but it had no effect # Forward REGISTER to Freeswitch route[REGFWD] { if(!is_method("REGISTER")) { return; } #if ( is_present_hf("User-Agent")) { * remove_hf("

Re: [SR-Users] Setting Kamailio User-Agent dynamically

2014-10-03 Thread Rainer Piper
Am 03.10.2014 um 17:52 schrieb Errol Samuels: Hi Rainer, Yes I did try user_agent_header = "User-Agent: $ua"; but it just passes "$ua" to Freeswitch rather than the value of $ua. regards, Errol On Fri, Oct 3, 2014 at 4:32 PM, Rainer Piper mailto:rainer.pi...@soho-piper.de>> wrote:

Re: [SR-Users] Setting Kamailio User-Agent dynamically

2014-10-03 Thread Errol Samuels
Hi Rainer, Yes I did try user_agent_header = "User-Agent: $ua"; but it just passes "$ua" to Freeswitch rather than the value of $ua. regards, Errol On Fri, Oct 3, 2014 at 4:32 PM, Rainer Piper wrote: > Am 03.10.2014 um 17:04 schrieb Errol Samuels: > >Hello All, > > I am using Kamailio

Re: [SR-Users] Setting Kamailio User-Agent dynamically

2014-10-03 Thread Rainer Piper
Am 03.10.2014 um 17:04 schrieb Errol Samuels: Hello All, I am using Kamailio in front of Freeswitch and Kamailio is handling the registrations then forwarding to Freeswitch and everything is working for the most part. However, there is niggling pain in the neck issue where the user's User-A

[SR-Users] Setting Kamailio User-Agent dynamically

2014-10-03 Thread Errol Samuels
Hello All, I am using Kamailio in front of Freeswitch and Kamailio is handling the registrations then forwarding to Freeswitch and everything is working for the most part. However, there is niggling pain in the neck issue where the user's User-Agent shows in Freeswitch as kamailio (4.0.6 (x86_64/