How to determine codec on a line

Hello,

This is my first post to this forum and I have a question regarding codecs in Asterisk which is running on a server (dedicated PC). More specifically, I would like to know how to verify (via CLI) what the current settings are for a particular line (maybe this is a global setting which applies to all lines - I’m not sure).

I would like to determine if RFC2833 / telephony events are configured for a particular line (or globally as mentioned above)? To further this, is there a way to see what codec(s) are negotiated for an active call, e.g. PCMU, G.711, telephony events / RFC2833, etc.

Thanks in advance!

The definitive method is sip set debug on. However, have you tried sip show channel… and sip show peer…?

Note, strictly speaking, these are not negotiated, although in practice Asterisk does negotiate. Strictly speaking, each side says what it can accept, and the other side should limit itself to that constraint. However the other side can use options that it didn’t include in its SDP.

Also, the actual inbound codec is chosen from the allowed ones, by the other side, and may change without further SIP activity.

Hi

[quote]
asterisk -rx “sip show channel Call ID”[/quote]
where you have got the call call id from

will give you

* SIP Call Curr. trans. direction: Outgoing Call-ID: 78b96dab6fb793ec3e4277111785179b@aa.aa.aa.aa Owner channel ID: SIP/6805-00008abc Our Codec Capability: 12 Non-Codec Capability (DTMF): 1 Their Codec Capability: 12 Joint Codec Capability: 12 Format: 0x8 (alaw) MaxCallBR: 384 kbps Theoretical Address: bb.bb.bb.bb:53019 Received Address: cc.cc.cc.cc:53019 SIP Transfer mode: open NAT Support: Always Audio IP: dd.dd.dd.dd (local) Our Tag: as568e71ea Their Tag: 427f6656 SIP User agent: 3CXPhone 6.0.20943.0 Username: 6805 Peername: 6805 Original uri: sip:6805@cc.cc.cc.cc:53019 Need Destroy: 0 Last Message: Tx: ACK Promiscuous Redir: No Route: sip:6805@cc.cc.cc.cc:53019;rinstance=8d0457b2e5e69ba0 DTMF Mode: rfc2833 SIP Options: (none)

Thanks everyone… I will try this a little later today and let you know my results.

Thanks! That was what I needed. Now I sent a snapshot from a channel:

Curr. trans. direction: Outgoing
Call-ID: 4132395a4e8a77736828a01965026aba@10.19.96.4
Owner channel ID: SIP/5550012-099b8740
Our Codec Capability: 2621452
Non-Codec Capability (DTMF): 1
Their Codec Capability: 2621452
Joint Codec Capability: 2621452
Format: 0x280004 (ulaw|h263|h264) <========================how do I modify this value?
MaxCallBR: 384 kbps
Theoretical Address: 10.19.99.135:5060
Received Address: 10.19.99.135:5060
SIP Transfer mode: open
NAT Support: Always
Audio IP: 10.19.96.4 (local)
Our Tag: as74762575
Their Tag: 94adda68-a136387-13c4-50029-589-4bcab841-589
SIP User agent: XXXXXXXXXXX
Username: 5550012
Peername: 5550012
Original uri: sip:5550012@10.19.99.135:5060
Need Destroy: 0
Last Message: Tx: ACK
Promiscuous Redir: No
Route: sip:5550012@10.19.99.135:5060
DTMF Mode: rfc2833 <========================how do I modify this value?
SIP Options: (none)

I have a question on how to modify the ‘Format’ line and the ‘DTMF Mode’?

See sip.conf.sample.