asterisk-java-users Mailing List for Asterisk-Java Library (Page 115)
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: preetha A. <pre...@gm...> - 2008-04-21 12:58:49
|
Hi, * The servlet can then obtain the caller id from the fastagi service and return the details to the html page.* I understand what you are saying.but how to use this? On Mon, Apr 21, 2008 at 11:46 AM, <bs...@no...> wrote: > > What you are looking to do doesn't quite make sense so you might have to > review your approach. > > The issue is that under normal circumstances a JSP page is called into > action by a user entering a url into their web browser. > You are looking to call the JSP page into action when a new phone call > enters your asterisk server which doesn't fit the normal JSP model. > > There are ways around this problem but we probably need to know a bit more > regarding what you are trying to do. > > Taking a guess at what you are trying to do, I would suggest: > > One possible solution is the AJAX model of programming which is some times > used to 'simulate' server event handling. > Basically your html would contain AJAX code which does a request to the > server. > Unlike a normal http request the server would not respond immediately. > Instead it would put the servlet to sleep with a 'wait()' statement. When > a fastagi event arrives the servlet would be woken up using a 'notify()' > statement. > The servlet can then obtain the caller id from the fastagi service and > return the details to the html page. The HTML page can then take further > action using javascript to display a page based on the caller id. > > The servlet also needs to return periodically otherwise the browser gets > upset. > > This is non-trival coding. We have an AJAX based 'Answer bar' which we > have developed which uses a similar technique to 'screen pop' a web page and > I know the developers spent a fair bit of time to get it working just right. > We also used the manager api rather than the fastagi, but either will > probably work, the manager api simply delivers more information and doesn't > require hooks in the dial plan. > > Regards, > Brett > > > > preetha Ayyappan <pre...@gm...> wrote: > > Thank you for your reply.I want to pass the callerid from the fastagi > > program to a jsp page .for this what should i do?mines is normal fastagi > > program like the HelloAgiScript program given in > > http://asterisk-java.org/development/tutorial.html .I didnt use any > > spring > > framework,application context,or anything.whether i have to use all > > these to > > pass a callerid?if yes, please explain me how to use spring framework. > > > > > > > > On 4/20/08, S. Brett Sutton <bs...@no...> wrote: > > > > > > > > to run fastagi you will need to startup up a thread during > > > application > > > context initialization to act as the fast agi server. > > > > > > To do this implement a *ServletContextListener< > > > http://java.sun.com/products/servlet/2.3/javadoc/javax/servlet/ServletContextListener.html>and > > > during the 'contextInitialized' method call create a the thread which > > > > > > will run your fastagi server. > > > > > > Note: the ServletContextListener needs to be configured in your > > > web.xml. > > > * > > > > > > preetha Ayyappan wrote: > > > > > > Hi, > > > As you have done the managerAPI in java servlet,Is it possible to do > > > the > > > following fastagi in servlet?if yes please guide me to do this. > > > > > > Code: > > > import java.io.IOException; > > > iimport org.asteriskjava.fastagi.AgiChannel; > > > import org.asteriskjava.fastagi.AgiException; > > > import org.asteriskjava.fastagi.AgiRequest; > > > import org.asteriskjava.fastagi.BaseAgiScript; > > > import org.asteriskjava.fastagi.DefaultAgiServer; > > > import org.asteriskjava.fastagi.AgiScript; > > > > > > public class Callerid extends BaseAgiScript implements AgiScript > > > > > > { > > > public void service(AgiRequest request, AgiChannel channel) > > > throws AgiException > > > { > > > > > > String callerid=request.getCallerId(); > > > System.out.println(callerid); > > > } > > > } > > > > > > On 3/27/08, Maciek Tokarski <mlo...@gm...> wrote: > > > > > > > > Hi, > > > > Let's say that you want to originate some call to somebody by > > > clicking > > > > button on HTML site. PHP script will look something like that > > > > > > > > > > > > ----PHP CODE filename: clickToCall.php > > > > > > > > > > > > <?php > > > > if (!isset($_POST['call']) or $_POST['call']=='') { > > > > //display form to user > > > > ?> > > > > <form action="clickToCall.php" method="POST"> > > > > <input type="text" name="destination" value="enter destination > > > number > > > > here...."> > > > > <input type="submit" value="call" name="call"> > > > > </form> > > > > <?php > > > > } else { > > > > //call web service using curl > > > > $destination=$_POST['destination']; > > > > > > > > $ch = curl_init(); > > > > $url="http://your.tomcat.host/serletname?dest=$destination"; //you > > > can > > > > also use fopen or file_get_contents functions > > > > curl_setopt($ch, CURLOPT_URL,$url); > > > > curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); > > > > curl_setopt($ch, CURLOPT_POST, 1); > > > > curl_setopt($ch, CURLOPT_POSTFIELDS, $xml_data); > > > > > > > > $data = curl_exec($ch); > > > > if ($data='OK') { > > > > echo "Ok... call is no the way"; > > > > } else { > > > > echo "Some problems...:-("; > > > > } > > > > } > > > > ?> > > > > ---end of PHP code > > > > I thin it won't work if You use Ctrl-C Ctrl-V, but it may looks like > > > > thise above > > > > > > > > Next you have to write a web service servlet that will handle > > > request > > > > from php script: > > > > > > > > > > > > ----JAVA CODE > > > > > > > > package clickToCall; > > > > > > > > import java.io.*; > > > > import javax.servlet.*; > > > > import javax.servlet.http.*; > > > > import org.asteriskjava.manager.AuthenticationFailedException; > > > > import org.asteriskjava.manager.ManagerConnection; > > > > > > > > > > > > > > > > import org.asteriskjava.manager.ManagerConnectionFactory; > > > > import org.asteriskjava.manager.TimeoutException; > > > > import org.asteriskjava.manager.action.OriginateAction; > > > > import org.asteriskjava.manager.response.ManagerResponse; > > > > > > > > > > > > > > > > > > > > public class HelloWorld extends HttpServlet { > > > > public void doGet(HttpServletRequest request, > > > > HttpServletResponse response) > > > > throws ServletException, IOException { > > > > > > > > > > > > PrintWriter out = response.getWriter(); > > > > > > > > > > > > String destinationNo=request.getParameter("dest"); > > > > //pasted from > > > http://asterisk-java.org/development/tutorial.html :-) > > > > > > > > > > > > try { > > > > > > > > ManagerConnectionFactory factory = new ManagerConnectionFactory( > > > > "localhost", "manager", "pa55w0rd"); // > > > > > > > > > > > > this.managerConnection = factory.createManagerConnection(); > > > > > > > > > > > > OriginateAction originateAction; > > > > ManagerResponse originateResponse; > > > > > > > > originateAction = new OriginateAction(); > > > > > > > > > > > originateAction.setChannel("SIP/YOUR_TRUNK_NAME/"+destination); > > > > > > > > originateAction.setContext("default"); > > > > originateAction.setExten("1300"); > > > > > > > > originateAction.setPriority(new Integer(1)); > > > > originateAction.setTimeout(new Integer(30000)); > > > > > > > > > > > > // connect to Asterisk and log in > > > > managerConnection.login(); > > > > > > > > // send the originate action and wait for a maximum of 30 > > > seconds for Asterisk > > > > > > > > // to send a reply > > > > originateResponse = > > > managerConnection.sendAction(originateAction, 30000); > > > > > > > > > > > > > > > > > > > > // and finally log off and disconnect > > > > managerConnection.logoff(); > > > > > > > > > > > > out.println("OK"); > > > > } catch (Exception e) { > > > > out.println("NOT OK"); > > > > > > > > > > > > } > > > > > > > > } > > > > } > > > > > > > > ---End of JAVA code > > > > > > > > > > > > It also won't work after pasting it. Remember to put your Trunk name > > > > context etc. when setting up originate action. Of course you have > > > to set up > > > > your Tomcat with this servlet. Php script can be simply putted into > > > > /varr/www folder of your server > > > > > > > > > > > > > > > > > > > > 2008/3/27, Gopal krishnan <sa...@gm...>: > > > > > > > > > > Hi, > > > > > > > > > > Thanks for the reply, can I have any help or hello world example > > > to > > > > > set this. It would be a great help for me. Thanks > > > > > > > > > > On Thu, Mar 27, 2008 at 2:51 PM, Maciek Tokarski < > > > mlo...@gm...> > > > > > wrote: > > > > > > > > > > > HI, > > > > > > Yes- it is possible. Once, I've developed Tomcat servlet (simple > > > > > > WebService) on Asterisk box to monitor users count on MeetMe > > > rooms. It works > > > > > > fine. In my opinion best way of integrating manager API with > > > HTML sites is > > > > > > interract with Asterisk not exacly via Tomcat servlet but via > > > WebServices > > > > > > servlets (on Tomcat) calling it form eg. PHP scripts using CURL. > > > > > > > > > > > > Your SITE<------CURL/SOAP------>Tomcat WS > > > servlet<--AMI--->Asterisk > > > > > > Box > > > > > > > > > > > > > > > > > > Regards, Maciek > > > > > > > > > > > > 2008/3/27, Gopal krishnan <sa...@gm...>: > > > > > > > > > > > > > > Hi, > > > > > > > > > > > > > > Is it possible I can use a manager api program with tomcat. > > > If > > > > > > > so how should i integrate that, please assist me. > > > > > > > > > > > > > > I would like to initate a action from a html page so that it > > > > > > > will hit a program developed with manager api. > > > > > > > > > > > > > > -- > > > > > > > Thank you with regards, > > > > > > > Gopal, > > > > > > > PeopleTech Systems Private Limited > > > > > > > www.peopletech.co.in > > > > > > > > > > > > > > > > > ------------------------------------------------------------------------- > > > > > > > Check out the new SourceForge.net Marketplace. > > > > > > > It's the best place to buy or sell services for > > > > > > > just about anything Open Source. > > > > > > > > > > > > > > > > > http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace > > > > > > > _______________________________________________ > > > > > > > Asterisk-java-users mailing list > > > > > > > Ast...@li... > > > > > > > > > > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > ------------------------------------------------------------------------- > > > > > > Check out the new SourceForge.net Marketplace. > > > > > > It's the best place to buy or sell services for > > > > > > just about anything Open Source. > > > > > > > > > > > > > > > http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace > > > > > > _______________________________________________ > > > > > > Asterisk-java-users mailing list > > > > > > Ast...@li... > > > > > > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > Thank you with regards, > > > > > Gopal, > > > > > PeopleTech Systems Private Limited > > > > > www.peopletech.co.in > > > > > > > > > > > > > > > > > > ------------------------------------------------------------------------- > > > > > Check out the new SourceForge.net Marketplace. > > > > > It's the best place to buy or sell services for > > > > > just about anything Open Source. > > > > > > > > > > > > > http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace > > > > > _______________________________________________ > > > > > Asterisk-java-users mailing list > > > > > Ast...@li... > > > > > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > > > > > > > > > > > > > > > > > > > > > > -- > > > > Pozdrawiam > > > > Maciek Tokarski > > > > > > > > > > > ------------------------------------------------------------------------- > > > > Check out the new SourceForge.net Marketplace. > > > > It's the best place to buy or sell services for > > > > just about anything Open Source. > > > > > > > > > > > http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace > > > > _______________________________________________ > > > > Asterisk-java-users mailing list > > > > Ast...@li... > > > > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > > > > > > > > > > > > > > > > > -- > > > Preetha.A > > > > > > ------------------------------ > > > > > > > > > ------------------------------------------------------------------------- > > > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference > > > Don't miss this year's exciting event. There's still time to save > > > $100. > > > Use priority code J8TL2D2. > > > > > > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone > > > > > > ------------------------------ > > > > > > _______________________________________________ > > > Asterisk-java-users mailing list > > > Ast...@li... > > > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > > > > > > > > > > > > ------------------------------------------------------------------------- > > > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference > > > Don't miss this year's exciting event. There's still time to save > > > $100. > > > Use priority code J8TL2D2. > > > > > > > > > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone > > > _______________________________________________ > > > Asterisk-java-users mailing list > > > Ast...@li... > > > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > > > > > > > > > > > > > -- > > Preetha.A > > > > > > > -- Preetha.A |
From: <bs...@no...> - 2008-04-21 06:20:36
|
What you are looking to do doesn't quite make sense so you might have to review your approach. The issue is that under normal circumstances a JSP page is called into action by a user entering a url into their web browser. You are looking to call the JSP page into action when a new phone call enters your asterisk server which doesn't fit the normal JSP model. There are ways around this problem but we probably need to know a bit more regarding what you are trying to do. Taking a guess at what you are trying to do, I would suggest: One possible solution is the AJAX model of programming which is some times used to 'simulate' server event handling. Basically your html would contain AJAX code which does a request to the server. Unlike a normal http request the server would not respond immediately. Instead it would put the servlet to sleep with a 'wait()' statement. When a fastagi event arrives the servlet would be woken up using a 'notify()' statement. The servlet can then obtain the caller id from the fastagi service and return the details to the html page. The HTML page can then take further action using javascript to display a page based on the caller id. The servlet also needs to return periodically otherwise the browser gets upset. This is non-trival coding. We have an AJAX based 'Answer bar' which we have developed which uses a similar technique to 'screen pop' a web page and I know the developers spent a fair bit of time to get it working just right. We also used the manager api rather than the fastagi, but either will probably work, the manager api simply delivers more information and doesn't require hooks in the dial plan. Regards, Brett preetha Ayyappan <pre...@gm...> wrote: > Thank you for your reply.I want to pass the callerid from the fastagi > program to a jsp page .for this what should i do?mines is normal fastagi > program like the HelloAgiScript program given in > http://asterisk-java.org/development/tutorial.html .I didnt use any spring > framework,application context,or anything.whether i have to use all these to > pass a callerid?if yes, please explain me how to use spring framework. > > > > On 4/20/08, S. Brett Sutton <bs...@no...> wrote: >> >> to run fastagi you will need to startup up a thread during application >> context initialization to act as the fast agi server. >> >> To do this implement a >> *ServletContextListener<http://java.sun.com/products/servlet/2.3/javadoc/javax/servlet/ServletContextListener.html>and during the 'contextInitialized' method call create a the thread >> which >> will run your fastagi server. >> >> Note: the ServletContextListener needs to be configured in your web.xml. >> * >> >> preetha Ayyappan wrote: >> >> Hi, >> As you have done the managerAPI in java servlet,Is it possible to do the >> following fastagi in servlet?if yes please guide me to do this. >> >> Code: >> import java.io.IOException; >> iimport org.asteriskjava.fastagi.AgiChannel; >> import org.asteriskjava.fastagi.AgiException; >> import org.asteriskjava.fastagi.AgiRequest; >> import org.asteriskjava.fastagi.BaseAgiScript; >> import org.asteriskjava.fastagi.DefaultAgiServer; >> import org.asteriskjava.fastagi.AgiScript; >> >> public class Callerid extends BaseAgiScript implements AgiScript >> >> { >> public void service(AgiRequest request, AgiChannel channel) >> throws AgiException >> { >> >> String callerid=request.getCallerId(); >> System.out.println(callerid); >> } >> } >> >> On 3/27/08, Maciek Tokarski <mlo...@gm...> wrote: >> > >> > Hi, >> > Let's say that you want to originate some call to somebody by clicking >> > button on HTML site. PHP script will look something like that >> > >> > >> > ----PHP CODE filename: clickToCall.php >> > >> > >> > <?php >> > if (!isset($_POST['call']) or $_POST['call']=='') { >> > //display form to user >> > ?> >> > <form action="clickToCall.php" method="POST"> >> > <input type="text" name="destination" value="enter destination number >> > here...."> >> > <input type="submit" value="call" name="call"> >> > </form> >> > <?php >> > } else { >> > //call web service using curl >> > $destination=$_POST['destination']; >> > >> > $ch = curl_init(); >> > $url="http://your.tomcat.host/serletname?dest=$destination"; //you can >> > also use fopen or file_get_contents functions >> > curl_setopt($ch, CURLOPT_URL,$url); >> > curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); >> > curl_setopt($ch, CURLOPT_POST, 1); >> > curl_setopt($ch, CURLOPT_POSTFIELDS, $xml_data); >> > >> > $data = curl_exec($ch); >> > if ($data='OK') { >> > echo "Ok... call is no the way"; >> > } else { >> > echo "Some problems...:-("; >> > } >> > } >> > ?> >> > ---end of PHP code >> > I thin it won't work if You use Ctrl-C Ctrl-V, but it may looks like >> > thise above >> > >> > Next you have to write a web service servlet that will handle request >> > from php script: >> > >> > >> > ----JAVA CODE >> > >> > package clickToCall; >> > >> > import java.io.*; >> > import javax.servlet.*; >> > import javax.servlet.http.*; >> > import org.asteriskjava.manager.AuthenticationFailedException; >> > import org.asteriskjava.manager.ManagerConnection; >> > >> > >> > >> > import org.asteriskjava.manager.ManagerConnectionFactory; >> > import org.asteriskjava.manager.TimeoutException; >> > import org.asteriskjava.manager.action.OriginateAction; >> > import org.asteriskjava.manager.response.ManagerResponse; >> > >> > >> > >> > >> > public class HelloWorld extends HttpServlet { >> > public void doGet(HttpServletRequest request, >> > HttpServletResponse response) >> > throws ServletException, IOException { >> > >> > >> > PrintWriter out = response.getWriter(); >> > >> > >> > String destinationNo=request.getParameter("dest"); >> > //pasted from http://asterisk-java.org/development/tutorial.html :-) >> > >> > >> > try { >> > >> > ManagerConnectionFactory factory = new ManagerConnectionFactory( >> > "localhost", "manager", "pa55w0rd"); // >> > >> > >> > this.managerConnection = factory.createManagerConnection(); >> > >> > >> > OriginateAction originateAction; >> > ManagerResponse originateResponse; >> > >> > originateAction = new OriginateAction(); >> > >> > originateAction.setChannel("SIP/YOUR_TRUNK_NAME/"+destination); >> > >> > originateAction.setContext("default"); >> > originateAction.setExten("1300"); >> > >> > originateAction.setPriority(new Integer(1)); >> > originateAction.setTimeout(new Integer(30000)); >> > >> > >> > // connect to Asterisk and log in >> > managerConnection.login(); >> > >> > // send the originate action and wait for a maximum of 30 >> seconds for Asterisk >> > >> > // to send a reply >> > originateResponse = >> managerConnection.sendAction(originateAction, 30000); >> > >> > >> > >> > >> > // and finally log off and disconnect >> > managerConnection.logoff(); >> > >> > >> > out.println("OK"); >> > } catch (Exception e) { >> > out.println("NOT OK"); >> > >> > >> > } >> > >> > } >> > } >> > >> > ---End of JAVA code >> > >> > >> > It also won't work after pasting it. Remember to put your Trunk name >> > context etc. when setting up originate action. Of course you have >> to set up >> > your Tomcat with this servlet. Php script can be simply putted into >> > /varr/www folder of your server >> > >> > >> > >> > >> > 2008/3/27, Gopal krishnan <sa...@gm...>: >> > > >> > > Hi, >> > > >> > > Thanks for the reply, can I have any help or hello world example to >> > > set this. It would be a great help for me. Thanks >> > > >> > > On Thu, Mar 27, 2008 at 2:51 PM, Maciek Tokarski <mlo...@gm...> >> > > wrote: >> > > >> > > > HI, >> > > > Yes- it is possible. Once, I've developed Tomcat servlet (simple >> > > > WebService) on Asterisk box to monitor users count on MeetMe >> rooms. It works >> > > > fine. In my opinion best way of integrating manager API with >> HTML sites is >> > > > interract with Asterisk not exacly via Tomcat servlet but via >> WebServices >> > > > servlets (on Tomcat) calling it form eg. PHP scripts using CURL. >> > > > >> > > > Your SITE<------CURL/SOAP------>Tomcat WS servlet<--AMI--->Asterisk >> > > > Box >> > > > >> > > > >> > > > Regards, Maciek >> > > > >> > > > 2008/3/27, Gopal krishnan <sa...@gm...>: >> > > > > >> > > > > Hi, >> > > > > >> > > > > Is it possible I can use a manager api program with tomcat. If >> > > > > so how should i integrate that, please assist me. >> > > > > >> > > > > I would like to initate a action from a html page so that it >> > > > > will hit a program developed with manager api. >> > > > > >> > > > > -- >> > > > > Thank you with regards, >> > > > > Gopal, >> > > > > PeopleTech Systems Private Limited >> > > > > www.peopletech.co.in >> > > > > >> > > > > >> ------------------------------------------------------------------------- >> > > > > Check out the new SourceForge.net Marketplace. >> > > > > It's the best place to buy or sell services for >> > > > > just about anything Open Source. >> > > > > >> > > > > >> http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace >> > > > > _______________________________________________ >> > > > > Asterisk-java-users mailing list >> > > > > Ast...@li... >> > > > > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users >> > > > > >> > > > > >> > > > >> > > > >> > > > >> > > > >> > > > >> ------------------------------------------------------------------------- >> > > > Check out the new SourceForge.net Marketplace. >> > > > It's the best place to buy or sell services for >> > > > just about anything Open Source. >> > > > >> > > > >> http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace >> > > > _______________________________________________ >> > > > Asterisk-java-users mailing list >> > > > Ast...@li... >> > > > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users >> > > > >> > > > >> > > >> > > >> > > -- >> > > Thank you with regards, >> > > Gopal, >> > > PeopleTech Systems Private Limited >> > > www.peopletech.co.in >> > > >> > > >> > > >> ------------------------------------------------------------------------- >> > > Check out the new SourceForge.net Marketplace. >> > > It's the best place to buy or sell services for >> > > just about anything Open Source. >> > > >> > > >> http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace >> > > _______________________________________________ >> > > Asterisk-java-users mailing list >> > > Ast...@li... >> > > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users >> > > >> > > >> > >> > >> > -- >> > Pozdrawiam >> > Maciek Tokarski >> > >> > ------------------------------------------------------------------------- >> > Check out the new SourceForge.net Marketplace. >> > It's the best place to buy or sell services for >> > just about anything Open Source. >> > >> > >> http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace >> > _______________________________________________ >> > Asterisk-java-users mailing list >> > Ast...@li... >> > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users >> > >> > >> >> >> -- >> Preetha.A >> >> ------------------------------ >> >> ------------------------------------------------------------------------- >> This SF.net email is sponsored by the 2008 JavaOne(SM) Conference >> Don't miss this year's exciting event. There's still time to save $100. >> Use priority code J8TL2D2. >> http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone >> >> ------------------------------ >> >> _______________________________________________ >> Asterisk-java-users mailing list >> Ast...@li... >> https://lists.sourceforge.net/lists/listinfo/asterisk-java-users >> >> >> ------------------------------------------------------------------------- >> This SF.net email is sponsored by the 2008 JavaOne(SM) Conference >> Don't miss this year's exciting event. There's still time to save $100. >> Use priority code J8TL2D2. >> >> http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone >> _______________________________________________ >> Asterisk-java-users mailing list >> Ast...@li... >> https://lists.sourceforge.net/lists/listinfo/asterisk-java-users >> >> > > > -- > Preetha.A > |
From: preetha A. <pre...@gm...> - 2008-04-21 05:10:52
|
Thank you for your reply.I want to pass the callerid from the fastagi program to a jsp page .for this what should i do?mines is normal fastagi program like the HelloAgiScript program given in http://asterisk-java.org/development/tutorial.html .I didnt use any spring framework,application context,or anything.whether i have to use all these to pass a callerid?if yes, please explain me how to use spring framework. On 4/20/08, S. Brett Sutton <bs...@no...> wrote: > > to run fastagi you will need to startup up a thread during application > context initialization to act as the fast agi server. > > To do this implement a *ServletContextListener<http://java.sun.com/products/servlet/2.3/javadoc/javax/servlet/ServletContextListener.html>and during the 'contextInitialized' method call create a the thread which > will run your fastagi server. > > Note: the ServletContextListener needs to be configured in your web.xml. > * > > preetha Ayyappan wrote: > > Hi, > As you have done the managerAPI in java servlet,Is it possible to do the > following fastagi in servlet?if yes please guide me to do this. > > Code: > import java.io.IOException; > iimport org.asteriskjava.fastagi.AgiChannel; > import org.asteriskjava.fastagi.AgiException; > import org.asteriskjava.fastagi.AgiRequest; > import org.asteriskjava.fastagi.BaseAgiScript; > import org.asteriskjava.fastagi.DefaultAgiServer; > import org.asteriskjava.fastagi.AgiScript; > > public class Callerid extends BaseAgiScript implements AgiScript > > { > public void service(AgiRequest request, AgiChannel channel) > throws AgiException > { > > String callerid=request.getCallerId(); > System.out.println(callerid); > } > } > > On 3/27/08, Maciek Tokarski <mlo...@gm...> wrote: > > > > Hi, > > Let's say that you want to originate some call to somebody by clicking > > button on HTML site. PHP script will look something like that > > > > > > ----PHP CODE filename: clickToCall.php > > > > > > <?php > > if (!isset($_POST['call']) or $_POST['call']=='') { > > //display form to user > > ?> > > <form action="clickToCall.php" method="POST"> > > <input type="text" name="destination" value="enter destination number > > here...."> > > <input type="submit" value="call" name="call"> > > </form> > > <?php > > } else { > > //call web service using curl > > $destination=$_POST['destination']; > > > > $ch = curl_init(); > > $url="http://your.tomcat.host/serletname?dest=$destination"; //you can > > also use fopen or file_get_contents functions > > curl_setopt($ch, CURLOPT_URL,$url); > > curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); > > curl_setopt($ch, CURLOPT_POST, 1); > > curl_setopt($ch, CURLOPT_POSTFIELDS, $xml_data); > > > > $data = curl_exec($ch); > > if ($data='OK') { > > echo "Ok... call is no the way"; > > } else { > > echo "Some problems...:-("; > > } > > } > > ?> > > ---end of PHP code > > I thin it won't work if You use Ctrl-C Ctrl-V, but it may looks like > > thise above > > > > Next you have to write a web service servlet that will handle request > > from php script: > > > > > > ----JAVA CODE > > > > package clickToCall; > > > > import java.io.*; > > import javax.servlet.*; > > import javax.servlet.http.*; > > import org.asteriskjava.manager.AuthenticationFailedException; > > import org.asteriskjava.manager.ManagerConnection; > > > > > > > > import org.asteriskjava.manager.ManagerConnectionFactory; > > import org.asteriskjava.manager.TimeoutException; > > import org.asteriskjava.manager.action.OriginateAction; > > import org.asteriskjava.manager.response.ManagerResponse; > > > > > > > > > > public class HelloWorld extends HttpServlet { > > public void doGet(HttpServletRequest request, > > HttpServletResponse response) > > throws ServletException, IOException { > > > > > > PrintWriter out = response.getWriter(); > > > > > > String destinationNo=request.getParameter("dest"); > > //pasted from http://asterisk-java.org/development/tutorial.html :-) > > > > > > try { > > > > ManagerConnectionFactory factory = new ManagerConnectionFactory( > > "localhost", "manager", "pa55w0rd"); // > > > > > > this.managerConnection = factory.createManagerConnection(); > > > > > > OriginateAction originateAction; > > ManagerResponse originateResponse; > > > > originateAction = new OriginateAction(); > > > > originateAction.setChannel("SIP/YOUR_TRUNK_NAME/"+destination); > > > > originateAction.setContext("default"); > > originateAction.setExten("1300"); > > > > originateAction.setPriority(new Integer(1)); > > originateAction.setTimeout(new Integer(30000)); > > > > > > // connect to Asterisk and log in > > managerConnection.login(); > > > > // send the originate action and wait for a maximum of 30 seconds for Asterisk > > > > // to send a reply > > originateResponse = managerConnection.sendAction(originateAction, 30000); > > > > > > > > > > // and finally log off and disconnect > > managerConnection.logoff(); > > > > > > out.println("OK"); > > } catch (Exception e) { > > out.println("NOT OK"); > > > > > > } > > > > } > > } > > > > ---End of JAVA code > > > > > > It also won't work after pasting it. Remember to put your Trunk name > > context etc. when setting up originate action. Of course you have to set up > > your Tomcat with this servlet. Php script can be simply putted into > > /varr/www folder of your server > > > > > > > > > > 2008/3/27, Gopal krishnan <sa...@gm...>: > > > > > > Hi, > > > > > > Thanks for the reply, can I have any help or hello world example to > > > set this. It would be a great help for me. Thanks > > > > > > On Thu, Mar 27, 2008 at 2:51 PM, Maciek Tokarski <mlo...@gm...> > > > wrote: > > > > > > > HI, > > > > Yes- it is possible. Once, I've developed Tomcat servlet (simple > > > > WebService) on Asterisk box to monitor users count on MeetMe rooms. It works > > > > fine. In my opinion best way of integrating manager API with HTML sites is > > > > interract with Asterisk not exacly via Tomcat servlet but via WebServices > > > > servlets (on Tomcat) calling it form eg. PHP scripts using CURL. > > > > > > > > Your SITE<------CURL/SOAP------>Tomcat WS servlet<--AMI--->Asterisk > > > > Box > > > > > > > > > > > > Regards, Maciek > > > > > > > > 2008/3/27, Gopal krishnan <sa...@gm...>: > > > > > > > > > > Hi, > > > > > > > > > > Is it possible I can use a manager api program with tomcat. If > > > > > so how should i integrate that, please assist me. > > > > > > > > > > I would like to initate a action from a html page so that it > > > > > will hit a program developed with manager api. > > > > > > > > > > -- > > > > > Thank you with regards, > > > > > Gopal, > > > > > PeopleTech Systems Private Limited > > > > > www.peopletech.co.in > > > > > > > > > > ------------------------------------------------------------------------- > > > > > Check out the new SourceForge.net Marketplace. > > > > > It's the best place to buy or sell services for > > > > > just about anything Open Source. > > > > > > > > > > http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace > > > > > _______________________________________________ > > > > > Asterisk-java-users mailing list > > > > > Ast...@li... > > > > > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > ------------------------------------------------------------------------- > > > > Check out the new SourceForge.net Marketplace. > > > > It's the best place to buy or sell services for > > > > just about anything Open Source. > > > > > > > > http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace > > > > _______________________________________________ > > > > Asterisk-java-users mailing list > > > > Ast...@li... > > > > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > > > > > > > > > > > > > > > > > -- > > > Thank you with regards, > > > Gopal, > > > PeopleTech Systems Private Limited > > > www.peopletech.co.in > > > > > > > > > ------------------------------------------------------------------------- > > > Check out the new SourceForge.net Marketplace. > > > It's the best place to buy or sell services for > > > just about anything Open Source. > > > > > > http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace > > > _______________________________________________ > > > Asterisk-java-users mailing list > > > Ast...@li... > > > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > > > > > > > > > > > > -- > > Pozdrawiam > > Maciek Tokarski > > > > ------------------------------------------------------------------------- > > Check out the new SourceForge.net Marketplace. > > It's the best place to buy or sell services for > > just about anything Open Source. > > > > http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace > > _______________________________________________ > > Asterisk-java-users mailing list > > Ast...@li... > > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > > > > > > > -- > Preetha.A > > ------------------------------ > > ------------------------------------------------------------------------- > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference > Don't miss this year's exciting event. There's still time to save $100. > Use priority code J8TL2D2. > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone > > ------------------------------ > > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference > Don't miss this year's exciting event. There's still time to save $100. > Use priority code J8TL2D2. > > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > > -- Preetha.A |
From: S. B. S. <bs...@no...> - 2008-04-20 09:58:52
|
to run fastagi you will need to startup up a thread during application context initialization to act as the fast agi server. To do this implement a /*/ServletContextListener/ <http://java.sun.com/products/servlet/2.3/javadoc/javax/servlet/ServletContextListener.html> and during the 'contextInitialized' method call create a the thread which will run your fastagi server. Note: the ServletContextListener needs to be configured in your web.xml. */ preetha Ayyappan wrote: > Hi, > As you have done the managerAPI in java servlet,Is it possible to do > the following fastagi in servlet?if yes please guide me to do this. > > Code: > import java.io.IOException; > iimport org.asteriskjava.fastagi.AgiChannel; > import org.asteriskjava.fastagi.AgiException; > import org.asteriskjava.fastagi.AgiRequest; > import org.asteriskjava.fastagi.BaseAgiScript; > import org.asteriskjava.fastagi.DefaultAgiServer; > import org.asteriskjava.fastagi.AgiScript; > > public class Callerid extends BaseAgiScript implements AgiScript > > { > public void service(AgiRequest request, AgiChannel channel) > throws AgiException > { > > String callerid=request.getCallerId(); > System.out.println(callerid); > } > } > > On 3/27/08, *Maciek Tokarski* <mlo...@gm... > <mailto:mlo...@gm...>> wrote: > > Hi, > Let's say that you want to originate some call to somebody by > clicking button on HTML site. PHP script will look something like > that > > > ----PHP CODE filename: clickToCall.php > > > <?php > if (!isset($_POST['call']) or $_POST['call']=='') { > //display form to user > ?> > <form action="clickToCall.php" method="POST"> > <input type="text" name="destination" value="enter destination > number here...."> > <input type="submit" value="call" name="call"> > </form> > <?php > } else { > //call web service using curl > $destination=$_POST['destination']; > > | $ch = curl_init(); > $url="http://your.tomcat.host/serletname?dest=$destination"; //you > can also use fopen or file_get_contents functions > curl_setopt($ch, CURLOPT_URL,$url); > ||curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);|| > curl_setopt($ch, CURLOPT_POST, 1); > curl_setopt($ch, CURLOPT_POSTFIELDS, $xml_data); > > $data = curl_exec($ch); > if ($data='OK') { > echo "Ok... call is no the way"; > } else { > echo "Some problems...:-("; > } > } > |?> > ---end of PHP code > I thin it won't work if You use Ctrl-C Ctrl-V, but it may looks > like thise above > > Next you have to write a web service servlet that will handle > request from php script: > > > ----JAVA CODE > > package clickToCall; > > import java.io.*; > import javax.servlet.*; > import javax.servlet.http.*; > import org.asteriskjava.manager.AuthenticationFailedException; > import org.asteriskjava.manager.ManagerConnection; > > > > import org.asteriskjava.manager.ManagerConnectionFactory; > import org.asteriskjava.manager.TimeoutException; > import org.asteriskjava.manager.action.OriginateAction; > import org.asteriskjava.manager.response.ManagerResponse; > > > > > public class HelloWorld extends HttpServlet { > public void doGet(HttpServletRequest request, > HttpServletResponse response) > throws ServletException, IOException { > > > PrintWriter out = response.getWriter(); > > > String destinationNo=request.getParameter("|dest|"); > //pasted from http://asterisk-java.org/development/tutorial.html :-) > > > try { > > ManagerConnectionFactory factory = new ManagerConnectionFactory( > "localhost", "manager", "pa55w0rd"); // > > > this.managerConnection = factory.createManagerConnection(); > > > OriginateAction originateAction; > ManagerResponse originateResponse; > > originateAction = new OriginateAction(); > > originateAction.setChannel("SIP/YOUR_TRUNK_NAME/"+destination); > > originateAction.setContext("default"); > originateAction.setExten("1300"); > > originateAction.setPriority(new Integer(1)); > originateAction.setTimeout(new Integer(30000)); > > > // connect to Asterisk and log in > managerConnection.login(); > > // send the originate action and wait for a maximum of 30 seconds for Asterisk > > // to send a reply > originateResponse = managerConnection.sendAction(originateAction, 30000); > > > > > // and finally log off and disconnect > managerConnection.logoff(); > > > out.println("OK"); > } catch (Exception e) { > out.println("NOT OK"); > > > } > > } > } > > ---End of JAVA code > > > It also won't work after pasting it. Remember to put your Trunk > name context etc. when setting up originate action. Of course you > have to set up your Tomcat with this servlet. Php script can be > simply putted into /varr/www folder of your server > > > > > > 2008/3/27, Gopal krishnan <sa...@gm... > <mailto:sa...@gm...>>: > > Hi, > > Thanks for the reply, can I have any help or hello world > example to set this. It would be a great help for me. Thanks > > > On Thu, Mar 27, 2008 at 2:51 PM, Maciek Tokarski > <mlo...@gm... <mailto:mlo...@gm...>> wrote: > > HI, > Yes- it is possible. Once, I've developed Tomcat servlet > (simple WebService) on Asterisk box to monitor users count > on MeetMe rooms. It works fine. In my opinion best way of > integrating manager API with HTML sites is interract with > Asterisk not exacly via Tomcat servlet but via WebServices > servlets (on Tomcat) calling it form eg. PHP scripts using > CURL. > > Your SITE<------CURL/SOAP------>Tomcat WS > servlet<--AMI--->Asterisk Box > > > Regards, Maciek > > 2008/3/27, Gopal krishnan <sa...@gm... > <mailto:sa...@gm...>>: > > Hi, > > Is it possible I can use a manager api program with > tomcat. If so how should i integrate that, please > assist me. > > I would like to initate a action from a html page so > that it will hit a program developed with manager api. > > -- > Thank you with regards, > Gopal, > PeopleTech Systems Private Limited > www.peopletech.co.in <http://www.peopletech.co.in> > ------------------------------------------------------------------------- > Check out the new SourceForge.net Marketplace. > It's the best place to buy or sell services for > just about anything Open Source. > http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li... > <mailto:Ast...@li...> > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > > > > > > ------------------------------------------------------------------------- > Check out the new SourceForge.net Marketplace. > It's the best place to buy or sell services for > just about anything Open Source. > http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li... > <mailto:Ast...@li...> > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > > > > > -- > Thank you with regards, > Gopal, > PeopleTech Systems Private Limited > www.peopletech.co.in <http://www.peopletech.co.in> > > ------------------------------------------------------------------------- > Check out the new SourceForge.net Marketplace. > It's the best place to buy or sell services for > just about anything Open Source. > http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li... > <mailto:Ast...@li...> > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > > > > > -- > Pozdrawiam > Maciek Tokarski > ------------------------------------------------------------------------- > Check out the new SourceForge.net Marketplace. > It's the best place to buy or sell services for > just about anything Open Source. > http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li... > <mailto:Ast...@li...> > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > > > > > -- > Preetha.A > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference > Don't miss this year's exciting event. There's still time to save $100. > Use priority code J8TL2D2. > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone > ------------------------------------------------------------------------ > > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > |
From: preetha A. <pre...@gm...> - 2008-04-19 09:25:34
|
Hi, As you have done the managerAPI in java servlet,Is it possible to do the following fastagi in servlet?if yes please guide me to do this. Code: import java.io.IOException; iimport org.asteriskjava.fastagi.AgiChannel; import org.asteriskjava.fastagi.AgiException; import org.asteriskjava.fastagi.AgiRequest; import org.asteriskjava.fastagi.BaseAgiScript; import org.asteriskjava.fastagi.DefaultAgiServer; import org.asteriskjava.fastagi.AgiScript; public class Callerid extends BaseAgiScript implements AgiScript { public void service(AgiRequest request, AgiChannel channel) throws AgiException { String callerid=request.getCallerId(); System.out.println(callerid); } } On 3/27/08, Maciek Tokarski <mlo...@gm...> wrote: > > Hi, > Let's say that you want to originate some call to somebody by clicking > button on HTML site. PHP script will look something like that > > > ----PHP CODE filename: clickToCall.php > > > <?php > if (!isset($_POST['call']) or $_POST['call']=='') { > //display form to user > ?> > <form action="clickToCall.php" method="POST"> > <input type="text" name="destination" value="enter destination number > here...."> > <input type="submit" value="call" name="call"> > </form> > <?php > } else { > //call web service using curl > $destination=$_POST['destination']; > > $ch = curl_init(); > $url="http://your.tomcat.host/serletname?dest=$destination"; //you can > also use fopen or file_get_contents functions > curl_setopt($ch, CURLOPT_URL,$url); > curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); > curl_setopt($ch, CURLOPT_POST, 1); > curl_setopt($ch, CURLOPT_POSTFIELDS, $xml_data); > > $data = curl_exec($ch); > if ($data='OK') { > echo "Ok... call is no the way"; > } else { > echo "Some problems...:-("; > } > } > ?> > ---end of PHP code > I thin it won't work if You use Ctrl-C Ctrl-V, but it may looks like thise > above > > Next you have to write a web service servlet that will handle request from > php script: > > > ----JAVA CODE > > package clickToCall; > > import java.io.*; > import javax.servlet.*; > import javax.servlet.http.*; > import org.asteriskjava.manager.AuthenticationFailedException; > import org.asteriskjava.manager.ManagerConnection; > > > import org.asteriskjava.manager.ManagerConnectionFactory; > import org.asteriskjava.manager.TimeoutException; > import org.asteriskjava.manager.action.OriginateAction; > import org.asteriskjava.manager.response.ManagerResponse; > > > > public class HelloWorld extends HttpServlet { > public void doGet(HttpServletRequest request, > HttpServletResponse response) > throws ServletException, IOException { > > PrintWriter out = response.getWriter(); > > > String destinationNo=request.getParameter("dest"); > //pasted from http://asterisk-java.org/development/tutorial.html :-) > > try { > > ManagerConnectionFactory factory = new ManagerConnectionFactory( > "localhost", "manager", "pa55w0rd"); // > > this.managerConnection = factory.createManagerConnection(); > > > OriginateAction originateAction; > ManagerResponse originateResponse; > > originateAction = new OriginateAction(); > originateAction.setChannel("SIP/YOUR_TRUNK_NAME/"+destination); > > originateAction.setContext("default"); > originateAction.setExten("1300"); > originateAction.setPriority(new Integer(1)); > originateAction.setTimeout(new Integer(30000)); > > > // connect to Asterisk and log in > managerConnection.login(); > > // send the originate action and wait for a maximum of 30 seconds for Asterisk > // to send a reply > originateResponse = managerConnection.sendAction(originateAction, 30000); > > > > > // and finally log off and disconnect > managerConnection.logoff(); > > out.println("OK"); > } catch (Exception e) { > out.println("NOT OK"); > > > } > > } > } > > ---End of JAVA code > > > It also won't work after pasting it. Remember to put your Trunk name > context etc. when setting up originate action. Of course you have to set up > your Tomcat with this servlet. Php script can be simply putted into > /varr/www folder of your server > > > > > 2008/3/27, Gopal krishnan <sa...@gm...>: > > > > Hi, > > > > Thanks for the reply, can I have any help or hello world example to set > > this. It would be a great help for me. Thanks > > > > On Thu, Mar 27, 2008 at 2:51 PM, Maciek Tokarski <mlo...@gm...> > > wrote: > > > > > HI, > > > Yes- it is possible. Once, I've developed Tomcat servlet (simple > > > WebService) on Asterisk box to monitor users count on MeetMe rooms. It works > > > fine. In my opinion best way of integrating manager API with HTML sites is > > > interract with Asterisk not exacly via Tomcat servlet but via WebServices > > > servlets (on Tomcat) calling it form eg. PHP scripts using CURL. > > > > > > Your SITE<------CURL/SOAP------>Tomcat WS servlet<--AMI--->Asterisk > > > Box > > > > > > > > > Regards, Maciek > > > > > > 2008/3/27, Gopal krishnan <sa...@gm...>: > > > > > > > > Hi, > > > > > > > > Is it possible I can use a manager api program with tomcat. If so > > > > how should i integrate that, please assist me. > > > > > > > > I would like to initate a action from a html page so that it will > > > > hit a program developed with manager api. > > > > > > > > -- > > > > Thank you with regards, > > > > Gopal, > > > > PeopleTech Systems Private Limited > > > > www.peopletech.co.in > > > > > > > > ------------------------------------------------------------------------- > > > > Check out the new SourceForge.net Marketplace. > > > > It's the best place to buy or sell services for > > > > just about anything Open Source. > > > > > > > > http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace > > > > _______________________________________________ > > > > Asterisk-java-users mailing list > > > > Ast...@li... > > > > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > > > > > > > > > > > > > > > > > > > > > > > ------------------------------------------------------------------------- > > > Check out the new SourceForge.net Marketplace. > > > It's the best place to buy or sell services for > > > just about anything Open Source. > > > > > > http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace > > > _______________________________________________ > > > Asterisk-java-users mailing list > > > Ast...@li... > > > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > > > > > > > > > > > > -- > > Thank you with regards, > > Gopal, > > PeopleTech Systems Private Limited > > www.peopletech.co.in > > > > > > ------------------------------------------------------------------------- > > Check out the new SourceForge.net Marketplace. > > It's the best place to buy or sell services for > > just about anything Open Source. > > > > http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace > > _______________________________________________ > > Asterisk-java-users mailing list > > Ast...@li... > > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > > > > > > > -- > Pozdrawiam > Maciek Tokarski > ------------------------------------------------------------------------- > Check out the new SourceForge.net Marketplace. > It's the best place to buy or sell services for > just about anything Open Source. > > http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > > -- Preetha.A |
From: preetha A. <pre...@gm...> - 2008-04-19 07:23:13
|
Hi, I need to pass a callerid from a fastagi program to a jsp page.How can i pass this?I dont understand how to use spring framework to integrate tomcat with fastagi.my code is very simple one and it follows. code: import java.io.IOException; iimport org.asteriskjava.fastagi.AgiChannel; import org.asteriskjava.fastagi.AgiException; import org.asteriskjava.fastagi.AgiRequest; import org.asteriskjava.fastagi.BaseAgiScript; import org.asteriskjava.fastagi.DefaultAgiServer; import org.asteriskjava.fastagi.AgiScript; public class Callerid extends BaseAgiScript implements AgiScript { public void service(AgiRequest request, AgiChannel channel) throws AgiException { String callerid=request.getCallerId(); System.out.println(callerid); } } I am just getting a callerid from asterisk and printing it.I need this callerid to be passed to a jsp page through a url or however it should be passed.please anyone guide me to do this .please reply me too whether this process needs spring framework? -- Preetha.A |
From: Martin S. <ma...@be...> - 2008-04-18 20:00:52
|
Hi Maciek, ManagerConnection will some concurrency attention -- it will block back and forth if you send and receieve an event on the same thread. Have you looked at using org.asteriskjava.manager.ManagerEventListenerProxy? It listens for events and dispatches them asynchronously in another thread with a single-threaded executor. You could easily probably easily modify it to dispatch to your threadpool of handlers with a multithreaded executor. Alternatively, why not use the Live API and then make a thread for a handler, and have each handler add a listener for events to be fired on the agent -- and then fire once on startup for everything that pre-exists your execution of the program: import java.util.Collection; import org.asteriskjava.live.*; import org.asteriskjava.live.internal.AsteriskAgentImpl; public class TestCase implements AsteriskServerListener { static final String HOST = ""; static final String USERNAME = ""; static final String PASSWORD = ""; public AsteriskServer asteriskServer; public TestCase() throws ManagerCommunicationException { asteriskServer = new DefaultAsteriskServer(HOST, USERNAME, PASSWORD); asteriskServer.addAsteriskServerListener(this); } public void onNewAsteriskChannel(AsteriskChannel channel) { System.out.println("New channel:\n" + channel); } public void onNewMeetMeUser(MeetMeUser user) { System.out.println("New meet me user:\n" + user); } public void onNewQueueEntry(AsteriskQueueEntry entry) { System.out.println("New queue entry:\n" + entry); } public void onNewAgent(AsteriskAgentImpl agent) { System.out.println("New agent:\n" + agent); } // dispatch your handler with agent object public static void main(String[] args) throws Exception { TestCase tc = new TestCase(); Collection<AsteriskAgent> agents = tc.asteriskServer.getAgents(); for(AsteriskAgent agent : agents) tc.onNewAgent((AsteriskAgentImpl)agent); while(true) { Thread.yield(); } } } The live API is much sweeter :) Martin Smith, Systems Developer ma...@be... Bureau of Economic and Business Research University of Florida (352) 392-0171 Ext. 221 ________________________________ From: ast...@li... [mailto:ast...@li...] On Behalf Of Maciek Tokarski Sent: Friday, April 18, 2008 2:11 PM To: ast...@li... Subject: Re: [Asterisk-java-users] Concurrent accesstoManagerConnectioninstance Hi, Examples of code: Main class: //////////// public class LiveMonitoring ManagerEventListener { (...) ManagerConnection connection; (...) Public void LiveMonitoring() { ManagerConnectionFactory manConnFact = new ManagerConnectionFactory("dialer.telebot.pl", "dialer", "dialer"); this.connection = manConnFact.createManagerConnection(); this.connection.addEventListener(this); try { this.connection.login(); } catch (Exception ex) { JOptionPane.showMessageDialog(null, "Connection error.. exiting"); System.exit(0); } } Public void event() { ///this event can be called several times SateliteClass SClass= new SateliteClass(this.connection); } } ////////Satelite class public class SateliteClass implements Runable { ManagerConnection connection; Public void SateliteClass(ManagerConnection) { This.run(); this.connection=connection; } Public synchronized void someMethod() { AgentsAction agentsAction = new AgentsAction(); try { ResponseEvents events = connection.sendEventGeneratingAction(agentsAction, 5000); /////[1] Collection<ResponseEvent> agents = events.getEvents(); Iterator<ResponseEvent> itr = agents.iterator(); while (itr.hasNext()) { ResponseEvent ev1 = itr.next(); if (ev1 instanceof AgentsEvent) { AgentsEvent ev = (AgentsEvent) ev1; if (ev.getAgent().equals(agentNo)) { //processing agent events } } } } catch (IllegalStateException ex) { ex.printStackTrace(); } catch (IllegalArgumentException ex) { ex.printStackTrace(); } catch (EventTimeoutException ex) { ex.printStackTrace(); } catch (IOException ex) { ex.printStackTrace(); } } } } I've located reason of hanging up application- it was Timeout while waiting for response for AgenstAction. Does it have any relation with multithread architecture and concurrent access to ManagerConnectio9 object? Maybe I'm doing something wrong... Regards, Maciek ________________________________ From: ast...@li... [mailto:ast...@li...] On Behalf Of Martin Smith Sent: Wednesday, April 16, 2008 7:22 PM To: ast...@li... Subject: Re: [Asterisk-java-users] Concurrent access toManagerConnectioninstance We might need an example of your code to explain why it doesn't work. Also, the Live API does pretty much what you're describing, including the threading problems. Martin Smith, Systems Developer ma...@be... Bureau of Economic and Business Research University of Florida (352) 392-0171 Ext. 221 ________________________________ From: ast...@li... [mailto:ast...@li...] On Behalf Of Maciek Tokarski Sent: Wednesday, April 16, 2008 11:38 AM To: ast...@li... Subject: [Asterisk-java-users] Concurrent access to ManagerConnectioninstance Hey all, I'm trying to build multithread app. Architecture is as follows: -one main Thread, that does creation of ManagerConnection and login stuff -several "satellite" threads that should have access to previously initialized ManagerConnection object (they have to send some events to Asterisk box) ManagerConnection object is passed to "satellite" threads in constructor and reference to it is assigned to satellite-class member. When I'm trying to send event (I'm doing it in synchronized way) by eg. invoking sendEvent method- application totally hangs up (main thread and child threads). What is the reason and what can be solution. Regards, Maciek |
From: Maciek T. <mlo...@gm...> - 2008-04-18 18:11:36
|
Hi, Examples of code: Main class: //////////// public class LiveMonitoring ManagerEventListener { (.) ManagerConnection connection; (.) Public void LiveMonitoring() { ManagerConnectionFactory manConnFact = new ManagerConnectionFactory("dialer.telebot.pl", "dialer", "dialer"); this.connection = manConnFact.createManagerConnection(); this.connection.addEventListener(this); try { this.connection.login(); } catch (Exception ex) { JOptionPane.showMessageDialog(null, "Connection error.. exiting"); System.exit(0); } } Public void event() { ///this event can be called several times SateliteClass SClass= new SateliteClass(this.connection); } } ////////Satelite class public class SateliteClass implements Runable { ManagerConnection connection; Public void SateliteClass(ManagerConnection) { This.run(); this.connection=connection; } Public synchronized void someMethod() { AgentsAction agentsAction = new AgentsAction(); try { ResponseEvents events = connection.sendEventGeneratingAction(agentsAction, 5000); /////[1] Collection<ResponseEvent> agents = events.getEvents(); Iterator<ResponseEvent> itr = agents.iterator(); while (itr.hasNext()) { ResponseEvent ev1 = itr.next(); if (ev1 instanceof AgentsEvent) { AgentsEvent ev = (AgentsEvent) ev1; if (ev.getAgent().equals(agentNo)) { //processing agent events } } } } catch (IllegalStateException ex) { ex.printStackTrace(); } catch (IllegalArgumentException ex) { ex.printStackTrace(); } catch (EventTimeoutException ex) { ex.printStackTrace(); } catch (IOException ex) { ex.printStackTrace(); } } } } I've located reason of hanging up application- it was Timeout while waiting for response for AgenstAction. Does it have any relation with multithread architecture and concurrent access to ManagerConnectio9 object? Maybe I'm doing something wrong. Regards, Maciek _____ From: ast...@li... [mailto:ast...@li...] On Behalf Of Martin Smith Sent: Wednesday, April 16, 2008 7:22 PM To: ast...@li... Subject: Re: [Asterisk-java-users] Concurrent access toManagerConnectioninstance We might need an example of your code to explain why it doesn't work. Also, the Live API does pretty much what you're describing, including the threading problems. Martin Smith, Systems Developer ma...@be... Bureau of Economic and Business Research University of Florida (352) 392-0171 Ext. 221 _____ From: ast...@li... [mailto:ast...@li...] On Behalf Of Maciek Tokarski Sent: Wednesday, April 16, 2008 11:38 AM To: ast...@li... Subject: [Asterisk-java-users] Concurrent access to ManagerConnectioninstance Hey all, I'm trying to build multithread app. Architecture is as follows: -one main Thread, that does creation of ManagerConnection and login stuff -several "satellite" threads that should have access to previously initialized ManagerConnection object (they have to send some events to Asterisk box) ManagerConnection object is passed to "satellite" threads in constructor and reference to it is assigned to satellite-class member. When I'm trying to send event (I'm doing it in synchronized way) by eg. invoking sendEvent method- application totally hangs up (main thread and child threads). What is the reason and what can be solution. Regards, Maciek |
From: T. L. P. T. <tom...@gm...> - 2008-04-17 02:55:19
|
Hello Satya: Thank you for sharing your experience with FreePBX and Asterisk-Java. Best regards, Tomás. On Wed, Apr 16, 2008 at 10:25 PM, Satya Parimi <sat...@dh...> wrote: > > Hi Tomas > > Thanks for all your help > Yes, In FreePBX 2.4 the custom extension is moved to tools > Here is what I did with FreePBX 2.4....... > I created a custom extension from "Tools/Custom Extensions" menu, 1300 as > extension and custom-myAsteriskJavaApp as description. > Then from "Tools/Custom Destinations" menu created a destination, > "custom-myAsteriskJavaApp,1300,1" as custom destination, and > myAsteriskJavaApp as the description. Then I could see a new radio button > "Custom Applications" in the inbound route screen, I could attach my custom > app to the incoming route > > Now it works. I made two more mistakes which I took a long time to figure > out what went wrong. Let me share it > 1. I used Asterisk server ip to create custom extension in > extensions_custom.conf, right thing is to use the ip of the server running > Asterisk-Java > 2. I created HelloAgiScript.java in a package "com.asteriskjava", but > haven't given the package name in fastagi-mapping.properties, so it > wasn't finding the class > > Now I'm all set > > Thanks > Satya > > > Tomás Laureano Peralta Tormey wrote: > Hello Satya: > I'm running FreePBX 2.3.1.0 on my lab so I can't tell you exactly how yo > solve this issue. Actually, this issue isn't directly related to > Asterisk-Java. > But doing some research in Google point out that the version 2.4 of > FreePBX has some changes in the "Custom App" drop down menu. > > From: http://freepbx.org/trac/browser/freepbx/tags/2.4.0/CHANGES > > > > Addition of Custom Applications Module. Provides a place to register > custom extension numbers as well as custom destinations that are to be used > in FreePBX. Replaces the old Custom Destinations choice that was available > in each module. > > > > Maybe you could try installing this module in FreePBX and doing some > tests. > > To verify if a context (and extension) is available to Asterisk, you can > run this command from the CLI: > show dialplan <exten>@<context> (Asterisk 1.2 or older) > dialplan show <exten>@<context> (Asterisk 1.4) > > For example: > > labbox*CLI> show dialplan 1300@custom-myAsteriskJavaApp > [ Context 'custom-myAsteriskJavaApp' created by 'pbx_config' ] > '1300' => 1. Agi(agi://localhost/hello.agi) > [pbx_config] > > -= 1 extension (1 priority) in 1 context. =- > labbox*CLI> > > Best regards, Tomás. > > ------------------------------------------------------------------------- > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference > Don't miss this year's exciting event. There's still time to save $100. > Use priority code J8TL2D2. > > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > > |
From: Satya P. <sat...@dh...> - 2008-04-17 01:25:19
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type"> </head> <body bgcolor="#ffffff" text="#000000"> Hi Tomas<br> <br> Thanks for all your help<br> Yes, In FreePBX 2.4 the custom extension is moved to tools<br> Here is what I did with FreePBX 2.4.......<br> I created a custom extension from "Tools/Custom Extensions" menu, 1300 as extension and custom-myAsteriskJavaApp as description.<br> Then from "Tools/Custom Destinations" menu created a destination, "custom-myAsteriskJavaApp,1300,1" as custom destination, and myAsteriskJavaApp as the description. Then I could see a new radio button "Custom Applications" in the inbound route screen, I could attach my custom app to the incoming route<br> <br> Now it works. I made two more mistakes which I took a long time to figure out what went wrong. Let me share it<br> 1. I used Asterisk server ip to create custom extension in extensions_custom.conf, right thing is to use the ip of the server running Asterisk-Java<br> 2. I created HelloAgiScript.java in a package "com.asteriskjava", but haven't given the package name in fastagi-mapping.properties, so it wasn't finding the class <br> <br> Now I'm all set<br> <br> Thanks<br> Satya<br> <br> Tomás Laureano Peralta Tormey wrote: <blockquote cite="mid:b00...@ma..." type="cite">Hello Satya:<br> I'm running FreePBX <a moz-do-not-send="true" href="http://2.3.1.0">2.3.1.0</a> on my lab so I can't tell you exactly how yo solve this issue. Actually, this issue isn't directly related to Asterisk-Java.<br> But doing some research in Google point out that the version 2.4 of FreePBX has some changes in the "Custom App" drop down menu.<br> <br> From: <a moz-do-not-send="true" href="http://freepbx.org/trac/browser/freepbx/tags/2.4.0/CHANGES">http://freepbx.org/trac/browser/freepbx/tags/2.4.0/CHANGES</a><br> <br> <blockquote style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;" class="gmail_quote">Addition of Custom Applications Module. Provides a place to register custom extension numbers as well as custom destinations that are to be used in FreePBX. Replaces the old Custom Destinations choice that was available in each module.<br> </blockquote> <br> Maybe you could try installing this module in FreePBX and doing some tests.<br> <br> To verify if a context (and extension) is available to Asterisk, you can run this command from the CLI:<br> show dialplan <exten>@<context> (Asterisk 1.2 or older)<br> dialplan show <exten>@<context> (Asterisk 1.4)<br> <br> For example:<br> <br> labbox*CLI> show dialplan 1300@custom-myAsteriskJavaApp<br> [ Context 'custom-myAsteriskJavaApp' created by 'pbx_config' ]<br> '1300' => 1. Agi(agi://localhost/hello.agi) [pbx_config]<br> <br> -= 1 extension (1 priority) in 1 context. =-<br> labbox*CLI> <br> <br> Best regards, Tomás.<br> <a moz-do-not-send="true" href="https://lists.sourceforge.net/lists/listinfo/asterisk-java-users"></a></blockquote> </body> </html> |
From: Kay Kw <ka...@ya...> - 2008-04-16 18:36:58
|
I'm making progress on this. I wasn't able to compile the sample 'HelloAgiScript' and 'Hellomanager' before, I was using textpad. I ended up downloading NetBeans as suggested in one of the responses I received . I can now compile and run these two files now. ----- Original Message ---- From: Martin Smith <ma...@be...> To: ast...@li... Sent: Wednesday, April 16, 2008 1:22:01 PM Subject: Re: [Asterisk-java-users] Concurrent access to ManagerConnectioninstance <!-- /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {margin:0cm;margin-bottom:.0001pt;font-size:12.0pt;font-family:"Times New Roman";} a:link, span.MsoHyperlink {color:blue;text-decoration:underline;} a:visited, span.MsoHyperlinkFollowed {color:blue;text-decoration:underline;} span.Stylwiadomocie-mail17 {font-family:Arial;color:navy;} _filtered {margin:70.85pt 70.85pt 70.85pt 70.85pt;} div.Section1 {} --> We might need an example of your code to explain why it doesn't work. Also, the Live API does pretty much what you're describing, including the threading problems. Martin Smith, Systems Developer ma...@be... Bureau of Economic and Business Research University of Florida (352) 392-0171 Ext. 221 From: ast...@li... [mailto:ast...@li...] On Behalf Of Maciek Tokarski Sent: Wednesday, April 16, 2008 11:38 AM To: ast...@li... Subject: [Asterisk-java-users] Concurrent access to ManagerConnectioninstance Hey all, I’m trying to build multithread app. Architecture is as follows: -one main Thread, that does creation of ManagerConnection and login stuff -several “satellite” threads that should have access to previously initialized ManagerConnection object (they have to send some events to Asterisk box) ManagerConnection object is passed to “satellite” threads in constructor and reference to it is assigned to satellite-class member. When I’m trying to send event (I’m doing it in synchronized way) by eg. invoking sendEvent method- application totally hangs up (main thread and child threads). What is the reason and what can be solution. Regards, Maciek ____________________________________________________________________________________ Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ |
From: Martin S. <ma...@be...> - 2008-04-16 17:22:10
|
We might need an example of your code to explain why it doesn't work. Also, the Live API does pretty much what you're describing, including the threading problems. Martin Smith, Systems Developer ma...@be... Bureau of Economic and Business Research University of Florida (352) 392-0171 Ext. 221 ________________________________ From: ast...@li... [mailto:ast...@li...] On Behalf Of Maciek Tokarski Sent: Wednesday, April 16, 2008 11:38 AM To: ast...@li... Subject: [Asterisk-java-users] Concurrent access to ManagerConnectioninstance Hey all, I'm trying to build multithread app. Architecture is as follows: -one main Thread, that does creation of ManagerConnection and login stuff -several "satellite" threads that should have access to previously initialized ManagerConnection object (they have to send some events to Asterisk box) ManagerConnection object is passed to "satellite" threads in constructor and reference to it is assigned to satellite-class member. When I'm trying to send event (I'm doing it in synchronized way) by eg. invoking sendEvent method- application totally hangs up (main thread and child threads). What is the reason and what can be solution. Regards, Maciek |
From: Maciek T. <mlo...@gm...> - 2008-04-16 16:15:53
|
Hey all, I'm trying to build multithread app. Architecture is as follows: -one main Thread, that does creation of ManagerConnection and login stuff -several "satellite" threads that should have access to previously initialized ManagerConnection object (they have to send some events to Asterisk box) ManagerConnection object is passed to "satellite" threads in constructor and reference to it is assigned to satellite-class member. When I'm trying to send event (I'm doing it in synchronized way) by eg. invoking sendEvent method- application totally hangs up (main thread and child threads). What is the reason and what can be solution. Regards, Maciek |
From: Martin S. <ma...@be...> - 2008-04-16 15:36:53
|
Depending on what you're trying to do, there may not BE a main method. Either way, you must specify the class on the command line if you want to run the default AGI server. The AMI and Live packages don't have main methods -- they'll be called from your existing code. Have you checked out the tutorial (http://asterisk-java.org/tutorial) or FAQ (http://asterisk-java.org/faq)? They may help you find what you're looking for. If all else fails, show us what code you're trying to run, and how you're trying to run it. Cheers, Martin Smith, Systems Developer ma...@be... Bureau of Economic and Business Research University of Florida (352) 392-0171 Ext. 221 ________________________________ From: ast...@li... [mailto:ast...@li...] On Behalf Of Kay Kw Sent: Wednesday, April 16, 2008 11:14 AM To: ast...@li... Subject: Re: [Asterisk-java-users] loading libraries I know this shouldn't be a big deal but I still cant run the asterisk-java libraries. I tried opening them using 'javaw' but I still get the same error "Failed to load Main-Class manifest attribute from..." please help, anyone thanks ----- Original Message ---- From: Kay Kw <ka...@ya...> To: ast...@li... Sent: Sunday, April 13, 2008 5:18:25 PM Subject: [Asterisk-java-users] loading libraries I'm new to asterisk-java. I'm having trouble loading the 3.0 liberies. My JVM version s 1.6 and am running Java6.0 . Can anyone help with this. __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com ________________________________ Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. <http://us.rd.yahoo.com/evt=51733/*http://mobile.yahoo.com/;_ylt=Ahu06i6 2sR8HDtDypao8Wcj9tAcJ> |
From: Maciek T. <mlo...@gm...> - 2008-04-16 15:28:38
|
Hey, It depends on IDE that you use for development. On NetBeans 6.X: Tools->Libraries->New Library, then you have to find jar file (asterisk-java-0.3.1.jar) and add it. Next, in Project Explorer in IDE expand your project node, right-click on the Libraries folder and add the asterisk-java library. In Eclipse adding library looks similar. By adding library, asterisk-java jar file is automatically added to your classpath _____ From: ast...@li... [mailto:ast...@li...] On Behalf Of Kay Kw Sent: Wednesday, April 16, 2008 5:14 PM To: ast...@li... Subject: Re: [Asterisk-java-users] loading libraries I know this shouldn't be a big deal but I still cant run the asterisk-java libraries. I tried opening them using 'javaw' but I still get the same error "Failed to load Main-Class manifest attribute from..." please help, anyone thanks ----- Original Message ---- From: Kay Kw <ka...@ya...> To: ast...@li... Sent: Sunday, April 13, 2008 5:18:25 PM Subject: [Asterisk-java-users] loading libraries I'm new to asterisk-java. I'm having trouble loading the 3.0 liberies. My JVM version s 1.6 and am running Java6.0 . Can anyone help with this. __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com _____ Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try <http://us.rd.yahoo.com/evt=51733/*http:/mobile.yahoo.com/;_ylt=Ahu06i62sR8H DtDypao8Wcj9tAcJ%20> it now. |
From: Kay Kw <ka...@ya...> - 2008-04-16 15:14:07
|
I know this shouldn't be a big deal but I still cant run the asterisk-java libraries. I tried opening them using 'javaw' but I still get the same error "Failed to load Main-Class manifest attribute from..." please help, anyone thanks ----- Original Message ---- From: Kay Kw <ka...@ya...> To: ast...@li... Sent: Sunday, April 13, 2008 5:18:25 PM Subject: [Asterisk-java-users] loading libraries I'm new to asterisk-java. I'm having trouble loading the 3.0 liberies. My JVM version s 1.6 and am running Java6.0 . Can anyone help with this. __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com ____________________________________________________________________________________ Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ |
From: Kay Kw <ka...@ya...> - 2008-04-13 21:18:23
|
I'm new to asterisk-java. I'm having trouble loading the 3.0 liberies. My JVM version s 1.6 and am running Java6.0 . Can anyone help with this. __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com |
From: preetha A. <pre...@gm...> - 2008-04-11 08:23:24
|
Hi I am trying to pass a callerid which i am getting in fastagi to a jsp or servlet which is in tomcat webapps.Is it possible?if not how could i pass the callerid?whether i have to write the fastagi also in servlet? anyone assist me please. -- Preetha.A |
From: Stefan R. <ste...@re...> - 2008-04-11 06:19:34
|
Hi Will, Trixbox Pro uses a modified protocol to pass events (xml-like). We are currently integrating support for that into Asterisk-Java for 1.0.0. Until that's finished you won't be able to make full use of ADM with Trixbox Pro. =Stefan -- reuter network consulting Neusser Str. 110 50760 Koeln Germany Telefon: +49 221 1305699-0 Telefax: +49 221 1305699-90 E-Mail: ste...@re... Jabber: ste...@re... WWW: http://www.reucon.com Steuernummern 215/5140/1791 USt-IdNr. DE220701760 |
From: T. L. P. T. <tom...@gm...> - 2008-04-11 01:28:14
|
Hello Satya: I'm running FreePBX 2.3.1.0 on my lab so I can't tell you exactly how yo solve this issue. Actually, this issue isn't directly related to Asterisk-Java. But doing some research in Google point out that the version 2.4 of FreePBX has some changes in the "Custom App" drop down menu. From: http://freepbx.org/trac/browser/freepbx/tags/2.4.0/CHANGES Addition of Custom Applications Module. Provides a place to register custom > extension numbers as well as custom destinations that are to be used in > FreePBX. Replaces the old Custom Destinations choice that was available in > each module. > Maybe you could try installing this module in FreePBX and doing some tests. To verify if a context (and extension) is available to Asterisk, you can run this command from the CLI: show dialplan <exten>@<context> (Asterisk 1.2 or older) dialplan show <exten>@<context> (Asterisk 1.4) For example: labbox*CLI> show dialplan 1300@custom-myAsteriskJavaApp [ Context 'custom-myAsteriskJavaApp' created by 'pbx_config' ] '1300' => 1. Agi(agi://localhost/hello.agi) [pbx_config] -= 1 extension (1 priority) in 1 context. =- labbox*CLI> Best regards, Tomás. On Thu, Apr 10, 2008 at 9:20 PM, Satya Parimi <sat...@dh...> wrote: > > Hello Tomas > > Thanks for your detailed response. > I followed the steps and added the custom entry to extensions_custom.conf, > ran the "reload" but did not know how to verify if the context is created > correctly. But while creating the inbound route got struck again. In FreePBX > 2.4, I do not see "Custom App" dropdown on "Set Destination" section. What I > see is two radio buttons, "Terminate Call" with a drop down of > Hangup/busy/congestion/...etc, the other dorpdown is "Extensions", which > shows extensions I created using FreePBX. > > Is there anything else to be done here to use the custom app? > > Thanks for your help > Satya > > > > From: Tomás Laureano Peralta Tormey <tomas.tormey@gm...> - 2008-04-10 03:59 > Hello Satya: > Yes, you can integrate Asterisk-Java and FreePBX without any dirty work > around. > Let's see how this could be achieved. > > The first thing you should know about FreePBX configuration files is > that any modules that generates any configuration files, usually use > the name <configuration file>_additional.conf. Normally, a base > configuration file will include this FreePBX generated file. For > example, the base extensions.conf file that comes with FreePBX > includes (among others) the files extensions_additional.conf. > It doesn't make any sense to modify extensions_additional.conf, > because the next time that changes are applied from the interface, > this file will be regenerated; dropping any changes done by hand. > Also, the base config file (in this case, extensions.conf) shouldn't > be edited. There is a better way to integrate your self developed > contexts, extensions and priorities. > Most of the base config files of FreePBX include a file named > <configuration file>_custom.conf. In this case, you should edit > extensions_custom.conf and add your custom context. > For example: > > [custom-myAsteriskJavaApp] > exten => 1300,1,Agi(agi://localhost/hello.agi) > > Now, if you run an "extensions reload" command from the CLI, a new > context will be available. We are going to use this context to > integrate Asterisk-Java. > > To attach an inbound route to your Asterisk-Java application, you > will need to create a new Inbound route and select "Custom App" in the > "Set Destination" combo box. By using "Custom App", any incoming call > that matches this inbound route will be delivered to a context (which > must start with the "custom-" prefix) available to Asterisk. Copy the > name of this new context, the extension and the priority > (custom-myAsteriskJavaApp,1300,1) to the input box. Submit the changes > and apply the changes to Asterisk. > > You can now test an incoming call to the DID 1300 and have fun with > Asterisk-Java. > > Your mileage may vary but you should be able to have this example > working with little modifications. Let us know if you have any > problem. > > Best regards, Tomás. > > > > Hi > I'm a new user with Asterisk & Asterisk-Java > I installed Asterisk using PBX in a FLASH, which is a bundle of Asterisk > 1.4, FreePBX 2.4 and Cent OS > I'm able to create trunk/inbound route/extension easily using the FreePBX > GUI, it works great with a soft phone > > Now I want to intercept the inbound call, so I'm trying to use > Asterisk-Java (release from 4/9/08). I followed the example but stumbled on > creating an extension as suggested. Since I used FreePBX it generates the > extensions.conf files, so I cannot edit that. Of course I tried to edit that > file to add "exten => 1300,1,Agi(agi://localhost/hello.agi)", but that > didn't work. It doesn't show up on FreePBX GUI, so I cannot attach that to > inbound route. > > If I use FreePBX, can't I setup Asterisk-Java? Is there a work around? > I appreciate any help with this > > Thanks > Satya > > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference > Don't miss this year's exciting event. There's still time to save $100. > Use priority code J8TL2D2. > > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > > |
From: Satya P. <sat...@dh...> - 2008-04-11 00:20:22
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type"> </head> <body bgcolor="#ffffff" text="#000000"> Hello Tomas<br> <br> Thanks for your detailed response. <br> I followed the steps and added the custom entry to extensions_custom.conf, ran the "reload" but did not know how to verify if the context is created correctly. But while creating the inbound route got struck again. In FreePBX 2.4, I do not see "Custom App" dropdown on "Set Destination" section. What I see is two radio buttons, "Terminate Call" with a drop down of Hangup/busy/congestion/...etc, the other dorpdown is "Extensions", which shows extensions I created using FreePBX. <br> <br> Is there anything else to be done here to use the custom app?<br> <br> Thanks for your help<br> Satya<br> <br> <br> <blockquote cite="mid:47F...@dh..." type="cite"><small>From: Tomás Laureano Peralta Tormey <a class="moz-txt-link-rfc2396E" href="mailto:tomas.tormey@gm..."><tomas.tormey@gm...></a> - 2008-04-10 03:59</small></blockquote> <blockquote cite="mid:47F...@dh..." type="cite"> Hello Satya:<br> Yes, you can integrate Asterisk-Java and FreePBX without any dirty work around.<br> Let's see how this could be achieved.<br> <br> The first thing you should know about FreePBX configuration files is<br> that any modules that generates any configuration files, usually use<br> the name <configuration file>_additional.conf. Normally, a base<br> configuration file will include this FreePBX generated file. For<br> example, the base extensions.conf file that comes with FreePBX<br> includes (among others) the files extensions_additional.conf.<br> It doesn't make any sense to modify extensions_additional.conf,<br> because the next time that changes are applied from the interface,<br> this file will be regenerated; dropping any changes done by hand.<br> Also, the base config file (in this case, extensions.conf) shouldn't<br> be edited. There is a better way to integrate your self developed<br> contexts, extensions and priorities.<br> Most of the base config files of FreePBX include a file named<br> <configuration file>_custom.conf. In this case, you should edit<br> extensions_custom.conf and add your custom context.<br> For example:<br> <br> [custom-myAsteriskJavaApp]<br> exten => 1300,1,Agi(agi://localhost/hello.agi)<br> <br> Now, if you run an "extensions reload" command from the CLI, a new<br> context will be available. We are going to use this context to<br> integrate Asterisk-Java.<br> <br> To attach an inbound route to your Asterisk-Java application, you<br> will need to create a new Inbound route and select "Custom App" in the<br> "Set Destination" combo box. By using "Custom App", any incoming call<br> that matches this inbound route will be delivered to a context (which<br> must start with the "custom-" prefix) available to Asterisk. Copy the<br> name of this new context, the extension and the priority<br> (custom-myAsteriskJavaApp,1300,1) to the input box. Submit the changes<br> and apply the changes to Asterisk.<br> <br> You can now test an incoming call to the DID 1300 and have fun with<br> Asterisk-Java.<br> <br> Your mileage may vary but you should be able to have this example<br> working with little modifications. Let us know if you have any<br> problem.<br> <br> Best regards, Tomás. <br> </blockquote> <br> <blockquote cite="mid:47F...@dh..." type="cite">Hi<br> I'm a new user with Asterisk & Asterisk-Java <br> I installed Asterisk using PBX in a FLASH, which is a bundle of Asterisk 1.4, FreePBX 2.4 and Cent OS <br> I'm able to create trunk/inbound route/extension easily using the FreePBX GUI, it works great with a soft phone <br> <br> Now I want to intercept the inbound call, so I'm trying to use Asterisk-Java (release from 4/9/08). I followed the example but stumbled on creating an extension as suggested. Since I used FreePBX it generates the extensions.conf files, so I cannot edit that. Of course I tried to edit that file to add "exten => 1300,1,Agi(agi://localhost/hello.agi)", but that didn't work. It doesn't show up on FreePBX GUI, so I cannot attach that to inbound route. <br> <br> If I use FreePBX, can't I setup Asterisk-Java? Is there a work around? <br> I appreciate any help with this <br> <br> Thanks <br> Satya <br> <br> </blockquote> <br> </body> </html> |
From: Martin S. <ma...@be...> - 2008-04-10 17:52:15
|
Hi Maciek, I know Gaetan has created a patch to AstManProxy that allows it to work with AJ, and I believe AstManProxy does attach information about what server the event originally came from. You may be able to combine AstManProxy and Asterisk-Java in such a way that you wouldn't have to modify either, and only write your program to read the extra field for the original server that fired the event. See http://dev.mcit.be/various/astmanproxy-asterisk-java.html. Cheers, Martin Smith, Systems Developer ma...@be... Bureau of Economic and Business Research University of Florida (352) 392-0171 Ext. 221 > -----Original Message----- > From: ast...@li... > [mailto:ast...@li...] On > Behalf Of Maciek Tokarski > Sent: Thursday, April 10, 2008 11:27 AM > To: ast...@li... > Subject: [Asterisk-java-users] Multihost events monitoring > > Hi all, > I want to develop application that will monitor cluster of > Asterisk hosts. > I'm wondering if asterisk-java is able to handle events form > many boxes. My > first idea was one main class implementing EventListner and > several manager > connections with main class as event listener. But problem > comes up when > main class have to find out origin of event (eg. Hostname or > IP address). > There is no property such "Source" in events classes. > > Next attempt may be multithread application with some common > synchronized > resources. > > Any more ideas?? > > Regards, Maciek > > > -------------------------------------------------------------- > ----------- > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference > Don't miss this year's exciting event. There's still time to > save $100. > Use priority code J8TL2D2. > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java > .sun.com/javaone > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > |
From: Maciek T. <mlo...@gm...> - 2008-04-10 15:27:14
|
Hi all, I want to develop application that will monitor cluster of Asterisk hosts. I'm wondering if asterisk-java is able to handle events form many boxes. My first idea was one main class implementing EventListner and several manager connections with main class as event listener. But problem comes up when main class have to find out origin of event (eg. Hostname or IP address). There is no property such "Source" in events classes. Next attempt may be multithread application with some common synchronized resources. Any more ideas?? Regards, Maciek |
From: Will B. <wb...@vo...> - 2008-04-10 12:21:00
|
Was wondering if anyone would know what I am doing wrong. I am running trixbox pro and have installed the Asterisk Desktop Manager to try an example program of the java-asterisk AMI. With little effort I was able to get the dialing out to work without a problem, but I can't get the ADM to recognize an incoming call, or do the system tray etc... Also tried setting callevent=yes in the general section of sip.conf as suggested on the ADM forums. My pbx is at a datacenter and ADM is running behind my cable modem router. Was wondering if I was running into some kind of router firewall issue. Tried wireshark and did not see anything that looked like packed were getting stranded. I wish I could tell if asterisk was actually even trying to deliver the notification to the ADM? Also if someone knows of some good documentation on AMI, would love to know about it. Not sure where to go from here? Any suggestions would be much appreciated. Thanks Will Berger |
From: Kay Kw <ka...@ya...> - 2008-04-10 05:50:09
|
I would like to kame posts to the list __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com |