SCCP and Asterisk
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&type=setup&display=sccpline" >SCCP Line</a></li>
<li><a href="/?menu=pbxconfig&type=setup&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!
November 7th, 2012 - 03:07
thank you David for this development.
If you like, we can link your module and post from chan-sccp-b.sourceforge.net
December 7th, 2012 - 16:34
Sure would Marcello – which is better/easier for everyone?
December 7th, 2012 - 16:34
And thanks for all your hard work with chan-sccp-b by the way
November 16th, 2012 - 20:06
Hello David,
First off, Thank you very much! This mod is awesome. One thing I noticed is that once you add devices/lines, there is not a way to delete them. Would you consider adding this? Thank you again for this module and how-to guide!
December 7th, 2012 - 16:34
There you go Jesse, reworked the button allocation, and remove lines/devices has been added to the latest release.
December 10th, 2012 - 12:00
So when I saw your posting on the CHAN-SCCP-B, I was really excited.
I have a couple issues though that I hope you can help me understand. First off, where is the res_config_mysql.conf I need to edit and also trying to install the module on Freepbx I get this error:
Filename not in correct format: must be modulename-version.[tar|tar.gz|tgz] (eg. custommodule-0.1.tgz)
I’m really excited to try this out as I have done this manually in the past. Looking forward to hearing from you!
DJ
December 12th, 2012 - 09:17
Hey mate,
Rename it to sccp-module.tar.gz – freepbx doesn’t like the .0.0.4 business… I’ll work something out for the next update.
As for res_config_mysql.conf…
/etc/asterisk/res_config_mysql.conf
Mine looks like this
[general]
dbhost = 127.0.0.1
dbname = asteriskrealtime
dbuser = asteriskuser
dbpass = passwordhere
;dbport = 3306
;dbsock = /tmp/mysql.sock
[asterisk]
dbhost = 127.0.0.1
dbname = asterisk
dbuser = asteriskuser
dbpass = passwordhere
December 30th, 2012 - 16:08
Hi David,
First off, thank you for the freepbx module!
I have a couple of questions.
1.) When I enter a “device”, I don’t see any entries in the SCCPDevice table, or the SCCPDeviceconfig table. Where does the freepbx front end write those configs?
2.) I can see the entry for the “line” I configured in the database, however, I don’t see it info updated in the sccp.conf. How does the phone “see” the newly created info in the FreePBX module?
I hope my questions make sense…
thanks again for all the hard work!
January 14th, 2013 - 07:52
Hey, saves in sccpdevice , sccpline and buttonconfig.
The module writes to the db, and chan-sccp-b already knows how to read from the db
December 31st, 2012 - 13:13
I have an update. I’m seeing entries in the asterisk db for the sccp device and line that I’ve added, however the phone is not registering. I’m able to manually register the phone by editing the sccp.conf.
Any ideas why chan-sccp is not pulling info from the database?
thanks!
Riten
January 14th, 2013 - 07:48
Check your sccp.conf for Realtime table settings and also verify your MySQL realtime db is set up properly
January 22nd, 2013 - 03:56
Ahh… That was the problem. I didn’t enable the Realtime table settings… All is working now.
thanks for your help!
January 13th, 2013 - 10:33
Could someone explain this section, I’m afraid I’m lost here!!
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
Cheers
January 13th, 2013 - 10:47
I downloaded and complied the Chan_SCCP-4.0.0_STABLE
I cannot locate “chan-sccp_trunk” anywhere. What am I missing?
January 14th, 2013 - 03:51
Never mind I think I’ve figure it out – at least got a little further
January 14th, 2013 - 07:45
Great news!
January 14th, 2013 - 07:24
Ok – I got everything figured out except the “Other” Button Manager and Device Manager are not working (The line manager is)
I have not been able to figure where to put this as main.tpl does not exist in my FreePBX 2.10:
“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
SCCP Line
SCCP Device“
January 14th, 2013 - 07:46
In freepbx you don’t need that step, it’s for trixbox. Should be working
I’m running this code on GitHub now, I’ll update my page… No new functionality for a bit, it’s just been bug fixes
January 14th, 2013 - 07:53
Sorry elastix, not trixbox
January 14th, 2013 - 07:58
Are you getting any errors on the device manager?
Button manager is called fom the device manager
January 25th, 2013 - 08:37
Hey. What version of asterisk and freepbx/elastix do you recommend. I am having a hell of a time getting this working
February 17th, 2013 - 20:30
Hi Dave,
thanks for sharing your work.
As some of the above comments, I have problems following the described steps. Especially when it comes to the res_config_mysql.conf, which I cannot find.
Could you share some more information on your freepbx/asterisk setup?
Thanks!
September 26th, 2013 - 13:04
Hi Mike,
I have the same problem, I can’t find res_config_mysql.conf files. I created but i think is not working.
I installed yum install asterisk-addons asterisk-addons-mysql.
I can only view the sccp line manager in freepbx gui, the other menu, the window become blank and no error message.
March 10th, 2013 - 08:29
Is it not creating the tftp file on version 0.4 anymore?
March 25th, 2013 - 20:29
Hello Dave,
I have been able to follow your guide, but I cannot get my Cisco 7911 to register. Do you have have a template for the SEPMAC.cnf.xml file?
Firmware version I’m using is SCCP 9.3.1
May 2nd, 2013 - 06:29
I am trying to do a 7935 and wondering if any of the types that you have on there will work for that or how I can get that to work.
June 6th, 2013 - 16:21
Hi David,
First off, thank you for the freepbx module!
I have only one question: How to configure a softkey for cisco phones in your module?
June 11th, 2013 - 20:44
Is it possible to have device and user mode working with chan sccp? Currently when I try to login as an extension on one of the Cisco’s nothing happens.
Thanks
June 12th, 2013 - 01:27
Update: This is actually working, but does anyway know a way to display the logged on user as a line on the screen?