Thursday, September 18, 2008

Asterisk Volume Function Dialplan

I talked briefly in #asterisk about wanting sip gains so I could use a dialplan toy that required backgrounddetect. well no such thing exist but Russel Bryant pointed me to a function that is part of 1.6 and which was backported to 1.4 that allows you to adjust the gains on any channel, Well I compiled the function and threw 2 lines to my dialplan and POOF it worked. I was thinking this would be handy for tuning gains and so I threw together a small dial plan that takes advantage of the volume function. This allows you to tune the gain with use of the CLI

exten => s,1,Set(RX=0)
exten => s,2,Set(TX=0)
exten => s,3,Set(TIMEOUT(digit)=3)
exten => s,4,Set(TIMEOUT(response)=10)
exten = s,5,NOOP("RX:${RX} TX:${TX}")
exten => s,6,Playback(tt-allbusy)
exten => 1,1,Set(RX=$[${RX} + 1])
exten => 1,2,Set(VOLUME(RX)=${RX})
exten => 1,3,goto(s,5)
exten => 2,1,Set(RX=$[${RX} - 1])
exten => 2,2,Set(VOLUME(RX)=${RX})
exten => 2,3,goto(s,5)
exten => 3,1,Set(TX=$[${TX} + 1])
exten => 3,2,Set(VOLUME(TX)=${TX})
exten => 3,3,goto(s,5)
exten => 4,1,Set(TX=$[${TX} - 1])
exten => 4,2,Set(VOLUME(TX)=${TX})
exten => 4,3,goto(s,5)


Volume port: http://svncommunity.digium.com/svn/russell/asterisk-1.4/func_volume.c

Digg Technorati del.icio.us Stumbleupon Reddit Blinklist Furl Spurl Yahoo Simpy

0 comments: