Account CODE for Incoming Calls via DID

Hello All…

Can someone help me do a modification to the PHP Code in FreePBX that generates the following Context: “EXT-DID” found in extensions_additional.conf

I need to be able to Assign DID’s an Account Code for CDR Billing

I have experimented makeing the changes manually…

EXISTING CODE GENERATED BY FREE PBX

exten => 800XXX1234,1,Set(FROM_DID=800XXX1234)
exten => 800XXX1234,n,Gosub(app-blacklist-check,s,1)
exten => 800XXX1234,n,Set(FAX_RX=disabled)
exten => 800XXX1234,n,Goto(ext-local,1000,1)

NEW CODE I WOULD LIKE FREEPBX TO GENERATE

exten => 800XXX1234,1,Set(FROM_DID=800XXX1234)
exten => 800XXX1234,n,Gosub(app-blacklist-check,s,1)
exten => 800XXX1234,n,Set(FAX_RX=disabled)
exten => 800XXX1234,n,Set(CDR(accountcode)=WhatEverISet)
exten => 800XXX1234,n,Goto(ext-local,1000,1)

There is a page called: page.did.php

If we can ADD and INPUT Field like the example below to LINE# 199… At this point I am stuck because I do not know PHP well… Now need this info to be STORED in the Database

	<tr>
		<td><a href="#" class="info"><?php echo _("Alert Info")?><span><?php echo _('DID Account Code.')?></span></a>:</td>
		<td><input type="text" name="didacctcode" size="10" value="<?php echo ($alertinfo)?$alertinfo:'' ?>"></td>
	</tr>

Anyone Can HELP

PLEASE PLEASE PLEASE

feel free to put this up as a feature request on trac, you’ll have a lot fewer headaches maintaining it over time if it becomes part of the main release. Also, you code is problematic to begin with (you are reusing variables). And the code to manage the database storage and dialplan generation needs to all be written which is elsewhere.

If you have a more urgent need and want to contract with us to get it added to your system and into the main code base sooner, you can pm me and we could make arrangements.

Otherwise, if you want to try finishing with it yourself, you’ll have to take a look at all the code in funcions.inc.php as well as extend the database schema to deal with this new information.