Mateusz Bartczak | 1 Oct 2010 16:10
Picon

Re: Yate looses registration to external SIP accounts

Disabling $ev->handled on call timer messages did the trick.

Thank you Marian and Paul. You saved me a day :)


2010/9/30 Paul Chitescu <paulc-uHKunLg9Q/3XMkR9fcqaOA@public.gmane.org>
On Thursday 30 September 2010 05:59:54 pm Marian Podgoreanu wrote:
> Hi,
>
> Saw the log:
>
> Make sure you don't acknowledge the engine.timer message in your script.

Correction: you must  $ev->Acknowledge() it but not set $ev->handled to true!

On Yate 3 the engine.timer is a broadcast (like several other critical engine
messages), it continues dispatching even if it gets handled. This feature is
not available in Yate 2.


> In yate 2.2 the engine will stop dispatching the message to other modules.
> Any module relying on engine.timer to do something (like expiring
> things) will fail to do that.
>
> I saw some database queries with 'expires' parameter.
> It's useless to store the registration interval in the database and
> expire it from there: the sip module don't set the expiring interval in
> the user.notify message.
> The sip module will re-register at 3/4 of expire interval (if
> engine.timer is received by the module).
>
> Marian


Mateusz Bartczak | 3 Oct 2010 17:36
Picon

How to enable registrations to Yate using domain name instead of IP

Hello

I have simple problem with SIP registrations to Yate.

When I put IP address of Yate box in softphone, then registration works OK.

But when I change IP to domain name, softphone could not register.

Domain is configured to point to the same IP address (A entry in DNS table), public DNS server, 100% DNS works OK.

What shoud I change to allow registration using host domain name?

Best Regards


Vihar Patel | 4 Oct 2010 14:59
Favicon

Need Assistance to configure Yate for SIP-H323 Proxy Setup

Hi,

 

I am trying to set up Yate as a proxy between H323 – SIP network. Where my calls are originated from H.323 and SIP routes them. This works with certain practical issues which holds me to complete my testing, those issues are listed as below:

 

1.       DTMFs are not getting transmitted between both ends – means caller (h323) is not receiving any DTMF from its called party which is via SIP network or vice versa.

2.       If called party (via SIP network) terminates the call, caller (h323) doesn’t get any termination signal so it keeps the call live.

3.       I need to understand routing based on different country codes.

E.g.

a.       If caller (h323) wants to dial to USA, call will have 001 and SIP provider’s IP will be x.x.x.x.

b.      If caller (h323) wants to dial to UK, call will have 044 and SIP Provider’s IP will be y.y.y.y.

 

Please help me out to set up this configuration and complete my testing so I can move ahead.

 

Thanks in Advance!!

 

Regards,

Vihar Patel

Paul Chitescu | 4 Oct 2010 16:48
Picon
Favicon

Embedded scripting proposal

Hi people!

We decided to introduce embedded scripting in Yate as a more powerful 
alternative to regexroute and external modules. We want to know your 
questions, opinions and improvement suggestions.

The reason to introduce scripting in Yate is to be able to perform complex 
routing and IVR like functions without the drawback of running an external 
interpreter. A script running in an external interpreter is slower to start, 
has more overhead processing the messages and cannot use all functionality of 
Yate. While regexroute can do arbitrary message processing it cannot keep a 
context associated with each call and the language itself is very weak.

We are choosing the Javascript language. It is simple enough to be used by 
beginners and basic functionality can be extended by experts. Moreover, there 
are several implementation libraries suitable for embedding.

We plan for the script instances to sit besides the controlled call legs just 
like pbxassist does now. The script will be able to control the call flow and 
route the call to various destinations.

A set of (Javascript) expressions will select which instruction block to 
instantiate for each incoming call, much like we do now in regexroute. Once an 
instance is created all further interaction will occur in that context.

// optional, reserved for future compatibility
language javascript

// include another file containing Javascript code
library "/path/to/library.js"

// declare a function we are going to use
function isAuth() {
	return username != "";
}

