[asterisk-users] AMR codec for Asterisk 1.6.1.X

Andrea Cristofanini andrea.cristofanini at zerozero39.it
Thu May 6 10:53:44 CDT 2010


Dear list,
i have re-compiled again the source code of amr patch for 1.6
(https://asteriskvideo.svn.sourceforge.net/svnroot/asteriskvideo/amr/asterisk-1.6-AMR.patch)
The patch does not compile with the static function into frame.c
called :
static int amr_samples(unsigned char *data, int datalen)

i have removed the static and used like

int amr_samples(unsigned char *data, int datalen)

Anyone else got this issue  ???


In this way the patch compile .
It also show right format name when i try lo load codec_amr.so
 load codec_amr.so
The 'load' command is deprecated and will be removed in a future
release. Please use 'module load' instead.
  == Parsing '/etc/asterisk/codecs.conf':   == Found
    -- codec_amr: parsing codecs.conf
    -- codec_amr: set octed-aligned mode to 1
    -- codec_amr: set dtx mode to 0
    -- codec_amr: AMR mode set to MR122 (7)
codec_amr: enc_mode = 7, dtx = 0
  == Registered translator 'amrtolin' from format amr to slin, cost 2000
  == Registered translator 'lintoamr' from format slin to amr, cost 17997
 Loaded codec_amr.so => (AMR Coder/Decoder)


Also i have into the config file asterisk.conf the  following  value to
filed transcode_via_sln
= yes
so transcode_via_sln = yes

If i try to make a call to echotest by dialing 600
  '600' =>          1. Answer()
[pbx_config]
                    2. Playback(demo-echotest)
[pbx_config]
                    3. Echo()
[pbx_config]
                    4. Playback(demo-echodone)
[pbx_config]

with a client that have only enabled amr codec i got this output:
[May  6 17:51:11] WARNING[9684]: chan_sip.c:7654 process_sdp:
Unsupported SDP media type in offer: audio 4002 RTP/SAVP 114 18 113 0 8 101


Anyone know how to get this AMR codec doing transcoding on asterisk 1.6?


Many thanks in advantage
Andrea





Il 05/05/2010 18:13, Adrian Marsh ha scritto:
> It says in the readme from that link you provided:
> 
> 	" This patch adds AMR-NB support to Asterisk 1.4
> 
> 	(for Asterisk 1.6 check out asterisk 1.6 branch and use the 
> 	asterisk-1.6-AMR.patch patch (provided by Ivelin Ivanov))"
> 
> Did you use the 1.6 branch and patch ??
> 
> I'll have to try this myself at some point.
> 
> Thanks,
> 
> Adrian
> -----Original Message-----
> From: asterisk-users-bounces at lists.digium.com
> [mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Andrea
> Cristofanini
> Sent: 05 May 2010 14:22
> To: asterisk-users at lists.digium.com
> Subject: [asterisk-users] AMR codec for Asterisk 1.6.1.X
> 
> Hi list,
> 
> Anyone have successfully compiled amr codec for asterisk 1.6.1.X ?
> I still have no problem compiling and playing with it on Asterisk 1.4.X.
> 
> I have used the following patch  :
> https://asteriskvideo.svn.sourceforge.net/svnroot/asteriskvideo/amr/
> 
> Hare is what i get while loading codec_amr.so
> 
> debbi*CLI> load codec_amr.so
>   == Parsing '/etc/asterisk/codecs.conf':   == Found
>     -- codec_amr: parsing codecs.conf
>     -- codec_amr: set octed-aligned mode to 1
>     -- codec_amr: set dtx mode to 0
>     -- codec_amr: AMR mode set to MR122 (7)
> codec_amr: enc_mode = 7, dtx = 0
>   == Registered translator 'amrtolin' from format unknown to slin, cost
> 4000
>   == Registered translator 'lintoamr' from format slin to unknown, cost
> 32002
>  Loaded codec_amr.so => (AMR Coder/Decoder)
> debbi*CLI> core show  translation
>          Translation times between formats (in microseconds) for one
> second of data
>           Source Format (Rows) Destination Format (Columns)
> 
>            g723   gsm  ulaw  alaw g726aal2 adpcm  slin lpc10  g729 speex
>  ilbc  g726  g722 slin16
>      g723     -     -     -     -        -     -     -     -     -     -
>     -     -     -      -
>       gsm     -     -     2     2        2     2     1  4001 12002     -
>     -     2     2   4003
>      ulaw     - 12002     -     1        2     2     1  4001 12002     -
>     -     2     2   4003
>      alaw     - 12002     1     -        2     2     1  4001 12002     -
>     -     2     2   4003
>  g726aal2     - 12002     2     2        -     2     1  4001 12002     -
>     -     2     2   4003
>     adpcm     - 12002     2     2        2     -     1  4001 12002     -
>     -     2     2   4003
>      slin     - 12001     1     1        1     1     -  4000 12001     -
>     -     1     1   4002
>     lpc10     - 16001  4001  4001     4001  4001  4000     - 16001     -
>     -  4001  4001   8002
>      g729     - 16001  4001  4001     4001  4001  4000  8000     -     -
>     -  4001  4001   8002
>     speex     -     -     -     -        -     -     -     -     -     -
>     -     -     -      -
>      ilbc     -     -     -     -        -     -     -     -     -     -
>     -     -     -      -
>      g726     - 16001  4001  4001     4001  4001  4000  8000 16001     -
>     -     -  4001   8002
>      g722     - 20001  8001  8001     8001  8001  8000 12000 20001     -
>     -  8001     -   4001
>    slin16     - 24001 12001 12001    12001 12001 12000 16000 24001     -
>     - 12001  4000      -
> debbi*CLI> core show  file
> formats  version
> debbi*CLI> core show  co
> codec   codecs  config
> debbi*CLI> core show  code
> codecs  codec
> debbi*CLI> core show  codec
> codecs  codec
> debbi*CLI> core show  codec audio
> Usage: core show codec <number>
>        Displays codec mapping
> debbi*CLI> core show  codecs audio
> Disclaimer: this command is for informational purposes only.
>         It does not indicate anything about your configuration.
>         INT    BINARY        HEX   TYPE       NAME   DESC
> ------------------------------------------------------------------------
> --------
>           1 (1 <<  0)      (0x1)  audio       g723   (G.723.1)
>           2 (1 <<  1)      (0x2)  audio        gsm   (GSM)
>           4 (1 <<  2)      (0x4)  audio       ulaw   (G.711 u-law)
>           8 (1 <<  3)      (0x8)  audio       alaw   (G.711 A-law)
>          16 (1 <<  4)     (0x10)  audio   g726aal2   (G.726 AAL2)
>          32 (1 <<  5)     (0x20)  audio      adpcm   (ADPCM)
>          64 (1 <<  6)     (0x40)  audio       slin   (16 bit Signed
> Linear PCM)
>         128 (1 <<  7)     (0x80)  audio      lpc10   (LPC10)
>         256 (1 <<  8)    (0x100)  audio       g729   (G.729A)
>         512 (1 <<  9)    (0x200)  audio      speex   (SpeeX)
>        1024 (1 << 10)    (0x400)  audio       ilbc   (iLBC)
>        2048 (1 << 11)    (0x800)  audio       g726   (G.726 RFC3551)
>        4096 (1 << 12)   (0x1000)  audio       g722   (G722)
> debbi*CLI>
> 
> The CLI does not show codec audio or codedc translation for AMR NB.
> 
> Anyone have any idea ??
> 
> Thanks in advantage
> 
> 
> Andrea
> 
> 
> 
> 


-- 
-----------------------------------------------------------------------
Andrea Cristofanini           Chief Technical Officer
ZeroZero39 srl                Tel: +39 02 61294759
Viale Brianza, 20             Fax: +39 02 87365813
20092 Cinisello Balsamo (MI)  Mob:+39 329 1871756
web:                          www.zerozero39.it
PGP Key:                      http://www.zerozero39.it/cristofanini.asc



More information about the asterisk-users mailing list