We are trying to implement multi-tenant asterisk solution with bandwidth.com as sip provider.
Every company(tenant) will have a bandwidth.com account which has all the DID numbers corresponding to that company.
As per the discussion in the below links, there will be separate context in extensions.conf for each company :
Outgoing calls can be configured easily.
Problem is in directing incoming calls to its corresponding context based on DID.
As per this project: https://github.com/irontec/ivozprovider , we figured we can have a DB call from extensions.conf through AGI script to fetch context corresponding to DID.
But there is performance issue as we need to have DB call for each incoming call.
An alternative can be getting the value from cache. We already have sorcery cache for pjsip realtime.
But we don’t know how to retrieve data from this cache through AGI script.
Question: How to retrieve data from sorcery cache? Is the above method preferred? If not,what are the alternate solutions?