// send international calls of authenticated users directly to a gateway
// in this case there is no instruction block, just a route
called.match(/^00/) && isAuth()  ::  "sip/sip:" + called + 
" <at> gateway.xyz"

// unauthenticated callers are not allowed to call outside
called.length >= 4 && !isAuth() :: { error("noauth"); }

// secondary dialer, also declare it as a function
called == "1234" ::
secondary_dialer()
{
	answer();
	play("/path/to/prompt_file.au");
}

// alternative for the above
function secondary_dialer2() { answer(); play("/path/to/prompt_file.au"); }
called == "1235" :: { secondary_dialer2(); }

// match and use a global variable shared between all instances
getGlobal("chans_used") < 30 ::
{
	setGlobal("chans_used",getGlobal("chans_used")+1);
	...
}

// handling of later messages
called == "123456" :: {

	function onAnswer() {
		...
	}

	function onHangup() {
		...
	}

	// this code is executed on entering the block
	ring("tone/ring");
	sleep(1);
	answer();
	...
}

// include another scripting file with similar syntax
include "/path/to/next_script_control";

Paul

Christopher O'Connell | 4 Oct 2010 17:06
Picon
Gravatar

Re: Embedded scripting proposal

1) I think this is a really good idea -- a framework that's as message passing oriented as YATE should mesh perfectly with a language with strong support for first class functions and closures like javascript.

2) Pardon my ignorance, but what does the double colon ("::") operator do in javascript? I'm assuming this must be some sort of extension you're contemplating as the most recent ECMA Script spec doesn't include the double colon on the list of punctuators.

3) In the little (truely little) playing around with the concept of javascript for YATE that I've done, I think that it's important that all of the YATE messages can be easily bound to callbacks. So, something like

yate.call.answer = function(arguments) {
          // do some stuff
};

All the best,

~ Christopher

On Mon, Oct 4, 2010 at 07:48, Paul Chitescu <paulc-uHKunLg9Q/3XMkR9fcqaOA@public.gmane.org> wrote:
Hi people!

We decided to introduce embedded scripting in Yate as a more powerful
alternative to regexroute and external modules. We want to know your
questions, opinions and improvement suggestions.

The reason to introduce scripting in Yate is to be able to perform complex
routing and IVR like functions without the drawback of running an external
interpreter. A script running in an external interpreter is slower to start,
has more overhead processing the messages and cannot use all functionality of
Yate. While regexroute can do arbitrary message processing it cannot keep a
context associated with each call and the language itself is very weak.

We are choosing the Javascript language. It is simple enough to be used by
beginners and basic functionality can be extended by experts. Moreover, there
are several implementation libraries suitable for embedding.

We plan for the script instances to sit besides the controlled call legs just
like pbxassist does now. The script will be able to control the call flow and
route the call to various destinations.

A set of (Javascript) expressions will select which instruction block to
instantiate for each incoming call, much like we do now in regexroute. Once an
instance is created all further interaction will occur in that context.


// optional, reserved for future compatibility
language javascript

// include another file containing Javascript code
library "/path/to/library.js"

// declare a function we are going to use
function isAuth() {
       return username != "";
}

// send international calls of authenticated users directly to a gateway
// in this case there is no instruction block, just a route
called.match(/^00/) && isAuth()  ::  "sip/sip:" + called +
" <at> gateway.xyz"

// unauthenticated callers are not allowed to call outside
called.length >= 4 && !isAuth() :: { error("noauth"); }

// secondary dialer, also declare it as a function
called == "1234" ::
secondary_dialer()
{
       answer();
       play("/path/to/prompt_file.au");
}

// alternative for the above
function secondary_dialer2() { answer(); play("/path/to/prompt_file.au"); }
called == "1235" :: { secondary_dialer2(); }

// match and use a global variable shared between all instances
getGlobal("chans_used") < 30 ::
{
       setGlobal("chans_used",getGlobal("chans_used")+1);
       ...
}

// handling of later messages
called == "123456" :: {

       function onAnswer() {
               ...
       }

       function onHangup() {
               ...
       }

       // this code is executed on entering the block
       ring("tone/ring");
       sleep(1);
       answer();
       ...
}

