-
-
Notifications
You must be signed in to change notification settings - Fork 245
H7: Writing HEP Sub Middleware
HOMER 7.7 does a lot of things, but there are cases where we need to get our own logic "in the loop" to provide users with additional details about the traffic, users, or elements they are working with.
To make this as easy as fun as possible, we have created hepsub
, a simple mechanism to attach middleware APIs into the natural HOMER workflow. Each HEPsub Agent will publish its API to HOMER and can act as data provider or proxy to other data it subscribes to.
Here's a quick "hello world" example to display the power of HEPSUB directly on the server.
- Homer 7.7+
- NodeJS 10+
As a first step, clone and configure the hepgen hello world example:
cd /usr/src
git clone https://github.com/sipcapture/hepsub
cd hepsub && npm install
In order to use HEPSUB you need to create an API key from the HOMER interface:
Once the key is available, complete the configuration using file config.js
{
backend: 'http://my.homer.hostname:80/api/v3/agent/subscribe',
token: 'xEvLmrcXhMKAjIPILgycOJHVVxZfohztYDELNzKjLUeKWIuiksFdVWzZcMHnnmztDMsmkqCCFdypTVYK',
service: {
"uuid": '70e57310-92b6-11ea-8014-2b3052014b77', // Math.random().toString(36).substring(7),
"host":"my.homer.hostname",
"port": 18088,
"protocol": "http",
"path": "/get",
"type": "cdr",
"ttl": 300,
"node": "test-endpoint",
"gid": 10
},
"debug": true
}
Once your configuration is ready, run the hepsub agent and watch for subscribe confirmation:
# npm start
API Server started 18088
RESPONSE API: { data:
{ expire_date: '2020-05-10T14:09:46.540826053+02:00',
expire_ts: 1589112586,
uuid: '70e57310-92b6-11ea-8014-2b3052014b77' },
message: 'successfully created agent record' }
Your hepsub agent should be subscribe and listening. Click any result in the UI and check the Logs tab:
- hepsub-helloworld basic example
- hepsub-cgrates fetch CDR details from CgRates
- hepsub-elastic fetch Logs from Elasticsearch
- hepsub-voipmonitor fetch RTP/CDRs from VoipMonitor
(C) 2008-2023 QXIP BV
HEP/EEP Agent Examples:
- CaptAgent
- HEPlify
- Kamailio
- OpenSIPS
- FreeSwitch
- Asterisk
- sipgrep
- sngrep
- RTPEngine
- RTPProxy
- Oracle ACME SBC
- Sonus SBC
- Avaya SM
- Sansay SBC
HEP/EEP Agent Examples (LOGS):
HEP/EEP Proxy:
Extra Examples:
- Custom JSON Stats
- RTCP-XR Stats
- GEO IP Maps
- Janus/Meetecho-WebRTC
- Cloudshark Export
- Encrypted HEP Tunneling
- SNMP Monitoring
- FreeSWITCH ESL Monitoring
- Kazoo Monitoring
- Speech-to-Text-to-HEP
Extra Resources: