How to dial a outbound call using Campaign ID from MYSQL


I have Created Asterisk Server


Asterisk 1.4.30
Dahdi Linux Complete
CentOS 5
Softphone -Xlite

What I have done here is :

  1. Developed Asterisk server. I have two server. One for Asterisk and another for MYSQL
  2. created 10 Agents. Agents are login using **1 that i have created dialplan to login the agents
  3. I have Two Campaigns.

I want to assign 5 agents in each CAMPAIGNS.

I have uploaded my customer details in my MYSQL server.
In my MYSQL server database i have assigned CAMPAIGN ID to know the each CAMPAIGNS.

For EX:


campaign Name Campaign ID


I have 10 Agents

AGENTS/1000 to…AGENT/1009

I want to add 5 agents for each


Campaign A Campaign B

Agent/1000 Agent/1005
Agent/1001 Agent/1006
Agent/1002 Agent/1007
Agent/1003 Agent/1008
Agent/1004 Agnet/1009

Once the agents logged in,
Agents will hear some music.
I have created a web application. There is one button to get that information from MYSQL. Once i click that ‘get numbers’ BUTTON on that application, it’ll automatically take that number from MYSQL database. dialing through asterisk. i have created a user in ‘manager.conf’ to connect that asterisk with application. Without campaign itz working. everything is Ok.

With out Campaign ID i have assigned context on my application. one i try to dial itz going through that Context. Itz working fine. everything is perfect.

If i want to dial using CAMPAIGN ID then.
what i have to do is instead of that context on my manager application code, i have given campaign ID.
So, Some one told me that i have to write a dial plan to fetch the campaign ID from MYSQL database and to create a two QUEUES for two campaign as well as assign 5 agents in each Queues.

So any one any IDEA about to write dialplan using MYSQL?


Database: cdr_call_center
username: root
password: password
campaign ID table name is: cust_campaign_details

Thanks & regards