Koozali.org: home of the SME Server

[Announce]... Er... Loads of Asterisk/SAIL stuff

Offline lightman

  • ****
  • 75
  • +0/-0
[Announce]... Er... Loads of Asterisk/SAIL stuff
« Reply #75 on: July 27, 2007, 09:15:56 PM »
Hi Selintra
Thanks a lot for the info!.

I will take a look at the laimbock rpm but, until i have this little problem with the TDM card i was very happy with your release, very stable btw :) i have 4 servers running it and works like a charm. (none of them has tdm cards, but this new one).

I was thinking about compile it myself but, since my blood pressure tends to go up in direct proportion to the amount of missing dependences, it would be a lot healthy to avoid it  :mrgreen: :mrgreen:

I follow you suggestion but the only way, that I can start automatically in a script (so far) is doing something like this:
Code: [Select]

modprobe wctdm
sleep 3
modprobe wctdm
sleep 1
ztcfg
sleep 1
ztcfg


the first ztcfg gives me error too when loaded inside the script (if I load by hand it works the first time, but not in the script).

so far doing this start perfectly :) hope it doesn't upset my tdm card because is the only way i found to make it work.

the weird thing is that I check if the /dev/zap exists before the first ztcfg and it does, but still gives me error the first time when inside the script.

if you have any idea, or recommendation to avoid this nasty solution I will be glad to test it :)

thanks a lot.
c-u

Lightman.

Offline SARK devs

  • *****
  • 2,806
  • +1/-0
    • http://sarkpbx.com
[Announce]... Er... Loads of Asterisk/SAIL stuff
« Reply #76 on: July 27, 2007, 10:16:43 PM »
Hi Light

OK..  This might work for you.

The way in which our config works is that it sets values in the selintra database for which drivers to probe.  Here's what you can do...

Install our asterisk rpms and the latest (505) sail rpm.

OK now do...

db selintra setprop wctdm status YES

This will turn on the value to load wctdm gracefully through our code.

Now, provided you have set zaptel.conf and zapata.conf correctly for your card, you can start your asterisk image with...

/etc/init.d/asterisk start


That's it.

Best

S

Offline rcasado

  • **
  • 24
  • +0/-0
[Announce]... Er... Loads of Asterisk/SAIL stuff
« Reply #77 on: July 29, 2007, 04:47:43 PM »
Hi Selintra,

I've been looking through your documentation on 1.4 and I was wondering about SLA (shared line appearance) and Sail. I know that 1.4 is at best buggy right now but SLA can be a deal maker / breaker for some small phone systems. Yeah, I know  :?  limited... but some people, no matter how hard you try, just don't get the concept of a parked call. ugh...

Are there any plans to take advantage of this?

Thank you,
Richard

Offline SARK devs

  • *****
  • 2,806
  • +1/-0
    • http://sarkpbx.com
[Announce]... Er... Loads of Asterisk/SAIL stuff
« Reply #78 on: July 29, 2007, 08:17:54 PM »
Hi Richard

Quote
Are there any plans to take advantage of this?


You bet.  It was the reason we went to 1.4 as early as we did.  We just haven't had the bandwidth to do anything with it yet.  In our opinion, key systems are great for small offices and we don't understand why it has taken Digium as long as it has to figure this out for themselves.  Having said that, it doesn't seem to have occurred to many of the phone manufacturers either.  There's really only Snom and Aastra phones which have enough assignable buttons to handle SLA and BLF in tandem.

If you want to get to grips with sla and have some spare bandwidth we'd be happy to support you.  

Best

S

Offline rcasado

  • **
  • 24
  • +0/-0
[Announce]... Er... Loads of Asterisk/SAIL stuff
« Reply #79 on: July 29, 2007, 11:24:08 PM »
Ohhhh... I see myself putting on the crash helmet already :lol:

Most businesses in my area will obtain about 400K to 600K upload speed on their broadband and ping times are usually good, but that's pretty common in the USA. This can be a stumbling block for some larger companies but it may be quite acceptable for smaller firms... Especially since thruput mode in Sail has always been quite good. I've always used Sail in server only mode and have compensated for QoS with a solid router. Personally, I use the DrayTek 2900VG because I've had good luck with them, plus they include a couple of FXO ports. (Not an advertisement, just personal experience... your mileage may vary.)

