Skip to main content

Is Tenant Stored in MySQL CDR?

Posted by dozment on Wed, 08/20/2008

I never finished setting up mysql for my CDR, and I've been dumping it to a csv. I would like to get it in mysql once and for all. I've got it set up so that it's writing to mysql, but I don't see a column for tenant. Did I miss it when I created the table, or is it not written to the database?


Submitted by eeman on Wed, 08/20/2008 Permalink

asterisk does not write to extra fields in 1.4 with the exception of 'userfield' which many 3rd party software (like billing software) overwrites so that they know they've processes that entry. This rules out any code included in the base to handle populating this field, leaving those changes on a personally customized level. Your best option, is to use the ACCOUNTCODE field as a way of identifying each tenant. You could customize your inbound and outbound scripts to Obviously, your sip channels will have the tennant name in them.

Submitted by dozment on Thu, 08/21/2008 Permalink

On the call history page there is a drop down to select a tenant. Where does that field come from? If I'm using csv for the cdr I am able to select records based on that tenant dropdown. But, if I'm using mysql I can't.

Also, if I log on as a tenant specific administrator with it set up to use csv for cdr I am able to see that tenant's detail. But, if I have it set to use mysql I don't see any detail.

I see that tenant is written to userfield in macro-tl-userexten-rg-base.

[macro-tl-userexten-rg-base]

exten => s,n,Set(CDR(userfield)=${tenant})

Is it using userfield?