Re: [Asterisk-java-devel] bug in userevent handling?
Brought to you by:
srt
From: Stefan R. <ste...@re...> - 2007-01-06 03:32:48
|
Thanks for the patch. I will have a look at it and include it. Do you use Asterisk 1.4? =3DStefan Daniel Gradecak wrote: > Hi guys, >=20 > I am using asterisk java v 3.0m1 and I think there is a bug in the even= t > handling. While we send a UserEvent from asterisk I cannot receive it e= ven > if I have registered as following : > managerConnection.registerUserEventClass(MyUserEvent.class); >=20 > This is what I see ... > INFO: No event class registered for event type 'userevent', attributes:= > {dialedparties =3DSIP/121, caller =3D151 , privilege=3Duser,all, > event=3DUserEvent, userevent=3DCalling} >=20 > So, after debugging a little it seems that there is an error in the > org.asteriskjava.manager.internal.EventBuilderImpl class in the buildEv= ent > method. > Here is a kind of patch that i have done, and now it is working ... so > please tell me if is ok and if you have fixed it already ... >=20 > PATCH : > public ManagerEvent buildEvent(Object source, Map<String, String> > attributes) > { > ManagerEvent event; > String eventType; > Class eventClass; > Constructor constructor; >=20 > if (attributes.get("event") =3D=3D null) > { > logger.error("No event event type in properties"); > return null; > } >=20 >=20 > eventType =3D ((String) attributes.get("event")).toLowerCase();= > <<<< FIX > if(eventType.equals("userevent")) { > String userEventType =3D ((String) > attributes.get("userevent")).toLowerCase(); >=20 > if (userEventType =3D=3D null) > { > logger.error("No user event type in properties"); > return null; > } >=20 > eventType =3D eventType + userEventType; > } >=20 > END FIX >>>> > method continue ..... >=20 > Best regards, > Daniel --=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... |