Re: [asterisk-users] Inaccurate CDRs

2006-10-21 Thread Philipp Ott

Hello!

Am 18.10.2006 um 09:39 schrieb Dumpolid Exeplish:


I have found the problem.
Before calls leave our network, thee user must supply a pin. this  
is a for of call accounting that we implemented. To do this, we had  
used AMP's Authenticate () function. This function actually and  
always answers the channel first before accepting pin entries. This  
was why there is always an answered flag on the channel. and since  
the channel is answered as soon as the call is made, there is no  
difference between the duration and the billsec.



Once the pin is verified issue a ResetCDR (http://www.voip-info.org/ 
wiki-Asterisk+cmd+ResetCDR) command. This would nullify the time the  
user spent entering the pin code and make them pay less. Still they  
would pay if the call never connects on the target, since it is  
already connected inbound. You could also try ForkCDR and take a look  
if the 2nd CDR has billsecs if it doenst connect to the target, then  
you would able to filter these calls out as well and dont charge the  
customer for a non-target-connecting call.


Regards
___
--Bandwidth and Colocation provided by Easynews.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
  http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] Inaccurate CDRs

2006-10-19 Thread Dumpolid Exeplish
This is an update on the issues of CDR inaccuracies, i hope this will help someone in need. 
In order to remove the Authenticate() function and still be able to perform call accounting and authentication, we pass the authetication process through an AGI. the reason beig that the Authenticate() application always awnsers the channel first before authentication. This will cause irregularities in terms of billing since the user will have to pay for both the 'authentication' time and the call processing time. My authentication Macros calls this perl script to enable authentication without awnsering the channel.




#!/usr/bin/perl
use Asterisk::AGI;open (PIN1,'/etc/asterisk/pinset_1');open (PIN2,'/etc/asterisk/pinset_2');open (PIN3,'/etc/asterisk/pinset_3');$|=1;$AGI = new Asterisk::AGI;
exit if $#ARGV 0;chomp($dbid=$ARGV[0]);#$AGI-exec(NoOp,$dbid) ;%input = $AGI-ReadParse();$try = '0';$filename = 'agent-pass';while($try  3) { $pin = $AGI-get_data($filename,2000);
 if (!defined $pin) {$try++;$filename = 'auth-incorrect';next;} if (length($pin)!=4) {$try++;$filename = 'auth-incorrect';next;} $status=check_pin($pin); 
 if ($status =='1'){ $AGI-exec(NoOp,$pin); $AGI-stream_file('auth-thankyou'); #$AGI-exec('Playback','auth-thankyou','noanswer');
 $AGI-exec('SetAccount',$pin); exit (0); } else { $try++; $filename = 'auth-incorrect'; #$AGI-exec('Playback','') next;
 }}$AGI-exec('Playback','vm-goodbye');$AGI-exec('Wait','1');$AGI-hangup();exit (0);

sub check_pin{ my $pin=$_[0]; my $file='PIN'.$dbid; seek ($file,0,0); while ($file){ if (/$pin/) {return '1';} } return '0';
}

you have to install the Asterisk::AGI module for thi script to work. i used the authentication macros from AMP (FreePBX) to pug in this agi. 
Every trunk thatrequiers authentication calls this macros. The macros is as follows..



[macro-pinsets]include = macro-pinsets-customexten = s,1,GotoIf(${ARG2} = 1?cdr,1)exten = cdr,1,AGI(auth.agi|${ARG1})
; end of [macro-pinsets]

i hope this will be of use to someone
On 10/18/06, Dumpolid Exeplish [EMAIL PROTECTED] wrote:

I have found the problem. 
Before calls leave our network, thee user must supply a pin. this is a for of call accounting that we implemented. To do this, we had used AMP's Authenticate () function. This function actually and always answers the channel first before accepting pin entries. This was why there is always an answered flag on the channel. and since the channel is answered as soon as the call is made, there is no difference between the duration and the billsec. Now my problem is how do i implement an authentication AGI that uses DTMF ? i would be posting this question in another thread 


