From the online documentation:$fU - From URI username
*$fU* - reference to username in URI of 'From' header
It is R/W variable (you can assign values to it directly in configuration file) But i am no able to assign values to $fU. Has anyone experienced this?
Snippet of code in the configuration file of mine and its respective logs showing that $fU is not getting overwritten. I have tried to hard code values to it assign variables to it, all to no avail.
configuration file code snippet:
xlog("L_INFO", "[$ci] from header username pre mod: $fU"); $fU = "5555555555"; xlog("L_INFO", "[$ci] from header username post mod: $fU");
Logfile snippet:
INFO: (s) [7EAB8FECD723E8444E36C659F331068B41EC6BB0] from header username pre mod: 3224567880 INFO: (s) [7EAB8FECD723E8444E36C659F331068B41EC6BB0] from header username post mod: 3224567880
Thanks,
Karthik
You may need to run msg_apply_changes() before this change is immediately visible in route script.
On Wed, Jun 13, 2018 at 12:45:19PM -0500, Karthik Srinivasan wrote:
From the online documentation:$fU - From URI username
*$fU* - reference to username in URI of 'From' header
It is R/W variable (you can assign values to it directly in configuration file) But i am no able to assign values to $fU. Has anyone experienced this?
Snippet of code in the configuration file of mine and its respective logs showing that $fU is not getting overwritten. I have tried to hard code values to it assign variables to it, all to no avail.
configuration file code snippet:
xlog("L_INFO", "[$ci] from header username pre mod: $fU"); $fU = "5555555555"; xlog("L_INFO", "[$ci] from header username post mod: $fU");
Logfile snippet:
INFO: (s) [7EAB8FECD723E8444E36C659F331068B41EC6BB0] from header username pre mod: 3224567880 INFO: (s) [7EAB8FECD723E8444E36C659F331068B41EC6BB0] from header username post mod: 3224567880
Thanks,
Karthik
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Alex,
You are correct. msg_apply_changes works.
I am a bit confused on why this is so. I have manipulated $rU for example without having to call msg_apply_changes.
Could you explain why we need to call this function when manipulating $fU ?
Thanks,
Karthik
On Wed, Jun 13, 2018 at 12:44 PM, Alex Balashov abalashov@evaristesys.com wrote:
You may need to run msg_apply_changes() before this change is immediately visible in route script.
On Wed, Jun 13, 2018 at 12:45:19PM -0500, Karthik Srinivasan wrote:
From the online documentation:$fU - From URI username
*$fU* - reference to username in URI of 'From' header
It is R/W variable (you can assign values to it directly in configuration file) But i am no able to assign values to $fU. Has anyone experienced this?
Snippet of code in the configuration file of mine and its respective logs showing that $fU is not getting overwritten. I have tried to hard code values to it assign variables to it, all to no avail.
configuration file code snippet:
xlog("L_INFO", "[$ci] from header username pre mod: $fU"); $fU = "5555555555"; xlog("L_INFO", "[$ci] from header username post mod: $fU");
Logfile snippet:
INFO: (s) [7EAB8FECD723E8444E36C659F331068B41EC6BB0] from header
username
pre mod: 3224567880 INFO: (s) [7EAB8FECD723E8444E36C659F331068B41EC6BB0] from header
username
post mod: 3224567880
Thanks,
Karthik
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
-- Alex Balashov | Principal | Evariste Systems LLC
Tel: +1-706-510-6800 / +1-800-250-5920 (toll-free) Web: http://www.evaristesys.com/, http://www.csrpswitch.com/
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
On Wed, Jun 13, 2018 at 01:26:07PM -0500, Karthik Srinivasan wrote:
Could you explain why we need to call this function when manipulating $fU ?
Some PV manipulations work that way, others don't. :-) "Because Kamailio".
Am Mittwoch, 13. Juni 2018, 20:28:13 CEST schrieb Alex Balashov:
On Wed, Jun 13, 2018 at 01:26:07PM -0500, Karthik Srinivasan wrote:
Could you explain why we need to call this function when manipulating $fU ?
Some PV manipulations work that way, others don't. :-) "Because Kamailio".
Don't want to dig into to much technical details here..
But to give a bit more context, the Kamailio architecture related to SIP message processing is optimized to avoid re-parsing of the message during configuration processing. This works with so called "lumps" which are more or less like a programming patch file (e.g. change, delete parts). This lumps are applied shortly before sending the message out or if you call msg_apply_changes().
Some parts of the SIP message are accessed directly, because they are "more important" (like the request URI) are handled specially, some like the From user are done like a normal SIP header part as described above.
For a bit more details and to look into the details, have a look to the dbg_sip_msg([log_level], [facility]) function in the debugger module.
Best regards,
Henning
Henning,
Thanks for the explanation. This does clear it up for me.
Do you happen to know if there is a list of pseudo vars that fall under the non special case? (a list for those psedo vars where msg_apply_changes needs to be called for the update to be reflected while in routing file processing that is.)
Thanks,
Karthik
On Wed, Jun 13, 2018 at 1:39 PM, Henning Westerholt hw@kamailio.org wrote:
Am Mittwoch, 13. Juni 2018, 20:28:13 CEST schrieb Alex Balashov:
On Wed, Jun 13, 2018 at 01:26:07PM -0500, Karthik Srinivasan wrote:
Could you explain why we need to call this function when manipulating
$fU
?
Some PV manipulations work that way, others don't. :-) "Because Kamailio".
Don't want to dig into to much technical details here..
But to give a bit more context, the Kamailio architecture related to SIP message processing is optimized to avoid re-parsing of the message during configuration processing. This works with so called "lumps" which are more or less like a programming patch file (e.g. change, delete parts). This lumps are applied shortly before sending the message out or if you call msg_apply_changes().
Some parts of the SIP message are accessed directly, because they are "more important" (like the request URI) are handled specially, some like the From user are done like a normal SIP header part as described above.
For a bit more details and to look into the details, have a look to the dbg_sip_msg([log_level], [facility]) function in the debugger module.
Best regards,
Henning
or rather a list of the pseudo vars that fall under the special case; assuming this list is smaller.
On Wed, Jun 13, 2018 at 4:05 PM, Karthik Srinivasan ksriniva2002@gmail.com wrote:
Henning,
Thanks for the explanation. This does clear it up for me.
Do you happen to know if there is a list of pseudo vars that fall under the non special case? (a list for those psedo vars where msg_apply_changes needs to be called for the update to be reflected while in routing file processing that is.)
Thanks,
Karthik
On Wed, Jun 13, 2018 at 1:39 PM, Henning Westerholt hw@kamailio.org wrote:
Am Mittwoch, 13. Juni 2018, 20:28:13 CEST schrieb Alex Balashov:
On Wed, Jun 13, 2018 at 01:26:07PM -0500, Karthik Srinivasan wrote:
Could you explain why we need to call this function when manipulating
$fU
?
Some PV manipulations work that way, others don't. :-) "Because Kamailio".
Don't want to dig into to much technical details here..
But to give a bit more context, the Kamailio architecture related to SIP message processing is optimized to avoid re-parsing of the message during configuration processing. This works with so called "lumps" which are more or less like a programming patch file (e.g. change, delete parts). This lumps are applied shortly before sending the message out or if you call msg_apply_changes().
Some parts of the SIP message are accessed directly, because they are "more important" (like the request URI) are handled specially, some like the From user are done like a normal SIP header part as described above.
For a bit more details and to look into the details, have a look to the dbg_sip_msg([log_level], [facility]) function in the debugger module.
Best regards,
Henning
Hello,
you have to put this from the perspective of: changes to the SIP message (headers and body) are not immediately reflected. So even if you do a replace or subst operation, changes are not visible. If you do remove_hf() or append_hf(), it happens the same.
The FAQ has an entry for it:
- https://www.kamailio.org/wiki/tutorials/faq/main#why_changes_made_to_headers...
$fu/U/d used to be read only, we made them r/w for convenience, as a variable based operation instead of uac_replace_from().
The r-uri variables ($ru, $rU, $rd, ...) are not pointing to the SIP message buffer, there is a special field (and buffer) inside the internal structure of Kamailio, that's why changes to it are visible. The corresponding variables pointing to the SIP message buffer are $ou, $oU, ...
Cheers, Daniel
On 13.06.18 23:05, Karthik Srinivasan wrote:
Henning,
Thanks for the explanation. This does clear it up for me.
Do you happen to know if there is a list of pseudo vars that fall under the non special case? (a list for those psedo vars where msg_apply_changes needs to be called for the update to be reflected while in routing file processing that is.)
Thanks,
Karthik
On Wed, Jun 13, 2018 at 1:39 PM, Henning Westerholt <hw@kamailio.org mailto:hw@kamailio.org> wrote:
Am Mittwoch, 13. Juni 2018, 20:28:13 CEST schrieb Alex Balashov: > On Wed, Jun 13, 2018 at 01:26:07PM -0500, Karthik Srinivasan wrote: > > Could you explain why we need to call this function when manipulating $fU > > ? > > Some PV manipulations work that way, others don't. :-) "Because > Kamailio". Don't want to dig into to much technical details here.. But to give a bit more context, the Kamailio architecture related to SIP message processing is optimized to avoid re-parsing of the message during configuration processing. This works with so called "lumps" which are more or less like a programming patch file (e.g. change, delete parts). This lumps are applied shortly before sending the message out or if you call msg_apply_changes(). Some parts of the SIP message are accessed directly, because they are "more important" (like the request URI) are handled specially, some like the From user are done like a normal SIP header part as described above. For a bit more details and to look into the details, have a look to the dbg_sip_msg([log_level], [facility]) function in the debugger module. Best regards, Henning
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Daniel,
I appreciate the information. Than you very much.
Karthik
On Thu, Jun 14, 2018 at 1:18 AM, Daniel-Constantin Mierla <miconda@gmail.com
wrote:
Hello,
you have to put this from the perspective of: changes to the SIP message (headers and body) are not immediately reflected. So even if you do a replace or subst operation, changes are not visible. If you do remove_hf() or append_hf(), it happens the same.
The FAQ has an entry for it:
changes_made_to_headers_or
$fu/U/d used to be read only, we made them r/w for convenience, as a variable based operation instead of uac_replace_from().
The r-uri variables ($ru, $rU, $rd, ...) are not pointing to the SIP message buffer, there is a special field (and buffer) inside the internal structure of Kamailio, that's why changes to it are visible. The corresponding variables pointing to the SIP message buffer are $ou, $oU, ... Cheers, Daniel
On 13.06.18 23:05, Karthik Srinivasan wrote:
Henning,
Thanks for the explanation. This does clear it up for me.
Do you happen to know if there is a list of pseudo vars that fall under the non special case? (a list for those psedo vars where msg_apply_changes needs to be called for the update to be reflected while in routing file processing that is.)
Thanks,
Karthik
On Wed, Jun 13, 2018 at 1:39 PM, Henning Westerholt hw@kamailio.org wrote:
Am Mittwoch, 13. Juni 2018, 20:28:13 CEST schrieb Alex Balashov:
On Wed, Jun 13, 2018 at 01:26:07PM -0500, Karthik Srinivasan wrote:
Could you explain why we need to call this function when manipulating
$fU
?
Some PV manipulations work that way, others don't. :-) "Because Kamailio".
Don't want to dig into to much technical details here..
But to give a bit more context, the Kamailio architecture related to SIP message processing is optimized to avoid re-parsing of the message during configuration processing. This works with so called "lumps" which are more or less like a programming patch file (e.g. change, delete parts). This lumps are applied shortly before sending the message out or if you call msg_apply_changes().
Some parts of the SIP message are accessed directly, because they are "more important" (like the request URI) are handled specially, some like the From user are done like a normal SIP header part as described above.
For a bit more details and to look into the details, have a look to the dbg_sip_msg([log_level], [facility]) function in the debugger module.
Best regards,
Henning
Kamailio (SER) - Users Mailing Listsr-users@lists.kamailio.orghttps://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
-- Daniel-Constantin Mierla -- www.asipto.comwww.twitter.com/miconda -- www.linkedin.com/in/miconda Kamailio World Conference -- www.kamailioworld.com