Hi,
what is the best way to replace the userpart of the SIP-To URI with the content of a pseudo variable?
Thanks for every hint.
Best regards, Bernhard
Am 03.01.2011 16:51, schrieb Bernhard Suttner:
Hi,
what is the best way to replace the userpart of the SIP-To URI with the content of a pseudo variable?
textops module:
e.g. use http://www.kamailio.org/docs/modules/3.1.x/modules_k/textops.html#id2910302
you could also remove_hf("to") and add a new header append_hf("To: ...");
some devices do not like if the To gets changed. In this case you have to reverse the change in the responses and keep track of cahnges for in-dialog messages.
Anyway - at the least the totag must not be changed (if present)
regards klaus
Hello,
On 1/3/11 6:42 PM, Klaus Darilion wrote:
Am 03.01.2011 16:51, schrieb Bernhard Suttner:
Hi,
what is the best way to replace the userpart of the SIP-To URI with the content of a pseudo variable?
textops module:
e.g. use http://www.kamailio.org/docs/modules/3.1.x/modules_k/textops.html#id2910302
you could also remove_hf("to") and add a new header append_hf("To: ...");
starting with 3.1.0, you can do simply:
$tU = "12345";
But be aware you have to do it only once, or call msg_apply_changes() before doing another one.
Since 3.1.0, From and To header attributes: display name, username and domain are writable via PVs, with the constraint stated above.
Cheers, Daniel
some devices do not like if the To gets changed. In this case you have to reverse the change in the responses and keep track of cahnges for in-dialog messages.
Anyway - at the least the totag must not be changed (if present)
regards klaus
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Daniel,
On 01/07/2011 04:36 AM, Daniel-Constantin Mierla wrote:
Since 3.1.0, From and To header attributes: display name, username and domain are writable via PVs, with the constraint stated above.
I can write to $fU/$fu/$fd without having to use uac_replace_from()?
Thanks,
On 1/7/11 10:37 AM, Alex Balashov wrote:
Daniel,
On 01/07/2011 04:36 AM, Daniel-Constantin Mierla wrote:
Since 3.1.0, From and To header attributes: display name, username and domain are writable via PVs, with the constraint stated above.
I can write to $fU/$fu/$fd without having to use uac_replace_from()?
yes, but only if you don't want to restore automatically.
I haven't met lately a sip device complaining because of changes in from/to uri. by rfc3261 only the tags matter for dialogs, therefore you can change as you want and forget about restoring back. it works for me in many deployments.
Cheers, Daniel
On 01/07/2011 04:51 AM, Daniel-Constantin Mierla wrote:
On 1/7/11 10:37 AM, Alex Balashov wrote:
Daniel,
On 01/07/2011 04:36 AM, Daniel-Constantin Mierla wrote:
Since 3.1.0, From and To header attributes: display name, username and domain are writable via PVs, with the constraint stated above.
I can write to $fU/$fu/$fd without having to use uac_replace_from()?
yes, but only if you don't want to restore automatically.
I haven't met lately a sip device complaining because of changes in from/to uri. by rfc3261 only the tags matter for dialogs, therefore you can change as you want and forget about restoring back. it works for me in many deployments.
Ah, okay. That was going to be my next question.
Personally, I prefer the stateful automatic restore for compatibility and purity reasons, but it is nice to know the capability is there to take a more simple approach if needed and appropriate.
Hi,
the trick, when using "uac_replace_from" is, that it will "automagically" change subsequest requests. This is required in order to work with most SIP-Endpoints. If you just want to change the "From" for the current request, that is fine.
Carsten
2011/1/7 Alex Balashov abalashov@evaristesys.com:
Daniel,
On 01/07/2011 04:36 AM, Daniel-Constantin Mierla wrote:
Since 3.1.0, From and To header attributes: display name, username and domain are writable via PVs, with the constraint stated above.
I can write to $fU/$fu/$fd without having to use uac_replace_from()?
Thanks,
-- Alex Balashov - Principal Evariste Systems LLC 260 Peachtree Street NW Suite 2200 Atlanta, GA 30303 Tel: +1-678-954-0670 Fax: +1-404-961-1892 Web: http://www.evaristesys.com/
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
On 01/07/2011 04:52 AM, Carsten Bock wrote:
the trick, when using "uac_replace_from" is, that it will "automagically" change subsequest requests. This is required in order to work with most SIP-Endpoints. If you just want to change the "From" for the current request, that is fine.
I understand. Changing To/From by a proxy has long been a thorny issue, in the sense that on the one hand those fields are purely cosmetic in strict-3261 mode, but on the other hand, changing them breaks 2543 compatibility, and it's just not something a proxy is supposed to do.
I suppose that a very strict UA could also refuse to process replies which contain From/To header values that do not match the ones it sent, even if those values are not used for dialog or request association or anything related to maintenance of state per se.
7 jan 2011 kl. 10.55 skrev Alex Balashov:
On 01/07/2011 04:52 AM, Carsten Bock wrote:
the trick, when using "uac_replace_from" is, that it will "automagically" change subsequest requests. This is required in order to work with most SIP-Endpoints. If you just want to change the "From" for the current request, that is fine.
I understand. Changing To/From by a proxy has long been a thorny issue, in the sense that on the one hand those fields are purely cosmetic in strict-3261 mode, but on the other hand, changing them breaks 2543 compatibility, and it's just not something a proxy is supposed to do.
Well, that changed with a new rfc (put number here) about caller ID updates. I do not remember the proxy role, but a UA can now change From/To identities mid call, like after a call transfer in a pbx.
/O