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.

Topics - asymetrixs

Pages: [1]

I want yate to make an outgoing call to a party and once this party answers the call, it should be connected to an internal javascript that runs an IVR.

I know that via javascript routing I can connect an incoming call to a javascript-ivr, but in this scenario it is an outgoing call.

What I have so far is a javascript registered in javascript.conf
Code: [Select]
with the following content, which causes Yate to create an outgoing call (in this case to my SIP phone which address is in m.getResult(0,1)).
Now after establishing this call I want to connect it to a javascript that plays a sound file and can handle DTMF. The problem right now is connecting it to this file. Once it is connected, I guess I can simply install handlers for chan.dtmf and receive the buttons pressed.

Code: [Select]
function onTimer(msg)
    //Engine.debug(Engine.DebugInfo,"Got Engine.Timer");

    // Get DB Object
    var m = new Message("database");
    // Specify connection to use
    m.account = "ivrcon";
    // Define Query
    m.query = "SELECT OK, number, call FROM get_next_call();";
    // Run the Query
    if (m.dispatch())
        if (m.rows > 0)
            Engine.debug(Engine.DebugInfo, "Got " + m.rows + " records of " + m.columns + " fields");

            var executeMsg = new Message("call.execute", msg); = Math.random(10000,10000000);
            //executeMsg.callto = "wave/play//usr/share/yate/sounds/prompt_for_destination.alaw";
            executeMsg.callto = "wave/play/-"; // silence
            executeMsg.called = m.getResult(0,1);
            executeMsg.caller = "Hans";
            executeMsg.callername = "Hans";
        Engine.output("Query failed");

    return false;


Is this even possible or do I need to connect it via
Code: [Select]
external to a PHP script?

Features requests / SQL query queue status / queue flush
« on: March 11, 2013, 12:47:22 PM »
Hi all,

as far as I know yate knows to ways of sending queries to the database, "enqueue" and "dispatch".

"enqueue" puts the SQL query into a queue and runs it as soon as it has free resources to do so. This can lead to a growing queue under very heavy load and maybe some queries get fired long time after they were enqueued.

"dispatch" runs the SQL query synchronously against the database and waits for the result to return. This is for example used in preroute and route where it is needed because yate routes depending on the value it retrieves from DB.

What I'd like to see as feature are two things:

1) At no time there is a way (or at least I do not know any) to see how many SQL queries are currently enqueued. 'status pgsqldb' should also display the amount of enqueued SQL statements so that one know, if there are still queries that need to be run. The reason is as follows: We saw that a yate server that retrieves more calls than it can handle performs the "dispatched" queries, but may forget to run some of the "enqueued" queries (like CDR query, we found lot's of CDR records that were not updated even though they were quite old and the call was terminated). This would give the user at least the chance to see how the queue is used and if there are queries pending.

2) Referring to 1) even if the server load decreases to a normal level, some SQLs may have get lost OR are pending for infinitive time. Therefore it would be nice to see a command like 'database pgsqldb flush' that causes yate to cleanup the queue and force running the enqueued queries against the database. This would be to solve the case where enqueued SQL queries are pending and not performed by yate automatically. We hade the issue that the server did not run the queries and we could not see if there are queries in the queue (mentioned in 1)) nor could we force yate to empty the queue and run all queries (referring to 2)).

What do you think?

Features requests / Get Hostname in Yate
« on: February 16, 2013, 03:28:55 PM »

currently we write the hostname of our yate servers into the config files and use them for example in SQL statements like SELECT * FROM table WHERE yate_instance = 'yate1';
We do need this, because results from and operations on the DB depend on which yate-server is querying.

This is very odd, because each server needs it's own set of configuration files just for the hostname.

It would be great if there would be a property on the message object like nodename (which is already present in some handlers) which is available globally. Maybe not to confuse both and influence existing yate installations it could be a new property called "hostname".
We do use it in
- user.register
- engine.timer
- call.preroute
- call.route
- call.cdr (initquery, cdr_initialize, cdr_update, cdr_finalize)
- accounts (initquery, timerquery, statusquery)

I already talked with Paul with that but we did not come to a conclusion so far. He suggested to write a small module for that.

For anyone who just needs it in CDR, you can put this in regexroute.conf
Code: [Select]

Who else is interested in this?
Null-Team what do you think?

Yate IVR / Javascript + DTMF
« on: January 10, 2013, 07:53:10 PM »
Hi all,

is it possible to use DTMF in Javascript routing?

Can someone provide an example script?


Yate IVR / Javascript Routing - Empty message-Object
« on: January 09, 2013, 04:30:37 PM »

I just wrote a simple routing script in Javascript and I have the following problem:

Code: [Select]
message.callto_account = mysqlAccount; // Setting the MySQL Account (this is a variable containing a string)
message.callto_query = "CALL yate_voice_timeout('" + dbTimeout + "', '" + language + "')"; // Setting up the query
Engine.output("1) ME: " + message.caller); // Gives: 123456
Channel.callTo("dbwave/play//"); // Plays the Binary Data returned by the SQL Query
Engine.output("2) ME: " + message.caller); // Gives: (empty)
message.callto.1  = "sip/";
message.callto.2  = "sip/";

When issuing the callJust, then message.caller is empty which causes problems because the value in CDR insert/update/finalize is empty too.
As far as described in the docs, that behavior is correct, because the return values of Channel.callTo are written in the message object, but I want to call other targets as well.

So do I have to copy all parameters and store them in separate variables to reuse them or is there a way to retrieve the original 'incoming'-message with all its values?

Damian / asymetrixs

Pages: [1]