Hey everyone.
Right now i'm doing a redirect server and i'm trying to sinalize the redirection using a 3xx reply. In order to do that, according the RFC I need to add a Contact and Diversion header. How do i do that ? i'm creating the reply with send_reply() but i can't seem to find a way to add these parameters to the reply.
Thanks for the help.
Cheers
Hi Duarte,
On Wed, Jan 24, 2018 at 06:55:27PM +0000, Duarte Rocha wrote:
Right now i'm doing a redirect server and i'm trying to sinalize the redirection using a 3xx reply. In order to do that, according the RFC I need to add a Contact and Diversion header. How do i do that ? i'm creating the reply with send_reply() but i can't seem to find a way to add these parameters to the reply.
append_to_reply() (from textops) is your friend here:
append_to_reply("Contact: sip:duarte@sip.rocha.aq\r\n");
-- Alex
On Wed, Jan 24, 2018 at 01:57:26PM -0500, Alex Balashov wrote:
Right now i'm doing a redirect server and i'm trying to sinalize the redirection using a 3xx reply. In order to do that, according the RFC I need to add a Contact and Diversion header. How do i do that ? i'm creating the reply with send_reply() but i can't seem to find a way to add these parameters to the reply.
append_to_reply() (from textops) is your friend here:
append_to_reply("Contact: sip:duarte@sip.rocha.aq\r\n");
Why would you do it this way? All you have to do is manipulate $ru (or its parts) and send_reply("302", "Redirect"); exit;
Though append_to_reply might be needed for the Diversion (unless the diversion module is any help here https://kamailio.org/docs/modules/stable/modules/diversion.html )