Re: [Asterisk-java-devel] ParkedCallsComplete generated events in manager
Brought to you by:
srt
|
From: Luca N. <l.n...@my...> - 2014-06-17 10:31:02
|
The listener is running fine, in fact i can catch any other event coming
from the manager :(
I never had problems catching events before, problem is that now i have
necessity of getting a list of the parked channels, so i thought about
building it using the events generated by a ParkedCallsAction, but to no
avail.
Is there another way to get a list of the parked channels using the AMI?
Asterisk-java version: asterisk-java-1.0.0.CI-20140513.214527-1608
Asterisk version: 11.6.0
manager.conf
[general]
enabled = yes
port = 5038
bindaddr = 0.0.0.0
[xbpbew]
writetimeout = 10000
secret = genna
deny=0.0.0.0/0.0.0.0
permit=127.0.0.1/255.255.255.255
permit=10.51.0.0/255.255.0.0
read = all
write = all
Thank you,
Luca
On 17/06/2014 12:21, Yves A. wrote:
> hi,
>
> is it sure that your "ServerAsterisk" is running, connected and
> listening all the time?
> Are you able to listen other events while testing your parking calls?
> which version of asterisk / asterisk-java?
> did you check the user your connecting to asterisk with has
> read/write=all privileges in manager.conf?
>
> y.
>
> Am 17.06.2014 11:57, schrieb Luca Natale:
>> 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>
>>
>>
>>
>>
>> ------------------------------------------------------------------------------
>> 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>
|