[SR-Users] forwarding multiple times

hdssdsdsdsfsdf hdssdsdsdsfsdf hdssdsdsdsfsdf at mail.com
Wed Apr 26 18:38:15 CEST 2017


Perhaps someone knows the rationale behind behavior of forward() that I find odd.

For example:
ds_select_domain();
forward();
subst('/(To: .*)/To: bla\n/g');
forward();
subst('/(To: .*)/To: bla\n/g');
forward();
subst('/(To: .*)/To: bla\n/g');

This should result in just a substitution of the To-header. In stead, each time a to-header is added, resulting in the final forwarded sip-messages containing many to-headers.

Is this a bug? Or am I missing something that forward is supposed to do? It seems as if it keeps track of a separate sip-message, and adds modifications there, in stead of replacing them.

In any case, it's this behaviour that is causing troubles implementing the case as described before.


> Sent: Monday, April 24, 2017 at 3:35 PM
> From: "hdssdsdsdsfsdf hdssdsdsdsfsdf" <hdssdsdsdsfsdf at mail.com>
> To: sr-users at lists.kamailio.org
> Subject: [SR-Users] forwarding multiple times
>
> Hi all,
> 
> I'm trying to transmit a CANCEL sip message from one server to multiple other servers (using ds_select_domain and ds_next_domain). Ideally, I would simply use forward() multiple times. The problem is however, that this would apply the changes of forward() multiple times too, for example adding multiple via-headers. I tried to use forward() for the first transmission and then send() for the next ones, but it turns out send() uses the original message to send, and not the message as crafted by forward.
> 
> As such, it seems I need exactly what's in the middle of these: Either a forward that operates on the original message, or a send that operates on the message as crafter by previous forward. Does anyone know how to achieve this?
> 
> The only other solution I see is to manually write some forwarding routing, but it seems tedious to craft the via-headers and fix the domain to be forwarded to.
> 
> Thanks and cheers,
> 
> _______________________________________________
> Kamailio (SER) - Users Mailing List
> sr-users at lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
> 



More information about the sr-users mailing list