Thanks for your help

On 10/17/06, Dumpolid Exeplish [EMAIL PROTECTED]
 wrote: 

this Cdr Record if from the Primary PBX

'2006-10-17 07:11:37', 'Admin', 'XXX, 'aa', 'from-internal', 'IAX2/[EMAIL PROTECTED]' 
, 'Zap/1-1', 'ResetCDR', 'w', 10, 0, 'BUSY', 3, '', '', ''



this is the CDR record from the secondsry for the same call


'2006-10-17 13:31:57', 'Admin X', 'X', 'aa', 'from-internal', 'SIP/401-8f0c', 'IAX2/TRUNK1-2', 'Dial', 'IAX2/TRUNK1/aaa|120', 15, 15, 'ANSWERED', 3, '4147', '', ''

in this setup, the caller dropped the call after allowing it to ring for 15 seconds






On 10/17/06, Dumpolid Exeplish [EMAIL PROTECTED] 
 wrote: 

Well I am using APM on the two boxes i have modified the srripts extensievely and i am sure that there is no Awnser befor a dial when Dialing through the PBX trunks



On 10/17/06, Steve Davies [EMAIL PROTECTED] 
 wrote: 
On 10/17/06, Dumpolid Exeplish 
 [EMAIL PROTECTED] wrote: Hello, i have call time irregularites in my asterisk CDR. I a currently using a mysqly backent to save CDR records and use this to generate bills at the end of each month. However, my users are complaining that they gety charged for 
 even uncompleted calls ( i.e. calls they make whaich have already be setup but canclled). i have noticed that only 'AWNSERED' and 'Busy' show up in my call disposition colume. I have also noticed that both the call duration and 
 the billsec are always equal. here is my setup below PSTN va E1 (Primary Asterisk) =Sip and IAX trunks  (Secondary PBX) 
 Clients are connected to the Secondary PBX. this pbx handles registration of all clents. The billing irregularities happen on the Secondary PBX. When a call is maked from the Secondary and it is routed across the trunks, call 
 disposition always registeres 'AWNSERED', unless the Primary PBX sends back a busy signal. the duration and billsecs are always equla. this means that the user gets billed for ring time, and calls disconnected from the 
 Secondary PBXCould you provide a snippet of the dialplan used on each of theprimary and secondary boxes to complete a call?For example, is the primary executing an Answer() before it does the 
onward Dial() on behalf of the secondary?Cheers,Steve___--Bandwidth and 

Re: [asterisk-users] Inaccurate CDRs

2006-10-18 Thread Dumpolid Exeplish
I have found the problem. 
Before calls leave our network, thee user must supply a pin. this is a for of call accounting that we implemented. To do this, we had used AMP's Authenticate () function. This function actually and always answers the channel first before accepting pin entries. This was why there is always an answered flag on the channel. and since the channel is answered as soon as the call is made, there is no difference between the duration and the billsec. Now my problem is how do i implement an authentication AGI that uses DTMF ? i would be posting this question in another thread


Thanks for your help
On 10/17/06, Dumpolid Exeplish [EMAIL PROTECTED] wrote:

this Cdr Record if from the Primary PBX

'2006-10-17 07:11:37', 'Admin', 'XXX, 'aa', 'from-internal', 'IAX2/[EMAIL PROTECTED]'
, 'Zap/1-1', 'ResetCDR', 'w', 10, 0, 'BUSY', 3, '', '', ''



this is the CDR record from the secondsry for the same call


'2006-10-17 13:31:57', 'Admin X', 'X', 'aa', 'from-internal', 'SIP/401-8f0c', 'IAX2/TRUNK1-2', 'Dial', 'IAX2/TRUNK1/aaa|120', 15, 15, 'ANSWERED', 3, '4147', '', ''

in this setup, the caller dropped the call after allowing it to ring for 15 seconds






