[Asterisk-Users] CDR query

Alex Brett alex.brett at loho.co.uk
Sat Apr 15 11:58:38 MST 2006


I'm using a macro such that if a call is forwarded to my mobile, I can 
choose to accept it or not. This is done with the following Dial command:

Dial(IAX2/voiptalk/44${ARG1:1},15,trM(screen)ow)

and the following macro:

[macro-screen] ; Allow called user to accept/reject the call

exten => s,1,Wait(0.2)
exten => s,2,Read(Accept|loho-support-choose|1)
exten => s,3,GotoIf($[a${Accept} = a1]?6:4) ; 1 = accept, anything else 
  = reject
exten => s,4,Set(MACRO_RESULT=ABORT)
exten => s,5,Playback(connection-timed-out)
exten => s,6,NoOp()


The problem I have, is that the 'billsec' field in the CDR records, only 
starts ticking if I accept the call, so it isn't including the time that 
I have answered the call on my mobile, but not actually accepted the 
call, which means if I reject the call or whatever, then it doesn't log 
the fact that I have actually spent money making a PSTN phone call...

What I guess I'm looking for is some sort of command to put into my 
macro to start the 'billsec' counting, does anybody know if such a thing 
exists, or if there is some other way of getting round this problem?

(I could just use the 'duration' field, but this would include time 
where it was merely ringing and I'm not actually being charged etc).

Thanks in advance,
Alex Brett
alex.brett at loho.co.uk
http://www.loho.co.uk/




More information about the asterisk-users mailing list