提交 14765d60 authored 作者: Raymond Chandler's avatar Raymond Chandler

make requests go to the same place as the other fs_curl requests

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk/contrib@15132 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 4080656a
...@@ -14,35 +14,34 @@ ...@@ -14,35 +14,34 @@
*/ */
class xml_cdr_conf extends fs_configuration { class xml_cdr_conf extends fs_configuration {
function xml_cdr_conf() { function xml_cdr_conf() {
$this -> fs_configuration(); $this->fs_configuration();
} }
function main() { function main() {
$params = $this -> get_settings(); $params = $this->get_settings();
$this -> write_settings($params); $this->write_settings($params);
} }
function get_settings() { function get_settings() {
return array('url'=>'http://$${curl_host}/fs_curl/cdr.php', 'encode'=>'true');
return array( return array(
'url'=>'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'] 'url'=>'http://' . $_SERVER['HTTP_HOST'] . '/' . $_SERVER['PHP_SELF']
, 'encode'=>'true' , 'encode'=>'true'
); );
} }
function write_settings($params) { function write_settings($params) {
$this -> xmlw -> startElement('configuration'); $this->xmlw->startElement('configuration');
$this -> xmlw -> writeAttribute('name', basename(__FILE__, '.php')); $this->xmlw->writeAttribute('name', basename(__FILE__, '.php'));
$this -> xmlw -> writeAttribute('description', 'CDRs via XML Post'); $this->xmlw->writeAttribute('description', 'CDRs via XML Post');
$this -> xmlw -> startElement('settings'); $this->xmlw->startElement('settings');
while (list($name, $value) = each($params)) { while (list($name, $value) = each($params)) {
$this -> xmlw -> startElement('param'); $this->xmlw->startElement('param');
$this -> xmlw -> writeAttribute('name', $name); $this->xmlw->writeAttribute('name', $name);
$this -> xmlw -> writeAttribute('value', $value); $this->xmlw->writeAttribute('value', $value);
$this -> xmlw -> endElement(); $this->xmlw->endElement();
} }
$this -> xmlw -> endElement(); $this->xmlw->endElement();
$this -> xmlw -> endElement(); $this->xmlw->endElement();
} }
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论