Disable unwanted transcoding


[to_peer]
host=9.8.7.6
insecure=port,invite
type=peer
disallow=all
allow=g729
allow=alaw
qualify=yes
nat=no
canreinvite=no

[from_peer]
host=1.2.3.4
insecure=port,invite
type=peer
context=from_peer
disallow=all
allow=g729
allow=alaw
nat=no
canreinvite=no
qualify=yes

Both peers have identical settings and codecs. Caller and callee and anybody in between support G729 and G711, and don’t have any problem with both codecs. But this asterisk machine always use G711 for to_peer and G729 for from_peer with transcoding, of course. What’s this? Why transcoding? Unloading codec_g729.so gives tons of error on console, like “can’t convert from g729 to slin” and no sound on calls.

Which codecs, and in what order, did each peer offer?

Here’s wireshark screen with full SIP exchange:

tinypic.com/r/23shzy9/8

That doesn’t make sense at all. It should not be offering g711u, at all.

Which version of Asterisk? Which SIP channel driver? What dialplan is there between the incoming call and the Dial call?

I think you need full SIP debugging (enable full log in logger.conf, core set verbose 5, core set debug 5, sip set debug on).