Re: [Asterisk-java-devel] ParkedCallsComplete generated events in manager
Brought to you by:
srt
From: Luca N. <l.n...@my...> - 2014-06-17 09:57:40
|
Hi, this is where i send the ParkedCallsAction in the agi service: @Override public void service(AgiRequest request, AgiChannel channel) throws AgiException { try { ManagerConnection managerConnection = factory.createManagerConnection(); managerConnection.login(); ParkedCallsAction parkedCalls = new ParkedCallsAction(); System.out.println("**Sending ParkedCallsAction"); monitorResponse = managerConnection.sendAction(parkedCalls, 30000); managerConnection.logoff(); } catch (IOException e) { e.printStackTrace(); } catch (IllegalStateException e) { e.printStackTrace(); } catch (AuthenticationFailedException e) { e.printStackTrace(); } catch (TimeoutException e) { e.printStackTrace(); } } And this is my eventlistener that should catch the ParkedCallEvent: public class ServerAsterisk implements Serializable, ManagerEventListener, SendActionCallback { ... stuff ... public void onManagerEvent(ManagerEvent event) { System.out.println(event.getClass()+" --- "+event); <- HERE, I CAN CATCH A PARKEDCALLEVENT WHEN I PUT A CHANNEL IN PARK USING AN ORIGINATE, BUT I CAN'T CATCH THE PARKEDCALLEVENT (s) SENT AFTER A PARKEDCALLSACTION } } Hope i have been clear enough, in addition here is an ngrep capture on the machine running the java program ----Packet received after a usual ParkedCallEvent---- T 10.40.0.106:5038 -> 10.51.0.21:53718 [AP] Event: ParkedCall..Privilege: call,all..Exten: 1..Channel: SIP/1078-00000029..Parkinglot: default..From: SIP/1078-00000029..Timeout: 1200..Caller IDNum: <unknown>..CallerIDName: 1078..ConnectedLineNum: <unknown>..ConnectedLineName: <unknown>..Uniqueid: palermo-1402675228.66.... ----Packet received after a ParkedCallsAction-generated ParkedCallEvent---- N.B. T 10.40.0.106:5038 -> 10.51.0.21:53721 [AP] Event: ParkedCall..Parkinglot: default..Exten: 1..Channel: SIP/1078-0000002a..From: SIP/1078-0000002a..Timeout: 1192..Duration: 8..CallerIDNum: . .CallerIDName: 1078..ConnectedLineNum: ..ConnectedLineName: ..ActionID: 239184002_4#.... Thank you for your reply, Luca On 17/06/2014 11:35, Yves A. wrote: > Hi Luca, > > post your code please and tell us, which version of asterisk and > asterisk-java you´re using. > > yves > > > Am 17.06.2014 09:43, schrieb Luca Natale: >> Hi there! >> >> In my project i have necessity to call my asterisk server to have a >> list of the parked channels. >> >> I understood that a ParkedCallsAction generates n ParkedCallEvents >> where n is the number of parked channels, following a >> ParkedCallsComplete event. >> >> Everything works just as expected, except for the fact that i can't >> catch these ParkedCallEvent in my events listener. >> >> This is a log for a normal ParkedCallEvent (i can see this event in >> my listener): >> >> Dispatching event: >> org.asteriskjava.manager.event.ParkedCallEvent[dateReceived='Mon Jun >> 16 15:08:57 CEST >> 2014',privilege='call,all',callerid=null,sequencenumber=null,from='SIP/1078-000000b3',calleridname='1078',timestamp=null,uniqueid='palermo-1402924150.275',exten='1',parkinglot='default',server=null,calleridnum=null,channel='SIP/1078-000000b3',timeout='1200',systemHashcode=662570926]DEBUG >> >> >> And this is a log for a ParkedCallsAction generated ParkedCallEvent >> (no trace of this event in my listener): >> >> Dispatching event: >> org.asteriskjava.manager.event.ParkedCallEvent[dateReceived='Mon Jun >> 16 15:09:00 CEST >> 2014',callerid=null,sequencenumber=null,from='SIP/1078-000000b3',calleridname='1078',timestamp=null,uniqueid=null,exten='1',parkinglot='default',server=null,calleridnum=null,channel='SIP/1078-000000b3',timeout='1196',systemHashcode=421189702] >> >> Major difference being that in the second case there is no privilege >> value. >> >> Is there a way i can catch these events in my listener? Or, is there >> a fastest way to have a list of the currently parked channels by >> request using the AMI? >> >> Thank you all :) >> >> -- >> Luca >> >> >> >> >> ------------------------------------------------------------------------------ >> HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions >> Find What Matters Most in Your Big Data with HPCC Systems >> Open Source. Fast. Scalable. Simple. Ideal for Dirty Data. >> Leverages Graph Analysis for Fast Processing & Easy Data Exploration >> http://p.sf.net/sfu/hpccsystems >> >> >> _______________________________________________ >> Asterisk-java-devel mailing list >> Ast...@li... >> https://lists.sourceforge.net/lists/listinfo/asterisk-java-devel > > > > ------------------------------------------------------------------------------ > HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions > Find What Matters Most in Your Big Data with HPCC Systems > Open Source. Fast. Scalable. Simple. Ideal for Dirty Data. > Leverages Graph Analysis for Fast Processing & Easy Data Exploration > http://p.sf.net/sfu/hpccsystems > > > _______________________________________________ > Asterisk-java-devel mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-devel -- *Ing. Luca Natale* /Area Tecnica/ *Mail* l.n...@my... <mailto:l.n...@my...> *Tel* +39 320 46 09 517 *Skype* lucanatale83 WatsON S.r.l Via Alfredo Nobel 281 - 81031 Aversa CE *Tel.*+39 02 944 376 19 *Fax.*+39 02 944 37 031 *Web*www.mywatson.it <http://www.mywatson.it> <http://www.facebook.com/pages/WatsON-Tecnologie-Facili/108939055857460?fref=ts> <http://www.linkedin.com/company/watson-s.r.l?trk=hb_tab_compy_id_2112721> |