User Manual 0 8

User Manual

Initialize System

At minimum, you will need to:

  • Create a root user
  • An account
  • And an administrator for the account

An "account" is a "tenant" in the WikiPBX terminology.

Create Root User

  • Click [Add Root] and add a root user.
  • Login as root

The root user has a different set of menus. The main function of the root user is to manage accounts and the server as a whole.

In order to start adding extensions, you will first need an account and an account admin.

Create a SIP profile

  • You will need at least one sip profile to do anything. It is recommended you create one on port 5060. Recommended names for the profile: external, internal, or main. It is recommended that you don't auth all calls on the profile and instead leave it open, and then lock down partiucular extensions so that only registered users can reach those extensions .. especially those that dial out of gateways.

Create account + account admin

  • Login as root
  • Create a new account and an account admin for that account. (must use different email as root)

Create endpoints/extensions

  • Logout as root
  • Login as the account admin
  • Create endpoints and extensions

Registering SIP Endpoints

An 'endpoint' is just a generic word for a 'phone', which covers hardphones, softphones, etc. Also referred to as 'device' in some contexts.


  • Click Endpoints / Add
  • Choose a User ID / Password
  • It is recommended to add an Extension for the endpoint

You will also need to configure the endpoint.

Configuring Gateways

Gateways allow you to 'bridge out' to the PSTN, as well as receiving incoming calls from the PSTN, depending on what services you have ordered.

When you are logged in as an account administrator, you will be able to create gateways. See Gateways / Add in the left toolbar.

Add Gateway

First, add a gateway called 'fwd' using the following parameters, leaving the rest as default:

  • '''username:''' <fwd number>
  • '''password:''' <super secret password>
  • '''realm:'''
  • '''proxy:'''
  • '''register:''' true

where <fwd number> is your assigned free world dialup number, for example: '''724316'''

Wait a few seconds, then go to the freeswitch console and type

 sofia status gateway fwd

And verify the state is REGED

Dialout Test

For testing that dialing out of the fwd gateway works, add an extension

  • Extension #: ^613$
  • Description: echo
  • Dialplan XML: <action application="bridge" data="sofia/gateway/fwd/$1"/>

And then call extension 613, and you should hear the echo test and have 2 way audio.

NOTES on NAT: This should work even if your freeswitch/wikipbx installation is behind a NAT (network address translation), such as a wireless router you typically find on home networks. The reason it works is because FWD is very lenient, and even though unroutable internal LAN ip addresses/ports are sent in the SIP headers, it ignores these and just looks at the incoming connection's ip and port.

Outgoing Extension

To dial out of fwd for any six digit extension, add an extension to your dialplan:


with dialplan xml:

 <action application="bridge" data="sofia/gateway/fwd/$1"/>

Then try calling another fwd user.

Incoming Extension

Add an extension equal to your fwd dialup number, for example '''724316''' that was used in above example, so your extension # should be:


And for the dialplan XML, you can add anything you like. Perhaps for an initial test, add

 <action application="echo"/>

and then after this works you can replace it with a bridge command that calls one or more endpoints.

Example Extensions

Dial a local endpoint and remote phone number simultaneously

<action application="bridge" data="sofia/gateway/voicemeup/12104400113,sofia/test/4761%"/>


  • Remote phone via 'voicemeup' gateway: sofia/gateway/voicemeup/12104400113
  • Local endpoint: sofia/test/4761% where 'test' is the name of your account

Dial out of a gateway for 1800 numbers

Set the destination number to:


And the action XML to:

 <action application="bridge" data="sofia/gateway/voicemeup/$1"/>

Where 'voicemeup' is the name of a valid gateway on your system.

Dial out of a gateway for all USA numbers

Set destination number to:


And the action XML to:

 <action application="bridge" data="sofia/gateway/voicemeup/$1"/>

Where 'voicemeup' is the name of a valid gateway on your system.

Connect to an IVR

 <action application="python" data=""/>

Where '''foo''' is the name of your account

You can also set variables before connecting to the IVR, which the IVR will be able to 'see'

  <action application="set" data="foo=bar"/> 
  <action application="python" data=""/>

Now when the IVR is called, it will see a variable called ''foo'', with the value of ''bar''


 <action application="echo"/>


 <action application="conference" data="freeconf"/>

The value in data defines the ID of the conference, which is created on the fly and no other configuration is necessary.

Play audio file

 <action application="playback" data="/var/lib/wikipbx/soundclips/welcome_echo.wav"/>

Speak TTS

 <action application="speak" data="cepstral|william|hello world"/>

Where ''cepstral'' is the name of the speech module, ''william'' is the name of the voice (however, if you dont know it, just use anything like 'yoda' and it will find the default voice). ''hello world'' is what will be spoken into the call.

Transfer to another extension

 <action application="transfer" data="0"/>

Transfers to extension 0

Bridge to external extension

 <action application="bridge" data="sofia/test/"/>

Example IVR's


Hello World

from freeswitch import *

def handler(uuid):
    session = PySession(uuid)
    session.set_tts_parms("cepstral", "william") 
    console_log("INFO", "Hello, world\n")
    session.speak("Hello World")

Time-based Routing

from freeswitch import *
import datetime

def handler(uuid):
    if not uuid:
        console_log("info", "\nNo uuid given\n")
    session = PySession(uuid)
    session.set_tts_parms("cepstral", "william") 
    session.speak("Hello, welcome to foo.")
    now =
    if now.hour >= 9 and now.hour <=17:
        session.speak("Connecting your call to the first available operator")
        session.execute("execute_extension", "4769 XML default")
        session.speak("Sorry, but nobody is available, connecting you to voicemail")   
        session.execute("python", "wikipbx.ivr.test.voicemail")
        session.speak("Sorry you have called after hours, bridging to voicemail")
        session.execute("python", "wikipbx.ivr.test.voicemail")
        session.speak("Goodbye and thank you for calling foo")

Playing a soundclip

import os

from freeswitch import *
from wikipbx.wikipbxweb.models import *

def handler(uuid):
    if not uuid:
        console_log("info", "No uuid given")
    session = PySession(uuid)
    session.set_tts_parms("cepstral", "william")
    account_id = session.getVariable("account_id")
    account = Account.objects.get(pk=account_id)
    session.speak("Welcome to %s" %
    server = Server.objects.all()[0]
    path = os.path.join(server.application_root,


Switching from zip file to bazaar branch

For example to switch from using a zip file to using the 0.8 branch:

  • cd /usr/src
  • mv wikipbx wikipbx.old
  • bzr co lp:~wikipbx-dev/wikipbx/0.8.x wikipbx
  • cp /usr/src/wikipbx.old/wikipbx/ /usr/src/wikipbx/wikipbx/
  • restart apache
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License