在asterCC框架内指
在每次asterCC打开坐席工作地址时,首先将会post坐席信息,内容包括:
例如:
<?php
$user_name = $_POST['agentmsg_username'];
$user_password = $_POST['agentmsg_application_code'];
?>
<form action="index.php" method="post" name="DetailView" id="form" onsubmit="return document.getElementById('cant_login').value == ''">
<input type="hidden" name="module" value="Users">
<input type="hidden" name="action" value="Authenticate">
<input type="hidden" name="return_module" value="Users">
<input type="hidden" name="return_action" value="Login">
<input type="hidden" id="cant_login" name="cant_login" value="">
<input type="hidden" name="login_module" value="">
<input type="hidden" name="login_action" value="">
<input type="hidden" name="login_record" value="">
<input type="hidden" id="user_name" name="user_name" value='<?echo $user_name;?>' />
<input type="hidden" id="user_password" name="user_password" value='<?echo $user_password;?>' />
</form>
<center>Login...</center>
<script type="text/javascript">
<!--
document.getElementById('form').submit();
//-->
</script>
该文件将接收用户名和密码并且提交到index.php以完成登录(适用于sugarcrm)
为了接受到asterCC发来的呼叫事件,你需要在业务页面中添加如下javascript代码,其中192.168.1.150为astercc服务器地址
<script type="text/javascript">
function sonAcceptHash(str){
alert(str);
}
</script>
<script type="text/javascript" src="http://192.168.1.150/astercc_hash_event.js"></script>
sonAcceptHash是用来接收和处理呼叫事件的函数,每次有新的事件时,该函数将被调用,事件的具体信息将通过str字符串传递进来
在上面的例子中,当有新的呼叫事件传来时,将会弹出窗口显示事件内容