At the end of all this my goal would be to go whole hog so that you can add Sangoma to your tested and working list. The 'approved list' will probably have to wait though.

I did go over the probelines section of sarkPCI and figured out what was happening at that stage. While playing around in the shell console I discovered that wctdm is not a module that is needed for the Sangoma cards. The correct driver to modprobe is
wanpipe.ko which will then insmod modules
sdladrv.ko,
crc-ccitt.ko,
zaptel.ko,
wanrouter.ko,
wanpipe.ko in that order. If you have the optional hardware cancellation as I do you also need to insmod
wanec.ko. After wanpipe and the other modules have been loaded you then have to execute a utility that is a part of the Sangoma driver package called `
wanconfig`. The full command is `
/usr/sbin/wanconfig card wanpipe1 up`. wanpipe1 is a config file created by the Sangoma setup script and represents your first span but I'm not sure when you would need to call up wanpipe2, wanpipe3, etc . It might be for when there is more than one pci card.. but that doesnt apply to me with the A200 since additional cards are bridged to the first one. At this stage
/proc/zaptel and
/dev/zap should be up. A script `
/usr/sbin/wanrouter` can do all of the above steps with one command. It can optionally be set to run
ztcfg -vvvv automatically at the end of the script.
In a previous post I pasted the output of the sarkPCI script when it would probe for telephony cards. I had defined it with the property of being a wctdm device with my addition of pci identifiers to selintra-work. What was a little confusing is that it appeared wctdm was bringing the card to life, but actually it wasn't. The
/proc/zaptel/ and
/dev/zap trees were already present before sarkPCI ran because I had already loaded the sangoma drivers while in the console using `
wanrouter start`. This realization led me to playing with modprobe a bit to see just when the zaptel tree would appear. The proper sequence was what I outlined above `
modprobe wanpipe; modprobe wanec; wanconfig card wanpipe1 up` I also noticed that if you modprobe wanpipe first and then modprobe wctdm afterwards the second modprobe will return some kind of error. It doesn't seem to harm anything if you load both but I think it is better to do wctdm.ko first in case someone's system actually has both a TDM card as well as a Sangoma card. Seems as though wctdm tries to do something with the sangoma card if its already initialized because wctdm is seeing it at that point as a zaptel device of some kind.
Another thing of interest is that 24 channels are listed when you `
cat /proc/zaptel/1` even though my card only has four available channels (presently 2 FXO modules). The A200 card can have extra daughterboards bridged to the primary one. Each board can hold 2 modules, either FXO or FXS. Each FXO or FXS modules provides two channels. The A200 can be maxed out to 24 channels with the addition of 5 daughterboards and 10 fxo/fxs modules. This probably makes the A200 similar to a TDM2400P rather than a TDM400P.
In review of all this information, perhaps some of it superfluous, and your valuable and much appreciated guidance I will try mucking about in sarkPCI with what looks like in a the least some additions to sub probelines, sub genhandle, and a sub sangHandle. Maybe calling it wrtdmHandle would be better?
My main main puzzler, at the moment, is to make a sangHandle routine so that sarkPCI will do the work of passing off the needed information to the rest of your application. What info do I actually need to supply in this routine? I can see that things are being added to the database but I'm not certain what information is being added. I gave a previous example in hopes I could get a little more detail of what needs to happen there. What should the entries I need to make to the database(s) be and how would they be structured?