I clearly understand your point about the phone manufacturers and was thinking the same thing. One unit that looks interesting is the Grandstream GXP2020. (http://www.grandstream.com/gxp2020.html) Yeah, they're economy type phones, no doubt about it, but it may make for a good test unit. I'll order one of these in the next week or two and let you know.

Well... Now that I have the helmet firmly placed on my head...  :lol:
Are there going to be any new releases to version 1.4 / 2.15 in the near future?

As always, Thank You,
Richard

Offline Rezo

  • *
  • 7
  • +0/-0
[Announce]... Er... Loads of Asterisk/SAIL stuff
« Reply #80 on: July 30, 2007, 06:16:34 PM »
Quote from: "selintra"
Hi Light

OK..  This might work for you.

The way in which our config works is that it sets values in the selintra database for which drivers to probe.  Here's what you can do...

Install our asterisk rpms and the latest (505) sail rpm.

OK now do...

db selintra setprop wctdm status YES

This will turn on the value to load wctdm gracefully through our code.

Now, provided you have set zaptel.conf and zapata.conf correctly for your card, you can start your asterisk image with...

/etc/init.d/asterisk start


That's it.

Best

S


Would this work with a Sangoma Remora card?

Based on Sangoma docs my understanding was that I would need to do new builds of Asterisk, zaptel, and sangoma's wanpipe drivers in order to make their card function properly. So far I have done fresh make installs of asterisk 1.2.23, patched zaptel 1.2.19 modules for sangoma, and installed sangoma wanpipe 2.3.4-12 drivers successfully through the Setup script that Sangoma includes. It even automatically builds a zapata.conf and zaptel.conf.

After that I installed Sail -505 which of course replaces those files (I did backup the originals before installing Sail). Anyway, when I run the probe script in the server-manager web interface or selsniff I get

Code: [Select]
Found following card...

01:01.0 Network controller: Sangoma Technologies Corp. A200/Remora FXO/FXS Analog AFT card
Subsystem: NEC Corporation: Unknown device 0500
Flags: bus master, medium devsel, latency 255, IRQ 201
Memory at fdcf0000 (32-bit, non-prefetchable) [size=64K]

Requesting Load of wctdm ...

Loaded wctdm...

Zaptel view of card in /proc/zaptel/1
 Span 1: WRTDM/0 "wrtdm Board 1"
 
    1 WRTDM/0/0 FXSKS (In use)
    2 WRTDM/0/1 FXSKS (In use)
    3 WRTDM/0/2 FXSKS (In use)
    4 WRTDM/0/3 FXSKS (In use)
    5 WRTDM/0/4
    ...
    24 WRTDM/0/23
 
Unknown Card type in slot 1 - ignoring...


After reading the Selintra admin docs on PCI card detection I tried adding the card to the selintra-work db with
Code: [Select]
# db selintra-work set pci:1923:0040:a200:0500 sysdev probe wctdm zzeor EOR

This was based on the output from lspci -vn
Code: [Select]
# lspci -vn

01:01.0 Class 0280: 1923:0040
        Subsystem: a200:0500
        Flags: bus master, medium devsel, latency 5, IRQ 201
        Memory at fdcf0000 (32-bit, non-prefetchable) [size=64K]


I also tried substituting various module names for 'wctdm' like wcfxo, wct4xxp, wanpipe, zaptel. As you can see I have no idea what the heck I'm doing so any advice would be greatly appreciated.  :)

I've read postings that mention these cards before but have failed to find documentation for a successful install. Just blurbs like "I cant make it work. NM I got it, k thanks!" If I finally get it to work the least I'd like to do is post a log/journal of my complete install from start to finish. Preferably I will digest what had to be done and then create some kind of documentation or script to share with the community. There are a lot of folks using third party pci cards like Rhino and Sangoma.

Offline SARK devs

  • *****
  • 2,806
  • +1/-0
    • http://sarkpbx.com
[Announce]... Er... Loads of Asterisk/SAIL stuff
« Reply #81 on: July 30, 2007, 07:22:35 PM »
Hi Rezo,

I'm afraid that SAIL doesn't support Sangoma cards.  Right now we just don't have enough spare capacity to create another version of the asterisk code (which we would almost certainly have to do for Sangoma).  If enough people ask us to support it then we will, but up  to now you are the only person who's asked.

Kind Regards

Selintra

Offline Rezo

  • *
  • 7
  • +0/-0
[Announce]... Er... Loads of Asterisk/SAIL stuff
« Reply #82 on: July 30, 2007, 08:41:39 PM »
Well I already compiled Asterisk and the Sangoma patched zaptel drivers so that Asterisk is successfully communicating with the card on SME Server 7.2. For some reason I thought that would satisfy the requirement of having to install smeserver-asterisk and smeserver-asterisk-zappri-MPP rpms. I can launch the Asterisk cli and see the active zap channels.

I may have misunderstood what your package provides but is SAIL not simply a "frontend" so to speak for Asterisk. Simplifying the process of creating trunks, extensions, greetings, etc. ? Would it actually require a major working of SAIL to make it work with my fresh install of Asterisk or is there something different about smeserver-asterisk-xxx.rpm from a manual compile of asterisk?

I guess I can look into using FreePBX but since SAIL seemed like it was targeted for users of SME I figured I would try it out first.

Offline SARK devs

  • *****
  • 2,806
  • +1/-0
    • http://sarkpbx.com
[Announce]... Er... Loads of Asterisk/SAIL stuff
« Reply #83 on: July 30, 2007, 11:10:55 PM »
Hi Rezo

How good is your Perl?

Best

S

Offline Rezo

  • *
  • 7
  • +0/-0
[Announce]... Er... Loads of Asterisk/SAIL stuff
« Reply #84 on: July 31, 2007, 01:06:06 AM »
hi selintra,

that question makes it sound like an evil grin should have accompanied it  :wink:

my perl skills are rudimentary at best but i have dealt with scripting in various formats for quite some time. I was not out to reinvent the wheel and see the reason for little interest in it for you if your customer base doesn't need the support either. I was in the hopes that it would not be too difficult to make SAIL control a zaptel device that asterisk was already recognizing. I did find a post where someone else said they got their A200 card to work with SAIL. The post seemed to indicate their problems were solved once they compiled the patched drivers (which ive already done) and then changed the info that identifies the pci card. I think this is where I am getting stuck??

Since you replied to this thread you might remember it http://forums.contribs.org/index.php?topic=36464.0

note: that makes at least two people who inquired about compatability with the sangoma a200?? :)

