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.

Add

  • 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:''' fwd.pulver.com
  • '''proxy:''' fwd.pulver.com
  • '''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:

 ^(\d{6})$

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:

 ^724316$

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

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

Dials:

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

Dial out of a gateway for 1800 numbers

Set the destination number to:

 ^(18(0{2}|8{2}|7{2}|6{2})\d{7})$

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:

 ^(\d{10,11})$

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="wikipbx.ivr.foo.main"/>

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="wikipbx.ivr.foo.main"/>

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

Echo

 <action application="echo"/>

Conference

 <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/1234@bar.com"/>

Example IVR's

Python

Hello World

from freeswitch import *

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

Time-based Routing

from freeswitch import *
import datetime

def handler(uuid):
    if not uuid:
        console_log("info", "\nNo uuid given\n")
        return
    session = PySession(uuid)
    session.set_tts_parms("cepstral", "william") 
    session.speak("Hello, welcome to foo.")
    now = datetime.datetime.now()
    if now.hour >= 9 and now.hour <=17:
        session.speak("Connecting your call to the first available operator")
        session.execute("set","call_timeout=20")
        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")
    else:
        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
os.environ['DJANGO_SETTINGS_MODULE']='wikipbx.settings'

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

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

Misc

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/settings.py /usr/src/wikipbx/wikipbx/settings.py
  • restart apache
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License