On 10/17/06, Dumpolid Exeplish [EMAIL PROTECTED]
 wrote: 

Well I am using APM on the two boxes i have modified the srripts extensievely and i am sure that there is no Awnser befor a dial when Dialing through the PBX trunks



On 10/17/06, Steve Davies [EMAIL PROTECTED] 
 wrote: 
On 10/17/06, Dumpolid Exeplish 
 [EMAIL PROTECTED] wrote: Hello, i have call time irregularites in my asterisk CDR. I a currently using a mysqly backent to save CDR records and use this to generate bills at the end of each month. However, my users are complaining that they gety charged for 
 even uncompleted calls ( i.e. calls they make whaich have already be setup but canclled). i have noticed that only 'AWNSERED' and 'Busy' show up in my call disposition colume. I have also noticed that both the call duration and 
 the billsec are always equal. here is my setup below PSTN va E1 (Primary Asterisk) =Sip and IAX trunks  (Secondary PBX) 
 Clients are connected to the Secondary PBX. this pbx handles registration of all clents. The billing irregularities happen on the Secondary PBX. When a call is maked from the Secondary and it is routed across the trunks, call 
 disposition always registeres 'AWNSERED', unless the Primary PBX sends back a busy signal. the duration and billsecs are always equla. this means that the user gets billed for ring time, and calls disconnected from the 
 Secondary PBXCould you provide a snippet of the dialplan used on each of theprimary and secondary boxes to complete a call?For example, is the primary executing an Answer() before it does the 
onward Dial() on behalf of the secondary?Cheers,Steve___--Bandwidth and Colocation provided by 
Easynews.com --asterisk-users mailing list To UNSUBSCRIBE or update options visit:
 http://lists.digium.com/mailman/listinfo/asterisk-users
___
--Bandwidth and Colocation provided by Easynews.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


[asterisk-users] Inaccurate CDRs

2006-10-17 Thread Dumpolid Exeplish
Hello,
i have call time irregularites in my asterisk CDR. I a currently using a mysqly backent to save CDR records and use this to generate bills at the end of each month. However, my users are complaining that they gety charged for even uncompleted calls (
i.e. calls they make whaich have already be setup but canclled). i have noticed that only 'AWNSERED' and 'Busy' show up in my call disposition colume. I have also noticed that both the call duration and the billsec are always equal. here is my setup below


PSTN va E1  (Primary Asterisk) =Sip and IAX trunks  (Secondary PBX)

Clients are connected to the Secondary PBX. this pbx handles registration of all clents. The billing irregularities happen on the Secondary PBX. When a call is maked from the Secondary and it is routed across the trunks,call dispositionalways registeres 'AWNSERED', unless the Primary PBX sends back a busy signal. the duration and billsecs are always equla. this means that the user gets billed for ring time, and calls disconnected from the Secondary PBX



Can someone help me out here ? 

Thanks
___
--Bandwidth and Colocation provided by Easynews.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] Inaccurate CDRs

2006-10-17 Thread yusuf

Dumpolid Exeplish wrote:

Hello,
i have call time irregularites in my asterisk CDR. I a currently using a 
mysqly backent to save CDR records and use this to generate bills at the 
end of each month. However, my users are complaining that they gety 
charged for even uncompleted calls ( i.e. calls they make whaich have 
already be setup but canclled). i have noticed that only 'AWNSERED' and 
'Busy' show up in my call disposition colume. I have also noticed that 
both the call duration and the billsec are always equal. here is my 
setup below
 
PSTN va E1   (Primary Asterisk) =Sip and IAX trunks 
 (Secondary PBX)
 
Clients are connected to the Secondary PBX. this pbx handles 
registration of all clents. The billing irregularities happen on the 
Secondary PBX. When a call is maked from the Secondary and it is routed 
across the trunks, call disposition always registeres 'AWNSERED', unless 
the Primary PBX sends back a busy signal. the duration and billsecs are 
always equla. this means that the user gets billed for ring time, and 
calls disconnected from the Secondary PBX
 
 
Can someone help me out here ?
 


