Hello,
if I create a response with sl_send_reply then the message contains not an Allow header. How could I add an Allow header to this responses?
thanks in advance, Andreas
On 12/17/2009 05:00 PM, Andreas Heise wrote:
Hello, if I create a response with sl_send_reply then the message contains not an Allow header. How could I add an Allow header to this responses?
append_hf("Allow: MOOSE,COW,GOAT\r\n");
from 'textops'
On 12/17/09 11:10 PM, Alex Balashov wrote:
On 12/17/2009 05:00 PM, Andreas Heise wrote:
Hello, if I create a response with sl_send_reply then the message contains not an Allow header. How could I add an Allow header to this responses?
append_hf("Allow: MOOSE,COW,GOAT\r\n");
from 'textops'
actually also from textops but it is append_to_reply().
Cheers, Daniel
Hi Daniel
great that's the missing trick
thanks, Andreas
2009/12/18 Daniel-Constantin Mierla miconda@gmail.com
On 12/17/09 11:10 PM, Alex Balashov wrote:
On 12/17/2009 05:00 PM, Andreas Heise wrote:
Hello,
if I create a response with sl_send_reply then the message contains not an Allow header. How could I add an Allow header to this responses?
append_hf("Allow: MOOSE,COW,GOAT\r\n");
from 'textops'
actually also from textops but it is append_to_reply().
Cheers, Daniel
-- Daniel-Constantin Mierla
Kamailio (OpenSER) - Users mailing list Users@lists.kamailio.org http://lists.kamailio.org/cgi-bin/mailman/listinfo/users http://lists.openser-project.org/cgi-bin/mailman/listinfo/users
Daniel,
But the documentation
http://www.kamailio.org/docs/modules/1.5.x/textops.html#id2506229
says that append_hf() can be used inside a reply route?
-- Alex
On 12/18/2009 03:25 AM, Daniel-Constantin Mierla wrote:
On 12/17/09 11:10 PM, Alex Balashov wrote:
On 12/17/2009 05:00 PM, Andreas Heise wrote:
Hello, if I create a response with sl_send_reply then the message contains not an Allow header. How could I add an Allow header to this responses?
append_hf("Allow: MOOSE,COW,GOAT\r\n");
from 'textops'
actually also from textops but it is append_to_reply().
Cheers, Daniel
Hi Alex,
On 12/18/09 9:57 PM, Alex Balashov wrote:
Daniel,
But the documentation
http://www.kamailio.org/docs/modules/1.5.x/textops.html#id2506229
says that append_hf() can be used inside a reply route?
yes, it can be used. The nuance in the initial question, as I understood, was to add a header to a reply for current processed request. with append_hf you add a header to the current processed sip message (no matter is request or reply).
append_to_reply() adds a header to any eventual reply kamailio may send for the request being processed, not visible in the request if that is forwarded.
Just to give an example, save("location") sends a reply from inside the function. If you want to have a custom header in that reply, that can be done with append_to_reply().
Cheers, Daniel
-- Alex
On 12/18/2009 03:25 AM, Daniel-Constantin Mierla wrote:
On 12/17/09 11:10 PM, Alex Balashov wrote:
On 12/17/2009 05:00 PM, Andreas Heise wrote:
Hello, if I create a response with sl_send_reply then the message contains not an Allow header. How could I add an Allow header to this responses?
append_hf("Allow: MOOSE,COW,GOAT\r\n");
from 'textops'
actually also from textops but it is append_to_reply().
Cheers, Daniel
On 12/18/2009 04:24 PM, Daniel-Constantin Mierla wrote:
Hi Alex,
On 12/18/09 9:57 PM, Alex Balashov wrote:
Daniel,
But the documentation
http://www.kamailio.org/docs/modules/1.5.x/textops.html#id2506229
says that append_hf() can be used inside a reply route?
yes, it can be used. The nuance in the initial question, as I understood, was to add a header to a reply for current processed request. with append_hf you add a header to the current processed sip message (no matter is request or reply).
append_to_reply() adds a header to any eventual reply kamailio may send for the request being processed, not visible in the request if that is forwarded.
Just to give an example, save("location") sends a reply from inside the function. If you want to have a custom header in that reply, that can be done with append_to_reply().
Oh, I see. I did not realise append_hf() always applied to the request context only. Thanks a lot! Learn something new every day.
18 dec 2009 kl. 22.27 skrev Alex Balashov:
On 12/18/2009 04:24 PM, Daniel-Constantin Mierla wrote:
Hi Alex,
On 12/18/09 9:57 PM, Alex Balashov wrote:
Daniel,
But the documentation
http://www.kamailio.org/docs/modules/1.5.x/textops.html#id2506229
says that append_hf() can be used inside a reply route?
yes, it can be used. The nuance in the initial question, as I understood, was to add a header to a reply for current processed request. with append_hf you add a header to the current processed sip message (no matter is request or reply).
append_to_reply() adds a header to any eventual reply kamailio may send for the request being processed, not visible in the request if that is forwarded.
Just to give an example, save("location") sends a reply from inside the function. If you want to have a custom header in that reply, that can be done with append_to_reply().
Oh, I see. I did not realise append_hf() always applied to the request context only. Thanks a lot! Learn something new every day.
I think the confusion is about which message you process in the on_reply branches - you actually process the initial request that you triggered with a reply route in the initial processing, not the reply. Thus if you use append_hf - you add a header to the request, not the response.
/O
On 12/19/09 9:50 AM, Olle E. Johansson wrote:
18 dec 2009 kl. 22.27 skrev Alex Balashov:
On 12/18/2009 04:24 PM, Daniel-Constantin Mierla wrote:
Hi Alex,
On 12/18/09 9:57 PM, Alex Balashov wrote:
Daniel,
But the documentation
http://www.kamailio.org/docs/modules/1.5.x/textops.html#id2506229
says that append_hf() can be used inside a reply route?
yes, it can be used. The nuance in the initial question, as I understood, was to add a header to a reply for current processed request. with append_hf you add a header to the current processed sip message (no matter is request or reply).
append_to_reply() adds a header to any eventual reply kamailio may send for the request being processed, not visible in the request if that is forwarded.
Just to give an example, save("location") sends a reply from inside the function. If you want to have a custom header in that reply, that can be done with append_to_reply().
Oh, I see. I did not realise append_hf() always applied to the request context only. Thanks a lot! Learn something new every day.
I think the confusion is about which message you process in the on_reply branches - you actually process the initial request that you triggered with a reply route in the initial processing, not the reply. Thus if you use append_hf - you add a header to the request, not the response.
a clarification for above: in onreply_route you process the reply and append_hf() adds a header to reply.
To put it in another words: - in route {...} - sip request is processed and append_hf() adds a header to that request. If you want to send a reply for that request from kamailio, then append_to_reply() can be used to add headers in the to-be-built reply - in onreply_route - sip reply is processed and append_hf() adds a header to that reply. append_to_reply() cannot be used in onreply_route.
Cheers, Daniel
19 dec 2009 kl. 10.28 skrev Daniel-Constantin Mierla:
On 12/19/09 9:50 AM, Olle E. Johansson wrote:
18 dec 2009 kl. 22.27 skrev Alex Balashov:
On 12/18/2009 04:24 PM, Daniel-Constantin Mierla wrote:
Hi Alex,
On 12/18/09 9:57 PM, Alex Balashov wrote:
Daniel,
But the documentation
http://www.kamailio.org/docs/modules/1.5.x/textops.html#id2506229
says that append_hf() can be used inside a reply route?
yes, it can be used. The nuance in the initial question, as I understood, was to add a header to a reply for current processed request. with append_hf you add a header to the current processed sip message (no matter is request or reply).
append_to_reply() adds a header to any eventual reply kamailio may send for the request being processed, not visible in the request if that is forwarded.
Just to give an example, save("location") sends a reply from inside the function. If you want to have a custom header in that reply, that can be done with append_to_reply().
Oh, I see. I did not realise append_hf() always applied to the request context only. Thanks a lot! Learn something new every day.
I think the confusion is about which message you process in the on_reply branches - you actually process the initial request that you triggered with a reply route in the initial processing, not the reply. Thus if you use append_hf - you add a header to the request, not the response.
a clarification for above: in onreply_route you process the reply and append_hf() adds a header to reply.
To put it in another words:
- in route {...} - sip request is processed and append_hf() adds a header to that request. If you want to send a reply for that request from kamailio, then append_to_reply() can be used to add headers in the to-be-built reply
- in onreply_route - sip reply is processed and append_hf() adds a header to that reply. append_to_reply() cannot be used in onreply_route.
Thanks for the clarification. Lot's of interesting misunderstandings in this thread :-)
/O
On 12/19/09 10:35 AM, Olle E. Johansson wrote:
[...]
Daniel,
But the documentation
http://www.kamailio.org/docs/modules/1.5.x/textops.html#id2506229
says that append_hf() can be used inside a reply route?
yes, it can be used. The nuance in the initial question, as I understood, was to add a header to a reply for current processed request. with append_hf you add a header to the current processed sip message (no matter is request or reply).
append_to_reply() adds a header to any eventual reply kamailio may send for the request being processed, not visible in the request if that is forwarded.
Just to give an example, save("location") sends a reply from inside the function. If you want to have a custom header in that reply, that can be done with append_to_reply().
Oh, I see. I did not realise append_hf() always applied to the request context only. Thanks a lot! Learn something new every day.
I think the confusion is about which message you process in the on_reply branches - you actually process the initial request that you triggered with a reply route in the initial processing, not the reply. Thus if you use append_hf - you add a header to the request, not the response.
a clarification for above: in onreply_route you process the reply and append_hf() adds a header to reply.
To put it in another words:
- in route {...} - sip request is processed and append_hf() adds a header to that request. If you want to send a reply for that request from kamailio, then append_to_reply() can be used to add headers in the to-be-built reply
- in onreply_route - sip reply is processed and append_hf() adds a header to that reply. append_to_reply() cannot be used in onreply_route.
Thanks for the clarification. Lot's of interesting misunderstandings in this thread :-)
The documentation is not very rich regarding these two functions, I have to say, hopefully someone will find time to put more there :-) :
http://kamailio.org/docs/modules/3.0.x/modules_k/textops.html#id2494805
Cheers, Daniel