What is the procedure to recompile chan_iax2.c?


#1

It looks like starting in v.1.2 of Asterisk a new jitter buffer is used. While the new jitter buffer sounds nice, it doesn’t work very well with other Asterisk boxes using the older jitter buffer. The documentation (bugs.digium.com/file_download.ph … 0&type=bug) says that if you want to go back to the old style jitter buffer:

[quote]You may also compile chan_iax2.c without the new jitterbuffer, enabling the old
backwards compatible architecture. Look in the source code for instructions.[/quote]

Before I proceed, I am a professional programmer, but I am not a C programmer. I have toyed in C a little, so I can vaguely read it, but that’s about the extent of it. I am still pretty much at the novice+ level on Linux, but being a hard-core-DOS guy I do OK with it.

That said, I’ve looked in chan_iax2.c, and quickly found this section:

[code]/* Define NEWJB to use the new channel independent jitterbuffer,

  • otherwise, use the old jitterbuffer */
    #define NEWJB

#ifdef NEWJB
#include “…/jitterbuf.h”
#endif[/code]

It would seem that simply remarking out the “#define NEWJB” line would be all that is needed to reinstate the old jitter buffer on recompile. Of course I’m so lame I’m not sure how to go about doing the recompile. Can I recompile just chan_iax2.c and replace /usr/lib/asterisk/modules/chan_iax2.so with the new one? Even if it is that simple, I don’t even know how to do that. I guessed it might be as simple as “cc -c chan_iax2.c” after making the change, but all I got was 10 screenfuls of errors. I know in Perl we usually have a makefile, but generally the makefile is for a whole application, not just one module.

I’ve searched the forums here, as well as Googled, and other searches, and just haven’t found anything that leads me to it. Either it is so simple that nobody ever discusses it, or nobody else is doing it. :wink:

Thanks for your time, and thanks in advance for any advice.


#2

I decided that rather than try to recompile just chan_iax2.c, or trying to recompile just the sources in the channels directory, I’d move up a level and just recompile the whole thing (all of Asterisk).

So, I downloaded Asterisk 1.2.6, un-tar/gz’d it, and did a make clean, make, and all compiled fine.

OK, that solves the compiling question.

Next is to try to get the old jitter buffer back. As I said in the previous post, the docs say just to “look in the source code for instructions” on recompiling chan_iax2.c with the old jitter buffer. Judging from the comments in chan_iax2.c, it seems that changing:

to:

should do the trick. However, once I make that change, the compile dies with a bunch of errors when compiling chan_iax2.c.

My next try is going to be to change this:

[code]/* Define NEWJB to use the new channel independent jitterbuffer,

  • otherwise, use the old jitterbuffer */
    #define NEWJB

#ifdef NEWJB
#include “…/jitterbuf.h”
#endif[/code]

to this:

[code]/* Define NEWJB to use the new channel independent jitterbuffer,

  • otherwise, use the old jitterbuffer /
    /
    #define NEWJB */

/* #ifdef NEWJB /
#include “…/jitterbuf.h”
/
#endif */[/code]

That way, NEWJB won’t be defined (there are lots of other sections where it says #ifdef NEWJB), but jitterbuf.h will still get “included”. If that doesn’t work, then I’d say that the purported method of reverting to the old jitter buffer is not correct.


#3

OK, that didn’t work either.

Has anybody successfully recompiled to revert to the old jitter buffer?