[Asterisk-Users] Billing inbound calls per minute

bbench at mail.bg bbench at mail.bg
Sat Feb 11 05:11:30 MST 2006


> >>>On 00:30, Mon 06 Feb 06, bbench at mail.bg wrote:
> >>>>I've been playing with astcc, but while
> >>>>'billseconds' stays empty, 'billcost' has
> >>>>strange behavior - either stays ampty
> >>>>or takes ONCE the "Connect fee"(if I put one)
> >>>>and keeps it that way no matter how long
> >>>>the call is ...( if no "Connect fee" -stays empty).
> >>>>i.e.
> >>>>[inbound]
> >>>>exten => 1122334455,1,Set(CALLERID(number)=${EXTEN})
> >>>>exten => 1122334455,2,DeadAGI(astcc.agi,${CALLERIDNUM},${EXTEN},4)
> >>>>exten => 1122334455,3,Hangup
> >>>
> >>Michiel van Baak wrote:
> >>>DeadAGI is for hungup channels, not for active channels.
> >>>That might be a problem.
> >>>
> >>>Try this:
> >>>exten => h,1,DeadAGI(astcc.agi,${CALLERIDNUM},${EXTEN},4)
> >>
> >>On Monday 06 February 2006 09:25, JP Carballo wrote:
> >>ASTCC works fine here. The duration and billseconds fields in my cdrs as
> >>well as ASTCC's cdr are filled.
> >>I don't use the connect fee field though and all are set to 0.
> >
> >Would you share with me how'd you do billing on a DID
> >(if you do), and through what Technology?
> >Anything that goes Local here is ANSWEREDTIME zero.

>On Saturday 11 February 2006 06:32, Darren Wiebe wrote:
> Are you running a relatively recent version of ASTCC?  Say within the
> last 6 months.  The answeredtime = 0 bug was supposed to have been fixed
> by http://bugs.digium.com/view.php?id=4300  Unless something has changed
> in Asterisk that affects this....

Thanks Daren,
Yes, my version of astcc is the most recent one.
Asterisk-1.2.4
I have found you patch 0004300 from 16 May 2005.
Probably it's time to reverse it back since "something has changed
in Asterisk that affects this..." as you said.
My observation is:
If I keep:
$dialstr = "Local/$phone\@$res->{path}|30|HL/n(" . ($maxtime * 60 * 1000) . 
":60000:30000)";
Either the billseconds is empty(when dial out through Local), either there is 
a<ZOMBIE> when dialing in. 
I put back the dialstring to:
"Local/$phone/$res->{path}|30|HL/n(" . ($maxtime * 60 * 1000) . 
":60000:30000)";
The only difference that it looks only for is a default context.

extensions.conf
[inbound]
; 10 digits DID = _XXXXXXXXXX = cardnumber
; 
exten => _XXXXXXXXXX ,1,Answer()
exten => _XXXXXXXXXX ,n,Set(DB(RCID/${CALLERIDNUM})=${CALLERIDNUM})
exten => _XXXXXXXXXX ,n,Set(realcid=${DB(RCID/${CALLERIDNUM})})
exten => _XXXXXXXXXX ,n,Noop(${REALCID})
;exten => _XXXXXXXXXX ,n,Set(TIMEOUT(digit)=4)
exten => _XXXXXXXXXX ,n,Set(CALLERID(number)=${EXTEN})
exten => _XXXXXXXXXX ,n,Set(CALLERID(name)= ${REALCID})
;exten => t,3,Goto(h|1)
;exten => _XXXXXXXXXX 2,Goto(s|1)
;exten => s,1,Wait,1 ; is this preventing HUP?
exten => h,1,DeadAGI(astcc.agi,${CALLERIDNUM},${CALLERIDNUM},4) 
; must be "h,1" as per Michiel van Baak note(above).
exten => h,2,Hangup
[internal]
; i.e. 360 1234567 = DID = card
exten => 3601234567,1,Macro(stdexten,3601234567,sip/did_owner)
[default]
include => internal
[personal]
exten => t,1,Hangup
include => inbound

Result:
- ANSWEREDTIME is OK
- inbound call billed on the callee
- there is CALLERID(name) for callerid in the cdrs(kind of)
There is still a small but "looong" problem - Timeout about 10 
secs long while the IAX2/incoming Hangup in personal,t,1.
But CDR is updated after that and the call is billed as expected.

Sorry for the long explanation.
What do you think? Is there something "suspicious" in
that solution?
Thanks,
benchev




More information about the asterisk-users mailing list