Offline SARK devs

  • *****
  • 2,806
  • +1/-0
    • http://sarkpbx.com
[Announce]... Er... Loads of Asterisk/SAIL stuff
« Reply #85 on: July 31, 2007, 01:38:47 AM »
OK good.

Our Perl skills are, quite frankly, crap so you may find the code a little tortuous.  As you've guessed, you've done most of the hard work already but you will need to hack the SAIL code a little.  Also, it's difficult for us to do much more than point you in the right direction because we don't have a Sangoma card here to practice on.  

The module you need to hack is called sarkPCI and you will find it in /etc/e-smith/web/functions/.  PCI does the automatic recognition and configuration of the various cards we support.   Let's start with the error message you are getting; -  it is generated in a subroutine called genHandle which you will find at or near line 928 (depending upon which version of SAIL you have).  genHandle reads through the /proc/zaptel/ entries examining the loaded cards and then handing off to the correct routine(s) to create the zapata and zaptel entries necessary for asterisk to recognise the cards.  It recognises the cards by simple regex pattern matching.  Your card has been processed as a result of your request for SAIL to modprobe wctdm (when you defined your card type to the database).   Unfortunately,  PCI doesn't recognise the 'WRTDM'  signature (look at or near line 1000).  So, you'll need to make a small mod in this routine to recognise your card.  Once you've done that you will need to create a "builder" routine to store your card data into the database and to build the necessary trunks/extensions for it.  Most of this is already done for you in various subroutines within PCI but you will have to decide which ones to call and when.  The "builder" routine which comes closest to doing what you want is called 'tdmHandle' (it builds the entries for regular TDM boards).  You will need to copy and hack it to create a 'sanHandle', or whatever you want to call it.  To be honest, this stuff is harder to explain than it is to do.  If you are familiar with scripting languages then you shouldn't have too much trouble with PCI.

Happy hacking and do let us know how you get on.  Also if there's anything you don't understand or want help on then drop us a line here.

Have fun

S

Offline Rezo

  • *
  • 7
  • +0/-0
[Announce]... Er... Loads of Asterisk/SAIL stuff
« Reply #86 on: July 31, 2007, 10:00:29 AM »
Alright pointing me in the right direction is definately a good start. Before I get in over my head on this let me just be clear on the following things...

Is it actually necessary for me to rely on the sarkPCI script to detect my card automagically? I understand that it is responsible for detecting what kind of card I have, how many and what kind of channels, etc.; then I guess later this would lead to the generation of a set of zaptel.conf and
zapata.conf files for asterisk and create certain records in the SAIL databases.