Hi,

I have not had this particular problem, but I had it where my billsec were wrong for some other 
reason.  Try callprogress=yes in zapata.conf, although I dont even think this will help, but you can 
try.



--
thanks,
yusuf

--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

___
--Bandwidth and Colocation provided by Easynews.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
  http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] Inaccurate CDRs

2006-10-17 Thread Steve Davies

On 10/17/06, Dumpolid Exeplish [EMAIL PROTECTED] wrote:

Hello,
i have call time irregularites in my asterisk CDR. I a currently using a
mysqly backent to save CDR records and use this to generate bills at the end
of each month. However, my users are complaining that they gety charged for
even uncompleted calls ( i.e. calls they make whaich have already be setup
but canclled). i have noticed that only 'AWNSERED' and 'Busy' show up in my
call disposition colume. I have also noticed that both the call duration and
the billsec are always equal. here is my setup below

PSTN va E1   (Primary Asterisk) =Sip and IAX trunks
 (Secondary PBX)

Clients are connected to the Secondary PBX. this pbx handles registration of
all clents. The billing irregularities happen on the Secondary PBX. When a
call is maked from the Secondary and it is routed across the trunks, call
disposition always registeres 'AWNSERED', unless the Primary PBX sends back
a busy signal. the duration and billsecs are always equla. this means that
the user gets billed for ring time, and calls disconnected from the
Secondary PBX



Could you provide a snippet of the dialplan used on each of the
primary and secondary boxes to complete a call?

For example, is the primary executing an Answer() before it does the
onward Dial() on behalf of the secondary?

Cheers,
Steve
___
--Bandwidth and Colocation provided by Easynews.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
  http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] Inaccurate CDRs

2006-10-17 Thread Dumpolid Exeplish
thanks for your response yusuf, but the problem is actually on the secondary PBX. The CDR beign generated by the Primary (i.e. the asterisk box that carries the E1s) is very accurate. The reason i can use this CDR for bill is because it does not containg user extensions and account codes.


Thanks
On 10/17/06, yusuf [EMAIL PROTECTED] wrote:
Dumpolid Exeplish wrote: Hello, i have call time irregularites in my asterisk CDR. I a currently using a
 mysqly backent to save CDR records and use this to generate bills at the end of each month. However, my users are complaining that they gety charged for even uncompleted calls ( i.e. calls they make whaich have
 already be setup but canclled). i have noticed that only 'AWNSERED' and 'Busy' show up in my call disposition colume. I have also noticed that both the call duration and the billsec are always equal. here is my
 setup below PSTN va E1 (Primary Asterisk) =Sip and IAX trunks  (Secondary PBX) Clients are connected to the Secondary PBX. this pbx handles
 registration of all clents. The billing irregularities happen on the Secondary PBX. When a call is maked from the Secondary and it is routed across the trunks, call disposition always registeres 'AWNSERED', unless
 the Primary PBX sends back a busy signal. the duration and billsecs are always equla. this means that the user gets billed for ring time, and calls disconnected from the Secondary PBX
 Can someone help me out here ?Hi,I have not had this particular problem, but I had it where my billsec were wrong for some otherreason.Try callprogress=yes in zapata.conf, although I dont even think this will help, but you can
try.--thanks,yusuf--This message has been scanned for viruses anddangerous content by MailScanner, and isbelieved to be clean.___
--Bandwidth and Colocation provided by Easynews.com --asterisk-users mailing listTo UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users
___
--Bandwidth and Colocation provided by Easynews.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] Inaccurate CDRs

2006-10-17 Thread Dumpolid Exeplish
Well I am using APM on the two boxes i have modified the srripts extensievely and i am sure that there is no Awnser befor a dial when Dialing through the PBX trunks


