Home Forum Developers General discussions Is porting Asterisk + modules a lot of work?

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


Gilles
useravatar
User Info

Is porting Asterisk + modules a lot of work?

Hello

I'm not comfortable with staying with an old release of Asterisk (BAPS = 1.4.20; Switchfin = 1.6.x?), and would like to know how much work is involved to port Asterisk and its modules to Blackfin + uClinux.

Considering the Atcom doesn't support fork() and virtual memory, I assume it's much more involved than mindlessly replacing all occurences of fork() with vfork() without thinking about the ripple effect, as well as preventing memory fragmentation, etc.

Thank you.


Administrator has disabled public posting
Chewi
useravatar
User Info

Re: Is porting Asterisk + modules a lot of work?

Trunk now has Asterisk 1.8, which I gather works at least as well as 1.6. I haven't had a chance to try it yet. I'm not sure what you're asking though. Do you mean bring the latest version (10.0.0) to Switchfin?

From what I've seen, it largely has been a case of just replacing fork with vfork and hoping that fragmentation won't be an issue.


Administrator has disabled public posting
Gilles
useravatar
User Info

Re: Is porting Asterisk + modules a lot of work?

Thanks for the info. 1.8 is good enough. I just wanted to know
1. what the latest version was for the Atcom, before checking what features were added since 1.4.20 that would justify upgrading
2. generally speaking, what changes are made to Asterisk so it runs on the Blackfin + uClinux.

"hoping that fragmentation won't be an issue." : sounds scary :-)


Administrator has disabled public posting
Chewi
useravatar
User Info

Re: Is porting Asterisk + modules a lot of work?

Yeah, I didn't say it was a good situation! I'm strongly considering Yate instead as it has been designed with embedded use in mind but even this needs to be patched for MMU-less systems.


Administrator has disabled public posting
Gilles
useravatar
User Info

Re: Is porting Asterisk + modules a lot of work?

Good idea. Have you checked with the Yate people about porting it to the Atcom?

I read that there's no way Freeswitch would run on that platform.


Administrator has disabled public posting
Chewi
useravatar
User Info

Re: Is porting Asterisk + modules a lot of work?

I asked and they confirmed it should work on uClinux, albeit with a small patch. I created a preliminary package for Switchfin and managed to build it fairly easily. I can't remember if I tried running it or not. I need to learn how to configure it and then test it out but funding for my company has been delayed so I've diverted my attention to other things for now.


Administrator has disabled public posting
Gilles
useravatar
User Info

Re: Is porting Asterisk + modules a lot of work?

I can try if you can provide whatever infos is necessary to go from the standard source, apply the patch, cross-compile, install/run Yate on the Atcom.


Administrator has disabled public posting
Chewi
useravatar
User Info

Re: Is porting Asterisk + modules a lot of work?

I have just pushed the Yate package to my GitHub branch. Everything you need is in that one commit so just apply the patch to your existing checkout.


Administrator has disabled public posting
Gilles
useravatar
User Info

Re: Is porting Asterisk + modules a lot of work?

Thanks. I'll download the original source code from the Yate site, and figure out how to download and apply those five patches before cross-compiling.


Administrator has disabled public posting
Chewi
useravatar
User Info

Re: Is porting Asterisk + modules a lot of work?

I think you misunderstood. Apply this whole commit as one patch against Switchfin. Here it is in its raw form. Then do "make menuconfig" to add Yate to your firmware and build away. smile


Administrator has disabled public posting
Gilles
useravatar
User Info

Re: Is porting Asterisk + modules a lot of work?

It's just that I never used Git/GitHub, so have no idea how to download those changes, but I'll read up and learn something new.


Administrator has disabled public posting
Chewi
useravatar
User Info

Re: Is porting Asterisk + modules a lot of work?

It's very well worth learning but I'll make this easy for you. smile Just switch to your Switchfin Subversion checkout directory and type...

Code:

wget -O - https://github.com/HaydenTech/switchfin/commit/558244ca9659b8b0223174300df0432ad6ab1737.diff | patch -p1


Administrator has disabled public posting
Gilles
useravatar
User Info

Re: Is porting Asterisk + modules a lot of work?

Thanks a lot.


Administrator has disabled public posting
admin
useravatar
User Info

Re: Is porting Asterisk + modules a lot of work?

Hi Guys,

It is good I see some movement around Yate smile
I will try to spend some time on it as well for the weeks to come.

Cheers
Dimitar


Administrator has disabled public posting
Gilles
useravatar
User Info

