Re: [Asterisk-java-users] UserEvents
Brought to you by:
srt
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 |