Thread: [Asterisk-java-users] MeetMeJoinEvent
Brought to you by:
srt
From: <mi...@si...> - 2007-08-09 02:10:00
|
Just getting started with Asterisk-Java ...and somewhat new with JAVA :-) Using the Hello Event example adding MeetMeJoinEvent as follows... public void onManagerEvent(ManagerEvent event) { // just print received events System.out.println(event); MeetMeJoinEvent mmje= new MeetMeJoinEvent(event); System.out.println(mmje.getMeetMe()); } ...should this have return the meetme room number??? I am running Asterisk 1.2.17 Asterisk-Java .3(Stable) the example only returns null for getMeetMe() ?? The event printed from the example does contain the meetme room number ....HELP GREATLY APPRECIATED!!! org.asteriskjava.manager.event.MeetMeJoinEvent[dateReceived=Wed Aug 08 22:06:57 EDT 2007,privilege='call,all',timestamp='null',uniqueid='1186625236.4',channel='SIP/150-081d5a20',usernum='1',meetme='8150',systemHashcode=8694729] null |
From: Maciek T. <mlo...@gm...> - 2007-08-09 07:36:53
|
Hi, you have MeetMe room number in your output "meetme='8150'" It is room nuber declarated in Meetme.conf file Regards, Maciek 2007/8/9, mi...@si... <mi...@si...>: > > > > Just getting started with Asterisk-Java ...and somewhat new with JAVA > :-) Using the Hello Event example adding MeetMeJoinEvent as follows... > > public void onManagerEvent(ManagerEvent event) > { > // just print received events > System.out.println(event); > > MeetMeJoinEvent mmje= new MeetMeJoinEvent(event); > System.out.println(mmje.getMeetMe()); > > } > > ...should this have return the meetme room number??? I am running Asterisk > 1.2.17 Asterisk-Java .3(Stable) the example only returns null for > getMeetMe() ?? The event printed from the example does contain the meetme > room number ....HELP GREATLY APPRECIATED!!! > > org.asteriskjava.manager.event.MeetMeJoinEvent[dateReceived=Wed Aug 08 > 22:06:57 EDT 2007,privilege='call,all',timestamp='null',uniqueid=' > 1186625236.4 > ',channel='SIP/150-081d5a20',usernum='1',meetme='8150',systemHashcode=8694729] > null > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > -- Pozdrawiam Maciek Tokarski |
From: Stefan R. <ste...@re...> - 2007-08-09 08:19:04
Attachments:
signature.asc
|
try this: (and take a look at some java introduction ;) public void onManagerEvent(ManagerEvent event) { // just print received events System.out.println(event); System.out.println((MeetMeJoinEvent) mmje.getMeetMe()); } --=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... Steuernummern 215/5140/1791 USt-IdNr. DE220701760 |
From: Miked <mi...@si...> - 2007-08-10 03:05:05
|
OK ... I know you were all waiting for me to 'get it' on my own... stupid syntax crap :-) This works! if (event instanceof MeetMeJoinEvent) { System.out.println(((MeetMeJoinEvent)event).getMeetMe()); } THANKS!!! ----- Original Message ----- From: "Miked" <mi...@si...> To: "Carlos G Mendioroz" <tr...@ac...>; <ast...@li...> Sent: Thursday, August 09, 2007 9:09 PM Subject: Re: [Asterisk-java-users] MeetMeJoinEvent > OK Java casting got that ...google is my friend ;-) after thinking I > understood and applying the suggested code ... Eclipse flags error on the > last line 'event.getMeetMe()' "The Method getMeetMe() is undefined for > the > type ManagerEvent" However what does work is as follows: > > This works: > if (event.getClass().equals(MeetMeJoinEvent.class)) { > > MeetMeJoinEvent mmje=(MeetMeJoinEvent)event; > > System.out.println(mmje.getMeetMe()); > > } > > > > Code flaged with error "undefined for type ManagerEvent": > > if (event instanceof MeetMeJoinEvent) { > System.out.println((MeetMeJoinEvent)event.getMeetMe()); } > > > > Not sure why??? Maybe this is Java 101 stuff, but just trying to > understand > ..it would seems these bits of code are the same???.... Help is GREATLY > APPRECIATED! > > ----- Original Message ----- > From: "Carlos G Mendioroz" <tr...@ac...> > To: <ast...@li...> > Cc: <mi...@si...> > Sent: Thursday, August 09, 2007 5:40 AM > Subject: Re: [Asterisk-java-users] MeetMeJoinEvent > > >> Oops, typo :) >> This should go into a FAQ. >> >> Events returned via onManagerEvent come with a common type of Event. >> Depending on the current event, more functionality is available via >> subclasses (of which the actual event "is a"). >> >> Usually you access subclass functionality by casting to the subclass, >> guarded by a type check like: >> >> public void onManagerEvent(ManagerEvent event) >> { >> // just print received events >> System.out.println(event); >> >> if (event.getClass().equals(MeetMeJoinEvent.class)) { >> System.out.println((MeetMeJoinEvent)event.getMeetMe()); >> ... >> >> HTH. >> >> Stefan Reuter @ 09/08/2007 05:18 -0300 dixit: >>> try this: (and take a look at some java introduction ;) >>> >>> public void onManagerEvent(ManagerEvent event) >>> { >>> // just print received events >>> System.out.println(event); >>> >>> System.out.println((MeetMeJoinEvent) mmje.getMeetMe()); >>> } >>> >>> >>> >>> ------------------------------------------------------------------------ >>> >>> ------------------------------------------------------------------------- >>> This SF.net email is sponsored by: Splunk Inc. >>> Still grepping through log files to find problems? Stop. >>> Now Search log events and configuration files using AJAX and a browser. >>> Download your FREE copy of Splunk now >> http://get.splunk.com/ >>> >>> >>> ------------------------------------------------------------------------ >>> >>> _______________________________________________ >>> Asterisk-java-users mailing list >>> Ast...@li... >>> https://lists.sourceforge.net/lists/listinfo/asterisk-java-users >> >> -- >> Carlos G Mendioroz <tr...@ac...> >> >> >> -- >> No virus found in this incoming message. >> Checked by AVG Free Edition. >> Version: 7.5.476 / Virus Database: 269.11.10/943 - Release Date: 8/8/2007 >> 5:38 PM >> >> > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > > > -- > No virus found in this incoming message. > Checked by AVG Free Edition. > Version: 7.5.476 / Virus Database: 269.11.10/943 - Release Date: 8/8/2007 > 5:38 PM > > |
From: Carlos G M. <tr...@ac...> - 2007-08-09 09:40:14
|
Oops, typo :) This should go into a FAQ. Events returned via onManagerEvent come with a common type of Event. Depending on the current event, more functionality is available via subclasses (of which the actual event "is a"). Usually you access subclass functionality by casting to the subclass, guarded by a type check like: public void onManagerEvent(ManagerEvent event) { // just print received events System.out.println(event); if (event.getClass().equals(MeetMeJoinEvent.class)) { System.out.println((MeetMeJoinEvent)event.getMeetMe()); ... HTH. Stefan Reuter @ 09/08/2007 05:18 -0300 dixit: > try this: (and take a look at some java introduction ;) > > public void onManagerEvent(ManagerEvent event) > { > // just print received events > System.out.println(event); > > System.out.println((MeetMeJoinEvent) mmje.getMeetMe()); > } > > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > > > ------------------------------------------------------------------------ > > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users -- Carlos G Mendioroz <tr...@ac...> |
From: David R. <dr...@in...> - 2007-08-09 09:50:51
|
On Thu, 2007-08-09 at 06:40 -0300, Carlos G Mendioroz wrote: > Usually you access subclass functionality by casting to the subclass, > guarded by a type check like: >=20 > public void onManagerEvent(ManagerEvent event) > { > // just print received events > System.out.println(event); > =09 > if (event.getClass().equals(MeetMeJoinEvent.class)) { if (event instanceof MeetMeJoinEvent) { > System.out.println((MeetMeJoinEvent)event.getMeetMe()); This might be much more common. :) Nitpicking, David --=20 INA Service GmbH Papenreye 63 22453 Hamburg Germany Mail: in...@in... Phone: +49 (0)40 557 07-07 Fax: +49 (0)40 557 07-100 Gesch=C3=A4ftsf=C3=BChrer: Ines M. Hoerner Amtsgericht Hamburg HRB 96470 Ust-IdNr. DE248754961 |
From: Miked <mi...@si...> - 2007-08-10 01:09:27
|
OK Java casting got that ...google is my friend ;-) after thinking I understood and applying the suggested code ... Eclipse flags error on the last line 'event.getMeetMe()' "The Method getMeetMe() is undefined for the type ManagerEvent" However what does work is as follows: This works: if (event.getClass().equals(MeetMeJoinEvent.class)) { MeetMeJoinEvent mmje=(MeetMeJoinEvent)event; System.out.println(mmje.getMeetMe()); } Code flaged with error "undefined for type ManagerEvent": if (event instanceof MeetMeJoinEvent) { System.out.println((MeetMeJoinEvent)event.getMeetMe()); } Not sure why??? Maybe this is Java 101 stuff, but just trying to understand ..it would seems these bits of code are the same???.... Help is GREATLY APPRECIATED! ----- Original Message ----- From: "Carlos G Mendioroz" <tr...@ac...> To: <ast...@li...> Cc: <mi...@si...> Sent: Thursday, August 09, 2007 5:40 AM Subject: Re: [Asterisk-java-users] MeetMeJoinEvent > Oops, typo :) > This should go into a FAQ. > > Events returned via onManagerEvent come with a common type of Event. > Depending on the current event, more functionality is available via > subclasses (of which the actual event "is a"). > > Usually you access subclass functionality by casting to the subclass, > guarded by a type check like: > > public void onManagerEvent(ManagerEvent event) > { > // just print received events > System.out.println(event); > > if (event.getClass().equals(MeetMeJoinEvent.class)) { > System.out.println((MeetMeJoinEvent)event.getMeetMe()); > ... > > HTH. > > Stefan Reuter @ 09/08/2007 05:18 -0300 dixit: >> try this: (and take a look at some java introduction ;) >> >> public void onManagerEvent(ManagerEvent event) >> { >> // just print received events >> System.out.println(event); >> >> System.out.println((MeetMeJoinEvent) mmje.getMeetMe()); >> } >> >> >> >> ------------------------------------------------------------------------ >> >> ------------------------------------------------------------------------- >> This SF.net email is sponsored by: Splunk Inc. >> Still grepping through log files to find problems? Stop. >> Now Search log events and configuration files using AJAX and a browser. >> Download your FREE copy of Splunk now >> http://get.splunk.com/ >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Asterisk-java-users mailing list >> Ast...@li... >> https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > > -- > Carlos G Mendioroz <tr...@ac...> > > > -- > No virus found in this incoming message. > Checked by AVG Free Edition. > Version: 7.5.476 / Virus Database: 269.11.10/943 - Release Date: 8/8/2007 > 5:38 PM > > |