From Joy Garcia, 7 Years ago, written in Plain Text.
- view diff
Embed
  1. ---xml_curl.conf.xml
  2. <configuration name="xml_curl.conf" description="cURL XML Gateway">
  3.     <bindings>
  4.         <binding name="dialplan">
  5.                 <param name="gateway-url" value="http://txtphoneline.com/freeswitch" bindings="dialplan" />
  6.             <param name="method" value="POST" />
  7.             <param name="enable-cacert-check" value="false" />
  8.             <param name="enable-ssl-verifyhost" value="false" />
  9.             <param name="enable-post-var" value="variable_sip_to_user"/>
  10.             <param name="enable-post-var" value="variable_sip_from_user_stripped"/>
  11.         </binding>
  12.     </bindings>
  13. </configuration>
  14.  
  15. ---http://txtphoneline.com/freeswitch/index.php
  16. header('Content-Type: text/xml');
  17.  
  18. $log = fopen("log.txt", "a");
  19. $txt = date('Y-m-d H:i:s') . "\n";
  20. $txt .= json_encode($_REQUEST) . "\n";
  21. $txt .= "\n";
  22. fwrite($log, $txt);
  23. fclose($log);
  24.  
  25. $response = <<< XML
  26. <?xml version="1.0" encoding="UTF-8" standalone="no"?>
  27. <document type="freeswitch/xml">
  28.   <section name="result">
  29.     <result status="not found" />
  30.   </section>
  31. </document>
  32. XML;
  33.  
  34. $response = <<< XML
  35. <?xml version="1.0" encoding="UTF-8" standalone="no"?>
  36. <document type="freeswitch/xml">
  37.   <section name="dialplan" description="Regex Xml Dialplan from local">
  38.     <context name="default">
  39.       <extension name="myextension">
  40.         <condition field="destination_number" expression="1004">
  41.           <action application="info"/>
  42.           <action application="answer"/>
  43.         </condition>
  44.       </extension>
  45.     </context>
  46.   </section>
  47. </document>
  48. XML;
  49.  
  50. die($response);