Completed
Push — v3.0 ( e28df5...5be1a9 )
by Samir
13:00
created
freeswitch/fs/lib/astpp.db.php 2 patches
Indentation   +47 added lines, -47 removed lines patch added patch discarded remove patch
@@ -23,61 +23,61 @@
 block discarded – undo
23 23
 
24 24
 class db extends PDO {
25 25
 
26
-    private $error;
27
-    private $sql;
28
-    private $bind;
29
-    private $errorCallbackFunction;
30
-    private $errorMsgFormat;
26
+	private $error;
27
+	private $sql;
28
+	private $bind;
29
+	private $errorCallbackFunction;
30
+	private $errorMsgFormat;
31 31
 
32
-    public function __construct($dsn = "", $user = "", $passwd = "") {
32
+	public function __construct($dsn = "", $user = "", $passwd = "") {
33 33
 
34
-        $config = parse_ini_file("/var/lib/astpp/astpp-config.conf");
34
+		$config = parse_ini_file("/var/lib/astpp/astpp-config.conf");
35 35
 
36
-        $options = array(
37
-            PDO::ATTR_PERSISTENT => true,
38
-            PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION
39
-        );
36
+		$options = array(
37
+			PDO::ATTR_PERSISTENT => true,
38
+			PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION
39
+		);
40 40
 
41
-        try {
42
-            parent::__construct("mysql:host=".$config['dbhost'].";dbname=".$config['dbname']."", $config['dbuser'], $config['dbpass'], $options);
43
-        } catch (PDOException $e) {
41
+		try {
42
+			parent::__construct("mysql:host=".$config['dbhost'].";dbname=".$config['dbname']."", $config['dbuser'], $config['dbpass'], $options);
43
+		} catch (PDOException $e) {
44 44
 
45
-            $this->error = $e->getMessage();
46
-        }
47
-        echo $this->error;
48
-    }
45
+			$this->error = $e->getMessage();
46
+		}
47
+		echo $this->error;
48
+	}
49 49
 
50
-    /**
51
-     * @param string $bind
52
-     */
53
-    public function cleanup($bind) {
54
-        if ( ! is_array($bind)) {
55
-            if ( ! empty($bind))
56
-                $bind = array($bind);
57
-            else
58
-                $bind = array();
59
-        }
60
-        return $bind;
61
-    }
50
+	/**
51
+	 * @param string $bind
52
+	 */
53
+	public function cleanup($bind) {
54
+		if ( ! is_array($bind)) {
55
+			if ( ! empty($bind))
56
+				$bind = array($bind);
57
+			else
58
+				$bind = array();
59
+		}
60
+		return $bind;
61
+	}
62 62
 
63
-    public function run($sql, $bind = "") {
64
-        $this->sql = trim($sql);
65
-        $this->bind = $this->cleanup($bind);
66
-        $this->error = "";
63
+	public function run($sql, $bind = "") {
64
+		$this->sql = trim($sql);
65
+		$this->bind = $this->cleanup($bind);
66
+		$this->error = "";
67 67
 
68
-        try {
69
-            $pdostmt = $this->prepare($this->sql);
70
-            if ($pdostmt->execute($this->bind) !== false) {
71
-                if (preg_match("/^(".implode("|", array("select", "describe", "pragma")).") /i", $this->sql))
72
-                    return $pdostmt->fetchAll(PDO::FETCH_ASSOC);
73
-                elseif (preg_match("/^(".implode("|", array("delete", "insert", "update")).") /i", $this->sql))
74
-                    return $pdostmt->rowCount();
75
-            }
76
-        } catch (PDOException $e) {
77
-            $this->error = $e->getMessage();
78
-            return $this->error;
79
-        }
80
-    }
68
+		try {
69
+			$pdostmt = $this->prepare($this->sql);
70
+			if ($pdostmt->execute($this->bind) !== false) {
71
+				if (preg_match("/^(".implode("|", array("select", "describe", "pragma")).") /i", $this->sql))
72
+					return $pdostmt->fetchAll(PDO::FETCH_ASSOC);
73
+				elseif (preg_match("/^(".implode("|", array("delete", "insert", "update")).") /i", $this->sql))
74
+					return $pdostmt->rowCount();
75
+			}
76
+		} catch (PDOException $e) {
77
+			$this->error = $e->getMessage();
78
+			return $this->error;
79
+		}
80
+	}
81 81
 
82 82
 }
