Uploaded image for project: 'OpenNMS'
  1. OpenNMS
  2. NMS-5767

Monitoring Asterisk SIP Peer and Clients



    • Type: Bug
    • Status: Reopened (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 1.10.8
    • Fix Version/s: None
    • Security Level: Default (Default Security Scheme)
    • Labels:


      The idea is to monitor the connection of SIP clients to an Asterisk server. SIP clients could be for example important phones or a SIP uplink to a provider.

      The attached SIPPeerPoller connects to an Asterisk box using the Asterisk Manager Interface (AMI) and executes a sip show peers command and checks the connection state for a given SIP peer. (it has to be configured in Asterisk's sip.conf, that Asterisk monitors the connection to that SIP peer with the option qualify=yes option). If the result from asterisk is "OK (x ms)", then the poller gives back an up message, if not it gives back a down message.

      The monitor reads the OpenNMS AMI configuration file (ami-config.xml) to get the data accessing the asterisk box. In the poller-configuration.xml it needs the parameter sip-peer to be set as the sip peer, that should be monitored. Here is an example:

      <service name="SIP-Uplink" interval="30000" user-defined="false" status="on">
          <parameter key="timeout" value="3000"/>
          <parameter key="retry" value="2"/>
          <parameter key="sip-peer" value="uplink" />
      <monitor service="SIP-Uplink" class-name="org.opennms.netmgt.poller.monitors.AsteriskSIPPeerMonitor" />

      Ronny has done some refactoring for better JUnit testing:

      In the attachment, there is also a patched opennms-asterisk.jar file for the OpenNMS/lib directory, if somebody wants to try it.


        1. opennms-asterisk-1.10.8.jar
          23 kB
        2. AsteriskSIPPeerMonitor.java
          8 kB
        3. opennms-services-1.12.5.jar
          1.70 MB
        4. opennms-services-1.12.6.jar
          1.70 MB
        5. opennms-services-1.12.8.jar
          1.71 MB

          Issue Links



              • Assignee:
                ranger Benjamin Reed
                michael_nt Michael Batz
              • Votes:
                2 Vote for this issue
                10 Start watching this issue


                • Created: