[reSIProcate] route scripting support with Python added to repro

Scott Godin sgodin at sipspectrum.com
Fri Dec 13 14:00:52 CST 2013


Awesome stuff.  Thanks Daniel!


On Fri, Dec 13, 2013 at 2:23 PM, Daniel Pocock <daniel at pocock.com.au> wrote:

>
> I've just committed a plugin that allows routing scripts to be written
> in Python
>
> Here is a trivial example:
>
>
> http://svn.resiprocate.org/viewsvn/resiprocate/main/repro/plugins/pyroute/example.py?rev=10734
>
> It is useable but could probably be extended.  Possible improvements:
>
> - reloading the Python scripts if they change at runtime (currently it
> loads once at startup)
> - support for passing headers to Python scripts (currently it just looks
> at the request URI)
> - making PYCXX_SRCDIR configurable (it is currently set to a value
> suitable for Debian filesystems)
> - making it support asynchronous routing actions
> - allow logging from the Python script to the repro logger
> - making the URI available as an object instead of just a string
>
> Most of these things are quite trivial but I thought I would share this
> initial cut to get feedback from other people before filling out the
> details.
>
> This code could also be used as boilerplate code for other things (e.g.
> making an authenticator)
>
> The benefit of scripting support:
>
> - it makes repro more accessible to non-C++ developers and non-programmers
>
> - it allows people to make rapid changes to routing logic without having
> a development environment or compiler
>
> - it is more powerful than the current regex support in the web UI
>
> - Python has a rich set of libraries that could provide useful
> functionality while evaluating routes
>
> For anybody who wants a deeper insight into Python with C++, there is
> good documentation in the PyCXX project.
>
>
> _______________________________________________
> resiprocate-devel mailing list
> resiprocate-devel at resiprocate.org
> https://list.resiprocate.org/mailman/listinfo/resiprocate-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.resiprocate.org/pipermail/resiprocate-devel/attachments/20131213/39280356/attachment.htm>


More information about the resiprocate-devel mailing list