Hello Sergey
I am agree with you that my dial plan can be risky I used ACL but this can be not sufficient. I want to be able to call any internal sip extension, but i don't want that this piece dialplan to be usable reach external numbers.
<extension name="blockCallToNonExistenDomain">
<condition regex="any">
<regex field="${sip_to_host}" expression="^[\d\.]+$"/>
<regex field="${domain_exists(${sip_to_host})}" expression="^false$"/>
<action application="info"/>
<action application="log"
data="ERR Unauthorised call with uuid "${uuid}" is processed in context "${context}"! Source IP: ${network_addr}"/>
<action application="hangup" data="INCOMING_CALL_BARRED"/>
</condition>
</extension>
<extension name="checkUserExist">
<condition field="${user_exists(id ${destination_number} ${sip_to_host})}" expression="^false$">
<action application="hangup" data="UNALLOCATED_NUMBER"/>
</condition>
</extension>
I probably need to protect theses variables ( sip_to_user must be only a locally registered sip extension ) or avoid using them ( maybe using multiple conditions field for each domain ? )
I don't fully understand your initial example:
<action application="bridge" data="{sip_invite_to_uri=<sip:${destination_number}@mydomain.org>}user/reg_user@mydomain.org"/>
What is reg_user for freeswitch1?
What should i use on freeswitch2 dialplan to recognize the inbound call ?
Thanks