[Asterisk-java-users] Re: Controlling the Queue
Brought to you by:
srt
From: <ine...@gm...> - 2005-09-27 08:00:26
|
hello, i'm a student, and i'm a beginner in the asterisk world !!! i've got a few questions, i hope you can help me : - i'm trying to do an application in java, wich receives a call, palys a audio file, wait for digits, then hangs up. but i can't find how to receive the events, and how to asnwer the phone. voila mon petit code : public void run () throws IOException, AuthenticationFailedException, TimeoutException, InterruptedException =09{ =09=09//boolean x=3Dtrue; =09=09=09 =09=09//register for events managerConnection.addEventHandler(this); // connect to Asterisk and log in managerConnection.login(); wait(); //and finally log off and disconnect managerConnection.logoff(); =09} =09public void handleEvent(ManagerEvent event) =09{ =09=09// just print received events =09=09System.out.println("this is an event: "+event); =09=09String source =3D event.getSource().toString(); =09=09System.out.println("Source : "+source); =09=09//print type of event =09=09System.out.println("Type of the event : "+event.getClass().getSimpleN= ame()); =09=09=09=09 =09} On 9/26/05, Alex <ab...@ga...> wrote: > Hi: > > My system has the following architecture (in the server side): > > - An app server (connected to the asterisk console) > - An AGI Server (developed with AsteriskJava) > - An AGI Script (executed by the above AGI Server) > > In the client side (Agents answering call center calls): > > - A softphone > - A client program (used to search and register call details) > > Here is the thing: > > - From AGI Server I detect that a call is coming from PSTN and launch the > AGI Script > - From AGI Script I put the call in the queue and I loose the control of = the > call (here is my first confusion) > - The agent answer the call (using his/her softphone) and I get the event > from the Asterisk Console with my App Server. > > Now, I need to play something (TTS, wav, etc) to the caller based on the > client application wich is connected to my App Server. What I want you to > know is that the information to be played to the caller comes from an > external source. > > So, my two big questions/confusions are: > > - How can I get the entire control of the call depending on the status of > the call, for example, if the call is in the queue and I need to play or = do > something with it, where and how I have the control? until now, when I pu= t > the call in the queue I loss the control until the caller or the agent ha= ngs > the call. > > - Once the call is answered by the Agent, how can I unlink the two channe= ls > (releasing the agent) to let the caller hear the text that the agent sent= . > > > Thanks in advance, > > Alejandro > > > -- In=E9s MOUSSA =C9l=E8ve ing=E9nieur g=E9nie logiciel 21 rue Henri Marrou Chatenay-Malabry 92290 Tel : 00 33 613984578 ine...@gm... ine...@ec... |