Details
-
Problem report
-
Resolution: Unresolved
-
Trivial
-
None
-
5.0.11
-
None
-
asterisk 16
Description
In current template only network status of PJSIP is detected (i.e. if remote PJSIP is not available) than 'PJSIP trunk "{#OBJECTNAME}": PJSIP trunk {#OBJECTNAME} has a state Unavailable' based on state of '
{[Template Tel Asterisk by HTTP:asterisk.pjsip.trunk.devicestate[\{#OBJECTNAME}]|https://zabbix.managed-it.a1.by/disc_prototypes.php?form=update&itemid=91461&parent_discoveryid=91455].last()}="Unavailable"' is fired.
But if remote PJSIP is available but credentials is not correct then no any items/triggers exists.
Following changes is needed in js code to monitor PJSIP registration status through PJSIPShowRegistrationsOutbound AMI comman:
<code>
+++ asterisk.js 2021-02-01 19:45:11.132350027 +0300
@@ -71,6 +71,7 @@
},
pjsip:
);
}
+function getPjsipShowRegistrationOutbound() {
+ response = Ami.request(url, 'PJSIPShowRegistrationsOutbound');
+ elements = text2Object(response.body);
+ asterisk.pjsip.registrations = elements.filter(function (element)
);
+}
+
function getQueueSummary() {
function getQueueSummary() {
response = Ami.request(url, 'QueueSummary');
asterisk.queue.queues = text2Object(response.body);
@@ -248,6 +257,9 @@
if (list.includes('PJSIPShowEndpoints'))
+if (list.includes('PJSIPShowRegistrationsOutbound'))
{ + getPjsipShowRegistrationOutbound(); +}if (list.includes('QueueSummary'))
{ getQueueSummary(); }</code>
And following trigger is created
{[Template Tel Asterisk by HTTP:asterisk.pjsip.registrations.status[\{#OBJECTNAME}
] |
https://zabbix.managed-it.a1.by/disc_prototypes.php?form=update&itemid=133965&parent_discoveryid=91455].last()}<>"Registered" based on state of new 'asterisk.pjsip.registrations.status{#OBJECTNAME}' item PS: It will be better to put this state to smth like asterisk.pjsip.trunk.registrationstate{#OBJECTNAME} but it is beyond my JS skills. |