I'm running asterisk2billing v1.2.3 on PostgreSQL-8.1
I noticed that (in case of Unknown and non-numeric Caller-ID) the query is somewhat like
INSERT .... (...src...) values (...,Unknown,...)
as src field is "text" it should be included within single quotes, so I suggest the following patch (after appliyng that patch everything is Ok with Unknown Caller-IDs):
available also at
http://voip-trade.net/patch1.txt
--- trunk/A2Billing_AGI/libs_a2billing/Class.A2Billing.php.orig 2006-12-03 12:48:46.000000000 +0000
+++ trunk/A2Billing_AGI/libs_a2billing/Class.A2Billing.php 2006-12-03 12:50:01.000000000 +0000
@@ -937,7 +937,7 @@
$QUERY .= " CURRENT_TIMESTAMP - INTERVAL $answeredtime SECOND ";
}
$QUERY .= ", '$answeredtime', '".$inst_listdestination[4]."', '$dialstatus', now(), '0', '0', ".
- " '".$this->countrycode."', '".$this->subcode."', 'DID CALL', '0', '0', '0', '0', $this->CallerID, '3' )";
+ " '".$this->countrycode."', '".$this->subcode."', 'DID CALL', '0', '0', '0', '0', '$this->CallerID', '3' )";
if ($this->agiconfig['debug']>=1) $agi->verbose('line:'.__LINE__.' - '.$QUERY);
$this -> write_log("[DID CALL - LOG CC_CALL: SQL: $QUERY]");
$result = $this -> instance_table -> SQLExec ($this->DBHandle, $QUERY, 0);