asterisk-java-users Mailing List for Asterisk-Java Library (Page 156)
Brought to you by:
srt
You can subscribe to this list here.
2005 |
Jan
|
Feb
(8) |
Mar
(33) |
Apr
(36) |
May
(19) |
Jun
(21) |
Jul
(53) |
Aug
(30) |
Sep
(36) |
Oct
(34) |
Nov
(43) |
Dec
(72) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(123) |
Feb
(75) |
Mar
(86) |
Apr
(46) |
May
(41) |
Jun
(29) |
Jul
(76) |
Aug
(38) |
Sep
(39) |
Oct
(68) |
Nov
(16) |
Dec
(17) |
2007 |
Jan
(34) |
Feb
(18) |
Mar
(39) |
Apr
(30) |
May
(20) |
Jun
(10) |
Jul
(59) |
Aug
(54) |
Sep
(60) |
Oct
(22) |
Nov
(14) |
Dec
(10) |
2008 |
Jan
(34) |
Feb
(67) |
Mar
(65) |
Apr
(67) |
May
(60) |
Jun
(51) |
Jul
(88) |
Aug
(75) |
Sep
(47) |
Oct
(143) |
Nov
(54) |
Dec
(42) |
2009 |
Jan
(46) |
Feb
(80) |
Mar
(162) |
Apr
(159) |
May
(200) |
Jun
(34) |
Jul
(46) |
Aug
(59) |
Sep
(5) |
Oct
(35) |
Nov
(73) |
Dec
(30) |
2010 |
Jan
(23) |
Feb
(50) |
Mar
(8) |
Apr
(24) |
May
(19) |
Jun
(49) |
Jul
(56) |
Aug
(35) |
Sep
(26) |
Oct
(79) |
Nov
(39) |
Dec
(34) |
2011 |
Jan
(27) |
Feb
(22) |
Mar
(28) |
Apr
(12) |
May
(16) |
Jun
(19) |
Jul
(1) |
Aug
(64) |
Sep
(19) |
Oct
(11) |
Nov
(17) |
Dec
(12) |
2012 |
Jan
(6) |
Feb
(8) |
Mar
(15) |
Apr
(43) |
May
(41) |
Jun
(14) |
Jul
(32) |
Aug
(3) |
Sep
(4) |
Oct
(7) |
Nov
(11) |
Dec
(11) |
2013 |
Jan
(35) |
Feb
(11) |
Mar
(23) |
Apr
(25) |
May
(37) |
Jun
(47) |
Jul
(25) |
Aug
(21) |
Sep
|
Oct
(1) |
Nov
(9) |
Dec
|
2014 |
Jan
(26) |
Feb
(2) |
Mar
(18) |
Apr
(41) |
May
(7) |
Jun
(7) |
Jul
(24) |
Aug
(5) |
Sep
(6) |
Oct
(8) |
Nov
(9) |
Dec
(7) |
2015 |
Jan
(7) |
Feb
(15) |
Mar
(8) |
Apr
(12) |
May
(7) |
Jun
|
Jul
|
Aug
(5) |
Sep
(1) |
Oct
(3) |
Nov
(30) |
Dec
(3) |
2016 |
Jan
(1) |
Feb
|
Mar
(2) |
Apr
|
May
(9) |
Jun
|
Jul
|
Aug
(3) |
Sep
|
Oct
|
Nov
|
Dec
|
2017 |
Jan
|
Feb
|
Mar
(3) |
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
(2) |
Oct
|
Nov
|
Dec
|
2018 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(8) |
Dec
(4) |
2019 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
2020 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(2) |
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: King H. <kin...@ne...> - 2006-03-04 12:06:24
|
Hi, I look through the code but can't find a way to login with Events turned = off. I know there is a LoginAction where I can call setEvents("off"). = But I can't send the action until I am already login. Am I missing = something? Thanks. King |
From: Stefan R. <sr...@re...> - 2006-03-04 11:45:25
|
Interrupting the calling thread is probably a bug... Would changing this stuff to use notify help? King Ho wrote: > I think I have also been bitten by this stray "interrupt" but I have no= t gone so far as to track down where it was thrown.=20 >=20 > I was having a queue.take() waiting for commands to send to the Asteris= k but it was being interrupted all the time :( =20 >=20 > I have since changed to starting a new thread for each command to send = to Asterisk instead. I think this has the added benefit that a stuck conn= ection will not hang the whole program. >=20 > King >=20 > -----Original Message----- > From: ast...@li... [mailto:asterisk-= jav...@li...] On Behalf Of Brett Sutton > Sent: Saturday, March 04, 2006 7:19 PM > To: ast...@li... > Subject: [Asterisk-java-users] ManagerReader Interrupt >=20 > I believe that there is a bug in the=20 > DefaultManagerConnection.sendAction(ManagerAction action, long timeout)= =20 > method. >=20 > The problem is with the creation of the ResponseHandlerResult. >=20 > The ResponseHandlerResult calls thread.interrupt to wake up the thread = > which called sendAction. Thats fine, the problem begins when the=20 > sendAction returns (with or without a response). > Calling Thread.interupt leaves the thread in an interrupted state until= =20 > some method (such as sleep) checks the threads interrupt state at which= =20 > point the interrupt state is cleared. > The problem occurs if the call to interrupt is made when sendAction is = > not currently sleeping. There are numerous ways in which this can happe= n. > The impact on sendAction is zero. However if an application then calls = a=20 > method such as Thread.sleep or Queue.take the method call will=20 > immediately throw an Interrupted exception as the thread is still in an= =20 > interrupted state. >=20 > I believe a better way of dealing with this problem is to use=20 > Object.wait(x) and Object.notify. For the purposes of sendAction the=20 > affects are identical without the nasty side effects of calling interru= pt. >=20 > I hope this makes some sense. >=20 > Regards, > Brett. >=20 >=20 >=20 >=20 >=20 >=20 >=20 > ------------------------------------------------------- > This SF.Net email is sponsored by xPML, a groundbreaking scripting lang= uage > that extends applications into web and mobile media. Attend the live we= bcast > and join the prime developer group breaking into this new coding territ= ory! > http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D110944&bid=3D241720&dat= =3D121642 > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users >=20 >=20 >=20 >=20 > ------------------------------------------------------- > This SF.Net email is sponsored by xPML, a groundbreaking scripting lang= uage > that extends applications into web and mobile media. Attend the live we= bcast > and join the prime developer group breaking into this new coding territ= ory! > http://sel.as-us.falkag.net/sel?cmd=3Dk&kid=110944&bid$1720&dat=121642 > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users --=20 reuter network consulting Neusser Str. 110 50760 K=C3=B6ln Germany Telefon: +49 221 1305699-0 Telefax: +49 221 1305699-90 E-Mail: sr...@re... Jabber: sr...@ja... |
From: King H. <kin...@ne...> - 2006-03-04 11:31:43
|
I think I have also been bitten by this stray "interrupt" but I have not = gone so far as to track down where it was thrown.=20 I was having a queue.take() waiting for commands to send to the Asterisk = but it was being interrupted all the time :( =20 I have since changed to starting a new thread for each command to send = to Asterisk instead. I think this has the added benefit that a stuck = connection will not hang the whole program. King -----Original Message----- From: ast...@li... = [mailto:ast...@li...] On Behalf Of = Brett Sutton Sent: Saturday, March 04, 2006 7:19 PM To: ast...@li... Subject: [Asterisk-java-users] ManagerReader Interrupt I believe that there is a bug in the=20 DefaultManagerConnection.sendAction(ManagerAction action, long timeout)=20 method. The problem is with the creation of the ResponseHandlerResult. The ResponseHandlerResult calls thread.interrupt to wake up the thread=20 which called sendAction. Thats fine, the problem begins when the=20 sendAction returns (with or without a response). Calling Thread.interupt leaves the thread in an interrupted state until=20 some method (such as sleep) checks the threads interrupt state at which=20 point the interrupt state is cleared. The problem occurs if the call to interrupt is made when sendAction is=20 not currently sleeping. There are numerous ways in which this can = happen. The impact on sendAction is zero. However if an application then calls a = method such as Thread.sleep or Queue.take the method call will=20 immediately throw an Interrupted exception as the thread is still in an=20 interrupted state. I believe a better way of dealing with this problem is to use=20 Object.wait(x) and Object.notify. For the purposes of sendAction the=20 affects are identical without the nasty side effects of calling = interrupt. I hope this makes some sense. Regards, Brett. ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting = language that extends applications into web and mobile media. Attend the live = webcast and join the prime developer group breaking into this new coding = territory! http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D110944&bid=3D241720&dat=3D= 121642 _______________________________________________ Asterisk-java-users mailing list Ast...@li... https://lists.sourceforge.net/lists/listinfo/asterisk-java-users |
From: Brett S. <bs...@no...> - 2006-03-04 11:19:46
|
I believe that there is a bug in the DefaultManagerConnection.sendAction(ManagerAction action, long timeout) method. The problem is with the creation of the ResponseHandlerResult. The ResponseHandlerResult calls thread.interrupt to wake up the thread which called sendAction. Thats fine, the problem begins when the sendAction returns (with or without a response). Calling Thread.interupt leaves the thread in an interrupted state until some method (such as sleep) checks the threads interrupt state at which point the interrupt state is cleared. The problem occurs if the call to interrupt is made when sendAction is not currently sleeping. There are numerous ways in which this can happen. The impact on sendAction is zero. However if an application then calls a method such as Thread.sleep or Queue.take the method call will immediately throw an Interrupted exception as the thread is still in an interrupted state. I believe a better way of dealing with this problem is to use Object.wait(x) and Object.notify. For the purposes of sendAction the affects are identical without the nasty side effects of calling interrupt. I hope this makes some sense. Regards, Brett. |
From: King H. <kin...@ne...> - 2006-03-04 10:35:40
|
I'll try to download 0.3 snapshot from the cvs archive later. The gz = version that I just download don't have the fix in yet.=20 However, after thinking about it, using a synchronized block may be an = overkill for 'determineScript' as there will be a slight performance = hit. Unless you are planning on allowing the reloading of a new mapping = after the first one is loaded. Furthermore, as there is a constructor = that allows the specification of the bundle name, I don't think there is = really a need for setResourceBundleName(). Since I don't use the = setResourceBundleName() myself, I am biased ;) King -----Original Message----- From: ast...@li... = [mailto:ast...@li...] On Behalf Of = Stefan Reuter Sent: Saturday, March 04, 2006 5:19 PM To: ast...@li... Subject: Re: [Asterisk-java-users] Timing issue with = ResourceBundleMappingStrategy Hi, thanks for reporting this bug. I fixed it for 0.3 by putting loadResourceBundle() inside a synchronized block. Moving it into the constructor would also have worked but then I also had to change setResourceBundleName(). Do you need a fix for 0.2 or is it ok for you to switch to a 0.3 = snapshot? =3DStefan --=20 reuter network consulting Neusser Str. 110 50760 K=C3=B6ln Germany Telefon: +49 221 1305699-0 Telefax: +49 221 1305699-90 E-Mail: sr...@re... Jabber: sr...@ja... |
From: Stefan R. <sr...@re...> - 2006-03-04 09:19:25
|
Hi, thanks for reporting this bug. I fixed it for 0.3 by putting loadResourceBundle() inside a synchronized block. Moving it into the constructor would also have worked but then I also had to change setResourceBundleName(). Do you need a fix for 0.2 or is it ok for you to switch to a 0.3 snapshot= ? =3DStefan --=20 reuter network consulting Neusser Str. 110 50760 K=C3=B6ln Germany Telefon: +49 221 1305699-0 Telefax: +49 221 1305699-90 E-Mail: sr...@re... Jabber: sr...@ja... |
From: King H. <kin...@ne...> - 2006-03-04 06:14:00
|
Hi, I've found a problem with the ResourceBundleMappingStrategy when after = the server=20 startup and several AGI requests comes in at the same time, then it is = possible that=20 other than the first request, the other may failed with the 'No script = configured for URL'=20 error.=20 This is because the first request will do a 'loadResourceBundle' and set = mappings =3D new HashMap() The other request will see that 'mapping' is not null and will proceed = to do a lookup. If=20 'loadResourceBundle' has not finished reading the mapping the server = will give the=20 'No script configured for URL' error. Setting 'mappings' at the end of 'loadResourceBundle' will also not work = as the=20 other requests will each do a 'loadResourceBundle'. I think one way to = solve this=20 problem is to do 'loadResourceBundle' in the = 'ResourceBundleMappingStrategy' constructor.=20 Thanks. Best Regards, King Ho |
From: Brett S. <bs...@no...> - 2006-03-02 20:14:48
|
The chances of your applications hanging on that actual line are about zero. I do however note that the line has two \n's. I would strong suggest testing your service method as a standalone application (just re-write it as a main()). Regards, Brett. Jason Wolfe wrote: > Stefan, > > When I found out that newline is sufficient for adding multiple mappings to > fastagi-mapping.properties, I realized that the problem was deeper. I have > the following code that works right up to the last line, where I concatenate > a string 'etext' with the += operator. > > **************************************************************************** > ************** > **************************************************************************** > **************** > > import net.sf.asterisk.fastagi.AGIChannel; > import net.sf.asterisk.fastagi.AGIException; > import net.sf.asterisk.fastagi.AGIRequest; > import net.sf.asterisk.fastagi.BaseAGIScript; > > import java.util.*; > import javax.mail.*; > import javax.mail.internet.*; > > public class imail extends BaseAGIScript { > public void service(AGIRequest request, AGIChannel channel) throws > AGIException > { > System.out.println("Starting Insurance Email AGI"); > String itype, year, make, model, areacode; > String dmail,etext,email1,email2,email3; > > email1 = "jason"; > email2 = "clickforacall"; > email3 = "com"; > itype = "error"; > year = "error"; > make = "error"; > model = "error"; > areacode = "error"; > > try { > email1 = request.getParameter("email1"); > email2 = request.getParameter("email2"); > email3 = request.getParameter("email3"); > > itype = request.getParameter("itype"); > year = request.getParameter("year"); > make = request.getParameter("make"); > model = request.getParameter("model"); > areacode = request.getParameter("areacode"); > System.out.println("Parameters accepted"); > } catch (Exception e) { > System.out.println(e); > } > etext = "Hello,\n"; > etext += "The Customer has entered the following information at the > time of call:\n\n"; //HANGS ON THIS LINE > > > //I cant make it past the line above my concatenation. > > > > > > > > > > > /* > etext += "Insurance Type: " + itype + "\n"; > etext += "Auto Year: " + year + "\n"; > etext += "Auto Make: " + make + "\n"; > etext += "Auto Model: " + model + "\n"; > etext += "Customer Area Code: " + areacode + "\n"; > System.out.println("text set"); > > > Properties props = new Properties(); > props.put("mail.smtp.host", "mail.clickforacall.com"); > Session s = Session.getInstance(props,null); > > MimeMessage message = new MimeMessage(s); > > try{ > > InternetAddress from = new > InternetAddress("Quo...@cl..."); > message.setFrom(from); > String toAddress = request.getParameter("to"); > InternetAddress to = new InternetAddress(email1 + "@" + email2 + "." + > email3); > message.addRecipient(Message.RecipientType.TO, to); > }catch(Exception e){ > System.out.println("EXCEPTION_1:" + e); > } > > > > > > String subject = "Customer Quote Data"; > > try{ > > message.setSubject(subject); > message.setText(etext); > > Transport.send(message); > }catch(Exception e){ > System.out.println("EXCEPTION_2:" + e); > } > > //get some variables and send the email... > > > */ > } > > } > > **************************************************************************** > ******* > **************************************************************************** > ******* > > > This was working for awhile, and then suddenly stoped. Any ideas why this > would cause the script to hang? > > It leaves the last message on the screen >>> INFO: Received Connection <<< > and that's it. > > If there are additional log files that would help, could you tell me where > to find them? > > Thanks, > Jason > > > > ------------------------------------------------------- > This SF.Net email is sponsored by xPML, a groundbreaking scripting language > that extends applications into web and mobile media. Attend the live webcast > and join the prime developer group breaking into this new coding territory! > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > |
From: Jason W. <ja...@cl...> - 2006-03-02 20:03:15
|
Stefan, When I found out that newline is sufficient for adding multiple mappings to fastagi-mapping.properties, I realized that the problem was deeper. I have the following code that works right up to the last line, where I concatenate a string 'etext' with the += operator. **************************************************************************** ************** **************************************************************************** **************** import net.sf.asterisk.fastagi.AGIChannel; import net.sf.asterisk.fastagi.AGIException; import net.sf.asterisk.fastagi.AGIRequest; import net.sf.asterisk.fastagi.BaseAGIScript; import java.util.*; import javax.mail.*; import javax.mail.internet.*; public class imail extends BaseAGIScript { public void service(AGIRequest request, AGIChannel channel) throws AGIException { System.out.println("Starting Insurance Email AGI"); String itype, year, make, model, areacode; String dmail,etext,email1,email2,email3; email1 = "jason"; email2 = "clickforacall"; email3 = "com"; itype = "error"; year = "error"; make = "error"; model = "error"; areacode = "error"; try { email1 = request.getParameter("email1"); email2 = request.getParameter("email2"); email3 = request.getParameter("email3"); itype = request.getParameter("itype"); year = request.getParameter("year"); make = request.getParameter("make"); model = request.getParameter("model"); areacode = request.getParameter("areacode"); System.out.println("Parameters accepted"); } catch (Exception e) { System.out.println(e); } etext = "Hello,\n"; etext += "The Customer has entered the following information at the time of call:\n\n"; //HANGS ON THIS LINE //I cant make it past the line above my concatenation. /* etext += "Insurance Type: " + itype + "\n"; etext += "Auto Year: " + year + "\n"; etext += "Auto Make: " + make + "\n"; etext += "Auto Model: " + model + "\n"; etext += "Customer Area Code: " + areacode + "\n"; System.out.println("text set"); Properties props = new Properties(); props.put("mail.smtp.host", "mail.clickforacall.com"); Session s = Session.getInstance(props,null); MimeMessage message = new MimeMessage(s); try{ InternetAddress from = new InternetAddress("Quo...@cl..."); message.setFrom(from); String toAddress = request.getParameter("to"); InternetAddress to = new InternetAddress(email1 + "@" + email2 + "." + email3); message.addRecipient(Message.RecipientType.TO, to); }catch(Exception e){ System.out.println("EXCEPTION_1:" + e); } String subject = "Customer Quote Data"; try{ message.setSubject(subject); message.setText(etext); Transport.send(message); }catch(Exception e){ System.out.println("EXCEPTION_2:" + e); } //get some variables and send the email... */ } } **************************************************************************** ******* **************************************************************************** ******* This was working for awhile, and then suddenly stoped. Any ideas why this would cause the script to hang? It leaves the last message on the screen >>> INFO: Received Connection <<< and that's it. If there are additional log files that would help, could you tell me where to find them? Thanks, Jason |
From: Stefan R. <sr...@re...> - 2006-03-02 09:04:40
|
sa...@st... wrote: > I sometimes get "error" back and sometimes "permission denied"? please enable debuging on your Asterisk console and look what error messages you receive there. "Permission denied" generally indicates that your user lacks read or write permissions in manager.conf. For Monitor you have to grant "call" permission to your manager user. =3DStefan --=20 reuter network consulting Neusser Str. 110 50760 K=F6ln Germany Telefon: +49 221 1305699-0 Telefax: +49 221 1305699-90 E-Mail: sr...@re... |
From: Stefan R. <sr...@re...> - 2006-03-02 08:58:46
|
Hi Jason, Jason Wolfe wrote: > I've tried a space, a comma, ;, and : and newline... as this is just a regular java properties file a newline should be fine. > I have >=20 > prop1.agi =3D prop1 > prop3.agi =3D prop3 >=20 > but prop3 gives severe error that looks good. Do you have a newline at the end of the file? Please send me your properties file as attachment and the exceprt of your logfile and I will have a closer look at it. =3DStefan |
From: <sa...@st...> - 2006-03-02 00:31:15
|
Hello, I recently upgraded asterisk and the java api to version 2 but since then my previous code which used to use monitor action. Could someone please tell me if I need to make any modification? I do know I have to append the id in the channels but other than that are there any other changes? This is the code I am using - MonitorAction ma = new MonitorAction("SIP/3004-5bab","testsdgsdgdsgsdg"); ManagerResponse originateResponse; Boolean yes = new Boolean("true"); ma.setMix(yes); managerConnection.login(); originateResponse = managerConnection.sendAction(ma); System.out.println(originateResponse.getResponse()); managerConnection.logoff(); I sometimes get "error" back and sometimes "permission denied"? |
From: Jason W. <ja...@cl...> - 2006-03-01 16:45:46
|
Anyone have any idea how to add additional mappings? I can get it to work with only one mapping... subsequent mappings are ignored. I've tried a space, a comma, ;, and : and newline... I have prop1.agi = prop1 prop3.agi = prop3 but prop3 gives severe error thanks! jason Jason Wolfe, CTO Click For A Call, Inc. ja...@cl... c (770) 561-6956 This e-mail transmission may contain information that is proprietary, privileged and/or confidential and is intended exclusively for the person(s) to whom it is addressed. Any use, copying, retention or disclosure by any person other than the intended recipient or the intended recipient's designees is strictly prohibited. If you are not the intended recipient or their designee, please notify the sender immediately by return e-mail and delete all copies. |
From: Darren H. <dha...@gh...> - 2006-02-28 19:46:20
|
Ah, that's what I was looking for: *Thread the dynamic TTS off. *Play music-on-hold or other already pre-generated sound until the = dyanamic-TTS thread finish. Thanks! -D > -----Original Message----- > From: ast...@li...=20 > [mailto:ast...@li...] On=20 > Behalf Of Stefan Reuter > Sent: Tuesday, February 28, 2006 2:33 PM > To: ast...@li... > Subject: Re: [Asterisk-java-users] Text-to-speech and=20 > gathering data (fastAGI) >=20 > Darren Hartford wrote: > > Thanks Stefan, > > My intent is actually to optimize the second part of non-static=20 > > requests. This test does indeed could used pre-generated=20 > voice files=20 > > (per the cached remark), but the intent is to identify the=20 > best way to=20 > > handle the dynamic parts. > >=20 > > Is this the best way to handle dynamic tts parts?=20 >=20 > You are probably thinking of something like directly=20 > streaming the tts generated voice files to the user instead=20 > of sequentially creating the while voice file and then=20 > streaming it. As far as I know this is currently not possible. > So the best approach that will currently work is > - use pregenerated voice files wherever possible > - try to minimize the dynamic generated part > - generate the dynamic files in the background and as soon as=20 > possible, i.e. as soon as you know what you have to say=20 > create them in a new Thread (not even through AGI but=20 > directly invoiking your tts engine) and meanwhile play=20 > something else to the user to avoid dead air. >=20 > =3DStefan >=20 > -- > reuter network consulting > Neusser Str. 110 > 50760 K=F6ln > Germany > Telefon: +49 221 1305699-0 > Telefax: +49 221 1305699-90 > E-Mail: sr...@re... > Jabber: sr...@ja... >=20 >=20 |
From: Stefan R. <sr...@re...> - 2006-02-28 19:33:29
|
Darren Hartford wrote: > Thanks Stefan, > My intent is actually to optimize the second part of non-static > requests. This test does indeed could used pre-generated voice files > (per the cached remark), but the intent is to identify the best way to > handle the dynamic parts. >=20 > Is this the best way to handle dynamic tts parts?=20 You are probably thinking of something like directly streaming the tts generated voice files to the user instead of sequentially creating the while voice file and then streaming it. As far as I know this is currently not possible. So the best approach that will currently work is - use pregenerated voice files wherever possible - try to minimize the dynamic generated part - generate the dynamic files in the background and as soon as possible, i.e. as soon as you know what you have to say create them in a new Thread (not even through AGI but directly invoiking your tts engine) and meanwhile play something else to the user to avoid dead air. =3DStefan --=20 reuter network consulting Neusser Str. 110 50760 K=F6ln Germany Telefon: +49 221 1305699-0 Telefax: +49 221 1305699-90 E-Mail: sr...@re... Jabber: sr...@ja... |
From: Darren H. <dha...@gh...> - 2006-02-28 19:21:34
|
Thanks Stefan, My intent is actually to optimize the second part of non-static requests. This test does indeed could used pre-generated voice files (per the cached remark), but the intent is to identify the best way to handle the dynamic parts. Is this the best way to handle dynamic tts parts?=20 -D > -----Original Message----- > From: ast...@li...=20 > [mailto:ast...@li...] On=20 > Behalf Of Stefan Reuter > Sent: Tuesday, February 28, 2006 1:59 PM > To: ast...@li... > Subject: Re: [Asterisk-java-users] Text-to-speech and=20 > gathering data (fastAGI) >=20 > Darren, >=20 > it looks like you are always using TTS to generate the voice=20 > files for your application even if they are rathe static. I=20 > would only run the TTS once (outside of your AGI scripts) and=20 > then use the generated voice files. If you have dynamic parts=20 > (like greeting the user with his name) I would only render=20 > those parts at run time. This should eliminate the delay and=20 > take away some load from your Asterisk server. >=20 > =3DStefan >=20 > Darren Hartford wrote: > > Hey all, > > Continuing my mad plan for using asterisk-java & fastAGI...taking=20 > > text, convert to voice, and then gathering data back. > >=20 > > The below works, but there is a 3-sec delay for the=20 > conversion (which=20 > > could be cached for future use, but focusing on the=20 > one-offs for now): > >=20 > > =3D=3D=3D=3D=3D=3D[code]=3D=3D=3D=3D=3D > > String texttospeech =3D "Please enter your favorite number=20 > > between 10 and 100 followed by pound sign."; > > int soundhash =3D texttospeech.hashCode(); > > String sounddir =3D "/var/lib/asterisk/sounds/tts"; =20 > > String textfile =3D sounddir + "/ttsTEST-" + soundhash=20 > + ".txt"; > > String wavefile =3D sounddir + "/ttsTEST-" + soundhash=20 > + ".wav"; > > String gsmfile =3D sounddir + "/ttsTEST-" + soundhash + = ".gsm"; > > result =3D exec("System","echo '" + texttospeech + "' > " +=20 > > textfile); > > System.out.println("text save result: " + result); > > result =3D exec("System","text2wave -F 8000 -o " +=20 > wavefile + " "=20 > > + textfile); > > System.out.println("text2wave result: " + result); > > // result =3D exec("System","sox " + wavefile + " -r=20 > 8000 -c1 " + > > textfile); > > result =3D exec("System","sox " + wavefile + " " + gsmfile); > > System.out.println("sox result: " + result); > > =20 > > String captureddata =3D ""; > > captureddata =3D getData("tts/ttsTEST-" + soundhash);=20 > > =3D=3D=3D=3D=3D[/code]=3D=3D=3D=3D=3D=3D > >=20 > > Any recommendations to get this streamlined for one-off text=20 > > conversions, or any pitfalls? > >=20 > > TIA, > > -D >=20 |
From: Stefan R. <sr...@re...> - 2006-02-28 18:59:11
|
Darren, it looks like you are always using TTS to generate the voice files for your application even if they are rathe static. I would only run the TTS once (outside of your AGI scripts) and then use the generated voice files. If you have dynamic parts (like greeting the user with his name) I would only render those parts at run time. This should eliminate the delay and take away some load from your Asterisk server. =Stefan Darren Hartford wrote: > Hey all, > Continuing my mad plan for using asterisk-java & fastAGI...taking text, > convert to voice, and then gathering data back. > > The below works, but there is a 3-sec delay for the conversion (which > could be cached for future use, but focusing on the one-offs for now): > > ======[code]===== > String texttospeech = "Please enter your favorite number between > 10 and 100 followed by pound sign."; > int soundhash = texttospeech.hashCode(); > String sounddir = "/var/lib/asterisk/sounds/tts"; > String textfile = sounddir + "/ttsTEST-" + soundhash + ".txt"; > String wavefile = sounddir + "/ttsTEST-" + soundhash + ".wav"; > String gsmfile = sounddir + "/ttsTEST-" + soundhash + ".gsm"; > result = exec("System","echo '" + texttospeech + "' > " + > textfile); > System.out.println("text save result: " + result); > result = exec("System","text2wave -F 8000 -o " + wavefile + " " + > textfile); > System.out.println("text2wave result: " + result); > // result = exec("System","sox " + wavefile + " -r 8000 -c1 " + > textfile); > result = exec("System","sox " + wavefile + " " + gsmfile); > System.out.println("sox result: " + result); > > String captureddata = ""; > captureddata = getData("tts/ttsTEST-" + soundhash); > =====[/code]====== > > Any recommendations to get this streamlined for one-off text > conversions, or any pitfalls? > > TIA, > -D |
From: Darren H. <dha...@gh...> - 2006-02-27 19:20:42
|
Hey all, Continuing my mad plan for using asterisk-java & fastAGI...taking text, convert to voice, and then gathering data back. The below works, but there is a 3-sec delay for the conversion (which could be cached for future use, but focusing on the one-offs for now): =3D=3D=3D=3D=3D=3D[code]=3D=3D=3D=3D=3D String texttospeech =3D "Please enter your favorite number = between 10 and 100 followed by pound sign."; int soundhash =3D texttospeech.hashCode(); String sounddir =3D "/var/lib/asterisk/sounds/tts"; =20 String textfile =3D sounddir + "/ttsTEST-" + soundhash + ".txt"; String wavefile =3D sounddir + "/ttsTEST-" + soundhash + ".wav"; String gsmfile =3D sounddir + "/ttsTEST-" + soundhash + ".gsm"; result =3D exec("System","echo '" + texttospeech + "' > " + textfile); System.out.println("text save result: " + result); result =3D exec("System","text2wave -F 8000 -o " + wavefile + " " = + textfile); System.out.println("text2wave result: " + result); // result =3D exec("System","sox " + wavefile + " -r 8000 -c1 " + textfile); result =3D exec("System","sox " + wavefile + " " + gsmfile); System.out.println("sox result: " + result); =20 String captureddata =3D ""; captureddata =3D getData("tts/ttsTEST-" + soundhash); =3D=3D=3D=3D=3D[/code]=3D=3D=3D=3D=3D=3D Any recommendations to get this streamlined for one-off text conversions, or any pitfalls? TIA, -D |
From: Darren H. <dha...@gh...> - 2006-02-27 17:55:23
|
Hey all, Found the answer to my question and sharing it. The command for asterisk-java for Festival does look like this: exec("Festival", "('I like asterisk java')"); Unsure with the paranthesis/single-quote, but it's a start. The ACTUAL problem I had was that the Festival Server was not running on the Asterisk box, but the exec() method still returned -1 instead of -2 (with -2 being application not found). The 'full' log on the asterisk server will show 'calling festival_client: but can't find festival_server' or similar. Thanky! -D > -----Original Message----- > From: Darren Hartford=20 > Sent: Thursday, February 23, 2006 8:26 AM > To: 'ast...@li...' > Subject: RE: [Asterisk-java-users] Text-to-voice conversion options? >=20 > Forgive me, can you show an example with asterisk-java using Festival? > My attempts have mostly been along the lines of: >=20 > Code: exec("Festival('Hello asterisk user, how are you today?')";=20 >=20 > and that has not met with success :-( > I have had some success with sound files *on the server* so calls like >=20 > Code: data =3D getData("pls-try-again"); >=20 > do work where pls-try-again is a sound file on the asterisk server. >=20 > Thanks, still learnin'! >=20 > -D >=20 |
From: Aparna R. <apa...@ya...> - 2006-02-24 09:58:45
|
Hello, I have the following programs using ManagerAPI. I want to run another thread, along with the handling of the asterisk events. The code follows and the question below the code. SeamlessMobility.java (main class) ---------------------------------------------------- public class SeamlessMobility implements ManagerEventHandler { public ManagerConnection managerConnection; private SnmpThread snmp; public SeamlessMobility() throws IOException { ManagerConnectionFactory factory = new ManagerConnectionFactory(); this.managerConnection = factory.getManagerConnection("localhost", "manager", "pass"); snmp = new SnmpThread(this); } public void run() { // register for events managerConnection.addEventHandler(this); try { // connect to Asterisk and log in managerConnection.login(); } catch(IOException ioe) { System.out.println("Manager Login-IOException-> "+ioe); } catch(AuthenticationFailedException afe) { System.out.println("Login-Authentication Failed Exc-> "+afe); return; } catch(TimeoutException toe) { System.out.println("Login-TimeOut Exc-> "+toe); return; } try { snmp.start(); Thread.sleep(1000); } catch(InterruptedException ie) { System.out.println("Interrupted Exc-> "+ie); } registerOnStart(); try { // and finally log off and disconnect managerConnection.logoff(); } catch(IOException ioe) { System.out.println("Manager Logoff-IOException-> "+ioe); } catch(TimeoutException toe) { System.out.println("Logoff-TimeOut Exc-> "+toe); } } public void registerOnStart() { // do the work snmp.run(); } public void handleEvent(ManagerEvent event) { if (event instanceof PeerStatusEvent) { String peerName = ((PeerStatusEvent) event).getPeer(); String peerStatus = ((PeerStatusEvent) event).getPeerStatus(); System.out.println("\nPeer '"+peerName+"' is "+peerStatus); } } public static void main(String[] args) { SeamlessMobility sm; try { sm = new SeamlessMobility(); sm.run(); } catch(IOException io) { System.out.println("Main Method - IO Exc "+io); } } } ------------------ SnmpThread.java (another class) which has a run() method. ------------------ To run the SnmpThread thread, I use snmp.start() in the run() method of the main class(SeamlessMobility.java). This also invokes the run() method of the snmp thread. But the Asterisk events do not get recorded in the java output console, unless I explicitly specify snmp.run() in the registerOnStart() method of the main class (shown in bold). But since this is not the right way to go about it, can you plz guide me on how do I make the Asterisk events get displayed on the console? Thanks much in advance Regards, Aparna --------------------------------- Relax. Yahoo! Mail virus scanning helps detect nasty viruses! |
From: Liam O'H. <lia...@gm...> - 2006-02-23 19:27:40
|
> I would recommend getting an IDE if you plan on working in Java for a wh= ile ;-) > > Eclipse & NetBeans are full-featured free ones, while simple free ones l= ike BlueJ also work. Thanks for the good advice. I imagine I'll be using Eclipse. > For commandline, try 'javac HelloAGIScript.java -classpath asterisk-java= .jar' I discovered the solution which, as I suspected, is Java-newbie related as opposed to Asterisk-Java related, however, for the purposes of closing this thread (and in case anyone other java newbie needs this answer) here is the solution : Read the documentation properly, read the source and read what the compiler is telling you!! The whole point of implementing BaseAGIScript instead of AbstractAGIScript is to remove the necessity to pass <channel> as a parameter to the methods. As such, you should remove <channel> as a parameter from the method calls in the example in the tutorial. The point could be made that the tutorial should contain a compilable example, but it's also not unreasonable to assume a certain basic familiarity with Java. So, the HelloAGIScript.java source should read : import net.sf.asterisk.fastagi.AGIChannel; import net.sf.asterisk.fastagi.AGIException; import net.sf.asterisk.fastagi.AGIRequest; import net.sf.asterisk.fastagi.BaseAGIScript; public class HelloAGIScript extends BaseAGIScript { public void service(AGIRequest request, AGIChannel channel) throws AGIException { // Answer the channel... answer(); // ...say hello... streamFile("welcome"); // ...and hangup. hangup(); } } |
From: Darren H. <dha...@gh...> - 2006-02-23 13:26:14
|
Forgive me, can you show an example with asterisk-java using Festival? My attempts have mostly been along the lines of: Code: exec("Festival('Hello asterisk user, how are you today?')";=20 and that has not met with success :-( I have had some success with sound files *on the server* so calls like Code: data =3D getData("pls-try-again"); do work where pls-try-again is a sound file on the asterisk server. Thanks, still learnin'! -D |
From:
<rob...@mo...> - 2006-02-23 10:41:05
|
Hi! Yes this behaviour is the eexpected one:) You'll need festival to do what you're looking for: http://www.voip-info.org/wiki/view/Asterisk+cmd+Festival cheers, Robert Darren Hartford napisał(a): > Hey all, > Trying to use the FastAGI server part of asterisk-java, and when I use > the: > > sayPhonetic("my text here"); > > Method, it spells out each letter in the 'alpha, beta, charlie' fashion. > Is this the expected use? I'm trying to do text-to-voice conversion, > and I'm not sure which feature of asterisk-java I should be using. If > one of the existing features does not include text-to-voice, how do you > invoke an interruptable(press a key) festival call? > > Thanks, this stuff is great!! > > -D > > > ------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. Do you grep through log files > for problems? Stop! Download the new AJAX search engine that makes > searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! > http://sel.as-us.falkag.net/sel?cmd=k&kid3432&bid#0486&dat1642 > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > |
From: Darren H. <dha...@gh...> - 2006-02-22 22:06:49
|
Hey all, Trying to use the FastAGI server part of asterisk-java, and when I use the: sayPhonetic("my text here"); Method, it spells out each letter in the 'alpha, beta, charlie' fashion. Is this the expected use? I'm trying to do text-to-voice conversion, and I'm not sure which feature of asterisk-java I should be using. If one of the existing features does not include text-to-voice, how do you invoke an interruptable(press a key) festival call? Thanks, this stuff is great!! -D |
From: Stefan R. <sr...@re...> - 2006-02-22 20:44:46
|
> If you truly want to use Manager only, then you should probably set > variables in the extension and then send a getvar action from manager api > when there is an extension event that sets the variable. yep or you could send a userevent with the relevant data and look for that. |