Ricardo Carvalho
2007-Sep-21 16:07 UTC
[asterisk-users] Authenticate() application and CDR
Dear all, I'm trying to configure Asterisk to be able to ask the caller to enter a given password in order to continue dialplan execution. I've tested this feature using the Authenticate application like this: exten => _X./5219,1,Answer exten => _X./5219,2,Authenticate(1234,a) exten => _X./5219,3,Playback(pin-number-accepted) exten => _X./5219,4,Dial(SIP/${EXTEN},120) Works great, although there is a problem with the CDR: Asterisk accounts only the call that is answered by Asterisk which asks for the pin. Case the call hasn't been answered by the called party, or case it even hasn't been dialed because the caller failed to insert the pin, or even if it has been answered, Asterisk writes in CDR table that it has been ANSWERED and billed from the time Asterisk picked up to ask the pin. I'm I skipping something in my syntax, or is this some kind of BUG? (I'm using Asterisk version 1.2.17) Regards, ---------------------------------------------- Ricardo Carvalho ITEC / IRICUP / Reitoria UP tel: +351220408108 (Ext: 5219) e-mail/sip: rjcarvalho[at]reit.up.pt ----------------------------------------------
On Friday 21 September 2007 19:07:43 Ricardo Carvalho wrote:> Works great, although there is a problem with the CDR: Asterisk accounts > only the call that is answered by Asterisk which asks for the pin. Case > the call hasn't been answered by the called party, or case it even > hasn't been dialed because the caller failed to insert the pin, or even > if it has been answered, Asterisk writes in CDR table that it has been > ANSWERED and billed from the time Asterisk picked up to ask the pin. > I'm I skipping something in my syntax, or is this some kind of BUG? (I'm > using Asterisk version 1.2.17)Nop, your dialplan is correct, and this is not a bug. Answer() in first line marks incoming call answered, so counter (also from your provider) is on, and you can't turn it off. Of course, Answer() is required, so that asterisk can start receiving voice, and DTMF to authenticate. If you would want to do your own billing, to count only duration of call dialed to SIP/whatever, you can do 1,Answer() 2,Authenticate() 3,Playback() 4,ResetCDR() 5,Dial() NoCDR would tell to not write CDR for that channel, but ResetCDR later would reset answer status for CDR, and start counting duration from that moment. ResetCDR(w) would make you have two CDR records, one for each part (that can be linked together by using uniqueid). Regards, Atis -- Atis Lezdins VoIP Developer, IQ Labs Inc. atis at iq-labs.net Skype: atis.lezdins Cell Phone: +371 28806004 Work phone: +1 800 7502835