I'm not sure what you are trying to do there but if you dial a sip URI from your phone, thats not going to work, its never going to go to the PBX.
I made it work! I was just trying to make direct SIP URI calling work through my FusionPBX so I can use the PBX's features and also the same softphone (Bria 5 which does not seem to support direct SIP URI calling).
So when I dialed a SIP URI like
0289304@zero-nine.biz (this is a real working number, the sip5060.net test ones did not work when I tried them), Bria assumes the @zero-nine.biz format means I'm trying to authenticate with this domain instead of my real SIP domain mydomain.com. So authentication fails on my FusionPBX's internal SIP profile because zero-nine.biz apparently does not exist in my PBX.
I realized I need to pass the entire SIP URI and also append my real domain @mydomain.com, so I adjusted my dialplan to recognize __ (two underscores) as a replacement for the @ in the destination number regex. This way when I dial 0289304__zero-nine.biz, Bria sends
0289304__zero-nine.biz@mydomain.com. Then I capture the 0289304__zero-nine.biz part in my dialplan and convert it to
0289304@zero-nine.biz for bridging action. This resulted in a successful call for me.
My final dialplan is below:
XML:
<extension name="direct_sip_calling" continue="false" uuid="xxxx">
<condition field="destination_number" expression="^([^@\s]+)__([^@\s]+\.[^@\s]+)$">
<action application="export" data="hold_music=silence"/>
<action application="bridge" data="sofia/${use_profile}/$1@$2"/>
</condition>
</extension>
I'm not sure if I'm doing this the right way or if there's a better way to make this work without substituting the @ in the SIP URI. If others have a better idea please let me know.