Multi-tenancy is an architecture in which a single instance of a software application serves multiple customers. Each customer is called a tenant.
For creating multitenant we need to create custom extensions in /etc/asterisk/extensions_custom.conf and give relevant context route calls:
[company1]
exten => 1234512345,1,Set(__FROM_DID=${EXTEN})
exten => 1234512345,n,Gosub(app-blacklist-check,s,1)
exten => 1234512345,n,ExecIf($[ “${CALLERID(name)}” = “” ] ?Set(CALLERID(name)=${CALLERID(num)}))
exten => 1234512345,n,Set(__CALLINGPRES_SV=${CALLERPRES()})
exten => 9498851902,n,Set(CALLERPRES()=allowed_not_screened)
exten => s,1,Dial(SIP/1500)

[company2]
exten => 1234567890,1,Set(__FROM_DID=${EXTEN})
exten => 1234567890,n,Gosub(app-blacklist-check,s,1)
exten => 1234567890,n,ExecIf($[ “${CALLERID(name)}” = “” ] ?Set(CALLERID(name)=${CALLERID(num)}))
exten => 1234567890,n,Set(__CALLINGPRES_SV=${CALLERPRES()})
exten => 1234567890,n,Set(CALLERPRES()=allowed_not_screened)
exten => s,1,Dial(SIP/1701)

 

Local Phone Numbers for your Business

Get the SIP Trunking for your Asterisk, we guarantee best price, best coverage and Free Support for Asterisk. 

Try it for Free Now!