The Sangoma driver package includes a utility that will auto-generate a proper set of zapata.conf and zaptel.conf files so there is a lot of valuable info provided with that. Also lets assume I already know all the tidbits of information about card (like which driver modules need to be loaded and in what order, which pci slot its in, how many fxo and fxs channels there are, stuff like that) would it be possible for me to create the necessary DB entries by hand as well as the asterisk conf files?

I took a brief look at the sarkPCI script and the tdmHandle routine but I'm not exactly sure what some of the variables are suppose to stand for. If I do need to rely on sarkPCI can I just create a feed the script what it needs to know with a routine that already has what it needs to know hardset with something like

Code: [Select]

sangHandle
{
 $chan=4
 $signal=fxo
 $DB->set_prop('PCI-1','channel4','fxo')
 $DB->set_prop('blah', 'foo','bar')
}


I know there would be a lot more to it than that but I tend to organize my thoughts better with examples. If I knew what was suppose to result from the run of the routine it would make understanding the script much easier. I'm a triple threat when it comes to this because I'm new to SME, Asterisk,  and SQL so I'm probably missing the knowledge that would make these things standout.

Offline SARK devs

  • *****
  • 2,806
  • +1/-0
    • http://sarkpbx.com
[Announce]... Er... Loads of Asterisk/SAIL stuff
« Reply #87 on: July 31, 2007, 11:08:45 AM »
Hi Rezo,

As long as you've taken a copy of PCI before you start (and even if you don't), you'll be fine. The worst thing that can happen is that you'll break it.  No big deal. :-) .   Let's quickly examine what it does and then attempt to answer your questions...

The main program starts off in a module called modProbe which is actioned as a result of the user hitting the "Probe" button.  It issues an lspci and then sorts through the output looking for cards it recognises.  Every time it finds one, it issues the correct modprobe to load the driver.  You don't need to do anything with these routines, you just need to load the DB record with the card fingerprint and the driver name (which you've already done).  So... for you wctdm will be loaded.

Once this phase has finished, the program waits for udev to make the /dev and /proc trees.  Then it executes genHandle to parse /proc/zaptel looking at each individual card and building the file entries to generate the zaptel and zapata entries.  It also builds the trunk and/or extension entries to complement the zap entries.  

Now, as to you questions and example.  Yes, you can absolutely hand create the entries in the database with setprop and bypass PCI altogether.  You might also take the output from the Sangoma generators and create a little batch routine to plug them into the database (have a look at /etc/selintra/selmerge as an example).  You don't have to do it in PCI.  The whole point of the Selintra DB is that many programs can add to it independently.  Alternatively, as a half-way house, you can create a simple sangHandle in the way you've shown.

We'd like to encourage you to have a go at going the whole hog (in whatever steps you want to take) so that we can incorporate what you've done into the main code.  It doesn't matter how many iterative steps it takes and how you do it (as long as you aren't up against a time line from a customer).

In short, if you have the time, then we'd encourage you to give it a go.  The quality of your questions shows that you'll be fine.  If not then there's no harm done and we will get 'round to it when a paying customer shouts loud enough. :-)

Best

S

Offline lightman

  • ****
  • 75
  • +0/-0
[Announce]... Er... Loads of Asterisk/SAIL stuff
« Reply #88 on: August 01, 2007, 03:16:04 AM »
Quote from: "selintra"
Hi Light

OK..  This might work for you.

The way in which our config works is that it sets values in the selintra database for which drivers to probe.  Here's what you can do...

Install our asterisk rpms and the latest (505) sail rpm.

OK now do...

db selintra setprop wctdm status YES

This will turn on the value to load wctdm gracefully through our code.

Now, provided you have set zaptel.conf and zapata.conf correctly for your card, you can start your asterisk image with...

/etc/init.d/asterisk start

That's it.
Best
S


Hi Selintra, Thanks for answer!
I was quite close to that, since I read the start script asterisk in init.d and I  try stuff like: db selintra set wctdm status enabled and yes but no sucess.

I was close, but not enough :) hehe.

I'll do that, the script seems quite complete and a lot better than what I have done so far :D

let U know if it worked
thanks a lot!!.
c-u
Light.

Offline Rezo

  • *
  • 7
  • +0/-0
[Announce]... Er... Loads of Asterisk/SAIL stuff
« Reply #89 on: August 01, 2007, 09:18:53 PM »
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. :lol:

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?