From 53bedfb00b678d5d954373a9f24957e19f906ee2 Mon Sep 17 00:00:00 2001 From: Xenofon Karamanos <22965395+xkaraman@users.noreply.github.com> Date: Fri, 23 Aug 2024 10:35:29 +0000 Subject: [PATCH 1/4] makrdownlint: Allow different character for each list level --- .markdownlint-cli2.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.markdownlint-cli2.yaml b/.markdownlint-cli2.yaml index 344c04c8..fa4829ad 100644 --- a/.markdownlint-cli2.yaml +++ b/.markdownlint-cli2.yaml @@ -1,4 +1,6 @@ config: default: true + MD004: + style: "sublist" MD013: false MD046: false From 8835941ea109e061f7d93cd81bdc864905db5b4c Mon Sep 17 00:00:00 2001 From: Xenofon Karamanos <22965395+xkaraman@users.noreply.github.com> Date: Tue, 20 Aug 2024 15:48:08 +0000 Subject: [PATCH 2/4] tutorial/faq/main: Pre-commit format fix --- docs/cookbooks/devel/pseudovariables.md | 12 +- docs/tutorials/faq/main.md | 164 ++++++++++++------------ 2 files changed, 87 insertions(+), 89 deletions(-) diff --git a/docs/cookbooks/devel/pseudovariables.md b/docs/cookbooks/devel/pseudovariables.md index 3e9b4aa0..44308fa5 100644 --- a/docs/cookbooks/devel/pseudovariables.md +++ b/docs/cookbooks/devel/pseudovariables.md @@ -336,7 +336,7 @@ Return `\t`. ### $Es - Space -Return ` `. +Return ` `. ### $Ec - Comma @@ -1749,7 +1749,7 @@ printing in the Erlang shell. ### $erl_atom(name) -*$erl_atom(name)* pseudo variable allows create analog to Erlang atom +_$erl_atom(name)_ pseudo variable allows create analog to Erlang atom data type. Erlang atom is a literal, a constant with name. Formatted output pseudo variable atom could be enclosed in single quotes (') if it does not begin with a lower-case letter or if it contains other @@ -2149,8 +2149,8 @@ HTTP response body and body length, - name - id to refer the documet - spec - specifier: - * doc - set/get the document as text - * xpath:xpath-expression - evaluate xpath expression + - doc - set/get the document as text + - xpath:xpath-expression - evaluate xpath expression Example: @@ -3347,7 +3347,7 @@ evrexec attributes: ### $subs(key) - Subscription Attributes This variable gives access to attributes of the current subscription. -The variable has to be used after executing *handle_subscription()* in +The variable has to be used after executing _handle_subscription()_ in order to provide accurate values. The key can be: @@ -3503,7 +3503,7 @@ The key can be: ## pv_headers module variables -- $x_hdr(*header_name*): *header_name* header value +- $x_hdr(_header_name_): _header_name_ header value - $x_fu: Full From header - $x_fU: From header user part - $x_fd: From header domain part diff --git a/docs/tutorials/faq/main.md b/docs/tutorials/faq/main.md index f2a4b531..24ae2ec7 100644 --- a/docs/tutorials/faq/main.md +++ b/docs/tutorials/faq/main.md @@ -12,82 +12,82 @@ right answer. ## Table Of Contents - [Frequently Asked Questions](#frequently-asked-questions) - * [General](#general) - + [What is Kamailio?](#what-is-kamailio) - + [Is Kamailio a B2BUA?](#is-kamailio-a-b2bua) - + [Can Kamailio be used as SIP redirect server?](#can-kamailio-be-used-as-sip-redirect-server) - + [Can Kamailio be used as SIP registrar and location server?](#can-kamailio-be-used-as-sip-registrar-and-location-server) - + [Can Kamailio be used as SIP proxy server?](#can-kamailio-be-used-as-sip-proxy-server) - + [Can Kamailio be used as SIP load balancer server?](#can-kamailio-be-used-as-sip-load-balancer-server) - + [Can I load balance Asterisk or FreeSwitch with Kamailio?](#can-i-load-balance-asterisk-or-freeswitch-with-kamailio) - + [Can Kamailio be used as SIP least cost routing server?](#can-kamailio-be-used-as-sip-least-cost-routing-server) - + [Is it possible to reload Kamailio configuration file?](#is-it-possible-to-reload-kamailio-configuration-file) - + [What is the license of Kamailio?](#what-is-the-license-of-kamailio) - + [Can it be installed on Windows?](#can-it-be-installed-on-windows) - * [Transport Layers](#transport-layers) - + [What transport layer protocols are implemented in Kamailio?](#what-transport-layer-protocols-are-implemented-in-kamailio) - + [Does Kamailio have support for WebSockets?](#does-kamailio-have-support-for-websockets) - + [Can Kamailio do gatewaying between transport layers?](#can-kamailio-do-gatewaying-between-transport-layers) - + [Can Kamailio be used to call from web browsers (webrtc) to classic](#can-kamailio-be-used-to-call-from-web-browsers-webrtc-to-classic) + * [General](#general) + + [What is Kamailio?](#what-is-kamailio) + + [Is Kamailio a B2BUA?](#is-kamailio-a-b2bua) + + [Can Kamailio be used as SIP redirect server?](#can-kamailio-be-used-as-sip-redirect-server) + + [Can Kamailio be used as SIP registrar and location server?](#can-kamailio-be-used-as-sip-registrar-and-location-server) + + [Can Kamailio be used as SIP proxy server?](#can-kamailio-be-used-as-sip-proxy-server) + + [Can Kamailio be used as SIP load balancer server?](#can-kamailio-be-used-as-sip-load-balancer-server) + + [Can I load balance Asterisk or FreeSwitch with Kamailio?](#can-i-load-balance-asterisk-or-freeswitch-with-kamailio) + + [Can Kamailio be used as SIP least cost routing server?](#can-kamailio-be-used-as-sip-least-cost-routing-server) + + [Is it possible to reload Kamailio configuration file?](#is-it-possible-to-reload-kamailio-configuration-file) + + [What is the license of Kamailio?](#what-is-the-license-of-kamailio) + + [Can it be installed on Windows?](#can-it-be-installed-on-windows) + * [Transport Layers](#transport-layers) + + [What transport layer protocols are implemented in Kamailio?](#what-transport-layer-protocols-are-implemented-in-kamailio) + + [Does Kamailio have support for WebSockets?](#does-kamailio-have-support-for-websockets) + + [Can Kamailio do gatewaying between transport layers?](#can-kamailio-do-gatewaying-between-transport-layers) + + [Can Kamailio be used to call from web browsers (webrtc) to classic SIP Phones](#can-kamailio-be-used-to-call-from-web-browsers-webrtc-to-classic-sip-phones) + [Modules](#modules) - + [What is a Kamailio module?](#what-is-a-kamailio-module) - + [Where are Kamailio modules located?](#where-are-kamailio-modules-located) - + [Which modules are compiled by default?](#which-modules-are-compiled-by-default) - + [How can I compile and install a module that is excluded by default?](#how-can-i-compile-and-install-a-module-that-is-excluded-by-default) - + [I use 'make all', but I can't get the db_mysql.so. How can I get this?](#i-use-make-all-but-i-cant-get-the-db_mysqlso-how-can-i-get-this) - + [How to compile only one module?](#how-to-compile-only-one-module) - * [SIP Message Processing](#sip-message-processing) - + [Why changes made to headers or body are not visible immediately?](#why-changes-made-to-headers-or-body-are-not-visible-immediately) - + [Why parts of From/To header appear many times?](#why-parts-of-fromto-header-appear-many-times) - + [Why body or other parts of the SIP message appear multiple times?](#why-body-or-other-parts-of-the-sip-message-appear-multiple-times) - + [How to set different header values for each destination of a SIP request?](#how-to-set-different-header-values-for-each-destination-of-a-sip-request) - + [How to remove a single header field when a header appears multiple times?](#how-to-remove-a-single-header-field-when-a-header-appears-multiple-times) - + [Why the SIP requests are replied with "483 Too Many Hops" or "513 Message Too Large"?](#why-the-sip-requests-are-replied-with-483-too-many-hops-or-513-message-too-large) - + [I send SIP requests to Kamailio, but nothing happens, why?](#i-send-sip-requests-to-kamailio-but-nothing-happens-why) - * [Media Streams](#media-streams) - + [Does Kamailio relay media streams?](#does-kamailio-relay-media-streams) - + [What codecs are supported by Kamailio?](#what-codecs-are-supported-by-kamailio) - + [Can Kamailio be used for video calls?](#can-kamailio-be-used-for-video-calls) - * [Getting Started](#getting-started) - + [What are the minimum knowledge requirements before starting with Kamailio?](#what-are-the-minimum-knowledge-requirements-before-starting-with-kamailio) - + [Any step-by-step guide to install Kamailio?](#any-step-by-step-guide-to-install-kamailio) - * [Support](#support) - + [Are there public mailing list where one can ask questions about Kamailio?](#are-there-public-mailing-list-where-one-can-ask-questions-about-kamailio) - + [What are the rules for posting questions about Kamailio?](#what-are-the-rules-for-posting-questions-about-kamailio) - + [Where I can report an issue?](#where-i-can-report-an-issue) - + [Where can I buy commercial support?](#where-can-i-buy-commercial-support) - * [DNS](#dns) - + [Does it have support for ENUM?](#does-it-have-support-for-enum) - + [What kind of DNS queries can it do?](#what-kind-of-dns-queries-can-it-do) - + [Can it do DNS-based (SRV) load balancing?](#can-it-do-dns-based-srv-load-balancing) - + [How to avoid reverse DNS for **src_ip** comparison?](#how-to-avoid-reverse-dns-for-src_ip-comparison) - * [Instant Messaging and Presence](#instant-messaging-and-presence) - + [Can it route SIP instant messaging requests (page mode, RFC3428)?](#can-it-route-sip-instant-messaging-requests-page-mode-rfc3428) - + [Can it store instant messages for offline users and deliver them when the users become online?](#can-it-store-instant-messages-for-offline-users-and-deliver-them-when-the-users-become-online) - + [Can it route instant messages using MSRP (RFC4975)?](#can-it-route-instant-messages-using-msrp-rfc4975) - + [Can it handle end-to-end presence requests?](#can-it-handle-end-to-end-presence-requests) - + [Does it have support for SIP SIMPLE Presence (presence agent model)?](#does-it-have-support-for-sip-simple-presence-presence-agent-model) - + [Does it have support for Resource Lists Service?](#does-it-have-support-for-resource-lists-service) - + [Can it act as a presence user agent?](#can-it-act-as-a-presence-user-agent) - + [Can it handle subscription requests for dialog states (aka, blinking lamps)?](#can-it-handle-subscription-requests-for-dialog-states-aka-blinking-lamps) - + [Does it have support for handling XCAP?](#does-it-have-support-for-handling-xcap) - * [NAT Traversal](#nat-traversal) - + [Can Kamailio be used with phones connecting from behind NAT?](#can-kamailio-be-used-with-phones-connecting-from-behind-nat) - + [Can Kamailio be installed behind NAT (e.g., like on Amazon EC2)?](#can-kamailio-be-installed-behind-nat-eg-like-on-amazon-ec2) - * [Configuration File Processing](#configuration-file-processing) - + [Can I check the configuration files for syntax errors?](#can-i-check-the-configuration-files-for-syntax-errors) - + [Do I have to delete the AVPs added in the configuration file for a SIP message?](#do-i-have-to-delete-the-avps-added-in-the-configuration-file-for-a-sip-message) - + [What is a pseudo-variable?](#what-is-a-pseudo-variable) - + [How to iterate through the items in a comma separated string?](#how-to-iterate-through-the-items-in-a-comma-separated-string) - + [How is the function return code evaluated?](#how-is-the-function-return-code-evaluated) - + [How is the SIP request retransmission handled?](#how-is-the-sip-request-retransmission-handled) - * [Troubleshooting](#troubleshooting) - + [I get 'out of memory' errors, what can be done?](#i-get-out-of-memory-errors-what-can-be-done) - * [Tools](#tools) - + [How to generate HA1 value in command line?](#how-to-generate-ha1-value-in-command-line) - + [How to generate HA1B value in command line?](#how-to-generate-ha1b-value-in-command-line) - + [Kamctl gives an error regarding opening FIFO file, why?](#kamctl-gives-an-error-regarding-opening-fifo-file-why) - + [Kamcmd sometime fails to execute RPC commands with number parameters, why?](#kamcmd-sometime-fails-to-execute-rpc-commands-with-number-parameters-why) + + [What is a Kamailio module?](#what-is-a-kamailio-module) + + [Where are Kamailio modules located?](#where-are-kamailio-modules-located) + + [Which modules are compiled by default?](#which-modules-are-compiled-by-default) + + [How can I compile and install a module that is excluded by default?](#how-can-i-compile-and-install-a-module-that-is-excluded-by-default) + + [I use 'make all', but I can't get the db_mysql.so. How can I get this?](#i-use-make-all-but-i-cant-get-the-db_mysqlso-how-can-i-get-this) + + [How to compile only one module?](#how-to-compile-only-one-module) + * [SIP Message Processing](#sip-message-processing) + + [Why changes made to headers or body are not visible immediately?](#why-changes-made-to-headers-or-body-are-not-visible-immediately) + + [Why parts of From/To header appear many times?](#why-parts-of-fromto-header-appear-many-times) + + [Why body or other parts of the SIP message appear multiple times?](#why-body-or-other-parts-of-the-sip-message-appear-multiple-times) + + [How to set different header values for each destination of a SIP request?](#how-to-set-different-header-values-for-each-destination-of-a-sip-request) + + [How to remove a single header field when a header appears multiple times?](#how-to-remove-a-single-header-field-when-a-header-appears-multiple-times) + + [Why the SIP requests are replied with "483 Too Many Hops" or "513 Message Too Large"?](#why-the-sip-requests-are-replied-with-483-too-many-hops-or-513-message-too-large) + + [I send SIP requests to Kamailio, but nothing happens, why?](#i-send-sip-requests-to-kamailio-but-nothing-happens-why) + * [Media Streams](#media-streams) + + [Does Kamailio relay media streams?](#does-kamailio-relay-media-streams) + + [What codecs are supported by Kamailio?](#what-codecs-are-supported-by-kamailio) + + [Can Kamailio be used for video calls?](#can-kamailio-be-used-for-video-calls) + * [Getting Started](#getting-started) + + [What are the minimum knowledge requirements before starting with Kamailio?](#what-are-the-minimum-knowledge-requirements-before-starting-with-kamailio) + + [Any step-by-step guide to install Kamailio?](#any-step-by-step-guide-to-install-kamailio) + * [Support](#support) + + [Are there public mailing list where one can ask questions about Kamailio?](#are-there-public-mailing-list-where-one-can-ask-questions-about-kamailio) + + [What are the rules for posting questions about Kamailio?](#what-are-the-rules-for-posting-questions-about-kamailio) + + [Where I can report an issue?](#where-i-can-report-an-issue) + + [Where can I buy commercial support?](#where-can-i-buy-commercial-support) + * [DNS](#dns) + + [Does it have support for ENUM?](#does-it-have-support-for-enum) + + [What kind of DNS queries can it do?](#what-kind-of-dns-queries-can-it-do) + + [Can it do DNS-based (SRV) load balancing?](#can-it-do-dns-based-srv-load-balancing) + + [How to avoid reverse DNS for **src_ip** comparison?](#how-to-avoid-reverse-dns-for-src_ip-comparison) + * [Instant Messaging and Presence](#instant-messaging-and-presence) + + [Can it route SIP instant messaging requests (page mode, RFC3428)?](#can-it-route-sip-instant-messaging-requests-page-mode-rfc3428) + + [Can it store instant messages for offline users and deliver them when the users become online?](#can-it-store-instant-messages-for-offline-users-and-deliver-them-when-the-users-become-online) + + [Can it route instant messages using MSRP (RFC4975)?](#can-it-route-instant-messages-using-msrp-rfc4975) + + [Can it handle end-to-end presence requests?](#can-it-handle-end-to-end-presence-requests) + + [Does it have support for SIP SIMPLE Presence (presence agent model)?](#does-it-have-support-for-sip-simple-presence-presence-agent-model) + + [Does it have support for Resource Lists Service?](#does-it-have-support-for-resource-lists-service) + + [Can it act as a presence user agent?](#can-it-act-as-a-presence-user-agent) + + [Can it handle subscription requests for dialog states (aka, blinking lamps)?](#can-it-handle-subscription-requests-for-dialog-states-aka-blinking-lamps) + + [Does it have support for handling XCAP?](#does-it-have-support-for-handling-xcap) + * [NAT Traversal](#nat-traversal) + + [Can Kamailio be used with phones connecting from behind NAT?](#can-kamailio-be-used-with-phones-connecting-from-behind-nat) + + [Can Kamailio be installed behind NAT (e.g., like on Amazon EC2)?](#can-kamailio-be-installed-behind-nat-eg-like-on-amazon-ec2) + * [Configuration File Processing](#configuration-file-processing) + + [Can I check the configuration files for syntax errors?](#can-i-check-the-configuration-files-for-syntax-errors) + + [Do I have to delete the AVPs added in the configuration file for a SIP message?](#do-i-have-to-delete-the-avps-added-in-the-configuration-file-for-a-sip-message) + + [What is a pseudo-variable?](#what-is-a-pseudo-variable) + + [How to iterate through the items in a comma separated string?](#how-to-iterate-through-the-items-in-a-comma-separated-string) + + [How is the function return code evaluated?](#how-is-the-function-return-code-evaluated) + + [How is the SIP request retransmission handled?](#how-is-the-sip-request-retransmission-handled) + * [Troubleshooting](#troubleshooting) + + [I get 'out of memory' errors, what can be done?](#i-get-out-of-memory-errors-what-can-be-done) + * [Tools](#tools) + + [How to generate HA1 value in command line?](#how-to-generate-ha1-value-in-command-line) + + [How to generate HA1B value in command line?](#how-to-generate-ha1b-value-in-command-line) + + [Kamctl gives an error regarding opening FIFO file, why?](#kamctl-gives-an-error-regarding-opening-fifo-file-why) + + [Kamcmd sometime fails to execute RPC commands with number parameters, why?](#kamcmd-sometime-fails-to-execute-rpc-commands-with-number-parameters-why) ## General @@ -195,18 +195,16 @@ through Kamailio. and send out on a different transport. For example, receive TLS on IPv6 and send out UDP on IPv4. -### Can Kamailio be used to call from web browsers (webrtc) to classic -SIP phones? +### Can Kamailio be used to call from web browsers (webrtc) to classic SIP phones? 📃 Yes, from signaling point of view. Remember that Kamailio is SIP packet router, not handling media plane at all. Simply, Kamailio can do gatewaying from WebSocket to UDP, TCP, TLS or SCTP for all SIP messages. However, note that media plane (RTP streams) requires special secure -encoding of the RTP packets, which may not be supported by the old SIP -phones. +encoding of the RTP packets, which may not be supported by the old SIP phones. -###### Modules +## Modules ### What is a Kamailio module? @@ -585,21 +583,21 @@ to: - sr-users \[at\] lists.sip-router.org - mailing list web page: - - + * If the question is related to development version of Kamailio, then email to: - sr-dev \[at\] lists.sip-router.org - mailing list web page: - - + * If the question is related to commercial aspects of Kamailio, then email to: - business \[at\] lists.kamailio.org - mailing list web page: - - + * ### Where I can report an issue? From fcabaddd89662fbc1c112d7aeceb442cf9d3aef1 Mon Sep 17 00:00:00 2001 From: Xenofon Karamanos <22965395+xkaraman@users.noreply.github.com> Date: Fri, 23 Aug 2024 10:45:54 +0000 Subject: [PATCH 3/4] cookbook/devel/pv: Pre-commit format fix --- docs/cookbooks/devel/pseudovariables.md | 28 ++++++++++++------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/docs/cookbooks/devel/pseudovariables.md b/docs/cookbooks/devel/pseudovariables.md index 44308fa5..2cb97336 100644 --- a/docs/cookbooks/devel/pseudovariables.md +++ b/docs/cookbooks/devel/pseudovariables.md @@ -2095,12 +2095,12 @@ parameters before sending a HTTP query. to discover server-supported authentication methods. You may want to use a specific value. Valid values are: - - 1 - BASIC authentication - - 2 - HTTP Digest authentication - - 4 - GSS-Negotiate authentication - - 8 - NTLM authentication - - 16 - HTTP Digest with IE flavour. - - (Default value is 3 - BASIC and Digest authentication.) + + 1 - BASIC authentication + + 2 - HTTP Digest authentication + + 4 - GSS-Negotiate authentication + + 8 - NTLM authentication + + 16 - HTTP Digest with IE flavour. + + (Default value is 3 - BASIC and Digest authentication.) - username: sets the username to use for authenticated requests - password: sets the password to use for authenticated requests - suspend: if set to 0 it doesn't suspend the current transaction before performing the query @@ -2149,8 +2149,8 @@ HTTP response body and body length, - name - id to refer the documet - spec - specifier: - - doc - set/get the document as text - - xpath:xpath-expression - evaluate xpath expression + + doc - set/get the document as text + + xpath:xpath-expression - evaluate xpath expression Example: @@ -2284,7 +2284,7 @@ The key can be: - hdrs - SIP Headers - body - Body - flags - flags for processing - - 1 - the password is provided in HA1 format + + 1 - the password is provided in HA1 format - auser - authentication username - apasswd - authentication password - sock - local socket to be used for sending (proto:address:port) @@ -3222,12 +3222,12 @@ dns_query(hostname, pvid) function from ipops module. - pvid can be any string - key can be: - - count - number of addresses - - ipv4 - set to 1 if at least one ipv4 address (otherwise 0) - - ipv6 - set to 1 if at least one ipv6 address (otherwise 0) - - addr\[index\] - the address as string from position index in the + + count - number of addresses + + ipv4 - set to 1 if at least one ipv4 address (otherwise 0) + + ipv6 - set to 1 if at least one ipv6 address (otherwise 0) + + addr\[index\] - the address as string from position index in the list (0 based indexing) - - type\[index\] - the type of address from position index in the + + type\[index\] - the type of address from position index in the list (0 based indexing), the value is 4 for ipv4 and 6 for ipv6 The index can be an integer or a variable with integer value. First From 9cfffbb23e10206f1e0d79241609d1d848ae68e9 Mon Sep 17 00:00:00 2001 From: Xenofon Karamanos <22965395+xkaraman@users.noreply.github.com> Date: Tue, 20 Aug 2024 15:48:59 +0000 Subject: [PATCH 4/4] cookbook/devel/pv: Add note regarding writable PVs and msg_apply_changes --- docs/cookbooks/devel/pseudovariables.md | 72 +++++++++++++++++++++++++ 1 file changed, 72 insertions(+) diff --git a/docs/cookbooks/devel/pseudovariables.md b/docs/cookbooks/devel/pseudovariables.md index 2cb97336..2ad55e9b 100644 --- a/docs/cookbooks/devel/pseudovariables.md +++ b/docs/cookbooks/devel/pseudovariables.md @@ -376,6 +376,24 @@ configuration file, but its value does not change) 🔥**IMPORTANT**: It is R/W variable (you can assign values to it directly in configuration file, but its value does not change) +**NOTE:** _When using this along with $fu to change part of the message, applying them all at once can result in unintended side-effects. To ensure that the changes are applied to the message as intended, it is suggested to use the `msg_apply_changes()` function from the `textopsx` module after each change to the message. This function can ensure that the changes are applied correctly and that the message remains valid._ + +Example: + +```c +loadmodule "textopsx.so" +... +$fu = "sip:new_user@example.com" +msg_apply_changes() +$fn = "New Display Name" +msg_apply_changes() +... +``` + +**Recommendation**: Use `uac` module functions such as `uac_replace_from` for updating values reliably. + +[See FAQ for more info.](../../tutorials/faq/main.md#sip-message-processing) + ### $fs - Forced Send Socket **$fs** - reference to the forced send socket for the SIP message (if @@ -438,6 +456,24 @@ configuration file, but its value does not change) Note that changing the From: header may break backwards compatibility with SIP 1.0 devices. +**NOTE:** _When using this along with $fn to change part of the message, applying them all at once can result in unintended side-effects. To ensure that the changes are applied to the message as intended, it is suggested to use the `msg_apply_changes()` function from the `textopsx` module after each change to the message. This function can ensure that the changes are applied correctly and that the message remains valid._ + +Example: + +```c +loadmodule "textopsx.so" +... +$fu = "sip:new_user@example.com" +msg_apply_changes() +$fn = "New Display Name" +msg_apply_changes() +... +``` + +**Recommendation**: Use `uac` module functions such as `uac_replace_from` for updating values reliably. + +[See FAQ for more info.](../../tutorials/faq/main.md#sip-message-processing) + ### $fU - From URI username **$fU** - reference to username in URI of 'From' header @@ -837,6 +873,24 @@ configuration file, but its value does not change) 🔥**IMPORTANT**: It is R/W variable (you can assign values to it directly in configuration file, but its value does not change) +**NOTE:** _When using this along with $tu to change part of the message, applying them all at once can result in unintended side-effects. To ensure that the changes are applied to the message as intended, it is suggested to use the `msg_apply_changes()` function from the `textopsx` module after each change to the message. This function can ensure that the changes are applied correctly and that the message remains valid._ + +Example: + +```c +loadmodule "textopsx.so" +... +$tu = "sip:new_user@example.com" +msg_apply_changes() +$tn = "New Display Name" +msg_apply_changes() +... +``` + +**Recommendation**: Use `uac` module functions such as `uac_replace_to` for updating values reliably. + +[See FAQ for more info.](../../tutorials/faq/main.md#sip-message-processing) + ### $tt - To tag **$tt** - reference to tag parameter of 'To' header @@ -862,6 +916,24 @@ this variable returning the right value. 🔥**IMPORTANT**: It is R/W variable (you can assign values to it directly in configuration file, but its value does not change) +**NOTE:** _When using this along with $tn to change part of the message, applying them all at once can result in unintended side-effects. To ensure that the changes are applied to the message as intended, it is suggested to use the `msg_apply_changes()` function from the `textopsx` module after each change to the message. This function can ensure that the changes are applied correctly and that the message remains valid._ + +Example: + +```c +loadmodule "textopsx.so" +... +$fu = "sip:new_user@example.com" +msg_apply_changes() +$fn = "New Display Name" +msg_apply_changes() +... +``` + +**Recommendation**: Use `uac` module functions such as `uac_replace_to` for updating values reliably. + +[See FAQ for more info.](../../tutorials/faq/main.md#sip-message-processing) + ### $tU - To URI Username **$tU** - reference to username in URI of 'To' header