Need to know how to apply patches

Newbee with the latest install need these patches to unistinm :

hope they will fix the asterisk crashing when I pickup my nortel 2004

Did you download Asterisk source from Digium? You have to apply the patch to the source code. You can’t patch a running system.

The procedure is:

Download the source
Run the patch script
Compile Asterisk as normal

Patch script fails with the first change it is ok with over 200 lines after that. guess I need to fix the patch some how. Don’t know how to get that text back but this is what results at the end of the make.

" [LD] chan_skinny.o ->
[CC] chan_unistim.c -> chan_unistim.o
chan_unistim.c: In function âattempt_transferâ:
chan_unistim.c:2262: error: âpeerdâ undeclared (first use in this function)
chan_unistim.c:2262: error: (Each undeclared identifier is reported only once
chan_unistim.c:2262: error: for each function it appears in.)
chan_unistim.c: In function âstart_rtpâ:
chan_unistim.c:2654: warning: passing argument 2 of âast_rtp_instance_newâ from incompatible pointer type
chan_unistim.c: In function âload_moduleâ:
chan_unistim.c:6533: warning: assignment from incompatible pointer type
chan_unistim.c:6559: warning: passing argument 1 of âsched_context_destroyâ from incompatible pointer type
chan_unistim.c: In function âunload_moduleâ:
chan_unistim.c:6575: warning: passing argument 1 of âsched_context_destroyâ from incompatible pointer type
make[1]: *** [chan_unistim.o] Error 1
make: *** [channels] Error 2"

Patches are for specific versions of Asterisk. You have to be very careful.

I am not a programmer so I can’t help you with any C syntax.

The patch command saved the original file so I can go back, did figure out how to do it. Not sure why but my progress posts to this thread are missing now. But found a thread about installing 1.8 from source and was able to compile a custom asterisk with the ilbc codec as a test.

It needed me to yum one development package and ./configure with an extra option but at least it is relatively easy. Will go back and see if I can figure out why the patch did not work and maybe fix it.

Wonder if the patch will make it to a future release ?

As for patches provided to Digium, unfortunately we can’t speak on their behalf as to when and if something will make it into a future release. The best thing to do is to watch the Asterisk Issue Tracker for it to be applied to the source tree.

Patched with chan_unistim.c. , it fails with first part not applied. I then edit with vi the patched source to add “*peerd = Null” to the same place where “*peerc = Null;” so “*peerc = NULL, *peerd = Null;” then do the normal compiles. Error is gone but warnings above remain. Now have a working 2004i on asterisk . I don’t know if this is the correct thing todo but it worked for me.

I have been using i2004’s with Trixbox for a while now… I want to move to FreePBX and have successfully installed 2.5… All SIP phones OK and my natting issue (forwarding to cell phones) is resolved.
Now for unistim… I followed your instructions as above for compiling latest. A couple of issues, but worked through them and got it compiled (
Then, the tuff part… I figured out how to apply a patch but I get an error when doing so…
Assumptions: I am applying the patch to /usr/src/asterisk- which was in the source.
If that is not the correct source file, where do I get the one to patch??
If it is the correct file, I then get 1 error “Hunk #1 FAILED at 32”.


The error Hunk #1 FAILED at 32 is the same I received but the source is patched almost. If you edit the patched source so that the error is fixed then it should work. Check the other thread for the specific edit instructions.