How to get calls to SIP Uri or Hostname!

Hiya,

The app i’m using can forward calls to Either Sip URI or hostname. Example:

SIP URI

If the destination is set as a SIP URI, the following XML will be generated. For eg. DESTINATION=sip:[email protected]

<Response>
<Dial callerId="{source number}">
    <User>sip:[email protected]</User>
</Dial>
</Response>
Hostname

If the destination is set as an IP or a hostname, the following XML will be generated. For eg. DESTINATION=192.123.1.23

<Response>
<Dial callerId="{source number}">
    <User>{Plivo Number}@192.123.1.23</User>
</Dial>
</Response>

How can i set this up in Freepbx so that My PBX accepts these calls and routes them using Inbound routes?

I would prefer to accept by hostname because if i use a URI, I need to do @hostname.com which would affect my inbound routing. if i can send it straight to IP address then i can sort my inbound routes out more better.