Re: [Asterisk-java-users] question about getting peers using SipShowPeerAction (AMI)
Brought to you by:
srt
From: Robert P. <ro...@ro...> - 2007-08-11 00:25:09
|
Well ... I still haven't had much success. Here's the scenario that I'm using: First, all is set up as stated in the start of this thread. 1) I pull the plug on my ATA, causing my two peers (test1 and test2) to time out eventually. 2) I see the unreachable events in the Asterisk console: *CLI> [Aug 10 19:59:58] NOTICE[9540]: chan_sip.c:15360 sip_poke_noanswer: Peer 'test1' is now UNREACHABLE! Last qualify: 94 [Aug 10 20:00:05] NOTICE[9540]: chan_sip.c:15360 sip_poke_noanswer: Peer 'test2' is now UNREACHABLE! Last qualify: 93 3) I see the PeerStatusEvents from the code (forgive my **** and &&&&, it's to help me identify specific debugging statements): **** PeerStatusEvent: org.asteriskjava.manager.event.PeerStatusEvent[dateReceived=Fri Aug 10 20:09:46 EDT 2007,privilege='system,all',timestamp='null',peer='SIP/test2',time='-1',cause='null',peerstatus='Unreachable',systemHashcode=7359402] **** peer name: test2 &&&&&&&&& SipShowPeerAction action complete event class: class org.asteriskjava.manager.event.PeerlistCompleteEvent *** Manager Response: org.asteriskjava.manager.response.ManagerResponse: actionId='actionIdtest2'; message='null'; response='Success'; uniqueId='null'; systemHashcode=12577309 **** PeerStatusEvent: org.asteriskjava.manager.event.PeerStatusEvent[dateReceived=Fri Aug 10 20:09:47 EDT 2007,privilege='system,all',timestamp='null',peer='SIP/test1',time='-1',cause='null',peerstatus='Unreachable',systemHashcode=27475272] **** peer name: test1 &&&&&&&&& SipShowPeerAction action complete event class: class org.asteriskjava.manager.event.PeerlistCompleteEvent *** Manager Response: org.asteriskjava.manager.response.ManagerResponse: actionId='actionIdtest1'; message='null'; response='Success'; uniqueId='null'; systemHashcode=813251 But, I don't see PeerlistCompleteEvents, or PeerEntryEvents. What I expect from reading the javadoc is that when I send a SipShowPeerAction to the AMI, it should result in the AMI sending me back a PeerEntryEvent, and possibly also a PeerlistCompleteEvent (?not sure about that). But, I don't seem to get either. I've posted the (very simple) code I'm using on Google docs to see if it will help point out where I'm going wrong - please, feel free to take a look and if there's anything, let me know! http://docs.google.com/Doc?id=dcpvc479_33gqzn2s Cheers, Robert On 8/10/07, Robert Prince <ro...@ro...> wrote: > Hello Stefan, > > Thanks very much for your help - I'll give that a try! > > > Cheers, > > Robert > > On 8/9/07, Stefan Reuter <ste...@re...> wrote: > > Hi Robert, > > > > first thanks for your very well prepared question, it's a pleasure to > > reply to it :) > > > > > **** PeerStatusEvent: > > > org.asteriskjava.manager.event.PeerStatusEvent[dateReceived=Thu Aug 09 > > > 20:16:31 EDT 2007,privilege='system,all',timestamp='null',peer='SIP/test2',time='97',cause='null',peerstatus='Reachable',systemHashcode=22618484] > > > ** Manager Response: org.asteriskjava.manager.response.ManagerError: > > > actionId='null'; message='Peer SIP/test2 not found.'; > > > response='Error'; uniqueId='null'; systemHashcode=10703525 > > > > The problem is that SipShowPeer requires only the name of the peer > > without the channel prefix ("SIP/"). Unfortunately the PeerStatus event > > returns the name with the channel prefix and Asterisk calls both > > attributes just "peer". I will have a look at the javadocs to make this > > more clear. > > For you this means you just have to strip the channel prefix before > > passing the peer name to the SipShowPeerAction. > > > > Hope that helps, > > > > Stefan > > > > -- > > 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 > > > > > > ------------------------------------------------------------------------- > > 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 > > > > > > > |