Thread: [Asterisk-java-users] Call status tracking HOWTO
Brought to you by:
srt
From: Silvio B. <sbi...@ja...> - 2007-07-05 10:28:31
|
Hello all, We are developing an Asterisk extension to a software system for automated telephonic interviewing. The sample management process feeds us telephone numbers and we have to respond with call status/progress information. Currently we are using asterisk-java to connect to Asterisk. Can anyone point us in the right direction (preferably a small code sample) of how to initiate a call and then track the status of that call (connecting, ringing, answered and various error statusses)? Thanks in advance, Kind regards, Silvio Bierman Jambo software |
From: David R. <dr...@in...> - 2007-07-05 11:04:16
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Silvio Bierman wrote: > Can anyone point us in the right direction (preferably a small code > sample) of how to initiate a call and then track the status of that call > (connecting, ringing, answered and various error statusses)? When initiating a call (using the Manager API and the Originate command), set a variable on that call. Then track the events the Manager API emits, if you encounter a NewChannelEvent get the variable from that channel and match it to a call. From there on you can use the channel name to track events. Hope that helps, David Roden - -- INA Service GmbH Papenreye 63 22453 Hamburg Germany Mail: in...@in... Phone: +49 (0)40 557 07-07 Fax: +49 (0)40 557 07-100 Geschäftsführer: Ines M. Hoerner Amtsgericht Hamburg HRB 96470 Ust-IdNr. DE248754961 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFGjNAXah2J2g3uuwIRAtIKAJwL+/S6KwzZYN8mhE8veYxpW0/N0QCdHObv paHpMSmx/Dz+mSfbxbf/570= =vDFB -----END PGP SIGNATURE----- |
From: Stefan R. <ste...@re...> - 2007-07-05 12:07:04
Attachments:
signature.asc
|
> When initiating a call (using the Manager API and the Originate > command), set a variable on that call. Then track the events the Manage= r > API emits, if you encounter a NewChannelEvent get the variable from tha= t > channel and match it to a call. From there on you can use the channel > name to track events. You can also use the originateToXXXAsync methods in org.asteriskjava.live.DefaultAsteriskServer that does exactly what David describes. If anybody has a good example I am happy to include it in the tutorial. =3DStefan --=20 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... Steuernummern 215/5140/1791 USt-IdNr. DE220701760 |
From: Silvio B. <sbi...@ja...> - 2007-07-06 09:27:11
|
Hello David, Thank you and Stefan for your responses. We tried this earlier, and after reading your messages also the async way. The problem is that we get a very limited number of events. We never see events like RINGING, BUSY or whatever. Just an immediate UP event and finally a DOWN event. Any idea if we are doing something wrong or should configure things differently? Kind regards, Silvio Bierman David Roden wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Silvio Bierman wrote: > > >> Can anyone point us in the right direction (preferably a small code >> sample) of how to initiate a call and then track the status of that call >> (connecting, ringing, answered and various error statusses)? >> > > When initiating a call (using the Manager API and the Originate > command), set a variable on that call. Then track the events the Manager > API emits, if you encounter a NewChannelEvent get the variable from that > channel and match it to a call. From there on you can use the channel > name to track events. > > > Hope that helps, > > David Roden > - -- > INA Service GmbH > Papenreye 63 > 22453 Hamburg > Germany > > Mail: in...@in... > Phone: +49 (0)40 557 07-07 > Fax: +49 (0)40 557 07-100 > > Geschäftsführer: Ines M. Hoerner > > Amtsgericht Hamburg > HRB 96470 > Ust-IdNr. DE248754961 > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.7 (GNU/Linux) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iD8DBQFGjNAXah2J2g3uuwIRAtIKAJwL+/S6KwzZYN8mhE8veYxpW0/N0QCdHObv > paHpMSmx/Dz+mSfbxbf/570= > =vDFB > -----END PGP SIGNATURE----- > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > |
From: Stefan R. <ste...@re...> - 2007-07-06 09:35:28
Attachments:
signature.asc
|
Silvio Bierman wrote: > The problem is that we get a very limited number of events. We never se= e=20 > events like RINGING, BUSY or whatever. Just an immediate UP event and=20 > finally a DOWN event. Any idea if we are doing something wrong or shoul= d=20 > configure things differently? You could either post your code so we can comment on it or you might have a look at http://svn.reucon.net/repos/asterisk-java/trunk/src/integrationtest/org/a= steriskjava/live/ and especially OriginateCauseAsyncTest.java which might give you some insights. =3DStefan --=20 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... Steuernummern 215/5140/1791 USt-IdNr. DE220701760 |
From: Silvio B. <sbi...@ja...> - 2007-07-06 09:43:13
|
Hello Stefan, That is very helpful. We will look into this code and see if we can get a better grasp on this whole Asterisk thing. If we still can't get things working than I will definitely come back with some code. Regards, Silvio Bierman Stefan Reuter wrote: > Silvio Bierman wrote: > >> The problem is that we get a very limited number of events. We never see >> events like RINGING, BUSY or whatever. Just an immediate UP event and >> finally a DOWN event. Any idea if we are doing something wrong or should >> configure things differently? >> > > You could either post your code so we can comment on it or you might > have a look at > http://svn.reucon.net/repos/asterisk-java/trunk/src/integrationtest/org/asteriskjava/live/ > and especially OriginateCauseAsyncTest.java which might give you some > insights. > > =Stefan > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > ------------------------------------------------------------------------ > > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > |
From: David R. <dr...@in...> - 2007-07-06 10:06:39
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Silvio Bierman wrote: > The problem is that we get a very limited number of events. We never see > events like RINGING, BUSY or whatever. Just an immediate UP event and > finally a DOWN event. Any idea if we are doing something wrong or should > configure things differently? Make sure that Asterisk is configured to deliver all events to your Manager API user. - From my manager.conf: - ---- SNIP ---- [javaclient] secret = haha-you-bet permit = 127.0.0.1/255.0.0.0 read = all write = all - ---- SNAP ---- With this configuration I get to see all kinds of event, NewChannelEvents, NewExtenEvents, NewStateEvents and what not. > Silvio Bierman David - -- INA Service GmbH Papenreye 63 22453 Hamburg Germany Mail: in...@in... Phone: +49 (0)40 557 07-07 Fax: +49 (0)40 557 07-100 Geschäftsführer: Ines M. Hoerner Amtsgericht Hamburg HRB 96470 Ust-IdNr. DE248754961 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFGjhQOah2J2g3uuwIRAnM5AJ0fktvsvAtm3GzjsdWupPjOuwBcwgCfQO7S FUSOK8FxxL0k3x6B7rgIB7I= =BvIQ -----END PGP SIGNATURE----- |
From: Gabriel A. <gab...@gl...> - 2007-07-05 18:51:54
|
Hi All, We are using asterisk-java 0.2 to handle Events and to do Calls with OriginateAction. Due to applications requirements we need to handle events all the time, but when we make an OriginateCall the Events Handling stops (ie. JoinEvent and LeaveEvent). We are using synchronous OriginateCall because we need to know in the moment the call's result (if the called really answered or not). We are using 2 different Manager Connections with 2 different Manager User in Asterisk. In spite of that the Events Handling stops until OriginateCall sends the response. Although there are 2 several connections it seems that there is only one tunnel. How can we have 2 real independents connections? Why does one connection stop to handle events if the other connection is making an OriginateAction? Any suggestion would be appreciated. Thanks in advance. Gabriel. |
From: David R. <dr...@in...> - 2007-07-06 08:17:41
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Gabriel Allasia wrote: > We are using synchronous OriginateCall because we need to know in the > moment the call's result (if the called really answered or not). Make it asynchron and watch for NewStateEvents with State == "Up", that will tell you when a channel has been answered. > Gabriel. Hope that helps, David - -- INA Service GmbH Papenreye 63 22453 Hamburg Germany Mail: in...@in... Phone: +49 (0)40 557 07-07 Fax: +49 (0)40 557 07-100 Geschäftsführer: Ines M. Hoerner Amtsgericht Hamburg HRB 96470 Ust-IdNr. DE248754961 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFGjfqFah2J2g3uuwIRAlePAKCFOjB13+u6uRDgxa2U/8MA0h1/GACg09GW ABa4bPEnahqzOPao26FAQAA= =+RNK -----END PGP SIGNATURE----- |
From: Gabriel A. <gab...@gl...> - 2007-07-10 20:27:24
|
Hi, I'm creating 2 beans with Spring using DefaultManagerConnection, only one of them has an EventListener added, the other it will used for making calls. Although the javadocs says "Note that the DefaultManagerConnection will create one new Thread for reading data from Asterisk", I'm receiving the events through the Connection that it doesn't have an EventListener. How can I get 2 real independent connections? Thanks in advance, Gabriel. |
From: Stefan R. <ste...@re...> - 2007-07-10 20:39:17
Attachments:
signature.asc
|
Gabriel Allasia wrote: > I'm creating 2 beans with Spring using DefaultManagerConnection, only o= ne of > them has an EventListener added, the other it will used for making call= s. >=20 > Although the javadocs says "Note that the DefaultManagerConnection will= > create one new Thread for reading data from Asterisk", I'm receiving th= e > events through the Connection that it doesn't have an EventListener. how (or where do you receive events) if you did not register an event listener? and which event? =3DStefan --=20 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... Steuernummern 215/5140/1791 USt-IdNr. DE220701760 |
From: Gabriel A. <gab...@gl...> - 2007-07-10 20:44:43
|
I need to make calls through one connection and to receive Events through another. Events like JoinEvent and LeaveEvent. Thanks for your reply. Gabriel -----Original Message----- From: ast...@li... [mailto:ast...@li...] On Behalf Of Stefan Reuter Sent: Martes, 10 de Julio de 2007 05:40 p.m. To: ast...@li... Subject: Re: [Asterisk-java-users] Two Connection but only one Thread for reading... Gabriel Allasia wrote: > I'm creating 2 beans with Spring using DefaultManagerConnection, only one of > them has an EventListener added, the other it will used for making calls. > > Although the javadocs says "Note that the DefaultManagerConnection will > create one new Thread for reading data from Asterisk", I'm receiving the > events through the Connection that it doesn't have an EventListener. how (or where do you receive events) if you did not register an event listener? and which event? =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... Steuernummern 215/5140/1791 USt-IdNr. DE220701760 |
From: Stefan R. <ste...@re...> - 2007-07-10 20:48:07
Attachments:
signature.asc
|
Gabriel Allasia wrote: > I need to make calls through one connection and to receive Events throu= gh > another. Events like JoinEvent and LeaveEvent. well that will just work. I really don't understand the problem you seem to encounter. =3DStefan --=20 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... Steuernummern 215/5140/1791 USt-IdNr. DE220701760 |
From: Gabriel A. <gab...@gl...> - 2007-07-11 13:12:42
|
I will try to explain better, sorry. I have 2 beans like: <bean id="managerConnection" class="org.asteriskjava.manager.DefaultManagerConnection" ... > <bean id="managerConnectionCaller" class="org.asteriskjava.manager.DefaultManagerConnection" ... > Over the first connection I add an Event Listener. With the second connection I will make a call with Originate Action. If I debug with Eclipse, I see the following Threads: Java Manager Connection 0-Reader 0 Java Manager Connection 1-Reader 0 However while I debug with Eclipse, if I make a call from a phone to Asterisk, the Events come through Java Manager Connection 1-Reader 0. And if I make a call with Originate using bean 2, it will go through Java Manager Connection 1-Reader 0 also. Nothing goes through Java Manager Connection 0-Reader 0. Regards, Gabriel. -----Original Message----- From: ast...@li... [mailto:ast...@li...] On Behalf Of Stefan Reuter Sent: Martes, 10 de Julio de 2007 05:49 p.m. To: ast...@li... Subject: Re: [Asterisk-java-users] Two Connection but only one Thread for reading... Gabriel Allasia wrote: > I need to make calls through one connection and to receive Events through > another. Events like JoinEvent and LeaveEvent. well that will just work. I really don't understand the problem you seem to encounter. =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... Steuernummern 215/5140/1791 USt-IdNr. DE220701760 |