Synopsis:
Sets account codeDescription:
SetAccount([account])Set the channel account code for billing purposes.
Return codes
Always returns 0.The ACCOUNTCODE variable
The accountcode is available as ${ACCOUNTCODE} from within the dialplan. Therefore you can use for exampleGotoIf($[${ACCOUNTCODE} = 1234]?4:6)
for further processing.
See also
Asterisk | Applications | Functions | Variables | Expressions | Asterisk FAQ
Page Changes
SetAccount has been deprecated
exten => _1NXXNXXXXXX,n,SetAccount(1122)
When dialing out, I get a "Call failed: denied" on the SIP client,
and the following on the asterisk console:
WARNING32574: pbx.c:1779 pbx_extension_helper: No application 'SetAccount' for extension (siplogin, 18002553700, 4)
Do the accounts need to be pre-declared somewhere, or has the SetAccount syntax changed with v1.4.1 ?
Thanks!
SetAccount Example.
I use this for a Bank that needs to back charge for LongDistance calls. The Code is not authenticated, but can be easily. If there is no code, then the default 999 is entered.
macro-account_calls
exten => s,1,DigitTimeout(6)
exten => s,2,ResponseTimeout(10)
exten => s,3,Wait(4)
exten => s,4,Read(accountcode,billing-3digit,3)
exten => s,5,GotoIf($"${accountcode}" = ""?macro-account_calls,s,10) ;Jump to set account at 999 if nothing entered
exten => s,6,SetAccount(${accountcode})
exten => s,7,Goto(s,12) ;if accountcode is not empty jump to end.
exten => s,10,SetAccount(999)
exten => s,12,NoOp(AccountCode=${accountcode} DialOut=${ARG1})
exten => s,13,Wait(2)
exten => s,13,Playback(pls-wait-connect-call)
exten => s,14,Macro(dialout,${ARG1})
See also: Authenticate()
Example: Authenticate(1234|a)