Re: [Asterisk-java-devel] How to Cancel a Dial command
Brought to you by:
srt
From: Yves A. <yv...@gm...> - 2012-01-05 10:46:09
|
Hi, unfortunately I do not understand you fully. What do you mean with "sufer"? What is the Event 4xx, 5xx ...? Please explain. And explain exactly what your Objective is. When To call who, And so on. I dont understand what you mean by cancel the dial on timeout...? After a timeout the dial IS finished... cancelling for me would be something like interrupting a running dial command. At First Reading it Looks like you're needing Something like a Queue...? Or an IVR? Regards, Yves Am 04.01.2012 um 22:23 schrieb "Jeryes ." <je...@vo...>: > Hi Yves, > > Happy new year and thanks for your quick reply!! > > Actually, I fixed the problem, sorry it was my fault... > > I'm working on an application based on fast-agi, and I've created an AsteriskServer that implements the interface BaseAgiScript, to receive and process calls from Asterisk. > After receive a new call, the application dial to some destination (e.g. user1), and in some situation, like timeout of dialing, the application must cancel that Dial and > create a new one to other destination, but I was doing in a wrong way, I was looking for a way to Cancel the Dial, and I guess that I can't do it, > so I fixed the problem adding the timeout value in the Dial command, now the Asterisk is sending that Cancel when the timeout expires, and it's working: > > Example code of implementation: > > public class AsteriskServer extends BaseAgiScript > { > > /** > * The service method is called whenever AgiAsteriskServer receive a new > * incoming AgiRequest. > */ > public void service(AgiRequest request, AgiChannel channel) throws AgiException > { > //Some code > > try > { > channel.exec("Dial", "SIP/user1, 20"); > > } catch (Exception e) { > //do something > } finally { > //do something > } > > //Some code > > } > } > > and 20 is the timeout to that destination. > > Now I'm facing another problem, the command Dial is not running on background, it keeps the Thread that executed the command in wait until the Dial sufers some dinconnection event (4xx, 5xx or 6xx) > So do I need to create a new Thread to execute the command Dial? > And is there another way besides the CLI to originate a new Call using fast-agi? > > > Thank you!! > > Best regards > Jeryes > > > 2012/1/3 Yves A. <yv...@gm...> > Hi, > > happy new year, welcome to the list and congrats... you´re the first in 2012! > reason enough for me to flood you with solutions, but.... > > you gave too little info...at least for me...: > - a few more lines of code would be helpful... full code would be best + part of the dialplan where you call the agi.. > - what is your objective? > - any exceptions / interesting logs? > - how do you define timeout? I don´t see any at your dial command. > - what did you try so far and what was the result? > > regards, > yves > > > Am 03.01.2012 21:55, schrieb Jeryes .: >> >> Hi All, >> >> I'm using java fast-agi protocol, >> and I'm dialing to new destinations based on the existing channel: >> >> channel.exec("Dial","SIP/extension1") >> >> and I'm facing a problem to cancel that dial if the call sufers a timeout, and originate new call to other destination. Do someone have faced that problem or have any idea to implement this scenario? >> >> I'm working with the versions below: >> asterisk 1.6.2.22 >> asterisk-java 1.0.0 >> >> Thanks in advance! >> >> Jeryes >> >> >> ------------------------------------------------------------------------------ >> Write once. Port to many. >> Get the SDK and tools to simplify cross-platform app development. Create >> new or port existing apps to sell to consumers worldwide. Explore the >> Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join >> http://p.sf.net/sfu/intel-appdev >> >> >> _______________________________________________ >> Asterisk-java-devel mailing list >> Ast...@li... >> https://lists.sourceforge.net/lists/listinfo/asterisk-java-devel > > > ------------------------------------------------------------------------------ > Write once. Port to many. > Get the SDK and tools to simplify cross-platform app development. Create > new or port existing apps to sell to consumers worldwide. Explore the > Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join > http://p.sf.net/sfu/intel-appdev > _______________________________________________ > Asterisk-java-devel mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-devel > > > ------------------------------------------------------------------------------ > Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex > infrastructure or vast IT resources to deliver seamless, secure access to > virtual desktops. With this all-in-one solution, easily deploy virtual > desktops for less than the cost of PCs and save 60% on VDI infrastructure > costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox > _______________________________________________ > Asterisk-java-devel mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-devel |