Skip to content

Example: Genband Q10 20 FMM XCID

Lorenzo Mangani edited this page Jun 9, 2017 · 3 revisions

GENBAND S3/Q10/Q20/Q21: FMM X-CID

USE AT YOUR OWN RISK!

Thanks to Wayne Mills-Kidals for contributing this snippet for S3/Q10/Q20/Q21 version 9.1+

The following rule example will be triggered by INVITES and copy the A-Leg "Call-ID" header value into a new B-LEG "X-CID" Header, useful for call correlation purposes in HOMER and HEPIC:


HOMER Config

HOMER/preferences.php

Enable x-cid style matching:

      /* BLEG DETECTION */
      define('BLEGDETECT', 1); 
      define('BLEGCID', "x-cid");
HOMER/kamailio.cfg

Tell HOMER to match a specific X-CID format, in our Genband case "X-Cid"

modparam("sipcapture", "callid_aleg_header", "X-Cid")

FMM RULE

cli fmm trigger add xcid-hdr-t sip-header
cli fmm trigger edit xcid-hdr-t method is("INVITE") msg.type is("request") header.name is("Call-ID")
 
cli fmm action add save-xcid-hdr-a save
cli fmm action edit save-xcid-hdr-a message.saved-from-hdr xcid-hdr-t.header.value
 
cli fmm action add insert-xcid-hdr-a insert
cli fmm action edit insert-xcid-hdr-a header.name "X-CID" value var.message.saved-from-hdr
 
cli fmm rule add xcid-hdr-r
cli fmm rule edit xcid-hdr-r condition (xcid-hdr-t) actions save-xcid-hdr-a,insert-xcid-hdr-a
 
cli fmm profile add xcid-hdr-p
cli fmm profile edit xcid-hdr-p rules xcid-hdr-r

HR RULE

cli hdrrule add x-cid-hdr
cli hdrrule edit x-cid-hdr method INVITE method-type req header X-CID header-element fullheader
cli hdrrule edit x-cid-hdr operation PASS-IGN-ERR
cli hdrpolicy edit System_Header_Policy_Profile add x-cid-hdr ruletype DESTHDRRULE
Clone this wiki locally