Thread: [Asterisk-java-users] event to check for Registered users
Brought to you by:
srt
From: Aparna R. <apa...@ya...> - 2005-12-19 13:59:17
|
Hello, Is there an event in Manager API, which can detect the users that have been registered with asterisk? I now use the PeerStatusEvent which denotes every time a user registers with asterisk. Now at times when i need to re-run my program again, the already registered users are not visible. What event can help me find also the already resgitered users, which will be displayed after i re-run my program? Kindly help. Thanks n Regards Aparna __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com |
From: Stefan R. <sr...@re...> - 2005-12-19 14:03:43
|
Aparna, please have a look at the SipPeersAction. It generates PeerEntryEvents that contain a status field that you can probably use for your purposes. =3DStefan On Mon, 2005-12-19 at 05:59 -0800, Aparna Ramakrishnan wrote: > Hello, > Is there an event in Manager API, which can detect the users that have > been registered with asterisk? > I now use the PeerStatusEvent which denotes every time a user > registers with asterisk.=20 > Now at times when i need to re-run my program again, the already > registered users are not visible. What event can help me find also the > already resgitered users, which will be displayed after i re-run my > program? > =20 > Kindly help. > =20 > Thanks n Regards > Aparna > __________________________________________________ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam protection around=20 > http://mail.yahoo.com=20 >=20 |
From: Aparna R. <apa...@ya...> - 2005-12-19 14:44:28
|
Hello Stefan, Thank you for your reply. I would like some additional help since I am new to Asterisk as well as Java. Plz bear with me. How do I assign SIPPeersAction .. , with sendAction? as in, managerConnection.sendAction(mySIPPeersAction()); ?? or how should i go abt it? Also, in handlevent method, should I use the event PeerStatusEvent? and get its Status? Kindly guide further. Appreciate your help and advice. Thanks again Aparna Stefan Reuter <sr...@re...> wrote: Aparna, please have a look at the SipPeersAction. It generates PeerEntryEvents that contain a status field that you can probably use for your purposes. =Stefan On Mon, 2005-12-19 at 05:59 -0800, Aparna Ramakrishnan wrote: > Hello, > Is there an event in Manager API, which can detect the users that have > been registered with asterisk? > I now use the PeerStatusEvent which denotes every time a user > registers with asterisk. > Now at times when i need to re-run my program again, the already > registered users are not visible. What event can help me find also the > already resgitered users, which will be displayed after i re-run my > program? > > Kindly help. > > Thanks n Regards > Aparna > __________________________________________________ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam protection around > http://mail.yahoo.com > __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com |
From: Stefan R. <sr...@re...> - 2005-12-19 15:22:26
|
Aparna, you can use something like this: ResponseEvents response =3D conn.sendEventGeneratingAction(new SIPPeersAction()); Iterator i =3D response.getEvents().iterator(); while (i.hasNext()) { ManagerEvent event =3D (ManagerEvent) i.next(); if (event instanceof PeerEntryEvent) { PeerEntryEvent peer =3D (PeerEntryEvent) event; System.out.println(peer.getObjectName() + ": " + peer.getStatus()); } } There are two things to note: 1. SIPPeersAction is only available with Asterisk 1.2. 2. SIPPeerEntry in Asterisk-Java 0.2 had a bug that I just fixed. Please us the asterisk-java jar from http://null.reucon.net/~srt/asterisk-java-0.2-fix1.jar Hope that helps, =3DStefan On Mon, 2005-12-19 at 06:44 -0800, Aparna Ramakrishnan wrote: > Hello Stefan, > Thank you for your reply. > I would like some additional help since I am new to Asterisk as well > as Java. Plz bear with me. > =20 > How do I assign SIPPeersAction .. , with sendAction? as in,=20 > managerConnection.sendAction(mySIPPeersAction()); ?? > =20 > or how should i go abt it? > =20 > Also, in handlevent method, should I use the event PeerStatusEvent? > and get its Status? > =20 > Kindly guide further. Appreciate your help and advice. > =20 > Thanks again > Aparna > =20 >=20 > Stefan Reuter <sr...@re...> wrote: > Aparna, > =20 > please have a look at the SipPeersAction. It generates > PeerEntryEvents > that contain a status field that you can probably use for your > purposes. > =20 > =3DStefan > =20 > On Mon, 2005-12-19 at 05:59 -0800, Aparna Ramakrishnan wrote: > > Hello, > > Is there an event in Manager API, which can detect the users > that have > > been registered with asterisk? > > I now use the PeerStatusEvent which denotes every time a > user > > registers with asterisk.=20 > > Now at times when i need to re-run my program again, the > already > > registered users are not visible. What event can help me > find also the > > already resgitered users, which will be displayed after i > re-run my > > program? > >=20 > > Kindly help. > >=20 > > Thanks n Regards > > Aparna > > __________________________________________________ > > Do You Yahoo!? > > Tired of spam? Yahoo! Mail has the best spam protection > around=20 > > http://mail.yahoo.com=20 > >=20 >=20 >=20 >=20 > __________________________________________________ > Do You Yahoo!? > Ti red of spam? Yahoo! Mail has the best spam protection around=20 > http://mail.yahoo.com=20 >=20 |
From: Aparna R. <apa...@ya...> - 2005-12-20 08:32:31
|
Hello Stefan, I have Asterisk version 1.0.7 and so I beleive I cannot go ahead with using SIPPeersAction. So if I now upgrade from 1.0.7 to 1.2, will I need to go through any changes in its setup or so? and whats the procedure.. kindly guide. Thanks n regards Aparna Stefan Reuter <sr...@re...> wrote: Aparna, you can use something like this: ResponseEvents response = conn.sendEventGeneratingAction(new SIPPeersAction()); Iterator i = response.getEvents().iterator(); while (i.hasNext()) { ManagerEvent event = (ManagerEvent) i.next(); if (event instanceof PeerEntryEvent) { PeerEntryEvent peer = (PeerEntryEvent) event; System.out.println(peer.getObjectName() + ": " + peer.getStatus()); } } There are two things to note: 1. SIPPeersAction is only available with Asterisk 1.2. 2. SIPPeerEntry in Asterisk-Java 0.2 had a bug that I just fixed. Please us the asterisk-java jar from http://null.reucon.net/~srt/asterisk-java-0.2-fix1.jar Hope that helps, =Stefan On Mon, 2005-12-19 at 06:44 -0800, Aparna Ramakrishnan wrote: > Hello Stefan, > Thank you for your reply. > I would like some additional help since I am new to Asterisk as well > as Java. Plz bear with me. > > How do I assign SIPPeersAction .. , with sendAction? as in, > managerConnection.sendAction(mySIPPeersAction()); ?? > > or how should i go abt it? > > Also, in handlevent method, should I use the event PeerStatusEvent? > and get its Status? > > Kindly guide further. Appreciate your help and advice. > > Thanks again > Aparna > > > Stefan Reuter wrote: > Aparna, > > please have a look at the SipPeersAction. It generates > PeerEntryEvents > that contain a status field that you can probably use for your > purposes. > > =Stefan > > On Mon, 2005-12-19 at 05:59 -0800, Aparna Ramakrishnan wrote: > > Hello, > > Is there an event in Manager API, which can detect the users > that have > > been registered with asterisk? > > I now use the PeerStatusEvent which denotes every time a > user > > registers with asterisk. > > Now at times when i need to re-run my program again, the > already > > registered users are not visible. What event can help me > find also the > > already resgitered users, which will be displayed after i > re-run my > > program? > > > > Kindly help. > > > > Thanks n Regards > > Aparna > > __________________________________________________ > > Do You Yahoo!? > > Tired of spam? Yahoo! Mail has the best spam protection > around > > http://mail.yahoo.com > > > > > > __________________________________________________ > Do You Yahoo!? > Ti red of spam? Yahoo! Mail has the best spam protection around > http://mail.yahoo.com > __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com |
From: Aparna R. <apa...@ya...> - 2005-12-20 09:38:52
|
Also, another question... Is there any other way that I can continue with the same version asterisk 1.0.7 and still get to display the Registered Users when i re-run the java program?? At this moment, I do not want to upgrade. Kindly guide. Thanks Aparna Aparna Ramakrishnan <apa...@ya...> wrote: Hello Stefan, I have Asterisk version 1.0.7 and so I beleive I cannot go ahead with using SIPPeersAction. So if I now upgrade from 1.0.7 to 1.2, will I need to go through any changes in its setup or so? and whats the procedure.. kindly guide. Thanks n regards Aparna Stefan Reuter <sr...@re...> wrote: Aparna, you can use something like this: ResponseEvents response = conn.sendEventGeneratingAction(new SIPPeersAction()); Iterator i = response.getEvents().iterator(); while (i.hasNext()) { ManagerEvent event = (ManagerEvent) i.next(); if (event instanceof PeerEntryEvent) { PeerEntryEvent peer = (PeerEntryEvent) event; System.out.println(peer.getObjectName() + ": " + peer.getStatus()); } } There are two things to note: 1. SIPPeersAction is only available with Asterisk 1.2. 2. SIPPeerEntry in Asterisk-Java 0.2 had a bug that I just fixed. Please us the asterisk-java jar from http://null.reucon.net/~srt/asterisk-java-0.2-fix1.jar Hope that helps, =Stefan On Mon, 2005-12-19 at 06:44 -0800, Aparna Ramakrishnan wrote: > Hello Stefan, > Thank you for your reply. > I would like some additional help since I am new to Asterisk as well > as Java. Plz bear with me. > > How do I assign SIPPeersAction .. , with sendAction? as in, > managerConnection.sendAction(mySIPPeersAction()); ?? > > or how should i go abt it? > > Also, in handlevent method, should I use the event PeerStatusEvent? > and get its Status? > > Kindly guide further. Appreciate your help and advice. > > Thanks again > Aparna > > > Stefan Reuter wrote: > Aparna, > > please have a look at the SipPeersAction. It generates > PeerEntryEvents > that contain a status field that you can probably use for your > purposes. > > =Stefan > > On Mon, 2005-12-19 at 05:59 -0800, Aparna Ramakrishnan wrote: > > Hello, > > Is there an event in Manager API, which can detect the users > that have > > been registered with asterisk? > > I now use the PeerStatusEvent which denotes every time a > user > > registers with asterisk. > > Now at times when i need to re-run my program again, the > already > > registered users are not visible. What event can help me > find also the > > already resgitered users, which will be displayed after i > re-run my > > program? > > > > Kindly help. > > > > Thanks n Regards > > Aparna > > __________________________________________________ > > Do You Yahoo!? > > Tired of spam? Yahoo! Mail has the best spam protection > around > > http://mail.yahoo.com > > > > > > __________________________________________________ > Do You Yahoo!? > Ti red of spam? Yahoo! Mail has the best spam protection around > http://mail.yahoo.com > __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com |
From: Stefan R. <sr...@re...> - 2005-12-20 13:34:27
|
You can also use a CommandAction with "sip show peers". But then you have to parse the CLI output on your own. =3DStefan > Also, another question... > Is there any other way that I can continue with the same version > asterisk 1.0.7 and still get to display the Registered Users when i > re-run the java program?? > At this moment, I do not want to upgrade. > Kindly guide. > > Thanks > Aparna > > Aparna Ramakrishnan <apa...@ya...> wrote: > Hello Stefan, > I have Asterisk version 1.0.7 and so I beleive I cannot go ahead with > using SIPPeersAction. So if I now upgrade from 1.0.7 to 1.2, will I nee= d > to go through any changes in its setup or so? and whats the procedure.. > kindly guide. > > Thanks n regards > Aparna > > > Stefan Reuter <sr...@re...> wrote: > Aparna, > > you can use something like this: > > ResponseEvents response =3D conn.sendEventGeneratingAction(new > SIPPeersAction()); > Iterator i =3D response.getEvents().iterator(); > while (i.hasNext()) > { > ManagerEvent event =3D (ManagerEvent) i.next(); > if (event instanceof PeerEntryEvent) > { > PeerEntryEvent peer =3D (PeerEntryEvent) event; > System.out.println(peer.getObjectName() + ": " + peer.getStatus()); > } > } > > There are two things to note: > 1. SIPPeersAction is only available with Asterisk 1.2. > 2. SIPPeerEntry in Asterisk-Java 0.2 had a bug that I just fixed. > Please us the asterisk-java jar from > http://null.reucon.net/~srt/asterisk-java-0.2-fix1.jar > > Hope that helps, > > =3DStefan > > > On Mon, 2005-12-19 at 06:44 -0800, Aparna Ramakrishnan wrote: >> Hello Stefan, >> Thank you for your reply. >> I would like some additional help since I am new to Asterisk as well >> as Java. Plz bear with me. >> >> How do I assign SIPPeersAction .. , with sendAction? as in, >> managerConnection.sendAction(mySIPPeersAction()); ?? >> >> or how should i go abt it? >> >> Also, in handlevent method, should I use the event PeerStatusEvent? >> and get its Status? >> >> Kindly guide further. Appreciate your help and advice. >> >> Thanks again >> Aparna >> >> >> Stefan Reuter wrote: >> Aparna, >> >> please have a look at the SipPeersAction. It generates >> PeerEntryEvents >> that contain a status field that you can probably use for your >> purposes. >> >> =3DStefan >> >> On Mon, 2005-12-19 at 05:59 -0800, Aparna Ramakrishnan wrote: >> > Hello, >> > Is there an event in Manager API, which can detect the users >> that have >> > been registered with asterisk? >> > I now use the PeerStatusEvent which denotes every time a >> user >> > registers with asterisk. >> > Now at times when i need to re-run my program again, the >> already >> > registered users are not visible. What event can help me >> find also the >> > already resgitered users, which will be displayed after i >> re-run my >> > program? >> > >> > Kindly help. >> > >> > Thanks n Regards >> > Aparna >> > __________________________________________________ >> > Do You Yahoo!? >> > Tired of spam? Yahoo! Mail has the best spam protection >> around >> > http://mail.yahoo.com >> > >> >> >> >> __________________________________________________ >> Do You Yahoo!? >> Ti red of spam? Yahoo! Mail has the best spam protection around >> http://mail.yahoo.com >> > > > __________________________________________________ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam protection around > http://mail.yahoo.com > > > > __________________________________________________ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam protection around > http://mail.yahoo.com |
From: Aparna R. <apa...@ya...> - 2005-12-20 14:42:22
|
ok .. thanks Stefan for all ur help. Aparna Stefan Reuter <sr...@re...> wrote: You can also use a CommandAction with "sip show peers". But then you have to parse the CLI output on your own. =Stefan > Also, another question... > Is there any other way that I can continue with the same version > asterisk 1.0.7 and still get to display the Registered Users when i > re-run the java program?? > At this moment, I do not want to upgrade. > Kindly guide. > > Thanks > Aparna > > Aparna Ramakrishnan wrote: > Hello Stefan, > I have Asterisk version 1.0.7 and so I beleive I cannot go ahead with > using SIPPeersAction. So if I now upgrade from 1.0.7 to 1.2, will I need > to go through any changes in its setup or so? and whats the procedure.. > kindly guide. > > Thanks n regards > Aparna > > > Stefan Reuter wrote: > Aparna, > > you can use something like this: > > ResponseEvents response = conn.sendEventGeneratingAction(new > SIPPeersAction()); > Iterator i = response.getEvents().iterator(); > while (i.hasNext()) > { > ManagerEvent event = (ManagerEvent) i.next(); > if (event instanceof PeerEntryEvent) > { > PeerEntryEvent peer = (PeerEntryEvent) event; > System.out.println(peer.getObjectName() + ": " + peer.getStatus()); > } > } > > There are two things to note: > 1. SIPPeersAction is only available with Asterisk 1.2. > 2. SIPPeerEntry in Asterisk-Java 0.2 had a bug that I just fixed. > Please us the asterisk-java jar from > http://null.reucon.net/~srt/asterisk-java-0.2-fix1.jar > > Hope that helps, > > =Stefan > > > On Mon, 2005-12-19 at 06:44 -0800, Aparna Ramakrishnan wrote: >> Hello Stefan, >> Thank you for your reply. >> I would like some additional help since I am new to Asterisk as well >> as Java. Plz bear with me. >> >> How do I assign SIPPeersAction .. , with sendAction? as in, >> managerConnection.sendAction(mySIPPeersAction()); ?? >> >> or how should i go abt it? >> >> Also, in handlevent method, should I use the event PeerStatusEvent? >> and get its Status? >> >> Kindly guide further. Appreciate your help and advice. >> >> Thanks again >> Aparna >> >> >> Stefan Reuter wrote: >> Aparna, >> >> please have a look at the SipPeersAction. It generates >> PeerEntryEvents >> that contain a status field that you can probably use for your >> purposes. >> >> =Stefan >> >> On Mon, 2005-12-19 at 05:59 -0800, Aparna Ramakrishnan wrote: >> > Hello, >> > Is there an event in Manager API, which can detect the users >> that have >> > been registered with asterisk? >> > I now use the PeerStatusEvent which denotes every time a >> user >> > registers with asterisk. >> > Now at times when i need to re-run my program again, the >> already >> > registered users are not visible. What event can help me >> find also the >> > already resgitered users, which will be displayed after i >> re-run my >> > program? >> > >> > Kindly help. >> > >> > Thanks n Regards >> > Aparna >> > __________________________________________________ >> > Do You Yahoo!? >> > Tired of spam? Yahoo! Mail has the best spam protection >> around >> > http://mail.yahoo.com >> > >> >> >> >> __________________________________________________ >> Do You Yahoo!? >> Ti red of spam? Yahoo! Mail has the best spam protection around >> http://mail.yahoo.com >> > > > __________________________________________________ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam protection around > http://mail.yahoo.com > > > > __________________________________________________ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam protection around > http://mail.yahoo.com ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://ads.osdn.com/?ad_idv37&alloc_id865&op=click _______________________________________________ Asterisk-java-users mailing list Ast...@li... https://lists.sourceforge.net/lists/listinfo/asterisk-java-users __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com |
From: Alex <ab...@ga...> - 2005-12-20 21:47:59
|
Hi Stefan: I'm facing an error in which the EventListenerList.fireEvent method is throwing an exception with the following message: "Unable to invoke method onRing on listener" The strange fact is that the application works fine in Windows (where I develop), but doesn't work in Linux (Debian 2.4.27 server). From the source code I see that this could be caused by an IllegalAccessException or an InvocationTargetException, but I don't know which one is, because the two of them have the same error message. The invocation of that method is in this line: callListeners.fireEvent(CallListener.class, "onRing", new AsteriskCallEvent(begin, channel, uniqueId, callerId, state, extension)); Do you have an idea of what could be causing this problem? Thanks in advance, Alex |
From: Stefan R. <sr...@re...> - 2005-12-20 22:04:30
|
Alex, what are you talking about? Asterisk-Java or ADM? =3DStefan On Tue, 2005-12-20 at 18:48 -0300, Alex wrote: > Hi Stefan: >=20 > I'm facing an error in which the EventListenerList.fireEvent method is > throwing an exception with the following message: >=20 > "Unable to invoke method onRing on listener" >=20 > The strange fact is that the application works fine in Windows (where I > develop), but doesn't work in Linux (Debian 2.4.27 server). > From the source code I see that this could be caused by an > IllegalAccessException or an InvocationTargetException, but I don't know > which one is, because the two of them have the same error message. >=20 > The invocation of that method is in this line: > callListeners.fireEvent(CallListener.class, "onRing", new > AsteriskCallEvent(begin, channel, uniqueId, callerId, state, extension)); >=20 > Do you have an idea of what could be causing this problem? >=20 >=20 > Thanks in advance, >=20 > Alex >=20 >=20 >=20 > ------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. Do you grep through log fi= les > for problems? Stop! Download the new AJAX search engine that makes > searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! > http://ads.osdn.com/?ad_id=3D7637&alloc_id=3D16865&op=3Dclick > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users |
From: Alex <ab...@ga...> - 2005-12-21 13:19:16
|
Stefan, I apologize. You were right it's ADM. I was trying to use this method to tell my application that an Asterisk Event has raised. But I forgot that it is not a part of Asterisk-Java. So, I guess you don't have an idea of what could be the problem. Thanks for answering, Alex ----- Original Message ----- From: "Stefan Reuter" <sr...@re...> To: <ast...@li...> Sent: Tuesday, December 20, 2005 7:04 PM Subject: Re: [Asterisk-java-users] ERROR: Unable to invoke method XXX onlistener Alex, what are you talking about? Asterisk-Java or ADM? =Stefan |