Dave Heavy Industries » ASTERISK http://www.daveheavyindustries.com Dave Heavy Industries - blog Mon, 12 Aug 2013 00:24:10 +0000 en-US hourly 1 http://wordpress.org/?v=3.6 SCCP and Asterisk http://www.daveheavyindustries.com/2012/11/05/sccp-and-asterisk/ http://www.daveheavyindustries.com/2012/11/05/sccp-and-asterisk/#comments Mon, 05 Nov 2012 06:31:42 +0000 admin http://wp.daveheavyindustries.com/?p=355 So, we bought a bunch of new cisco phones to replace some failing SNOM devices around the place. Realizing a chance to implement some great functionality, I decided to use chan-sccp-b to run them on the SCCP protocol instead of sip. I've put together some steps to help you through the process, and the module I wrote for freepbx (and how to expose that through to the elastix gui)

First things first, you'll need to get a copy of chan-sccp-b (http://chan-sccp-b.sourceforge.net/) and compile it. If you don't know how to do that, follow the steps on the chan-sccp-b site.

Grab a copy of my freepbx module -

http://wp.daveheavyindustries.com/?attachment_id=357  

http://wp.daveheavyindustries.com/?attachment_id=372

http://wp.daveheavyindustries.com/?attachment_id=378

http://wp.daveheavyindustries.com/?attachment_id=382

I used this sccp.conf, pay attention to the bold lines, this is what tells chan-sccp-b to talk to the mysql database for it's config (which the freepbx module updates).

[general]
servername = Asterisk
 keepalive = 60
 debug = core,event,device,channel
 context = from-internal
 dateFormat = D.M.Y
 bindaddr = 0.0.0.0
 port = 2000
 disallow=all
 allow=g722
 allow=g729
 allow=alaw
 allow=ulaw
 firstdigittimeout = 16
 digittimeout = 8
 autoanswer_ring_time = 1
 autoanswer_tone = 0x32
 remotehangup_tone = 0x32
 transfer_tone = 0
 callwaiting_tone = 0x2d
 musicclass=default
 language=en
 deny=0.0.0.0/0.0.0.0
 permit=10.0.0.0/255.0.0.0
 dnd = off
 sccp_tos = 0x68
 sccp_cos = 4
 audio_tos = 0xB8
 audio_cos = 6
 video_tos = 0x88
 video_cos = 5
 echocancel = on
 silencesuppression = off
 private = off
 callanswerorder=oldestfirst
 meetme = on
 meetme = qxd
 hotline_enabled=yes ; can devices without configuration register
 hotline_context=default ; context for hotline
 hotline_extension=111 ; extension will be dialed on offHook
 devicetable=sccpdevice
 linetable=sccpline

append this to your res_config_mysql.conf (your username, password  and database name added obviously)

[asterisk]
 dbhost = 127.0.0.1
 dbname = asterisk
 dbuser = username
 dbpass = password

execute mysql-v5.sql from chan-sccp_trunk/conf of your downloaded chan-sccp-b source on your mysql database

mysql --user=user --password=password asterisk < mysql-v5.sql

install the module to freepbx (http://yourpbxip/admin )

Admin -> Module Admin ->Upload Module ->Chose File -> browse to sccp_module.tar.gz (downloaded from above) -> Upload
Admin -> Module Admin -> SCCP Manager -> Install -> Process (bottom right hand corner)  -> Confirm

Two new menus will be added under "Basic"

SCCP Device Manager
SCCP Line Manager
SCCP Button Manager <-- SCCP Button manager cannot be accessed directly, this is called via the SCCP Device Manager

Self explanatory really.

now the last step is to add sccp to the extension list so you can map extensions to SCCP.

edit /var/www/html/admin/modules/core/functions.inc.php around line 6041.

Add this above "$currentcomponent->setoptlistopts('devicelist', 'sort', false);" :-

$currentcomponent->addoptlistitem('devicelist', 'sccp', _("SCCP MAP"));

Now, for elastix, to get the module visible from the elastix gui, I ahd to add two lines to modules/pbxadmin/themes/default/main.tpl, just below extensions

<li><a href="/?menu=pbxconfig&amp;type=setup&amp;display=sccpline" >SCCP Line</a></li>
<li><a href="/?menu=pbxconfig&amp;type=setup&amp;display=sccpdevice" >SCCP Device</a></li>

Install JSON module for PHP

yum info php-pecl-json-1.2.1-4.el5.x86_64

and add to php.ini under Dynamic Extensions

extension=json.so

 

and you're done!

]]>
http://www.daveheavyindustries.com/2012/11/05/sccp-and-asterisk/feed/ 29