Hi all, can I with SER add following in 302 response? 1) add a parameter in Contact header that a UA will read and copy it to the new INVITE and how would I do it in ser config. 2) or add a new header field with in 302 that a UA will read and copy it to the new INVITE
The first should be possible as RFC3261 in 20.10 shows in example but I'm wondering if SER can do it too.
Thank you, Lada
Hi Lada,
if SER generates the response: append_to_reply("Contact: sip:user@host;param=value\r\n");
if SER forwards the response: (There might be a better way, the following example replaces the whole header field. And I am not sure that it works correctly with multiple contact headers.) assign_hf_value("Contact", "%@contact;param=value");
Miklos
On 03/14/2008 10:35 AM, Ladislav Andel wrote:
Hi all, can I with SER add following in 302 response?
- add a parameter in Contact header that a UA will read and copy it to
the new INVITE and how would I do it in ser config. 2) or add a new header field with in 302 that a UA will read and copy it to the new INVITE
The first should be possible as RFC3261 in 20.10 shows in example but I'm wondering if SER can do it too.
Thank you, Lada _______________________________________________ Serusers mailing list Serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
Hi Miklos,
Miklos Tirpak wrote:
Hi Lada,
if SER generates the response: append_to_reply("Contact: sip:user@host;param=value\r\n");
if SER forwards the response: (There might be a better way, the following example replaces the whole header field. And I am not sure that it works correctly with multiple contact headers.) assign_hf_value("Contact", "%@contact;param=value");
Where is the %@contact taken from? Let's say I will always use the same SIP URI there. Will the param=value be included in following INVITE sent from the client somehow? The UA parse the Contact in 302 and place it to Request-URI of new INVITE but where the param=value will be?
thanks, Lada
Miklos
On 03/14/2008 10:35 AM, Ladislav Andel wrote:
Hi all, can I with SER add following in 302 response?
- add a parameter in Contact header that a UA will read and copy it
to the new INVITE and how would I do it in ser config. 2) or add a new header field with in 302 that a UA will read and copy it to the new INVITE
The first should be possible as RFC3261 in 20.10 shows in example but I'm wondering if SER can do it too.
Thank you, Lada _______________________________________________ Serusers mailing list Serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
Hi,
On 03/14/2008 11:36 AM, Ladislav Andel wrote:
Hi Miklos,
Miklos Tirpak wrote:
Hi Lada,
if SER generates the response: append_to_reply("Contact: sip:user@host;param=value\r\n");
if SER forwards the response: (There might be a better way, the following example replaces the whole header field. And I am not sure that it works correctly with multiple contact headers.) assign_hf_value("Contact", "%@contact;param=value");
Where is the %@contact taken from? Let's say I will always use the same SIP URI there.
@contact is the value of contact header field of the SIP msg being processed. So if you put assign_hf_value into onreply_route, than it returns the contact HF of the reply.
If you need a static value instead, than put there a static value :)
Will the param=value be included in following INVITE sent from the client somehow? The UA parse the Contact in 302 and place it to Request-URI of new INVITE but where the param=value will be?
Oh, I see. Than you have to make sure that the parameter you insert is a URI parameter and not a header parameter, so it must be within <>. And you have to get only the URI of the original contact header field, not the whole HF value (if you do not use a static value), because the URI may have been already enclosed in <>:
assign_hf_value("Contact", "<%@contact.uri;param=value>");
But you loose the header parameters this way :(
Miklos
thanks, Lada
Miklos
On 03/14/2008 10:35 AM, Ladislav Andel wrote:
Hi all, can I with SER add following in 302 response?
- add a parameter in Contact header that a UA will read and copy it
to the new INVITE and how would I do it in ser config. 2) or add a new header field with in 302 that a UA will read and copy it to the new INVITE
The first should be possible as RFC3261 in 20.10 shows in example but I'm wondering if SER can do it too.
Thank you, Lada _______________________________________________ Serusers mailing list Serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
Hi,
Oh, I see. Than you have to make sure that the parameter you insert is a URI parameter and not a header parameter, so it must be within <>. And you have to get only the URI of the original contact header field, not the whole HF value (if you do not use a static value), because the URI may have been already enclosed in <>:
assign_hf_value("Contact", "<%@contact.uri;param=value>");
But you loose the header parameters this way :(
That should be enough for my purpose. Thank you.
Lada
Correcting two mails in this thread....
Miklos Tirpak píše v Pá 14. 03. 2008 v 12:03 +0100: ...
assign_hf_value("Contact", "<%@contact.uri;param=value>");
But you loose the header parameters this way :(
I don't think so... @(select_any_header.nameaddr).uri was intended to return the whole uri INCLUDING all parameters. Anyway the construction above will work, you just might end with two occurences of param parameter.
----
Jiri Kuthan píše v Pá 14. 03. 2008 v 08:35 -0400:
# here you can formulate complex URIs xlset_attr("$rpidheader", "sip:%$asserted_id@%@ruri.host;screen=yes");
correct, shows how you can combine the request's parts using xlog formatting.
# here you initiate redirection based on a URI in an AVP (statefuly here) attr_destination("$tu.fwd_busy_target"); t_reply("302", "Redirect On Busy");
These two are completely unrelated.... attr_destination sets the target for the request being forwarded regardless what request_uri/loose_route has set (e.g. should be followed by append_branch, t_relay) whilst t_reply just sends reply. So if you use just these two lines you won't get Contact holding $tu.fwd_busy_target in the 302 reply.
Michal
Thank you for all exhausting info. I see I can do it several ways.
Lada
Michal Matyska wrote:
Correcting two mails in this thread....
Miklos Tirpak píše v Pá 14. 03. 2008 v 12:03 +0100: ...
assign_hf_value("Contact", "<%@contact.uri;param=value>");
But you loose the header parameters this way :(
I don't think so... @(select_any_header.nameaddr).uri was intended to return the whole uri INCLUDING all parameters. Anyway the construction above will work, you just might end with two occurences of param parameter.
Jiri Kuthan píše v Pá 14. 03. 2008 v 08:35 -0400:
# here you can formulate complex URIs xlset_attr("$rpidheader", "sip:%$asserted_id@%@ruri.host;screen=yes");
correct, shows how you can combine the request's parts using xlog formatting.
# here you initiate redirection based on a URI in an AVP (statefuly here) attr_destination("$tu.fwd_busy_target"); t_reply("302", "Redirect On Busy");
These two are completely unrelated.... attr_destination sets the target for the request being forwarded regardless what request_uri/loose_route has set (e.g. should be followed by append_branch, t_relay) whilst t_reply just sends reply. So if you use just these two lines you won't get Contact holding $tu.fwd_busy_target in the 302 reply.
Michal
Serusers mailing list Serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
At 06:36 14/03/2008, Ladislav Andel wrote:
Will the param=value be included in following INVITE sent from the client somehow?
by the way of RFC3261, it will be. It remains to be seen what today's UAC implementations actually do (or not). If you wish to convey some info, the safest way is to encode it in the userpart, something like
lada@iptel.org --> lada_voicemail@iptel.org
-jiri
-- Jiri Kuthan http://iptel.org/~jiri/
another way of doing so is you formulate the URI (whichever way you wish, if if is really something more complex, you can use the AVP formatting function), append the AVP to destination set and call sl_send_reply(3xx .... this shall return the new URI in Contact.
-jiri
p.s. some related examples from oob.cfg (it is not exactly it, but it gives you some fragments....)
# here you can formulate complex URIs xlset_attr("$rpidheader", "sip:%$asserted_id@%@ruri.host;screen=yes");
# here you initiate redirection based on a URI in an AVP (statefuly here) attr_destination("$tu.fwd_busy_target"); t_reply("302", "Redirect On Busy");
if you would like to manipulate URI based on the incoming request URI, check subst_uri doc webpage (example 5)http://www.iptel.org/ser/doc/modules/textops
At 06:23 14/03/2008, Miklos Tirpak wrote:
Hi Lada,
if SER generates the response: append_to_reply("Contact: sip:user@host;param=value\r\n");
if SER forwards the response: (There might be a better way, the following example replaces the whole header field. And I am not sure that it works correctly with multiple contact headers.) assign_hf_value("Contact", "%@contact;param=value");
Miklos
On 03/14/2008 10:35 AM, Ladislav Andel wrote:
Hi all, can I with SER add following in 302 response?
- add a parameter in Contact header that a UA will read and copy it to
the new INVITE and how would I do it in ser config. 2) or add a new header field with in 302 that a UA will read and copy it to the new INVITE
The first should be possible as RFC3261 in 20.10 shows in example but I'm wondering if SER can do it too.
Thank you, Lada _______________________________________________ Serusers mailing list Serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
Serusers mailing list Serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
-- Jiri Kuthan http://iptel.org/~jiri/