Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - jamie

Pages: [1] 2 3
Yate users hangout place / MRCP Module
« on: November 23, 2019, 12:31:50 PM »

Does anyone know if this module is implemented?

I've seen POST on the mailing list archive that mentioned that it wasn't finished.

If anyone has any detail it would be greatly received!

Thank you


Is there any reason why audio format when using, for example:


could vary from slin little endian to big endian ?

My code:

Code: [Select]
    $m = new Yate("chan.masquerade");

    $m->params["message"] = "call.execute";
    $m->params["id"] = $channel_id;
    $m->params["callto"] = 'conf/' . $stream_id;
    $m->params["notify"] = $channel_id;
    $m->params["lonely"] = true;
    $m->params["maxusers"] = 1;
    $m->params["smart"] = true;

    $m->params["utility"] = false;

    $m->params["record"] = 'external/record//var/digit/ivr/src/yate/scripts/stream.php';

    // set this so that script can play warnings in conference
    $m->params["recordwarn"] = "-";
    $m->params["speakers"] = true;

    $m->params["interval"] = 3000;
    $m->params["waitlock"] = -200;

Always within the same call, but the above conference could be destroyed and restarted.

Thank you,


To remove a channel from a conference it is a simple as issuing the following:

$chan_id = sip/123456

$m = new Yate('chan.masquerade');
$m->SetParam('callto', 'wave/play/-');
$m->SetParam('id', $chan_id   );

This is a PHP implementation, but the theory is the same as the important parts are the messages.


I think there might be a mistake on one of the pages of the online documents.

It's on this page:

Towards the bottom at the section "Keyword: %%>connect"

It says:

<role> - role of this connection: global, channel, play, record, playrec

but if I try setting the role to anything other than 'global' or 'channel' it throws an error.

EG: "Unknown role 'record' received"

Here's an example of the command string i've been using :


and my extmodule.conf file uses:

[listener DigitAudioStream]

I've also checked the source of extmodule.cpp   ( )

And it to seems to indicate that only 'global' and 'channel' settings are acceptable as a role.

Please could you let me know what I should be using instead ?

I'm looking to gain access to the audio directly, as per :

3 (optional) - Transports audio data from the engine to the application
4 (optional) - Transports audio data from the application to the engine

I was assuming that upon successful connection i'd be able to start reading the audio-stream from the socket.

Thank you and much appreciated

Copied from page:
Keyword: %%>connect
Direction: Application to engine
The "connect" keyword is used only by external modules that attach to the socket interface. As the conection is initiated from the external module the engine must be informed on the role of the connection.
This must be the first request sent over a newly established socket connection. The role and direction of the connection is established and then this keyword cannot be used again on the same connection.
There is no answer to this request - if it fails the engine will slam the connection shut.
Connections with a role of play, record or playrec are data connections and must be attached to a valid control channel. Any existing data endpoint with the same type and direction is closed.
<role> - role of this connection: global, channel, play, record, playrec
<id> - channel id to connect this socket to
<type> - type of data channel, assuming audio if missing

Yate users hangout place / How to Install lazyrec.cpp module / patch
« on: November 04, 2018, 09:50:01 PM »

Please could I ask for a little help ?

Is it possible or feasible to install lazyrec.cpp ?

I found it here :

but unfortunately I've not be able to find any instructions.

If possible, please could you point me in the right direction?

Thank you!


OS Dist: debian

Hi Ganapathi,

To indefinitely repeat an audio file you can include the parameter autorepeat = true :

but I've only used this in PHP


Hi Marian

Thank you, For others to view, I'll update the post shortly with what I've done.

Occasionally I get the following message:

"Overflow reading in buffer of length 8192"

Is this because I'm passing too much 'data' into the listening external module ?



Hi Marian,

Thanks very much for your help, much apprecited.

I think I've managed to implement this !

One quick questions .... is it best to issue the masquerade call.execute immediately after the call.drop channel, or
to listen for the disconnected message and do it then?


Please could you help me ?

I need to be able to remove a caller from a conference and not hang-up.

I've been using the following to create a conference (PHP):

Code: [Select]
$m = new Yate("chan.masquerade");
 $m->id = "";
 $m->params["message"] = "call.execute";
 $m->params["id"] = $partycallid;
 $m->params["callto"] = "conf/cs-$conference_id";
 $m->params["notify"] = "conf-monitor/cs-$conference_id";
 $m->params["billing"] = "true";
 $m->params["lonely"] = "true";
 $m->params["maxusers"] = $maxusers;
 $m->params["smart"] = "t";

 //$m->params["record"] = "external/nodata/conference.php";
 // set this so that script can play warnings in conference
 //$m->params["recordwarn"] = "-";
 $m->params["speakers"] = $speakers;
 $m->params["interval"] = $interval_notifications;
 $m->params["waitlock"] = -200;  // ( ** Not sure what this does ** )


This work fine.

However, after a period of time, I need to be able to remove the caller from the conference (or destroy it) but without dropping the call.

