Hi Alex,
yes it works (just verified this morning ;-).
I use this trick in several situation, in the event-route the message is
still editable.
It's in the onsend_route that you cannot modify it, IIRC.
Cheers,
Federico
On Fri, May 31, 2019 at 8:27 AM Alex Balashov <abalashov(a)evaristesys.com>
wrote:
Federico,
Does that actually work? I thought this route provides a hook to catch
the request, but does not necessarily apply any lump changes to the
outgoing message?
On Fri, May 31, 2019 at 07:27:34AM +0200, Federico Cabiddu wrote:
Hi,
to add headers to locally generated requests, as it's the case for
dispatcher's OPTIONS, you could use tm's module "local-request" event
route
to catch the outgoing OPTIONS and append a header
before it's relayed.
Something like this:
event_route[tm:local-request] { # Handle locally generated requests
if (is_method("OPTIONS")) {
xlog("L_INFO", "dispatcher generated OPTIONS to
$du\n");
append_hf("X-CustomHeader: myValue\r\n");
}
}
Cheers,
Federico
On Thu, May 30, 2019 at 9:28 PM Henning Westerholt <hw(a)skalatan.de>
wrote:
> Hello Tim,
>
> at the moment there is no such functionality available in the module.
But
> have a look eg. to the implementation of
this function
>
>
>
https://kamailio.org/docs/modules/5.2.x/modules/dispatcher.html#dispatcher.…
>
> in C function "void ds_ping_set(ds_set_t *node)" which allows to set
the
> From header for the dispatcher pings. Maybe
this gives you a starting
> point. If you came up with an extension, we are always open to pull
> requests. :-)
>
> Cheers,
>
> Henning
> Am 22.05.19 um 00:06 schrieb Tim Chubb:
>
> Hi
>
>
>
> Is there any mechanism to add a contact and rr headers to the option
> messages generated by dispatcher?
>
>
>
> I have a need for both headers to be present otherwise the message gets
> rejected at the proxy im trying to connect to, the content of the
headers
> in my use case is the from address, so would
seem trivial (in so far I
know
> enough c to just about follow what’s going
on in the code, but wouldn’t
> know where to start to add the functionality) to add using the existing
> from attribute and a pair of additional modparams to enable this
> functionality, if its not already possible
>
> Currently I have a workaround by generating the pings in asterisk and
> routing as usual, but would really prefer to not reinvent the wheel
and use
> dispatcher as I do with other trunks and
services mainly for
consistency
> and keeping what is essentially a routing
issue out of the application
> stack, as apart from the missing headers dispatchers functionality is
> exactly what I need.
>
>
>
> Any suggestions?
>
>
>
> Tim.
>
>
>
>
>
>
> _______________________________________________
> Kamailio (SER) - Development Mailing Listsr-dev
@lists.kamailio.orghttps://
lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
>
> --
> Henning Westerholt -
https://skalatan.de/blog/
> Kamailio services -
https://skalatan.de/services
>
_______________________________________________
Kamailio (SER) - Development Mailing List
sr-dev(a)lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev >
_______________________________________________
Kamailio (SER) - Development Mailing List
sr-dev(a)lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
--
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 (SER) - Development Mailing List
sr-dev(a)lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev