Post data when agent save in campaign page

In campaign popup page, when agent finish a call, he needs to save the call log.

asterCC supports to post data in this page to a URL so you can integrate with your system.

Enable "Submit post" feature

Login as admin, go to Campaign → Campaigns

Open the campaign you want to edit, find “Submit Post” option under “Advanced” tab

When it's blank, means this feature is disabled.

Put a URL such as http://192.168.2.88/api/message or http://www.astercc.org/msg.php to enable it.

How to receive post data from asterCC

when agent submit a success customer, astercc will send data to a url via jquery ajax

$.ajax({
  type: 'POST', 
  url : your post url,
  dataType: 'json',
  data: data(e.g.: a=1&b=2&c=3&...)
});

Data format

Data sent by the composition of two parts, this contact record + customer data.

campaignId: campaign id

customerId: customer id

callresult: call result (set by agent)

memo: call log (set by agent)

status: customer status (set by agent, including: open, pending, errorclosed, sucessclosed)

workorder_template_id: id of the work order template

workorder_id: id of the work order

diallogid: identity string of the call

curusephone: customer phone number

quick_schedual: quick schedule value if status is pending, (no_appointment,xh x hours later, xw x weeks later, xd x days later, xm x minutes later)

dialschedule: scheduled time if status is pending and callback appointment is set, format is YYYY-MM-DD HH:MM, so callback time = dialschedule + quick_schedual

dialerpriority: priority,the greater number it is, the higher priority it has

agent_group_id: agent group id of the agent

the following are customer information, it only send displayed fields of the campaign, the key is database column name, such as

customername

individualname

gender

age

birthdate

phone1

phone2

fax1

email

address1

country

memo

flag

A sample to receive the data

First your web server need to accept post request cross-domain.

The you can process the data you received

Finally, you need to return a json string (such as: {code: 1, msg: “xxxx”}), if you don't do this, agent might see an error in their browser

sample code in nodejs

var express = require('express.io');
var app = express();

//allow cross domain request
app.use(function (req, res, next) {
    res.setHeader('Access-Control-Allow-Origin', '*');
    res.setHeader('Access-Control-Allow-Methods', 'GET, POST, OPTIONS, PUT, PATCH, DELETE');
    res.setHeader('Access-Control-Allow-Headers', 'X-Requested-With,Authorization,content-type,Content-Length');
    res.setHeader('Access-Control-Allow-Credentials', true);
    next();
});

app.post('/api/xxvxx', function(req, res, next) {
    console.log(req.body);//print data we received
    // sample data you are suppose to read from console
    /*
campaignId:1
customerId:2
callresult: callback later
memo: customer is busy, he's interested I will callback later
status:pending
workorder_template_id:0
workorder_id:0
diallogid:
curusephone:
quick_schedual:3h
dialschedule:2015-02-11 10:17
dialerpriority:5
curCalling:no
curSendSMSnum:0
customername:Astercc
agent_group_id:1
curCallStatus:
individualname:Astercc
gender:male
age:8
birthdate:2007-02-11
phone1:1234567890
phone2:
fax1:
email:
address1:
country:
memo:
flag:    
    */

    //send 200 response
    res.status(200).send({"code": 1, "msg": "success"});
});

app.listen(3000, function(){
    console.log('Server listening on port 3000');
});

en/custom_development_guide/how_to_post_customer_and_call_information_to_specific_url_in_campaign_model.txt · Last modified: 2015/03/27 14:20 by solo
Recent changes RSS feed Debian Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki