Thread: [Asterisk-java-devel] bug in userevent handling?
Brought to you by:
srt
From: Daniel G. <dgr...@xn...> - 2007-01-04 23:08:58
|
Hi guys, I am using asterisk java v 3.0m1 and I think there is a bug in the event handling. While we send a UserEvent from asterisk I cannot receive it even if I have registered as following : managerConnection.registerUserEventClass(MyUserEvent.class); This is what I see ... INFO: No event class registered for event type 'userevent', attributes: {dialedparties =SIP/121, caller =151 , privilege=user,all, event=UserEvent, userevent=Calling} So, after debugging a little it seems that there is an error in the org.asteriskjava.manager.internal.EventBuilderImpl class in the buildEvent 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 ... PATCH : public ManagerEvent buildEvent(Object source, Map<String, String> attributes) { ManagerEvent event; String eventType; Class eventClass; Constructor constructor; if (attributes.get("event") == null) { logger.error("No event event type in properties"); return null; } eventType = ((String) attributes.get("event")).toLowerCase(); <<<< FIX if(eventType.equals("userevent")) { String userEventType = ((String) attributes.get("userevent")).toLowerCase(); if (userEventType == null) { logger.error("No user event type in properties"); return null; } eventType = eventType + userEventType; } END FIX >>>> method continue ..... Best regards, Daniel |
From: Daniel G. <da...@gr...> - 2007-01-05 08:41:47
|
wow I am sorry for sending the same mail 3 times ... there was a problem and i thought that the 2 first times it was not sent. Daniel Gradecak wrote: > Hi guys, > > I am using asterisk java v 3.0m1 and I think there is a bug in the event > handling. While we send a UserEvent from asterisk I cannot receive it even > if I have registered as following : > managerConnection.registerUserEventClass(MyUserEvent.class); > > This is what I see ... > INFO: No event class registered for event type 'userevent', attributes: > {dialedparties =SIP/121, caller =151 , privilege=user,all, > event=UserEvent, userevent=Calling} > > So, after debugging a little it seems that there is an error in the > org.asteriskjava.manager.internal.EventBuilderImpl class in the buildEvent > 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 ... > > PATCH : > public ManagerEvent buildEvent(Object source, Map<String, String> > attributes) > { > ManagerEvent event; > String eventType; > Class eventClass; > Constructor constructor; > > if (attributes.get("event") == null) > { > logger.error("No event event type in properties"); > return null; > } > > > eventType = ((String) attributes.get("event")).toLowerCase(); > <<<< FIX > if(eventType.equals("userevent")) { > String userEventType = ((String) > attributes.get("userevent")).toLowerCase(); > > if (userEventType == null) > { > logger.error("No user event type in properties"); > return null; > } > > eventType = eventType + userEventType; > } > > END FIX >>>> > method continue ..... > > Best regards, > Daniel > > > > > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys - and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > Asterisk-java-devel mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-devel > |
From: Stefan R. <ste...@re...> - 2007-01-06 03:32:48
Attachments:
signature.asc
|
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... |
From: Stefan R. <ste...@re...> - 2007-01-06 03:44:39
Attachments:
signature.asc
|
OK, i've added the patch slightly modified, see http://fe.reucon.net/fisheye/browse/repos/asterisk-java/trunk/src/main/ja= va/org/asteriskjava/manager/internal/EventBuilderImpl.java?r1=3D569&r2=3D= 581 Do you have a chance to test the latest version from SVN? =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... |
From: Daniel G. <da...@gr...> - 2007-01-06 15:57:27
|
I will test it on monday then. Thank you for that. Regards, Daniel Stefan Reuter wrote: > OK, i've added the patch slightly modified, see > http://fe.reucon.net/fisheye/browse/repos/asterisk-java/trunk/src/main/java/org/asteriskjava/manager/internal/EventBuilderImpl.java?r1=569&r2=581 > > Do you have a chance to test the latest version from SVN? > > =Stefan > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys - and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > ------------------------------------------------------------------------ > > _______________________________________________ > Asterisk-java-devel mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-devel > |
From: Daniel G. <da...@gr...> - 2007-01-11 00:42:06
|
Hi Stefan, I did the test and it is working. I am using it in my system, thank you very much for that great work :-) Regards, Daniel Daniel Gradecak wrote: > I will test it on monday then. > > Thank you for that. > > Regards, > Daniel > > Stefan Reuter wrote: > >> OK, i've added the patch slightly modified, see >> http://fe.reucon.net/fisheye/browse/repos/asterisk-java/trunk/src/main/java/org/asteriskjava/manager/internal/EventBuilderImpl.java?r1=569&r2=581 >> >> Do you have a chance to test the latest version from SVN? >> >> =Stefan >> >> >> ------------------------------------------------------------------------ >> >> ------------------------------------------------------------------------- >> Take Surveys. Earn Cash. Influence the Future of IT >> Join SourceForge.net's Techsay panel and you'll get the chance to share your >> opinions on IT & business topics through brief surveys - and earn cash >> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Asterisk-java-devel mailing list >> Ast...@li... >> https://lists.sourceforge.net/lists/listinfo/asterisk-java-devel >> >> > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys - and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > Asterisk-java-devel mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-devel > |
From: Daniel G. <da...@gr...> - 2007-01-17 11:58:14
|
Hi, I am using asterisk queues and i noticed a problem in asterisk java, but i am not sure where it should be handled. When you have a direct call from phone to phone the caller ids are set normally, but when a customer calls a queue and then is linked to an agent the source (customer) caller id is not set, even if the events are fired correctly. What i mean it is when a DialEvent is handled in my code if this is a phone to phone call i have a thread waiting for the callerids, the NewCallerIdEvent which is handled by the DefaultAsteriskServer implementation sets correctly the callerid and I can continue working. But when a call is done via a queue the NewCallerIdEvent never sets the callerid from the caller that called the queue. Ok, i have kind of a workaround and i wonder if i should look to fix that in asterisk java code or is there a reason why this is not handled ? Regards, Daniel |
From: Stefan R. <ste...@re...> - 2007-01-18 22:53:02
Attachments:
signature.asc
|
Hi, Daniel Gradecak wrote: > Ok, i have kind of a workaround and i wonder if i should look to fix=20 > that in asterisk java code or is there a reason why this is not handled= ? I dont think there is a real reason for this. If you have a look and provide a patch that would be great. =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... |
From: Daniel G. <da...@gr...> - 2007-01-06 15:57:42
|
Hi Stefan, yes i am using asterisk 1.4 Stefan Reuter wrote: > Thanks for the patch. I will have a look at it and include it. > Do you use Asterisk 1.4? > > =Stefan > > > Daniel Gradecak wrote: > >> Hi guys, >> >> I am using asterisk java v 3.0m1 and I think there is a bug in the event >> handling. While we send a UserEvent from asterisk I cannot receive it even >> if I have registered as following : >> managerConnection.registerUserEventClass(MyUserEvent.class); >> >> This is what I see ... >> INFO: No event class registered for event type 'userevent', attributes: >> {dialedparties =SIP/121, caller =151 , privilege=user,all, >> event=UserEvent, userevent=Calling} >> >> So, after debugging a little it seems that there is an error in the >> org.asteriskjava.manager.internal.EventBuilderImpl class in the buildEvent >> 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 ... >> >> PATCH : >> public ManagerEvent buildEvent(Object source, Map<String, String> >> attributes) >> { >> ManagerEvent event; >> String eventType; >> Class eventClass; >> Constructor constructor; >> >> if (attributes.get("event") == null) >> { >> logger.error("No event event type in properties"); >> return null; >> } >> >> >> eventType = ((String) attributes.get("event")).toLowerCase(); >> <<<< FIX >> if(eventType.equals("userevent")) { >> String userEventType = ((String) >> attributes.get("userevent")).toLowerCase(); >> >> if (userEventType == null) >> { >> logger.error("No user event type in properties"); >> return null; >> } >> >> eventType = eventType + userEventType; >> } >> >> END FIX >>>> >> method continue ..... >> >> Best regards, >> Daniel >> > > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys - and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > ------------------------------------------------------------------------ > > _______________________________________________ > Asterisk-java-devel mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-devel > |