[SR-Users] remove header from reply?

Alex Balashov abalashov at evaristesys.com
Fri Aug 19 11:47:03 CEST 2022


Huh! Looks like we both learned something. :-) 

—
Sent from mobile, with due apologies for brevity and errors.

> On Aug 19, 2022, at 2:39 AM, Brett Nemeroff <brett+kamailio at voicefoxtelephony.com> wrote:
> 
> 
> Hey Alex,
> I solved this, but I'm including my troubleshooting for the archives. 
> 
> It is in fact a failure route. I've tried to make it as simple as possible. I was a little off on the contact header. It appears the contents of the contact header are in fact the RURI that was used to send the call to the first redirect server.
> ME=> Redirect server: Fails into "TEST FAILURE". Also has an onreply that checks for 302 and sets an avp. (nothing else)
> ME => t_reply(302) to originator. Has 2 contact headers. One from the below append_to_reply. The other is verbatim the RURI I send to the redirect server. 
> 
> failure_route[TEST_FAILURE] {
>         if (t_check_status("302")) {
>                 append_to_reply("Contact: me at here.com:5060\r\n");
>                 t_reply("302","Redirect NOW");
>                 exit;
> 
> 
> OH... so after I went through the exercise of writing that out for you I thought I'd check the docs for t_reply based on your comment that it's a whole new reply message. Look what I found: 
> 
> "If the code is in the range 300-399 (redirect reply), the current destination set is appended to the reply as Contact headers."
> 
> :facepalm:
> 
> So instead of using append_to_reply, I set $ru prior to the t_reply(302) and we good. 
> 
> THANK YOU!
> -Brett
> 
> 
>> On Fri, Aug 19, 2022 at 12:35 AM Alex Balashov <abalashov at evaristesys.com> wrote:
>> Hi Brett,
>> 
>> In what context are you performing these operations? Is it a failure_route? If not, can you try it in a failure_route?
>> 
>> I ask because this is very surprising behaviour. t_reply() should create an entirely brand-new reply message, and no elements of a previously received reply on some branch should leak into it.
>> 
>> — Alex
>> 
>> > On Aug 19, 2022, at 12:26 AM, Brett Nemeroff <brett+kamailio at voicefoxtelephony.com> wrote:
>> > 
>> > Hello,
>> > I'm receiving calls which I forward to a server I KNOW will reply with a 302. When I get that 302, I parse some information and then t_reply(302) the originator. The 302 I create needs to have it's own contact header which I am adding with append_to_reply(). That works great. BUT the contact header from the original 302 is hanging around. Now I have two contact headers :( 
>> > 
>> > How can I get rid of the original 302's contact header? remove_hf() doesn't work in this context since it's a reply. So I need a kind of "remove_header_from_reply()". 
>> > 
>> > Thanks,
>> > Brett
>> > 
>> > __________________________________________________________
>> > Kamailio - Users Mailing List - Non Commercial Discussions
>> >  * sr-users at lists.kamailio.org
>> > Important: keep the mailing list in the recipients, do not reply only to the sender!
>> > Edit mailing list options or unsubscribe:
>> >  * https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>> 
>> -- 
>> Alex Balashov | Principal | Evariste Systems LLC
>> 
>> Tel: +1-706-510-6800 / +1-800-250-5920 (toll-free)
>> Web: http://www.evaristesys.com/, http://www.csrpswitch.com/
>> 
>> 
>> __________________________________________________________
>> Kamailio - Users Mailing List - Non Commercial Discussions
>>   * sr-users at lists.kamailio.org
>> Important: keep the mailing list in the recipients, do not reply only to the sender!
>> Edit mailing list options or unsubscribe:
>>   * https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
> __________________________________________________________
> Kamailio - Users Mailing List - Non Commercial Discussions
>  * sr-users at lists.kamailio.org
> Important: keep the mailing list in the recipients, do not reply only to the sender!
> Edit mailing list options or unsubscribe:
>  * https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20220819/7a41a17f/attachment.htm>


More information about the sr-users mailing list