I'm not quite sure of the use case. Do any of these help?
1) specify a server, not an IP, and then let DNS determine where it goes.
2) use a small lua script to set the channel variable based on whatever you need - an sql query, some logic.. and then use that variable in the bridge string.

Those help? If not, please explain more what problem you are trying to solve.

-Avi


On Sun, Jan 8, 2012 at 3:34 PM, fieldpeak <fieldpeak@gmail.com> wrote:

Dear friends,

i have FS for PSTN outbound call using below dial plan,

<extension name="CallToPSTN" >
   <condition field="destination_number" expression="^(0\d+)$" >
       <action application="bridge" data="sofia/internal/$1@1.2.3.4" />
   </condition>
</extension>

While, now i need dynamically specify the outbound GW’s IP address according to the return result of the external command before routing in the source code , e.g. if the external command return FS the IP address of OB GW 6.7.8.9, then

<action application="bridge" data="sofia/internal/$1@6.7.8.9" />

however, i don't know which function i should call within the source code to realize it, could anybody help to advise,

P.S. i know there is existing module “mod_xml_curl” can realize similar function, however, I could not use it for this case…

 

thanks a lot!

Regards,
Charles

_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
consulting@freeswitch.org
http://www.freeswitchsolutions.com

FreeSWITCH-powered IP PBX: The CudaTel Communication Server
http://www.cudatel.com

Official FreeSWITCH Sites
http://www.freeswitch.org
http://wiki.freeswitch.org
http://www.cluecon.com

FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org