// include another scripting file with similar syntax
include "/path/to/next_script_control";


Paul

Saugort Dario Garcia Tovar | 4 Oct 2010 17:08
Picon

Re: Embedded scripting proposal

Hi Paul,

That sound fantastic.

My suggestions:

1.  For IVR and Call Center applications:
If you have experienced with Asterisk, Asterisk has one weakness: if you use AGI and create an variable, the variable is associated to the channel and there is no a direct way to propagate the variable. For YATE, create a custom variable, should be asociated to the call, and the variable and value should be preserved until the javascript finish and give the posibility to transfer/recover the variable directly.

2. Consider the option to run and execute the javascript as locally as remote (http will be nice). It will give the power to yate to be distributed.

3. Consider the option to get wav audio from a remote (http will be nice). It will give the power to yate to be more flexible.

4. Consider the option to add failover scripts, example is a javascript can not retrieve or it did not respond in a fashion time, YATE should look a second javascript. If a second script fail, just play a "sorry"

5. In future, could be interesting add something like a cache, to hold a local copy of javascripts and prompts. It wil be useful for some architectures.

On 10/4/2010 10:18 AM, Paul Chitescu wrote:
Hi people! We decided to introduce embedded scripting in Yate as a more powerful alternative to regexroute and external modules. We want to know your questions, opinions and improvement suggestions. The reason to introduce scripting in Yate is to be able to perform complex routing and IVR like functions without the drawback of running an external interpreter. A script running in an external interpreter is slower to start, has more overhead processing the messages and cannot use all functionality of Yate. While regexroute can do arbitrary message processing it cannot keep a context associated with each call and the language itself is very weak. We are choosing the Javascript language. It is simple enough to be used by beginners and basic functionality can be extended by experts. Moreover, there are several implementation libraries suitable for embedding. We plan for the script instances to sit besides the controlled call legs just like pbxassist does now. The script will be able to control the call flow and route the call to various destinations. A set of (Javascript) expressions will select which instruction block to instantiate for each incoming call, much like we do now in regexroute. Once an instance is created all further interaction will occur in that context. // optional, reserved for future compatibility language javascript // include another file containing Javascript code library "/path/to/library.js" // declare a function we are going to use function isAuth() { return username != ""; } // send international calls of authenticated users directly to a gateway // in this case there is no instruction block, just a route called.match(/^00/) && isAuth() :: "sip/sip:" + called + " <at> gateway.xyz" // unauthenticated callers are not allowed to call outside called.length >= 4 && !isAuth() :: { error("noauth"); } // secondary dialer, also declare it as a function called == "1234" :: secondary_dialer() { answer(); play("/path/to/prompt_file.au"); } // alternative for the above function secondary_dialer2() { answer(); play("/path/to/prompt_file.au"); } called == "1235" :: { secondary_dialer2(); } // match and use a global variable shared between all instances getGlobal("chans_used") < 30 :: { setGlobal("chans_used",getGlobal("chans_used")+1); ... } // handling of later messages called == "123456" :: { function onAnswer() { ... } function onHangup() { ... } // this code is executed on entering the block ring("tone/ring"); sleep(1); answer(); ... } // include another scripting file with similar syntax include "/path/to/next_script_control"; Paul No virus found in this incoming message. Checked by AVG - www.avg.com Version: 9.0.856 / Virus Database: 271.1.1/3176 - Release Date: 10/04/10 02:05:00

Martin Provencher | 4 Oct 2010 17:20
Picon
Gravatar

Re: Need Assistance to configure Yate for SIP-H323 Proxy Setup

Hi Vihar,
      Some answers on your questions :
1. If your using SIP INFO, you should not have any problem at all. If you are using RFC2833, you need to enable or disable it in ysipchan.conf. Verify with your SIP side which option you need.
2. I never see this case before. You should verify in a ethernet capture if your message on the SIP side are well formatted.
3. You will need to understand how regexroutes.conf works to be able to do that. See http://yate.null.ro/pmwiki/index.php?n=Main.RegularExpressions to start.

