Skip to main content

Session Execute

About​

Javascript method to execute a dialplan application

Click here to expand Table of Contents

Description​

Executes a dialplan application.
(To execute an API (console) command, use apiExecute.)

Synopsis​

  • execute(appname,arguments)
  • appname is the name of the application to execute
  • arguments are the arguments to pass to the application

Arguments​

The arguments variable is a single string, if multiple arguments need to be packed into this string, then it is up to the particular application what the delimiter is. However, the syntax is identical to using an action tag with an application attribute in the XML dialplan.

Examples​

Set Caller ID​

session.execute("set","effective_caller_id_number=4141231234");

Bridge

session.execute("bridge","sofia/mydomain.com/foo@bar");

Record a Session (call)

session.execute("record_session", "/tmp/foo.wav");

Execute Extension

session.execute("execute_extension", "100 XML default");

Sleep​

session.execute("sleep", "2000");

Chat permissions: Join a conference muted

 Fetch values from ODBC. If you want this user muted:
memberflags = "+flags{mute}";
Else:
memberflags = "";
session.execute("conference", conf_nr + "@default+" + memberflags);
 Can also be applied to other flags as well