From MozillaWiki
< Labs‎ | Ubiquity
Jump to: navigation, search

Back to Labs/Ubiquity/Commands_In_The_Wild.

Asterisk related functionality will go here Labs/Ubiquity/Asterisk

LEGAL NOTICE: Mozilla is providing links to these third-party Ubiquity commands as a courtesy, and makes no representations regarding the commands or any information related there to. Any questions, complaints or claims regarding the commands must be directed to the appropriate developer or software vendor.

Dial Command

Using Asterisk PBX & Ubiquity, one can create the 'dial' command to send out a call to a configured SIP phone and once answered the number entered will be dialed.

Asterisk Setup

Most of the documentation for this will be on other sites. I'll give just a general overview. There are also several ways this could be accomplished and this is just one method. Also be aware that some of these configurations could leave your asterisk machine open to attacks if not setup properly so read the manual.

http.conf & manager.conf

AJAM - Setup the Asterisk HTTP server and allow AMI to operate on HTTP.

I set the bind address to my public IP and bind port as 8088 in this example.

The prefix was also set to ubiquity instead of asterisk.


There should be some type of account setup for outbound termination of sip calls.

Should also have a friend setup with an extension. This will be used for your SIP phones authentication.

In this example I use a sip extension/user of 201.


PROVIDER_FROM_SIP_CONF - should be updated to match your provider defined in sip.conf.

exten => _X.,n,Hangup()

Once this is setup reload or restart asterisk.


This seems to achieve what we're looking for. Any updates or modifications to this please add back on this page or perhaps there is some other way of managing this?

Add the following in your Ubiquity Command Editor.

  name: "dial",
  takes: { "number":noun_arb_text },
  icon: "",
  author: {name: "Justin", email: ""},
  description: "Dials a call with Asterisk",
  help: "Dial NXXNXXXXXX - Rings configured SIP extension and dials number on answer",
  execute: function( directObject ) {
    var number = directObject.text;
    var url = "";

    var auth = {
      action: "login",
      username: "ubiquity",
      secret: "ubiquitydemo"

    var dial = {
      action: "originate",
      channel: "SIP/201",
      context: "custom-ubiquity",
      exten: number,
      priority: "1"

    jQuery.get( url, auth, function( ) { jQuery.get( url, dial); });

  • Will need to update the IP address ( to the IP of *PBX.
  • Modify the username and secret to match whatever was setup in manager.conf.
  • Update channel to match the user or extension of your SIP phone. (IAX, Zap, or Local)

The command will send auth varaibles to the PBX. When a successful return is received the dial (originate) variables will then be passed which causes the call to begin.


dial 1231231234
  • Extension 201 will start ringing as soon as enter is pressed.
  • Answer Extension 201 (x-lite auto answer button is handy)
  • 1231231234 starts to dial.
  • Talking with called party


  • Handle returns or errors
  • Create package ast-[command] (ast-dial, ast-hold, ast-chans, ast-trans)
  • SIP phone embedded into Ubiquity preview?


  • Sarge_ - Discuss in the ubiquitously forum.