Accountcode field - where is it used?

Bill, thank you so much for bringing up this idea!

So simple and can do so much.

For example, I just did an extension to extension block/allow based on the account code.

Basically, with COS you can control everything besides calls between extension to extension. We managed in the past to block extension to extension calls based on the Caller ID etc. But now we can have the PBX administrator simply add the account code to each extension, and only extensions with matching account codes can call each other.

[macro-dialout-one-predial-hook]
exten => s,1,noop(Entereing custom context to block/allow ext to ext calls based on the account code)
exten => s,n,Set(CALLER_ACCOUNTCODE=${DB(AMPUSER/${AMPUSER}/accountcode)})
exten => s,n,ExecIf($["${CALLER_ACCOUNTCODE}" = "${CALLEE_ACCOUNCODE}"]?MacroExit:Goto(app-blackhole,zapateller,1))
exten => s,n,Hangup

This dialplan can probably be brushed up a little, but it works…

4 Likes