Re: Is porting Asterisk + modules a lot of work?

But then, do you guys notice some issues such as memory fragmentation when using Asterisk? Or do you just reboot the Atcom regularly as a preemptive "solution"? Maybe this is actually a baseless fear, after all.

Also, when it comes to TDM hardware, Yate only seems to work with Sangoma: Does this mean it won't support the FXS modules in the Atcom? It looks like it does have its own DADHI/Zaptel : http://yate.null.ro/pmwiki/index.php?n=Main.Analog

OTOH, if Yate has enough features for most users and is easier to port to the Atcom, it seems like a good alternative.


Administrator has disabled public posting
Chewi
useravatar
User Info

Re: Is porting Asterisk + modules a lot of work?

I haven't actually seen any problems with Asterisk in this regard because I haven't used it enough on this platform. I do believe that Asterisk is quite buggy and inconsistent in general though. I talked about this more in another thread. The FreeSWITCH rationale is worth a read.


Administrator has disabled public posting
Gilles
useravatar
User Info

Re: Is porting Asterisk + modules a lot of work?

After checking out the latest Switchfin source using SVN and running the command above to download and apply the patch required to include Yate, I ran make.

It runs OK for a while, but fails with the following error:

make
...
wget --passive-ftp -nd -P /usr/src/switchfin/dl http://www.soft-switch.org/downloads/sp … 6pre17.tgz
--2012-02-10 12:41:55--  http://www.soft-switch.org/downloads/sp … 6pre17.tgz
Resolving www.soft-switch.org... 74.112.133.112
Connecting to www.soft-switch.org|74.112.133.112|:80... connected.
HTTP request sent, awaiting response... 404 Not Found
2012-02-10 12:41:55 ERROR 404: Not Found.
FWIW, I used the default settings when running "make menuconfig", which includes those two SpanDSP-related items:
[*]   SpanDSP-based Caller ID (EXPERIMENTAL)
[ ]   SpanDSP-based Fax
Any idea?


Administrator has disabled public posting
Chewi
useravatar
User Info

Re: Is porting Asterisk + modules a lot of work?

Looks like pre17 is too old now, I only see 18, 19 and 20 listed for download.


Administrator has disabled public posting
Gilles
useravatar
User Info

Re: Is porting Asterisk + modules a lot of work?

Chewi wrote:

I do believe that Asterisk is quite buggy and inconsistent in general though. I talked about this more in another thread. The FreeSWITCH rationale is worth a read.
Yes, I'd much rather use Freeswitch because it's a more recent project launched by someone who knows Asterisk very well as an ex-developper, but its main author also said that getting it to run on an non-MMU would require significant changes.

Chewi wrote:

Looks like pre17 is too old now, I only see 18, 19 and 20 listed for download.
Should I edit some configuration files (which?) before re-running "make"?


Administrator has disabled public posting
Gilles
useravatar
User Info

Re: Is porting Asterisk + modules a lot of work?

Unfortunately, spandsp-0.0.6pre17.tgz is no longer available, and a patch was required before compiling it into Switchfin.

I checked the patch (package/spandsp/spandsp.patch)...

Code:


@@ -304,10 +304,10 @@
#endif

/* Define to rpl_malloc if the replacement function should be used. */
-#define malloc rpl_malloc
+//#define malloc rpl_malloc

/* Define to rpl_realloc if the replacement function should be used. */
-#define realloc rpl_realloc
+//#define realloc rpl_realloc

/* Define to empty if the keyword `volatile' does not work. Warning: valid
    code using `volatile' can become incorrect without. Disable with care. */

... and although it's minimal, I didn't find its equivalent in spandsp-0.0.6pre20.tgz:
1. "src/config.h" is gone
2. "rpl_malloc" is referenced in config-h.in and configure, but the lines don't mean the same thing

Do we really need SpanDSP? If yes, I'll drop an e-mail to the author and ask how to convert the patch.


Administrator has disabled public posting
Gilles
useravatar
User Info

Re: Is porting Asterisk + modules a lot of work?

News: "src/config.h is created when you run configure. If configure finds that rpl_malloc is needed, config.h will define it."

So I just updated package/spandsp/spandsp.mk to use "SPANDSP_SOURCE=spandsp-0.0.6pre20.tgz" instead, and reran "make", but it fails building Yate:


