1
votes

fs_cli can execute api function find_user_xml and I can get user data in XML. However, if I run it inside dialplan, Freeswitch logs true instead of real result.

Here is my dialplan extension:

<extension name="Test">
  <condition field="destination_number" expression="^(\d{1,20})$">
    <action  application="set" data="somevar=${find_user_xml(id 1000 xxx.xxx.xxx.xxx)}"/>
    <action  application="log" data="INFO ${somevar}"/>
  </condition>
</extension>

And I get this result instead of actual XML representation:

2019-09-02 07:01:58.120071 [INFO] mod_dptools.c:1792 true

If user does not exist, Freeswitch will return false. Command xml_locate also returns data in XML format and it works just fine.

Does anybody know how can I get XML result from 'find_user_xml' command instead of boolean value?

1

1 Answers

0
votes

I found a workaround for this issue - execute find_user_xml like system command. It is not best solution but still returns desired result.

<extension name="Test">
  <condition field="destination_number" expression="^(\d{1,20})$">
    <action  application="set" data="somevar=${system fs_cli -x 'find_user_xml id 1000 xxx.xxx.xxx.xxx'}" />
    <action  application="log" data="INFO ${somevar}" />
  </condition>
</extension>