Hep Protocol and Homer

Capturing telecom protocols or traffic for various purposes is a topic that has been discussed for a long time and always has been done with different tools or through some vendors.

One of the tools that help to capture protocols, especially SIP, is Homer. This project provides valuable tools to capture and monitor your VoIP network and use it for troubleshooting or analytics purposes.

Homer’s idea is simple, you have some agents to capture the required data, then encapsulate it in the standard format and send it to the server. You can find the below image in project git:

How-Homer-Works Image

If you are looking for a ready solution, Homer has it and there are different agents for open-source platforms like Kamailio, FreeSWITCH and etc. But if you are looking to use this platform for your application, first of all, you need to understand HEP protocol (actually it is not RFC protocol but there is an RFC draft for that). You can read HEP protocol specification here: HEP V3

Recently for one of my project, needed to send SIP protocol message through HEP to another consumer that uses them for analytics. So, I tried to use HEP-js lib. It is a simple module that encapsulates your protocol message and other info in HEP PDU and then decapsulates HEP PDU to JSON. Somethin like this:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
{
  "rcinfo": {
    "protocolFamily": 2,
    "protocol": 6,
    "srcIp": "172.26.26.72",
    "dstIp": "172.26.21.185",
    "srcPort": 64831,
    "dstPort": 8060,
    "timeSeconds": 1592975786,
    "timeUseconds": 669278,
    "payloadType": 1,
    "captureId": 2001,
    "hepNodeName": "2001",
    "conversationId": "456852465",
    "organizationId": "3bac7742-243f-4af7-ba39-f4098b941eda",
  },
  "payload": "INVITE sip:BellUser2@172.26.21.185:8060;transport=tls SIP/2.0\r\nTo:  <sip:BellUser2@172.26.21.185:8060>\r\nFrom:  <sip:BellStation1@172.26.21.185:8060>;tag=974329\r\ncall-id: 3935064a-294e-44d8-930d-1a87b90515bb\r\nCSeq: 1 INVITE\r\nallow-events: conference, talk, hold\r\nContact:  <sip:BellStation1@172.26.26.72:5061;transport=tls>\r\nx-phonesim-proxy-type: primary\r\ncontent-type: application/sdp\r\nx-edge-id: 268c720e-b939-4484-966d-80a1123e3810\r\nx-edge-name: qf-bell\r\nx-test-id: Station2Station\r\nx-test-name: Station to Station Keyword Test\r\nUser-Agent: PolycomSoundPointIP-SPIP_450-UA/4.0.10.0689_000025CC0001\r\nx-phonesim: 1.0.0-534\r\ncontent-length: 567\r\nVia: SIP/2.0/TLS qf-lempel:5060;branch=z9hG4bK416647af6e43448b8fc9c8b804713a0e\r\n\r\nv=0\r\no=- 4056025290 3801964586 IN IP4 172.26.26.72\r\ns= \r\nt=0 0\r\na=group:ANAT 1 2\r\nm=audio 20522 RTP/SAVP 0 8 9 101\r\nc=IN IP4 172.26.26.72\r\na=mid:1\r\na=rtpmap:101 telephone-event/8000\r\na=fmtp:101 0-15\r\na=crypto:1 AES_CM_256_HMAC_SHA1_80 inline:ba6DaKfQLSQQbYNMtL1ng2xCVbJuihEgzeajdEWIHT4qGpfrPwuTMDIasyhSOA\r\na=sendrecv\r\nm=audio 23824 RTP/SAVP 0 8 9 101\r\nc=IN IP6 2620:102:c000:f10:d::6050\r\na=mid:2\r\na=rtpmap:101 telephone-event/8000\r\na=fmtp:101 0-15\r\na=crypto:1 AES_CM_256_HMAC_SHA1_80 inline:ba6DaKfQLSQQbYNMtL1ng2xCVbJuihEgzeajdEWIHT4qGpfrPwuTMDIasyhSOA\r\na=sendrecv\r\n"
}

I have added support for IPv6 to this lib that you can find it here.

In this case, you don’t need any Homer server, as you are encapsulating through HEP and other side when receives the PDU, only extract payload and meta data information and digest it for other purposes. HEP gives you a standard structure that will be helpful for future requirements too. Attention please, you can send HEP PDU over any transport you like, in my case I am sending through HTTPS to AWS API gateway and behind that a Lambda decapsulate it and do other processes.

updatedupdated2024-10-082024-10-08