Call switching based on reference number

Hi,

I have the below requirement and need to confirm if this is possible through degium switchvox or any other asterisk device.

I will advertise some four digit reference number with my products for example 1100. When customer call our phone line PBX should advise the user to enter the reference number to contact the agent directly.

I will maintain a database of direct contact numbers of my agents against the reference number. Once the user enter the four digit reference the digium device should fetch the corrosponding phone number and connect the agent. This call also has to be recorded for the quality purpose.

My table will be like below
Index | Reference | Telephone
1 | 0011 | 011111111
2 | 0012 | 022222222
3 | 1000 | 011111111
4 | 1500 | 011111111
5 | 1900 | 033333333
6 | 0065 | 022222222

I can use two telephone connection one to get the customer’s call and the other to contact the agent built the connection.

Could anyone advise me a way to achieve this?

Thanks in advance!

It is easy on pure Asterisk. This is not the place to ask about Switchvox. Read the database chapter of Asterisk the Definitive Guide, earlier versions of which are available online.