<html><head><style type='text/css'>p { margin: 0; }</style></head><body><div style='font-family: Arial; font-size: 10pt; color: #000000'><div><span><div><div> </div><div>Thanks Mark for your reply. </div><div><br></div><div>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). </div><div>My app , in the first idea, will create the same call file.</div><div>There is a better way to treat this issue? </div><div><br></div><div>Until now, we use asterisk for routes call in our office. Now we are thinking in integrate asterisk with our app. </div><div><br></div><div>Thanks once again!</div><div><br></div>Regards </div><span name="x"></span><div><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: small; font-weight: bold; "><br></span></div><div><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: small; "><strong>S<span class="Apple-style-span" style="font-size: small;">idarta Oliveira</strong></span></span></div><span name="x"></span><br></span><br><hr id="zwchr"><b>De: </b>"Mark Murawski" <markm-lists@intellasoft.net><br><b>Para: </b>asterisk-users@lists.digium.com<br><b>Enviadas: </b>Terça-feira, 16 de Novembro de 2010 15:15:16<br><b>Assunto: </b>Re: [asterisk-users] Issues with Local Channel<br><br>Local channels behave like an endpoint. So instead of a sip phone <br>picking up the call, asterisk is picking up the call.<br><br>Instead of someone speaking into a sip phone, asterisk can play tracks, <br>or record digits, etc.<br><br>You need to make sure that the call does not end before you're done with <br>your local channel. Your current use is incorrect and your call is <br>going to hang up before it does much of anything.<br><br>Channel: Local/1@dtmf<br>Application: NoOp<br><br>This is guaranteed to not work... asterisk will spawn the local channel <br>one one leg, lets call it the source leg, and it will run the <br>application NoOp on the destination leg. The NoOp will run, there is <br>then no more dialplan to run, so the call will be hung up.<br><br>Also... using the G option to dial, is probably not what you want. You <br>must think of a local channel as an end point.<br><br>I'm not sure if this will get you exactly what you want, but it should <br>get you further along the path.<br><br># destination dialplan<br>[read]<br>exten => 1,1,Answer()<br>exten => 1,n,Read(data,play-msg,4,,2,15)<br>exten => 1,n,Verbose("${data}")<br>exten => 1,n,AGI(send_data.py,${data})<br>exten => 1,n,Hangup()<br><br>-- Note that timeout is in milliseconds<br><br>Action: Originate<br>Channel: DAHDI/1/99999999<br>Context: read<br>Exten: 1<br>Priority: 1<br>Timeout: 120000<br><br><br>This isn't using the local channel, but instead uses straight dialplan. <br> Asterisk will wait for the "source leg", 99999999 to answer, and once <br>it does, it will execute [read]<br><br><br>Here's how to do it with local channels.<br><br># source leg<br>[dialout]<br>exten => 1,1,Dial(dahdi/1/99999999,120)<br>exten => 1,n,Hangup()<br><br># destination leg<br>[read]<br>exten => 1,1,Answer()<br>exten => 1,n,Read(data,play-msg,4,,2,15)<br>exten => 1,n,Verbose("${data}")<br>exten => 1,n,AGI(send_data.py,${data})<br>exten => 1,n,Hangup()<br><br>Action: Originate<br>Channel: Local/1@dialout<br>Context: read<br>Exten: 1<br>Priority: 1<br>Timeout: 120000<br><br>Note, that the timeout applies to waiting for the Channel "source leg", <br>endpoint to pick up. If you put the timeout to say 1000, (1 second), <br>asterisk will kill the call before the Dial() timeout of 120 seconds hit.<br><br><br><br>On 11/16/2010 07:57 AM, Sidarta Aguiar de Oliveira wrote:<br>> Hello,<br>><br>> I don't really understand how channel Local works. I need that asterisk<br>> initiate a call and get some data (DTMF).<br>><br>> So to do that I've created this dialplan :<br>><br>> ; extensions.conf - the Asterisk dial plan<br>> ;<br>> [general]<br>> static=yes<br>> writeprotect=no<br>> clearglobalvars=no<br>><br>> [dtmf]<br>> exten => 1,1,Verbose(Get User ID)<br>> exten => 1,n,Dial(dahdi/1/99999999,120,G(read^1^1))<br>> exten => 1,n,Hangup()<br>><br>> [read]<br>> exten => 1,1,Hangup()<br>> exten => 1,n,Read(data,play-msg,4,,2,15)<br>> exten => 1,n,Verbose("${data}")<br>> exten => 1,n,AGI(send_data.py,${data})<br>> exten => 1,n,Hangup()<br>><br>> File: test.call<br>><br>> Channel: Local/1@dtmf<br>> Application: NoOp<br>><br>> I've create a file name test.call and then move the call file to the dir<br>> /var/spool/asterisk/outgoing/. Some issues I've had, the option G, in<br>> the Dial function don't wait the user answer the call to follow the<br>> dialplan. Is this rigth? Is this because I have used a Local Channel?<br>> Are better way to do that?<br>><br>> Regards,<br>> *<br>> *<br>> *Sidarta Oliveira*<br>><br><br><br>-- <br>_____________________________________________________________________<br>-- Bandwidth and Colocation Provided by http://www.api-digital.com --<br>New to Asterisk? Join us for a live introductory webinar every Thurs:<br> http://www.asterisk.org/hello<br><br>asterisk-users mailing list<br>To UNSUBSCRIBE or update options visit:<br> http://lists.digium.com/mailman/listinfo/asterisk-users<br></div></div></body></html>