Click 2 call billing issue

Hello,

I have successfully deployed a click-to-call functionality using PHP and Manager access with Originate command.

There is, however, one thing that makes me confused - when I make normal calls, Asterisk sends cdr details to mysql db with no problem at all. However, with Manager access and Originate Command in Mysql I get empty lines, but in Master.csv everything is ok - it shows billing line.

What could I have possibly done wrong?

I apologize for bumping this topic, but I still did not solve it. Anyone?

if you use outgoing functionality of asterisk (dropping files into /var/spool/asterisk/outgoing), then it’s a WAD. see: voip-info.org/wiki/view/Aste … o-dial+out towards the end

you need to go through a local channel for CDR to be generated.

J.

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? :smile: