[asterisk-users] Issues with Local Channel

Sidarta Aguiar de Oliveira sidarta at freeddom.com
Tue Nov 16 11:48:56 CST 2010





Thanks Mark for your reply. 


I understand all you explained and I agree . All I want to do is abstract for my app how handle channels (DAHDI or SIP). That's is the main reason, I try to use Local Channels and NoOp Application so the dial plan should do all the heavy work (channels avaliable). 
My app , in the first idea, will create the same call file. 
There is a better way to treat this issue? 


Until now, we use asterisk for routes call in our office. Now we are thinking in integrate asterisk with our app. 


Thanks once again! 

Regards 


S idarta Oliveira 

----- Mensagem original -----
De: "Mark Murawski" <markm-lists at intellasoft.net> 
Para: asterisk-users at lists.digium.com 
Enviadas: Terça-feira, 16 de Novembro de 2010 15:15:16 
Assunto: Re: [asterisk-users] Issues with Local Channel 

Local channels behave like an endpoint. So instead of a sip phone 
picking up the call, asterisk is picking up the call. 

Instead of someone speaking into a sip phone, asterisk can play tracks, 
or record digits, etc. 

You need to make sure that the call does not end before you're done with 
your local channel. Your current use is incorrect and your call is 
going to hang up before it does much of anything. 

Channel: Local/1 at dtmf 
Application: NoOp 

This is guaranteed to not work... asterisk will spawn the local channel 
one one leg, lets call it the source leg, and it will run the 
application NoOp on the destination leg. The NoOp will run, there is 
then no more dialplan to run, so the call will be hung up. 

Also... using the G option to dial, is probably not what you want. You 
must think of a local channel as an end point. 

I'm not sure if this will get you exactly what you want, but it should 
get you further along the path. 

# destination dialplan 
[read] 
exten => 1,1,Answer() 
exten => 1,n,Read(data,play-msg,4,,2,15) 
exten => 1,n,Verbose("${data}") 
exten => 1,n,AGI(send_data.py,${data}) 
exten => 1,n,Hangup() 

-- Note that timeout is in milliseconds 

Action: Originate 
Channel: DAHDI/1/99999999 
Context: read 
Exten: 1 
Priority: 1 
Timeout: 120000 


This isn't using the local channel, but instead uses straight dialplan. 
Asterisk will wait for the "source leg", 99999999 to answer, and once 
it does, it will execute [read] 


Here's how to do it with local channels. 

# source leg 
[dialout] 
exten => 1,1,Dial(dahdi/1/99999999,120) 
exten => 1,n,Hangup() 

# destination leg 
[read] 
exten => 1,1,Answer() 
exten => 1,n,Read(data,play-msg,4,,2,15) 
exten => 1,n,Verbose("${data}") 
exten => 1,n,AGI(send_data.py,${data}) 
exten => 1,n,Hangup() 

Action: Originate 
Channel: Local/1 at dialout 
Context: read 
Exten: 1 
Priority: 1 
Timeout: 120000 

Note, that the timeout applies to waiting for the Channel "source leg", 
endpoint to pick up. If you put the timeout to say 1000, (1 second), 
asterisk will kill the call before the Dial() timeout of 120 seconds hit. 



On 11/16/2010 07:57 AM, Sidarta Aguiar de Oliveira wrote: 
> Hello, 
> 
> I don't really understand how channel Local works. I need that asterisk 
> initiate a call and get some data (DTMF). 
> 
> So to do that I've created this dialplan : 
> 
> ; extensions.conf - the Asterisk dial plan 
> ; 
> [general] 
> static=yes 
> writeprotect=no 
> clearglobalvars=no 
> 
> [dtmf] 
> exten => 1,1,Verbose(Get User ID) 
> exten => 1,n,Dial(dahdi/1/99999999,120,G(read^1^1)) 
> exten => 1,n,Hangup() 
> 
> [read] 
> exten => 1,1,Hangup() 
> exten => 1,n,Read(data,play-msg,4,,2,15) 
> exten => 1,n,Verbose("${data}") 
> exten => 1,n,AGI(send_data.py,${data}) 
> exten => 1,n,Hangup() 
> 
> File: test.call 
> 
> Channel: Local/1 at dtmf 
> Application: NoOp 
> 
> I've create a file name test.call and then move the call file to the dir 
> /var/spool/asterisk/outgoing/. Some issues I've had, the option G, in 
> the Dial function don't wait the user answer the call to follow the 
> dialplan. Is this rigth? Is this because I have used a Local Channel? 
> Are better way to do that? 
> 
> Regards, 
> * 
> * 
> *Sidarta Oliveira* 
> 


-- 
_____________________________________________________________________ 
-- Bandwidth and Colocation Provided by http://www.api-digital.com -- 
New to Asterisk? Join us for a live introductory webinar every Thurs: 
http://www.asterisk.org/hello 

asterisk-users mailing list 
To UNSUBSCRIBE or update options visit: 
http://lists.digium.com/mailman/listinfo/asterisk-users 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20101116/a5640d32/attachment.htm 


More information about the asterisk-users mailing list