[ previous ] [ next ] [ threads ]
 To :  Maxim Telegin <maximtel@g...>
 From :  =?ISO-8859-2?Q?Maciek_Kami=F1ski?= <maciejka@t...>
 Subject :  Re: [yate] Embedded scripting proposal
 Date :  Wed, 6 Oct 2010 15:07:04 +0200
Hi,

I see two independent problems:
1. which scripting language to choose and how to design library in
chosen language that will make scripting yate easy
2. how scripting environment should be started, external or embedded
vm, choice here is between security of separate processes and speed
direct message passing.

If library is well designed it should be possible to use it both for
external modules and embedded scripts, it will be just initiated
differently.
In fact you can start development by prototyping script library as
external script, implement "embedded C++ module" later.

Javascript is not a bad choice as it is popular, but it lacks standard
library and libraries in general, although node.js project might
provide help (in terms of event based libraries). Lack of coroutine
support might not be a problem if there are going to be separate VM
per call leg. It will be difficult to write global scripts this way
though.

From Paul's example:
...
called == "1234" ::
secondary_dialer()
{
       answer();
       play("/path/to/prompt_file.au");
}
...
it seems that you want to hide yate message passing model under the
library. I hope not, as it might limit what you can do within the
script. I would prefer to have direct message manipulation
primitives(I mean: wait for, replay, watch, send) as basic operations
and build answer, play etc function above.

Btw. I have had a prototype on embedded python module for
yate(http://yate.null.ro/mantis/view.php?id=33). It was able to run
yaypm scripts within yate process. I have discontinued it because for
my purposes there were no practical advantages of using it versus
using global external scripts.

mk