Home Forum Developers IP0x Asterisk 1.8 for switchfin

JRPassphrase Registration Control

In order to register on this site, you must first submit the passphrase below.

TODO list for each hardware target can be found as sticky topic in the corresponding forum


kelchy
useravatar
User Info

Asterisk 1.8 for switchfin

hi guys, i just emailed dimitar a patch to compile asterisk 1.8 for switchfin.

to avoid having to debug unrelated issues, i have chosen to do this on revision 500.

so far, i have eliminated a SIGBUS issue in memory allocation, enabling me to run asterisk 1.8 steadily (this is without any sip registrations and no calls)

please take note, it's still in the infancy stage and unusable.
any help will be appreciated.

let's keep notes using this thread, thanks!


Administrator has disabled public posting
kelchy
useravatar
User Info

Re: Asterisk 1.8 for switchfin

just an update, i just made my first dahdi call using asterisk 1.8 on switchfin.
still rock solid


Administrator has disabled public posting
Chewi
useravatar
User Info

Re: Asterisk 1.8 for switchfin

Fantastic. I am more than willing to help so let me know if there's anything I can do. Since you used revision 500, what I could do is merge your makefile changes with the latest in trunk and stick it in a branch of my github mirror for the time being.

https://github.com/HaydenTech/switchfin


Administrator has disabled public posting
admin
useravatar
User Info

Re: Asterisk 1.8 for switchfin

Hi Kelvin,

I have imported your Astfin credentials to Switchfin so you will be able to comit your patch directly in Switchfin.

In case you feel we better test Asterisk 1.8 at revision 500 please feel free to make a test branch.

For me it is OK to get the patch in the trunk in case Asterisk 1.8 is optional and 1.4 is the default telephony engine:)

Thank you!
Dimitar


Administrator has disabled public posting
kelchy
useravatar
User Info

Re: Asterisk 1.8 for switchfin

just uploaded 1.8 patch to trunk. please test stability, as for my own testing, my setup is already on its 2nd week without any hitch.


Administrator has disabled public posting
Chewi
useravatar
User Info

Re: Asterisk 1.8 for switchfin

I may briefly give it a try but the bad news is I've decided to give Yate a go instead as uClinux is an officially supported platform. The good news is I will add it as a package to Switchfin. smile Just waiting for funding at the moment but currently, things are looking very promising.


Administrator has disabled public posting
kelchy
useravatar
User Info

Re: Asterisk 1.8 for switchfin

slightly OT, but chewi, based on your experience what would you say to an asterisk aficionado to move him/her over to YATE?smile


Administrator has disabled public posting
Chewi
useravatar
User Info

Re: Asterisk 1.8 for switchfin

I haven't actually tried Yate yet but I've read about Asterisk's fundamental flaws, such as deadlocks. Deadlocks aren't a big issue for the small scale stuff that these boxes are likely to deal with but having worked with it for a few years, I know there are plenty of other oddities and inconsistencies that seem to stem from the fact that Asterisk had to grow very fast without the time for much refactoring or cleaning up. It has been improving but what it's needed more than anything is a rewrite and that's why FreeSWITCH, Yate, and others were created. This is a good read.

