From: drowe67 Date: Sat, 31 Mar 2012 08:56:43 +0000 (+0000) Subject: first pass Asterisk codec2 support works, have made a few calls, updated asterisk... X-Git-Url: http://git.whiteaudio.com/gitweb/?a=commitdiff_plain;h=6a034f2bd4753ac2564c9b1ba64a604ae37ac384;p=freetel-svn-tracking.git first pass Asterisk codec2 support works, have made a few calls, updated asterisk/README with build instructions git-svn-id: https://svn.code.sf.net/p/freetel/code@360 01035d8c-6547-0410-b346-abe4f91aad63 --- diff --git a/codec2-dev/asterisk/README b/codec2-dev/asterisk/README index ee368e6f..70e58486 100644 --- a/codec2-dev/asterisk/README +++ b/codec2-dev/asterisk/README @@ -1,24 +1,109 @@ README for codec2/asterisk Asterisk Codec 2 support -todo: +Test Configuration +------------------ -[ ] Patches for configure macro -[ ] document - + make install codec 2: - david@bear:~/codec2-dev$ ./configure && make clean && sudo make install +Codec 2 is used to trunk calls between two Asterisk boxes: + + A - SIP phone - Asterisk A - Codec2 - Asterisk B - SIP Phone - B + +The two SIP phones are configiured for mulaw. + +Buildling +--------- + +Asterisk must be pacthed so that the core understand Codec 2 frames. + +1/ First install Codec 2: + + david@cool:~$ svn co https://freetel.svn.sourceforge.net/svnroot/freetel/codec2-dev codec2-dev + david@cool:~/codec2-dev$ cd codec2-dev + david@cool:~/codec2-dev$ ./configure && make && sudo make install david@bear:~/codec2-dev$ sudo ldconfig -v - + ./configure Asterisk with Codec2 include and ibrary - CFLAGS=-I/home/david/tmp/codec2/include ./configure - + install instructions - + Asterisk version - - david@bear:~/asterisk-1.8.9.0$ make ASTLDFLAGS=-lcodec2 - - + configuration and demo - + AST_FORMAT_GSM - + patch: - frames.h, - channel.c - frames.c - + support for different Codec 2 bit rates + david@cool:~/codec2-dev$ cd ~ + +2/ Then build Asterisk with Codec 2 support: + + david@cool:~$ tar xvzf asterisk-1.8.9.0.tar.gz + david@cool:~/asterisk-1.8.9.0$ patch -p4 < ~/codec2-dev/asterisk/asterisk-codec2.patch + david@cool:~/asterisk-1.8.9.0$ cp ~/codec2-dev/asterisk/codec2_codec2.c . + david@cool:~/asterisk-1.8.9.0$ cp ~/codec2-dev/asterisk/ex_codec2.h . + david@cool:~/asterisk-1.8.9.0$ ./configure && make ASTLDFLAGS=-lcodec2 + david@cool:~/asterisk-1.8.9.0$ sudo make install + david@cool:~/asterisk-1.8.9.0$ sudo make samples + +3/ Add this to the end of sip.conf on Asterisk A: + + [6013] + type=friend + context=default + host=dynamic + user=6013 + secret=6013 + canreinvite=no + callerid=6013 + disallow=all + allow=ulaw + + [potato] + type=peer + username=potato + fromuser=potato + secret=password + context=default + disallow=all + dtmfmode=rfc2833 + callerid=server + canreinvite=no + host=cool + allow=codec2 + +3/ Add this to the end of sip.conf on Asterisk B: + + [6014] + type=friend + context=default + host=dynamic + user=6014 + secret=6014 + canreinvite=no + callerid=6014 + disallow=all + allow=ulaw + + [potato] + type=peer + username=potato + fromuser=potato + secret=password + context=default + disallow=all + dtmfmode=rfc2833 + callerid=server + canreinvite=no + host=bear + allow=codec2 + +4/ Here is the [default] section of extensions.conf on Asterisk B: + + [default] + + exten => 6013,1,Dial(SIP/potato/6013) + ; + ; By default we include the demo. In a production system, you + ; probably don't want to have the demo there. + ; + ;include => demo + +5/ After booting see if the codec2_codec2.so module is loaded with "core show translate" + +6/ To make a test call dial 6013 on the SIP phone connected to Asterisk B + +7/ If codec_codec2.so won't load and you see "can't find codec2_create" try: + + david@cool:~/asterisk-1.8.9.0$ touch codecs/codec_codec2.c + david@cool:~/asterisk-1.8.9.0$ make ASTLDFLAGS=-lcodec2 + david@cool:~/asterisk-1.8.9.0$ sudo cp codecs/codec_codec2.so /usr/lib/asterisk/modules + david@cool:~/asterisk-1.8.9.0$ sudo asterisk -vvvcn +