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_header…
$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(a)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(a)lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
--
Daniel-Constantin Mierla --
www.asipto.com
www.twitter.com/miconda --
www.linkedin.com/in/miconda
Kamailio World Conference --
www.kamailioworld.com