Using alias_db - 7XXX calls were succesfully aliased and routed to Asterisk through 4444 user (asterisk server did not accept connections to sip ports from Internet due to security reasons).
On asterisk side, all this calls had equal extension, configured in sip.conf "REGISTER =>.../exten" string.
[from_kamailio]
exten => 4444,1,Noop(Call EXTEN:${EXTEN} TO:${SIP_HEADER(TO)})
same => n,Set(newext=${SIP_HEADER(To)})
same => n,Set(newext=${CUT(newext,@,1)})
same => n,Set(newext=${CUT(newext,:,2)})
same => n,Goto(from_kamailio,${newext},1)
exten => _7XXX,1,Noop(Call to ${EXTEN})
same => n,Dial(SIP/${EXTEN});
same => n,Hangup()
One disadvantage with alias_db - is that i cant use regex to alias all 7XXX numbers with 4444 user, so i need to create aliases for every 7XXX user in dbaliases table using this scenario.
Is the any other not very difficult way to route all 7XXX calls in Kamailio to Asterisk through 4444 user without creating alias dbrecords for every number?