[asterisk-users] [Asterisk-Java] SipShowPeerAction

Richard OSS oss_richard at rogers.com
Wed Oct 4 14:45:58 MST 2006


I think you have to implement the ManagerEventHandler interface to handle the PeerEntryEvent.
   
  ManagerEventHandler mgrHdlr = new ManagerEventHandler {
       public void handleEvent(ManagerEvent event) {
  PeerEntryEvent peerEntryEvent = (PeerEntryEvent) event;
System.out.println(peerEntryEvent.getStatus());
     
       }
  }

  And you have to register to receive your eventHandler
  managerConnection.addEventHandle(mgrHdlr);
   
  HTH.
  
richard Coco <coco_richard at yahoo.com> wrote: 
  Hi all,

first of all sorry for the question. I know there is
an asterisk-java mailinglist but i am not subscribed
to this list and i am sure there are asterisk-java
guru on this list who can help me.

I am trying to get the status of a peer using
"SipShowPeerAction". Unfortunately the getStatus
method gives me everytime "null".

SipShowPeerAction sipShowPeerAction = new
SipShowPeerAction("2001");
managerConnection.sendAction(sipShowPeerAction);
PeerEntryEvent peerEntryEvent = new
PeerEntryEvent(sipShowPeerAction);
System.out.println(peerEntryEvent.getStatus());

What wrong with this example? Maybe someone can give
me a working example.

hope someone can help...

thx in advance 



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20061004/80543b4c/attachment.htm


More information about the asterisk-users mailing list