Using HEP / Homer with FreePBX adding correlation header

I am using Homer to monitor QoS and log SIP packets. One of the configuration steps is to add a correlation header so that you can follow the call legs. The documentation just shows PJSIP_HEADER(add,X-CID)=$SIPCALLID which I understand needs to go into the dial plan somewhere but they don’t expand upon it any further. Has anyone configured Homer with FreePBX and successfully added the correlation header to inbound and outbound calls?

Yes!

Add to /etc/asterisk/extensions_custom.conf:

[macro-dialout-one-predial-hook]
exten => s,1,Gosub(func-set-sipheader,s,1(X-cid,${PJSIP_HEADER(read,call-id}))

and then reload dialplan.

1 Like

Thank you that seemed to work. I assume you added it to more than just one spot correct? It seems like this only works if it is an inbound caller that dials an extension directly

Hooking for fun and income is the reference I followed.

Looks like you may want to add the same header on macro-dialout-trunk-predial-hook

2 Likes

Thanks for the resource and help again. It looks like I need to figure out queue calls still. The X-CID header is set but it is empty for some reason.

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.