[asterisk-users] about application Jack and its runtime

Russell Bryant russell at digium.com
Sat Sep 13 08:09:00 CDT 2008


On Sep 12, 2008, at 10:17 AM, Julien Claassen wrote:
> exten => NUM,1,System(ast_picker ring.wav)
> exten => NUM,2,Answer()
> exten => NUM,3,GotoIf($[${SYSTEMSTATUS} = SUCCESS]?4:7)
> exten => \
> NUM, 
> 4,Set(JACK_HOOK(manipulate,i(sstem:playback_1)o(system:capture_1)=on)
> exten => NUM,5,System(ast_connect)
> exten => NUM,6,Goto(8)
> exten => NUM,7,VoiceMail(MBOX)
> exten => NUM,8,Hangup()

JACK_HOOK is not going to do exactly what you want it to do here.   
JACK_HOOK does the following:

   Incoming call audio -> audio in to jack, audio out from jack ->  
current Asterisk application
   Outgoing call audio <- current Asterisk application

When you use the JACK application, you get:

   Incoming call audio -> Jack Application
   Outgoing call audio <- Jack Application

It looks like the Jack application is really what you want here, and  
that you're just trying to figure out how to connect to more than one  
port.  I would be happy to add that as an option.  Until then, here is  
something that should allow you to run your script to do more  
connections.

It takes advantage of some features of the Dial application to  
accomplish what you need.  It does a "dial" back into the local  
dialplan, which is just an extension that answers and runs JACK.  It  
uses the M() option to Dial() to run a macro after the called channel  
(the jack application) answers.  The macro waits a few seconds to  
ensure the jack application has had time to get set up, and then runs  
your ast_connect script to do the rest of your connections.

[default]

exten => NUM,1,System(ast_picker ring.wav)
exten => NUM,n,Answer()
exten => NUM,n,GotoIf($[${SYSTEMSTATUS} = SUCCESS]?4:7)
exten => NUM,n,Dial(Local/jack-exten at default,,M(connect))

exten => jack-exten,1,Answer()
exten => jack-exten,n,JACK(i(system:playback_1)o(system:capture_1))

[macro-connect]

exten => s,1,Wait(3)
exten => s,n,System(ast_connect)

--
Russell Bryant
Senior Software Engineer
Open Source Team Lead
Digium, Inc.







More information about the asterisk-users mailing list