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