[SR-Users] Modify Reply Created

Daniel Tryba d.tryba at pocos.nl
Thu Jan 25 13:43:03 CET 2018


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 at 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 )



More information about the sr-users mailing list