83 83
 
Please login to merge, or discard this patch.
Braces   +10 added lines, -8 removed lines patch added patch discarded remove patch
@@ -52,10 +52,11 @@  discard block
 block discarded – undo
52 52
      */
53 53
     public function cleanup($bind) {
54 54
         if ( ! is_array($bind)) {
55
-            if ( ! empty($bind))
56
-                $bind = array($bind);
57
-            else
58
-                $bind = array();
55
+            if ( ! empty($bind)) {
56
+                            $bind = array($bind);
57
+            } else {
58
+                            $bind = array();
59
+            }
59 60
         }
60 61
         return $bind;
61 62
     }
@@ -68,10 +69,11 @@  discard block
 block discarded – undo
68 69
         try {
69 70
             $pdostmt = $this->prepare($this->sql);
70 71
             if ($pdostmt->execute($this->bind) !== false) {
71
-                if (preg_match("/^(".implode("|", array("select", "describe", "pragma")).") /i", $this->sql))
72
-                    return $pdostmt->fetchAll(PDO::FETCH_ASSOC);
73
-                elseif (preg_match("/^(".implode("|", array("delete", "insert", "update")).") /i", $this->sql))
74
-                    return $pdostmt->rowCount();
72
+                if (preg_match("/^(".implode("|", array("select", "describe", "pragma")).") /i", $this->sql)) {
73
+                                    return $pdostmt->fetchAll(PDO::FETCH_ASSOC);
74
+                } elseif (preg_match("/^(".implode("|", array("delete", "insert", "update")).") /i", $this->sql)) {
75
+                                    return $pdostmt->rowCount();
76
+                }
75 77
             }
76 78
         } catch (PDOException $e) {
77 79
             $this->error = $e->getMessage();
Please login to merge, or discard this patch.
freeswitch/fs/lib/astpp.xml.php 2 patches
Spacing   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 }
37 37
 
38 38
 //Build acl xml
