Monday, 10 March 2008

UK caller ID, POTS and pains

I've recently been working on a project that has opened my eyes to the (apparent) simplicity, value and benefits running your own VoIP-enabled PBX. For my own business, doing this would provide some good functionality for very little money. Apart from managing phone extensions, low-cost call routing and the rest of the usual PBX stuff, this solution could allow access to the phone lines while we're not in the office, via a soft-phone or even my Nokia E61i with its built-in SIP client. Acquiring the skills and having a test facility will also be very useful.

For the PBX I've built an old DeskPro with Centos 5.1 and Asterisk 1.4.18. To connect to the PSTN and local faxes I have an ATCOM AX-400P with two FXO, two FXS modules and an X100P.com SE with one FXO. Both PCI cards are recognised by the standard Zaptel drivers, as a "Digium Wildcard TDM400P" and a "Digium Wildcard X100P" respectively.

The install of Asterisk on this hardware is well documented on the Web and no significant problems were encountered. From bare tin, the demo and echo-test applications were up and running in only a couple of hours. A little bit of jiggery-pokery had to be done to ensure the two analogue cards were recognised in the same order are each restart (by ordering the loading of modules in "/etc/sysconfig/zaptel") but other than that things went very smoothly.

However, I noticed immediately that CallerID was not being recognised on any of the lines and hangups were not being noticed properly. I'd read about this particularly UK problem on a number of forums and they'd all suggested easy remedies. None of these problems had been encountered on the project as there was no POTS equipment. When I came to make my own configuration I found things were a little less straightforward.

Poring over the debug logs for many more hours and trawling the Internet guided me to a working solution. There now follows a summary of the UK-specific config that eventually got things working reliably. These settings are required in addition to or in place of the default configs. Removing any one of these settings breaks either the CallerID or hangup detection, or both!
  • In "/etc/modprobe.conf", added...
        option wctdm opermode=UK
  • In "/etc/zaptel.conf"...
        defaultzone=uk
        loadzone=uk
        fxsks=1,2,5
        fxoks=3,4
  • In "/etc/asterisk/zapata.conf"...
        [global]
        cidsignalling=v23
        cidstart=polarity
        sendcalleridafter=2 ; Setting this to 0 works too (but only     some of the time!)
        [channels]
        context=incoming
        usecallerid=yes
        hidecallerid=no
        callerid=asreceived
        restrictcid=no
        callprogress=yes
        progzone=uk
        answeronpolarityswitch=yes
        hanguponpolarityswitch=yes
        signalling=fxs_ks
        immediate=no
        channel => 1,2,5
  • In "/etc/asterisk/extensions.conf", to see that things are working...
        exten => s,1,Verbose(CallerID= ${CALLERID(all)})
With this done, everything seems to be running well. Now I can develop at my leisure a mad IVR script to fox all those call-centres trying to sell me cheaper electricity.

No comments :