Thread: [Asterisk-java-users] Controlling the Queue
Brought to you by:
srt
From: Alex <ab...@ga...> - 2005-09-26 21:31:37
|
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 put the call in the queue I loss the control until the caller or = the agent hangs the call. - Once the call is answered by the Agent, how can I unlink the two = channels (releasing the agent) to let the caller hear the text that the = agent sent. Thanks in advance, Alejandro |
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... |
From: <ine...@gm...> - 2005-09-27 08:01:26
|
thank's in advance have a nice day ines On 9/27/05, In=E9s <ine...@gm...> wrote: > 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().getSimpleName()); > =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 t= he > > AGI Script > > - From AGI Script I put the call in the queue and I loose the control o= f > the > > call (here is my first confusion) > > - The agent answer the call (using his/her softphone) and I get the eve= nt > > from the Asterisk Console with my App Server. > > > > Now, I need to play something (TTS, wav, etc) to the caller based on th= e > > 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 o= r > do > > something with it, where and how I have the control? until now, when I > put > > the call in the queue I loss the control until the caller or the agent > hangs > > the call. > > > > - Once the call is answered by the Agent, how can I unlink the two > channels > > (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... > -- 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... |
From: Jan E. <jan...@pl...> - 2005-09-27 08:13:07
|
On Tuesday 27 September 2005 11:00, In=E9s wrote: > 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. RedirectAction can be used to answer the phone, but then you'll need to hav= e=20 the caller call a queue or similar. I'm not sure if Asterisk-Java can work = as=20 a softphone by itself, I don't think so. The AGI command GetDataCommand see= ms=20 to be able to read DTMF stuff, but I haven't used it myself. > voila mon petit code : > public void run () throws IOException, AuthenticationFailedException, > TimeoutException, InterruptedException > { > //boolean x=3Dtrue; > > //register for events > managerConnection.addEventHandler(this); > > // connect to Asterisk and log in > managerConnection.login(); > > > wait(); > > //and finally log off and disconnect > managerConnection.logoff(); > > } > public void handleEvent(ManagerEvent event) > { > // just print received events > System.out.println("this is an event: "+event); > String source =3D event.getSource().toString(); > System.out.println("Source : "+source); > //print type of event > System.out.println("Type of the event : > "+event.getClass().getSimpleName()); > > } > > 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 t= he > > 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 eve= nt > > 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 > > put the call in the queue I loss the control until the caller or the > > agent hangs the call. > > > > - Once the call is answered by the Agent, how can I unlink the two > > channels (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... > > > ------------------------------------------------------- > SF.Net email is sponsored by: > Tame your development challenges with Apache's Geronimo App Server. > Download it for free - -and be entered to win a 42" plasma tv or your very > own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users =2D-=20 Jan Ekholm jan...@pl... |
From: Gerwin B. <ger...@gm...> - 2005-09-27 08:22:21
|
Hi, is there a certain reason why you try to use the manager API for Call =20= handling? Just extend the BaseAGIScript and do your call handling there. More Info can be found here: http://asterisk-java.sourceforge.net/tutorial.html look at the AGI section. Gerwin On Sep 27, 2005, at 10:13 AM, Jan Ekholm wrote: > On Tuesday 27 September 2005 11:00, In=E9s wrote: > >> 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, =20 >> 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 =20 >> phone. >> > > RedirectAction can be used to answer the phone, but then you'll =20 > need to have > the caller call a queue or similar. I'm not sure if Asterisk-Java =20 > can work as > a softphone by itself, I don't think so. The AGI command =20 > GetDataCommand seems > to be able to read DTMF stuff, but I haven't used it myself. > > > >> voila mon petit code : >> public void run () throws IOException, AuthenticationFailedException, >> TimeoutException, InterruptedException >> { >> //boolean x=3Dtrue; >> >> //register for events >> managerConnection.addEventHandler(this); >> >> // connect to Asterisk and log in >> managerConnection.login(); >> >> >> wait(); >> >> //and finally log off and disconnect >> managerConnection.logoff(); >> >> } >> public void handleEvent(ManagerEvent event) >> { >> // just print received events >> System.out.println("this is an event: "+event); >> String source =3D event.getSource().toString(); >> System.out.println("Source : "+source); >> //print type of event >> System.out.println("Type of the event : >> "+event.getClass().getSimpleName()); >> >> } >> >> 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: >>> >>> - =46rom AGI Server I detect that a call is coming from PSTN and =20 >>> launch the >>> AGI Script >>> - =46rom AGI Script I put the call in the queue and I loose the =20 >>> control of >>> the call (here is my first confusion) >>> - The agent answer the call (using his/her softphone) and I get =20 >>> the event >>> from the Asterisk Console with my App Server. >>> >>> Now, I need to play something (TTS, wav, etc) to the caller based =20= >>> on the >>> client application wich is connected to my App Server. What I =20 >>> want you to >>> know is that the information to be played to the caller comes =20 >>> from an >>> external source. >>> >>> So, my two big questions/confusions are: >>> >>> - How can I get the entire control of the call depending on the =20 >>> status of >>> the call, for example, if the call is in the queue and I need to =20 >>> play or >>> do something with it, where and how I have the control? until =20 >>> now, when I >>> put the call in the queue I loss the control until the caller or the >>> agent hangs the call. >>> >>> - Once the call is answered by the Agent, how can I unlink the two >>> channels (releasing the agent) to let the caller hear the text =20 >>> 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... >> >> >> ------------------------------------------------------- >> SF.Net email is sponsored by: >> Tame your development challenges with Apache's Geronimo App Server. >> Download it for free - -and be entered to win a 42" plasma tv or =20 >> your very >> own Sony(tm)PSP. Click here to play: http://sourceforge.net/=20 >> geronimo.php >> _______________________________________________ >> Asterisk-java-users mailing list >> Ast...@li... >> https://lists.sourceforge.net/lists/listinfo/asterisk-java-users >> > > --=20 > Jan Ekholm > jan...@pl... > > > ------------------------------------------------------- > SF.Net email is sponsored by: > Tame your development challenges with Apache's Geronimo App Server. > Download it for free - -and be entered to win a 42" plasma tv or =20 > your very > own Sony(tm)PSP. Click here to play: http://sourceforge.net/=20 > geronimo.php > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > |
From: Jan E. <jan...@pl...> - 2005-09-27 08:32:58
|
On Tuesday 27 September 2005 11:22, Gerwin Bruner wrote: > Hi, > > is there a certain reason why you try to use the manager API for Call > handling? No special reason at all really. As a total newbie to Asterisk I looked at= =20 what Flash Operator Panel did and found that AMI seemed to have the=20 components I wanted for queue handling, calling and generally keeping up to= =20 date with calls, channels and peers. I have no idea wether I could combine AMI with AGI and cherry pick from bot= h.=20 Maybe my own redirection problems could be solved using something from the= =20 AGI world. > Just extend the BaseAGIScript and do your call handling there. > More Info can be found here: > http://asterisk-java.sourceforge.net/tutorial.html > > look at the AGI section. > > Gerwin > > On Sep 27, 2005, at 10:13 AM, Jan Ekholm wrote: > > On Tuesday 27 September 2005 11:00, In=E9s wrote: > >> 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. > > > > RedirectAction can be used to answer the phone, but then you'll > > need to have > > the caller call a queue or similar. I'm not sure if Asterisk-Java > > can work as > > a softphone by itself, I don't think so. The AGI command > > GetDataCommand seems > > to be able to read DTMF stuff, but I haven't used it myself. > > > >> voila mon petit code : > >> public void run () throws IOException, AuthenticationFailedException, > >> TimeoutException, InterruptedException > >> { > >> //boolean x=3Dtrue; > >> > >> //register for events > >> managerConnection.addEventHandler(this); > >> > >> // connect to Asterisk and log in > >> managerConnection.login(); > >> > >> > >> wait(); > >> > >> //and finally log off and disconnect > >> managerConnection.logoff(); > >> > >> } > >> public void handleEvent(ManagerEvent event) > >> { > >> // just print received events > >> System.out.println("this is an event: "+event); > >> String source =3D event.getSource().toString(); > >> System.out.println("Source : "+source); > >> //print type of event > >> System.out.println("Type of the event : > >> "+event.getClass().getSimpleName()); > >> > >> } > >> > >> 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 > >>> put the call in the queue I loss the control until the caller or the > >>> agent hangs the call. > >>> > >>> - Once the call is answered by the Agent, how can I unlink the two > >>> channels (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... > >> > >> > >> ------------------------------------------------------- > >> SF.Net email is sponsored by: > >> Tame your development challenges with Apache's Geronimo App Server. > >> Download it for free - -and be entered to win a 42" plasma tv or > >> your very > >> own Sony(tm)PSP. Click here to play: http://sourceforge.net/ > >> geronimo.php > >> _______________________________________________ > >> Asterisk-java-users mailing list > >> Ast...@li... > >> https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > > > > -- > > Jan Ekholm > > jan...@pl... > > > > > > ------------------------------------------------------- > > SF.Net email is sponsored by: > > Tame your development challenges with Apache's Geronimo App Server. > > Download it for free - -and be entered to win a 42" plasma tv or > > your very > > own Sony(tm)PSP. Click here to play: http://sourceforge.net/ > > geronimo.php > > _______________________________________________ > > Asterisk-java-users mailing list > > Ast...@li... > > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > > ------------------------------------------------------- > SF.Net email is sponsored by: > Tame your development challenges with Apache's Geronimo App Server. > Download it for free - -and be entered to win a 42" plasma tv or your very > own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users =2D-=20 Jan Ekholm jan...@pl... |