For call detail reporting purposes, I needed a way to add an account code to incoming calls. Setting the account code to the DID number was the simplest and made the most sense to me. It would be nice for freepbx to do this automatically when adding an extension (see the attached patch file for /var/www/html/admin/modules/core/functions.inc.php) or to have the ability to specify an account code on the inbound routes page similar to extensions.
Thanks,
Kris
--- functions.inc.php.orig 2008-02-25 10:29:14.000000000 -0600
+++ functions.inc.php 2008-02-25 10:29:35.000000000 -0600
@@ -741,6 +741,7 @@
$context = "ext-did";
$ext->add($context, $exten, '', new ext_setvar('__FROM_DID','${EXTEN}'));
+ $ext->add($context, $exten, '', new ext_setvar('CDR(accountcode)','${EXTEN}'));
// always set callerID name
$ext->add($context, $exten, '', new ext_gotoif('$[ "${CALLERID(name)}" != "" ] ','cidok'));
$ext->add($context, $exten, '', new ext_setvar('CALLERID(name)','${CALLERID(num)}')