Hi Rene,

Yes they are.

The plugins are not executed in a synchronous fashion, they need to call
the callback function when they are done processing. This is to allow the
plugins to do long running tasks (eg HTTP queries) without slowing down
potentially faster message execution chains.

At the end of the plugin chain, the plugin processor will finally call the
'done' callback, which will be different depending on the direction of
messages. Plugins only need worry about making sure they call the
callback() function in all scenarios, otherwise messages will stall and
never be acked/nacked.

You can see in my example HTTP plugin here how to handle an asynchronous
execution chain:
https://github.com/donald-jackson/kannel-pluginbox/blob/master/plugins/pluginbox_http.c

Hope this helps.

Thanks,
Donald

On 12 October 2016 at 13:48, Rene Kluwen <rene.klu...@chimit.nl> wrote:

> What exactly do the done() and callback() functions in the plugin
> structure?
>
> Are they required?
>
>
>
> == Rene
>
>
>
> *Van:* devel [mailto:devel-boun...@kannel.org] *Namens *Donald Jackson
> *Verzonden:* vrijdag 7 oktober 2016 11:50
> *Aan:* kannel_dev_mailinglist <devel@kannel.org>
> *Onderwerp:* Re: [RFC] New 'box' Kannel Pluginbox
>
>
>
> Hi everyone (again),
>
>
>
> Thank you for the great feedback yesterday (publicly and privately).
>
>
>
> I have updated the repository here: https://github.com/
> donald-jackson/kannel-pluginbox
>
>
>
> And have included the HTTP plugin as promised with an example of how to
> modify and reject traffic. If you have any issues please make use of the
> issue tracker on Github.
>
>
>
> I'd also like to correct my mistake of only crediting Alejandro in my
> original mail - thanks too to Rene actually started SQLBox ;)
>
>
>
> Thanks,
>
> Donald
>
>
>
> On 6 October 2016 at 09:25, Donald Jackson <djack...@kannel.org> wrote:
>
> Hi everyone,
>
>
>
> I have started laying the foundations for a new 'box' for Kannel which
> intends to allow users more flexibility in terms of the platform.
>
>
>
> At the moment there are many ways to get messages into the bearerbox,
> namely: smsbox, wapbox, opensmppbox, smppbox, ksmppd, sqlbox. Some rely on
> routing in their own process and others allow bearerbox to do the routing.
> What they all have in common is they don't allow external or third party
> applications help make decisions at processing time (with the exception of
> ksmppd/smppbox).
>
>
>
> My new planned box is called pluginbox which will basically be like SQLBox
> - but instead of using database callbacks, it will allow linking of dynamic
> libraries (.so|.dylib) which will allow custom 
> interception/filtering/modification
> of message packages to and from various boxes.
>
>
>
> So a hypothetical scenario for this box could be something like
>
>
>
> SMSBox, SMPPBox/KSMPPD, WapBox <--> PluginBox <--> Bearerbox
>
>
>
> Or even
>
>
>
> SMSBox, SMPPBox/KSMPPD, WapBox <--> SQLBox <--> PluginBox <--> Bearerbox
>
>
>
> For those who want to still make use of SQLBox.
>
>
>
> My initial design is to use an asynchronous callback chain to allow slow
> plugins to not hold up the processing of faster messages. This would be
> especially useful in the context of people using HTTP and other external
> services to process routing decisions. The plugin would also be able to
> return a status to 'reject' a message packet which would in turn not submit
> to the target receiver.
>
>
>
> My plan is also to implement at least one example plugin (probably an HTTP
> plugin?) which can show the submission and manipulation of a message packet
> in both directions.
>
>
>
> So here I am looking for comments.
>
>
>
> 1) Is this something worthwhile doing, does anyone else have a need for
> this?
>
> 2) Are there any considerations you wish to add at this time?
>
> 3) Are there any features you would like to see added?
>
> 4) Would there be any problem including this in the Kannel repository?
>
>
>
> Here is the initial version : https://github.com/donald-
> jackson/kannel-pluginbox
>
>
>
> Thanks Alejandro for SQLBox, its largely based on your code.
>
>
>
> Regards,
>
> --
>
> Donald Jackson
> http://www.ddj.co.za
>
>
>
>
>
> --
>
> Donald Jackson
> http://www.ddj.co.za
>



-- 
Donald Jackson
http://www.ddj.co.za

Reply via email to