BlueBox - Gentoo Wiki
BlueBox - Gentoo Wiki
BlueBox - Gentoo Wiki
BlueBox
From Gentoo Wiki BlueBox (http://www.2600hz.org) is a web based php configuration and management GUI for FreeSWITCH (http://www.freeswitch.org/) and Asterisk switching libraries. It supports multi-tenancy, skinning, and is completely open-source. It can be used with database and file replication to scale up to thousands of registered devices and simultaneous phone calls. It can operate in the cloud or on the premise. It originally developed from FreePBXv3 (http://www.freepbx.org/freepbx-v3) . I found the following two blogs on VOIP PBX useful: freeSWITCH (http://michigantelephone.wordpress.com/category/freeswitch/page/2/) --- which covers Asterisk+FreePBX, FreeSWITCH+BlueBox and FreeSWITCH+FusionPBX FreeSWITCH Cookbook (http://michigantelephone.wordpress.com/category/freeswitch/)
Article status T his article needs wikification. T his article has some todo items: FreeSWIT CH Configuring a Dialplan
Contents
1 Prerequisites 1.1 FreeSWITCH 1.2 Web Server 1.3 PHP 1.4 Database 2 Database Setup 3 Installing Bluebox 4 Starting FreeSWITCH 5 Configuring FreeSWITCH with BlueBox 5.1 IPKall 5.2 NAT Traversal For SIP 6 Configuring a Dialplan (TODO) 6.1 Auto Attendant 6.2 Time Based Routes 6.3 Ring Groups 6.4 Conferences 6.5 Feature Codes 6.6 Trunks 7 Saving your BlueBox Configuration
wiki.gentoo.org/wiki/BlueBox
1/12
6/1/13
Prerequisites
I installed the following prerequisites: net-misc/freeswitch (http://packages.gentoo.org/package/net-misc/freeswitch) -9999 www-servers/apache (http://packages.gentoo.org/package/www-servers/apache) -2.2.22-r1 dev-lang/php (http://packages.gentoo.org/package/dev-lang/php) -5.3.13 dev-db/mysql (http://packages.gentoo.org/package/dev-db/mysql) -5.1.62-r1
FreeSWITCH
Please first install FreeSWITCH following the FreeSWITCH Wiki (http://wiki.freeswitch.org/wiki/Installation:Gentoo) There are many USE options for FreeSwitch. Not all of them compile for me. [TODO] -- Add list here of which work and which don't compile. After installing FreeSWITCH, there is a post-installation message from portage that a backup of the default configuration files has been saved to: / u s r / s h a r e / d o c / f r e e s w i t c h 9 9 9 9 / c o n f But a "diff -r /etc/freeswitch /usr/share/doc/freeswitch-9999/conf" shows differences. So I made my own copy:
r o o t#c pa/ e t c / f r e e s w i t c h/ e t c / f r e e s w i t c h . o r i g r o o t#l ns/ e t c / f r e e s w i t c h . o r i g/ o p t / f r e e s w i t c h / c o n f . o r i g
Also, portage seems to install the freeswitch configuration directory twice: once into / e t c / f r e e s w i t c h and a second time into / e t c / f r e e s w i t c h / f r e e s w i t c h A "diff" for each file/folder in /etc/freeswitch/* and /etc/freeswitch/freeswitch/* shows no differences. Is this a mistake? Double check FreeSWITCH permissions: -- I think during BlueBox installation I may have done a "chown -R apache.freeswitch /opt/freeswitch". If apache needs read access to / o p t / f r e e s w i t c hduring BlueBox installation, the ownership/permissions need to be reset as follows or you cannot run freeswitch as user "freeswitch": Code Changing ownership/permissions
c h o w nRr o o t : f r e e s w i t c h" / e t c / f r e e s w i t c h " c h m o dRu = r w X , g = r X , o = " / e t c / f r e e s w i t c h " #p r e f i x c h o w nRr o o t : f r e e s w i t c h" / o p t / f r e e s w i t c h " c h m o dRu = r w X , g = r X , o = " / o p t / f r e e s w i t c h " #a l l o wr e a da c c e s sf o rt h i n g sl i k eb u i l d i n ge x t e r n a lm o d u l e s c h m o dRu = r w x , g = r x , o = r x" / o p t / f r e e s w i t c h / " { l i b * , b i n , i n c l u d e } c h m o d u = r w x , g = r x , o = r x" / o p t / f r e e s w i t c h " #d i r e c t o r i e so w n e db yt h ef r e e s w i t c hu s e r
wiki.gentoo.org/wiki/BlueBox 2/12
[Collapse]
6/1/13
Also, the / e t c / i n i t . d / f r e e s w i t c hscript tries to change the pid file from the default for FreeSwitch from / o p t / f r e e s w i t c h / r u n / f r e e s w i t c h . p i dto / v a r / r u n / f r e e s w i t c h . p i d . FreeSwitch insists on writing its pid to / o p t / f r e e s w i t c h / r u n / f r e e s w i t c h . p i d , but the Gentoo init script looks for the pid in / v a r / r u n / f r e e s w i t c h . p i d . So my solution is to change the init script: Code Updated init script
s t a r t ( ){ l o c a lO P T S [n" $ { F R E E S W I T C H _ U S E R } "]& &\ O P T S = " $ { O P T S }u$ { F R E E S W I T C H _ U S E R } " [n" $ { F R E E S W I T C H _ G R O U P } "]& &\ O P T S = " $ { O P T S }g$ { F R E E S W I T C H _ G R O U P } " [n" $ { F R E E S W I T C H _ O P T S } "]& &\ O P T S = " $ { O P T S }$ { F R E E S W I T C H _ O P T S } " e b e g i n" S t a r t i n gF r e e s w i t c h " u l i m i ts2 4 0 s t a r t s t o p d a e m o ns t a r tq u i e te x e c$ { F R E E S W I T C H _ B I N }\ p i d f i l e/ o p t / f r e e s w i t c h / r u n / f r e e s w i t c h . p i d-n c$ { O P T S } e e n d$ ? }
[Collapse]
Web Server
Install a web server such as Apache nginx
PHP
Install PHP.
Database
Install a database backend such as: MySQL PostgreSQL dev-db/sqlite (http://packages.gentoo.org/package/dev-db/sqlite)
Database Setup
wiki.gentoo.org/wiki/BlueBox 3/12
6/1/13
[Collapse]
If you make a mistake and need to start over: Code MySQL start over
m y s q lur o o tp m y s q l >R E V O K EA L LP R I V I L E G E S ,G R A N TO P T I O NO Nb l u e b o x . *F R O M' b l u e b o x ' @ ' l o c a l h o s t ' ; m y s q l >D R O PD A T A B A S Eb l u e b o x ; m y s q l >\ q
[Collapse]
Installing Bluebox
Adapted from Bluebox FreeSwitch install guide (CentOS v5.x, Freeswitch v1.0.x, Bluebox) (http://www.powerpbx.org/content/centos-freeswitch-bluebox-v1) . Install BlueBox git source into top level root of web server:
r o o t#c d/ v a r / w w w / l o c a l h o s t / h t d o c s r o o t#g i tc l o n eg i t : / / s o u r c e . 2 6 0 0 h z . o r g / b l u e b o x . g i t r o o t#c h o w nRf r e e s w i t c h : f r e e s w i t c h/ v a r / w w w / l o c a l h o s t / h t d o c s / b l u e b o x r o o t#c d/ v a r / w w w / l o c a l h o s t / h t d o c s / b l u e b o x r o o t#. / p r e i n s t a l l . s h
When the install asks you for the web user name change default ("apache") to "freeswitch" (without quotes). Everything else can remain at default (just repeatedly press E n t e r when it asks). Increase the memory_limit for PHP:
r o o t#s e di' s / m e m o r y _ l i m i t=3 2 M / m e m o r y _ l i m i t=1 2 8 M / g '/ e t c / p h p / a p a c h e 2 p h p 5 . 3 / p h p . i n i
Restart apache:
r o o t#/ e t c / i n i t . d / a p a c h e 2r e s t a r t / o p t / f r e e s w i t c h / c o n fis a symlink c o n f i g u r a t i o nG U I : r o o t#c h o w nRa p a c h e . f r e e s w i t c h/ e t c / f r e e s w i t c h
wiki.gentoo.org/wiki/BlueBox 4/12
to / e t c / f r e e s w i t c h } .Y o uw i l ln e e dt oc h a n g et h eo w n e r s h i p
o nt h ec o n f i g u r a t i o nf i l e st oa l l o wa p a c h et om a k ec h a n g e sb e f o r ey o ur u nt h eB l u e B o x
6/1/13
[ C o l l a p s e ]
Ij u s tc o n t i n u e d . A f t e rc o n f i g u r i n gB l u e B o x ,m yd e f a u l tc o n f i g u r a t i o nw a sa sf o l l o w s : F i l e/ v a r / w w w / l o c a l h o s t / h t d o c s / b l u e b o x / c o n f i g / d a t a b a s e . p h p
' t y p e ' = >' m y s q l ' , ' u s e r ' = >' b l u e b o x ' , ' p a s s ' = >' b l u e b o x ' , ' h o s t ' = >' 1 2 7 . 0 . 0 . 1 ' , ' p o r t ' = >' 3 3 0 6 ' , ' s o c k e t ' = >F A L S E , ' d a t a b a s e '= >' b l u e b o x '
[ C o l l a p s e ]
File /var/www/localhost/htdocs/bluebox/bluebox/config/config.php
c o n f i g [ ' i n s t a l l e r _ e n a b l e d ' ]=F A L S E ;
Starting FreeSWITCH
There appears to be no man installation for FreeSWITCH. So use --help to get freeswitch command line options:
r o o t#/ o p t / f r e e s w i t c h / b i n / f r e e s w i t c hh e l p
T h e s ea r et h eo p t i o n a la r g u m e n t sy o uc a np a s st of r e e s w i t c h n f -n of o r k i n g u[ u s e r ] -s p e c i f yu s e rt os w i t c ht o g[ g r o u p ] -s p e c i f yg r o u pt os w i t c ht o h e l p -t h i sm e s s a g e v e r s i o n -p r i n tt h ev e r s i o na n de x i t w a s t e -a l l o wm e m o r yw a s t e
wiki.gentoo.org/wiki/BlueBox 5/12
6/1/13
c o r e r p l p n p v g n o s q l h e a v y t i m e r n o n a t n o n a t m a p n o c a l n o r t s t o p n c n c w a i t c c o n f[ c o n f d i r ] l o g[ l o g d i r ] r u n[ r u n d i r ] d b[ d b d i r ] m o d[ m o d d i r ] h t d o c s[ h t d o c s d i r ] s c r i p t s[ s c r i p t s d i r ]
So I just added ulimit -s 240 to the start routine of / e t c / i n i t . d / f r e e s w i t c h . Some useful fs_cli (FreeSWITCH command line interface) for debugging, tracing:
s o f i as t a t u s s o f i as t a t u sp r o f i l es i p i n t e r f a c e _ 1 s o f i as t a t u sp r o f i l es i p i n t e r f a c e _ 1r e g s o f i al o g l e v e la l l9 s o f i ag l o b a ls i p t r a c eo n c o n s o l el o g l e v e ld e b u g e v a l $ { d o m a i n } e x p a n ds o f i ac o n t a c t< s i pu s e ra c c o u n t >
6/1/13
A few pairs of modules conflict, e.g.: "Freeswitch" and "Asterisk" "Endpoint Manager" and "Provisioner" "Media File" and "Media Manager" I chose "Freeswitch", "Endpoint Manager" and "Media File" and installed every remaining module except those for a call center. Bluebox came pre-installed with three sip interfaces "Connectivity" -> "SIP Interface"
A u t h e n t i c a t e dS I P A u t oD e t e c t 5 0 6 0 5 0 7 0 5 0 8 0 R e q u i r e d R e q u i r e d N o n e E d i t | D e l e t e E d i t | D e l e t e E d i t | D e l e t e
A u t h e n t i c a t e dS I P-N A TA u t oD e t e c t U n a u t h e n t i c a t e dS I P A u t oD e t e c t
Use the FreeSWITCH CLI to see your interfaces: freeswitch@myhost> sofia status
N a m e T y p e D a t a S t a t e
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = s i p i n t e r f a c e _ 2 v o i c e m a i l _ 1 s i p i n t e r f a c e _ 1 s i p i n t e r f a c e _ 3 1 9 2 . 1 6 8 . 1 . 4 0 p r o f i l e a l i a s p r o f i l e p r o f i l e a l i a s s i p : m o d _ s o f i a @ 1 9 2 . 1 6 8 . 1 . 4 0 : 5 0 7 0 s i p i n t e r f a c e _ 2 s i p : m o d _ s o f i a @ 1 9 2 . 1 6 8 . 1 . 4 0 : 5 0 6 0 s i p : m o d _ s o f i a @ 1 9 2 . 1 6 8 . 1 . 4 0 : 5 0 8 0 s i p i n t e r f a c e _ 1 R U N N I N G( 0 ) A L I A S E D R U N N I N G( 0 ) R U N N I N G( 0 ) A L I A S E D
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 3p r o f i l e s2a l i a s e s
Now configure users, devices, voicemail boxes, endpoints and assign numbers. It facilitates configuring your sip device if you first configure the Users ("Organization" -> "User Manager") their Voicemail Boxes ("Applications" -> "Voicemail Boxes") the Endpoints ("Applications" -> "Endpoints") and then the sip phones ("Applications" -> "Devices")
wiki.gentoo.org/wiki/BlueBox 7/12
6/1/13
The passwords for the users must be alphanumeric but the passwords for the sip devices and voicemail boxes need not be so. To keep things simple I used the same identifying string for device names, sip accounts, extensions. For example, Device Name "101" associated with user "John Doe" used sip account "101" and was assigned extension "101" and unanswered calls were transferred to the voicemail box for 101 (extension 201) All used the same password except for the the required alphanumeric password for the User Account for John Doe. If you decide to have a default Multitenant system, then your sip registrations will use "user@domain" instead of just "user" for the User Account. Make sure that your user:password (or user@domain:password) for each Device in bluebox matches what you have configured for each sip phone. First try to get sip registration working before attempting secure sip (sips) registration or encrypted media (srtp). FreeSWITCH also has support for end-to-end encryption using zrtp (http://www.zrtp.org/) (see FreeSWITCH Wiki: ZRTP (http://wiki.freeswitch.org/wiki/ZRTP) ). But you must use a sip phone which supports zrtp such as the softphone Zfone (http://zfoneproject.com/prod_zfone.html) . Unfortunately, my Snom phones don't support zrtp and Snom has no plans to do so. Note that bluebox adds your sip devices to / e t c / f r e e s w i t c h / d i r e c t o r y / d e f a u l t . x m l . So check and verify that your users have been added there. Verify that your sip phones have registered with FreeSWITCH:
s o f i as t a t u sp r o f i l es i p i n t e r f a c e _ 1 = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = N a m e D o m a i nN a m e A u t o N A T D B N a m e P r e sH o s t s D i a l p l a n C o n t e x t C h a l l e n g eR e a l m R T P I P S I P I P U R L B I N D U R L H O L D M U S I C O U T B O U N D P R O X Y C O D E C SI N C O D E C SO U T T E L E V E N T
wiki.gentoo.org/wiki/BlueBox
s i p i n t e r f a c e _ 1 N / A f a l s e
X M L m u l t i t e n a n t _ r o u t i n g _ c o n t e x t a u t o _ t o 1 9 2 . 1 6 8 . 1 . 4 0 1 9 2 . 1 6 8 . 1 . 4 0 s i p : m o d _ s o f i a @ 1 9 2 . 1 6 8 . 1 . 4 0 : 5 0 6 0 s i p : m o d _ s o f i a @ 1 9 2 . 1 6 8 . 1 . 4 0 : 5 0 6 0 N / A N / A G 7 2 2 1 @ 3 2 0 0 0 h , G 7 2 2 1 @ 1 6 0 0 0 h , G 7 2 2 , P C M U , P C M A , G S M G 7 2 2 1 @ 3 2 0 0 0 h , G 7 2 2 1 @ 1 6 0 0 0 h , G 7 2 2 , P C M U , P C M A , G S M 1 0 1
8/12
6/1/13
D T M F M O D E C N G S E S S I O N T O M A X D I A L O G N O M E D I A L A T E N E G P R O X Y M E D I A A G G R E S S I V E N A T S T U N E N A B L E D S T U N A U T O D I S A B L E C A L L S I N F A I L E D C A L L S I N C A L L S O U T F A I L E D C A L L S O U T R E G I S T R A T I O N S
r f c 2 8 3 3 1 3 0 0 f a l s e f a l s e f a l s e f a l s e t r u e f a l s e 2 1 1 1 4
wiki.gentoo.org/wiki/BlueBox
9/12
6/1/13
Now that our phones have registered with FreeSWITCH, check that you have a dial tone and can dial an internal extension.
IPKall
If you want to test SIP from outside your network, apply for a free DID from IPKall (http://www.ipkall.com/) (Washington State). Just select an area code and choose a "SIP phone number" which can be any alphanumeric string, eg. "IPKall". Enter the "SIP Proxy" for your FreeSWITCH server, eg. "pbx.mydomain.com:5080". Make sure you specify a SIP port of 5080 instead of the default 5060. BlueBox uses different SIP ports to listen on for each different SIP interface, e.g.: Authenticated SIP Auto Detect 5060 Authenticated SIP - NAT Auto Detect 5070 Unauthenticated SIP Auto Detect 5080 Then go to "Routing -> Number Manager" and add your new number: Manage -> Number: "IPKall" Manage -> Type: Internal Device (Pick a destination such as Device "101") Contexts -> Inbound Routes Number Pools -> Device Now add a trunk for IPKall "Connectivity -> Trunk Manager": Trunk Name: "IPKall" Trunk Type: "SIP Interface" Server: "voiper.ipkall.com" Bind To Interface: "Unauthenticated SIP" Made from these Contexts: "Inbound Routes" Caller ID Name: "ipkall" Caller ID Number: <DID number emailed to you by IPKall> Now try phoning the IPKall DID phone number emailed to you. I got a busy signal, so I had to edit "Connectivity -> SIP Interfaces -> Unauthenticated SIP" and change "Inbound Calls -> Default Incoming Context" from "AUTO(Multitenant)" to "Inbound Routes" since I opted not to have a multitenant system.
wiki.gentoo.org/wiki/BlueBox
10/12
6/1/13
Now we need to configure various components for a dialplan. BlueBox's modules make configuring a dialplan rather straight forward. A few things from FreePBX seem to be missing: A simple way to call an extension to record an IVR prompt for use with an AutoAttendant BB does however allow you to upload a pre-recorded media file or to use text-to-speach (flite, cepstral) for your prompts No iax or dahdi (freetdm) modules -- only sip Early versions of FreePBX did not have a dahdi configuration utility for managing chan_dahdi_additional.conf, however you could still manually edit the chan_dahdi_custom.conf. It should be possible to do something similar with FS+BB. The configuration files created by BB begin with "bluebox_", can one though edit other configuration files and have them included in the BB dialplan? without getting clobbered by BB? Auto Attendant AutoAttendant Time Based Routes Time Based Routes Ring Groups Ring Groups Conferences Conferences Feature Codes Feature Codes such as CheckingVoicemail, etc. Trunks Trunks: DAHDI (PSTN), SIP, IAX
6/1/13
r o o t#c pa/ e t c / f r e e s w i t c h/ e t c / b l u e b o x
Before starting freeswitch or using the GUI just remember to copy either / e t c / { b l u e b o x , f u s i o n p b x } to / e t c / f r e e s w i t c hor change the symlink:
r o o t#l ns f/ e t c / b l u e b o x/ o p t / f r e e s w i t c h / c o n f
A u t h e n t i c a t e dS I P-N A TA u t oD e t e c t 5 0 7 0 R e q u i r e d E d i t | D e l e t e
> /dev/null Retrieved from "http://wiki.gentoo.org/index.php?title=BlueBox&oldid=16027" Categories: Wikify articles Todo articles Telephony software Web application This page was last modified on 19 April 2013, at 08:12. Content is available under Creative Commons Attribution Share Alike.
wiki.gentoo.org/wiki/BlueBox
12/12