I've checked for capability in the source ( conference.cpp ) and see that it seems to have class methods that might do it, but I can't see how I would do it.

Your help would be very much appreciated.

Thank you, Regards


Yate users hangout place / Detecting Speech - Lex VoiceBot
« on: September 14, 2018, 06:32:18 PM »

Please could I ask for some help ?

Does YATE currently have a method of detecting if a caller is talking ?

I was wondering if it would be practical to use the conference 'speaking' notify event? However this would me invoking a conference each time we want to listen for a caller 'speaking' or not.

If it doesn't, any thoughts as to where I might begin would be much appreciated.

Thank you!



Hi Monica,

Forking in the external module is very flexible, here's what I've worked out this evening that solves my original routing requirement. I hope it helps others one day!

I have tested the following, but please let me know if you see any problems ?!

*Simple Example - Fork to 2 Registered SIP users*

Code: [Select]

// Start the fork
$ev->retval = "fork";
// Add the first target
$ev->params["callto.1"] = 'sip/sip:test_user_1@';
// Add the second target
$ev->params["callto.3"] =  'sip/sip:test_user_2@';
// Mark handled
$ev->handled = true;

*More Complex Example - Fork to 2 Registered SIP users and then a 3rd Target over a line*

Code: [Select]

// Start the fork
$ev->retval = "fork";

// Add the first target (registered sip user)
$ev->params["callto.1"] = 'sip/sip:test_user_1@';
// Add a Max Call duration for target 1
$ev->params["callto.1.timeout"]  = "30000";

// To start calling the next target after 3 seconds add a callto param of |next=3000  ( call 1 will not hangup )
$ev->params["callto.2"]  = "|next=3000";

// Add the next Target
$ev->params["callto.3"] =  'sip/sip:test_user_2@';
// Add it's Max Call duration
$ev->params["callto.3.timeout"]  = "30000";

// To start calling the next target after 3 seconds add a callto param of |drop=3000  ( calls 1 and 2 will both hangup )
$ev->params["callto.4"]  = "|drop=3000";

// Add the final Target
$ev->params["callto.5"] =  'line/sip:449066631234';
// Tell YATE that this is to be routed over line 'test_gateway_1'
$ev->params["callto.5.line"]  = "test_gateway_1";
// Add it's Max Call duration
$ev->params["callto.5.timeout"]  = "60000";

// Mark handled
$ev->handled = true;

For testing purposes, I wrapped the above in the following and listened for the call.route event message.

Code: [Select]

if ( $ev->name==='call.route' && $ev->getValue("called") == "1001") {



Just the authentication mystery to solve now !

Thank you, regards


I've just been looking at an external script as an alternative option.

I remember now why I went the database route and doing it all in register.conf and the pg function!

Setting up an external script is straightforward.

I can also make it listen for the the call.route message event and point it at something eg tone/busy or moh/default to test.

But my problem has always been authentication.

The auth process it's self is ok,

My problem is when i come to route the call in the .php script, how do I check the user is authenticated before routing ?

There's no username parameter in my call.route, so I've installed user.auth as  well.

But, if i try to listen for the the user.auth event, i can quite often get the call.route event before seeing an auth event, defeating the purpose.

I must be looking at this in the wrong way. I suspect priorities !

Sorry to leave you with two questions, but any pointers would be really helpful !

Thank you!


PS I'm still using register.conf for it's other features, eg auth, cdr, line status etc

Hi Monica,

Thanks for your reply.

This is actually one of the pages I've been trying to use.

From your notes are you saying we'd need to return 'column' as follows:

( column name = value )

location = fork
param1 = abc
param2  = xyz

If so, I'm unsure how to translate that to the various fork targets. Where would I put the index for example and what format is ?

Just a quick example would be great !

Thank you



Please could I ask for a little help?

My Objective:

To route an incoming call using a database with a fork to two or more different registered 'lines' (accounts) and/or Registered SIP users
Everything is done from a database utilising register.conf

I've created a PostgreSQL prepared statement to return a single row with any columns we require. Eg location, line, callername etc etc

Routing to say a registered SIP user or an account (line) individually works fine, as follows:

forking the incoming call to two registered sip users, i return:

Code: [Select]
location = fork sip/sip:testuser1@ sip/sip:testuser2@
line = <NULL>

Or ...

two or more endpoints on the same line, we return fields as:

Code: [Select]
location = fork sip/01234567890 sip/01234567891
line = my_gateway

Both of the above methods work fine,

but I'm a bit flummoxed how to do the same with a mixture of registered users and lines.

I had hoped something like this would work, but alas it didn't :

Code: [Select]
location = fork sip/sip:test1@ sip/01234567891;line=my_gateway
line = <NULL>

Is what I'm trying to achieve possible from register.conf ?

If it is, please could you point me in the right direction ?

Thank you!

Yate users hangout place / Re: How to Generate a series of DTMF tones
« on: March 07, 2016, 09:36:04 AM »

Thanks Marian,

I'll stick with 'chan.dtmf ', it seems the better solution all round !

Thanks again for your help !


Pages: [1] 2 3