Ok,
I sincerely do not know why or how I did that, but it works now.
cdr_mysql.conf
[global]
hostname=localhost
dbname=asteriskdb
password=*
user=asteriskdb
table=cdr
;port=3306
However I now have different problem… When I use Manager access and do this from PHP:
/*=========== Asterisk Manager Access Code BGN ===========*/
$oSocket = fsockopen('127.0.0.1', 5038) or die("Connection to host failed");
fwrite($oSocket, "Action: Login\n");
fwrite($oSocket, "Username: someuser\n");
fwrite($oSocket, "Secret: somepass\n");
fwrite($oSocket, "Events: on\n");
fwrite($oSocket, "EventMask: on\n\n");
fwrite($oSocket, "Action: Originate\n");
if(preg_match("/[A-Za-z]+/",$_POST['nr1'][0])==1) fwrite($oSocket, "Channel: SIP/".$_POST['nr1']."\n");
else fwrite($oSocket, "Channel: SIP/".$_POST['nr1']."@operator1\n");
fwrite($oSocket, "CallerId: ".$_POST['nr1']."\n");
fwrite($oSocket, "Exten: ".$_POST['nr2']."\n");
fwrite($oSocket, "Context: something\n");
fwrite($oSocket, "Priority: 1\n\n");
fputs($oSocket, "Action: Logoff\n\n");
fclose($oSocket);
It works, connection is established with no problem… but in CDR I can see connectrion from one number (nr1) to the other (nr2), but I cannot determine which customer placed that call… So I did that (Set(CDR… ) in extensions.conf:
[something]
exten => _0[1-9]X.,1,Dial(SIP/operator1/0048${EXTEN:1},45,grtT)
exten => _0[1-9]X.,2,Hangup
exten => _[1-9]X.,1,Dial(SIP/operator1/0048${EXTEN},45,grtT)
exten => _[1-9]X.,2,Set(CDR(determine)=${CHANNEL(from)})
exten => _[1-9]X.,3,Hangup
exten => _00X.,1,Dial(SIP/operator1/${EXTEN},45,grtT)
exten => _00X.,3,Hangup
exten => _[a-z].,1,Dial(SIP/${EXTEN},45,grtT)
exten => _[a-z].,2,Hangup
exten => n,h,Set(CDR(determine)=${CHANNEL(from)})
but still no result. Anyone?