Hi all, I am going to create an Asterisk gateway that it will be used at one side as REGISTRAR server for many endpoint and on the other side to a carrier.
Many users will have it’s own external number associated and others will be part of groups, and external number will be associated to that groups as well.
More or less this is what I need.
For better handle all users, DID etc, it’s better to store in AstDB DID numbers associated to internal numbers and create in dialplan an extension that reads AstDB, or is there a better way to handle this?
Maybe a sqllite db?
This is an example of what I mean:
DB:
database put inbound +495117775601 “SIP/100&SIP/101&SIP/102”
database put inbound +495117775602 “SIP/200&SIP/201&SIP/202”
database put inbound +495117775603 “SIP/300&SIP/301&SIP/302”
DIALPLAN:
[default]
exten => _+4951177756XX,1,NoOp(Chiamata in ingresso al numero ${EXTEN})
same => n,Set(INTERNALS=${DB(inbound/${EXTEN})})
same => n,GotoIf($[“${INTERNALS}”=“”]?unhandled)same => n,Dial(${INTERNALS},30)
same => n,GotoIf($[“${DIALSTATUS}”=“NOANSWER”]?failover)
same => n,GotoIf($[“${DIALSTATUS}”=“BUSY”]?failover)
same => n,Hangup()exten => failover,1,NoOp(Inoltro a 999)
same => n,Dial(SIP/999)
same => n,Hangup()exten => unhandled,1,NoOp(Numero non configurato in AstDB)
same => n,Hangup()