I hope it will help you.

Martin

On Mon, Oct 4, 2010 at 8:59 AM, Vihar Patel <vihar.patel-DaQTI0RpDDMAvxtiuMwx3w@public.gmane.org> wrote:

Hi,

 

I am trying to set up Yate as a proxy between H323 – SIP network. Where my calls are originated from H.323 and SIP routes them. This works with certain practical issues which holds me to complete my testing, those issues are listed as below:

 

1.       DTMFs are not getting transmitted between both ends – means caller (h323) is not receiving any DTMF from its called party which is via SIP network or vice versa.

2.       If called party (via SIP network) terminates the call, caller (h323) doesn’t get any termination signal so it keeps the call live.

3.       I need to understand routing based on different country codes.

E.g.

a.       If caller (h323) wants to dial to USA, call will have 001 and SIP provider’s IP will be x.x.x.x.

b.      If caller (h323) wants to dial to UK, call will have 044 and SIP Provider’s IP will be y.y.y.y.

 

Please help me out to set up this configuration and complete my testing so I can move ahead.

 

Thanks in Advance!!

 

Regards,

Vihar Patel


Francisco Olarte (M | 4 Oct 2010 18:02

Re: Embedded scripting proposal

On Mon, Oct 4, 2010 at 4:48 PM, Paul Chitescu <paulc@...> wrote:
> Hi people!
>
> We decided to introduce embedded scripting in Yate as a more powerful
> alternative to regexroute and external modules. We want to know your
> questions, opinions and improvement suggestions.
.....

I think scripting will be a great add-on for Yate, and as someone
pointed out a way to easily handle any message will be specially
useful ( I'm thinking in the kind of manipulations we are presently
truing to do with the regexroute mini-language could be done in two
lines of script, and having proper subroutines and variables will help
a lot ).

I understand the reasons to embed JavaScript, but I'll like to have
some language like python/perl with a more complete library. We are
presetnly developing some control modules for Yate using the external
module interface which need to read BerkeleyDb databases, perform
connections to some other servers speaking their protocol and I'm not
quite sure this can be done easily from JavaScript ( it cannot be done
from raw perl/python, but the modules to do it are there on CPAN and
similar, I'm not aware of anything similar for JavaScript ).

I think starting with JavaScript is right, but the interface to the
scripting engine should have some intermediate class or whatever
dessigned to make it easier to plug another scripting engine
implementation there.

Regards.

Francisco Olarte.

>
> The reason to introduce scripting in Yate is to be able to perform complex
> routing and IVR like functions without the drawback of running an external
> interpreter. A script running in an external interpreter is slower to start,
> has more overhead processing the messages and cannot use all functionality of
> Yate. While regexroute can do arbitrary message processing it cannot keep a
> context associated with each call and the language itself is very weak.
>
> We are choosing the Javascript language. It is simple enough to be used by
> beginners and basic functionality can be extended by experts. Moreover, there
> are several implementation libraries suitable for embedding.
>
> We plan for the script instances to sit besides the controlled call legs just
> like pbxassist does now. The script will be able to control the call flow and
> route the call to various destinations.

>
> A set of (Javascript) expressions will select which instruction block to
> instantiate for each incoming call, much like we do now in regexroute. Once an
> instance is created all further interaction will occur in that context.
>
>
> // optional, reserved for future compatibility
> language javascript
>
> // include another file containing Javascript code
> library "/path/to/library.js"
>
> // declare a function we are going to use
> function isAuth() {
>        return username != "";
> }
>
> // send international calls of authenticated users directly to a gateway
> // in this case there is no instruction block, just a route
> called.match(/^00/) && isAuth()  ::  "sip/sip:" + called +
> " <at> gateway.xyz"
>
> // unauthenticated callers are not allowed to call outside
> called.length >= 4 && !isAuth() :: { error("noauth"); }
>
> // secondary dialer, also declare it as a function
> called == "1234" ::
> secondary_dialer()
> {
>        answer();
>        play("/path/to/prompt_file.au");
> }
>
> // alternative for the above
> function secondary_dialer2() { answer(); play("/path/to/prompt_file.au"); }
> called == "1235" :: { secondary_dialer2(); }
>
> // match and use a global variable shared between all instances
> getGlobal("chans_used") < 30 ::
> {
>        setGlobal("chans_used",getGlobal("chans_used")+1);
>        ...
> }
>
> // handling of later messages
> called == "123456" :: {
>
>        function onAnswer() {
>                ...
>        }
>
>        function onHangup() {
>                ...
>        }
>
>        // this code is executed on entering the block
>        ring("tone/ring");
>        sleep(1);
>        answer();
>        ...
> }
>
> // include another scripting file with similar syntax
> include "/path/to/next_script_control";
>
>
> Paul
>

Stanisław Pitucha | 4 Oct 2010 18:15
Picon
Gravatar

Re: Embedded scripting proposal

On 04/10/10 15:48, Paul Chitescu wrote:
> The reason to introduce scripting in Yate is to be able to perform complex 
> routing and IVR like functions without the drawback of running an external 
> interpreter. A script running in an external interpreter is slower to start, 
> has more overhead processing the messages and cannot use all functionality of 
> Yate. While regexroute can do arbitrary message processing it cannot keep a 
> context associated with each call and the language itself is very weak.
That's right with external scripts spawned when needed. But what is the
advantage of using built-in scripting -vs- global extmodule? They don't
have the starting overhead, text processing is pretty much minimal (if
you meant only the text parsing), they can keep the global context and
language can be chosen.
What is the gain here? (apart from raw performance on network
transmissions) Also, what functionality cannot be used from global
extmodules?

> We are choosing the Javascript language.
It's been mentioned by someone else too, but why:

> called.length >= 4 && !isAuth() :: { error("noauth"); }

instead of a "standard"
addRule(
   function(call) { return call.called.length >= 4 && !call.isAuth(); },
   function() { error("noauth"); }
);

This way, both sides of the rules can be named / reused, exported to
other functions, added and removed as needed, etc. etc.
Using more "standard" javascript could also be useful if someone wanted
to include external code. Also if you're going to run any known
Javascript VM, people could reuse extensions.

Regards,
Stan

Radu - Eosif Mihailescu | 4 Oct 2010 18:19
Picon
Favicon

Re: Embedded scripting proposal

On 10/04/10 17:02, Francisco Olarte (M) wrote:
(...)
I understand the reasons to embed JavaScript, but I'll like to have some language like python/perl with a more complete library. We are presetnly developing some control modules for Yate using the external module interface which need to read BerkeleyDb databases, perform connections to some other servers speaking their protocol and I'm not quite sure this can be done easily from JavaScript ( it cannot be done from raw perl/python, but the modules to do it are there on CPAN and similar, I'm not aware of anything similar for JavaScript ).
Since Yate is C++ (i.e. object-oriented) and since they have a libyate containing their base classes, it should be relatively easy to provide a language-consumer -independent API onto which language-consumers (i.e. interpretors, compilers, executors etc.) could be plugged in.

Something along the lines of what SWIG does in order to reconstruct an API created in a language for other languages (i.e. bindings).

Something similar to the way PHP extensions are written: using the ABI of C but providing primitives to another language (i.e. PHP) using some form of common abstraction (i.e. the "php_string", "php_int" etc. thingies).

Once again, something similar to the way PostgreSQL loads support for procedural languages at runtime using a plugin architecture based on a common, language-independent, abstraction of primitives available in SQL.


If that is done in an as lightweight and as straightforward a way as technically possible, we could have Yate drive code written in any language (and being driven, in return, by the same) -- even in multiple languages.

I think it would be great to be able to run a Yate instance that gets user data via Erlang's Mnesia distributed DB, does the IVR logic via a Lua script and eventually provides live load statistics via XML-RPC using ECMAScript :-)
I think starting with JavaScript is right, but the interface to the scripting engine should have some intermediate class or whatever dessigned to make it easier to plug another scripting engine implementation there. Regards. Francisco Olarte.
Keep up the good work,
<at> Dexter

Gmane