I noticed the new TenantID feature blogged about at Tenant ID, a Flexible Asterisk Tool ⋆ Asterisk and found this would be a useful feature for us, as we have tenants and want the tenantID to show up in CDRs, and currently use a workaround by setting a custom CDR field.
I was able to get this working well for outgoing calls, via setting the tenantID in the pjsip.conf. That winds up in our newly created tenantID column in our CDRs.
However, I’m not able to get the tenantID to show up in the CDR for incoming calls. In this case I’m setting the tenantID in the dialplan, since I won’t know who the tenant is until I can look up who owns the DID in the dialplan. So I do something like this:
same => n,Set(CHANNEL(tenantid)=${companyID})
(companyID is set previously)
However, this doesn’t show up in my DB. Furthermore, this returns blank:
same => n,NoOp(tenantID: ${CDR(tenantid)})
NoOp(tenantID: )
I’ve also tried setting the CDR explicitly,
same => n,Set(CDR(tenantid)=${CHANNEL(tenantid)})
Which when I query CDR, shows up:
NoOp(tenantID: uatTest)
But doesn’t show in my DB column in CDR, it’s still null.
Just to repeat, this all works perfectly for an outgoing call, when tenantID is set in my pjsip.conf for an outgoing call, DB column and all.
It’s just not terribly useful to us unless we can get the tenantID into all calls, outgoing, incoming, fax, etc. I think I followed the blog entry correctly, but otherwise can’t get this feature to work.
Any help is appreciated. Thanks.