Help on call codec negotiation

Can someone give some light on this call setup? from console (slin) and sip peer (alaw,slin,g729)?

Why if they have a the same code, ends saying “Could not find preferred codec - Going for the best codec” and “o audio format found to offer. Cancelling call to…”

Thanks!!

Kig
Asked to create a SIP channel with formats: 0x8000 (slin16)
== Using SIP RTP CoS mark 5
== Using SIP VRTP CoS mark 6
Allocating new SIP dialog for 5312212b3c41fa8f3ea0d0440c8ad150@192.168.3.20 - INVITE (With RTP)
Setting NAT on RTP to Off
Found IP address for this socket
Setting SIP_TRANSPORT_UDP with address 192.168.3.20:5060
Could not find preferred codec - Going for the best codec
*** Our native formats are 0x8000 (slin16)
*** Joint capabilities are 0x8000 (slin16)
*** Our capabilities are 0x148 (alaw|slin|g729)
Could not find preferred codec - Going for the best codec
*** AST_CODEC_CHOOSE formats are 0x8000 (slin16)
*** Our preferred formats from the incoming channel are 0x8000 (slin16)
This channel will not be able to handle video.
Channel ‘Console/default’ has no RTP, not doing anything
Not copying variable DIALEDTIME.
Not copying variable ANSWEREDTIME.
Not copying variable DIALEDPEERNAME.
Not copying variable DIALEDPEERNUMBER.
Not copying variable DIALSTATUS.
Outgoing Call for …
Updating call counter for outgoing call
No audio format found to offer. Cancelling call to…

The first one is because the console is only offering 16kHz, 16 bit audio, and the SIP line is only offering 8kHz 16 bit, as its linear format. slin16 is not the same as slin

Yes, thanks you’re right!

Then i have the following questions

1) What has to do slin16 and g722 beacuse it’s conversor goes throught this codec:

module load codec_g722.so
== Parsing ‘/etc/asterisk/codecs.conf’: == Found
– codec_g722: using generic PLC
== Registered translator ‘g722tolin’ from format g722 to slin, cost 1
== Registered translator ‘lintog722’ from format slin to g722, cost 1
plc_samples 160 format f
== Registered translator ‘g722tolin16’ from format g722 to slin16, cost 4001
== Registered translator ‘lin16tog722’ from format slin16 to g722, cost 1

2) Why slin16 (0x8000) doesn’t appear on ‘core show codecs’?

*CLI> core show codecs
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)
  65536 (1 << 16)  (0x10000)  image       jpeg   (JPEG image)
 131072 (1 << 17)  (0x20000)  image        png   (PNG image)
 262144 (1 << 18)  (0x40000)  video       h261   (H.261 Video)
 524288 (1 << 19)  (0x80000)  video       h263   (H.263 Video)
1048576 (1 << 20) (0x100000)  video      h263p   (H.263+ Video)
2097152 (1 << 21) (0x200000)  video       h264   (H.264 Video)

For the second part, because the limit on the audio codecs in core show codecs is hard coded. That probably constitutes a severity “tweak” bug, so might be worth reporting.

From main/frame.c in 1.6.1.0

            for (i=0;i<13;i++) {
                    snprintf(hex,25,"(0x%x)",1<<i);
                    ast_cli(a->fd, "%11u (1 << %2d) %10s  audio   %8s   (%s)\n",1 << i,i,hex,ast_getformatname(1<<i),ast_codec2str(1<<i));
            }

Ok, i’ll post a “bug”, thanks… and about the first?