I had the pleasure of meeting Mark Spencer in 2005 (that's how I got into Asterisk) and actually got very drunk with him. big_smile He was a great guy and was passionate about what he was doing but I suspect the pressures of the business have meant that breaking Asterisk free of its legacy has simply not been a viable option. Real community projects are much more flexible in this regard.

I initially considered FreeSWITCH but it quickly became clear that this was never going to run under uClinux. It's just not been written with this in mind. Neither has Asterisk for that matter and I find the fact that fork() keeps reappearing in the code quite worrying. The manner in which these instances of fork() are then blindly replaced with vfork() is equally worrying. It seems unlikely that memory fragmentation has even been considered. Frankly, I'm surprised that it works at all and that isn't something you want to be saying when you need it to be rock solid.

More recently, I checked out the other options. Unfortunately, CallWeaver, a fork of Asterisk 1.2, didn't live for very long. That pretty much left Yate. I was about to say how great it is that it officially supports uClinux but having looked at their site again, I now realise I was wrong about this! sad What it actually says is...

It is embeddable - Yate perfoms just as well on ARM-based machines or uclibc-based Linux implementations.
This obviously isn't the same thing. I misread it because voip-info.org actually says it does support uClinux. I've checked the code and evidently it doesn't because there a few unconditional instances of fork(). The good news is that in all but one optional case, they are followed by exec() so it should be safe to replace these with vfork().

This leaves the question of memory fragmentation. I'll have to ask the Yate developers if they believe this might be an issue. Other than that, we'll just have to try it and see.

This is a long way from the official support I thought was there and it may turn out that Asterisk is more suitable but I still think this is well worth trying. sipgate (my SIP provider) is powered by Yate so it's got some strong production use behind it.


Administrator has disabled public posting
admin
useravatar
User Info

Re: Asterisk 1.8 for switchfin

Hi Guys,

Thank you Kelvin for the patch!!
Do you already get some feelings about the 1.8 performance (CPU/Memory)?

We had a discussion in the past giving a try to Yate.
Due to lack of man power it was not started.
I am interested to spend some time on Yate as well
but can not afford spending months right now.

It is very nice that we are getting options for the
telephony engine in Switchfin. smile

Cheers!
Dimitar


Administrator has disabled public posting
kelchy
useravatar
User Info

Re: Asterisk 1.8 for switchfin

I am currently more interested on stability/functionality rather than performance, still battling with these 2 issues, somebody out there might have a fix.
1.way back 2003 there was this discussion http://lists.digium.com/pipermail/aster … 08269.html
there has to be a way for an fxo to detect whether there is a line plugged into it, or if the line has dialtone or not. This is a very very old issue, and i am not aware of any way to do it, are there any?
2.http://forums.digium.com/viewtopic.php?t=73048
setting modems and fax rate are being ignored by res_fax / res_fax_spandsp. there is no way a blackfin can do 14400 with the current floating point implementation (i already checked with steve) so i am currently creating a patch which i am planning to submit to digium. https://issues.asterisk.org/jira/browse/ASTERISK-16409


Administrator has disabled public posting
kelchy
useravatar
User Info

Re: Asterisk 1.8 for switchfin

Hi Chewi,
appreciate the long story, i believe we share the same sentiment about asterisk. I also thought of trying other engines, in fact, I have been a staunch supporter of kamailio. I like mix and matching, kamailio goes along smoothly with asterisk. (we got kamailio's innovation award last year) http://by-miconda.blogspot.com/2011/02/ … wards.html
http://www.nextixsystems.com/kamailio-2 … nications/
http://www.nextixsystems.com/nextix-win … on-awards/

well, kamailio is a completely different animal compared to asterisk and i would say has a strong production use behind it also as i know a lot of service providers who use openser/kamailio, I am still in search of a viable competitor to asterisk. I asked about yate because i think it has great potential, maybe if we can port it to blackfin, we'll have a more flexible/stable solution.

Chewi wrote:

I haven't actually tried Yate yet but I've read about Asterisk's fundamental flaws, such as deadlocks. Deadlocks aren't a big issue for the small scale stuff that these boxes are likely to deal with but having worked with it for a few years, I know there are plenty of other oddities and inconsistencies that seem to stem from the fact that Asterisk had to grow very fast without the time for much refactoring or cleaning up. It has been improving but what it's needed more than anything is a rewrite and that's why FreeSWITCH, Yate, and others were created. This is a good read.

I had the pleasure of meeting Mark Spencer in 2005 (that's how I got into Asterisk) and actually got very drunk with him. big_smile He was a great guy and was passionate about what he was doing but I suspect the pressures of the business have meant that breaking Asterisk free of its legacy has simply not been a viable option. Real community projects are much more flexible in this regard.

I initially considered FreeSWITCH but it quickly became clear that this was never going to run under uClinux. It's just not been written with this in mind. Neither has Asterisk for that matter and I find the fact that fork() keeps reappearing in the code quite worrying. The manner in which these instances of fork() are then blindly replaced with vfork() is equally worrying. It seems unlikely that memory fragmentation has even been considered. Frankly, I'm surprised that it works at all and that isn't something you want to be saying when you need it to be rock solid.

More recently, I checked out the other options. Unfortunately, CallWeaver, a fork of Asterisk 1.2, didn't live for very long. That pretty much left Yate. I was about to say how great it is that it officially supports uClinux but having looked at their site again, I now realise I was wrong about this! sad What it actually says is...

It is embeddable - Yate perfoms just as well on ARM-based machines or uclibc-based Linux implementations.
This obviously isn't the same thing. I misread it because voip-info.org actually says it does support uClinux. I've checked the code and evidently it doesn't because there a few unconditional instances of fork(). The good news is that in all but one optional case, they are followed by exec() so it should be safe to replace these with vfork().

This leaves the question of memory fragmentation. I'll have to ask the Yate developers if they believe this might be an issue. Other than that, we'll just have to try it and see.

This is a long way from the official support I thought was there and it may turn out that Asterisk is more suitable but I still think this is well worth trying. sipgate (my SIP provider) is powered by Yate so it's got some strong production use behind it.


Administrator has disabled public posting
admin
useravatar
User Info

Re: Asterisk 1.8 for switchfin

Hi Guys,

Few telephony engines have been mentioned in this thread so I decided to clarify.

Yate is an PBX system similar to Asterisk and is probably good candidate to be put on IP0x, PR1, BR4 Appliance targets

OpenSER from the other hand is a SIP proxy server.
So it deals only with signaling no media ever cross the OpenSER server, so no codec transcoding , no protocol translations ,no IVR, Queuing, speech recognition, etc.
I don't see direct application of OpenSER on our hardware other then just utilizing its embedded CPU power.
Please correct me if I am wrong.

Best Regards
Dimitar


Administrator has disabled public posting
Chewi
useravatar
User Info

Re: Asterisk 1.8 for switchfin

I've spoken to the Yate guys and although no one actually said they'd run it on uClinux themselves, they'd heard of other people doing it and that replacing fork() with vfork() would probably be the only thing I'd need to do. smile


Administrator has disabled public posting
kelchy
useravatar
User Info

Re: Asterisk 1.8 for switchfin

Hi Dimitar,

yes i agree, there is actually no advantage of using openser/kamailio on
blackfin (other than creating a supernode of clustered embedded opensers,
the idea which i was toying with years ago) what we need is an alternative
to asterisk, a PBX engine with all the bling-blings... like yate

admin wrote:

Hi Guys,

Few telephony engines have been mentioned in this thread so I decided to clarify.

Yate is an PBX system similar to Asterisk and is probably good candidate to be put on IP0x, PR1, BR4 Appliance targets

OpenSER from the other hand is a SIP proxy server.
So it deals only with signaling no media ever cross the OpenSER server, so no codec transcoding , no protocol translations ,no IVR, Queuing, speech recognition, etc.
I don't see direct application of OpenSER on our hardware other then just utilizing its embedded CPU power.
Please correct me if I am wrong.

Best Regards
Dimitar


Administrator has disabled public posting
kelchy
useravatar
User Info

Re: Asterisk 1.8 for switchfin

i wonder if yate's dsp routines were written in pure fixed point?

Chewi wrote:

I've spoken to the Yate guys and although no one actually said they'd run it on uClinux themselves, they'd heard of other people doing it and that replacing fork() with vfork() would probably be the only thing I'd need to do. smile


Administrator has disabled public posting
admin
useravatar
User Info

Re: Asterisk 1.8 for switchfin

Hi Kelvin,

Writing DSP code is a tedious task.
Writing fixed point DSP code is even more tricky -  issues like quantization noise , scaling, etc.

Now a days most of the open source code is targeting x86 (and similar) platforms with floating point support and people just use it for the DSP code as it is simpler. 

Please don't expect to find fixed point open source DSP code unless it is specially intended for the fixed point hardware.

I don't expect Yate to differ in this respect.
I just checked it quickly and for what I have checked
- It uses external libraries libgsm, libspeex (floating point)
- It uses matched filters for tone detection which uses double entities (floating point)
- The DTMF detection and generation is floating point too.

So I have not spend time to study in details but I would say (based on my quick 10 min research) that Asterisk is even a bit more friendly in this respect. Asterisk also uses some external libraries but it has its own gsm/lpc implementation.
For Blackfin we have fixed point tone detection in Asterisk and G729 (which probably we can reuse in Yate).

I would be interested in Yate if it appears to be more stable then Asterisk
and performs quicker (on a protocol level) which is important for the PR1 Appliance box.
(And all this apart of the DSP code)   

Best Regards
Dimitar


Administrator has disabled public posting
Chewi
useravatar
User Info

Re: Asterisk 1.8 for switchfin

Before I ask them about this, can you clarify how SpanDSP fits into the picture? Is it being used to do all or just some of the fixed point in Asterisk? I haven't actually installed SpanDSP on my box and it's been working fine so far, though I'm only handling one call at a time.

And what features actually use DSP? SpanDSP is already used by Yate for FAX. I gather this is the case for Asterisk too. You mentioned tone detection. Is caller ID another one?


Administrator has disabled public posting
admin
useravatar
User Info

Re: Asterisk 1.8 for switchfin

Hi James,

We currently use SpanDSP for two things:
- Caller ID detection
- faxing

The Caller ID detection involves FSK demodulation.
Caller ID in SpanDSP is fixed point.
Asterisk has its own floating point implementation which is supposed to be few times slower than the Span DSP one.
By default in the Switchfin building GUI we select SpanDSP based Caller ID

Fax modems in SpanDSP are floating point. You can hardly get one fax channel using 9600 fax speed on Blackfin.
Previous year I have spent some time on faxing. I realized that I can not afford that much time to rewrite the SpanDSP
fax modems in fixed point. At that time Zoiper opened their fax engine Attrafax which was simpler from algorithmic point
of view and the code was cleaner (Span DSP has more complex/advanced algos).
I have rewritten Attrafax in fixed point and now it is part of Switchfin.
It probably can achieve few channels on BF537 600 MHz. Still it may have some glitches however.

- DTMF uses Goertzel filters which we have in fixed point for Blackfin. This is included in our Asterisk patch.

- Astreisk has its own GSM and LPC10 codecs implemented in fixed point. That's why they run pretty fast on Blackfin.

- All the rest DSP either built in Asterisk or via  external libraries libspeex, iLBC, g729, etc is floating point and is slow.

Based on very quick browsing I have feelings that Yate will have slower DSP then Asterisk.

Best Regards
Dimitar


Administrator has disabled public posting
kelchy
useravatar
User Info

Re: Asterisk 1.8 for switchfin

there's a new build option for asterisk 1.8

<member name="INTEGER_CALLERID" displayname="Use the (less accurate) integer-based method for decoding FSK tones (for embedded systems)">

one of the reasons why i was pushed to create the 1.8 patch


Administrator has disabled public posting
kelchy
useravatar
User Info

Re: Asterisk 1.8 for switchfin

FYI, i made a patch to wcfxs.c to detect and flag fxo ports which does not have a pstn line plugged in.
How should i upload this to trunk? as a patch? or as a whole wcfxs.c? it just involves 2 additional lines.
I need you guys to test this also. i made some tests here on asterisk 1.8 and it works, outbound calls do not go to those ports which does not have a pstn line plugged in.
If a port is flagged and the pstn line is plugged back in, flag gets cleared.


Administrator has disabled public posting
admin
useravatar
User Info

Re: Asterisk 1.8 for switchfin

Hi Kelvin,

Well in my opinion the best is initially to be added as patch.
Please modify the asterisk.mk to include this patch.

Later on we may decide to integrate it better.

Thank you
Dimitar


Administrator has disabled public posting
kelchy
useravatar
User Info

Re: Asterisk 1.8 for switchfin

committed revision 633

seem cleaner changing it directly


Administrator has disabled public posting
Chewi
useravatar
User Info

Re: Asterisk 1.8 for switchfin

Quick update. I've created a draft package for Yate and after a couple of patches, it builds with Speex support but no GSM support yet (need libgsm). Haven't tried running it yet. Need to work out how to configure it first. smile


Administrator has disabled public posting
admin
useravatar
User Info

Re: Asterisk 1.8 for switchfin

Hi James,

Oh good!
Keep up the good work smile

Best Regards
Dimitar Penev


Administrator has disabled public posting
kelchy
useravatar
User Info

Re: Asterisk 1.8 for switchfin

ported attrafax fixed point to asterisk 1.8 (partially)
received my first t.30 fax on 1.8, i'll keep you guys posted
on any progress


Administrator has disabled public posting
Albi90
useravatar
User Info

Re: Asterisk 1.8 for switchfin

Oh awesome work Kelchy


Administrator has disabled public posting
nunne
useravatar
User Info

Re: Asterisk 1.8 for switchfin

excellent work guys!

i will start looking into this and perhaps getting dahdi to talk isdn-bri and see if that will work smoothly. so in the future you can drop misdn + misdn-user (for nt-mode).

I dont have any more free time this week, but will look into it next week.


Administrator has disabled public posting
sam
useravatar
User Info

Re: Asterisk 1.8 for switchfin

Hi,
I made some modifications to be able to compile asterisk 1.8.4 with Google Voice support. (Added Iksemel package)
I haven't tested it yet but I was able to compile and create an uImage.
Here you can find the modifications applied to revision 660:
http://dl.free.fr/nXphK3gMf
If someone want to try it.

BR,
Sam


Administrator has disabled public posting
admin
useravatar
User Info

Re: Asterisk 1.8 for switchfin

Hi Sam,

Sounds pretty interesting smile

Probably we can put this in Switchfin already?

Best Regards
Dimitar


Administrator has disabled public posting
sam
useravatar
User Info

Re: Asterisk 1.8 for switchfin

Sure you can.
I don't have write access to the svn so I had to publish it this way.
I don't have my IP02 nearby so I can't test it but I will ASAP and get back to you.
Feel free to test and give me some feedbacks


Administrator has disabled public posting

Board Info

Board Stats:   Total Users: 2587  Total Topics: 299  Total Polls: 1  Total Posts: 1727  Dormant
User Info:   Newest User :  user2553   Members Online: 0   Guests Online: 180
Online  There are no members online
Topic
New
Locked
Topic
New
Locked
Sticky
Active
New/Active
Sticky
Active
New/Active
New/Closed
New Sticky
Closed/Active
New/Locked
New Sticky
Locked/Active
Active/Sticky
Sticky/Locked
Sticky Active Locked
Active/Sticky
Sticky/Locked
Sticky/Active/Locked