...
make[1]: Leaving directory `/usr/src/switchfin/build_ip01/yate/share/sounds'
cp /usr/src/switchfin/build_ip01/yate/libyate*.so* /usr/src/switchfin/build_ip01/root/usr/lib/

/usr/src/switchfin/toolchain/opt/uClinux/bfin-linux-uclibc/bin/bfin-linux-uclibc-strip --strip-unneeded -o /usr/src/switchfin/build_ip01/root/usr/bin/yate /usr/src/switchfin/build_ip01/yate/yate

/usr/src/switchfin/toolchain/opt/uClinux/bfin-linux-uclibc/bin/bfin-linux-uclibc-
strip --strip-unneeded /usr/src/switchfin/build_ip01/root/usr/lib/libyate*.so* /usr/src/switchfin/build_ip01/root/usr/lib/yate/{,**/}*.yate

/usr/src/switchfin/toolchain/opt/uClinux/bfin-linux-uclibc/bin/bfin-linux-uclibc-strip: '/usr/src/switchfin/build_ip01/root/usr/lib/yate/{,**/}*.yate': No such file
Any idea?


Administrator has disabled public posting
Chewi
useravatar
User Info

Re: Is porting Asterisk + modules a lot of work?

Yeah I know that's how config.h works and was a bit puzzled when I saw the patch but I'm a little busy today. I'll try this out later. It did build when I wrote the package a few months ago.


Administrator has disabled public posting
Gilles
useravatar
User Info

Re: Is porting Asterisk + modules a lot of work?

Ok, no problem. It can wait.


Administrator has disabled public posting
Chewi
useravatar
User Info

Re: Is porting Asterisk + modules a lot of work?

I've committed the SpanDSP update to the Subversion repository. You don't need SpanDSP to build Yate but it will use it if present. As to why the Yate build failed, I really don't know because it works for me. Try with a completely clean build and if it still fails, stick much more of the output on Pastebin so I can have a look.


Administrator has disabled public posting
Gilles
useravatar
User Info

Re: Is porting Asterisk + modules a lot of work?

Thanks. I'll try to run it again tomorrow morning. It was from a clean build, but I ran "make" twice without running "make clean" in between.

BTW, when does SpanDSP do?


Administrator has disabled public posting
Gilles
useravatar
User Info

Re: Is porting Asterisk + modules a lot of work?

After running "svn update", "make clean", and "make", compiling goes much further, but finally ends with the following error:

bfin-linux-uclibc-gcc  -o res_crypto.so -pthread  -shared   res_crypto.o  -lssl -lcrypto
/usr/src/switchfin/toolchain/opt/uClinux/bfin-linux-uclibc/bin/../lib/gcc/bfin-linux-uclibc/4.3.5/../../../../bfin-linux-uclibc/bin/ld: cannot find -lssl
collect2: ld returned 1 exit status
make[2]: *** [res_crypto.so] Error 1
make[2]: Leaving directory `/usr/src/switchfin/build_ip01/asterisk-1.4.42/res'
make[1]: *** [res] Error 2
make[1]: Leaving directory `/usr/src/switchfin/build_ip01/asterisk-1.4.42'
make: *** [asterisk] Error 2
Am I missing an option maybe?


Administrator has disabled public posting
Chewi
useravatar
User Info

Re: Is porting Asterisk + modules a lot of work?

This may be my fault. I made some unrelated clean ups to the build scripts, which I accidentally pushed along with the Yate package. It looks like my changes worked for Asterisk 1.6 but not 1.4. I'll have a look shortly.


Administrator has disabled public posting
Gilles
useravatar
User Info

Re: Is porting Asterisk + modules a lot of work?

Thanks.

FWIW, when choosing custom build settings, in the "Library Configuration" section, I notice "--- Build libSSL", so it looks like libssl is always compiled.


Administrator has disabled public posting
Gilles
useravatar
User Info

Re: Is porting Asterisk + modules a lot of work?

BTW, did you try the analog module provided by Yate with the FXO module of the Atcom in replacement for Zaptel?


Administrator has disabled public posting
Chewi
useravatar
User Info

Re: Is porting Asterisk + modules a lot of work?

Well I'm having trouble building 1.4 for a different reason and my changes aren't to blame. I get this notorious error and I can't figure out why. It detected libtonezone just fine. I wish it would tell me what it actually failed to find.

Code:

***********************************************************

  The existing menuselect.makeopts file did not specify   
  that 'chan_dahdi' should not be included.  However, either some 
  dependencies for this module were not found or a         
  conflict exists.                                         
                                                           
  Either run 'make menuselect' or remove the existing     
  menuselect.makeopts file to resolve this issue.         
***********************************************************


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: 174
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