Need to learn about codec negotiation

My Asterisk server is having several connectivity problems that can be traced back to the codec issue. These are the devices involved:

  • Asterisk 1.4
  • Sipura/Linksys ATAs with varied firmware
  • Cisco AS-5300 voice gateway (used for VoIP-> POTS calls only)

I keep on getting a “No available media” (i.e.: there are no common codecs) messages from the Cisco even when I have tried every combination of codecs. Sometimes the call goes through but the voice is unidirectional (no NAT involved).

What I need is to understand better the nature of codec negotiation, so I can debug and track down the specific failures. Is there some documentation that describes the codec negotiation protocol? What debugging mode should I use?

What I use now is

sip show peers
sip show peer xyz

What else should I look into?

TIA,

-Ramon

Turn on sip debug and you can see what codecs each side are capable of doing.

search on lists.digium.com, there are one or two reports/bugs about how codec negotiation occurs and how it should change.