asterisk-java-users Mailing List for Asterisk-Java Library (Page 179)
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: Stefan R. <sr...@re...> - 2005-03-15 16:25:12
|
On Tue, 2005-03-15 at 10:01 -0600, Chris Howard wrote: > I'm currently working with an older version of Asterisk Java (plan on=20 > updating soon but I don't have time for regression test). I was mainly working on the FastAGI implementation for the last time, so it "shouldn't" break your Manager API stuff. > Created my own user event > public class UserEventASGHold extends UserEvent Your class must be named ASGHoldEvent just the name of the event you will send with the appendix Event. > WARNING: No event class registered for event type 'usereventasghold',=20 > attributes: {callerid=3D0262, uniqueid=3D1110900347.498, event=3DUserEven= tASGHold,=20 > channel=3DZap/38-1} >=20 > How do I register the event? Is this because I'm using a old version of = the=20 > core code? The newer code base includes a method called registerUserEventClass(Class userEventClass) in the ManagerConnection interface so you would just call managerConnection.registerUserEventClass(ASGHoldEvent.class); If you are unable to upgrade right now and don't mind to change Asterisk-java's internal code you can also add your event to the EventBuilder (this is either net.sf.asterisk.manager.EventBuilder or in newer versions net.sf.asterisk.manager.impl.EventBuilderImpl). There is a private method called registerBuiltinEventClasses() where you can add a registerEventClass(ASGHoldEvent.class); Hope that helps =3DStefan |
From: Chris H. <ch...@as...> - 2005-03-15 16:01:54
|
I'm currently working with an older version of Asterisk Java (plan on updating soon but I don't have time for regression test). I have a need for a user defined event but the UserEvent class was not included in the version I was working with. I pull the user event class from the latest cvs and added it. Created my own user event public class UserEventASGHold extends UserEvent { private String callerId; public UserEventASGHold(Object source) { super(source); } public String getCallerId() { return callerId; } public void setCallerId(String callerId) { this.callerId = callerId; } } I call the event via: exten => _0262,10,UserEvent(ASGHold|callerId: ${CALLERIDNUM}) Now I get the warning: WARNING: No event class registered for event type 'usereventasghold', attributes: {callerid=0262, uniqueid=1110900347.498, event=UserEventASGHold, channel=Zap/38-1} How do I register the event? Is this because I'm using a old version of the core code? Thanks, Chris -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.308 / Virus Database: 266.7.2 - Release Date: 3/11/2005 |
From: Alex M. <al...@go...> - 2005-03-08 16:08:39
|
On Tue, 2005-03-08 at 09:35 -0600, Alex Malinovich wrote: --snip-- > A) Overload handleEvent() in ManagerEventHandler to handle each of the > various types of ManagerEvents I think I just answered my own question again. 'A' is the correct solution, only instead of overloading handleEvent in ManagerEventHandler, I should overload it in my implementation. That is: mc.addEventHandler(new ManagerEventHandler() { public void handleEvent(ManagerEvent event) { //do nothing yet } public void handleEvent(NewChannelEvent event) { //DEBUG System.out.println("Caller ID =3D " + event.getCallerId()); } }); I think I should just stop asking questions and wait until I answer them myself. :) --=20 Alex Malinovich Golden Technologies, Inc. (219) 462-7200 x 216 http://www.golden-tech.com |
From: Alex M. <al...@go...> - 2005-03-08 15:35:20
|
I was hoping you could clarify something for me. I haven't done much heavy work with events in Java, so I'm not sure if I'm understanding this correctly.=20 1) ManagerEventHandler.handleEvent() deals with ManagerEvents.=20 2) ManagerEvent has a number of subclasses such as ChannelEvent, CdrEvent, etc. 3) Therefore, handleEvent(ChannelEvent event) should work since ChannelEvent extends ManagerEvent. Yet, it doesn't. So that leaves two possible solutions: A) Overload handleEvent() in ManagerEventHandler to handle each of the various types of ManagerEvents B) Do an instanceof on every received ManagerEvent to see what it is Now, I'm sure that A & B are both quite wrong. Then again, I'm also pretty sure that 3 is quite right. So what am I missing here? --=20 Alex Malinovich Golden Technologies, Inc. (219) 462-7200 x 216 http://www.golden-tech.com |
From: Stefan R. <sr...@re...> - 2005-03-07 23:17:08
|
On Mon, 2005-03-07 at 17:00 -0600, Alex Malinovich wrote: > On Mon, 2005-03-07 at 16:56 -0600, Alex Malinovich wrote: > > Is there any way to get a concrete implementation of AsteriskManager > > currently (preferably that uses a pre-existing ManagerConnection for > > connection information)? > >=20 > I think I may have already found my answer after reading a bit more. I > can create a DefaultAsteriskManager and then use setManagerConnection to > have it use my existing ManagerConnection. This looks like it will do > what I need. Yes, thats in fact the best solution. AsteriskManager just acts as a higher level wrapper around a ManagerConnection. Note: The AsteriskManager stuff is not yet that well engineered as the lower level interface using ManagerConnection, so if you encounter any obstacles feel free to call for improvement. Especially there is currently no way to register listeners for higher level events (like a new channel being created). Cheers Stefan |
From: Alex M. <al...@go...> - 2005-03-07 23:00:24
|
On Mon, 2005-03-07 at 16:56 -0600, Alex Malinovich wrote: > Is there any way to get a concrete implementation of AsteriskManager > currently (preferably that uses a pre-existing ManagerConnection for > connection information)? >=20 > What I need to do is get a list of channels and map them to my list of > Employee objects so that I can add channel event listeners and have each > Employee be self-updating rather than monitoring the ManagerConnection > for events that relate to a particular user. Is this possible or will it > be possible at some point? I think I may have already found my answer after reading a bit more. I can create a DefaultAsteriskManager and then use setManagerConnection to have it use my existing ManagerConnection. This looks like it will do what I need. --=20 Alex Malinovich Golden Technologies, Inc. (219) 462-7200 x 216 http://www.golden-tech.com |
From: Alex M. <al...@go...> - 2005-03-07 22:56:49
|
Is there any way to get a concrete implementation of AsteriskManager currently (preferably that uses a pre-existing ManagerConnection for connection information)? What I need to do is get a list of channels and map them to my list of Employee objects so that I can add channel event listeners and have each Employee be self-updating rather than monitoring the ManagerConnection for events that relate to a particular user. Is this possible or will it be possible at some point? --=20 Alex Malinovich Golden Technologies, Inc. (219) 462-7200 x 216 http://www.golden-tech.com |
From: Alex M. <al...@go...> - 2005-03-02 23:07:38
|
On Wed, 2005-03-02 at 00:40 +0000, Stefan Reuter wrote: > Ok, try again with the latest version from CVS HEAD. > I synchronized access to socket and writer and before sending an > action it is checked if we are actually connected, otherwise an > IllegalStateException is thrown. Just did a build with the updated code from CVS and it's working fine. Now it is time for me to start coding. Thanks for the help! :) --=20 Alex Malinovich Golden Technologies, Inc. (219) 462-7200 x 216 http://www.golden-tech.com |
From: Stefan R. <ste...@gm...> - 2005-03-02 00:40:37
|
Ok, try again with the latest version from CVS HEAD. I synchronized access to socket and writer and before sending an action it is checked if we are actually connected, otherwise an IllegalStateException is thrown. Stefan |
From: Stefan R. <ste...@gm...> - 2005-03-01 17:06:40
|
Ok, that really looks like a timing issue. It gets disconnected while still logging in: Mar 1, 2005 9:56:14 AM net.sf.asterisk.manager.DefaultManagerConnection disconnect INFO: Closing writer Mar 1, 2005 9:56:14 AM net.sf.asterisk.manager.DefaultManagerConnection disconnect INFO: Closing socket Mar 1, 2005 9:56:14 AM net.sf.asterisk.manager.ManagerReader run INFO: Disconnected, closing reader Mar 1, 2005 9:56:14 AM net.sf.asterisk.manager.DefaultManagerConnection login INFO: Successfully logged in I will have a more detailed look at this in the evening. Stefan |
From: Alex M. <al...@go...> - 2005-03-01 16:03:03
|
On Tue, 2005-03-01 at 15:47 +0000, Stefan Reuter wrote: > I still dont get the NPE, even when i run your code on a plain JDK 1.5 on= Linux. > Please send me a stacktrace that matches the TestingAsterisk class you > just sent. Here you go: java.lang.NullPointerException at net.sf.asterisk.manager.DefaultManagerConnection.sendAction(DefaultMana= gerConnection.java:380) at net.sf.asterisk.manager.DefaultManagerConnection.sendAction(DefaultMana= gerConnection.java:328) at net.sf.asterisk.manager.DefaultManagerConnection.sendAction(DefaultMana= gerConnection.java:316) at TestingAsterisk.testLogin(TestingAsterisk.java:38) at TestingAsterisk.<init>(TestingAsterisk.java:9) at TestingAsterisk.main(TestingAsterisk.java:46) Here's the logging output as well: Mar 1, 2005 9:56:12 AM net.sf.asterisk.manager.DefaultManagerConnection con= nect INFO: Connecting to 10.0.0.61 port 5038 Mar 1, 2005 9:56:12 AM net.sf.asterisk.manager.EventBuilder registerEventCl= ass INFO: Registered event type 'agentcallbacklogin' (class net.sf.asterisk.man= ager.event.AgentCallbackLoginEvent) Mar 1, 2005 9:56:12 AM net.sf.asterisk.manager.EventBuilder registerEventCl= ass INFO: Registered event type 'agentcallbacklogoff' (class net.sf.asterisk.ma= nager.event.AgentCallbackLogoffEvent) Mar 1, 2005 9:56:12 AM net.sf.asterisk.manager.EventBuilder registerEventCl= ass INFO: Registered event type 'agentcalled' (class net.sf.asterisk.manager.ev= ent.AgentCalledEvent) Mar 1, 2005 9:56:12 AM net.sf.asterisk.manager.EventBuilder registerEventCl= ass INFO: Registered event type 'agentlogin' (class net.sf.asterisk.manager.eve= nt.AgentLoginEvent) Mar 1, 2005 9:56:12 AM net.sf.asterisk.manager.EventBuilder registerEventCl= ass INFO: Registered event type 'agentlogoff' (class net.sf.asterisk.manager.ev= ent.AgentLogoffEvent) Mar 1, 2005 9:56:12 AM net.sf.asterisk.manager.EventBuilder registerEventCl= ass INFO: Registered event type 'alarm' (class net.sf.asterisk.manager.event.Al= armEvent) Mar 1, 2005 9:56:12 AM net.sf.asterisk.manager.EventBuilder registerEventCl= ass INFO: Registered event type 'alarmclear' (class net.sf.asterisk.manager.eve= nt.AlarmClearEvent) Mar 1, 2005 9:56:12 AM net.sf.asterisk.manager.EventBuilder registerEventCl= ass INFO: Registered event type 'cdr' (class net.sf.asterisk.manager.event.CdrE= vent) Mar 1, 2005 9:56:12 AM net.sf.asterisk.manager.EventBuilder registerEventCl= ass INFO: Registered event type 'extensionstatus' (class net.sf.asterisk.manage= r.event.ExtensionStatusEvent) Mar 1, 2005 9:56:12 AM net.sf.asterisk.manager.EventBuilder registerEventCl= ass INFO: Registered event type 'hangup' (class net.sf.asterisk.manager.event.H= angupEvent) Mar 1, 2005 9:56:12 AM net.sf.asterisk.manager.EventBuilder registerEventCl= ass INFO: Registered event type 'holdedcall' (class net.sf.asterisk.manager.eve= nt.HoldedCallEvent) Mar 1, 2005 9:56:12 AM net.sf.asterisk.manager.EventBuilder registerEventCl= ass INFO: Registered event type 'join' (class net.sf.asterisk.manager.event.Joi= nEvent) Mar 1, 2005 9:56:12 AM net.sf.asterisk.manager.EventBuilder registerEventCl= ass INFO: Registered event type 'leave' (class net.sf.asterisk.manager.event.Le= aveEvent) Mar 1, 2005 9:56:12 AM net.sf.asterisk.manager.EventBuilder registerEventCl= ass INFO: Registered event type 'link' (class net.sf.asterisk.manager.event.Lin= kEvent) Mar 1, 2005 9:56:12 AM net.sf.asterisk.manager.EventBuilder registerEventCl= ass INFO: Registered event type 'meetmejoin' (class net.sf.asterisk.manager.eve= nt.MeetMeJoinEvent) Mar 1, 2005 9:56:12 AM net.sf.asterisk.manager.EventBuilder registerEventCl= ass INFO: Registered event type 'meetmeleave' (class net.sf.asterisk.manager.ev= ent.MeetMeLeaveEvent) Mar 1, 2005 9:56:12 AM net.sf.asterisk.manager.EventBuilder registerEventCl= ass INFO: Registered event type 'messagewaiting' (class net.sf.asterisk.manager= .event.MessageWaitingEvent) Mar 1, 2005 9:56:12 AM net.sf.asterisk.manager.EventBuilder registerEventCl= ass INFO: Registered event type 'newcallerid' (class net.sf.asterisk.manager.ev= ent.NewCallerIdEvent) Mar 1, 2005 9:56:12 AM net.sf.asterisk.manager.EventBuilder registerEventCl= ass INFO: Registered event type 'newchannel' (class net.sf.asterisk.manager.eve= nt.NewChannelEvent) Mar 1, 2005 9:56:12 AM net.sf.asterisk.manager.EventBuilder registerEventCl= ass INFO: Registered event type 'newexten' (class net.sf.asterisk.manager.event= .NewExtenEvent) Mar 1, 2005 9:56:12 AM net.sf.asterisk.manager.EventBuilder registerEventCl= ass INFO: Registered event type 'newstate' (class net.sf.asterisk.manager.event= .NewStateEvent) Mar 1, 2005 9:56:12 AM net.sf.asterisk.manager.EventBuilder registerEventCl= ass INFO: Registered event type 'originatefailure' (class net.sf.asterisk.manag= er.event.OriginateFailureEvent) Mar 1, 2005 9:56:12 AM net.sf.asterisk.manager.EventBuilder registerEventCl= ass INFO: Registered event type 'originatesuccess' (class net.sf.asterisk.manag= er.event.OriginateSuccessEvent) Mar 1, 2005 9:56:12 AM net.sf.asterisk.manager.EventBuilder registerEventCl= ass INFO: Registered event type 'parkedcall' (class net.sf.asterisk.manager.eve= nt.ParkedCallEvent) Mar 1, 2005 9:56:12 AM net.sf.asterisk.manager.EventBuilder registerEventCl= ass INFO: Registered event type 'parkedcallscomplete' (class net.sf.asterisk.ma= nager.event.ParkedCallsCompleteEvent) Mar 1, 2005 9:56:12 AM net.sf.asterisk.manager.EventBuilder registerEventCl= ass INFO: Registered event type 'peerstatus' (class net.sf.asterisk.manager.eve= nt.PeerStatusEvent) Mar 1, 2005 9:56:12 AM net.sf.asterisk.manager.EventBuilder registerEventCl= ass INFO: Registered event type 'queueentry' (class net.sf.asterisk.manager.eve= nt.QueueEntryEvent) Mar 1, 2005 9:56:12 AM net.sf.asterisk.manager.EventBuilder registerEventCl= ass INFO: Registered event type 'queuemember' (class net.sf.asterisk.manager.ev= ent.QueueMemberEvent) Mar 1, 2005 9:56:12 AM net.sf.asterisk.manager.EventBuilder registerEventCl= ass INFO: Registered event type 'queueparams' (class net.sf.asterisk.manager.ev= ent.QueueParamsEvent) Mar 1, 2005 9:56:12 AM net.sf.asterisk.manager.EventBuilder registerEventCl= ass INFO: Registered event type 'registry' (class net.sf.asterisk.manager.event= .RegistryEvent) Mar 1, 2005 9:56:12 AM net.sf.asterisk.manager.EventBuilder registerEventCl= ass INFO: Registered event type 'reload' (class net.sf.asterisk.manager.event.R= eloadEvent) Mar 1, 2005 9:56:12 AM net.sf.asterisk.manager.EventBuilder registerEventCl= ass INFO: Registered event type 'rename' (class net.sf.asterisk.manager.event.R= enameEvent) Mar 1, 2005 9:56:12 AM net.sf.asterisk.manager.EventBuilder registerEventCl= ass INFO: Registered event type 'shutdown' (class net.sf.asterisk.manager.event= .ShutdownEvent) Mar 1, 2005 9:56:12 AM net.sf.asterisk.manager.EventBuilder registerEventCl= ass INFO: Registered event type 'status' (class net.sf.asterisk.manager.event.S= tatusEvent) Mar 1, 2005 9:56:12 AM net.sf.asterisk.manager.EventBuilder registerEventCl= ass INFO: Registered event type 'statuscomplete' (class net.sf.asterisk.manager= .event.StatusCompleteEvent) Mar 1, 2005 9:56:12 AM net.sf.asterisk.manager.EventBuilder registerEventCl= ass INFO: Registered event type 'unlink' (class net.sf.asterisk.manager.event.U= nlinkEvent) Mar 1, 2005 9:56:12 AM net.sf.asterisk.manager.EventBuilder registerEventCl= ass INFO: Registered event type 'zapshowchannels' (class net.sf.asterisk.manage= r.event.ZapShowChannelsEvent) Mar 1, 2005 9:56:12 AM net.sf.asterisk.manager.EventBuilder registerEventCl= ass INFO: Registered event type 'zapshowchannelscomplete' (class net.sf.asteris= k.manager.event.ZapShowChannelsCompleteEvent) Mar 1, 2005 9:56:14 AM net.sf.asterisk.manager.DefaultManagerConnection dis= connect INFO: Closing writer Mar 1, 2005 9:56:14 AM net.sf.asterisk.manager.DefaultManagerConnection dis= connect INFO: Closing socket Mar 1, 2005 9:56:14 AM net.sf.asterisk.manager.ManagerReader run INFO: Disconnected, closing reader Mar 1, 2005 9:56:14 AM net.sf.asterisk.manager.DefaultManagerConnection log= in INFO: Successfully logged in --=20 Alex Malinovich Golden Technologies, Inc. (219) 462-7200 x 216 http://www.golden-tech.com |
From: Stefan R. <ste...@gm...> - 2005-03-01 15:48:20
|
I still dont get the NPE, even when i run your code on a plain JDK 1.5 on Linux. Please send me a stacktrace that matches the TestingAsterisk class you just sent. Thanks Stefan |
From: Alex M. <al...@go...> - 2005-03-01 15:14:23
|
On Mon, 2005-02-28 at 16:19 -0600, Stefan Reuter wrote: > Hi Alex, > > > However, if I try using this instead: > > > > dmc = new DefaultManagerConnection("hostname", 5038, "user", > > "password"); > > > > I've tested this about 5 times so far and I get consistent results each > > time. Just in case it matters, I'm using Eclipse 2.1 on a Linux system > > with the 1.5 JDK. Any ideas? > > I tried to reproduce this error but here it works. > Please send me your java file so i can try it here. Source is attached. In its current form it will fail with the null pointer exception. If you comment out line 19 and uncomment lines 20-23, it works just fine. -- Alex Malinovich Golden Technologies, Inc. (219) 462-7200 x 216 http://www.golden-tech.com |
From: Stefan R. <sr...@re...> - 2005-02-28 22:24:21
|
On Mon, 2005-02-28 at 15:36 -0600, Alex Malinovich wrote: > java.lang.NullPointerException > at net.sf.asterisk.manager.DefaultManagerConnection.sendAction(DefaultMa= nagerConnection.java:380) > at net.sf.asterisk.manager.DefaultManagerConnection.sendAction(DefaultMa= nagerConnection.java:328) > at net.sf.asterisk.manager.DefaultManagerConnection.sendAction(DefaultMa= nagerConnection.java:316) > at TestingAsterisk.testLogin(TestingAsterisk.java:64) > at TestingAsterisk.<init>(TestingAsterisk.java:18) > at TestingAsterisk.main(TestingAsterisk.java:86) just an idea: this NullPointerException can happen when you are not yet connected to the asterisk server. Make sure you called login() on the DefaultManagerConnection. Stefan |
From: Stefan R. <sr...@re...> - 2005-02-28 22:19:15
|
Hi Alex, > However, if I try using this instead: >=20 > dmc =3D new DefaultManagerConnection("hostname", 5038, "user", > "password"); >=20 > I've tested this about 5 times so far and I get consistent results each > time. Just in case it matters, I'm using Eclipse 2.1 on a Linux system > with the 1.5 JDK. Any ideas? I tried to reproduce this error but here it works. Please send me your java file so i can try it here. Stefan |
From: Alex M. <al...@go...> - 2005-02-28 21:36:18
|
There seems to be a problem with the constructor for the DefaultManagerConnection class. I've done as much debugging as I could on my end, and it seems to be a thread synchronization problem somewhere. Here's the exception that gets thrown: java.lang.NullPointerException at net.sf.asterisk.manager.DefaultManagerConnection.sendAction(DefaultMana= gerConnection.java:380) at net.sf.asterisk.manager.DefaultManagerConnection.sendAction(DefaultMana= gerConnection.java:328) at net.sf.asterisk.manager.DefaultManagerConnection.sendAction(DefaultMana= gerConnection.java:316) at TestingAsterisk.testLogin(TestingAsterisk.java:64) at TestingAsterisk.<init>(TestingAsterisk.java:18) at TestingAsterisk.main(TestingAsterisk.java:86) TestingAsterisk is my test program. It is an exact copy of TestDefaultManagerConnection with a constructor and main() added. The problem occurs when trying to create a connection using something other than the default constructor with appropriate setter methods. Here's the exact code: dmc =3D new DefaultManagerConnection(); dmc.setUsername("user"); dmc.setPassword("password"); dmc.setHostname("hostname"); Doing this works just fine. Program executes, events come back, etc. However, if I try using this instead: dmc =3D new DefaultManagerConnection("hostname", 5038, "user", "password"); I've tested this about 5 times so far and I get consistent results each time. Just in case it matters, I'm using Eclipse 2.1 on a Linux system with the 1.5 JDK. Any ideas? --=20 Alex Malinovich Golden Technologies, Inc. (219) 462-7200 x 216 http://www.golden-tech.com |
From: Stefan R. <sr...@re...> - 2005-02-25 20:21:02
|
On Fri, 2005-02-25 at 14:14 -0600, Alex Malinovich wrote: > I have started a simple test program just to see if I can get a > connection going. It isn't working yet, but I hope that it won't take > long.=20 You can have a look at TestDefaultManagerConnection in src/test that class just connects to asterisk, registers itself as ManagerEventHandler and prints all received events to System.out. > Once I get it done I'd be glad to put it into a tutorial form and > submit it. Fine > > So for now if you encounter any problems or have question on how things > > should work feel free to ask on the mailing list. > I will definitely be doing this in the near future, so I apologize in > advance if I overload your inbox. :) No problem - that increases the chance i put more effort into providing some more documentation :) Cheers, Stefan |
From: Alex M. <al...@go...> - 2005-02-25 20:14:11
|
On Fri, 2005-02-25 at 20:02 +0000, Stefan Reuter wrote: --snip-- > To make it easier to get started there will be a short tutorial with a > sample app somewhere in there future, but that doesn't have the highest > priority right now. If anybody would like to contribute i will happily > publish it on the project site though :) I have started a simple test program just to see if I can get a connection going. It isn't working yet, but I hope that it won't take long. Once I get it done I'd be glad to put it into a tutorial form and submit it. > So for now if you encounter any problems or have question on how things > should work feel free to ask on the mailing list. I will definitely be doing this in the near future, so I apologize in advance if I overload your inbox. :) I have already had a couple of problems, so as soon as I get some free time (unfortunately probably not until Monday), I will try again and send out a mail if I have problems. Thanks for the excellent work on the project so far, and I'm very much looking forward to using it in the near future. --=20 Alex Malinovich Golden Technologies, Inc. (219) 462-7200 x 216 http://www.golden-tech.com |
From: Stefan R. <sr...@re...> - 2005-02-25 20:02:59
|
On Fri, 2005-02-25 at 10:33 -0600, Alex Malinovich wrote: > I've checked out the asterisk-java code from CVS and gotten it to build > properly (without the test suite). Yes the test suite is not yet in a good state - this is mainly due to the problem that testing the lib without an asterisk server is of limited value... I am working on that to clearly seperate the unit tests from the integration tests. > But I'm getting lots of debug > messages throughout the process. While this is ok for testing, when I > get ready to release the next version of my application for my end > users, I can't have their consoles scrolling all day. Asterisk-java uses commons-logging to do all its logging. On INFO level it is quite verbose. To adjust the output on your console you have to configure the underlying logging library. This is either log4j or the standard JDK 1.4 logging. If you use the later (i.e. have no log4j on the CLASSPATH) you can set the log level to WARNING and above by putting Logger.getLogger("net.sf.asterisk.manager").setLevel(Level.WARNING); at the beginning of your program. Alternatively you can adjust the logging via the logging.properties file. See http://java.sun.com/j2se/1.4.2/docs/api/java/util/logging/LogManager.html f= or details. If you use log4j see http://logging.apache.org/log4j/docs/manual.html for configuration details. > I also haven't gotten much done other than connecting to the asterisk > server so far and getting a successful login message. Since there isn't > much documentation on the project status (outside of the excellent > javadoc documentation) I'm just wanting to get an idea of how stable the > code is and how much I can depend on it to work and keep working. The short answer is: As long as there is no official 1.0 release the API is considered unstable. The longer answer is: The basic concepts of the ManagerConnection, actions, events and responses will probably stay the way they are and act as the basis on which to build a more abstract interface. So as long as you use the methods in ManagerConnection you should be on the safe side. To make it easier to get started there will be a short tutorial with a sample app somewhere in there future, but that doesn't have the highest priority right now. If anybody would like to contribute i will happily publish it on the project site though :) So for now if you encounter any problems or have question on how things should work feel free to ask on the mailing list. Cheers Stefan |
From: Alex M. <al...@go...> - 2005-02-25 16:33:31
|
I just found this project today and so far this is looking like EXACTLY what I've been looking for. I've been working on an employee status application for a few weeks now and I've gotten to the point where I want to integrate phone status into it. I've checked out the asterisk-java code from CVS and gotten it to build properly (without the test suite) and have included it in my code and I appear to be getting a connection going. But I'm getting lots of debug messages throughout the process. While this is ok for testing, when I get ready to release the next version of my application for my end users, I can't have their consoles scrolling all day. I also haven't gotten much done other than connecting to the asterisk server so far and getting a successful login message. Since there isn't much documentation on the project status (outside of the excellent javadoc documentation) I'm just wanting to get an idea of how stable the code is and how much I can depend on it to work and keep working. --=20 Alex Malinovich Golden Technologies, Inc. (219) 462-7200 x 216 http://www.golden-tech.com |
From: Stefan R. <sr...@re...> - 2005-02-24 10:47:42
|