39
-function load_acl($logger, $db,$config) {
39
+function load_acl($logger, $db, $config) {
40 40
 	$xml = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n";
41 41
 	$xml .= "<document type=\"freeswitch/xml\">\n";
42 42
 	$xml .= "   <section name=\"Configuration\" description=\"Configuration\">\n";
@@ -46,29 +46,29 @@  discard block
 block discarded – undo
46 46
 	
47 47
 	//For customer and provider ips
48 48
 	$query = "SELECT ip FROM ip_map,accounts WHERE ip_map.accountid=accounts.id AND accounts.status=0 AND deleted=0";
49
-	$logger->log("ACL Query : " . $query);
49
+	$logger->log("ACL Query : ".$query);
50 50
 	$res_acl = $db->run($query);
51 51
 	$logger->log($res_acl);
52 52
 
53 53
 	foreach ($res_acl as $res_acl_key => $res_acl_value) {
54
-		$xml .= "       <node type=\"allow\" cidr=\"" . $res_acl_value['ip'] . "\"/>\n";
54
+		$xml .= "       <node type=\"allow\" cidr=\"".$res_acl_value['ip']."\"/>\n";
55 55
 	}
56 56
 
57 57
 	//For gateways
58 58
 	$query = "SELECT * FROM gateways WHERE status=0";
59
-	$logger->log("Sofia Gateway Query : " . $query);
59
+	$logger->log("Sofia Gateway Query : ".$query);
60 60
 	$sp_gw = $db->run($query);
61 61
 	$logger->log($sp_gw);
62 62
 
63 63
 	foreach ($sp_gw as $sp_gw_key => $sp_gw_value) {
64 64
 
65
-			$sp_gw_settings  = json_decode($sp_gw_value['gateway_data'], true);
65
+			$sp_gw_settings = json_decode($sp_gw_value['gateway_data'], true);
66 66
 			foreach ($sp_gw_settings as $sp_gw_settings_key => $sp_gw_settings_value) {
67 67
 				if ($sp_gw_settings_value != "" && $sp_gw_settings_key == "proxy")
68 68
 				{
69
-					$tmp_ip_arr = explode(":",$sp_gw_settings_value);
70
-					if (!filter_var($tmp_ip_arr[0], FILTER_VALIDATE_IP) === false) {
71
-						$xml .= "   <node type=\"allow\" cidr=\"" . $tmp_ip_arr[0] . "/32\"/>\n";
69
+					$tmp_ip_arr = explode(":", $sp_gw_settings_value);
70
+					if ( ! filter_var($tmp_ip_arr[0], FILTER_VALIDATE_IP) === false) {
71
+						$xml .= "   <node type=\"allow\" cidr=\"".$tmp_ip_arr[0]."/32\"/>\n";
72 72
 					}
73 73
 				}
74 74
 	   	}
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 
78 78
 
79 79
 	//For opensips
80
-	if($config['opensips'] == '0')
80
+	if ($config['opensips'] == '0')
81 81
 	{
82 82
 		$xml .= "<node type=\"allow\" cidr=\"".$config['opensips_domain']."/32\"/>\n";     
83 83
 	}
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 	$xml .= "       </list>\n";
86 86
 
87 87
 	//For loopback 
88
-	if($config['opensips'] == '0')
88
+	if ($config['opensips'] == '0')
89 89
 	{
90 90
 		$xml .= "<list name=\"loopback.auto\" default=\"allow\">\n";
91 91
 			$xml .= "<node type=\"allow\" cidr=\"".$config['opensips_domain']."/32\"/>\n";
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
 
95 95
 	//For event handing
96 96
 	$xml .= "<list name=\"event\" default=\"deny\">\n";
97
-		$xml .= ($config['opensips'] == "0")?"<node type=\"allow\" cidr=\"".$config['opensips_domain']."/32\"/>\n":"\n";
97
+		$xml .= ($config['opensips'] == "0") ? "<node type=\"allow\" cidr=\"".$config['opensips_domain']."/32\"/>\n" : "\n";
98 98
 		$xml .= "<node type=\"allow\" cidr=\"127.0.0.0/8\"/>\n";
99 99
 	$xml .= "</list>\n";
100 100
 	$xml .= "           </network-lists>\n";
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
 	$xml .= "   <profiles>\n";
115 115
 
116 116
 	$query = "SELECT * FROM sip_profiles WHERE status=0";
117
-	$logger->log("Sofia Query : " . $query);
117
+	$logger->log("Sofia Query : ".$query);
118 118
 	$res_sp = $db->run($query);
119 119
 	//$logger->log($res_sp);
120 120
 
@@ -122,40 +122,40 @@  discard block
 block discarded – undo
122 122
 
123 123
 		$settings = json_decode($sp_value['profile_data'], true);
124 124
 		//$logger->log(print_r($settings,true));
125
-		$xml .= "   <profile name=\"" . $sp_value['name'] . "\">\n";
125
+		$xml .= "   <profile name=\"".$sp_value['name']."\">\n";
126 126
 
127 127
 		$xml .= "   <domains>\n";
128
-			$xml .= "       <domain name=\"" . $sp_value['sip_ip'] . "\" alias=\"true\" parse=\"true\"/>\n";
128
+			$xml .= "       <domain name=\"".$sp_value['sip_ip']."\" alias=\"true\" parse=\"true\"/>\n";
129 129
 		$xml .= "   </domains>\n";
130 130
 		/*$xml .= "   <aliases>\n";
131 131
             $xml .= "       <alias name=\"" . $sp_value['sip_ip'] . "\"/>\n";
132 132
         $xml .= "   </aliases>\n";*/
133 133
 
134 134
 	$xml .= "   <settings>\n";
135
-	$xml .= "       <param name=\"sip-ip\" value=\"" . $sp_value['sip_ip'] . "\"/>\n";
136
-	$xml .= "       <param name=\"sip-port\" value=\"" . $sp_value['sip_port'] . "\"/>\n";    
137
-	foreach($settings as $set_key => $set_val)
135
+	$xml .= "       <param name=\"sip-ip\" value=\"".$sp_value['sip_ip']."\"/>\n";
136
+	$xml .= "       <param name=\"sip-port\" value=\"".$sp_value['sip_port']."\"/>\n";    
137
+	foreach ($settings as $set_key => $set_val)
138 138
 	{
139
-			$xml .= "       <param name=\"" . $set_key . "\" value=\"" . $set_val . "\"/>\n";
139
+			$xml .= "       <param name=\"".$set_key."\" value=\"".$set_val."\"/>\n";
140 140
 	}
141 141
 		$xml .= "   </settings>\n";
142 142
 	
143 143
 
144 144
 		//Gateway block start 
145 145
 		$xml .= "   <gateways>\n";
146
-		$query = "SELECT * FROM gateways WHERE sip_profile_id=" . $sp_value['id'] . " AND status=0";
147
-		$logger->log("Sofia Gateway Query : " . $query);
146
+		$query = "SELECT * FROM gateways WHERE sip_profile_id=".$sp_value['id']." AND status=0";
147
+		$logger->log("Sofia Gateway Query : ".$query);
148 148
 		$sp_gw = $db->run($query);
149 149
 		$logger->log($sp_gw);
150 150
 		foreach ($sp_gw as $sp_gw_key => $sp_gw_value) {
151
-			$xml .= "       <gateway name=\"" . $sp_gw_value['name'] . "\">\n";
151
+			$xml .= "       <gateway name=\"".$sp_gw_value['name']."\">\n";
152 152
 
153 153
 
154 154
 
155
-		$sp_gw_settings  = json_decode($sp_gw_value['gateway_data'], true);
155
+		$sp_gw_settings = json_decode($sp_gw_value['gateway_data'], true);
156 156
 			foreach ($sp_gw_settings as $sp_gw_settings_key => $sp_gw_settings_value) {
157 157
 				if ($sp_gw_settings_value != "")
158
-					$xml .= "           <param name=\"" . $sp_gw_settings_key . "\" value=\"" . $sp_gw_settings_value . "\"/>\n";
158
+					$xml .= "           <param name=\"".$sp_gw_settings_key."\" value=\"".$sp_gw_settings_value."\"/>\n";
159 159
 			}
160 160
 			$xml .= "       </gateway>\n";
161 161
 		}
@@ -177,9 +177,9 @@  discard block
 block discarded – undo
177 177
 function load_directory($logger, $db) {
178 178
 	$xml = "";
179 179
 
180
-	$query = "SELECT username,dir_params,dir_vars,number as accountcode,accountid FROM sip_devices,accounts WHERE accounts.status=0 AND accounts.deleted=0 AND accounts.id=sip_devices.accountid AND username='" . $_REQUEST['user']."' limit 1";
180
+	$query = "SELECT username,dir_params,dir_vars,number as accountcode,accountid FROM sip_devices,accounts WHERE accounts.status=0 AND accounts.deleted=0 AND accounts.id=sip_devices.accountid AND username='".$_REQUEST['user']."' limit 1";
181 181
 	
182
-	$logger->log("Directory Query : " . $query);
182
+	$logger->log("Directory Query : ".$query);
183 183
 	$res_dir = $db->run($query);
184 184
 	$logger->log($res_dir);
185 185
 
@@ -187,21 +187,21 @@  discard block
 block discarded – undo
187 187
 		$xml = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n";
188 188
 		$xml .= "<document type=\"freeswitch/xml\">\n";
189 189
 		$xml .= "   <section name=\"Directory\" description=\"Directory\">\n";
190
-		$xml .= "       <domain name=\"" . $_REQUEST['domain'] . "\" alias=\"true\">\n";
191
-		$xml .= "           <user id=\"" . $_REQUEST['user'] . "\">\n";
190
+		$xml .= "       <domain name=\"".$_REQUEST['domain']."\" alias=\"true\">\n";
191
+		$xml .= "           <user id=\"".$_REQUEST['user']."\">\n";
192 192
 
193 193
 	$params = json_decode($res_dir_value['dir_params'], true);
194 194
 
195 195
 	$vars   = json_decode($res_dir_value['dir_vars'], true);
196 196
 	$param_xml = $var_xml = "";
197
-	foreach($params as $parms_key => $res_dir_params)
197
+	foreach ($params as $parms_key => $res_dir_params)
198 198
 	{	
199
-						$param_xml .= "<param name=\"" . $parms_key . "\" value=\"" . $res_dir_params . "\"/>\n";
199
+						$param_xml .= "<param name=\"".$parms_key."\" value=\"".$res_dir_params."\"/>\n";
200 200
 	}
201 201
 
202
-	foreach($vars as $var_key => $res_dir_vars)
202
+	foreach ($vars as $var_key => $res_dir_vars)
203 203
 	{	
204
-						$var_xml .= "<variable name=\"" . $var_key . "\" value=\"" . $res_dir_vars . "\"/>\n";
204
+						$var_xml .= "<variable name=\"".$var_key."\" value=\"".$res_dir_vars."\"/>\n";
205 205
 	}		
206 206
 
207 207
 
@@ -214,8 +214,8 @@  discard block
 block discarded – undo
214 214
 		$xml .= "               <variables>\n";
215 215
 		$xml .= $var_xml;
216 216
 		$xml .= "<variable name=\"sipcall\" value=\"true\"/>\n";
217
-		$xml .= "<variable name=\"accountcode\" value=\"" . $res_dir_value['accountcode'] . "\"/>\n";
218
-		$xml .= "<variable name=\"domain_name\" value=\"" . $_REQUEST['domain'] . "\"/>\n";
217
+		$xml .= "<variable name=\"accountcode\" value=\"".$res_dir_value['accountcode']."\"/>\n";
218
+		$xml .= "<variable name=\"domain_name\" value=\"".$_REQUEST['domain']."\"/>\n";
219 219
 		$xml .= "               </variables>\n";
220 220
 
221 221
 		$xml .= "           </user>\n";
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -154,8 +154,9 @@
 block discarded – undo
154 154
 
155 155
 		$sp_gw_settings  = json_decode($sp_gw_value['gateway_data'], true);
156 156
 			foreach ($sp_gw_settings as $sp_gw_settings_key => $sp_gw_settings_value) {
157
-				if ($sp_gw_settings_value != "")
158
-					$xml .= "           <param name=\"" . $sp_gw_settings_key . "\" value=\"" . $sp_gw_settings_value . "\"/>\n";
157
+				if ($sp_gw_settings_value != "") {
158
+									$xml .= "           <param name=\"" . $sp_gw_settings_key . "\" value=\"" . $sp_gw_settings_value . "\"/>\n";
159
+				}
159 160
 			}
160 161
 			$xml .= "       </gateway>\n";
161 162
 		}
Please login to merge, or discard this patch.
freeswitch/fs/lib/astpp.logger.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -30,15 +30,15 @@
 block discarded – undo
30 30
 		$this->config = $lib->config;
31 31
 		$this->config['log_path'] = "/var/log/astpp/";
32 32
 		if ($this->config['debug'] == '0')
33
-			$this->fp = fopen($this->config['log_path'] . 'astpp_' . date('Y-m-d') . '.txt', 'a');
33
+			$this->fp = fopen($this->config['log_path'].'astpp_'.date('Y-m-d').'.txt', 'a');
34 34
 	}
35 35
 
36 36
 	function log($log) {
37 37
 		if ($this->config['debug'] == '0') {
38 38
 			if (is_array($log))
39
-				fwrite($this->fp, "[" . date('Y-m-d H:i:s') . "] " . print_r($log, TRUE));
39
+				fwrite($this->fp, "[".date('Y-m-d H:i:s')."] ".print_r($log, TRUE));
40 40
 			else
41
-				fwrite($this->fp, "[" . date('Y-m-d H:i:s') . "] " . $log . "\n");
41
+				fwrite($this->fp, "[".date('Y-m-d H:i:s')."] ".$log."\n");
42 42
 		}
43 43
 	}
44 44
 
Please login to merge, or discard this patch.
Braces   +11 added lines, -8 removed lines patch added patch discarded remove patch
@@ -29,22 +29,25 @@
 block discarded – undo
29 29
 	function logger($lib) {
30 30
 		$this->config = $lib->config;
31 31
 		$this->config['log_path'] = "/var/log/astpp/";
32
-		if ($this->config['debug'] == '0')
33
-			$this->fp = fopen($this->config['log_path'] . 'astpp_' . date('Y-m-d') . '.txt', 'a');
32
+		if ($this->config['debug'] == '0') {
33
+					$this->fp = fopen($this->config['log_path'] . 'astpp_' . date('Y-m-d') . '.txt', 'a');
34
+		}
34 35
 	}
35 36
 
36 37
 	function log($log) {
37 38
 		if ($this->config['debug'] == '0') {
38
-			if (is_array($log))
39
-				fwrite($this->fp, "[" . date('Y-m-d H:i:s') . "] " . print_r($log, TRUE));
40
-			else
41
-				fwrite($this->fp, "[" . date('Y-m-d H:i:s') . "] " . $log . "\n");
39
+			if (is_array($log)) {
40
+							fwrite($this->fp, "[" . date('Y-m-d H:i:s') . "] " . print_r($log, TRUE));
41
+			} else {
42
+							fwrite($this->fp, "[" . date('Y-m-d H:i:s') . "] " . $log . "\n");
43
+			}
42 44
 		}
43 45
 	}
44 46
 
45 47
 	function close() {
46
-		if ($this->config['debug'] == '0')
47
-			fclose($this->fp);
48
+		if ($this->config['debug'] == '0') {
49
+					fclose($this->fp);
50
+		}
48 51
 	}
49 52
 
50 53
 }
Please login to merge, or discard this patch.
freeswitch/fs/scripts/astpp.directory.php 1 patch
Braces   +4 added lines, -3 removed lines patch added patch discarded remove patch
@@ -28,10 +28,11 @@
 block discarded – undo
28 28
 
29 29
 if (isset($_REQUEST['user']) && isset($_REQUEST['domain'])) {
30 30
 	$xml = load_directory($logger, $db);
31
-	if ($xml == "")
32
-		xml_not_found();
31
+	if ($xml == "") {
32
+			xml_not_found();
33
+	}
33 34
 	echo $xml;
34
-}else {
35
+} else {
35 36
 	xml_not_found();
36 37
 }
37 38
 $logger->log("*************************** Directory Ends **********************************");
Please login to merge, or discard this patch.
freeswitch/fs/scripts/astpp.configuration.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@
 block discarded – undo
29 29
 	header('Content-Type: text/xml');
30 30
 	echo $xml;
31 31
 } elseif ($_REQUEST['key_value'] == 'acl.conf') {
32
-	$xml = load_acl($logger, $db,$config);
32
+	$xml = load_acl($logger, $db, $config);
33 33
 	header('Content-Type: text/xml');
34 34
 	echo $xml;
35 35
 } else {
Please login to merge, or discard this patch.
freeswitch/fs/cdr.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
 	{
29 29
 		case 'development':
30 30
 //			error_reporting(E_ALL);
31
-			error_reporting(E_ERROR|E_WARNING|E_PARSE);
31
+			error_reporting(E_ERROR | E_WARNING | E_PARSE);
32 32
 		break;
33 33
 	
34 34
 		case 'testing':
@@ -55,18 +55,18 @@  discard block
 block discarded – undo
55 55
 $config = $lib->get_configurations($db);
56 56
 
57 57
 //Set default decimal points 
58
-$decimal_points = ($config['decimal_points'] <= 0)?4:$config['decimal_points'];
58
+$decimal_points = ($config['decimal_points'] <= 0) ? 4 : $config['decimal_points'];
59 59
 
60 60
 //Define logger object
61 61
 $logger = new logger($lib);
62 62
 
63
-if(isset($_SERVER["CONTENT_TYPE"]) && $_SERVER["CONTENT_TYPE"] == "application/json") {
63
+if (isset($_SERVER["CONTENT_TYPE"]) && $_SERVER["CONTENT_TYPE"] == "application/json") {
64 64
 
65 65
 	$db->run("SET NAMES utf8");
66
-	$data = json_decode(file_get_contents("php://input"),true);
66
+	$data = json_decode(file_get_contents("php://input"), true);
67 67
 	//error_log(print_r($data,true));
68
-	$logger->log(print_r($data,true));
69
-	process_cdr($data,$db,$logger,$decimal_points);
68
+	$logger->log(print_r($data, true));
69
+	process_cdr($data, $db, $logger, $decimal_points);
70 70
 }
71 71
 
72 72
 //$db->cleanup();
Please login to merge, or discard this patch.