Hi list,
my configuration file contains the following block:
% if (is_method("INVITE")){ % force_rtp_proxy(""); % t_on_failure("1"); % append_hf("P-hint: RTP session ports reserved by rtpproxy\r\n"); % };
If I dump the SIP dialog on the network, I can indeed see the "P-hint" header.
Then, the configuration file contains:
% failure_route[1] { % if (!(status == "407")) { % unforce_rtp_proxy(); % append_hf("P-hint: RTP session dropped\r\n"); % } else { % append_hf("P-hint: Proxy authentication required, don't drop RTP session\r\n"); % } % }
Unfortunately, when a 407 reply code comes back from the registrar, the outgoing SIP packet doesn't have any "P-hint" header. I didn't manage to test the other cases, unfortunately.
Did I miss something in the configuration file ?
Thank you. Regards,
Hi Jeremie,
append_hf() adds an hdr to a request and not to a reply - see docs (textops module). For you purpose, use append_to_reply() in failure_route.
Regards, Bogdan
Jeremie Le Hen wrote:
Hi list,
my configuration file contains the following block:
% if (is_method("INVITE")){ % force_rtp_proxy(""); % t_on_failure("1"); % append_hf("P-hint: RTP session ports reserved by rtpproxy\r\n"); % };
If I dump the SIP dialog on the network, I can indeed see the "P-hint" header.
Then, the configuration file contains:
% failure_route[1] { % if (!(status == "407")) { % unforce_rtp_proxy(); % append_hf("P-hint: RTP session dropped\r\n"); % } else { % append_hf("P-hint: Proxy authentication required, don't drop RTP session\r\n"); % } % }
Unfortunately, when a 407 reply code comes back from the registrar, the outgoing SIP packet doesn't have any "P-hint" header. I didn't manage to test the other cases, unfortunately.
Did I miss something in the configuration file ?
Thank you. Regards,
Hi Bogdan-Andrei,
thank your for your quick and clear answer.
On Tue, Sep 26, 2006 at 11:05:09PM +0300, Bogdan-Andrei Iancu wrote:
append_hf() adds an hdr to a request and not to a reply - see docs (textops module). For you purpose, use append_to_reply() in failure_route.
I admit I have neglected to look closely at the documentation, but in my humble opinion, the name is misleading. It sounds as a general way to append a header field, without suggesting it only work for a request. I guess there is an historical reason for this, but what is the technival reason for not making it work for the replies ?
Furthermore, the append_hf() function is described as being usable in REQUEST_ROUTE, ONREPLY_ROUTE, FAILURE_ROUTE and BRANCH_ROUTE ? If it does naught on replies, what's the point of using it in ONREPLY_ROUTE and FAILURE_ROUTE ?
Thank you very much. Best regards,
Hi Jeremie,
Jeremie Le Hen wrote:
Hi Bogdan-Andrei,
thank your for your quick and clear answer.
On Tue, Sep 26, 2006 at 11:05:09PM +0300, Bogdan-Andrei Iancu wrote:
append_hf() adds an hdr to a request and not to a reply - see docs (textops module). For you purpose, use append_to_reply() in failure_route.
I admit I have neglected to look closely at the documentation, but in my humble opinion, the name is misleading. It sounds as a general way to append a header field, without suggesting it only work for a request. I guess there is an historical reason for this,
yes, that is right
but what is the technival reason for not making it work for the replies ?
you need separate functions for adding to request and adding to reply. For example you process a request and you want to add a header to 1) the current processed request or 2) to the reply that will be sent for this request.
Furthermore, the append_hf() function is described as being usable in REQUEST_ROUTE, ONREPLY_ROUTE, FAILURE_ROUTE and BRANCH_ROUTE ? If it does naught on replies, what's the point of using it in ONREPLY_ROUTE and FAILURE_ROUTE ?
well...it is a bit complicate to explain here....is not quite a doc error: actually append_hf() adds a header to the current process message which can be 1) request in REQUEST_ROUTE, FAILURE_ROUTE and BRANCH_ROUTE 2) reply in ONREPLY_ROUTE
append_to_reply() will set the header to be appended to all replies generated locally.
regards, bogdan