On 5/11/07, <b class="gmail_sendername">Morgan Gilroy</b> <<a href="mailto:morgan@telappliant.com">morgan@telappliant.com</a>> wrote:<div><span class="gmail_quote"></span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
At the moment to find the codecs used I have to look though the sip<br>trace or show channels/show channel (annoying when you have 50+<br>channels).<br>Im just trying to find an easier and quicker way to keep track of the
<br>codecs used to help with debug etc.<br><br>The closest variable iv found is, "${SIP_CODEC} Set the SIP codec for a<br>call"<br>Ill see if NoOp (${SIP_CODEC}) shows the codec that was used without me<br>setting it though I don't think it will.
<br><br>Iv looked all over and I cant find anything so it looks like I may have<br>to hack a ast_set_var into app_dial or chan_sip</blockquote><div><br><br>1.4 has the CHANNEL function:<br><br>pbxlab-01*CLI> show function CHANNEL
<br>pbxlab-01*CLI><br> -= Info about function 'CHANNEL' =-<br><br>[Syntax]<br>CHANNEL(item)<br><br>[Synopsis]<br>Gets/sets various pieces of information about the channel.<br><br>[Description]<br>Gets/set various pieces of information about the channel.
<br>Standard items (provided by all channel technologies) are:<br>R/O audioreadformat format currently being read<br>R/O audionativeformat format used natively for audio<br>R/O audiowriteformat format currently being written
<br>R/W callgroup call groups for call pickup<br>R/O channeltype technology used for channel<br>R/W language language for sounds played<br>R/W musicclass class (from musiconhold.conf
) for hold music<br>R/W rxgain set rxgain level on channel drivers that support it<br>R/O state state for channel<br>R/W tonezone zone for indications played<br>R/W txgain set txgain level on channel drivers that support it
<br>R/O videonativeformat format used natively for video<br><br>When I put this in a dialplan with NoOps and called channel macros, I can kind of get what you're describing:<br><br>[from-external-pbxtel]<br>exten => 491,1,NoOp(${CHANNEL(audioreadformat)})
<br>exten => 491,n,NoOp(${CHANNEL(audiowriteformat)})<br>exten => 491,n,NoOp(${CHANNEL(audionativeformat)})<br>exten => 491,n,Dial(SIP/491,20,M(logcodec))<br>exten => 491,n,Hangup<br><br>[macro-logcodec]
<br>exten => s,1,NoOp(${CHANNEL(audioreadformat)})<br>exten => s,n,NoOp(${CHANNEL(audiowriteformat)})<br>exten => s,n,NoOp(${CHANNEL(audionativeformat)})<br><br></div></div>Console output is:<br><br> -- Executing [
491@from-external-pbxtel:1] NoOp("IAX2/pbxtel-01-5", "ulaw") in new stack<br> -- Executing [491@from-external-pbxtel:2] NoOp("IAX2/pbxtel-01-5", "ulaw") in new stack<br> -- Executing [
491@from-external-pbxtel:3] NoOp("IAX2/pbxtel-01-5", "ulaw") in new stack<br> -- Executing [491@from-external-pbxtel:4] Dial("IAX2/pbxtel-01-5", "SIP/491|20|M(logcodec)") in new stack
<br> -- Called 491<br> -- SIP/491-0a16d1c0 is ringing<br> -- SIP/491-0a16d1c0 answered IAX2/pbxtel-01-5<br> -- Executing [s@macro-logcodec:1] NoOp("SIP/491-0a16d1c0", "slin") in new stack<br>
-- Executing [s@macro-logcodec:2] NoOp("SIP/491-0a16d1c0", "slin") in new stack<br> -- Executing [s@macro-logcodec:3] NoOp("SIP/491-0a16d1c0", "gsm") in new stack<br> == Spawn extension (from-external-pbxtel, 491, 4) exited non-zero on 'IAX2/pbxtel-01-5'
<br> -- Hungup 'IAX2/pbxtel-01-5'<br><br>This is a call coming in as ulaw over IAX2, then going to a SIP softphone configured for only gsm.<br><br>Hope that helps.<br><br>-- <br>j.