On 10/17/06, Steve Davies [EMAIL PROTECTED] wrote:
On 10/17/06, Dumpolid Exeplish [EMAIL PROTECTED] wrote:
 Hello, i have call time irregularites in my asterisk CDR. I a currently using a mysqly backent to save CDR records and use this to generate bills at the end of each month. However, my users are complaining that they gety charged for
 even uncompleted calls ( i.e. calls they make whaich have already be setup but canclled). i have noticed that only 'AWNSERED' and 'Busy' show up in my call disposition colume. I have also noticed that both the call duration and
 the billsec are always equal. here is my setup below PSTN va E1 (Primary Asterisk) =Sip and IAX trunks  (Secondary PBX)
 Clients are connected to the Secondary PBX. this pbx handles registration of all clents. The billing irregularities happen on the Secondary PBX. When a call is maked from the Secondary and it is routed across the trunks, call
 disposition always registeres 'AWNSERED', unless the Primary PBX sends back a busy signal. the duration and billsecs are always equla. this means that the user gets billed for ring time, and calls disconnected from the
 Secondary PBXCould you provide a snippet of the dialplan used on each of theprimary and secondary boxes to complete a call?For example, is the primary executing an Answer() before it does the
onward Dial() on behalf of the secondary?Cheers,Steve___--Bandwidth and Colocation provided by Easynews.com --asterisk-users mailing list
To UNSUBSCRIBE or update options visit:http://lists.digium.com/mailman/listinfo/asterisk-users
___
--Bandwidth and Colocation provided by Easynews.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] Inaccurate CDRs

2006-10-17 Thread Dumpolid Exeplish
this Cdr Record if from the Primary PBX

'2006-10-17 07:11:37', 'Admin', 'XXX, 'aa', 'from-internal', 'IAX2/[EMAIL PROTECTED]', 'Zap/1-1', 'ResetCDR', 'w', 10, 0, 'BUSY', 3, '', '', ''




this is the CDR record from the secondsry for the same call


'2006-10-17 13:31:57', 'Admin X', 'X', 'aa', 'from-internal', 'SIP/401-8f0c', 'IAX2/TRUNK1-2', 'Dial', 'IAX2/TRUNK1/aaa|120', 15, 15, 'ANSWERED', 3, '4147', '', ''

in this setup, the caller dropped the call after allowing it to ring for 15 seconds





On 10/17/06, Dumpolid Exeplish [EMAIL PROTECTED] wrote:

Well I am using APM on the two boxes i have modified the srripts extensievely and i am sure that there is no Awnser befor a dial when Dialing through the PBX trunks



On 10/17/06, Steve Davies [EMAIL PROTECTED]
 wrote: 
On 10/17/06, Dumpolid Exeplish 
[EMAIL PROTECTED] wrote: Hello, i have call time irregularites in my asterisk CDR. I a currently using a mysqly backent to save CDR records and use this to generate bills at the end of each month. However, my users are complaining that they gety charged for 
 even uncompleted calls ( i.e. calls they make whaich have already be setup but canclled). i have noticed that only 'AWNSERED' and 'Busy' show up in my call disposition colume. I have also noticed that both the call duration and 
 the billsec are always equal. here is my setup below PSTN va E1 (Primary Asterisk) =Sip and IAX trunks  (Secondary PBX) 
 Clients are connected to the Secondary PBX. this pbx handles registration of all clents. The billing irregularities happen on the Secondary PBX. When a call is maked from the Secondary and it is routed across the trunks, call 
 disposition always registeres 'AWNSERED', unless the Primary PBX sends back a busy signal. the duration and billsecs are always equla. this means that the user gets billed for ring time, and calls disconnected from the 
 Secondary PBXCould you provide a snippet of the dialplan used on each of theprimary and secondary boxes to complete a call?For example, is the primary executing an Answer() before it does the 
onward Dial() on behalf of the secondary?Cheers,Steve___--Bandwidth and Colocation provided by 
Easynews.com --asterisk-users mailing list To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users
___
--Bandwidth and Colocation provided by Easynews.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users