Re: [Asterisk-java-devel] bug in userevent handling?
Brought to you by:
srt
|
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
>
|