diff --git a/INSTALL.md b/INSTALL.md
index afe9ebc..25b4e34 100644
--- a/INSTALL.md
+++ b/INSTALL.md
@@ -1,8 +1,8 @@
 #platform
 
 ##å»ºè®®çŽ¯å¢ƒ
-1. linuxå†…æ ¸æ“�ä½œç³»ç»Ÿï¼Œå»ºè®®å†…æ ¸ç‰ˆæœ¬> 2.6.9
-2. gcc 3.4 ç¼–è¯‘å·¥å…·é“¾ 
+1. linuxå†…æ ¸æ“�ä½œç³»ç»Ÿï¼Œå»ºè®®å†…æ ¸ç‰ˆæœ¬> 2.6.9ï¼Œ 64bit
+2. gcc 3.4/4.8 ç¼–è¯‘å·¥å…·é“¾ 
 
 ##ä¾�èµ–é¡¹
 1. [FreeSWITCH](http://files.freeswitch.org/freeswitch-1.0.6.tar.gz)
@@ -13,6 +13,7 @@
 6. [mysql](http://downloads.mysql.com/archives/get/file/mysql-5.0.51b.tar.gz)
 7. [pcre](http://sourceforge.net/projects/pcre/files/pcre/7.7/pcre-7.7.tar.gz/download)
 8. [libcurl](http://curl.haxx.se/download/curl-7.21.0.tar.gz)
+9. [openssl](http://www.openssl.org)
 
 
 ##ç¼–è¯‘
@@ -27,4 +28,5 @@
 
 
 ##ç¼–è¯‘
-1. å�„å·¥ç¨‹ç›®å½•çš„vcprjæˆ–slnæ–‡ä»¶æ‰“å¼€ç¼–è¯‘å�³å�¯
\ No newline at end of file
+1. å�„å·¥ç¨‹ç›®å½•çš„vcxprojæˆ–slnæ–‡ä»¶æ‰“å¼€ç¼–è¯‘å�³å�¯
+2. ä¹Ÿå�¯ä»¥ä½¿ç”¨å�„è‡ªçš„build.batè„šæœ¬è¿›è¡Œç¼–è¯‘
diff --git a/README.md b/README.md
index ed9e3bb..6282e7b 100644
--- a/README.md
+++ b/README.md
@@ -2,6 +2,11 @@
 
 ç™¾åº¦å¼€å�‘çš„ä¸€å¥—åŸºäºŽäº’è�”ç½‘åº”ç”¨æ¨¡å¼�çš„å‘¼å�«ä¸­å¿ƒå¥—ä»¶ï¼Œé‡‡ç”¨é¢ è¦†å¼�çš„æŠ€æœ¯æ¨¡å¼�ï¼Œæ— éœ€ä»»ä½•ä¸“æœ‰ç¡¬ä»¶è®¾å¤‡ï¼Œä»¥é€šç”¨æœ�åŠ¡å™¨+è½¯ä»¶çš„æ¨¡å¼�ï¼Œä¾�é� äº‘è®¡ç®—ç­‰æŠ€æœ¯ï¼Œå®Œæˆ�è¯­éŸ³çš„äº¤æ�¢å’Œå‘¼å�«çš„æŽ§åˆ¶ï¼Œåœ¨å¤§å¹…é™�ä½Žå‘¼å�«ä¸­å¿ƒå»ºè®¾æˆ�æœ¬çš„å�Œæ—¶ï¼Œä»�ç„¶å…·æœ‰æ— æ³•æ¯”æ‹Ÿçš„é«˜å�¯é� æ€§ã€‚
 
+#è�”ç³»æ–¹å¼� 	
+
+1. [**åœ¨çº¿å’¨è¯¢**](http://p.qiao.baidu.com//im/index?siteid=5677496&ucid=7880242) 	
+2. QQç¾¤ï¼š **83412519**
+
 #å¹³å�°ç‰¹æ€§
 1. è¯­éŸ³é€šä¿¡é�µå¾ªSIPå��è®®ï¼ŒåŸºäºŽ[FreeSWITCH](http://www.freeswitch.org)è¿›è¡Œè¯­éŸ³æŽ¥å…¥
 2. å‘¼å�«æŽ§åˆ¶é�µå¾ªCSTAIIå��è®®
@@ -13,7 +18,7 @@
 
 #è½¯ä»¶å®žçŽ°
 1. ACD. å��å¸­ç™»é™†å’Œè·¯ç”±æœ�åŠ¡ï¼Œæ��ä¾›æŽ§ä»¶çº§ã€�æŽ¥å�£çº§äºŒæ¬¡å¼€å�‘åŒ…
-2. AP. å��å¸­æŽ¥å…¥ä»£ç�†ï¼Œä¸ºACDåˆ†æ‹…åŽ‹åŠ›
+2. AgentProxy. å��å¸­æŽ¥å…¥ä»£ç�†ï¼Œä¸ºACDåˆ†æ‹…åŽ‹åŠ›
 2. IMS. ç»Ÿä¸€å‘¼å�«æ¨¡åž‹ç»´æŠ¤
 3. IVR. è‡ªåŠ©è¯­éŸ³äº¤äº’å¹³å�°ï¼Œæ��ä¾›å�¯è§†åŒ–å®šåˆ¶IDE
 4. RECORD. æŒ‰éœ€/è‡ªåŠ¨è¿›è¡Œåˆ†å¸ƒå¼�é€šè¯�å½•éŸ³
@@ -71,5 +76,8 @@
 #ç¼–è¯‘&&å®‰è£…
 1. [How To INSTALL](./INSTALL.md)
 
+#é…�ç½®è¯´æ˜Ž
+1. [è®¿é—®wiki](https://github.com/Baidu-ecom/CC/wiki)
+
 #License
 1. [Apache 2.0](./LICENSE)
diff --git a/build.sh b/build.sh
index 2af266f..2801d8e 100644
--- a/build.sh
+++ b/build.sh
@@ -41,13 +41,28 @@ build()
     # 2. interface
     # 3. platform
 
-    cd ${DEP_BASE} && bash build.sh && cd ..
+    ret=0
+    cd ${DEP_BASE} && bash build.sh; ret=$? && cd ..
+
+    if [ $ret != 0 ]; then
+        exit $ret;
+    fi
+    
+    cd ${ROOT_DIR} && make clean -C ${INC_BASE}; make -C ${INC_BASE}; ret=$?
     
-    cd ${ROOT_DIR} && make -C ${INC_BASE}
+    if [ $ret != 0 ]; then
+        exit $ret;
+    fi
     
     for d in ${PLAT_SVR}; do
+        make clean -C ${PLAT_BASE}/$d;
         make -C ${PLAT_BASE}/$d;
 
+	    if [ $? != 0 ]; then
+	    	echo "build $d FAILED! EXIT!"
+	    	exit ;
+	    fi
+	
         if [ ! -d ${RELEASE_BASE}/$d ]; then 
             mkdir -p ${RELEASE_BASE}/$d; 
         fi
@@ -58,8 +73,13 @@ build()
     if [ ! -d ${RELEASE_BASE}/freeswitch ]; then 
         mkdir -p ${RELEASE_BASE}/freeswitch; 
     fi
+    
+    if [ ! -d ${RELEASE_BASE}/opensips ]; then 
+        mkdir -p ${RELEASE_BASE}/opensips; 
+    fi
 
     cp -r ${DEP_BASE}/freeswitch/output/*  ${RELEASE_BASE}/freeswitch/
+    cp -r ${DEP_BASE}/opensips/output/*  ${RELEASE_BASE}/opensips/
 }
     
 case "$1" in
diff --git a/dep/bgcc/build.sh b/dep/bgcc/build.sh
index d66993f..fa5b73e 100644
--- a/dep/bgcc/build.sh
+++ b/dep/bgcc/build.sh
@@ -14,19 +14,23 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-SRCTAR=v2.2.4.tar.gz
+SRCTAR=v2.2.7.tar.gz
 
-if [ ! -f ${SRCTAR} ]; then
-    curl --location-trusted -k -O https://github.com/BaiduCC/BGCC/archive/v2.2.4.tar.gz
+
+if [ -f ${SRCTAR} -a -f "output/include/bgcc.h" -a -f "output/include/openssl/ssl.h" -a -f "output/lib/libbgcc.a" -a -f "output/lib/libssl.a" ]; then
+    exit 0;
 fi
 
 if [ ! -f ${SRCTAR} ]; then
+    curl --connect-timeout 10 --location-trusted -k -O https://github.com/BaiduCC/BGCC/archive/${SRCTAR}
+fi
+
+if [ $? != 0 -o ! -f ${SRCTAR} ]; then
     echo "can't find ${SRCTAR}, build failed";
     exit 1;
 fi
 
-tar xzf ${SRCTAR}
+tar xzf ${SRCTAR} && make -C BGCC-2.2.7 && cp -r BGCC-2.2.7/output ./ && exit 0
 
-make -C BGCC-2.2.4
 
-cp -r BGCC-2.2.4/output ./
+exit 1
diff --git a/dep/boost/build.sh b/dep/boost/build.sh
index 75e5293..e4fb353 100644
--- a/dep/boost/build.sh
+++ b/dep/boost/build.sh
@@ -14,8 +14,12 @@
 
 SRCTAR=boost_1_56_0.tar.gz
 
+if [ -f "output/include/boost/config.hpp" -a -f "output/lib/libboost_system.a" ]; then
+    exit 0;
+fi
+
 if [ ! -f ${SRCTAR} ]; then
-    wget http://sourceforge.net/projects/boost/files/boost/1.56.0/boost_1_56_0.tar.gz/download;
+    wget http://sourceforge.net/projects/boost/files/boost/1.56.0/boost_1_56_0.tar.gz;
 fi
 
 if [ ! -f ${SRCTAR} ]; then
diff --git a/dep/build.sh b/dep/build.sh
index 1a2020e..360bcb6 100644
--- a/dep/build.sh
+++ b/dep/build.sh
@@ -1,5 +1,4 @@
-#!/bin/bash
-
+#!/bin/bash 
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # You may obtain a copy of the License at
@@ -12,18 +11,27 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+DIR="bgcc boost freeswitch json-c libcurl libxml2 mysql pcre opensips"
+
 build()
 {
-    for d in `dir`; do
+    for d in ${DIR}; do
         if [ -d $d ]; then
-            cd $d && if [ -f build.sh ]; then bash build.sh; else python build.py; fi && cd ..;
+	    ret=0;
+            cd $d && if [ -f build.sh ]; then bash build.sh; ret=$?;  else python build.py; ret=$?; fi && cd ..;
+	    if [ $ret == 0 ]; then
+	    	echo "BUILD $d SUCCESS!";
+            else
+		echo "BUILD $d FAILED!";
+		exit $ret;
+	    fi
         fi
     done
 }
 
 clean()
 {
-    for d in `dir`; do
+    for d in ${DIR}; do
         if [ -d $d ]; then
             rm -fr $d/$d*;
             rm -fr $d/output;
diff --git a/dep/freeswitch/build.sh b/dep/freeswitch/build.sh
index f6509ad..52f5f91 100644
--- a/dep/freeswitch/build.sh
+++ b/dep/freeswitch/build.sh
@@ -21,6 +21,10 @@ ROOT=`pwd`
 PREFIX=$ROOT/output
 VOICE_DIR=$ROOT/voice
 
+if [ -f "output/libs/esl/include/esl.h" -a -f "output/libs/esl/libesl.a" ]; then
+    exit 0;
+fi
+
 echo "prepare build..."
 
 if [ -z "$DIST_VERSION" ]; then
@@ -81,8 +85,14 @@ fi
 
 echo "begin to build..."
 
+sed -i '14764,14782s/^/#&/g' configure
 CFLAGS="-fPIC" CXXFLAGS="-fPIC" ./configure --prefix=$PREFIX
 
+if [ $? != 0 ] ; then
+	echo "./configure FAILED! EXIT!";
+	exit 1;
+fi
+
 echo "begin compiling libedit library..."
 make -C libs/libedit/ 
 echo "end compiling libedit library..."
@@ -92,6 +102,7 @@ make -C libs/curl/
 echo "end compiling curl library..."
 
 echo "begin compiling esl library..."
+sed -i 's/-Werror//g' libs/esl/Makefile
 make -C libs/esl/ 
 echo "end compiling esl library..."
 
@@ -105,11 +116,11 @@ fi
 
 if [ -d "$PREFIX/conf" ]; then
     cp ../../../platform/fw-mod/record/mod_ccl_record/conf/ccl_record.conf.xml $PREFIX/conf/autoload_configs/
-    cp ../../../platform/fw-mod/ivrloadbalance/ivr_loadbalance.conf $PREFIX/conf/autoload_configs/
+    mkdir -p $PREFIX/conf/ivr_loadbalance
+    cp ../../../platform/fw-mod/ivrloadbalance/ivr_loadbalance.conf $PREFIX/conf/ivr_loadbalance/
     cp $ROOT/patch/autoload_configs/event_socket.conf.xml $PREFIX/conf/autoload_configs/
     cp $ROOT/patch/autoload_configs/logfile.conf.xml $PREFIX/conf/autoload_configs/
-
-    mv $PREFIX/conf $PREFIX/conf.old
+    cp $ROOT/patch/sip_profiles/agent.xml $PREFIX/conf/sip_profiles/
     mkdir -p $PREFIX/conf-new/autoload_configs
     cp $ROOT/patch/autoload_configs/modules.conf.xml $PREFIX/conf-new/autoload_configs/
 fi
diff --git a/dep/freeswitch/patch/sip_profiles/agent.xml b/dep/freeswitch/patch/sip_profiles/agent.xml
new file mode 100644
index 0000000..3e21199
--- /dev/null
+++ b/dep/freeswitch/patch/sip_profiles/agent.xml
@@ -0,0 +1,11 @@
+ <!--<param name="aggressive-nat-detection" value="true"/>-->                    
+ <param name="inbound-codec-negotiation" value="generous"/>                      
+ <param name="nonce-ttl" value="60"/>                                            
+ <param name="auth-calls" value="false"/>                                        
+ <!--DO NOT USE HOSTNAMES, ONLY IP ADDRESSES IN THESE SETTINGS! -->                                                                                              
+ <param name="rtp-ip" value="127.0.0.1"/>
+ <param name="sip-ip" value="127.0.0.1"/>
+ <param name="ext-rtp-ip" value="auto-nat"/>                                     
+ <param name="ext-sip-ip" value="auto-nat"/>                                     
+ <param name="rtp-timeout-sec" value="3600"/>
+
diff --git a/dep/json-c/build.sh b/dep/json-c/build.sh
index 600e730..93f463b 100755
--- a/dep/json-c/build.sh
+++ b/dep/json-c/build.sh
@@ -16,6 +16,10 @@
 
 SRCTAR=json-c-0.10-20120530.tar.gz
 
+if [ -f "output/include/json/json.h" -a -f "output/lib/libjson.a" ]; then
+    exit 0;
+fi
+
 if [ ! -f ${SRCTAR} ]; then
     curl --location-trusted -k -O https://github.com/json-c/json-c/archive/${SRCTAR}
 fi
diff --git a/dep/libcurl/build.sh b/dep/libcurl/build.sh
index 22d0247..febe850 100755
--- a/dep/libcurl/build.sh
+++ b/dep/libcurl/build.sh
@@ -16,6 +16,10 @@
 
 SRCTAR=curl-7.21.0.tar.gz
 
+if [ -f "output/include/curl/curl.h" -a -f "output/lib/libcurl.a" ]; then
+    exit 0;
+fi
+
 if [ ! -f ${SRCTAR} ]; then
     wget http://curl.haxx.se/download/${SRCTAR}
 fi
@@ -52,7 +56,7 @@ cd $DIRNAME
 
 
 chmod +x configure;
-CONFIG="./configure --prefix=$INSTALL --enable-shared=no --enable-static=yes --with-pic=yes"
+CONFIG="./configure --prefix=$INSTALL --enable-shared=no --enable-static=yes --with-pic=yes --without-libidn"
 CPPFLAGS="-fPIC" $CONFIG
 make && make install
 
diff --git a/dep/libxml2/build.sh b/dep/libxml2/build.sh
index 5c37517..cb9c708 100755
--- a/dep/libxml2/build.sh
+++ b/dep/libxml2/build.sh
@@ -18,8 +18,16 @@
 #libxml2µÄÔ´Âëtar°üÎÄ¼þÃû
 SRCTAR=libxml2-2.6.30.tar.gz
 
+if [ -f "output/include/libxml.h" -a -f "output/lib/libxml2.a" ]; then
+    exit 0;
+fi
+
 if [ ! -f ${SRCTAR} ]; then
-    wget http://xmlsoft.org/sources/old/libxml2-2.6.30.tar.gz
+    wget --tries=3 -T 10 http://xmlsoft.org/sources/old/libxml2-2.6.30.tar.gz
+    if [ $? != 0 ]; then
+        echo "download libxml2 FAILED! EXIT!";
+        exit;
+    fi
 fi
 
 if [ ! -f ${SRCTAR} ]; then
@@ -41,6 +49,12 @@ cd $SRC
 #ÉèÖÃconfigure²ÎÊý
 #°²×°µ½$INSTALL, ¿ÉÒÔÔÚÕâºóÃæ¼ÌÐøÌí¼ÓÆäËû±àÒë²ÎÊý, 
 ./configure --prefix=$INSTALL --with-pic=yes --with-threads=yes
+
+if [ $? != 0 ]; then
+    echo "configure FAILED! EXIT!";
+    exit;
+fi
+
 #±àÒë²¢°²×°
 make; make install
 
diff --git a/dep/mysql/build.sh b/dep/mysql/build.sh
index dee0c28..00c642d 100644
--- a/dep/mysql/build.sh
+++ b/dep/mysql/build.sh
@@ -18,6 +18,10 @@
 #mysqlµÄÔ´Âëtar°üÎÄ¼þÃû
 MYSQL_SRCTAR=mysql-5.0.51b.tar.gz
 
+if [ -f "output/include/mysql.h" -a -f "output/lib/libmysqlclient.a" ]; then
+    exit 0;
+fi
+
 if [ ! -f ${MYSQL_SRCTAR} ]; then
     wget http://downloads.mysql.com/archives/get/file/mysql-5.0.51b.tar.gz
 fi
@@ -43,6 +47,12 @@ cd $MYSQL_SRC
 #ÉèÖÃconfigure²ÎÊý
 #°²×°µ½$MYSQL_INSTALL, ¿ÉÒÔÔÚÕâºóÃæ¼ÌÐøÌí¼ÓÆäËû±àÒë²ÎÊý, 
 CFLAGS=-fPIC ./configure --prefix=$MYSQL_INSTALL --with-charset=gbk --with--enable-local-infile --with-extra-charset=all --enable-thread-safe-client
+
+if [ $? != 0 ]; then
+    echo "configure FAILED! EXIT!";
+    exit 1;
+fi
+
 #±àÒë²¢°²×°
 make; make install
 
diff --git a/dep/opensips/build.sh b/dep/opensips/build.sh
new file mode 100755
index 0000000..f2738e2
--- /dev/null
+++ b/dep/opensips/build.sh
@@ -0,0 +1,95 @@
+#!/bin/bash
+
+# Copyright 2002-2014 the original author or authors.
+
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      CC/LICENSE
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+DIST_VERSION="opensips-1.6.4-2-tls"
+PWD=`pwd`
+PREFIX=$PWD/output
+
+if [ -f "output/opensips-1.6.4-2-tls.tgz" ]; then
+    exit 0;
+fi
+
+file="$DIST_VERSION"_src.tar.gz
+
+
+echo "prepare build..."
+
+echo "$DIST_VERSION"
+
+if [ -z "$DIST_VERSION" ]; then
+    echo "errno: no DIST_VERSION info"
+    exit 1
+fi
+
+DIRNAME=$DIST_VERSION
+if [ -d "$DIRNAME" ]; then  
+    rm -rf $DIRNAME
+fi
+
+if [ -d "$PREFIX" ]; then
+    rm -fr $PREFIX
+fi
+
+if [ ! -f $file ]; then
+    wget http://opensips.org/pub/opensips/1.6.4/src/${file}
+fi
+
+if [ ! -f "$file" ]; then    
+    echo "error: no $file"  
+    exit 1
+fi
+
+echo "tar xzf $file..."
+tar xzf $file
+
+if [ ! -d "$DIRNAME" ]; then  
+    echo "error: no $DIRNAME"   
+    exit 1
+fi
+    
+
+cd $DIRNAME
+patch -p1 < ../patch/db_mysql.patch
+patch -p1 < ../patch/dialplan.patch
+
+echo "begin to build..."
+
+export CROSS_COMPILE=true
+export include_modules="db_mysql dialplan"
+make prefix=$PREFIX all 
+export include_modules="db_mysql dialplan"
+make prefix=$PREFIX install 
+
+if [ ! -f "$PREFIX/sbin/opensips" ]; then
+    echo "error: no opensips"
+    exit 1
+fi
+
+cp $PREFIX/../opensips.sh $PREFIX/
+
+cd $PREFIX
+tar cvzf $DIST_VERSION.tgz *
+find -type d -maxdepth 1 | grep "\./" | xargs rm -fr
+rm -f opensips.sh
+
+if [ ! -f "$PREFIX/$DIST_VERSION.tgz" ]; then
+    echo "error: no $PREFIX/$DIST_VERSION.tgz"
+    exit 1
+fi
+
+echo "build binary done success"
+
+exit 0;
diff --git a/dep/opensips/opensips.sh b/dep/opensips/opensips.sh
new file mode 100755
index 0000000..593b3d5
--- /dev/null
+++ b/dep/opensips/opensips.sh
@@ -0,0 +1,66 @@
+#!/bin/bash
+
+# Copyright 2002-2014 the original author or authors.
+
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      CC/LICENSE
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+ROOT_DIR=`pwd`
+
+export PATH=$ROOT_DIR/sbin/:$PATH
+export LD_LIBRARY_PATH=$ROOT_DIR/lib:$LD_LIBRARY_PATH
+NAME=opensips
+DAEMON=$ROOT_DIR/sbin/$NAME
+
+CONF_FILE=$ROOT_DIR/etc/opensips/opensips.cfg
+
+do_start()
+{
+    $DAEMON -f $CONF_FILE -m 4096
+    RETVAL=$?
+    if [ $RETVAL = 0 ]; then
+        echo "success $DAEMON startup"
+    else
+        echo "failure $DAEMON startup"
+    fi
+    
+    return $RETVAL
+}
+
+do_stop()
+{
+    killall $NAME 
+    echo "success $DAEMON stop"
+    return 0
+}
+
+case "$1" in
+    
+    start)
+        do_start
+        ;;
+    stop)
+        do_stop
+        ;;
+    restart)
+        do_stop
+        sleep 1
+        do_start
+        ;;
+    *)
+        echo "Usage: $0 {start|stop}"
+        exit 2
+        ;;
+esac
+
+exit $RETVAL
+
diff --git a/dep/opensips/patch/db_mysql.patch b/dep/opensips/patch/db_mysql.patch
new file mode 100755
index 0000000..2a1ab70
--- /dev/null
+++ b/dep/opensips/patch/db_mysql.patch
@@ -0,0 +1,102 @@
+diff -uNr opensips-1.6.4-2-tls/modules/db_mysql/dbase.c ../opensips-1.6.4-2-tls/modules/db_mysql/dbase.c
+--- opensips-1.6.4-2-tls/modules/db_mysql/dbase.c	2010-12-17 16:08:31.000000000 +0800
++++ ../opensips-1.6.4-2-tls/modules/db_mysql/dbase.c	2011-10-10 17:05:17.000000000 +0800
+@@ -34,10 +34,10 @@
+ 
+ #include <stdio.h>
+ #include <string.h>
+-#include <mysql/mysql.h>
+-#include <mysql/errmsg.h>
+-#include <mysql/mysqld_error.h>
+-#include <mysql/mysql_version.h>
++#include <mysql.h>
++#include <errmsg.h>
++#include <mysqld_error.h>
++#include <mysql_version.h>
+ #include "../../mem/mem.h"
+ #include "../../dprint.h"
+ #include "../../db/db_query.h"
+diff -uNr opensips-1.6.4-2-tls/modules/db_mysql/db_mysql.c ../opensips-1.6.4-2-tls/modules/db_mysql/db_mysql.c
+--- opensips-1.6.4-2-tls/modules/db_mysql/db_mysql.c	2009-10-16 08:37:24.000000000 +0800
++++ ../opensips-1.6.4-2-tls/modules/db_mysql/db_mysql.c	2011-10-10 17:06:31.000000000 +0800
+@@ -34,7 +34,7 @@
+ #include "dbase.h"
+ #include "db_mysql.h"
+ 
+-#include <mysql/mysql.h>
++#include <mysql.h>
+ 
+ unsigned int db_mysql_ping_interval = 5 * 60; /* Default is 5 minutes */
+ unsigned int db_mysql_timeout_interval = 2;   /* Default is 6 seconds */
+diff -uNr opensips-1.6.4-2-tls/modules/db_mysql/Makefile ../opensips-1.6.4-2-tls/modules/db_mysql/Makefile
+--- opensips-1.6.4-2-tls/modules/db_mysql/Makefile	2009-12-11 02:59:19.000000000 +0800
++++ ../opensips-1.6.4-2-tls/modules/db_mysql/Makefile	2011-10-10 17:33:29.000000000 +0800
+@@ -24,18 +24,11 @@
+ 
+ 	# use standard know paths
+ 	# mysql.h locations (freebsd,openbsd  solaris)
+-	DEFS +=-I$(LOCALBASE)/include -I$(LOCALBASE)/include/mysql \
+-		-I$(LOCALBASE)/mysql/include/mysql -I$(LOCALBASE)/mysql/include \
+-		-I$(SYSBASE)/include/mysql
++	DEFS+=-I../../../../mysql/output/include
+ 
+ 	# libmysqlclient locations on RH/Suse, Solaris /OpenBSD, FreeBSD
+ 	# (Debian does the right thing and puts it in /usr/lib)
+-	LIBS=-L$(SYSBASE)/lib/mysql -L$(LOCALBASE)/lib -L$(LOCALBASE)/lib/mysql \
+-		-L$(LOCALBASE)/mysql/lib/mysql/ \
+-		-L$(LOCALBASE)/mysql/lib \
+-		-L$(SYSBASE)/lib64/mysql \
+-		-lm -lmysqlclient -lz
+-
++	LIBS=-L../../../../mysql/output/lib -lm -lmysqlclient -lz
+ endif
+ 
+ include ../../Makefile.modules
+diff -uNr opensips-1.6.4-2-tls/modules/db_mysql/my_con.c ../opensips-1.6.4-2-tls/modules/db_mysql/my_con.c
+--- opensips-1.6.4-2-tls/modules/db_mysql/my_con.c	2009-10-16 08:37:24.000000000 +0800
++++ ../opensips-1.6.4-2-tls/modules/db_mysql/my_con.c	2011-10-10 17:18:06.000000000 +0800
+@@ -24,7 +24,7 @@
+ #include "my_con.h"
+ #include "db_mysql.h"
+ #include "dbase.h"
+-#include <mysql/mysql_version.h>
++#include <mysql_version.h>
+ #include "../../mem/mem.h"
+ #include "../../dprint.h"
+ #include "../../ut.h"
+diff -uNr opensips-1.6.4-2-tls/modules/db_mysql/my_con.h ../opensips-1.6.4-2-tls/modules/db_mysql/my_con.h
+--- opensips-1.6.4-2-tls/modules/db_mysql/my_con.h	2010-01-26 00:07:20.000000000 +0800
++++ ../opensips-1.6.4-2-tls/modules/db_mysql/my_con.h	2011-10-10 17:06:08.000000000 +0800
+@@ -28,7 +28,7 @@
+ #include "../../db/db_id.h"
+ 
+ #include <time.h>
+-#include <mysql/mysql.h>
++#include <mysql.h>
+ 
+ 
+ #define PREP_STMT_VAL_LEN	1024
+diff -uNr opensips-1.6.4-2-tls/modules/db_mysql/res.c ../opensips-1.6.4-2-tls/modules/db_mysql/res.c
+--- opensips-1.6.4-2-tls/modules/db_mysql/res.c	2009-10-16 08:37:24.000000000 +0800
++++ ../opensips-1.6.4-2-tls/modules/db_mysql/res.c	2011-10-10 17:18:23.000000000 +0800
+@@ -25,7 +25,7 @@
+ 
+ 
+ #include <string.h>
+-#include <mysql/mysql.h>
++#include <mysql.h>
+ #include "../../db/db_res.h"
+ #include "../../mem/mem.h"
+ #include "../../dprint.h"
+diff -uNr opensips-1.6.4-2-tls/modules/db_mysql/val.h ../opensips-1.6.4-2-tls/modules/db_mysql/val.h
+--- opensips-1.6.4-2-tls/modules/db_mysql/val.h	2009-10-16 08:37:24.000000000 +0800
++++ ../opensips-1.6.4-2-tls/modules/db_mysql/val.h	2011-10-10 17:05:40.000000000 +0800
+@@ -24,7 +24,7 @@
+ #ifndef VAL_H
+ #define VAL_H
+ 
+-#include <mysql/mysql.h>
++#include <mysql.h>
+ #include "../../db/db_val.h"
+ #include "../../db/db.h"
+ 
diff --git a/dep/opensips/patch/dialplan.patch b/dep/opensips/patch/dialplan.patch
new file mode 100755
index 0000000..7191624
--- /dev/null
+++ b/dep/opensips/patch/dialplan.patch
@@ -0,0 +1,19 @@
+diff -uNr opensips-1.6.4-2-tls/modules/dialplan/Makefile patch/opensips-1.6.4-2-tls/modules/dialplan/Makefile
+--- opensips-1.6.4-2-tls/modules/dialplan/Makefile	2010-12-17 16:26:32.000000000 +0800
++++ patch/opensips-1.6.4-2-tls/modules/dialplan/Makefile	2011-10-11 09:37:39.000000000 +0800
+@@ -21,13 +21,8 @@
+ 	LIBS = $(shell pcre-config --libs)
+ 
+ else
+-
+-	DEFS+=-I$(SYSBASE)/include/pcre -I$(LOCALBASE)/include/pcre \
+-			-I$(LOCALBASE)/include -I/opt/csw/include -I/usr/sfw/include \
+-			-I/usr/local/include
+-	LIBS=-I$(LOCALBASE)/lib -L/opt/csw/lib -L/usr/sfw/lib -L/usr/local/lib \
+-			-lpcre
+-
++	DEFS+=-I../../../../pcre/output/include
++	LIBS=-L../../../../pcre/output/lib -lpcre
+ endif
+ 
+ 
diff --git a/dep/pcre/build.sh b/dep/pcre/build.sh
index 377f2ad..ddd1b1c 100755
--- a/dep/pcre/build.sh
+++ b/dep/pcre/build.sh
@@ -16,12 +16,16 @@
 
 SRCTAR=pcre-7.7.tar.gz
 
-if [ ! -f ${SRCTAR} ]; then
-    wget http://sourceforge.net/projects/pcre/files/pcre/7.7/pcre-7.7.tar.gz/download
+if [ -f "output/include/pcre.h" -a -f "output/lib/libpcre.a" ]; then
+    exit 0;
 fi
 
 if [ ! -f ${SRCTAR} ]; then
-    echo "can't find ${SRCTAR}, build failed";
+    wget http://sourceforge.net/projects/pcre/files/pcre/7.7/pcre-7.7.tar.gz
+fi
+
+if [ $? != 0 -o ! -f ${SRCTAR} ]; then
+    echo "can't find ${SRCTAR} or invalid ${SRCTAR}, build failed";
     exit 1;
 fi
 
@@ -77,3 +81,4 @@ rm -f $PREFIX/lib/*.la
 
 echo "done!"
 
+exit 0
diff --git a/img/inbound.png b/img/inbound.png
new file mode 100755
index 0000000..414674a
Binary files /dev/null and b/img/inbound.png differ
diff --git a/img/outbound.png b/img/outbound.png
new file mode 100755
index 0000000..8b01bf9
Binary files /dev/null and b/img/outbound.png differ
diff --git a/interface/acd/bidl/acd.bidl b/interface/acd/bidl/acd.bidl
index 054e4bf..77bbcb0 100644
--- a/interface/acd/bidl/acd.bidl
+++ b/interface/acd/bidl/acd.bidl
@@ -561,5 +561,16 @@ namespace acd
         // @return  ½Ó¿Úµ÷ÓÃ½á¹û
         //
         AcdResultT ResetConfig(string password);
+
+		    // »ñÈ¡ºô½ÐÊý¾Ý
+		    // @param handle            [in] : Á¬½Ó¾ä±ú
+		    // @param agentId           [in] : ×øÏ¯¹¤ºÅ
+		    // @param type              [in] : Êý¾ÝÀàÐÍ 0£»°´Æ½Ì¨»ñÈ¡£¬ 1£º°´¼¼ÄÜ×é»ñÈ¡  2:»ñÈ¡ËùÓÐ
+	      // @param input             [in] : ÊäÈë£¬°´Æ½Ì¨»ñÈ¡£¬Îª±£Áô×Ö¶Î£¬°´¼¼ÄÜ×é»ñÈ¡£¬Îª¶ÔÓ¦µÄ¼¼ÄÜ×é
+		    // @param result            [out] : ·µ»Ø½á¹û
+		    //
+		    // @return  ½Ó¿Úµ÷ÓÃ½á¹û
+		    //
+		    AcdResultT GetCallInfo(int64 handle, string agentId, int32 type, string input, [out] string result);
     }
 }
diff --git a/interface/ims/bidl/common.bidl b/interface/ims/bidl/common.bidl
index 678f49d..edc4931 100644
--- a/interface/ims/bidl/common.bidl
+++ b/interface/ims/bidl/common.bidl
@@ -284,6 +284,7 @@ namespace ims {
         int32                timeout;            /*³¬Ê±Ê±¼ä*/ 
         string               buffer;             /*±£Áô²ÎÊý*/
         int64                timestamp;          /*ÊÂ¼þÊ±¼ä´Á*/
+        string               targetAgentId;      /*Ä¿±ê×øÏ¯¹¤ºÅ*/
     }
 
     /*ÆäËûÊÂ¼þÀàÐÍ*/
diff --git a/interface/ims/bidl/ims.bidl b/interface/ims/bidl/ims.bidl
index 108b60b..09e273c 100644
--- a/interface/ims/bidl/ims.bidl
+++ b/interface/ims/bidl/ims.bidl
@@ -308,11 +308,12 @@ namespace ims {
 
         /**
          * Â·ÓÉÇëÇó»Ø¸´
-         * @param reqid        [in] : ×¢²áÊ±µÃµ½µÄ·þÎñµ¥ÔªµÄ±êÊ¶
-         *        sessionid    [in] : ºô½ÐµÄsessionid
-         *        requestId    [in] : Â·ÓÉÇëÇóID 
-         *        result       [in] : Â·ÓÉÇëÇó½á¹û
-         *        targetUri    [in] : Â·ÓÉÕÒµ½µÄ·Ö»úºÅÂë 
+         * @param reqid         [in] : ×¢²áÊ±µÃµ½µÄ·þÎñµ¥ÔªµÄ±êÊ¶
+         *        sessionid     [in] : ºô½ÐµÄsessionid
+         *        requestId     [in] : Â·ÓÉÇëÇóID 
+         *        result        [in] : Â·ÓÉÇëÇó½á¹û
+         *        targetUri     [in] : Â·ÓÉÕÒµ½µÄ·Ö»úºÅÂë 
+         *        targetAgentId [in] : Â·ÓÉÕÒµ½µÄ×øÏ¯¹¤ºÅ
          *
          * @return ½Ó¿Úµ÷ÓÃ½á¹û
          */
@@ -320,7 +321,8 @@ namespace ims {
                 SessionIdT sessionid,
                 RouteRequestIDT  requestId,
                 RouteEventReasonT result,
-                string targetUri
+                string targetUri,
+                string targetAgentId
                 );
 
         /**
diff --git a/interface/ivr/bidl/ivr.bidl b/interface/ivr/bidl/ivr.bidl
index 2e08120..540744f 100644
--- a/interface/ivr/bidl/ivr.bidl
+++ b/interface/ivr/bidl/ivr.bidl
@@ -35,6 +35,7 @@ namespace ivr {
     {
         IvrResultT ReloadConfig([in] ReloadFlagT type);
         IvrResultT StartFlow([in] string flowname, [in] string flowvars);
-        IvrResultT Heartbeat([out] string ivrinfo); 
+        IvrResultT Heartbeat([out] string ivrinfo);
+        IvrResultT GetCallInfo([in] int32 type, [in] string input, [out] string result); 
     }
 }
diff --git a/platform/acd/Makefile b/platform/acd/Makefile
index 4b95448..0d5900f 100644
--- a/platform/acd/Makefile
+++ b/platform/acd/Makefile
@@ -8,21 +8,25 @@ INC_PATH += -I../../interface/output/bgcc/include/libs/
 INC_PATH += -I../../interface/output/acd/include/
 INC_PATH += -I../../interface/output/ims/include/
 INC_PATH += -I$(DEP_ROOT)/mysql/output/include/
+INC_PATH += -I$(DEP_ROOT)/json-c/output/include
 
-LIB_PATH  = -L../../interface/output/bgcc/lib/
+LIB_PATH  = -L../../interface/output/bgcc//lib/
 LIB_PATH += -L../../interface/output/acd/lib/linux/
 LIB_PATH += -L../../interface/output/ims/lib/linux/
 LIB_PATH += -L$(DEP_ROOT)/mysql/output/lib/
+LIB_PATH += -L$(DEP_ROOT)/json-c/output/lib
 
-VERSION = ${shell echo $$SCMPF_MODULE_VERSION}
-TAG = ${shell echo $$SCMPF_MODULE_TAG}
+VERSION = "1-1-2-14"
+TAG = ${VERSION}
+#VERSION = ${shell echo $$SCMPF_MODULE_VERSION}
+#TAG = ${shell echo $$SCMPF_MODULE_TAG}
 CXXFLAGS = -Wall -W -pipe -Wno-unused-parameter -Wreorder -Wwrite-strings -Wswitch -Wno-sign-compare\
 		   -g -D__XDEBUG__ -D__YDEBUG__ \
 		   -fPIC -finline-functions -Winline -Wreturn-type -Wtrigraphs -Wformat -Wparentheses -Wpointer-arith -Werror \
 		         -DACD_VERSION=\"$(VERSION)\" -DCVSTAG=\"$(TAG)\" -DPROJECT_NAME=\"$(BINNAME)\"\
 #				 -Dprotected=public -Dprivate=public
 
-LDFLAGS =  -lacd -lims -lbgcc -lmysqlclient_r -luuid -lpthread -lxml2 -lssl -lm -lrt 
+LDFLAGS =  -lacd -lims -lbgcc -lmysqlclient_r -lz -luuid -lpthread -lssl -lcrypto -lm -lrt -ldl -ljson -lssl -ldl -lcrypto
 
 SOURCES = $(wildcard src/*.cpp)
 OBJS = $(patsubst %.cpp,%.o,$(SOURCES))
diff --git a/platform/acd/include/acd_agent.h b/platform/acd/include/acd_agent.h
index 5bf923c..aa8ed04 100644
--- a/platform/acd/include/acd_agent.h
+++ b/platform/acd/include/acd_agent.h
@@ -38,6 +38,7 @@ class acd_agent {
     time_t m_validTime;
     time_t m_heartbeatTime;                        // ÐÄÌøÊ±¼ä
     string m_recordFilename;                         // Â¼ÒôÉú³ÉµÄÓïÒôÎÄ¼þÃû
+    string _m_cur_skill;                                      //µ±Ç°ºô½Ð¶ÔÓ¦µÄskill
 
     time_t m_loginTime;                              // µÇÂ½Ê±¼ä
     acd::AgentStatusT m_agentStatus;
@@ -75,7 +76,7 @@ class acd_agent {
     ims::SessionIdT GetSessionId();
     string GetRecordFileName();
     void GetAgentDetail(acd::AgentInfoT& agentInfo);
-    void lock(const ims::RouteEventT& event, time_t waitbegin = time(NULL));
+    void lock(const ims::RouteEventT& event, const string& skill, time_t waitbegin = time(NULL));
     bool unlock(const ims::RouteEventT& event);
     bool unlockTimeout();
     bool isCalling();
diff --git a/platform/acd/include/acd_data_collection.h b/platform/acd/include/acd_data_collection.h
new file mode 100644
index 0000000..c68fd81
--- /dev/null
+++ b/platform/acd/include/acd_data_collection.h
@@ -0,0 +1,125 @@
+/*
+ * Copyright 2002-2015 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      CC/LICENSE
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// acd manager define
+
+#ifndef _ACD_DATA_COLLECTION_H
+#define _ACD_DATA_COLLECTION_H
+
+#include<fstream> 
+#include "safe_queue.h"
+#include "acd_info.h"
+#include "bgcc.h"
+#include "thread.h"
+#include "locker.h"
+
+typedef struct {
+    uint32_t outbound_call_num; //ºô³öÁ¿
+    uint32_t outbound_ans_num; //ºô³ö½ÓÍ¨Á¿
+    uint32_t inbound_call_num; //ºôÈëµç»°Á¿
+    uint32_t inbound_ans_num; //ºôÈë½ÓÍ¨Á¿
+    uint32_t inbound_call_time; //ºôÈëµç»°×ÜÊ±³¤
+    uint32_t inbound_alerting_time; //ºôÈëµç»°ÕñÁå×ÜÊ±³¤
+    uint32_t outbound_call_time; //ºô³öµç»°×ÜÊ±³¤
+} CCCallData;
+
+typedef struct {
+    uint32_t inbound_call_time; //ºôÈëÍ¨»°Ê±³¤
+    uint32_t inbound_alerting_time; //ºôÈëÕñÁåÊ±³¤
+    uint32_t inbound_call_num; //ºôÈëµç»°Á¿
+    uint32_t inbound_answer_num; //ºôÈë½ÓÍ¨Á¿
+} SkillCallData;
+
+namespace acd {
+class AcdCallDataCollection : public Thread {
+public:
+    AcdCallDataCollection(){}
+    ~AcdCallDataCollection(){}
+
+    enum {
+        GETBYPLAT,
+        GETBYSKILL,
+        GETALL
+    };
+protected:
+    virtual void Method();
+public:
+    typedef std::map<string, SkillCallData*>::iterator iter;
+public:
+
+    // @brief ³õÊ¼»¯
+    void initialize(const char* path);
+
+    // @brief ·´³õÊ¼»¯
+    void unInitialize();
+
+    // @brief ´ÓÎÄ¼þÖÐ»ñÈ¡»º´æÊý¾Ý
+    int32_t get_data_from_file();
+
+    // @brief ½«»º´æÊý¾ÝÐ´ÈëÎÄ¼þÖÐ
+    int32_t put_data_to_file();
+
+    // @brief ¸ù¾ÝÊ±¼äÍ¬²½ »òÕß¸´Î»Êý¾Ý
+    void commit_data();
+
+    // @brief ¸üÐÂÊý¾Ý
+    // @param callinfo »°µ¥Êý¾Ý
+    void update_data(calldata_ptr& callinfo);
+
+    // @breif »ñÈ¡ºô½ÐÔÆµÄËùÓÐºô½ÐÐÅÏ¢
+    // @param calldata °´ºô½ÐÔÆ·µ»ØµÄºô½ÐÐÅÏ¢
+    // @return 0:success other:failed   
+    int32_t get_call_data_by_plat(string& data);
+
+    // @breif ¸ù¾Ý¼¼ÄÜ×é»ñÈ¡ºô½ÐÐÅÏ¢
+    // @param calldata °´¼¼ÄÜ×é·µ»ØµÄºô½ÐÐÅÏ¢
+    // @param skill ¼¼ÄÜ×é
+    // @return 0:success other:failed    
+    int32_t get_call_data_by_skill(string& data, const string& skill);
+
+    // @breif ¸ù¾Ý¼¼ÄÜ×é»ñÈ¡ºô½ÐÐÅÏ¢
+    // @return 0:success other:failed    
+    int32_t get_call_data_by_all(string& data);
+
+    // @breif »ñÈ¡ºô½ÐÐÅÏ¢
+    // @param type Êý¾ÝÀàÐÍ
+    // @param input ÊäÈë
+    // @param result ·µ»Ø½á¹û
+    // @return 0:success other:failed    
+    acd::AcdResultT get_call_data(int64_t handle, const std::string& agentId,
+                                int32_t type, const string& input, string& result);
+
+    // @brief ¸´Î»
+    void reset();
+
+    // @breif ½«»°µ¥Êý¾Ý¼ÓÈë¶ÓÁÐ
+    // @param calldata »°µ¥Êý¾Ý
+    // @return 0:success other:failed    
+    int32_t push_call_data(calldata_ptr& calldata);
+
+private:
+    bgcc::RWLock _lock;
+    string _cached_file; // »º´æÎÄ¼þÂ·¾¶
+    string _cached_date; // »º´æÈÕÆÚ
+    uint64_t _cached_second; //»º´æµÄÊ±¼ä£¬ÃëÎªµ¥Î»
+    SafeQueue<calldata_ptr> _calldata_queue;
+    std::map<string, SkillCallData*> _skill_call_info; //°´¼¼ÄÜ×é·µ»ØµÄºô½ÐÐÅÏ¢
+    CCCallData _cc_call_data; //µ±Ç°µÄºô½ÐÊý¾Ý
+};
+};
+
+#endif
+
diff --git a/platform/acd/include/acd_ims.h b/platform/acd/include/acd_ims.h
index be3c6c2..bc0d79d 100644
--- a/platform/acd/include/acd_ims.h
+++ b/platform/acd/include/acd_ims.h
@@ -71,7 +71,8 @@ class acd_ims : public Thread {
                           string& val);
     //RouteRequest, CancelRouteRequest
     bool RouteRequestRespond(ims::SessionIdT sessionid, ims::RouteRequestIDT requestId,
-                             const ims::RouteEventReasonT& result, const string& targetUri);
+                             const ims::RouteEventReasonT& result, const string& targetUri, 
+                             const string& targetAgentId);
     //CreateSession, TransferAgent
     bool Record(ims::SessionIdT sessionid, const string& agentId, const string& agentDn,
                 const string& filename, int32_t maxTime, const string& interruptKeys);
diff --git a/platform/acd/include/acd_info.h b/platform/acd/include/acd_info.h
index 2a19dc6..9033bf4 100644
--- a/platform/acd/include/acd_info.h
+++ b/platform/acd/include/acd_info.h
@@ -59,8 +59,28 @@ class ReleaseCauseT {
     bool isValid();
 };
 
-class callinfo {
-private:
+struct calldata {
+public:
+    calldata() : m_sessionId(0), m_callId(""), m_agentId(""), m_agentDn(""), m_caller(""),
+    m_callee(""), m_waitbegin(0), m_waitend(0), m_ackbegin(0), m_ackend(0), 
+    _m_connectbegin(0), _m_connectend(0), m_callbegin(0), m_callend(0),
+    m_callType(ims::PartyAttributeT::P_Unknown), m_callDirect(CallDirectT::UNKNOWN),
+    m_releaseCause(ReleaseCauseT::UNKNOWN),
+    m_recordFilename(""), m_routecall(false){}
+
+    calldata(ims::SessionIdT sessionId, ims::CallIdT callId, string agentId, string agentDn,
+    string skill, string caller, string callee, time_t waitbegin, time_t waitend, time_t ackbegin,
+    time_t ackend, time_t connectbegin, time_t connectend, time_t callbegin,
+    time_t callend, ims::PartyAttributeT callType, CallDirectT callDirect, 
+    ReleaseCauseT releaseCause, string recordFilename, bool routecall)
+    : m_sessionId(sessionId), m_callId(callId), m_agentId(agentId), m_agentDn(agentDn), 
+    m_skill(skill), m_caller(caller),
+    m_callee(callee), m_waitbegin(waitbegin), m_waitend(waitend), m_ackbegin(ackbegin), m_ackend(ackend), 
+    _m_connectbegin(connectbegin), _m_connectend(connectend), m_callbegin(callbegin), m_callend(callend),
+    m_callType(callType), m_callDirect(callDirect),
+    m_releaseCause(releaseCause), m_recordFilename(recordFilename), m_routecall(routecall){}
+
+public:
     ims::SessionIdT m_sessionId;
     ims::CallIdT m_callId;
     string m_agentId;
@@ -73,6 +93,8 @@ class callinfo {
     time_t m_waitend;
     time_t m_ackbegin;
     time_t m_ackend;
+    time_t _m_connectbegin;//other altering begin
+    time_t _m_connectend;//other alerting end
     time_t m_callbegin;
     time_t m_callend;
 
@@ -82,7 +104,11 @@ class callinfo {
     string m_recordFilename;
 
     bool m_routecall;
+};
+
+typedef bgcc::SharedPtr<calldata> calldata_ptr;
 
+class callinfo : private calldata{
 public:
     callinfo();
     ~callinfo();
@@ -92,6 +118,8 @@ class callinfo {
     void SetAniDnis(const string& caller, const string& callee);
     void SetAckBegin(time_t t);
     void SetAckEnd(time_t t);
+    void SetConnectBegin(time_t t);
+    void SetConnectEnd(time_t t);
     void SetCallBegin(time_t t);
     void SetCallEnd(time_t t);
     void SetCallType(const ims::PartyAttributeT& callType);
@@ -103,4 +131,5 @@ class callinfo {
     bool isValid();
     void reset();
     void WriteCallLog();
+    void AddDataToCollection();
 };
diff --git a/platform/acd/include/acd_server.h b/platform/acd/include/acd_server.h
index b56bbcb..bb2c999 100644
--- a/platform/acd/include/acd_server.h
+++ b/platform/acd/include/acd_server.h
@@ -160,4 +160,7 @@ class acd_server : public acd::acdapi {
                                       const std::map<std::string, std::string>& ctx);
     virtual acd::AcdResultT ResetConfig(const string& password,
                                         const std::map<std::string, std::string>& ctx);
+    virtual acd::AcdResultT GetCallInfo(int64_t handle, const string& agentId,
+                                        int32_t type, const string& input, string& result,
+                                        const std::map<std::string, std::string>& ctx);
 };
diff --git a/platform/acd/include/acd_tool.h b/platform/acd/include/acd_tool.h
index 1f72274..f731444 100644
--- a/platform/acd/include/acd_tool.h
+++ b/platform/acd/include/acd_tool.h
@@ -27,7 +27,9 @@
 #include "acd_backup.h"
 #include "acd_ims.h"
 #include "acd_server.h"
+#include "acd_data_collection.h"
 
+using acd::AcdCallDataCollection;
 class IDCreater {
 private:
     int64_t m_ID;
@@ -58,6 +60,7 @@ class acd_tool {
     static acd_backup* p_m_acd_backup;
     static acd_ims* p_m_acd_ims;
     static acd_main_server m_main_server;
+    static AcdCallDataCollection _acd_calldata;
 
 private:
     static void init_log();
@@ -66,6 +69,8 @@ class acd_tool {
     static void un_init_manager();
     static void init_connect();
     static void un_init_connect();
+    static void init_collection();
+    static void un_init_collection();
 
 public:
     static void init();
diff --git a/platform/acd/include/const_define.h b/platform/acd/include/const_define.h
index d50e14e..dfac486 100644
--- a/platform/acd/include/const_define.h
+++ b/platform/acd/include/const_define.h
@@ -96,6 +96,7 @@ const char CONFIG_FILE[] = "acd.conf";
 const char LOG_FILE[] = "acdlog";
 const char EVNET_LOG_FILE[] = "acdeventlog";
 const char CALL_LOG_FILE[] = "acdcalllog";
+const char DATA_CACHE_FILE[] = "log/acd_datacached.log";
 
 // ÈÕÖ¾¼¶±ð
 enum Level {
diff --git a/platform/acd/include/safe_queue.h b/platform/acd/include/safe_queue.h
index 4603fde..49d4299 100644
--- a/platform/acd/include/safe_queue.h
+++ b/platform/acd/include/safe_queue.h
@@ -32,6 +32,10 @@ class SafeQueue {
 
     bgcc::Semaphore mFullSemaphore;
     bgcc::Semaphore mEmptySemaphore;
+
+    pthread_mutex_t     _mutex;
+    pthread_cond_t      _cond;
+    uint32_t            _waitings;
 public:
     SafeQueue();
     ~SafeQueue();
@@ -42,17 +46,27 @@ class SafeQueue {
     void BlockPop();
     void BlockPop(T& value);
     void HarfBlockPop(T& value);
+    bool UnBlockPop(T& value, int32_t timeout);
     void Push(const T& value);
     void BlockPush(const T& value);
     void HarfBlockPush(const T& value);
 };
 
 template<class T>
-SafeQueue<T>::SafeQueue() : mFullSemaphore(0), mEmptySemaphore(MAX_QUEUE_COUNT) {
+SafeQueue<T>::SafeQueue() 
+    : mFullSemaphore(0)
+    , mEmptySemaphore(MAX_QUEUE_COUNT)
+    , _waitings(0)
+{
+    pthread_mutex_init(&this->_mutex, NULL);
+    pthread_cond_init(&this->_cond, NULL);
 }
 
 template<class T>
-SafeQueue<T>::~SafeQueue() {
+SafeQueue<T>::~SafeQueue() 
+{
+    pthread_mutex_destroy(&_mutex);
+    pthread_cond_destroy(&_cond);
 }
 
 template<class T>
@@ -117,6 +131,39 @@ void SafeQueue<T>::HarfBlockPop(T& value) {
     mLocker.unlock();
 }
 
+template<class T>
+bool SafeQueue<T>::UnBlockPop(T& value, int32_t timeout) {
+    pthread_mutex_lock(&_mutex);
+    mLocker.lock();
+    ++_waitings;
+
+        if (mQueue.empty()) {
+            if (timeout > 0) {
+                struct timespec abstime;
+                clock_gettime(CLOCK_REALTIME, &abstime);
+                abstime.tv_sec += timeout / 1000;
+                abstime.tv_nsec += (timeout % 1000) * 1000000;
+                mLocker.unlock();
+                pthread_cond_timedwait(&_cond, &_mutex, &abstime);
+                mLocker.lock();
+            }
+        }
+
+        if (mQueue.empty()) {
+            --_waitings;
+            pthread_mutex_unlock(&_mutex);
+            mLocker.unlock();
+            return false;
+        }
+
+    value = mQueue.front();
+    mQueue.pop();
+    --_waitings;
+    mLocker.unlock();
+    pthread_mutex_unlock(&_mutex);
+    return true;
+}
+
 template<class T>
 void SafeQueue<T>::Push(const T& value) {
     SingleLocker s(&mLocker);
@@ -126,6 +173,10 @@ void SafeQueue<T>::Push(const T& value) {
     }
 
     mQueue.push(value);
+
+    if (_waitings > 0) {
+        pthread_cond_signal(&_cond);
+    }
 }
 
 template<class T>
@@ -135,6 +186,9 @@ void SafeQueue<T>::BlockPush(const T& value) {
     mQueue.push(value);
     mLocker.unlock();
     mFullSemaphore.signal();
+    if (_waitings > 0) {
+        pthread_cond_signal(&_cond);
+    }
 }
 
 template<class T>
@@ -153,4 +207,8 @@ void SafeQueue<T>::HarfBlockPush(const T& value) {
     if (!isFull) {
         mFullSemaphore.signal();
     }
+
+    if (_waitings > 0) {
+        pthread_cond_signal(&_cond);
+    }
 }
diff --git a/platform/acd/sql/data.sql b/platform/acd/sql/data.sql
new file mode 100644
index 0000000..c53427c
--- /dev/null
+++ b/platform/acd/sql/data.sql
@@ -0,0 +1,802 @@
+--
+-- Host: localhost    Database: 
+-- ------------------------------------------------------
+-- Server version	5.0.51b-log
+
+/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
+/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
+/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
+/*!40101 SET NAMES utf8 */;
+/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
+/*!40103 SET TIME_ZONE='+00:00' */;
+/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
+/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
+/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
+/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+
+--
+-- Current Database: `acddb`
+--
+
+USE `acddb`;
+
+--
+-- Data for table `AgentTbl`
+--
+
+LOCK TABLES `AgentTbl` WRITE;
+/*!40000 ALTER TABLE `AgentTbl` DISABLE KEYS */;
+/*!40000 ALTER TABLE `AgentTbl` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Data for table `RestReasonTbl`
+--
+
+LOCK TABLES `RestReasonTbl` WRITE;
+/*!40000 ALTER TABLE `RestReasonTbl` DISABLE KEYS */;
+INSERT INTO `RestReasonTbl` VALUES (1,'å�ƒé¥­'),(2,'ä¸ŠåŽ•æ‰€'),(3,'æŠ½çƒŸ'),(4,'å�ˆä¼‘');
+/*!40000 ALTER TABLE `RestReasonTbl` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Data for table `SkillIdTbl`
+--
+
+LOCK TABLES `SkillIdTbl` WRITE;
+/*!40000 ALTER TABLE `SkillIdTbl` DISABLE KEYS */;
+INSERT INTO `SkillIdTbl` VALUES (5,'å’¨è¯¢'),(6,'test'),(7,'æŠ•è¯‰'),(8,'å®¢æœ�'),(9,'é”€å”®');
+/*!40000 ALTER TABLE `SkillIdTbl` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Data for table `tb_opt_log`
+--
+
+LOCK TABLES `tb_opt_log` WRITE;
+/*!40000 ALTER TABLE `tb_opt_log` DISABLE KEYS */;
+INSERT INTO `tb_opt_log` VALUES (1,'2012-06-08 11:33:09','skill_Id','update id:8');
+/*!40000 ALTER TABLE `tb_opt_log` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Current Database: `ccclouddb`
+--
+
+USE `ccclouddb`;
+
+--
+-- Data for table `acd_01`
+--
+
+LOCK TABLES `acd_01` WRITE;
+/*!40000 ALTER TABLE `acd_01` DISABLE KEYS */;
+/*!40000 ALTER TABLE `acd_01` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Data for table `acd_02`
+--
+
+LOCK TABLES `acd_02` WRITE;
+/*!40000 ALTER TABLE `acd_02` DISABLE KEYS */;
+/*!40000 ALTER TABLE `acd_02` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Data for table `acd_03`
+--
+
+LOCK TABLES `acd_03` WRITE;
+/*!40000 ALTER TABLE `acd_03` DISABLE KEYS */;
+/*!40000 ALTER TABLE `acd_03` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Data for table `acd_04`
+--
+
+LOCK TABLES `acd_04` WRITE;
+/*!40000 ALTER TABLE `acd_04` DISABLE KEYS */;
+/*!40000 ALTER TABLE `acd_04` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Data for table `acd_05`
+--
+
+LOCK TABLES `acd_05` WRITE;
+/*!40000 ALTER TABLE `acd_05` DISABLE KEYS */;
+/*!40000 ALTER TABLE `acd_05` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Data for table `acd_06`
+--
+
+LOCK TABLES `acd_06` WRITE;
+/*!40000 ALTER TABLE `acd_06` DISABLE KEYS */;
+/*!40000 ALTER TABLE `acd_06` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Data for table `acd_07`
+--
+
+LOCK TABLES `acd_07` WRITE;
+/*!40000 ALTER TABLE `acd_07` DISABLE KEYS */;
+/*!40000 ALTER TABLE `acd_07` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Data for table `acd_08`
+--
+
+LOCK TABLES `acd_08` WRITE;
+/*!40000 ALTER TABLE `acd_08` DISABLE KEYS */;
+/*!40000 ALTER TABLE `acd_08` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Data for table `acd_09`
+--
+
+LOCK TABLES `acd_09` WRITE;
+/*!40000 ALTER TABLE `acd_09` DISABLE KEYS */;
+/*!40000 ALTER TABLE `acd_09` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Data for table `acd_10`
+--
+
+LOCK TABLES `acd_10` WRITE;
+/*!40000 ALTER TABLE `acd_10` DISABLE KEYS */;
+/*!40000 ALTER TABLE `acd_10` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Data for table `acd_11`
+--
+
+LOCK TABLES `acd_11` WRITE;
+/*!40000 ALTER TABLE `acd_11` DISABLE KEYS */;
+/*!40000 ALTER TABLE `acd_11` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Data for table `acd_12`
+--
+
+LOCK TABLES `acd_12` WRITE;
+/*!40000 ALTER TABLE `acd_12` DISABLE KEYS */;
+/*!40000 ALTER TABLE `acd_12` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Data for table `fs_01`
+--
+
+LOCK TABLES `fs_01` WRITE;
+/*!40000 ALTER TABLE `fs_01` DISABLE KEYS */;
+/*!40000 ALTER TABLE `fs_01` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Data for table `fs_02`
+--
+
+LOCK TABLES `fs_02` WRITE;
+/*!40000 ALTER TABLE `fs_02` DISABLE KEYS */;
+/*!40000 ALTER TABLE `fs_02` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Data for table `fs_03`
+--
+
+LOCK TABLES `fs_03` WRITE;
+/*!40000 ALTER TABLE `fs_03` DISABLE KEYS */;
+/*!40000 ALTER TABLE `fs_03` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Data for table `fs_04`
+--
+
+LOCK TABLES `fs_04` WRITE;
+/*!40000 ALTER TABLE `fs_04` DISABLE KEYS */;
+/*!40000 ALTER TABLE `fs_04` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Data for table `fs_05`
+--
+
+LOCK TABLES `fs_05` WRITE;
+/*!40000 ALTER TABLE `fs_05` DISABLE KEYS */;
+/*!40000 ALTER TABLE `fs_05` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Data for table `fs_06`
+--
+
+LOCK TABLES `fs_06` WRITE;
+/*!40000 ALTER TABLE `fs_06` DISABLE KEYS */;
+/*!40000 ALTER TABLE `fs_06` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Data for table `fs_07`
+--
+
+LOCK TABLES `fs_07` WRITE;
+/*!40000 ALTER TABLE `fs_07` DISABLE KEYS */;
+/*!40000 ALTER TABLE `fs_07` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Data for table `fs_08`
+--
+
+LOCK TABLES `fs_08` WRITE;
+/*!40000 ALTER TABLE `fs_08` DISABLE KEYS */;
+/*!40000 ALTER TABLE `fs_08` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Data for table `fs_09`
+--
+
+LOCK TABLES `fs_09` WRITE;
+/*!40000 ALTER TABLE `fs_09` DISABLE KEYS */;
+/*!40000 ALTER TABLE `fs_09` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Data for table `fs_10`
+--
+
+LOCK TABLES `fs_10` WRITE;
+/*!40000 ALTER TABLE `fs_10` DISABLE KEYS */;
+/*!40000 ALTER TABLE `fs_10` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Data for table `fs_11`
+--
+
+LOCK TABLES `fs_11` WRITE;
+/*!40000 ALTER TABLE `fs_11` DISABLE KEYS */;
+/*!40000 ALTER TABLE `fs_11` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Data for table `fs_12`
+--
+
+LOCK TABLES `fs_12` WRITE;
+/*!40000 ALTER TABLE `fs_12` DISABLE KEYS */;
+/*!40000 ALTER TABLE `fs_12` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Data for table `ivr_01`
+--
+
+LOCK TABLES `ivr_01` WRITE;
+/*!40000 ALTER TABLE `ivr_01` DISABLE KEYS */;
+/*!40000 ALTER TABLE `ivr_01` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Data for table `ivr_02`
+--
+
+LOCK TABLES `ivr_02` WRITE;
+/*!40000 ALTER TABLE `ivr_02` DISABLE KEYS */;
+/*!40000 ALTER TABLE `ivr_02` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Data for table `ivr_03`
+--
+
+LOCK TABLES `ivr_03` WRITE;
+/*!40000 ALTER TABLE `ivr_03` DISABLE KEYS */;
+/*!40000 ALTER TABLE `ivr_03` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Data for table `ivr_04`
+--
+
+LOCK TABLES `ivr_04` WRITE;
+/*!40000 ALTER TABLE `ivr_04` DISABLE KEYS */;
+/*!40000 ALTER TABLE `ivr_04` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Data for table `ivr_05`
+--
+
+LOCK TABLES `ivr_05` WRITE;
+/*!40000 ALTER TABLE `ivr_05` DISABLE KEYS */;
+/*!40000 ALTER TABLE `ivr_05` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Data for table `ivr_06`
+--
+
+LOCK TABLES `ivr_06` WRITE;
+/*!40000 ALTER TABLE `ivr_06` DISABLE KEYS */;
+/*!40000 ALTER TABLE `ivr_06` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Data for table `ivr_07`
+--
+
+LOCK TABLES `ivr_07` WRITE;
+/*!40000 ALTER TABLE `ivr_07` DISABLE KEYS */;
+/*!40000 ALTER TABLE `ivr_07` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Data for table `ivr_08`
+--
+
+LOCK TABLES `ivr_08` WRITE;
+/*!40000 ALTER TABLE `ivr_08` DISABLE KEYS */;
+/*!40000 ALTER TABLE `ivr_08` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Data for table `ivr_09`
+--
+
+LOCK TABLES `ivr_09` WRITE;
+/*!40000 ALTER TABLE `ivr_09` DISABLE KEYS */;
+/*!40000 ALTER TABLE `ivr_09` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Data for table `ivr_10`
+--
+
+LOCK TABLES `ivr_10` WRITE;
+/*!40000 ALTER TABLE `ivr_10` DISABLE KEYS */;
+/*!40000 ALTER TABLE `ivr_10` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Data for table `ivr_11`
+--
+
+LOCK TABLES `ivr_11` WRITE;
+/*!40000 ALTER TABLE `ivr_11` DISABLE KEYS */;
+/*!40000 ALTER TABLE `ivr_11` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Data for table `ivr_12`
+--
+
+LOCK TABLES `ivr_12` WRITE;
+/*!40000 ALTER TABLE `ivr_12` DISABLE KEYS */;
+/*!40000 ALTER TABLE `ivr_12` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Current Database: `osips_db`
+--
+
+USE `osips_db`;
+
+--
+-- Data for table `acc`
+--
+
+LOCK TABLES `acc` WRITE;
+/*!40000 ALTER TABLE `acc` DISABLE KEYS */;
+/*!40000 ALTER TABLE `acc` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Data for table `active_watchers`
+--
+
+LOCK TABLES `active_watchers` WRITE;
+/*!40000 ALTER TABLE `active_watchers` DISABLE KEYS */;
+/*!40000 ALTER TABLE `active_watchers` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Data for table `address`
+--
+
+LOCK TABLES `address` WRITE;
+/*!40000 ALTER TABLE `address` DISABLE KEYS */;
+/*!40000 ALTER TABLE `address` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Data for table `aliases`
+--
+
+LOCK TABLES `aliases` WRITE;
+/*!40000 ALTER TABLE `aliases` DISABLE KEYS */;
+/*!40000 ALTER TABLE `aliases` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Data for table `carrierfailureroute`
+--
+
+LOCK TABLES `carrierfailureroute` WRITE;
+/*!40000 ALTER TABLE `carrierfailureroute` DISABLE KEYS */;
+/*!40000 ALTER TABLE `carrierfailureroute` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Data for table `carrierroute`
+--
+
+LOCK TABLES `carrierroute` WRITE;
+/*!40000 ALTER TABLE `carrierroute` DISABLE KEYS */;
+/*!40000 ALTER TABLE `carrierroute` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Data for table `cdrs`
+--
+
+LOCK TABLES `cdrs` WRITE;
+/*!40000 ALTER TABLE `cdrs` DISABLE KEYS */;
+/*!40000 ALTER TABLE `cdrs` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Data for table `cpl`
+--
+
+LOCK TABLES `cpl` WRITE;
+/*!40000 ALTER TABLE `cpl` DISABLE KEYS */;
+/*!40000 ALTER TABLE `cpl` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Data for table `dbaliases`
+--
+
+LOCK TABLES `dbaliases` WRITE;
+/*!40000 ALTER TABLE `dbaliases` DISABLE KEYS */;
+/*!40000 ALTER TABLE `dbaliases` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Data for table `dialog`
+--
+
+LOCK TABLES `dialog` WRITE;
+/*!40000 ALTER TABLE `dialog` DISABLE KEYS */;
+/*!40000 ALTER TABLE `dialog` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Data for table `dialplan`
+--
+
+LOCK TABLES `dialplan` WRITE;
+/*!40000 ALTER TABLE `dialplan` DISABLE KEYS */;
+/*!40000 ALTER TABLE `dialplan` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Data for table `dispatcher`
+--
+
+LOCK TABLES `dispatcher` WRITE;
+/*!40000 ALTER TABLE `dispatcher` DISABLE KEYS */;
+/*!40000 ALTER TABLE `dispatcher` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Data for table `domain`
+--
+
+LOCK TABLES `domain` WRITE;
+/*!40000 ALTER TABLE `domain` DISABLE KEYS */;
+/*!40000 ALTER TABLE `domain` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Data for table `domainpolicy`
+--
+
+LOCK TABLES `domainpolicy` WRITE;
+/*!40000 ALTER TABLE `domainpolicy` DISABLE KEYS */;
+/*!40000 ALTER TABLE `domainpolicy` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Data for table `dr_gateways`
+--
+
+LOCK TABLES `dr_gateways` WRITE;
+/*!40000 ALTER TABLE `dr_gateways` DISABLE KEYS */;
+/*!40000 ALTER TABLE `dr_gateways` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Data for table `dr_groups`
+--
+
+LOCK TABLES `dr_groups` WRITE;
+/*!40000 ALTER TABLE `dr_groups` DISABLE KEYS */;
+/*!40000 ALTER TABLE `dr_groups` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Data for table `dr_gw_lists`
+--
+
+LOCK TABLES `dr_gw_lists` WRITE;
+/*!40000 ALTER TABLE `dr_gw_lists` DISABLE KEYS */;
+/*!40000 ALTER TABLE `dr_gw_lists` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Data for table `dr_rules`
+--
+
+LOCK TABLES `dr_rules` WRITE;
+/*!40000 ALTER TABLE `dr_rules` DISABLE KEYS */;
+/*!40000 ALTER TABLE `dr_rules` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Data for table `globalblacklist`
+--
+
+LOCK TABLES `globalblacklist` WRITE;
+/*!40000 ALTER TABLE `globalblacklist` DISABLE KEYS */;
+/*!40000 ALTER TABLE `globalblacklist` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Data for table `grp`
+--
+
+LOCK TABLES `grp` WRITE;
+/*!40000 ALTER TABLE `grp` DISABLE KEYS */;
+/*!40000 ALTER TABLE `grp` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Data for table `gw`
+--
+
+LOCK TABLES `gw` WRITE;
+/*!40000 ALTER TABLE `gw` DISABLE KEYS */;
+/*!40000 ALTER TABLE `gw` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Data for table `imc_members`
+--
+
+LOCK TABLES `imc_members` WRITE;
+/*!40000 ALTER TABLE `imc_members` DISABLE KEYS */;
+/*!40000 ALTER TABLE `imc_members` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Data for table `imc_rooms`
+--
+
+LOCK TABLES `imc_rooms` WRITE;
+/*!40000 ALTER TABLE `imc_rooms` DISABLE KEYS */;
+/*!40000 ALTER TABLE `imc_rooms` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Data for table `lcr`
+--
+
+LOCK TABLES `lcr` WRITE;
+/*!40000 ALTER TABLE `lcr` DISABLE KEYS */;
+/*!40000 ALTER TABLE `lcr` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Data for table `load_balancer`
+--
+
+LOCK TABLES `load_balancer` WRITE;
+/*!40000 ALTER TABLE `load_balancer` DISABLE KEYS */;
+/*!40000 ALTER TABLE `load_balancer` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Data for table `location`
+--
+
+LOCK TABLES `location` WRITE;
+/*!40000 ALTER TABLE `location` DISABLE KEYS */;
+/*!40000 ALTER TABLE `location` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Data for table `missed_calls`
+--
+
+LOCK TABLES `missed_calls` WRITE;
+/*!40000 ALTER TABLE `missed_calls` DISABLE KEYS */;
+/*!40000 ALTER TABLE `missed_calls` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Data for table `nh_sockets`
+--
+
+LOCK TABLES `nh_sockets` WRITE;
+/*!40000 ALTER TABLE `nh_sockets` DISABLE KEYS */;
+/*!40000 ALTER TABLE `nh_sockets` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Data for table `pdt`
+--
+
+LOCK TABLES `pdt` WRITE;
+/*!40000 ALTER TABLE `pdt` DISABLE KEYS */;
+/*!40000 ALTER TABLE `pdt` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Data for table `presentity`
+--
+
+LOCK TABLES `presentity` WRITE;
+/*!40000 ALTER TABLE `presentity` DISABLE KEYS */;
+/*!40000 ALTER TABLE `presentity` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Data for table `pua`
+--
+
+LOCK TABLES `pua` WRITE;
+/*!40000 ALTER TABLE `pua` DISABLE KEYS */;
+/*!40000 ALTER TABLE `pua` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Data for table `re_grp`
+--
+
+LOCK TABLES `re_grp` WRITE;
+/*!40000 ALTER TABLE `re_grp` DISABLE KEYS */;
+/*!40000 ALTER TABLE `re_grp` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Data for table `rls_presentity`
+--
+
+LOCK TABLES `rls_presentity` WRITE;
+/*!40000 ALTER TABLE `rls_presentity` DISABLE KEYS */;
+/*!40000 ALTER TABLE `rls_presentity` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Data for table `rls_watchers`
+--
+
+LOCK TABLES `rls_watchers` WRITE;
+/*!40000 ALTER TABLE `rls_watchers` DISABLE KEYS */;
+/*!40000 ALTER TABLE `rls_watchers` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Data for table `route_tree`
+--
+
+LOCK TABLES `route_tree` WRITE;
+/*!40000 ALTER TABLE `route_tree` DISABLE KEYS */;
+/*!40000 ALTER TABLE `route_tree` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Data for table `silo`
+--
+
+LOCK TABLES `silo` WRITE;
+/*!40000 ALTER TABLE `silo` DISABLE KEYS */;
+/*!40000 ALTER TABLE `silo` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Data for table `sip_trace`
+--
+
+LOCK TABLES `sip_trace` WRITE;
+/*!40000 ALTER TABLE `sip_trace` DISABLE KEYS */;
+/*!40000 ALTER TABLE `sip_trace` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Data for table `speed_dial`
+--
+
+LOCK TABLES `speed_dial` WRITE;
+/*!40000 ALTER TABLE `speed_dial` DISABLE KEYS */;
+/*!40000 ALTER TABLE `speed_dial` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Data for table `subscriber`
+--
+
+LOCK TABLES `subscriber` WRITE;
+/*!40000 ALTER TABLE `subscriber` DISABLE KEYS */;
+/*!40000 ALTER TABLE `subscriber` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Data for table `uri`
+--
+
+LOCK TABLES `uri` WRITE;
+/*!40000 ALTER TABLE `uri` DISABLE KEYS */;
+/*!40000 ALTER TABLE `uri` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Data for table `userblacklist`
+--
+
+LOCK TABLES `userblacklist` WRITE;
+/*!40000 ALTER TABLE `userblacklist` DISABLE KEYS */;
+/*!40000 ALTER TABLE `userblacklist` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Data for table `usr_preferences`
+--
+
+LOCK TABLES `usr_preferences` WRITE;
+/*!40000 ALTER TABLE `usr_preferences` DISABLE KEYS */;
+/*!40000 ALTER TABLE `usr_preferences` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Data for table `version`
+--
+
+LOCK TABLES `version` WRITE;
+/*!40000 ALTER TABLE `version` DISABLE KEYS */;
+INSERT INTO `version` VALUES ('acc',6),('active_watchers',10),('address',5),('aliases',1005),('carrierfailureroute',2),('carrierroute',3),('cpl',2),('dbaliases',2),('dialog',4),('dialplan',2),('dispatcher',4),('domain',2),('domainpolicy',3),('dr_gateways',4),('dr_groups',2),('dr_gw_lists',1),('dr_rules',3),('globalblacklist',2),('grp',3),('gw',8),('imc_members',2),('imc_rooms',2),('lcr',3),('load_balancer',2),('location',1005),('missed_calls',4),('nh_sockets',0),('pdt',2),('presentity',5),('pua',8),('re_grp',2),('rls_presentity',1),('rls_watchers',2),('route_tree',2),('silo',6),('sip_trace',3),('speed_dial',3),('subscriber',7),('uri',2),('userblacklist',2),('usr_preferences',3),('watchers',4),('xcap',4);
+/*!40000 ALTER TABLE `version` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Data for table `watchers`
+--
+
+LOCK TABLES `watchers` WRITE;
+/*!40000 ALTER TABLE `watchers` DISABLE KEYS */;
+/*!40000 ALTER TABLE `watchers` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Data for table `xcap`
+--
+
+LOCK TABLES `xcap` WRITE;
+/*!40000 ALTER TABLE `xcap` DISABLE KEYS */;
+/*!40000 ALTER TABLE `xcap` ENABLE KEYS */;
+UNLOCK TABLES;
diff --git a/platform/acd/sql/schema.sql b/platform/acd/sql/schema.sql
new file mode 100644
index 0000000..3b8fd66
--- /dev/null
+++ b/platform/acd/sql/schema.sql
@@ -0,0 +1,2072 @@
+--
+-- Host: localhost    Database: 
+-- ------------------------------------------------------
+-- Server version	5.0.51b-log
+
+/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
+/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
+/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
+/*!40101 SET NAMES utf8 */;
+/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
+/*!40103 SET TIME_ZONE='+00:00' */;
+/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
+/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
+/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
+/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+
+--
+-- Current Database: `acddb`
+--
+
+CREATE DATABASE /*!32312 IF NOT EXISTS*/ `acddb` /*!40100 DEFAULT CHARACTER SET utf8 */;
+
+USE `acddb`;
+
+--
+-- Table structure for table `AgentTbl`
+--
+
+DROP TABLE IF EXISTS `AgentTbl`;
+SET @saved_cs_client     = @@character_set_client;
+SET character_set_client = utf8;
+CREATE TABLE `AgentTbl` (
+  `Id` int(11) NOT NULL auto_increment,
+  `AgentId` varchar(64) default NULL,
+  `AgentPwd` varchar(64) default NULL,
+  `Skills` varchar(64) default NULL,
+  PRIMARY KEY  (`Id`),
+  KEY `AgentId` (`AgentId`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+SET character_set_client = @saved_cs_client;
+
+--
+-- Table structure for table `RestReasonTbl`
+--
+
+DROP TABLE IF EXISTS `RestReasonTbl`;
+SET @saved_cs_client     = @@character_set_client;
+SET character_set_client = utf8;
+CREATE TABLE `RestReasonTbl` (
+  `Id` int(11) NOT NULL auto_increment,
+  `RestReason` varchar(255) default NULL,
+  PRIMARY KEY  (`Id`)
+) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
+SET character_set_client = @saved_cs_client;
+
+--
+-- Table structure for table `SkillIdTbl`
+--
+
+DROP TABLE IF EXISTS `SkillIdTbl`;
+SET @saved_cs_client     = @@character_set_client;
+SET character_set_client = utf8;
+CREATE TABLE `SkillIdTbl` (
+  `Id` int(11) NOT NULL auto_increment,
+  `SkillName` varchar(255) default NULL,
+  PRIMARY KEY  (`Id`)
+) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8;
+SET character_set_client = @saved_cs_client;
+
+--
+-- Table structure for table `tb_opt_log`
+--
+
+DROP TABLE IF EXISTS `tb_opt_log`;
+SET @saved_cs_client     = @@character_set_client;
+SET character_set_client = utf8;
+CREATE TABLE `tb_opt_log` (
+  `id` int(10) unsigned NOT NULL auto_increment,
+  `add_time` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP COMMENT '²Ù×÷Ê±¼ä',
+  `opt_type` varchar(200) NOT NULL COMMENT '²Ù×÷ÀàÐÍ',
+  `opt_data` varchar(2000) NOT NULL COMMENT '²Ù×÷ÏêÇé',
+  PRIMARY KEY  (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='²Ù×÷ÈÕÖ¾±í';
+SET character_set_client = @saved_cs_client;
+
+--
+-- Current Database: `ccclouddb`
+--
+
+CREATE DATABASE /*!32312 IF NOT EXISTS*/ `ccclouddb` /*!40100 DEFAULT CHARACTER SET utf8 */;
+
+USE `ccclouddb`;
+
+--
+-- Table structure for table `acd_01`
+--
+
+DROP TABLE IF EXISTS `acd_01`;
+SET @saved_cs_client     = @@character_set_client;
+SET character_set_client = utf8;
+CREATE TABLE `acd_01` (
+  `sessionid` varchar(30) default NULL,
+  `callid` varchar(30) default NULL,
+  `agentid` varchar(30) default NULL,
+  `agentdn` varchar(30) default NULL,
+  `skill` varchar(255) default NULL,
+  `caller` varchar(30) default NULL,
+  `callee` varchar(30) default NULL,
+  `waitbegin` datetime default NULL,
+  `waitend` datetime default NULL,
+  `ackbegin` datetime default NULL,
+  `ackend` datetime default NULL,
+  `callbegin` datetime default NULL,
+  `callend` datetime default NULL,
+  `calltype` varchar(30) default NULL,
+  `calldirect` varchar(30) default NULL,
+  `release_cause` varchar(30) default NULL,
+  `record_filename` varchar(255) default NULL,
+  `src_IP` varchar(32) default NULL,
+  KEY `callid` (`callid`),
+  KEY `agentid` (`agentid`),
+  KEY `agentdn` (`agentdn`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+SET character_set_client = @saved_cs_client;
+
+--
+-- Table structure for table `acd_02`
+--
+
+DROP TABLE IF EXISTS `acd_02`;
+SET @saved_cs_client     = @@character_set_client;
+SET character_set_client = utf8;
+CREATE TABLE `acd_02` (
+  `sessionid` varchar(30) default NULL,
+  `callid` varchar(30) default NULL,
+  `agentid` varchar(30) default NULL,
+  `agentdn` varchar(30) default NULL,
+  `skill` varchar(255) default NULL,
+  `caller` varchar(30) default NULL,
+  `callee` varchar(30) default NULL,
+  `waitbegin` datetime default NULL,
+  `waitend` datetime default NULL,
+  `ackbegin` datetime default NULL,
+  `ackend` datetime default NULL,
+  `callbegin` datetime default NULL,
+  `callend` datetime default NULL,
+  `calltype` varchar(30) default NULL,
+  `calldirect` varchar(30) default NULL,
+  `release_cause` varchar(30) default NULL,
+  `record_filename` varchar(255) default NULL,
+  `src_IP` varchar(32) default NULL,
+  KEY `callid` (`callid`),
+  KEY `agentid` (`agentid`),
+  KEY `agentdn` (`agentdn`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+SET character_set_client = @saved_cs_client;
+
+--
+-- Table structure for table `acd_03`
+--
+
+DROP TABLE IF EXISTS `acd_03`;
+SET @saved_cs_client     = @@character_set_client;
+SET character_set_client = utf8;
+CREATE TABLE `acd_03` (
+  `sessionid` varchar(30) default NULL,
+  `callid` varchar(30) default NULL,
+  `agentid` varchar(30) default NULL,
+  `agentdn` varchar(30) default NULL,
+  `skill` varchar(255) default NULL,
+  `caller` varchar(30) default NULL,
+  `callee` varchar(30) default NULL,
+  `waitbegin` datetime default NULL,
+  `waitend` datetime default NULL,
+  `ackbegin` datetime default NULL,
+  `ackend` datetime default NULL,
+  `callbegin` datetime default NULL,
+  `callend` datetime default NULL,
+  `calltype` varchar(30) default NULL,
+  `calldirect` varchar(30) default NULL,
+  `release_cause` varchar(30) default NULL,
+  `record_filename` varchar(255) default NULL,
+  `src_IP` varchar(32) default NULL,
+  KEY `callid` (`callid`),
+  KEY `agentid` (`agentid`),
+  KEY `agentdn` (`agentdn`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+SET character_set_client = @saved_cs_client;
+
+--
+-- Table structure for table `acd_04`
+--
+
+DROP TABLE IF EXISTS `acd_04`;
+SET @saved_cs_client     = @@character_set_client;
+SET character_set_client = utf8;
+CREATE TABLE `acd_04` (
+  `sessionid` varchar(30) default NULL,
+  `callid` varchar(30) default NULL,
+  `agentid` varchar(30) default NULL,
+  `agentdn` varchar(30) default NULL,
+  `skill` varchar(255) default NULL,
+  `caller` varchar(30) default NULL,
+  `callee` varchar(30) default NULL,
+  `waitbegin` datetime default NULL,
+  `waitend` datetime default NULL,
+  `ackbegin` datetime default NULL,
+  `ackend` datetime default NULL,
+  `callbegin` datetime default NULL,
+  `callend` datetime default NULL,
+  `calltype` varchar(30) default NULL,
+  `calldirect` varchar(30) default NULL,
+  `release_cause` varchar(30) default NULL,
+  `record_filename` varchar(255) default NULL,
+  `src_IP` varchar(32) default NULL,
+  KEY `callid` (`callid`),
+  KEY `agentid` (`agentid`),
+  KEY `agentdn` (`agentdn`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+SET character_set_client = @saved_cs_client;
+
+--
+-- Table structure for table `acd_05`
+--
+
+DROP TABLE IF EXISTS `acd_05`;
+SET @saved_cs_client     = @@character_set_client;
+SET character_set_client = utf8;
+CREATE TABLE `acd_05` (
+  `sessionid` varchar(30) default NULL,
+  `callid` varchar(30) default NULL,
+  `agentid` varchar(30) default NULL,
+  `agentdn` varchar(30) default NULL,
+  `skill` varchar(255) default NULL,
+  `caller` varchar(30) default NULL,
+  `callee` varchar(30) default NULL,
+  `waitbegin` datetime default NULL,
+  `waitend` datetime default NULL,
+  `ackbegin` datetime default NULL,
+  `ackend` datetime default NULL,
+  `callbegin` datetime default NULL,
+  `callend` datetime default NULL,
+  `calltype` varchar(30) default NULL,
+  `calldirect` varchar(30) default NULL,
+  `release_cause` varchar(30) default NULL,
+  `record_filename` varchar(255) default NULL,
+  `src_IP` varchar(32) default NULL,
+  KEY `callid` (`callid`),
+  KEY `agentid` (`agentid`),
+  KEY `agentdn` (`agentdn`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+SET character_set_client = @saved_cs_client;
+
+--
+-- Table structure for table `acd_06`
+--
+
+DROP TABLE IF EXISTS `acd_06`;
+SET @saved_cs_client     = @@character_set_client;
+SET character_set_client = utf8;
+CREATE TABLE `acd_06` (
+  `sessionid` varchar(30) default NULL,
+  `callid` varchar(30) default NULL,
+  `agentid` varchar(30) default NULL,
+  `agentdn` varchar(30) default NULL,
+  `skill` varchar(255) default NULL,
+  `caller` varchar(30) default NULL,
+  `callee` varchar(30) default NULL,
+  `waitbegin` datetime default NULL,
+  `waitend` datetime default NULL,
+  `ackbegin` datetime default NULL,
+  `ackend` datetime default NULL,
+  `callbegin` datetime default NULL,
+  `callend` datetime default NULL,
+  `calltype` varchar(30) default NULL,
+  `calldirect` varchar(30) default NULL,
+  `release_cause` varchar(30) default NULL,
+  `record_filename` varchar(255) default NULL,
+  `src_IP` varchar(32) default NULL,
+  KEY `callid` (`callid`),
+  KEY `agentid` (`agentid`),
+  KEY `agentdn` (`agentdn`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+SET character_set_client = @saved_cs_client;
+
+--
+-- Table structure for table `acd_07`
+--
+
+DROP TABLE IF EXISTS `acd_07`;
+SET @saved_cs_client     = @@character_set_client;
+SET character_set_client = utf8;
+CREATE TABLE `acd_07` (
+  `sessionid` varchar(30) default NULL,
+  `callid` varchar(30) default NULL,
+  `agentid` varchar(30) default NULL,
+  `agentdn` varchar(30) default NULL,
+  `skill` varchar(255) default NULL,
+  `caller` varchar(30) default NULL,
+  `callee` varchar(30) default NULL,
+  `waitbegin` datetime default NULL,
+  `waitend` datetime default NULL,
+  `ackbegin` datetime default NULL,
+  `ackend` datetime default NULL,
+  `callbegin` datetime default NULL,
+  `callend` datetime default NULL,
+  `calltype` varchar(30) default NULL,
+  `calldirect` varchar(30) default NULL,
+  `release_cause` varchar(30) default NULL,
+  `record_filename` varchar(255) default NULL,
+  `src_IP` varchar(32) default NULL,
+  KEY `callid` (`callid`),
+  KEY `agentid` (`agentid`),
+  KEY `agentdn` (`agentdn`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+SET character_set_client = @saved_cs_client;
+
+--
+-- Table structure for table `acd_08`
+--
+
+DROP TABLE IF EXISTS `acd_08`;
+SET @saved_cs_client     = @@character_set_client;
+SET character_set_client = utf8;
+CREATE TABLE `acd_08` (
+  `sessionid` varchar(30) default NULL,
+  `callid` varchar(30) default NULL,
+  `agentid` varchar(30) default NULL,
+  `agentdn` varchar(30) default NULL,
+  `skill` varchar(255) default NULL,
+  `caller` varchar(30) default NULL,
+  `callee` varchar(30) default NULL,
+  `waitbegin` datetime default NULL,
+  `waitend` datetime default NULL,
+  `ackbegin` datetime default NULL,
+  `ackend` datetime default NULL,
+  `callbegin` datetime default NULL,
+  `callend` datetime default NULL,
+  `calltype` varchar(30) default NULL,
+  `calldirect` varchar(30) default NULL,
+  `release_cause` varchar(30) default NULL,
+  `record_filename` varchar(255) default NULL,
+  `src_IP` varchar(32) default NULL,
+  KEY `callid` (`callid`),
+  KEY `agentid` (`agentid`),
+  KEY `agentdn` (`agentdn`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+SET character_set_client = @saved_cs_client;
+
+--
+-- Table structure for table `acd_09`
+--
+
+DROP TABLE IF EXISTS `acd_09`;
+SET @saved_cs_client     = @@character_set_client;
+SET character_set_client = utf8;
+CREATE TABLE `acd_09` (
+  `sessionid` varchar(30) default NULL,
+  `callid` varchar(30) default NULL,
+  `agentid` varchar(30) default NULL,
+  `agentdn` varchar(30) default NULL,
+  `skill` varchar(255) default NULL,
+  `caller` varchar(30) default NULL,
+  `callee` varchar(30) default NULL,
+  `waitbegin` datetime default NULL,
+  `waitend` datetime default NULL,
+  `ackbegin` datetime default NULL,
+  `ackend` datetime default NULL,
+  `callbegin` datetime default NULL,
+  `callend` datetime default NULL,
+  `calltype` varchar(30) default NULL,
+  `calldirect` varchar(30) default NULL,
+  `release_cause` varchar(30) default NULL,
+  `record_filename` varchar(255) default NULL,
+  `src_IP` varchar(32) default NULL,
+  KEY `callid` (`callid`),
+  KEY `agentid` (`agentid`),
+  KEY `agentdn` (`agentdn`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+SET character_set_client = @saved_cs_client;
+
+--
+-- Table structure for table `acd_10`
+--
+
+DROP TABLE IF EXISTS `acd_10`;
+SET @saved_cs_client     = @@character_set_client;
+SET character_set_client = utf8;
+CREATE TABLE `acd_10` (
+  `sessionid` varchar(30) default NULL,
+  `callid` varchar(30) default NULL,
+  `agentid` varchar(30) default NULL,
+  `agentdn` varchar(30) default NULL,
+  `skill` varchar(255) default NULL,
+  `caller` varchar(30) default NULL,
+  `callee` varchar(30) default NULL,
+  `waitbegin` datetime default NULL,
+  `waitend` datetime default NULL,
+  `ackbegin` datetime default NULL,
+  `ackend` datetime default NULL,
+  `callbegin` datetime default NULL,
+  `callend` datetime default NULL,
+  `calltype` varchar(30) default NULL,
+  `calldirect` varchar(30) default NULL,
+  `release_cause` varchar(30) default NULL,
+  `record_filename` varchar(255) default NULL,
+  `src_IP` varchar(32) default NULL,
+  KEY `callid` (`callid`),
+  KEY `agentid` (`agentid`),
+  KEY `agentdn` (`agentdn`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+SET character_set_client = @saved_cs_client;
+
+--
+-- Table structure for table `acd_11`
+--
+
+DROP TABLE IF EXISTS `acd_11`;
+SET @saved_cs_client     = @@character_set_client;
+SET character_set_client = utf8;
+CREATE TABLE `acd_11` (
+  `sessionid` varchar(30) default NULL,
+  `callid` varchar(30) default NULL,
+  `agentid` varchar(30) default NULL,
+  `agentdn` varchar(30) default NULL,
+  `skill` varchar(255) default NULL,
+  `caller` varchar(30) default NULL,
+  `callee` varchar(30) default NULL,
+  `waitbegin` datetime default NULL,
+  `waitend` datetime default NULL,
+  `ackbegin` datetime default NULL,
+  `ackend` datetime default NULL,
+  `callbegin` datetime default NULL,
+  `callend` datetime default NULL,
+  `calltype` varchar(30) default NULL,
+  `calldirect` varchar(30) default NULL,
+  `release_cause` varchar(30) default NULL,
+  `record_filename` varchar(255) default NULL,
+  `src_IP` varchar(32) default NULL,
+  KEY `callid` (`callid`),
+  KEY `agentid` (`agentid`),
+  KEY `agentdn` (`agentdn`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+SET character_set_client = @saved_cs_client;
+
+--
+-- Table structure for table `acd_12`
+--
+
+DROP TABLE IF EXISTS `acd_12`;
+SET @saved_cs_client     = @@character_set_client;
+SET character_set_client = utf8;
+CREATE TABLE `acd_12` (
+  `sessionid` varchar(30) default NULL,
+  `callid` varchar(30) default NULL,
+  `agentid` varchar(30) default NULL,
+  `agentdn` varchar(30) default NULL,
+  `skill` varchar(255) default NULL,
+  `caller` varchar(30) default NULL,
+  `callee` varchar(30) default NULL,
+  `waitbegin` datetime default NULL,
+  `waitend` datetime default NULL,
+  `ackbegin` datetime default NULL,
+  `ackend` datetime default NULL,
+  `callbegin` datetime default NULL,
+  `callend` datetime default NULL,
+  `calltype` varchar(30) default NULL,
+  `calldirect` varchar(30) default NULL,
+  `release_cause` varchar(30) default NULL,
+  `record_filename` varchar(255) default NULL,
+  `src_IP` varchar(32) default NULL,
+  KEY `callid` (`callid`),
+  KEY `agentid` (`agentid`),
+  KEY `agentdn` (`agentdn`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+SET character_set_client = @saved_cs_client;
+
+--
+-- Table structure for table `fs_01`
+--
+
+DROP TABLE IF EXISTS `fs_01`;
+SET @saved_cs_client     = @@character_set_client;
+SET character_set_client = utf8;
+CREATE TABLE `fs_01` (
+  `caller_id_name` varchar(30) default NULL,
+  `caller_id_number` varchar(30) default NULL,
+  `destination_number` varchar(30) default NULL,
+  `context` varchar(20) default NULL,
+  `start_stamp` datetime default NULL,
+  `answer_stamp` datetime default NULL,
+  `end_stamp` datetime default NULL,
+  `duration` int(11) default NULL,
+  `billsec` int(11) default NULL,
+  `hangup_cause` varchar(50) default NULL,
+  `uuid_1` bigint(64) unsigned default NULL,
+  `uuid_2` bigint(64) unsigned default NULL,
+  `buuid_1` bigint(64) unsigned default NULL,
+  `buuid_2` bigint(64) unsigned default NULL,
+  `accountcode` varchar(10) default NULL,
+  `record` varchar(512) default NULL,
+  `fs_IP` varchar(32) default NULL,
+  KEY `uuid_1` (`uuid_1`,`uuid_2`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+SET character_set_client = @saved_cs_client;
+
+--
+-- Table structure for table `fs_02`
+--
+
+DROP TABLE IF EXISTS `fs_02`;
+SET @saved_cs_client     = @@character_set_client;
+SET character_set_client = utf8;
+CREATE TABLE `fs_02` (
+  `caller_id_name` varchar(30) default NULL,
+  `caller_id_number` varchar(30) default NULL,
+  `destination_number` varchar(30) default NULL,
+  `context` varchar(20) default NULL,
+  `start_stamp` datetime default NULL,
+  `answer_stamp` datetime default NULL,
+  `end_stamp` datetime default NULL,
+  `duration` int(11) default NULL,
+  `billsec` int(11) default NULL,
+  `hangup_cause` varchar(50) default NULL,
+  `uuid_1` bigint(64) unsigned default NULL,
+  `uuid_2` bigint(64) unsigned default NULL,
+  `buuid_1` bigint(64) unsigned default NULL,
+  `buuid_2` bigint(64) unsigned default NULL,
+  `accountcode` varchar(10) default NULL,
+  `record` varchar(512) default NULL,
+  `fs_IP` varchar(32) default NULL,
+  KEY `uuid_1` (`uuid_1`,`uuid_2`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+SET character_set_client = @saved_cs_client;
+
+--
+-- Table structure for table `fs_03`
+--
+
+DROP TABLE IF EXISTS `fs_03`;
+SET @saved_cs_client     = @@character_set_client;
+SET character_set_client = utf8;
+CREATE TABLE `fs_03` (
+  `caller_id_name` varchar(30) default NULL,
+  `caller_id_number` varchar(30) default NULL,
+  `destination_number` varchar(30) default NULL,
+  `context` varchar(20) default NULL,
+  `start_stamp` datetime default NULL,
+  `answer_stamp` datetime default NULL,
+  `end_stamp` datetime default NULL,
+  `duration` int(11) default NULL,
+  `billsec` int(11) default NULL,
+  `hangup_cause` varchar(50) default NULL,
+  `uuid_1` bigint(64) unsigned default NULL,
+  `uuid_2` bigint(64) unsigned default NULL,
+  `buuid_1` bigint(64) unsigned default NULL,
+  `buuid_2` bigint(64) unsigned default NULL,
+  `accountcode` varchar(10) default NULL,
+  `record` varchar(512) default NULL,
+  `fs_IP` varchar(32) default NULL,
+  KEY `uuid_1` (`uuid_1`,`uuid_2`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+SET character_set_client = @saved_cs_client;
+
+--
+-- Table structure for table `fs_04`
+--
+
+DROP TABLE IF EXISTS `fs_04`;
+SET @saved_cs_client     = @@character_set_client;
+SET character_set_client = utf8;
+CREATE TABLE `fs_04` (
+  `caller_id_name` varchar(30) default NULL,
+  `caller_id_number` varchar(30) default NULL,
+  `destination_number` varchar(30) default NULL,
+  `context` varchar(20) default NULL,
+  `start_stamp` datetime default NULL,
+  `answer_stamp` datetime default NULL,
+  `end_stamp` datetime default NULL,
+  `duration` int(11) default NULL,
+  `billsec` int(11) default NULL,
+  `hangup_cause` varchar(50) default NULL,
+  `uuid_1` bigint(64) unsigned default NULL,
+  `uuid_2` bigint(64) unsigned default NULL,
+  `buuid_1` bigint(64) unsigned default NULL,
+  `buuid_2` bigint(64) unsigned default NULL,
+  `accountcode` varchar(10) default NULL,
+  `record` varchar(512) default NULL,
+  `fs_IP` varchar(32) default NULL,
+  KEY `uuid_1` (`uuid_1`,`uuid_2`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+SET character_set_client = @saved_cs_client;
+
+--
+-- Table structure for table `fs_05`
+--
+
+DROP TABLE IF EXISTS `fs_05`;
+SET @saved_cs_client     = @@character_set_client;
+SET character_set_client = utf8;
+CREATE TABLE `fs_05` (
+  `caller_id_name` varchar(30) default NULL,
+  `caller_id_number` varchar(30) default NULL,
+  `destination_number` varchar(30) default NULL,
+  `context` varchar(20) default NULL,
+  `start_stamp` datetime default NULL,
+  `answer_stamp` datetime default NULL,
+  `end_stamp` datetime default NULL,
+  `duration` int(11) default NULL,
+  `billsec` int(11) default NULL,
+  `hangup_cause` varchar(50) default NULL,
+  `uuid_1` bigint(64) unsigned default NULL,
+  `uuid_2` bigint(64) unsigned default NULL,
+  `buuid_1` bigint(64) unsigned default NULL,
+  `buuid_2` bigint(64) unsigned default NULL,
+  `accountcode` varchar(10) default NULL,
+  `record` varchar(512) default NULL,
+  `fs_IP` varchar(32) default NULL,
+  KEY `uuid_1` (`uuid_1`,`uuid_2`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+SET character_set_client = @saved_cs_client;
+
+--
+-- Table structure for table `fs_06`
+--
+
+DROP TABLE IF EXISTS `fs_06`;
+SET @saved_cs_client     = @@character_set_client;
+SET character_set_client = utf8;
+CREATE TABLE `fs_06` (
+  `caller_id_name` varchar(30) default NULL,
+  `caller_id_number` varchar(30) default NULL,
+  `destination_number` varchar(30) default NULL,
+  `context` varchar(20) default NULL,
+  `start_stamp` datetime default NULL,
+  `answer_stamp` datetime default NULL,
+  `end_stamp` datetime default NULL,
+  `duration` int(11) default NULL,
+  `billsec` int(11) default NULL,
+  `hangup_cause` varchar(50) default NULL,
+  `uuid_1` bigint(64) unsigned default NULL,
+  `uuid_2` bigint(64) unsigned default NULL,
+  `buuid_1` bigint(64) unsigned default NULL,
+  `buuid_2` bigint(64) unsigned default NULL,
+  `accountcode` varchar(10) default NULL,
+  `record` varchar(512) default NULL,
+  `fs_IP` varchar(32) default NULL,
+  KEY `uuid_1` (`uuid_1`,`uuid_2`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+SET character_set_client = @saved_cs_client;
+
+--
+-- Table structure for table `fs_07`
+--
+
+DROP TABLE IF EXISTS `fs_07`;
+SET @saved_cs_client     = @@character_set_client;
+SET character_set_client = utf8;
+CREATE TABLE `fs_07` (
+  `caller_id_name` varchar(30) default NULL,
+  `caller_id_number` varchar(30) default NULL,
+  `destination_number` varchar(30) default NULL,
+  `context` varchar(20) default NULL,
+  `start_stamp` datetime default NULL,
+  `answer_stamp` datetime default NULL,
+  `end_stamp` datetime default NULL,
+  `duration` int(11) default NULL,
+  `billsec` int(11) default NULL,
+  `hangup_cause` varchar(50) default NULL,
+  `uuid_1` bigint(64) unsigned default NULL,
+  `uuid_2` bigint(64) unsigned default NULL,
+  `buuid_1` bigint(64) unsigned default NULL,
+  `buuid_2` bigint(64) unsigned default NULL,
+  `accountcode` varchar(10) default NULL,
+  `record` varchar(512) default NULL,
+  `fs_IP` varchar(32) default NULL,
+  KEY `uuid_1` (`uuid_1`,`uuid_2`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+SET character_set_client = @saved_cs_client;
+
+--
+-- Table structure for table `fs_08`
+--
+
+DROP TABLE IF EXISTS `fs_08`;
+SET @saved_cs_client     = @@character_set_client;
+SET character_set_client = utf8;
+CREATE TABLE `fs_08` (
+  `caller_id_name` varchar(30) default NULL,
+  `caller_id_number` varchar(30) default NULL,
+  `destination_number` varchar(30) default NULL,
+  `context` varchar(20) default NULL,
+  `start_stamp` datetime default NULL,
+  `answer_stamp` datetime default NULL,
+  `end_stamp` datetime default NULL,
+  `duration` int(11) default NULL,
+  `billsec` int(11) default NULL,
+  `hangup_cause` varchar(50) default NULL,
+  `uuid_1` bigint(64) unsigned default NULL,
+  `uuid_2` bigint(64) unsigned default NULL,
+  `buuid_1` bigint(64) unsigned default NULL,
+  `buuid_2` bigint(64) unsigned default NULL,
+  `accountcode` varchar(10) default NULL,
+  `record` varchar(512) default NULL,
+  `fs_IP` varchar(32) default NULL,
+  KEY `uuid_1` (`uuid_1`,`uuid_2`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+SET character_set_client = @saved_cs_client;
+
+--
+-- Table structure for table `fs_09`
+--
+
+DROP TABLE IF EXISTS `fs_09`;
+SET @saved_cs_client     = @@character_set_client;
+SET character_set_client = utf8;
+CREATE TABLE `fs_09` (
+  `caller_id_name` varchar(30) default NULL,
+  `caller_id_number` varchar(30) default NULL,
+  `destination_number` varchar(30) default NULL,
+  `context` varchar(20) default NULL,
+  `start_stamp` datetime default NULL,
+  `answer_stamp` datetime default NULL,
+  `end_stamp` datetime default NULL,
+  `duration` int(11) default NULL,
+  `billsec` int(11) default NULL,
+  `hangup_cause` varchar(50) default NULL,
+  `uuid_1` bigint(64) unsigned default NULL,
+  `uuid_2` bigint(64) unsigned default NULL,
+  `buuid_1` bigint(64) unsigned default NULL,
+  `buuid_2` bigint(64) unsigned default NULL,
+  `accountcode` varchar(10) default NULL,
+  `record` varchar(512) default NULL,
+  `fs_IP` varchar(32) default NULL,
+  KEY `uuid_1` (`uuid_1`,`uuid_2`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+SET character_set_client = @saved_cs_client;
+
+--
+-- Table structure for table `fs_10`
+--
+
+DROP TABLE IF EXISTS `fs_10`;
+SET @saved_cs_client     = @@character_set_client;
+SET character_set_client = utf8;
+CREATE TABLE `fs_10` (
+  `caller_id_name` varchar(30) default NULL,
+  `caller_id_number` varchar(30) default NULL,
+  `destination_number` varchar(30) default NULL,
+  `context` varchar(20) default NULL,
+  `start_stamp` datetime default NULL,
+  `answer_stamp` datetime default NULL,
+  `end_stamp` datetime default NULL,
+  `duration` int(11) default NULL,
+  `billsec` int(11) default NULL,
+  `hangup_cause` varchar(50) default NULL,
+  `uuid_1` bigint(64) unsigned default NULL,
+  `uuid_2` bigint(64) unsigned default NULL,
+  `buuid_1` bigint(64) unsigned default NULL,
+  `buuid_2` bigint(64) unsigned default NULL,
+  `accountcode` varchar(10) default NULL,
+  `record` varchar(512) default NULL,
+  `fs_IP` varchar(32) default NULL,
+  KEY `uuid_1` (`uuid_1`,`uuid_2`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+SET character_set_client = @saved_cs_client;
+
+--
+-- Table structure for table `fs_11`
+--
+
+DROP TABLE IF EXISTS `fs_11`;
+SET @saved_cs_client     = @@character_set_client;
+SET character_set_client = utf8;
+CREATE TABLE `fs_11` (
+  `caller_id_name` varchar(30) default NULL,
+  `caller_id_number` varchar(30) default NULL,
+  `destination_number` varchar(30) default NULL,
+  `context` varchar(20) default NULL,
+  `start_stamp` datetime default NULL,
+  `answer_stamp` datetime default NULL,
+  `end_stamp` datetime default NULL,
+  `duration` int(11) default NULL,
+  `billsec` int(11) default NULL,
+  `hangup_cause` varchar(50) default NULL,
+  `uuid_1` bigint(64) unsigned default NULL,
+  `uuid_2` bigint(64) unsigned default NULL,
+  `buuid_1` bigint(64) unsigned default NULL,
+  `buuid_2` bigint(64) unsigned default NULL,
+  `accountcode` varchar(10) default NULL,
+  `record` varchar(512) default NULL,
+  `fs_IP` varchar(32) default NULL,
+  KEY `uuid_1` (`uuid_1`,`uuid_2`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+SET character_set_client = @saved_cs_client;
+
+--
+-- Table structure for table `fs_12`
+--
+
+DROP TABLE IF EXISTS `fs_12`;
+SET @saved_cs_client     = @@character_set_client;
+SET character_set_client = utf8;
+CREATE TABLE `fs_12` (
+  `caller_id_name` varchar(30) default NULL,
+  `caller_id_number` varchar(30) default NULL,
+  `destination_number` varchar(30) default NULL,
+  `context` varchar(20) default NULL,
+  `start_stamp` datetime default NULL,
+  `answer_stamp` datetime default NULL,
+  `end_stamp` datetime default NULL,
+  `duration` int(11) default NULL,
+  `billsec` int(11) default NULL,
+  `hangup_cause` varchar(50) default NULL,
+  `uuid_1` bigint(64) unsigned default NULL,
+  `uuid_2` bigint(64) unsigned default NULL,
+  `buuid_1` bigint(64) unsigned default NULL,
+  `buuid_2` bigint(64) unsigned default NULL,
+  `accountcode` varchar(10) default NULL,
+  `record` varchar(512) default NULL,
+  `fs_IP` varchar(32) default NULL,
+  KEY `uuid_1` (`uuid_1`,`uuid_2`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+SET character_set_client = @saved_cs_client;
+
+--
+-- Table structure for table `ivr_01`
+--
+
+DROP TABLE IF EXISTS `ivr_01`;
+SET @saved_cs_client     = @@character_set_client;
+SET character_set_client = utf8;
+CREATE TABLE `ivr_01` (
+  `caller_id_number` varchar(30) default NULL,
+  `destination_number` varchar(30) default NULL,
+  `start_stamp` datetime default NULL,
+  `answer_stamp` datetime default NULL,
+  `end_stamp` datetime default NULL,
+  `duration` int(11) default NULL,
+  `billsec` int(11) default NULL,
+  `hangup_cause` varchar(50) default NULL,
+  `uuid_1` bigint(64) unsigned default NULL,
+  `uuid_2` bigint(64) unsigned default NULL,
+  `src_IP` varchar(32) default NULL,
+  KEY `uuid_1` (`uuid_1`,`uuid_2`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+SET character_set_client = @saved_cs_client;
+
+--
+-- Table structure for table `ivr_02`
+--
+
+DROP TABLE IF EXISTS `ivr_02`;
+SET @saved_cs_client     = @@character_set_client;
+SET character_set_client = utf8;
+CREATE TABLE `ivr_02` (
+  `caller_id_number` varchar(30) default NULL,
+  `destination_number` varchar(30) default NULL,
+  `start_stamp` datetime default NULL,
+  `answer_stamp` datetime default NULL,
+  `end_stamp` datetime default NULL,
+  `duration` int(11) default NULL,
+  `billsec` int(11) default NULL,
+  `hangup_cause` varchar(50) default NULL,
+  `uuid_1` bigint(64) unsigned default NULL,
+  `uuid_2` bigint(64) unsigned default NULL,
+  `src_IP` varchar(32) default NULL,
+  KEY `uuid_1` (`uuid_1`,`uuid_2`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+SET character_set_client = @saved_cs_client;
+
+--
+-- Table structure for table `ivr_03`
+--
+
+DROP TABLE IF EXISTS `ivr_03`;
+SET @saved_cs_client     = @@character_set_client;
+SET character_set_client = utf8;
+CREATE TABLE `ivr_03` (
+  `caller_id_number` varchar(30) default NULL,
+  `destination_number` varchar(30) default NULL,
+  `start_stamp` datetime default NULL,
+  `answer_stamp` datetime default NULL,
+  `end_stamp` datetime default NULL,
+  `duration` int(11) default NULL,
+  `billsec` int(11) default NULL,
+  `hangup_cause` varchar(50) default NULL,
+  `uuid_1` bigint(64) unsigned default NULL,
+  `uuid_2` bigint(64) unsigned default NULL,
+  `src_IP` varchar(32) default NULL,
+  KEY `uuid_1` (`uuid_1`,`uuid_2`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+SET character_set_client = @saved_cs_client;
+
+--
+-- Table structure for table `ivr_04`
+--
+
+DROP TABLE IF EXISTS `ivr_04`;
+SET @saved_cs_client     = @@character_set_client;
+SET character_set_client = utf8;
+CREATE TABLE `ivr_04` (
+  `caller_id_number` varchar(30) default NULL,
+  `destination_number` varchar(30) default NULL,
+  `start_stamp` datetime default NULL,
+  `answer_stamp` datetime default NULL,
+  `end_stamp` datetime default NULL,
+  `duration` int(11) default NULL,
+  `billsec` int(11) default NULL,
+  `hangup_cause` varchar(50) default NULL,
+  `uuid_1` bigint(64) unsigned default NULL,
+  `uuid_2` bigint(64) unsigned default NULL,
+  `src_IP` varchar(32) default NULL,
+  KEY `uuid_1` (`uuid_1`,`uuid_2`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+SET character_set_client = @saved_cs_client;
+
+--
+-- Table structure for table `ivr_05`
+--
+
+DROP TABLE IF EXISTS `ivr_05`;
+SET @saved_cs_client     = @@character_set_client;
+SET character_set_client = utf8;
+CREATE TABLE `ivr_05` (
+  `caller_id_number` varchar(30) default NULL,
+  `destination_number` varchar(30) default NULL,
+  `start_stamp` datetime default NULL,
+  `answer_stamp` datetime default NULL,
+  `end_stamp` datetime default NULL,
+  `duration` int(11) default NULL,
+  `billsec` int(11) default NULL,
+  `hangup_cause` varchar(50) default NULL,
+  `uuid_1` bigint(64) unsigned default NULL,
+  `uuid_2` bigint(64) unsigned default NULL,
+  `src_IP` varchar(32) default NULL,
+  KEY `uuid_1` (`uuid_1`,`uuid_2`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+SET character_set_client = @saved_cs_client;
+
+--
+-- Table structure for table `ivr_06`
+--
+
+DROP TABLE IF EXISTS `ivr_06`;
+SET @saved_cs_client     = @@character_set_client;
+SET character_set_client = utf8;
+CREATE TABLE `ivr_06` (
+  `caller_id_number` varchar(30) default NULL,
+  `destination_number` varchar(30) default NULL,
+  `start_stamp` datetime default NULL,
+  `answer_stamp` datetime default NULL,
+  `end_stamp` datetime default NULL,
+  `duration` int(11) default NULL,
+  `billsec` int(11) default NULL,
+  `hangup_cause` varchar(50) default NULL,
+  `uuid_1` bigint(64) unsigned default NULL,
+  `uuid_2` bigint(64) unsigned default NULL,
+  `src_IP` varchar(32) default NULL,
+  KEY `uuid_1` (`uuid_1`,`uuid_2`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+SET character_set_client = @saved_cs_client;
+
+--
+-- Table structure for table `ivr_07`
+--
+
+DROP TABLE IF EXISTS `ivr_07`;
+SET @saved_cs_client     = @@character_set_client;
+SET character_set_client = utf8;
+CREATE TABLE `ivr_07` (
+  `caller_id_number` varchar(30) default NULL,
+  `destination_number` varchar(30) default NULL,
+  `start_stamp` datetime default NULL,
+  `answer_stamp` datetime default NULL,
+  `end_stamp` datetime default NULL,
+  `duration` int(11) default NULL,
+  `billsec` int(11) default NULL,
+  `hangup_cause` varchar(50) default NULL,
+  `uuid_1` bigint(64) unsigned default NULL,
+  `uuid_2` bigint(64) unsigned default NULL,
+  `src_IP` varchar(32) default NULL,
+  KEY `uuid_1` (`uuid_1`,`uuid_2`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+SET character_set_client = @saved_cs_client;
+
+--
+-- Table structure for table `ivr_08`
+--
+
+DROP TABLE IF EXISTS `ivr_08`;
+SET @saved_cs_client     = @@character_set_client;
+SET character_set_client = utf8;
+CREATE TABLE `ivr_08` (
+  `caller_id_number` varchar(30) default NULL,
+  `destination_number` varchar(30) default NULL,
+  `start_stamp` datetime default NULL,
+  `answer_stamp` datetime default NULL,
+  `end_stamp` datetime default NULL,
+  `duration` int(11) default NULL,
+  `billsec` int(11) default NULL,
+  `hangup_cause` varchar(50) default NULL,
+  `uuid_1` bigint(64) unsigned default NULL,
+  `uuid_2` bigint(64) unsigned default NULL,
+  `src_IP` varchar(32) default NULL,
+  KEY `uuid_1` (`uuid_1`,`uuid_2`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+SET character_set_client = @saved_cs_client;
+
+--
+-- Table structure for table `ivr_09`
+--
+
+DROP TABLE IF EXISTS `ivr_09`;
+SET @saved_cs_client     = @@character_set_client;
+SET character_set_client = utf8;
+CREATE TABLE `ivr_09` (
+  `caller_id_number` varchar(30) default NULL,
+  `destination_number` varchar(30) default NULL,
+  `start_stamp` datetime default NULL,
+  `answer_stamp` datetime default NULL,
+  `end_stamp` datetime default NULL,
+  `duration` int(11) default NULL,
+  `billsec` int(11) default NULL,
+  `hangup_cause` varchar(50) default NULL,
+  `uuid_1` bigint(64) unsigned default NULL,
+  `uuid_2` bigint(64) unsigned default NULL,
+  `src_IP` varchar(32) default NULL,
+  KEY `uuid_1` (`uuid_1`,`uuid_2`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+SET character_set_client = @saved_cs_client;
+
+--
+-- Table structure for table `ivr_10`
+--
+
+DROP TABLE IF EXISTS `ivr_10`;
+SET @saved_cs_client     = @@character_set_client;
+SET character_set_client = utf8;
+CREATE TABLE `ivr_10` (
+  `caller_id_number` varchar(30) default NULL,
+  `destination_number` varchar(30) default NULL,
+  `start_stamp` datetime default NULL,
+  `answer_stamp` datetime default NULL,
+  `end_stamp` datetime default NULL,
+  `duration` int(11) default NULL,
+  `billsec` int(11) default NULL,
+  `hangup_cause` varchar(50) default NULL,
+  `uuid_1` bigint(64) unsigned default NULL,
+  `uuid_2` bigint(64) unsigned default NULL,
+  `src_IP` varchar(32) default NULL,
+  KEY `uuid_1` (`uuid_1`,`uuid_2`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+SET character_set_client = @saved_cs_client;
+
+--
+-- Table structure for table `ivr_11`
+--
+
+DROP TABLE IF EXISTS `ivr_11`;
+SET @saved_cs_client     = @@character_set_client;
+SET character_set_client = utf8;
+CREATE TABLE `ivr_11` (
+  `caller_id_number` varchar(30) default NULL,
+  `destination_number` varchar(30) default NULL,
+  `start_stamp` datetime default NULL,
+  `answer_stamp` datetime default NULL,
+  `end_stamp` datetime default NULL,
+  `duration` int(11) default NULL,
+  `billsec` int(11) default NULL,
+  `hangup_cause` varchar(50) default NULL,
+  `uuid_1` bigint(64) unsigned default NULL,
+  `uuid_2` bigint(64) unsigned default NULL,
+  `src_IP` varchar(32) default NULL,
+  KEY `uuid_1` (`uuid_1`,`uuid_2`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+SET character_set_client = @saved_cs_client;
+
+--
+-- Table structure for table `ivr_12`
+--
+
+DROP TABLE IF EXISTS `ivr_12`;
+SET @saved_cs_client     = @@character_set_client;
+SET character_set_client = utf8;
+CREATE TABLE `ivr_12` (
+  `caller_id_number` varchar(30) default NULL,
+  `destination_number` varchar(30) default NULL,
+  `start_stamp` datetime default NULL,
+  `answer_stamp` datetime default NULL,
+  `end_stamp` datetime default NULL,
+  `duration` int(11) default NULL,
+  `billsec` int(11) default NULL,
+  `hangup_cause` varchar(50) default NULL,
+  `uuid_1` bigint(64) unsigned default NULL,
+  `uuid_2` bigint(64) unsigned default NULL,
+  `src_IP` varchar(32) default NULL,
+  KEY `uuid_1` (`uuid_1`,`uuid_2`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+SET character_set_client = @saved_cs_client;
+
+--
+-- Current Database: `osips_db`
+--
+
+CREATE DATABASE /*!32312 IF NOT EXISTS*/ `osips_db` /*!40100 DEFAULT CHARACTER SET utf8 */;
+
+USE `osips_db`;
+
+--
+-- Table structure for table `acc`
+--
+
+DROP TABLE IF EXISTS `acc`;
+SET @saved_cs_client     = @@character_set_client;
+SET character_set_client = utf8;
+CREATE TABLE `acc` (
+  `id` int(10) unsigned NOT NULL auto_increment,
+  `method` char(16) NOT NULL default '',
+  `from_tag` char(64) NOT NULL default '',
+  `to_tag` char(64) NOT NULL default '',
+  `callid` char(64) NOT NULL default '',
+  `sip_code` char(3) NOT NULL default '',
+  `sip_reason` char(32) NOT NULL default '',
+  `time` datetime NOT NULL default '0000-00-00 00:00:00',
+  `cdr_id` bigint(11) NOT NULL default '0',
+  `duration` int(11) unsigned NOT NULL default '0',
+  `setuptime` int(11) unsigned NOT NULL default '0',
+  `created` datetime NOT NULL default '0000-00-00 00:00:00',
+  `caller_id` char(64) NOT NULL default '',
+  `callee_id` char(64) NOT NULL default '',
+  PRIMARY KEY  (`id`),
+  KEY `callid_idx` (`callid`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+SET character_set_client = @saved_cs_client;
+
+--
+-- Table structure for table `active_watchers`
+--
+
+DROP TABLE IF EXISTS `active_watchers`;
+SET @saved_cs_client     = @@character_set_client;
+SET character_set_client = utf8;
+CREATE TABLE `active_watchers` (
+  `id` int(10) unsigned NOT NULL auto_increment,
+  `presentity_uri` varchar(128) NOT NULL default '',
+  `watcher_username` varchar(64) NOT NULL default '',
+  `watcher_domain` varchar(64) NOT NULL default '',
+  `to_user` varchar(64) NOT NULL default '',
+  `to_domain` varchar(64) NOT NULL default '',
+  `event` varchar(64) NOT NULL default 'presence',
+  `event_id` varchar(64) default NULL,
+  `to_tag` varchar(64) NOT NULL default '',
+  `from_tag` varchar(64) NOT NULL default '',
+  `callid` varchar(64) NOT NULL default '',
+  `local_cseq` int(11) NOT NULL default '0',
+  `remote_cseq` int(11) NOT NULL default '0',
+  `contact` varchar(128) NOT NULL default '',
+  `record_route` text,
+  `expires` int(11) NOT NULL default '0',
+  `status` int(11) NOT NULL default '2',
+  `reason` varchar(64) NOT NULL default '',
+  `version` int(11) NOT NULL default '0',
+  `socket_info` varchar(64) NOT NULL default '',
+  `local_contact` varchar(128) NOT NULL default '',
+  PRIMARY KEY  (`id`),
+  UNIQUE KEY `active_watchers_idx` (`presentity_uri`,`callid`,`to_tag`,`from_tag`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+SET character_set_client = @saved_cs_client;
+
+--
+-- Table structure for table `address`
+--
+
+DROP TABLE IF EXISTS `address`;
+SET @saved_cs_client     = @@character_set_client;
+SET character_set_client = utf8;
+CREATE TABLE `address` (
+  `id` int(10) unsigned NOT NULL auto_increment,
+  `grp` smallint(5) unsigned NOT NULL default '0',
+  `ip` char(50) NOT NULL default '',
+  `mask` tinyint(4) NOT NULL default '32',
+  `port` smallint(5) unsigned NOT NULL default '0',
+  `proto` char(4) NOT NULL default 'any',
+  `pattern` char(64) default NULL,
+  `context_info` char(32) default NULL,
+  PRIMARY KEY  (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
+SET character_set_client = @saved_cs_client;
+
+--
+-- Table structure for table `aliases`
+--
+
+DROP TABLE IF EXISTS `aliases`;
+SET @saved_cs_client     = @@character_set_client;
+SET character_set_client = utf8;
+CREATE TABLE `aliases` (
+  `id` int(10) unsigned NOT NULL auto_increment,
+  `username` char(64) NOT NULL default '',
+  `domain` char(64) default NULL,
+  `contact` char(255) NOT NULL default '',
+  `received` char(128) default NULL,
+  `path` char(128) default NULL,
+  `expires` datetime NOT NULL default '2020-05-28 21:32:15',
+  `q` float(10,2) NOT NULL default '1.00',
+  `callid` char(255) NOT NULL default 'Default-Call-ID',
+  `cseq` int(11) NOT NULL default '13',
+  `last_modified` datetime NOT NULL default '1900-01-01 00:00:01',
+  `flags` int(11) NOT NULL default '0',
+  `cflags` int(11) NOT NULL default '0',
+  `user_agent` char(255) NOT NULL default '',
+  `socket` char(64) default NULL,
+  `methods` int(11) default NULL,
+  PRIMARY KEY  (`id`),
+  KEY `alias_idx` (`username`,`domain`,`contact`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+SET character_set_client = @saved_cs_client;
+
+--
+-- Table structure for table `carrierfailureroute`
+--
+
+DROP TABLE IF EXISTS `carrierfailureroute`;
+SET @saved_cs_client     = @@character_set_client;
+SET character_set_client = utf8;
+CREATE TABLE `carrierfailureroute` (
+  `id` int(10) unsigned NOT NULL auto_increment,
+  `carrier` int(10) unsigned NOT NULL default '0',
+  `domain` char(64) NOT NULL default '',
+  `scan_prefix` char(64) NOT NULL default '',
+  `host_name` char(128) NOT NULL default '',
+  `reply_code` char(3) NOT NULL default '',
+  `flags` int(11) unsigned NOT NULL default '0',
+  `mask` int(11) unsigned NOT NULL default '0',
+  `next_domain` char(64) NOT NULL default '',
+  `description` char(255) default NULL,
+  PRIMARY KEY  (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+SET character_set_client = @saved_cs_client;
+
+--
+-- Table structure for table `carrierroute`
+--
+
+DROP TABLE IF EXISTS `carrierroute`;
+SET @saved_cs_client     = @@character_set_client;
+SET character_set_client = utf8;
+CREATE TABLE `carrierroute` (
+  `id` int(10) unsigned NOT NULL auto_increment,
+  `carrier` int(10) unsigned NOT NULL default '0',
+  `domain` char(64) NOT NULL default '',
+  `scan_prefix` char(64) NOT NULL default '',
+  `flags` int(11) unsigned NOT NULL default '0',
+  `mask` int(11) unsigned NOT NULL default '0',
+  `prob` float NOT NULL default '0',
+  `strip` int(11) unsigned NOT NULL default '0',
+  `rewrite_host` char(128) NOT NULL default '',
+  `rewrite_prefix` char(64) NOT NULL default '',
+  `rewrite_suffix` char(64) NOT NULL default '',
+  `description` char(255) default NULL,
+  PRIMARY KEY  (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+SET character_set_client = @saved_cs_client;
+
+--
+-- Table structure for table `cdrs`
+--
+
+DROP TABLE IF EXISTS `cdrs`;
+SET @saved_cs_client     = @@character_set_client;
+SET character_set_client = utf8;
+CREATE TABLE `cdrs` (
+  `cdr_id` bigint(20) NOT NULL auto_increment,
+  `call_start_time` datetime NOT NULL default '0000-00-00 00:00:00',
+  `duration` int(10) unsigned NOT NULL default '0',
+  `sip_call_id` varchar(128) NOT NULL default '',
+  `sip_from_tag` varchar(128) NOT NULL default '',
+  `sip_to_tag` varchar(128) NOT NULL default '',
+  `created` datetime NOT NULL default '0000-00-00 00:00:00',
+  PRIMARY KEY  (`cdr_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+SET character_set_client = @saved_cs_client;
+
+--
+-- Table structure for table `cpl`
+--
+
+DROP TABLE IF EXISTS `cpl`;
+SET @saved_cs_client     = @@character_set_client;
+SET character_set_client = utf8;
+CREATE TABLE `cpl` (
+  `id` int(10) unsigned NOT NULL auto_increment,
+  `username` varchar(64) NOT NULL default '',
+  `domain` varchar(64) NOT NULL default '',
+  `cpl_xml` text,
+  `cpl_bin` text,
+  PRIMARY KEY  (`id`),
+  UNIQUE KEY `account_idx` (`username`,`domain`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+SET character_set_client = @saved_cs_client;
+
+--
+-- Table structure for table `dbaliases`
+--
+
+DROP TABLE IF EXISTS `dbaliases`;
+SET @saved_cs_client     = @@character_set_client;
+SET character_set_client = utf8;
+CREATE TABLE `dbaliases` (
+  `id` int(10) unsigned NOT NULL auto_increment,
+  `alias_username` char(64) NOT NULL default '',
+  `alias_domain` char(64) NOT NULL default '',
+  `username` char(64) NOT NULL default '',
+  `domain` char(64) NOT NULL default '',
+  PRIMARY KEY  (`id`),
+  UNIQUE KEY `alias_idx` (`alias_username`,`alias_domain`),
+  KEY `target_idx` (`username`,`domain`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+SET character_set_client = @saved_cs_client;
+
+--
+-- Table structure for table `dialog`
+--
+
+DROP TABLE IF EXISTS `dialog`;
+SET @saved_cs_client     = @@character_set_client;
+SET character_set_client = utf8;
+CREATE TABLE `dialog` (
+  `id` int(10) unsigned NOT NULL auto_increment,
+  `hash_entry` int(10) unsigned NOT NULL default '0',
+  `hash_id` int(10) unsigned NOT NULL default '0',
+  `callid` varchar(255) NOT NULL default '',
+  `from_uri` varchar(128) NOT NULL default '',
+  `from_tag` varchar(64) NOT NULL default '',
+  `to_uri` varchar(128) NOT NULL default '',
+  `to_tag` varchar(64) NOT NULL default '',
+  `caller_cseq` varchar(11) NOT NULL default '',
+  `callee_cseq` varchar(11) NOT NULL default '',
+  `caller_route_set` text,
+  `callee_route_set` text,
+  `caller_contact` varchar(128) NOT NULL default '',
+  `callee_contact` varchar(128) NOT NULL default '',
+  `caller_sock` varchar(64) NOT NULL default '',
+  `callee_sock` varchar(64) NOT NULL default '',
+  `state` int(10) unsigned NOT NULL default '0',
+  `start_time` int(10) unsigned NOT NULL default '0',
+  `timeout` int(10) unsigned NOT NULL default '0',
+  `vars` text,
+  `profiles` text,
+  `script_flags` int(10) unsigned NOT NULL default '0',
+  PRIMARY KEY  (`id`),
+  KEY `hash_idx` (`hash_entry`,`hash_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+SET character_set_client = @saved_cs_client;
+
+--
+-- Table structure for table `dialplan`
+--
+
+DROP TABLE IF EXISTS `dialplan`;
+SET @saved_cs_client     = @@character_set_client;
+SET character_set_client = utf8;
+CREATE TABLE `dialplan` (
+  `id` int(10) unsigned NOT NULL auto_increment,
+  `dpid` int(11) NOT NULL default '0',
+  `pr` int(11) NOT NULL default '0',
+  `match_op` int(11) NOT NULL default '0',
+  `match_exp` char(64) NOT NULL default '',
+  `match_len` int(11) NOT NULL default '0',
+  `subst_exp` char(64) NOT NULL default '',
+  `repl_exp` char(32) NOT NULL default '',
+  `attrs` char(32) NOT NULL default '',
+  PRIMARY KEY  (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=utf8;
+SET character_set_client = @saved_cs_client;
+
+--
+-- Table structure for table `dispatcher`
+--
+
+DROP TABLE IF EXISTS `dispatcher`;
+SET @saved_cs_client     = @@character_set_client;
+SET character_set_client = utf8;
+CREATE TABLE `dispatcher` (
+  `id` int(10) unsigned NOT NULL auto_increment,
+  `setid` int(11) NOT NULL default '0',
+  `destination` char(192) NOT NULL default '',
+  `flags` int(11) NOT NULL default '0',
+  `weight` int(11) NOT NULL default '1',
+  `attrs` char(128) NOT NULL default '',
+  `description` char(64) NOT NULL default '',
+  PRIMARY KEY  (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
+SET character_set_client = @saved_cs_client;
+
+--
+-- Table structure for table `domain`
+--
+
+DROP TABLE IF EXISTS `domain`;
+SET @saved_cs_client     = @@character_set_client;
+SET character_set_client = utf8;
+CREATE TABLE `domain` (
+  `id` int(10) unsigned NOT NULL auto_increment,
+  `domain` char(64) NOT NULL default '',
+  `last_modified` datetime NOT NULL default '1900-01-01 00:00:01',
+  PRIMARY KEY  (`id`),
+  UNIQUE KEY `domain_idx` (`domain`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+SET character_set_client = @saved_cs_client;
+
+--
+-- Table structure for table `domainpolicy`
+--
+
+DROP TABLE IF EXISTS `domainpolicy`;
+SET @saved_cs_client     = @@character_set_client;
+SET character_set_client = utf8;
+CREATE TABLE `domainpolicy` (
+  `id` int(10) unsigned NOT NULL auto_increment,
+  `rule` char(255) NOT NULL default '',
+  `type` char(255) NOT NULL default '',
+  `att` char(255) default NULL,
+  `val` char(128) default NULL,
+  `description` char(255) NOT NULL default '',
+  PRIMARY KEY  (`id`),
+  UNIQUE KEY `rav_idx` (`rule`,`att`,`val`),
+  KEY `rule_idx` (`rule`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+SET character_set_client = @saved_cs_client;
+
+--
+-- Table structure for table `dr_gateways`
+--
+
+DROP TABLE IF EXISTS `dr_gateways`;
+SET @saved_cs_client     = @@character_set_client;
+SET character_set_client = utf8;
+CREATE TABLE `dr_gateways` (
+  `gwid` int(10) unsigned NOT NULL auto_increment,
+  `type` int(11) unsigned NOT NULL default '0',
+  `address` char(128) NOT NULL default '',
+  `strip` int(11) unsigned NOT NULL default '0',
+  `pri_prefix` char(16) default NULL,
+  `attrs` char(255) default NULL,
+  `probe_mode` int(11) unsigned NOT NULL default '0',
+  `description` char(128) NOT NULL default '',
+  PRIMARY KEY  (`gwid`)
+) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
+SET character_set_client = @saved_cs_client;
+
+--
+-- Table structure for table `dr_groups`
+--
+
+DROP TABLE IF EXISTS `dr_groups`;
+SET @saved_cs_client     = @@character_set_client;
+SET character_set_client = utf8;
+CREATE TABLE `dr_groups` (
+  `id` int(10) unsigned NOT NULL auto_increment,
+  `username` char(64) NOT NULL default '',
+  `domain` char(128) NOT NULL default '',
+  `groupid` int(11) unsigned NOT NULL default '0',
+  `description` char(128) NOT NULL default '',
+  PRIMARY KEY  (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
+SET character_set_client = @saved_cs_client;
+
+--
+-- Table structure for table `dr_gw_lists`
+--
+
+DROP TABLE IF EXISTS `dr_gw_lists`;
+SET @saved_cs_client     = @@character_set_client;
+SET character_set_client = utf8;
+CREATE TABLE `dr_gw_lists` (
+  `id` int(10) unsigned NOT NULL auto_increment,
+  `gwlist` char(255) NOT NULL default '',
+  `description` char(128) NOT NULL default '',
+  PRIMARY KEY  (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
+SET character_set_client = @saved_cs_client;
+
+--
+-- Table structure for table `dr_rules`
+--
+
+DROP TABLE IF EXISTS `dr_rules`;
+SET @saved_cs_client     = @@character_set_client;
+SET character_set_client = utf8;
+CREATE TABLE `dr_rules` (
+  `ruleid` int(10) unsigned NOT NULL auto_increment,
+  `groupid` char(255) NOT NULL default '',
+  `prefix` char(64) NOT NULL default '',
+  `timerec` char(255) NOT NULL default '',
+  `priority` int(11) NOT NULL default '0',
+  `routeid` char(255) NOT NULL default '',
+  `gwlist` char(255) NOT NULL default '',
+  `attrs` char(255) default NULL,
+  `description` char(128) NOT NULL default '',
+  PRIMARY KEY  (`ruleid`)
+) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
+SET character_set_client = @saved_cs_client;
+
+--
+-- Table structure for table `globalblacklist`
+--
+
+DROP TABLE IF EXISTS `globalblacklist`;
+SET @saved_cs_client     = @@character_set_client;
+SET character_set_client = utf8;
+CREATE TABLE `globalblacklist` (
+  `id` int(10) unsigned NOT NULL auto_increment,
+  `prefix` char(64) NOT NULL default '',
+  `whitelist` tinyint(1) NOT NULL default '0',
+  `description` char(255) default NULL,
+  PRIMARY KEY  (`id`),
+  KEY `globalblacklist_idx` (`prefix`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+SET character_set_client = @saved_cs_client;
+
+--
+-- Table structure for table `grp`
+--
+
+DROP TABLE IF EXISTS `grp`;
+SET @saved_cs_client     = @@character_set_client;
+SET character_set_client = utf8;
+CREATE TABLE `grp` (
+  `id` int(10) unsigned NOT NULL auto_increment,
+  `username` char(64) NOT NULL default '',
+  `domain` char(64) NOT NULL default '',
+  `grp` char(64) NOT NULL default '',
+  `last_modified` datetime NOT NULL default '1900-01-01 00:00:01',
+  PRIMARY KEY  (`id`),
+  UNIQUE KEY `account_group_idx` (`username`,`domain`,`grp`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+SET character_set_client = @saved_cs_client;
+
+--
+-- Table structure for table `gw`
+--
+
+DROP TABLE IF EXISTS `gw`;
+SET @saved_cs_client     = @@character_set_client;
+SET character_set_client = utf8;
+CREATE TABLE `gw` (
+  `id` int(10) unsigned NOT NULL auto_increment,
+  `gw_name` char(128) NOT NULL default '',
+  `grp_id` int(10) unsigned NOT NULL default '0',
+  `ip_addr` char(15) NOT NULL default '',
+  `port` smallint(5) unsigned default NULL,
+  `uri_scheme` tinyint(3) unsigned default NULL,
+  `transport` tinyint(3) unsigned default NULL,
+  `strip` tinyint(3) unsigned default NULL,
+  `tag` char(16) default NULL,
+  `flags` int(10) unsigned NOT NULL default '0',
+  PRIMARY KEY  (`id`),
+  UNIQUE KEY `gw_name_idx` (`gw_name`),
+  KEY `grp_id_idx` (`grp_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+SET character_set_client = @saved_cs_client;
+
+--
+-- Table structure for table `imc_members`
+--
+
+DROP TABLE IF EXISTS `imc_members`;
+SET @saved_cs_client     = @@character_set_client;
+SET character_set_client = utf8;
+CREATE TABLE `imc_members` (
+  `id` int(10) unsigned NOT NULL auto_increment,
+  `username` char(64) NOT NULL default '',
+  `domain` char(64) NOT NULL default '',
+  `room` char(64) NOT NULL default '',
+  `flag` int(11) NOT NULL default '0',
+  PRIMARY KEY  (`id`),
+  UNIQUE KEY `account_room_idx` (`username`,`domain`,`room`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+SET character_set_client = @saved_cs_client;
+
+--
+-- Table structure for table `imc_rooms`
+--
+
+DROP TABLE IF EXISTS `imc_rooms`;
+SET @saved_cs_client     = @@character_set_client;
+SET character_set_client = utf8;
+CREATE TABLE `imc_rooms` (
+  `id` int(10) unsigned NOT NULL auto_increment,
+  `name` char(64) NOT NULL default '',
+  `domain` char(64) NOT NULL default '',
+  `flag` int(11) NOT NULL default '0',
+  PRIMARY KEY  (`id`),
+  UNIQUE KEY `name_domain_idx` (`name`,`domain`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+SET character_set_client = @saved_cs_client;
+
+--
+-- Table structure for table `lcr`
+--
+
+DROP TABLE IF EXISTS `lcr`;
+SET @saved_cs_client     = @@character_set_client;
+SET character_set_client = utf8;
+CREATE TABLE `lcr` (
+  `id` int(10) unsigned NOT NULL auto_increment,
+  `prefix` char(16) default NULL,
+  `from_uri` char(64) default NULL,
+  `grp_id` int(10) unsigned NOT NULL default '0',
+  `priority` int(10) unsigned NOT NULL default '0',
+  PRIMARY KEY  (`id`),
+  KEY `prefix_idx` (`prefix`),
+  KEY `from_uri_idx` (`from_uri`),
+  KEY `grp_id_idx` (`grp_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+SET character_set_client = @saved_cs_client;
+
+--
+-- Table structure for table `load_balancer`
+--
+
+DROP TABLE IF EXISTS `load_balancer`;
+SET @saved_cs_client     = @@character_set_client;
+SET character_set_client = utf8;
+CREATE TABLE `load_balancer` (
+  `id` int(10) unsigned NOT NULL auto_increment,
+  `group_id` int(11) unsigned NOT NULL default '0',
+  `dst_uri` char(128) NOT NULL default '',
+  `resources` char(255) NOT NULL default '',
+  `probe_mode` int(11) unsigned NOT NULL default '0',
+  `description` char(128) NOT NULL default '',
+  PRIMARY KEY  (`id`),
+  KEY `dsturi_idx` (`dst_uri`)
+) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
+SET character_set_client = @saved_cs_client;
+
+--
+-- Table structure for table `location`
+--
+
+DROP TABLE IF EXISTS `location`;
+SET @saved_cs_client     = @@character_set_client;
+SET character_set_client = utf8;
+CREATE TABLE `location` (
+  `id` int(10) unsigned NOT NULL auto_increment,
+  `username` char(64) NOT NULL default '',
+  `domain` char(64) default NULL,
+  `contact` char(255) NOT NULL default '',
+  `received` char(128) default NULL,
+  `path` char(128) default NULL,
+  `expires` datetime NOT NULL default '2020-05-28 21:32:15',
+  `q` float(10,2) NOT NULL default '1.00',
+  `callid` char(255) NOT NULL default 'Default-Call-ID',
+  `cseq` int(11) NOT NULL default '13',
+  `last_modified` datetime NOT NULL default '1900-01-01 00:00:01',
+  `flags` int(11) NOT NULL default '0',
+  `cflags` int(11) NOT NULL default '0',
+  `user_agent` char(255) NOT NULL default '',
+  `socket` char(64) default NULL,
+  `methods` int(11) default NULL,
+  PRIMARY KEY  (`id`),
+  KEY `account_contact_idx` (`username`,`domain`,`contact`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+SET character_set_client = @saved_cs_client;
+
+--
+-- Table structure for table `missed_calls`
+--
+
+DROP TABLE IF EXISTS `missed_calls`;
+SET @saved_cs_client     = @@character_set_client;
+SET character_set_client = utf8;
+CREATE TABLE `missed_calls` (
+  `id` int(10) unsigned NOT NULL auto_increment,
+  `method` char(16) NOT NULL default '',
+  `from_tag` char(64) NOT NULL default '',
+  `to_tag` char(64) NOT NULL default '',
+  `callid` char(64) NOT NULL default '',
+  `sip_code` char(3) NOT NULL default '',
+  `sip_reason` char(32) NOT NULL default '',
+  `time` datetime NOT NULL default '0000-00-00 00:00:00',
+  PRIMARY KEY  (`id`),
+  KEY `callid_idx` (`callid`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+SET character_set_client = @saved_cs_client;
+
+--
+-- Table structure for table `nh_sockets`
+--
+
+DROP TABLE IF EXISTS `nh_sockets`;
+SET @saved_cs_client     = @@character_set_client;
+SET character_set_client = utf8;
+CREATE TABLE `nh_sockets` (
+  `id` int(10) unsigned NOT NULL auto_increment,
+  `rtpproxy_sock` text NOT NULL,
+  `set_id` int(10) unsigned NOT NULL default '0',
+  PRIMARY KEY  (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+SET character_set_client = @saved_cs_client;
+
+--
+-- Table structure for table `pdt`
+--
+
+DROP TABLE IF EXISTS `pdt`;
+SET @saved_cs_client     = @@character_set_client;
+SET character_set_client = utf8;
+CREATE TABLE `pdt` (
+  `id` int(10) unsigned NOT NULL auto_increment,
+  `sdomain` char(128) NOT NULL default '',
+  `prefix` char(32) NOT NULL default '',
+  `domain` char(128) NOT NULL default '',
+  PRIMARY KEY  (`id`),
+  UNIQUE KEY `sdomain_prefix_idx` (`sdomain`,`prefix`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+SET character_set_client = @saved_cs_client;
+
+--
+-- Table structure for table `presentity`
+--
+
+DROP TABLE IF EXISTS `presentity`;
+SET @saved_cs_client     = @@character_set_client;
+SET character_set_client = utf8;
+CREATE TABLE `presentity` (
+  `id` int(10) unsigned NOT NULL auto_increment,
+  `username` varchar(64) NOT NULL default '',
+  `domain` varchar(64) NOT NULL default '',
+  `event` varchar(64) NOT NULL default '',
+  `etag` varchar(64) NOT NULL default '',
+  `expires` int(11) NOT NULL default '0',
+  `received_time` int(11) NOT NULL default '0',
+  `body` blob NOT NULL,
+  `extra_hdrs` blob NOT NULL,
+  `sender` varchar(128) NOT NULL default '',
+  PRIMARY KEY  (`id`),
+  UNIQUE KEY `presentity_idx` (`username`,`domain`,`event`,`etag`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+SET character_set_client = @saved_cs_client;
+
+--
+-- Table structure for table `pua`
+--
+
+DROP TABLE IF EXISTS `pua`;
+SET @saved_cs_client     = @@character_set_client;
+SET character_set_client = utf8;
+CREATE TABLE `pua` (
+  `id` int(10) unsigned NOT NULL auto_increment,
+  `pres_uri` varchar(128) NOT NULL default '',
+  `pres_id` varchar(255) NOT NULL default '',
+  `event` int(11) NOT NULL default '0',
+  `expires` int(11) NOT NULL default '0',
+  `desired_expires` int(11) NOT NULL default '0',
+  `flag` int(11) NOT NULL default '0',
+  `etag` varchar(64) default NULL,
+  `tuple_id` varchar(64) default NULL,
+  `watcher_uri` varchar(128) default NULL,
+  `to_uri` varchar(128) default NULL,
+  `call_id` varchar(64) default NULL,
+  `to_tag` varchar(64) default NULL,
+  `from_tag` varchar(64) default NULL,
+  `cseq` int(11) default NULL,
+  `record_route` text,
+  `contact` varchar(128) default NULL,
+  `remote_contact` varchar(128) default NULL,
+  `version` int(11) default NULL,
+  `extra_headers` text,
+  PRIMARY KEY  (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+SET character_set_client = @saved_cs_client;
+
+--
+-- Table structure for table `re_grp`
+--
+
+DROP TABLE IF EXISTS `re_grp`;
+SET @saved_cs_client     = @@character_set_client;
+SET character_set_client = utf8;
+CREATE TABLE `re_grp` (
+  `id` int(10) unsigned NOT NULL auto_increment,
+  `reg_exp` char(128) NOT NULL default '',
+  `group_id` int(11) NOT NULL default '0',
+  PRIMARY KEY  (`id`),
+  KEY `group_idx` (`group_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+SET character_set_client = @saved_cs_client;
+
+--
+-- Table structure for table `rls_presentity`
+--
+
+DROP TABLE IF EXISTS `rls_presentity`;
+SET @saved_cs_client     = @@character_set_client;
+SET character_set_client = utf8;
+CREATE TABLE `rls_presentity` (
+  `id` int(10) unsigned NOT NULL auto_increment,
+  `rlsubs_did` varchar(255) NOT NULL default '',
+  `resource_uri` varchar(128) NOT NULL default '',
+  `content_type` varchar(255) NOT NULL default '',
+  `presence_state` blob NOT NULL,
+  `expires` int(11) NOT NULL default '0',
+  `updated` int(11) NOT NULL default '0',
+  `auth_state` int(11) NOT NULL default '0',
+  `reason` varchar(64) NOT NULL default '',
+  PRIMARY KEY  (`id`),
+  UNIQUE KEY `rls_presentity_idx` (`rlsubs_did`,`resource_uri`),
+  KEY `updated_idx` (`updated`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+SET character_set_client = @saved_cs_client;
+
+--
+-- Table structure for table `rls_watchers`
+--
+
+DROP TABLE IF EXISTS `rls_watchers`;
+SET @saved_cs_client     = @@character_set_client;
+SET character_set_client = utf8;
+CREATE TABLE `rls_watchers` (
+  `id` int(10) unsigned NOT NULL auto_increment,
+  `presentity_uri` varchar(128) NOT NULL default '',
+  `to_user` varchar(64) NOT NULL default '',
+  `to_domain` varchar(64) NOT NULL default '',
+  `watcher_username` varchar(64) NOT NULL default '',
+  `watcher_domain` varchar(64) NOT NULL default '',
+  `event` varchar(64) NOT NULL default 'presence',
+  `event_id` varchar(64) default NULL,
+  `to_tag` varchar(64) NOT NULL default '',
+  `from_tag` varchar(64) NOT NULL default '',
+  `callid` varchar(64) NOT NULL default '',
+  `local_cseq` int(11) NOT NULL default '0',
+  `remote_cseq` int(11) NOT NULL default '0',
+  `contact` varchar(64) NOT NULL default '',
+  `record_route` text,
+  `expires` int(11) NOT NULL default '0',
+  `status` int(11) NOT NULL default '2',
+  `reason` varchar(64) NOT NULL default '',
+  `version` int(11) NOT NULL default '0',
+  `socket_info` varchar(64) NOT NULL default '',
+  `local_contact` varchar(128) NOT NULL default '',
+  PRIMARY KEY  (`id`),
+  UNIQUE KEY `rls_watcher_idx` (`presentity_uri`,`callid`,`to_tag`,`from_tag`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+SET character_set_client = @saved_cs_client;
+
+--
+-- Table structure for table `route_tree`
+--
+
+DROP TABLE IF EXISTS `route_tree`;
+SET @saved_cs_client     = @@character_set_client;
+SET character_set_client = utf8;
+CREATE TABLE `route_tree` (
+  `id` int(10) unsigned NOT NULL auto_increment,
+  `carrier` char(64) default NULL,
+  PRIMARY KEY  (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+SET character_set_client = @saved_cs_client;
+
+--
+-- Table structure for table `silo`
+--
+
+DROP TABLE IF EXISTS `silo`;
+SET @saved_cs_client     = @@character_set_client;
+SET character_set_client = utf8;
+CREATE TABLE `silo` (
+  `id` int(10) unsigned NOT NULL auto_increment,
+  `src_addr` varchar(128) NOT NULL default '',
+  `dst_addr` varchar(128) NOT NULL default '',
+  `username` varchar(64) NOT NULL default '',
+  `domain` varchar(64) NOT NULL default '',
+  `inc_time` int(11) NOT NULL default '0',
+  `exp_time` int(11) NOT NULL default '0',
+  `snd_time` int(11) NOT NULL default '0',
+  `ctype` varchar(32) NOT NULL default 'text/plain',
+  `body` blob NOT NULL,
+  PRIMARY KEY  (`id`),
+  KEY `account_idx` (`username`,`domain`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+SET character_set_client = @saved_cs_client;
+
+--
+-- Table structure for table `sip_trace`
+--
+
+DROP TABLE IF EXISTS `sip_trace`;
+SET @saved_cs_client     = @@character_set_client;
+SET character_set_client = utf8;
+CREATE TABLE `sip_trace` (
+  `id` int(10) unsigned NOT NULL auto_increment,
+  `time_stamp` datetime NOT NULL default '1900-01-01 00:00:01',
+  `callid` varchar(255) NOT NULL default '',
+  `traced_user` varchar(128) default NULL,
+  `msg` text NOT NULL,
+  `method` varchar(32) NOT NULL default '',
+  `status` varchar(128) default NULL,
+  `fromip` varchar(50) NOT NULL default '',
+  `toip` varchar(50) NOT NULL default '',
+  `fromtag` varchar(64) NOT NULL default '',
+  `direction` varchar(4) NOT NULL default '',
+  PRIMARY KEY  (`id`),
+  KEY `traced_user_idx` (`traced_user`),
+  KEY `date_idx` (`time_stamp`),
+  KEY `fromip_idx` (`fromip`),
+  KEY `callid_idx` (`callid`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+SET character_set_client = @saved_cs_client;
+
+--
+-- Table structure for table `speed_dial`
+--
+
+DROP TABLE IF EXISTS `speed_dial`;
+SET @saved_cs_client     = @@character_set_client;
+SET character_set_client = utf8;
+CREATE TABLE `speed_dial` (
+  `id` int(10) unsigned NOT NULL auto_increment,
+  `username` char(64) NOT NULL default '',
+  `domain` char(64) NOT NULL default '',
+  `sd_username` char(64) NOT NULL default '',
+  `sd_domain` char(64) NOT NULL default '',
+  `new_uri` char(128) NOT NULL default '',
+  `fname` char(64) NOT NULL default '',
+  `lname` char(64) NOT NULL default '',
+  `description` char(64) NOT NULL default '',
+  PRIMARY KEY  (`id`),
+  UNIQUE KEY `speed_dial_idx` (`username`,`domain`,`sd_domain`,`sd_username`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+SET character_set_client = @saved_cs_client;
+
+--
+-- Table structure for table `subscriber`
+--
+
+DROP TABLE IF EXISTS `subscriber`;
+SET @saved_cs_client     = @@character_set_client;
+SET character_set_client = utf8;
+CREATE TABLE `subscriber` (
+  `id` int(10) unsigned NOT NULL auto_increment,
+  `username` char(64) NOT NULL default '',
+  `domain` char(64) NOT NULL default '',
+  `password` char(25) NOT NULL default '',
+  `email_address` char(64) NOT NULL default '',
+  `ha1` char(64) NOT NULL default '',
+  `ha1b` char(64) NOT NULL default '',
+  `rpid` char(64) default NULL,
+  PRIMARY KEY  (`id`),
+  UNIQUE KEY `account_idx` (`username`,`domain`),
+  KEY `username_idx` (`username`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+SET character_set_client = @saved_cs_client;
+
+--
+-- Table structure for table `uri`
+--
+
+DROP TABLE IF EXISTS `uri`;
+SET @saved_cs_client     = @@character_set_client;
+SET character_set_client = utf8;
+CREATE TABLE `uri` (
+  `id` int(10) unsigned NOT NULL auto_increment,
+  `username` char(64) NOT NULL default '',
+  `domain` char(64) NOT NULL default '',
+  `uri_user` char(64) NOT NULL default '',
+  `last_modified` datetime NOT NULL default '1900-01-01 00:00:01',
+  PRIMARY KEY  (`id`),
+  UNIQUE KEY `account_idx` (`username`,`domain`,`uri_user`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+SET character_set_client = @saved_cs_client;
+
+--
+-- Table structure for table `userblacklist`
+--
+
+DROP TABLE IF EXISTS `userblacklist`;
+SET @saved_cs_client     = @@character_set_client;
+SET character_set_client = utf8;
+CREATE TABLE `userblacklist` (
+  `id` int(10) unsigned NOT NULL auto_increment,
+  `username` char(64) NOT NULL default '',
+  `domain` char(64) NOT NULL default '',
+  `prefix` char(64) NOT NULL default '',
+  `whitelist` tinyint(1) NOT NULL default '0',
+  PRIMARY KEY  (`id`),
+  KEY `userblacklist_idx` (`username`,`domain`,`prefix`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+SET character_set_client = @saved_cs_client;
+
+--
+-- Table structure for table `usr_preferences`
+--
+
+DROP TABLE IF EXISTS `usr_preferences`;
+SET @saved_cs_client     = @@character_set_client;
+SET character_set_client = utf8;
+CREATE TABLE `usr_preferences` (
+  `id` int(10) unsigned NOT NULL auto_increment,
+  `uuid` char(64) NOT NULL default '',
+  `username` char(128) NOT NULL default '0',
+  `domain` char(64) NOT NULL default '',
+  `attribute` char(32) NOT NULL default '',
+  `type` int(11) NOT NULL default '0',
+  `value` char(128) NOT NULL default '',
+  `last_modified` datetime NOT NULL default '1900-01-01 00:00:01',
+  PRIMARY KEY  (`id`),
+  KEY `ua_idx` (`uuid`,`attribute`),
+  KEY `uda_idx` (`username`,`domain`,`attribute`),
+  KEY `value_idx` (`value`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+SET character_set_client = @saved_cs_client;
+
+--
+-- Table structure for table `version`
+--
+
+DROP TABLE IF EXISTS `version`;
+SET @saved_cs_client     = @@character_set_client;
+SET character_set_client = utf8;
+CREATE TABLE `version` (
+  `table_name` char(32) NOT NULL default '',
+  `table_version` int(10) unsigned NOT NULL default '0',
+  UNIQUE KEY `t_name_idx` (`table_name`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+SET character_set_client = @saved_cs_client;
+
+--
+-- Table structure for table `watchers`
+--
+
+DROP TABLE IF EXISTS `watchers`;
+SET @saved_cs_client     = @@character_set_client;
+SET character_set_client = utf8;
+CREATE TABLE `watchers` (
+  `id` int(10) unsigned NOT NULL auto_increment,
+  `presentity_uri` char(128) NOT NULL default '',
+  `watcher_username` char(64) NOT NULL default '',
+  `watcher_domain` char(64) NOT NULL default '',
+  `event` char(64) NOT NULL default 'presence',
+  `status` int(11) NOT NULL default '0',
+  `reason` char(64) default NULL,
+  `inserted_time` int(11) NOT NULL default '0',
+  PRIMARY KEY  (`id`),
+  UNIQUE KEY `watcher_idx` (`presentity_uri`,`watcher_username`,`watcher_domain`,`event`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+SET character_set_client = @saved_cs_client;
+
+--
+-- Table structure for table `xcap`
+--
+
+DROP TABLE IF EXISTS `xcap`;
+SET @saved_cs_client     = @@character_set_client;
+SET character_set_client = utf8;
+CREATE TABLE `xcap` (
+  `id` int(10) unsigned NOT NULL auto_increment,
+  `username` varchar(64) NOT NULL default '',
+  `domain` varchar(64) NOT NULL default '',
+  `doc` blob NOT NULL,
+  `doc_type` int(11) NOT NULL default '0',
+  `etag` varchar(64) NOT NULL default '',
+  `source` int(11) NOT NULL default '0',
+  `doc_uri` varchar(128) NOT NULL default '',
+  `port` int(11) NOT NULL default '0',
+  PRIMARY KEY  (`id`),
+  UNIQUE KEY `account_doc_type_idx` (`username`,`domain`,`doc_type`,`doc_uri`),
+  KEY `source_idx` (`source`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+SET character_set_client = @saved_cs_client;
diff --git a/platform/acd/src/acd_agent.cpp b/platform/acd/src/acd_agent.cpp
index a297707..7d1dfba 100644
--- a/platform/acd/src/acd_agent.cpp
+++ b/platform/acd/src/acd_agent.cpp
@@ -92,6 +92,7 @@ void acd_agent::Reset() {
     m_answerTime = 0;
     m_origCaller.clear();
     m_origCallee.clear();
+    _m_cur_skill.clear();
 }
 
 acd_agent::acd_agent() :
@@ -161,11 +162,12 @@ void acd_agent::GetAgentDetail(acd::AgentInfoT& agentInfo) {
     agentInfo.agentIP         = m_agentIP;
 }
 
-void acd_agent::lock(const ims::RouteEventT& event, time_t waitbegin) {
+void acd_agent::lock(const ims::RouteEventT& event, const string& skill, time_t waitbegin) {
     SingleRWLocker s(&m_RWLock, true);
 
     m_requestId = event.requstid;
     m_validTime = event.validtime;
+    _m_cur_skill = skill;
     SetStatus(acd::AgentStatusT::AsLockState, acd::CallEventReasonT::CerSuccess);
 
     if (m_callinfo.isValid()) {
@@ -173,7 +175,7 @@ void acd_agent::lock(const ims::RouteEventT& event, time_t waitbegin) {
         m_callinfo.reset();
     }
 
-    m_callinfo.Initial(event.sessionid, event.callid, m_agentId, m_agentDn, m_skill, event.callerDn,
+    m_callinfo.Initial(event.sessionid, event.callid, m_agentId, m_agentDn, _m_cur_skill, event.callerDn,
                        m_agentDn, waitbegin, time(NULL));
     m_callinfo.SetRoutecall();
 }
@@ -184,7 +186,7 @@ bool acd_agent::unlock(const ims::RouteEventT& event) {
     if (m_requestId != event.requstid) {
         return false;
     }
-
+    _m_cur_skill.clear();
     if (m_agentStatus == acd::AgentStatusT::AsLockState) {
         if (m_statusChangetype == acd::StatusChangeT::ScBusy) {
             SetStatus(acd::AgentStatusT::AsBusyState, acd::CallEventReasonT::CerIdleUnlock);
@@ -203,7 +205,7 @@ bool acd_agent::unlock(const ims::RouteEventT& event) {
 
 bool acd_agent::unlockTimeout() {
     SingleRWLocker s(&m_RWLock, true);
-
+    _m_cur_skill.clear();
     if (m_agentStatus == acd::AgentStatusT::AsLockState
             && m_validTime <= time(NULL) - m_currStatusTime) {
         if (m_statusChangetype == acd::StatusChangeT::ScBusy) {
@@ -324,8 +326,17 @@ void acd_agent::ProcessIMSEvent(const ims::CallEventT& event) {
             }
 
             m_callinfo.SetAniDnis(event.originalAni, event.originalDnis);
-            m_callinfo.SetAckEnd(m_currStatusTime);
-            m_callinfo.SetCallEnd(m_currStatusTime);
+            if (lastAgentStatus == acd::AgentStatusT::AsConnectingState) {
+                m_callinfo.SetConnectEnd(m_currStatusTime);
+                m_callinfo.SetCallEnd(m_currStatusTime);
+            }
+            else if (lastAgentStatus == acd::AgentStatusT::AsConsultConnectingState) {
+                m_callinfo.SetCallEnd(m_currStatusTime);
+            }
+            else {
+                m_callinfo.SetAckEnd(m_currStatusTime);
+                m_callinfo.SetCallEnd(m_currStatusTime);
+            }
 
             if (m_callinfo.isValid()) { // Èç¹û»°µ¥Ã»ÓÐÆðÊ¼ÐÅÏ¢£¬Ôò²»±ØÒªÐ´
                 m_callinfo.WriteCallLog();
@@ -394,7 +405,7 @@ void acd_agent::ProcessIMSEvent(const ims::CallEventT& event) {
                 m_callinfo.reset();
             }
 
-            m_callinfo.Initial(event.sessionid, event.callid, m_agentId, m_agentDn, m_skill, event.originalAni,
+            m_callinfo.Initial(event.sessionid, event.callid, m_agentId, m_agentDn, _m_cur_skill, event.originalAni,
                                event.originalDnis, 0, 0);
         }
 
@@ -416,7 +427,7 @@ void acd_agent::ProcessIMSEvent(const ims::CallEventT& event) {
             m_callinfo.reset();
         }
 
-        m_callinfo.Initial(event.sessionid, event.callid, m_agentId, m_agentDn, m_skill, event.originalAni,
+        m_callinfo.Initial(event.sessionid, event.callid, m_agentId, m_agentDn, _m_cur_skill, event.originalAni,
                            event.originalDnis, 0, 0);
         m_callinfo.SetAckBegin(m_currStatusTime);
         m_callinfo.SetCallDirect(CallDirectT::OUTBOUND);
@@ -437,6 +448,7 @@ void acd_agent::ProcessIMSEvent(const ims::CallEventT& event) {
         } else {
             m_callinfo.SetCallType(event.otherAttr);
             m_agentStatus = acd::AgentStatusT::AsConnectingState;
+            m_callinfo.SetConnectBegin(m_currStatusTime);
         }
 
         break;
@@ -446,7 +458,7 @@ void acd_agent::ProcessIMSEvent(const ims::CallEventT& event) {
         if (event.eventType == ims::CallEventTypeT::SG_ThisPartyAnswered_InternalCall ||
                 event.eventType == ims::CallEventTypeT::SG_ThisPartyAnswered_NormalCall) {
             Record();
-            m_callinfo.SetAckEnd(m_currStatusTime);
+            m_callinfo.SetConnectEnd(m_currStatusTime);
             m_callinfo.SetCallBegin(m_currStatusTime);
             m_callinfo.SetRecordFilename(m_recordFilename);
             m_answerTime = m_currStatusTime;
@@ -455,7 +467,7 @@ void acd_agent::ProcessIMSEvent(const ims::CallEventT& event) {
         } else if (event.eventType == ims::CallEventTypeT::SG_OtherPartyAnswered_InternalCall ||
                    event.eventType == ims::CallEventTypeT::SG_OtherPartyAnswered_NormalCall) {
             Record();
-            m_callinfo.SetAckEnd(m_currStatusTime);
+            m_callinfo.SetConnectEnd(m_currStatusTime);
             m_callinfo.SetCallBegin(m_currStatusTime);
             m_callinfo.SetRecordFilename(m_recordFilename);
             m_answerTime = m_currStatusTime;
@@ -480,6 +492,7 @@ void acd_agent::ProcessIMSEvent(const ims::CallEventT& event) {
 
     case ims::CallStateT::SG_HalfConnectedState:
         m_agentStatus = acd::AgentStatusT::AsHalfConnectedState;
+        m_callinfo.SetAckEnd(m_currStatusTime);
         break;
 
     case ims::CallStateT::SG_SuspendedState:
@@ -490,7 +503,7 @@ void acd_agent::ProcessIMSEvent(const ims::CallEventT& event) {
         if (event.eventType == ims::CallEventTypeT::SG_ThisPartyConferenced_MonitorCall) {
             if (acd::AgentStatusT::AsHalfConnectedState == lastAgentStatus) {
                 Record();
-                m_callinfo.SetAckEnd(m_currStatusTime);
+                m_callinfo.SetConnectEnd(m_currStatusTime);
                 m_callinfo.SetCallBegin(m_currStatusTime);
                 m_callinfo.SetCallType(event.otherAttr);
                 m_callinfo.SetRecordFilename(m_recordFilename);
@@ -504,7 +517,7 @@ void acd_agent::ProcessIMSEvent(const ims::CallEventT& event) {
         } else if (event.eventType == ims::CallEventTypeT::SG_ThisPartyConferenced_IntrudeCall) {
             if (acd::AgentStatusT::AsHalfConnectedState == lastAgentStatus) {
                 Record();
-                m_callinfo.SetAckEnd(m_currStatusTime);
+                m_callinfo.SetConnectEnd(m_currStatusTime);
                 m_callinfo.SetCallBegin(m_currStatusTime);
                 m_callinfo.SetCallType(event.otherAttr);
                 m_callinfo.SetRecordFilename(m_recordFilename);
diff --git a/platform/acd/src/acd_agent_manager.cpp b/platform/acd/src/acd_agent_manager.cpp
index 9ae4c82..54c175c 100644
--- a/platform/acd/src/acd_agent_manager.cpp
+++ b/platform/acd/src/acd_agent_manager.cpp
@@ -165,10 +165,11 @@ void acd_agent_manager::RouteRequestCancel(const ims::RouteEventT& event) {
 
 void acd_agent_manager::RouteRequestSuccess(const ims::RouteEventT& event,
         const acd_agent_ptr& p_agent) {
-    p_agent->lock(event);
+    p_agent->lock(event, "");
 
     if (acd_tool::p_m_acd_ims->RouteRequestRespond(event.sessionid, event.requstid,
-            ims::RouteEventReasonT::RouteReasonSuccess, p_agent->GetAgentDn())) {
+            ims::RouteEventReasonT::RouteReasonSuccess, p_agent->GetAgentDn(), 
+            p_agent->GetAgentId())) {
         acd_tool::m_logger.WriteLog(LOG_LEVEL_DEBUG, __FILE__, __LINE__, __FUNCTION__,
                                     "requestId:%"SHOW_LONG"d request agentId:%s agentDn:%s success", event.requstid,
                                     event.requestArgs.c_str(), p_agent->GetAgentDn().c_str());
@@ -182,7 +183,7 @@ void acd_agent_manager::RouteRequestSuccess(const ims::RouteEventT& event,
 
 void acd_agent_manager::RouteRequestFail(const ims::RouteEventT& event,
         const ims::RouteEventReasonT& result) {
-    acd_tool::p_m_acd_ims->RouteRequestRespond(event.sessionid, event.requstid, result, "");
+    acd_tool::p_m_acd_ims->RouteRequestRespond(event.sessionid, event.requstid, result, "", "");
     time_t t = time(NULL);
     callinfo info;
     info.Initial(event.sessionid, event.callid, "", "", "", event.callerDn, event.calleeDn, t, t);
@@ -238,7 +239,7 @@ void acd_agent_manager::ProcessIMSEvent(const ims::RouteEventT& event) {
     switch (event.eventType.get_value()) {
     case ims::RouteEventTypeT::RT_RouteUnknown:
         acd_tool::p_m_acd_ims->RouteRequestRespond(event.sessionid, event.requstid,
-                ims::RouteEventReasonT::RouteReasonError, "");
+                ims::RouteEventReasonT::RouteReasonError, "", "");
         acd_tool::m_logger.WriteLog(LOG_LEVEL_CRITICAL, __FILE__, __LINE__, __FUNCTION__,
                                     "event type error");
         break;
@@ -249,7 +250,7 @@ void acd_agent_manager::ProcessIMSEvent(const ims::RouteEventT& event) {
 
     case ims::RouteEventTypeT::RT_RouteRespond:
         acd_tool::p_m_acd_ims->RouteRequestRespond(event.sessionid, event.requstid,
-                ims::RouteEventReasonT::RouteReasonError, "");
+                ims::RouteEventReasonT::RouteReasonError, "", "");
         acd_tool::m_logger.WriteLog(LOG_LEVEL_CRITICAL, __FILE__, __LINE__, __FUNCTION__,
                                     "event type error");
         break;
@@ -260,7 +261,7 @@ void acd_agent_manager::ProcessIMSEvent(const ims::RouteEventT& event) {
 
     default:
         acd_tool::p_m_acd_ims->RouteRequestRespond(event.sessionid, event.requstid,
-                ims::RouteEventReasonT::RouteReasonError, "");
+                ims::RouteEventReasonT::RouteReasonError, "", "");
         acd_tool::m_logger.WriteLog(LOG_LEVEL_CRITICAL, __FILE__, __LINE__, __FUNCTION__,
                                     "event type error");
         break;
diff --git a/platform/acd/src/acd_config.cpp b/platform/acd/src/acd_config.cpp
index caa5513..ae990a4 100644
--- a/platform/acd/src/acd_config.cpp
+++ b/platform/acd/src/acd_config.cpp
@@ -117,7 +117,7 @@ bool acd_config::LoadSkills() {
         if (!mysql_query(conn, "SELECT * FROM SkillIdTbl")) {
             result = mysql_store_result(conn);
 
-            while (row = mysql_fetch_row(result)) {
+            while ((row = mysql_fetch_row(result))) {
                 m_setSkills.Insert(row[1]);
             }
 
@@ -152,7 +152,7 @@ bool acd_config::LoadRestReason() {
         if (!mysql_query(conn, "SELECT * FROM RestReasonTbl")) {
             result = mysql_store_result(conn);
 
-            while (row = mysql_fetch_row(result)) {
+            while ((row = mysql_fetch_row(result))) {
                 m_setRestReason.Insert(row[1]);
             }
 
diff --git a/platform/acd/src/acd_data_collection.cpp b/platform/acd/src/acd_data_collection.cpp
new file mode 100644
index 0000000..f54ee24
--- /dev/null
+++ b/platform/acd/src/acd_data_collection.cpp
@@ -0,0 +1,571 @@
+// acd_data_collection.cpp: implement AcdDataCollection
+
+#include <json/json.h>
+#include "acd_data_collection.h"
+#include "acd_tool.h"
+
+#define CHECK_CONF(name, type) \
+    if (name.is_null()) { \
+        acd_tool::m_logger.WriteLog(LOG_LEVEL_WARNING, __FILE__, __LINE__, __FUNCTION__,\
+            "not found %s", #name);\
+        return -1; \
+    } else if (name.get_type() != type) { \
+        acd_tool::m_logger.WriteLog(LOG_LEVEL_WARNING, __FILE__, __LINE__, __FUNCTION__,\
+            "type is equal, need(%d), given(%d)", type, name.get_type());\
+        return -1; \
+    }
+
+namespace acd {
+void AcdCallDataCollection::initialize(const char* path)
+{
+    reset();
+    if (path ==  NULL) {
+        acd_tool::m_logger.WriteLog(LOG_LEVEL_WARNING, __FILE__, __LINE__, __FUNCTION__,
+            "data cached path is NULL");
+        return;
+    }
+    _cached_file = path;
+    _cached_date = bgcc::TimeUtil::get_date();
+    _cached_second = bgcc::TimeUtil::get_timestamp_s();
+    get_data_from_file();
+    acd_tool::m_logger.WriteLog(LOG_LEVEL_NOTICE, __FILE__, __LINE__, __FUNCTION__,
+        "data collection has initialize");
+}
+
+void AcdCallDataCollection::unInitialize()
+{
+    reset();
+}
+
+int32_t AcdCallDataCollection::get_data_from_file()
+{
+    string filename = _cached_file;
+    bgcc2::ConfUnit root;
+    if(!bgcc2::ConfLoader::load_conf(filename.c_str(), root)) {
+        acd_tool::m_logger.WriteLog(LOG_LEVEL_WARNING, __FILE__, __LINE__, __FUNCTION__,
+            "open cached file failed ,path(%s)", filename.c_str());
+        return -1;
+    }
+    acd_tool::m_logger.WriteLog(LOG_LEVEL_WARNING, __FILE__, __LINE__, __FUNCTION__,
+        "begin load =========================================");    
+
+    // load date
+    bgcc2::ConfUnit& section = root["Date"];
+    if(section.is_null()) {
+        acd_tool::m_logger.WriteLog(LOG_LEVEL_WARNING, __FILE__, __LINE__, __FUNCTION__,
+            "not find date section");
+        return -1;
+    }
+    bgcc2::ConfUnit& date = section["date"];
+    CHECK_CONF(date, bgcc::ConfUnit::UT_STRING);
+    string cacheddate = date.to_string();
+    acd_tool::m_logger.WriteLog(LOG_LEVEL_NOTICE, __FILE__, __LINE__, __FUNCTION__,
+        "|Cached Date  | %s", cacheddate.c_str());
+
+    // check is today?
+    string curdate = bgcc::TimeUtil::get_date();
+    if (curdate != cacheddate) {
+        acd_tool::m_logger.WriteLog(LOG_LEVEL_WARNING, __FILE__, __LINE__, __FUNCTION__,
+            "data is not this day, cacheddate(%s), curdate(%s)", cacheddate.c_str(), curdate.c_str());
+        return -1;
+    }
+
+    // load cc plat info
+    bgcc2::ConfUnit& section1 = root["PlatCallData"];
+    if(section1.is_null()) {
+        acd_tool::m_logger.WriteLog(LOG_LEVEL_WARNING, __FILE__, __LINE__, __FUNCTION__,
+            "not find platcalldata section");
+        return -1;
+    }
+
+    bgcc2::ConfUnit& out_call_num= section1["OUTCALLNUM"];
+    bgcc2::ConfUnit& out_ans_num= section1["OUTANSNUM"];
+    bgcc2::ConfUnit& out_call_time= section1["OUTCALLTIME"];
+    bgcc2::ConfUnit& in_call_time= section1["INCALLTIME"];
+    bgcc2::ConfUnit& in_alert_time= section1["INALERTTIME"];
+    bgcc2::ConfUnit& in_ans_num= section1["INANWNUM"];
+    bgcc2::ConfUnit& in_call_num= section1["INCALLNUM"];
+    CHECK_CONF(out_call_num, bgcc::ConfUnit::UT_STRING);
+    CHECK_CONF(out_ans_num, bgcc::ConfUnit::UT_STRING);
+    CHECK_CONF(out_call_time, bgcc::ConfUnit::UT_STRING);
+    CHECK_CONF(in_call_time, bgcc::ConfUnit::UT_STRING);
+    CHECK_CONF(in_alert_time, bgcc::ConfUnit::UT_STRING);
+    CHECK_CONF(in_ans_num, bgcc::ConfUnit::UT_STRING);
+    CHECK_CONF(in_call_num, bgcc::ConfUnit::UT_STRING);
+    if (!bgcc::StringUtil::str2uint32(out_call_num.to_string().c_str(), _cc_call_data.outbound_call_num)) {
+        acd_tool::m_logger.WriteLog(LOG_LEVEL_WARNING, __FILE__, __LINE__, __FUNCTION__,
+            "parse outcallnum(%s) failed", out_call_num.to_string().c_str());
+        return -1;
+    }
+    if (!bgcc::StringUtil::str2uint32(out_ans_num.to_string().c_str(), _cc_call_data.outbound_ans_num)) {
+        acd_tool::m_logger.WriteLog(LOG_LEVEL_WARNING, __FILE__, __LINE__, __FUNCTION__,
+            "parse outansnum(%s) failed", out_ans_num.to_string().c_str());
+        return -1;
+    }
+    if (!bgcc::StringUtil::str2uint32(out_call_time.to_string().c_str(), _cc_call_data.outbound_call_time)) {
+        acd_tool::m_logger.WriteLog(LOG_LEVEL_WARNING, __FILE__, __LINE__, __FUNCTION__,
+            "parse outcalltime(%s) failed", out_call_time.to_string().c_str());
+        return -1;
+    }
+    if (!bgcc::StringUtil::str2uint32(in_call_time.to_string().c_str(), _cc_call_data.inbound_call_time)) {
+        acd_tool::m_logger.WriteLog(LOG_LEVEL_WARNING, __FILE__, __LINE__, __FUNCTION__,
+            "parse incalltime(%s) failed", in_call_time.to_string().c_str());
+        return -1;
+    }
+    if (!bgcc::StringUtil::str2uint32(in_alert_time.to_string().c_str(), _cc_call_data.inbound_alerting_time)) {
+        acd_tool::m_logger.WriteLog(LOG_LEVEL_WARNING, __FILE__, __LINE__, __FUNCTION__,
+            "parse inalerttime(%s) failed", in_alert_time.to_string().c_str());
+        return -1;
+    }
+    if (!bgcc::StringUtil::str2uint32(in_ans_num.to_string().c_str(), _cc_call_data.inbound_ans_num)) {
+        acd_tool::m_logger.WriteLog(LOG_LEVEL_WARNING, __FILE__, __LINE__, __FUNCTION__,
+            "parse inansnum(%s) failed", in_ans_num.to_string().c_str());
+        return -1;
+    }
+    if (!bgcc::StringUtil::str2uint32(in_call_num.to_string().c_str(), _cc_call_data.inbound_call_num)) {
+        acd_tool::m_logger.WriteLog(LOG_LEVEL_WARNING, __FILE__, __LINE__, __FUNCTION__,
+            "parse incallnum(%s) failed", out_call_num.to_string().c_str());
+        return -1;
+    }
+    acd_tool::m_logger.WriteLog(LOG_LEVEL_NOTICE, __FILE__, __LINE__, __FUNCTION__,
+        "|OUTCALLNUM  | %d", _cc_call_data.outbound_call_num);
+    acd_tool::m_logger.WriteLog(LOG_LEVEL_NOTICE, __FILE__, __LINE__, __FUNCTION__,
+        "|OUTANSNUM  | %d", _cc_call_data.outbound_ans_num);
+    acd_tool::m_logger.WriteLog(LOG_LEVEL_NOTICE, __FILE__, __LINE__, __FUNCTION__,
+        "|OUTCALLTIME  | %d", _cc_call_data.outbound_call_time);
+    acd_tool::m_logger.WriteLog(LOG_LEVEL_NOTICE, __FILE__, __LINE__, __FUNCTION__,
+        "|INCALLTIME  | %d", _cc_call_data.inbound_call_time);
+    acd_tool::m_logger.WriteLog(LOG_LEVEL_NOTICE, __FILE__, __LINE__, __FUNCTION__,
+        "|INALERTTIME  | %d", _cc_call_data.inbound_alerting_time);
+    acd_tool::m_logger.WriteLog(LOG_LEVEL_NOTICE, __FILE__, __LINE__, __FUNCTION__,
+        "|INANSNUM  | %d", _cc_call_data.inbound_ans_num);
+    acd_tool::m_logger.WriteLog(LOG_LEVEL_NOTICE, __FILE__, __LINE__, __FUNCTION__,
+        "|INCALLNUM  | %d", _cc_call_data.inbound_call_num);
+
+    //begin load skill info
+    bgcc2::ConfUnit& section3 = root["SkillCallData"];
+    if(section3.is_null()) {
+        acd_tool::m_logger.WriteLog(LOG_LEVEL_NOTICE, __FILE__, __LINE__, __FUNCTION__,
+            "not found SkillCallData section");
+        return -1;
+    }
+
+    for(bgcc2::ConfUnit::const_iterator itr = section3.begin(); itr != section3.end(); ++itr) {
+        bgcc2::ConfUnit& skill = **itr;
+        bgcc2::ConfUnit& skillname = skill["SkillName"];
+        bgcc2::ConfUnit& calltime = skill["InCallTime"];
+        bgcc2::ConfUnit& alerttime = skill["InAlertTime"];
+        bgcc2::ConfUnit& ansnum = skill["InAnsNum"];
+        bgcc2::ConfUnit& callnum = skill["InCallNum"];
+        CHECK_CONF(skillname, bgcc::ConfUnit::UT_STRING);
+        CHECK_CONF(calltime, bgcc::ConfUnit::UT_STRING);
+        CHECK_CONF(alerttime, bgcc::ConfUnit::UT_STRING);
+        CHECK_CONF(ansnum, bgcc::ConfUnit::UT_STRING);
+        SkillCallData* p = new (std::nothrow) SkillCallData;
+	    if (p == NULL) {
+            acd_tool::m_logger.WriteLog(LOG_LEVEL_WARNING, __FILE__, __LINE__, __FUNCTION__,
+                "new skillinfo failed");
+            return -1;            
+	    }
+        if (!bgcc::StringUtil::str2uint32(calltime.to_string().c_str(), p->inbound_call_time)) {
+            acd_tool::m_logger.WriteLog(LOG_LEVEL_WARNING, __FILE__, __LINE__, __FUNCTION__,
+                "parse skill calltime(%s) failed", calltime.to_string().c_str());
+            return -1;
+        }
+        if (!bgcc::StringUtil::str2uint32(alerttime.to_string().c_str(), p->inbound_alerting_time)) {
+            acd_tool::m_logger.WriteLog(LOG_LEVEL_WARNING, __FILE__, __LINE__, __FUNCTION__,
+                "parse skill alerttime(%s) failed", alerttime.to_string().c_str());
+            return -1;
+        }
+        if (!bgcc::StringUtil::str2uint32(callnum.to_string().c_str(), p->inbound_call_num)) {
+            acd_tool::m_logger.WriteLog(LOG_LEVEL_WARNING, __FILE__, __LINE__, __FUNCTION__,
+                "parse skill callnum(%s) failed", callnum.to_string().c_str());
+            return -1;
+        }
+        if (!bgcc::StringUtil::str2uint32(ansnum.to_string().c_str(), p->inbound_answer_num)) {
+            acd_tool::m_logger.WriteLog(LOG_LEVEL_WARNING, __FILE__, __LINE__, __FUNCTION__,
+                "parse skill ansnum(%s) failed", ansnum.to_string().c_str());
+            return -1;
+        }
+        _skill_call_info.insert(std::make_pair(skillname.to_string(), p));
+        acd_tool::m_logger.WriteLog(LOG_LEVEL_NOTICE, __FILE__, __LINE__, __FUNCTION__,
+            "|SKILLNAME  | %s", skillname.to_string().c_str());
+        acd_tool::m_logger.WriteLog(LOG_LEVEL_NOTICE, __FILE__, __LINE__, __FUNCTION__,
+            "        |CALLTIME | %d", p->inbound_call_time);
+        acd_tool::m_logger.WriteLog(LOG_LEVEL_NOTICE, __FILE__, __LINE__, __FUNCTION__,
+            "        |ALERTTIME  | %d", p->inbound_alerting_time);
+        acd_tool::m_logger.WriteLog(LOG_LEVEL_NOTICE, __FILE__, __LINE__, __FUNCTION__,
+            "        |CALLNUM | %d", p->inbound_call_num);
+        acd_tool::m_logger.WriteLog(LOG_LEVEL_NOTICE, __FILE__, __LINE__, __FUNCTION__,
+            "        |ANSNUM | %d", p->inbound_answer_num);
+    } 
+    acd_tool::m_logger.WriteLog(LOG_LEVEL_WARNING, __FILE__, __LINE__, __FUNCTION__,
+        "begin end =========================================");   
+    return 0;
+}
+
+int32_t AcdCallDataCollection::put_data_to_file()
+{
+    std::ofstream out(_cached_file.c_str(), std::ios::out);
+    if (!out.is_open()){
+        acd_tool::m_logger.WriteLog(LOG_LEVEL_WARNING, __FILE__, __LINE__, __FUNCTION__,
+            "open cached file failed ,path(%s)", _cached_file.c_str());
+        return -1;
+    }
+    // put date
+    string curdate = bgcc::TimeUtil::get_date();
+    out << "[Date]" << "\n";
+    out << "date = " << curdate << "\n";
+
+    // put plat call data
+    out << "[PlatCallData]" << "\n";
+    out << "OUTCALLNUM = " << _cc_call_data.outbound_call_num << "\n";
+    out << "OUTANSNUM = " << _cc_call_data.outbound_ans_num << "\n";
+    out << "OUTCALLTIME = " << _cc_call_data.outbound_call_time << "\n";
+    out << "INCALLTIME = " << _cc_call_data.inbound_call_time << "\n";
+    out << "INALERTTIME = " << _cc_call_data.inbound_call_time << "\n";
+    out << "INANWNUM = " << _cc_call_data.inbound_ans_num << "\n";
+    out << "INCALLNUM = " << _cc_call_data.inbound_call_num << "\n";
+
+
+    // load skill call data
+    for (iter iter = _skill_call_info.begin(); iter != _skill_call_info.end(); ++iter) {
+        out << "[@SkillCallData]" << "\n";
+        out << "SkillName = " << iter->first.c_str() << "\n";
+        out << "InCallTime = " << iter->second->inbound_call_time << "\n";
+        out << "InAlertTime = " << iter->second->inbound_alerting_time << "\n";
+        out << "InCallNum = " << iter->second->inbound_call_num << "\n";
+        out << "InAnsNum = " << iter->second->inbound_answer_num << "\n";
+    }
+    out.close();    
+    acd_tool::m_logger.WriteLog(LOG_LEVEL_WARNING, __FILE__, __LINE__, __FUNCTION__,
+        "commit data to cached file");
+    return 0;
+}
+
+void AcdCallDataCollection::commit_data()
+{
+    string cur_date = bgcc::TimeUtil::get_date();
+    uint64_t cur_second = bgcc::TimeUtil::get_timestamp_s();
+    const static uint64_t time_interval = 30;
+    if (cur_date != _cached_date) {
+        reset();
+        put_data_to_file();
+        acd_tool::m_logger.WriteLog(LOG_LEVEL_NOTICE, __FILE__, __LINE__, __FUNCTION__,
+            "not this day, put data to file");
+    }
+    if (cur_second - _cached_second > time_interval) {
+        acd_tool::m_logger.WriteLog(LOG_LEVEL_DEBUG, __FILE__, __LINE__, __FUNCTION__,
+            "commit data to file");
+        put_data_to_file();
+        _cached_second = cur_second;
+    }
+    _cached_date = cur_date;
+}
+
+void AcdCallDataCollection::update_data(calldata_ptr& callinfo)
+{
+    SingleRWLocker s(&_lock, true);
+    if (callinfo.get() == NULL) {
+        acd_tool::m_logger.WriteLog(LOG_LEVEL_NOTICE, __FILE__, __LINE__, __FUNCTION__,
+            "callinfo is NULL");
+        return;
+    }
+    uint32_t calltime = callinfo->m_callend - callinfo->m_callbegin;
+    if (callinfo->m_callend < callinfo->m_callbegin) {
+        calltime = 0;
+    }
+    uint32_t alerting = callinfo->m_ackend - callinfo->m_ackbegin;
+    if (callinfo->m_ackend < callinfo->m_ackbegin) {
+        alerting = 0;
+    }
+    //update cc info
+    if (callinfo->m_callDirect.get_value() == CallDirectT::OUTBOUND) {
+        ++_cc_call_data.outbound_call_num;
+        if (calltime > 0) {
+            ++_cc_call_data.outbound_ans_num;
+            _cc_call_data.outbound_call_time += calltime;
+        }
+    }
+    else if (callinfo->m_callDirect.get_value() == CallDirectT::INBOUND && calltime > 0) {
+        ++_cc_call_data.inbound_call_num;
+        _cc_call_data.inbound_alerting_time += alerting;
+        if (calltime > 0) {
+            ++_cc_call_data.inbound_ans_num;
+            _cc_call_data.inbound_call_time += calltime;
+        }
+    }
+    //update skill info
+    if (callinfo->m_callDirect.get_value() == CallDirectT::INBOUND && !callinfo->m_skill.empty()) {
+        iter iter = _skill_call_info.find(callinfo->m_skill);
+        if (iter == _skill_call_info.end()) {
+            acd_tool::m_logger.WriteLog(LOG_LEVEL_NOTICE, __FILE__, __LINE__, __FUNCTION__,
+                "new skill (%s)", callinfo->m_skill.c_str());
+            SkillCallData * p = new (std::nothrow) SkillCallData;
+            if (p ==  NULL) {
+                acd_tool::m_logger.WriteLog(LOG_LEVEL_WARNING, __FILE__, __LINE__, __FUNCTION__,
+                    "new skill call data info failed, skill(%s)", callinfo->m_skill.c_str());
+                return;
+            }
+            p->inbound_alerting_time = 0;
+            p->inbound_answer_num = 0;
+            p->inbound_call_time = 0;
+            p->inbound_call_num = 0;
+            ++p->inbound_call_num;
+            p->inbound_alerting_time += alerting;
+            if (calltime > 0) {
+                ++p->inbound_answer_num;
+                p->inbound_call_time += calltime;
+            }
+            _skill_call_info.insert(std::make_pair(callinfo->m_skill, p));
+        }
+        else {
+            iter->second->inbound_alerting_time += alerting;
+            ++iter->second->inbound_call_num;
+            if (calltime > 0) {
+                ++iter->second->inbound_answer_num;
+                iter->second->inbound_call_time += calltime;
+            }
+            acd_tool::m_logger.WriteLog(LOG_LEVEL_DEBUG, __FILE__, __LINE__, __FUNCTION__,
+                "update skill info skill(%s), calltime(%d), alerttime(%d)", 
+                    callinfo->m_skill.c_str(), calltime, alerting);
+        }
+    }
+    
+}
+
+void AcdCallDataCollection::Method()
+{
+    acd_tool::m_logger.WriteLog(LOG_LEVEL_WARNING, __FILE__, __LINE__, __FUNCTION__,
+        "acd data collection thread begin");
+    const static int32_t timeout = 30;
+    while (this->mIsLoop) {
+        calldata_ptr callinfo;
+        bool ret = _calldata_queue.UnBlockPop(callinfo, timeout);
+        commit_data();
+        if (ret) {
+            update_data(callinfo);
+        }
+    }
+}
+
+int32_t AcdCallDataCollection::get_call_data_by_plat(string& data)
+{
+    SingleRWLocker s(&_lock, true);
+    string fail_str = "{\"result\":\"-1\",\"data\":\"memory error\"}";
+    json_object *root = json_object_new_object();
+    if (root == NULL) {
+        acd_tool::m_logger.WriteLog(LOG_LEVEL_WARNING, __FILE__, __LINE__, __FUNCTION__,
+            "new root json object failed");
+        data = fail_str;
+        return -1;
+    }
+    json_object *calldata = json_object_new_object();
+    if (calldata == NULL) {
+        acd_tool::m_logger.WriteLog(LOG_LEVEL_WARNING, __FILE__, __LINE__, __FUNCTION__,
+            "new calldata json object failed");
+        data = fail_str;
+        json_object_put(root);
+        return -1;
+    }
+    json_object_object_add(calldata, "OutCallNum", json_object_new_int(_cc_call_data.outbound_call_num));
+    json_object_object_add(calldata, "OutAnsNum", json_object_new_int(_cc_call_data.outbound_ans_num));
+    json_object_object_add(calldata, "OutCallTime", json_object_new_int(_cc_call_data.outbound_call_time));
+    json_object_object_add(calldata, "InAnsNum", json_object_new_int(_cc_call_data.inbound_ans_num));
+    json_object_object_add(calldata, "InCallNum", json_object_new_int(_cc_call_data.inbound_ans_num));
+    json_object_object_add(calldata, "InCallTime", json_object_new_int(_cc_call_data.inbound_call_time));
+    json_object_object_add(calldata, "InAlertTime", json_object_new_int(_cc_call_data.inbound_alerting_time));
+    json_object_object_add(root, "result", json_object_new_string("0"));
+    json_object_object_add(root, "data", calldata);
+    data = json_object_to_json_string(root);
+    //acd_tool::m_logger.WriteLog(LOG_LEVEL_NOTICE, __FILE__, __LINE__, __FUNCTION__,
+    //    "get cc call data success, data(%s)", data.c_str());
+    acd_tool::m_logger.WriteLog(LOG_LEVEL_NOTICE, __FILE__, __LINE__, __FUNCTION__,
+        "get cc call data success");
+    json_object_put(root);
+    return 0;
+}
+
+int32_t AcdCallDataCollection::get_call_data_by_skill(string& data, const string& skill)
+{
+    SingleRWLocker s(&_lock, true);
+    string fail_str = "{\"result\":\"-1\",\"data\":\"memory error\"}";
+    json_object *root = json_object_new_object();
+    if (root == NULL) {
+        acd_tool::m_logger.WriteLog(LOG_LEVEL_WARNING, __FILE__, __LINE__, __FUNCTION__,
+            "new root json object failed");
+        data = fail_str;
+        return -1;
+    }
+    json_object *calldata = json_object_new_object();
+    if (calldata == NULL) {
+        acd_tool::m_logger.WriteLog(LOG_LEVEL_WARNING, __FILE__, __LINE__, __FUNCTION__,
+            "new calldata json object failed");
+        data = fail_str;
+        json_object_put(root);
+        return -1;
+    }
+    iter iter = _skill_call_info.find(skill);
+    if (iter == _skill_call_info.end()) {
+        json_object_object_add(root, "result", json_object_new_string("-1"));
+        json_object_object_add(root, "data", json_object_new_string("not found skill"));
+        data = json_object_to_json_string(root);
+        acd_tool::m_logger.WriteLog(LOG_LEVEL_NOTICE, __FILE__, __LINE__, __FUNCTION__,
+            "get cc call data by skill failed, skill(%s)", skill.c_str());
+        json_object_put(calldata);
+        json_object_put(calldata);
+        return -1;
+    }
+    json_object_object_add(calldata, "InCallTime", json_object_new_int(iter->second->inbound_call_time));
+    json_object_object_add(calldata, "InAlertTime", json_object_new_int(iter->second->inbound_alerting_time));
+    json_object_object_add(calldata, "InAnsNum", json_object_new_int(iter->second->inbound_answer_num));
+    json_object_object_add(calldata, "InCallNum", json_object_new_int(iter->second->inbound_call_num));
+    json_object_object_add(root, "result", json_object_new_string("0"));
+    json_object_object_add(root, "data", calldata);
+    data = json_object_to_json_string(root);
+    //acd_tool::m_logger.WriteLog(LOG_LEVEL_NOTICE, __FILE__, __LINE__, __FUNCTION__,
+    //    "get call data by skill success, skill(%s), data(%s)", skill.c_str(), data.c_str());
+    acd_tool::m_logger.WriteLog(LOG_LEVEL_NOTICE, __FILE__, __LINE__, __FUNCTION__,
+        "get call data by skill success skill(%s)", skill.c_str());
+    json_object_put(root);
+    return 0;
+}
+
+int32_t AcdCallDataCollection::get_call_data_by_all(string& data)
+{
+    SingleRWLocker s(&_lock, true);
+    string fail_str = "{\"result\":\"-1\",\"data\":\"memory error\"}";
+    json_object *root = json_object_new_object();
+    if (root == NULL) {
+        acd_tool::m_logger.WriteLog(LOG_LEVEL_WARNING, __FILE__, __LINE__, __FUNCTION__,
+            "new root json object failed");
+        data = fail_str;
+        return -1;
+    }
+    json_object *calldata = json_object_new_object();
+    if (calldata == NULL) {
+        acd_tool::m_logger.WriteLog(LOG_LEVEL_WARNING, __FILE__, __LINE__, __FUNCTION__,
+            "new calldata json object failed");
+        data = fail_str;
+        json_object_put(root);
+        return -1;
+    }
+    // add plat call info
+    json_object *platdata = json_object_new_object();
+    if (calldata == NULL) {
+        acd_tool::m_logger.WriteLog(LOG_LEVEL_WARNING, __FILE__, __LINE__, __FUNCTION__,
+            "new platdata json object failed");
+        data = fail_str;
+        json_object_put(root);
+        json_object_put(calldata);
+        return -1;
+    }
+    json_object_object_add(platdata, "OutCallNum", json_object_new_int(_cc_call_data.outbound_call_num));
+    json_object_object_add(platdata, "OutAnsNum", json_object_new_int(_cc_call_data.outbound_ans_num));
+    json_object_object_add(platdata, "OutCallTime", json_object_new_int(_cc_call_data.outbound_call_time));
+    json_object_object_add(platdata, "InAnsNum", json_object_new_int(_cc_call_data.inbound_ans_num));
+    json_object_object_add(platdata, "InCallNum", json_object_new_int(_cc_call_data.inbound_call_num));
+    json_object_object_add(platdata, "InCallTime", json_object_new_int(_cc_call_data.inbound_call_time));
+    json_object_object_add(platdata, "InAlertTime", json_object_new_int(_cc_call_data.inbound_alerting_time));
+    json_object_object_add(calldata, "platinfo", platdata);
+    json_object *skilldata = json_object_new_array();
+    if (skilldata == NULL) {
+        acd_tool::m_logger.WriteLog(LOG_LEVEL_WARNING, __FILE__, __LINE__, __FUNCTION__,
+            "new skilldata json object failed");
+        data = fail_str;
+        json_object_put(root);
+        json_object_put(calldata);
+        return -1;
+    }
+    for (iter iter = _skill_call_info.begin(); iter != _skill_call_info.end(); ++iter) {
+        if (iter->second != NULL) {
+            json_object *skillinfo = json_object_new_object();
+            if (skillinfo == NULL) {
+                acd_tool::m_logger.WriteLog(LOG_LEVEL_WARNING, __FILE__, __LINE__, __FUNCTION__,
+                    "new skilinfo json object failed, skill(%s)", iter->first.c_str());
+                continue;
+            }
+            json_object_object_add(skillinfo, "skillname", json_object_new_string(iter->first.c_str()));
+            json_object_object_add(skillinfo, "InCallTime", json_object_new_int(iter->second->inbound_call_time));
+            json_object_object_add(skillinfo, "InAlertTime", json_object_new_int(iter->second->inbound_alerting_time));
+            json_object_object_add(skillinfo, "InAnsNum", json_object_new_int(iter->second->inbound_answer_num));
+            json_object_object_add(skillinfo, "InCallNum", json_object_new_int(iter->second->inbound_call_num));
+            json_object_array_add(skilldata, skillinfo);
+        }
+    }
+    json_object_object_add(calldata, "skillinfo", skilldata);
+    json_object_object_add(root, "result", json_object_new_string("0"));
+    json_object_object_add(root, "data", calldata);
+    data = json_object_to_json_string(root);
+    //acd_tool::m_logger.WriteLog(LOG_LEVEL_NOTICE, __FILE__, __LINE__, __FUNCTION__,
+    //    "get call data by ALL success, data(%s)", data.c_str());
+    acd_tool::m_logger.WriteLog(LOG_LEVEL_NOTICE, __FILE__, __LINE__, __FUNCTION__,
+        "get call data by ALL success");
+    json_object_put(root);
+    return 0;    
+}
+
+acd::AcdResultT AcdCallDataCollection::get_call_data(int64_t handle, const std::string& agentId,
+                                                            int32_t type, const string& input, string& result)
+{
+    acd::AcdResultT ret = acd::AcdResultT::ArSuccess;
+    if (agentId.empty()) {
+        acd_tool::m_logger.WriteLog(LOG_LEVEL_WARNING, __FILE__, __LINE__, __FUNCTION__, "empty agentId");
+        ret = acd::AcdResultT::ArAgentIdIsEmpty;
+        return ret;
+    }
+
+    if (!acd_tool::p_m_acd_backup->GetIsMaster()) {
+        acd_tool::m_logger.WriteLog(LOG_LEVEL_WARNING, __FILE__, __LINE__, __FUNCTION__,
+                                    "agentId:%s handle:%"SHOW_LONG"d not master", agentId.c_str(), handle);
+        ret = acd::AcdResultT::ArNotMaster;
+        return ret;
+    }
+    if (type == GETBYPLAT) {
+        return get_call_data_by_plat(result);
+    }
+    else if (type == GETBYSKILL) {
+        return get_call_data_by_skill(result, input);
+    }
+    else if (type == GETALL) {
+        return get_call_data_by_all(result);
+    }
+    return -1;
+}
+
+void AcdCallDataCollection::reset()
+{
+    SingleRWLocker s(&_lock, true);
+    for (iter iter = _skill_call_info.begin()
+            ; iter != _skill_call_info.end()
+            ; ++iter) {
+         if (iter->second != NULL) {
+             delete iter->second;
+             iter->second = NULL;
+         }
+         _skill_call_info.erase(iter->first);
+    }
+
+    _cc_call_data.inbound_ans_num = 0;
+    _cc_call_data.inbound_call_num = 0;
+    _cc_call_data.inbound_call_time = 0;
+    _cc_call_data.outbound_ans_num = 0;
+    _cc_call_data.outbound_call_num = 0;
+    _cc_call_data.outbound_call_time = 0;
+}
+
+int32_t AcdCallDataCollection::push_call_data(calldata_ptr& calldata)
+{
+    if (calldata.get() == NULL ) {
+        acd_tool::m_logger.WriteLog(LOG_LEVEL_WARNING, __FILE__, __LINE__, __FUNCTION__,
+            "calldata is NULL");
+        return -1;
+    }
+    _calldata_queue.BlockPush(calldata);
+    acd_tool::m_logger.WriteLog(LOG_LEVEL_DEBUG, __FILE__, __LINE__, __FUNCTION__,
+        "calldata has in queue, agentId(%s),  sessionid(%lu), callid(%s), skill(%s)",
+        calldata->m_agentId.c_str(), calldata->m_sessionId, 
+        calldata->m_callId.c_str(), calldata->m_skill.c_str());
+    return 0;
+}
+};
diff --git a/platform/acd/src/acd_ims.cpp b/platform/acd/src/acd_ims.cpp
index d2be2a2..5f6c752 100644
--- a/platform/acd/src/acd_ims.cpp
+++ b/platform/acd/src/acd_ims.cpp
@@ -642,13 +642,14 @@ bool acd_ims::GetAssociateData(ims::SessionIdT sessionid, const string& agentId,
 }
 
 bool acd_ims::RouteRequestRespond(ims::SessionIdT sessionid, ims::RouteRequestIDT requestId,
-                                  const ims::RouteEventReasonT& result, const string& targetUri) {
+                                  const ims::RouteEventReasonT& result, const string& targetUri, 
+                                  const string& targetAgentId) {
     if (p_m_imsapi_prx) {
         acd_tool::m_logger.WriteLog(LOG_LEVEL_DEBUG, __FILE__, __LINE__, __FUNCTION__,
                                     "sessionid:%"SHOW_LONG"d requestId:%"SHOW_LONG"d result:%s targetUri:%s", sessionid, requestId,
                                     result.get_desc().c_str(), targetUri.c_str());
         ims::CcResultT ret = p_m_imsapi_prx->RouteRequestRespond(m_reqid, sessionid, requestId, result,
-                             targetUri);
+                             targetUri, targetAgentId);
 
         if (p_m_imsapi_prx->get_errno() != 0) {
             acd_tool::m_logger.WriteLog(LOG_LEVEL_WARNING, __FILE__, __LINE__, __FUNCTION__,
diff --git a/platform/acd/src/acd_info.cpp b/platform/acd/src/acd_info.cpp
index 9f5842d..3ee86b1 100644
--- a/platform/acd/src/acd_info.cpp
+++ b/platform/acd/src/acd_info.cpp
@@ -17,6 +17,7 @@
 
 #include "acd_info.h"
 #include "acd_tool.h"
+#include "acd_data_collection.h"
 
 CallDirectT::CallDirectT(int32_t value) : m_value(value) {
 }
@@ -54,12 +55,7 @@ bool ReleaseCauseT::isValid() {
     return m_value != UNKNOWN;
 }
 
-callinfo::callinfo() : m_sessionId(0), m_callId(""), m_agentId(""), m_agentDn(""), m_caller(""),
-    m_callee(""), m_waitbegin(0), m_waitend(0),
-    m_ackbegin(0), m_ackend(0), m_callbegin(0), m_callend(0),
-    m_callType(ims::PartyAttributeT::P_Unknown), m_callDirect(CallDirectT::UNKNOWN),
-    m_releaseCause(ReleaseCauseT::UNKNOWN),
-    m_recordFilename(""), m_routecall(false) {
+callinfo::callinfo() {
 }
 
 callinfo::~callinfo() {
@@ -94,7 +90,20 @@ void callinfo::SetAckEnd(time_t t) {
     }
 }
 
+void callinfo::SetConnectBegin(time_t t) {
+    _m_connectbegin = t;
+}
+
+void callinfo::SetConnectEnd(time_t t) {
+    if (0 != _m_connectbegin) {
+        _m_connectend = t;
+    }
+}
+
 void callinfo::SetCallBegin(time_t t) {
+    if (m_ackend == 0) {
+        m_ackend = t;
+    }
     m_callbegin = t;
     m_callend = t;
 }
@@ -145,6 +154,8 @@ void callinfo::reset() {
     m_waitend = 0;
     m_ackbegin = 0;
     m_ackend = 0;
+    _m_connectbegin = 0;
+    _m_connectend = 0;
     m_callbegin = 0;
     m_callend = 0;
 
@@ -177,4 +188,55 @@ void callinfo::WriteCallLog() {
            << ',' << m_releaseCause.get_value()
            << ',' << m_recordFilename;
     acd_tool::m_calllogger.WriteLog(strbuf.str().c_str());
+    AddDataToCollection();
 }
+
+/*void callinfo::WriteCallLog() {
+    ostringstream strbuf;
+    strbuf << '1'
+           << ',' << m_sessionId
+           << ',' << m_callId
+           << ',' << m_agentId
+           << ',' << m_agentDn
+           << ',' << m_skill
+           << ',' << m_caller
+           << ',' << m_callee
+           << ',' << static_cast<int64_t>(m_waitbegin)
+           << ',' << static_cast<int64_t>(m_waitend)
+           << ',' << static_cast<int64_t>(m_ackbegin)
+           << ',' << static_cast<int64_t>(m_ackend)
+           << ',' << static_cast<int64_t>(_m_connectbegin)
+           << ',' << static_cast<int64_t>(_m_connectend)
+           << ',' << static_cast<int64_t>(m_callbegin)
+           << ',' << static_cast<int64_t>(m_callend)
+           << ',' << m_callType.get_value()
+           << ',' << m_callDirect.get_value()
+           << ',' << m_releaseCause.get_value()
+           << ',' << m_recordFilename;
+    acd_tool::m_calllogger.WriteLog(strbuf.str().c_str());
+    AddDataToCollection();
+}*/
+
+void callinfo::AddDataToCollection()
+{
+    calldata_ptr p(new (std::nothrow) calldata(m_sessionId, m_callId, m_agentId,
+        m_agentDn, m_skill, m_caller, m_callee, m_waitbegin, m_waitend, m_ackbegin, m_ackend,
+        _m_connectbegin, _m_connectend, m_callbegin, m_callend, m_callType, m_callDirect,
+        m_releaseCause, m_recordFilename, m_routecall));
+    /*struct calldata *p = new (std::nothrow) calldata(m_sessionId, m_callId, m_agentId,
+        m_agentDn, m_skill, m_caller, m_callee, m_waitbegin, m_waitend, m_ackbegin, m_ackend,
+        _m_connectbegin, _m_connectend, m_callbegin, m_callend, m_callType, m_callDirect,
+        m_releaseCause, m_recordFilename, m_routecall);*/
+    if (p.get() ==  NULL) {
+        acd_tool::m_logger.WriteLog(LOG_LEVEL_DEBUG, __FILE__, __LINE__, __FUNCTION__,
+            "new failed: agentId(%s),  sessionid(%d), callid(%s), skill(%s)", 
+            m_agentId.c_str(), m_sessionId, m_callId.c_str(), m_skill.c_str());
+        return;
+    }
+    acd_tool::_acd_calldata.push_call_data(p);
+    acd_tool::m_logger.WriteLog(LOG_LEVEL_DEBUG, __FILE__, __LINE__, __FUNCTION__,
+        "push calldata to cached: agentId(%s),  sessionid(%lu), callid(%s), skill(%s)in queue", 
+        m_agentId.c_str(), m_sessionId, m_callId.c_str(), m_skill.c_str());
+    return;
+}
+
diff --git a/platform/acd/src/acd_send_event_manager.cpp b/platform/acd/src/acd_send_event_manager.cpp
index c0abeab..5e665d8 100644
--- a/platform/acd/src/acd_send_event_manager.cpp
+++ b/platform/acd/src/acd_send_event_manager.cpp
@@ -61,12 +61,25 @@ void acd_send_event::Method() {
         }
 
         if (p_event->m_callback_proxy->get_errno() != 0) {
-            acd_tool::m_logger.WriteLog(LOG_LEVEL_WARNING, __FILE__, __LINE__, __FUNCTION__,
-                                        "thread flag:%d event id:%d Communication Error:%d", m_thread_flag, p_event->m_event_id,
-                                        p_event->m_callback_proxy->get_errno());
+            if (p_event->m_event_type == AGENT_EVENT) {
+                acd_tool::m_logger.WriteLog(LOG_LEVEL_WARNING, __FILE__, __LINE__, __FUNCTION__,
+                        "thread flag:%d event id:%d sid:%lld evtname:%s Communication Error:%d", m_thread_flag, p_event->m_event_id,
+                        p_event->m_agent_event.sessionId, p_event->m_agent_event.eventId.get_desc().c_str(),
+                        p_event->m_callback_proxy->get_errno());
+            } else {
+                acd_tool::m_logger.WriteLog(LOG_LEVEL_WARNING, __FILE__, __LINE__, __FUNCTION__,
+                    "thread flag:%d event id:%d Communication Error:%d", m_thread_flag, p_event->m_event_id,
+                    p_event->m_callback_proxy->get_errno());
+            }
         } else {
-            acd_tool::m_logger.WriteLog(LOG_LEVEL_DEBUG, __FILE__, __LINE__, __FUNCTION__,
-                                        "thread flag:%d event id:%d Communication Success", m_thread_flag, p_event->m_event_id);
+            if (p_event->m_event_type == AGENT_EVENT) {
+                acd_tool::m_logger.WriteLog(LOG_LEVEL_DEBUG, __FILE__, __LINE__, __FUNCTION__,
+                    "thread flag:%d event id:%d sid:%lld evtname:%s Communication Success", m_thread_flag, p_event->m_event_id,
+                    p_event->m_agent_event.sessionId, p_event->m_agent_event.eventId.get_desc().c_str());
+            } else {
+                acd_tool::m_logger.WriteLog(LOG_LEVEL_DEBUG, __FILE__, __LINE__, __FUNCTION__,
+                    "thread flag:%d event id:%d Communication Success", m_thread_flag, p_event->m_event_id);
+            }
         }
 
         acd_tool::write_acd_event_log(*p_event);
@@ -123,7 +136,22 @@ void acd_send_event_manager::send_event(SendEventT* p_event, int64_t handle) {
 
     vector<acd_send_event*>::size_type thread_flag = static_cast<vector<acd_send_event*>::size_type>
             (handle % m_max_thread);
-    acd_tool::m_logger.WriteLog(LOG_LEVEL_DEBUG, __FILE__, __LINE__, __FUNCTION__,
-                                "thread flag:%d event id:%d in queue", thread_flag, p_event->m_event_id);
+    
+    if (p_event->m_event_type == AGENT_EVENT) {
+        acd_tool::m_logger.WriteLog(LOG_LEVEL_DEBUG, __FILE__, __LINE__, __FUNCTION__,
+            "thread flag:%d event id:%d sid:%lld evtname:%s in queue", thread_flag, p_event->m_event_id,
+            p_event->m_agent_event.sessionId, p_event->m_agent_event.eventId.get_desc().c_str());
+    
+    }
+    else if (p_event->m_event_type == MEDIA_EVENT) {
+        acd_tool::m_logger.WriteLog(LOG_LEVEL_DEBUG, __FILE__, __LINE__, __FUNCTION__,
+            "thread flag:%d event id:%d sid:%lld evtname:%s in queue", thread_flag, p_event->m_event_id,
+            p_event->m_media_event.sessionId, p_event->m_media_event.eventType.get_desc().c_str());
+    }
+    else {
+        acd_tool::m_logger.WriteLog(LOG_LEVEL_DEBUG, __FILE__, __LINE__, __FUNCTION__,
+            "thread flag:%d event id:%d in queue", thread_flag, p_event->m_event_id);
+    }
+
     m_event_arrey[thread_flag]->in_queue(p_event);
 }
diff --git a/platform/acd/src/acd_server.cpp b/platform/acd/src/acd_server.cpp
index e3be7e3..143c28c 100644
--- a/platform/acd/src/acd_server.cpp
+++ b/platform/acd/src/acd_server.cpp
@@ -344,3 +344,10 @@ acd::AcdResultT acd_server::ResetConfig(const string& password,
                                         const std::map<std::string, std::string>& ctx) {
     return acd_tool::m_agent_manager.ResetConfig(password);
 }
+
+acd::AcdResultT acd_server::GetCallInfo(int64_t handle, const string& agentId, 
+                                int32_t type, const string& input, string& result, 
+                                const std::map<std::string, std::string>& ctx)
+{
+    return acd_tool::_acd_calldata.get_call_data(handle, agentId, type, input, result);
+}
diff --git a/platform/acd/src/acd_skill.cpp b/platform/acd/src/acd_skill.cpp
index 7dcf108..5b06c11 100644
--- a/platform/acd/src/acd_skill.cpp
+++ b/platform/acd/src/acd_skill.cpp
@@ -104,10 +104,11 @@ void acd_skill::Method() {
             continue;
         }
 
-        p_agent->lock(pRequest->GetEvent(), pRequest->GetWaitbeginTime());
+        p_agent->lock(pRequest->GetEvent(), m_strSkill, pRequest->GetWaitbeginTime());
 
         if (acd_tool::p_m_acd_ims->RouteRequestRespond(pRequest->GetEvent().sessionid,
-                pRequest->GetEvent().requstid, ims::RouteEventReasonT::RouteReasonSuccess, p_agent->GetAgentDn())) {
+                pRequest->GetEvent().requstid, ims::RouteEventReasonT::RouteReasonSuccess, p_agent->GetAgentDn(), 
+                p_agent->GetAgentId())) {
             acd_tool::m_logger.WriteLog(LOG_LEVEL_DEBUG, __FILE__, __LINE__, __FUNCTION__,
                                         "flag:%d skill:%s requestId:%"SHOW_LONG"d request agentId:%s agentDn:%d success", m_skill_flag,
                                         m_strSkill.c_str(), requestId, p_agent->GetAgentId().c_str(), p_agent->GetAgentDn().c_str());
@@ -140,7 +141,7 @@ bool acd_skill::isTimeoutRequest(const request_ptr& pRequest) {
     if (bgcc::TimeUtil::get_timestamp_us() - pRequest->GetEvent().timestamp >
             pRequest->GetEvent().timeout * 1000000) {
         acd_tool::p_m_acd_ims->RouteRequestRespond(pRequest->GetEvent().sessionid,
-                pRequest->GetEvent().requstid, ims::RouteEventReasonT::RouteReasonBusy, "");
+                pRequest->GetEvent().requstid, ims::RouteEventReasonT::RouteReasonBusy, "", "");
         acd_tool::m_logger.WriteLog(LOG_LEVEL_DEBUG, __FILE__, __LINE__, __FUNCTION__,
                                     "requestId:%"SHOW_LONG"d is timeout", pRequest->GetEvent().requstid);
         return true;
@@ -151,7 +152,7 @@ bool acd_skill::isTimeoutRequest(const request_ptr& pRequest) {
 
 bool acd_skill::ProcessInvalidRequest(const request_ptr& pRequest) {
     acd_tool::p_m_acd_ims->RouteRequestRespond(pRequest->GetEvent().sessionid,
-            pRequest->GetEvent().requstid, ims::RouteEventReasonT::RouteReasonWrongSkill, "");
+            pRequest->GetEvent().requstid, ims::RouteEventReasonT::RouteReasonWrongSkill, "", "");
     acd_tool::m_logger.WriteLog(LOG_LEVEL_DEBUG, __FILE__, __LINE__, __FUNCTION__,
                                 "requestId:%"SHOW_LONG"d invalid", pRequest->GetEvent().requstid);
     return true;
diff --git a/platform/acd/src/acd_skill_manager.cpp b/platform/acd/src/acd_skill_manager.cpp
index f818044..52f3581 100644
--- a/platform/acd/src/acd_skill_manager.cpp
+++ b/platform/acd/src/acd_skill_manager.cpp
@@ -79,7 +79,7 @@ void acd_skill_manager::RouteRequest(const ims::RouteEventT& event) {
         p_skill->RouteRequest(event);
     } else {
         acd_tool::p_m_acd_ims->RouteRequestRespond(event.sessionid, event.requstid,
-                ims::RouteEventReasonT::RouteReasonWrongSkill, "");
+                ims::RouteEventReasonT::RouteReasonWrongSkill, "", "");
         acd_tool::m_logger.WriteLog(LOG_LEVEL_WARNING, __FILE__, __LINE__, __FUNCTION__,
                                     "requestId:%"SHOW_LONG"d request skill:%s not existed", event.requstid, event.requestArgs.c_str());
     }
@@ -190,7 +190,7 @@ void acd_skill_manager::ProcessIMSEvent(const ims::RouteEventT& event) {
     switch (event.eventType.get_value()) {
     case ims::RouteEventTypeT::RT_RouteUnknown:
         acd_tool::p_m_acd_ims->RouteRequestRespond(event.sessionid, event.requstid,
-                ims::RouteEventReasonT::RouteReasonError, "");
+                ims::RouteEventReasonT::RouteReasonError, "", "");
         acd_tool::m_logger.WriteLog(LOG_LEVEL_CRITICAL, __FILE__, __LINE__, __FUNCTION__,
                                     "event type error");
         break;
@@ -201,7 +201,7 @@ void acd_skill_manager::ProcessIMSEvent(const ims::RouteEventT& event) {
 
     case ims::RouteEventTypeT::RT_RouteRespond:
         acd_tool::p_m_acd_ims->RouteRequestRespond(event.sessionid, event.requstid,
-                ims::RouteEventReasonT::RouteReasonError, "");
+                ims::RouteEventReasonT::RouteReasonError, "", "");
         acd_tool::m_logger.WriteLog(LOG_LEVEL_CRITICAL, __FILE__, __LINE__, __FUNCTION__,
                                     "event type error");
         break;
@@ -212,7 +212,7 @@ void acd_skill_manager::ProcessIMSEvent(const ims::RouteEventT& event) {
 
     default:
         acd_tool::p_m_acd_ims->RouteRequestRespond(event.sessionid, event.requstid,
-                ims::RouteEventReasonT::RouteReasonError, "");
+                ims::RouteEventReasonT::RouteReasonError, "", "");
         acd_tool::m_logger.WriteLog(LOG_LEVEL_CRITICAL, __FILE__, __LINE__, __FUNCTION__,
                                     "event type error");
         break;
diff --git a/platform/acd/src/acd_tool.cpp b/platform/acd/src/acd_tool.cpp
index ceb4659..e53fe4a 100644
--- a/platform/acd/src/acd_tool.cpp
+++ b/platform/acd/src/acd_tool.cpp
@@ -16,6 +16,7 @@
 
 
 #include "acd_tool.h"
+using acd::AcdCallDataCollection;
 
 IDCreater::IDCreater() : m_ID(0) {
 }
@@ -49,6 +50,7 @@ acd_skill_manager acd_tool::m_skill_manager;
 acd_backup* acd_tool::p_m_acd_backup = NULL;
 acd_ims* acd_tool::p_m_acd_ims = NULL;
 acd_main_server acd_tool::m_main_server;
+AcdCallDataCollection acd_tool::_acd_calldata;
 
 void acd_tool::init_log() {
     m_logger.Initialize(m_config.m_log_count, m_config.m_log_filecount, LOG_DIR, LOG_FILE, ACD_VERSION,
@@ -109,6 +111,19 @@ void acd_tool::un_init_connect() {
     p_m_acd_backup = NULL;
 }
 
+void acd_tool::init_collection() 
+{
+    _acd_calldata.initialize(DATA_CACHE_FILE);
+    cout << "data collection init" << endl;
+    _acd_calldata.Start();
+}
+
+void acd_tool::un_init_collection() 
+{
+    _acd_calldata.unInitialize();
+    _acd_calldata.Stop();
+}
+
 void acd_tool::init() {
     if (m_config.read_config()) {
         cout << "acd init, read config success!" << endl;
@@ -116,14 +131,15 @@ void acd_tool::init() {
         cout << "acd init, read config error! acd exit!" << endl;
         exit(0);
     }
-
     init_log();
     init_manager();
+    init_collection();
     init_connect();
 }
 
 void acd_tool::un_init() {
     un_init_connect();
+    un_init_collection();
     un_init_manager();
     un_init_log();
 }
diff --git a/platform/agentproxy/Makefile b/platform/agentproxy/Makefile
index 3604e10..7e958c6 100644
--- a/platform/agentproxy/Makefile
+++ b/platform/agentproxy/Makefile
@@ -20,7 +20,7 @@ CXXFLAGS = -Wall -W -pipe -Wno-unused-parameter -Wreorder -Wwrite-strings -Wswit
 		   -fPIC -finline-functions -Winline -Wreturn-type -Wtrigraphs -Wformat -Wparentheses -Wpointer-arith \
 		         -DSCMPF_MODULE_VERSION=\"$(VERSION)\"  -DPROJECT_NAME=\"$(BINNAME)\"
 
-LDFLAGS = -lacd -lap -lpthread -lbgcc -lssl -lm -lrt
+LDFLAGS = -lacd -lap -lpthread -lbgcc -lssl -lcrypto -lm -lrt -ldl
 
 SOURCES = $(wildcard src/core/*.cpp) $(wildcard src/apserver/*.cpp) $(wildcard src/apclient/*.cpp)
 OBJS = $(patsubst %.cpp,%.o,$(SOURCES))
@@ -61,7 +61,7 @@ output: $(OBJS)
 
 $(OBJS): %.o: %.cpp
 	$(CXX) $(CXXFLAGS) -c $< -o $@ $(INC_PATH) 
-clean:apclean getagentclean reloadclean acdServerclean
+clean:apclean
 
 apclean:
 	rm -f $(OBJS)
@@ -71,12 +71,3 @@ apclean:
 	rm -f $(BINNAME)
 	rm -fr $(OUTPUT_PATH)
 	rm -fr $(LOG_PATH)
-
-getagentclean:
-	@$(MAKE) clean -C sample/GetAgents
-
-reloadclean:
-	@$(MAKE) clean -C sample/Reload
-
-acdServerclean:
-	@$(MAKE) clean -C sample/acdServer
diff --git a/platform/agentproxy/include/apclient/ApClient.h b/platform/agentproxy/include/apclient/ApClient.h
index a445250..a4ed6a3 100644
--- a/platform/agentproxy/include/apclient/ApClient.h
+++ b/platform/agentproxy/include/apclient/ApClient.h
@@ -370,6 +370,9 @@ class ApClient {
                             int64_t requestId,
                             uint64_t time_rcv);
 
+    AcdResultT GetCallInfo(int64_t handle, const std::string& agentId, 
+                            int32_t type, const std::string& input, std::string& result);
+
 }; // end of class ApClient
 
 
diff --git a/platform/agentproxy/include/apserver/ApServer.h b/platform/agentproxy/include/apserver/ApServer.h
index 9d68992..6df99c9 100644
--- a/platform/agentproxy/include/apserver/ApServer.h
+++ b/platform/agentproxy/include/apserver/ApServer.h
@@ -343,6 +343,10 @@ class ApServer: public acdapi {
 
     virtual AcdResultT JumptheQueue(int64_t handle, const std::string& agentId, int64_t requestId,
                                     const std::map<std::string, std::string>& ctx);
+
+    virtual acd::AcdResultT GetCallInfo(int64_t handle, const std::string& agentId,
+                                        int32_t type, const std::string& input, std::string& result,
+                                        const std::map<std::string, std::string>& ctx);
 private:
 
 
diff --git a/platform/agentproxy/include/apserver/ApService.h b/platform/agentproxy/include/apserver/ApService.h
index c1a8264..0fc898d 100644
--- a/platform/agentproxy/include/apserver/ApService.h
+++ b/platform/agentproxy/include/apserver/ApService.h
@@ -33,7 +33,6 @@ class ApService: public apapi {
      * @return  ³É¹¦£ºtrue;Ê§°Ü£ºfalse
      * @see
      * @note
-     * @author  caozhenxing(caozhenxing@baidu.com)
      * @date    2013Äê03ÔÂ26ÈÕ 21Ê±23·Ö25Ãë
      */
     bool InitApService(std::string ApListenIp, int32_t ApListenPort, int32_t threadPoolNum);
@@ -44,7 +43,6 @@ class ApService: public apapi {
      * @return  ³É¹¦£ºtrue;Ê§°Ü£ºfalse
      * @see
      * @note
-     * @author  caozhenxing(caozhenxing@baidu.com)
      * @date    2013Äê03ÔÂ26ÈÕ 21Ê±23·Ö25Ãë
      */
     virtual bool ReLoadConfig(const std::map<std::string, std::string>& ctx);
@@ -56,7 +54,6 @@ class ApService: public apapi {
      * @return  ³É¹¦£ºtrue;Ê§°Ü£ºfalse
      * @see
      * @note
-     * @author  caozhenxing(caozhenxing@baidu.com)
      * @date    2013Äê03ÔÂ26ÈÕ 21Ê±23·Ö25Ãë
      */
     virtual bool GetAgents(ApAgentInfoListT& agentInfoList,
diff --git a/platform/agentproxy/include/core/AgentProxy.h b/platform/agentproxy/include/core/AgentProxy.h
index 1203eda..9b7f6e7 100644
--- a/platform/agentproxy/include/core/AgentProxy.h
+++ b/platform/agentproxy/include/core/AgentProxy.h
@@ -62,7 +62,6 @@ class AgentProxy {
      * @return  ³É¹¦£ºtrue;Ê§°Ü£ºfalse
      * @see
      * @note
-     * @author  caozhenxing(caozhenxing@baidu.com)
      * @date    2012Äê06ÔÂ28ÈÕ 13Ê±05·Ö33Ãë
      */
     bool Init();
@@ -75,7 +74,6 @@ class AgentProxy {
      * @return
      * @see
      * @note
-     * @author  caozhenxing(caozhenxing@baidu.com)
      * @date    2012Äê06ÔÂ28ÈÕ 12Ê±59·Ö09Ãë
      */
     bool SetMapAgentIdData(AgentData* agentInfo);
@@ -86,7 +84,6 @@ class AgentProxy {
      * @return  ³É¹¦£ºtrue;Ê§°Ü£ºfalse
      * @see
      * @note
-     * @author  caozhenxing(caozhenxing@baidu.com)
      * @date    2012Äê06ÔÂ28ÈÕ 13Ê±07·Ö04Ãë
      */
     bool DelMapAgentIdData(const std::string& agentId);
@@ -96,7 +93,6 @@ class AgentProxy {
      * @return  ³É¹¦£ºtrue;Ê§°Ü£ºfalse
      * @see
      * @note
-     * @author  caozhenxing(caozhenxing@baidu.com)
      * @date    2012Äê06ÔÂ28ÈÕ 13Ê±07·Ö04Ãë
      */
     bool ClearMapAgentData();
@@ -110,7 +106,6 @@ class AgentProxy {
      * @return  ³É¹¦£ºtrue;Ê§°Ü£ºfalse
      * @see
      * @note
-     * @author  caozhenxing(caozhenxing@baidu.com)
      * @date    2012Äê06ÔÂ28ÈÕ 13Ê±07·Ö30Ãë
      */
     bool ResetProxy(const std::string& agentId, AgentData* agentInfo);
@@ -124,7 +119,6 @@ class AgentProxy {
      * @return  ³É¹¦£ºtrue;Ê§°Ü£ºfalse
      * @see
      * @note
-     * @author  caozhenxing(caozhenxing@baidu.com)
      * @date    2012Äê06ÔÂ29ÈÕ 17Ê±23·Ö25Ãë
      */
     bool GetAgentData(const std::string& agentId, AgentData& agentInfo);
@@ -138,7 +132,6 @@ class AgentProxy {
      * @return  ³É¹¦£ºtrue;Ê§°Ü£ºfalse
      * @see
      * @note
-     * @author  caozhenxing(caozhenxing@baidu.com)
      * @date    2012Äê06ÔÂ29ÈÕ 17Ê±23·Ö25Ãë
      */
     bool GetAgentHandleById(const std::string agentId, int64_t& handle);
@@ -149,7 +142,6 @@ class AgentProxy {
      * @return  ³É¹¦£ºtrue;Ê§°Ü£ºfalse
      * @see
      * @note
-     * @author  caozhenxing(caozhenxing@baidu.com)
      * @date    2012Äê06ÔÂ29ÈÕ 17Ê±23·Ö25Ãë
      */
     bool IsAgentHasExist(const std::string agentId);
@@ -160,7 +152,6 @@ class AgentProxy {
      * @return  ³É¹¦£ºtrue;Ê§°Ü£ºfalse
      * @see
      * @note
-     * @author  caozhenxing(caozhenxing@baidu.com)
      * @date    2012Äê06ÔÂ29ÈÕ 17Ê±23·Ö25Ãë
      */
     bool UpdateAgentData(AgentData& agentinfo);
@@ -171,7 +162,6 @@ class AgentProxy {
      * @return  ³É¹¦£ºtrue;Ê§°Ü£ºfalse
      * @see
      * @note
-     * @author  caozhenxing(caozhenxing@baidu.com)
      * @date    2013Äê03ÔÂ26ÈÕ 21Ê±23·Ö25Ãë
      */
     bool SetAgentOldProxyNull(const std::string agentId, int64_t handle);
@@ -182,7 +172,6 @@ class AgentProxy {
      * @return  ³É¹¦£ºtrue;Ê§°Ü£ºfalse
      * @see
      * @note
-     * @author  caozhenxing(caozhenxing@baidu.com)
      * @date    2013Äê03ÔÂ26ÈÕ 21Ê±23·Ö25Ãë
      */
     bool SetAgentHandleById(const std::string agentId, int64_t handle);
@@ -194,7 +183,6 @@ class AgentProxy {
      * @return  ³É¹¦£ºtrue;Ê§°Ü£ºfalse
      * @see
      * @note
-     * @author  caozhenxing(caozhenxing@baidu.com)
      * @date    2013Äê03ÔÂ26ÈÕ 21Ê±23·Ö25Ãë
      */
     void SetAgentFlag(const std::string agentId, int32_t flag);
@@ -206,7 +194,6 @@ class AgentProxy {
      * @return  ³É¹¦£ºtrue;Ê§°Ü£ºfalse
      * @see
      * @note
-     * @author  caozhenxing(caozhenxing@baidu.com)
      * @date    2013Äê03ÔÂ26ÈÕ 21Ê±23·Ö25Ãë
      */
     void SendCallEvent(const AgentEventT& acdCallEvent, int32_t threadNo);
@@ -218,7 +205,6 @@ class AgentProxy {
      * @return  ³É¹¦£ºtrue;Ê§°Ü£ºfalse
      * @see
      * @note
-     * @author  caozhenxing(caozhenxing@baidu.com)
      * @date    2013Äê03ÔÂ26ÈÕ 21Ê±23·Ö25Ãë
      */
     void SendOtherEvent(const OtherEventT& acdOtherEvent, int32_t threadNo);
@@ -230,7 +216,6 @@ class AgentProxy {
      * @return  ³É¹¦£ºtrue;Ê§°Ü£ºfalse
      * @see
      * @note
-     * @author  caozhenxing(caozhenxing@baidu.com)
      * @date    2013Äê03ÔÂ26ÈÕ 21Ê±23·Ö25Ãë
      */
     void SendRouteEvent(const RouteEventT& acdRouteEvent, int32_t threadNo);
@@ -242,7 +227,6 @@ class AgentProxy {
      * @return  ³É¹¦£ºtrue;Ê§°Ü£ºfalse
      * @see
      * @note
-     * @author  caozhenxing(caozhenxing@baidu.com)
      * @date    2013Äê03ÔÂ26ÈÕ 21Ê±23·Ö25Ãë
      */
     void SendMediaEvent(const MediaEventT& acdMediaEvent, int32_t threadNo);
@@ -252,7 +236,6 @@ class AgentProxy {
      * @return ÐÄÌøÊ±¼ä
      * @see
      * @note
-     * @author  caozhenxing(caozhenxing@baidu.com)
      * @date    2013Äê03ÔÂ26ÈÕ 21Ê±23·Ö25Ãë
      */
     int32_t GetHeartBeatTimeOut();
@@ -265,7 +248,6 @@ class AgentProxy {
      * @return
      * @see
      * @note
-     * @author  caozhenxing(caozhenxing@baidu.com)
      * @date    2012Äê06ÔÂ28ÈÕ 13Ê±08·Ö14Ãë
      */
     bool AddAcdCallEvent(AgentEventT& event);
@@ -278,7 +260,6 @@ class AgentProxy {
      * @return
      * @see
      * @note
-     * @author  caozhenxing(caozhenxing@baidu.com)
      * @date    2012Äê06ÔÂ28ÈÕ 13Ê±08·Ö27Ãë
      */
     bool AddAcdMediaEvent(MediaEventT& event);
@@ -291,7 +272,6 @@ class AgentProxy {
      * @return
      * @see
      * @note
-     * @author  caozhenxing(caozhenxing@baidu.com)
      * @date    2012Äê06ÔÂ28ÈÕ 13Ê±08·Ö37Ãë
      */
     bool AddAcdRouteEvent(RouteEventT& event);
@@ -304,7 +284,6 @@ class AgentProxy {
      * @return
      * @see
      * @note
-     * @author  caozhenxing(caozhenxing@baidu.com)
      * @date    2012Äê06ÔÂ28ÈÕ 13Ê±08·Ö47Ãë
      */
     bool AddAcdOtherEvent(OtherEventT& event);
@@ -317,7 +296,6 @@ class AgentProxy {
      * @return
      * @see
      * @note
-     * @author  caozhenxing(caozhenxing@baidu.com)
      * @date    2012Äê06ÔÂ28ÈÕ 13Ê±08·Ö59Ãë
      */
     bool GetAcdCallEvent(AgentEventT& event, const int32_t threadNo);
@@ -330,7 +308,6 @@ class AgentProxy {
      * @return
      * @see
      * @note
-     * @author  caozhenxing(caozhenxing@baidu.com)
      * @date    2012Äê06ÔÂ28ÈÕ 13Ê±09·Ö11Ãë
      */
     bool GetAcdMediaEvent(MediaEventT& event, const int32_t threadNo);
@@ -343,7 +320,6 @@ class AgentProxy {
      * @return
      * @see
      * @note
-     * @author  caozhenxing(caozhenxing@baidu.com)
      * @date    2012Äê06ÔÂ28ÈÕ 13Ê±09·Ö22Ãë
      */
     bool GetAcdRouteEvent(RouteEventT& event, const int32_t threadNo);
@@ -356,7 +332,6 @@ class AgentProxy {
      * @return
      * @see
      * @note
-     * @author  caozhenxing(caozhenxing@baidu.com)
      * @date    2012Äê06ÔÂ28ÈÕ 13Ê±09·Ö36Ãë
      */
     bool GetAcdOtherEvent(OtherEventT& event, const int32_t threadNo);
@@ -367,7 +342,6 @@ class AgentProxy {
      * @return
      * @see
      * @note
-     * @author  caozhenxing(caozhenxing@baidu.com)
      * @date    2012Äê06ÔÂ28ÈÕ 13Ê±09·Ö54Ãë
      */
     bool CreateAcdCBThread();
@@ -377,7 +351,6 @@ class AgentProxy {
      * @return  ³É¹¦£ºtrue;Ê§°Ü£ºfalse
      * @see
      * @note
-     * @author  caozhenxing(caozhenxing@baidu.com)
      * @date    2013Äê03ÔÂ26ÈÕ 21Ê±23·Ö25Ãë
      */
     bool CreateApListenThread();
@@ -390,7 +363,6 @@ class AgentProxy {
      * @return
      * @see
      * @note
-     * @author  caozhenxing(caozhenxing@baidu.com)
      * @date    2012Äê06ÔÂ28ÈÕ 13Ê±10·Ö03Ãë
      */
     bool IsQueueEmpty(const int32_t& threadNo);
@@ -401,7 +373,6 @@ class AgentProxy {
      * @return
      * @see
      * @note
-     * @author  caozhenxing(caozhenxing@baidu.com)
      * @date    2012Äê06ÔÂ28ÈÕ 13Ê±10·Ö20Ãë
      */
     void HeartBeat();
@@ -412,7 +383,6 @@ class AgentProxy {
      * @return
      * @see
      * @note
-     * @author  caozhenxing(caozhenxing@baidu.com)
      * @date    2012Äê06ÔÂ28ÈÕ 13Ê±10·Ö45Ãë
      */
     bool Backup();
@@ -423,7 +393,6 @@ class AgentProxy {
      * @return
      * @see
      * @note
-     * @author  caozhenxing(caozhenxing@baidu.com)
      * @date    2012Äê06ÔÂ28ÈÕ 13Ê±14·Ö28Ãë
      */
     static AgentProxy* Instance() {
@@ -435,7 +404,6 @@ class AgentProxy {
      * @brief Destroy Ïú»Ù×ÊÔ´
      * @see
      * @note
-     * @author  caozhenxing(caozhenxing@baidu.com)
      * @date    2012Äê06ÔÂ29ÈÕ 13Ê±18·Ö58Ãë
      */
     void Destroy();
@@ -445,7 +413,6 @@ class AgentProxy {
      * @return
      * @see
      * @note
-     * @author  caozhenxing(caozhenxing@baidu.com)
      * @date    2012Äê06ÔÂ28ÈÕ 13Ê±09·Ö54Ãë
      */
     bool CreateCheckHBThread();
@@ -456,7 +423,6 @@ class AgentProxy {
      * @return
      * @see
      * @note
-     * @author  caozhenxing(caozhenxing@baidu.com)
      * @date    2012Äê07ÔÂ01ÈÕ 15Ê±26·Ö48Ãë
      */
     bool IsNeedApThreadShutdown();
@@ -469,7 +435,6 @@ class AgentProxy {
      * @return  ³É¹¦£ºtrue;Ê§°Ü£ºfalse
      * @see
      * @note
-     * @author  caozhenxing(caozhenxing@baidu.com)
      * @date    2013Äê03ÔÂ26ÈÕ 21Ê±23·Ö25Ãë
      */
     bool CreateClient(std::string Ip, int32_t Port, int32_t connectNum);
@@ -480,7 +445,6 @@ class AgentProxy {
      * @return
      * @see
      * @note
-     * @author  caozhenxing(caozhenxing@baidu.com)
      * @date    2012Äê07ÔÂ02ÈÕ 14Ê±08·Ö36Ãë
      */
     void ClearHaveSendMsgNum();
@@ -490,7 +454,6 @@ class AgentProxy {
      * @return  ³É¹¦£ºtrue;Ê§°Ü£ºfalse
      * @see
      * @note
-     * @author  caozhenxing(caozhenxing@baidu.com)
      * @date    2013Äê03ÔÂ26ÈÕ 21Ê±23·Ö25Ãë
      */
     bool StartApListen();
@@ -500,7 +463,6 @@ class AgentProxy {
      * @return  ³É¹¦£ºtrue;Ê§°Ü£ºfalse
      * @see
      * @note
-     * @author  caozhenxing(caozhenxing@baidu.com)
      * @date    2013Äê03ÔÂ26ÈÕ 21Ê±23·Ö25Ãë
      */
     void ClearTimeOutAgentInfo(std::string agentId);
@@ -651,6 +613,9 @@ class AgentProxy {
                             const std::map<std::string, std::string>& ctx, uint64_t time_rcv);
     bool ReLoadConfig();
     bool GetAgents(ApAgentInfoListT& agentInfoList);
+    AcdResultT GetCallInfo(int64_t handle, const std::string& agentId, 
+                            int32_t type, const std::string& input, std::string& result,
+                            const std::map<std::string, std::string>& ctx);
 
 
     /*Ë½ÓÐ³ÉÔ±½Ó¿ÚÉùÃ÷*/
@@ -661,7 +626,6 @@ class AgentProxy {
     * @return
     * @see
     * @note
-    * @author  caozhenxing(caozhenxing@baidu.com)
     * @date    2013Äê03ÔÂ25ÈÕ
     */
     bool readConf(const char* conf_filepath);
@@ -671,7 +635,6 @@ class AgentProxy {
      * @return  ³É¹¦£ºtrue;Ê§°Ü£ºfalse
      * @see
      * @note
-     * @author  caozhenxing(caozhenxing@baidu.com)
      * @date    2013Äê03ÔÂ26ÈÕ 21Ê±23·Ö25Ãë
      */
     bool getApCommonConf(const char* conf_filepath);
@@ -681,7 +644,6 @@ class AgentProxy {
      * @return  ³É¹¦£ºtrue;Ê§°Ü£ºfalse
      * @see
      * @note
-     * @author  caozhenxing(caozhenxing@baidu.com)
      * @date    2013Äê03ÔÂ26ÈÕ 21Ê±23·Ö25Ãë
      */
     bool getAcdConf(const char* conf_filepath);
@@ -691,7 +653,6 @@ class AgentProxy {
      * @return  ³É¹¦£ºtrue;Ê§°Ü£ºfalse
      * @see
      * @note
-     * @author  caozhenxing(caozhenxing@baidu.com)
      * @date    2013Äê03ÔÂ26ÈÕ 21Ê±23·Ö25Ãë
      */
     bool getBgccConf(const char* conf_filepath);
@@ -701,7 +662,6 @@ class AgentProxy {
      * @return
      * @see
      * @note
-     * @author  caozhenxing(caozhenxing@baidu.com)
      * @date    2012Äê06ÔÂ28ÈÕ 19Ê±55·Ö35Ãë
      */
     bool Init_log();
@@ -711,7 +671,6 @@ class AgentProxy {
      * @return
      * @see
      * @note
-     * @author  caozhenxing(caozhenxing@baidu.com)
      * @date    2013Äê03ÔÂ26ÈÕ 21Ê±23·Ö25Ãë
      */
     void SetApThreadShutdown();
@@ -722,7 +681,6 @@ class AgentProxy {
      * @return
      * @see
      * @note
-     * @author  caozhenxing(caozhenxing@baidu.com)
      * @date    2012Äê07ÔÂ09ÈÕ 15Ê±09·Ö10Ãë
      */
     APCONNACDSTATE GetCtiService();
@@ -735,7 +693,6 @@ class AgentProxy {
      * @return
      * @see
      * @note
-     * @author  caozhenxing(caozhenxing@baidu.com)
      * @date    2012Äê07ÔÂ09ÈÕ 15Ê±09·Ö24Ãë
      */
     void SetCtiService(APCONNACDSTATE State);
@@ -745,7 +702,6 @@ class AgentProxy {
      * @return  ³É¹¦£ºtrue;Ê§°Ü£ºfalse
      * @see
      * @note
-     * @author  caozhenxing(caozhenxing@baidu.com)
      * @date    2013Äê03ÔÂ26ÈÕ 21Ê±23·Ö25Ãë
      */
     bool SetApClient(ApClient* client);
@@ -755,7 +711,6 @@ class AgentProxy {
      * @return
      * @see
      * @note
-     * @author  caozhenxing(caozhenxing@baidu.com)
      * @date    2013Äê03ÔÂ26ÈÕ 21Ê±23·Ö25Ãë
      */
     void AddHeartBeatCount();
@@ -765,7 +720,6 @@ class AgentProxy {
      * @return  ³É¹¦£ºtrue;Ê§°Ü£ºfalse
      * @see
      * @note
-     * @author  caozhenxing(caozhenxing@baidu.com)
      * @date    2013Äê03ÔÂ26ÈÕ 21Ê±23·Ö25Ãë
      */
     void ClearHeartBeatCount();
@@ -775,7 +729,6 @@ class AgentProxy {
      * @return  Òì³£ÐÄÌø´ÎÊý
      * @see
      * @note
-     * @author  caozhenxing(caozhenxing@baidu.com)
      * @date    2013Äê03ÔÂ26ÈÕ 21Ê±23·Ö25Ãë
      */
     int32_t GetHeartBeatCount();
@@ -785,7 +738,6 @@ class AgentProxy {
      * @return  ³É¹¦£ºtrue;Ê§°Ü£ºfalse
      * @see
      * @note
-     * @author  caozhenxing(caozhenxing@baidu.com)
      * @date    2013Äê03ÔÂ26ÈÕ 21Ê±23·Ö25Ãë
      */
     bool GetValidAcd();
@@ -795,7 +747,6 @@ class AgentProxy {
      * @return  ³É¹¦£ºtrue;Ê§°Ü£ºfalse
      * @see
      * @note
-     * @author  caozhenxing(caozhenxing@baidu.com)
      * @date    2013Äê03ÔÂ26ÈÕ 21Ê±23·Ö25Ãë
      */
     bool TryConnAcd(std::string strIp, int32_t Port, APCONNACDSTATE state);
@@ -805,7 +756,6 @@ class AgentProxy {
      * @return
      * @see
      * @note
-     * @author  caozhenxing(caozhenxing@baidu.com)
      * @date    2013Äê03ÔÂ26ÈÕ 21Ê±23·Ö25Ãë
      */
     void ReSignIn(APCONNACDSTATE state);
@@ -815,7 +765,6 @@ class AgentProxy {
      * @return  Á¬½ÓID
      * @see
      * @note
-     * @author  caozhenxing(caozhenxing@baidu.com)
      * @date    2013Äê03ÔÂ26ÈÕ 21Ê±23·Ö25Ãë
      */
     std::string getProxyName(const std::map<std::string, std::string>& ctx);
@@ -825,7 +774,6 @@ class AgentProxy {
      * @return
      * @see
      * @note
-     * @author  caozhenxing(caozhenxing@baidu.com)
      * @date    2013Äê03ÔÂ26ÈÕ 21Ê±23·Ö25Ãë
      */
     std::string getProxyIP(const std::map<std::string, std::string>& ctx);
diff --git a/platform/agentproxy/include/core/ApCommon.h b/platform/agentproxy/include/core/ApCommon.h
index d0bda03..cdfde4a 100644
--- a/platform/agentproxy/include/core/ApCommon.h
+++ b/platform/agentproxy/include/core/ApCommon.h
@@ -64,7 +64,6 @@ using namespace acd;
  * @brief   APÓëACDµÄÁ¬½Ó×´Ì¬
  * @see
  * @note
- * @author  caozhenxing(caozhenxing@baidu.com)
  * @date    2012Äê06ÔÂ28ÈÕ 12Ê±59·Ö21Ãë
  */
 enum APCONNACDSTATE {
@@ -79,7 +78,6 @@ enum APCONNACDSTATE {
  * @brief   AP±£´æµÄagentbarÐÅÏ¢£¬ÓÃÓÚ»Øµ÷ÊÂ¼þÍÆËÍ
  * @see
  * @note
- * @author  caozhenxing(caozhenxing@baidu.com)
  * @date    2012Äê06ÔÂ28ÈÕ 13Ê±03·Ö12Ãë
  */
 struct AgentData {
@@ -104,7 +102,6 @@ struct AgentData {
  * @brief   ÊÂ¼þ¶ÓÁÐ½á¹¹Ìå£¬ÓÃÓÚ·¢ËÍ»Øµ÷ÊÂ¼þ
  * @see
  * @note
- * @author  caozhenxing(caozhenxing@baidu.com)
  * @date    2012Äê06ÔÂ28ÈÕ 14Ê±05·Ö06Ãë
  */
 struct ApEventQ {
diff --git a/platform/agentproxy/src/apclient/ApClient.cpp b/platform/agentproxy/src/apclient/ApClient.cpp
index e420f1f..9e98504 100644
--- a/platform/agentproxy/src/apclient/ApClient.cpp
+++ b/platform/agentproxy/src/apclient/ApClient.cpp
@@ -1798,6 +1798,26 @@ AcdResultT ApClient::ResetConfig(const std::string& password,
     return ret;
 }
 
+AcdResultT ApClient::GetCallInfo(int64_t handle, const std::string& agentId, 
+                            int32_t type, const std::string& input, std::string& result) {
+    AcdResultT ret;
+    if (_acdClientProxy) {
+        ret = _acdClientProxy->GetCallInfo(handle, agentId, type, input, result);
+
+        int32_t err = _acdClientProxy->get_errno();
+
+        if (err != 0) {
+            BGCC_WARN("ap", "GetCallInfo:Fail to GetCallInfo from ACD.errno = %d.", err);
+            ret = AcdResultT::ArConnAcdFail;
+        }
+    } else {
+        BGCC_WARN("ap", "ResetConfig:Proxy is NULL");
+        ret = AcdResultT::ArApFailed;
+    }
+
+    return ret;
+}
+
 AcdResultT ApClient::JumptheQueue(int64_t handle,
                                   const std::string& agentId,
                                   int64_t requestId,
diff --git a/platform/agentproxy/src/apserver/ApServer.cpp b/platform/agentproxy/src/apserver/ApServer.cpp
index 422346f..a02063d 100644
--- a/platform/agentproxy/src/apserver/ApServer.cpp
+++ b/platform/agentproxy/src/apserver/ApServer.cpp
@@ -814,5 +814,17 @@ AcdResultT ApServer::ResetConfig(const std::string& password,
     ret = agentProxy->ResetConfig(password, ctx, time_rcv);
     return ret;
 }
+
+AcdResultT ApServer::GetCallInfo(int64_t handle, const std::string& agentId, 
+                                int32_t type, const std::string& input, std::string& result, 
+                                const std::map<std::string, std::string>& ctx)
+{
+    AgentProxy* agentProxy = AgentProxy::Instance();
+    AcdResultT ret;
+
+    ret = agentProxy->GetCallInfo(handle, agentId, type, input, result, ctx);
+    return ret;
+}
+
 ApServer::~ApServer() {}
 
diff --git a/platform/agentproxy/src/core/AgentProxy.cpp b/platform/agentproxy/src/core/AgentProxy.cpp
index 3a1590d..16dad4b 100644
--- a/platform/agentproxy/src/core/AgentProxy.cpp
+++ b/platform/agentproxy/src/core/AgentProxy.cpp
@@ -4310,3 +4310,31 @@ bool AgentProxy::GetAgents(ApAgentInfoListT& agentInfoList) {
 
     return true;
 }
+
+AcdResultT AgentProxy::GetCallInfo(int64_t handle, const std::string& agentId, 
+        int32_t type, const std::string& input, std::string& result,
+        const std::map<std::string, std::string>& ctx) {
+    AcdResultT ret;
+
+    //»ñÈ¡¿Í»§¶ËIPµØÖ·
+    std::string peerIP = getProxyIP(ctx);
+    BGCC_NOTICE("ap", "Transfer GetCallInfo PeerIP[%s].", peerIP.c_str());
+
+    APCONNACDSTATE state;
+    state = GetCtiService();
+
+    if (AP_CONNACD_BACKING == state || AP_CONNACD_UNKNOW == state) {
+        BGCC_WARN("ap", "Transfer GetCallInfo:NowState = %d,return fail connect to ACD.", state);
+        return AcdResultT::ArConnAcdFail;
+    }
+
+    if (!_pApClient) {
+        BGCC_WARN("ap", "Client is NULL.");
+        return AcdResultT::ArApFailed;
+    }
+
+    ret = _pApClient->GetCallInfo(handle, agentId, type, input, result);
+
+    BGCC_NOTICE("ap", "Transfer GetCallInfo End:ret = %s", ret.get_desc().c_str());
+    return ret;
+}
diff --git a/platform/fw-mod/ivrloadbalance/mod_ivr_loadbalance.cpp b/platform/fw-mod/ivrloadbalance/mod_ivr_loadbalance.cpp
index 3d3cbd9..beaecb0 100644
--- a/platform/fw-mod/ivrloadbalance/mod_ivr_loadbalance.cpp
+++ b/platform/fw-mod/ivrloadbalance/mod_ivr_loadbalance.cpp
@@ -34,6 +34,7 @@
 #include <map>
 #include <vector>
 #include <sstream>
+#include <algorithm>
 
 #define MAX_EMAIL_LEN 1024
 #define MAX_PHONE_LEN 1024
@@ -370,7 +371,7 @@ bool load_file(const char* file_path) {
         }
 
         std::string strSection = strLine.substr(firstPos + 1, lastPos - firstPos - 1);
-        transform(strSection.begin(), strSection.end(), strSection.begin(), ::tolower);
+        std::transform(strSection.begin(), strSection.end(), strSection.begin(), ::tolower);
 
         section_map sectionMap;
         fileMap[strSection] = sectionMap;
@@ -405,7 +406,7 @@ bool load_file(const char* file_path) {
 
             int32_t pos = strLine.find_last_not_of(' ', pos0 - 1);
             std::string strKey = strLine.substr(firstPos, pos - firstPos + 1);
-            transform(strKey.begin(), strKey.end(), strKey.begin(), ::tolower);
+            std::transform(strKey.begin(), strKey.end(), strKey.begin(), ::tolower);
             pos = strLine.find_first_not_of(' ', pos0 + 1);
             std::string strVal("");
 
@@ -592,7 +593,7 @@ int32_t get_int(file_map filemap, const char* section_name, const char* key_name
     std:: string strTmp;
 
     strTmp = section_name;
-    transform(strTmp.begin(), strTmp.end(), strTmp.begin(), ::tolower);
+    std::transform(strTmp.begin(), strTmp.end(), strTmp.begin(), ::tolower);
 
     if (filemap.find(strTmp) == filemap.end()) {
         return ret;
@@ -600,7 +601,7 @@ int32_t get_int(file_map filemap, const char* section_name, const char* key_name
 
     section_map& pSectionMap = filemap[strTmp];
     strTmp = key_name;
-    transform(strTmp.begin(), strTmp.end(), strTmp.begin(), ::tolower);
+    std::transform(strTmp.begin(), strTmp.end(), strTmp.begin(), ::tolower);
 
     if (pSectionMap.find(strTmp) == pSectionMap.end()) {
         return ret;
@@ -626,7 +627,7 @@ int32_t get_string(file_map filemap, const char* section_name, const char* key_n
     std:: string strTmp;
 
     strTmp = section_name;
-    transform(strTmp.begin(), strTmp.end(), strTmp.begin(), ::tolower);
+    std::transform(strTmp.begin(), strTmp.end(), strTmp.begin(), ::tolower);
 
     if (filemap.find(strTmp) == filemap.end()) {
         strncpy(dest_buff, default_value, buff_size - 1);
@@ -635,7 +636,7 @@ int32_t get_string(file_map filemap, const char* section_name, const char* key_n
 
     section_map& pSectionMap = filemap[strTmp];
     strTmp = key_name;
-    transform(strTmp.begin(), strTmp.end(), strTmp.begin(), ::tolower);
+    std::transform(strTmp.begin(), strTmp.end(), strTmp.begin(), ::tolower);
 
     if (pSectionMap.find(strTmp) == pSectionMap.end()) {
         strncpy(dest_buff, default_value, buff_size - 1);
@@ -853,6 +854,7 @@ int32_t check_ivr_server(const char* ip_addr, uint32_t port, int32_t* cpu, int32
     int32_t getbytes = 0;
     int32_t ret = IVR_SUCCESS;
     int32_t tmpRet = 0;
+    char* tmpbuf = NULL;
 
     //host = gethostbyname(ip_addr);
     hostRes = gethostbyname_r(ip_addr, &host, strPtmpHost, MAX_LINE_LEN, &ptmpHost, &hostErr);
@@ -898,7 +900,7 @@ int32_t check_ivr_server(const char* ip_addr, uint32_t port, int32_t* cpu, int32
     //½ÓÊÕ"Connect"ÏûÏ¢
     bzero(&buffer, sizeof(buffer));
     getbytes = 9;
-    char* tmpbuf = buffer;
+    tmpbuf = buffer;
 
     do {
         nbytes = recv(sockfd, tmpbuf, getbytes, 0);
@@ -984,8 +986,7 @@ int32_t check_ivr_server(const char* ip_addr, uint32_t port, int32_t* cpu, int32
     }
 
     gettimeofday(&endTime , 0);
-    timeUsed = (endTime.tv_usec - startTime.tv_usec) / 1000 + (endTime.tv_sec - startTime.tv_sec) * 1000
-               ;
+    timeUsed = (endTime.tv_usec - startTime.tv_usec) / 1000 + (endTime.tv_sec - startTime.tv_sec) * 1000;
 
     if (timeUsed >= g_conf_info.connect_timeout) {
         //²é¿´Á´½ÓÊÇ·ñ³¬Ê±
@@ -1206,7 +1207,7 @@ bool alarm_by_sms(std::string& content, const ::std::string& smslist) {
 
     for (uint32_t i = 0; i < number_vec.size(); i++) {
         std::ostringstream ostm;
-        ostm << "/bin/gsmsend -s 10.23.199.131:15003 -s 10.23.248.104:15003 ";
+        ostm << "/bin/gsmsend -s 0.0.0.0:0 -s 0.0.0.0:0 ";//use to send SMS
         ostm << number_vec[i] << "@'" << content << "'";
 
         switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "[IVR_LB]SEND SMS:cmd=%s\n",
diff --git a/platform/ims/Makefile b/platform/ims/Makefile
index 5860053..100b921 100644
--- a/platform/ims/Makefile
+++ b/platform/ims/Makefile
@@ -27,10 +27,10 @@ VERSION="1.2.0.4"
 
 CXXFLAGS = -Wall -W -pipe -Wno-unused-parameter -Wreorder -Wwrite-strings -Wswitch -Wno-sign-compare\
 		   -g -D__XDEBUG__ -D__YDEBUG__ \
-		   -fPIC -finline-functions -Winline -Wreturn-type -Wtrigraphs -Wformat -Wparentheses -Wpointer-arith -Werror \
+		   -fPIC -finline-functions -Winline -Wreturn-type -Wtrigraphs -Wformat -Wparentheses -Wpointer-arith \
 		   -DVERSION=\"$(VERSION)\"  -DCVSTAG=\"$(VERSION)\" -DPROJECT_NAME=\"$(BINNAME)\"
 
-LDFLAGS = -lboost_system -lboost_filesystem -lims -lbgcc -lssl -lesl -lxml2 -lpcre -lpthread  -lrt -lm -lz -ldl -luuid
+LDFLAGS = -lboost_system -lboost_filesystem -lims -lbgcc -lssl -lesl -lcrypto -lxml2 -lpcre -lpthread  -lrt -lm -lz -ldl -luuid
 
 SOURCES = $(wildcard *.cpp) $(wildcard src/fs/*.cpp) $(wildcard src/utl/*.cpp) $(wildcard src/core/*.cpp) $(wildcard src/api/*.cpp)
 OBJS = $(patsubst %.cpp,%.o,$(SOURCES))
diff --git a/platform/ims/conf/ims.conf.xml b/platform/ims/conf/ims.conf.xml
index fc5e361..2ba6f1d 100644
--- a/platform/ims/conf/ims.conf.xml
+++ b/platform/ims/conf/ims.conf.xml
@@ -2,8 +2,8 @@
 <document type="ims/xml">
 	<section type="service" description="ims basic run config">
 		<service type="main"    ip="127.0.0.1" port="9527"/>
-		<service type="monitor" ip="192.168.111.9" port="9011"/>
-		<service type="config"  ip="192.168.111.9" port="9012"/>
+		<service type="monitor" ip="127.0.0.1" port="9011"/>
+		<service type="config"  ip="127.0.0.1" port="9012"/>
     </section>
 
     <section type="param" description="run core param">
@@ -13,13 +13,11 @@
 	
 	<section type="client" description="allow/deny connect to ims">
 		<client type="ivr">
-			<allow data="192.168.111.0/24" />
-			<allow data="192.168.119.0/24" />
 			<allow data="127.0.0.0/24" />
 		</client>
 		
 		<client type="config">
-			<allow data="192.168.111.0/24" />
+			<allow data="127.0.0.0/24" />
 		</client>
 
 		<client type="acd">
@@ -27,7 +25,7 @@
 		</client>
 
 		<client type="monitor">
-			<allow data="192.168.111.0/24" />
+			<allow data="127.0.0.0/24" />
 		</client>
 	</section>
 	
diff --git a/platform/ims/conf/imslog.conf b/platform/ims/conf/imslog.conf
deleted file mode 100644
index d1df8c4..0000000
--- a/platform/ims/conf/imslog.conf
+++ /dev/null
@@ -1,48 +0,0 @@
-COMLOG_PROCNAME : IMS
-COMLOG_LEVEL : 16
-COMLOG_SELFDEFINE : esl,imsevent,fsevent
-
-COMLOG_DEVICE_NUM : 4
-COMLOG_DEVICE0 : IMS
-COMLOG_DEVICE1 : ESL
-COMLOG_DEVICE2 : IMSEVENT
-COMLOG_DEVICE3 : FSEVENT
-
-IMS_TYPE : FILE
-IMS_NAME : ims.log
-IMS_PATH : log/
-IMS_SPLITE_TYPE : SIZECUT
-IMS_SIZE : 50
-IMS_LAYOUT : [%D.%U][%L][%T]%R
-IMS_OPEN : 1
-
-ESL_TYPE : AFILE
-ESL_NAME : esl.log
-ESL_PATH : log/
-ESL_SYSLEVEL : 0
-ESL_SELFLEVEL : esl
-ESL_SPLITE_TYPE : SIZECUT
-ESL_SIZE : 100
-ESL_LAYOUT : [%D.%U][%T]%R
-ESL_OPEN : 1
-
-IMSEVENT_TYPE : AFILE
-IMSEVENT_NAME : imsevent.log
-IMSEVENT_PATH : log/
-IMSEVENT_SYSLEVEL : 0
-IMSEVENT_SELFLEVEL : imsevent
-IMSEVENT_SPLITE_TYPE : SIZECUT
-IMSEVENT_SIZE : 50
-IMSEVENT_LAYOUT : [%D.%U][%T]%R
-ISMEVENT_OPEN : 1
-
-FSEVENT_TYPE : AFILE
-FSEVENT_NAME : fsevent.log
-FSEVENT_PATH : log/
-FSEVENT_SYSLEVEL : 0
-FSEVENT_SELFLEVEL : fsevent
-FSEVENT_SPLITE_TYPE : SIZECUT
-FSEVENT_SIZE : 50
-FSEVENT_LAYOUT : [%D.%U][%T]%R
-FSEVENT_OPEN : 1
-
diff --git a/platform/ims/ims_service.cpp b/platform/ims/ims_service.cpp
index d4ab6ed..06d82f3 100644
--- a/platform/ims/ims_service.cpp
+++ b/platform/ims/ims_service.cpp
@@ -100,16 +100,17 @@ int main(int argc, char** argv) {
         tmp = conf.param[ICPT_MAXSESSION];
         pmgr->maxsession((uint32_t)atoi(tmp));
     } else {
-        pmgr->maxsession(2000);
+        pmgr->maxsession(global_data_t::MAX_SESSION);
     }
 
     TRACE_LOG("starting freeswitch manager...");
     //fs_mgrÆô¶¯
     std::list<ims_conf_gw_node_t*>& gws = conf.gateway;
-    ims_conf_gw_node_t* gw_node;
+    ims_conf_gw_node_t* gw_node=NULL;
 
     for (std::list<ims_conf_gw_node_t*>::iterator it = gws.begin(); it != gws.end(); ++it) {
-        if (gw_node = *it) {
+        if (*it) {
+            gw_node = (*it);
             fs_info_t info(gw_node->id, gw_node->ip, gw_node->port, gw_node->max_conn,
                            gw_node->user, gw_node->pswd);
 
diff --git a/platform/ims/inc/api/imsapi_impl.h b/platform/ims/inc/api/imsapi_impl.h
index 2131bbc..28a5717 100644
--- a/platform/ims/inc/api/imsapi_impl.h
+++ b/platform/ims/inc/api/imsapi_impl.h
@@ -59,7 +59,6 @@ class imsapi_impl_t : public imsapi {
      * @param fsno
      *
      * @return CcResultT
-     * @author  dangdawei(dangdawei@baidu.com)
      * @date    2013Äê09ÔÂ18ÈÕ 16Ê±47·Ö12Ãë
      */
     CcResultT create_ivr_outbound_session(
@@ -214,6 +213,7 @@ class imsapi_impl_t : public imsapi {
         RouteRequestIDT requestId,
         const RouteEventReasonT& result,
         const std::string& targetUri,
+        const std::string& targetAgentId,
         const std::map<std::string, std::string>& ctx);
 
     virtual CcResultT CreateSession(
diff --git a/platform/ims/inc/core/ims_core.h b/platform/ims/inc/core/ims_core.h
index 33a5115..2d005e5 100644
--- a/platform/ims/inc/core/ims_core.h
+++ b/platform/ims/inc/core/ims_core.h
@@ -96,7 +96,7 @@ enum ims_state_signal_t {
 };
 
 typedef struct ims_global_data {
-    const static uint32_t MAX_SESSION = 2048;         ///<  µ¥Ì¨IMSÖ§³ÖµÄsession
+    const static uint32_t MAX_SESSION = 10240;        ///<  µ¥Ì¨IMSÖ§³ÖµÄsession
     const static uint32_t MAX_REQUEST = 1024;         ///<  ×î¶à¿Í»§¶Ë¶ÔÏó¸öÊý
     const static uint32_t DN_SIZE = 64;               ///<  ×ùÏ¯·Ö»ú×î´ó³¤¶È
     const static uint32_t MAX_OBJ_PER_SESSION = 16;   ///<  sessionÖÐ¸÷ÖÖ¶ÔÏóµÄ×î¶à¸öÊý
diff --git a/platform/ims/inc/core/ims_core_session_mgr.h b/platform/ims/inc/core/ims_core_session_mgr.h
index e494dfd..89ad9d6 100644
--- a/platform/ims/inc/core/ims_core_session_mgr.h
+++ b/platform/ims/inc/core/ims_core_session_mgr.h
@@ -59,9 +59,6 @@ class ims_session_manager_t {
 
     ims_session_manager_t() {
         runtime.isrunning = true;
-        //session_table.create(global_data_t::MAX_SESSION );
-        //channel_table.create(global_data_t::MAX_SESSION);
-        //channelname_table.create(global_data_t::MAX_SESSION);
         dn_pool.init(global_data_t::MAX_SESSION);
         session_pool.init(global_data_t::MAX_SESSION);
     }
@@ -93,7 +90,6 @@ class ims_session_manager_t {
      *    inside, and then call this->remove_session()
      *
      * @return  ture if the session successfully removed or not existed at all
-     * @author  dangdawei(dangdawei@baidu.com)
      * @date    2014-2-14
      */
     bool destroy_session(ims::SessionIdT id);
@@ -113,7 +109,6 @@ class ims_session_manager_t {
      *        1. empty session lasts for more than one hour
      *        2. any session lasts for more than 24 hours
      *
-     * @author  dangdawei(dangdawei@baidu.com)
      * @date    2013Äê09ÔÂ23ÈÕ 17Ê±14·Ö42Ãë
      */
     void clear_dead_session();
@@ -155,7 +150,7 @@ class ims_session_manager_t {
 
     //////////////////////channel ////////////////////////
     bool create_channel(ims::SessionIdT id,
-                        const char* id, const char* name,
+                        const char* cid, const char* name,
                         ims::CallStateT callstate = ims::CallStateT::SG_UnknownState,
                         ims::MediaStateT mediastate = ims::MediaStateT::MG_UnknownState);
     bool destroy_channel(const char* channelid);
@@ -381,6 +376,11 @@ class ims_session_manager_t {
         bgcc::Guard<bgcc::Mutex> lock(&runtime.mutex);
 
         if (lock.is_locked()) {
+            if (count > global_data_t::MAX_SESSION) {
+                WARNING_LOG("config max session > ims support max session(%u > %u)", 
+                    count, global_data_t::MAX_SESSION);
+                count = global_data_t::MAX_SESSION;
+            }
             runtime.max_session = count;
         }
     }
diff --git a/platform/ims/inc/core/ims_core_struct.h b/platform/ims/inc/core/ims_core_struct.h
index 839fe1e..9cdaaff 100644
--- a/platform/ims/inc/core/ims_core_struct.h
+++ b/platform/ims/inc/core/ims_core_struct.h
@@ -170,6 +170,7 @@ struct ims_session {
         // boost release memory of bject_pool
         delete pims_channel_pool;
         delete pims_call_pool;
+        delete pstring_pool;
     }
 };
 
@@ -219,8 +220,6 @@ typedef struct req_info {
     string_map accessno;
     bool is_master;
     req_info() {
-        //agent_dn.create(global_data_t::MAX_SESSION);
-        //accessno.create(global_data_t::MAX_SESSION);
         is_master = false;
     }
 
diff --git a/platform/ims/inc/utl/ims_obj_pool.h b/platform/ims/inc/utl/ims_obj_pool.h
index 3e06c84..c5f33a8 100644
--- a/platform/ims/inc/utl/ims_obj_pool.h
+++ b/platform/ims/inc/utl/ims_obj_pool.h
@@ -196,13 +196,6 @@ class ims_obj_pool {
     bool    _inited;              ///<  ÊÇ·ñÒÑ¾­Íê³É³õÊ¼»¯£¬·ÀÖ¹¶à´Î³õÊ¼»¯
 
     bgcc::Mutex _mutex;         ///<  ¶ÔÏó³Ø»¥³âËø
-
-    /**
-     * @brief »ñÈ¡¶ÔÏóÖ®ºó£¬»òÊÍ·Å¶ÔÏóÖ®Ç°Ö´ÐÐµÄ»Øµ÷º¯Êý
-     *
-     */
-    typedef void CALLBACK(T*);
-
 };
 
 #endif  //__IMS_OBJ_POOL_H_
diff --git a/platform/ims/inc/utl/ims_tool.h b/platform/ims/inc/utl/ims_tool.h
index 600d911..1d1f09e 100644
--- a/platform/ims/inc/utl/ims_tool.h
+++ b/platform/ims/inc/utl/ims_tool.h
@@ -265,7 +265,7 @@ class ims_tool_t {
     static uint32_t str_to_uint32(const char* src);
 
     static bool ip_mask_parse(const char* src , uint32_t& ip, uint32_t& mask, uint32_t& bit);
-    static std::string ims_tool_t::num2str(uint64_t num);
+    static std::string num2str(uint64_t num);
 
     static void prepare_call_event(ims::CallEventT& call_event,
                                    const uint64_t time,
diff --git a/platform/ims/src/api/imsapi_impl.cpp b/platform/ims/src/api/imsapi_impl.cpp
index a4283ab..c19303a 100644
--- a/platform/ims/src/api/imsapi_impl.cpp
+++ b/platform/ims/src/api/imsapi_impl.cpp
@@ -1070,6 +1070,7 @@ CcResultT imsapi_impl_t::RouteRequestRespond(ReqIdT reqid,
         RouteRequestIDT requestId,
         const RouteEventReasonT& result,
         const std::string& targetUri,
+        const std::string& targetAgentId,
         const std::map<std::string, std::string>& ctx) {
     NOTICE_LOG("RouteRequestRespond start, reqid=%ld,sid=%ld,requestId=%ld,result=%s,target=%s",
                reqid, sessionid, requestId, result.get_desc().c_str(), targetUri.c_str());
@@ -1100,6 +1101,7 @@ CcResultT imsapi_impl_t::RouteRequestRespond(ReqIdT reqid,
     ims_event.reason = result;
     ims_event.eventType = ims::RouteEventTypeT::RT_RouteRespond;
     ims_event.targetDevice = targetUri;
+	ims_event.targetAgentId = targetAgentId;
 
     /*        //ÏÈÉ¾³ý¼ÇÂ¼ÔÙÍÆËÍÊÂ¼þ£¬ÒòÎªÊÂ¼þÍÆËÍÊÇ²»¿ÉÄæµÄ¡£
             //µ«ÊÇÕâÑù¸üÈÝÒ×ÒòÎªÏß³ÌÖ®¼äµÄ¾ºÕùµ¼ÖÂ²»Ò»ÖÂµÄ½á¹û¡£
@@ -1157,8 +1159,10 @@ CcResultT imsapi_impl_t::RouteRequestRespond(ReqIdT reqid,
         }
     }
 
-    NOTICE_LOG("RouteRequestRespond OK. reqid=%ld,sid=%ld,requestId=%ld,result=%s,target=%s",
-               reqid, sessionid, requestId, result.get_desc().c_str(), targetUri.c_str());
+    NOTICE_LOG("RouteRequestRespond OK. reqid=%ld,sid=%ld,requestId=%ld,result=%s,target=%s,"
+               "agentID = %s",
+               reqid, sessionid, requestId, result.get_desc().c_str(), targetUri.c_str(), 
+			   targetAgentId.c_str());
     return CcResultT::ResSuccess;
 }
 
diff --git a/platform/ims/src/core/conf_event_handler.cpp b/platform/ims/src/core/conf_event_handler.cpp
index 5096dff..1775bf6 100644
--- a/platform/ims/src/core/conf_event_handler.cpp
+++ b/platform/ims/src/core/conf_event_handler.cpp
@@ -469,13 +469,20 @@ void event_handler_t::handle_singlestepconference_event(const fs_event_t& evt, b
         }
 
         ims::CallStateT state;
-
-        if ((session_mgr->get_channel_callstate(chls.front(), state) &&
+        bool has_customer = false;
+        for (std::list<const char*>::iterator it = chls.begin();
+            it != chls.end(); ++it) {
+            if (session_mgr->get_channelnamebyid(evt.sessionid, *it, tmp) &&
+                !session_mgr->rt_query_dn(tmp.c_str(), DnTypeT::AgentDn)) {
+                has_customer = true;
+            }
+        }
+        if (((session_mgr->get_channel_callstate(chls.front(), state) &&
                 (state == CallStateT::SG_HalfAlertingState || state == CallStateT::SG_IdleState
                  || state == CallStateT::SG_UnknownState))
                 || (session_mgr->get_channel_callstate(chls.back(), state) &&
                     (state == CallStateT::SG_HalfAlertingState || state == CallStateT::SG_IdleState
-                     || state == CallStateT::SG_UnknownState))) {
+                     || state == CallStateT::SG_UnknownState))) && !has_customer) {
             TRACE_LOG("one of the left two channels' state is alerting or idle, hangup the left two.");
             session_mgr->update_session_operation(evt.sessionid, SOPR_MAKECALL, other_agtname.c_str());
             opr.opr().hangup(chls.front());
diff --git a/platform/ims/src/core/ims_core_request.cpp b/platform/ims/src/core/ims_core_request.cpp
index 2495ae1..930f3d7 100644
--- a/platform/ims/src/core/ims_core_request.cpp
+++ b/platform/ims/src/core/ims_core_request.cpp
@@ -66,7 +66,7 @@ int32_t ims_request_t::operator()(const bool* isstoped, void* param) {
             if ((ims_tool_t::get_timestamp_s() - last_heartbeat) >= 3) {
                 last_heartbeat = ims_tool_t::get_timestamp_s();
                 heartbeat.timestamp = ims_tool_t::get_timestamp_ms();
-                ims::CcResultT result = proxy.SendOtherEvent(heartbeat);
+                proxy.SendOtherEvent(heartbeat);
 
                 if (proxy.get_errno() != 0) {
                     WARNING_LOG("event push to client(%s) failed,reqid=%lu", _conn_info.c_str(), _reqid);
diff --git a/platform/ims/src/core/ims_core_session_mgr.cpp b/platform/ims/src/core/ims_core_session_mgr.cpp
index c04954b..3a4e3cd 100644
--- a/platform/ims/src/core/ims_core_session_mgr.cpp
+++ b/platform/ims/src/core/ims_core_session_mgr.cpp
@@ -180,7 +180,9 @@ bool ims_session_manager_t::destroy_session(ims::SessionIdT id) {
 
         // session not locked, so the actuall channels in session may be changed by other thread,
         // Don't care it, because it's sematically impossible.
-        for (std::list<const char*>::iterator it = chls.begin(); it != chls.end(); ++it) {
+        std::list<const char*>::iterator it;
+        while (!chls.empty()) {
+            it=chls.begin(); 
             opr.opr().hangup(*it);
 
             callid_t callid = 0;
@@ -1165,12 +1167,14 @@ bool ims_session_manager_t::rt_del_req(ims::ReqIdT reqid) {
                 req->stop(); //thread is detached mode, don't need to join
             }
         }
-
-        for (string_map::iterator it = reqinfo->agent_dn.begin(); it != reqinfo->agent_dn.end(); ++it) {
+        string_map::iterator it;
+        while (!reqinfo->agent_dn.empty()) {
+            it = reqinfo->agent_dn.begin();
             rt_del_dn(it->first, ims::DnTypeT::AgentDn);
         }
 
-        for (string_map::iterator it = reqinfo->accessno.begin(); it != reqinfo->accessno.end(); ++it) {
+        while (!reqinfo->accessno.empty()) {
+            it = reqinfo->accessno.begin();
             rt_del_dn(it->first, ims::DnTypeT::IvrANI);
         }
 
@@ -1180,13 +1184,16 @@ bool ims_session_manager_t::rt_del_req(ims::ReqIdT reqid) {
     }
 
     //delete ims_route_info
-    for (std::map<ims::RouteRequestIDT, ims_route_info_t>::iterator it = runtime.route_mgr.begin();
-            it != runtime.route_mgr.end(); ++it) {
+    std::map<ims::RouteRequestIDT,ims_route_info_t>::iterator it;
+    it = runtime.route_mgr.begin();
+    while (!runtime.route_mgr.empty()) {
         if (reqid == it->second.reqid || reqid == it->second.dest_reqid) {
             rt_del_route(it->first);
+            it = runtime.route_mgr.begin();
+        } else {
+            ++it;
         }
     }
-
     TRACE_LOG("delete reqid[%ld] related ims_route_info.", reqid);
 
     {
diff --git a/platform/ims/src/fs/fs_mgr.cpp b/platform/ims/src/fs/fs_mgr.cpp
index b7f3232..95c905c 100644
--- a/platform/ims/src/fs/fs_mgr.cpp
+++ b/platform/ims/src/fs/fs_mgr.cpp
@@ -140,18 +140,14 @@ int32_t fs_mgr_t::update_runinfo(uint32_t fs_no, event_data_heartbeat_t& run) {
         return IMS_FAIL_LOCK;
     }
 
-    //DEBUG_LOG("fs_no(=%u)", fs_no);
-    //DEBUG_LOG("cur_session(=%u)", run.cur_session);
-    //DEBUG_LOG("all_session(=%u)", run.all_session);
-    //DEBUG_LOG("cpu_idle(=%u)", run.cpu_idle);
-
     run.used_times = 0;
 
     event_data_heartbeat_t* pinfo = NULL;
 
     if (_runinfo.count(fs_no) == 0 || NULL == _runinfo[fs_no]) {
-        //pinfo=_rp.createp<event_data_heartbeat_t>();
         pinfo = _evt_hb_pool.construct();
+    } else {
+        pinfo = _runinfo[fs_no];
     }
 
     if (NULL != pinfo) {
@@ -324,16 +320,11 @@ int32_t fs_mgr_t::decision_fs(uint32_t& fs_no) {
         event_data_heartbeat_t* curr = iter->second;
         bool change = false;
 
-        if (curr->cpu_idle > fs_data.cpu_idle + 20) {
+        if (curr->cur_session + curr->used_times * 2 < fs_data.cur_session + fs_data.used_times * 2) {
             change = true;
-        } else if (curr->cpu_idle >= (fs_data.cpu_idle > 20 ? fs_data.cpu_idle - 20 : 0)) {
-            if (curr->cur_session + curr->used_times * 2 < fs_data.cur_session + fs_data.used_times * 2) {
+        } else if (curr->cur_session + curr->used_times * 2 == fs_data.cur_session + fs_data.used_times * 2) {
+            if (key < fs_no) {
                 change = true;
-            } else if (curr->cur_session + curr->used_times * 2 == fs_data.cur_session + fs_data.used_times *
-                       2) {
-                if (key < fs_no) {
-                    change = true;
-                }
             }
         }
 
@@ -348,10 +339,6 @@ int32_t fs_mgr_t::decision_fs(uint32_t& fs_no) {
             final = curr;
         }
 
-        //if(curr->cpu_idle == 99 && curr->cur_session + curr->used_times*2 > 1000) {
-        //    ++heavyload_node_count;
-        //}
-
         ++iter;
     }
 
diff --git a/platform/ims/src/fs/fs_opr.cpp b/platform/ims/src/fs/fs_opr.cpp
index 1dac875..cf80567 100644
--- a/platform/ims/src/fs/fs_opr.cpp
+++ b/platform/ims/src/fs/fs_opr.cpp
@@ -255,6 +255,10 @@ int32_t fs_opr_t::get_event(fs_event_t& event, uint32_t timeout) {
                 get_head_val("Channel-Name", event.event_data.normal.channel_name, LEN_64);
                 std::string deviceno;
 
+                if (strncasecmp(event.event_data.normal.channel_name, "freetdm", 7) == 0) {
+                    get_head_val("variable_channel_name", event.event_data.normal.channel_name, LEN_64);
+                }
+
                 if (ims_tool_t::chlname2no(event.event_data.normal.channel_name, deviceno)) {
                     strncpy(event.event_data.normal.deviceno, deviceno.c_str(), LEN_64);
                 } else {
diff --git a/platform/ivr/Makefile b/platform/ivr/Makefile
index b2851bd..c46914c 100644
--- a/platform/ivr/Makefile
+++ b/platform/ivr/Makefile
@@ -31,11 +31,10 @@ OUTPUT_PATH = ./output
 
 VERSION=${shell echo $$SCMPF_MODULE_VERSION}
 
-LDFLAGS = -lesl -lpthread -luuid  -lmysqlclient -lmysqlclient_r -lmystrings -lmysys -lcrypto -lidn -lssl -lldap -lcurl -lrt -lz -ljson -lims -livr -lbgcc  -lboost_system 
-CXX_FLAGS = -DSCMPF_MODULE_VERSION=\"$(VERSION)\" -Wall -pipe -Wno-unused-parameter -Wno-reorder -Wwrite-strings -Wswitch -Wconversion -g \
+LDFLAGS = -livr -lims -lesl -lbgcc -lcurl -lpthread -luuid  -lmysqlclient -lmysqlclient_r -lmystrings -lmysys -lssl -lcrypto -lldap -llber -lrt -lz -ljson -lboost_system  -ldl
+CXX_FLAGS = -DSCMPF_MODULE_VERSION=\"$(VERSION)\" -Wall -pipe -Wno-unused-parameter -Wno-reorder -Wwrite-strings -Wswitch -g \
                    -fPIC -Winline -Wreturn-type -Wtrigraphs -Wformat -Wparentheses -Wpointer-arith \
-				   -fthreadsafe-statics \
-				   -Werror
+				   -fthreadsafe-statics
 
 OBJ_DIR = ./obj
 SRC_DIR = ./src
diff --git a/platform/ivr/conf/inbound.conf b/platform/ivr/conf/inbound.conf
index 86e9d8b..285929a 100644
--- a/platform/ivr/conf/inbound.conf
+++ b/platform/ivr/conf/inbound.conf
@@ -9,269 +9,230 @@ desc =
 #flowfile = flow/testPlayInterrupt.flow
 flowfile = flow/testPlayAnswer.flow
 voxbase = 
-recbase= /home/huxiaolong/callcloud/freeswitch/recordings
 
 [script2]
 dnis = 7001
 desc = flow2
 flowfile = flow/testTrans_9.flow
 voxbase =
-recbase= /home/huxiaolong/callcloud/freeswitch/recordings
 
 [script4]
 dnis = 7002
 desc = myflow2
 flowfile = flow/testTrans.flow
 voxbase= 
-recbase = /home/huxiaolong/callcloud/freeswitch/recordings
 
 [script401]
 dnis = 7039
 desc = myflow10
 flowfile = flow/testTrans_lihua.flow
 voxbase= 
-recbase = /home/huxiaolong/callcloud/freeswitch/recordings
 
 [script402]
 dnis = 7038
 desc = myflow11
 flowfile = flow/testTrans_play.flow
 voxbase= 
-recbase = /home/huxiaolong/callcloud/freeswitch/recordings
 
 [script400]
-dnis = 59704012
+dnis = 123456
 desc = testflowa
 flowfile = flow/testTrans.flow
 voxbase= 
-recbase = /home/huxiaolong/callcloud/freeswitch/recordings
 
 [script40]
 dnis = 7040
 desc = myflow20
 flowfile = flow/testTrans_11.flow
 voxbase= 
-recbase = /home/huxiaolong/callcloud/freeswitch/recordings
 
 [script41]
 dnis = 7041
 desc = memory
 flowfile = flow/testTrans_12.flow
 voxbase= 
-recbase = /home/huxiaolong/callcloud/freeswitch/recordings
 
 [script42]
 dnis = 7042
 desc = privateList
 flowfile = flow/testTrans_13.flow
 voxbase= 
-recbase = /home/huxiaolong/callcloud/freeswitch/recordings
 
 [script43]
 dnis = 7043
 desc = xunhuan
 flowfile = flow/testTrans_iter.flow
 voxbase= 
-recbase = /home/huxiaolong/callcloud/freeswitch/recordings
 
 [script3]
 dnis = 7003
 desc = myflow
 flowfile = flow/testCancel.flow
 voxbase= 
-recbase = /home/huxiaolong/callcloud/freeswitch/recordings
 
 [script5]
 dnis = 7004
 desc = myflow3
 flowfile = flow/testCancel_1.flow
 voxbase= 
-recbase = /home/huxiaolong/callcloud/freeswitch/recordings
 
 [script50]
 dnis = 7005
 desc = myflow4
 flowfile = flow/testCancel_2.flow
 voxbase= 
-recbase = /home/huxiaolong/callcloud/freeswitch/recordings
 
 [script51]
 dnis = 7006
 desc = myflow5
 flowfile = flow/testTrans_1.flow
 voxbase= 
-recbase = /home/huxiaolong/callcloud/freeswitch/recordings
 
 [script52]
 dnis = 7026
 desc = myflow5
 flowfile = flow/testTrans_10.flow
 voxbase= 
-recbase = /home/huxiaolong/callcloud/freeswitch/recordings
 
 [script6]
 dnis = 7007
 desc = myflow6
 flowfile = flow/testCancel_3.flow
 voxbase= 
-recbase = /home/huxiaolong/callcloud/freeswitch/recordings
 
 [script7]
 dnis = 7008
 desc = myflow7
 flowfile = flow/testCancel_4.flow
 voxbase= 
-recbase = /home/huxiaolong/callcloud/freeswitch/recordings
 
 [script8]
 dnis = 7009
 desc = myflow8
 flowfile = flow/testCancel_5.flow
 voxbase= 
-recbase = /home/huxiaolong/callcloud/freeswitch/recordings
 
 [script80]
 dnis = 7029
 desc = myflow28
 flowfile = flow/testCancel_50.flow
 voxbase= 
-recbase = /home/huxiaolong/callcloud/freeswitch/recordings
 
 [script9]
 dnis = 7010
 desc = myflow9
 flowfile = flow/testTrans_2.flow
 voxbase= 
-recbase = /home/huxiaolong/callcloud/freeswitch/recordings
 
 [script10]
 dnis = 7011
 desc = myflow10
 flowfile = flow/testTrans_3.flow
 voxbase= 
-recbase = /home/huxiaolong/callcloud/freeswitch/recordings
 
 [script11]
 dnis = 7012
 desc = myflow11
 flowfile = flow/testTrans_4.flow
 voxbase= 
-recbase = /home/huxiaolong/callcloud/freeswitch/recordings
 
 [script110]
 dnis = 7032
 desc = myflow110
 flowfile = flow/testTrans_40.flow
 voxbase= 
-recbase = /home/huxiaolong/callcloud/freeswitch/recordings
 
 [script111]
 dnis = 7033
 desc = myflow111
 flowfile = flow/testTrans_41.flow
 voxbase= 
-recbase = /home/huxiaolong/callcloud/freeswitch/recordings
 
 [script112]
 dnis = 7034
 desc = myflow112
 flowfile = flow/testTrans_42.flow
 voxbase= 
-recbase = /home/huxiaolong/callcloud/freeswitch/recordings
 
 [script113]
 dnis = 7035
 desc = myflow113
 flowfile = flow/testTrans_43.flow
 voxbase= 
-recbase = /home/huxiaolong/callcloud/freeswitch/recordings
 
 [script114]
 dnis = 7036
 desc = myflow114
 flowfile = flow/testTrans_44.flow
 voxbase= 
-recbase = /home/huxiaolong/callcloud/freeswitch/recordings
 
 [script12]
 dnis = 7013
 desc = myflow12
 flowfile = flow/testTrans_5.flow
 voxbase= 
-recbase = /home/huxiaolong/callcloud/freeswitch/recordings
 
 [script130]
 dnis = 7014
 desc = myflow13
 flowfile = flow/testTrans_6.flow
 voxbase= 
-recbase = /home/huxiaolong/callcloud/freeswitch/recordings
 
 [script13]
 dnis = 7015
 desc = myflow14
 flowfile = flow/testTrans_7.flow
 voxbase= 
-recbase = /home/huxiaolong/callcloud/freeswitch/recordings
 
 [script14]
 dnis = 7016
 desc = myflow15
 flowfile = flow/testTrans_8.flow
 voxbase= 
-recbase = /home/huxiaolong/callcloud/freeswitch/recordings
 
 [script15]
 dnis = 7017
 desc = myflow16
 flowfile = flow/testAssociateData.flow
 voxbase= 
-recbase = /home/huxiaolong/callcloud/freeswitch/recordings
 
 [script16]
 dnis = 7018
 desc = myflow17
 flowfile = flow/testOutDialTrans.flow
 voxbase= 
-recbase = /home/huxiaolong/callcloud/freeswitch/recordings
 
 [script17]
 dnis = 7019
 desc = myflow18
 flowfile = flow/testRefCount.flow
 voxbase= 
-recbase = /home/huxiaolong/callcloud/freeswitch/recordings
 
 [script18]
 dnis = 7019
 desc = myflow19
 flowfile = flow/testRefCount.flow
 voxbase= 
-recbase = /home/huxiaolong/callcloud/freeswitch/recordings
 
 [script19]
 dnis = 7020
 desc = myflow20
 flowfile = flow/testhttp.flow
 voxbase= 
-recbase = /home/huxiaolong/callcloud/freeswitch/recordings
 
 [script20]
 dnis = 7021
 desc = myflow21
 flowfile = flow/test_http_size.flow
 voxbase= 
-recbase = /home/huxiaolong/callcloud/freeswitch/recordings
 
 [script21]
 dnis = 7022
 desc = myflow22
 flowfile = flow/test_rand.flow
 voxbase= 
-recbase = /home/huxiaolong/callcloud/freeswitch/recordings
 
 [-]
 desc =
 flowfile = flow/test2_0/testDial.flow
 voxbase = 
-recbase = /home/huxiaolong/callcloud/freeswitch/recordings 
diff --git a/platform/ivr/doc/develop_manual.pdf b/platform/ivr/doc/develop_manual.pdf
index 8f0007b..192bfa9 100644
Binary files a/platform/ivr/doc/develop_manual.pdf and b/platform/ivr/doc/develop_manual.pdf differ
diff --git a/platform/ivr/flow/autorun1.flow b/platform/ivr/flow/autorun1.flow
index 8eaa776..4c26ee5 100644
--- a/platform/ivr/flow/autorun1.flow
+++ b/platform/ivr/flow/autorun1.flow
@@ -7,7 +7,7 @@ Descript=
 Type=Dial
 Callid=${_CALLID}
 NewCallid=strCALLID
-CalledNumber=1014@10.36.159.19
+CalledNumber=1014@127.0.0.1
 #CalledNumber=1011
 CallerNumber=110
 #calltype=1
diff --git a/platform/ivr/flow/autorun1.flow.bak b/platform/ivr/flow/autorun1.flow.bak
index e2186d8..9193ba7 100644
--- a/platform/ivr/flow/autorun1.flow.bak
+++ b/platform/ivr/flow/autorun1.flow.bak
@@ -25,12 +25,12 @@ Name = strDial2
 
 [Conn1]
 Name = CC1Êý¾Ý¿â
-ConnStr = 10.36.159.33:3306;root;123456
+ConnStr = 127.0.0.1:8080;root;123456
 ConnNum = 10
 
 [Conn2]
 Name = CC2Êý¾Ý¿â
-ConnStr = 10.36.159.33:3306;root;123456
+ConnStr = 127.0.0.1:8080;root;123456
 ConnNum = 5
 
 
diff --git a/platform/ivr/flow/bridgeex.flow b/platform/ivr/flow/bridgeex.flow
index fef57bc..56f8353 100644
--- a/platform/ivr/flow/bridgeex.flow
+++ b/platform/ivr/flow/bridgeex.flow
@@ -14,8 +14,8 @@ Type=Dial
 Callid=${_CALLID}
 NewCallid=strCALLID1
 calltype=1
-callednumber=59926119@10.0.9.17
-CallerNumber=01059704020
+callednumber=123456@127.0.0.1
+CallerNumber=123456
 _Success=14
 _Failure=0
 _UserHangup=0
@@ -41,8 +41,8 @@ Descript=
 Type=Bridgeex
 callid=${_CALLID}
 calltype=1
-callernumber=01059704020
-callednumber=${strInput}@10.0.9.17
+callernumber=123456
+callednumber=${strInput}@127.0.0.1
 _UserHangup=0
 _Success=5
 _Failure=100
diff --git a/platform/ivr/flow/cal.flow b/platform/ivr/flow/cal.flow
index 28d323f..9619f3a 100644
--- a/platform/ivr/flow/cal.flow
+++ b/platform/ivr/flow/cal.flow
@@ -28,15 +28,15 @@ name=num
 type=string
 
 [conn1]
-connstr=tc-cc-dev00.tc:6666;cc-ivr;123456
+connstr=127.0.0.1:6666;username;123456
 connnum=80
 
 
 [node1]
 type=db
 connectid=1
-sql=call callcloud.p_blacklist('58271288')
-#select number from callcloud.blacklist where ani='58271288'
+sql=call callcloud.p_blacklist('123456')
+#select number from callcloud.blacklist where ani='123456'
 rsvarname=res
 _success=2
 _failure=0
@@ -56,14 +56,14 @@ _failure=19
 
 [node19]
 type=http
-url=http://tc-crm-rd00.tc.baidu.com:8099/
+url=http://127.0.0.1:80/
 resp=name
 _success=20
 _failure=20
 
 [node20]
 type=assign
-exp=58270000
+exp=123456
 result=inikey
 _success=21
 _failure=21
diff --git a/platform/ivr/flow/cal.flow.bak b/platform/ivr/flow/cal.flow.bak
index 466b5c9..3362b27 100644
--- a/platform/ivr/flow/cal.flow.bak
+++ b/platform/ivr/flow/cal.flow.bak
@@ -18,7 +18,7 @@ type=string
 
 [node20]
 type=assign
-exp=58270000
+exp=123456
 result=inikey
 _success=21
 _failure=21
diff --git a/platform/ivr/flow/call_call.flow b/platform/ivr/flow/call_call.flow
index c0a02b1..182d976 100644
--- a/platform/ivr/flow/call_call.flow
+++ b/platform/ivr/flow/call_call.flow
@@ -14,8 +14,8 @@ Type=Dial
 Callid=${_CALLID}
 NewCallid=strCALLID1
 calltype=1
-callednumber=59926119@10.0.9.17
-CallerNumber=01059704020
+callednumber=123456@127.0.0.1
+CallerNumber=123456
 _Success=14
 _Failure=0
 _UserHangup=0
@@ -43,8 +43,8 @@ Type=Dial
 CallID=${_CALLID}
 NewCallid=strCALLID2
 calltype=1
-callernumber=01059704020
-CalledNumber=${strInput}@10.0.9.17
+callernumber=123456
+CalledNumber=${strInput}@127.0.0.1
 _UserHangup=100
 _Success=4
 _Failure=100
diff --git a/platform/ivr/flow/db.flow b/platform/ivr/flow/db.flow
index ca83360..5255e2e 100644
--- a/platform/ivr/flow/db.flow
+++ b/platform/ivr/flow/db.flow
@@ -8,7 +8,7 @@ Name = strTmp
 
 [Conn1]
 Name = CC1Êý¾Ý¿â
-ConnStr = 10.36.159.33:3306;root;123456
+ConnStr = 127.0.0.1:80;root;123456
 ConnNum = 20
 
 [Node1]
diff --git a/platform/ivr/flow/http.flow b/platform/ivr/flow/http.flow
index abb3400..5979009 100644
--- a/platform/ivr/flow/http.flow
+++ b/platform/ivr/flow/http.flow
@@ -4,7 +4,7 @@ name=name
 
 [node19]
 type=http
-url=http://tc-crm-rd00.tc.baidu.com:8099/
+url=http://127.0.0.1:8080/
 resp=name
 _success=0
 _failure=0
diff --git a/platform/ivr/flow/inbound1.flow b/platform/ivr/flow/inbound1.flow
index 210063c..53c1281 100644
--- a/platform/ivr/flow/inbound1.flow
+++ b/platform/ivr/flow/inbound1.flow
@@ -36,7 +36,7 @@ Descript=
 Type=Bridgeex
 callid=${_CALLID}
 calltype=0
-callernumber=01059704020
+callernumber=123456
 callednumber=1014
 _UserHangup=0
 _Success=5
diff --git a/platform/ivr/flow/inbound1.flow.bak b/platform/ivr/flow/inbound1.flow.bak
index 7889355..34a9a9f 100644
--- a/platform/ivr/flow/inbound1.flow.bak
+++ b/platform/ivr/flow/inbound1.flow.bak
@@ -33,12 +33,12 @@ Name = strHttpResp
 
 [Conn1]
 Name = CC1Êý¾Ý¿â
-ConnStr = 10.36.159.33:3306;root;123456
+ConnStr = 127.0.0.1:8080;root;123456
 ConnNum = 20
 
 [Conn2]
 Name = CC2Êý¾Ý¿â
-ConnStr = 10.36.159.33:3306;root;123456
+ConnStr = 127.0.0.1:8080;root;123456
 ConnNum = 10
 
 [Node1]
@@ -165,7 +165,7 @@ _Failure=102
 [Node602]
 Descript=HTTPµ÷ÓÃ
 Type=Http
-Url=http://10.36.159.33:8080/app/test.jsp?ani=${_ANI}
+Url=http://127.0.0.1:8080/app/test.jsp?ani=${_ANI}
 Resp=strHttpResp
 _Success=603
 _Failure=300
diff --git a/platform/ivr/flow/test2_0/test/test_testHangup2.cpp b/platform/ivr/flow/test2_0/test/test_testHangup2.cpp
index c815e7d..b2fd10a 100644
--- a/platform/ivr/flow/test2_0/test/test_testHangup2.cpp
+++ b/platform/ivr/flow/test2_0/test/test_testHangup2.cpp
@@ -18,7 +18,6 @@ int main(int argc, char **argv)
  
 /**
  * /home/zhangyue/callcloud/ivrserver/flow/test2_0//test/test_testHangup2.cpp ~ 2012/05/10 15:25:38
- * @author zhangyue(liyubei@baidu.com)
  * @version $Revision$ 
  * @description 
  *  
diff --git a/platform/ivr/flow/test2_0/testCall.flow b/platform/ivr/flow/test2_0/testCall.flow
index 736c8b2..7d68aab 100644
--- a/platform/ivr/flow/test2_0/testCall.flow
+++ b/platform/ivr/flow/test2_0/testCall.flow
@@ -14,8 +14,8 @@ Type=Dial
 Callid=${_CALLID}
 NewCallid=strCALLID1
 calltype=1
-callednumber=59926119@10.0.9.17
-CallerNumber=01059704020
+callednumber=123456@127.0.0.1
+CallerNumber=123456
 _Success=112
 _Failure=0
 _UserHangup=0
@@ -53,8 +53,8 @@ Type=Dial
 CallID=${_CALLID}
 NewCallid=strCALLID2
 calltype=1
-callernumber=01059704020
-CalledNumber=${strInput}@10.0.9.17
+callernumber=123456
+CalledNumber=${strInput}@127.0.0.1
 _UserHangup=100
 _Success=332
 _Failure=100
diff --git a/platform/ivr/flow/test2_0/testDial.flow b/platform/ivr/flow/test2_0/testDial.flow
index 30af6ff..50f5d03 100644
--- a/platform/ivr/flow/test2_0/testDial.flow
+++ b/platform/ivr/flow/test2_0/testDial.flow
@@ -37,7 +37,7 @@ CALLID = ${_CALLID}
 NEWCALLID = STRCALLID1
 CALLTYPE = 0
 CALLEDNUMBER = 1005
-CALLERNUMBER = 01059704020
+CALLERNUMBER = 123456
 _SUCCESS = 4
 _FAILURE = 0
 
diff --git a/platform/ivr/flow/test_http_size.flow b/platform/ivr/flow/test_http_size.flow
index 8f228f7..22b28db 100644
--- a/platform/ivr/flow/test_http_size.flow
+++ b/platform/ivr/flow/test_http_size.flow
@@ -21,7 +21,7 @@ type = HTTP
 descript = recv 20
 Outtype = POST
 timeout = 3
-Url = http://10.23.240.177:8900/ivrtest/sizetest?size=20
+Url = http://127.0.0.1:8080/ivrtest/sizetest?size=20
 Resp = result
 _Success = 3
 _Failure = 0
@@ -38,7 +38,7 @@ type = HTTP
 descript = recv 4095
 Outtype = POST
 timeout = 3
-Url = http://10.23.240.177:8900/ivrtest/sizetest?size=4095
+Url = http://127.0.0.1:8080/ivrtest/sizetest?size=4095
 Resp = result
 _Success = 5
 _Failure = 0
@@ -62,7 +62,7 @@ type = HTTP
 descript = recv 4095
 Outtype = POST
 timeout = 3
-Url = http://10.23.240.177:8900/ivrtest/sizetest?size=4095
+Url = http://127.0.0.1:8080/ivrtest/sizetest?size=4095
 Resp = result
 _Success = 8
 _Failure = 0
@@ -110,7 +110,7 @@ type = HTTP
 descript = recv 4096
 Outtype = POST
 timeout = 3
-Url = http://10.23.240.177:8900/ivrtest/sizetest?size=4096
+Url = http://127.0.0.1:8080/ivrtest/sizetest?size=4096
 Resp = result
 _Success = 0
 _Failure = 14
@@ -151,7 +151,7 @@ type = HTTP
 descript = recv 4097
 Outtype = POST
 timeout = 3
-Url = http://10.23.240.177:8900/ivrtest/sizetest?size=4097
+Url = http://127.0.0.1:8080/ivrtest/sizetest?size=4097
 Resp = result
 _Success = 0
 _Failure = 19
diff --git a/platform/ivr/include/common.h b/platform/ivr/include/common.h
index 5fe0c04..90c5fa6 100644
--- a/platform/ivr/include/common.h
+++ b/platform/ivr/include/common.h
@@ -34,8 +34,8 @@
 #include <algorithm>
 #include <exception>
 #include <stdexcept>
+#include <memory>
 
-//#include <com_log.h>
 #include <bgcc.h>
 
 #include "esl.h"
@@ -351,6 +351,8 @@ struct base_script_t {
     string channel_id;
     string callsource; // Freeswitch IP
 
+    string trunck;//data when transfer from other ivr
+
     IvrTimer* timer;                ///<IVR¼ÆÊ±Æ÷£¬session´´½¨ºóÈ·¶¨
 
     // ims infomation
@@ -439,7 +441,9 @@ typedef struct _sys_var_t {
         HANGUP_CAUSE = 4,
         CALL_BEGIN_TIME = 5, ///< ºô½Ðµ½´ïÆ½Ì¨µÄÊ±¼ä
         CALL_ANSWER_TIME = 6, ///< ºô½Ð±»½ÓÆðµÄÊ±¼ä
-        END = 7
+        TRUNCK = 7,
+        AGENTID= 8, //×ª×øÏ¯µÄ¹¤ºÅ
+        END = 9
     };
 } sys_var_t;
 
@@ -456,6 +460,12 @@ struct errorcode_string {
 extern int32_t g_stopped;
 extern sem_t g_stop_sem;
 
+//logger config
+extern uint32_t g_log_count;
+extern uint32_t g_log_filecount;
+extern uint32_t g_log_level;
+extern uint32_t g_log_timeout;
+
 extern string g_server_ip;
 extern uint32_t g_server_port;
 extern uint32_t g_reload_port;
@@ -486,4 +496,6 @@ extern time_t g_autorun_script_stamp;   // mark last autorun script loaded time
 //  if st < g_autorun_script_stamp, the thread need stop,
 //      because autorun script ust reloaded
 
+const char DATA_CACHE_FILE[] = "log/ivr_datacached.log";
+
 #endif
diff --git a/platform/ivr/include/fs/fs_opr.h b/platform/ivr/include/fs/fs_opr.h
index 3b315c5..7e8716f 100644
--- a/platform/ivr/include/fs/fs_opr.h
+++ b/platform/ivr/include/fs/fs_opr.h
@@ -116,7 +116,7 @@ class fs_opr_t {
     int32_t unbridge(const char* uuid);
     int32_t bridgeonly(const char* uuid1, const char* uuid2);
     int32_t bridgeex(const char* uuid, const char* caller, const char* called, bool external,
-                     bool usbgm, const char* bgmfile);
+                     bool usbgm, const char* bgmfile,  bool bghungup);
     int32_t dial(ivr_session_id_t sessionid, const char* called_number,
                  const char* caller_number, uint32_t timeout = 30, bool external = true);
 
@@ -133,8 +133,11 @@ class fs_opr_t {
     //////////////////////////////////////////Ã½Ìå´¦Àí//////////////////////////////////////
     int32_t stop_media(const char* uuid);
     int32_t play(const char* uuid, const char* file, uint32_t count = 1);
+    int32_t uuid_broadcast(const char * callid1, const char * callid2, const char * file);
+    int32_t broadcast_num(const char * callid1, const char * callid2, const char* data,
+                 const char* basepath, bool isStr);
     int32_t record(const char* uuid, const char* file, bool isstart);
-    int32_t fs_opr_t::playnum(const char* uuid, const char* data, const char* basepath, bool isStr);
+    int32_t playnum(const char* uuid, const char* data, const char* basepath, bool isStr);
     int32_t send_dtmf(const char* uuid, const char* keys);
     int32_t collect(const char* callid, const char* playfile, uint32_t min, uint32_t max,
                     uint32_t timeout, const char* end);
@@ -159,6 +162,7 @@ class fs_opr_t {
     const static char* CMD_UUIDSENDDTMF_FMT;
     const static char* CMD_RECORD_FMT;
     const static char* CMD_STOPRECORD_FMT;
+    const static char * _s_cmd_uuidbroadcast_fmt;
 
     const static char* EVENT_NORMAL;
     const static char* EVENT_HEARTBEAT;
diff --git a/platform/ivr/include/fs/fs_struct.h b/platform/ivr/include/fs/fs_struct.h
index bd39ae7..77ded8f 100644
--- a/platform/ivr/include/fs/fs_struct.h
+++ b/platform/ivr/include/fs/fs_struct.h
@@ -62,6 +62,8 @@ typedef struct event_data_normal {
     char ivr_data[LEN_128 + 1];
 
     char reason[LEN_128 + 1];
+
+    char trunck[LEN_512 + 1];
 } event_data_normal_t;
 
 typedef struct event_data_heartbeat {
diff --git a/platform/ivr/include/http.h b/platform/ivr/include/http.h
index 2a6ab49..1442434 100644
--- a/platform/ivr/include/http.h
+++ b/platform/ivr/include/http.h
@@ -27,7 +27,7 @@
 */
 class http_t {
 private:
-    const static uint32_t MAX_BUF = 4096;
+    const static uint32_t MAX_BUF = 40960;
     /**
     * @brief curlÓÃµ½µÄ½á¹¹Ìå
     *   detail description
diff --git a/platform/ivr/include/ivr_callinfo.h b/platform/ivr/include/ivr_callinfo.h
new file mode 100644
index 0000000..2b08bf1
--- /dev/null
+++ b/platform/ivr/include/ivr_callinfo.h
@@ -0,0 +1,96 @@
+/*
+ * Copyright 2002-2015 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      CC/LICENSE
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// ivr call info define
+
+#ifndef _IVR_CALLINFO_H
+#define _IVR_CALLINFO_H
+
+#include "common.h"
+#include "logger.h"
+
+namespace ivr {
+class ReleaseCauseT {
+public:
+    enum {
+        UNKNOWN,
+        THISPARTY,
+        OTHERPARTY
+    };
+
+private:
+    int _m_value;
+public:
+    ReleaseCauseT(int32_t value);
+    ~ReleaseCauseT();
+    void set_value(int32_t value);
+    int32_t get_value();
+    bool isValid();
+};
+
+class IvrCallInfo 
+{
+public:
+    IvrCallInfo();
+    ~IvrCallInfo();
+    void initial(ivr_session_id_t sessionId, const std::string& callid, const std::string& caller, const std::string& callee);
+    std::string get_callee();
+    void set_inbound_begin_time(time_t t);
+    time_t get_inbound_begin_time();
+    void set_flow_begin_time(time_t t);
+    void set_cust_ans_time(time_t t);
+    void set_agt_ans_time(time_t t);
+    void set_agt_alert_time(time_t t);
+    void set_connected_time(time_t t);
+    void set_trans_time(time_t t);
+    void set_hangup_time(time_t t);
+    void set_exit_flow_time(time_t t);
+    void set_release_cause(int32_t releaseCause);
+    void set_record_filename(const string &recordFilename);
+    void set_skill(time_t t, const std::string& skill);
+    void update_skill(time_t t, const std::string& skill);
+    void set_appdata(const std::string& appdata);
+    std::string get_skill();
+    void set_agent_num(const string &agentnum);
+    void reset();
+    void write_call_log();
+
+    static Logger _m_logger;
+private:
+    ivr_session_id_t _m_sessionid;
+    string _m_skill;
+    string _m_route_list;
+    string _m_caller;
+    string _m_callee;
+    time_t _m_inboundbegin_time;
+    time_t _m_flowbegin_time;
+    time_t _m_cust_ans_time;
+    time_t _m_agt_ans_time;
+    time_t _m_agt_alert_time;
+    time_t _m_connected_time;
+    time_t _m_trans_time;
+    time_t _m_exit_flow_time;
+    time_t _m_hangup_time;
+    string _m_agentnum;
+    ReleaseCauseT _m_releaseCause;
+    string _m_recordFilename;
+
+    string _m_appdata;
+    string _m_callid;
+    bool _is_update;
+};
+};
+#endif
diff --git a/platform/ivr/include/ivr_data_collection.h b/platform/ivr/include/ivr_data_collection.h
new file mode 100644
index 0000000..05079ae
--- /dev/null
+++ b/platform/ivr/include/ivr_data_collection.h
@@ -0,0 +1,211 @@
+/*
+ * Copyright 2002-2015 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      CC/LICENSE
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// ivr data collection define
+
+#ifndef _IVR_DATA_COLLECTION_H
+#define _IVR_DATA_COLLECTION_H
+
+#include "ivr_callinfo.h"
+#include "fs_struct.h"
+
+namespace ivr {
+// Ã¿¸ö¼¼ÄÜ×éµÄÐÅÏ¢
+struct SkillCallData{
+public:
+    SkillCallData() : giveuptimes(0){}
+public:
+    uint32_t giveuptimes;  // ¸Ã¼¼ÄÜ×éµÄÅÅ¶Ó·ÅÆúÁ¿
+};
+
+// µ±Ç°µÄºô½ÐÊý¾Ýºô½ÐÊý¾Ý
+struct IvrCallData{
+public:
+    IvrCallData()
+    : cur_inbound_num(0)
+    , cur_accept_num(0)
+    , trans_num(0)
+    , total_inbound_num(0)
+    , total_accept_num(0)
+    , giveuptimes(0){}
+public:
+    uint32_t cur_inbound_num;  // µ±Ç°ºôÈë×ÜÁ¿
+    uint32_t cur_accept_num;  // µ±Ç°»îÔ¾µÄºôÈëÁ¿
+    uint32_t trans_num;  //×ª×øÏ¯Á¿
+    uint32_t total_inbound_num;  // ×ÜºôÈë×ÜÁ¿
+    uint32_t total_accept_num;  // ×Ü»îÔ¾µÄºôÈëÁ¿
+    uint32_t giveuptimes; // ÅÅ¶Ó·ÅÆúÁ¿
+    std::map<std::string, SkillCallData*> skill_call_data; //¼¼ÄÜºô½ÐÊý¾Ý
+};
+
+class IvrInboundCall {
+public:
+    enum {
+        BEGIN,
+        ACCEPT,
+        INFLOW,
+        CUSTOMERANSWER,
+        AGENTALERTING,
+        AGENTANSWER,
+        CONNECTED,
+        ROUTEBYSKILL,
+        ROUTEBYAGENTID,
+        ROUTEBYAGENTLIST,
+        TRANSAGENT,
+        EXITFLOW,
+        CALLWITHOUTFOLW,
+        THISPARTYHANGUP,
+        OTHERPARTYHANGUP,
+        UNKNOW
+    }; // state
+
+    IvrInboundCall() : _m_state(UNKNOW), _has_hangup(false), _exit_flow(false){}
+    ~IvrInboundCall(){}
+    int32_t update_route_skill_endtime(const std::string& skill_name);
+    int32_t set_appdata(const std::string& appdata);
+    int32_t set_state(int32_t state);//ÉèÖÃµ±Ç°×´Ì¬
+    int32_t get_state();//ÉèÖÃµ±Ç°×´Ì¬
+    void init_new_call(const ivr_session_id_t& sessionId, const string &callid, const string &caller, const string &callee); 
+    void set_skill(const std::string& skill);
+    std::string get_skill();
+    std::string get_called();
+    bool get_exit_flow();
+    void set_agent_num(const string &agentnum);
+    time_t get_begintime();
+private:
+    int32_t _m_state;
+    bool _has_hangup;
+    bool _exit_flow;
+    IvrCallInfo _m_ivr_callinfo;
+} ;
+
+class IvrCallDataCollection
+{
+public:
+    enum {
+        GETBYPLAT,
+        GETBYIVRNUM,
+    };
+
+    IvrCallDataCollection(){}
+private:
+    ~IvrCallDataCollection(){}
+public:
+    static IvrCallDataCollection& instance();
+
+    // @breif ³õÊ¼»¯º¯Êý
+    int32_t initialize(const char* path);
+    
+    // @breif ·´ ³õÊ¼»¯º¯Êý
+    int32_t uninitialize();
+    
+    // ½«Êý¾ÝÐ´ÈëÎÄ¼þÇÒÅÐ¶ÏÈÕÆÚº¯Êý
+    void calldata_to_file_block_func();
+    
+    // @brief ºôÈëÁ¿(½øÈëÁ÷³Ì) +1
+    // @param caller ºôÈëºÅÂë
+    // @param called ivr×ª½ÓÂë
+    // @parma sessionid ,±ê¼ÇÃ¿Í¨ºô½ÐÌ
+    // @return 0:success other:failed
+    int32_t new_accept_call(const std::string& caller, const std::string& called
+                    , const ivr_session_id_t& sessionId, const std::string& uuid);
+
+    // @brief ºôÈëÁ¿(ËùÓÐµÄÁ¿) +1
+    // @param caller ºôÈëºÅÂë
+    // @param called ivr×ª½ÓÂë
+    // @parma uuit uuid,±ê¼ÇÃ¿Í¨ºô½ÐÌ
+    // @return 0:success other:failed
+    int32_t new_inbound_call(const std::string& caller, const std::string& called
+                    , const std::string& uuid);
+    
+    // @brief ÉèÖÃ×´Ì¬
+    // @parma callid callid,±ê¼ÇÃ¿Í¨ºô½Ð
+    // @parma state ×´Ì¬ 
+    // @parma skill ¼¼ÄÜ£¬Ä¬ÈÏÎª¿Õ
+    // @return 0:success other:failed   
+    int32_t set_appdata(const ivr_session_id_t& sessionId, const std::string& appdata);
+    int32_t set_state(const ivr_session_id_t& sessionId, const int32_t state, const std::string& skill);
+    
+    // @brief ´¦ÀíÊÂ¼þ
+    // @parma event,ÊÂ¼þ
+    // @return 0:success other:failed
+    int32_t process_event(struct fs_event& event);
+
+    // @brief ´¦ÀíÂ·ÓÉÊÂ¼þºÍ³¬Ê±ÊÂ¼þ
+    // @parma event,ÊÂ¼þ
+    // @return 0:success other:failed
+    int32_t process_event(ivr_base_event_t* event);
+    
+    // @breif »ñÈ¡ÏµÍ³µ±Ç°ºô½ÐÊý¾Ý
+    // @param calldata calldataµØÖ·
+    // @param result ·µ»ØµÄ¼¼ÄÜ×éÊý¾Ý
+    // @return 0:success other:failed  
+    int32_t get_call_data(struct IvrCallData* p, std::string& result);
+    
+    // @breif »ñÈ¡ÏµÍ³µ±Ç°ºô½ÐÊý¾Ý
+    // @param result ·µ»ØµÄ¼¼ÄÜ×éÊý¾Ý
+    // @return 0:success other:failed  
+    int32_t get_inbound_by_plat(std::string& result);
+
+    // @breif »ñÈ¡ÏµÍ³µ±Ç°ºô½ÐÊý¾Ý
+    // @param result ·µ»ØµÄ¼¼ÄÜ×éÊý¾Ý
+    // @return 0:success other:failed  
+    int32_t get_inbound_call_data(const int32_t type, const std::string& input, std::string& result);
+    
+    // @breif »ñÈ¡ÏµÍ³µ±Ç°ºô½ÐÊý¾Ý
+    // @param ivrnum ivr½ÓÈëÂë
+    // @param result ¸ù¾Ýivr½ÓÈëÂë·µ»ØÊý¾Ý
+    // @return 0:success other:failed  
+    int32_t get_inbound_by_ivrnum(const std::string& ivrnum, std::string& result);
+
+    // @brief ´ÓÎÄ¼þÖÐ»ñÈ¡»º´æÊý¾Ý
+    int32_t get_data_from_file();
+
+    // @brief ½«»º´æÊý¾ÝÐ´ÈëÎÄ¼þÖÐ
+    int32_t put_data_to_file();
+
+    // @ÅÐ¶ÏÊÇ·ñÅÅ¶Ó·ÅÆú£¬Èç¹ûÊÇ¸üÐÂÏà¹ØÊý¾Ý
+    int32_t is_giveup_call(IvrInboundCall *call
+                    , const uint64_t sessionid, const std::string& called);
+
+    // @brief ¸´Î»
+    void clear_invaid_call();
+    
+    // @brief ¸´Î»
+    void reset();
+
+private:
+    bgcc::Mutex _m_locker;
+    std::string _cached_file; // »º´æÎÄ¼þÂ·¾¶
+    std::string _cached_date; // »º´æÈÕÆÚ
+    struct IvrCallData _plat_call_data;//µ±Ç°µÄºô½ÐÊý¾Ý
+    std::map<std::string, struct IvrCallData*> _ivrnum_call_data; // °´ivr½ÓÈëÂë´æ´¢µÄµ±Ììºô½ÐÊý¾Ý
+    std::map<ivr_session_id_t, IvrInboundCall*> _realtime_call;
+    std::map<ivr_session_id_t, IvrInboundCall*> _exitflow_call;
+    std::map<std::string, ivr_session_id_t> _first_uuid_map;
+    std::map<std::string, ivr_session_id_t> _second_uuid_map;
+    std::set<std::string> _refuse_call;
+};
+
+typedef std::map<std::string, struct SkillCallData*>::iterator IterSkill;
+typedef std::map<std::string, struct IvrCallData*>::iterator IterIvrNum;
+typedef std::map<ivr_session_id_t, IvrInboundCall*>::iterator IterCall;
+typedef std::map<std::string, ivr_session_id_t>::iterator IterSession;
+typedef std::set<std::string>::iterator IterStr;
+}
+
+#endif
+
diff --git a/platform/ivr/include/ivrapi.h b/platform/ivr/include/ivrapi.h
index a105eb4..52e9bb6 100644
--- a/platform/ivr/include/ivrapi.h
+++ b/platform/ivr/include/ivrapi.h
@@ -29,6 +29,8 @@ class IvrApi_Imp : public ivr::ivrapi {
     ivr::IvrResultT StartFlow(const std::string& flowname, const std::string& flowvars,
                               const str2str_map& ctx);
     ivr::IvrResultT Heartbeat(std::string& ivrinfo, const str2str_map& ctx);
+    ivr::IvrResultT GetCallInfo(int32_t type, const std::string& input, std::string& result,
+                                        const str2str_map& ctx);
 };
 
 // reload config server, create a bgcc server to wait reload command
diff --git a/platform/ivr/include/lock.h b/platform/ivr/include/lock.h
index 37d7e2b..2325cde 100644
--- a/platform/ivr/include/lock.h
+++ b/platform/ivr/include/lock.h
@@ -127,14 +127,14 @@ class rw_lock_t {
 
 class sem_lock_t {
 public:
-    sem_lock_t(sem_t& sem): _sem(sem) {
+    sem_lock_t(sem_t* sem): _sem(sem) {
     }
 
     bool wait()const {
         int32_t ret = 0;
 
         do {
-            ret = sem_wait(&_sem);
+            ret = sem_wait(_sem);
         } while (-1 == ret && EINTR == errno);
 
         return 0 == ret;
@@ -143,13 +143,13 @@ class sem_lock_t {
         int32_t ret = 0;
 
         do {
-            ret = sem_post(&_sem);
+            ret = sem_post(_sem);
         } while (-1 == ret && EINTR == errno);
 
         return 0 == ret;
     }
 private:
-    mutable sem_t& _sem;
+    mutable sem_t* _sem;
 };
 
 #endif
diff --git a/platform/ivr/include/logger.h b/platform/ivr/include/logger.h
new file mode 100644
index 0000000..5b7dbd8
--- /dev/null
+++ b/platform/ivr/include/logger.h
@@ -0,0 +1,134 @@
+/*
+ * Copyright 2002-2014 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      CC/LICENSE
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#pragma once
+
+#include <string>           //±ê×¼C++¿â£¬stringÀà
+#include <fstream>          //±ê×¼C++¿â£¬IOÁ÷Àà
+#include <vector>           //±ê×¼C++¿â£¬vector
+#include <list>             //±ê×¼C++¿â£¬list
+#include <cstdio>           //±ê×¼C++¿â£¬remove
+#include <cstring>          //±ê×¼C++¿â£¬strcmp
+#include <cassert>
+
+#include <sys/stat.h>       // mkdir, access
+#include <dirent.h>         // DIR, dirent, opendir, readdir, closedir
+#include <time.h>
+#include <sys/timeb.h>
+#include <pthread.h>
+#include <semaphore.h>
+#include <sys/syscall.h>
+#include <stdint.h>
+#include <stdarg.h>
+#include <getopt.h>         // getopt_long
+
+#include "bgcc.h"
+
+#define SHOW_LONG "ll"
+#define PATH_FLAG '/'
+
+const char CONFIG_DIR[] = "conf/";
+const char LOG_DIR[] = "log/";
+const char EVNET_LOG_DIR[] = "log/eventlog/";
+const char CALL_LOG_DIR[] = "log/calllog/";
+const char BGCC_LOG_CONFIG_FILE[] = "conf/bgcc.cfg";
+
+const char CONFIG_FILE[] = "acd.conf";
+const char LOG_FILE[] = "acdlog";
+const char EVNET_LOG_FILE[] = "acdeventlog";
+const char CALL_LOG_FILE[] = "acdcalllog";
+//const char DATA_CACHE_FILE[] = "log/acd_datacached.log";
+
+typedef bgcc::Guard<bgcc::Mutex> SingleLocker;
+
+// ÈÕÖ¾µÈÖÐ¹ã·ºÊ¹ÓÃ
+//const uint32_t STRING_LENGHT = 64;
+const uint32_t LONG_STRING_LENGHT = 128;
+const uint32_t TEXT_LENGHT = 1024;
+const uint32_t LONG_TEXT_LENGHT = 2048;
+
+//typedef char String[STRING_LENGHT];
+typedef char LongString[LONG_STRING_LENGHT];
+typedef char Text[TEXT_LENGHT];
+typedef char LongText[LONG_TEXT_LENGHT];
+
+// ÈÕÖ¾¼¶±ð
+enum Level {
+    LOG_LEVEL_CRITICAL,
+    LOG_LEVEL_WARNING,
+    LOG_LEVEL_NOTICE,
+    LOG_LEVEL_DEBUG
+};
+
+enum EventTypeT {
+    AGENT_EVENT,
+    MEDIA_EVENT,
+    ROUTE_EVENT,
+    OTHER_EVENT
+};
+
+/*
+struct SendEventT {
+    int64_t m_event_id;
+    acd_callback_proxy_ptr m_callback_proxy;
+    EventTypeT m_event_type;
+    acd::AgentEventT m_agent_event;
+    acd::MediaEventT m_media_event;
+    acd::RouteEventT m_route_event;
+    acd::OtherEventT m_other_event;
+};
+*/
+
+using namespace std;
+
+class Logger {
+private:
+    uint32_t mLogCount;                 //ÈÕÖ¾ÎÄ¼þ´óÐ¡
+    uint32_t mFileCount;                    //ÈÕÖ¾ÎÄ¼þÊýÁ¿
+    string mDirName;                            //ÈÕÖ¾ÎÄ¼þÂ·¾¶
+    string mFileName;                           //ÈÕÖ¾ÎÄ¼þÃû
+    string mVersion;                            //³ÌÐò°æ±¾
+    bool mShowVersion;                          //ÊÇ·ñÏÔÊ¾°æ±¾
+    Level mLevel;                               //ÈÕÖ¾¼¶±ð
+
+    uint32_t mCurLogCount;                  //µ±Ç°ÈÕÖ¾ÌõÊý
+    string mFuleFileName;                       //ÈÕÖ¾ÎÄ¼þÈ«Ãû
+    ofstream mOutStream;                        //IOÁ÷
+    bgcc::Mutex mLocker;                        //Í¬²½Ëø
+private:
+    bool CreatDirectory(const string& strPath);
+    void GetTimeFileName(LongString strTime);
+    void GetCurrentTimeString(LongString strTime);
+    void InitLogger();
+    void DeleteLog();
+    void UnInitLogger();
+    void ProcessLog();
+    bool LogFileNotExisted();
+    void GetLevelString(Level level, string& levelString);
+public:
+    Logger();
+    ~Logger();
+    void Initialize(uint32_t logCount, uint32_t fileCount, const char* dirName, const char* fileName,
+                    const char* version, bool showVersion = true, Level level = LOG_LEVEL_NOTICE);
+    void UnInitialize();
+    void WriteLog(const char* pFormat, ...);
+    void WriteLog(Level level, const char* pFormat, ...);
+    void WriteLog(Level level, const char* file, uint32_t line, const char* fun, const char* pFormat,
+                  ...);
+    void SetTimeout();
+    void SetLogLevel(Level level = LOG_LEVEL_NOTICE);
+};
diff --git a/platform/ivr/include/node_base.h b/platform/ivr/include/node_base.h
index f1c5504..3a0a6aa 100644
--- a/platform/ivr/include/node_base.h
+++ b/platform/ivr/include/node_base.h
@@ -62,7 +62,7 @@ class NodeBase {
      * @author chenyuzhen
      * @date 2011/09/06 15:55:47
      **/
-    bool NodeBase::valid_str(key_map_t& vars, const char* key, uint32_t& out);
+    bool valid_str(key_map_t& vars, const char* key, uint32_t& out);
 
     static bool get_sys_var(const map<string, variable_t>& vars, uint32_t type,
                             std::string& out) {
diff --git a/platform/ivr/include/node_base64decode.h b/platform/ivr/include/node_base64decode.h
new file mode 100644
index 0000000..43d6963
--- /dev/null
+++ b/platform/ivr/include/node_base64decode.h
@@ -0,0 +1,44 @@
+/*
+ * Copyright 2002-2015 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      CC/LICENSE
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _NODE_BASE64DECODE_H
+#define _NODE_BASE64DECODE_H
+
+#include "node_base.h"
+
+class NodeBase64Decode : public NodeBase {
+public:
+    NodeBase64Decode(const uint32_t id, const string& name,
+               const string& type, const string& desc, const key_map_t& keymap);
+    virtual ~NodeBase64Decode(void);
+
+    virtual NodeBase* run(base_script_t* param);
+
+    virtual bool load_other();
+
+    virtual std::string enter(const map<string, variable_t>& vars)const ;
+
+    virtual std::string leave(const map<string, variable_t>& vars)const ;
+private:
+    string _input;          ///ÊäÈëµÄÎ´±àÂë×Ö·û´®
+    string _result;       ///´æ·Å±àÂëºóµÄ×Ö·û´®
+    const static char* _s_param_input;
+    const static char* _s_param_result;
+
+};
+
+#endif
+
diff --git a/platform/ivr/include/node_base64encode.h b/platform/ivr/include/node_base64encode.h
new file mode 100644
index 0000000..c552b60
--- /dev/null
+++ b/platform/ivr/include/node_base64encode.h
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2002-2015 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      CC/LICENSE
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _NODE_BASE64ENCODE_H
+#define _NODE_BASE64ENCODE_H
+
+#include "node_base.h"
+
+class NodeBase64Encode : public NodeBase {
+public:
+    NodeBase64Encode(const uint32_t id, const string& name,
+               const string& type, const string& desc, const key_map_t& keymap);
+    virtual ~NodeBase64Encode(void);
+
+    virtual NodeBase* run(base_script_t* param);
+
+    virtual bool load_other();
+
+    virtual std::string enter(const map<string, variable_t>& vars)const ;
+
+    virtual std::string leave(const map<string, variable_t>& vars)const ;
+private:
+    string _input;          ///ÊäÈëµÄÎ´±àÂë×Ö·û´®
+    string _result;       ///´æ·Å±àÂëºóµÄ×Ö·û´®
+    const static char* _s_param_input;
+    const static char* _s_param_result;
+
+};
+
+#endif
diff --git a/platform/ivr/include/node_bridgeex.h b/platform/ivr/include/node_bridgeex.h
index 57784e9..026069c 100644
--- a/platform/ivr/include/node_bridgeex.h
+++ b/platform/ivr/include/node_bridgeex.h
@@ -73,9 +73,11 @@ class node_bridgeex_t: public NodeResource {
     const static char* PARAM_BGMFILE;         ///<±³¾°ÒôÎÄ¼þ
     std::string _caller, _called, _calltype;  ///<Ö÷±»½Ð
     std::string _bgtype, _bgmfile;
+    std::string _bghungup;
 
     const static char* PARAMITEM_BGM;
     const static char* PARAMITEM_RING;
+    const static char* _s_param_bghungup;
     /**
      * @brief
      *
diff --git a/platform/ivr/include/node_broadcast.h b/platform/ivr/include/node_broadcast.h
new file mode 100755
index 0000000..5094d06
--- /dev/null
+++ b/platform/ivr/include/node_broadcast.h
@@ -0,0 +1,62 @@
+/*
+ * Copyright 2002-2014 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      CC/LICENSE
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _NODE_BROADCAST_H
+#define _NODE_BROADCAST_H
+
+
+#include "node_resource.h"
+
+namespace ivr {
+
+class NodeBroadcast : public NodeResource {
+public:
+    NodeBroadcast(const uint32_t id, const string& name,
+                  const string& type, const string& desc, const key_map_t& keymap);
+    virtual ~NodeBroadcast(void);
+
+    virtual NodeBase* run(base_script_t* param);
+
+    virtual bool load_other();
+private:
+
+    string _callid1;
+    string _callid2;
+    string _play_file;
+    uint32_t _delay;          ///< ¿ªÊ¼·ÅÒôµÄÑÓÊ±
+
+    //const static char * PARAM_CALLID;
+    const static char* _s_param_delay;       ///<
+    const static char* _s_param_file;        ///<
+    const static char* _s_param_callid1;        ///<
+    const static char* _s_param_callid2;        ///<
+
+    /**
+     * @brief
+     *
+     * @param [in/out] map<string   : const
+     * @param [in/out] vars   : variable_t>&
+     * @return  std::string
+     * @retval
+     * @see
+     * @note
+     * @date 2014/06/18 10:08:22
+    **/
+    std::string enter(const map<string, variable_t>& vars) const;
+};
+
+}
+#endif
diff --git a/platform/ivr/include/node_broadcast_num.h b/platform/ivr/include/node_broadcast_num.h
new file mode 100755
index 0000000..24c2a9d
--- /dev/null
+++ b/platform/ivr/include/node_broadcast_num.h
@@ -0,0 +1,65 @@
+/*
+ * Copyright 2002-2014 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      CC/LICENSE
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _NODE_BROADCAST_NUM_H
+#define _NODE_BROADCAST_NUM_H
+
+
+#include "node_resource.h"
+
+namespace ivr {
+
+class NodeBroadcastNum : public NodeResource {
+public:
+    NodeBroadcastNum(const uint32_t id, const string& name,
+                     const string& type, const string& desc, const key_map_t& keymap);
+    virtual ~NodeBroadcastNum(void);
+
+    virtual NodeBase* run(base_script_t* param);
+
+    virtual bool load_other();
+private:
+
+    string _callid1;
+    string _callid2;
+    string _play_str;
+    uint32_t _delay;          ///< ¿ªÊ¼·ÅÒôµÄÑÓÊ±
+    string _playtype;
+    //const static char * PARAM_CALLID;
+    const static char* _s_param_delay;       ///<
+    const static char* _s_param_str;        ///<
+    const static char* _s_param_callid1;        ///<
+    const static char* _s_param_callid2;        ///<
+    const static char* _s_param_playtype;
+    const static char* _s_paramitem_number;
+    const static char* _s_paramitem_int32;
+
+    /**
+     * @brief
+     *
+     * @param [in/out] map<string   : const
+     * @param [in/out] vars   : variable_t>&
+     * @return  std::string
+     * @retval
+     * @see
+     * @note
+     * @date 2014/06/18 10:08:22
+    **/
+    std::string enter(const map<string, variable_t>& vars) const;
+};
+
+}
+#endif
diff --git a/platform/ivr/include/node_factory.h b/platform/ivr/include/node_factory.h
index bd978a7..149dfed 100644
--- a/platform/ivr/include/node_factory.h
+++ b/platform/ivr/include/node_factory.h
@@ -79,6 +79,11 @@ class node_factory {
 
     const static char* NODE_WHATWEEKDAY;
     const static char* NODE_MAKECALL;
+    const static char * _s_node_broadcast;
+    const static char * _s_node_broadcast_num;
+    const static char* _s_node_base64_decode;
+    const static char* _s_node_base64_encode;
+    const static char* _s_node_set_appdata;
 };
 
 #endif  //__NODE_FACTORY_H_
diff --git a/platform/ivr/include/node_getdigits.h b/platform/ivr/include/node_getdigits.h
index b0e89ff..f7bfa78 100644
--- a/platform/ivr/include/node_getdigits.h
+++ b/platform/ivr/include/node_getdigits.h
@@ -64,7 +64,7 @@ class NodeGetDigits : public NodeResource {
      * @author chenyuzhen
      * @date 2011/09/06 15:48:23
     **/
-    std::string NodeGetDigits::enter(const map<string, variable_t>& vars)const;
+    std::string enter(const map<string, variable_t>& vars)const;
 
 };
 
diff --git a/platform/ivr/include/node_jsonget_array.h b/platform/ivr/include/node_jsonget_array.h
index 796eda8..59e17fd 100644
--- a/platform/ivr/include/node_jsonget_array.h
+++ b/platform/ivr/include/node_jsonget_array.h
@@ -58,14 +58,12 @@ class NodeJsonGetArray : public NodeBase {
 private:
     string _input;          ///< nodeÊäÈëjson´®
     string _valueindex;     ///< ÖµÏÂ±ê
-    string _key;            ///< node²éÕÒµÄkeyÖµ
     string _valuetype;      ///< nodeÖÐ»ñÈ¡ÖµÀàÐÍ
     string _value;          ///< node²éÕÒµ½µÄkeyÖµ
     string _reason;         ///< nodeÖÐÊ§°ÜÔ­ÒòÖµ
 
     const static char* PARAM_INPUT;
     const static char* PARAM_VALUEINDEX;
-    const static char* PARAM_KEY;
     const static char* PARAM_VALUETYPE;
     const static char* PARAM_VALUE;
     const static char* PARAM_REASON;
diff --git a/platform/ivr/include/node_setappdata.h b/platform/ivr/include/node_setappdata.h
new file mode 100644
index 0000000..4bf445d
--- /dev/null
+++ b/platform/ivr/include/node_setappdata.h
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2002-2014 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      CC/LICENSE
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _NODE_SETAPPDATA_H_
+#define _NODE_SETAPPDATA_H_
+
+#include "node_base.h"
+
+class NodeSetAppData : public NodeBase {
+public:
+    NodeSetAppData(const uint32_t id, const string& name,
+                const string& type, const string& desc, const key_map_t& keymap);
+    virtual ~NodeSetAppData(void);
+
+    virtual NodeBase* run(base_script_t* param);
+
+    virtual bool load_other();
+
+    virtual std::string enter(const map<string, variable_t>& vars)const ;
+
+    virtual std::string leave(const map<string, variable_t>& vars)const ;
+private:
+	string _app_data;
+    const static char* _s_param_input;
+
+};
+
+#endif
diff --git a/platform/ivr/include/parser.c b/platform/ivr/include/parser.c
index dc87c66..9b99b1f 100644
--- a/platform/ivr/include/parser.c
+++ b/platform/ivr/include/parser.c
@@ -8,7 +8,6 @@
  
 /**
  * @file include/parser.c
- * @author chenyuzhen(chenyuzhen@baidu.com)
  * @date 2011/08/24 17:53:49
  * @brief 
  *
diff --git a/platform/ivr/include/tools.h b/platform/ivr/include/tools.h
index 4c4230b..bd6d423 100644
--- a/platform/ivr/include/tools.h
+++ b/platform/ivr/include/tools.h
@@ -301,7 +301,7 @@ class ivr_tools_t {
      * @author chenyuzhen
      * @date 2011/09/16 12:36:39
     **/
-    static void ivr_tools_t::safe_sleeps(uint32_t s);
+    static void safe_sleeps(uint32_t s);
 
     /**
      * @brief sleep ms
@@ -314,7 +314,7 @@ class ivr_tools_t {
      * @author chenyuzhen
      * @date 2011/10/20 12:09:59
     **/
-    static void ivr_tools_t::safe_sleepms(uint32_t ms);
+    static void safe_sleepms(uint32_t ms);
 
 
     // return "-h ip -p port"
diff --git a/platform/ivr/include/utl.cpp b/platform/ivr/include/utl.cpp
index 4c35c65..375b9c8 100644
--- a/platform/ivr/include/utl.cpp
+++ b/platform/ivr/include/utl.cpp
@@ -111,7 +111,7 @@ int32_t http_post(
 }
 /*
 int main(){
-    char url[]="http://10.26.78.49:8010/login";
+    char url[]="http://127.0.0.1:80/login";
     char reqs[]="{\"agentid\":1001,\"agenttype\":1,\"optype\":\"system\",\"op\":\"login\",\"tab\":49849,\"param\":{}}";
     char* request=curl_escape( reqs , 0);
     char post[256];
diff --git a/platform/ivr/src/autodial_chan_thread.cpp b/platform/ivr/src/autodial_chan_thread.cpp
index 6a45179..a35261c 100644
--- a/platform/ivr/src/autodial_chan_thread.cpp
+++ b/platform/ivr/src/autodial_chan_thread.cpp
@@ -71,6 +71,7 @@ bool AutoDialChanThread::init_ivrvars(const std::string& dialdata, inbound_scrip
     *(string*)kvpair[SYS_VAR[sys_var_t::HANGUP_CAUSE]].pvalue = "user_hangup";
     *(string*)kvpair[SYS_VAR[sys_var_t::CALL_BEGIN_TIME]].pvalue = curr;
     *(string*)kvpair[SYS_VAR[sys_var_t::CALL_ANSWER_TIME]].pvalue = curr;
+    *(string*)kvpair[SYS_VAR[sys_var_t::AGENTID]].pvalue = "";
 
     if (kvpair.find("_AUTODIALDATA") == kvpair.end()) {
         variable_t variable;
diff --git a/platform/ivr/src/autorun_chan_thread.cpp b/platform/ivr/src/autorun_chan_thread.cpp
index 32a31d2..8a0e8fe 100644
--- a/platform/ivr/src/autorun_chan_thread.cpp
+++ b/platform/ivr/src/autorun_chan_thread.cpp
@@ -111,6 +111,7 @@ uint32_t AutoRunChanThread::execute(void* taskparam) {
         *(string*)_script->name_var_map[SYS_VAR[sys_var_t::HANGUP_CAUSE]].pvalue = "user_hangup";
         *(string*)_script->name_var_map[SYS_VAR[sys_var_t::CALL_BEGIN_TIME]].pvalue = curr;
         *(string*)_script->name_var_map[SYS_VAR[sys_var_t::CALL_ANSWER_TIME]].pvalue = curr;
+        *(string*)_script->name_var_map[SYS_VAR[sys_var_t::AGENTID]].pvalue = "";
 
         NodeBase* node = _script->flow->id_node_map[_script->flow->begin_id];
 
diff --git a/platform/ivr/src/common.cpp b/platform/ivr/src/common.cpp
index e813e18..cc82c33 100644
--- a/platform/ivr/src/common.cpp
+++ b/platform/ivr/src/common.cpp
@@ -14,6 +14,7 @@
  * limitations under the License.
  */
 
+
 #include "common.h"
 #include "tools.h"
 #include "flow_manager.h"
@@ -22,6 +23,13 @@
 int32_t g_stopped = 0;
 sem_t g_stop_sem;
 
+//looger config
+uint32_t g_log_count;
+uint32_t g_log_filecount;
+uint32_t g_log_level;
+uint32_t g_log_timeout;
+
+
 //system configuration
 string g_server_ip;
 uint32_t g_server_port = 0;
@@ -77,7 +85,9 @@ const char* SYS_VAR[] = {
     "_RECORD_FILE_NAME",
     "_HANGUP_CAUSE",
     "_CALL_BEGIN_TIME",
-    "_CALL_ANSWER_TIME"
+    "_CALL_ANSWER_TIME",
+    "_TRUNCK",//add to store associate data when incall is transfer from other ivr
+    "_AGENTID"
 };
 std::string base_script_t::bill_info() {
     ostringstream ostm;
diff --git a/platform/ivr/src/conf_manager.cpp b/platform/ivr/src/conf_manager.cpp
index 44e099f..3a7d48c 100644
--- a/platform/ivr/src/conf_manager.cpp
+++ b/platform/ivr/src/conf_manager.cpp
@@ -124,6 +124,24 @@ int32_t ConfManager::load_system_conf() {
         return FAILURE;
     }
 
+    IVR_TRACE("---------------[System]-[logger]---------------------------------");
+    g_log_count = conf->get_int("logger", "log_count", 0, _sys_file.c_str(), true);
+    g_log_filecount = conf->get_int("logger", "log_filecount", 0, _sys_file.c_str(), true);
+    g_log_level = conf->get_int("logger", "log_level", 0, _sys_file.c_str(), true);
+    g_log_timeout= conf->get_int("logger", "log_timeout", 0, _sys_file.c_str(), true);
+
+/*
+    char tmp[512] = {0};    //lo
+    conf->get_string("calldata", "log_dir", "", tmp, 512, _sys_file.c_str(), true);
+    g_log_dir = tmp;
+    memset(tmp, 0, 512);
+    conf->get_string("calldata", "log_file", "", tmp, 512, _sys_file.c_str(), true);
+    g_log_file= tmp;
+    memset(tmp, 0, 512);
+    conf->get_string("calldata", "version", "", tmp, 512, _sys_file.c_str(), true);
+    g_version= tmp;
+*/
+
     IVR_TRACE("---------------[System]-[General]---------------------------------");
 
     char ip[16] = {0};           //load ip
diff --git a/platform/ivr/src/db_pool.cpp b/platform/ivr/src/db_pool.cpp
index feca972..43faabe 100644
--- a/platform/ivr/src/db_pool.cpp
+++ b/platform/ivr/src/db_pool.cpp
@@ -168,7 +168,7 @@ int32_t DBContainer::create_container(mysql::MySQL_Driver* driver, string& host,
 Connection* DBContainer::get_connection() {
     Connection* conn = NULL;
 
-    sem_lock_t lock_conn(_sem_conn);
+    sem_lock_t lock_conn(&_sem_conn);
 
     if (!lock_conn.wait()) {
         return NULL;
@@ -213,6 +213,6 @@ void DBContainer::free_connection(Connection* conn) {
         _idle_conn_vec.push_back(conn);
     }
 
-    sem_lock_t lock_conn(_sem_conn);
+    sem_lock_t lock_conn(&_sem_conn);
     lock_conn.post();
 }
diff --git a/platform/ivr/src/fs/event_receiver.cpp b/platform/ivr/src/fs/event_receiver.cpp
index d8025dd..9c64187 100644
--- a/platform/ivr/src/fs/event_receiver.cpp
+++ b/platform/ivr/src/fs/event_receiver.cpp
@@ -21,7 +21,9 @@
 #include "inbound_chan_thread.h"
 #include "thread_pool.h"
 #include "ivr_instance_manager.h"
+#include "ivr_data_collection.h"
 
+using ivr::IvrCallDataCollection;
 
 int32_t heartbeat_recv_t::operator()(const bool*, void* param) {
     _shutdown = false;
@@ -110,6 +112,7 @@ int32_t callevent_recv_t::operator()(const bool*, void* param) {
                         param->ani = string(evt.event_data.normal.caller_no);
                         param->dnis = string(evt.event_data.normal.called_no);
                         param->callid = string(evt.event_data.normal.uuid);
+                        param->trunck = string(evt.event_data.normal.trunck);
                         param->channel_name = string(evt.event_data.normal.channel_name);
                         param->channel_id = string(evt.event_data.normal.uuid);
                         param->callsource = ivr_tools_t::get_address(_info->get_address());
@@ -117,6 +120,7 @@ int32_t callevent_recv_t::operator()(const bool*, void* param) {
                         param->imssid = 0;
                         param->requestId = 0;
                         InboundChanThread* inbound_thread = new InboundChanThread(param); // thread pool will delete it
+                        IvrCallDataCollection::instance().new_inbound_call(param->ani, param->dnis, param->callid);
                         ThreadPool* threadpool = ThreadPool::get_instance();
                         threadpool->assign_work(inbound_thread);
                         //*/
diff --git a/platform/ivr/src/fs/fs_opr.cpp b/platform/ivr/src/fs/fs_opr.cpp
index 4524654..7034a39 100644
--- a/platform/ivr/src/fs/fs_opr.cpp
+++ b/platform/ivr/src/fs/fs_opr.cpp
@@ -20,6 +20,9 @@
 #include "tools.h"
 #include "ivr_instance_manager.h"
 #include "ims/ims_mgr.h"
+#include "ivr_data_collection.h"
+
+using ivr::IvrCallDataCollection;
 
 #define IMSDATA_EQUAL IMS_SESSION_TAG"="
 
@@ -187,6 +190,11 @@ int32_t fs_opr_t::get_event(fs_event_t& event, uint32_t timeout) {
                 getIP = szcmd;
             }
 
+            if (IVR_SUCCESS == get_var("IPTKC", szcmd, LEN_512)) {
+                snprintf(event.event_data.normal.trunck, LEN_512, "%s", szcmd);
+                IVR_DEBUG("get trunck (%s)", event.event_data.normal.trunck);
+            }
+
             if (strcasecmp(event.name, "BACKGROUND_JOB") == 0) {
                 get_head_val("Job-Command", szcmd, LEN_512);
 
@@ -344,30 +352,14 @@ int32_t fs_opr_t::get_event(fs_event_t& event, uint32_t timeout) {
             //1£©Ã»ÓÐsessionidµÄÕñÁåÊÓÎªºôÈë£¬Í¬Ê±±ê¼Ç
             //2£©ÓÐsessionidµÄÕñÁåÊÓÎªÍâºôºóµÄÕñÁå
             //3£©ÆäËüÊÂ¼þ¸ù¾Ýuuid²éÑ¯
-            else if (0 == strcasecmp(event.name, "CHANNEL_PROGRESS_MEDIA") ||
-                     0 == strcasecmp(event.name, "CHANNEL_PROGRESS")) {
-                if (0 != event.sessionid &&
-                        IvrInstanceManager::get_instance()->search_ivr_instance(event.sessionid)) {
-                    IvrInstanceManager::get_instance()->add_uuid(event.sessionid, tmp_uuid);
-                    IVR_DEBUG("ADD UUID SUCC: UUID= %s", tmp_uuid);
-                } else {
-                    if (!check_ivr_ip(getIP.c_str())) {
-                        continue;
-                    }
-                }
-            } else if (!IvrInstanceManager::get_instance()->check_uuid(tmp_uuid, event.sessionid)) {
-                IVR_DEBUG("CHECK UUID FAIL: UUID= %s", tmp_uuid);
-                continue;
-            }
-
+            else {
             //·â×°ÊÂ¼þ
-            if (strcasecmp(event.name, "BACKGROUND_JOB") != 0) {
                 get_head_val("Unique-ID", event.event_data.normal.uuid, LEN_64);
                 get_head_val("Caller-Caller-ID-Number", event.event_data.normal.caller_no, LEN_64);
                 get_head_val("Caller-Destination-Number", event.event_data.normal.called_no, LEN_64);
                 get_head_val("Channel-Name", event.event_data.normal.channel_name, LEN_64);
                 std::string deviceno;
-
+                
                 if (ivr_tools_t::chlname2no(event.event_data.normal.channel_name, deviceno)) {
                     strncpy(event.event_data.normal.deviceno, deviceno.c_str(), LEN_64);
                 } else {
@@ -465,9 +457,25 @@ int32_t fs_opr_t::get_event(fs_event_t& event, uint32_t timeout) {
                     }
 
                 }
+                IvrCallDataCollection::instance().process_event(event);
+                if (0 == strcasecmp(event.name, "CHANNEL_PROGRESS_MEDIA") ||
+                    0 == strcasecmp(event.name, "CHANNEL_ORIGINATE") ||
+                    0 == strcasecmp(event.name, "CHANNEL_PROGRESS")) {
+                   if (0 != event.sessionid &&
+                       IvrInstanceManager::get_instance()->search_ivr_instance(event.sessionid)) {
+                       IvrInstanceManager::get_instance()->add_uuid(event.sessionid, tmp_uuid);
+                       IVR_DEBUG("ADD UUID SUCC: UUID= %s", tmp_uuid);
+                   } else {
+                       if (!check_ivr_ip(getIP.c_str())) {
+                           continue;
+                       }
+                   }
+                } else if (!IvrInstanceManager::get_instance()->check_uuid(tmp_uuid, event.sessionid)) {
+                    IVR_DEBUG("CHECK UUID FAIL: UUID= %s", tmp_uuid);
+                    continue;
+                }
             }
 
-
             std::ostringstream ostm;
             ostm << std::endl;
             ostm << "===========================FS EVENT============================" << std::endl;
@@ -764,7 +772,7 @@ int32_t fs_opr_t::bridgeonly(const char* uuid1, const char* uuid2) {
 }
 
 int32_t fs_opr_t::bridgeex(const char* uuid, const char* caller, const char* called,
-                           bool external, bool usbgm, const char* bgmfile) {
+                           bool external, bool usbgm, const char* bgmfile,  bool bghungup) {
     FUNC_BEGIN();
     (void)fs_resp;
     ostringstream ostm;
@@ -787,8 +795,16 @@ int32_t fs_opr_t::bridgeex(const char* uuid, const char* caller, const char* cal
         }
     }
 
-    if (set_channel_attribute(uuid, "hangup_after_bridge=false") &&
-            set_channel_attribute(uuid, "bypass_media=false") &&
+    if (bghungup){
+        IVR_DEBUG("set hangup_after_bridge=true");
+        set_channel_attribute(uuid, "hangup_after_bridge=true");
+    }
+    else{
+        IVR_DEBUG("set hangup_after_bridge=false");
+        set_channel_attribute(uuid, "hangup_after_bridge=false");
+    }
+
+    if (set_channel_attribute(uuid, "bypass_media=false") &&
             set_channel_attribute(uuid, "continue_on_fail=true")) {
         set_channel_attribute(uuid, "export_vars=IVR_SESSION_ID");
         //set_channel_attribute(uuid,"export_vars=IVRDATA");
@@ -931,6 +947,97 @@ int32_t fs_opr_t::play(const char* uuid, const char* file, uint32_t count) {
     FUNC_END();
 }
 
+int32_t fs_opr_t::broadcast_num(const char* callid1, const char* callid2,
+        const char* data, const char* basepath, bool isStr)
+{
+    FUNC_BEGIN();
+    (void)szcmd;
+    (void)fs_resp;
+    string playlist = "";
+    if (isStr) {
+        string playstr = string(data);
+        IVR_DEBUG("playstr:[%s]", data);
+        uint32_t i = 0;
+        for (i = 0; i < playstr.size(); i++) {
+            playlist = playlist + basepath + "system/num" + data[i] + ".wav&";
+        }
+    } else {
+        uint32_t tmp = atoi(data);
+        string str_number;
+        std::ostringstream ostm;
+        ostm.str("");
+        ostm << tmp;
+        str_number = ostm.str();
+
+        uint32_t numlength = str_number.size();
+        IVR_TRACE("STARS tmp:%u; str:%s; len:%u", tmp, str_number.c_str(), numlength);
+        for (uint32_t i = 0; i < numlength; i++) {
+            uint32_t small = (numlength-i-1) % 4;
+            uint32_t big   = (numlength-i-1) / 4;
+            bool zerotag = false;
+            if (small == 0) {
+                if (str_number.at(i) != '0') {
+                    if (zerotag) {
+                        playlist = playlist + basepath + "system/num0.wav&";
+                    }
+                    playlist = playlist + basepath + "system/num" + str_number.at(i) + ".wav&";
+                }
+                zerotag = false;
+                if (big > 0) {
+                    char tmp = '4' + big;
+                    playlist = playlist + basepath + "system/dimension" + tmp + ".wav&";
+                }
+            }
+            else {
+                if (str_number.at(i) == '0') {
+                    zerotag = true;
+                }
+                else {
+                    if (zerotag) {
+                        playlist = playlist + basepath + "system/num0.wav&";
+                    }
+                    playlist = playlist + basepath + "system/num" + str_number.at(i) + ".wav&";
+                    char tmp = '0' + small;
+                    playlist = playlist + basepath + "system/dimension" + tmp + ".wav&";
+                }
+            }
+        }
+    } 
+    if (uuid_broadcast(callid1, callid2, playlist.c_str()) != IVR_SUCCESS) {
+        IVR_TRACE("%s,%s,·ÅÒôÊ§°Ü[%s]", callid1, callid2, playlist.c_str());
+    } else {
+        ret = IVR_SUCCESS;
+    }
+    FUNC_END();
+}
+
+int32_t fs_opr_t::uuid_broadcast(const char * callid1, const char * callid2, const char * file)
+{
+    FUNC_BEGIN();
+    snprintf(szcmd, LEN_512, _s_cmd_uuidbroadcast_fmt, callid1, file);
+    IVR_TRACE("uuid_broadcast (%s)", szcmd);
+
+    if (set_channel_attribute(callid1, "playback_terminators=none") &&
+        set_channel_attribute(callid1, "playback_delimiter=&") &&
+        esl_execute(&_handle, "break", NULL, callid1) == ESL_SUCCESS && //stop before play
+        is_result_ok(fs_resp = esl_event_get_header(_handle.last_sr_event, "Reply-Text")) &&
+        set_channel_attribute(callid2, "playback_terminators=none") &&
+        set_channel_attribute(callid2, "playback_delimiter=&") &&
+        esl_execute(&_handle, "break", NULL, callid2) == ESL_SUCCESS && //stop before play
+        is_result_ok(fs_resp = esl_event_get_header(_handle.last_sr_event, "Reply-Text")) &&
+        esl_send_recv(&_handle, szcmd) == ESL_SUCCESS) {
+        if (is_result_ok(fs_resp = esl_event_get_body(_handle.last_sr_event))) {
+            ret = IVR_SUCCESS;
+            IVR_TRACE("uuid_broadcast success");
+        }
+        else {
+            IVR_WARN("fs:uuid_broadcast(%s,%s);ret(%s)", callid1, file, fs_resp);
+        } 
+    }
+
+    FUNC_END();
+}
+
 int32_t fs_opr_t::send_dtmf(const char* uuid, const char* keys) {
     FUNC_BEGIN();
     (void)szcmd;
@@ -1128,6 +1235,7 @@ const char* fs_opr_t::CMD_ORIGINATE_FMT =
     "bgapi originate {return_ring_ready=false,bridge_early_media=true,bypass_media=false,"
     "origination_caller_id_number=%s,origination_caller_id_name=%s,IVRDATA=%llu}%s "
     "&bridge([origination_caller_id_number=%s,origination_caller_id_name=%s,call_timeout=%u,IVRDATA=%llu]%s)\n\n";
+const char* fs_opr_t::_s_cmd_uuidbroadcast_fmt = "api uuid_broadcast %s %s both\n\n";
 
 const char* fs_opr_t::CMD_RECORD_FMT = "api uuid_record %s start %s\n\n";
 const char* fs_opr_t::CMD_STOPRECORD_FMT = "api uuid_record %s stop all\n\n";
diff --git a/platform/ivr/src/fs_operator.cpp b/platform/ivr/src/fs_operator.cpp
index de201e6..88e4fe4 100644
--- a/platform/ivr/src/fs_operator.cpp
+++ b/platform/ivr/src/fs_operator.cpp
@@ -155,7 +155,7 @@ bool fs_operator_t::record(esl_handle_t* handle,
         esl_execute(handle, CMD_SET, "RECORD_COPYRIGHT=(c) 2011 Baidu.com", callid.c_str());
         check_result(esl_event_get_header(handle->last_sr_event, REPLY_TEXT));
 
-        esl_execute(handle, CMD_SET, "RECORD_TITLE=callcloud@baidu.com", callid.c_str());
+        esl_execute(handle, CMD_SET, "RECORD_TITLE=callcloud@127.0.0.1", callid.c_str());
         check_result(esl_event_get_header(handle->last_sr_event, REPLY_TEXT));
 
         esl_execute(handle, CMD_SET, "RECORD_MIN_SEC=0", callid.c_str());
diff --git a/platform/ivr/src/ims/eventimp.cpp b/platform/ivr/src/ims/eventimp.cpp
index 39353e3..b254f5b 100644
--- a/platform/ivr/src/ims/eventimp.cpp
+++ b/platform/ivr/src/ims/eventimp.cpp
@@ -14,12 +14,17 @@
  * limitations under the License.
  */
 
+
 #include "ims/eventimp.h"
+#include "ivr_data_collection.h"
 #include <tools.h>
 #include <ims/ims_mgr.h>
 #include <ivr_instance_manager.h>
 #include <common.h>
 
+using ivr::IvrCallDataCollection;
+using ivr::IvrInboundCall;
+
 ims::CcResultT ImsEventImp::SendCallEvent(const ims::CallEventT& event,
         const std::map<std::string, std::string>& ctx) {
     //IVR_DEBUG("ims call event");
@@ -39,7 +44,8 @@ ims::CcResultT ImsEventImp::SendRouteEvent(const ims::RouteEventT& event,
         ss << "callid(" << event.callid
            << ") sessionid(" << event.sessionid
            << ") reason" << event.reason.get_desc()
-           << ") agent(" << event.targetDevice << ")";
+           << ") agentDN(" << event.targetDevice
+           << ") agentID(" << event.targetAgentId << ")";
         IVR_TRACE("ims route event: %s", ss.str().c_str());
     }
     ivr_session_id_t ivrsid = 0;
@@ -52,6 +58,7 @@ ims::CcResultT ImsEventImp::SendRouteEvent(const ims::RouteEventT& event,
             ivrevent->sessionId = ivrsid;
             ivrevent->evt_type = ivr_base_event_t::IMS_EVENT;
             ivrevent->evt_name = ivr_ims_event_t::IVR_EVT_IMS_ROUTE_RESPONSE;
+            IvrCallDataCollection::instance().process_event(ivrevent.get());
             IvrInstanceManager::get_instance()->put_ivr_event(ivrevent.release());
             IVR_TRACE("route event success!");
         } else {
diff --git a/platform/ivr/src/inbound_chan_thread.cpp b/platform/ivr/src/inbound_chan_thread.cpp
index 06c54da..db988ef 100644
--- a/platform/ivr/src/inbound_chan_thread.cpp
+++ b/platform/ivr/src/inbound_chan_thread.cpp
@@ -25,13 +25,16 @@
 #include "flow_manager.h"
 #include "fs_mgr.h"
 #include "fs_opr.h"
-#include "lock.h"
+#include "ivr_data_collection.h"
 #include <ims/ims_mgr.h>
 
 #if IVR_ENABLE_DEBUGER
 #include "ivrdebuger.h"
 #endif
 
+using ivr::IvrCallDataCollection;
+using ivr::IvrInboundCall;
+
 extern inbound_conf_t  g_inbound_conf;
 //extern map<string, flow_t*> g_flow_name_info_map;
 extern FlowManager g_flowmanager;
@@ -108,6 +111,10 @@ uint32_t InboundChanThread::execute(void* taskparam) {
     IVR_DEBUG("inbound_execute event queue pointer %lu, queue size: %lu",
               (uint64_t)(((session_dynamic_resource_t*)taskparam)->event_queue),
               ((session_dynamic_resource_t*)taskparam)->event_queue->size());
+    
+    ivr_session_id_t ivr_s_id;
+    session_dynamic_resource_t* resource = NULL;
+    IvrInstanceManager* mgr = NULL;
 
     if (!check_capability()) {
         ret = 1;
@@ -159,15 +166,15 @@ uint32_t InboundChanThread::execute(void* taskparam) {
     script.callsource = ((inbound_script_t*)_param)->callsource;
     script.channel_name = ((inbound_script_t*)_param)->channel_name;
     script.channel_id = ((inbound_script_t*)_param)->channel_id;
+    script.trunck = ((inbound_script_t*)_param)->trunck;
     ivr_tools_t::build_vars(script.flow->name_var_map, script.name_var_map);
 
     // don't add channel information here
     //  if answer the call, will add information
 
     //´´½¨ÊµÀý
-    ivr_session_id_t ivr_s_id;
-    session_dynamic_resource_t* resource = (session_dynamic_resource_t*)taskparam;
-    IvrInstanceManager* mgr = IvrInstanceManager::get_instance();
+    resource = (session_dynamic_resource_t*)taskparam;
+    mgr = IvrInstanceManager::get_instance();
 
     if (IVR_SUCCESS != mgr->create_ivr_instance(script.type, script.fid, &ivr_s_id, *resource,
             script.callid.c_str())) {
@@ -211,11 +218,13 @@ uint32_t InboundChanThread::execute(void* taskparam) {
     *(string*)script.name_var_map[SYS_VAR[sys_var_t::ANI]].pvalue = script.ani;
     *(string*)script.name_var_map[SYS_VAR[sys_var_t::DNIS]].pvalue = script.dnis;
     *(string*)script.name_var_map[SYS_VAR[sys_var_t::CALLID]].pvalue = script.callid;
+    *(string*)script.name_var_map[SYS_VAR[sys_var_t::TRUNCK]].pvalue = script.trunck;
     *(string*)script.name_var_map[SYS_VAR[sys_var_t::RECORD_FILE]].pvalue = "";
     *(string*)script.name_var_map[SYS_VAR[sys_var_t::HANGUP_CAUSE]].pvalue = "user_hangup";
 
     *(string*)script.name_var_map[SYS_VAR[sys_var_t::CALL_BEGIN_TIME]].pvalue = curr;
     *(string*)script.name_var_map[SYS_VAR[sys_var_t::CALL_ANSWER_TIME]].pvalue = curr;
+    *(string*)script.name_var_map[SYS_VAR[sys_var_t::AGENTID]].pvalue = "";
 
     //ÔËÐÐÁ÷³Ì
     node = script.flow->id_node_map[script.flow->begin_id];
@@ -223,11 +232,15 @@ uint32_t InboundChanThread::execute(void* taskparam) {
     ost << "ANI:\t" << script.ani << endl;
     ost << "DNIS:\t" << script.dnis << endl;
     ost << "CALLID:\t" << script.callid << endl;
+    ost << "TRUNCK:\t" << script.trunck << endl;
     ost << "FID:\t" << script.fid << endl;
     ost << "SESSIONID:\t" << script.session_id << endl;
     ost << "================";
     IVR_DEBUG("%s", ost.str().c_str());
 
+    // add to data collection
+   IvrCallDataCollection::instance().new_accept_call(script.ani, script.dnis, script.session_id, script.callid); 
+
 #if IVR_ENABLE_DEBUGER
     IvrDebuger::get_instance()->report(this, "startup", script, node);
 #endif
@@ -252,6 +265,8 @@ uint32_t InboundChanThread::execute(void* taskparam) {
         calldata_manager->push_calldata(script.bill_info().c_str());
     }
 
+    //set state
+    IvrCallDataCollection::instance().set_state(script.session_id, IvrInboundCall::EXITFLOW, "");
     ivr_tools_t::destroy_vars(script.name_var_map);
     mgr->destroy_ivr_instance(ivr_s_id);
     ims_mgr_t::get_instance()->unbind_session_id(ivr_s_id);
@@ -260,7 +275,6 @@ uint32_t InboundChanThread::execute(void* taskparam) {
         // clear all timer
         resource->timer->clear_all_timer();
     }
-
 CHAN_END:
     FlowManager::detach_flow(&script.flow);
     {
diff --git a/platform/ivr/src/ini_file.cpp b/platform/ivr/src/ini_file.cpp
index 2520057..a49df14 100644
--- a/platform/ivr/src/ini_file.cpp
+++ b/platform/ivr/src/ini_file.cpp
@@ -14,9 +14,10 @@
  * limitations under the License.
  */
 
+#include <fstream>
+
 #include "tools.h"
 #include "ini_file.h"
-#include <fstream>
 
 INIFile::~INIFile() {
     _file_map.clear();
@@ -57,9 +58,6 @@ bool INIFile::load_file(const char* file_name, section_map_t& sections, bool cas
 
             line = szbuf;
             ivr_tools_t::trim(line);
-            //            if(!casesensive){
-            //                transform(line.begin(), line.end(), line.begin(), ::tolower);
-            //            }
         } else {
             has_read = false;
         }
diff --git a/platform/ivr/src/ivr_callinfo.cpp b/platform/ivr/src/ivr_callinfo.cpp
new file mode 100644
index 0000000..c90da48
--- /dev/null
+++ b/platform/ivr/src/ivr_callinfo.cpp
@@ -0,0 +1,201 @@
+// ivr_callinfo.cpp: implement IvrCallInfo 
+
+#include "ivr_callinfo.h"
+
+namespace ivr {
+Logger IvrCallInfo::_m_logger;
+ReleaseCauseT::ReleaseCauseT(int32_t value) : _m_value(value) {
+}
+
+ReleaseCauseT::~ReleaseCauseT() {
+}
+
+void ReleaseCauseT::set_value(int32_t value) {
+    _m_value = value;
+}
+
+int32_t ReleaseCauseT::get_value() {
+    return _m_value;
+}
+
+bool ReleaseCauseT::isValid() {
+    return _m_value != UNKNOWN;
+}
+
+void IvrCallInfo::initial(ivr_session_id_t sessionId, const string& callid, const string& caller, const string& callee)
+{
+    _m_sessionid = sessionId;
+    _m_caller = caller;
+    _m_callee = callee;
+    _m_callid = callid;
+}
+
+IvrCallInfo::IvrCallInfo() : _m_skill(""), _m_route_list(""), _m_agentnum(""), _m_cust_ans_time(0), _m_agt_ans_time(0)
+        , _m_agt_alert_time(0), _m_connected_time(0), _m_callee(""), _m_caller(""), _m_exit_flow_time(0)
+        , _m_flowbegin_time(0), _m_hangup_time(0), _m_inboundbegin_time(0), _m_recordFilename("")
+        , _m_releaseCause(ReleaseCauseT::UNKNOWN), _m_sessionid(0), _m_trans_time(0), _is_update(true)
+{
+}
+
+IvrCallInfo::~IvrCallInfo()
+{
+}
+
+void IvrCallInfo::set_inbound_begin_time(time_t t)
+{
+    _m_inboundbegin_time = t;
+}
+
+time_t IvrCallInfo::get_inbound_begin_time()
+{
+    return _m_inboundbegin_time;
+}
+
+void IvrCallInfo::set_flow_begin_time(time_t t)
+{
+    _m_flowbegin_time = t;
+}
+
+void IvrCallInfo::set_cust_ans_time(time_t t)
+{
+    _m_cust_ans_time = t;
+}
+
+void IvrCallInfo::set_agt_ans_time(time_t t)
+{
+    _m_agt_ans_time = t;
+}
+
+void IvrCallInfo::set_agt_alert_time(time_t t)
+{
+    _m_agt_alert_time = t;
+}
+
+void IvrCallInfo::set_connected_time(time_t t)
+{
+    _m_connected_time = t;
+}
+
+void IvrCallInfo::set_trans_time(time_t t)
+{
+    _m_trans_time = t;
+}
+
+void IvrCallInfo::set_hangup_time(time_t t)
+{
+    _m_hangup_time = t;
+    if (!_is_update && _m_route_list != "") {
+        std::ostringstream oss;
+        oss << "#";
+        oss << t;
+        _m_route_list+= oss.str();
+    }
+}
+
+void IvrCallInfo::set_exit_flow_time(time_t t)
+{
+    _m_exit_flow_time = t;
+}
+
+void IvrCallInfo::set_release_cause(int32_t releaseCause)
+{
+    _m_releaseCause.set_value(releaseCause);
+}
+
+void IvrCallInfo::set_record_filename(const string &recordFilename)
+{
+    _m_recordFilename = recordFilename;
+}
+
+void IvrCallInfo::set_skill(time_t t, const std::string &skill)
+{
+    std::ostringstream oss;
+    if (_m_route_list != "") {
+        if (!_is_update) {
+            oss << "#";
+            oss << t;        
+        }
+        oss << "|";
+    }
+    oss << skill;
+    oss << "#";
+    oss << t;
+    _m_route_list+= oss.str();
+    _m_skill = skill;
+    _is_update = false;
+}
+void IvrCallInfo::update_skill(time_t t, const std::string& skill) {
+    std::ostringstream oss;
+    oss << "#";
+    oss << t;
+
+    _m_route_list += oss.str();
+    _is_update = true;
+}
+
+void IvrCallInfo::set_appdata(const std::string& appdata) {
+    _m_appdata = appdata;
+}
+
+std::string IvrCallInfo::get_skill()
+{
+    return _m_skill;
+}
+
+std::string IvrCallInfo::get_callee()
+{
+    return _m_callee;
+}
+
+void IvrCallInfo::set_agent_num(const string &agentnum)
+{
+    _m_agentnum = agentnum;
+}
+
+void IvrCallInfo::reset()
+{
+    _m_agentnum.clear();
+    _m_cust_ans_time = 0;
+    _m_connected_time = 0;
+    _m_agt_ans_time = 0;
+    _m_agt_alert_time = 0;
+    _m_callee.clear();
+    _m_caller.clear();
+    _m_exit_flow_time = 0;
+    _m_flowbegin_time = 0;
+    _m_hangup_time = 0;
+    _m_inboundbegin_time = 0;
+    _m_recordFilename.clear();
+    _m_releaseCause = ReleaseCauseT::UNKNOWN;
+    _m_sessionid = 0;
+    _m_skill.clear();
+    _m_trans_time = 0;
+}
+
+void IvrCallInfo::write_call_log()
+{
+    char buffer[20480] = {0};
+    snprintf(
+            buffer, 
+            20480, 
+            "%s,%s,%s,%lu,%lu,%lu,%lu,%lu,%lu,%lu,%d,%s,%s,%s", 
+            _m_callid.c_str(), 
+            _m_caller.c_str(), 
+            _m_callee.c_str(), 
+            _m_flowbegin_time, 
+            _m_agt_ans_time,
+            _m_hangup_time, 
+            _m_trans_time, 
+            _m_agt_alert_time, 
+            _m_agt_ans_time, 
+            _m_exit_flow_time, 
+            _m_releaseCause.get_value(), 
+            _m_skill.c_str(), 
+            _m_route_list.c_str(), 
+            _m_appdata.c_str());
+    //std::cout << "buffer " << buffer << std::endl;
+    IVR_NOTICE("write callinfo, sessionid(%lu), callid(%s)", _m_sessionid, _m_callid.c_str());
+    _m_logger.WriteLog(buffer);
+}
+
+};
diff --git a/platform/ivr/src/ivr_data_collection.cpp b/platform/ivr/src/ivr_data_collection.cpp
new file mode 100644
index 0000000..71d54c7
--- /dev/null
+++ b/platform/ivr/src/ivr_data_collection.cpp
@@ -0,0 +1,1169 @@
+// ivr_data_collection.cpp: implement IvrCallDataCollection
+
+#include <json/json.h>
+#include "ivr_data_collection.h"
+
+#define CHECK_CONF(name, type) \
+    if (name.is_null()) { \
+        IVR_WARN("not found %s", #name);\
+        return -1; \
+    } else if (name.get_type() != type) { \
+        IVR_WARN("type is equal, need(%d), given(%d)", type, name.get_type());\
+        return -1; \
+    }
+
+#define FIND_CALL(sessionid, p) do {\
+    IterCall iter_call = _realtime_call.find(sessionid);\
+    if (iter_call == _realtime_call.end()) { \
+        IVR_WARN("process event, not found sessionid, sessionid(%lu)", sessionid);\
+        return -1; \
+    } \
+    if (iter_call->second ==  NULL) { \
+        IVR_WARN("inbound call struct is null, sessionid(%lu)", sessionid); \
+        return -1; \
+    } \
+    p = iter_call->second; \
+} while(0)
+
+#define BGCC_LOCK(locker) \
+    locker_t w_lock(&locker);\
+    if (!w_lock.is_locked()) { \
+        IVR_WARN("w_lock failed!"); \
+        return -1; \
+    }
+
+namespace ivr {
+time_t _m_inboundbegin_time;
+time_t _m_flowbegin_time;
+time_t _m_answer_time;	
+time_t _m_trans_time;
+time_t _m_exit_flow_time;
+time_t _m_hangup_time;
+
+int32_t IvrInboundCall::update_route_skill_endtime(const std::string& skill_name) {
+    _m_ivr_callinfo.update_skill(time(NULL), skill_name);
+    return 0;
+}
+
+int32_t IvrInboundCall::set_appdata(const std::string& appdata) {
+    _m_ivr_callinfo.set_appdata(appdata);
+    return 0;
+}
+
+int32_t IvrInboundCall::set_state(int32_t state)
+{
+    time_t cur_time = time(NULL);
+    switch (state) {
+        case BEGIN: {
+            _m_ivr_callinfo.set_inbound_begin_time(cur_time);
+            break;
+        }
+        case ACCEPT: {
+            _m_ivr_callinfo.set_flow_begin_time(cur_time);
+            state = INFLOW;
+            break;
+        }
+        case CUSTOMERANSWER: {
+            _m_ivr_callinfo.set_cust_ans_time(cur_time);
+            break;
+        }
+        case AGENTANSWER: {
+            _m_ivr_callinfo.set_agt_ans_time(cur_time);
+            break;
+        }
+        case CONNECTED: {
+            _m_ivr_callinfo.set_connected_time(cur_time);
+            break;
+        }
+        case AGENTALERTING: {
+            _m_ivr_callinfo.set_agt_alert_time(cur_time);
+            break;
+        }
+        case TRANSAGENT: {
+            _m_ivr_callinfo.set_trans_time(cur_time);
+            state = _m_state;
+            break;
+        }
+        case EXITFLOW:
+        case CALLWITHOUTFOLW: {
+            //ivr_flow_end
+            _m_ivr_callinfo.set_exit_flow_time(cur_time);
+            if (_has_hangup) {
+                _m_ivr_callinfo.write_call_log();
+            } else {
+                _exit_flow = true;
+            }
+            break;
+        }
+        case THISPARTYHANGUP: {
+            _m_ivr_callinfo.set_hangup_time(cur_time);
+            _m_ivr_callinfo.set_release_cause(ReleaseCauseT::THISPARTY);
+			if (_exit_flow) {
+                //write call log
+                _m_ivr_callinfo.write_call_log();
+			} else {
+                _has_hangup = true;
+			}
+            break;
+        }
+        case OTHERPARTYHANGUP: {
+            _m_ivr_callinfo.set_hangup_time(cur_time);
+            _m_ivr_callinfo.set_release_cause(ReleaseCauseT::OTHERPARTY);
+			if (_exit_flow) {
+                //write call log
+                _m_ivr_callinfo.write_call_log();
+
+			} else {
+                _has_hangup = true;
+			}
+            break;
+        }
+        default:
+            break;
+    }
+    _m_state = state;
+    return 0;
+}
+
+int32_t IvrInboundCall::get_state()
+{
+    return _m_state;
+}
+
+void IvrInboundCall::init_new_call(const ivr_session_id_t& sessionId, const string &callid, const string &caller, const string &callee)
+{
+    _m_ivr_callinfo.initial(sessionId, callid, caller, callee);
+}
+
+void IvrInboundCall::set_skill(const std::string& skill)
+{
+    _m_ivr_callinfo.set_skill(time(NULL), skill);
+}
+
+std::string IvrInboundCall::get_skill()
+{
+    return _m_ivr_callinfo.get_skill();
+}
+
+bool IvrInboundCall::get_exit_flow()
+{
+    return _exit_flow;
+}
+
+std::string IvrInboundCall::get_called()
+{
+    return _m_ivr_callinfo.get_callee();
+}
+
+void IvrInboundCall::set_agent_num(const string &agentnum)
+{
+    _m_ivr_callinfo.set_agent_num(agentnum);
+}
+
+time_t IvrInboundCall::get_begintime()
+{
+    return _m_ivr_callinfo.get_inbound_begin_time();
+}
+
+IvrCallDataCollection& IvrCallDataCollection::instance()
+{
+    static IvrCallDataCollection mgr;
+    return mgr;
+}
+
+int32_t IvrCallDataCollection::initialize(const char* path)
+{
+    //init plat_call_data
+    _plat_call_data.cur_accept_num = 0;
+    _plat_call_data.cur_inbound_num = 0;
+    _plat_call_data.trans_num = 0;
+    _plat_call_data.total_inbound_num = 0;
+    _plat_call_data.total_accept_num = 0;
+    _plat_call_data.giveuptimes = 0;
+
+    //init ivrnum call info
+    std::map<string, inbound_script_t>::iterator iter;
+    for (iter = g_inbound_conf.dnis_script_map.begin()
+    ; iter != g_inbound_conf.dnis_script_map.end(); ++iter) {
+        struct IvrCallData *p = new (std::nothrow) struct IvrCallData;
+        if (p ==  NULL) {
+            IVR_WARN("new ivr num memory failed, ivrnum(%s)", iter->first.c_str());
+            return -1;
+        }
+        std::pair<IterIvrNum, bool> ret = _ivrnum_call_data.insert(std::make_pair(iter->first, p));
+        if (!ret.second) {
+            IVR_WARN("insert ivrnum falied, ivrnum(%s)", iter->first.c_str());
+            return -1;
+        }
+    }
+
+    if (g_inbound_conf.has_default) {
+        struct IvrCallData *p = new (std::nothrow) struct IvrCallData;
+        if (p ==  NULL) {
+            IVR_WARN("new ivr num memory failed, ivrnum(%s)", iter->first.c_str());
+            return -1;
+        }
+	    std::pair<IterIvrNum, bool> ret = _ivrnum_call_data.insert(std::make_pair("default", p));
+        if (!ret.second) {
+            IVR_WARN("insert ivrnum falied, ivrnum(%s)", iter->first.c_str());
+            return -1;
+        }
+    }
+    // read cached data form file
+    _cached_file = path;
+    _cached_date = bgcc::TimeUtil::get_date();
+    if (get_data_from_file() != 0) {
+        IVR_WARN("get data from file falied");
+		reset();
+    }
+    IVR_NOTICE("ivr data collection has been initialize");
+    return 0;
+}
+
+int32_t IvrCallDataCollection::uninitialize()
+{
+    BGCC_LOCK(_m_locker);
+    // uninitialize real call info
+    for (IterCall iter = _realtime_call.begin(); iter != _realtime_call.end(); ++iter) {
+        if (iter->second != NULL) {
+            delete iter->second;
+            iter->second = NULL;
+        }
+        _realtime_call.erase(iter->first);
+    }
+    // uninitialize plat info
+    for (IterSkill iter = _plat_call_data.skill_call_data.begin()
+            ; iter != _plat_call_data.skill_call_data.end(); ++iter) {
+        if (iter->second != NULL) {
+            delete iter->second;
+            iter->second = NULL;
+        }
+        _plat_call_data.skill_call_data.erase(iter->first);
+    }
+    // uninitialize ivrnum info
+    for (IterIvrNum iter = _ivrnum_call_data.begin(); iter != _ivrnum_call_data.end(); ++iter) {
+        if (iter->second == NULL) {
+            _ivrnum_call_data.erase(iter->first);
+            continue;
+        }
+        for (IterSkill iterskill = iter->second->skill_call_data.begin()
+            ; iterskill != iter->second->skill_call_data.end(); ++iterskill) {
+            if (iterskill->second != NULL) {
+                delete iterskill->second;
+                iterskill->second = NULL;
+            }
+           iter->second->skill_call_data.erase(iterskill->first);
+        }
+        _ivrnum_call_data.erase(iter->first);
+    }
+    IVR_NOTICE("ivr data collection has been uninitialize");
+    return 0;
+}
+
+void IvrCallDataCollection::calldata_to_file_block_func()
+{
+    IVR_NOTICE("ivr data collection thread has start");
+    std::string cur_date;
+    const static int32_t sleep_time = 30;
+    while (!g_stopped) {
+        bgcc::TimeUtil::safe_sleep_s(sleep_time);
+        cur_date = bgcc::TimeUtil::get_date();
+        if (cur_date != _cached_date) {
+            reset();
+            clear_invaid_call();
+            _cached_date = cur_date;
+            IVR_DEBUG("not this day, clear date, cachedate(%s), curdate(%s)", 
+                        _cached_date.c_str(), cur_date.c_str());
+        }
+        put_data_to_file();
+    }
+}
+
+int32_t IvrCallDataCollection::new_inbound_call(const std::string& caller, const std::string& called
+                , const std::string& uuid)
+{
+    IVR_DEBUG("one new inbound call, caller(%s), called(%s), uuid(%s)"
+                , caller.c_str(), called.c_str(), uuid.c_str());
+    BGCC_LOCK(_m_locker);
+	std::pair<IterStr, bool> ret = _refuse_call.insert(uuid);
+    if (!ret.second) {
+        IVR_WARN("insert inbound call falied, caller(%s), called(%s), uuid(%s)"
+                , caller.c_str(), called.c_str(), uuid.c_str());
+        return -1;
+    }
+
+    ++_plat_call_data.cur_inbound_num;
+    ++_plat_call_data.total_inbound_num;
+    IterIvrNum iter = _ivrnum_call_data.find(called);
+    if (iter == _ivrnum_call_data.end()) {
+        iter = _ivrnum_call_data.find("default");
+    }
+    if (iter == _ivrnum_call_data.end()) {
+        IVR_WARN("called is not in ivr num, caller(%s), called(%s)", caller.c_str(), called.c_str());
+        return 0;
+    }
+    if (iter->second == NULL) {
+        IVR_WARN("ivr num struct is NULL, caller(%s), called(%s)", caller.c_str(), called.c_str());
+        return 0;
+    }
+    ++iter->second->cur_inbound_num;
+    ++iter->second->total_inbound_num;
+    IVR_DEBUG("update ivr num info, caller(%s), called(%s), uuid(%s)"
+                , caller.c_str(), called.c_str(), uuid.c_str());
+    return 0;
+
+}
+
+int32_t IvrCallDataCollection::new_accept_call(const std::string& caller, const std::string& called
+                , const ivr_session_id_t& sessionId, const std::string& uuid /* call_id */)
+{
+    IVR_DEBUG("one new inbound call, caller(%s), called(%s), sessionid(%lu), uuid(%s)"
+                    , caller.c_str(), called.c_str(), sessionId, uuid.c_str());
+    struct IvrInboundCall *p = new (std::nothrow) struct IvrInboundCall;
+    if (p == NULL) {
+        IVR_WARN("new inbound call memory failed, caller(%s), called(%s)", caller.c_str(), called.c_str());
+        return -1;
+    }
+    BGCC_LOCK(_m_locker);
+    if (_refuse_call.find(uuid) == _refuse_call.end()) {
+        IVR_WARN("can,t find uuid, caller(%s), called(%s), uuid(%s)",
+                caller.c_str(), called.c_str(), uuid.c_str());
+        return -1;
+    }
+    // É¾³ýrefuseÖÐµÄuuid
+    _refuse_call.erase(uuid);
+    p->init_new_call(sessionId, uuid, caller, called);
+    p->set_state(IvrInboundCall::ACCEPT);
+    //set callid
+    //set caller
+    //set called
+    //set BEGIN
+    //insert map
+    std::pair<IterCall, bool> ret_call = _realtime_call.insert(std::make_pair(sessionId, p));
+    if (!ret_call.second) {
+        IVR_WARN("insert realtime call falied, caller(%s), called(%s)", caller.c_str(), called.c_str());
+        return -1;
+    }
+    std::pair<IterSession, bool> ret_uuid = _first_uuid_map.insert(std::make_pair(uuid, sessionId));
+    if (!ret_uuid.second) {
+        IVR_WARN("insert first uuid falied, caller(%s), called(%s)", caller.c_str(), called.c_str());
+        return -1;
+    }
+    ++_plat_call_data.cur_accept_num;
+    ++_plat_call_data.total_accept_num;
+    IterIvrNum iter = _ivrnum_call_data.find(called);
+    if (iter == _ivrnum_call_data.end()) {
+        iter = _ivrnum_call_data.find("default");
+    }
+    if (iter == _ivrnum_call_data.end()) {
+        IVR_WARN("called is not in ivr num, caller(%s), called(%s)", caller.c_str(), called.c_str());
+        return 0;
+    }
+    if (iter->second == NULL) {
+        IVR_WARN("ivr num struct is NULL, caller(%s), called(%s)", caller.c_str(), called.c_str());
+        return 0;
+    }
+    ++iter->second->cur_accept_num;
+    ++iter->second->total_accept_num;
+    IVR_DEBUG("update ivr num info, caller(%s), called(%s), sessionid(%lu), uuid(%s)"
+                , caller.c_str(), called.c_str(), sessionId, uuid.c_str());
+    return 0;
+}
+
+int32_t IvrCallDataCollection::set_appdata(
+        const ivr_session_id_t& sessionId, 
+        const std::string& appdata) {
+    IterCall iter = _realtime_call.find(sessionId);
+    if (iter == _realtime_call.end()) {
+        IVR_DEBUG("not found inbound call sessionid(%lu) in realtime call", sessionId);
+        iter = _exitflow_call.find(sessionId);
+		if (iter == _exitflow_call.end()) {
+            IVR_DEBUG("not found inbound call sessionid(%lu) in exitflow call", sessionId);
+            return -1;
+		}
+    }
+    iter->second->set_appdata(appdata);
+    return 0;
+}
+
+int32_t IvrCallDataCollection::set_state(const ivr_session_id_t& sessionId
+                , const int32_t state, const std::string& skill)
+{
+    IVR_DEBUG("set state sessionid(%lu), state(%d)", sessionId, state);
+    BGCC_LOCK(_m_locker);
+
+    IterCall iter = _exitflow_call.find(sessionId);
+	if (iter == _exitflow_call.end()) {
+        IVR_DEBUG("not found inbound call sessionid(%lu) in exitflow call", sessionId);
+	} else {
+        if (state != IvrInboundCall::EXITFLOW && state != IvrInboundCall::CALLWITHOUTFOLW) {
+            IVR_DEBUG("not exitflow state sessionid(%lu) ,continue", sessionId);
+            return 0;
+        }
+		iter->second->set_state(state);
+        if (iter->second != NULL) {
+            delete iter->second;
+            iter->second = NULL;
+        }
+        _exitflow_call.erase(sessionId);
+		return 0;
+	}
+
+    iter = _realtime_call.find(sessionId);
+    if (iter == _realtime_call.end()) {
+        IVR_DEBUG("not found inbound call sessionid(%lu) in realtime call", sessionId);
+		return -1;
+    }
+    std::string called = iter->second->get_called();
+    switch (state) {
+        case IvrInboundCall::BEGIN:
+        case IvrInboundCall::ACCEPT:
+        case IvrInboundCall::INFLOW:
+        case IvrInboundCall::ROUTEBYAGENTID:
+        case IvrInboundCall::ROUTEBYAGENTLIST: {
+            iter->second->set_state(state);
+            break;
+        }
+        case IvrInboundCall::ROUTEBYSKILL: {
+            iter->second->set_state(state);
+            iter->second->set_skill(skill);
+            break;    
+        }
+        case IvrInboundCall::TRANSAGENT: {
+            ++_plat_call_data.trans_num;
+            IterIvrNum iter_ivrnum = _ivrnum_call_data.find(called);
+            if (iter_ivrnum != _ivrnum_call_data.end() && iter_ivrnum->second != NULL) {
+                ++iter_ivrnum->second->trans_num;
+            }
+            iter->second->set_state(state);
+            break;
+        }
+        case IvrInboundCall::EXITFLOW: {
+            if (iter->second->get_state() == IvrInboundCall::TRANSAGENT) {
+                iter->second->set_state(IvrInboundCall::CALLWITHOUTFOLW);
+            }
+            else {
+                iter->second->set_state(state);
+            }
+            break;
+        }
+        default:
+            IVR_WARN("unknow state, state(%d)", state);
+            break;
+    }
+    return 0;
+}
+
+int32_t IvrCallDataCollection::is_giveup_call(IvrInboundCall *call
+                , const uint64_t sessionid, const std::string& called)
+{
+    if (call == NULL) {
+        IVR_WARN("call is null");
+        return -1;
+    }
+    if (call->get_state() == IvrInboundCall::ROUTEBYSKILL) {
+        ++_plat_call_data.giveuptimes;
+        std::string call_skill = call->get_skill();
+        if (call_skill == "") {
+            IVR_WARN("skill is empty");
+            return -1; 
+        }
+        IterSkill iter_skill = _plat_call_data.skill_call_data.find(call_skill);
+        if (iter_skill == _plat_call_data.skill_call_data.end()) {
+            struct SkillCallData *p = new (std::nothrow) struct SkillCallData;
+            if (p == NULL){
+                IVR_WARN("new skill info memory failed, sessionid(%lu), skill(%s)"
+                                , sessionid, call_skill.c_str());
+                return -1;                        
+            }
+            ++p->giveuptimes;
+            std::pair<IterSkill, bool> ret = 
+                    _plat_call_data.skill_call_data.insert(std::make_pair(call_skill, p));
+            if (!ret.second) {
+                IVR_WARN("insert skill failed, sessionid(%lu), skill(%s)",
+                        sessionid, call_skill.c_str());
+                return -1;
+            }
+             
+        }
+        else {
+            if (iter_skill->second == NULL) {
+                IVR_WARN("skill struct is null, sessionid(%lu), skill(%s)"
+                                , sessionid, call_skill.c_str());
+                return -1; 
+            }
+            ++iter_skill->second->giveuptimes;
+        }
+        IterIvrNum iter_ivrnum = _ivrnum_call_data.find(called);
+        if (iter_ivrnum != _ivrnum_call_data.end() && iter_ivrnum->second != NULL) {
+            ++iter_ivrnum->second->giveuptimes;
+            iter_skill = iter_ivrnum->second->skill_call_data.find(call_skill);
+            if (iter_skill == iter_ivrnum->second->skill_call_data.end()) {
+                struct SkillCallData *p = new (std::nothrow) struct SkillCallData;
+                if (p == NULL){
+                    IVR_WARN("new skill info memory failed, sessionid(%lu), skill(%s)"
+                    , sessionid, call_skill.c_str());
+                    return -1;                        
+                }
+                ++p->giveuptimes;
+                std::pair<IterSkill, bool> ret = 
+                        iter_ivrnum->second->skill_call_data.insert(std::make_pair(call_skill, p));
+                if (!ret.second) {
+                    IVR_WARN("insert skill failed, sessionid(%lu), skill(%s)",
+                            sessionid, call_skill.c_str());
+                    return -1;
+                }
+            }
+            else {
+                 if (iter_skill->second == NULL) {
+                     IVR_WARN("skill struct is null, sessionid(%lu), skill(%s)"
+                      , sessionid, call_skill.c_str());
+                     return -1; 
+                 }
+                 ++iter_skill->second->giveuptimes;
+            }
+        }
+    }
+    return 0;
+}
+
+int32_t IvrCallDataCollection::process_event(ivr_base_event_t* event)
+{
+    ivr_session_id_t ivrsid = event->sessionId;
+    if (event->evt_type != ivr_base_event_t::IMS_EVENT) {
+        return -1;
+    }
+    ivr_ims_event_t *evt = (struct ivr_ims_event_t*)event;
+    struct IvrInboundCall *cur_call = NULL;
+    BGCC_LOCK(_m_locker);
+    FIND_CALL(ivrsid, cur_call);
+    cur_call->set_state(IvrInboundCall::INFLOW);    
+    if (evt->evt_name == ivr_ims_event_t::IVR_EVT_IMS_ROUTE_RESPONSE && 
+        evt->data.requestType == ims_routerequest_type_t::RR_TypeSkill) {
+        cur_call->update_route_skill_endtime(evt->data.requestArgs);
+    }
+    return 0;    
+}
+
+int32_t IvrCallDataCollection::process_event(struct fs_event& event)
+{
+    std::string uuid = event.event_data.normal.uuid;
+    uint64_t sessionid = event.sessionid;
+    /*IVR_DEBUG("process event, name(%s), caller(%s), called(%s), sessionid(%lu), callid(%s)"
+            , event.name
+            , event.event_data.normal.caller_no
+            , event.event_data.normal.called_no
+            , sessionid, uuid.c_str());*/
+    struct IvrInboundCall *cur_call = NULL;
+    if (strcasecmp(event.name, "CHANNEL_ANSWER") == 0) {
+        std::map<std::string, ivr_session_id_t>::iterator iter;
+        if ((iter = _second_uuid_map.find(uuid)) != _second_uuid_map.end()) {
+            // agent answer
+            sessionid = iter->second;
+            BGCC_LOCK(_m_locker);
+            FIND_CALL(sessionid, cur_call);
+            cur_call->set_state(IvrInboundCall::AGENTANSWER);
+            IVR_DEBUG("set call to state(%d), sessionid(%lu)", IvrInboundCall::CUSTOMERANSWER, sessionid);
+        }
+        else if ((iter = _first_uuid_map.find(uuid)) != _first_uuid_map.end()) {
+            // customer answer
+            sessionid = iter->second;
+            BGCC_LOCK(_m_locker);
+            FIND_CALL(sessionid, cur_call);
+            cur_call->set_state(IvrInboundCall::CUSTOMERANSWER);
+            IVR_DEBUG("set call to state(%d), sessionid(%lu)", IvrInboundCall::AGENTANSWER, sessionid);
+        }
+    }
+    else if (0 == strcasecmp(event.name, "CHANNEL_PROGRESS_MEDIA") ||
+                0 == strcasecmp(event.name, "CHANNEL_PROGRESS")) {
+        // agent alerting
+        std::map<std::string, ivr_session_id_t>::iterator iter;
+        if ((iter = _second_uuid_map.find(uuid)) != _second_uuid_map.end()) {
+            sessionid = iter->second;
+            BGCC_LOCK(_m_locker);
+            FIND_CALL(sessionid, cur_call);
+            cur_call->set_state(IvrInboundCall::AGENTALERTING);
+            IVR_DEBUG("set call to state(%d), sessionid(%lu)", IvrInboundCall::AGENTALERTING, sessionid);
+        }
+    }
+    else if (0 == strcasecmp(event.name, "CHANNEL_ORIGINATE")) {
+        BGCC_LOCK(_m_locker);
+        FIND_CALL(sessionid, cur_call);
+        _second_uuid_map[uuid] = sessionid;
+        cur_call->set_agent_num(event.event_data.normal.called_no);
+        IVR_DEBUG("add second leg, sessionid(%lu)", sessionid);
+    }
+    else if (0 == strcasecmp(event.name, "CHANNEL_BRIDGE")) {
+        std::map<std::string, ivr_session_id_t>::iterator iter = _second_uuid_map.find(uuid);
+        if (iter == _second_uuid_map.end()) {
+            IVR_WARN("not found session");
+            return 0;
+        }
+        sessionid = iter->second;
+        BGCC_LOCK(_m_locker);
+        FIND_CALL(sessionid, cur_call);
+        cur_call->set_state(IvrInboundCall::CONNECTED);
+        IVR_DEBUG("set call to state(%d), sessionid(%lu)", IvrInboundCall::CONNECTED, sessionid);
+    }
+    else if (0 == strcasecmp(event.name, "CHANNEL_HANGUP")) {
+        //save file  zzy
+        std::string other_uuid = event.event_data.normal.other_uuid;
+        std::string caller = event.event_data.normal.caller_no;
+        std::string called = event.event_data.normal.called_no;
+        std::string other_called = event.event_data.normal.other_called_no;
+        BGCC_LOCK(_m_locker);
+        // first refuse call
+        if (_refuse_call.find(uuid) != _refuse_call.end()) {
+            _refuse_call.erase(uuid);
+            if (_plat_call_data.cur_inbound_num > 0) {
+                --_plat_call_data.cur_inbound_num;
+            }
+            IterIvrNum iter_ivrnum = _ivrnum_call_data.find(called);
+            if (iter_ivrnum != _ivrnum_call_data.end() && iter_ivrnum->second != NULL) {
+                if (iter_ivrnum->second->cur_inbound_num > 0) {
+                    --iter_ivrnum->second->cur_inbound_num;
+                }
+            }
+            IVR_NOTICE("one refuse call hangup,caller(%s), called(%s)", caller.c_str(), called.c_str());
+        }
+        // accept call
+        std::map<std::string, ivr_session_id_t>::iterator iter;
+        if ((iter = _first_uuid_map.find(uuid)) != _first_uuid_map.end()) {
+            // customer hangup
+            sessionid = iter->second;
+            FIND_CALL(sessionid, cur_call);
+            is_giveup_call(cur_call, sessionid, called);
+            cur_call->set_state(IvrInboundCall::THISPARTYHANGUP);
+            if (_plat_call_data.cur_accept_num > 0) {
+                --_plat_call_data.cur_accept_num;
+            }
+            if (_plat_call_data.cur_inbound_num > 0) {
+                --_plat_call_data.cur_inbound_num;
+            }
+            IterIvrNum iter_ivrnum = _ivrnum_call_data.find(called);
+            if (iter_ivrnum != _ivrnum_call_data.end() && iter_ivrnum->second != NULL) {
+                if (iter_ivrnum->second->cur_accept_num > 0) {
+                    --iter_ivrnum->second->cur_accept_num;
+                }
+                if (iter_ivrnum->second->cur_inbound_num > 0) {
+                    --iter_ivrnum->second->cur_inbound_num;
+                }
+            }
+            if (!cur_call->get_exit_flow()) {
+                std::pair<IterCall, bool> ret_call = _exitflow_call.insert(std::make_pair(sessionid, cur_call));
+                if (!ret_call.second) {
+                    IVR_WARN("insert realtime call falied, caller(%s), called(%s)", caller.c_str(), called.c_str());
+                    return -1;
+                }
+            } else {
+                if (cur_call != NULL) {
+                    delete cur_call;
+                    cur_call = NULL;
+                }
+            }
+            _realtime_call.erase(sessionid);
+            _first_uuid_map.erase(uuid);
+            _second_uuid_map.erase(other_uuid);
+            IVR_DEBUG("set call to state(%d), sessionid(%lu)", IvrInboundCall::THISPARTYHANGUP, sessionid);
+        }
+        else if ((iter = _second_uuid_map.find(uuid)) != _second_uuid_map.end()) {
+            // agent hangup
+            sessionid = iter->second;
+            FIND_CALL(sessionid, cur_call);
+            cur_call->set_state(IvrInboundCall::OTHERPARTYHANGUP);
+            if (_plat_call_data.cur_accept_num > 0) {
+                --_plat_call_data.cur_accept_num;
+            }
+            if (_plat_call_data.cur_inbound_num > 0) {
+                --_plat_call_data.cur_inbound_num;
+            }
+            IterIvrNum iter_ivrnum = _ivrnum_call_data.find(other_called);
+            if (iter_ivrnum != _ivrnum_call_data.end() && iter_ivrnum->second != NULL) {
+                if (iter_ivrnum->second->cur_accept_num > 0) {
+                    --iter_ivrnum->second->cur_accept_num;
+                }
+                if (iter_ivrnum->second->cur_inbound_num > 0) {
+                    --iter_ivrnum->second->cur_inbound_num;
+                }
+            }
+            if (!cur_call->get_exit_flow()) {
+                std::pair<IterCall, bool> ret_call = _exitflow_call.insert(std::make_pair(sessionid, cur_call));
+                if (!ret_call.second) {
+                    IVR_WARN("insert realtime call falied, caller(%s), called(%s)", caller.c_str(), called.c_str());
+                    return -1;
+                }
+            } else {
+                if (cur_call != NULL) {
+                    delete cur_call;
+                    cur_call = NULL;
+                }
+            }
+            _realtime_call.erase(sessionid);
+            _second_uuid_map.erase(uuid);
+            _first_uuid_map.erase(other_uuid);
+            IVR_DEBUG("set call to state(%d), sessionid(%lu)", IvrInboundCall::OTHERPARTYHANGUP, sessionid);
+        }
+        //clear data        
+    }
+    /*IVR_DEBUG("process event end, name(%s), caller(%s), called(%s), sessionid(%lu), callid(%s), curcalnum(%d)"
+            , event.name
+            , event.event_data.normal.caller_no
+            , event.event_data.normal.called_no
+            , sessionid, uuid.c_str(), (int32_t)_realtime_call.size());*/
+    return 0;
+}
+
+int32_t IvrCallDataCollection::get_call_data(struct IvrCallData* p, std::string& result)
+{
+    std::string fail_str = "{\"result\":\"-1\",\"data\":\"memory error\"}";
+    if (p == NULL) {
+        IVR_WARN("calldata is NULL");
+        result = fail_str;
+        return -1;
+    }
+    json_object *root = json_object_new_object();
+    if (root == NULL) {
+        IVR_WARN("new root json object failed");
+        result = fail_str;
+        return -1;
+    }
+    json_object *calldata = json_object_new_object();
+    if (calldata == NULL) {
+        IVR_WARN("new calldata json object failed");
+        result = fail_str;
+        json_object_put(root);
+        return -1;
+    }
+    json_object *platdata = json_object_new_object();
+    if (calldata == NULL) {
+        IVR_WARN("new platdata json object failed");
+        result = fail_str;
+        json_object_put(root);
+        json_object_put(calldata);
+        return -1;
+    }
+    json_object *skilldata = json_object_new_array();
+    if (skilldata == NULL) {
+        IVR_WARN("new skilldata json object failed");
+        result = fail_str;
+        json_object_put(root);
+        json_object_put(calldata);
+        json_object_put(platdata);
+        return -1;
+    }
+    json_object_object_add(platdata, "CurInboundNum", json_object_new_int(p->cur_inbound_num));
+    json_object_object_add(platdata, "CurAcceptNum", json_object_new_int(p->cur_accept_num));
+    json_object_object_add(platdata, "TotalInboundNum", json_object_new_int(p->total_inbound_num));
+    json_object_object_add(platdata, "TotalAcceptNum", json_object_new_int(p->total_accept_num));
+    json_object_object_add(platdata, "GiveupNum", json_object_new_int(p->giveuptimes));
+    json_object_object_add(platdata, "TransNum", json_object_new_int(p->trans_num));
+    for (IterSkill iter = p->skill_call_data.begin()
+            ; iter != p->skill_call_data.end(); ++iter) {
+        if (iter->second != NULL) {
+            json_object *skillinfo = json_object_new_object();
+            if (skillinfo == NULL) {
+                IVR_WARN("new skilinfo json object failed, skill(%s)", iter->first.c_str());
+                continue;
+            }
+            json_object_object_add(skillinfo, "skillname", json_object_new_string(iter->first.c_str()));
+            json_object_object_add(skillinfo, "GiveupNum", json_object_new_int(iter->second->giveuptimes));
+            json_object_array_add(skilldata, skillinfo);
+        }
+    }
+    json_object_object_add(calldata, "platinfo", platdata);
+    json_object_object_add(calldata, "skillinfo", skilldata);
+    json_object_object_add(root, "result", json_object_new_string("0"));
+    json_object_object_add(root, "data", calldata);
+    result = json_object_to_json_string(root);
+    IVR_DEBUG("get call data by plat success, data(%s)", result.c_str());
+    //IVR_DEBUG("get call data by plat success");
+    json_object_put(root);
+    return 0;
+}
+
+int32_t IvrCallDataCollection::get_inbound_by_plat(std::string& result)
+{
+    IVR_DEBUG("get inbound info by plat");
+    std::string fail_str = "{\"result\":\"-1\",\"data\":\"lock failed\"}";
+    BGCC_LOCK(_m_locker);
+    return get_call_data(&_plat_call_data, result);
+}
+
+int32_t IvrCallDataCollection::get_inbound_by_ivrnum(const std::string& ivrnum, std::string& result)
+{
+    IVR_DEBUG("get inbound info by ivrnum, ivrnum(%s)", ivrnum.c_str());
+    std::string fail_str = "{\"result\":\"-1\",\"data\":\"lock failed\"}";
+    BGCC_LOCK(_m_locker);
+    fail_str = "{\"result\":\"-1\",\"data\":\"not find ivrnum\"}";
+    IterIvrNum iter = _ivrnum_call_data.find(ivrnum);
+    if (iter == _ivrnum_call_data.end()) {
+        IVR_WARN("not find ivr num, ivrnum(%s)", ivrnum.c_str());
+        result = fail_str;
+        return -1;
+    }
+    return get_call_data(iter->second, result);
+}
+
+int32_t IvrCallDataCollection::get_inbound_call_data(const int32_t type
+                       , const std::string& input, std::string& result)
+{
+    if (type == GETBYPLAT) {
+        return get_inbound_by_plat(result);
+    }
+    else if (type == GETBYIVRNUM) {
+        return get_inbound_by_ivrnum(input, result);
+    }
+    return -1;
+}
+
+int32_t IvrCallDataCollection::get_data_from_file()
+{
+    reset();
+    std::string filename = _cached_file;
+    bgcc2::ConfUnit root;
+    if(!bgcc2::ConfLoader::load_conf(filename.c_str(), root)) {
+        IVR_WARN("open cached file failed ,path(%s)", filename.c_str());
+        return -1;
+    }
+    IVR_NOTICE("begin load =========================================");
+    // load date
+    bgcc2::ConfUnit& section = root["Date"];
+    if(section.is_null()) {
+        IVR_WARN("not find date section");
+        return -1;
+    }
+    bgcc2::ConfUnit& date = section["date"];
+    CHECK_CONF(date, bgcc::ConfUnit::UT_STRING);
+    string cacheddate = date.to_string();
+    IVR_NOTICE("|Cached Date  | %s", cacheddate.c_str());
+
+    // check is today?
+    std::string curdate = bgcc::TimeUtil::get_date();
+    if (curdate != cacheddate) {
+        IVR_WARN("data is not this day, cacheddate(%s), curdate(%s)", cacheddate.c_str(), curdate.c_str());
+        return -1;
+    }
+
+    //load plat info
+    bgcc2::ConfUnit& section_plat = root["PlatInfo"];
+    if(section.is_null()) {
+        IVR_WARN("not find platinfo section");
+        return -1;
+    }
+    bgcc2::ConfUnit& total_inbound_num = section_plat["TotalInboundNum"];
+    bgcc2::ConfUnit& trans_num = section_plat["TransNum"];
+    bgcc2::ConfUnit& total_accept_num = section_plat["TotalAcceptNum"];
+    bgcc2::ConfUnit& giveuptimes = section_plat["GiveupTimes"];
+    bgcc2::ConfUnit& skill_info = section_plat["SkillInfo"];
+    CHECK_CONF(total_inbound_num, bgcc::ConfUnit::UT_STRING);
+    CHECK_CONF(trans_num, bgcc::ConfUnit::UT_STRING);
+    CHECK_CONF(total_accept_num, bgcc::ConfUnit::UT_STRING);
+    CHECK_CONF(giveuptimes, bgcc::ConfUnit::UT_STRING);
+    CHECK_CONF(skill_info, bgcc::ConfUnit::UT_STRING);
+    if (!bgcc::StringUtil::str2uint32(total_inbound_num.to_string().c_str(), _plat_call_data.total_inbound_num)) {
+        IVR_WARN("parse total_inbound_num(%s) failed", total_inbound_num.to_string().c_str());
+        return -1;
+    }
+    if (!bgcc::StringUtil::str2uint32(trans_num.to_string().c_str(), _plat_call_data.trans_num)) {
+        IVR_WARN("parse trans_num(%s) failed", trans_num.to_string().c_str());
+        return -1;
+    }
+    if (!bgcc::StringUtil::str2uint32(total_accept_num.to_string().c_str(), _plat_call_data.total_accept_num)) {
+        IVR_WARN("parse total_accept_num(%s) failed", total_accept_num.to_string().c_str());
+        return -1;
+    }
+    if (!bgcc::StringUtil::str2uint32(giveuptimes.to_string().c_str(), _plat_call_data.giveuptimes)) {
+        IVR_WARN("parse giveuptimes(%s) failed", giveuptimes.to_string().c_str());
+        return -1;
+    }
+
+    IVR_NOTICE("|TotalInboundNum  | %d", _plat_call_data.total_inbound_num);
+    IVR_NOTICE("|TransNum  | %d", _plat_call_data.trans_num);
+    IVR_NOTICE("|TotalAcceptNum  | %d", _plat_call_data.total_accept_num);
+    IVR_NOTICE("|GiveupTimes  | %d", _plat_call_data.giveuptimes);
+
+    std::vector<std::string> vecp;
+    bgcc::StringUtil::split_string(skill_info.to_string(), ",", vecp, true);
+    for (std::vector<std::string>::iterator iter = vecp.begin(); iter != vecp.end(); ++iter) {
+        size_t pos_equal = iter->find(':');
+        if (pos_equal == std::string::npos){
+            IVR_WARN("not find : string(%s)", iter->c_str());
+            continue;
+        }
+        std::string key = iter->substr(0, pos_equal);
+        std::string var = iter->substr(pos_equal + 1);
+        struct SkillCallData *p = new(std::nothrow) struct SkillCallData;
+        if (p == NULL) {
+            IVR_WARN("new skill info failed, skill(%s)", key.c_str());
+            return -1;
+        }
+        bgcc::StringUtil::str2uint32(var.c_str(), p->giveuptimes);
+        std::pair<IterSkill, bool> ret = _plat_call_data.skill_call_data.insert(std::make_pair(key, p));
+        if (!ret.second) {
+            IVR_WARN("insert skill failed, skill(%s)", key.c_str());
+            return -1;
+        }
+        IVR_NOTICE("|SkillName(%s)  | GiveupTimes(%d)", key.c_str(), p->giveuptimes);
+    }
+
+    //load ivr num info
+    bgcc2::ConfUnit& section_ivrnum = root["IvrNumInfo"];
+    if(section.is_null()) {
+        IVR_WARN("not find platinfo section");
+        return -1;
+    }
+    for(bgcc2::ConfUnit::const_iterator iter = section_ivrnum.begin()
+            ; iter != section_ivrnum.end(); ++iter) {
+        bgcc2::ConfUnit& ivrnum = **iter;
+        bgcc2::ConfUnit& name = ivrnum["IvrNum"];
+        bgcc2::ConfUnit& total_inbound_num_ivrnum = ivrnum["TotalInboundNum"];
+        bgcc2::ConfUnit& trans_num_ivrnum = ivrnum["TransNum"];
+        bgcc2::ConfUnit& total_accept_num_ivrnum = ivrnum["TotalAcceptNum"];
+        bgcc2::ConfUnit& giveuptimes_ivrnum = ivrnum["GiveupTimes"];
+        bgcc2::ConfUnit& skill_info_ivrnum = ivrnum["SkillInfo"];
+        CHECK_CONF(name, bgcc::ConfUnit::UT_STRING);
+        CHECK_CONF(total_inbound_num_ivrnum, bgcc::ConfUnit::UT_STRING);
+        CHECK_CONF(trans_num_ivrnum, bgcc::ConfUnit::UT_STRING);
+        CHECK_CONF(total_accept_num_ivrnum, bgcc::ConfUnit::UT_STRING);
+        CHECK_CONF(giveuptimes_ivrnum, bgcc::ConfUnit::UT_STRING);
+        CHECK_CONF(skill_info_ivrnum, bgcc::ConfUnit::UT_STRING);
+        IterIvrNum it = _ivrnum_call_data.find(name.to_string());
+        if (it == _ivrnum_call_data.end()) {
+            // Èç¹û²»ÊÇÊ¹ÓÃÖÐµÄivr½ÓÈëÂë£¬Ôò²»¶ÁÈ¡
+            IVR_WARN("ivr num is not use, ivrnum(%s)", name.to_string().c_str());
+			continue;
+        }
+        if (!bgcc::StringUtil::str2uint32(total_inbound_num_ivrnum.to_string().c_str(), it->second->total_inbound_num)) {
+            IVR_WARN("parse total_inbound_num(%s) failed", total_inbound_num_ivrnum.to_string().c_str());
+            return -1;
+        }
+        if (!bgcc::StringUtil::str2uint32(trans_num_ivrnum.to_string().c_str(), it->second->trans_num)) {
+            IVR_WARN("parse trans_num(%s) failed", trans_num_ivrnum.to_string().c_str());
+            return -1;
+        }
+        if (!bgcc::StringUtil::str2uint32(total_accept_num_ivrnum.to_string().c_str(), it->second->total_accept_num)) {
+            IVR_WARN("parse total_accept_num(%s) failed", total_accept_num_ivrnum.to_string().c_str());
+            return -1;
+        }
+        if (!bgcc::StringUtil::str2uint32(giveuptimes_ivrnum.to_string().c_str(), it->second->giveuptimes)) {
+            IVR_WARN("parse giveuptimes(%s) failed", giveuptimes_ivrnum.to_string().c_str());
+            return -1;
+        }
+        IVR_NOTICE("|IvrNum  | %s", name.to_string().c_str());
+        IVR_NOTICE("    |TotalInboundNum  | %d", it->second->total_inbound_num);
+        IVR_NOTICE("    |TransNum  | %d", it->second->trans_num);
+        IVR_NOTICE("    |TotalAcceptNum  | %d", it->second->total_accept_num);
+        IVR_NOTICE("    |GiveupTimes  | %d", it->second->giveuptimes);
+        std::vector<std::string> vecp;
+        bgcc::StringUtil::split_string(skill_info_ivrnum.to_string(), ",", vecp, true);
+        for (std::vector<std::string>::iterator iter_v = vecp.begin(); iter_v != vecp.end(); ++iter_v) {
+            size_t pos_equal = iter_v->find(':');
+            if (pos_equal == std::string::npos){
+                IVR_WARN("not find : string(%s)", iter_v->c_str());
+                continue;
+            }
+            std::string key = iter_v->substr(0, pos_equal);
+            std::string var = iter_v->substr(pos_equal + 1);
+            struct SkillCallData *p = new(std::nothrow) struct SkillCallData;
+            if (p == NULL) {
+                IVR_WARN("new ivrnum skill info failed, ivrnum(%s), skill(%s)"
+                    , name.to_string().c_str(), key.c_str());
+                return -1;
+            }
+            bgcc::StringUtil::str2uint32(var.c_str(), p->giveuptimes);
+            std::pair<IterSkill, bool> ret = it->second->skill_call_data.insert(std::make_pair(key, p));
+            if (!ret.second) {
+                IVR_WARN("insert skill failed, skill(%s)", key.c_str());
+                return -1;
+            }
+            IVR_NOTICE("    |SkillName(%s)  | GiveupTimes(%d)", key.c_str(), p->giveuptimes);
+        }
+    }
+
+    IVR_NOTICE("begin end =========================================");   
+    return 0;
+}
+
+int32_t IvrCallDataCollection::put_data_to_file()
+{
+    std::ofstream out(_cached_file.c_str(), std::ios::out);
+    if (!out.is_open()){
+        IVR_WARN("open cached file failed ,path(%s)", _cached_file.c_str());
+        return -1;
+    }
+    // put date
+    string curdate = bgcc::TimeUtil::get_date();
+    out << "[Date]" << "\n";
+    out << "date = " << curdate << "\n";
+
+    //put plat info
+    out << "[PlatInfo]" << "\n"; 
+    out << "TotalInboundNum = " << _plat_call_data.total_inbound_num << "\n";
+    out << "TransNum = " << _plat_call_data.trans_num << "\n";
+    out << "TotalAcceptNum = " << _plat_call_data.total_accept_num << "\n";
+    out << "GiveupTimes = " << _plat_call_data.giveuptimes << "\n";
+    out << "SkillInfo = "; 
+    for (IterSkill iter = _plat_call_data.skill_call_data.begin()
+            ; iter != _plat_call_data.skill_call_data.end(); ++iter) {
+        if (iter->second != NULL) {
+            if (iter == _plat_call_data.skill_call_data.begin()) {
+                out << iter->first << ":" << iter->second->giveuptimes;
+            }
+            else {
+                out << "," << iter->first << ":" << iter->second->giveuptimes;
+            }
+        }
+    }
+    out << "\n";
+
+    // put ivrnum info
+    for (IterIvrNum iter_ivrnum = _ivrnum_call_data.begin()
+            ; iter_ivrnum != _ivrnum_call_data.end(); ++iter_ivrnum) {
+        if (iter_ivrnum->second == NULL) {
+            IVR_WARN("calldata is NULL while put ivrnum info to file, ivrnum(%s)", iter_ivrnum->first.c_str());
+            continue;
+        }
+        out << "[@IvrNumInfo]" << "\n"; 
+        out << "IvrNum = " << iter_ivrnum->first << "\n";
+        out << "TotalInboundNum = " << iter_ivrnum->second->total_inbound_num << "\n";
+        out << "TransNum = " << iter_ivrnum->second->trans_num << "\n";
+        out << "TotalAcceptNum = " << iter_ivrnum->second->total_accept_num << "\n";
+        out << "GiveupTimes = " << iter_ivrnum->second->giveuptimes << "\n";
+        out << "SkillInfo = "; 
+        for (IterSkill iter = iter_ivrnum->second->skill_call_data.begin()
+                ; iter != iter_ivrnum->second->skill_call_data.end(); ++iter) {
+            if (iter->second != NULL) {
+                if (iter == iter_ivrnum->second->skill_call_data.begin()) {
+                    out << iter->first << ":" << iter->second->giveuptimes;
+                }
+                else {
+                    out << "," << iter->first << ":" << iter->second->giveuptimes;
+                }
+            }
+        }
+        out << "\n";
+    }
+    return 0;
+}
+
+void IvrCallDataCollection::clear_invaid_call()
+{
+    IVR_NOTICE("clear invaid call");
+    locker_t w_lock(&_m_locker);    
+    if (!w_lock.is_locked()) {
+        IVR_WARN("w_lock failed!");
+        return;
+    }
+    // clear refuse call
+    _plat_call_data.cur_inbound_num = _realtime_call.size();
+    _refuse_call.clear();
+    _plat_call_data.cur_accept_num = _plat_call_data.cur_inbound_num;
+    const static time_t interval = 6 * 60 * 30;
+    time_t cur_time = time(NULL);
+    for (IterCall iter = _realtime_call.begin(); iter != _realtime_call.end(); ++iter) {
+        if (iter->second == NULL) {
+            IVR_NOTICE("clear one invaid call, sessionid(%lu)", iter->first);
+            _realtime_call.erase(iter->first);
+            continue;
+        }
+        if (cur_time - iter->second->get_begintime() > interval) {
+            IVR_NOTICE("clear one invaid call, sessionid(%lu)", iter->first);
+            std::string called = iter->second->get_called();
+            IterIvrNum iter_ivrnum = _ivrnum_call_data.find(called);
+            if (iter_ivrnum != _ivrnum_call_data.end() && iter_ivrnum->second != NULL) {
+                if (iter_ivrnum->second->cur_accept_num > 0) {
+                    --iter_ivrnum->second->cur_accept_num;
+                }
+                if (iter_ivrnum->second->cur_inbound_num) {
+                    --iter_ivrnum->second->cur_inbound_num;
+                }
+            }
+            // clear first uuid_sessiond
+            std::map<std::string, ivr_session_id_t>::iterator iter_uuid;
+            for (iter_uuid = _first_uuid_map.begin(); iter_uuid != _first_uuid_map.end(); ++iter_uuid) {
+                if (iter_uuid->second == iter->first) {
+                    _first_uuid_map.erase(iter_uuid->first);
+                }
+            }
+            // clear second uuid_sessionid
+            for (iter_uuid = _second_uuid_map.begin(); iter_uuid != _second_uuid_map.end(); ++iter_uuid) {
+                if (iter_uuid->second == iter->first) {
+                    _second_uuid_map.erase(iter_uuid->first);
+                }
+            }
+            delete iter->second;
+            iter->second = NULL;
+            _realtime_call.erase(iter->first);
+            if (_plat_call_data.cur_accept_num > 0) { 
+                --_plat_call_data.cur_accept_num;
+            }
+            if (_plat_call_data.cur_inbound_num > 0) {
+                --_plat_call_data.cur_inbound_num;
+            }
+        }        
+    }
+}
+
+void IvrCallDataCollection::reset()
+{
+    locker_t w_lock(&_m_locker);    
+    if (!w_lock.is_locked()) {
+        IVR_WARN("w_lock failed!");
+        return;
+    }
+    // clear plat data
+    _plat_call_data.trans_num = 0;
+    _plat_call_data.total_inbound_num = 0;
+    _plat_call_data.total_accept_num = 0;
+    _plat_call_data.giveuptimes = 0;
+    IVR_NOTICE("clear plat info");
+    for (IterSkill iter = _plat_call_data.skill_call_data.begin()
+        ; iter !=  _plat_call_data.skill_call_data.end()
+        ; ++iter) {
+        if (iter->second != NULL) {
+            delete iter->second;
+            iter->second = NULL;
+        }
+        _plat_call_data.skill_call_data.erase(iter->first);
+        IVR_NOTICE("clear skill info, skill(%s)", iter->first.c_str());
+    }
+
+    // clear ivrnum data
+    for (IterIvrNum iter = _ivrnum_call_data.begin(); iter != _ivrnum_call_data.end(); ++iter) {
+        if (iter->second == NULL) {
+            IVR_WARN("ivrnum info is NULL, ivrnum(%s)", iter->first.c_str());
+            if (g_inbound_conf.dnis_script_map.find(iter->first) 
+                    != g_inbound_conf.dnis_script_map.end()) {
+                struct IvrCallData *p = new (std::nothrow) struct IvrCallData;
+                if (p == NULL) {
+                    IVR_WARN("new ivrnum struct failed, ivrnum(%s)", iter->first.c_str());
+                    _ivrnum_call_data.erase(iter->first);
+                   continue;
+                }
+                _ivrnum_call_data[iter->first] = p;
+            }
+            else {
+                _ivrnum_call_data.erase(iter->first);
+            }
+           continue;
+        }
+        iter->second->trans_num = 0;
+        iter->second->total_inbound_num = 0;
+        iter->second->total_accept_num = 0;
+        iter->second->giveuptimes = 0;
+        IVR_NOTICE("clear ivrnum plat info, ivrnum(%s)", iter->first.c_str()); 
+        for (IterSkill iterskill = iter->second->skill_call_data.begin()
+        ; iterskill !=  iter->second->skill_call_data.end()
+        ; ++iterskill) {
+        if (iterskill->second != NULL) {
+            delete iterskill->second;
+            iterskill->second = NULL;
+        }
+        iter->second->skill_call_data.erase(iterskill->first);
+        IVR_NOTICE("clear ivrnum skill info, ivrnum(%s), skill(%s)", 
+                    iter->first.c_str(), iterskill->first.c_str());
+        }
+    }
+}
+
+};
diff --git a/platform/ivr/src/ivr_server.cpp b/platform/ivr/src/ivr_server.cpp
index 9a23739..4950c13 100644
--- a/platform/ivr/src/ivr_server.cpp
+++ b/platform/ivr/src/ivr_server.cpp
@@ -14,6 +14,9 @@
  * limitations under the License.
  */
 
+
+#include <getopt.h>
+
 #include "lock.h"
 #include "common.h"
 #include "ini_file.h"
@@ -29,13 +32,16 @@
 
 #include "ivr_timer.h"
 #include "ivrapi.h"
+#include "ivr_data_collection.h"
+
+#include "ivr_callinfo.h"
 
-#include <getopt.h>
 
 #ifndef SCMPF_MODULE_VERSION
 #define SCMPF_MODULE_VERSION "undefined"
 #endif
 
+using ivr::IvrCallDataCollection;
 static const char* cut_path(const char* in) {
     const char* p, *ret = in;
     char delims[] = "/\\";
@@ -186,6 +192,11 @@ void* calc_cpu_occupy_thread_func(void* arg) {
     return NULL;
 }
 
+void* calldata_collection_thread_func(void* arg) {
+    IvrCallDataCollection::instance().calldata_to_file_block_func();
+    return NULL;
+}
+
 //Êä³öÔËÐÐÊ±ÐÅÏ¢ Ïß³Ìº¯Êý
 void* disp_runinfo_thread_func(void* arg) {
     CpuManager* cpu_manager = CpuManager::get_instance();
@@ -260,8 +271,7 @@ void sig_handler(int32_t signum) {
         }
 
         ivr_tools_t::safe_sleeps(1);
-        sem_lock_t sem_lock(g_stop_sem);
-        //        sem_post(&g_stop_sem);
+        sem_lock_t sem_lock(&g_stop_sem);
         sem_lock.post();
     }
 }
@@ -272,18 +282,16 @@ bool init_log() {
     bgcc::log_open(bgcclogpath.c_str());
     IVR_TRACE("bgcc::log_open success!");
 
-    /* int32_t ret = com_loadlog(LOG_PATH, "log.conf");
-     if (ret != 0) {
-         IVR_FATAL("com_openlog() = %d \n", ret);
-         return false;
-     }
-     else {
-         IVR_TRACE("com_openlog() success");
-     }*/
-
     return true;
 }
 
+void *log_thread(void *) {
+    while (true) {
+        bgcc::TimeUtil::safe_sleep_s(g_log_timeout);
+        ivr::IvrCallInfo::_m_logger.SetTimeout();
+    }
+    return NULL;
+}
 
 extern std::auto_ptr<ConfManager> g_conf_manager;
 
@@ -354,6 +362,22 @@ int32_t main(int32_t argc, char* argv[]) {
         return FAILURE;
     }
 
+    //modified by zzy
+    pthread_t tid = 0;
+    if (pthread_create(&tid, NULL, log_thread, NULL) != 0) {
+        IVR_FATAL("create logthread thread failure");
+        return FAILURE;
+    }
+
+    std::string filename = "calllog-" + g_server_ip;
+    ivr::IvrCallInfo::_m_logger.Initialize(
+            g_log_count, 
+            g_log_filecount, 
+            "log/calllog", 
+            filename.c_str(), 
+            "3", 
+            true);
+    
     pthread_t thread_h = 0;
 
     //Æô¶¯event socket¼àÌýÏß³Ì
@@ -381,6 +405,16 @@ int32_t main(int32_t argc, char* argv[]) {
         return FAILURE;
     }
 
+    //³õÊ¼»¯Êý¾Ý»º´æ£¬ Æô¶¯ÔËÐÐÊ±ºô½ÐÊý¾Ý»º´æÏß³Ì
+    if (IvrCallDataCollection::instance().initialize(DATA_CACHE_FILE) != 0) {
+        IVR_FATAL("init ivr call data collection failed");
+        return FAILURE;
+    }
+    if (pthread_create(&thread_h, NULL, calldata_collection_thread_func, NULL) != 0) {
+        IVR_FATAL("create ivr call data thread failed");
+        return FAILURE;
+    }
+
     //ÍâºôÍ¨µÀµÄ¿ØÖÆ²ßÂÔ
     uint32_t num = g_autorun_conf.autorun_script_vec.size();
 
@@ -400,9 +434,8 @@ int32_t main(int32_t argc, char* argv[]) {
     start_debug_server(g_server_port - 1);
 #endif
 
-    sem_lock_t stop_sem(g_stop_sem);
+    sem_lock_t stop_sem(&g_stop_sem);
     stop_sem.wait();
-    //    threadpool->destroy_pool(1);
 
     return SUCCESS;
 }
diff --git a/platform/ivr/src/ivrapi.cpp b/platform/ivr/src/ivrapi.cpp
index 907596a..f7c1cc9 100644
--- a/platform/ivr/src/ivrapi.cpp
+++ b/platform/ivr/src/ivrapi.cpp
@@ -22,6 +22,9 @@
 #include "cpu_manager.h"
 #include "lock.h"
 #include "common.h"
+#include "ivr_data_collection.h"
+
+using ivr::IvrCallDataCollection;
 
 extern std::auto_ptr<ConfManager> g_conf_manager;
 ivr::IvrResultT IvrApi_Imp::ReloadConfig(const ivr::ReloadFlagT& type,
@@ -142,6 +145,12 @@ ivr::IvrResultT IvrApi_Imp::Heartbeat(std::string& ivrinfo, const str2str_map& c
     return 0;
 }
 
+ivr::IvrResultT IvrApi_Imp::GetCallInfo(int32_t type, const std::string& input, std::string& result,
+                                        const str2str_map& ctx)
+{
+    return IvrCallDataCollection::instance().get_inbound_call_data(type, input, result);
+}
+
 uint32_t ivr_reload_server::start() {
     if (!_shutdown) {
         IVR_WARN("ivr reload thread is running!");
@@ -169,7 +178,7 @@ uint32_t ivr_reload_server::start() {
         IVR_WARN("ivr reload server not ok now!");
     }
 
-    return IVR_SUCCESS;
+    return ivr::IvrResultT::ResSuccess;
 }
 
 int32_t ivr_reload_server::_thread_fun() {
diff --git a/platform/ivr/src/logger.cpp b/platform/ivr/src/logger.cpp
new file mode 100644
index 0000000..043f4c3
--- /dev/null
+++ b/platform/ivr/src/logger.cpp
@@ -0,0 +1,374 @@
+/*
+ * Copyright 2002-2014 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      CC/LICENSE
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#include "logger.h"
+
+// **********************************Ë½ÓÐº¯Êý**********************************
+bool Logger::CreatDirectory(const string& strPath) {
+    if (access(strPath.c_str(), 0) == 0) { //Ä¿Â¼´æÔÚ
+        return true;
+    }
+
+    vector<string> dirVector;
+    string temp;
+
+    for (string::const_iterator it = strPath.begin(); it != strPath.end(); it++) {
+        temp.push_back(*it);
+
+        if ((*it) == PATH_FLAG) {
+            dirVector.push_back(temp);
+        }
+    }
+
+    for (vector<string>::iterator it = dirVector.begin(); it != dirVector.end(); it++) {
+        if (access((*it).c_str(), 0) != 0) {
+#ifdef WIN32
+
+            if (!CreateDirectory((*it).c_str(), NULL))
+#else
+            if (mkdir((*it).c_str(), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH) != 0)
+#endif
+            {
+                return false;
+            }
+        }
+    }
+
+    return true;
+}
+
+void Logger::GetTimeFileName(LongString strTime) {
+    assert(strTime != NULL);
+
+#ifdef WIN32
+    SYSTEMTIME now;
+    GetLocalTime(&now);
+    snprintf(strTime, LONG_STRING_LENGHT, "_%04d%02d%02d%02d%02d%02d%03d", now.wYear, now.wMonth,
+             now.wDay, now.wHour, now.wMinute,
+             now.wSecond, now.wMilliseconds);
+#else
+    struct timeb tTime;
+    struct tm tmTemp;
+    ftime(&tTime);
+    localtime_r(&tTime.time, &tmTemp);
+    snprintf(strTime, LONG_STRING_LENGHT, "_%04d%02d%02d%02d%02d%02d%03d", tmTemp.tm_year + 1900,
+             tmTemp.tm_mon + 1,
+             tmTemp.tm_mday, tmTemp.tm_hour, tmTemp.tm_min, tmTemp.tm_sec, tTime.millitm);
+#endif
+}
+
+void Logger::GetCurrentTimeString(LongString strTime) {
+    assert(strTime != NULL);
+
+#ifdef WIN32
+    SYSTEMTIME now;
+    GetLocalTime(&now);
+    snprintf(strTime, LONG_STRING_LENGHT, "%04d-%02d-%02d %02d:%02d:%02d.%03d", now.wYear, now.wMonth,
+             now.wDay, now.wHour, now.wMinute,
+             now.wSecond, now.wMilliseconds);
+#else
+    struct timeb tTime;
+    struct tm tmTemp;
+    ftime(&tTime);
+    localtime_r(&tTime.time, &tmTemp);
+    snprintf(strTime, LONG_STRING_LENGHT, "%04d-%02d-%02d %02d:%02d:%02d.%03d", tmTemp.tm_year + 1900,
+             tmTemp.tm_mon + 1,
+             tmTemp.tm_mday, tmTemp.tm_hour, tmTemp.tm_min, tmTemp.tm_sec, tTime.millitm);
+#endif
+}
+
+void Logger::InitLogger() {
+    this->mFuleFileName = this->mDirName + this->mFileName + ".log";
+    this->mOutStream.open(this->mFuleFileName.c_str(), ios::out | ios::app);
+
+
+#if 0
+    if (this->mOutStream.is_open() && this->mShowVersion) {
+        LongString strTime;
+        this->GetCurrentTimeString(strTime);
+        LongText logText;
+        snprintf(logText, LONG_TEXT_LENGHT, "[%s] %s", strTime, mVersion.c_str());
+        this->mOutStream << logText << endl;
+    }
+#endif
+}
+
+void Logger::DeleteLog() {
+#ifdef WIN32
+    string temp = this->mDirName + this->mFileName + "_*.log";
+    WIN32_FIND_DATA fileData;
+    HANDLE handle = FindFirstFile(temp.c_str(), &fileData);
+
+    if (handle != INVALID_HANDLE_VALUE) {
+        list<WIN32_FIND_DATA> fileList;
+        fileList.push_back(fileData);
+
+        while (FindNextFile(handle, &fileData)) {
+            fileList.push_back(fileData);
+        }
+
+        while (fileList.size() >= this->mFileCount) {
+            list<WIN32_FIND_DATA>::iterator min_it = fileList.begin();
+
+            for (list<WIN32_FIND_DATA>::iterator it = fileList.begin(); it != fileList.end(); it++) {
+                if (strcmp((*it).cFileName, (*min_it).cFileName) < 0) {
+                    min_it = it;
+                }
+            }
+
+            temp = this->mDirName + (*min_it).cFileName;
+            remove(temp.c_str());
+            fileList.erase(min_it);
+        }
+
+        FindClose(handle);
+    }
+
+#else
+    DIR* p_dir;
+    dirent* direntp;
+
+    if (NULL == (p_dir = opendir(this->mDirName.c_str()))) {
+        return;
+    }
+
+    list<string> fileList;
+
+    while ((direntp = readdir(p_dir)) != NULL) {
+        string temp = mFileName + "_";
+
+        if (strstr(direntp->d_name, ".log") != NULL && strstr(direntp->d_name, temp.c_str()) != NULL) {
+            fileList.push_back(direntp->d_name);
+        }
+    }
+
+    closedir(p_dir);
+
+    while (fileList.size() >= this->mFileCount) {
+        list<string>::iterator min_it = fileList.begin();
+
+        for (list<string>::iterator it = fileList.begin(); it != fileList.end(); it++) {
+            if ((*it).compare(*min_it) < 0) {
+                min_it = it;
+            }
+        }
+
+        string temp = this->mDirName + *min_it;
+        remove(temp.c_str());
+        fileList.erase(min_it);
+    }
+
+#endif
+}
+
+void Logger::UnInitLogger() {
+    if (this->mOutStream.is_open()) {
+        this->mOutStream.close();
+
+        LongString strFileTime;
+        this->GetTimeFileName(strFileTime);
+        string oldLogFileName = this->mDirName + this->mFileName + strFileTime + ".log";
+        rename(this->mFuleFileName.c_str(), oldLogFileName.c_str());
+    }
+}
+
+void Logger::ProcessLog() {
+    if (this->mCurLogCount >= this->mLogCount || this->LogFileNotExisted()) {
+        this->UnInitLogger();
+        this->DeleteLog();
+        this->InitLogger();
+        this->mCurLogCount = 0;
+    }
+
+    this->mCurLogCount++;
+}
+
+bool Logger::LogFileNotExisted() {
+#ifdef WIN32
+    return false;
+#else
+    struct stat st;
+    return -1 == stat(this->mFuleFileName.c_str(), &st) && ENOENT == errno;
+#endif
+}
+
+void Logger::GetLevelString(Level level, string& levelString) {
+    switch (level) {
+    case LOG_LEVEL_CRITICAL:
+        levelString = "CRITICAL";
+        break;
+
+    case LOG_LEVEL_WARNING:
+        levelString = "WARNING";
+        break;
+
+    case LOG_LEVEL_NOTICE:
+        levelString = "NOTICE";
+        break;
+
+    case LOG_LEVEL_DEBUG:
+        levelString = "DEBUG";
+        break;
+
+    default:
+        levelString = "OVERFLOW";
+        break;
+    }
+}
+
+// **********************************¹²ÓÐº¯Êý**********************************
+Logger::Logger() : mLogCount(50000), mFileCount(10), mDirName(LOG_DIR), mFileName(LOG_FILE),
+    mVersion(""), mShowVersion(true), mLevel(LOG_LEVEL_NOTICE), mCurLogCount(0) {
+    //mVersion(ACD_VERSION), mShowVersion(true), mLevel(LOG_LEVEL_NOTICE), mCurLogCount(0) {
+}
+
+Logger::~Logger() {
+    this->UnInitLogger();
+}
+
+void Logger::Initialize(uint32_t logCount, uint32_t fileCount, const char* dirName,
+                        const char* fileName, const char* version, bool showVersion, Level level) {
+    assert(logCount > 0);
+    assert(fileCount > 0);
+    assert(dirName != NULL);
+    assert(*dirName != '\0');
+    assert(fileName != NULL);
+    assert(*fileName != '\0');
+    assert(version != NULL);
+    assert(*version != '\0');
+
+    SingleLocker s(&mLocker);
+    mLogCount = logCount;
+    mFileCount = fileCount;
+    mDirName.assign(dirName);
+
+    if (mDirName[mDirName.size() - 1] != PATH_FLAG) {
+        mDirName.push_back(PATH_FLAG);
+    }
+
+    mFileName.assign(fileName);
+    mVersion.assign(version);
+    mShowVersion = showVersion;
+    mLevel = level;
+
+    this->CreatDirectory(this->mDirName);
+    this->UnInitLogger();
+    this->DeleteLog();
+    this->InitLogger();
+    mCurLogCount = 0;
+}
+
+void Logger::UnInitialize() {
+    SingleLocker s(&mLocker);
+    this->UnInitLogger();
+}
+
+void Logger::WriteLog(const char* pFormat, ...) {
+    assert(pFormat != NULL);
+
+    SingleLocker s(&mLocker);
+    Text content;
+    va_list list;
+    va_start(list, pFormat);
+    vsnprintf(content, TEXT_LENGHT, pFormat, list);
+    va_end(list);
+
+    this->ProcessLog();
+
+    if (this->mOutStream.is_open()) {
+        //LongString strTime;
+        //this->GetCurrentTimeString(strTime);
+        LongText logText;
+        //snprintf(logText, LONG_TEXT_LENGHT, "[%s] %s", strTime, content);
+        //snprintf(logText, LONG_TEXT_LENGHT, "%s", content);
+        this->mOutStream << content << endl;
+    }
+}
+
+void Logger::WriteLog(Level level, const char* pFormat, ...) {
+    assert(pFormat != NULL);
+
+    SingleLocker s(&mLocker);
+    Text content;
+    va_list list;
+    va_start(list, pFormat);
+    vsnprintf(content, TEXT_LENGHT, pFormat, list);
+    va_end(list);
+
+    if (this->mLevel < level) {
+        return;
+    }
+
+    this->ProcessLog();
+
+    if (this->mOutStream.is_open()) {
+        LongString strTime;
+        this->GetCurrentTimeString(strTime);
+        string levelString;
+        GetLevelString(level, levelString);
+        LongText logText;
+        //snprintf(logText, LONG_TEXT_LENGHT, "[%s] [%s] %s", strTime, levelString.c_str(), content);
+        snprintf(logText, LONG_TEXT_LENGHT, "%s", content);
+        //this->mOutStream << logText << endl;
+        this->mOutStream << content << endl;
+    }
+}
+
+void Logger::WriteLog(Level level, const char* file, uint32_t line, const char* fun,
+                      const char* pFormat, ...) {
+    assert(file != NULL);
+    assert(pFormat != NULL);
+
+    SingleLocker s(&mLocker);
+    Text content;
+    va_list list;
+    va_start(list, pFormat);
+    vsnprintf(content, TEXT_LENGHT, pFormat, list);
+    va_end(list);
+
+    if (this->mLevel < level) {
+        return;
+    }
+
+    this->ProcessLog();
+
+    if (this->mOutStream.is_open()) {
+        LongString strTime;
+        this->GetCurrentTimeString(strTime);
+        string levelString;
+        GetLevelString(level, levelString);
+        LongText logText;
+        //snprintf(logText, LONG_TEXT_LENGHT, "[%s] [%s] [%s:%d] [%s] %s", strTime, levelString.c_str(), file,
+        //         line, fun, content);
+        snprintf(logText, LONG_TEXT_LENGHT, "%s", content);
+        //this->mOutStream << logText << endl;
+        this->mOutStream << content << endl;
+    }
+}
+
+void Logger::SetTimeout() {
+    SingleLocker s(&mLocker);
+    this->UnInitLogger();
+    this->DeleteLog();
+    this->InitLogger();
+    mCurLogCount = 0;
+}
+
+void Logger::SetLogLevel(Level level) {
+    SingleLocker s(&mLocker);
+    mLevel = level;
+}
diff --git a/platform/ivr/src/node_base64decode.cpp b/platform/ivr/src/node_base64decode.cpp
new file mode 100644
index 0000000..1d2da18
--- /dev/null
+++ b/platform/ivr/src/node_base64decode.cpp
@@ -0,0 +1,143 @@
+/*
+ * Copyright 2002-2015 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      CC/LICENSE
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "node_base64decode.h"
+
+NodeBase64Decode::NodeBase64Decode(const uint32_t id, const string& name,
+                       const string& type, const string& desc, const key_map_t& keymap)
+    : NodeBase(id, name, type, desc, keymap) {
+}
+
+NodeBase64Decode::~NodeBase64Decode(void) {
+}
+
+//////////////////////////////////////////////////////////////////////////////////////////
+//Base64 ½âÂë
+char getbase64value(char ch) //µÃµ½±àÂëÖµ
+{
+    if ((ch >= 'A') && (ch <= 'Z')){  // A ~ Z
+        return ch - 'A';
+    }
+    if ((ch >= 'a') && (ch <= 'z')){  // a ~ z
+        return ch - 'a' + 26;
+    }
+    if ((ch >= '0') && (ch <= '9')){  // 0 ~ 9
+        return ch - '0' + 52;
+    }
+    switch (ch)       // ÆäËü×Ö·û
+    {
+    case '+':
+        return 62;
+    case '/':
+        return 63;
+    case '=':  //Base64 Ìî³ä×Ö·û
+        return 0;
+    default:
+        return 0;
+    }
+}
+
+// ½âÂëº¯Êý
+int32_t base64decode(std::string& OrgString, std::string& Base64String, int Base64StringLen, bool bForceDecode)  //½âÂëº¯Êý
+{
+    OrgString = "";
+    if (Base64StringLen % 4 && !bForceDecode)   //Èç¹û²»ÊÇ 4 µÄ±¶Êý,Ôò Base64 ±àÂëÓÐÎÊÌâ
+    {
+        return -1;
+    }
+    unsigned char base64encode[4];
+    char *p = new (std::nothrow)char[3];
+    int32_t orgstringlen = 0;
+    int32_t cur = 0;
+    
+    while (Base64StringLen > 3)  //µ±´ý½âÂë¸öÊý²»×ã3¸öÊ±,½«ºöÂÔËü(Ç¿ÖÆ½âÂëÊ±ÓÐÐ§)
+    {
+        base64encode[0] = getbase64value(Base64String.at(cur));
+        base64encode[1] = getbase64value(Base64String.at(cur + 1));
+        base64encode[2] = getbase64value(Base64String.at(cur + 2));
+        base64encode[3] = getbase64value(Base64String.at(cur + 3));
+        
+        *p = (base64encode[0] << 2) | (base64encode[1] >> 4);
+        *(p + 1) = (base64encode[1] << 4) | (base64encode[2] >> 2);
+        *(p + 2) = (base64encode[2] << 6) | (base64encode[3]);
+        
+        cur += 4;
+        Base64StringLen -= 4;
+        orgstringlen += 3;
+        OrgString = OrgString + std::string(p).substr(0, 3);//delete "\0"
+    }
+    delete[] p;
+    p = NULL;
+    return orgstringlen;
+}
+
+NodeBase* NodeBase64Decode::run(base_script_t* param) {
+    const char* exit = EXIT_FAIL;
+    std::string ret = "";
+    std::string tmp = "";
+    IVR_TRACE("%s", enter(param->name_var_map).c_str());
+
+    map<string, variable_t>::iterator it = param->name_var_map.find(_result);
+
+    if (it == param->name_var_map.end()) {
+        IVR_WARN("Î´ÕÒµ½·µ»ØÖµ±äÁ¿");
+    } else {
+        if (parse_expression(_input, param->name_var_map, ret)) {
+
+            if (STRING != it->second.type) {
+                IVR_WARN("±äÁ¿%s µÄÀàÐÍ²»ÄÜ½âÂë", _result.c_str());
+            } else {
+                if (base64decode(tmp, ret, ret.length(), true) > 0){
+                    *(string*)it->second.pvalue = tmp;
+                    exit = EXIT_SUCC;
+                }
+                else{
+                    exit = EXIT_FAIL;
+                }
+            }
+        } else {
+            IVR_WARN("parse assign expression failed(%s)", _input.c_str());
+        }
+    }
+
+    IVR_TRACE("%s exit from %s(%s)",
+              leave(param->name_var_map).c_str(), exit, tmp.c_str());
+    return _exit_node_map[exit];
+}
+
+bool NodeBase64Decode::load_other() {
+    return NodeBase::load_other()
+           && valid_str(_key_map, _s_param_input, _input, false)
+           && valid_str(_key_map, _s_param_result, _result);
+}
+
+const char* NodeBase64Decode::_s_param_input = "input";
+const char* NodeBase64Decode::_s_param_result = "result";
+
+std::string NodeBase64Decode::enter(const map<string, variable_t>& vars)const {
+    ostringstream ostm;
+    ostm << NodeBase::enter(vars);
+    ostm << "input:" << _input << ",result:" << _result;
+    return ostm.str();
+}
+
+std::string NodeBase64Decode::leave(const map<string, variable_t>& vars)const {
+    ostringstream ostm;
+    ostm << NodeBase::leave(vars);
+    ostm << "result:" << _result;
+    return ostm.str();
+}
+
diff --git a/platform/ivr/src/node_base64encode.cpp b/platform/ivr/src/node_base64encode.cpp
new file mode 100644
index 0000000..25d487b
--- /dev/null
+++ b/platform/ivr/src/node_base64encode.cpp
@@ -0,0 +1,127 @@
+/*
+ * Copyright 2002-2015 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      CC/LICENSE
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "node_base64encode.h"
+
+NodeBase64Encode::NodeBase64Encode(const uint32_t id, const string& name,
+                       const string& type, const string& desc, const key_map_t& keymap)
+    : NodeBase(id, name, type, desc, keymap) {
+}
+
+NodeBase64Encode::~NodeBase64Encode(void) {
+}
+
+std::string base64_encode(const std::string& input)
+{
+    static const char base64_chars[] = 
+        "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
+    
+    std::string result;
+    
+    int i = 0;
+    unsigned char char_array_3[3];
+    
+    const unsigned char* bytes_to_encode = (const unsigned char*)input.c_str();
+    size_t in_len = input.size();
+    
+    result.reserve(((in_len + 2) / 3) * 4);
+    while (in_len--)
+    {
+        char_array_3[i++] = *(bytes_to_encode++);
+        if (i == 3)
+        {
+            result.push_back(base64_chars[(char_array_3[0] & 0xfc) >> 2]);
+            result.push_back(base64_chars[((char_array_3[0] & 0x03) << 4) + 
+                    ((char_array_3[1] & 0xf0) >> 4)]);
+            result.push_back(base64_chars[((char_array_3[1] & 0x0f) << 2) + 
+                    ((char_array_3[2] & 0xc0) >> 6)]);
+            result.push_back(base64_chars[char_array_3[2] & 0x3f]);
+            
+            i = 0;
+        }
+    }
+    
+    if (i != 0)
+    { // input.size() % 3 != 0
+        memset(char_array_3 + i, 0, 3 - i);
+        result.push_back(base64_chars[(char_array_3[0] & 0xfc) >> 2]);
+        result.push_back(base64_chars[((char_array_3[0] & 0x03) << 4) + 
+                ((char_array_3[1] & 0xf0) >> 4)]);
+        if (i >= 2){
+            result.push_back(base64_chars[((char_array_3[1] & 0x0f) << 2) + 
+                ((char_array_3[2] & 0xc0) >> 6)]);
+        }
+        else result.push_back('=');
+        result.push_back('=');
+    }
+    
+    return result;
+}
+
+NodeBase* NodeBase64Encode::run(base_script_t* param) {
+    const char* exit = EXIT_FAIL;
+    std::string ret = "";
+    std::string tmp = "";
+    IVR_TRACE("%s", enter(param->name_var_map).c_str());
+
+    map<string, variable_t>::iterator it = param->name_var_map.find(_result);
+
+    if (it == param->name_var_map.end()) {
+        IVR_WARN("Î´ÕÒµ½·µ»ØÖµ±äÁ¿");
+    } else {
+        if (parse_expression(_input, param->name_var_map, ret)) {
+
+            if (STRING != it->second.type) {
+                IVR_WARN("±äÁ¿%s µÄÀàÐÍ²»ÄÜ±»±àÂë", _result.c_str());
+            } else {
+                tmp = base64_encode(ret);
+                *(string*)it->second.pvalue = tmp;
+                exit = EXIT_SUCC;
+            }
+        } else {
+            IVR_WARN("parse assign expression failed(%s)", _input.c_str());
+        }
+    }
+
+    IVR_TRACE("%s exit from %s(%s)",
+              leave(param->name_var_map).c_str(), exit, tmp.c_str());
+    return _exit_node_map[exit];
+}
+
+bool NodeBase64Encode::load_other() {
+    return NodeBase::load_other()
+           && valid_str(_key_map, _s_param_input, _input, false)
+           && valid_str(_key_map, _s_param_result, _result);
+}
+
+const char* NodeBase64Encode::_s_param_input = "input";
+const char* NodeBase64Encode::_s_param_result = "result";
+
+std::string NodeBase64Encode::enter(const map<string, variable_t>& vars)const {
+    ostringstream ostm;
+    ostm << NodeBase::enter(vars);
+    ostm << "input:" << _input << ",result:" << _result;
+    return ostm.str();
+}
+
+std::string NodeBase64Encode::leave(const map<string, variable_t>& vars)const {
+    ostringstream ostm;
+    ostm << NodeBase::leave(vars);
+    ostm << "result:" << _result;
+    return ostm.str();
+}
+
+
diff --git a/platform/ivr/src/node_bridgeex.cpp b/platform/ivr/src/node_bridgeex.cpp
index d165755..bd60858 100644
--- a/platform/ivr/src/node_bridgeex.cpp
+++ b/platform/ivr/src/node_bridgeex.cpp
@@ -36,6 +36,7 @@ NodeBase* node_bridgeex_t::run(base_script_t* param) {
     string called;
     string calltype;
     string bgmfile;
+    bool bghungup = false;
     bool usebgm = true;
     std::string callid;
     fw_id_t fs_no = param->fid;
@@ -46,6 +47,13 @@ NodeBase* node_bridgeex_t::run(base_script_t* param) {
         callid = *(std::string*)ptmp;
     }
 
+    if (!_bghungup.empty()){
+        if (strcasecmp(_bghungup.c_str(), "true") == 0){
+            IVR_WARN("hungup after bridge set true");
+            bghungup = true;
+        }
+    }
+
     if (strcasecmp(_bgtype.c_str(), PARAMITEM_RING) != 0
             && strcasecmp(_bgtype.c_str(), PARAMITEM_BGM) != 0) {
         IVR_WARN("bgtype error, USE ring");
@@ -61,16 +69,17 @@ NodeBase* node_bridgeex_t::run(base_script_t* param) {
 
     if (true == parse_expression(_caller, param->name_var_map, caller)
             && true == parse_expression(_called, param->name_var_map, called)
-            && true == parse_expression(_calltype, param->name_var_map, calltype)) {
-        IVR_TRACE("caller=%s,called=%s,bgtype=%s(usebgm:%d),bgmfile=%s", caller.c_str(), called.c_str(),
-                  _bgtype.c_str(), usebgm, bgmfile.c_str());
+            && true == parse_expression(_calltype, param->name_var_map, calltype)
+            && true == parse_expression(_callid, param->name_var_map, callid)) {
+        IVR_TRACE("caller=%s,called=%s,callid=%s,bgtype=%s(usebgm:%d),bgmfile=%s", caller.c_str(),
+                called.c_str(), callid.c_str(), _bgtype.c_str(), usebgm, bgmfile.c_str());
 
         fs_opr_t* opr = NULL;
 
         if (fs_mgr_t::instance()->fetch_opr(fs_no, &opr) == IVR_SUCCESS) {
             if (NULL != opr) {
                 if (IVR_SUCCESS == opr->bridgeex(callid.c_str(), caller.c_str(), called.c_str(), calltype != "0",
-                                                 usebgm, bgmfile.c_str())) {
+                                                 usebgm, bgmfile.c_str(), bghungup)) {
                     exit = EXIT_SUCC;
                 } else {
                     IVR_WARN("bridgeex failed(caller: %s, called: %s)", _caller.c_str(), _called.c_str());
@@ -106,6 +115,7 @@ NodeBase* node_bridgeex_t::run(base_script_t* param) {
 bool node_bridgeex_t::load_other() {
     valid_str(_key_map, PARAM_BGTYPE, _bgtype);
     valid_str(_key_map, PARAM_BGMFILE, _bgmfile);
+    valid_str(_key_map, _s_param_bghungup, _bghungup);
     return NodeResource::load_other()
            && valid_str(_key_map, PARAM_CALLER, _caller)
            && valid_str(_key_map, PARAM_CALLED, _called)
@@ -124,6 +134,7 @@ const char* node_bridgeex_t::PARAM_CALLED = "callednumber";
 const char* node_bridgeex_t::PARAM_CALLTYPE = "calltype";
 const char* node_bridgeex_t::PARAM_BGTYPE = "bgtype";
 const char* node_bridgeex_t::PARAM_BGMFILE = "bgmfile";
+const char* node_bridgeex_t::_s_param_bghungup = "bghungup";
 
 const char* node_bridgeex_t::PARAMITEM_BGM = "bgm";
 const char* node_bridgeex_t::PARAMITEM_RING = "ring";
diff --git a/platform/ivr/src/node_broadcast.cpp b/platform/ivr/src/node_broadcast.cpp
new file mode 100755
index 0000000..eb8cd09
--- /dev/null
+++ b/platform/ivr/src/node_broadcast.cpp
@@ -0,0 +1,136 @@
+/*
+ * Copyright 2002-2014 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      CC/LICENSE
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "tools.h"
+#include "node_broadcast.h"
+#include "fs_opr.h"
+#include "fs_mgr.h"
+
+namespace ivr {
+
+NodeBroadcast::NodeBroadcast(const uint32_t id, const string& name,
+                             const string& type, const string& desc, const key_map_t& keymap)
+    : NodeResource(id, name, type, desc, keymap) {
+    _delay = 0;
+}
+
+NodeBroadcast::~NodeBroadcast(void) {
+}
+
+NodeBase* NodeBroadcast::run(base_script_t* param) {
+    if (NULL == param) {
+        IVR_WARN("base_script_t pointer should not be null");
+        return NULL;
+    }
+
+    const char* exit = EXIT_FAIL;
+    std::string ret = "";
+    IVR_TRACE("%s", enter(param->name_var_map).c_str());
+
+    if (_delay != 0) {
+        ivr_tools_t::safe_sleeps(_delay);
+    }
+
+    std::string playfile;
+    std::string callid1;
+    std::string callid2;
+    fs_opr_t* opr = NULL;
+    fw_id_t fs_no;
+
+    if (parse_expression(_callid1, param->name_var_map, callid1)
+            && parse_expression(_callid2, param->name_var_map, callid2)
+            && parse_expression(_play_file, param->name_var_map, playfile)) {
+        IVR_TRACE("callid1=%s, callid2=%s, delay=%u,playfile=%s",
+                  callid1.c_str(), callid2.c_str(),  _delay, (param->vox_base + playfile).c_str());
+        playfile = param->vox_base + playfile;
+    }  else {
+        IVR_WARN("parse callid or playfile failed");
+        goto END;
+    }
+
+    fs_no = param->fid;
+
+    if (fs_mgr_t::instance()->fetch_opr(fs_no, &opr) == IVR_SUCCESS) {
+        if (NULL != opr) {
+            if (opr->uuid_broadcast(callid1.c_str(), callid2.c_str(),
+                                    playfile.c_str()) == IVR_SUCCESS) {
+                exit = EXIT_SUCC;
+            } else {
+                IVR_WARN("opr broadcast  failed(callid1: %s, callid2:%s)",
+                         _callid1.c_str(), _callid2.c_str());
+            }
+        } else {
+            IVR_WARN("fs_opr_t pointer should not be null");
+        }
+
+        fs_mgr_t::instance()->free_opr(&opr);
+    } else {
+        IVR_WARN("fetch opr failed. freeswitch no is %d", fs_no);
+    }
+
+END:
+    NodeBase* exit_node_ptr = NULL;
+    std::map<std::string, NodeBase*>::iterator citr;
+    citr = _exit_node_map.find(exit);
+
+    if (citr != _exit_node_map.end()) {
+        exit_node_ptr = citr->second;
+        IVR_TRACE("%s exit from %s(%s)",
+                  leave(param->name_var_map).c_str(), exit, ret.c_str());
+    } else {
+        IVR_WARN("Can not find exit %s in _exit_node_map", exit);
+    }
+
+    return exit_node_ptr;
+}
+
+bool NodeBroadcast::load_other() {
+    std::string tmp;
+
+    if (!valid_str(_key_map, _s_param_callid1, _callid1)) {
+        return false;
+    }
+
+    if (!valid_str(_key_map, _s_param_callid2, _callid2)) {
+        return false;
+    }
+
+    valid_str(_key_map, _s_param_file, _play_file);//ÔÊÐíÎª¿Õ
+
+    _delay = 0;
+
+    if (valid_str(_key_map, _s_param_delay, tmp)) {//ÔÊÐíÎª¿Õ
+        if (ivr_tools_t::is_positive_integer(tmp)) {
+            _delay = atoi(tmp.c_str());
+        }
+    }
+
+    return  NodeBase::load_other();
+}
+//const char * NodeBroadcast::PARAM_CALLID="callid";
+const char* NodeBroadcast::_s_param_delay = "delay";
+const char* NodeBroadcast::_s_param_file = "playfile";
+const char* NodeBroadcast::_s_param_callid1 = "callid1";
+const char* NodeBroadcast::_s_param_callid2 = "callid2";
+
+std::string NodeBroadcast::enter(const map<string, variable_t>& vars) const {
+    ostringstream ostm;
+    ostm << NodeBase::enter(vars);
+    ostm << ",delay:" << _delay << ",file:" << _play_file;
+    return ostm.str();
+}
+
+}
diff --git a/platform/ivr/src/node_broadcast_num.cpp b/platform/ivr/src/node_broadcast_num.cpp
new file mode 100755
index 0000000..d61cf5f
--- /dev/null
+++ b/platform/ivr/src/node_broadcast_num.cpp
@@ -0,0 +1,160 @@
+/*
+ * Copyright 2002-2014 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      CC/LICENSE
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "tools.h"
+#include "node_broadcast_num.h"
+#include "fs_opr.h"
+#include "fs_mgr.h"
+
+namespace ivr {
+
+NodeBroadcastNum::NodeBroadcastNum(const uint32_t id, const string& name,
+                                   const string& type, const string& desc, const key_map_t& keymap)
+    : NodeResource(id, name, type, desc, keymap) {
+    _delay = 0;
+}
+
+NodeBroadcastNum::~NodeBroadcastNum(void) {
+}
+
+NodeBase* NodeBroadcastNum::run(base_script_t* param) {
+    if (NULL == param) {
+        IVR_WARN("base_script_t pointer should not be null");
+        return NULL;
+    }
+
+    const char* exit = EXIT_FAIL;
+    std::string ret = "";
+    IVR_TRACE("%s", enter(param->name_var_map).c_str());
+
+    if (_delay != 0) {
+        ivr_tools_t::safe_sleeps(_delay);
+    }
+
+    std::string playstr;
+    std::string callid1;
+    std::string callid2;
+    fs_opr_t* opr = NULL;
+    fw_id_t fs_no;
+
+    if (parse_expression(_callid1, param->name_var_map, callid1)
+            && parse_expression(_callid2, param->name_var_map, callid2)
+            && parse_expression(_play_str, param->name_var_map, playstr)) {
+        IVR_TRACE("callid1=%s,callid2=%s,delay=%u,playstr=%s",
+                  callid1.c_str(), callid2.c_str(),  _delay, playstr.c_str());
+    }  else {
+        IVR_WARN("parse callid or playstr failed");
+        IVR_TRACE("%s exit from %s(%s)",
+                  leave(param->name_var_map).c_str(), exit, ret.c_str());
+        return _exit_node_map[exit];
+    }
+
+    if (!ivr_tools_t::is_all_digit(playstr)) {
+        IVR_TRACE("·ÅÒô×Ö·û´®²»¾ùÎªÊý×Ö[%s]", playstr.c_str());
+        IVR_TRACE("%s exit from %s(%s)",
+                  leave(param->name_var_map).c_str(), exit, ret.c_str());
+        return _exit_node_map[exit];
+    }
+
+    fs_no = param->fid;
+
+    if (fs_mgr_t::instance()->fetch_opr(fs_no, &opr) == IVR_SUCCESS) {
+        if (NULL != opr) {
+            if (0 == strcasecmp(_playtype.c_str(), _s_paramitem_number)) {
+                if (opr->broadcast_num(callid1.c_str(), callid2.c_str(), playstr.c_str(),
+                                       param->vox_base.c_str(), true) == IVR_SUCCESS) {
+                    exit = EXIT_SUCC;
+                } else {
+                    IVR_WARN("opr playnum err(callid1:%s,callid2:%s,number: %s)",
+                             callid1.c_str(), callid2.c_str(), playstr.c_str());
+                }
+            } else if (0 == strcasecmp(_playtype.c_str(), _s_paramitem_int32)) {
+                if (opr->broadcast_num(callid1.c_str(), callid2.c_str(), playstr.c_str(),
+                                       param->vox_base.c_str(), false) == IVR_SUCCESS) {
+                    exit = EXIT_SUCC;
+                } else {
+                    IVR_WARN("opr broadcastnum err(callid1:%s,callid2:%s,number: %s)",
+                             callid1.c_str(), callid2.c_str(), playstr.c_str());
+                }
+            } else {
+                IVR_WARN("invalid playtype");
+            }
+        } else {
+            IVR_WARN("fs_opr_t pointer should not be null");
+        }
+
+        fs_mgr_t::instance()->free_opr(&opr);
+    } else {
+        IVR_WARN("fetch opr failed. freeswitch no is %d", fs_no);
+    }
+
+    IVR_TRACE("%s exit from %s(%s)",
+              leave(param->name_var_map).c_str(), exit, ret.c_str());
+
+    return _exit_node_map[exit];
+}
+
+bool NodeBroadcastNum::load_other() {
+    std::string tmp;
+
+    if (!valid_str(_key_map, _s_param_callid1, _callid1)) {
+        return false;
+    }
+
+    if (!valid_str(_key_map, _s_param_callid2, _callid2)) {
+        return false;
+    }
+
+    valid_str(_key_map, _s_param_str, _play_str);//ÔÊÐíÎª¿Õ
+
+    //ÑÓÊ±Ê±¼äÉèÖÃ
+    _delay = 0;
+
+    if (valid_str(_key_map, _s_param_delay, tmp)) {//ÔÊÐíÎª¿Õ
+        if (ivr_tools_t::is_positive_integer(tmp)) {
+            _delay = atoi(tmp.c_str());
+        }
+    }
+
+    //playtype³õÊ¼»¯
+    _playtype = _s_paramitem_number;
+
+    if (valid_str(_key_map, _s_param_playtype, tmp)) {
+        if (0 == strcasecmp(_playtype.c_str(), _s_paramitem_number)
+                || 0 == strcasecmp(_playtype.c_str(), _s_paramitem_int32)) {
+            _playtype = tmp;
+        }
+    }
+
+    return NodeBase::load_other();
+}
+
+const char* NodeBroadcastNum::_s_param_delay = "delay";
+const char* NodeBroadcastNum::_s_param_str = "playstr";
+const char* NodeBroadcastNum::_s_param_callid1 = "callid1";
+const char* NodeBroadcastNum::_s_param_callid2 = "callid2";
+const char* NodeBroadcastNum::_s_param_playtype = "playtype";
+const char* NodeBroadcastNum::_s_paramitem_number = "number";
+const char* NodeBroadcastNum::_s_paramitem_int32 = "int32";
+
+std::string NodeBroadcastNum::enter(const map<string, variable_t>& vars) const {
+    ostringstream ostm;
+    ostm << NodeBase::enter(vars);
+    ostm << "file:" << _play_str << ",delay:" << _delay;
+    return ostm.str();
+}
+
+}
diff --git a/platform/ivr/src/node_factory.cpp b/platform/ivr/src/node_factory.cpp
index f563127..f30508f 100644
--- a/platform/ivr/src/node_factory.cpp
+++ b/platform/ivr/src/node_factory.cpp
@@ -50,6 +50,11 @@
 #include "node_getassociatedata.h"
 #include "node_whatweekday.h"
 #include "node_makecall.h"
+#include "node_broadcast.h"
+#include "node_broadcast_num.h"
+#include "node_base64encode.h"
+#include "node_base64decode.h"
+#include "node_setappdata.h"
 
 const char* node_factory::NODE_ANSWER = "answer";
 const char* node_factory::NODE_HANGUP = "hangup";
@@ -82,9 +87,14 @@ const char* node_factory::NODE_CANCEL_AGENT = "cancelagent";
 const char* node_factory::NODE_SET_ASSOCIATEDATA = "setassociatedata";
 const char* node_factory::NODE_GET_ASSOCIATEDATA = "getassociatedata";
 const char* node_factory::NODE_REQUEST_RESULT = "requestresponsecompare";
+const char* node_factory::_s_node_base64_encode = "base64encode";
+const char* node_factory::_s_node_base64_decode = "base64decode";
+const char* node_factory::_s_node_set_appdata = "setappdata";
 
 const char* node_factory::NODE_WHATWEEKDAY = "whatweekday";
 const char* node_factory::NODE_MAKECALL = "makecall";
+const char* node_factory::_s_node_broadcast = "broadcast";
+const char* node_factory::_s_node_broadcast_num = "broadcastnumber";
 
 NodeBase* node_factory::create_node(const uint32_t id,
                                     const string& name, const string& type,
@@ -153,6 +163,16 @@ NodeBase* node_factory::create_node(const uint32_t id,
         node = new(std::nothrow) NodeWhatWeekday(id, name, type, desc, keymap);
     } else if (strcasecmp(type.c_str(), NODE_MAKECALL) == 0) {
         node = new(std::nothrow) NodeMakeCall(id, name, type, desc, keymap);
+    } else if (strcasecmp(type.c_str(), _s_node_broadcast) == 0) {
+        node = new(std::nothrow) ivr::NodeBroadcast(id, name, type, desc, keymap);
+    } else if (strcasecmp(type.c_str(), _s_node_broadcast_num) == 0) {
+        node = new(std::nothrow) ivr::NodeBroadcastNum(id, name, type, desc, keymap);
+    }else if (strcasecmp(type.c_str(), _s_node_base64_encode) == 0) {
+        node = new(std::nothrow) NodeBase64Encode(id, name, type, desc, keymap);
+    }else if (strcasecmp(type.c_str(), _s_node_base64_decode) == 0) {
+        node = new(std::nothrow) NodeBase64Decode(id, name, type, desc, keymap);
+    }else if (strcasecmp(type.c_str(), _s_node_set_appdata) == 0) {
+        node = new(std::nothrow) NodeSetAppData(id, name, type, desc, keymap);
     }
 
     if (node && (!node->load_other())) {
diff --git a/platform/ivr/src/node_jsonget.cpp b/platform/ivr/src/node_jsonget.cpp
index 7203625..bc1fbf9 100644
--- a/platform/ivr/src/node_jsonget.cpp
+++ b/platform/ivr/src/node_jsonget.cpp
@@ -14,9 +14,9 @@
  * limitations under the License.
  */
 
-#include "node_jsonget.h"
-#include <json/json.h>
 #include <sstream>
+#include <json/json.h>
+#include "node_jsonget.h"
 
 NodeJsonGet::NodeJsonGet(const uint32_t id, const string& name,
                          const string& type, const string& desc, const key_map_t& keymap)
@@ -55,7 +55,7 @@ NodeBase* NodeJsonGet::run(base_script_t* param) {
 
     if (var_reason.type != INT32) {
         IVR_WARN("±äÁ¿%s µÄÀàÐÍ´íÎó", _reason.c_str());
-        //(*(std::string*)var_reason.pvalue).assign("5");
+        (*(std::string*)var_reason.pvalue).assign("5");
         goto LEAVE;
     }
 
@@ -66,7 +66,7 @@ NodeBase* NodeJsonGet::run(base_script_t* param) {
         //»ñÈ¡json´®
         json_object* obj = json_tokener_parse(input.c_str());
 
-        if (is_error(obj) || NULL == obj) {
+        if (is_error(obj) || NULL == obj || !json_object_is_type(obj, json_type_object)) {
             IVR_TRACE("Î´ÕÒµ½ÐèÒª¸³ÖµµÄ±äÁ¿");
             (*(std::string*)var_reason.pvalue).assign("1");
             goto LEAVE;
@@ -91,8 +91,18 @@ NodeBase* NodeJsonGet::run(base_script_t* param) {
             goto LEAVE;
         }
 
+        json_type jtype = json_object_get_type(obj_value);
+
         //¸ù¾ÝÐèÒª×ª»¯
         if (0 == strcasecmp(_valuetype.c_str(), PARAMITEM_TYPE_STRING)) {
+            if (jtype != json_type_string && jtype != json_type_object &&
+                    jtype != json_type_array) {
+                IVR_TRACE("jsonÖµÀàÐÍ·ÇSTRING¡¢OBJECT¡¢ARRAYÀàÐÍ");
+                (*(std::string*)var_reason.pvalue).assign("5");
+                json_object_put(obj);
+                goto LEAVE;
+            }
+
             const char* cstr_value = json_object_get_string(obj_value);
 
             if (NULL == cstr_value) {
@@ -117,6 +127,13 @@ NodeBase* NodeJsonGet::run(base_script_t* param) {
             json_object_put(obj);
             goto LEAVE;
         } else if (0 == strcasecmp(_valuetype.c_str(), PARAMITEM_TYPE_INT32)) {
+            if (jtype != json_type_int) {
+                IVR_TRACE("jsonÖµÀàÐÍ·ÇINTÀàÐÍ");
+                (*(std::string*)var_reason.pvalue).assign("5");
+                json_object_put(obj);
+                goto LEAVE;
+            }
+
             int32_t int32_value = json_object_get_int(obj_value);
 
             if (var_value.type != INT32) {
@@ -135,7 +152,14 @@ NodeBase* NodeJsonGet::run(base_script_t* param) {
             json_object_put(obj);
             goto LEAVE;
         } else if (0 == strcasecmp(_valuetype.c_str(), PARAMITEM_TYPE_BOOL)) {
-            json_bool bool_value = json_object_get_boolean(obj_value);
+            if (jtype != json_type_boolean) {
+                IVR_TRACE("jsonÖµÀàÐÍ·ÇBOOLÀàÐÍ");
+                (*(std::string*)var_reason.pvalue).assign("5");
+                json_object_put(obj);
+                goto LEAVE;
+            }
+
+            bool bool_value = json_object_get_boolean(obj_value);
 
             if (var_value.type != INT32) {
                 IVR_TRACE("¸³Öµ±äÁ¿ÀàÐÍ´íÎó");
diff --git a/platform/ivr/src/node_jsonget_array.cpp b/platform/ivr/src/node_jsonget_array.cpp
index 9d70ef9..448dbb2 100644
--- a/platform/ivr/src/node_jsonget_array.cpp
+++ b/platform/ivr/src/node_jsonget_array.cpp
@@ -14,9 +14,9 @@
  * limitations under the License.
  */
 
-#include "node_jsonget_array.h"
-#include <json/json.h>
 #include <sstream>
+#include <json/json.h>
+#include "node_jsonget_array.h"
 
 NodeJsonGetArray::NodeJsonGetArray(const uint32_t id, const string& name,
                                    const string& type, const string& desc, const key_map_t& keymap)
@@ -33,7 +33,6 @@ NodeBase* NodeJsonGetArray::run(base_script_t* param) {
     std::string value = "";
     std::string valueindex = "";
     std::string input = "";
-    std::string key = "";
 
     variable_t var_value;
     variable_t var_reason;
@@ -63,9 +62,8 @@ NodeBase* NodeJsonGetArray::run(base_script_t* param) {
     (*(std::string*)var_reason.pvalue).assign("0");
 
     if (parse_all(_input, param->name_var_map, input)
-            && parse_all(_key, param->name_var_map, key)
             && parse_expression(_valueindex, param->name_var_map, valueindex)) {
-        IVR_TRACE("INPUT: %s; key: %s", input.c_str(), key.c_str());
+        IVR_TRACE("INPUT: %s;", input.c_str());
         //»ñÈ¡json´®
         json_object* obj = json_tokener_parse(input.c_str());
 
@@ -84,20 +82,9 @@ NodeBase* NodeJsonGetArray::run(base_script_t* param) {
             goto LEAVE;
         }
 
-        //²éÕÒkey
-        json_object* obj_value = json_object_object_get(obj, key.c_str());
-
-        if (is_error(obj_value) || NULL == obj_value) {
-            IVR_TRACE("Î´ÕÒµ½keyÖµ");
-            (*(std::string*)var_reason.pvalue).assign("2");
-            json_object_put(obj);
-            goto LEAVE;
-        }
-
-
         //¼ì²éÊÇ·ñÎªarray
-        if (! json_object_is_type(obj_value, json_type_array)) {
-            IVR_WARN("jsonget array ÖÐ³öÏÖ·ÇarrayÖµ");
+        if (! json_object_is_type(obj, json_type_array)) {
+            IVR_WARN("jsongetarrayÖÐ³öÏÖ·ÇarrayÖµ");
             //TODO: assign what?
             (*(std::string*)var_reason.pvalue).assign("10");
             json_object_put(obj);
@@ -116,7 +103,7 @@ NodeBase* NodeJsonGetArray::run(base_script_t* param) {
 
         int32_t tmp_value_index = atoi(valueindex.c_str());
 
-        int32_t array_len = json_object_array_length(obj_value);
+        int32_t array_len = json_object_array_length(obj);
 
         if (tmp_value_index < 0 || tmp_value_index >= array_len) {
             IVR_WARN("jsonget array ÖÐÏÂ±êÖµÔ½½ç");
@@ -127,10 +114,10 @@ NodeBase* NodeJsonGetArray::run(base_script_t* param) {
             goto LEAVE;
         }
 
-        json_object* obj_sub = json_object_array_get_idx(obj_value, tmp_value_index);
+        json_object* obj_value = json_object_array_get_idx(obj, tmp_value_index);
 
-        if (is_error(obj_sub) || NULL == obj_sub) {
-            IVR_TRACE("Î´ÕÒµ½keyÖÐÏÂ±êÎª%dµÄÖµ", tmp_value_index);
+        if (is_error(obj_value) || NULL == obj_value) {
+            IVR_TRACE("Î´ÕÒµ½ÏÂ±êÎª%dµÄÔªËØ", tmp_value_index);
             //TODO: assign what?
             (*(std::string*)var_reason.pvalue).assign("13");
             json_object_put(obj);
@@ -138,16 +125,23 @@ NodeBase* NodeJsonGetArray::run(base_script_t* param) {
             goto LEAVE;
         }
 
-        //¸ù¾ÝÐèÒª×ª»¯
+        json_type jtype = json_object_get_type(obj_value);
+
         if (0 == strcasecmp(_valuetype.c_str(), PARAMITEM_TYPE_STRING)) {
-            const char* cstr_value = json_object_get_string(obj_sub);
+            if (jtype != json_type_string && jtype != json_type_object
+                    && jtype != json_type_array) {
+                IVR_TRACE("jsonÖµÀàÐÍ´íÎó£¬·Çstring¡¢object¡¢arrayÀàÐÍ");
+                (*(std::string*)var_reason.pvalue).assign("5");
+                json_object_put(obj);
+                goto LEAVE;
+            }
+
+            const char* cstr_value = json_object_get_string(obj_value);
 
             if (NULL == cstr_value) {
-                IVR_TRACE("×ª»»keyÖµ´íÎó");
+                IVR_TRACE("×ª»»Êý×éÖµ´íÎó");
                 (*(std::string*)var_reason.pvalue).assign("3");
                 json_object_put(obj);
-                //json_object_put(obj_value);
-                //json_object_put(obj_sub);
                 goto LEAVE;
             }
 
@@ -155,8 +149,6 @@ NodeBase* NodeJsonGetArray::run(base_script_t* param) {
                 IVR_TRACE("¸³Öµ±äÁ¿ÀàÐÍ´íÎó");
                 (*(std::string*)var_reason.pvalue).assign("4");
                 json_object_put(obj);
-                //json_object_put(obj_value);
-                //json_object_put(obj_sub);
                 goto LEAVE;
             }
 
@@ -166,14 +158,19 @@ NodeBase* NodeJsonGetArray::run(base_script_t* param) {
             json_object_put(obj);
             goto LEAVE;
         } else if (0 == strcasecmp(_valuetype.c_str(), PARAMITEM_TYPE_INT32)) {
-            int32_t int32_value = json_object_get_int(obj_sub);
+            if (jtype != json_type_int) {
+                IVR_TRACE("jsonÖµÀàÐÍ´íÎó£¬·ÇintÀàÐÍ");
+                (*(std::string*)var_reason.pvalue).assign("5");
+                json_object_put(obj);
+                goto LEAVE;
+            }
+
+            int32_t int32_value = json_object_get_int(obj_value);
 
             if (var_value.type != INT32) {
                 IVR_TRACE("¸³Öµ±äÁ¿ÀàÐÍ´íÎó");
                 (*(std::string*)var_reason.pvalue).assign("4");
                 json_object_put(obj);
-                //json_object_put(obj_value);
-                //json_object_put(obj_sub);
                 goto LEAVE;
             }
 
@@ -185,14 +182,19 @@ NodeBase* NodeJsonGetArray::run(base_script_t* param) {
             json_object_put(obj);
             goto LEAVE;
         } else if (0 == strcasecmp(_valuetype.c_str(), PARAMITEM_TYPE_BOOL)) {
-            json_bool bool_value = json_object_get_boolean(obj_sub);
+            if (jtype != json_type_boolean) {
+                IVR_TRACE("jsonÖµÀàÐÍ´íÎó£¬·ÇbooleanÀàÐÍ");
+                (*(std::string*)var_reason.pvalue).assign("5");
+                json_object_put(obj);
+                goto LEAVE;
+            }
+
+            bool bool_value = json_object_get_boolean(obj_value);
 
             if (var_value.type != INT32) {
                 IVR_TRACE("¸³Öµ±äÁ¿ÀàÐÍ´íÎó");
                 (*(std::string*)var_reason.pvalue).assign("4");
                 json_object_put(obj);
-                //json_object_put(obj_value);
-                //json_object_put(obj_sub);
                 goto LEAVE;
             }
 
@@ -210,16 +212,14 @@ NodeBase* NodeJsonGetArray::run(base_script_t* param) {
             IVR_TRACE("Param valuetype is invalid: %s", _valuetype.c_str());
             (*(std::string*)var_reason.pvalue).assign("3");
             json_object_put(obj);
-            //json_object_put(obj_value);
-            //json_object_put(obj_sub);
             goto LEAVE;
         }
     }
 
 LEAVE:
-    IVR_TRACE("%s: Input:%s,Key:%s,ValueType:%s,Value:%s,Reason:%s exit from %s(%s)",
+    IVR_TRACE("%s: Input:%s,ValueType:%s,Value:%s,Reason:%s exit from %s(%s)",
               leave(param->name_var_map).c_str(),
-              input.c_str(), key.c_str(), _valuetype.c_str(), value.c_str(),
+              input.c_str(), _valuetype.c_str(), value.c_str(),
               (*(std::string*)var_reason.pvalue).c_str(), exit, value.c_str());
     return _exit_node_map[exit];
 }
@@ -228,7 +228,6 @@ bool NodeJsonGetArray::load_other() {
     return NodeBase::load_other()
            && valid_str(_key_map, PARAM_INPUT, _input)
            && valid_str(_key_map, PARAM_VALUEINDEX, _valueindex)
-           && valid_str(_key_map, PARAM_KEY, _key)
            && valid_str(_key_map, PARAM_VALUETYPE, _valuetype)
            && valid_str(_key_map, PARAM_VALUE, _value)
            && valid_str(_key_map, PARAM_REASON, _reason);
@@ -237,8 +236,8 @@ bool NodeJsonGetArray::load_other() {
 std::string NodeJsonGetArray::enter(const map<string, variable_t>& vars)const {
     ostringstream ostm;
     ostm << NodeBase::enter(vars);
-    ostm << "Input:" << _input << ",Key:" << _key << ",ValueType:" << _valuetype << ",Value:" << _value
-         << ",Reason:" << _reason;
+    ostm << "Input:" << _input << ",ValueType:" << _valuetype
+         << ",Value:" << _value << ",Reason:" << _reason;
     return ostm.str();
 }
 
@@ -249,8 +248,7 @@ std::string NodeJsonGetArray::leave(const map<string, variable_t>& vars)const {
 }
 
 const char* NodeJsonGetArray::PARAM_INPUT = "input";
-const char* NodeJsonGetArray::PARAM_VALUEINDEX = "valueindex";
-const char* NodeJsonGetArray::PARAM_KEY = "key";
+const char* NodeJsonGetArray::PARAM_VALUEINDEX = "index";
 const char* NodeJsonGetArray::PARAM_VALUETYPE = "valuetype";
 const char* NodeJsonGetArray::PARAM_VALUE = "value";
 const char* NodeJsonGetArray::PARAM_REASON = "reason";
diff --git a/platform/ivr/src/node_requestagent.cpp b/platform/ivr/src/node_requestagent.cpp
index d786a38..da4b188 100644
--- a/platform/ivr/src/node_requestagent.cpp
+++ b/platform/ivr/src/node_requestagent.cpp
@@ -13,13 +13,17 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
+ 
+#include "ivr_data_collection.h"
 #include <node_requestagent.h>
 #include <ivr_timer.h>
 #include "fs_opr.h"
 #include "fs_mgr.h"
 #include <ivr_instance_manager.h>
 
+using ivr::IvrCallDataCollection;
+using ivr::IvrInboundCall;
+
 NodeRequestAgent::NodeRequestAgent(const uint32_t id, const string& name,
                                    const string& type, const string& desc, const key_map_t& keymap)
     : NodeResource(id, name, type, desc, keymap) {
@@ -139,7 +143,15 @@ NodeBase* NodeRequestAgent::run(base_script_t* param) {
                 ims_mgr_t::get_instance()->bind_session_id(param->imssid, param->session_id);
                 param->requestId = 0; // because imssid has changed, so request id must change
                 ims_routerequest_id_t requestid = 0;
-
+                if (reqType == ims_routerequest_type_t::RR_TypeSkill) {
+                    IvrCallDataCollection::instance().set_state(param->session_id, IvrInboundCall::ROUTEBYSKILL, reqargs);
+                }
+                else if(reqType == ims_routerequest_type_t::RR_TypePrivate) {
+                    IvrCallDataCollection::instance().set_state(param->session_id, IvrInboundCall::ROUTEBYAGENTID, "");
+                }
+                else if (reqType == ims_routerequest_type_t::RR_TypePrivateList) {
+                    IvrCallDataCollection::instance().set_state(param->session_id, IvrInboundCall::ROUTEBYAGENTLIST, "");
+                }
                 if (IVR_SUCCESS == ims_mgr_t::get_instance()->route_request(param->imsno, param->imssid, requestid,
                         ims::ServiceTypeT::ServiceACD, timeout, valid_time, reqType,
                         reqargs, 0, caller_uri, callee_uri, buffer)) {
@@ -148,6 +160,7 @@ NodeBase* NodeRequestAgent::run(base_script_t* param) {
                     param->requestId = requestid;
                     exit = EXIT_SUCC;
                 } else {
+                    IvrCallDataCollection::instance().set_state(param->session_id, IvrInboundCall::INFLOW, "");
                     IVR_WARN("route request 2 failed");
                 }
             } else {
@@ -158,6 +171,15 @@ NodeBase* NodeRequestAgent::run(base_script_t* param) {
             break;
         } else {
             ims_routerequest_id_t requestid = 0;
+            if (reqType == ims_routerequest_type_t::RR_TypeSkill) {
+                IvrCallDataCollection::instance().set_state(param->session_id, IvrInboundCall::ROUTEBYSKILL, reqargs);
+            }
+            else if(reqType == ims_routerequest_type_t::RR_TypePrivate) {
+                IvrCallDataCollection::instance().set_state(param->session_id, IvrInboundCall::ROUTEBYAGENTID, "");
+            }
+            else if (reqType == ims_routerequest_type_t::RR_TypePrivateList) {
+                IvrCallDataCollection::instance().set_state(param->session_id, IvrInboundCall::ROUTEBYAGENTLIST, "");
+            }
             int32_t ret = ims_mgr_t::get_instance()->route_request(param->imsno, param->imssid, requestid,
                           ims::ServiceTypeT::ServiceACD, timeout, valid_time, reqType,
                           reqargs, 0, caller_uri, callee_uri, buffer);
@@ -172,17 +194,20 @@ NodeBase* NodeRequestAgent::run(base_script_t* param) {
 
             case IVR_FAIL_IMS_ROUTEREQUEST_REPEATED:
                 // don't try again
+                IvrCallDataCollection::instance().set_state(param->session_id, IvrInboundCall::INFLOW, "");
                 -- retryTimes;
                 break;
 
             case IVR_FAIL_IMS_REQIDINVALIDATE:
             case IVR_FAIL_IMS_SESSIONINVALIDATE:
+                IvrCallDataCollection::instance().set_state(param->session_id, IvrInboundCall::INFLOW, "");
                 // ims may restarted, so must retry again
                 param->imssid = 0;
                 param->imsno = (uint32_t) - 1;
                 param->requestId = 0;
 
             default:
+                IvrCallDataCollection::instance().set_state(param->session_id, IvrInboundCall::INFLOW, "");
                 // don't try again
                 -- retryTimes;
                 break;
diff --git a/platform/ivr/src/node_setappdata.cpp b/platform/ivr/src/node_setappdata.cpp
new file mode 100644
index 0000000..8f1b6fe
--- /dev/null
+++ b/platform/ivr/src/node_setappdata.cpp
@@ -0,0 +1,69 @@
+/*
+ * Copyright 2002-2016 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      CC/LICENSE
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "node_setappdata.h"
+#include "ivr_data_collection.h"
+
+NodeSetAppData::NodeSetAppData(const uint32_t id, const string& name,
+                         const string& type, const string& desc, const key_map_t& keymap)
+    : NodeBase(id, name, type, desc, keymap) {
+}
+
+NodeSetAppData::~NodeSetAppData(void) {
+}
+
+NodeBase* NodeSetAppData::run(base_script_t* param) {
+    const char* exit = EXIT_FAIL;
+    std::string ret = "";
+    IVR_TRACE("%s", enter(param->name_var_map).c_str());
+
+    if (parse_expression(_app_data, param->name_var_map, ret)) {
+        if (ret.length() > 512 || ret.find("\n", 0, ret.length() - 1) != std::string::npos) {
+            exit = EXIT_FAIL;
+			IVR_WARN("appdata is too long(%d)", int(ret.length()));
+        } else {
+            //to do set call data
+            ivr::IvrCallDataCollection::instance().set_appdata(param->session_id, ret);
+			exit = EXIT_SUCC;
+        }
+    } else {
+        IVR_WARN("parse assign expression failed(%s)", _app_data.c_str());
+    }
+    IVR_TRACE("%s exit from %s",
+              leave(param->name_var_map).c_str(), exit);
+    return _exit_node_map[exit];
+}
+
+bool NodeSetAppData::load_other() {
+    return NodeBase::load_other()
+           && valid_str(_key_map, _s_param_input, _app_data);
+}
+
+const char* NodeSetAppData::_s_param_input = "appdata";
+
+std::string NodeSetAppData::enter(const map<string, variable_t>& vars)const {
+    ostringstream ostm;
+    ostm << NodeBase::enter(vars);
+    ostm << "appdata:" << _app_data;
+    return ostm.str();
+}
+
+std::string NodeSetAppData::leave(const map<string, variable_t>& vars)const {
+    ostringstream ostm;
+    ostm << NodeBase::leave(vars);
+    return ostm.str();
+}
+
diff --git a/platform/ivr/src/node_transagent.cpp b/platform/ivr/src/node_transagent.cpp
index 8e6d19e..42d756c 100644
--- a/platform/ivr/src/node_transagent.cpp
+++ b/platform/ivr/src/node_transagent.cpp
@@ -14,10 +14,12 @@
  * limitations under the License.
  */
 
+#include "ivr_data_collection.h"
 #include <node_transagent.h>
 #include <ivr_instance_manager.h>
 
-
+using ivr::IvrCallDataCollection;
+using ivr::IvrInboundCall;
 NodeTransAgent::NodeTransAgent(const uint32_t id, const string& name,
                                const string& type, const string& desc, const key_map_t& keymap)
     : NodeResource(id, name, type, desc, keymap) {
@@ -41,6 +43,7 @@ NodeBase* NodeTransAgent::run(base_script_t* param) {
     ims_transtype_t ttype;
 
     if (_get_type(_transtype, ttype)) {
+        IvrCallDataCollection::instance().set_state(param->session_id, IvrInboundCall::TRANSAGENT, "");
         if (IVR_SUCCESS == ims_mgr_t::get_instance()->trans_agent(param->imsno, param->imssid,
                 param->requestId, ttype)) {
             IVR_TRACE("trans agent success!");
@@ -52,6 +55,7 @@ NodeBase* NodeTransAgent::run(base_script_t* param) {
             IVR_WARN("trans agent failed!");
         }
     } else {
+        IvrCallDataCollection::instance().set_state(param->session_id, IvrInboundCall::INFLOW, "");
         IVR_WARN("failed to convert %s to trans type!", _transtype.c_str());
     }
 
diff --git a/platform/ivr/src/node_waitevent.cpp b/platform/ivr/src/node_waitevent.cpp
index 56bb92d..573c4e1 100644
--- a/platform/ivr/src/node_waitevent.cpp
+++ b/platform/ivr/src/node_waitevent.cpp
@@ -270,6 +270,9 @@ NodeBase* NodeWaitEvent::run(base_script_t* param) {
                 int32_t evt_name = e->evt_name;
 
                 if (ivr_ims_event_t::IVR_EVT_IMS_ROUTE_RESPONSE == evt_name) {
+                    //Update transfer agentid
+                    *(string*)param->name_var_map[SYS_VAR[sys_var_t::AGENTID]].pvalue 
+                        = e->data.targetAgentId;
                     // ims response event
                     string_build strb;
                     string res = e->data.reason.get_desc();
@@ -280,12 +283,18 @@ NodeBase* NodeWaitEvent::run(base_script_t* param) {
                     "\",\"Agent\":\"" + e->data.targetDevice + "\"}";
                     *(string*)it->second.pvalue = strb.str();
                 } else if (ivr_ims_event_t::IVR_EVT_IMS_NOT_RESPONSE == evt_name) {
+                    //Update transfer agentid
+                    *(string*)param->name_var_map[SYS_VAR[sys_var_t::AGENTID]].pvalue 
+                        = "";
                     string_build strb;
                     strb + "{\"requestID\":\"" + e->data.requstid +
                     "\",\"RequestResult\":\"" + "RouteReasonNotResponse" +
                     "\",\"Agent\":\"" + e->data.targetDevice + "\"}";
                     *(string*)it->second.pvalue = strb.str();
                 } else {
+                    //Update transfer agentid
+                    *(string*)param->name_var_map[SYS_VAR[sys_var_t::AGENTID]].pvalue 
+                        = "";
                     string_build strb;
                     strb + "{\"requestID\":\"" + e->data.requstid +
                     "\",\"RequestResult\":\"" + "Unknown" +
diff --git a/platform/ivr/src/thread_pool.cpp b/platform/ivr/src/thread_pool.cpp
index 2f3dcdf..7c64d0b 100644
--- a/platform/ivr/src/thread_pool.cpp
+++ b/platform/ivr/src/thread_pool.cpp
@@ -64,7 +64,7 @@ void ThreadPool::initialize_threads(uint32_t max_thread_num) {
             //¿ÕÓà20%µÄ×ÊÔ´£¬20%ÒÔÄÚµÄºô½ÐÖ±½Ó¹Ò»ú£¬³¬¹ý20%Ôò²»ÓèÏìÓ¦
             uint32_t tmp = (uint32_t)((double)max_thread_num * 1.2) + 1;
 
-            sem_lock_t lock_threads(_available_threads);
+            sem_lock_t lock_threads(&_available_threads);
 
             for (uint32_t i = _max_thread_num; i < tmp; ++i) {
                 pthread_t tempThread;
@@ -132,7 +132,7 @@ void ThreadPool::destroy_pool(int max_poll_second = 2) {
 
 
 bool ThreadPool::assign_work(WorkerThread* worker_thread) {
-    sem_lock_t lock_sem(_available_threads);
+    sem_lock_t lock_sem(&_available_threads);
 
     if (!lock_sem.wait()) {
         return false;
@@ -155,12 +155,12 @@ bool ThreadPool::assign_work(WorkerThread* worker_thread) {
     IVR_TRACE("unfinished_work = %u", _unfinished_work);
     IVR_TRACE("push worker address:[%p]", worker_thread);
 
-    sem_lock_t lock_work(_available_work);
+    sem_lock_t lock_work(&_available_work);
     return lock_work.post();
 }
 
 bool ThreadPool::fetch_work(WorkerThread** worker) {
-    sem_lock_t lock_work(_available_work);
+    sem_lock_t lock_work(&_available_work);
 
     if (!lock_work.wait()) {
         return false;
@@ -177,7 +177,7 @@ bool ThreadPool::fetch_work(WorkerThread** worker) {
     _worker_queue.pop();
     IVR_TRACE("fetch work (%p)", *worker);
 
-    sem_lock_t lock_thread(_available_threads);
+    sem_lock_t lock_thread(&_available_threads);
     return lock_thread.post();
 }
 
diff --git a/platform/ivr/src/tools.cpp b/platform/ivr/src/tools.cpp
index bbef9ab..127bbd7 100644
--- a/platform/ivr/src/tools.cpp
+++ b/platform/ivr/src/tools.cpp
@@ -15,6 +15,8 @@
  */
 
 #include <errno.h>
+#include <limits> 
+
 #include "tools.h"
 #include "db_pool.h"
 
diff --git a/tools/AgentMonitor/MainFormView.cpp b/tools/AgentMonitor/MainFormView.cpp
index c997e7d..3182899 100644
--- a/tools/AgentMonitor/MainFormView.cpp
+++ b/tools/AgentMonitor/MainFormView.cpp
@@ -411,36 +411,6 @@ void CMainFormView::getSysInfo()
 void CMainFormView::On32771()
 {
 	// TODO: ÔÚ´ËÌí¼ÓÃüÁî´¦Àí³ÌÐò´úÂë
-	/*
-	this->m_agentCtrl.SetMainCTIIP("10.36.159.19");
-	this->m_agentCtrl.SetBackCTIIP("10.36.159.19");
-	this->m_agentCtrl.SetCTIPort(10000);
-	this->m_agentCtrl.SetAgentID("2011");
-	this->m_agentCtrl.SetPassWord("2011123");
-	this->m_agentCtrl.SetDN("1205");
-	this->m_agentCtrl.SetServiceList("×ÉÑ¯");
-	this->m_agentCtrl.SetTimeOut(3000);
-	this->m_agentCtrl.SetAgentTag("");
-	this->m_agentCtrl.SetCustomerTag("agt");
-
-
-	this->m_agentCtrl.SetStatusChangeType(0);
-	this->m_agentCtrl.SetANIChangeType(0);
-	this->m_agentCtrl.SetLogLevel(2);
-	this->m_agentCtrl.SetAutoAnswer(1);
-	this->m_agentCtrl.SetForceSignIn(1);
-	this->m_agentCtrl.SetIsInitial(0);
-	this->m_agentCtrl.SetIsSignIn(0);
-	this->m_agentCtrl.SetIsShowCallOut(1);
-	this->m_agentCtrl.SetIsCallOut(1);
-	this->m_agentCtrl.SetEnableSeniorCall(0);
-
-	this->m_agentCtrl.SetSIPServerIP("10.36.159.60");
-	this->m_agentCtrl.SetSIPServerPort(8060);
-	this->m_agentCtrl.SetPhoneNum("1205");
-	this->m_agentCtrl.SetPhonePwd("1234");
-	this->m_agentCtrl.SetIsSIPPhone(0);
-	*/
 
 	this->getAgentData();
 	this->m_agentCtrl.SetMainCTIIP(this->m_strMainIP);
diff --git a/tools/agentbar/agentbarsrc/CCAgentBar.idl b/tools/agentbar/agentbarsrc/CCAgentBar.idl
index 6d60fdc..f8a27f8 100644
--- a/tools/agentbar/agentbarsrc/CCAgentBar.idl
+++ b/tools/agentbar/agentbarsrc/CCAgentBar.idl
@@ -1,165 +1,166 @@
-// *****************************************************************************
-//  Name:		CCAgentBar.idl£¬ActiveX ¿Ø¼þÏîÄ¿µÄÀàÐÍ¿âÔ´
-//  Author:		Yanhl
-//  Version:	1.0
-// *****************************************************************************
-
-// ´ËÎÄ¼þ½«ÓÉ MIDL ±àÒëÆ÷¹¤¾ß´¦ÀíÒÔ
-//²úÉúÀàÐÍ¿â(CCAgentBar.tlb)£¬¸ÃÀàÐÍ¿â½«³ÉÎª 
-// CCAgentBar.ocx ÖÐµÄ×ÊÔ´¡£
-
-#include <olectl.h>
-#include <idispids.h>
-
-[ uuid(0C996584-8882-4D08-9D29-24F18B9928BA), version(1.0),
-  helpfile("CCAgentBar.hlp"),
-  helpstring("CCAgentBar ActiveX ¿Ø¼þÄ£¿é"),
-  control ]
-library CCAgentBarLib
-{
-	importlib(STDOLE_TLB);
-
-	//  CCCAgentBarCtrl µÄÖ÷µ÷¶È½Ó¿Ú
-
-	[ uuid(72EA8ED1-D4EE-4FE9-9313-BB7257EC19B8),
-	  helpstring("CCAgentBar Control µÄµ÷¶È½Ó¿Ú")]
-	dispinterface _DCCAgentBar
-	{
-		properties:
-		[id(1), helpstring("ÊôÐÔ AgentID")] BSTR AgentID;
-		[id(2), helpstring("ÊôÐÔ PassWord")] BSTR PassWord;
-		[id(3), helpstring("ÊôÐÔ DN")] BSTR DN;
-		[id(4), helpstring("ÊôÐÔ StatusChangeType")] LONG StatusChangeType;
-		[id(5), helpstring("ÊôÐÔ AutoAnswer")] LONG AutoAnswer;
-		[id(6), helpstring("ÊôÐÔ ForceSignIn")] LONG ForceSignIn;
-		[id(7), helpstring("ÊôÐÔ ServiceList")] BSTR ServiceList;
-		[id(8), helpstring("ÊôÐÔ MainCTIIP")] BSTR MainCTIIP;
-		[id(9), helpstring("ÊôÐÔ BackCTIIP")] BSTR BackCTIIP;
-		[id(10), helpstring("ÊôÐÔ CTIPort")] LONG CTIPort;
-		[id(11), helpstring("ÊôÐÔ TimeOut")] LONG TimeOut;
-		[id(12), helpstring("ÊôÐÔ IsInitial")] LONG IsInitial;
-		[id(13), helpstring("ÊôÐÔ IsSignIn")] LONG IsSignIn;
-		[id(14), helpstring("ÊôÐÔ IsSIPPhone")] LONG IsSIPPhone;
-		[id(15), helpstring("ÊôÐÔ SIPServerIP")] BSTR SIPServerIP;
-		[id(16), helpstring("ÊôÐÔ SIPServerPort")] LONG SIPServerPort;
-		[id(17), helpstring("ÊôÐÔ PhoneNum")] BSTR PhoneNum;
-		[id(18), helpstring("ÊôÐÔ PhonePwd")] BSTR PhonePwd;
-		[id(19), helpstring("ÊôÐÔ AgentTag")] BSTR AgentTag;
-		[id(20), helpstring("ÊôÐÔ CustomerTag")] BSTR CustomerTag;
-		[id(21), helpstring("ÊôÐÔ ANIChangeType")] LONG ANIChangeType;
-		[id(22), helpstring("ÊôÐÔ IsShowCallOut")] LONG IsShowCallOut;
-		[id(23), helpstring("ÊôÐÔ IsCallOut")] LONG IsCallOut;
-		[id(24), helpstring("ÊôÐÔ LogLevel")] LONG LogLevel;
-		[id(25), helpstring("ÊôÐÔ EnableSeniorCall")] LONG EnableSeniorCall;
-		[id(26), helpstring("ÊôÐÔ AnyProperty")] BSTR AnyProperty;
-methods:
-		[id(27), helpstring("·½·¨Initial")] LONG Initial(void);
-		[id(28), helpstring("·½·¨UnInitial")] LONG UnInitial(void);
-		[id(29), helpstring("·½·¨SignIn")] LONG SignIn(void);
-		[id(30), helpstring("·½·¨SignOut")] LONG SignOut(void);
-		[id(31), helpstring("·½·¨SetIdle")] LONG SetIdle(void);
-		[id(32), helpstring("·½·¨SetBusy")] LONG SetBusy(void);
-		[id(33), helpstring("·½·¨SetRest")] LONG SetRest(BSTR reason);
-		[id(34), helpstring("·½·¨SetAgentStatus")] LONG SetAgentStatus(LONG agentState, BSTR reason);
-		[id(35), helpstring("·½·¨GetAgentStatus")] LONG GetAgentStatus(void);
-		[id(36), helpstring("·½·¨ResetSkill")] LONG ResetSkill(BSTR skillList);
-		[id(37), helpstring("·½·¨Reset")] LONG Reset(void);
-		[id(38), helpstring("·½·¨MakeCall")] LONG MakeCall(BSTR dest, BSTR showANI, BSTR showDest, LONG isOffhook, LONG type);
-		[id(39), helpstring("·½·¨Answer")] LONG Answer(void);
-		[id(40), helpstring("·½·¨ReleaseCall")] LONG ReleaseCall(void);
-		[id(41), helpstring("·½·¨Hold")] LONG Hold(void);
-		[id(42), helpstring("·½·¨Retrieve")] LONG Retrieve(void);
-		[id(43), helpstring("·½·¨Consult")] LONG Consult(BSTR consultNum, BSTR showANI, BSTR showDest, LONG consultType);
-		[id(44), helpstring("·½·¨Reconnect")] LONG Reconnect(void);
-		[id(45), helpstring("·½·¨Transfer")] LONG Transfer(void);
-		[id(46), helpstring("·½·¨SingleStepTransfer")] LONG SingleStepTransfer(BSTR transferNum, BSTR showANI, BSTR showDest, LONG transferStyle, LONG transferType);
-		[id(47), helpstring("·½·¨Conference")] LONG Conference(void);
-		[id(48), helpstring("·½·¨SetCallData")] LONG SetCallData(BSTR key, BSTR callData);
-		[id(49), helpstring("·½·¨GetCallData")] BSTR GetCallData(BSTR key);
-		[id(50), helpstring("·½·¨ForceOut")] LONG ForceOut(BSTR agentID);
-		[id(51), helpstring("·½·¨ForceIdle")] LONG ForceIdle(BSTR agentID);
-		[id(52), helpstring("·½·¨ForceBusy")] LONG ForceBusy(BSTR agentID);
-		[id(53), helpstring("·½·¨Listen")] LONG Listen(BSTR agentID, BSTR showANI, BSTR showDest);
-		[id(54), helpstring("·½·¨StopListen")] LONG StopListen(BSTR agentID);
-		[id(55), helpstring("·½·¨Insert")] LONG Insert(BSTR agentID, BSTR showANI, BSTR showDest);
-		[id(56), helpstring("·½·¨StopInsert")] LONG StopInsert(BSTR agentID);
-		[id(57), helpstring("·½·¨SwitchInsertorListen")] LONG SwitchInsertorListen(BSTR agentID, BSTR showANI, BSTR showDest);
-		[id(58), helpstring("·½·¨Break")] LONG Break(BSTR agentID);
-		[id(59), helpstring("·½·¨SendDTMF")] LONG SendDTMF(BSTR dtmf);
-		[id(60), helpstring("·½·¨MuteOn")] LONG MuteOn(void);
-		[id(61), helpstring("·½·¨MuteOff")] LONG MuteOff(void);
-		[id(62), helpstring("·½·¨GetAgentDetailByAgentID")] BSTR GetAgentDetailByAgentID(BSTR agentID);
-		[id(63), helpstring("·½·¨GetAgentDetailByAgentDN")] BSTR GetAgentDetailByAgentDN(BSTR agentDN);
-		[id(64), helpstring("·½·¨GetAgentDetailsByAgentIDs")] BSTR GetAgentDetailsByAgentIDs(BSTR agentIDs);
-		[id(65), helpstring("·½·¨GetAgentDetailsByAgentDNs")] BSTR GetAgentDetailsByAgentDNs(BSTR agentDNs);
-		[id(66), helpstring("·½·¨GetRecordFileName")] BSTR GetRecordFileName(void);
-		[id(67), helpstring("·½·¨GetRestReason")] BSTR GetRestReason(void);
-		[id(68), helpstring("·½·¨GetAgentNumberBySkill")] LONG GetAgentNumberBySkill(BSTR skill);
-		[id(69), helpstring("·½·¨GetAgentDetailsBySkill")] BSTR GetAgentDetailsBySkill(BSTR skill);
-		[id(70), helpstring("·½·¨GetSkillWaitingNumber")] BSTR GetSkillWaitingNumber(BSTR skill);
-		[id(71), helpstring("·½·¨GetSkillWaitingCallInfo")] BSTR GetSkillWaitingCallInfo(BSTR skill);
-		[id(72), helpstring("·½·¨GetPrivateQueue")] BSTR GetPrivateQueue(BSTR agentID);
-		[id(73), helpstring("·½·¨GetSysInfo")] BSTR GetSysInfo(void);
-		[id(74), helpstring("·½·¨GetCallingNo")] BSTR GetCallingNo(void);
-		[id(75), helpstring("·½·¨GetOrgCallingNo")] BSTR GetOrgCallingNo(void);
-		[id(76), helpstring("·½·¨GetCalledNo")] BSTR GetCalledNo(void);
-		[id(77), helpstring("·½·¨GetOrgCalledNo")] BSTR GetOrgCalledNo(void);
-		[id(78), helpstring("·½·¨SynchronizeCTITime")] LONG SynchronizeCTITime(void);
-		[id(79), helpstring("·½·¨GetPromptByErrorCode")] BSTR GetPromptByErrorCode(LONG errCode);
-		[id(80), helpstring("·½·¨JumptheQueue")] LONG JumptheQueue(LONGLONG requestId);
-		[id(81), helpstring("·½·¨TransIVR")] LONG TransIVR(BSTR transferNum);
-		[id(82), helpstring("·½·¨TransIVREx")] LONG TransIVREx(BSTR callerNum, BSTR transferNum);
-	};
-
-	//  CCCAgentBarCtrl µÄÊÂ¼þµ÷¶È½Ó¿Ú
-
-	[ uuid(7AE6BDA7-9F41-4C75-9F71-FF055A167DC2),
-	  helpstring("CCAgentBar Control µÄÊÂ¼þ½Ó¿Ú") ]
-	dispinterface _DCCAgentBarEvents
-	{
-		properties:
-			//  ÊÂ¼þ½Ó¿ÚÃ»ÓÐÈÎºÎÊôÐÔ
-
-		methods:
-		[id(1)] void OnUnLogin(           LONG eventID, BSTR callID, LONGLONG contactID, LONG partyNum, BSTR otherParty, LONG otherPartyAttribute, BSTR originatingParty, BSTR originalANI, BSTR originalDNIS, LONG reason, LONGLONG timestamp);
-		[id(2)] void OnReady(             LONG eventID, BSTR callID, LONGLONG contactID, LONG partyNum, BSTR otherParty, LONG otherPartyAttribute, BSTR originatingParty, BSTR originalANI, BSTR originalDNIS, LONG reason, LONGLONG timestamp);
-		[id(3)] void OnBusy(              LONG eventID, BSTR callID, LONGLONG contactID, LONG partyNum, BSTR otherParty, LONG otherPartyAttribute, BSTR originatingParty, BSTR originalANI, BSTR originalDNIS, LONG reason, LONGLONG timestamp);
-		[id(4)] void OnRest(              LONG eventID, BSTR callID, LONGLONG contactID, LONG partyNum, BSTR otherParty, LONG otherPartyAttribute, BSTR originatingParty, BSTR originalANI, BSTR originalDNIS, LONG reason, LONGLONG timestamp);
-		[id(5)] void OnLock(              LONG eventID, BSTR callID, LONGLONG contactID, LONG partyNum, BSTR otherParty, LONG otherPartyAttribute, BSTR originatingParty, BSTR originalANI, BSTR originalDNIS, LONG reason, LONGLONG timestamp);
-		[id(6)] void OnAlerting(          LONG eventID, BSTR callID, LONGLONG contactID, LONG partyNum, BSTR otherParty, LONG otherPartyAttribute, BSTR originatingParty, BSTR originalANI, BSTR originalDNIS, LONG reason, LONGLONG timestamp);
-		[id(7)] void OnHarfAlerting(      LONG eventID, BSTR callID, LONGLONG contactID, LONG partyNum, BSTR otherParty, LONG otherPartyAttribute, BSTR originatingParty, BSTR originalANI, BSTR originalDNIS, LONG reason, LONGLONG timestamp);
-		[id(8)] void OnConnecting(        LONG eventID, BSTR callID, LONGLONG contactID, LONG partyNum, BSTR otherParty, LONG otherPartyAttribute, BSTR originatingParty, BSTR originalANI, BSTR originalDNIS, LONG reason, LONGLONG timestamp);
-		[id(9)] void OnConnected(         LONG eventID, BSTR callID, LONGLONG contactID, LONG partyNum, BSTR otherParty, LONG otherPartyAttribute, BSTR originatingParty, BSTR originalANI, BSTR originalDNIS, LONG reason, LONGLONG timestamp);
-		[id(10)] void OnHarfConnected(    LONG eventID, BSTR callID, LONGLONG contactID, LONG partyNum, BSTR otherParty, LONG otherPartyAttribute, BSTR originatingParty, BSTR originalANI, BSTR originalDNIS, LONG reason, LONGLONG timestamp);
-		[id(11)] void OnInternalConnected(LONG eventID, BSTR callID, LONGLONG contactID, LONG partyNum, BSTR otherParty, LONG otherPartyAttribute, BSTR originatingParty, BSTR originalANI, BSTR originalDNIS, LONG reason, LONGLONG timestamp);
-		[id(12)] void OnSuspended(        LONG eventID, BSTR callID, LONGLONG contactID, LONG partyNum, BSTR otherParty, LONG otherPartyAttribute, BSTR originatingParty, BSTR originalANI, BSTR originalDNIS, LONG reason, LONGLONG timestamp);
-		[id(13)] void OnConsultConnecting(LONG eventID, BSTR callID, LONGLONG contactID, LONG partyNum, BSTR otherParty, LONG otherPartyAttribute, BSTR originatingParty, BSTR originalANI, BSTR originalDNIS, LONG reason, LONGLONG timestamp);
-		[id(14)] void OnConsultConnected( LONG eventID, BSTR callID, LONGLONG contactID, LONG partyNum, BSTR otherParty, LONG otherPartyAttribute, BSTR originatingParty, BSTR originalANI, BSTR originalDNIS, LONG reason, LONGLONG timestamp);
-		[id(15)] void OnConference(       LONG eventID, BSTR callID, LONGLONG contactID, LONG partyNum, BSTR otherParty, LONG otherPartyAttribute, BSTR originatingParty, BSTR originalANI, BSTR originalDNIS, LONG reason, LONGLONG timestamp);
-		[id(16)] void OnMonitor(          LONG eventID, BSTR callID, LONGLONG contactID, LONG partyNum, BSTR otherParty, LONG otherPartyAttribute, BSTR originatingParty, BSTR originalANI, BSTR originalDNIS, LONG reason, LONGLONG timestamp);
-		[id(17)] void OnInsert(           LONG eventID, BSTR callID, LONGLONG contactID, LONG partyNum, BSTR otherParty, LONG otherPartyAttribute, BSTR originatingParty, BSTR originalANI, BSTR originalDNIS, LONG reason, LONGLONG timestamp);
-		[id(18)] void OnMonitored(        LONG eventID, BSTR callID, LONGLONG contactID, LONG partyNum, BSTR otherParty, LONG otherPartyAttribute, BSTR originatingParty, BSTR originalANI, BSTR originalDNIS, LONG reason, LONGLONG timestamp);
-		[id(19)] void OnInserted(         LONG eventID, BSTR callID, LONGLONG contactID, LONG partyNum, BSTR otherParty, LONG otherPartyAttribute, BSTR originatingParty, BSTR originalANI, BSTR originalDNIS, LONG reason, LONGLONG timestamp);
-		[id(20)] void OnBeginRecord(      BSTR callID, LONGLONG contactID, BSTR filename, LONG reason, LONGLONG timestamp);
-		[id(21)] void OnEndRecord(        BSTR callID, LONGLONG contactID, BSTR filename, LONG reason, LONGLONG timestamp);
-		[id(22)] void OnInprivatequeue(   BSTR callID, LONGLONG contactID, LONGLONG requestID, BSTR originalANI, BSTR originalDNIS, LONG reason, LONGLONG timestamp);
-		[id(23)] void OnOutprivatequeue(  BSTR callID, LONGLONG contactID, LONGLONG requestID, BSTR originalANI, BSTR originalDNIS, LONG reason, LONGLONG timestamp);
-		[id(24)] void OnCTIDisconnect(    BSTR callID, LONGLONG contactID, BSTR originalANI, BSTR originalDNIS, LONG reason, LONGLONG timestamp);
-		[id(25)] void OnCTIMasterChanged( BSTR callID, LONGLONG contactID, BSTR originalANI, BSTR originalDNIS, LONG reason, LONGLONG timestamp);
-		[id(26)] void OnOperationFailed(  BSTR callID, LONGLONG contactID, BSTR originalANI, BSTR originalDNIS, LONG reason, LONGLONG timestamp);
-		[id(27)] void OnBeforeOutCall(    BSTR otherParty, LONG otherPartyAttribute, BSTR originalANI, BSTR originalDNIS, LONG reason, LONGLONG timestamp); // reason:  1,makecall; 2,consult; 3,singtrans
-        [id(28)] void OnHeartbeat(LONGLONG timestamp);
-        [id(29)] void OnBtnStatus(LONGLONG btnStatus, BSTR info);
-    };
-
-	//  CCCAgentBarCtrl µÄÀàÐÅÏ¢
-
-	[ uuid(6D4733B4-8E49-495C-9F2B-27606CEB20E3),
-	  helpstring("CCAgentBar Control"), control ]
-	coclass CCAgentBar
-	{
-		[default] dispinterface _DCCAgentBar;
-		[default, source] dispinterface _DCCAgentBarEvents;
-	};
-
-};
+// *****************************************************************************
+//  Name:		CCAgentBar.idl£¬ActiveX ¿Ø¼þÏîÄ¿µÄÀàÐÍ¿âÔ´
+//  Author:		Yanhl
+//  Version:	1.0
+// *****************************************************************************
+
+// ´ËÎÄ¼þ½«ÓÉ MIDL ±àÒëÆ÷¹¤¾ß´¦ÀíÒÔ
+//²úÉúÀàÐÍ¿â(CCAgentBar.tlb)£¬¸ÃÀàÐÍ¿â½«³ÉÎª 
+// CCAgentBar.ocx ÖÐµÄ×ÊÔ´¡£
+
+#include <olectl.h>
+#include <idispids.h>
+
+[ uuid(0C996584-8882-4D08-9D29-24F18B9928BA), version(1.0),
+  helpfile("CCAgentBar.hlp"),
+  helpstring("CCAgentBar ActiveX ¿Ø¼þÄ£¿é"),
+  control ]
+library CCAgentBarLib
+{
+	importlib(STDOLE_TLB);
+
+	//  CCCAgentBarCtrl µÄÖ÷µ÷¶È½Ó¿Ú
+
+	[ uuid(72EA8ED1-D4EE-4FE9-9313-BB7257EC19B8),
+	  helpstring("CCAgentBar Control µÄµ÷¶È½Ó¿Ú")]
+	dispinterface _DCCAgentBar
+	{
+		properties:
+		[id(1), helpstring("ÊôÐÔ AgentID")] BSTR AgentID;
+		[id(2), helpstring("ÊôÐÔ PassWord")] BSTR PassWord;
+		[id(3), helpstring("ÊôÐÔ DN")] BSTR DN;
+		[id(4), helpstring("ÊôÐÔ StatusChangeType")] LONG StatusChangeType;
+		[id(5), helpstring("ÊôÐÔ AutoAnswer")] LONG AutoAnswer;
+		[id(6), helpstring("ÊôÐÔ ForceSignIn")] LONG ForceSignIn;
+		[id(7), helpstring("ÊôÐÔ ServiceList")] BSTR ServiceList;
+		[id(8), helpstring("ÊôÐÔ MainCTIIP")] BSTR MainCTIIP;
+		[id(9), helpstring("ÊôÐÔ BackCTIIP")] BSTR BackCTIIP;
+		[id(10), helpstring("ÊôÐÔ CTIPort")] LONG CTIPort;
+		[id(11), helpstring("ÊôÐÔ TimeOut")] LONG TimeOut;
+		[id(12), helpstring("ÊôÐÔ IsInitial")] LONG IsInitial;
+		[id(13), helpstring("ÊôÐÔ IsSignIn")] LONG IsSignIn;
+		[id(14), helpstring("ÊôÐÔ IsSIPPhone")] LONG IsSIPPhone;
+		[id(15), helpstring("ÊôÐÔ SIPServerIP")] BSTR SIPServerIP;
+		[id(16), helpstring("ÊôÐÔ SIPServerPort")] LONG SIPServerPort;
+		[id(17), helpstring("ÊôÐÔ PhoneNum")] BSTR PhoneNum;
+		[id(18), helpstring("ÊôÐÔ PhonePwd")] BSTR PhonePwd;
+		[id(19), helpstring("ÊôÐÔ AgentTag")] BSTR AgentTag;
+		[id(20), helpstring("ÊôÐÔ CustomerTag")] BSTR CustomerTag;
+		[id(21), helpstring("ÊôÐÔ ANIChangeType")] LONG ANIChangeType;
+		[id(22), helpstring("ÊôÐÔ IsShowCallOut")] LONG IsShowCallOut;
+		[id(23), helpstring("ÊôÐÔ IsCallOut")] LONG IsCallOut;
+		[id(24), helpstring("ÊôÐÔ LogLevel")] LONG LogLevel;
+		[id(25), helpstring("ÊôÐÔ EnableSeniorCall")] LONG EnableSeniorCall;
+		[id(26), helpstring("ÊôÐÔ AnyProperty")] BSTR AnyProperty;
+methods:
+		[id(27), helpstring("·½·¨Initial")] LONG Initial(void);
+		[id(28), helpstring("·½·¨UnInitial")] LONG UnInitial(void);
+		[id(29), helpstring("·½·¨SignIn")] LONG SignIn(void);
+		[id(30), helpstring("·½·¨SignOut")] LONG SignOut(void);
+		[id(31), helpstring("·½·¨SetIdle")] LONG SetIdle(void);
+		[id(32), helpstring("·½·¨SetBusy")] LONG SetBusy(void);
+		[id(33), helpstring("·½·¨SetRest")] LONG SetRest(BSTR reason);
+		[id(34), helpstring("·½·¨SetAgentStatus")] LONG SetAgentStatus(LONG agentState, BSTR reason);
+		[id(35), helpstring("·½·¨GetAgentStatus")] LONG GetAgentStatus(void);
+		[id(36), helpstring("·½·¨ResetSkill")] LONG ResetSkill(BSTR skillList);
+		[id(37), helpstring("·½·¨Reset")] LONG Reset(void);
+		[id(38), helpstring("·½·¨MakeCall")] LONG MakeCall(BSTR dest, BSTR showANI, BSTR showDest, LONG isOffhook, LONG type);
+		[id(39), helpstring("·½·¨Answer")] LONG Answer(void);
+		[id(40), helpstring("·½·¨ReleaseCall")] LONG ReleaseCall(void);
+		[id(41), helpstring("·½·¨Hold")] LONG Hold(void);
+		[id(42), helpstring("·½·¨Retrieve")] LONG Retrieve(void);
+		[id(43), helpstring("·½·¨Consult")] LONG Consult(BSTR consultNum, BSTR showANI, BSTR showDest, LONG consultType);
+		[id(44), helpstring("·½·¨Reconnect")] LONG Reconnect(void);
+		[id(45), helpstring("·½·¨Transfer")] LONG Transfer(void);
+		[id(46), helpstring("·½·¨SingleStepTransfer")] LONG SingleStepTransfer(BSTR transferNum, BSTR showANI, BSTR showDest, LONG transferStyle, LONG transferType);
+		[id(47), helpstring("·½·¨Conference")] LONG Conference(void);
+		[id(48), helpstring("·½·¨SetCallData")] LONG SetCallData(BSTR key, BSTR callData);
+		[id(49), helpstring("·½·¨GetCallData")] BSTR GetCallData(BSTR key);
+		[id(50), helpstring("·½·¨ForceOut")] LONG ForceOut(BSTR agentID);
+		[id(51), helpstring("·½·¨ForceIdle")] LONG ForceIdle(BSTR agentID);
+		[id(52), helpstring("·½·¨ForceBusy")] LONG ForceBusy(BSTR agentID);
+		[id(53), helpstring("·½·¨Listen")] LONG Listen(BSTR agentID, BSTR showANI, BSTR showDest);
+		[id(54), helpstring("·½·¨StopListen")] LONG StopListen(BSTR agentID);
+		[id(55), helpstring("·½·¨Insert")] LONG Insert(BSTR agentID, BSTR showANI, BSTR showDest);
+		[id(56), helpstring("·½·¨StopInsert")] LONG StopInsert(BSTR agentID);
+		[id(57), helpstring("·½·¨SwitchInsertorListen")] LONG SwitchInsertorListen(BSTR agentID, BSTR showANI, BSTR showDest);
+		[id(58), helpstring("·½·¨Break")] LONG Break(BSTR agentID);
+		[id(59), helpstring("·½·¨SendDTMF")] LONG SendDTMF(BSTR dtmf);
+		[id(60), helpstring("·½·¨MuteOn")] LONG MuteOn(void);
+		[id(61), helpstring("·½·¨MuteOff")] LONG MuteOff(void);
+		[id(62), helpstring("·½·¨GetAgentDetailByAgentID")] BSTR GetAgentDetailByAgentID(BSTR agentID);
+		[id(63), helpstring("·½·¨GetAgentDetailByAgentDN")] BSTR GetAgentDetailByAgentDN(BSTR agentDN);
+		[id(64), helpstring("·½·¨GetAgentDetailsByAgentIDs")] BSTR GetAgentDetailsByAgentIDs(BSTR agentIDs);
+		[id(65), helpstring("·½·¨GetAgentDetailsByAgentDNs")] BSTR GetAgentDetailsByAgentDNs(BSTR agentDNs);
+		[id(66), helpstring("·½·¨GetRecordFileName")] BSTR GetRecordFileName(void);
+		[id(67), helpstring("·½·¨GetRestReason")] BSTR GetRestReason(void);
+		[id(68), helpstring("·½·¨GetAgentNumberBySkill")] LONG GetAgentNumberBySkill(BSTR skill);
+		[id(69), helpstring("·½·¨GetAgentDetailsBySkill")] BSTR GetAgentDetailsBySkill(BSTR skill);
+		[id(70), helpstring("·½·¨GetSkillWaitingNumber")] BSTR GetSkillWaitingNumber(BSTR skill);
+		[id(71), helpstring("·½·¨GetSkillWaitingCallInfo")] BSTR GetSkillWaitingCallInfo(BSTR skill);
+		[id(72), helpstring("·½·¨GetPrivateQueue")] BSTR GetPrivateQueue(BSTR agentID);
+		[id(73), helpstring("·½·¨GetSysInfo")] BSTR GetSysInfo(void);
+		[id(74), helpstring("·½·¨GetCallingNo")] BSTR GetCallingNo(void);
+		[id(75), helpstring("·½·¨GetOrgCallingNo")] BSTR GetOrgCallingNo(void);
+		[id(76), helpstring("·½·¨GetCalledNo")] BSTR GetCalledNo(void);
+		[id(77), helpstring("·½·¨GetOrgCalledNo")] BSTR GetOrgCalledNo(void);
+		[id(78), helpstring("·½·¨SynchronizeCTITime")] LONG SynchronizeCTITime(void);
+		[id(79), helpstring("·½·¨GetPromptByErrorCode")] BSTR GetPromptByErrorCode(LONG errCode);
+		[id(80), helpstring("·½·¨JumptheQueue")] LONG JumptheQueue(LONGLONG requestId);
+		[id(81), helpstring("·½·¨TransIVR")] LONG TransIVR(BSTR transferNum);
+		[id(82), helpstring("·½·¨TransIVREx")] LONG TransIVREx(BSTR callerNum, BSTR transferNum);
+		[id(83), helpstring("·½·¨SinglestepTransferNum")] BSTR GetSinglestepTransferNum(void);
+	};
+
+	//  CCCAgentBarCtrl µÄÊÂ¼þµ÷¶È½Ó¿Ú
+
+	[ uuid(7AE6BDA7-9F41-4C75-9F71-FF055A167DC2),
+	  helpstring("CCAgentBar Control µÄÊÂ¼þ½Ó¿Ú") ]
+	dispinterface _DCCAgentBarEvents
+	{
+		properties:
+			//  ÊÂ¼þ½Ó¿ÚÃ»ÓÐÈÎºÎÊôÐÔ
+
+		methods:
+		[id(1)] void OnUnLogin(           LONG eventID, BSTR callID, LONGLONG contactID, LONG partyNum, BSTR otherParty, LONG otherPartyAttribute, BSTR originatingParty, BSTR originalANI, BSTR originalDNIS, LONG reason, LONGLONG timestamp);
+		[id(2)] void OnReady(             LONG eventID, BSTR callID, LONGLONG contactID, LONG partyNum, BSTR otherParty, LONG otherPartyAttribute, BSTR originatingParty, BSTR originalANI, BSTR originalDNIS, LONG reason, LONGLONG timestamp);
+		[id(3)] void OnBusy(              LONG eventID, BSTR callID, LONGLONG contactID, LONG partyNum, BSTR otherParty, LONG otherPartyAttribute, BSTR originatingParty, BSTR originalANI, BSTR originalDNIS, LONG reason, LONGLONG timestamp);
+		[id(4)] void OnRest(              LONG eventID, BSTR callID, LONGLONG contactID, LONG partyNum, BSTR otherParty, LONG otherPartyAttribute, BSTR originatingParty, BSTR originalANI, BSTR originalDNIS, LONG reason, LONGLONG timestamp, BSTR restReson);
+		[id(5)] void OnLock(              LONG eventID, BSTR callID, LONGLONG contactID, LONG partyNum, BSTR otherParty, LONG otherPartyAttribute, BSTR originatingParty, BSTR originalANI, BSTR originalDNIS, LONG reason, LONGLONG timestamp);
+		[id(6)] void OnAlerting(          LONG eventID, BSTR callID, LONGLONG contactID, LONG partyNum, BSTR otherParty, LONG otherPartyAttribute, BSTR originatingParty, BSTR originalANI, BSTR originalDNIS, LONG reason, LONGLONG timestamp);
+		[id(7)] void OnHarfAlerting(      LONG eventID, BSTR callID, LONGLONG contactID, LONG partyNum, BSTR otherParty, LONG otherPartyAttribute, BSTR originatingParty, BSTR originalANI, BSTR originalDNIS, LONG reason, LONGLONG timestamp);
+		[id(8)] void OnConnecting(        LONG eventID, BSTR callID, LONGLONG contactID, LONG partyNum, BSTR otherParty, LONG otherPartyAttribute, BSTR originatingParty, BSTR originalANI, BSTR originalDNIS, LONG reason, LONGLONG timestamp);
+		[id(9)] void OnConnected(         LONG eventID, BSTR callID, LONGLONG contactID, LONG partyNum, BSTR otherParty, LONG otherPartyAttribute, BSTR originatingParty, BSTR originalANI, BSTR originalDNIS, LONG reason, LONGLONG timestamp);
+		[id(10)] void OnHarfConnected(    LONG eventID, BSTR callID, LONGLONG contactID, LONG partyNum, BSTR otherParty, LONG otherPartyAttribute, BSTR originatingParty, BSTR originalANI, BSTR originalDNIS, LONG reason, LONGLONG timestamp);
+		[id(11)] void OnInternalConnected(LONG eventID, BSTR callID, LONGLONG contactID, LONG partyNum, BSTR otherParty, LONG otherPartyAttribute, BSTR originatingParty, BSTR originalANI, BSTR originalDNIS, LONG reason, LONGLONG timestamp);
+		[id(12)] void OnSuspended(        LONG eventID, BSTR callID, LONGLONG contactID, LONG partyNum, BSTR otherParty, LONG otherPartyAttribute, BSTR originatingParty, BSTR originalANI, BSTR originalDNIS, LONG reason, LONGLONG timestamp);
+		[id(13)] void OnConsultConnecting(LONG eventID, BSTR callID, LONGLONG contactID, LONG partyNum, BSTR otherParty, LONG otherPartyAttribute, BSTR originatingParty, BSTR originalANI, BSTR originalDNIS, LONG reason, LONGLONG timestamp);
+		[id(14)] void OnConsultConnected( LONG eventID, BSTR callID, LONGLONG contactID, LONG partyNum, BSTR otherParty, LONG otherPartyAttribute, BSTR originatingParty, BSTR originalANI, BSTR originalDNIS, LONG reason, LONGLONG timestamp);
+		[id(15)] void OnConference(       LONG eventID, BSTR callID, LONGLONG contactID, LONG partyNum, BSTR otherParty, LONG otherPartyAttribute, BSTR originatingParty, BSTR originalANI, BSTR originalDNIS, LONG reason, LONGLONG timestamp);
+		[id(16)] void OnMonitor(          LONG eventID, BSTR callID, LONGLONG contactID, LONG partyNum, BSTR otherParty, LONG otherPartyAttribute, BSTR originatingParty, BSTR originalANI, BSTR originalDNIS, LONG reason, LONGLONG timestamp);
+		[id(17)] void OnInsert(           LONG eventID, BSTR callID, LONGLONG contactID, LONG partyNum, BSTR otherParty, LONG otherPartyAttribute, BSTR originatingParty, BSTR originalANI, BSTR originalDNIS, LONG reason, LONGLONG timestamp);
+		[id(18)] void OnMonitored(        LONG eventID, BSTR callID, LONGLONG contactID, LONG partyNum, BSTR otherParty, LONG otherPartyAttribute, BSTR originatingParty, BSTR originalANI, BSTR originalDNIS, LONG reason, LONGLONG timestamp);
+		[id(19)] void OnInserted(         LONG eventID, BSTR callID, LONGLONG contactID, LONG partyNum, BSTR otherParty, LONG otherPartyAttribute, BSTR originatingParty, BSTR originalANI, BSTR originalDNIS, LONG reason, LONGLONG timestamp);
+		[id(20)] void OnBeginRecord(      BSTR callID, LONGLONG contactID, BSTR filename, LONG reason, LONGLONG timestamp);
+		[id(21)] void OnEndRecord(        BSTR callID, LONGLONG contactID, BSTR filename, LONG reason, LONGLONG timestamp);
+		[id(22)] void OnInprivatequeue(   BSTR callID, LONGLONG contactID, LONGLONG requestID, BSTR originalANI, BSTR originalDNIS, LONG reason, LONGLONG timestamp);
+		[id(23)] void OnOutprivatequeue(  BSTR callID, LONGLONG contactID, LONGLONG requestID, BSTR originalANI, BSTR originalDNIS, LONG reason, LONGLONG timestamp);
+		[id(24)] void OnCTIDisconnect(    BSTR callID, LONGLONG contactID, BSTR originalANI, BSTR originalDNIS, LONG reason, LONGLONG timestamp);
+		[id(25)] void OnCTIMasterChanged( BSTR callID, LONGLONG contactID, BSTR originalANI, BSTR originalDNIS, LONG reason, LONGLONG timestamp);
+		[id(26)] void OnOperationFailed(  BSTR callID, LONGLONG contactID, BSTR originalANI, BSTR originalDNIS, LONG reason, LONGLONG timestamp);
+		[id(27)] void OnBeforeOutCall(    BSTR otherParty, LONG otherPartyAttribute, BSTR originalANI, BSTR originalDNIS, LONG reason, LONGLONG timestamp); // reason:  1,makecall; 2,consult; 3,singtrans
+        [id(28)] void OnHeartbeat(LONGLONG timestamp);
+        [id(29)] void OnBtnStatus(LONGLONG btnStatus, BSTR info);
+    };
+
+	//  CCCAgentBarCtrl µÄÀàÐÅÏ¢
+
+	[ uuid(6D4733B4-8E49-495C-9F2B-27606CEB20E3),
+	  helpstring("CCAgentBar Control"), control ]
+	coclass CCAgentBar
+	{
+		[default] dispinterface _DCCAgentBar;
+		[default, source] dispinterface _DCCAgentBarEvents;
+	};
+
+};
diff --git a/tools/agentbar/agentbarsrc/CCAgentBar.ncb b/tools/agentbar/agentbarsrc/CCAgentBar.ncb
deleted file mode 100644
index 8370ae0..0000000
Binary files a/tools/agentbar/agentbarsrc/CCAgentBar.ncb and /dev/null differ
diff --git a/tools/agentbar/agentbarsrc/CCAgentBar.rc b/tools/agentbar/agentbarsrc/CCAgentBar.rc
index 3869d12..a1ef10a 100644
--- a/tools/agentbar/agentbarsrc/CCAgentBar.rc
+++ b/tools/agentbar/agentbarsrc/CCAgentBar.rc
@@ -92,58 +92,58 @@ END
 //
 
 IDB_CCAGENTBAR          BITMAP                  "res\\CCAgentBarCtrl.bmp"
-IDB_BMP_SIGNIN          BITMAP                  "res\\ÓÐÐ§_Ç©Èë.bmp"
-IDB_BMP_SIGNOUT         BITMAP                  "res\\ÓÐÐ§_Ç©³ö.bmp"
-IDB_BMP_ANSWER          BITMAP                  "res\\ÓÐÐ§_½ÓÌý.bmp"
-IDB_BMP_CALLOUT         BITMAP                  "res\\ÓÐÐ§_ºô³ö.bmp"
-IDB_BMP_SENDDTMF        BITMAP                  "res\\ÓÐÐ§_²¦´ò·Ö»ú.bmp"
-IDB_BMP_HANGUP          BITMAP                  "res\\ÓÐÐ§_¹Ò¶Ï.bmp"
-IDB_BMP_HOLD            BITMAP                  "res\\ÓÐÐ§_±£³Ö.bmp"
-IDB_BMP_RETRIEVE        BITMAP                  "res\\ÓÐÐ§_±£³Ö½Ó»Ø.bmp"
-IDB_BMP_CONSULT         BITMAP                  "res\\ÓÐÐ§_×ÉÑ¯.bmp"
-IDB_BMP_RECONNECT       BITMAP                  "res\\ÓÐÐ§_×ÉÑ¯½Ó»Ø.bmp"
-IDB_BMP_TRANSFER        BITMAP                  "res\\ÓÐÐ§_×ÉÑ¯×ªÒÆ.bmp"
-IDB_BMP_CONFERENCE      BITMAP                  "res\\ÓÐÐ§_×ÉÑ¯»áÒé.bmp"
-IDB_BMP_SSTRANSFER      BITMAP                  "res\\ÓÐÐ§_Í¨»°×ªÒÆ.bmp"
-IDB_BMP_REST            BITMAP                  "res\\ÓÐÐ§_ÐÝÏ¢.bmp"
-IDB_BMP_READY           BITMAP                  "res\\ÓÐÐ§_½ÓÌý¾ÍÐ÷.bmp"
-IDB_BMP_BUSY            BITMAP                  "res\\ÓÐÐ§_ºô³ö¾ÍÐ÷.bmp"
-IDB_BMP_SKILLCHANGE     BITMAP                  "res\\ÓÐÐ§_¼¼ÄÜÇÐ»».bmp"
-IDB_BMP_FENGE           BITMAP                  "res\\·Ö¸ô·û.bmp"
-IDB_BMP_MS_SIGNIN       BITMAP                  "res\\Êó±ê¾­¹ý_Ç©Èë.bmp"
-IDB_BMP_MS_SIGNOUT      BITMAP                  "res\\Êó±ê¾­¹ý_Ç©³ö.bmp"
-IDB_BMP_MS_ANSWER       BITMAP                  "res\\Êó±ê¾­¹ý_½ÓÌý.bmp"
-IDB_BMP_MS_CALLOUT      BITMAP                  "res\\Êó±ê¾­¹ý_ºô³ö.bmp"
-IDB_BMP_MS_SENDDTMF     BITMAP                  "res\\Êó±ê¾­¹ý_²¦´ò·Ö»ú.bmp"
-IDB_BMP_MS_HANGUP       BITMAP                  "res\\Êó±ê¾­¹ý_¹Ò¶Ï.bmp"
-IDB_BMP_MS_HOLD         BITMAP                  "res\\Êó±ê¾­¹ý_±£³Ö.bmp"
-IDB_BMP_MS_RETRIEVE     BITMAP                  "res\\Êó±ê¾­¹ý_±£³Ö½Ó»Ø.bmp"
-IDB_BMP_MS_CONSULT      BITMAP                  "res\\Êó±ê¾­¹ý_×ÉÑ¯.bmp"
-IDB_BMP_MS_RECONNECT    BITMAP                  "res\\Êó±ê¾­¹ý_×ÉÑ¯½Ó»Ø.bmp"
-IDB_BMP_MS_TRANSFER     BITMAP                  "res\\Êó±ê¾­¹ý_×ÉÑ¯×ªÒÆ.bmp"
-IDB_BMP_MS_CONFERENCE   BITMAP                  "res\\Êó±ê¾­¹ý_×ÉÑ¯»áÒé.bmp"
-IDB_BMP_MS_SSTRANSFER   BITMAP                  "res\\Êó±ê¾­¹ý_Í¨»°×ªÒÆ.bmp"
-IDB_BMP_MS_REST         BITMAP                  "res\\Êó±ê¾­¹ý_ÐÝÏ¢.bmp"
-IDB_BMP_MS_READY        BITMAP                  "res\\Êó±ê¾­¹ý_½ÓÌý¾ÍÐ÷.bmp"
-IDB_BMP_MS_BUSY         BITMAP                  "res\\Êó±ê¾­¹ý_ºô³ö¾ÍÐ÷.bmp"
-IDB_BMP_MS_SKILLCHANGE  BITMAP                  "res\\Êó±ê¾­¹ý_¼¼ÄÜÇÐ»».bmp"
-IDB_BMP_IN_SIGNIN       BITMAP                  "res\\ÎÞÐ§_Ç©Èë.bmp"
-IDB_BMP_IN_SIGNOUT      BITMAP                  "res\\ÎÞÐ§_Ç©³ö.bmp"
-IDB_BMP_IN_ANSWER       BITMAP                  "res\\ÎÞÐ§_½ÓÌý.bmp"
-IDB_BMP_IN_CALLOUT      BITMAP                  "res\\ÎÞÐ§_ºô³ö.bmp"
-IDB_BMP_IN_SENDDTMF     BITMAP                  "res\\ÎÞÐ§_²¦´ò·Ö»ú.bmp"
-IDB_BMP_IN_HANGUP       BITMAP                  "res\\ÎÞÐ§_¹Ò¶Ï.bmp"
-IDB_BMP_IN_HOLD         BITMAP                  "res\\ÎÞÐ§_±£³Ö.bmp"
-IDB_BMP_IN_RETRIEVE     BITMAP                  "res\\ÎÞÐ§_±£³Ö½Ó»Ø.bmp"
-IDB_BMP_IN_CONSULT      BITMAP                  "res\\ÎÞÐ§_×ÉÑ¯.bmp"
-IDB_BMP_IN_RECONNECT    BITMAP                  "res\\ÎÞÐ§_×ÉÑ¯½Ó»Ø.bmp"
-IDB_BMP_IN_TRANSFER     BITMAP                  "res\\ÎÞÐ§_×ÉÑ¯×ªÒÆ.bmp"
-IDB_BMP_IN_CONFERENCE   BITMAP                  "res\\ÎÞÐ§_×ÉÑ¯»áÒé.bmp"
-IDB_BMP_IN_SSTRANSFER   BITMAP                  "res\\ÎÞÐ§_Í¨»°×ªÒÆ.bmp"
-IDB_BMP_IN_REST         BITMAP                  "res\\ÎÞÐ§_ÐÝÏ¢.bmp"
-IDB_BMP_IN_READY        BITMAP                  "res\\ÎÞÐ§_½ÓÌý¾ÍÐ÷.bmp"
-IDB_BMP_IN_BUSY         BITMAP                  "res\\ÎÞÐ§_ºô³ö¾ÍÐ÷.bmp"
-IDB_BMP_IN_SKILLCHANGE  BITMAP                  "res\\ÎÞÐ§_¼¼ÄÜÇÐ»».bmp"
+IDB_BMP_SIGNIN          BITMAP                  "res\\valid_signin.bmp"
+IDB_BMP_SIGNOUT         BITMAP                  "res\\valid_signout.bmp"
+IDB_BMP_ANSWER          BITMAP                  "res\\valid_answer.bmp"
+IDB_BMP_CALLOUT         BITMAP                  "res\\valid_callout.bmp"
+IDB_BMP_SENDDTMF        BITMAP                  "res\\valid_dtmf.bmp"
+IDB_BMP_HANGUP          BITMAP                  "res\\valid_hangup.bmp"
+IDB_BMP_HOLD            BITMAP                  "res\\valid_hold.bmp"
+IDB_BMP_RETRIEVE        BITMAP                  "res\\valid_retrieve.bmp"
+IDB_BMP_CONSULT         BITMAP                  "res\\valid_consult.bmp"
+IDB_BMP_RECONNECT       BITMAP                  "res\\valid_reconnect.bmp"
+IDB_BMP_TRANSFER        BITMAP                  "res\\valid_transfer.bmp"
+IDB_BMP_CONFERENCE      BITMAP                  "res\\valid_conference.bmp"
+IDB_BMP_SSTRANSFER      BITMAP                  "res\\valid_sstransfer.bmp"
+IDB_BMP_REST            BITMAP                  "res\\valid_rest.bmp"
+IDB_BMP_READY           BITMAP                  "res\\valid_ready.bmp"
+IDB_BMP_BUSY            BITMAP                  "res\\valid_busy.bmp"
+IDB_BMP_SKILLCHANGE     BITMAP                  "res\\valid_skillchange.bmp"
+IDB_BMP_FENGE           BITMAP                  "res\\split.bmp"
+IDB_BMP_MS_SIGNIN       BITMAP                  "res\\over_signin.bmp"
+IDB_BMP_MS_SIGNOUT      BITMAP                  "res\\over_signout.bmp"
+IDB_BMP_MS_ANSWER       BITMAP                  "res\\over_answer.bmp"
+IDB_BMP_MS_CALLOUT      BITMAP                  "res\\over_callout.bmp"
+IDB_BMP_MS_SENDDTMF     BITMAP                  "res\\over_dtmf.bmp"
+IDB_BMP_MS_HANGUP       BITMAP                  "res\\over_hangup.bmp"
+IDB_BMP_MS_HOLD         BITMAP                  "res\\over_hold.bmp"
+IDB_BMP_MS_RETRIEVE     BITMAP                  "res\\over_retrieve.bmp"
+IDB_BMP_MS_CONSULT      BITMAP                  "res\\over_consult.bmp"
+IDB_BMP_MS_RECONNECT    BITMAP                  "res\\over_reconnect.bmp"
+IDB_BMP_MS_TRANSFER     BITMAP                  "res\\over_transfer.bmp"
+IDB_BMP_MS_CONFERENCE   BITMAP                  "res\\over_conference.bmp"
+IDB_BMP_MS_SSTRANSFER   BITMAP                  "res\\over_sstransfer.bmp"
+IDB_BMP_MS_REST         BITMAP                  "res\\over_rest.bmp"
+IDB_BMP_MS_READY        BITMAP                  "res\\over_ready.bmp"
+IDB_BMP_MS_BUSY         BITMAP                  "res\\over_busy.bmp"
+IDB_BMP_MS_SKILLCHANGE  BITMAP                  "res\\over_skillchange.bmp"
+IDB_BMP_IN_SIGNIN       BITMAP                  "res\\invalid_signin.bmp"
+IDB_BMP_IN_SIGNOUT      BITMAP                  "res\\invalid_signout.bmp"
+IDB_BMP_IN_ANSWER       BITMAP                  "res\\invalid_answer.bmp"
+IDB_BMP_IN_CALLOUT      BITMAP                  "res\\invalid_callout.bmp"
+IDB_BMP_IN_SENDDTMF     BITMAP                  "res\\invalid_dtmf.bmp"
+IDB_BMP_IN_HANGUP       BITMAP                  "res\\invalid_hangup.bmp"
+IDB_BMP_IN_HOLD         BITMAP                  "res\\invalid_hold.bmp"
+IDB_BMP_IN_RETRIEVE     BITMAP                  "res\\invalid_retrieve.bmp"
+IDB_BMP_IN_CONSULT      BITMAP                  "res\\invalid_consult.bmp"
+IDB_BMP_IN_RECONNECT    BITMAP                  "res\\invalid_reconnect.bmp"
+IDB_BMP_IN_TRANSFER     BITMAP                  "res\\invalid_transfer.bmp"
+IDB_BMP_IN_CONFERENCE   BITMAP                  "res\\invalid_conference.bmp"
+IDB_BMP_IN_SSTRANSFER   BITMAP                  "res\\invalid_sstransfer.bmp"
+IDB_BMP_IN_REST         BITMAP                  "res\\invalid_rest.bmp"
+IDB_BMP_IN_READY        BITMAP                  "res\\invalid_ready.bmp"
+IDB_BMP_IN_BUSY         BITMAP                  "res\\invalid_busy.bmp"
+IDB_BMP_IN_SKILLCHANGE  BITMAP                  "res\\invalid_skillchange.bmp"
 
 /////////////////////////////////////////////////////////////////////////////
 //
@@ -251,9 +251,9 @@ END
 
 // Icon with lowest ID value placed first to ensure application icon
 // remains consistent on all systems.
-IDI_ICON_ALARM          ICON                    "res\\ÌáÊ¾_¾¯¸æ.ICO"
-IDI_ICON_ERROR          ICON                    "res\\ÌáÊ¾_´íÎó.ICO"
-IDI_ICON_INFOMATION     ICON                    "res\\ÌáÊ¾_ÐÅÏ¢.ICO"
+IDI_ICON_ALARM          ICON                    "res\\alert.ICO"
+IDI_ICON_ERROR          ICON                    "res\\error.ICO"
+IDI_ICON_INFOMATION     ICON                    "res\\info.ICO"
 
 /////////////////////////////////////////////////////////////////////////////
 //
diff --git a/tools/agentbar/agentbarsrc/CCAgentBar.vcproj b/tools/agentbar/agentbarsrc/CCAgentBar.vcproj
index 399be0e..eedf8eb 100644
--- a/tools/agentbar/agentbarsrc/CCAgentBar.vcproj
+++ b/tools/agentbar/agentbarsrc/CCAgentBar.vcproj
@@ -226,178 +226,6 @@
 			<File
 				RelativePath=".\CCAgentBar.rc">
 			</File>
-			<Filter
-				Name="picture"
-				Filter="">
-				<File
-					RelativePath=".\res\CCAgentBarCtrl.bmp">
-				</File>
-				<File
-					RelativePath=".\res\·Ö¸ô·û.bmp">
-				</File>
-				<File
-					RelativePath=".\res\ÌáÊ¾_ÐÅÏ¢.ico">
-				</File>
-				<File
-					RelativePath=".\res\ÌáÊ¾_¾¯¸æ.ico">
-				</File>
-				<File
-					RelativePath=".\res\ÌáÊ¾_´íÎó.ico">
-				</File>
-				<File
-					RelativePath=".\res\ÎÞÐ§_ÐÝÏ¢.bmp">
-				</File>
-				<File
-					RelativePath=".\res\ÎÞÐ§_±£³Ö.bmp">
-				</File>
-				<File
-					RelativePath=".\res\ÎÞÐ§_±£³Ö½Ó»Ø.bmp">
-				</File>
-				<File
-					RelativePath=".\res\ÎÞÐ§_ºô³ö.bmp">
-				</File>
-				<File
-					RelativePath=".\res\ÎÞÐ§_ºô³ö¾ÍÐ÷.bmp">
-				</File>
-				<File
-					RelativePath=".\res\ÎÞÐ§_×ÉÑ¯.bmp">
-				</File>
-				<File
-					RelativePath=".\res\ÎÞÐ§_×ÉÑ¯»áÒé.bmp">
-				</File>
-				<File
-					RelativePath=".\res\ÎÞÐ§_×ÉÑ¯½Ó»Ø.bmp">
-				</File>
-				<File
-					RelativePath=".\res\ÎÞÐ§_×ÉÑ¯×ªÒÆ.bmp">
-				</File>
-				<File
-					RelativePath=".\res\ÎÞÐ§_¼¼ÄÜÇÐ»».bmp">
-				</File>
-				<File
-					RelativePath=".\res\ÎÞÐ§_²¦´ò·Ö»ú.bmp">
-				</File>
-				<File
-					RelativePath=".\res\ÎÞÐ§_¹Ò¶Ï.bmp">
-				</File>
-				<File
-					RelativePath=".\res\ÎÞÐ§_½ÓÌý.bmp">
-				</File>
-				<File
-					RelativePath=".\res\ÎÞÐ§_½ÓÌý¾ÍÐ÷.bmp">
-				</File>
-				<File
-					RelativePath=".\res\ÎÞÐ§_Ç©Èë.bmp">
-				</File>
-				<File
-					RelativePath=".\res\ÎÞÐ§_Ç©³ö.bmp">
-				</File>
-				<File
-					RelativePath=".\res\ÎÞÐ§_Í¨»°×ªÒÆ.bmp">
-				</File>
-				<File
-					RelativePath=".\res\ÓÐÐ§_ÐÝÏ¢.bmp">
-				</File>
-				<File
-					RelativePath=".\res\ÓÐÐ§_±£³Ö.bmp">
-				</File>
-				<File
-					RelativePath=".\res\ÓÐÐ§_±£³Ö½Ó»Ø.bmp">
-				</File>
-				<File
-					RelativePath=".\res\ÓÐÐ§_ºô³ö.bmp">
-				</File>
-				<File
-					RelativePath=".\res\ÓÐÐ§_ºô³ö¾ÍÐ÷.bmp">
-				</File>
-				<File
-					RelativePath=".\res\ÓÐÐ§_×ÉÑ¯.bmp">
-				</File>
-				<File
-					RelativePath=".\res\ÓÐÐ§_×ÉÑ¯»áÒé.bmp">
-				</File>
-				<File
-					RelativePath=".\res\ÓÐÐ§_×ÉÑ¯½Ó»Ø.bmp">
-				</File>
-				<File
-					RelativePath=".\res\ÓÐÐ§_×ÉÑ¯×ªÒÆ.bmp">
-				</File>
-				<File
-					RelativePath=".\res\ÓÐÐ§_¼¼ÄÜÇÐ»».bmp">
-				</File>
-				<File
-					RelativePath=".\res\ÓÐÐ§_²¦´ò·Ö»ú.bmp">
-				</File>
-				<File
-					RelativePath=".\res\ÓÐÐ§_¹Ò¶Ï.bmp">
-				</File>
-				<File
-					RelativePath=".\res\ÓÐÐ§_½ÓÌý.bmp">
-				</File>
-				<File
-					RelativePath=".\res\ÓÐÐ§_½ÓÌý¾ÍÐ÷.bmp">
-				</File>
-				<File
-					RelativePath=".\res\ÓÐÐ§_Ç©Èë.bmp">
-				</File>
-				<File
-					RelativePath=".\res\ÓÐÐ§_Ç©³ö.bmp">
-				</File>
-				<File
-					RelativePath=".\res\ÓÐÐ§_Í¨»°×ªÒÆ.bmp">
-				</File>
-				<File
-					RelativePath=".\res\Êó±ê¾­¹ý_ÐÝÏ¢.bmp">
-				</File>
-				<File
-					RelativePath=".\res\Êó±ê¾­¹ý_±£³Ö.bmp">
-				</File>
-				<File
-					RelativePath=".\res\Êó±ê¾­¹ý_±£³Ö½Ó»Ø.bmp">
-				</File>
-				<File
-					RelativePath=".\res\Êó±ê¾­¹ý_ºô³ö.bmp">
-				</File>
-				<File
-					RelativePath=".\res\Êó±ê¾­¹ý_ºô³ö¾ÍÐ÷.bmp">
-				</File>
-				<File
-					RelativePath=".\res\Êó±ê¾­¹ý_×ÉÑ¯.bmp">
-				</File>
-				<File
-					RelativePath=".\res\Êó±ê¾­¹ý_×ÉÑ¯»áÒé.bmp">
-				</File>
-				<File
-					RelativePath=".\res\Êó±ê¾­¹ý_×ÉÑ¯½Ó»Ø.bmp">
-				</File>
-				<File
-					RelativePath=".\res\Êó±ê¾­¹ý_×ÉÑ¯×ªÒÆ.bmp">
-				</File>
-				<File
-					RelativePath=".\res\Êó±ê¾­¹ý_¼¼ÄÜÇÐ»».bmp">
-				</File>
-				<File
-					RelativePath=".\res\Êó±ê¾­¹ý_²¦´ò·Ö»ú.bmp">
-				</File>
-				<File
-					RelativePath=".\res\Êó±ê¾­¹ý_¹Ò¶Ï.bmp">
-				</File>
-				<File
-					RelativePath=".\res\Êó±ê¾­¹ý_½ÓÌý.bmp">
-				</File>
-				<File
-					RelativePath=".\res\Êó±ê¾­¹ý_½ÓÌý¾ÍÐ÷.bmp">
-				</File>
-				<File
-					RelativePath=".\res\Êó±ê¾­¹ý_Ç©Èë.bmp">
-				</File>
-				<File
-					RelativePath=".\res\Êó±ê¾­¹ý_Ç©³ö.bmp">
-				</File>
-				<File
-					RelativePath=".\res\Êó±ê¾­¹ý_Í¨»°×ªÒÆ.bmp">
-				</File>
-			</Filter>
 		</Filter>
 		<Filter
 			Name="Control"
diff --git a/tools/agentbar/agentbarsrc/CCAgentBar.vcxproj b/tools/agentbar/agentbarsrc/CCAgentBar.vcxproj
new file mode 100755
index 0000000..e3cb187
--- /dev/null
+++ b/tools/agentbar/agentbarsrc/CCAgentBar.vcxproj
@@ -0,0 +1,199 @@
+ï»¿<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup Label="ProjectConfigurations">
+    <ProjectConfiguration Include="Debug|Win32">
+      <Configuration>Debug</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|Win32">
+      <Configuration>Release</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Template|Win32">
+      <Configuration>Template</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+  </ItemGroup>
+  <PropertyGroup Label="Globals">
+    <ProjectName>CCAgentBar</ProjectName>
+    <ProjectGuid>{5A7A29A0-C1AF-4BF9-9B7C-941ABF6E2942}</ProjectGuid>
+    <Keyword>MFCActiveXProj</Keyword>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <UseOfMfc>Static</UseOfMfc>
+    <CharacterSet>MultiByte</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <UseOfMfc>Static</UseOfMfc>
+    <CharacterSet>MultiByte</CharacterSet>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+  <ImportGroup Label="ExtensionSettings">
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <PropertyGroup Label="UserMacros" />
+  <PropertyGroup>
+    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\bin\</OutDir>
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Debug\</IntDir>
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</LinkIncremental>
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\bin\</OutDir>
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Release\</IntDir>
+    <EmbedManifest Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</EmbedManifest>
+    <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">CCAgentBard</TargetName>
+    <TargetExt Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.ocx</TargetExt>
+    <TargetExt Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.ocx</TargetExt>
+    <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">CCAgentBar</TargetName>
+  </PropertyGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <ClCompile>
+      <Optimization>Disabled</Optimization>
+      <AdditionalIncludeDirectories>.;..\..\interface\output\acd\include;..\..\interface\output\bgcc\include;..\..\interface\output\bgcc\include\openssl;..\..\interface\output\third\json-cpp\include;..\..\sipphone\output\sdk\inc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <PreprocessorDefinitions>WIN32;_WINDOWS;_DEBUG;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <MinimalRebuild>true</MinimalRebuild>
+      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+      <RuntimeTypeInfo>true</RuntimeTypeInfo>
+      <WarningLevel>Level3</WarningLevel>
+      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
+    </ClCompile>
+    <Link>
+      <AdditionalDependencies>version.lib;acdd.lib;bgccd.lib;json-cppd_0.5.0.lib;PhoneLib-Debug.lib;ssleay32d.lib;libeay32d.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <OutputFile>$(OutDir)CCAgentBard.ocx</OutputFile>
+      <AdditionalLibraryDirectories>..\..\interface\output\acd\lib\win32;..\..\interface\output\bgcc\lib;..\..\interface\output\third\json-cpp\lib\win32;..\..\sipphone\output\sdk\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <IgnoreSpecificDefaultLibraries>%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+      <ModuleDefinitionFile>.\CCAgentBar.def</ModuleDefinitionFile>
+      <DelayLoadDLLs>%(DelayLoadDLLs)</DelayLoadDLLs>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <SubSystem>Windows</SubSystem>
+      <ImportLibrary>$(OutDir)CCAgentBar.lib</ImportLibrary>
+      <TargetMachine>MachineX86</TargetMachine>
+    </Link>
+    <Midl>
+      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <MkTypLibCompatible>false</MkTypLibCompatible>
+      <TypeLibraryName>$(IntDir)$(ProjectName).tlb</TypeLibraryName>
+      <HeaderFileName>$(ProjectName)idl.h</HeaderFileName>
+    </Midl>
+    <PostBuildEvent>
+      <Message>æ‰§è¡Œæ³¨å†Œ</Message>
+      <Command>regsvr32 /s /c "$(TargetPath)"</Command>
+    </PostBuildEvent>
+    <ResourceCompile>
+      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <Culture>0x0804</Culture>
+      <AdditionalIncludeDirectories>$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+    </ResourceCompile>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <ClCompile>
+      <AdditionalIncludeDirectories>.;..\..\interface\output\acd\include;..\..\interface\output\bgcc\include;..\..\interface\output\bgcc\include\openssl;..\..\interface\output\third\json-cpp\include;..\..\sipphone\output\sdk\inc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <PreprocessorDefinitions>WIN32;_WINDOWS;NDEBUG;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+      <RuntimeTypeInfo>true</RuntimeTypeInfo>
+      <WarningLevel>Level3</WarningLevel>
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+    </ClCompile>
+    <Link>
+      <AdditionalDependencies>version.lib;acd.lib;bgcc.lib;json-cpp_0.5.0.lib;PhoneLib-Release.lib;ssleay32d.lib;libeay32d.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <OutputFile>$(OutDir)CCAgentBar.ocx</OutputFile>
+      <AdditionalLibraryDirectories>..\..\interface\output\acd\lib\win32;..\..\interface\output\bgcc\lib;..\..\interface\output\third\json-cpp\lib\win32;..\..\sipphone\output\sdk\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <IgnoreSpecificDefaultLibraries>%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+      <ModuleDefinitionFile>.\CCAgentBar.def</ModuleDefinitionFile>
+      <DelayLoadDLLs>%(DelayLoadDLLs)</DelayLoadDLLs>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <SubSystem>Windows</SubSystem>
+      <OptimizeReferences>true</OptimizeReferences>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <ImportLibrary>$(OutDir)CCAgentBar.lib</ImportLibrary>
+      <TargetMachine>MachineX86</TargetMachine>
+    </Link>
+    <Midl>
+      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <MkTypLibCompatible>false</MkTypLibCompatible>
+      <TypeLibraryName>$(IntDir)$(ProjectName).tlb</TypeLibraryName>
+      <HeaderFileName>$(ProjectName)idl.h</HeaderFileName>
+    </Midl>
+    <PostBuildEvent>
+      <Message>æ‰§è¡Œæ³¨å†Œ</Message>
+      <Command>regsvr32 /s /c "$(TargetPath)"</Command>
+    </PostBuildEvent>
+    <ResourceCompile>
+      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <Culture>0x0804</Culture>
+      <AdditionalIncludeDirectories>$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+    </ResourceCompile>
+  </ItemDefinitionGroup>
+  <ItemGroup>
+    <ClCompile Include="AcdClient.cpp" />
+    <ClCompile Include="CallOut.cpp" />
+    <ClCompile Include="CCAgentBar.cpp" />
+    <ClCompile Include="CCAgentBarCtrl.cpp" />
+    <ClCompile Include="CCAgentBarPropPage.cpp" />
+    <ClCompile Include="CCBar.cpp" />
+    <ClCompile Include="ImgMgr.cpp" />
+    <ClCompile Include="Info.cpp" />
+    <ClCompile Include="SipphoneClient.cpp" />
+    <ClCompile Include="Tool.cpp" />
+    <ClCompile Include="ButtonEx.cpp" />
+    <ClCompile Include="ButtonIcon.cpp" />
+    <ClCompile Include="ButtonXP.cpp" />
+    <ClCompile Include="EditEx.cpp" />
+    <ClCompile Include="StaticEx.cpp" />
+    <ClCompile Include="Logger.cpp" />
+    <ClCompile Include="stdafx.cpp">
+      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
+      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
+    </ClCompile>
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="CCAgentBar.def" />
+    <None Include="..\..\interface\acd\bidl\acd.bidl" />
+    <None Include="..\..\interface\acd\bidl\acdcallback.bidl" />
+    <None Include="..\..\interface\acd\bidl\acdcommon.bidl" />
+    <None Include="ReadMe.txt" />
+  </ItemGroup>
+  <ItemGroup>
+    <Midl Include="CCAgentBar.idl" />
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="AcdClient.h" />
+    <ClInclude Include="CallOut.h" />
+    <ClInclude Include="CCAgentBar.h" />
+    <ClInclude Include="CCAgentBarCtrl.h" />
+    <ClInclude Include="CCAgentBarPropPage.h" />
+    <ClInclude Include="CCBar.h" />
+    <ClInclude Include="ImgMgr.h" />
+    <ClInclude Include="Info.h" />
+    <ClInclude Include="Resource.h" />
+    <ClInclude Include="SipphoneClient.h" />
+    <ClInclude Include="Tool.h" />
+    <ClInclude Include="ButtonEx.h" />
+    <ClInclude Include="ButtonIcon.h" />
+    <ClInclude Include="ButtonXP.h" />
+    <ClInclude Include="EditEx.h" />
+    <ClInclude Include="StaticEx.h" />
+    <ClInclude Include="ConstDef.h" />
+    <ClInclude Include="Logger.h" />
+    <ClInclude Include="stdafx.h" />
+  </ItemGroup>
+  <ItemGroup>
+    <ResourceCompile Include="CCAgentBar.rc" />
+  </ItemGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+  <ImportGroup Label="ExtensionTargets">
+  </ImportGroup>
+  <ProjectExtensions>
+    <VisualStudio>
+      <UserProperties RESOURCE_FILE="CCAgentBar.rc" />
+    </VisualStudio>
+  </ProjectExtensions>
+</Project>
\ No newline at end of file
diff --git a/tools/agentbar/agentbarsrc/CCAgentBarCtrl.cpp b/tools/agentbar/agentbarsrc/CCAgentBarCtrl.cpp
index 58e5670..862a4b0 100644
--- a/tools/agentbar/agentbarsrc/CCAgentBarCtrl.cpp
+++ b/tools/agentbar/agentbarsrc/CCAgentBarCtrl.cpp
@@ -1,2270 +1,2277 @@
-/*
- * Copyright 2002-2014 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      CC/LICENSE
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "CCAgentBarCtrl.h"
-#include "CCAgentBar.h"
-#include "CCAgentBarPropPage.h"
-#include "json.h"
-
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#endif
-
-IMPLEMENT_DYNCREATE(CCCAgentBarCtrl, COleControl)
-
-// ÏûÏ¢Ó³Éä
-BEGIN_MESSAGE_MAP(CCCAgentBarCtrl, COleControl)
-	ON_OLEVERB(AFX_IDS_VERB_PROPERTIES, OnProperties)
-	ON_WM_CREATE()
-	ON_WM_SIZE()
-END_MESSAGE_MAP()
-
-// µ÷¶ÈÓ³Éä
-BEGIN_DISPATCH_MAP(CCCAgentBarCtrl, COleControl)
-	DISP_PROPERTY_EX_ID(CCCAgentBarCtrl, "AgentID", dispidAgentID, GetAgentID, SetAgentID, VT_BSTR)
-	DISP_PROPERTY_EX_ID(CCCAgentBarCtrl, "PassWord", dispidPassWord, GetPassWord, SetPassWord, VT_BSTR)
-	DISP_PROPERTY_EX_ID(CCCAgentBarCtrl, "DN", dispidDN, GetDN, SetDN, VT_BSTR)
-	DISP_PROPERTY_EX_ID(CCCAgentBarCtrl, "StatusChangeType", dispidStatusChangeType, GetStatusChangeType, SetStatusChangeType, VT_I4)
-	DISP_PROPERTY_EX_ID(CCCAgentBarCtrl, "AutoAnswer", dispidAutoAnswer, GetAutoAnswer, SetAutoAnswer, VT_I4)
-	DISP_PROPERTY_EX_ID(CCCAgentBarCtrl, "ForceSignIn", dispidForceSignIn, GetForceSignIn, SetForceSignIn, VT_I4)
-	DISP_PROPERTY_EX_ID(CCCAgentBarCtrl, "ServiceList", dispidServiceList, GetServiceList, SetServiceList, VT_BSTR)
-	DISP_PROPERTY_EX_ID(CCCAgentBarCtrl, "MainCTIIP", dispidMainCTIIP, GetMainCTIIP, SetMainCTIIP, VT_BSTR)
-	DISP_PROPERTY_EX_ID(CCCAgentBarCtrl, "BackCTIIP", dispidBackCTIIP, GetBackCTIIP, SetBackCTIIP, VT_BSTR)
-	DISP_PROPERTY_EX_ID(CCCAgentBarCtrl, "CTIPort", dispidCTIPort, GetCTIPort, SetCTIPort, VT_I4)
-	DISP_PROPERTY_EX_ID(CCCAgentBarCtrl, "TimeOut", dispidTimeOut, GetTimeOut, SetTimeOut, VT_I4)
-	DISP_PROPERTY_EX_ID(CCCAgentBarCtrl, "IsInitial", dispidIsInitial, GetIsInitial, SetIsInitial, VT_I4)
-	DISP_PROPERTY_EX_ID(CCCAgentBarCtrl, "IsSignIn", dispidIsSignIn, GetIsSignIn, SetIsSignIn, VT_I4)
-	DISP_PROPERTY_EX_ID(CCCAgentBarCtrl, "IsSIPPhone", dispidIsSIPPhone, GetIsSIPPhone, SetIsSIPPhone, VT_I4)
-	DISP_PROPERTY_EX_ID(CCCAgentBarCtrl, "SIPServerIP", dispidSIPServerIP, GetSIPServerIP, SetSIPServerIP, VT_BSTR)
-	DISP_PROPERTY_EX_ID(CCCAgentBarCtrl, "SIPServerPort", dispidSIPServerPort, GetSIPServerPort, SetSIPServerPort, VT_I4)
-	DISP_PROPERTY_EX_ID(CCCAgentBarCtrl, "PhoneNum", dispidPhoneNum, GetPhoneNum, SetPhoneNum, VT_BSTR)
-	DISP_PROPERTY_EX_ID(CCCAgentBarCtrl, "PhonePwd", dispidPhonePwd, GetPhonePwd, SetPhonePwd, VT_BSTR)
-	DISP_PROPERTY_EX_ID(CCCAgentBarCtrl, "AgentTag", dispidAgentTag, GetAgentTag, SetAgentTag, VT_BSTR)
-	DISP_PROPERTY_EX_ID(CCCAgentBarCtrl, "CustomerTag", dispidCustomerTag, GetCustomerTag, SetCustomerTag, VT_BSTR)
-	DISP_PROPERTY_EX_ID(CCCAgentBarCtrl, "ANIChangeType", dispidANIChangeType, GetANIChangeType, SetANIChangeType, VT_I4)
-	DISP_PROPERTY_EX_ID(CCCAgentBarCtrl, "IsShowCallOut", dispidIsShowCallOut, GetIsShowCallOut, SetIsShowCallOut, VT_I4)
-	DISP_PROPERTY_EX_ID(CCCAgentBarCtrl, "IsCallOut", dispidIsCallOut, GetIsCallOut, SetIsCallOut, VT_I4)
-	DISP_PROPERTY_EX_ID(CCCAgentBarCtrl, "LogLevel", dispidLogLevel, GetLogLevel, SetLogLevel, VT_I4)
-	DISP_PROPERTY_EX_ID(CCCAgentBarCtrl, "EnableSeniorCall", dispidEnableSeniorCall, GetEnableSeniorCall, SetEnableSeniorCall, VT_I4)
-	DISP_PROPERTY_EX_ID(CCCAgentBarCtrl, "AnyProperty", dispidAnyProperty, GetAnyProperty, SetAnyProperty, VT_BSTR)
-	DISP_FUNCTION_ID(CCCAgentBarCtrl, "Initial", dispidInitial, Initial, VT_I4, VTS_NONE)
-	DISP_FUNCTION_ID(CCCAgentBarCtrl, "UnInitial", dispidUnInitial, UnInitial, VT_I4, VTS_NONE)
-	DISP_FUNCTION_ID(CCCAgentBarCtrl, "SignIn", dispidSignIn, SignIn, VT_I4, VTS_NONE)
-	DISP_FUNCTION_ID(CCCAgentBarCtrl, "SignOut", dispidSignOut, SignOut, VT_I4, VTS_NONE)
-	DISP_FUNCTION_ID(CCCAgentBarCtrl, "SetIdle", dispidSetIdle, SetIdle, VT_I4, VTS_NONE)
-	DISP_FUNCTION_ID(CCCAgentBarCtrl, "SetBusy", dispidSetBusy, SetBusy, VT_I4, VTS_NONE)
-	DISP_FUNCTION_ID(CCCAgentBarCtrl, "SetRest", dispidSetRest, SetRest, VT_I4, VTS_BSTR)
-	DISP_FUNCTION_ID(CCCAgentBarCtrl, "SetAgentStatus", dispidSetAgentStatus, SetAgentStatus, VT_I4, VTS_I4 VTS_BSTR)
-	DISP_FUNCTION_ID(CCCAgentBarCtrl, "GetAgentStatus", dispidGetAgentStatus, GetAgentStatus, VT_I4, VTS_NONE)
-	DISP_FUNCTION_ID(CCCAgentBarCtrl, "ResetSkill", dispidResetSkill, ResetSkill, VT_I4, VTS_BSTR)
-	DISP_FUNCTION_ID(CCCAgentBarCtrl, "Reset", dispidReset, Reset, VT_I4, VTS_NONE)
-	DISP_FUNCTION_ID(CCCAgentBarCtrl, "MakeCall", dispidMakeCall, MakeCall, VT_I4, VTS_BSTR VTS_BSTR VTS_BSTR VTS_I4 VTS_I4)
-	DISP_FUNCTION_ID(CCCAgentBarCtrl, "Answer", dispidAnswer, Answer, VT_I4, VTS_NONE)
-	DISP_FUNCTION_ID(CCCAgentBarCtrl, "ReleaseCall", dispidReleaseCall, ReleaseCall, VT_I4, VTS_NONE)
-	DISP_FUNCTION_ID(CCCAgentBarCtrl, "Hold", dispidHold, Hold, VT_I4, VTS_NONE)
-	DISP_FUNCTION_ID(CCCAgentBarCtrl, "Retrieve", dispidRetrieve, Retrieve, VT_I4, VTS_NONE)
-	DISP_FUNCTION_ID(CCCAgentBarCtrl, "Consult", dispidConsult, Consult, VT_I4, VTS_BSTR VTS_BSTR VTS_BSTR VTS_I4)
-	DISP_FUNCTION_ID(CCCAgentBarCtrl, "Reconnect", dispidReconnect, Reconnect, VT_I4, VTS_NONE)
-	DISP_FUNCTION_ID(CCCAgentBarCtrl, "Transfer", dispidTransfer, Transfer, VT_I4, VTS_NONE)
-	DISP_FUNCTION_ID(CCCAgentBarCtrl, "SingleStepTransfer", dispidSingleStepTransfer, SingleStepTransfer, VT_I4, VTS_BSTR VTS_BSTR VTS_BSTR VTS_I4 VTS_I4)
-	DISP_FUNCTION_ID(CCCAgentBarCtrl, "Conference", dispidConference, Conference, VT_I4, VTS_NONE)
-	DISP_FUNCTION_ID(CCCAgentBarCtrl, "SetCallData", dispidSetCallData, SetCallData, VT_I4, VTS_BSTR VTS_BSTR)
-	DISP_FUNCTION_ID(CCCAgentBarCtrl, "GetCallData", dispidGetCallData, GetCallData, VT_BSTR, VTS_BSTR)
-	DISP_FUNCTION_ID(CCCAgentBarCtrl, "ForceOut", dispidForceOut, ForceOut, VT_I4, VTS_BSTR)
-	DISP_FUNCTION_ID(CCCAgentBarCtrl, "ForceIdle", dispidForceIdle, ForceIdle, VT_I4, VTS_BSTR)
-	DISP_FUNCTION_ID(CCCAgentBarCtrl, "ForceBusy", dispidForceBusy, ForceBusy, VT_I4, VTS_BSTR)
-	DISP_FUNCTION_ID(CCCAgentBarCtrl, "Listen", dispidListen, Listen, VT_I4, VTS_BSTR VTS_BSTR VTS_BSTR)
-	DISP_FUNCTION_ID(CCCAgentBarCtrl, "StopListen", dispidStopListen, StopListen, VT_I4, VTS_BSTR)
-	DISP_FUNCTION_ID(CCCAgentBarCtrl, "Insert", dispidInsert, Insert, VT_I4, VTS_BSTR VTS_BSTR VTS_BSTR)
-	DISP_FUNCTION_ID(CCCAgentBarCtrl, "StopInsert", dispidStopInsert, StopInsert, VT_I4, VTS_BSTR)
-	DISP_FUNCTION_ID(CCCAgentBarCtrl, "SwitchInsertorListen", dispidSwitchInsertorListen, SwitchInsertorListen, VT_I4, VTS_BSTR VTS_BSTR VTS_BSTR)
-	DISP_FUNCTION_ID(CCCAgentBarCtrl, "Break", dispidBreak, Break, VT_I4, VTS_BSTR)
-	DISP_FUNCTION_ID(CCCAgentBarCtrl, "SendDTMF", dispidSendDTMF, SendDTMF, VT_I4, VTS_BSTR)
-	DISP_FUNCTION_ID(CCCAgentBarCtrl, "MuteOn", dispidMuteOn, MuteOn, VT_I4, VTS_NONE)
-	DISP_FUNCTION_ID(CCCAgentBarCtrl, "MuteOff", dispidMuteOff, MuteOff, VT_I4, VTS_NONE)
-	DISP_FUNCTION_ID(CCCAgentBarCtrl, "GetAgentDetailByAgentID", dispidGetAgentDetailByAgentID, GetAgentDetailByAgentID, VT_BSTR, VTS_BSTR)
-	DISP_FUNCTION_ID(CCCAgentBarCtrl, "GetAgentDetailByAgentDN", dispidGetAgentDetailByAgentDN, GetAgentDetailByAgentDN, VT_BSTR, VTS_BSTR)
-	DISP_FUNCTION_ID(CCCAgentBarCtrl, "GetAgentDetailsByAgentIDs", dispidGetAgentDetailsByAgentIDs, GetAgentDetailsByAgentIDs, VT_BSTR, VTS_BSTR)
-	DISP_FUNCTION_ID(CCCAgentBarCtrl, "GetAgentDetailsByAgentDNs", dispidGetAgentDetailsByAgentDNs, GetAgentDetailsByAgentDNs, VT_BSTR, VTS_BSTR)
-	DISP_FUNCTION_ID(CCCAgentBarCtrl, "GetRecordFileName", dispidGetRecordFileName, GetRecordFileName, VT_BSTR, VTS_NONE)
-	DISP_FUNCTION_ID(CCCAgentBarCtrl, "GetRestReason", dispidGetRestReason, GetRestReason, VT_BSTR, VTS_NONE)
-	DISP_FUNCTION_ID(CCCAgentBarCtrl, "GetAgentNumberBySkill", dispidGetAgentNumberBySkill, GetAgentNumberBySkill, VT_I4, VTS_BSTR)
-	DISP_FUNCTION_ID(CCCAgentBarCtrl, "GetAgentDetailsBySkill", dispidGetAgentDetailsBySkill, GetAgentDetailsBySkill, VT_BSTR, VTS_BSTR)
-	DISP_FUNCTION_ID(CCCAgentBarCtrl, "GetSkillWaitingNumber", dispidGetSkillWaitingNumber, GetSkillWaitingNumber, VT_BSTR, VTS_BSTR)
-	DISP_FUNCTION_ID(CCCAgentBarCtrl, "GetSkillWaitingCallInfo", dispidGetSkillWaitingCallInfo, GetSkillWaitingCallInfo, VT_BSTR, VTS_BSTR)
-	DISP_FUNCTION_ID(CCCAgentBarCtrl, "GetPrivateQueue", dispidGetPrivateQueue, GetPrivateQueue, VT_BSTR, VTS_BSTR)
-	DISP_FUNCTION_ID(CCCAgentBarCtrl, "GetSysInfo", dispidGetSysInfo, GetSysInfo, VT_BSTR, VTS_NONE)
-	DISP_FUNCTION_ID(CCCAgentBarCtrl, "GetCallingNo", dispidGetCallingNo, GetCallingNo, VT_BSTR, VTS_NONE)
-	DISP_FUNCTION_ID(CCCAgentBarCtrl, "GetOrgCallingNo", dispidGetOrgCallingNo, GetOrgCallingNo, VT_BSTR, VTS_NONE)
-	DISP_FUNCTION_ID(CCCAgentBarCtrl, "GetCalledNo", dispidGetCalledNo, GetCalledNo, VT_BSTR, VTS_NONE)
-	DISP_FUNCTION_ID(CCCAgentBarCtrl, "GetOrgCalledNo", dispidGetOrgCalledNo, GetOrgCalledNo, VT_BSTR, VTS_NONE)
-	DISP_FUNCTION_ID(CCCAgentBarCtrl, "SynchronizeCTITime", dispidSynchronizeCTITime, SynchronizeCTITime, VT_I4, VTS_NONE)
-	DISP_FUNCTION_ID(CCCAgentBarCtrl, "GetPromptByErrorCode", dispidGetPromptByErrorCode, GetPromptByErrorCode, VT_BSTR, VTS_I4)
-	DISP_FUNCTION_ID(CCCAgentBarCtrl, "JumptheQueue", dispidJumptheQueue, JumptheQueue, VT_I4, VTS_I8)
-	DISP_FUNCTION_ID(CCCAgentBarCtrl, "TransIVR", dispidTransIVR, TransIVR, VT_I4, VTS_BSTR)
-	DISP_FUNCTION_ID(CCCAgentBarCtrl, "TransIVREx", dispidTransIVREx, TransIVREx, VT_I4, VTS_BSTR VTS_BSTR)
-END_DISPATCH_MAP()
-
-// ÊÂ¼þÓ³Éä
-BEGIN_EVENT_MAP(CCCAgentBarCtrl, COleControl)
-	EVENT_CUSTOM_ID("OnUnLogin",           eventidOnUnLogin,           OnUnLogin,           VTS_I4 VTS_BSTR VTS_I8 VTS_I4 VTS_BSTR VTS_I4 VTS_BSTR VTS_BSTR VTS_BSTR VTS_I4 VTS_I8)
-	EVENT_CUSTOM_ID("OnReady",             eventidOnReady,             OnReady,             VTS_I4 VTS_BSTR VTS_I8 VTS_I4 VTS_BSTR VTS_I4 VTS_BSTR VTS_BSTR VTS_BSTR VTS_I4 VTS_I8)
-	EVENT_CUSTOM_ID("OnBusy",              eventidOnBusy,              OnBusy,              VTS_I4 VTS_BSTR VTS_I8 VTS_I4 VTS_BSTR VTS_I4 VTS_BSTR VTS_BSTR VTS_BSTR VTS_I4 VTS_I8)
-	EVENT_CUSTOM_ID("OnRest",              eventidOnRest,              OnRest,              VTS_I4 VTS_BSTR VTS_I8 VTS_I4 VTS_BSTR VTS_I4 VTS_BSTR VTS_BSTR VTS_BSTR VTS_I4 VTS_I8)
-	EVENT_CUSTOM_ID("OnLock",              eventidOnLock,              OnLock,              VTS_I4 VTS_BSTR VTS_I8 VTS_I4 VTS_BSTR VTS_I4 VTS_BSTR VTS_BSTR VTS_BSTR VTS_I4 VTS_I8)
-	EVENT_CUSTOM_ID("OnAlerting",          eventidOnAlerting,          OnAlerting,          VTS_I4 VTS_BSTR VTS_I8 VTS_I4 VTS_BSTR VTS_I4 VTS_BSTR VTS_BSTR VTS_BSTR VTS_I4 VTS_I8)
-	EVENT_CUSTOM_ID("OnHarfAlerting",      eventidOnHarfAlerting,      OnHarfAlerting,      VTS_I4 VTS_BSTR VTS_I8 VTS_I4 VTS_BSTR VTS_I4 VTS_BSTR VTS_BSTR VTS_BSTR VTS_I4 VTS_I8)
-	EVENT_CUSTOM_ID("OnConnecting",        eventidOnConnecting,        OnConnecting,        VTS_I4 VTS_BSTR VTS_I8 VTS_I4 VTS_BSTR VTS_I4 VTS_BSTR VTS_BSTR VTS_BSTR VTS_I4 VTS_I8)
-	EVENT_CUSTOM_ID("OnConnected",         eventidOnConnected,         OnConnected,         VTS_I4 VTS_BSTR VTS_I8 VTS_I4 VTS_BSTR VTS_I4 VTS_BSTR VTS_BSTR VTS_BSTR VTS_I4 VTS_I8)
-	EVENT_CUSTOM_ID("OnHarfConnected",     eventidOnHarfConnected,     OnHarfConnected,     VTS_I4 VTS_BSTR VTS_I8 VTS_I4 VTS_BSTR VTS_I4 VTS_BSTR VTS_BSTR VTS_BSTR VTS_I4 VTS_I8)
-	EVENT_CUSTOM_ID("OnInternalConnected", eventidOnInternalConnected, OnInternalConnected, VTS_I4 VTS_BSTR VTS_I8 VTS_I4 VTS_BSTR VTS_I4 VTS_BSTR VTS_BSTR VTS_BSTR VTS_I4 VTS_I8)
-	EVENT_CUSTOM_ID("OnSuspended",         eventidOnSuspended,         OnSuspended,         VTS_I4 VTS_BSTR VTS_I8 VTS_I4 VTS_BSTR VTS_I4 VTS_BSTR VTS_BSTR VTS_BSTR VTS_I4 VTS_I8)
-	EVENT_CUSTOM_ID("OnConsultConnecting", eventidOnConsultConnecting, OnConsultConnecting, VTS_I4 VTS_BSTR VTS_I8 VTS_I4 VTS_BSTR VTS_I4 VTS_BSTR VTS_BSTR VTS_BSTR VTS_I4 VTS_I8)
-	EVENT_CUSTOM_ID("OnConsultConnected",  eventidOnConsultConnected,  OnConsultConnected,  VTS_I4 VTS_BSTR VTS_I8 VTS_I4 VTS_BSTR VTS_I4 VTS_BSTR VTS_BSTR VTS_BSTR VTS_I4 VTS_I8)
-	EVENT_CUSTOM_ID("OnConference",        eventidOnConference,        OnConference,        VTS_I4 VTS_BSTR VTS_I8 VTS_I4 VTS_BSTR VTS_I4 VTS_BSTR VTS_BSTR VTS_BSTR VTS_I4 VTS_I8)
-	EVENT_CUSTOM_ID("OnMonitor",           eventidOnMonitor,           OnMonitor,           VTS_I4 VTS_BSTR VTS_I8 VTS_I4 VTS_BSTR VTS_I4 VTS_BSTR VTS_BSTR VTS_BSTR VTS_I4 VTS_I8)
-	EVENT_CUSTOM_ID("OnInsert",            eventidOnInsert,            OnInsert,            VTS_I4 VTS_BSTR VTS_I8 VTS_I4 VTS_BSTR VTS_I4 VTS_BSTR VTS_BSTR VTS_BSTR VTS_I4 VTS_I8)
-	EVENT_CUSTOM_ID("OnMonitored",         eventidOnMonitored,         OnMonitored,         VTS_I4 VTS_BSTR VTS_I8 VTS_I4 VTS_BSTR VTS_I4 VTS_BSTR VTS_BSTR VTS_BSTR VTS_I4 VTS_I8)
-	EVENT_CUSTOM_ID("OnInserted",          eventidOnInserted,          OnInserted,          VTS_I4 VTS_BSTR VTS_I8 VTS_I4 VTS_BSTR VTS_I4 VTS_BSTR VTS_BSTR VTS_BSTR VTS_I4 VTS_I8)
-	EVENT_CUSTOM_ID("OnBeginRecord",       eventidOnBeginRecord,       OnBeginRecord,       VTS_BSTR VTS_I8 VTS_BSTR VTS_I4 VTS_I8)
-	EVENT_CUSTOM_ID("OnEndRecord",         eventidOnEndRecord,         OnEndRecord,         VTS_BSTR VTS_I8 VTS_BSTR VTS_I4 VTS_I8)
-	EVENT_CUSTOM_ID("OnInprivatequeue",    eventidOnInprivatequeue,    OnInprivatequeue,    VTS_BSTR VTS_I8 VTS_I8 VTS_BSTR VTS_BSTR VTS_I4 VTS_I8)
-	EVENT_CUSTOM_ID("OnOutprivatequeue",   eventidOnOutprivatequeue,   OnOutprivatequeue,   VTS_BSTR VTS_I8 VTS_I8 VTS_BSTR VTS_BSTR VTS_I4 VTS_I8)
-	EVENT_CUSTOM_ID("OnCTIDisconnect",     eventidOnCTIDisconnect,     OnCTIDisconnect,     VTS_BSTR VTS_I8 VTS_BSTR VTS_BSTR VTS_I4 VTS_I8)
-	EVENT_CUSTOM_ID("OnCTIMasterChanged",  eventidOnCTIMasterChanged,  OnCTIMasterChanged,  VTS_BSTR VTS_I8 VTS_BSTR VTS_BSTR VTS_I4 VTS_I8)
-	EVENT_CUSTOM_ID("OnOperationFailed",   eventidOnOperationFailed,   OnOperationFailed,   VTS_BSTR VTS_I8 VTS_BSTR VTS_BSTR VTS_I4 VTS_I8)
-	EVENT_CUSTOM_ID("OnBeforeOutCall",     eventidOnBeforeOutCall,     OnBeforeOutCall,     VTS_BSTR VTS_I4 VTS_BSTR VTS_BSTR VTS_I4 VTS_I8)
-    EVENT_CUSTOM_ID("OnHeartbeat", eventidOnHeartbeat, OnHeartbeat, VTS_I8)
-    EVENT_CUSTOM_ID("OnBtnStatus", eventidOnBtnStatus, OnBtnStatus, VTS_I8 VTS_BSTR)
-END_EVENT_MAP()
-
-// ÊôÐÔÒ³
-// TODO: °´ÐèÒªÌí¼Ó¸ü¶àÊôÐÔÒ³¡£Çë¼Ç×¡Ôö¼Ó¼ÆÊý£¡
-BEGIN_PROPPAGEIDS(CCCAgentBarCtrl, 1)
-	PROPPAGEID(CCCAgentBarPropPage::guid)
-END_PROPPAGEIDS(CCCAgentBarCtrl)
-
-// ³õÊ¼»¯Àà¹¤³§ºÍ guid
-IMPLEMENT_OLECREATE_EX(CCCAgentBarCtrl, "CCAGENTBAR.CCAgentBarCtrl.1",
-	0x6d4733b4, 0x8e49, 0x495c, 0x9f, 0x2b, 0x27, 0x60, 0x6c, 0xeb, 0x20, 0xe3)
-
-// ¼üÈë¿â ID ºÍ°æ±¾
-IMPLEMENT_OLETYPELIB(CCCAgentBarCtrl, _tlid, _wVerMajor, _wVerMinor)
-
-// ½Ó¿Ú ID
-const IID BASED_CODE IID_DCCAgentBar =
-		{ 0x72EA8ED1, 0xD4EE, 0x4FE9, { 0x93, 0x13, 0xBB, 0x72, 0x57, 0xEC, 0x19, 0xB8 } };
-const IID BASED_CODE IID_DCCAgentBarEvents =
-		{ 0x7AE6BDA7, 0x9F41, 0x4C75, { 0x9F, 0x71, 0xFF, 0x5, 0x5A, 0x16, 0x7D, 0xC2 } };
-
-// ¿Ø¼þÀàÐÍÐÅÏ¢
-static const DWORD BASED_CODE _dwCCAgentBarOleMisc =
-	OLEMISC_ACTIVATEWHENVISIBLE |
-	OLEMISC_SETCLIENTSITEFIRST |
-	OLEMISC_INSIDEOUT |
-	OLEMISC_CANTLINKINSIDE |
-	OLEMISC_RECOMPOSEONRESIZE;
-
-IMPLEMENT_OLECTLTYPE(CCCAgentBarCtrl, IDS_CCAGENTBAR, _dwCCAgentBarOleMisc)
-
-// CCCAgentBarCtrl::CCCAgentBarCtrlFactory::UpdateRegistry -
-// Ìí¼Ó»òÒÆ³ý CCCAgentBarCtrl µÄÏµÍ³×¢²á±íÏî
-BOOL CCCAgentBarCtrl::CCCAgentBarCtrlFactory::UpdateRegistry(BOOL bRegister)
-{
-	// TODO: ÑéÖ¤ÄúµÄ¿Ø¼þÊÇ·ñ·ûºÏµ¥ÔªÄ£ÐÍÏß³Ì´¦Àí¹æÔò¡£
-	// ÓÐ¹Ø¸ü¶àÐÅÏ¢£¬Çë²Î¿¼ MFC ¼¼ÊõËµÃ÷ 64¡£
-	// Èç¹ûÄúµÄ¿Ø¼þ²»·ûºÏµ¥ÔªÄ£ÐÍ¹æÔò£¬Ôò
-	// ±ØÐëÐÞ¸ÄÈçÏÂ´úÂë£¬½«µÚÁù¸ö²ÎÊý´Ó
-	// afxRegApartmentThreading ¸ÄÎª 0¡£
-
-	if (bRegister)
-		return AfxOleRegisterControlClass(
-			AfxGetInstanceHandle(),
-			m_clsid,
-			m_lpszProgID,
-			IDS_CCAGENTBAR,
-			IDB_CCAGENTBAR,
-			afxRegInsertable | afxRegApartmentThreading,
-			_dwCCAgentBarOleMisc,
-			_tlid,
-			_wVerMajor,
-			_wVerMinor);
-	else
-		return AfxOleUnregisterClass(m_clsid, m_lpszProgID);
-}
-
-// CCCAgentBarCtrl::CCCAgentBarCtrl - ¹¹Ôìº¯Êý
-CCCAgentBarCtrl::CCCAgentBarCtrl()
-{
-	InitializeIIDs(&IID_DCCAgentBar, &IID_DCCAgentBarEvents);
-	// TODO: ÔÚ´Ë³õÊ¼»¯¿Ø¼þµÄÊµÀýÊý¾Ý¡£
-
-	this->SetInitialSize(BAR_WIDTH, BAR_HEIGHT);
-	this->SetBorderStyle(0);
-
-	p_m_Bar = new CCCBar(this);
-	Tool::p_Bar = p_m_Bar;
-}
-
-// CCCAgentBarCtrl::~CCCAgentBarCtrl - Îö¹¹º¯Êý
-CCCAgentBarCtrl::~CCCAgentBarCtrl()
-{
-	// TODO: ÔÚ´ËÇåÀí¿Ø¼þµÄÊµÀýÊý¾Ý¡£
-	delete p_m_Bar;
-	p_m_Bar = NULL;
-}
-
-// CCCAgentBarCtrl::OnDraw - »æÍ¼º¯Êý
-void CCCAgentBarCtrl::OnDraw(
-			CDC* pdc, const CRect& rcBounds, const CRect& rcInvalid)
-{
-	if (!pdc)
-		return;
-
-	// TODO: ÓÃÄú×Ô¼ºµÄ»æÍ¼´úÂëÌæ»»ÏÂÃæµÄ´úÂë¡£
-	//pdc->FillRect(rcBounds, CBrush::FromHandle((HBRUSH)GetStockObject(WHITE_BRUSH)));
-	//pdc->Ellipse(rcBounds);
-}
-
-// CCCAgentBarCtrl::DoPropExchange - ³Ö¾ÃÐÔÖ§³Ö
-void CCCAgentBarCtrl::DoPropExchange(CPropExchange* pPX)
-{
-	ExchangeVersion(pPX, MAKELONG(_wVerMinor, _wVerMajor));
-	COleControl::DoPropExchange(pPX);
-
-	// TODO: ÎªÃ¿¸ö³Ö¾ÃµÄ×Ô¶¨ÒåÊôÐÔµ÷ÓÃ PX_ º¯Êý¡£
-	if(pPX->GetVersion() == static_cast<DWORD>(MAKELONG(_wVerMinor, _wVerMajor)))
-	{
-		PX_String(pPX, "AgentID", p_m_Bar->m_strAgentID);
-		PX_String(pPX, "PassWord", p_m_Bar->m_strPassWord);
-		PX_String(pPX, "DN", p_m_Bar->m_strDN);
-
-		long temp = -1;
-		PX_Long(pPX, "StatusChangeType", temp);
-		if(temp != -1)
-		{
-			if(temp < 0 || temp > 1)// ×¢Òâ£¡
-				temp = 0;
-			p_m_Bar->m_intStatusChangeType = temp;
-		}
-
-		PX_Bool(pPX, "AutoAnswer", p_m_Bar->m_intAutoAnswer);
-		PX_Bool(pPX, "ForceSignIn", p_m_Bar->m_intForceSignIn);
-		PX_String(pPX, "ServiceList", p_m_Bar->m_strServiceList);
-		PX_String(pPX, "MainCTIIP", p_m_Bar->m_strMainCTIIP);
-		PX_String(pPX, "BackCTIIP", p_m_Bar->m_strBackCTIIP);
-		PX_Long(pPX, "CTIPort", p_m_Bar->m_intCTIPort);
-		PX_Long(pPX, "TimeOut", p_m_Bar->m_intTimeOut);
-		//IsInitialºÍIsSignInÊÇÖ»¶ÁÊôÐÔ£¬´Ë´¦²»´¦Àí
-		PX_Bool(pPX, "IsSIPPhone", p_m_Bar->m_intIsSIPPhone);
-		PX_String(pPX, "SIPServerIP", p_m_Bar->m_strSIPServerIP);
-		PX_Long(pPX, "SIPServerPort", p_m_Bar->m_intSIPServerPort);
-		PX_String(pPX, "PhoneNum", p_m_Bar->m_strPhoneNum);
-		PX_String(pPX, "PhonePwd", p_m_Bar->m_strPhonePwd);
-		PX_String(pPX, "AgentTag", p_m_Bar->m_strAgentTag);
-		PX_String(pPX, "CustomerTag", p_m_Bar->m_strCustomerTag);
-
-		temp = -1;
-		PX_Long(pPX, "ANIChangeType", temp);
-		if(temp != -1)
-		{
-			if(temp < 0 || temp > 2)// ×¢Òâ£¡
-				temp = 0;
-			p_m_Bar->m_intANIChangeType = static_cast<ANICHANGE>(temp);
-		}
-
-		PX_Bool(pPX, "IsShowCallOut", p_m_Bar->m_intIsShowCallOut);
-		PX_Bool(pPX, "IsCallOut", p_m_Bar->m_intIsCallOut);
-
-		temp = -1;
-		PX_Long(pPX, "LogLevel", temp);
-		if(temp != -1)
-		{
-			if(temp < 0 || temp > 3)// ×¢Òâ£¡
-				temp = 2;
-			p_m_Bar->m_intLogLevel = static_cast<Level>(temp);
-		}
-
-		PX_Bool(pPX, "EnableSeniorCall", p_m_Bar->m_intEnableSeniorCall);
-	}
-}
-
-// CCCAgentBarCtrl::OnResetState - ½«¿Ø¼þÖØÖÃÎªÄ¬ÈÏ×´Ì¬
-void CCCAgentBarCtrl::OnResetState()
-{
-	COleControl::OnResetState();  // ÖØÖÃ DoPropExchange ÖÐÕÒµ½µÄÄ¬ÈÏÖµ
-
-	// TODO: ÔÚ´ËÖØÖÃÈÎÒâÆäËû¿Ø¼þ×´Ì¬¡£
-}
-
-BOOL CCCAgentBarCtrl::OnSetObjectRects(LPCRECT lpRectPos, LPCRECT lpRectClip)
-{
-	// TODO: ÔÚ´ËÌí¼Ó×¨ÓÃ´úÂëºÍ/»òµ÷ÓÃ»ùÀà
-
-	ASSERT(lpRectPos != NULL);
-
-	// Remember the position rectangle for later
-	m_rcPos = *lpRectPos;
-
-	// Calculate complete rectangle including the tracker (if present)
-	CRect rectPos = m_rcPos;
-	if(m_bUIActive && m_pRectTracker != NULL)
-	{
-		// Save new clipping rectangle (for DestroyTracker)
-		if(lpRectClip != NULL)
-			m_pRectTracker->m_rectClip = *lpRectClip;
-
-		// Adjust tracker rectangle to new dimensions
-		CRect rectTmp = rectPos;
-		rectTmp.OffsetRect(-rectTmp.left, -rectTmp.top);
-		m_pRectTracker->m_rect = rectTmp;
-
-		// Adjust the "true" rectangle to include handles/hatching
-		UINT nHandleSize = m_pRectTracker->m_nHandleSize - 1;
-		rectPos.InflateRect(nHandleSize, nHandleSize);
-	}
-
-	// Now clip that rectangle as appropriate
-	CRect rectClip;
-
-	// CHANGE - call your own copy of _GetClippingCoordinates
-	GetClippingCoordinates(rectPos, lpRectClip, rectClip, &m_ptOffset);
-
-	// Move outer window first. then inner window
-	if(!m_bInPlaceSiteWndless)
-	{
-		CWnd* pWndOuter = GetOuterWindow();
-
-		//BEGIN CHANGE
-		if(pWndOuter != NULL)
-			::MoveWindow(pWndOuter->m_hWnd, rectPos.left, rectPos.top, rectPos.Width(), rectPos.Height(), TRUE);
-
-		//END CHANGE								
-		if(pWndOuter != this)
-			MoveWindow(m_ptOffset.x, m_ptOffset.y, rectPos.Width(), rectPos.Height());
-	}
-
-	return TRUE;
-
-	//return COleControl::OnSetObjectRects(lpRectPos, lpRectClip);
-}
-
-void CCCAgentBarCtrl::GetClippingCoordinates(LPCRECT pPosRect, LPCRECT pClipRect, LPRECT pIntersectRect, LPPOINT pOffsetPoint)
-{
-	int clipLeft = 0;
-	int clipTop = 0;
-
-	if(pClipRect == NULL || IsRectEmpty(pClipRect))
-	{
-		CopyRect(pIntersectRect, pPosRect);
-	}
-	else
-	{
-		IntersectRect(pIntersectRect, pPosRect, pClipRect);
-		clipLeft = pClipRect->left;
-		clipTop = pClipRect->top;
-	}
-
-	pOffsetPoint->x = 0;
-	pOffsetPoint->y = 0;
-}
-
-// CCCAgentBarCtrl ÏûÏ¢´¦Àí³ÌÐò
-int CCCAgentBarCtrl::OnCreate(LPCREATESTRUCT lpCreateStruct)
-{
-	if (COleControl::OnCreate(lpCreateStruct) == -1)
-		return -1;
-
-	// TODO:  ÔÚ´ËÌí¼ÓÄú×¨ÓÃµÄ´´½¨´úÂë
-	p_m_Bar->Create(IDD_DIALOG_CCBAR, this);
-
-	//p_m_Bar->MoveWindow(0, 0, BAR_WIDTH, BAR_HEIGHT); //¸ù¾Ý¿Ø¼þµÄ´óÐ¡µ÷Õû½çÃæµÄ´óÐ¡
-	//p_m_Bar->ShowWindow(SW_SHOW);
-
-	return 0;
-}
-
-void CCCAgentBarCtrl::OnSize(UINT nType, int cx, int cy)
-{
-	COleControl::OnSize(nType, cx, cy);
-
-	// TODO: ÔÚ´Ë´¦Ìí¼ÓÏûÏ¢´¦Àí³ÌÐò´úÂë
-	p_m_Bar->MoveWindow(0, 0, BAR_WIDTH, BAR_HEIGHT); //¸ù¾Ý¿Ø¼þµÄ´óÐ¡µ÷Õû½çÃæµÄ´óÐ¡
-	p_m_Bar->ShowWindow(SW_SHOW);
-}
-
-// ÊôÐÔ--------------------------------------------------------------------------------------------------------------
-BSTR CCCAgentBarCtrl::GetAgentID(void)
-{
-	AFX_MANAGE_STATE(AfxGetStaticModuleState());
-
-	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
-
-	return p_m_Bar->m_strAgentID.AllocSysString();
-}
-
-void CCCAgentBarCtrl::SetAgentID(LPCTSTR newVal)
-{
-	AFX_MANAGE_STATE(AfxGetStaticModuleState());
-
-	// TODO: ÔÚ´ËÌí¼ÓÊôÐÔ´¦Àí³ÌÐò´úÂë
-	if(!p_m_Bar->m_intIsSignIn)
-	{
-		p_m_Bar->m_strAgentID = newVal;
-	}
-
-	SetModifiedFlag();
-}
-
-BSTR CCCAgentBarCtrl::GetPassWord(void)
-{
-	AFX_MANAGE_STATE(AfxGetStaticModuleState());
-
-	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
-
-	return p_m_Bar->m_strPassWord.AllocSysString();
-}
-
-void CCCAgentBarCtrl::SetPassWord(LPCTSTR newVal)
-{
-	AFX_MANAGE_STATE(AfxGetStaticModuleState());
-
-	// TODO: ÔÚ´ËÌí¼ÓÊôÐÔ´¦Àí³ÌÐò´úÂë
-	if(!p_m_Bar->m_intIsSignIn)
-	{
-		p_m_Bar->m_strPassWord = newVal;
-	}
-
-	SetModifiedFlag();
-}
-
-BSTR CCCAgentBarCtrl::GetDN(void)
-{
-	AFX_MANAGE_STATE(AfxGetStaticModuleState());
-
-	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
-
-	return p_m_Bar->m_strDN.AllocSysString();
-}
-
-void CCCAgentBarCtrl::SetDN(LPCTSTR newVal)
-{
-	AFX_MANAGE_STATE(AfxGetStaticModuleState());
-
-	// TODO: ÔÚ´ËÌí¼ÓÊôÐÔ´¦Àí³ÌÐò´úÂë
-	if(!p_m_Bar->m_intIsSignIn)
-	{
-		p_m_Bar->m_strDN = newVal;
-	}
-
-	SetModifiedFlag();
-}
-
-LONG CCCAgentBarCtrl::GetStatusChangeType(void)
-{
-	AFX_MANAGE_STATE(AfxGetStaticModuleState());
-
-	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
-
-	return p_m_Bar->m_intStatusChangeType.get_value();
-}
-
-void CCCAgentBarCtrl::SetStatusChangeType(LONG newVal)
-{
-	AFX_MANAGE_STATE(AfxGetStaticModuleState());
-
-	// TODO: ÔÚ´ËÌí¼ÓÊôÐÔ´¦Àí³ÌÐò´úÂë
-	if(!p_m_Bar->m_intIsSignIn)
-	{
-		if(newVal < 0 || newVal > 1)// ×¢Òâ£¡
-			newVal = 0;
-		p_m_Bar->m_intStatusChangeType = newVal;
-	}
-
-	SetModifiedFlag();
-}
-
-LONG CCCAgentBarCtrl::GetAutoAnswer(void)
-{
-	AFX_MANAGE_STATE(AfxGetStaticModuleState());
-
-	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
-
-	return p_m_Bar->m_intAutoAnswer;
-}
-
-void CCCAgentBarCtrl::SetAutoAnswer(LONG newVal)
-{
-	AFX_MANAGE_STATE(AfxGetStaticModuleState());
-
-	// TODO: ÔÚ´ËÌí¼ÓÊôÐÔ´¦Àí³ÌÐò´úÂë
-	if(!p_m_Bar->m_intIsSignIn)
-	{
-		p_m_Bar->m_intAutoAnswer = newVal;
-	}
-
-	SetModifiedFlag();
-}
-
-LONG CCCAgentBarCtrl::GetForceSignIn(void)
-{
-	AFX_MANAGE_STATE(AfxGetStaticModuleState());
-
-	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
-
-	return p_m_Bar->m_intForceSignIn;
-}
-
-void CCCAgentBarCtrl::SetForceSignIn(LONG newVal)
-{
-	AFX_MANAGE_STATE(AfxGetStaticModuleState());
-
-	// TODO: ÔÚ´ËÌí¼ÓÊôÐÔ´¦Àí³ÌÐò´úÂë
-	if(!p_m_Bar->m_intIsSignIn)
-	{
-		p_m_Bar->m_intForceSignIn = newVal;
-	}
-
-	SetModifiedFlag();
-}
-
-BSTR CCCAgentBarCtrl::GetServiceList(void)
-{
-	AFX_MANAGE_STATE(AfxGetStaticModuleState());
-
-	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
-
-	return p_m_Bar->m_strServiceList.AllocSysString();
-}
-
-void CCCAgentBarCtrl::SetServiceList(LPCTSTR newVal)
-{
-	AFX_MANAGE_STATE(AfxGetStaticModuleState());
-
-	// TODO: ÔÚ´ËÌí¼ÓÊôÐÔ´¦Àí³ÌÐò´úÂë
-	if(!p_m_Bar->m_intIsSignIn)
-	{
-		p_m_Bar->m_strServiceList = newVal;
-	}
-
-	SetModifiedFlag();
-}
-
-BSTR CCCAgentBarCtrl::GetMainCTIIP(void)
-{
-	AFX_MANAGE_STATE(AfxGetStaticModuleState());
-
-	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
-
-	return p_m_Bar->m_strMainCTIIP.AllocSysString();
-}
-
-void CCCAgentBarCtrl::SetMainCTIIP(LPCTSTR newVal)
-{
-	AFX_MANAGE_STATE(AfxGetStaticModuleState());
-
-	// TODO: ÔÚ´ËÌí¼ÓÊôÐÔ´¦Àí³ÌÐò´úÂë
-	if(!p_m_Bar->m_intIsSignIn)
-	{
-		p_m_Bar->m_strMainCTIIP = newVal;
-	}
-
-	SetModifiedFlag();
-}
-
-BSTR CCCAgentBarCtrl::GetBackCTIIP(void)
-{
-	AFX_MANAGE_STATE(AfxGetStaticModuleState());
-
-	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
-
-	return p_m_Bar->m_strBackCTIIP.AllocSysString();
-}
-
-void CCCAgentBarCtrl::SetBackCTIIP(LPCTSTR newVal)
-{
-	AFX_MANAGE_STATE(AfxGetStaticModuleState());
-
-	// TODO: ÔÚ´ËÌí¼ÓÊôÐÔ´¦Àí³ÌÐò´úÂë
-	if(!p_m_Bar->m_intIsSignIn)
-	{
-		p_m_Bar->m_strBackCTIIP = newVal;
-	}
-
-	SetModifiedFlag();
-}
-
-LONG CCCAgentBarCtrl::GetCTIPort(void)
-{
-	AFX_MANAGE_STATE(AfxGetStaticModuleState());
-
-	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
-
-	return p_m_Bar->m_intCTIPort;
-}
-
-void CCCAgentBarCtrl::SetCTIPort(LONG newVal)
-{
-	AFX_MANAGE_STATE(AfxGetStaticModuleState());
-
-	// TODO: ÔÚ´ËÌí¼ÓÊôÐÔ´¦Àí³ÌÐò´úÂë
-	if(!p_m_Bar->m_intIsSignIn)
-	{
-		p_m_Bar->m_intCTIPort = newVal;
-	}
-
-	SetModifiedFlag();
-}
-
-LONG CCCAgentBarCtrl::GetTimeOut(void)
-{
-	AFX_MANAGE_STATE(AfxGetStaticModuleState());
-
-	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
-
-	return p_m_Bar->m_intTimeOut;
-}
-
-void CCCAgentBarCtrl::SetTimeOut(LONG newVal)
-{
-	AFX_MANAGE_STATE(AfxGetStaticModuleState());
-
-	// TODO: ÔÚ´ËÌí¼ÓÊôÐÔ´¦Àí³ÌÐò´úÂë
-	if(!p_m_Bar->m_intIsSignIn)
-	{
-		p_m_Bar->m_intTimeOut = newVal;
-	}
-
-	SetModifiedFlag();
-}
-
-LONG CCCAgentBarCtrl::GetIsInitial(void)
-{
-	AFX_MANAGE_STATE(AfxGetStaticModuleState());
-
-	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
-
-	return p_m_Bar->m_intIsInitial;
-}
-
-void CCCAgentBarCtrl::SetIsInitial(LONG newVal)
-{
-	AFX_MANAGE_STATE(AfxGetStaticModuleState());
-
-	// TODO: ÔÚ´ËÌí¼ÓÊôÐÔ´¦Àí³ÌÐò´úÂë
-	// Ö»¶ÁÊôÐÔ£¬´Ë´¦²»´¦Àí
-	//p_m_Bar->m_intIsInitial = newVal;
-
-	SetModifiedFlag();
-}
-
-LONG CCCAgentBarCtrl::GetIsSignIn(void)
-{
-	AFX_MANAGE_STATE(AfxGetStaticModuleState());
-
-	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
-
-	return p_m_Bar->m_intIsSignIn;
-}
-
-void CCCAgentBarCtrl::SetIsSignIn(LONG newVal)
-{
-	AFX_MANAGE_STATE(AfxGetStaticModuleState());
-
-	// TODO: ÔÚ´ËÌí¼ÓÊôÐÔ´¦Àí³ÌÐò´úÂë
-	// Ö»¶ÁÊôÐÔ£¬´Ë´¦²»´¦Àí
-	//p_m_Bar->m_intIsSignIn = newVal;
-
-	SetModifiedFlag();
-}
-
-LONG CCCAgentBarCtrl::GetIsSIPPhone(void)
-{
-	AFX_MANAGE_STATE(AfxGetStaticModuleState());
-
-	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
-
-	return p_m_Bar->m_intIsSIPPhone;
-}
-
-void CCCAgentBarCtrl::SetIsSIPPhone(LONG newVal)
-{
-	AFX_MANAGE_STATE(AfxGetStaticModuleState());
-
-	// TODO: ÔÚ´ËÌí¼ÓÊôÐÔ´¦Àí³ÌÐò´úÂë
-	if(!p_m_Bar->m_intIsInitial)
-	{
-		p_m_Bar->m_intIsSIPPhone = newVal;
-	}
-
-	SetModifiedFlag();
-}
-
-BSTR CCCAgentBarCtrl::GetSIPServerIP(void)
-{
-	AFX_MANAGE_STATE(AfxGetStaticModuleState());
-
-	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
-
-	return p_m_Bar->m_strSIPServerIP.AllocSysString();
-}
-
-void CCCAgentBarCtrl::SetSIPServerIP(LPCTSTR newVal)
-{
-	AFX_MANAGE_STATE(AfxGetStaticModuleState());
-
-	// TODO: ÔÚ´ËÌí¼ÓÊôÐÔ´¦Àí³ÌÐò´úÂë
-	if(!p_m_Bar->m_intIsSignIn)
-	{
-		p_m_Bar->m_strSIPServerIP = newVal;
-	}
-
-	SetModifiedFlag();
-}
-
-LONG CCCAgentBarCtrl::GetSIPServerPort(void)
-{
-	AFX_MANAGE_STATE(AfxGetStaticModuleState());
-
-	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
-
-	return p_m_Bar->m_intSIPServerPort;
-}
-
-void CCCAgentBarCtrl::SetSIPServerPort(LONG newVal)
-{
-	AFX_MANAGE_STATE(AfxGetStaticModuleState());
-
-	// TODO: ÔÚ´ËÌí¼ÓÊôÐÔ´¦Àí³ÌÐò´úÂë
-	if(!p_m_Bar->m_intIsSignIn)
-	{
-		p_m_Bar->m_intSIPServerPort = newVal;
-	}
-
-	SetModifiedFlag();
-}
-
-BSTR CCCAgentBarCtrl::GetPhoneNum(void)
-{
-	AFX_MANAGE_STATE(AfxGetStaticModuleState());
-
-	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
-
-	return p_m_Bar->m_strPhoneNum.AllocSysString();
-}
-
-void CCCAgentBarCtrl::SetPhoneNum(LPCTSTR newVal)
-{
-	AFX_MANAGE_STATE(AfxGetStaticModuleState());
-
-	// TODO: ÔÚ´ËÌí¼ÓÊôÐÔ´¦Àí³ÌÐò´úÂë
-	if(!p_m_Bar->m_intIsSignIn)
-	{
-		p_m_Bar->m_strPhoneNum = newVal;
-	}
-
-	SetModifiedFlag();
-}
-
-BSTR CCCAgentBarCtrl::GetPhonePwd(void)
-{
-	AFX_MANAGE_STATE(AfxGetStaticModuleState());
-
-	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
-
-	return p_m_Bar->m_strPhonePwd.AllocSysString();
-}
-
-void CCCAgentBarCtrl::SetPhonePwd(LPCTSTR newVal)
-{
-	AFX_MANAGE_STATE(AfxGetStaticModuleState());
-
-	// TODO: ÔÚ´ËÌí¼ÓÊôÐÔ´¦Àí³ÌÐò´úÂë
-	if(!p_m_Bar->m_intIsSignIn)
-	{
-		p_m_Bar->m_strPhonePwd = newVal;
-	}
-
-	SetModifiedFlag();
-}
-
-BSTR CCCAgentBarCtrl::GetAgentTag(void)
-{
-	AFX_MANAGE_STATE(AfxGetStaticModuleState());
-
-	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
-
-	return p_m_Bar->m_strAgentTag.AllocSysString();
-}
-
-void CCCAgentBarCtrl::SetAgentTag(LPCTSTR newVal)
-{
-	AFX_MANAGE_STATE(AfxGetStaticModuleState());
-
-	// TODO: ÔÚ´ËÌí¼ÓÊôÐÔ´¦Àí³ÌÐò´úÂë
-	p_m_Bar->m_strAgentTag = newVal;
-
-	SetModifiedFlag();
-}
-
-BSTR CCCAgentBarCtrl::GetCustomerTag(void)
-{
-	AFX_MANAGE_STATE(AfxGetStaticModuleState());
-
-	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
-
-	return p_m_Bar->m_strCustomerTag.AllocSysString();
-}
-
-void CCCAgentBarCtrl::SetCustomerTag(LPCTSTR newVal)
-{
-	AFX_MANAGE_STATE(AfxGetStaticModuleState());
-
-	// TODO: ÔÚ´ËÌí¼ÓÊôÐÔ´¦Àí³ÌÐò´úÂë
-	p_m_Bar->m_strCustomerTag = newVal;
-
-	SetModifiedFlag();
-}
-
-LONG CCCAgentBarCtrl::GetANIChangeType(void)
-{
-	AFX_MANAGE_STATE(AfxGetStaticModuleState());
-
-	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
-
-	return p_m_Bar->m_intANIChangeType;
-}
-
-void CCCAgentBarCtrl::SetANIChangeType(LONG newVal)
-{
-	AFX_MANAGE_STATE(AfxGetStaticModuleState());
-
-	// TODO: ÔÚ´ËÌí¼ÓÊôÐÔ´¦Àí³ÌÐò´úÂë
-	if(newVal < 0 || newVal > 2)// ×¢Òâ£¡
-		newVal = 0;
-	p_m_Bar->m_intANIChangeType = static_cast<ANICHANGE>(newVal);
-
-	SetModifiedFlag();
-}
-
-LONG CCCAgentBarCtrl::GetIsShowCallOut(void)
-{
-	AFX_MANAGE_STATE(AfxGetStaticModuleState());
-
-	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
-
-	return p_m_Bar->m_intIsShowCallOut;
-}
-
-void CCCAgentBarCtrl::SetIsShowCallOut(LONG newVal)
-{
-	AFX_MANAGE_STATE(AfxGetStaticModuleState());
-
-	// TODO: ÔÚ´ËÌí¼ÓÊôÐÔ´¦Àí³ÌÐò´úÂë
-	p_m_Bar->m_intIsShowCallOut = newVal;
-
-	SetModifiedFlag();
-}
-
-LONG CCCAgentBarCtrl::GetIsCallOut(void)
-{
-	AFX_MANAGE_STATE(AfxGetStaticModuleState());
-
-	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
-
-	return p_m_Bar->m_intIsCallOut;
-}
-
-void CCCAgentBarCtrl::SetIsCallOut(LONG newVal)
-{
-	AFX_MANAGE_STATE(AfxGetStaticModuleState());
-
-	// TODO: ÔÚ´ËÌí¼ÓÊôÐÔ´¦Àí³ÌÐò´úÂë
-	p_m_Bar->m_intIsCallOut = newVal;
-
-	SetModifiedFlag();
-}
-
-LONG CCCAgentBarCtrl::GetLogLevel(void)
-{
-	AFX_MANAGE_STATE(AfxGetStaticModuleState());
-
-	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
-
-	return p_m_Bar->m_intLogLevel;
-}
-
-void CCCAgentBarCtrl::SetLogLevel(LONG newVal)
-{
-	AFX_MANAGE_STATE(AfxGetStaticModuleState());
-
-	// TODO: ÔÚ´ËÌí¼ÓÊôÐÔ´¦Àí³ÌÐò´úÂë
-	if(!p_m_Bar->m_intIsInitial)
-	{
-		if(newVal < 0 || newVal > 3)// ×¢Òâ£¡
-			newVal = 2;
-		p_m_Bar->m_intLogLevel = static_cast<Level>(newVal);
-	}
-
-	SetModifiedFlag();
-}
-
-LONG CCCAgentBarCtrl::GetEnableSeniorCall(void)
-{
-	AFX_MANAGE_STATE(AfxGetStaticModuleState());
-
-	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
-
-	return p_m_Bar->m_intEnableSeniorCall;
-}
-
-void CCCAgentBarCtrl::SetEnableSeniorCall(LONG newVal)
-{
-	AFX_MANAGE_STATE(AfxGetStaticModuleState());
-
-	// TODO: ÔÚ´ËÌí¼ÓÊôÐÔ´¦Àí³ÌÐò´úÂë
-	if(!p_m_Bar->m_intIsSignIn)
-	{
-		p_m_Bar->m_intEnableSeniorCall = newVal;
-	}
-
-	SetModifiedFlag();
-}
-
-BSTR CCCAgentBarCtrl::GetAnyProperty(void)
-{
-	AFX_MANAGE_STATE(AfxGetStaticModuleState());
-
-	CString strResult;
-
-	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
-
-	return strResult.AllocSysString();
-}
-
-void CCCAgentBarCtrl::SetAnyProperty(LPCTSTR newVal)
-{
-	AFX_MANAGE_STATE(AfxGetStaticModuleState());
-
-	// TODO: ÔÚ´ËÌí¼ÓÊôÐÔ´¦Àí³ÌÐò´úÂë
-
-	SetModifiedFlag();
-}
-
-// ·½·¨-------------------------------------------------------------------------------------------------------------
-LONG CCCAgentBarCtrl::Initial(void)
-{
-	AFX_MANAGE_STATE(AfxGetStaticModuleState());
-
-	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
-
-	if(p_m_Bar->m_intIsInitial)
-	{
-		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "Initial", "IsInitial Error", AGENTBARERROR_BAR_INITIAL);
-		return AGENTBARERROR_BAR_INITIAL;
-	}
-
-	return p_m_Bar->BInitial();
-}
-
-LONG CCCAgentBarCtrl::UnInitial(void)
-{
-	AFX_MANAGE_STATE(AfxGetStaticModuleState());
-
-	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
-
-	if(!p_m_Bar->m_intIsInitial)
-	{
-		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "UnInitial", "IsInitial Error", AGENTBARERROR_BAR_UNINITIAL);
-		return AGENTBARERROR_BAR_UNINITIAL;
-	}
-
-	return p_m_Bar->BUnInitial();
-}
-
-LONG CCCAgentBarCtrl::SignIn(void)
-{
-	AFX_MANAGE_STATE(AfxGetStaticModuleState());
-
-	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
-
-	if(!p_m_Bar->m_intIsInitial)
-	{
-		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "SignIn", "IsInitial Error", AGENTBARERROR_BAR_UNINITIAL);
-		return AGENTBARERROR_BAR_UNINITIAL;
-	}
-
-	return p_m_Bar->BSignIn();
-}
-
-LONG CCCAgentBarCtrl::SignOut(void)
-{
-	AFX_MANAGE_STATE(AfxGetStaticModuleState());
-
-	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
-
-	if(!p_m_Bar->m_intIsSignIn)
-	{
-		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "SignOut", "IsSignIn Error", AGENTBARERROR_BAR_UNSIGNIN);
-		return AGENTBARERROR_BAR_UNSIGNIN;
-	}
-
-	return p_m_Bar->BSignOut();
-}
-
-LONG CCCAgentBarCtrl::SetIdle(void)
-{
-	AFX_MANAGE_STATE(AfxGetStaticModuleState());
-
-	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
-
-	if(!p_m_Bar->m_intIsSignIn)
-	{
-		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "SetIdle", "IsSignIn Error", AGENTBARERROR_BAR_UNSIGNIN);
-		return AGENTBARERROR_BAR_UNSIGNIN;
-	}
-
-	return p_m_Bar->BSetIdle();
-}
-
-LONG CCCAgentBarCtrl::SetBusy(void)
-{
-	AFX_MANAGE_STATE(AfxGetStaticModuleState());
-
-	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
-
-	if(!p_m_Bar->m_intIsSignIn)
-	{
-		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "SetBusy", "IsSignIn Error", AGENTBARERROR_BAR_UNSIGNIN);
-		return AGENTBARERROR_BAR_UNSIGNIN;
-	}
-
-	return p_m_Bar->BSetBusy();
-}
-
-LONG CCCAgentBarCtrl::SetRest(LPCTSTR reason)
-{
-	AFX_MANAGE_STATE(AfxGetStaticModuleState());
-
-	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
-
-	if(!p_m_Bar->m_intIsSignIn)
-	{
-		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "SetRest", "IsSignIn Error", AGENTBARERROR_BAR_UNSIGNIN);
-		return AGENTBARERROR_BAR_UNSIGNIN;
-	}
-
-	return p_m_Bar->BSetRest(reason);
-}
-
-LONG CCCAgentBarCtrl::SetAgentStatus(LONG agentState, LPCTSTR reason)
-{
-	AFX_MANAGE_STATE(AfxGetStaticModuleState());
-
-	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
-
-	if(!p_m_Bar->m_intIsSignIn)
-	{
-		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "SetAgentStatus", "IsSignIn Error", AGENTBARERROR_BAR_UNSIGNIN);
-		return AGENTBARERROR_BAR_UNSIGNIN;
-	}
-
-	if(agentState < 0 || agentState > 19)// ×¢Òâ£¡
-		agentState = 0;
-
-	return p_m_Bar->GetAcdClient().AcdSetAgentStatus(p_m_Bar->m_strAgentID, agentState, reason);
-}
-
-LONG CCCAgentBarCtrl::GetAgentStatus(void)
-{
-	AFX_MANAGE_STATE(AfxGetStaticModuleState());
-
-	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
-
-	if(!p_m_Bar->m_intIsSignIn)
-	{
-		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "GetAgentStatus", "IsSignIn Error", AGENTBARERROR_BAR_UNSIGNIN);
-		return AGENTBARERROR_BAR_UNSIGNIN;
-	}
-
-	acd::AgentStatusT status = acd::AgentStatusT::AsUnknownState;
-	int ret = p_m_Bar->BGetAgentStatus(status);
-
-	if(ret != AGENTBARERROR_SUCCESS)
-	{
-		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "GetAgentStatus", "Return Error", ret);
-		return ret;
-	}
-
-	return status.get_value();
-}
-
-LONG CCCAgentBarCtrl::ResetSkill(LPCTSTR skillList)
-{
-	AFX_MANAGE_STATE(AfxGetStaticModuleState());
-
-	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
-
-	if(!p_m_Bar->m_intIsSignIn)
-	{
-		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "ResetSkill", "IsSignIn Error", AGENTBARERROR_BAR_UNSIGNIN);
-		return AGENTBARERROR_BAR_UNSIGNIN;
-	}
-
-	return p_m_Bar->BResetSkill(skillList);
-}
-
-LONG CCCAgentBarCtrl::Reset(void)
-{
-	AFX_MANAGE_STATE(AfxGetStaticModuleState());
-
-	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
-
-	if(!p_m_Bar->m_intIsSignIn)
-	{
-		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "Reset", "IsSignIn Error", AGENTBARERROR_BAR_UNSIGNIN);
-		return AGENTBARERROR_BAR_UNSIGNIN;
-	}
-
-	return p_m_Bar->BReset();
-}
-
-LONG CCCAgentBarCtrl::MakeCall(LPCTSTR dest, LPCTSTR showANI, LPCTSTR showDest, LONG isOffhook, LONG type)
-{
-	AFX_MANAGE_STATE(AfxGetStaticModuleState());
-
-	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
-
-	if(!p_m_Bar->m_intIsSignIn)
-	{
-		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "MakeCall", "IsSignIn Error", AGENTBARERROR_BAR_UNSIGNIN);
-		return AGENTBARERROR_BAR_UNSIGNIN;
-	}
-
-	if(isOffhook < 0 || isOffhook > 1)// ×¢Òâ£¡
-		isOffhook = 0;
-	if(type < 0 || type > 1)// ×¢Òâ£¡
-		type = 0;
-
-	CString ani, dnis;
-	switch(p_m_Bar->m_intANIChangeType)
-	{
-	case ANICHANGE_SYSTEM:
-		break;
-	case ANICHANGE_TRANSFER:
-		//ani = dest; Õþ²ßÎÊÌâ
-		dnis = p_m_Bar->m_strDN;
-		break;
-	case ANICHANGE_SPECIAL:
-		ani = showANI;
-		dnis = showDest;
-		break;
-	default:
-		break;
-	}
-
-	return p_m_Bar->BMakeCall(dest, ani, dnis, isOffhook, type);
-}
-
-LONG CCCAgentBarCtrl::Answer(void)
-{
-	AFX_MANAGE_STATE(AfxGetStaticModuleState());
-
-	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
-
-	if(!p_m_Bar->m_intIsSignIn)
-	{
-		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "Answer", "IsSignIn Error", AGENTBARERROR_BAR_UNSIGNIN);
-		return AGENTBARERROR_BAR_UNSIGNIN;
-	}
-
-	return p_m_Bar->BAnswer();
-}
-
-LONG CCCAgentBarCtrl::ReleaseCall(void)
-{
-	AFX_MANAGE_STATE(AfxGetStaticModuleState());
-
-	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
-
-	if(!p_m_Bar->m_intIsSignIn)
-	{
-		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "ReleaseCall", "IsSignIn Error", AGENTBARERROR_BAR_UNSIGNIN);
-		return AGENTBARERROR_BAR_UNSIGNIN;
-	}
-
-	return p_m_Bar->BReleaseCall();
-}
-
-LONG CCCAgentBarCtrl::Hold(void)
-{
-	AFX_MANAGE_STATE(AfxGetStaticModuleState());
-
-	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
-
-	if(!p_m_Bar->m_intIsSignIn)
-	{
-		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "Hold", "IsSignIn Error", AGENTBARERROR_BAR_UNSIGNIN);
-		return AGENTBARERROR_BAR_UNSIGNIN;
-	}
-
-	return p_m_Bar->BHold();
-}
-
-LONG CCCAgentBarCtrl::Retrieve(void)
-{
-	AFX_MANAGE_STATE(AfxGetStaticModuleState());
-
-	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
-
-	if(!p_m_Bar->m_intIsSignIn)
-	{
-		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "Retrieve", "IsSignIn Error", AGENTBARERROR_BAR_UNSIGNIN);
-		return AGENTBARERROR_BAR_UNSIGNIN;
-	}
-
-	return p_m_Bar->BRetrieve();
-}
-
-LONG CCCAgentBarCtrl::Consult(LPCTSTR consultNum, LPCTSTR showANI, LPCTSTR showDest, LONG consultType)
-{
-	AFX_MANAGE_STATE(AfxGetStaticModuleState());
-
-	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
-
-	if(!p_m_Bar->m_intIsSignIn)
-	{
-		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "Consult", "IsSignIn Error", AGENTBARERROR_BAR_UNSIGNIN);
-		return AGENTBARERROR_BAR_UNSIGNIN;
-	}
-
-	if(consultType < 0 || consultType > 1)// ×¢Òâ£¡
-		consultType = 0;
-
-	CString ani, dnis;
-	switch(p_m_Bar->m_intANIChangeType)
-	{
-	case ANICHANGE_SYSTEM:
-		break;
-	case ANICHANGE_TRANSFER:
-		//ani = consultNum; Õþ²ßÎÊÌâ
-		dnis = p_m_Bar->m_strDN;
-		break;
-	case ANICHANGE_SPECIAL:
-		ani = showANI;
-		dnis = showDest;
-		break;
-	default:
-		break;
-	}
-
-	return p_m_Bar->BConsult(consultNum, ani, dnis, consultType);
-}
-
-LONG CCCAgentBarCtrl::Reconnect(void)
-{
-	AFX_MANAGE_STATE(AfxGetStaticModuleState());
-
-	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
-
-	if(!p_m_Bar->m_intIsSignIn)
-	{
-		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "Reconnect", "IsSignIn Error", AGENTBARERROR_BAR_UNSIGNIN);
-		return AGENTBARERROR_BAR_UNSIGNIN;
-	}
-
-	return p_m_Bar->BReconnect();
-}
-
-LONG CCCAgentBarCtrl::Transfer(void)
-{
-	AFX_MANAGE_STATE(AfxGetStaticModuleState());
-
-	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
-
-	if(!p_m_Bar->m_intIsSignIn)
-	{
-		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "Transfer", "IsSignIn Error", AGENTBARERROR_BAR_UNSIGNIN);
-		return AGENTBARERROR_BAR_UNSIGNIN;
-	}
-
-	return p_m_Bar->BTransfer();
-}
-
-LONG CCCAgentBarCtrl::SingleStepTransfer(LPCTSTR transferNum, LPCTSTR showANI, LPCTSTR showDest, LONG transferStyle, LONG transferType)
-{
-	AFX_MANAGE_STATE(AfxGetStaticModuleState());
-
-	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
-
-	if(!p_m_Bar->m_intIsSignIn)
-	{
-		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "SingleStepTransfer", "IsSignIn Error", AGENTBARERROR_BAR_UNSIGNIN);
-		return AGENTBARERROR_BAR_UNSIGNIN;
-	}
-
-	if(transferType < 0 || transferType > 2)// ×¢Òâ£¡
-		transferType = 0;
-
-	// 0£ºÄÚÏß
-	// 1£ºÍâÏß
-	// 2£ºIVR Ö»¶ÔagentbarÓÐÐ§£¬acdÃ»ÓÐ´ËÀàÐÍ£¬µ½acdÖ®ºó£¬×ª»»ÎªÍâÏß
-	if(2 == transferType)
-	{
-		return p_m_Bar->BTransferIVR(transferNum);
-	}
-
-	CString ani, dnis;
-	switch(p_m_Bar->m_intANIChangeType)
-	{
-	case ANICHANGE_SYSTEM:
-		break;
-	case ANICHANGE_TRANSFER:
-		//ani = transferNum; Õþ²ßÎÊÌâ
-		dnis = p_m_Bar->m_strDN;
-		break;
-	case ANICHANGE_SPECIAL:
-		ani = showANI;
-		dnis = showDest;
-		break;
-	default:
-		break;
-	}
-
-	return p_m_Bar->BSingleStepTransfer(transferNum, ani, dnis, transferStyle, transferType);
-}
-
-LONG CCCAgentBarCtrl::Conference(void)
-{
-	AFX_MANAGE_STATE(AfxGetStaticModuleState());
-
-	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
-
-	if(!p_m_Bar->m_intIsSignIn)
-	{
-		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "Conference", "IsSignIn Error", AGENTBARERROR_BAR_UNSIGNIN);
-		return AGENTBARERROR_BAR_UNSIGNIN;
-	}
-
-	return p_m_Bar->BConference();
-}
-
-LONG CCCAgentBarCtrl::SetCallData(LPCTSTR key, LPCTSTR callData)
-{
-	AFX_MANAGE_STATE(AfxGetStaticModuleState());
-
-	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
-
-	if(!p_m_Bar->m_intIsSignIn)
-	{
-		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "SetCallData", "IsSignIn Error", AGENTBARERROR_BAR_UNSIGNIN);
-		return AGENTBARERROR_BAR_UNSIGNIN;
-	}
-
-	return p_m_Bar->GetAcdClient().AcdSetAssociateData(p_m_Bar->m_strAgentID, key, callData);
-}
-
-BSTR CCCAgentBarCtrl::GetCallData(LPCTSTR key)
-{
-	AFX_MANAGE_STATE(AfxGetStaticModuleState());
-
-	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
-
-	if(!p_m_Bar->m_intIsSignIn)
-	{
-		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "GetCallData", "IsSignIn Error", AGENTBARERROR_BAR_UNSIGNIN);
-		CString strResult;
-		return strResult.AllocSysString();
-	}
-
-	string data;
-	int ret = p_m_Bar->GetAcdClient().AcdGetAssociateData(p_m_Bar->m_strAgentID, key, data);
-	if(ret != AGENTBARERROR_SUCCESS)
-	{
-		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "GetCallData", "Return Error", ret);
-		CString strResult;
-		return strResult.AllocSysString();
-	}
-
-	CString strResult(data.c_str());
-	return strResult.AllocSysString();
-}
-
-LONG CCCAgentBarCtrl::ForceOut(LPCTSTR agentID)
-{
-	AFX_MANAGE_STATE(AfxGetStaticModuleState());
-
-	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
-
-	if(!p_m_Bar->m_intIsSignIn)
-	{
-		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "ForceOut", "IsSignIn Error", AGENTBARERROR_BAR_UNSIGNIN);
-		return AGENTBARERROR_BAR_UNSIGNIN;
-	}
-
-	return p_m_Bar->GetAcdClient().AcdForceSignOut(p_m_Bar->m_strAgentID, agentID);
-}
-
-LONG CCCAgentBarCtrl::ForceIdle(LPCTSTR agentID)
-{
-	AFX_MANAGE_STATE(AfxGetStaticModuleState());
-
-	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
-
-	if(!p_m_Bar->m_intIsSignIn)
-	{
-		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "ForceIdle", "IsSignIn Error", AGENTBARERROR_BAR_UNSIGNIN);
-		return AGENTBARERROR_BAR_UNSIGNIN;
-	}
-
-	return p_m_Bar->GetAcdClient().AcdForceSetAgentStatus(p_m_Bar->m_strAgentID, agentID, acd::AgentStatusT::AsReadyState);
-}
-
-LONG CCCAgentBarCtrl::ForceBusy(LPCTSTR agentID)
-{
-	AFX_MANAGE_STATE(AfxGetStaticModuleState());
-
-	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
-
-	if(!p_m_Bar->m_intIsSignIn)
-	{
-		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "ForceBusy", "IsSignIn Error", AGENTBARERROR_BAR_UNSIGNIN);
-		return AGENTBARERROR_BAR_UNSIGNIN;
-	}
-
-	return p_m_Bar->GetAcdClient().AcdForceSetAgentStatus(p_m_Bar->m_strAgentID, agentID, acd::AgentStatusT::AsBusyState);
-}
-
-LONG CCCAgentBarCtrl::Listen(LPCTSTR agentID, LPCTSTR showANI, LPCTSTR showDest)
-{
-	AFX_MANAGE_STATE(AfxGetStaticModuleState());
-
-	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
-
-	if(!p_m_Bar->m_intIsSignIn)
-	{
-		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "Listen", "IsSignIn Error", AGENTBARERROR_BAR_UNSIGNIN);
-		return AGENTBARERROR_BAR_UNSIGNIN;
-	}
-
-	return p_m_Bar->BListen(agentID, showANI, showDest);
-}
-
-LONG CCCAgentBarCtrl::StopListen(LPCTSTR agentID)
-{
-	AFX_MANAGE_STATE(AfxGetStaticModuleState());
-
-	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
-
-	if(!p_m_Bar->m_intIsSignIn)
-	{
-		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "StopListen", "IsSignIn Error", AGENTBARERROR_BAR_UNSIGNIN);
-		return AGENTBARERROR_BAR_UNSIGNIN;
-	}
-
-	return p_m_Bar->BStopListen(agentID);
-}
-
-LONG CCCAgentBarCtrl::Insert(LPCTSTR agentID, LPCTSTR showANI, LPCTSTR showDest)
-{
-	AFX_MANAGE_STATE(AfxGetStaticModuleState());
-
-	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
-
-	if(!p_m_Bar->m_intIsSignIn)
-	{
-		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "Insert", "IsSignIn Error", AGENTBARERROR_BAR_UNSIGNIN);
-		return AGENTBARERROR_BAR_UNSIGNIN;
-	}
-
-	return p_m_Bar->BInsert(agentID, showANI, showDest);
-}
-
-LONG CCCAgentBarCtrl::StopInsert(LPCTSTR agentID)
-{
-	AFX_MANAGE_STATE(AfxGetStaticModuleState());
-
-	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
-
-	if(!p_m_Bar->m_intIsSignIn)
-	{
-		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "StopInsert", "IsSignIn Error", AGENTBARERROR_BAR_UNSIGNIN);
-		return AGENTBARERROR_BAR_UNSIGNIN;
-	}
-
-	return p_m_Bar->BStopInsert(agentID);
-}
-
-LONG CCCAgentBarCtrl::SwitchInsertorListen(LPCTSTR agentID, LPCTSTR showANI, LPCTSTR showDest)
-{
-	AFX_MANAGE_STATE(AfxGetStaticModuleState());
-
-	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
-
-	if(!p_m_Bar->m_intIsSignIn)
-	{
-		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "SwitchInsertorListen", "IsSignIn Error", AGENTBARERROR_BAR_UNSIGNIN);
-		return AGENTBARERROR_BAR_UNSIGNIN;
-	}
-
-	return p_m_Bar->BSwitchInsertorListen(agentID, showANI, showDest);
-}
-
-LONG CCCAgentBarCtrl::Break(LPCTSTR agentID)
-{
-	AFX_MANAGE_STATE(AfxGetStaticModuleState());
-
-	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
-
-	if(!p_m_Bar->m_intIsSignIn)
-	{
-		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "Break", "IsSignIn Error", AGENTBARERROR_BAR_UNSIGNIN);
-		return AGENTBARERROR_BAR_UNSIGNIN;
-	}
-
-	return p_m_Bar->GetAcdClient().AcdBreak(p_m_Bar->m_strAgentID, agentID);
-}
-
-LONG CCCAgentBarCtrl::SendDTMF(LPCTSTR dtmf)
-{
-	AFX_MANAGE_STATE(AfxGetStaticModuleState());
-
-	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
-
-	if(!p_m_Bar->m_intIsSignIn)
-	{
-		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "SendDTMF", "IsSignIn Error", AGENTBARERROR_BAR_UNSIGNIN);
-		return AGENTBARERROR_BAR_UNSIGNIN;
-	}
-
-	return p_m_Bar->BSendDTMF(dtmf);
-}
-
-LONG CCCAgentBarCtrl::MuteOn(void)
-{
-	AFX_MANAGE_STATE(AfxGetStaticModuleState());
-
-	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
-
-	if(!p_m_Bar->m_intIsSignIn)
-	{
-		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "MuteOn", "IsSignIn Error", AGENTBARERROR_BAR_UNSIGNIN);
-		return AGENTBARERROR_BAR_UNSIGNIN;
-	}
-
-	return p_m_Bar->GetAcdClient().AcdMuteOn(p_m_Bar->m_strAgentID);
-}
-
-LONG CCCAgentBarCtrl::MuteOff(void)
-{
-	AFX_MANAGE_STATE(AfxGetStaticModuleState());
-
-	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
-
-	if(!p_m_Bar->m_intIsSignIn)
-	{
-		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "MuteOff", "IsSignIn Error", AGENTBARERROR_BAR_UNSIGNIN);
-		return AGENTBARERROR_BAR_UNSIGNIN;
-	}
-
-	return p_m_Bar->GetAcdClient().AcdMuteOff(p_m_Bar->m_strAgentID);
-}
-
-BSTR CCCAgentBarCtrl::GetAgentDetailByAgentID(LPCTSTR agentID)
-{
-	AFX_MANAGE_STATE(AfxGetStaticModuleState());
-
-	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
-
-	if(!p_m_Bar->m_intIsSignIn)
-	{
-		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "GetAgentDetailByAgentID", "IsSignIn Error", AGENTBARERROR_BAR_UNSIGNIN);
-		CString strResult;
-		return strResult.AllocSysString();
-	}
-
-	acd::AgentInfoT agentInfo;
-	int ret = p_m_Bar->GetAcdClient().AcdGetAgentDetailByAgentID(p_m_Bar->m_strAgentID, agentID, agentInfo);
-	if(ret != AGENTBARERROR_SUCCESS)
-	{
-		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "GetAgentDetailByAgentID", "Return Error", ret);
-		CString strResult;
-		return strResult.AllocSysString();
-	}
-
-	Json::Value root;
-	root["agentId"]         = Json::Value(agentInfo.agentId);
-	root["agentDn"]         = Json::Value(agentInfo.agentDn);
-	root["loginTime"]       = Json::Value(agentInfo.loginTime);
-	root["currStatus"]      = Json::Value(agentInfo.currStatus.get_value());
-	root["currStatusTime"]  = Json::Value(agentInfo.currStatusTime);
-	root["answerTime"]      = Json::Value(agentInfo.answerTime);
-	root["currTime"]        = Json::Value(agentInfo.currTime);
-	root["origCaller"]      = Json::Value(agentInfo.origCaller);
-	root["origCallee"]      = Json::Value(agentInfo.origCallee);
-	root["privQueueNum"]    = Json::Value(agentInfo.privQueueNum);
-	root["callTimes"]       = Json::Value(agentInfo.callTimes);
-	root["answerTimes"]     = Json::Value(agentInfo.answerTimes);
-	root["freeTotalTime"]   = Json::Value(agentInfo.freeTotalTime);
-	root["busyTotalTime"]   = Json::Value(agentInfo.busyTotalTime);
-	root["resetTotalTime"]  = Json::Value(agentInfo.resetTotalTime);
-	root["callTotalTime"]   = Json::Value(agentInfo.callTotalTime);
-	root["answerTotalTime"] = Json::Value(agentInfo.answerTotalTime);
-	root["agentIP"]         = Json::Value(agentInfo.agentIP);
-	Json::FastWriter w;
-	string s = w.write(root);
-	CString strResult(s.c_str());
-	return strResult.AllocSysString();
-}
-
-BSTR CCCAgentBarCtrl::GetAgentDetailByAgentDN(LPCTSTR agentDN)
-{
-	AFX_MANAGE_STATE(AfxGetStaticModuleState());
-
-	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
-
-	if(!p_m_Bar->m_intIsSignIn)
-	{
-		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "GetAgentDetailByAgentDN", "IsSignIn Error", AGENTBARERROR_BAR_UNSIGNIN);
-		CString strResult;
-		return strResult.AllocSysString();
-	}
-
-	acd::AgentInfoT agentInfo;
-	int ret = p_m_Bar->GetAcdClient().AcdGetAgentDetailByAgentDN(p_m_Bar->m_strAgentID, agentDN, agentInfo);
-	if(ret != AGENTBARERROR_SUCCESS)
-	{
-		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "GetAgentDetailByAgentDN", "Return Error", ret);
-		CString strResult;
-		return strResult.AllocSysString();
-	}
-
-	Json::Value root;
-	root["agentId"]         = Json::Value(agentInfo.agentId);
-	root["agentDn"]         = Json::Value(agentInfo.agentDn);
-	root["loginTime"]       = Json::Value(agentInfo.loginTime);
-	root["currStatus"]      = Json::Value(agentInfo.currStatus.get_value());
-	root["currStatusTime"]  = Json::Value(agentInfo.currStatusTime);
-	root["answerTime"]      = Json::Value(agentInfo.answerTime);
-	root["currTime"]        = Json::Value(agentInfo.currTime);
-	root["origCaller"]      = Json::Value(agentInfo.origCaller);
-	root["origCallee"]      = Json::Value(agentInfo.origCallee);
-	root["privQueueNum"]    = Json::Value(agentInfo.privQueueNum);
-	root["callTimes"]       = Json::Value(agentInfo.callTimes);
-	root["answerTimes"]     = Json::Value(agentInfo.answerTimes);
-	root["freeTotalTime"]   = Json::Value(agentInfo.freeTotalTime);
-	root["busyTotalTime"]   = Json::Value(agentInfo.busyTotalTime);
-	root["resetTotalTime"]  = Json::Value(agentInfo.resetTotalTime);
-	root["callTotalTime"]   = Json::Value(agentInfo.callTotalTime);
-	root["answerTotalTime"] = Json::Value(agentInfo.answerTotalTime);
-	root["agentIP"]         = Json::Value(agentInfo.agentIP);
-	Json::FastWriter w;
-	string s = w.write(root);
-	CString strResult(s.c_str());
-	return strResult.AllocSysString();
-}
-
-BSTR CCCAgentBarCtrl::GetAgentDetailsByAgentIDs(LPCTSTR agentIDs)
-{
-	AFX_MANAGE_STATE(AfxGetStaticModuleState());
-
-	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
-
-	if(!p_m_Bar->m_intIsSignIn)
-	{
-		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "GetAgentDetailsByAgentIDs", "IsSignIn Error", AGENTBARERROR_BAR_UNSIGNIN);
-		CString strResult;
-		return strResult.AllocSysString();
-	}
-
-	Json::Reader reader;
-	Json::Value readRoot;
-	if(!reader.parse(agentIDs, readRoot))
-	{
-		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "GetAgentDetailsByAgentIDs", "json Error", AGENTBARERROR_JSON_READERROR);
-		CString strResult;
-		return strResult.AllocSysString();
-	}
-	if(!readRoot.isArray())
-	{
-		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "GetAgentDetailsByAgentIDs", "json not array Error", AGENTBARERROR_JSON_READERROR);
-		CString strResult;
-		return strResult.AllocSysString();
-	}
-	acd::StringListT agents;
-	for(Json::Value::iterator it = readRoot.begin(); it != readRoot.end(); it++)
-	{
-		Json::Value v = (*it)["AgentID"];
-		if(!v)
-			continue;
-		if(!v.isString())
-			continue;
-		agents.push_back(v.asCString());
-	}
-	if(agents.size() == 0)
-	{
-		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "GetAgentDetailsByAgentIDs", "AgentList size", 0);
-		CString strResult;
-		return strResult.AllocSysString();
-	}
-	acd::AgentInfoListT agentInfos;
-	int ret = p_m_Bar->GetAcdClient().AcdGetAgentDetailsByAgentIDs(p_m_Bar->m_strAgentID, agents, agentInfos);
-	if(ret != AGENTBARERROR_SUCCESS)
-	{
-		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "GetAgentDetailsByAgentIDs", "Return Error", ret);
-		CString strResult;
-		return strResult.AllocSysString();
-	}
-	Json::Value writeRoot;
-	for(acd::AgentInfoListT::iterator it = agentInfos.begin(); it != agentInfos.end(); it++)
-	{
-		Json::Value temp;
-		temp["agentId"]         = Json::Value((*it).agentId);
-		temp["agentDn"]         = Json::Value((*it).agentDn);
-		temp["loginTime"]       = Json::Value((*it).loginTime);
-		temp["currStatus"]      = Json::Value((*it).currStatus.get_value());
-		temp["currStatusTime"]  = Json::Value((*it).currStatusTime);
-		temp["answerTime"]      = Json::Value((*it).answerTime);
-		temp["currTime"]        = Json::Value((*it).currTime);
-		temp["origCaller"]      = Json::Value((*it).origCaller);
-		temp["origCallee"]      = Json::Value((*it).origCallee);
-		temp["privQueueNum"]    = Json::Value((*it).privQueueNum);
-		temp["callTimes"]       = Json::Value((*it).callTimes);
-		temp["answerTimes"]     = Json::Value((*it).answerTimes);
-		temp["freeTotalTime"]   = Json::Value((*it).freeTotalTime);
-		temp["busyTotalTime"]   = Json::Value((*it).busyTotalTime);
-		temp["resetTotalTime"]  = Json::Value((*it).resetTotalTime);
-		temp["callTotalTime"]   = Json::Value((*it).callTotalTime);
-		temp["answerTotalTime"] = Json::Value((*it).answerTotalTime);
-		temp["agentIP"]         = Json::Value((*it).agentIP);
-		writeRoot.append(temp);
-	}
-	Json::FastWriter w;
-	string s = w.write(writeRoot);
-	CString strResult(s.c_str());
-	return strResult.AllocSysString();
-}
-
-BSTR CCCAgentBarCtrl::GetAgentDetailsByAgentDNs(LPCTSTR agentDNs)
-{
-	AFX_MANAGE_STATE(AfxGetStaticModuleState());
-
-	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
-
-	if(!p_m_Bar->m_intIsSignIn)
-	{
-		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "GetAgentDetailsByAgentDNs", "IsSignIn Error", AGENTBARERROR_BAR_UNSIGNIN);
-		CString strResult;
-		return strResult.AllocSysString();
-	}
-
-	Json::Reader reader;
-	Json::Value readRoot;
-	if(!reader.parse(agentDNs, readRoot))
-	{
-		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "GetAgentDetailsByAgentDNs", "json Error", AGENTBARERROR_JSON_READERROR);
-		CString strResult;
-		return strResult.AllocSysString();
-	}
-	if(!readRoot.isArray())
-	{
-		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "GetAgentDetailsByAgentDNs", "json not array Error", AGENTBARERROR_JSON_READERROR);
-		CString strResult;
-		return strResult.AllocSysString();
-	}
-	acd::StringListT agents;
-	for(Json::Value::iterator it = readRoot.begin(); it != readRoot.end(); it++)
-	{
-		Json::Value v = (*it)["AgentDN"];
-		if(!v)
-			continue;
-		if(!v.isString())
-			continue;
-		agents.push_back(v.asCString());
-	}
-	if(agents.size() == 0)
-	{
-		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "GetAgentDetailsByAgentDNs", "AgentList size", 0);
-		CString strResult;
-		return strResult.AllocSysString();
-	}
-	acd::AgentInfoListT agentInfos;
-	int ret = p_m_Bar->GetAcdClient().AcdGetAgentDetailsByAgentDNs(p_m_Bar->m_strAgentID, agents, agentInfos);
-	if(ret != AGENTBARERROR_SUCCESS)
-	{
-		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "GetAgentDetailsByAgentDNs", "Return Error", ret);
-		CString strResult;
-		return strResult.AllocSysString();
-	}
-	Json::Value writeRoot;
-	for(acd::AgentInfoListT::iterator it = agentInfos.begin(); it != agentInfos.end(); it++)
-	{
-		Json::Value temp;
-		temp["agentId"]         = Json::Value((*it).agentId);
-		temp["agentDn"]         = Json::Value((*it).agentDn);
-		temp["loginTime"]       = Json::Value((*it).loginTime);
-		temp["currStatus"]      = Json::Value((*it).currStatus.get_value());
-		temp["currStatusTime"]  = Json::Value((*it).currStatusTime);
-		temp["answerTime"]      = Json::Value((*it).answerTime);
-		temp["currTime"]        = Json::Value((*it).currTime);
-		temp["origCaller"]      = Json::Value((*it).origCaller);
-		temp["origCallee"]      = Json::Value((*it).origCallee);
-		temp["privQueueNum"]    = Json::Value((*it).privQueueNum);
-		temp["callTimes"]       = Json::Value((*it).callTimes);
-		temp["answerTimes"]     = Json::Value((*it).answerTimes);
-		temp["freeTotalTime"]   = Json::Value((*it).freeTotalTime);
-		temp["busyTotalTime"]   = Json::Value((*it).busyTotalTime);
-		temp["resetTotalTime"]  = Json::Value((*it).resetTotalTime);
-		temp["callTotalTime"]   = Json::Value((*it).callTotalTime);
-		temp["answerTotalTime"] = Json::Value((*it).answerTotalTime);
-		temp["agentIP"]         = Json::Value((*it).agentIP);
-		writeRoot.append(temp);
-	}
-	Json::FastWriter w;
-	string s = w.write(writeRoot);
-	CString strResult(s.c_str());
-	return strResult.AllocSysString();
-}
-
-BSTR CCCAgentBarCtrl::GetRecordFileName(void)
-{
-	AFX_MANAGE_STATE(AfxGetStaticModuleState());
-
-	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
-
-	if(!p_m_Bar->m_intIsSignIn)
-	{
-		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "GetRecordFileName", "IsSignIn Error", AGENTBARERROR_BAR_UNSIGNIN);
-		CString strResult;
-		return strResult.AllocSysString();
-	}
-
-	string fileName;
-	int ret = p_m_Bar->GetAcdClient().AcdGetRecordFileName(p_m_Bar->m_strAgentID, fileName);
-	if(ret != AGENTBARERROR_SUCCESS)
-	{
-		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "GetRecordFileName", "Return Error", ret);
-		CString strResult;
-		return strResult.AllocSysString();
-	}
-
-	CString strResult(fileName.c_str());
-	return strResult.AllocSysString();
-}
-
-BSTR CCCAgentBarCtrl::GetRestReason(void)
-{
-	AFX_MANAGE_STATE(AfxGetStaticModuleState());
-
-	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
-
-	if(!p_m_Bar->m_intIsSignIn)
-	{
-		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "GetRestReason", "IsSignIn Error", AGENTBARERROR_BAR_UNSIGNIN);
-		CString strResult;
-		return strResult.AllocSysString();
-	}
-
-	acd::StringListT reasons;
-	int ret = p_m_Bar->BGetRestReason(reasons);
-	if(ret != AGENTBARERROR_SUCCESS)
-	{
-		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "GetRestReason", "Return Error", ret);
-		CString strResult;
-		return strResult.AllocSysString();
-	}
-	Json::Value writeRoot;
-	for(acd::StringListT::iterator it = reasons.begin(); it != reasons.end(); it++)
-	{
-		Json::Value temp;
-		temp["reason"] = Json::Value(*it);
-		writeRoot.append(temp);
-	}
-	Json::FastWriter w;
-	string s = w.write(writeRoot);
-	CString strResult(s.c_str());
-	return strResult.AllocSysString();
-}
-
-LONG CCCAgentBarCtrl::GetAgentNumberBySkill(LPCTSTR skill)
-{
-	AFX_MANAGE_STATE(AfxGetStaticModuleState());
-
-	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
-
-	if(!p_m_Bar->m_intIsSignIn)
-	{
-		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "GetAgentNumberBySkill", "IsSignIn Error", AGENTBARERROR_BAR_UNSIGNIN);
-		return AGENTBARERROR_BAR_UNSIGNIN;
-	}
-
-	int agentNumber = 0;
-	int ret = p_m_Bar->GetAcdClient().AcdGetAgentNumberBySkill(p_m_Bar->m_strAgentID, skill, agentNumber);
-
-	if(ret != AGENTBARERROR_SUCCESS)
-	{
-		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "GetAgentNumberBySkill", "Return Error", ret);
-		return ret;
-	}
-
-	return agentNumber;
-}
-
-BSTR CCCAgentBarCtrl::GetAgentDetailsBySkill(LPCTSTR skill)
-{
-	AFX_MANAGE_STATE(AfxGetStaticModuleState());
-
-	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
-
-	if(!p_m_Bar->m_intIsSignIn)
-	{
-		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "GetAgentDetailsBySkill", "IsSignIn Error", AGENTBARERROR_BAR_UNSIGNIN);
-		CString strResult;
-		return strResult.AllocSysString();
-	}
-
-	int agentNumber = 0;
-	acd::AgentInfoListT agentInfos;
-	int ret = p_m_Bar->GetAcdClient().AcdGetAgentDetailsBySkill(p_m_Bar->m_strAgentID, skill, agentNumber, agentInfos);
-	if(ret != AGENTBARERROR_SUCCESS)
-	{
-		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "GetAgentDetailsBySkill", "Return Error", ret);
-		CString strResult;
-		return strResult.AllocSysString();
-	}
-	Json::Value writeRoot;
-	for(acd::AgentInfoListT::iterator it = agentInfos.begin(); it != agentInfos.end(); it++)
-	{
-		Json::Value temp;
-		temp["agentId"]         = Json::Value((*it).agentId);
-		temp["agentDn"]         = Json::Value((*it).agentDn);
-		temp["loginTime"]       = Json::Value((*it).loginTime);
-		temp["currStatus"]      = Json::Value((*it).currStatus.get_value());
-		temp["currStatusTime"]  = Json::Value((*it).currStatusTime);
-		temp["answerTime"]      = Json::Value((*it).answerTime);
-		temp["currTime"]        = Json::Value((*it).currTime);
-		temp["origCaller"]      = Json::Value((*it).origCaller);
-		temp["origCallee"]      = Json::Value((*it).origCallee);
-		temp["privQueueNum"]    = Json::Value((*it).privQueueNum);
-		temp["callTimes"]       = Json::Value((*it).callTimes);
-		temp["answerTimes"]     = Json::Value((*it).answerTimes);
-		temp["freeTotalTime"]   = Json::Value((*it).freeTotalTime);
-		temp["busyTotalTime"]   = Json::Value((*it).busyTotalTime);
-		temp["resetTotalTime"]  = Json::Value((*it).resetTotalTime);
-		temp["callTotalTime"]   = Json::Value((*it).callTotalTime);
-		temp["answerTotalTime"] = Json::Value((*it).answerTotalTime);
-		temp["agentIP"]         = Json::Value((*it).agentIP);
-		writeRoot.append(temp);
-	}
-	Json::FastWriter w;
-	string s = w.write(writeRoot);
-	CString strResult(s.c_str());
-	return strResult.AllocSysString();
-}
-
-BSTR CCCAgentBarCtrl::GetSkillWaitingNumber(LPCTSTR skill)
-{
-	AFX_MANAGE_STATE(AfxGetStaticModuleState());
-
-	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
-
-	if(!p_m_Bar->m_intIsSignIn)
-	{
-		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "GetSkillWaitingNumber", "IsSignIn Error", AGENTBARERROR_BAR_UNSIGNIN);
-		CString strResult;
-		return strResult.AllocSysString();
-	}
-
-	int queueNum = 0;
-	int freeNum = 0;
-	int ret = p_m_Bar->GetAcdClient().AcdGetSkillWaitingNumber(p_m_Bar->m_strAgentID, skill, queueNum, freeNum);
-	if(ret != AGENTBARERROR_SUCCESS)
-	{
-		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "GetSkillWaitingNumber", "Return Error", ret);
-		CString strResult;
-		return strResult.AllocSysString();
-	}
-	Json::Value writeRoot;
-	writeRoot["queueNum"] = Json::Value(queueNum);
-	writeRoot["freeNum"]  = Json::Value(freeNum);
-	Json::FastWriter w;
-	string s = w.write(writeRoot);
-	CString strResult(s.c_str());
-	return strResult.AllocSysString();
-}
-
-BSTR CCCAgentBarCtrl::GetSkillWaitingCallInfo(LPCTSTR skill)
-{
-	AFX_MANAGE_STATE(AfxGetStaticModuleState());
-
-	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
-
-	if(!p_m_Bar->m_intIsSignIn)
-	{
-		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "GetSkillWaitingCallInfo", "IsSignIn Error", AGENTBARERROR_BAR_UNSIGNIN);
-		CString strResult;
-		return strResult.AllocSysString();
-	}
-
-	int queueNum = 0;
-	acd::QueueInfoListT queueInfos;
-	int ret = p_m_Bar->GetAcdClient().AcdGetSkillWaitingCallInfo(p_m_Bar->m_strAgentID, skill, queueNum, queueInfos);
-	if(ret != AGENTBARERROR_SUCCESS)
-	{
-		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "GetSkillWaitingCallInfo", "Return Error", ret);
-		CString strResult;
-		return strResult.AllocSysString();
-	}
-	Json::Value writeRoot;
-	for(acd::QueueInfoListT::iterator it = queueInfos.begin(); it != queueInfos.end(); it++)
-	{
-		Json::Value temp;
-		temp["callId"]     = Json::Value((*it).callId);
-		temp["contactId"]  = Json::Value((*it).contactId);
-		temp["requestId"]  = Json::Value((*it).requestId);
-		temp["origCaller"] = Json::Value((*it).origCaller);
-		temp["origCallee"] = Json::Value((*it).origCallee);
-		temp["startTime"]  = Json::Value((*it).startTime);
-		temp["currTime"]   = Json::Value((*it).currTime);
-		temp["changeTime"] = Json::Value((*it).changeTime);
-		writeRoot.append(temp);
-	}
-	Json::FastWriter w;
-	string s = w.write(writeRoot);
-	CString strResult(s.c_str());
-	return strResult.AllocSysString();
-}
-
-BSTR CCCAgentBarCtrl::GetPrivateQueue(LPCTSTR agentID)
-{
-	AFX_MANAGE_STATE(AfxGetStaticModuleState());
-
-	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
-
-	if(!p_m_Bar->m_intIsSignIn)
-	{
-		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "GetPrivateQueue", "IsSignIn Error", AGENTBARERROR_BAR_UNSIGNIN);
-		CString strResult;
-		return strResult.AllocSysString();
-	}
-
-	int queueNum = 0;
-	acd::QueueInfoListT queueInfos;
-	int ret = p_m_Bar->GetAcdClient().AcdGetPrivateQueue(p_m_Bar->m_strAgentID, agentID, queueNum, queueInfos);
-	if(ret != AGENTBARERROR_SUCCESS)
-	{
-		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "GetPrivateQueue", "Return Error", ret);
-		CString strResult;
-		return strResult.AllocSysString();
-	}
-	Json::Value writeRoot;
-	for(acd::QueueInfoListT::iterator it = queueInfos.begin(); it != queueInfos.end(); it++)
-	{
-		Json::Value temp;
-		temp["callId"]     = Json::Value((*it).callId);
-		temp["contactId"]  = Json::Value((*it).contactId);
-		temp["requestId"]  = Json::Value((*it).requestId);
-		temp["origCaller"] = Json::Value((*it).origCaller);
-		temp["origCallee"] = Json::Value((*it).origCallee);
-		temp["startTime"]  = Json::Value((*it).startTime);
-		temp["currTime"]   = Json::Value((*it).currTime);
-		temp["changeTime"] = Json::Value((*it).changeTime);
-		writeRoot.append(temp);
-	}
-	Json::FastWriter w;
-	string s = w.write(writeRoot);
-	CString strResult(s.c_str());
-	return strResult.AllocSysString();
-}
-
-BSTR CCCAgentBarCtrl::GetSysInfo(void)
-{
-	AFX_MANAGE_STATE(AfxGetStaticModuleState());
-
-	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
-
-	if(!p_m_Bar->m_intIsSignIn)
-	{
-		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "GetSysInfo", "IsSignIn Error", AGENTBARERROR_BAR_UNSIGNIN);
-		CString strResult;
-		return strResult.AllocSysString();
-	}
-
-	acd::SysInfoT sysInfo;
-	int ret = p_m_Bar->GetAcdClient().AcdGetSysInfo(p_m_Bar->m_strAgentID, sysInfo);
-	if(ret != AGENTBARERROR_SUCCESS)
-	{
-		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "GetSysInfo", "Return Error", ret);
-		CString strResult;
-		return strResult.AllocSysString();
-	}
-	Json::Value root;
-	root["totalAgents"]    = Json::Value(sysInfo.totalAgents);
-	root["totalCalls"]     = Json::Value(sysInfo.totalCalls);
-	root["ivrCalls"]       = Json::Value(sysInfo.ivrCalls);
-	root["agentCalls"]     = Json::Value(sysInfo.agentCalls);
-	root["queueCalls"]     = Json::Value(sysInfo.queueCalls);
-	root["privQueueCalls"] = Json::Value(sysInfo.privQueueCalls);
-	Json::FastWriter w;
-	string s = w.write(root);
-	CString strResult(s.c_str());
-	return strResult.AllocSysString();
-}
-
-BSTR CCCAgentBarCtrl::GetCallingNo(void)
-{
-	AFX_MANAGE_STATE(AfxGetStaticModuleState());
-
-	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
-
-	if(!p_m_Bar->m_intIsSignIn)
-	{
-		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "GetCallingNo", "IsSignIn Error", AGENTBARERROR_BAR_UNSIGNIN);
-		CString strResult;
-		return strResult.AllocSysString();
-	}
-
-	return p_m_Bar->m_callingNo.AllocSysString();
-}
-
-BSTR CCCAgentBarCtrl::GetOrgCallingNo(void)
-{
-	AFX_MANAGE_STATE(AfxGetStaticModuleState());
-
-	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
-
-	if(!p_m_Bar->m_intIsSignIn)
-	{
-		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "GetOrgCallingNo", "IsSignIn Error", AGENTBARERROR_BAR_UNSIGNIN);
-		CString strResult;
-		return strResult.AllocSysString();
-	}
-
-	return p_m_Bar->m_orgCallingNo.AllocSysString();
-}
-
-BSTR CCCAgentBarCtrl::GetCalledNo(void)
-{
-	AFX_MANAGE_STATE(AfxGetStaticModuleState());
-
-	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
-
-	if(!p_m_Bar->m_intIsSignIn)
-	{
-		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "GetCalledNo", "IsSignIn Error", AGENTBARERROR_BAR_UNSIGNIN);
-		CString strResult;
-		return strResult.AllocSysString();
-	}
-
-	return p_m_Bar->m_calledNo.AllocSysString();
-}
-
-BSTR CCCAgentBarCtrl::GetOrgCalledNo(void)
-{
-	AFX_MANAGE_STATE(AfxGetStaticModuleState());
-
-	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
-
-	if(!p_m_Bar->m_intIsSignIn)
-	{
-		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "GetOrgCalledNo", "IsSignIn Error", AGENTBARERROR_BAR_UNSIGNIN);
-		CString strResult;
-		return strResult.AllocSysString();
-	}
-
-	return p_m_Bar->m_orgCalledNo.AllocSysString();
-}
-
-LONG CCCAgentBarCtrl::SynchronizeCTITime(void)
-{
-	AFX_MANAGE_STATE(AfxGetStaticModuleState());
-
-	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
-
-	if(!p_m_Bar->m_intIsSignIn)
-	{
-		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "SynchronizeCTITime", "IsSignIn Error", AGENTBARERROR_BAR_UNSIGNIN);
-		return AGENTBARERROR_BAR_UNSIGNIN;
-	}
-
-	return p_m_Bar->BSynchronizeCTITime();
-}
-
-BSTR CCCAgentBarCtrl::GetPromptByErrorCode(LONG errCode)
-{
-	AFX_MANAGE_STATE(AfxGetStaticModuleState());
-
-	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
-
-	if(!p_m_Bar->m_intIsSignIn)
-	{
-		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "GetPromptByErrorCode", "IsSignIn Error", AGENTBARERROR_BAR_UNSIGNIN);
-		CString strResult;
-		return strResult.AllocSysString();
-	}
-
-	string errDescript;
-	Tool::GetAcdResult_Str(errCode, errDescript);
-
-	CString strResult(errDescript.c_str());
-	return strResult.AllocSysString();
-}
-
-LONG CCCAgentBarCtrl::JumptheQueue(LONGLONG requestId)
-{
-	AFX_MANAGE_STATE(AfxGetStaticModuleState());
-
-	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
-
-	if(!p_m_Bar->m_intIsSignIn)
-	{
-		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "JumptheQueue", "IsSignIn Error", AGENTBARERROR_BAR_UNSIGNIN);
-		return AGENTBARERROR_BAR_UNSIGNIN;
-	}
-
-	return p_m_Bar->GetAcdClient().AcdJumptheQueue(p_m_Bar->m_strAgentID, requestId);
-}
-
-
-LONG CCCAgentBarCtrl::TransIVR(LPCTSTR transferNum)
-{
-	AFX_MANAGE_STATE(AfxGetStaticModuleState());
-
-	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
-
-	if(!p_m_Bar->m_intIsSignIn)
-	{
-		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "TransIVR", "IsSignIn Error", AGENTBARERROR_BAR_UNSIGNIN);
-		return AGENTBARERROR_BAR_UNSIGNIN;
-	}
-
-	return p_m_Bar->BTransferIVR(transferNum);
-}
-
-LONG CCCAgentBarCtrl::TransIVREx(LPCTSTR callerNum, LPCTSTR transferNum)
-{
-	AFX_MANAGE_STATE(AfxGetStaticModuleState());
-
-	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
-
-	if(!p_m_Bar->m_intIsSignIn)
-	{
-		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "TransIVREx", "IsSignIn Error", AGENTBARERROR_BAR_UNSIGNIN);
-		return AGENTBARERROR_BAR_UNSIGNIN;
-	}
-
-	return p_m_Bar->BTransferIVR(transferNum, callerNum);
-}
\ No newline at end of file
+// *****************************************************************************
+//  Name:		CCCAgentBarCtrl£¬¿Ø¼þ»ù±¾Àà
+//  Author:		Yanhl
+//  Version:	1.0
+// *****************************************************************************
+
+#include "CCAgentBarCtrl.h"
+#include "CCAgentBar.h"
+#include "CCAgentBarPropPage.h"
+#include "json.h"
+
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#endif
+
+IMPLEMENT_DYNCREATE(CCCAgentBarCtrl, COleControl)
+
+// ÏûÏ¢Ó³Éä
+BEGIN_MESSAGE_MAP(CCCAgentBarCtrl, COleControl)
+	ON_OLEVERB(AFX_IDS_VERB_PROPERTIES, OnProperties)
+	ON_WM_CREATE()
+	ON_WM_SIZE()
+END_MESSAGE_MAP()
+
+// µ÷¶ÈÓ³Éä
+BEGIN_DISPATCH_MAP(CCCAgentBarCtrl, COleControl)
+	DISP_PROPERTY_EX_ID(CCCAgentBarCtrl, "AgentID", dispidAgentID, GetAgentID, SetAgentID, VT_BSTR)
+	DISP_PROPERTY_EX_ID(CCCAgentBarCtrl, "PassWord", dispidPassWord, GetPassWord, SetPassWord, VT_BSTR)
+	DISP_PROPERTY_EX_ID(CCCAgentBarCtrl, "DN", dispidDN, GetDN, SetDN, VT_BSTR)
+	DISP_PROPERTY_EX_ID(CCCAgentBarCtrl, "StatusChangeType", dispidStatusChangeType, GetStatusChangeType, SetStatusChangeType, VT_I4)
+	DISP_PROPERTY_EX_ID(CCCAgentBarCtrl, "AutoAnswer", dispidAutoAnswer, GetAutoAnswer, SetAutoAnswer, VT_I4)
+	DISP_PROPERTY_EX_ID(CCCAgentBarCtrl, "ForceSignIn", dispidForceSignIn, GetForceSignIn, SetForceSignIn, VT_I4)
+	DISP_PROPERTY_EX_ID(CCCAgentBarCtrl, "ServiceList", dispidServiceList, GetServiceList, SetServiceList, VT_BSTR)
+	DISP_PROPERTY_EX_ID(CCCAgentBarCtrl, "MainCTIIP", dispidMainCTIIP, GetMainCTIIP, SetMainCTIIP, VT_BSTR)
+	DISP_PROPERTY_EX_ID(CCCAgentBarCtrl, "BackCTIIP", dispidBackCTIIP, GetBackCTIIP, SetBackCTIIP, VT_BSTR)
+	DISP_PROPERTY_EX_ID(CCCAgentBarCtrl, "CTIPort", dispidCTIPort, GetCTIPort, SetCTIPort, VT_I4)
+	DISP_PROPERTY_EX_ID(CCCAgentBarCtrl, "TimeOut", dispidTimeOut, GetTimeOut, SetTimeOut, VT_I4)
+	DISP_PROPERTY_EX_ID(CCCAgentBarCtrl, "IsInitial", dispidIsInitial, GetIsInitial, SetIsInitial, VT_I4)
+	DISP_PROPERTY_EX_ID(CCCAgentBarCtrl, "IsSignIn", dispidIsSignIn, GetIsSignIn, SetIsSignIn, VT_I4)
+	DISP_PROPERTY_EX_ID(CCCAgentBarCtrl, "IsSIPPhone", dispidIsSIPPhone, GetIsSIPPhone, SetIsSIPPhone, VT_I4)
+	DISP_PROPERTY_EX_ID(CCCAgentBarCtrl, "SIPServerIP", dispidSIPServerIP, GetSIPServerIP, SetSIPServerIP, VT_BSTR)
+	DISP_PROPERTY_EX_ID(CCCAgentBarCtrl, "SIPServerPort", dispidSIPServerPort, GetSIPServerPort, SetSIPServerPort, VT_I4)
+	DISP_PROPERTY_EX_ID(CCCAgentBarCtrl, "PhoneNum", dispidPhoneNum, GetPhoneNum, SetPhoneNum, VT_BSTR)
+	DISP_PROPERTY_EX_ID(CCCAgentBarCtrl, "PhonePwd", dispidPhonePwd, GetPhonePwd, SetPhonePwd, VT_BSTR)
+	DISP_PROPERTY_EX_ID(CCCAgentBarCtrl, "AgentTag", dispidAgentTag, GetAgentTag, SetAgentTag, VT_BSTR)
+	DISP_PROPERTY_EX_ID(CCCAgentBarCtrl, "CustomerTag", dispidCustomerTag, GetCustomerTag, SetCustomerTag, VT_BSTR)
+	DISP_PROPERTY_EX_ID(CCCAgentBarCtrl, "ANIChangeType", dispidANIChangeType, GetANIChangeType, SetANIChangeType, VT_I4)
+	DISP_PROPERTY_EX_ID(CCCAgentBarCtrl, "IsShowCallOut", dispidIsShowCallOut, GetIsShowCallOut, SetIsShowCallOut, VT_I4)
+	DISP_PROPERTY_EX_ID(CCCAgentBarCtrl, "IsCallOut", dispidIsCallOut, GetIsCallOut, SetIsCallOut, VT_I4)
+	DISP_PROPERTY_EX_ID(CCCAgentBarCtrl, "LogLevel", dispidLogLevel, GetLogLevel, SetLogLevel, VT_I4)
+	DISP_PROPERTY_EX_ID(CCCAgentBarCtrl, "EnableSeniorCall", dispidEnableSeniorCall, GetEnableSeniorCall, SetEnableSeniorCall, VT_I4)
+	DISP_PROPERTY_EX_ID(CCCAgentBarCtrl, "AnyProperty", dispidAnyProperty, GetAnyProperty, SetAnyProperty, VT_BSTR)
+	DISP_FUNCTION_ID(CCCAgentBarCtrl, "Initial", dispidInitial, Initial, VT_I4, VTS_NONE)
+	DISP_FUNCTION_ID(CCCAgentBarCtrl, "UnInitial", dispidUnInitial, UnInitial, VT_I4, VTS_NONE)
+	DISP_FUNCTION_ID(CCCAgentBarCtrl, "SignIn", dispidSignIn, SignIn, VT_I4, VTS_NONE)
+	DISP_FUNCTION_ID(CCCAgentBarCtrl, "SignOut", dispidSignOut, SignOut, VT_I4, VTS_NONE)
+	DISP_FUNCTION_ID(CCCAgentBarCtrl, "SetIdle", dispidSetIdle, SetIdle, VT_I4, VTS_NONE)
+	DISP_FUNCTION_ID(CCCAgentBarCtrl, "SetBusy", dispidSetBusy, SetBusy, VT_I4, VTS_NONE)
+	DISP_FUNCTION_ID(CCCAgentBarCtrl, "SetRest", dispidSetRest, SetRest, VT_I4, VTS_BSTR)
+	DISP_FUNCTION_ID(CCCAgentBarCtrl, "SetAgentStatus", dispidSetAgentStatus, SetAgentStatus, VT_I4, VTS_I4 VTS_BSTR)
+	DISP_FUNCTION_ID(CCCAgentBarCtrl, "GetAgentStatus", dispidGetAgentStatus, GetAgentStatus, VT_I4, VTS_NONE)
+	DISP_FUNCTION_ID(CCCAgentBarCtrl, "ResetSkill", dispidResetSkill, ResetSkill, VT_I4, VTS_BSTR)
+	DISP_FUNCTION_ID(CCCAgentBarCtrl, "Reset", dispidReset, Reset, VT_I4, VTS_NONE)
+	DISP_FUNCTION_ID(CCCAgentBarCtrl, "MakeCall", dispidMakeCall, MakeCall, VT_I4, VTS_BSTR VTS_BSTR VTS_BSTR VTS_I4 VTS_I4)
+	DISP_FUNCTION_ID(CCCAgentBarCtrl, "Answer", dispidAnswer, Answer, VT_I4, VTS_NONE)
+	DISP_FUNCTION_ID(CCCAgentBarCtrl, "ReleaseCall", dispidReleaseCall, ReleaseCall, VT_I4, VTS_NONE)
+	DISP_FUNCTION_ID(CCCAgentBarCtrl, "Hold", dispidHold, Hold, VT_I4, VTS_NONE)
+	DISP_FUNCTION_ID(CCCAgentBarCtrl, "Retrieve", dispidRetrieve, Retrieve, VT_I4, VTS_NONE)
+	DISP_FUNCTION_ID(CCCAgentBarCtrl, "Consult", dispidConsult, Consult, VT_I4, VTS_BSTR VTS_BSTR VTS_BSTR VTS_I4)
+	DISP_FUNCTION_ID(CCCAgentBarCtrl, "Reconnect", dispidReconnect, Reconnect, VT_I4, VTS_NONE)
+	DISP_FUNCTION_ID(CCCAgentBarCtrl, "Transfer", dispidTransfer, Transfer, VT_I4, VTS_NONE)
+	DISP_FUNCTION_ID(CCCAgentBarCtrl, "SingleStepTransfer", dispidSingleStepTransfer, SingleStepTransfer, VT_I4, VTS_BSTR VTS_BSTR VTS_BSTR VTS_I4 VTS_I4)
+	DISP_FUNCTION_ID(CCCAgentBarCtrl, "Conference", dispidConference, Conference, VT_I4, VTS_NONE)
+	DISP_FUNCTION_ID(CCCAgentBarCtrl, "SetCallData", dispidSetCallData, SetCallData, VT_I4, VTS_BSTR VTS_BSTR)
+	DISP_FUNCTION_ID(CCCAgentBarCtrl, "GetCallData", dispidGetCallData, GetCallData, VT_BSTR, VTS_BSTR)
+	DISP_FUNCTION_ID(CCCAgentBarCtrl, "ForceOut", dispidForceOut, ForceOut, VT_I4, VTS_BSTR)
+	DISP_FUNCTION_ID(CCCAgentBarCtrl, "ForceIdle", dispidForceIdle, ForceIdle, VT_I4, VTS_BSTR)
+	DISP_FUNCTION_ID(CCCAgentBarCtrl, "ForceBusy", dispidForceBusy, ForceBusy, VT_I4, VTS_BSTR)
+	DISP_FUNCTION_ID(CCCAgentBarCtrl, "Listen", dispidListen, Listen, VT_I4, VTS_BSTR VTS_BSTR VTS_BSTR)
+	DISP_FUNCTION_ID(CCCAgentBarCtrl, "StopListen", dispidStopListen, StopListen, VT_I4, VTS_BSTR)
+	DISP_FUNCTION_ID(CCCAgentBarCtrl, "Insert", dispidInsert, Insert, VT_I4, VTS_BSTR VTS_BSTR VTS_BSTR)
+	DISP_FUNCTION_ID(CCCAgentBarCtrl, "StopInsert", dispidStopInsert, StopInsert, VT_I4, VTS_BSTR)
+	DISP_FUNCTION_ID(CCCAgentBarCtrl, "SwitchInsertorListen", dispidSwitchInsertorListen, SwitchInsertorListen, VT_I4, VTS_BSTR VTS_BSTR VTS_BSTR)
+	DISP_FUNCTION_ID(CCCAgentBarCtrl, "Break", dispidBreak, Break, VT_I4, VTS_BSTR)
+	DISP_FUNCTION_ID(CCCAgentBarCtrl, "SendDTMF", dispidSendDTMF, SendDTMF, VT_I4, VTS_BSTR)
+	DISP_FUNCTION_ID(CCCAgentBarCtrl, "MuteOn", dispidMuteOn, MuteOn, VT_I4, VTS_NONE)
+	DISP_FUNCTION_ID(CCCAgentBarCtrl, "MuteOff", dispidMuteOff, MuteOff, VT_I4, VTS_NONE)
+	DISP_FUNCTION_ID(CCCAgentBarCtrl, "GetAgentDetailByAgentID", dispidGetAgentDetailByAgentID, GetAgentDetailByAgentID, VT_BSTR, VTS_BSTR)
+	DISP_FUNCTION_ID(CCCAgentBarCtrl, "GetAgentDetailByAgentDN", dispidGetAgentDetailByAgentDN, GetAgentDetailByAgentDN, VT_BSTR, VTS_BSTR)
+	DISP_FUNCTION_ID(CCCAgentBarCtrl, "GetAgentDetailsByAgentIDs", dispidGetAgentDetailsByAgentIDs, GetAgentDetailsByAgentIDs, VT_BSTR, VTS_BSTR)
+	DISP_FUNCTION_ID(CCCAgentBarCtrl, "GetAgentDetailsByAgentDNs", dispidGetAgentDetailsByAgentDNs, GetAgentDetailsByAgentDNs, VT_BSTR, VTS_BSTR)
+	DISP_FUNCTION_ID(CCCAgentBarCtrl, "GetRecordFileName", dispidGetRecordFileName, GetRecordFileName, VT_BSTR, VTS_NONE)
+	DISP_FUNCTION_ID(CCCAgentBarCtrl, "GetRestReason", dispidGetRestReason, GetRestReason, VT_BSTR, VTS_NONE)
+	DISP_FUNCTION_ID(CCCAgentBarCtrl, "GetAgentNumberBySkill", dispidGetAgentNumberBySkill, GetAgentNumberBySkill, VT_I4, VTS_BSTR)
+	DISP_FUNCTION_ID(CCCAgentBarCtrl, "GetAgentDetailsBySkill", dispidGetAgentDetailsBySkill, GetAgentDetailsBySkill, VT_BSTR, VTS_BSTR)
+	DISP_FUNCTION_ID(CCCAgentBarCtrl, "GetSkillWaitingNumber", dispidGetSkillWaitingNumber, GetSkillWaitingNumber, VT_BSTR, VTS_BSTR)
+	DISP_FUNCTION_ID(CCCAgentBarCtrl, "GetSkillWaitingCallInfo", dispidGetSkillWaitingCallInfo, GetSkillWaitingCallInfo, VT_BSTR, VTS_BSTR)
+	DISP_FUNCTION_ID(CCCAgentBarCtrl, "GetPrivateQueue", dispidGetPrivateQueue, GetPrivateQueue, VT_BSTR, VTS_BSTR)
+	DISP_FUNCTION_ID(CCCAgentBarCtrl, "GetSysInfo", dispidGetSysInfo, GetSysInfo, VT_BSTR, VTS_NONE)
+	DISP_FUNCTION_ID(CCCAgentBarCtrl, "GetCallingNo", dispidGetCallingNo, GetCallingNo, VT_BSTR, VTS_NONE)
+	DISP_FUNCTION_ID(CCCAgentBarCtrl, "GetOrgCallingNo", dispidGetOrgCallingNo, GetOrgCallingNo, VT_BSTR, VTS_NONE)
+	DISP_FUNCTION_ID(CCCAgentBarCtrl, "GetCalledNo", dispidGetCalledNo, GetCalledNo, VT_BSTR, VTS_NONE)
+	DISP_FUNCTION_ID(CCCAgentBarCtrl, "GetOrgCalledNo", dispidGetOrgCalledNo, GetOrgCalledNo, VT_BSTR, VTS_NONE)
+	DISP_FUNCTION_ID(CCCAgentBarCtrl, "SynchronizeCTITime", dispidSynchronizeCTITime, SynchronizeCTITime, VT_I4, VTS_NONE)
+	DISP_FUNCTION_ID(CCCAgentBarCtrl, "GetPromptByErrorCode", dispidGetPromptByErrorCode, GetPromptByErrorCode, VT_BSTR, VTS_I4)
+	DISP_FUNCTION_ID(CCCAgentBarCtrl, "JumptheQueue", dispidJumptheQueue, JumptheQueue, VT_I4, VTS_I8)
+	DISP_FUNCTION_ID(CCCAgentBarCtrl, "TransIVR", dispidTransIVR, TransIVR, VT_I4, VTS_BSTR)
+	DISP_FUNCTION_ID(CCCAgentBarCtrl, "TransIVREx", dispidTransIVREx, TransIVREx, VT_I4, VTS_BSTR VTS_BSTR)
+	DISP_FUNCTION_ID(CCCAgentBarCtrl, "SinglestepTransferNum", dispidSinglestepTransferNum, GetSinglestepTransferNum, VT_BSTR, VTS_NONE)
+END_DISPATCH_MAP()
+
+// ÊÂ¼þÓ³Éä
+BEGIN_EVENT_MAP(CCCAgentBarCtrl, COleControl)
+	EVENT_CUSTOM_ID("OnUnLogin",           eventidOnUnLogin,           OnUnLogin,           VTS_I4 VTS_BSTR VTS_I8 VTS_I4 VTS_BSTR VTS_I4 VTS_BSTR VTS_BSTR VTS_BSTR VTS_I4 VTS_I8)
+	EVENT_CUSTOM_ID("OnReady",             eventidOnReady,             OnReady,             VTS_I4 VTS_BSTR VTS_I8 VTS_I4 VTS_BSTR VTS_I4 VTS_BSTR VTS_BSTR VTS_BSTR VTS_I4 VTS_I8)
+	EVENT_CUSTOM_ID("OnBusy",              eventidOnBusy,              OnBusy,              VTS_I4 VTS_BSTR VTS_I8 VTS_I4 VTS_BSTR VTS_I4 VTS_BSTR VTS_BSTR VTS_BSTR VTS_I4 VTS_I8)
+	EVENT_CUSTOM_ID("OnRest",              eventidOnRest,              OnRest,              VTS_I4 VTS_BSTR VTS_I8 VTS_I4 VTS_BSTR VTS_I4 VTS_BSTR VTS_BSTR VTS_BSTR VTS_I4 VTS_I8 VTS_BSTR)
+	EVENT_CUSTOM_ID("OnLock",              eventidOnLock,              OnLock,              VTS_I4 VTS_BSTR VTS_I8 VTS_I4 VTS_BSTR VTS_I4 VTS_BSTR VTS_BSTR VTS_BSTR VTS_I4 VTS_I8)
+	EVENT_CUSTOM_ID("OnAlerting",          eventidOnAlerting,          OnAlerting,          VTS_I4 VTS_BSTR VTS_I8 VTS_I4 VTS_BSTR VTS_I4 VTS_BSTR VTS_BSTR VTS_BSTR VTS_I4 VTS_I8)
+	EVENT_CUSTOM_ID("OnHarfAlerting",      eventidOnHarfAlerting,      OnHarfAlerting,      VTS_I4 VTS_BSTR VTS_I8 VTS_I4 VTS_BSTR VTS_I4 VTS_BSTR VTS_BSTR VTS_BSTR VTS_I4 VTS_I8)
+	EVENT_CUSTOM_ID("OnConnecting",        eventidOnConnecting,        OnConnecting,        VTS_I4 VTS_BSTR VTS_I8 VTS_I4 VTS_BSTR VTS_I4 VTS_BSTR VTS_BSTR VTS_BSTR VTS_I4 VTS_I8)
+	EVENT_CUSTOM_ID("OnConnected",         eventidOnConnected,         OnConnected,         VTS_I4 VTS_BSTR VTS_I8 VTS_I4 VTS_BSTR VTS_I4 VTS_BSTR VTS_BSTR VTS_BSTR VTS_I4 VTS_I8)
+	EVENT_CUSTOM_ID("OnHarfConnected",     eventidOnHarfConnected,     OnHarfConnected,     VTS_I4 VTS_BSTR VTS_I8 VTS_I4 VTS_BSTR VTS_I4 VTS_BSTR VTS_BSTR VTS_BSTR VTS_I4 VTS_I8)
+	EVENT_CUSTOM_ID("OnInternalConnected", eventidOnInternalConnected, OnInternalConnected, VTS_I4 VTS_BSTR VTS_I8 VTS_I4 VTS_BSTR VTS_I4 VTS_BSTR VTS_BSTR VTS_BSTR VTS_I4 VTS_I8)
+	EVENT_CUSTOM_ID("OnSuspended",         eventidOnSuspended,         OnSuspended,         VTS_I4 VTS_BSTR VTS_I8 VTS_I4 VTS_BSTR VTS_I4 VTS_BSTR VTS_BSTR VTS_BSTR VTS_I4 VTS_I8)
+	EVENT_CUSTOM_ID("OnConsultConnecting", eventidOnConsultConnecting, OnConsultConnecting, VTS_I4 VTS_BSTR VTS_I8 VTS_I4 VTS_BSTR VTS_I4 VTS_BSTR VTS_BSTR VTS_BSTR VTS_I4 VTS_I8)
+	EVENT_CUSTOM_ID("OnConsultConnected",  eventidOnConsultConnected,  OnConsultConnected,  VTS_I4 VTS_BSTR VTS_I8 VTS_I4 VTS_BSTR VTS_I4 VTS_BSTR VTS_BSTR VTS_BSTR VTS_I4 VTS_I8)
+	EVENT_CUSTOM_ID("OnConference",        eventidOnConference,        OnConference,        VTS_I4 VTS_BSTR VTS_I8 VTS_I4 VTS_BSTR VTS_I4 VTS_BSTR VTS_BSTR VTS_BSTR VTS_I4 VTS_I8)
+	EVENT_CUSTOM_ID("OnMonitor",           eventidOnMonitor,           OnMonitor,           VTS_I4 VTS_BSTR VTS_I8 VTS_I4 VTS_BSTR VTS_I4 VTS_BSTR VTS_BSTR VTS_BSTR VTS_I4 VTS_I8)
+	EVENT_CUSTOM_ID("OnInsert",            eventidOnInsert,            OnInsert,            VTS_I4 VTS_BSTR VTS_I8 VTS_I4 VTS_BSTR VTS_I4 VTS_BSTR VTS_BSTR VTS_BSTR VTS_I4 VTS_I8)
+	EVENT_CUSTOM_ID("OnMonitored",         eventidOnMonitored,         OnMonitored,         VTS_I4 VTS_BSTR VTS_I8 VTS_I4 VTS_BSTR VTS_I4 VTS_BSTR VTS_BSTR VTS_BSTR VTS_I4 VTS_I8)
+	EVENT_CUSTOM_ID("OnInserted",          eventidOnInserted,          OnInserted,          VTS_I4 VTS_BSTR VTS_I8 VTS_I4 VTS_BSTR VTS_I4 VTS_BSTR VTS_BSTR VTS_BSTR VTS_I4 VTS_I8)
+	EVENT_CUSTOM_ID("OnBeginRecord",       eventidOnBeginRecord,       OnBeginRecord,       VTS_BSTR VTS_I8 VTS_BSTR VTS_I4 VTS_I8)
+	EVENT_CUSTOM_ID("OnEndRecord",         eventidOnEndRecord,         OnEndRecord,         VTS_BSTR VTS_I8 VTS_BSTR VTS_I4 VTS_I8)
+	EVENT_CUSTOM_ID("OnInprivatequeue",    eventidOnInprivatequeue,    OnInprivatequeue,    VTS_BSTR VTS_I8 VTS_I8 VTS_BSTR VTS_BSTR VTS_I4 VTS_I8)
+	EVENT_CUSTOM_ID("OnOutprivatequeue",   eventidOnOutprivatequeue,   OnOutprivatequeue,   VTS_BSTR VTS_I8 VTS_I8 VTS_BSTR VTS_BSTR VTS_I4 VTS_I8)
+	EVENT_CUSTOM_ID("OnCTIDisconnect",     eventidOnCTIDisconnect,     OnCTIDisconnect,     VTS_BSTR VTS_I8 VTS_BSTR VTS_BSTR VTS_I4 VTS_I8)
+	EVENT_CUSTOM_ID("OnCTIMasterChanged",  eventidOnCTIMasterChanged,  OnCTIMasterChanged,  VTS_BSTR VTS_I8 VTS_BSTR VTS_BSTR VTS_I4 VTS_I8)
+	EVENT_CUSTOM_ID("OnOperationFailed",   eventidOnOperationFailed,   OnOperationFailed,   VTS_BSTR VTS_I8 VTS_BSTR VTS_BSTR VTS_I4 VTS_I8)
+	EVENT_CUSTOM_ID("OnBeforeOutCall",     eventidOnBeforeOutCall,     OnBeforeOutCall,     VTS_BSTR VTS_I4 VTS_BSTR VTS_BSTR VTS_I4 VTS_I8)
+    EVENT_CUSTOM_ID("OnHeartbeat", eventidOnHeartbeat, OnHeartbeat, VTS_I8)
+    EVENT_CUSTOM_ID("OnBtnStatus", eventidOnBtnStatus, OnBtnStatus, VTS_I8 VTS_BSTR)
+END_EVENT_MAP()
+
+// ÊôÐÔÒ³
+// TODO: °´ÐèÒªÌí¼Ó¸ü¶àÊôÐÔÒ³¡£Çë¼Ç×¡Ôö¼Ó¼ÆÊý£¡
+BEGIN_PROPPAGEIDS(CCCAgentBarCtrl, 1)
+	PROPPAGEID(CCCAgentBarPropPage::guid)
+END_PROPPAGEIDS(CCCAgentBarCtrl)
+
+// ³õÊ¼»¯Àà¹¤³§ºÍ guid
+IMPLEMENT_OLECREATE_EX(CCCAgentBarCtrl, "CCAGENTBAR.CCAgentBarCtrl.1",
+	0x6d4733b4, 0x8e49, 0x495c, 0x9f, 0x2b, 0x27, 0x60, 0x6c, 0xeb, 0x20, 0xe3)
+
+// ¼üÈë¿â ID ºÍ°æ±¾
+IMPLEMENT_OLETYPELIB(CCCAgentBarCtrl, _tlid, _wVerMajor, _wVerMinor)
+
+// ½Ó¿Ú ID
+const IID BASED_CODE IID_DCCAgentBar =
+		{ 0x72EA8ED1, 0xD4EE, 0x4FE9, { 0x93, 0x13, 0xBB, 0x72, 0x57, 0xEC, 0x19, 0xB8 } };
+const IID BASED_CODE IID_DCCAgentBarEvents =
+		{ 0x7AE6BDA7, 0x9F41, 0x4C75, { 0x9F, 0x71, 0xFF, 0x5, 0x5A, 0x16, 0x7D, 0xC2 } };
+
+// ¿Ø¼þÀàÐÍÐÅÏ¢
+static const DWORD BASED_CODE _dwCCAgentBarOleMisc =
+	OLEMISC_ACTIVATEWHENVISIBLE |
+	OLEMISC_SETCLIENTSITEFIRST |
+	OLEMISC_INSIDEOUT |
+	OLEMISC_CANTLINKINSIDE |
+	OLEMISC_RECOMPOSEONRESIZE;
+
+IMPLEMENT_OLECTLTYPE(CCCAgentBarCtrl, IDS_CCAGENTBAR, _dwCCAgentBarOleMisc)
+
+// CCCAgentBarCtrl::CCCAgentBarCtrlFactory::UpdateRegistry -
+// Ìí¼Ó»òÒÆ³ý CCCAgentBarCtrl µÄÏµÍ³×¢²á±íÏî
+BOOL CCCAgentBarCtrl::CCCAgentBarCtrlFactory::UpdateRegistry(BOOL bRegister)
+{
+	// TODO: ÑéÖ¤ÄúµÄ¿Ø¼þÊÇ·ñ·ûºÏµ¥ÔªÄ£ÐÍÏß³Ì´¦Àí¹æÔò¡£
+	// ÓÐ¹Ø¸ü¶àÐÅÏ¢£¬Çë²Î¿¼ MFC ¼¼ÊõËµÃ÷ 64¡£
+	// Èç¹ûÄúµÄ¿Ø¼þ²»·ûºÏµ¥ÔªÄ£ÐÍ¹æÔò£¬Ôò
+	// ±ØÐëÐÞ¸ÄÈçÏÂ´úÂë£¬½«µÚÁù¸ö²ÎÊý´Ó
+	// afxRegApartmentThreading ¸ÄÎª 0¡£
+
+	if (bRegister)
+		return AfxOleRegisterControlClass(
+			AfxGetInstanceHandle(),
+			m_clsid,
+			m_lpszProgID,
+			IDS_CCAGENTBAR,
+			IDB_CCAGENTBAR,
+			afxRegInsertable | afxRegApartmentThreading,
+			_dwCCAgentBarOleMisc,
+			_tlid,
+			_wVerMajor,
+			_wVerMinor);
+	else
+		return AfxOleUnregisterClass(m_clsid, m_lpszProgID);
+}
+
+// CCCAgentBarCtrl::CCCAgentBarCtrl - ¹¹Ôìº¯Êý
+CCCAgentBarCtrl::CCCAgentBarCtrl()
+{
+	InitializeIIDs(&IID_DCCAgentBar, &IID_DCCAgentBarEvents);
+	// TODO: ÔÚ´Ë³õÊ¼»¯¿Ø¼þµÄÊµÀýÊý¾Ý¡£
+
+	this->SetInitialSize(BAR_WIDTH, BAR_HEIGHT);
+	this->SetBorderStyle(0);
+
+	p_m_Bar = new CCCBar(this);
+	Tool::p_Bar = p_m_Bar;
+}
+
+// CCCAgentBarCtrl::~CCCAgentBarCtrl - Îö¹¹º¯Êý
+CCCAgentBarCtrl::~CCCAgentBarCtrl()
+{
+	// TODO: ÔÚ´ËÇåÀí¿Ø¼þµÄÊµÀýÊý¾Ý¡£
+	delete p_m_Bar;
+	p_m_Bar = NULL;
+}
+
+// CCCAgentBarCtrl::OnDraw - »æÍ¼º¯Êý
+void CCCAgentBarCtrl::OnDraw(
+			CDC* pdc, const CRect& rcBounds, const CRect& rcInvalid)
+{
+	if (!pdc)
+		return;
+
+	// TODO: ÓÃÄú×Ô¼ºµÄ»æÍ¼´úÂëÌæ»»ÏÂÃæµÄ´úÂë¡£
+	//pdc->FillRect(rcBounds, CBrush::FromHandle((HBRUSH)GetStockObject(WHITE_BRUSH)));
+	//pdc->Ellipse(rcBounds);
+}
+
+// CCCAgentBarCtrl::DoPropExchange - ³Ö¾ÃÐÔÖ§³Ö
+void CCCAgentBarCtrl::DoPropExchange(CPropExchange* pPX)
+{
+	ExchangeVersion(pPX, MAKELONG(_wVerMinor, _wVerMajor));
+	COleControl::DoPropExchange(pPX);
+
+	// TODO: ÎªÃ¿¸ö³Ö¾ÃµÄ×Ô¶¨ÒåÊôÐÔµ÷ÓÃ PX_ º¯Êý¡£
+	if(pPX->GetVersion() == static_cast<DWORD>(MAKELONG(_wVerMinor, _wVerMajor)))
+	{
+		PX_String(pPX, "AgentID", p_m_Bar->m_strAgentID);
+		PX_String(pPX, "SinglestepTransferNum", p_m_Bar->m_singlestepTransferNum);
+		PX_String(pPX, "PassWord", p_m_Bar->m_strPassWord);
+		PX_String(pPX, "DN", p_m_Bar->m_strDN);
+
+		long temp = -1;
+		PX_Long(pPX, "StatusChangeType", temp);
+		if(temp != -1)
+		{
+			if(temp < 0 || temp > 1)// ×¢Òâ£¡
+				temp = 0;
+			p_m_Bar->m_intStatusChangeType = temp;
+		}
+
+		PX_Bool(pPX, "AutoAnswer", p_m_Bar->m_intAutoAnswer);
+		PX_Bool(pPX, "ForceSignIn", p_m_Bar->m_intForceSignIn);
+		PX_String(pPX, "ServiceList", p_m_Bar->m_strServiceList);
+		PX_String(pPX, "MainCTIIP", p_m_Bar->m_strMainCTIIP);
+		PX_String(pPX, "BackCTIIP", p_m_Bar->m_strBackCTIIP);
+		PX_Long(pPX, "CTIPort", p_m_Bar->m_intCTIPort);
+		PX_Long(pPX, "TimeOut", p_m_Bar->m_intTimeOut);
+		//IsInitialºÍIsSignInÊÇÖ»¶ÁÊôÐÔ£¬´Ë´¦²»´¦Àí
+		PX_Bool(pPX, "IsSIPPhone", p_m_Bar->m_intIsSIPPhone);
+		PX_String(pPX, "SIPServerIP", p_m_Bar->m_strSIPServerIP);
+		PX_Long(pPX, "SIPServerPort", p_m_Bar->m_intSIPServerPort);
+		PX_String(pPX, "PhoneNum", p_m_Bar->m_strPhoneNum);
+		PX_String(pPX, "PhonePwd", p_m_Bar->m_strPhonePwd);
+		PX_String(pPX, "AgentTag", p_m_Bar->m_strAgentTag);
+		PX_String(pPX, "CustomerTag", p_m_Bar->m_strCustomerTag);
+
+		temp = -1;
+		PX_Long(pPX, "ANIChangeType", temp);
+		if(temp != -1)
+		{
+			if(temp < 0 || temp > 2)// ×¢Òâ£¡
+				temp = 0;
+			p_m_Bar->m_intANIChangeType = static_cast<ANICHANGE>(temp);
+		}
+
+		PX_Bool(pPX, "IsShowCallOut", p_m_Bar->m_intIsShowCallOut);
+		PX_Bool(pPX, "IsCallOut", p_m_Bar->m_intIsCallOut);
+
+		temp = -1;
+		PX_Long(pPX, "LogLevel", temp);
+		if(temp != -1)
+		{
+			if(temp < 0 || temp > 3)// ×¢Òâ£¡
+				temp = 2;
+			p_m_Bar->m_intLogLevel = static_cast<Level>(temp);
+		}
+
+		PX_Bool(pPX, "EnableSeniorCall", p_m_Bar->m_intEnableSeniorCall);
+	}
+}
+
+// CCCAgentBarCtrl::OnResetState - ½«¿Ø¼þÖØÖÃÎªÄ¬ÈÏ×´Ì¬
+void CCCAgentBarCtrl::OnResetState()
+{
+	COleControl::OnResetState();  // ÖØÖÃ DoPropExchange ÖÐÕÒµ½µÄÄ¬ÈÏÖµ
+
+	// TODO: ÔÚ´ËÖØÖÃÈÎÒâÆäËû¿Ø¼þ×´Ì¬¡£
+}
+
+BOOL CCCAgentBarCtrl::OnSetObjectRects(LPCRECT lpRectPos, LPCRECT lpRectClip)
+{
+	// TODO: ÔÚ´ËÌí¼Ó×¨ÓÃ´úÂëºÍ/»òµ÷ÓÃ»ùÀà
+
+	ASSERT(lpRectPos != NULL);
+
+	// Remember the position rectangle for later
+	m_rcPos = *lpRectPos;
+
+	// Calculate complete rectangle including the tracker (if present)
+	CRect rectPos = m_rcPos;
+	if(m_bUIActive && m_pRectTracker != NULL)
+	{
+		// Save new clipping rectangle (for DestroyTracker)
+		if(lpRectClip != NULL)
+			m_pRectTracker->m_rectClip = *lpRectClip;
+
+		// Adjust tracker rectangle to new dimensions
+		CRect rectTmp = rectPos;
+		rectTmp.OffsetRect(-rectTmp.left, -rectTmp.top);
+		m_pRectTracker->m_rect = rectTmp;
+
+		// Adjust the "true" rectangle to include handles/hatching
+		UINT nHandleSize = m_pRectTracker->m_nHandleSize - 1;
+		rectPos.InflateRect(nHandleSize, nHandleSize);
+	}
+
+	// Now clip that rectangle as appropriate
+	CRect rectClip;
+
+	// CHANGE - call your own copy of _GetClippingCoordinates
+	GetClippingCoordinates(rectPos, lpRectClip, rectClip, &m_ptOffset);
+
+	// Move outer window first. then inner window
+	if(!m_bInPlaceSiteWndless)
+	{
+		CWnd* pWndOuter = GetOuterWindow();
+
+		//BEGIN CHANGE
+		if(pWndOuter != NULL)
+			::MoveWindow(pWndOuter->m_hWnd, rectPos.left, rectPos.top, rectPos.Width(), rectPos.Height(), TRUE);
+
+		//END CHANGE								
+		if(pWndOuter != this)
+			MoveWindow(m_ptOffset.x, m_ptOffset.y, rectPos.Width(), rectPos.Height());
+	}
+
+	return TRUE;
+
+	//return COleControl::OnSetObjectRects(lpRectPos, lpRectClip);
+}
+
+void CCCAgentBarCtrl::GetClippingCoordinates(LPCRECT pPosRect, LPCRECT pClipRect, LPRECT pIntersectRect, LPPOINT pOffsetPoint)
+{
+	int clipLeft = 0;
+	int clipTop = 0;
+
+	if(pClipRect == NULL || IsRectEmpty(pClipRect))
+	{
+		CopyRect(pIntersectRect, pPosRect);
+	}
+	else
+	{
+		IntersectRect(pIntersectRect, pPosRect, pClipRect);
+		clipLeft = pClipRect->left;
+		clipTop = pClipRect->top;
+	}
+
+	pOffsetPoint->x = 0;
+	pOffsetPoint->y = 0;
+}
+
+// CCCAgentBarCtrl ÏûÏ¢´¦Àí³ÌÐò
+int CCCAgentBarCtrl::OnCreate(LPCREATESTRUCT lpCreateStruct)
+{
+	if (COleControl::OnCreate(lpCreateStruct) == -1)
+		return -1;
+
+	// TODO:  ÔÚ´ËÌí¼ÓÄú×¨ÓÃµÄ´´½¨´úÂë
+	p_m_Bar->Create(IDD_DIALOG_CCBAR, this);
+
+	//p_m_Bar->MoveWindow(0, 0, BAR_WIDTH, BAR_HEIGHT); //¸ù¾Ý¿Ø¼þµÄ´óÐ¡µ÷Õû½çÃæµÄ´óÐ¡
+	//p_m_Bar->ShowWindow(SW_SHOW);
+
+	return 0;
+}
+
+void CCCAgentBarCtrl::OnSize(UINT nType, int cx, int cy)
+{
+	COleControl::OnSize(nType, cx, cy);
+
+	// TODO: ÔÚ´Ë´¦Ìí¼ÓÏûÏ¢´¦Àí³ÌÐò´úÂë
+	p_m_Bar->MoveWindow(0, 0, BAR_WIDTH, BAR_HEIGHT); //¸ù¾Ý¿Ø¼þµÄ´óÐ¡µ÷Õû½çÃæµÄ´óÐ¡
+	p_m_Bar->ShowWindow(SW_SHOW);
+}
+
+// ÊôÐÔ--------------------------------------------------------------------------------------------------------------
+BSTR CCCAgentBarCtrl::GetAgentID(void)
+{
+	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
+
+	return p_m_Bar->m_strAgentID.AllocSysString();
+}
+
+void CCCAgentBarCtrl::SetAgentID(LPCTSTR newVal)
+{
+	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+	// TODO: ÔÚ´ËÌí¼ÓÊôÐÔ´¦Àí³ÌÐò´úÂë
+	if(!p_m_Bar->m_intIsSignIn)
+	{
+		p_m_Bar->m_strAgentID = newVal;
+	}
+
+	SetModifiedFlag();
+}
+
+BSTR CCCAgentBarCtrl::GetPassWord(void)
+{
+	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
+
+	return p_m_Bar->m_strPassWord.AllocSysString();
+}
+
+void CCCAgentBarCtrl::SetPassWord(LPCTSTR newVal)
+{
+	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+	// TODO: ÔÚ´ËÌí¼ÓÊôÐÔ´¦Àí³ÌÐò´úÂë
+	if(!p_m_Bar->m_intIsSignIn)
+	{
+		p_m_Bar->m_strPassWord = newVal;
+	}
+
+	SetModifiedFlag();
+}
+
+BSTR CCCAgentBarCtrl::GetDN(void)
+{
+	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
+
+	return p_m_Bar->m_strDN.AllocSysString();
+}
+
+void CCCAgentBarCtrl::SetDN(LPCTSTR newVal)
+{
+	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+	// TODO: ÔÚ´ËÌí¼ÓÊôÐÔ´¦Àí³ÌÐò´úÂë
+	if(!p_m_Bar->m_intIsSignIn)
+	{
+		p_m_Bar->m_strDN = newVal;
+	}
+
+	SetModifiedFlag();
+}
+
+LONG CCCAgentBarCtrl::GetStatusChangeType(void)
+{
+	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
+
+	return p_m_Bar->m_intStatusChangeType.get_value();
+}
+
+void CCCAgentBarCtrl::SetStatusChangeType(LONG newVal)
+{
+	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+	// TODO: ÔÚ´ËÌí¼ÓÊôÐÔ´¦Àí³ÌÐò´úÂë
+	if(!p_m_Bar->m_intIsSignIn)
+	{
+		if(newVal < 0 || newVal > 1)// ×¢Òâ£¡
+			newVal = 0;
+		p_m_Bar->m_intStatusChangeType = newVal;
+	}
+
+	SetModifiedFlag();
+}
+
+LONG CCCAgentBarCtrl::GetAutoAnswer(void)
+{
+	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
+
+	return p_m_Bar->m_intAutoAnswer;
+}
+
+void CCCAgentBarCtrl::SetAutoAnswer(LONG newVal)
+{
+	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+	// TODO: ÔÚ´ËÌí¼ÓÊôÐÔ´¦Àí³ÌÐò´úÂë
+	if(!p_m_Bar->m_intIsSignIn)
+	{
+		p_m_Bar->m_intAutoAnswer = newVal;
+	}
+
+	SetModifiedFlag();
+}
+
+LONG CCCAgentBarCtrl::GetForceSignIn(void)
+{
+	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
+
+	return p_m_Bar->m_intForceSignIn;
+}
+
+void CCCAgentBarCtrl::SetForceSignIn(LONG newVal)
+{
+	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+	// TODO: ÔÚ´ËÌí¼ÓÊôÐÔ´¦Àí³ÌÐò´úÂë
+	if(!p_m_Bar->m_intIsSignIn)
+	{
+		p_m_Bar->m_intForceSignIn = newVal;
+	}
+
+	SetModifiedFlag();
+}
+
+BSTR CCCAgentBarCtrl::GetServiceList(void)
+{
+	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
+
+	return p_m_Bar->m_strServiceList.AllocSysString();
+}
+
+void CCCAgentBarCtrl::SetServiceList(LPCTSTR newVal)
+{
+	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+	// TODO: ÔÚ´ËÌí¼ÓÊôÐÔ´¦Àí³ÌÐò´úÂë
+	if(!p_m_Bar->m_intIsSignIn)
+	{
+		p_m_Bar->m_strServiceList = newVal;
+	}
+
+	SetModifiedFlag();
+}
+
+BSTR CCCAgentBarCtrl::GetMainCTIIP(void)
+{
+	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
+
+	return p_m_Bar->m_strMainCTIIP.AllocSysString();
+}
+
+void CCCAgentBarCtrl::SetMainCTIIP(LPCTSTR newVal)
+{
+	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+	// TODO: ÔÚ´ËÌí¼ÓÊôÐÔ´¦Àí³ÌÐò´úÂë
+	if(!p_m_Bar->m_intIsSignIn)
+	{
+		p_m_Bar->m_strMainCTIIP = newVal;
+	}
+
+	SetModifiedFlag();
+}
+
+BSTR CCCAgentBarCtrl::GetBackCTIIP(void)
+{
+	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
+
+	return p_m_Bar->m_strBackCTIIP.AllocSysString();
+}
+
+void CCCAgentBarCtrl::SetBackCTIIP(LPCTSTR newVal)
+{
+	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+	// TODO: ÔÚ´ËÌí¼ÓÊôÐÔ´¦Àí³ÌÐò´úÂë
+	if(!p_m_Bar->m_intIsSignIn)
+	{
+		p_m_Bar->m_strBackCTIIP = newVal;
+	}
+
+	SetModifiedFlag();
+}
+
+LONG CCCAgentBarCtrl::GetCTIPort(void)
+{
+	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
+
+	return p_m_Bar->m_intCTIPort;
+}
+
+void CCCAgentBarCtrl::SetCTIPort(LONG newVal)
+{
+	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+	// TODO: ÔÚ´ËÌí¼ÓÊôÐÔ´¦Àí³ÌÐò´úÂë
+	if(!p_m_Bar->m_intIsSignIn)
+	{
+		p_m_Bar->m_intCTIPort = newVal;
+	}
+
+	SetModifiedFlag();
+}
+
+LONG CCCAgentBarCtrl::GetTimeOut(void)
+{
+	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
+
+	return p_m_Bar->m_intTimeOut;
+}
+
+void CCCAgentBarCtrl::SetTimeOut(LONG newVal)
+{
+	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+	// TODO: ÔÚ´ËÌí¼ÓÊôÐÔ´¦Àí³ÌÐò´úÂë
+	if(!p_m_Bar->m_intIsSignIn)
+	{
+		p_m_Bar->m_intTimeOut = newVal;
+	}
+
+	SetModifiedFlag();
+}
+
+LONG CCCAgentBarCtrl::GetIsInitial(void)
+{
+	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
+
+	return p_m_Bar->m_intIsInitial;
+}
+
+void CCCAgentBarCtrl::SetIsInitial(LONG newVal)
+{
+	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+	// TODO: ÔÚ´ËÌí¼ÓÊôÐÔ´¦Àí³ÌÐò´úÂë
+	// Ö»¶ÁÊôÐÔ£¬´Ë´¦²»´¦Àí
+	//p_m_Bar->m_intIsInitial = newVal;
+
+	SetModifiedFlag();
+}
+
+LONG CCCAgentBarCtrl::GetIsSignIn(void)
+{
+	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
+
+	return p_m_Bar->m_intIsSignIn;
+}
+
+void CCCAgentBarCtrl::SetIsSignIn(LONG newVal)
+{
+	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+	// TODO: ÔÚ´ËÌí¼ÓÊôÐÔ´¦Àí³ÌÐò´úÂë
+	// Ö»¶ÁÊôÐÔ£¬´Ë´¦²»´¦Àí
+	//p_m_Bar->m_intIsSignIn = newVal;
+
+	SetModifiedFlag();
+}
+
+LONG CCCAgentBarCtrl::GetIsSIPPhone(void)
+{
+	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
+
+	return p_m_Bar->m_intIsSIPPhone;
+}
+
+void CCCAgentBarCtrl::SetIsSIPPhone(LONG newVal)
+{
+	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+	// TODO: ÔÚ´ËÌí¼ÓÊôÐÔ´¦Àí³ÌÐò´úÂë
+	if(!p_m_Bar->m_intIsInitial)
+	{
+		p_m_Bar->m_intIsSIPPhone = newVal;
+	}
+
+	SetModifiedFlag();
+}
+
+BSTR CCCAgentBarCtrl::GetSIPServerIP(void)
+{
+	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
+
+	return p_m_Bar->m_strSIPServerIP.AllocSysString();
+}
+
+void CCCAgentBarCtrl::SetSIPServerIP(LPCTSTR newVal)
+{
+	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+	// TODO: ÔÚ´ËÌí¼ÓÊôÐÔ´¦Àí³ÌÐò´úÂë
+	if(!p_m_Bar->m_intIsSignIn)
+	{
+		p_m_Bar->m_strSIPServerIP = newVal;
+	}
+
+	SetModifiedFlag();
+}
+
+LONG CCCAgentBarCtrl::GetSIPServerPort(void)
+{
+	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
+
+	return p_m_Bar->m_intSIPServerPort;
+}
+
+void CCCAgentBarCtrl::SetSIPServerPort(LONG newVal)
+{
+	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+	// TODO: ÔÚ´ËÌí¼ÓÊôÐÔ´¦Àí³ÌÐò´úÂë
+	if(!p_m_Bar->m_intIsSignIn)
+	{
+		p_m_Bar->m_intSIPServerPort = newVal;
+	}
+
+	SetModifiedFlag();
+}
+
+BSTR CCCAgentBarCtrl::GetPhoneNum(void)
+{
+	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
+
+	return p_m_Bar->m_strPhoneNum.AllocSysString();
+}
+
+void CCCAgentBarCtrl::SetPhoneNum(LPCTSTR newVal)
+{
+	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+	// TODO: ÔÚ´ËÌí¼ÓÊôÐÔ´¦Àí³ÌÐò´úÂë
+	if(!p_m_Bar->m_intIsSignIn)
+	{
+		p_m_Bar->m_strPhoneNum = newVal;
+	}
+
+	SetModifiedFlag();
+}
+
+BSTR CCCAgentBarCtrl::GetPhonePwd(void)
+{
+	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
+
+	return p_m_Bar->m_strPhonePwd.AllocSysString();
+}
+
+void CCCAgentBarCtrl::SetPhonePwd(LPCTSTR newVal)
+{
+	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+	// TODO: ÔÚ´ËÌí¼ÓÊôÐÔ´¦Àí³ÌÐò´úÂë
+	if(!p_m_Bar->m_intIsSignIn)
+	{
+		p_m_Bar->m_strPhonePwd = newVal;
+	}
+
+	SetModifiedFlag();
+}
+
+BSTR CCCAgentBarCtrl::GetAgentTag(void)
+{
+	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
+
+	return p_m_Bar->m_strAgentTag.AllocSysString();
+}
+
+void CCCAgentBarCtrl::SetAgentTag(LPCTSTR newVal)
+{
+	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+	// TODO: ÔÚ´ËÌí¼ÓÊôÐÔ´¦Àí³ÌÐò´úÂë
+	p_m_Bar->m_strAgentTag = newVal;
+
+	SetModifiedFlag();
+}
+
+BSTR CCCAgentBarCtrl::GetCustomerTag(void)
+{
+	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
+
+	return p_m_Bar->m_strCustomerTag.AllocSysString();
+}
+
+void CCCAgentBarCtrl::SetCustomerTag(LPCTSTR newVal)
+{
+	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+	// TODO: ÔÚ´ËÌí¼ÓÊôÐÔ´¦Àí³ÌÐò´úÂë
+	p_m_Bar->m_strCustomerTag = newVal;
+
+	SetModifiedFlag();
+}
+
+LONG CCCAgentBarCtrl::GetANIChangeType(void)
+{
+	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
+
+	return p_m_Bar->m_intANIChangeType;
+}
+
+void CCCAgentBarCtrl::SetANIChangeType(LONG newVal)
+{
+	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+	// TODO: ÔÚ´ËÌí¼ÓÊôÐÔ´¦Àí³ÌÐò´úÂë
+	if(newVal < 0 || newVal > 2)// ×¢Òâ£¡
+		newVal = 0;
+	p_m_Bar->m_intANIChangeType = static_cast<ANICHANGE>(newVal);
+
+	SetModifiedFlag();
+}
+
+LONG CCCAgentBarCtrl::GetIsShowCallOut(void)
+{
+	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
+
+	return p_m_Bar->m_intIsShowCallOut;
+}
+
+void CCCAgentBarCtrl::SetIsShowCallOut(LONG newVal)
+{
+	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+	// TODO: ÔÚ´ËÌí¼ÓÊôÐÔ´¦Àí³ÌÐò´úÂë
+	p_m_Bar->m_intIsShowCallOut = newVal;
+
+	SetModifiedFlag();
+}
+
+LONG CCCAgentBarCtrl::GetIsCallOut(void)
+{
+	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
+
+	return p_m_Bar->m_intIsCallOut;
+}
+
+void CCCAgentBarCtrl::SetIsCallOut(LONG newVal)
+{
+	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+	// TODO: ÔÚ´ËÌí¼ÓÊôÐÔ´¦Àí³ÌÐò´úÂë
+	p_m_Bar->m_intIsCallOut = newVal;
+
+	SetModifiedFlag();
+}
+
+LONG CCCAgentBarCtrl::GetLogLevel(void)
+{
+	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
+
+	return p_m_Bar->m_intLogLevel;
+}
+
+void CCCAgentBarCtrl::SetLogLevel(LONG newVal)
+{
+	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+	// TODO: ÔÚ´ËÌí¼ÓÊôÐÔ´¦Àí³ÌÐò´úÂë
+	if(!p_m_Bar->m_intIsInitial)
+	{
+		if(newVal < 0 || newVal > 3)// ×¢Òâ£¡
+			newVal = 2;
+		p_m_Bar->m_intLogLevel = static_cast<Level>(newVal);
+	}
+
+	SetModifiedFlag();
+}
+
+LONG CCCAgentBarCtrl::GetEnableSeniorCall(void)
+{
+	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
+
+	return p_m_Bar->m_intEnableSeniorCall;
+}
+
+void CCCAgentBarCtrl::SetEnableSeniorCall(LONG newVal)
+{
+	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+	// TODO: ÔÚ´ËÌí¼ÓÊôÐÔ´¦Àí³ÌÐò´úÂë
+	if(!p_m_Bar->m_intIsSignIn)
+	{
+		p_m_Bar->m_intEnableSeniorCall = newVal;
+	}
+
+	SetModifiedFlag();
+}
+
+BSTR CCCAgentBarCtrl::GetAnyProperty(void)
+{
+	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+	CString strResult;
+
+	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
+
+	return strResult.AllocSysString();
+}
+
+void CCCAgentBarCtrl::SetAnyProperty(LPCTSTR newVal)
+{
+	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+	// TODO: ÔÚ´ËÌí¼ÓÊôÐÔ´¦Àí³ÌÐò´úÂë
+
+	SetModifiedFlag();
+}
+
+BSTR CCCAgentBarCtrl::GetSinglestepTransferNum(void)
+{
+	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
+
+	return p_m_Bar->m_singlestepTransferNum.AllocSysString();
+
+}
+
+
+// ·½·¨-------------------------------------------------------------------------------------------------------------
+LONG CCCAgentBarCtrl::Initial(void)
+{
+	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
+
+	if(p_m_Bar->m_intIsInitial)
+	{
+		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "Initial", "IsInitial Error", AGENTBARERROR_BAR_INITIAL);
+		return AGENTBARERROR_BAR_INITIAL;
+	}
+
+	return p_m_Bar->BInitial();
+}
+
+LONG CCCAgentBarCtrl::UnInitial(void)
+{
+	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
+
+	if(!p_m_Bar->m_intIsInitial)
+	{
+		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "UnInitial", "IsInitial Error", AGENTBARERROR_BAR_UNINITIAL);
+		return AGENTBARERROR_BAR_UNINITIAL;
+	}
+
+	return p_m_Bar->BUnInitial();
+}
+
+LONG CCCAgentBarCtrl::SignIn(void)
+{
+	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
+
+	if(!p_m_Bar->m_intIsInitial)
+	{
+		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "SignIn", "IsInitial Error", AGENTBARERROR_BAR_UNINITIAL);
+		return AGENTBARERROR_BAR_UNINITIAL;
+	}
+
+	return p_m_Bar->BSignIn();
+}
+
+LONG CCCAgentBarCtrl::SignOut(void)
+{
+	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
+
+	if(!p_m_Bar->m_intIsSignIn)
+	{
+		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "SignOut", "IsSignIn Error", AGENTBARERROR_BAR_UNSIGNIN);
+		return AGENTBARERROR_BAR_UNSIGNIN;
+	}
+
+	return p_m_Bar->BSignOut();
+}
+
+LONG CCCAgentBarCtrl::SetIdle(void)
+{
+	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
+
+	if(!p_m_Bar->m_intIsSignIn)
+	{
+		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "SetIdle", "IsSignIn Error", AGENTBARERROR_BAR_UNSIGNIN);
+		return AGENTBARERROR_BAR_UNSIGNIN;
+	}
+
+	return p_m_Bar->BSetIdle();
+}
+
+LONG CCCAgentBarCtrl::SetBusy(void)
+{
+	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
+
+	if(!p_m_Bar->m_intIsSignIn)
+	{
+		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "SetBusy", "IsSignIn Error", AGENTBARERROR_BAR_UNSIGNIN);
+		return AGENTBARERROR_BAR_UNSIGNIN;
+	}
+
+	return p_m_Bar->BSetBusy();
+}
+
+LONG CCCAgentBarCtrl::SetRest(LPCTSTR reason)
+{
+	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
+
+	if(!p_m_Bar->m_intIsSignIn)
+	{
+		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "SetRest", "IsSignIn Error", AGENTBARERROR_BAR_UNSIGNIN);
+		return AGENTBARERROR_BAR_UNSIGNIN;
+	}
+
+	return p_m_Bar->BSetRest(reason);
+}
+
+LONG CCCAgentBarCtrl::SetAgentStatus(LONG agentState, LPCTSTR reason)
+{
+	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
+
+	if(!p_m_Bar->m_intIsSignIn)
+	{
+		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "SetAgentStatus", "IsSignIn Error", AGENTBARERROR_BAR_UNSIGNIN);
+		return AGENTBARERROR_BAR_UNSIGNIN;
+	}
+
+	if(agentState < 0 || agentState > 19)// ×¢Òâ£¡
+		agentState = 0;
+
+	return p_m_Bar->GetAcdClient().AcdSetAgentStatus(p_m_Bar->m_strAgentID, agentState, reason);
+}
+
+LONG CCCAgentBarCtrl::GetAgentStatus(void)
+{
+	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
+
+	if(!p_m_Bar->m_intIsSignIn)
+	{
+		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "GetAgentStatus", "IsSignIn Error", AGENTBARERROR_BAR_UNSIGNIN);
+		return AGENTBARERROR_BAR_UNSIGNIN;
+	}
+
+	acd::AgentStatusT status = acd::AgentStatusT::AsUnknownState;
+	int ret = p_m_Bar->BGetAgentStatus(status);
+
+	if(ret != AGENTBARERROR_SUCCESS)
+	{
+		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "GetAgentStatus", "Return Error", ret);
+		return ret;
+	}
+
+	return status.get_value();
+}
+
+LONG CCCAgentBarCtrl::ResetSkill(LPCTSTR skillList)
+{
+	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
+
+	if(!p_m_Bar->m_intIsSignIn)
+	{
+		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "ResetSkill", "IsSignIn Error", AGENTBARERROR_BAR_UNSIGNIN);
+		return AGENTBARERROR_BAR_UNSIGNIN;
+	}
+
+	return p_m_Bar->BResetSkill(skillList);
+}
+
+LONG CCCAgentBarCtrl::Reset(void)
+{
+	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
+
+	if(!p_m_Bar->m_intIsSignIn)
+	{
+		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "Reset", "IsSignIn Error", AGENTBARERROR_BAR_UNSIGNIN);
+		return AGENTBARERROR_BAR_UNSIGNIN;
+	}
+
+	return p_m_Bar->BReset();
+}
+
+LONG CCCAgentBarCtrl::MakeCall(LPCTSTR dest, LPCTSTR showANI, LPCTSTR showDest, LONG isOffhook, LONG type)
+{
+	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
+
+	if(!p_m_Bar->m_intIsSignIn)
+	{
+		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "MakeCall", "IsSignIn Error", AGENTBARERROR_BAR_UNSIGNIN);
+		return AGENTBARERROR_BAR_UNSIGNIN;
+	}
+
+	if(isOffhook < 0 || isOffhook > 1)// ×¢Òâ£¡
+		isOffhook = 0;
+	if(type < 0 || type > 1)// ×¢Òâ£¡
+		type = 0;
+
+	CString ani, dnis;
+	switch(p_m_Bar->m_intANIChangeType)
+	{
+	case ANICHANGE_SYSTEM:
+		break;
+	case ANICHANGE_TRANSFER:
+		//ani = dest; Õþ²ßÎÊÌâ
+		dnis = p_m_Bar->m_strDN;
+		break;
+	case ANICHANGE_SPECIAL:
+		ani = showANI;
+		dnis = showDest;
+		break;
+	default:
+		break;
+	}
+
+	return p_m_Bar->BMakeCall(dest, ani, dnis, isOffhook, type);
+}
+
+LONG CCCAgentBarCtrl::Answer(void)
+{
+	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
+
+	if(!p_m_Bar->m_intIsSignIn)
+	{
+		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "Answer", "IsSignIn Error", AGENTBARERROR_BAR_UNSIGNIN);
+		return AGENTBARERROR_BAR_UNSIGNIN;
+	}
+
+	return p_m_Bar->BAnswer();
+}
+
+LONG CCCAgentBarCtrl::ReleaseCall(void)
+{
+	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
+
+	if(!p_m_Bar->m_intIsSignIn)
+	{
+		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "ReleaseCall", "IsSignIn Error", AGENTBARERROR_BAR_UNSIGNIN);
+		return AGENTBARERROR_BAR_UNSIGNIN;
+	}
+
+	return p_m_Bar->BReleaseCall();
+}
+
+LONG CCCAgentBarCtrl::Hold(void)
+{
+	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
+
+	if(!p_m_Bar->m_intIsSignIn)
+	{
+		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "Hold", "IsSignIn Error", AGENTBARERROR_BAR_UNSIGNIN);
+		return AGENTBARERROR_BAR_UNSIGNIN;
+	}
+
+	return p_m_Bar->BHold();
+}
+
+LONG CCCAgentBarCtrl::Retrieve(void)
+{
+	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
+
+	if(!p_m_Bar->m_intIsSignIn)
+	{
+		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "Retrieve", "IsSignIn Error", AGENTBARERROR_BAR_UNSIGNIN);
+		return AGENTBARERROR_BAR_UNSIGNIN;
+	}
+
+	return p_m_Bar->BRetrieve();
+}
+
+LONG CCCAgentBarCtrl::Consult(LPCTSTR consultNum, LPCTSTR showANI, LPCTSTR showDest, 
+                                                LONG consultType)
+{
+	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
+
+	if(!p_m_Bar->m_intIsSignIn)
+	{
+		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "Consult", "IsSignIn Error", AGENTBARERROR_BAR_UNSIGNIN);
+		return AGENTBARERROR_BAR_UNSIGNIN;
+	}
+
+    //if(consultType < 0 || consultType > 1)// ×¢Òâ£¡
+    //    consultType = 0;
+	CString ani, dnis;
+	switch(p_m_Bar->m_intANIChangeType)
+	{
+	case ANICHANGE_SYSTEM:
+		break;
+	case ANICHANGE_TRANSFER:
+		//ani = consultNum; Õþ²ßÎÊÌâ
+		dnis = p_m_Bar->m_strDN;
+		break;
+	case ANICHANGE_SPECIAL:
+		ani = showANI;
+		dnis = showDest;
+		break;
+	default:
+		break;
+	}
+
+	return p_m_Bar->BConsult(consultNum, ani, dnis, consultType);
+}
+
+LONG CCCAgentBarCtrl::Reconnect(void)
+{
+	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
+
+	if(!p_m_Bar->m_intIsSignIn)
+	{
+		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "Reconnect", "IsSignIn Error", AGENTBARERROR_BAR_UNSIGNIN);
+		return AGENTBARERROR_BAR_UNSIGNIN;
+	}
+
+	return p_m_Bar->BReconnect();
+}
+
+LONG CCCAgentBarCtrl::Transfer(void)
+{
+	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
+
+	if(!p_m_Bar->m_intIsSignIn)
+	{
+		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "Transfer", "IsSignIn Error", AGENTBARERROR_BAR_UNSIGNIN);
+		return AGENTBARERROR_BAR_UNSIGNIN;
+	}
+
+	return p_m_Bar->BTransfer();
+}
+
+LONG CCCAgentBarCtrl::SingleStepTransfer(LPCTSTR transferNum, LPCTSTR showANI, LPCTSTR showDest, LONG transferStyle, LONG transferType)
+{
+	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
+
+	if(!p_m_Bar->m_intIsSignIn)
+	{
+		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "SingleStepTransfer", "IsSignIn Error", AGENTBARERROR_BAR_UNSIGNIN);
+		return AGENTBARERROR_BAR_UNSIGNIN;
+	}
+
+	if (transferType < 0 || transferType > 3)// ×¢Òâ£¡
+		transferType = 0;
+
+	// 0£ºÄÚÏß
+	// 1£ºÍâÏß
+	// 2£ºIVR Ö»¶ÔagentbarÓÐÐ§£¬acdÃ»ÓÐ´ËÀàÐÍ£¬µ½acdÖ®ºó£¬×ª»»ÎªÍâÏß
+	if(2 == transferType)
+	{
+		return p_m_Bar->BTransferIVR(transferNum);
+	}
+
+	CString ani, dnis;
+	switch(p_m_Bar->m_intANIChangeType)
+	{
+	case ANICHANGE_SYSTEM:
+		break;
+	case ANICHANGE_TRANSFER:
+		//ani = transferNum; Õþ²ßÎÊÌâ
+		dnis = p_m_Bar->m_strDN;
+		break;
+	case ANICHANGE_SPECIAL:
+		ani = showANI;
+		dnis = showDest;
+		break;
+	default:
+		break;
+	}
+    if (transferType == 3) {
+        ani = showANI;
+        dnis = showDest;
+    }
+
+	return p_m_Bar->BSingleStepTransfer(transferNum, ani, dnis, transferStyle, transferType);
+}
+
+LONG CCCAgentBarCtrl::Conference(void)
+{
+	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
+
+	if(!p_m_Bar->m_intIsSignIn)
+	{
+		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "Conference", "IsSignIn Error", AGENTBARERROR_BAR_UNSIGNIN);
+		return AGENTBARERROR_BAR_UNSIGNIN;
+	}
+
+	return p_m_Bar->BConference();
+}
+
+LONG CCCAgentBarCtrl::SetCallData(LPCTSTR key, LPCTSTR callData)
+{
+	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
+
+	if(!p_m_Bar->m_intIsSignIn)
+	{
+		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "SetCallData", "IsSignIn Error", AGENTBARERROR_BAR_UNSIGNIN);
+		return AGENTBARERROR_BAR_UNSIGNIN;
+	}
+
+	return p_m_Bar->GetAcdClient().AcdSetAssociateData(p_m_Bar->m_strAgentID, key, callData);
+}
+
+BSTR CCCAgentBarCtrl::GetCallData(LPCTSTR key)
+{
+	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
+
+	if(!p_m_Bar->m_intIsSignIn)
+	{
+		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "GetCallData", "IsSignIn Error", AGENTBARERROR_BAR_UNSIGNIN);
+		CString strResult;
+		return strResult.AllocSysString();
+	}
+
+	string data;
+	int ret = p_m_Bar->GetAcdClient().AcdGetAssociateData(p_m_Bar->m_strAgentID, key, data);
+	if(ret != AGENTBARERROR_SUCCESS)
+	{
+		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "GetCallData", "Return Error", ret);
+		CString strResult;
+		return strResult.AllocSysString();
+	}
+
+	CString strResult(data.c_str());
+	return strResult.AllocSysString();
+}
+
+LONG CCCAgentBarCtrl::ForceOut(LPCTSTR agentID)
+{
+	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
+
+	if(!p_m_Bar->m_intIsSignIn)
+	{
+		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "ForceOut", "IsSignIn Error", AGENTBARERROR_BAR_UNSIGNIN);
+		return AGENTBARERROR_BAR_UNSIGNIN;
+	}
+
+	return p_m_Bar->GetAcdClient().AcdForceSignOut(p_m_Bar->m_strAgentID, agentID);
+}
+
+LONG CCCAgentBarCtrl::ForceIdle(LPCTSTR agentID)
+{
+	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
+
+	if(!p_m_Bar->m_intIsSignIn)
+	{
+		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "ForceIdle", "IsSignIn Error", AGENTBARERROR_BAR_UNSIGNIN);
+		return AGENTBARERROR_BAR_UNSIGNIN;
+	}
+
+	return p_m_Bar->GetAcdClient().AcdForceSetAgentStatus(p_m_Bar->m_strAgentID, agentID, acd::AgentStatusT::AsReadyState);
+}
+
+LONG CCCAgentBarCtrl::ForceBusy(LPCTSTR agentID)
+{
+	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
+
+	if(!p_m_Bar->m_intIsSignIn)
+	{
+		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "ForceBusy", "IsSignIn Error", AGENTBARERROR_BAR_UNSIGNIN);
+		return AGENTBARERROR_BAR_UNSIGNIN;
+	}
+
+	return p_m_Bar->GetAcdClient().AcdForceSetAgentStatus(p_m_Bar->m_strAgentID, agentID, acd::AgentStatusT::AsBusyState);
+}
+
+LONG CCCAgentBarCtrl::Listen(LPCTSTR agentID, LPCTSTR showANI, LPCTSTR showDest)
+{
+	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
+
+	if(!p_m_Bar->m_intIsSignIn)
+	{
+		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "Listen", "IsSignIn Error", AGENTBARERROR_BAR_UNSIGNIN);
+		return AGENTBARERROR_BAR_UNSIGNIN;
+	}
+
+	return p_m_Bar->BListen(agentID, showANI, showDest);
+}
+
+LONG CCCAgentBarCtrl::StopListen(LPCTSTR agentID)
+{
+	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
+
+	if(!p_m_Bar->m_intIsSignIn)
+	{
+		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "StopListen", "IsSignIn Error", AGENTBARERROR_BAR_UNSIGNIN);
+		return AGENTBARERROR_BAR_UNSIGNIN;
+	}
+
+	return p_m_Bar->BStopListen(agentID);
+}
+
+LONG CCCAgentBarCtrl::Insert(LPCTSTR agentID, LPCTSTR showANI, LPCTSTR showDest)
+{
+	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
+
+	if(!p_m_Bar->m_intIsSignIn)
+	{
+		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "Insert", "IsSignIn Error", AGENTBARERROR_BAR_UNSIGNIN);
+		return AGENTBARERROR_BAR_UNSIGNIN;
+	}
+
+	return p_m_Bar->BInsert(agentID, showANI, showDest);
+}
+
+LONG CCCAgentBarCtrl::StopInsert(LPCTSTR agentID)
+{
+	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
+
+	if(!p_m_Bar->m_intIsSignIn)
+	{
+		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "StopInsert", "IsSignIn Error", AGENTBARERROR_BAR_UNSIGNIN);
+		return AGENTBARERROR_BAR_UNSIGNIN;
+	}
+
+	return p_m_Bar->BStopInsert(agentID);
+}
+
+LONG CCCAgentBarCtrl::SwitchInsertorListen(LPCTSTR agentID, LPCTSTR showANI, LPCTSTR showDest)
+{
+	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
+
+	if(!p_m_Bar->m_intIsSignIn)
+	{
+		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "SwitchInsertorListen", "IsSignIn Error", AGENTBARERROR_BAR_UNSIGNIN);
+		return AGENTBARERROR_BAR_UNSIGNIN;
+	}
+
+	return p_m_Bar->BSwitchInsertorListen(agentID, showANI, showDest);
+}
+
+LONG CCCAgentBarCtrl::Break(LPCTSTR agentID)
+{
+	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
+
+	if(!p_m_Bar->m_intIsSignIn)
+	{
+		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "Break", "IsSignIn Error", AGENTBARERROR_BAR_UNSIGNIN);
+		return AGENTBARERROR_BAR_UNSIGNIN;
+	}
+
+	return p_m_Bar->GetAcdClient().AcdBreak(p_m_Bar->m_strAgentID, agentID);
+}
+
+LONG CCCAgentBarCtrl::SendDTMF(LPCTSTR dtmf)
+{
+	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
+
+	if(!p_m_Bar->m_intIsSignIn)
+	{
+		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "SendDTMF", "IsSignIn Error", AGENTBARERROR_BAR_UNSIGNIN);
+		return AGENTBARERROR_BAR_UNSIGNIN;
+	}
+
+	return p_m_Bar->BSendDTMF(dtmf);
+}
+
+LONG CCCAgentBarCtrl::MuteOn(void)
+{
+	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
+
+	if(!p_m_Bar->m_intIsSignIn)
+	{
+		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "MuteOn", "IsSignIn Error", AGENTBARERROR_BAR_UNSIGNIN);
+		return AGENTBARERROR_BAR_UNSIGNIN;
+	}
+
+	return p_m_Bar->GetAcdClient().AcdMuteOn(p_m_Bar->m_strAgentID);
+}
+
+LONG CCCAgentBarCtrl::MuteOff(void)
+{
+	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
+
+	if(!p_m_Bar->m_intIsSignIn)
+	{
+		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "MuteOff", "IsSignIn Error", AGENTBARERROR_BAR_UNSIGNIN);
+		return AGENTBARERROR_BAR_UNSIGNIN;
+	}
+
+	return p_m_Bar->GetAcdClient().AcdMuteOff(p_m_Bar->m_strAgentID);
+}
+
+BSTR CCCAgentBarCtrl::GetAgentDetailByAgentID(LPCTSTR agentID)
+{
+	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
+
+	if(!p_m_Bar->m_intIsSignIn)
+	{
+		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "GetAgentDetailByAgentID", "IsSignIn Error", AGENTBARERROR_BAR_UNSIGNIN);
+		CString strResult;
+		return strResult.AllocSysString();
+	}
+
+	acd::AgentInfoT agentInfo;
+	int ret = p_m_Bar->GetAcdClient().AcdGetAgentDetailByAgentID(p_m_Bar->m_strAgentID, agentID, agentInfo);
+	if(ret != AGENTBARERROR_SUCCESS)
+	{
+		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "GetAgentDetailByAgentID", "Return Error", ret);
+		CString strResult;
+		return strResult.AllocSysString();
+	}
+
+	Json::Value root;
+	root["agentId"]         = Json::Value(agentInfo.agentId);
+	root["agentDn"]         = Json::Value(agentInfo.agentDn);
+	root["loginTime"]       = Json::Value(agentInfo.loginTime);
+	root["currStatus"]      = Json::Value(agentInfo.currStatus.get_value());
+	root["currStatusTime"]  = Json::Value(agentInfo.currStatusTime);
+	root["answerTime"]      = Json::Value(agentInfo.answerTime);
+	root["currTime"]        = Json::Value(agentInfo.currTime);
+	root["origCaller"]      = Json::Value(agentInfo.origCaller);
+	root["origCallee"]      = Json::Value(agentInfo.origCallee);
+	root["privQueueNum"]    = Json::Value(agentInfo.privQueueNum);
+	root["callTimes"]       = Json::Value(agentInfo.callTimes);
+	root["answerTimes"]     = Json::Value(agentInfo.answerTimes);
+	root["freeTotalTime"]   = Json::Value(agentInfo.freeTotalTime);
+	root["busyTotalTime"]   = Json::Value(agentInfo.busyTotalTime);
+	root["resetTotalTime"]  = Json::Value(agentInfo.resetTotalTime);
+	root["callTotalTime"]   = Json::Value(agentInfo.callTotalTime);
+	root["answerTotalTime"] = Json::Value(agentInfo.answerTotalTime);
+	root["agentIP"]         = Json::Value(agentInfo.agentIP);
+	Json::FastWriter w;
+	string s = w.write(root);
+	CString strResult(s.c_str());
+	return strResult.AllocSysString();
+}
+
+BSTR CCCAgentBarCtrl::GetAgentDetailByAgentDN(LPCTSTR agentDN)
+{
+	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
+
+	if(!p_m_Bar->m_intIsSignIn)
+	{
+		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "GetAgentDetailByAgentDN", "IsSignIn Error", AGENTBARERROR_BAR_UNSIGNIN);
+		CString strResult;
+		return strResult.AllocSysString();
+	}
+
+	acd::AgentInfoT agentInfo;
+	int ret = p_m_Bar->GetAcdClient().AcdGetAgentDetailByAgentDN(p_m_Bar->m_strAgentID, agentDN, agentInfo);
+	if(ret != AGENTBARERROR_SUCCESS)
+	{
+		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "GetAgentDetailByAgentDN", "Return Error", ret);
+		CString strResult;
+		return strResult.AllocSysString();
+	}
+
+	Json::Value root;
+	root["agentId"]         = Json::Value(agentInfo.agentId);
+	root["agentDn"]         = Json::Value(agentInfo.agentDn);
+	root["loginTime"]       = Json::Value(agentInfo.loginTime);
+	root["currStatus"]      = Json::Value(agentInfo.currStatus.get_value());
+	root["currStatusTime"]  = Json::Value(agentInfo.currStatusTime);
+	root["answerTime"]      = Json::Value(agentInfo.answerTime);
+	root["currTime"]        = Json::Value(agentInfo.currTime);
+	root["origCaller"]      = Json::Value(agentInfo.origCaller);
+	root["origCallee"]      = Json::Value(agentInfo.origCallee);
+	root["privQueueNum"]    = Json::Value(agentInfo.privQueueNum);
+	root["callTimes"]       = Json::Value(agentInfo.callTimes);
+	root["answerTimes"]     = Json::Value(agentInfo.answerTimes);
+	root["freeTotalTime"]   = Json::Value(agentInfo.freeTotalTime);
+	root["busyTotalTime"]   = Json::Value(agentInfo.busyTotalTime);
+	root["resetTotalTime"]  = Json::Value(agentInfo.resetTotalTime);
+	root["callTotalTime"]   = Json::Value(agentInfo.callTotalTime);
+	root["answerTotalTime"] = Json::Value(agentInfo.answerTotalTime);
+	root["agentIP"]         = Json::Value(agentInfo.agentIP);
+	Json::FastWriter w;
+	string s = w.write(root);
+	CString strResult(s.c_str());
+	return strResult.AllocSysString();
+}
+
+BSTR CCCAgentBarCtrl::GetAgentDetailsByAgentIDs(LPCTSTR agentIDs)
+{
+	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
+
+	if(!p_m_Bar->m_intIsSignIn)
+	{
+		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "GetAgentDetailsByAgentIDs", "IsSignIn Error", AGENTBARERROR_BAR_UNSIGNIN);
+		CString strResult;
+		return strResult.AllocSysString();
+	}
+
+	Json::Reader reader;
+	Json::Value readRoot;
+	if(!reader.parse(agentIDs, readRoot))
+	{
+		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "GetAgentDetailsByAgentIDs", "json Error", AGENTBARERROR_JSON_READERROR);
+		CString strResult;
+		return strResult.AllocSysString();
+	}
+	if(!readRoot.isArray())
+	{
+		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "GetAgentDetailsByAgentIDs", "json not array Error", AGENTBARERROR_JSON_READERROR);
+		CString strResult;
+		return strResult.AllocSysString();
+	}
+	acd::StringListT agents;
+	for(Json::Value::iterator it = readRoot.begin(); it != readRoot.end(); it++)
+	{
+		Json::Value v = (*it)["AgentID"];
+		if(!v)
+			continue;
+		if(!v.isString())
+			continue;
+		agents.push_back(v.asCString());
+	}
+	if(agents.size() == 0)
+	{
+		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "GetAgentDetailsByAgentIDs", "AgentList size", 0);
+		CString strResult;
+		return strResult.AllocSysString();
+	}
+	acd::AgentInfoListT agentInfos;
+	int ret = p_m_Bar->GetAcdClient().AcdGetAgentDetailsByAgentIDs(p_m_Bar->m_strAgentID, agents, agentInfos);
+	if(ret != AGENTBARERROR_SUCCESS)
+	{
+		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "GetAgentDetailsByAgentIDs", "Return Error", ret);
+		CString strResult;
+		return strResult.AllocSysString();
+	}
+	Json::Value writeRoot;
+	for(acd::AgentInfoListT::iterator it = agentInfos.begin(); it != agentInfos.end(); it++)
+	{
+		Json::Value temp;
+		temp["agentId"]         = Json::Value((*it).agentId);
+		temp["agentDn"]         = Json::Value((*it).agentDn);
+		temp["loginTime"]       = Json::Value((*it).loginTime);
+		temp["currStatus"]      = Json::Value((*it).currStatus.get_value());
+		temp["currStatusTime"]  = Json::Value((*it).currStatusTime);
+		temp["answerTime"]      = Json::Value((*it).answerTime);
+		temp["currTime"]        = Json::Value((*it).currTime);
+		temp["origCaller"]      = Json::Value((*it).origCaller);
+		temp["origCallee"]      = Json::Value((*it).origCallee);
+		temp["privQueueNum"]    = Json::Value((*it).privQueueNum);
+		temp["callTimes"]       = Json::Value((*it).callTimes);
+		temp["answerTimes"]     = Json::Value((*it).answerTimes);
+		temp["freeTotalTime"]   = Json::Value((*it).freeTotalTime);
+		temp["busyTotalTime"]   = Json::Value((*it).busyTotalTime);
+		temp["resetTotalTime"]  = Json::Value((*it).resetTotalTime);
+		temp["callTotalTime"]   = Json::Value((*it).callTotalTime);
+		temp["answerTotalTime"] = Json::Value((*it).answerTotalTime);
+		temp["agentIP"]         = Json::Value((*it).agentIP);
+		writeRoot.append(temp);
+	}
+	Json::FastWriter w;
+	string s = w.write(writeRoot);
+	CString strResult(s.c_str());
+	return strResult.AllocSysString();
+}
+
+BSTR CCCAgentBarCtrl::GetAgentDetailsByAgentDNs(LPCTSTR agentDNs)
+{
+	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
+
+	if(!p_m_Bar->m_intIsSignIn)
+	{
+		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "GetAgentDetailsByAgentDNs", "IsSignIn Error", AGENTBARERROR_BAR_UNSIGNIN);
+		CString strResult;
+		return strResult.AllocSysString();
+	}
+
+	Json::Reader reader;
+	Json::Value readRoot;
+	if(!reader.parse(agentDNs, readRoot))
+	{
+		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "GetAgentDetailsByAgentDNs", "json Error", AGENTBARERROR_JSON_READERROR);
+		CString strResult;
+		return strResult.AllocSysString();
+	}
+	if(!readRoot.isArray())
+	{
+		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "GetAgentDetailsByAgentDNs", "json not array Error", AGENTBARERROR_JSON_READERROR);
+		CString strResult;
+		return strResult.AllocSysString();
+	}
+	acd::StringListT agents;
+	for(Json::Value::iterator it = readRoot.begin(); it != readRoot.end(); it++)
+	{
+		Json::Value v = (*it)["AgentDN"];
+		if(!v)
+			continue;
+		if(!v.isString())
+			continue;
+		agents.push_back(v.asCString());
+	}
+	if(agents.size() == 0)
+	{
+		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "GetAgentDetailsByAgentDNs", "AgentList size", 0);
+		CString strResult;
+		return strResult.AllocSysString();
+	}
+	acd::AgentInfoListT agentInfos;
+	int ret = p_m_Bar->GetAcdClient().AcdGetAgentDetailsByAgentDNs(p_m_Bar->m_strAgentID, agents, agentInfos);
+	if(ret != AGENTBARERROR_SUCCESS)
+	{
+		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "GetAgentDetailsByAgentDNs", "Return Error", ret);
+		CString strResult;
+		return strResult.AllocSysString();
+	}
+	Json::Value writeRoot;
+	for(acd::AgentInfoListT::iterator it = agentInfos.begin(); it != agentInfos.end(); it++)
+	{
+		Json::Value temp;
+		temp["agentId"]         = Json::Value((*it).agentId);
+		temp["agentDn"]         = Json::Value((*it).agentDn);
+		temp["loginTime"]       = Json::Value((*it).loginTime);
+		temp["currStatus"]      = Json::Value((*it).currStatus.get_value());
+		temp["currStatusTime"]  = Json::Value((*it).currStatusTime);
+		temp["answerTime"]      = Json::Value((*it).answerTime);
+		temp["currTime"]        = Json::Value((*it).currTime);
+		temp["origCaller"]      = Json::Value((*it).origCaller);
+		temp["origCallee"]      = Json::Value((*it).origCallee);
+		temp["privQueueNum"]    = Json::Value((*it).privQueueNum);
+		temp["callTimes"]       = Json::Value((*it).callTimes);
+		temp["answerTimes"]     = Json::Value((*it).answerTimes);
+		temp["freeTotalTime"]   = Json::Value((*it).freeTotalTime);
+		temp["busyTotalTime"]   = Json::Value((*it).busyTotalTime);
+		temp["resetTotalTime"]  = Json::Value((*it).resetTotalTime);
+		temp["callTotalTime"]   = Json::Value((*it).callTotalTime);
+		temp["answerTotalTime"] = Json::Value((*it).answerTotalTime);
+		temp["agentIP"]         = Json::Value((*it).agentIP);
+		writeRoot.append(temp);
+	}
+	Json::FastWriter w;
+	string s = w.write(writeRoot);
+	CString strResult(s.c_str());
+	return strResult.AllocSysString();
+}
+
+BSTR CCCAgentBarCtrl::GetRecordFileName(void)
+{
+	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
+
+	if(!p_m_Bar->m_intIsSignIn)
+	{
+		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "GetRecordFileName", "IsSignIn Error", AGENTBARERROR_BAR_UNSIGNIN);
+		CString strResult;
+		return strResult.AllocSysString();
+	}
+
+	string fileName;
+	int ret = p_m_Bar->GetAcdClient().AcdGetRecordFileName(p_m_Bar->m_strAgentID, fileName);
+	if(ret != AGENTBARERROR_SUCCESS)
+	{
+		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "GetRecordFileName", "Return Error", ret);
+		CString strResult;
+		return strResult.AllocSysString();
+	}
+
+	CString strResult(fileName.c_str());
+	return strResult.AllocSysString();
+}
+
+BSTR CCCAgentBarCtrl::GetRestReason(void)
+{
+	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
+
+	if(!p_m_Bar->m_intIsSignIn)
+	{
+		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "GetRestReason", "IsSignIn Error", AGENTBARERROR_BAR_UNSIGNIN);
+		CString strResult;
+		return strResult.AllocSysString();
+	}
+
+	acd::StringListT reasons;
+	int ret = p_m_Bar->BGetRestReason(reasons);
+	if(ret != AGENTBARERROR_SUCCESS)
+	{
+		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "GetRestReason", "Return Error", ret);
+		CString strResult;
+		return strResult.AllocSysString();
+	}
+	Json::Value writeRoot;
+	for(acd::StringListT::iterator it = reasons.begin(); it != reasons.end(); it++)
+	{
+		Json::Value temp;
+		temp["reason"] = Json::Value(*it);
+		writeRoot.append(temp);
+	}
+	Json::FastWriter w;
+	string s = w.write(writeRoot);
+	CString strResult(s.c_str());
+	return strResult.AllocSysString();
+}
+
+LONG CCCAgentBarCtrl::GetAgentNumberBySkill(LPCTSTR skill)
+{
+	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
+
+	if(!p_m_Bar->m_intIsSignIn)
+	{
+		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "GetAgentNumberBySkill", "IsSignIn Error", AGENTBARERROR_BAR_UNSIGNIN);
+		return AGENTBARERROR_BAR_UNSIGNIN;
+	}
+
+	int agentNumber = 0;
+	int ret = p_m_Bar->GetAcdClient().AcdGetAgentNumberBySkill(p_m_Bar->m_strAgentID, skill, agentNumber);
+
+	if(ret != AGENTBARERROR_SUCCESS)
+	{
+		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "GetAgentNumberBySkill", "Return Error", ret);
+		return ret;
+	}
+
+	return agentNumber;
+}
+
+BSTR CCCAgentBarCtrl::GetAgentDetailsBySkill(LPCTSTR skill)
+{
+	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
+
+	if(!p_m_Bar->m_intIsSignIn)
+	{
+		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "GetAgentDetailsBySkill", "IsSignIn Error", AGENTBARERROR_BAR_UNSIGNIN);
+		CString strResult;
+		return strResult.AllocSysString();
+	}
+
+	int agentNumber = 0;
+	acd::AgentInfoListT agentInfos;
+	int ret = p_m_Bar->GetAcdClient().AcdGetAgentDetailsBySkill(p_m_Bar->m_strAgentID, skill, agentNumber, agentInfos);
+	if(ret != AGENTBARERROR_SUCCESS)
+	{
+		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "GetAgentDetailsBySkill", "Return Error", ret);
+		CString strResult;
+		return strResult.AllocSysString();
+	}
+	Json::Value writeRoot;
+	for(acd::AgentInfoListT::iterator it = agentInfos.begin(); it != agentInfos.end(); it++)
+	{
+		Json::Value temp;
+		temp["agentId"]         = Json::Value((*it).agentId);
+		temp["agentDn"]         = Json::Value((*it).agentDn);
+		temp["loginTime"]       = Json::Value((*it).loginTime);
+		temp["currStatus"]      = Json::Value((*it).currStatus.get_value());
+		temp["currStatusTime"]  = Json::Value((*it).currStatusTime);
+		temp["answerTime"]      = Json::Value((*it).answerTime);
+		temp["currTime"]        = Json::Value((*it).currTime);
+		temp["origCaller"]      = Json::Value((*it).origCaller);
+		temp["origCallee"]      = Json::Value((*it).origCallee);
+		temp["privQueueNum"]    = Json::Value((*it).privQueueNum);
+		temp["callTimes"]       = Json::Value((*it).callTimes);
+		temp["answerTimes"]     = Json::Value((*it).answerTimes);
+		temp["freeTotalTime"]   = Json::Value((*it).freeTotalTime);
+		temp["busyTotalTime"]   = Json::Value((*it).busyTotalTime);
+		temp["resetTotalTime"]  = Json::Value((*it).resetTotalTime);
+		temp["callTotalTime"]   = Json::Value((*it).callTotalTime);
+		temp["answerTotalTime"] = Json::Value((*it).answerTotalTime);
+		temp["agentIP"]         = Json::Value((*it).agentIP);
+		writeRoot.append(temp);
+	}
+	Json::FastWriter w;
+	string s = w.write(writeRoot);
+	CString strResult(s.c_str());
+	return strResult.AllocSysString();
+}
+
+BSTR CCCAgentBarCtrl::GetSkillWaitingNumber(LPCTSTR skill)
+{
+	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
+
+	if(!p_m_Bar->m_intIsSignIn)
+	{
+		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "GetSkillWaitingNumber", "IsSignIn Error", AGENTBARERROR_BAR_UNSIGNIN);
+		CString strResult;
+		return strResult.AllocSysString();
+	}
+
+	int queueNum = 0;
+	int freeNum = 0;
+	int ret = p_m_Bar->GetAcdClient().AcdGetSkillWaitingNumber(p_m_Bar->m_strAgentID, skill, queueNum, freeNum);
+	if(ret != AGENTBARERROR_SUCCESS)
+	{
+		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "GetSkillWaitingNumber", "Return Error", ret);
+		CString strResult;
+		return strResult.AllocSysString();
+	}
+	Json::Value writeRoot;
+	writeRoot["queueNum"] = Json::Value(queueNum);
+	writeRoot["freeNum"]  = Json::Value(freeNum);
+	Json::FastWriter w;
+	string s = w.write(writeRoot);
+	CString strResult(s.c_str());
+	return strResult.AllocSysString();
+}
+
+BSTR CCCAgentBarCtrl::GetSkillWaitingCallInfo(LPCTSTR skill)
+{
+	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
+
+	if(!p_m_Bar->m_intIsSignIn)
+	{
+		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "GetSkillWaitingCallInfo", "IsSignIn Error", AGENTBARERROR_BAR_UNSIGNIN);
+		CString strResult;
+		return strResult.AllocSysString();
+	}
+
+	int queueNum = 0;
+	acd::QueueInfoListT queueInfos;
+	int ret = p_m_Bar->GetAcdClient().AcdGetSkillWaitingCallInfo(p_m_Bar->m_strAgentID, skill, queueNum, queueInfos);
+	if(ret != AGENTBARERROR_SUCCESS)
+	{
+		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "GetSkillWaitingCallInfo", "Return Error", ret);
+		CString strResult;
+		return strResult.AllocSysString();
+	}
+	Json::Value writeRoot;
+	for(acd::QueueInfoListT::iterator it = queueInfos.begin(); it != queueInfos.end(); it++)
+	{
+		Json::Value temp;
+		temp["callId"]     = Json::Value((*it).callId);
+		temp["contactId"]  = Json::Value((*it).contactId);
+		temp["requestId"]  = Json::Value((*it).requestId);
+		temp["origCaller"] = Json::Value((*it).origCaller);
+		temp["origCallee"] = Json::Value((*it).origCallee);
+		temp["startTime"]  = Json::Value((*it).startTime);
+		temp["currTime"]   = Json::Value((*it).currTime);
+		temp["changeTime"] = Json::Value((*it).changeTime);
+		writeRoot.append(temp);
+	}
+	Json::FastWriter w;
+	string s = w.write(writeRoot);
+	CString strResult(s.c_str());
+	return strResult.AllocSysString();
+}
+
+BSTR CCCAgentBarCtrl::GetPrivateQueue(LPCTSTR agentID)
+{
+	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
+
+	if(!p_m_Bar->m_intIsSignIn)
+	{
+		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "GetPrivateQueue", "IsSignIn Error", AGENTBARERROR_BAR_UNSIGNIN);
+		CString strResult;
+		return strResult.AllocSysString();
+	}
+
+	int queueNum = 0;
+	acd::QueueInfoListT queueInfos;
+	int ret = p_m_Bar->GetAcdClient().AcdGetPrivateQueue(p_m_Bar->m_strAgentID, agentID, queueNum, queueInfos);
+	if(ret != AGENTBARERROR_SUCCESS)
+	{
+		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "GetPrivateQueue", "Return Error", ret);
+		CString strResult;
+		return strResult.AllocSysString();
+	}
+	Json::Value writeRoot;
+	for(acd::QueueInfoListT::iterator it = queueInfos.begin(); it != queueInfos.end(); it++)
+	{
+		Json::Value temp;
+		temp["callId"]     = Json::Value((*it).callId);
+		temp["contactId"]  = Json::Value((*it).contactId);
+		temp["requestId"]  = Json::Value((*it).requestId);
+		temp["origCaller"] = Json::Value((*it).origCaller);
+		temp["origCallee"] = Json::Value((*it).origCallee);
+		temp["startTime"]  = Json::Value((*it).startTime);
+		temp["currTime"]   = Json::Value((*it).currTime);
+		temp["changeTime"] = Json::Value((*it).changeTime);
+		writeRoot.append(temp);
+	}
+	Json::FastWriter w;
+	string s = w.write(writeRoot);
+	CString strResult(s.c_str());
+	return strResult.AllocSysString();
+}
+
+BSTR CCCAgentBarCtrl::GetSysInfo(void)
+{
+	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
+
+	if(!p_m_Bar->m_intIsSignIn)
+	{
+		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "GetSysInfo", "IsSignIn Error", AGENTBARERROR_BAR_UNSIGNIN);
+		CString strResult;
+		return strResult.AllocSysString();
+	}
+
+	acd::SysInfoT sysInfo;
+	int ret = p_m_Bar->GetAcdClient().AcdGetSysInfo(p_m_Bar->m_strAgentID, sysInfo);
+	if(ret != AGENTBARERROR_SUCCESS)
+	{
+		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "GetSysInfo", "Return Error", ret);
+		CString strResult;
+		return strResult.AllocSysString();
+	}
+	Json::Value root;
+	root["totalAgents"]    = Json::Value(sysInfo.totalAgents);
+	root["totalCalls"]     = Json::Value(sysInfo.totalCalls);
+	root["ivrCalls"]       = Json::Value(sysInfo.ivrCalls);
+	root["agentCalls"]     = Json::Value(sysInfo.agentCalls);
+	root["queueCalls"]     = Json::Value(sysInfo.queueCalls);
+	root["privQueueCalls"] = Json::Value(sysInfo.privQueueCalls);
+	Json::FastWriter w;
+	string s = w.write(root);
+	CString strResult(s.c_str());
+	return strResult.AllocSysString();
+}
+
+BSTR CCCAgentBarCtrl::GetCallingNo(void)
+{
+	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
+
+	if(!p_m_Bar->m_intIsSignIn)
+	{
+		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "GetCallingNo", "IsSignIn Error", AGENTBARERROR_BAR_UNSIGNIN);
+		CString strResult;
+		return strResult.AllocSysString();
+	}
+
+	return p_m_Bar->m_callingNo.AllocSysString();
+}
+
+BSTR CCCAgentBarCtrl::GetOrgCallingNo(void)
+{
+	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
+
+	if(!p_m_Bar->m_intIsSignIn)
+	{
+		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "GetOrgCallingNo", "IsSignIn Error", AGENTBARERROR_BAR_UNSIGNIN);
+		CString strResult;
+		return strResult.AllocSysString();
+	}
+
+	return p_m_Bar->m_orgCallingNo.AllocSysString();
+}
+
+BSTR CCCAgentBarCtrl::GetCalledNo(void)
+{
+	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
+
+	if(!p_m_Bar->m_intIsSignIn)
+	{
+		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "GetCalledNo", "IsSignIn Error", AGENTBARERROR_BAR_UNSIGNIN);
+		CString strResult;
+		return strResult.AllocSysString();
+	}
+
+	return p_m_Bar->m_calledNo.AllocSysString();
+}
+
+BSTR CCCAgentBarCtrl::GetOrgCalledNo(void)
+{
+	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
+
+	if(!p_m_Bar->m_intIsSignIn)
+	{
+		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "GetOrgCalledNo", "IsSignIn Error", AGENTBARERROR_BAR_UNSIGNIN);
+		CString strResult;
+		return strResult.AllocSysString();
+	}
+
+	return p_m_Bar->m_orgCalledNo.AllocSysString();
+}
+
+LONG CCCAgentBarCtrl::SynchronizeCTITime(void)
+{
+	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
+
+	if(!p_m_Bar->m_intIsSignIn)
+	{
+		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "SynchronizeCTITime", "IsSignIn Error", AGENTBARERROR_BAR_UNSIGNIN);
+		return AGENTBARERROR_BAR_UNSIGNIN;
+	}
+
+	return p_m_Bar->BSynchronizeCTITime();
+}
+
+BSTR CCCAgentBarCtrl::GetPromptByErrorCode(LONG errCode)
+{
+	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
+
+	if(!p_m_Bar->m_intIsSignIn)
+	{
+		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "GetPromptByErrorCode", "IsSignIn Error", AGENTBARERROR_BAR_UNSIGNIN);
+		CString strResult;
+		return strResult.AllocSysString();
+	}
+
+	string errDescript;
+	Tool::GetAcdResult_Str(errCode, errDescript);
+
+	CString strResult(errDescript.c_str());
+	return strResult.AllocSysString();
+}
+
+LONG CCCAgentBarCtrl::JumptheQueue(LONGLONG requestId)
+{
+	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
+
+	if(!p_m_Bar->m_intIsSignIn)
+	{
+		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "JumptheQueue", "IsSignIn Error", AGENTBARERROR_BAR_UNSIGNIN);
+		return AGENTBARERROR_BAR_UNSIGNIN;
+	}
+
+	return p_m_Bar->GetAcdClient().AcdJumptheQueue(p_m_Bar->m_strAgentID, requestId);
+}
+
+
+LONG CCCAgentBarCtrl::TransIVR(LPCTSTR transferNum)
+{
+	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
+
+	if(!p_m_Bar->m_intIsSignIn)
+	{
+		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "TransIVR", "IsSignIn Error", AGENTBARERROR_BAR_UNSIGNIN);
+		return AGENTBARERROR_BAR_UNSIGNIN;
+	}
+
+	return p_m_Bar->BTransferIVR(transferNum);
+}
+
+LONG CCCAgentBarCtrl::TransIVREx(LPCTSTR callerNum, LPCTSTR transferNum)
+{
+	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+	// TODO: ÔÚ´ËÌí¼Óµ÷¶È´¦Àí³ÌÐò´úÂë
+
+	if(!p_m_Bar->m_intIsSignIn)
+	{
+		Tool::m_Logger.WriteLog("CCCAgentBarCtrl", "TransIVREx", "IsSignIn Error", AGENTBARERROR_BAR_UNSIGNIN);
+		return AGENTBARERROR_BAR_UNSIGNIN;
+	}
+
+	return p_m_Bar->BTransferIVR(transferNum, callerNum);
+}
diff --git a/tools/agentbar/agentbarsrc/CCAgentBarCtrl.h b/tools/agentbar/agentbarsrc/CCAgentBarCtrl.h
index b95f3a8..492047a 100644
--- a/tools/agentbar/agentbarsrc/CCAgentBarCtrl.h
+++ b/tools/agentbar/agentbarsrc/CCAgentBarCtrl.h
@@ -1,447 +1,438 @@
-/*
- * Copyright 2002-2014 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      CC/LICENSE
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#pragma once
-
-#include "CCBar.h"
-
-class CCCAgentBarCtrl : public COleControl
-{
-	DECLARE_DYNCREATE(CCCAgentBarCtrl)
-
-// ¹¹Ôìº¯Êý£¬×Ô¶¯Éú³É
-public:
-	CCCAgentBarCtrl();
-
-// ÖØÐ´£¬×Ô¶¯Éú³É
-protected:
-	virtual void OnDraw(CDC* pdc, const CRect& rcBounds, const CRect& rcInvalid);
-	virtual void DoPropExchange(CPropExchange* pPX);
-	virtual void OnResetState();
-	virtual BOOL OnSetObjectRects(LPCRECT lpRectPos, LPCRECT lpRectClip);
-
-// ÊµÏÖ£¬×Ô¶¯Éú³É
-protected:
-	~CCCAgentBarCtrl();
-
-	DECLARE_OLECREATE_EX(CCCAgentBarCtrl)    // Àà¹¤³§ºÍ guid
-	DECLARE_OLETYPELIB(CCCAgentBarCtrl)      // GetTypeInfo
-	DECLARE_PROPPAGEIDS(CCCAgentBarCtrl)     // ÊôÐÔÒ³ ID
-	DECLARE_OLECTLTYPE(CCCAgentBarCtrl)		// ÀàÐÍÃû³ÆºÍÔÓÏî×´Ì¬
-
-// ÏûÏ¢Ó³Éä£¬×Ô¶¯Éú³É
-	DECLARE_MESSAGE_MAP()
-
-// µ÷¶ÈÓ³Éä£¬×Ô¶¯Éú³É
-	DECLARE_DISPATCH_MAP()
-
-// ÊÂ¼þÓ³Éä£¬×Ô¶¯Éú³É
-	DECLARE_EVENT_MAP()
-
-// µ÷¶ÈºÍÊÂ¼þ ID£¬×Ô¶¯Éú³É
-public:
-	enum
-	{
-        eventidOnBtnStatus = 29L,
-        eventidOnHeartbeat = 28L,
-        eventidOnBeforeOutCall = 27L,
-		eventidOnOperationFailed = 26L,
-		eventidOnCTIMasterChanged = 25L,
-		eventidOnCTIDisconnect = 24L,
-		eventidOnOutprivatequeue = 23L,
-		eventidOnInprivatequeue = 22L,
-		eventidOnEndRecord = 21L,
-		eventidOnBeginRecord = 20L,
-		eventidOnInserted = 19L,
-		eventidOnMonitored = 18L,
-		eventidOnInsert = 17L,
-		eventidOnMonitor = 16L,
-		eventidOnConference = 15L,
-		eventidOnConsultConnected = 14L,
-		eventidOnConsultConnecting = 13L,
-		eventidOnSuspended = 12L,
-		eventidOnInternalConnected = 11L,
-		eventidOnHarfConnected = 10L,
-		eventidOnConnected = 9L,
-		eventidOnConnecting = 8L,
-		eventidOnHarfAlerting = 7L,
-		eventidOnAlerting = 6L,
-		eventidOnLock = 5L,
-		eventidOnRest = 4L,
-		eventidOnBusy = 3L,
-		eventidOnReady = 2L,
-		eventidOnUnLogin = 1L,
-		dispidTransIVR = 81L,
-		dispidTransIVREx = 82L,
-		dispidJumptheQueue = 80L,
-		dispidGetPromptByErrorCode = 79L,
-		dispidSynchronizeCTITime = 78L,
-		dispidGetOrgCalledNo = 77L,
-		dispidGetCalledNo = 76L,
-		dispidGetOrgCallingNo = 75L,
-		dispidGetCallingNo = 74L,
-		dispidGetSysInfo = 73L,
-		dispidGetPrivateQueue = 72L,
-		dispidGetSkillWaitingCallInfo = 71L,
-		dispidGetSkillWaitingNumber = 70L,
-		dispidGetAgentDetailsBySkill = 69L,
-		dispidGetAgentNumberBySkill = 68L,
-		dispidGetRestReason = 67L,
-		dispidGetRecordFileName = 66L,
-		dispidGetAgentDetailsByAgentDNs = 65L,
-		dispidGetAgentDetailsByAgentIDs = 64L,
-		dispidGetAgentDetailByAgentDN = 63L,
-		dispidGetAgentDetailByAgentID = 62L,
-		dispidMuteOff = 61L,
-		dispidMuteOn = 60L,
-		dispidSendDTMF = 59L,
-		dispidBreak = 58L,
-		dispidSwitchInsertorListen = 57L,
-		dispidStopInsert = 56L,
-		dispidInsert = 55L,
-		dispidStopListen = 54L,
-		dispidListen = 53L,
-		dispidForceBusy = 52L,
-		dispidForceIdle = 51L,
-		dispidForceOut = 50L,
-		dispidGetCallData = 49L,
-		dispidSetCallData = 48L,
-		dispidConference = 47L,
-		dispidSingleStepTransfer = 46L,
-		dispidTransfer = 45L,
-		dispidReconnect = 44L,
-		dispidConsult = 43L,
-		dispidRetrieve = 42L,
-		dispidHold = 41L,
-		dispidReleaseCall = 40L,
-		dispidAnswer = 39L,
-		dispidMakeCall = 38L,
-		dispidReset = 37L,
-		dispidResetSkill = 36L,
-		dispidGetAgentStatus = 35L,
-		dispidSetAgentStatus = 34L,
-		dispidSetRest = 33L,
-		dispidSetBusy = 32L,
-		dispidSetIdle = 31L,
-		dispidSignOut = 30L,
-		dispidSignIn = 29L,
-		dispidUnInitial = 28L,
-		dispidInitial = 27L,
-		dispidAnyProperty = 26,
-		dispidEnableSeniorCall = 25,
-		dispidLogLevel = 24,
-		dispidIsCallOut = 23,
-		dispidIsShowCallOut = 22,
-		dispidANIChangeType = 21,
-		dispidCustomerTag = 20,
-		dispidAgentTag = 19,
-		dispidPhonePwd = 18,
-		dispidPhoneNum = 17,
-		dispidSIPServerPort = 16,
-		dispidSIPServerIP = 15,
-		dispidIsSIPPhone = 14,
-		dispidIsSignIn = 13,
-		dispidIsInitial = 12,
-		dispidTimeOut = 11,
-		dispidCTIPort = 10,
-		dispidBackCTIIP = 9,
-		dispidMainCTIIP = 8,
-		dispidServiceList = 7,
-		dispidForceSignIn = 6,
-		dispidAutoAnswer = 5,
-		dispidStatusChangeType = 4,
-		dispidDN = 3,
-		dispidPassWord = 2,
-		dispidAgentID = 1
-	};
-
-// ±äÁ¿£¬ºóÀ´Ìí¼Ó
-private:
-	CCCBar *p_m_Bar;
-
-private:
-	void GetClippingCoordinates(LPCRECT pPosRect, LPCRECT pClipRect, LPRECT pIntersectRect, LPPOINT pOffsetPoint);
-
-// º¯ÊýÖØÔØºÍÏûÏ¢ÏìÓ¦£¬ºóÀ´Ìí¼Ó
-protected:
-	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
-	afx_msg void OnSize(UINT nType, int cx, int cy);
-
-// ÊôÐÔ
-protected:
-	BSTR GetAgentID(void);
-	void SetAgentID(LPCTSTR newVal);
-	BSTR GetPassWord(void);
-	void SetPassWord(LPCTSTR newVal);
-	BSTR GetDN(void);
-	void SetDN(LPCTSTR newVal);
-	LONG GetStatusChangeType(void);
-	void SetStatusChangeType(LONG newVal);
-	LONG GetAutoAnswer(void);
-	void SetAutoAnswer(LONG newVal);
-	LONG GetForceSignIn(void);
-	void SetForceSignIn(LONG newVal);
-	BSTR GetServiceList(void);
-	void SetServiceList(LPCTSTR newVal);
-	BSTR GetMainCTIIP(void);
-	void SetMainCTIIP(LPCTSTR newVal);
-	BSTR GetBackCTIIP(void);
-	void SetBackCTIIP(LPCTSTR newVal);
-	LONG GetCTIPort(void);
-	void SetCTIPort(LONG newVal);
-	LONG GetTimeOut(void);
-	void SetTimeOut(LONG newVal);
-	LONG GetIsInitial(void);
-	void SetIsInitial(LONG newVal);
-	LONG GetIsSignIn(void);
-	void SetIsSignIn(LONG newVal);
-	LONG GetIsSIPPhone(void);
-	void SetIsSIPPhone(LONG newVal);
-	BSTR GetSIPServerIP(void);
-	void SetSIPServerIP(LPCTSTR newVal);
-	LONG GetSIPServerPort(void);
-	void SetSIPServerPort(LONG newVal);
-	BSTR GetPhoneNum(void);
-	void SetPhoneNum(LPCTSTR newVal);
-	BSTR GetPhonePwd(void);
-	void SetPhonePwd(LPCTSTR newVal);
-	BSTR GetAgentTag(void);
-	void SetAgentTag(LPCTSTR newVal);
-	BSTR GetCustomerTag(void);
-	void SetCustomerTag(LPCTSTR newVal);
-	LONG GetANIChangeType(void);
-	void SetANIChangeType(LONG newVal);
-	LONG GetIsShowCallOut(void);
-	void SetIsShowCallOut(LONG newVal);
-	LONG GetIsCallOut(void);
-	void SetIsCallOut(LONG newVal);
-	LONG GetLogLevel(void);
-	void SetLogLevel(LONG newVal);
-	LONG GetEnableSeniorCall(void);
-	void SetEnableSeniorCall(LONG newVal);
-	BSTR GetAnyProperty(void);
-	void SetAnyProperty(LPCTSTR newVal);
-
-// ·½·¨
-protected:
-	LONG Initial(void);
-	LONG UnInitial(void);
-	LONG SignIn(void);
-	LONG SignOut(void);
-	LONG SetIdle(void);
-	LONG SetBusy(void);
-	LONG SetRest(LPCTSTR reason);
-	LONG SetAgentStatus(LONG agentState, LPCTSTR reason);
-	LONG GetAgentStatus(void);
-	LONG ResetSkill(LPCTSTR skillList);
-	LONG Reset(void);
-	LONG MakeCall(LPCTSTR dest, LPCTSTR showANI, LPCTSTR showDest, LONG isOffhook, LONG type);
-	LONG Answer(void);
-	LONG ReleaseCall(void);
-	LONG Hold(void);
-	LONG Retrieve(void);
-	LONG Consult(LPCTSTR consultNum, LPCTSTR showANI, LPCTSTR showDest, LONG consultType);
-	LONG Reconnect(void);
-	LONG Transfer(void);
-	LONG SingleStepTransfer(LPCTSTR transferNum, LPCTSTR showANI, LPCTSTR showDest, LONG transferStyle, LONG transferType);
-	LONG Conference(void);
-	LONG SetCallData(LPCTSTR key, LPCTSTR callData);
-	BSTR GetCallData(LPCTSTR key);
-	LONG ForceOut(LPCTSTR agentID);
-	LONG ForceIdle(LPCTSTR agentID);
-	LONG ForceBusy(LPCTSTR agentID);
-	LONG Listen(LPCTSTR agentID, LPCTSTR showANI, LPCTSTR showDest);
-	LONG StopListen(LPCTSTR agentID);
-	LONG Insert(LPCTSTR agentID, LPCTSTR showANI, LPCTSTR showDest);
-	LONG StopInsert(LPCTSTR agentID);
-	LONG SwitchInsertorListen(LPCTSTR agentID, LPCTSTR showANI, LPCTSTR showDest);
-	LONG Break(LPCTSTR agentID);
-	LONG SendDTMF(LPCTSTR dtmf);
-	LONG MuteOn(void);
-	LONG MuteOff(void);
-	BSTR GetAgentDetailByAgentID(LPCTSTR agentID);
-	BSTR GetAgentDetailByAgentDN(LPCTSTR agentDN);
-	BSTR GetAgentDetailsByAgentIDs(LPCTSTR agentIDs);
-	BSTR GetAgentDetailsByAgentDNs(LPCTSTR agentDNs);
-	BSTR GetRecordFileName(void);
-	BSTR GetRestReason(void);
-	LONG GetAgentNumberBySkill(LPCTSTR skill);
-	BSTR GetAgentDetailsBySkill(LPCTSTR skill);
-	BSTR GetSkillWaitingNumber(LPCTSTR skill);
-	BSTR GetSkillWaitingCallInfo(LPCTSTR skill);
-	BSTR GetPrivateQueue(LPCTSTR agentID);
-	BSTR GetSysInfo(void);
-	BSTR GetCallingNo(void);
-	BSTR GetOrgCallingNo(void);
-	BSTR GetCalledNo(void);
-	BSTR GetOrgCalledNo(void);
-	LONG SynchronizeCTITime(void);
-	BSTR GetPromptByErrorCode(LONG errCode);
-	LONG JumptheQueue(LONGLONG requestId);
-	LONG TransIVR(LPCTSTR transferNum);
-	LONG TransIVREx(LPCTSTR callerNum, LPCTSTR transferNum);
-
-// ÊÂ¼þ
-public:
-	void OnUnLogin(LONG eventID, LPCTSTR callID, LONGLONG contactID, LONG partyNum, LPCTSTR otherParty, LONG otherPartyAttribute, LPCTSTR originatingParty, LPCTSTR originalANI, LPCTSTR originalDNIS, LONG reason, LONGLONG timestamp)
-	{
-		FireEvent(eventidOnUnLogin, EVENT_PARAM(VTS_I4 VTS_BSTR VTS_I8 VTS_I4 VTS_BSTR VTS_I4 VTS_BSTR VTS_BSTR VTS_BSTR VTS_I4 VTS_I8), eventID, callID, contactID, partyNum, otherParty, otherPartyAttribute, originatingParty, originalANI, originalDNIS, reason, timestamp);
-	}
-
-	void OnReady(LONG eventID, LPCTSTR callID, LONGLONG contactID, LONG partyNum, LPCTSTR otherParty, LONG otherPartyAttribute, LPCTSTR originatingParty, LPCTSTR originalANI, LPCTSTR originalDNIS, LONG reason, LONGLONG timestamp)
-	{
-		FireEvent(eventidOnReady, EVENT_PARAM(VTS_I4 VTS_BSTR VTS_I8 VTS_I4 VTS_BSTR VTS_I4 VTS_BSTR VTS_BSTR VTS_BSTR VTS_I4 VTS_I8), eventID, callID, contactID, partyNum, otherParty, otherPartyAttribute, originatingParty, originalANI, originalDNIS, reason, timestamp);
-	}
-
-	void OnBusy(LONG eventID, LPCTSTR callID, LONGLONG contactID, LONG partyNum, LPCTSTR otherParty, LONG otherPartyAttribute, LPCTSTR originatingParty, LPCTSTR originalANI, LPCTSTR originalDNIS, LONG reason, LONGLONG timestamp)
-	{
-		FireEvent(eventidOnBusy, EVENT_PARAM(VTS_I4 VTS_BSTR VTS_I8 VTS_I4 VTS_BSTR VTS_I4 VTS_BSTR VTS_BSTR VTS_BSTR VTS_I4 VTS_I8), eventID, callID, contactID, partyNum, otherParty, otherPartyAttribute, originatingParty, originalANI, originalDNIS, reason, timestamp);
-	}
-
-	void OnRest(LONG eventID, LPCTSTR callID, LONGLONG contactID, LONG partyNum, LPCTSTR otherParty, LONG otherPartyAttribute, LPCTSTR originatingParty, LPCTSTR originalANI, LPCTSTR originalDNIS, LONG reason, LONGLONG timestamp)
-	{
-		FireEvent(eventidOnRest, EVENT_PARAM(VTS_I4 VTS_BSTR VTS_I8 VTS_I4 VTS_BSTR VTS_I4 VTS_BSTR VTS_BSTR VTS_BSTR VTS_I4 VTS_I8), eventID, callID, contactID, partyNum, otherParty, otherPartyAttribute, originatingParty, originalANI, originalDNIS, reason, timestamp);
-	}
-
-	void OnLock(LONG eventID, LPCTSTR callID, LONGLONG contactID, LONG partyNum, LPCTSTR otherParty, LONG otherPartyAttribute, LPCTSTR originatingParty, LPCTSTR originalANI, LPCTSTR originalDNIS, LONG reason, LONGLONG timestamp)
-	{
-		FireEvent(eventidOnLock, EVENT_PARAM(VTS_I4 VTS_BSTR VTS_I8 VTS_I4 VTS_BSTR VTS_I4 VTS_BSTR VTS_BSTR VTS_BSTR VTS_I4 VTS_I8), eventID, callID, contactID, partyNum, otherParty, otherPartyAttribute, originatingParty, originalANI, originalDNIS, reason, timestamp);
-	}
-
-	void OnAlerting(LONG eventID, LPCTSTR callID, LONGLONG contactID, LONG partyNum, LPCTSTR otherParty, LONG otherPartyAttribute, LPCTSTR originatingParty, LPCTSTR originalANI, LPCTSTR originalDNIS, LONG reason, LONGLONG timestamp)
-	{
-		FireEvent(eventidOnAlerting, EVENT_PARAM(VTS_I4 VTS_BSTR VTS_I8 VTS_I4 VTS_BSTR VTS_I4 VTS_BSTR VTS_BSTR VTS_BSTR VTS_I4 VTS_I8), eventID, callID, contactID, partyNum, otherParty, otherPartyAttribute, originatingParty, originalANI, originalDNIS, reason, timestamp);
-	}
-
-	void OnHarfAlerting(LONG eventID, LPCTSTR callID, LONGLONG contactID, LONG partyNum, LPCTSTR otherParty, LONG otherPartyAttribute, LPCTSTR originatingParty, LPCTSTR originalANI, LPCTSTR originalDNIS, LONG reason, LONGLONG timestamp)
-	{
-		FireEvent(eventidOnHarfAlerting, EVENT_PARAM(VTS_I4 VTS_BSTR VTS_I8 VTS_I4 VTS_BSTR VTS_I4 VTS_BSTR VTS_BSTR VTS_BSTR VTS_I4 VTS_I8), eventID, callID, contactID, partyNum, otherParty, otherPartyAttribute, originatingParty, originalANI, originalDNIS, reason, timestamp);
-	}
-
-	void OnConnecting(LONG eventID, LPCTSTR callID, LONGLONG contactID, LONG partyNum, LPCTSTR otherParty, LONG otherPartyAttribute, LPCTSTR originatingParty, LPCTSTR originalANI, LPCTSTR originalDNIS, LONG reason, LONGLONG timestamp)
-	{
-		FireEvent(eventidOnConnecting, EVENT_PARAM(VTS_I4 VTS_BSTR VTS_I8 VTS_I4 VTS_BSTR VTS_I4 VTS_BSTR VTS_BSTR VTS_BSTR VTS_I4 VTS_I8), eventID, callID, contactID, partyNum, otherParty, otherPartyAttribute, originatingParty, originalANI, originalDNIS, reason, timestamp);
-	}
-
-	void OnConnected(LONG eventID, LPCTSTR callID, LONGLONG contactID, LONG partyNum, LPCTSTR otherParty, LONG otherPartyAttribute, LPCTSTR originatingParty, LPCTSTR originalANI, LPCTSTR originalDNIS, LONG reason, LONGLONG timestamp)
-	{
-		FireEvent(eventidOnConnected, EVENT_PARAM(VTS_I4 VTS_BSTR VTS_I8 VTS_I4 VTS_BSTR VTS_I4 VTS_BSTR VTS_BSTR VTS_BSTR VTS_I4 VTS_I8), eventID, callID, contactID, partyNum, otherParty, otherPartyAttribute, originatingParty, originalANI, originalDNIS, reason, timestamp);
-	}
-
-	void OnHarfConnected(LONG eventID, LPCTSTR callID, LONGLONG contactID, LONG partyNum, LPCTSTR otherParty, LONG otherPartyAttribute, LPCTSTR originatingParty, LPCTSTR originalANI, LPCTSTR originalDNIS, LONG reason, LONGLONG timestamp)
-	{
-		FireEvent(eventidOnHarfConnected, EVENT_PARAM(VTS_I4 VTS_BSTR VTS_I8 VTS_I4 VTS_BSTR VTS_I4 VTS_BSTR VTS_BSTR VTS_BSTR VTS_I4 VTS_I8), eventID, callID, contactID, partyNum, otherParty, otherPartyAttribute, originatingParty, originalANI, originalDNIS, reason, timestamp);
-	}
-
-	void OnInternalConnected(LONG eventID, LPCTSTR callID, LONGLONG contactID, LONG partyNum, LPCTSTR otherParty, LONG otherPartyAttribute, LPCTSTR originatingParty, LPCTSTR originalANI, LPCTSTR originalDNIS, LONG reason, LONGLONG timestamp)
-	{
-		FireEvent(eventidOnInternalConnected, EVENT_PARAM(VTS_I4 VTS_BSTR VTS_I8 VTS_I4 VTS_BSTR VTS_I4 VTS_BSTR VTS_BSTR VTS_BSTR VTS_I4 VTS_I8), eventID, callID, contactID, partyNum, otherParty, otherPartyAttribute, originatingParty, originalANI, originalDNIS, reason, timestamp);
-	}
-
-	void OnSuspended(LONG eventID, LPCTSTR callID, LONGLONG contactID, LONG partyNum, LPCTSTR otherParty, LONG otherPartyAttribute, LPCTSTR originatingParty, LPCTSTR originalANI, LPCTSTR originalDNIS, LONG reason, LONGLONG timestamp)
-	{
-		FireEvent(eventidOnSuspended, EVENT_PARAM(VTS_I4 VTS_BSTR VTS_I8 VTS_I4 VTS_BSTR VTS_I4 VTS_BSTR VTS_BSTR VTS_BSTR VTS_I4 VTS_I8), eventID, callID, contactID, partyNum, otherParty, otherPartyAttribute, originatingParty, originalANI, originalDNIS, reason, timestamp);
-	}
-
-	void OnConsultConnecting(LONG eventID, LPCTSTR callID, LONGLONG contactID, LONG partyNum, LPCTSTR otherParty, LONG otherPartyAttribute, LPCTSTR originatingParty, LPCTSTR originalANI, LPCTSTR originalDNIS, LONG reason, LONGLONG timestamp)
-	{
-		FireEvent(eventidOnConsultConnecting, EVENT_PARAM(VTS_I4 VTS_BSTR VTS_I8 VTS_I4 VTS_BSTR VTS_I4 VTS_BSTR VTS_BSTR VTS_BSTR VTS_I4 VTS_I8), eventID, callID, contactID, partyNum, otherParty, otherPartyAttribute, originatingParty, originalANI, originalDNIS, reason, timestamp);
-	}
-
-	void OnConsultConnected(LONG eventID, LPCTSTR callID, LONGLONG contactID, LONG partyNum, LPCTSTR otherParty, LONG otherPartyAttribute, LPCTSTR originatingParty, LPCTSTR originalANI, LPCTSTR originalDNIS, LONG reason, LONGLONG timestamp)
-	{
-		FireEvent(eventidOnConsultConnected, EVENT_PARAM(VTS_I4 VTS_BSTR VTS_I8 VTS_I4 VTS_BSTR VTS_I4 VTS_BSTR VTS_BSTR VTS_BSTR VTS_I4 VTS_I8), eventID, callID, contactID, partyNum, otherParty, otherPartyAttribute, originatingParty, originalANI, originalDNIS, reason, timestamp);
-	}
-
-	void OnConference(LONG eventID, LPCTSTR callID, LONGLONG contactID, LONG partyNum, LPCTSTR otherParty, LONG otherPartyAttribute, LPCTSTR originatingParty, LPCTSTR originalANI, LPCTSTR originalDNIS, LONG reason, LONGLONG timestamp)
-	{
-		FireEvent(eventidOnConference, EVENT_PARAM(VTS_I4 VTS_BSTR VTS_I8 VTS_I4 VTS_BSTR VTS_I4 VTS_BSTR VTS_BSTR VTS_BSTR VTS_I4 VTS_I8), eventID, callID, contactID, partyNum, otherParty, otherPartyAttribute, originatingParty, originalANI, originalDNIS, reason, timestamp);
-	}
-
-	void OnMonitor(LONG eventID, LPCTSTR callID, LONGLONG contactID, LONG partyNum, LPCTSTR otherParty, LONG otherPartyAttribute, LPCTSTR originatingParty, LPCTSTR originalANI, LPCTSTR originalDNIS, LONG reason, LONGLONG timestamp)
-	{
-		FireEvent(eventidOnMonitor, EVENT_PARAM(VTS_I4 VTS_BSTR VTS_I8 VTS_I4 VTS_BSTR VTS_I4 VTS_BSTR VTS_BSTR VTS_BSTR VTS_I4 VTS_I8), eventID, callID, contactID, partyNum, otherParty, otherPartyAttribute, originatingParty, originalANI, originalDNIS, reason, timestamp);
-	}
-
-	void OnInsert(LONG eventID, LPCTSTR callID, LONGLONG contactID, LONG partyNum, LPCTSTR otherParty, LONG otherPartyAttribute, LPCTSTR originatingParty, LPCTSTR originalANI, LPCTSTR originalDNIS, LONG reason, LONGLONG timestamp)
-	{
-		FireEvent(eventidOnInsert, EVENT_PARAM(VTS_I4 VTS_BSTR VTS_I8 VTS_I4 VTS_BSTR VTS_I4 VTS_BSTR VTS_BSTR VTS_BSTR VTS_I4 VTS_I8), eventID, callID, contactID, partyNum, otherParty, otherPartyAttribute, originatingParty, originalANI, originalDNIS, reason, timestamp);
-	}
-
-	void OnMonitored(LONG eventID, LPCTSTR callID, LONGLONG contactID, LONG partyNum, LPCTSTR otherParty, LONG otherPartyAttribute, LPCTSTR originatingParty, LPCTSTR originalANI, LPCTSTR originalDNIS, LONG reason, LONGLONG timestamp)
-	{
-		FireEvent(eventidOnMonitored, EVENT_PARAM(VTS_I4 VTS_BSTR VTS_I8 VTS_I4 VTS_BSTR VTS_I4 VTS_BSTR VTS_BSTR VTS_BSTR VTS_I4 VTS_I8), eventID, callID, contactID, partyNum, otherParty, otherPartyAttribute, originatingParty, originalANI, originalDNIS, reason, timestamp);
-	}
-
-	void OnInserted(LONG eventID, LPCTSTR callID, LONGLONG contactID, LONG partyNum, LPCTSTR otherParty, LONG otherPartyAttribute, LPCTSTR originatingParty, LPCTSTR originalANI, LPCTSTR originalDNIS, LONG reason, LONGLONG timestamp)
-	{
-		FireEvent(eventidOnInserted, EVENT_PARAM(VTS_I4 VTS_BSTR VTS_I8 VTS_I4 VTS_BSTR VTS_I4 VTS_BSTR VTS_BSTR VTS_BSTR VTS_I4 VTS_I8), eventID, callID, contactID, partyNum, otherParty, otherPartyAttribute, originatingParty, originalANI, originalDNIS, reason, timestamp);
-	}
-
-	void OnBeginRecord(LPCTSTR callID, LONGLONG contactID, LPCTSTR filename, LONG reason, LONGLONG timestamp)
-	{
-		FireEvent(eventidOnBeginRecord, EVENT_PARAM(VTS_BSTR VTS_I8 VTS_BSTR VTS_I4 VTS_I8), callID, contactID, filename, reason, timestamp);
-	}
-
-	void OnEndRecord(LPCTSTR callID, LONGLONG contactID, LPCTSTR filename, LONG reason, LONGLONG timestamp)
-	{
-		FireEvent(eventidOnEndRecord, EVENT_PARAM(VTS_BSTR VTS_I8 VTS_BSTR VTS_I4 VTS_I8), callID, contactID, filename, reason, timestamp);
-	}
-	
-	void OnInprivatequeue(LPCTSTR callID, LONGLONG contactID, LONGLONG requestID, LPCTSTR originalANI, LPCTSTR originalDNIS, LONG reason, LONGLONG timestamp)
-	{
-		FireEvent(eventidOnInprivatequeue, EVENT_PARAM(VTS_BSTR VTS_I8 VTS_I8 VTS_BSTR VTS_BSTR VTS_I4 VTS_I8), callID, contactID, requestID, originalANI, originalDNIS, reason, timestamp);
-	}
-
-	void OnOutprivatequeue(LPCTSTR callID, LONGLONG contactID, LONGLONG requestID, LPCTSTR originalANI, LPCTSTR originalDNIS, LONG reason, LONGLONG timestamp)
-	{
-		FireEvent(eventidOnOutprivatequeue, EVENT_PARAM(VTS_BSTR VTS_I8 VTS_I8 VTS_BSTR VTS_BSTR VTS_I4 VTS_I8), callID, contactID, requestID, originalANI, originalDNIS, reason, timestamp);
-	}
-
-	void OnCTIDisconnect(LPCTSTR callID, LONGLONG contactID, LPCTSTR originalANI, LPCTSTR originalDNIS, LONG reason, LONGLONG timestamp)
-	{
-		FireEvent(eventidOnCTIDisconnect, EVENT_PARAM(VTS_BSTR VTS_I8 VTS_BSTR VTS_BSTR VTS_I4 VTS_I8), callID, contactID, originalANI, originalDNIS, reason, timestamp);
-	}
-
-	void OnCTIMasterChanged(LPCTSTR callID, LONGLONG contactID, LPCTSTR originalANI, LPCTSTR originalDNIS, LONG reason, LONGLONG timestamp)
-	{
-		FireEvent(eventidOnCTIMasterChanged, EVENT_PARAM(VTS_BSTR VTS_I8 VTS_BSTR VTS_BSTR VTS_I4 VTS_I8), callID, contactID, originalANI, originalDNIS, reason, timestamp);
-	}
-
-	void OnOperationFailed(LPCTSTR callID, LONGLONG contactID, LPCTSTR originalANI, LPCTSTR originalDNIS, LONG reason, LONGLONG timestamp)
-	{
-		FireEvent(eventidOnOperationFailed, EVENT_PARAM(VTS_BSTR VTS_I8 VTS_BSTR VTS_BSTR VTS_I4 VTS_I8), callID, contactID, originalANI, originalDNIS, reason, timestamp);
-	}
-
-	void OnBeforeOutCall(LPCTSTR otherParty, LONG otherPartyAttribute, LPCTSTR originalANI, LPCTSTR originalDNIS, LONG reason, LONGLONG timestamp)
-	{
-		FireEvent(eventidOnBeforeOutCall, EVENT_PARAM(VTS_BSTR VTS_I4 VTS_BSTR VTS_BSTR VTS_I4 VTS_I8), otherParty, otherPartyAttribute, originalANI, originalDNIS, reason, timestamp);
-	}
-
-    void OnHeartbeat(LONGLONG timestamp)
-    {
-        FireEvent(eventidOnHeartbeat, EVENT_PARAM(VTS_I8), timestamp);
-    }
-
-    void OnBtnStatus(LONGLONG btnStatus, LPCTSTR info)
-    {
-        FireEvent(eventidOnBtnStatus, EVENT_PARAM(VTS_I8 VTS_BSTR), btnStatus, info);
-    }
-
-// ²¹³äµÄÊôÐÔ¡¢·½·¨ºÍÊ±¼ä
-protected:
-
-};
+// *****************************************************************************
+//  Name:		CCCAgentBarCtrl£¬¿Ø¼þ»ù±¾Àà
+//  Author:		Yanhl
+//  Version:	1.0
+// *****************************************************************************
+
+#pragma once
+
+#include "CCBar.h"
+
+class CCCAgentBarCtrl : public COleControl
+{
+	DECLARE_DYNCREATE(CCCAgentBarCtrl)
+
+// ¹¹Ôìº¯Êý£¬×Ô¶¯Éú³É
+public:
+	CCCAgentBarCtrl();
+
+// ÖØÐ´£¬×Ô¶¯Éú³É
+protected:
+	virtual void OnDraw(CDC* pdc, const CRect& rcBounds, const CRect& rcInvalid);
+	virtual void DoPropExchange(CPropExchange* pPX);
+	virtual void OnResetState();
+	virtual BOOL OnSetObjectRects(LPCRECT lpRectPos, LPCRECT lpRectClip);
+
+// ÊµÏÖ£¬×Ô¶¯Éú³É
+protected:
+	~CCCAgentBarCtrl();
+
+	DECLARE_OLECREATE_EX(CCCAgentBarCtrl)    // Àà¹¤³§ºÍ guid
+	DECLARE_OLETYPELIB(CCCAgentBarCtrl)      // GetTypeInfo
+	DECLARE_PROPPAGEIDS(CCCAgentBarCtrl)     // ÊôÐÔÒ³ ID
+	DECLARE_OLECTLTYPE(CCCAgentBarCtrl)		// ÀàÐÍÃû³ÆºÍÔÓÏî×´Ì¬
+
+// ÏûÏ¢Ó³Éä£¬×Ô¶¯Éú³É
+	DECLARE_MESSAGE_MAP()
+
+// µ÷¶ÈÓ³Éä£¬×Ô¶¯Éú³É
+	DECLARE_DISPATCH_MAP()
+
+// ÊÂ¼þÓ³Éä£¬×Ô¶¯Éú³É
+	DECLARE_EVENT_MAP()
+
+// µ÷¶ÈºÍÊÂ¼þ ID£¬×Ô¶¯Éú³É
+public:
+	enum
+	{
+        eventidOnBtnStatus = 29L,
+        eventidOnHeartbeat = 28L,
+        eventidOnBeforeOutCall = 27L,
+		eventidOnOperationFailed = 26L,
+		eventidOnCTIMasterChanged = 25L,
+		eventidOnCTIDisconnect = 24L,
+		eventidOnOutprivatequeue = 23L,
+		eventidOnInprivatequeue = 22L,
+		eventidOnEndRecord = 21L,
+		eventidOnBeginRecord = 20L,
+		eventidOnInserted = 19L,
+		eventidOnMonitored = 18L,
+		eventidOnInsert = 17L,
+		eventidOnMonitor = 16L,
+		eventidOnConference = 15L,
+		eventidOnConsultConnected = 14L,
+		eventidOnConsultConnecting = 13L,
+		eventidOnSuspended = 12L,
+		eventidOnInternalConnected = 11L,
+		eventidOnHarfConnected = 10L,
+		eventidOnConnected = 9L,
+		eventidOnConnecting = 8L,
+		eventidOnHarfAlerting = 7L,
+		eventidOnAlerting = 6L,
+		eventidOnLock = 5L,
+		eventidOnRest = 4L,
+		eventidOnBusy = 3L,
+		eventidOnReady = 2L,
+		eventidOnUnLogin = 1L,
+		dispidSinglestepTransferNum = 83L,
+		dispidTransIVR = 81L,
+		dispidTransIVREx = 82L,
+		dispidJumptheQueue = 80L,
+		dispidGetPromptByErrorCode = 79L,
+		dispidSynchronizeCTITime = 78L,
+		dispidGetOrgCalledNo = 77L,
+		dispidGetCalledNo = 76L,
+		dispidGetOrgCallingNo = 75L,
+		dispidGetCallingNo = 74L,
+		dispidGetSysInfo = 73L,
+		dispidGetPrivateQueue = 72L,
+		dispidGetSkillWaitingCallInfo = 71L,
+		dispidGetSkillWaitingNumber = 70L,
+		dispidGetAgentDetailsBySkill = 69L,
+		dispidGetAgentNumberBySkill = 68L,
+		dispidGetRestReason = 67L,
+		dispidGetRecordFileName = 66L,
+		dispidGetAgentDetailsByAgentDNs = 65L,
+		dispidGetAgentDetailsByAgentIDs = 64L,
+		dispidGetAgentDetailByAgentDN = 63L,
+		dispidGetAgentDetailByAgentID = 62L,
+		dispidMuteOff = 61L,
+		dispidMuteOn = 60L,
+		dispidSendDTMF = 59L,
+		dispidBreak = 58L,
+		dispidSwitchInsertorListen = 57L,
+		dispidStopInsert = 56L,
+		dispidInsert = 55L,
+		dispidStopListen = 54L,
+		dispidListen = 53L,
+		dispidForceBusy = 52L,
+		dispidForceIdle = 51L,
+		dispidForceOut = 50L,
+		dispidGetCallData = 49L,
+		dispidSetCallData = 48L,
+		dispidConference = 47L,
+		dispidSingleStepTransfer = 46L,
+		dispidTransfer = 45L,
+		dispidReconnect = 44L,
+		dispidConsult = 43L,
+		dispidRetrieve = 42L,
+		dispidHold = 41L,
+		dispidReleaseCall = 40L,
+		dispidAnswer = 39L,
+		dispidMakeCall = 38L,
+		dispidReset = 37L,
+		dispidResetSkill = 36L,
+		dispidGetAgentStatus = 35L,
+		dispidSetAgentStatus = 34L,
+		dispidSetRest = 33L,
+		dispidSetBusy = 32L,
+		dispidSetIdle = 31L,
+		dispidSignOut = 30L,
+		dispidSignIn = 29L,
+		dispidUnInitial = 28L,
+		dispidInitial = 27L,
+		dispidAnyProperty = 26,
+		dispidEnableSeniorCall = 25,
+		dispidLogLevel = 24,
+		dispidIsCallOut = 23,
+		dispidIsShowCallOut = 22,
+		dispidANIChangeType = 21,
+		dispidCustomerTag = 20,
+		dispidAgentTag = 19,
+		dispidPhonePwd = 18,
+		dispidPhoneNum = 17,
+		dispidSIPServerPort = 16,
+		dispidSIPServerIP = 15,
+		dispidIsSIPPhone = 14,
+		dispidIsSignIn = 13,
+		dispidIsInitial = 12,
+		dispidTimeOut = 11,
+		dispidCTIPort = 10,
+		dispidBackCTIIP = 9,
+		dispidMainCTIIP = 8,
+		dispidServiceList = 7,
+		dispidForceSignIn = 6,
+		dispidAutoAnswer = 5,
+		dispidStatusChangeType = 4,
+		dispidDN = 3,
+		dispidPassWord = 2,
+		dispidAgentID = 1
+	};
+
+// ±äÁ¿£¬ºóÀ´Ìí¼Ó
+private:
+	CCCBar *p_m_Bar;
+
+private:
+	void GetClippingCoordinates(LPCRECT pPosRect, LPCRECT pClipRect, LPRECT pIntersectRect, LPPOINT pOffsetPoint);
+
+// º¯ÊýÖØÔØºÍÏûÏ¢ÏìÓ¦£¬ºóÀ´Ìí¼Ó
+protected:
+	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
+	afx_msg void OnSize(UINT nType, int cx, int cy);
+
+// ÊôÐÔ
+protected:
+	BSTR GetAgentID(void);
+	void SetAgentID(LPCTSTR newVal);
+	BSTR GetPassWord(void);
+	void SetPassWord(LPCTSTR newVal);
+	BSTR GetDN(void);
+	void SetDN(LPCTSTR newVal);
+	LONG GetStatusChangeType(void);
+	void SetStatusChangeType(LONG newVal);
+	LONG GetAutoAnswer(void);
+	void SetAutoAnswer(LONG newVal);
+	LONG GetForceSignIn(void);
+	void SetForceSignIn(LONG newVal);
+	BSTR GetServiceList(void);
+	void SetServiceList(LPCTSTR newVal);
+	BSTR GetMainCTIIP(void);
+	void SetMainCTIIP(LPCTSTR newVal);
+	BSTR GetBackCTIIP(void);
+	void SetBackCTIIP(LPCTSTR newVal);
+	LONG GetCTIPort(void);
+	void SetCTIPort(LONG newVal);
+	LONG GetTimeOut(void);
+	void SetTimeOut(LONG newVal);
+	LONG GetIsInitial(void);
+	void SetIsInitial(LONG newVal);
+	LONG GetIsSignIn(void);
+	void SetIsSignIn(LONG newVal);
+	LONG GetIsSIPPhone(void);
+	void SetIsSIPPhone(LONG newVal);
+	BSTR GetSIPServerIP(void);
+	void SetSIPServerIP(LPCTSTR newVal);
+	LONG GetSIPServerPort(void);
+	void SetSIPServerPort(LONG newVal);
+	BSTR GetPhoneNum(void);
+	void SetPhoneNum(LPCTSTR newVal);
+	BSTR GetPhonePwd(void);
+	void SetPhonePwd(LPCTSTR newVal);
+	BSTR GetAgentTag(void);
+	void SetAgentTag(LPCTSTR newVal);
+	BSTR GetCustomerTag(void);
+	void SetCustomerTag(LPCTSTR newVal);
+	LONG GetANIChangeType(void);
+	void SetANIChangeType(LONG newVal);
+	LONG GetIsShowCallOut(void);
+	void SetIsShowCallOut(LONG newVal);
+	LONG GetIsCallOut(void);
+	void SetIsCallOut(LONG newVal);
+	LONG GetLogLevel(void);
+	void SetLogLevel(LONG newVal);
+	LONG GetEnableSeniorCall(void);
+	void SetEnableSeniorCall(LONG newVal);
+	BSTR GetAnyProperty(void);
+	void SetAnyProperty(LPCTSTR newVal);
+// ·½·¨
+protected:
+	LONG Initial(void);
+	LONG UnInitial(void);
+	LONG SignIn(void);
+	LONG SignOut(void);
+	LONG SetIdle(void);
+	LONG SetBusy(void);
+	LONG SetRest(LPCTSTR reason);
+	LONG SetAgentStatus(LONG agentState, LPCTSTR reason);
+	LONG GetAgentStatus(void);
+	LONG ResetSkill(LPCTSTR skillList);
+	LONG Reset(void);
+	LONG MakeCall(LPCTSTR dest, LPCTSTR showANI, LPCTSTR showDest, LONG isOffhook, LONG type);
+	LONG Answer(void);
+	LONG ReleaseCall(void);
+	LONG Hold(void);
+	LONG Retrieve(void);
+	LONG Consult(LPCTSTR consultNum, LPCTSTR showANI, LPCTSTR showDest, LONG consultType);
+	LONG Reconnect(void);
+	LONG Transfer(void);
+	LONG SingleStepTransfer(LPCTSTR transferNum, LPCTSTR showANI, LPCTSTR showDest, LONG transferStyle, LONG transferType);
+	LONG Conference(void);
+	LONG SetCallData(LPCTSTR key, LPCTSTR callData);
+	BSTR GetCallData(LPCTSTR key);
+	LONG ForceOut(LPCTSTR agentID);
+	LONG ForceIdle(LPCTSTR agentID);
+	LONG ForceBusy(LPCTSTR agentID);
+	LONG Listen(LPCTSTR agentID, LPCTSTR showANI, LPCTSTR showDest);
+	LONG StopListen(LPCTSTR agentID);
+	LONG Insert(LPCTSTR agentID, LPCTSTR showANI, LPCTSTR showDest);
+	LONG StopInsert(LPCTSTR agentID);
+	LONG SwitchInsertorListen(LPCTSTR agentID, LPCTSTR showANI, LPCTSTR showDest);
+	LONG Break(LPCTSTR agentID);
+	LONG SendDTMF(LPCTSTR dtmf);
+	LONG MuteOn(void);
+	LONG MuteOff(void);
+	BSTR GetAgentDetailByAgentID(LPCTSTR agentID);
+	BSTR GetAgentDetailByAgentDN(LPCTSTR agentDN);
+	BSTR GetAgentDetailsByAgentIDs(LPCTSTR agentIDs);
+	BSTR GetAgentDetailsByAgentDNs(LPCTSTR agentDNs);
+	BSTR GetRecordFileName(void);
+	BSTR GetRestReason(void);
+	LONG GetAgentNumberBySkill(LPCTSTR skill);
+	BSTR GetAgentDetailsBySkill(LPCTSTR skill);
+	BSTR GetSkillWaitingNumber(LPCTSTR skill);
+	BSTR GetSkillWaitingCallInfo(LPCTSTR skill);
+	BSTR GetPrivateQueue(LPCTSTR agentID);
+	BSTR GetSysInfo(void);
+	BSTR GetCallingNo(void);
+	BSTR GetOrgCallingNo(void);
+	BSTR GetCalledNo(void);
+	BSTR GetOrgCalledNo(void);
+	LONG SynchronizeCTITime(void);
+	BSTR GetPromptByErrorCode(LONG errCode);
+	LONG JumptheQueue(LONGLONG requestId);
+	LONG TransIVR(LPCTSTR transferNum);
+	LONG TransIVREx(LPCTSTR callerNum, LPCTSTR transferNum);
+	BSTR GetSinglestepTransferNum(void);
+
+// ÊÂ¼þ
+public:
+	void OnUnLogin(LONG eventID, LPCTSTR callID, LONGLONG contactID, LONG partyNum, LPCTSTR otherParty, LONG otherPartyAttribute, LPCTSTR originatingParty, LPCTSTR originalANI, LPCTSTR originalDNIS, LONG reason, LONGLONG timestamp)
+	{
+		FireEvent(eventidOnUnLogin, EVENT_PARAM(VTS_I4 VTS_BSTR VTS_I8 VTS_I4 VTS_BSTR VTS_I4 VTS_BSTR VTS_BSTR VTS_BSTR VTS_I4 VTS_I8), eventID, callID, contactID, partyNum, otherParty, otherPartyAttribute, originatingParty, originalANI, originalDNIS, reason, timestamp);
+	}
+
+	void OnReady(LONG eventID, LPCTSTR callID, LONGLONG contactID, LONG partyNum, LPCTSTR otherParty, LONG otherPartyAttribute, LPCTSTR originatingParty, LPCTSTR originalANI, LPCTSTR originalDNIS, LONG reason, LONGLONG timestamp)
+	{
+		FireEvent(eventidOnReady, EVENT_PARAM(VTS_I4 VTS_BSTR VTS_I8 VTS_I4 VTS_BSTR VTS_I4 VTS_BSTR VTS_BSTR VTS_BSTR VTS_I4 VTS_I8), eventID, callID, contactID, partyNum, otherParty, otherPartyAttribute, originatingParty, originalANI, originalDNIS, reason, timestamp);
+	}
+
+	void OnBusy(LONG eventID, LPCTSTR callID, LONGLONG contactID, LONG partyNum, LPCTSTR otherParty, LONG otherPartyAttribute, LPCTSTR originatingParty, LPCTSTR originalANI, LPCTSTR originalDNIS, LONG reason, LONGLONG timestamp)
+	{
+		FireEvent(eventidOnBusy, EVENT_PARAM(VTS_I4 VTS_BSTR VTS_I8 VTS_I4 VTS_BSTR VTS_I4 VTS_BSTR VTS_BSTR VTS_BSTR VTS_I4 VTS_I8), eventID, callID, contactID, partyNum, otherParty, otherPartyAttribute, originatingParty, originalANI, originalDNIS, reason, timestamp);
+	}
+
+	void OnRest(LONG eventID, LPCTSTR callID, LONGLONG contactID, LONG partyNum, LPCTSTR otherParty, LONG otherPartyAttribute, LPCTSTR originatingParty, LPCTSTR originalANI, LPCTSTR originalDNIS, LONG reason, LONGLONG timestamp, LPCTSTR restReason)
+	{
+		FireEvent(eventidOnRest, EVENT_PARAM(VTS_I4 VTS_BSTR VTS_I8 VTS_I4 VTS_BSTR VTS_I4 VTS_BSTR VTS_BSTR VTS_BSTR VTS_I4 VTS_I8 VTS_BSTR), eventID, callID, contactID, partyNum, otherParty, otherPartyAttribute, originatingParty, originalANI, originalDNIS, reason, timestamp, restReason);
+	}
+
+	void OnLock(LONG eventID, LPCTSTR callID, LONGLONG contactID, LONG partyNum, LPCTSTR otherParty, LONG otherPartyAttribute, LPCTSTR originatingParty, LPCTSTR originalANI, LPCTSTR originalDNIS, LONG reason, LONGLONG timestamp)
+	{
+		FireEvent(eventidOnLock, EVENT_PARAM(VTS_I4 VTS_BSTR VTS_I8 VTS_I4 VTS_BSTR VTS_I4 VTS_BSTR VTS_BSTR VTS_BSTR VTS_I4 VTS_I8), eventID, callID, contactID, partyNum, otherParty, otherPartyAttribute, originatingParty, originalANI, originalDNIS, reason, timestamp);
+	}
+
+	void OnAlerting(LONG eventID, LPCTSTR callID, LONGLONG contactID, LONG partyNum, LPCTSTR otherParty, LONG otherPartyAttribute, LPCTSTR originatingParty, LPCTSTR originalANI, LPCTSTR originalDNIS, LONG reason, LONGLONG timestamp)
+	{
+		FireEvent(eventidOnAlerting, EVENT_PARAM(VTS_I4 VTS_BSTR VTS_I8 VTS_I4 VTS_BSTR VTS_I4 VTS_BSTR VTS_BSTR VTS_BSTR VTS_I4 VTS_I8), eventID, callID, contactID, partyNum, otherParty, otherPartyAttribute, originatingParty, originalANI, originalDNIS, reason, timestamp);
+	}
+
+	void OnHarfAlerting(LONG eventID, LPCTSTR callID, LONGLONG contactID, LONG partyNum, LPCTSTR otherParty, LONG otherPartyAttribute, LPCTSTR originatingParty, LPCTSTR originalANI, LPCTSTR originalDNIS, LONG reason, LONGLONG timestamp)
+	{
+		FireEvent(eventidOnHarfAlerting, EVENT_PARAM(VTS_I4 VTS_BSTR VTS_I8 VTS_I4 VTS_BSTR VTS_I4 VTS_BSTR VTS_BSTR VTS_BSTR VTS_I4 VTS_I8), eventID, callID, contactID, partyNum, otherParty, otherPartyAttribute, originatingParty, originalANI, originalDNIS, reason, timestamp);
+	}
+
+	void OnConnecting(LONG eventID, LPCTSTR callID, LONGLONG contactID, LONG partyNum, LPCTSTR otherParty, LONG otherPartyAttribute, LPCTSTR originatingParty, LPCTSTR originalANI, LPCTSTR originalDNIS, LONG reason, LONGLONG timestamp)
+	{
+		FireEvent(eventidOnConnecting, EVENT_PARAM(VTS_I4 VTS_BSTR VTS_I8 VTS_I4 VTS_BSTR VTS_I4 VTS_BSTR VTS_BSTR VTS_BSTR VTS_I4 VTS_I8), eventID, callID, contactID, partyNum, otherParty, otherPartyAttribute, originatingParty, originalANI, originalDNIS, reason, timestamp);
+	}
+
+	void OnConnected(LONG eventID, LPCTSTR callID, LONGLONG contactID, LONG partyNum, LPCTSTR otherParty, LONG otherPartyAttribute, LPCTSTR originatingParty, LPCTSTR originalANI, LPCTSTR originalDNIS, LONG reason, LONGLONG timestamp)
+	{
+		FireEvent(eventidOnConnected, EVENT_PARAM(VTS_I4 VTS_BSTR VTS_I8 VTS_I4 VTS_BSTR VTS_I4 VTS_BSTR VTS_BSTR VTS_BSTR VTS_I4 VTS_I8), eventID, callID, contactID, partyNum, otherParty, otherPartyAttribute, originatingParty, originalANI, originalDNIS, reason, timestamp);
+	}
+
+	void OnHarfConnected(LONG eventID, LPCTSTR callID, LONGLONG contactID, LONG partyNum, LPCTSTR otherParty, LONG otherPartyAttribute, LPCTSTR originatingParty, LPCTSTR originalANI, LPCTSTR originalDNIS, LONG reason, LONGLONG timestamp)
+	{
+		FireEvent(eventidOnHarfConnected, EVENT_PARAM(VTS_I4 VTS_BSTR VTS_I8 VTS_I4 VTS_BSTR VTS_I4 VTS_BSTR VTS_BSTR VTS_BSTR VTS_I4 VTS_I8), eventID, callID, contactID, partyNum, otherParty, otherPartyAttribute, originatingParty, originalANI, originalDNIS, reason, timestamp);
+	}
+
+	void OnInternalConnected(LONG eventID, LPCTSTR callID, LONGLONG contactID, LONG partyNum, LPCTSTR otherParty, LONG otherPartyAttribute, LPCTSTR originatingParty, LPCTSTR originalANI, LPCTSTR originalDNIS, LONG reason, LONGLONG timestamp)
+	{
+		FireEvent(eventidOnInternalConnected, EVENT_PARAM(VTS_I4 VTS_BSTR VTS_I8 VTS_I4 VTS_BSTR VTS_I4 VTS_BSTR VTS_BSTR VTS_BSTR VTS_I4 VTS_I8), eventID, callID, contactID, partyNum, otherParty, otherPartyAttribute, originatingParty, originalANI, originalDNIS, reason, timestamp);
+	}
+
+	void OnSuspended(LONG eventID, LPCTSTR callID, LONGLONG contactID, LONG partyNum, LPCTSTR otherParty, LONG otherPartyAttribute, LPCTSTR originatingParty, LPCTSTR originalANI, LPCTSTR originalDNIS, LONG reason, LONGLONG timestamp)
+	{
+		FireEvent(eventidOnSuspended, EVENT_PARAM(VTS_I4 VTS_BSTR VTS_I8 VTS_I4 VTS_BSTR VTS_I4 VTS_BSTR VTS_BSTR VTS_BSTR VTS_I4 VTS_I8), eventID, callID, contactID, partyNum, otherParty, otherPartyAttribute, originatingParty, originalANI, originalDNIS, reason, timestamp);
+	}
+
+	void OnConsultConnecting(LONG eventID, LPCTSTR callID, LONGLONG contactID, LONG partyNum, LPCTSTR otherParty, LONG otherPartyAttribute, LPCTSTR originatingParty, LPCTSTR originalANI, LPCTSTR originalDNIS, LONG reason, LONGLONG timestamp)
+	{
+		FireEvent(eventidOnConsultConnecting, EVENT_PARAM(VTS_I4 VTS_BSTR VTS_I8 VTS_I4 VTS_BSTR VTS_I4 VTS_BSTR VTS_BSTR VTS_BSTR VTS_I4 VTS_I8), eventID, callID, contactID, partyNum, otherParty, otherPartyAttribute, originatingParty, originalANI, originalDNIS, reason, timestamp);
+	}
+
+	void OnConsultConnected(LONG eventID, LPCTSTR callID, LONGLONG contactID, LONG partyNum, LPCTSTR otherParty, LONG otherPartyAttribute, LPCTSTR originatingParty, LPCTSTR originalANI, LPCTSTR originalDNIS, LONG reason, LONGLONG timestamp)
+	{
+		FireEvent(eventidOnConsultConnected, EVENT_PARAM(VTS_I4 VTS_BSTR VTS_I8 VTS_I4 VTS_BSTR VTS_I4 VTS_BSTR VTS_BSTR VTS_BSTR VTS_I4 VTS_I8), eventID, callID, contactID, partyNum, otherParty, otherPartyAttribute, originatingParty, originalANI, originalDNIS, reason, timestamp);
+	}
+
+	void OnConference(LONG eventID, LPCTSTR callID, LONGLONG contactID, LONG partyNum, LPCTSTR otherParty, LONG otherPartyAttribute, LPCTSTR originatingParty, LPCTSTR originalANI, LPCTSTR originalDNIS, LONG reason, LONGLONG timestamp)
+	{
+		FireEvent(eventidOnConference, EVENT_PARAM(VTS_I4 VTS_BSTR VTS_I8 VTS_I4 VTS_BSTR VTS_I4 VTS_BSTR VTS_BSTR VTS_BSTR VTS_I4 VTS_I8), eventID, callID, contactID, partyNum, otherParty, otherPartyAttribute, originatingParty, originalANI, originalDNIS, reason, timestamp);
+	}
+
+	void OnMonitor(LONG eventID, LPCTSTR callID, LONGLONG contactID, LONG partyNum, LPCTSTR otherParty, LONG otherPartyAttribute, LPCTSTR originatingParty, LPCTSTR originalANI, LPCTSTR originalDNIS, LONG reason, LONGLONG timestamp)
+	{
+		FireEvent(eventidOnMonitor, EVENT_PARAM(VTS_I4 VTS_BSTR VTS_I8 VTS_I4 VTS_BSTR VTS_I4 VTS_BSTR VTS_BSTR VTS_BSTR VTS_I4 VTS_I8), eventID, callID, contactID, partyNum, otherParty, otherPartyAttribute, originatingParty, originalANI, originalDNIS, reason, timestamp);
+	}
+
+	void OnInsert(LONG eventID, LPCTSTR callID, LONGLONG contactID, LONG partyNum, LPCTSTR otherParty, LONG otherPartyAttribute, LPCTSTR originatingParty, LPCTSTR originalANI, LPCTSTR originalDNIS, LONG reason, LONGLONG timestamp)
+	{
+		FireEvent(eventidOnInsert, EVENT_PARAM(VTS_I4 VTS_BSTR VTS_I8 VTS_I4 VTS_BSTR VTS_I4 VTS_BSTR VTS_BSTR VTS_BSTR VTS_I4 VTS_I8), eventID, callID, contactID, partyNum, otherParty, otherPartyAttribute, originatingParty, originalANI, originalDNIS, reason, timestamp);
+	}
+
+	void OnMonitored(LONG eventID, LPCTSTR callID, LONGLONG contactID, LONG partyNum, LPCTSTR otherParty, LONG otherPartyAttribute, LPCTSTR originatingParty, LPCTSTR originalANI, LPCTSTR originalDNIS, LONG reason, LONGLONG timestamp)
+	{
+		FireEvent(eventidOnMonitored, EVENT_PARAM(VTS_I4 VTS_BSTR VTS_I8 VTS_I4 VTS_BSTR VTS_I4 VTS_BSTR VTS_BSTR VTS_BSTR VTS_I4 VTS_I8), eventID, callID, contactID, partyNum, otherParty, otherPartyAttribute, originatingParty, originalANI, originalDNIS, reason, timestamp);
+	}
+
+	void OnInserted(LONG eventID, LPCTSTR callID, LONGLONG contactID, LONG partyNum, LPCTSTR otherParty, LONG otherPartyAttribute, LPCTSTR originatingParty, LPCTSTR originalANI, LPCTSTR originalDNIS, LONG reason, LONGLONG timestamp)
+	{
+		FireEvent(eventidOnInserted, EVENT_PARAM(VTS_I4 VTS_BSTR VTS_I8 VTS_I4 VTS_BSTR VTS_I4 VTS_BSTR VTS_BSTR VTS_BSTR VTS_I4 VTS_I8), eventID, callID, contactID, partyNum, otherParty, otherPartyAttribute, originatingParty, originalANI, originalDNIS, reason, timestamp);
+	}
+
+	void OnBeginRecord(LPCTSTR callID, LONGLONG contactID, LPCTSTR filename, LONG reason, LONGLONG timestamp)
+	{
+		FireEvent(eventidOnBeginRecord, EVENT_PARAM(VTS_BSTR VTS_I8 VTS_BSTR VTS_I4 VTS_I8), callID, contactID, filename, reason, timestamp);
+	}
+
+	void OnEndRecord(LPCTSTR callID, LONGLONG contactID, LPCTSTR filename, LONG reason, LONGLONG timestamp)
+	{
+		FireEvent(eventidOnEndRecord, EVENT_PARAM(VTS_BSTR VTS_I8 VTS_BSTR VTS_I4 VTS_I8), callID, contactID, filename, reason, timestamp);
+	}
+	
+	void OnInprivatequeue(LPCTSTR callID, LONGLONG contactID, LONGLONG requestID, LPCTSTR originalANI, LPCTSTR originalDNIS, LONG reason, LONGLONG timestamp)
+	{
+		FireEvent(eventidOnInprivatequeue, EVENT_PARAM(VTS_BSTR VTS_I8 VTS_I8 VTS_BSTR VTS_BSTR VTS_I4 VTS_I8), callID, contactID, requestID, originalANI, originalDNIS, reason, timestamp);
+	}
+
+	void OnOutprivatequeue(LPCTSTR callID, LONGLONG contactID, LONGLONG requestID, LPCTSTR originalANI, LPCTSTR originalDNIS, LONG reason, LONGLONG timestamp)
+	{
+		FireEvent(eventidOnOutprivatequeue, EVENT_PARAM(VTS_BSTR VTS_I8 VTS_I8 VTS_BSTR VTS_BSTR VTS_I4 VTS_I8), callID, contactID, requestID, originalANI, originalDNIS, reason, timestamp);
+	}
+
+	void OnCTIDisconnect(LPCTSTR callID, LONGLONG contactID, LPCTSTR originalANI, LPCTSTR originalDNIS, LONG reason, LONGLONG timestamp)
+	{
+		FireEvent(eventidOnCTIDisconnect, EVENT_PARAM(VTS_BSTR VTS_I8 VTS_BSTR VTS_BSTR VTS_I4 VTS_I8), callID, contactID, originalANI, originalDNIS, reason, timestamp);
+	}
+
+	void OnCTIMasterChanged(LPCTSTR callID, LONGLONG contactID, LPCTSTR originalANI, LPCTSTR originalDNIS, LONG reason, LONGLONG timestamp)
+	{
+		FireEvent(eventidOnCTIMasterChanged, EVENT_PARAM(VTS_BSTR VTS_I8 VTS_BSTR VTS_BSTR VTS_I4 VTS_I8), callID, contactID, originalANI, originalDNIS, reason, timestamp);
+	}
+
+	void OnOperationFailed(LPCTSTR callID, LONGLONG contactID, LPCTSTR originalANI, LPCTSTR originalDNIS, LONG reason, LONGLONG timestamp)
+	{
+		FireEvent(eventidOnOperationFailed, EVENT_PARAM(VTS_BSTR VTS_I8 VTS_BSTR VTS_BSTR VTS_I4 VTS_I8), callID, contactID, originalANI, originalDNIS, reason, timestamp);
+	}
+
+	void OnBeforeOutCall(LPCTSTR otherParty, LONG otherPartyAttribute, LPCTSTR originalANI, LPCTSTR originalDNIS, LONG reason, LONGLONG timestamp)
+	{
+		FireEvent(eventidOnBeforeOutCall, EVENT_PARAM(VTS_BSTR VTS_I4 VTS_BSTR VTS_BSTR VTS_I4 VTS_I8), otherParty, otherPartyAttribute, originalANI, originalDNIS, reason, timestamp);
+	}
+
+    void OnHeartbeat(LONGLONG timestamp)
+    {
+        FireEvent(eventidOnHeartbeat, EVENT_PARAM(VTS_I8), timestamp);
+    }
+
+    void OnBtnStatus(LONGLONG btnStatus, LPCTSTR info)
+    {
+        FireEvent(eventidOnBtnStatus, EVENT_PARAM(VTS_I8 VTS_BSTR), btnStatus, info);
+    }
+
+// ²¹³äµÄÊôÐÔ¡¢·½·¨ºÍÊ±¼ä
+protected:
+
+};
diff --git a/tools/agentbar/agentbarsrc/CCBar.cpp b/tools/agentbar/agentbarsrc/CCBar.cpp
index 3409ac8..21ac026 100644
--- a/tools/agentbar/agentbarsrc/CCBar.cpp
+++ b/tools/agentbar/agentbarsrc/CCBar.cpp
@@ -1,2352 +1,2363 @@
-/*
- * Copyright 2002-2014 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      CC/LICENSE
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "CCBar.h"
-#include "CCAgentBarCtrl.h"
-#include "Info.h"
-#include "ImgMgr.h"
-// CCCBar ¶Ô»°¿ò
-
-IMPLEMENT_DYNAMIC(CCCBar, CDialog)
-CCCBar::CCCBar(CWnd* pParent) : CDialog(CCCBar::IDD, pParent), m_AgentStatus(acd::AgentStatusT::AsUnknownState), m_totalTime(0), m_heartbeatCount(0), m_lDetaTime(0), 
-	m_intStatusChangeType(acd::StatusChangeT::ScReady), m_intAutoAnswer(TRUE), m_intForceSignIn(TRUE), m_intCTIPort(10000), m_intTimeOut(3000), 
-	m_intIsInitial(FALSE), m_intIsSignIn(FALSE), m_intIsSIPPhone(FALSE), m_intSIPServerPort(5060), m_intANIChangeType(ANICHANGE_SYSTEM), 
-	m_intIsShowCallOut(TRUE), m_intIsCallOut(TRUE), m_intLogLevel(Level_High), m_intEnableSeniorCall(FALSE)
-{
-	p_m_BarCtrl = dynamic_cast<CCCAgentBarCtrl *>(pParent);
-
-	// ³õÊ¼»¯¹¤¾ß×é¼þ£¨ÈÕÖ¾µÈ£©
-	Tool::Init(AfxGetInstanceHandle());
-}
-
-CCCBar::~CCCBar()
-{
-	if(m_thrd_heartbeat.is_valid()){
-		m_thrd_heartbeat->stop();
-		m_thrd_heartbeat->join();
-		m_thrd_heartbeat = bgcc::SharedPointer<bgcc::Thread>(NULL);
-	}
-	Tool::UnInit();
-}
-
-void CCCBar::DoDataExchange(CDataExchange* pDX)
-{
-	CDialog::DoDataExchange(pDX);
-	DDX_Control(pDX, IDC_BUTTON_SIGNINOUT, m_btnSignInOut);
-	DDX_Control(pDX, IDC_BUTTON_ANSWER, m_btnAnswer);
-	DDX_Control(pDX, IDC_BUTTON_CALLOUT, m_btnCallOut);
-	DDX_Control(pDX, IDC_BUTTON_HUNGUP, m_btnHangup);
-	DDX_Control(pDX, IDC_BUTTON_HOLD, m_btnHold);
-	DDX_Control(pDX, IDC_BUTTON_CONSULT, m_btnConsult);
-	DDX_Control(pDX, IDC_BUTTON_TRANSFER, m_btnTransfer);
-	DDX_Control(pDX, IDC_BUTTON_CONFERENCE, m_btnConference);
-	DDX_Control(pDX, IDC_BUTTON_SINGLESTEPTRANSFER, m_btnSingleStepTransfer);
-	DDX_Control(pDX, IDC_BUTTON_REST, m_btnRest);
-	DDX_Control(pDX, IDC_BUTTON_READY, m_btnReady);
-	DDX_Control(pDX, IDC_BUTTON_BUSY, m_btnBusy);
-	DDX_Control(pDX, IDC_BUTTON_SKILLCHANGE, m_btnSkillChange);
-	DDX_Control(pDX, IDC_BUTTON_FENGEONE, m_btnFengeOne);
-	DDX_Control(pDX, IDC_BUTTON_FENGETWO, m_btnFengeTwo);
-	DDX_Control(pDX, IDC_BUTTON_FENGETHREE, m_btnFengeThree);
-	DDX_Control(pDX, IDC_BUTTON_FENGEFOUR, m_btnFengeFour);
-	DDX_Control(pDX, IDC_STATIC_AGENTSTATE, m_stcAgentState);
-	DDX_Control(pDX, IDC_STATIC_AGENTSTATE_TIME, m_stcStateTime);
-	DDX_Control(pDX, IDC_STATIC_TALK, m_stcTalk);
-	DDX_Control(pDX, IDC_STATIC_TALK_TIME, m_stcTalkTime);
-	DDX_Control(pDX, IDC_STATIC_TOTAL, m_stcTotalTalk);
-	DDX_Control(pDX, IDC_STATIC_TOTAL_TIME, m_stcTotalTalkTime);
-	DDX_Control(pDX, IDC_COMBO_REST, m_cmbRest);
-	DDX_Control(pDX, IDC_COMBO_SKILL, m_cmbSkill);
-}
-
-BOOL CCCBar::OnInitDialog()
-{
-	CDialog::OnInitDialog();
-
-	// TODO:  ÔÚ´ËÌí¼Ó¶îÍâµÄ³õÊ¼»¯
-	if(CImgMgr::Instance().LoadImg())
-	{
-		CBitmap *pBit = CImgMgr::Instance().Get(IDB_BMP_BACKGROUND);
-		if(pBit == NULL)
-			return FALSE;
-
-		m_BrushTop.CreatePatternBrush(pBit);
-		m_BrushBottom.CreateSolidBrush(RGB(170,211,253));
-
-		m_stcAgentState.SetColor(RGB(170,211,253), RGB(5, 75, 144));
-		m_stcStateTime.SetColor(RGB(233,191,145), RGB(5, 75, 144));
-
-		m_stcTalk.SetColor(RGB(170,211,253), RGB(5, 75, 144));
-		m_stcTalkTime.SetColor(RGB(233,191,145), RGB(5, 75, 144));
-
-		m_stcTotalTalk.SetColor(RGB(170,211,253), RGB(5, 75, 144));
-		m_stcTotalTalkTime.SetColor(RGB(233,191,145),RGB(5, 75, 144));
-	}
-	else
-	{
-		m_BrushTop.CreateSolidBrush(RGB(240,240,240));
-		m_BrushBottom.CreateSolidBrush(RGB(225,225,225));
-		
-		m_stcAgentState.SetColor(RGB(128,255,255), RGB(250, 0, 0));
-		m_stcStateTime.SetColor(RGB(92,80,35), RGB(255, 255, 255));
-
-		m_stcTalk.SetColor(RGB(128,255,255), RGB(255, 0, 0));
-		m_stcTalkTime.SetColor(RGB(92,80,35), RGB(255, 255, 255));
-
-		m_stcTotalTalk.SetColor(RGB(128,255,255), RGB(255, 0, 0));
-		m_stcTotalTalkTime.SetColor(RGB(92,80,35), RGB(255, 255, 255));
-	}
-
-	CRect rect;
-	GetClientRect(&rect);
-	rect.right = rect.left + BAR_WIDTH;											//¿í1440
-	rect.bottom = rect.top + BAR_HEIGHT;										//¸ß84
-
-	m_RectTop.left = rect.left;
-	m_RectTop.top = rect.top;
-	m_RectTop.right = rect.right;
-	m_RectTop.bottom = rect.top + TOP_HEIGHT;
-
-	m_RectBottom.left = rect.left;
-	m_RectBottom.top = rect.top + TOP_HEIGHT;
-	m_RectBottom.right = rect.right;
-	m_RectBottom.bottom = rect.bottom;
-
-	//¿í150
-	m_stcAgentState.SetWidth(150);
-	m_stcAgentState.SetStaticexText("Î´Ç©Èë");
-	m_stcAgentState.SetFont(110, "ËÎÌå");
-	m_stcAgentState.SetWindowpos(m_RectBottom.left, m_RectBottom.top);
-	
-
-	//¿í100
-	m_stcStateTime.SetWidth(100);
-	m_stcStateTime.SetStaticexText("00:00:00");
-	m_stcStateTime.SetFont(110, "ËÎÌå");
-	m_stcStateTime.SetWindowpos(m_RectBottom.left + 150, m_RectBottom.top);
-
-	//¿í150
-	m_stcTalk.SetWidth(150);
-	m_stcTalk.SetStaticexText("µ±Ç°Í¨»°Ê±³¤");
-	m_stcTalk.SetFont(110, "ËÎÌå");
-	m_stcTalk.SetWindowpos(m_RectBottom.left + 250, m_RectBottom.top);
-
-	//¿í100
-	m_stcTalkTime.SetWidth(100);
-	m_stcTalkTime.SetStaticexText("00:00:00");
-	m_stcTalkTime.SetFont(110, "ËÎÌå");
-	m_stcTalkTime.SetWindowpos(m_RectBottom.left + 400, m_RectBottom.top);
-
-	//¿í150
-	m_stcTotalTalk .SetWidth(150);
-	m_stcTotalTalk.SetStaticexText("×ÜÍ¨»°Ê±³¤");
-	m_stcTotalTalk.SetFont(110, "ËÎÌå");
-	m_stcTotalTalk.SetWindowpos(m_RectBottom.left + 500, m_RectBottom.top);
-
-	//¿í100
-	m_stcTotalTalkTime.SetWidth(100);
-	m_stcTotalTalkTime.SetStaticexText("00:00:00");
-	m_stcTotalTalkTime.SetFont(110, "ËÎÌå");
-	m_stcTotalTalkTime.SetWindowpos(m_RectBottom.left + 650, m_RectBottom.top);
-
-	m_btnSignInOut.SetButtonPos(m_RectTop.left + 10, m_RectTop.top + BAR_TOP_POSITION);
-	m_btnSignInOut.SetBitMap(IDB_BMP_IN_SIGNIN, IDB_BMP_IN_SIGNIN);
-	m_btnSignInOut.EnableWindow(FALSE);
-
-	m_btnFengeOne.SetButtonPos(m_RectTop.left + 62,  m_RectTop.top + BAR_TOP_POSITION);
-	m_btnFengeOne.SetBitMap(IDB_BMP_FENGE, IDB_BMP_FENGE);
-	m_btnFengeOne.EnableWindow(FALSE);
-
-	m_btnAnswer.SetButtonPos(m_RectTop.left + 74, m_RectTop.top + BAR_TOP_POSITION);
-	m_btnAnswer.SetBitMap(IDB_BMP_IN_ANSWER, IDB_BMP_IN_ANSWER);
-	m_btnAnswer.EnableWindow(FALSE);
-
-	m_btnCallOut.SetButtonPos(m_RectTop.left + 126,  m_RectTop.top + BAR_TOP_POSITION);
-	m_btnCallOut.SetBitMap(IDB_BMP_IN_CALLOUT, IDB_BMP_IN_CALLOUT);
-	m_btnCallOut.EnableWindow(FALSE);
-
-	m_btnHangup.SetButtonPos(m_RectTop.left + 178,  m_RectTop.top + BAR_TOP_POSITION);
-	m_btnHangup.SetBitMap(IDB_BMP_IN_HANGUP, IDB_BMP_IN_HANGUP);
-	m_btnHangup.EnableWindow(FALSE);
-
-	m_btnFengeTwo.SetButtonPos(m_RectTop.left + 230, m_RectTop.top + BAR_TOP_POSITION);
-	m_btnFengeTwo.SetBitMap(IDB_BMP_FENGE, IDB_BMP_FENGE);
-	m_btnFengeTwo.EnableWindow(FALSE);
-
-	m_btnHold.SetButtonPos(m_RectTop.left + 242, m_RectTop.top + BAR_TOP_POSITION);
-	m_btnHold.SetBitMap(IDB_BMP_IN_HOLD, IDB_BMP_IN_HOLD);
-	m_btnHold.EnableWindow(FALSE);
-
-	m_btnFengeThree.SetButtonPos(m_RectTop.left + 294, m_RectTop.top + BAR_TOP_POSITION);
-	m_btnFengeThree.SetBitMap(IDB_BMP_FENGE, IDB_BMP_FENGE);
-	m_btnFengeThree.EnableWindow(FALSE);
-
-	m_btnConsult.SetButtonPos(m_RectTop.left + 306, m_RectTop.top + BAR_TOP_POSITION);
-	m_btnConsult.SetBitMap(IDB_BMP_IN_CONSULT, IDB_BMP_IN_CONSULT);
-	m_btnConsult.EnableWindow(FALSE);
-
-	m_btnTransfer.SetButtonPos(m_RectTop.left + 358, m_RectTop.top + BAR_TOP_POSITION);
-	m_btnTransfer.SetBitMap(IDB_BMP_IN_TRANSFER, IDB_BMP_IN_TRANSFER);
-	m_btnTransfer.EnableWindow(FALSE);
-
-	m_btnConference.SetButtonPos(m_RectTop.left + 410, m_RectTop.top + BAR_TOP_POSITION);
-	m_btnConference.SetBitMap(IDB_BMP_IN_CONFERENCE, IDB_BMP_IN_CONFERENCE);
-	m_btnConference.EnableWindow(FALSE);
-
-	m_btnSingleStepTransfer.SetButtonPos(m_RectTop.left + 462, m_RectTop.top + BAR_TOP_POSITION);
-	m_btnSingleStepTransfer.SetBitMap(IDB_BMP_IN_SSTRANSFER, IDB_BMP_IN_SSTRANSFER);
-	m_btnSingleStepTransfer.EnableWindow(FALSE);
-
-	m_btnFengeFour.SetButtonPos(m_RectTop.left + 514, m_RectTop.top + BAR_TOP_POSITION);
-	m_btnFengeFour.SetBitMap(IDB_BMP_FENGE, IDB_BMP_FENGE);
-	m_btnFengeFour.EnableWindow(FALSE);
-
-	m_btnRest.SetButtonPos(m_RectTop.left + 526, m_RectTop.top + BAR_TOP_POSITION);
-	m_btnRest.SetBitMap(IDB_BMP_IN_REST, IDB_BMP_IN_REST);
-	m_btnRest.EnableWindow(FALSE);
-
-	m_cmbRest.MoveWindow(m_RectTop.left + 578, m_RectTop.top + BAR_TOP_POSITION, 76, 80);
-	m_cmbRest.EnableWindow(FALSE);
-
-	m_btnReady.SetButtonPos(m_RectTop.left + 658, m_RectTop.top + BAR_TOP_POSITION); 
-	m_btnReady.SetBitMap(IDB_BMP_IN_READY, IDB_BMP_IN_READY);
-	m_btnReady.EnableWindow(FALSE);
-
-	m_btnBusy.SetButtonPos(m_RectTop.left + 710, m_RectTop.top + BAR_TOP_POSITION);
-	m_btnBusy.SetBitMap(IDB_BMP_IN_BUSY, IDB_BMP_IN_BUSY);
-	m_btnBusy.EnableWindow(FALSE);
-
-	m_btnSkillChange.SetButtonPos(m_RectTop.left + 762 ,m_RectTop.top + BAR_TOP_POSITION);
-	m_btnSkillChange.SetBitMap(IDB_BMP_IN_SKILLCHANGE, IDB_BMP_IN_SKILLCHANGE);
-	m_btnSkillChange.EnableWindow(FALSE);
-
-	m_cmbSkill.MoveWindow(m_RectTop.left + 814, m_RectTop.top + BAR_TOP_POSITION, 152, 80);
-	m_cmbSkill.EnableWindow(FALSE);
-
-	m_btnSkillChange.ShowWindow(SW_HIDE);
-	m_cmbSkill.ShowWindow(SW_HIDE);
-
-	return TRUE;
-}
-
-BEGIN_MESSAGE_MAP(CCCBar, CDialog)
-	ON_WM_ERASEBKGND()
-	ON_WM_SETCURSOR()
-	ON_WM_TIMER()
-	ON_WM_DESTROY()
-	ON_BN_CLICKED(IDC_BUTTON_SIGNINOUT, OnBnClickedButtonSigninout)
-	ON_BN_CLICKED(IDC_BUTTON_ANSWER, OnBnClickedButtonAnswer)
-	ON_BN_CLICKED(IDC_BUTTON_CALLOUT, OnBnClickedButtonCallout)
-	ON_BN_CLICKED(IDC_BUTTON_HUNGUP, OnBnClickedButtonHungup)
-	ON_BN_CLICKED(IDC_BUTTON_HOLD, OnBnClickedButtonHold)
-	ON_BN_CLICKED(IDC_BUTTON_CONSULT, OnBnClickedButtonConsult)
-	ON_BN_CLICKED(IDC_BUTTON_TRANSFER, OnBnClickedButtonTransfer)
-	ON_BN_CLICKED(IDC_BUTTON_CONFERENCE, OnBnClickedButtonConference)
-	ON_BN_CLICKED(IDC_BUTTON_SINGLESTEPTRANSFER, OnBnClickedButtonSinglesteptransfer)
-	ON_BN_CLICKED(IDC_BUTTON_REST, OnBnClickedButtonRest)
-	ON_BN_CLICKED(IDC_BUTTON_READY, OnBnClickedButtonReady)
-	ON_BN_CLICKED(IDC_BUTTON_BUSY, OnBnClickedButtonBusy)
-	ON_BN_CLICKED(IDC_BUTTON_SKILLCHANGE, OnBnClickedButtonSkillchange)
-	ON_MESSAGE(WM_AGENTEVENT, OnAgentEvent)
-	ON_MESSAGE(WM_MEDIAEVENT, OnMediaEvent)
-	ON_MESSAGE(WM_QUEUEEVENT, OnRouteEvent)
-	ON_MESSAGE(WM_OTHEREVENT, OnOtherEvent)
-END_MESSAGE_MAP()
-
-void CCCBar::SetButton()
-{
-	if(m_btnStatus.btnLogin ^ m_lastBtnStatus.btnLogin || m_btnStatus.btnLogout ^ m_lastBtnStatus.btnLogout)
-	{
-		if(m_btnStatus.btnLogin)
-		{
-			m_btnSignInOut.SetBitMap(IDB_BMP_SIGNIN, IDB_BMP_MS_SIGNIN);
-			m_btnSignInOut.EnableWindow(TRUE);
-		}
-		else if(m_btnStatus.btnLogout)
-		{
-			m_btnSignInOut.SetBitMap(IDB_BMP_SIGNOUT, IDB_BMP_MS_SIGNOUT);
-			m_btnSignInOut.EnableWindow(TRUE);
-		}
-		else if(m_lastBtnStatus.btnLogin)
-		{
-			m_btnSignInOut.SetBitMap(IDB_BMP_IN_SIGNIN, IDB_BMP_IN_SIGNIN);
-			m_btnSignInOut.EnableWindow(FALSE);
-		}
-		else
-		{
-			m_btnSignInOut.SetBitMap(IDB_BMP_IN_SIGNOUT, IDB_BMP_IN_SIGNOUT);
-			m_btnSignInOut.EnableWindow(FALSE);
-		}
-		m_btnSignInOut.Invalidate();
-	}
-	if(m_btnStatus.btnAnswer ^ m_lastBtnStatus.btnAnswer)
-	{
-		if(m_btnStatus.btnAnswer)
-		{
-			m_btnAnswer.SetBitMap(IDB_BMP_ANSWER, IDB_BMP_MS_ANSWER);
-			m_btnAnswer.EnableWindow(TRUE);
-		}
-		else
-		{
-			m_btnAnswer.SetBitMap(IDB_BMP_IN_ANSWER, IDB_BMP_IN_ANSWER);
-			m_btnAnswer.EnableWindow(FALSE);
-		}
-		m_btnAnswer.Invalidate();
-	}
-	if((m_btnStatus.btnCallout ^ m_lastBtnStatus.btnCallout || m_btnStatus.btnSenddtmf ^ m_lastBtnStatus.btnSenddtmf) && m_intIsShowCallOut)
-	{
-		if(m_btnStatus.btnCallout)
-		{
-			m_btnCallOut.SetBitMap(IDB_BMP_CALLOUT, IDB_BMP_MS_CALLOUT);
-			m_btnCallOut.EnableWindow(TRUE);
-		}
-		else if(m_btnStatus.btnSenddtmf)
-		{
-			m_btnCallOut.SetBitMap(IDB_BMP_SENDDTMF, IDB_BMP_MS_SENDDTMF);
-			m_btnCallOut.EnableWindow(TRUE);
-		}
-		else
-		{
-			m_btnCallOut.SetBitMap(IDB_BMP_IN_CALLOUT, IDB_BMP_IN_CALLOUT);
-			m_btnCallOut.EnableWindow(FALSE);
-		}
-		m_btnCallOut.Invalidate();
-	}
-	if(m_btnStatus.btnHangup ^ m_lastBtnStatus.btnHangup)
-	{
-		if(m_btnStatus.btnHangup)
-		{
-			m_btnHangup.SetBitMap(IDB_BMP_HANGUP, IDB_BMP_MS_HANGUP);
-			m_btnHangup.EnableWindow(TRUE);
-		}
-		else
-		{
-			m_btnHangup.SetBitMap(IDB_BMP_IN_HANGUP, IDB_BMP_IN_HANGUP);
-			m_btnHangup.EnableWindow(FALSE);
-		}
-		m_btnHangup.Invalidate();
-	}
-	if(m_btnStatus.btnHold ^ m_lastBtnStatus.btnHold || m_btnStatus.btnRetrieve ^ m_lastBtnStatus.btnRetrieve)
-	{
-		if(m_btnStatus.btnHold)
-		{
-			m_btnHold.SetBitMap(IDB_BMP_HOLD, IDB_BMP_MS_HOLD);
-			m_btnHold.EnableWindow(TRUE);
-		}
-		else if(m_btnStatus.btnRetrieve)
-		{
-			m_btnHold.SetBitMap(IDB_BMP_RETRIEVE, IDB_BMP_MS_RETRIEVE);
-			m_btnHold.EnableWindow(TRUE);
-		}
-		else
-		{
-			m_btnHold.SetBitMap(IDB_BMP_IN_HOLD, IDB_BMP_IN_HOLD);
-			m_btnHold.EnableWindow(FALSE);
-		}
-		m_btnHold.Invalidate();
-	}
-	if((m_btnStatus.btnConsult ^ m_lastBtnStatus.btnConsult || m_btnStatus.btnReconnect ^ m_lastBtnStatus.btnReconnect) && m_intEnableSeniorCall)
-	{
-		if(m_btnStatus.btnConsult)
-		{
-			m_btnConsult.SetBitMap(IDB_BMP_CONSULT, IDB_BMP_MS_CONSULT);
-			m_btnConsult.EnableWindow(TRUE);
-		}
-		else if(m_btnStatus.btnReconnect)
-		{
-			m_btnConsult.SetBitMap(IDB_BMP_RECONNECT, IDB_BMP_MS_RECONNECT);
-			m_btnConsult.EnableWindow(TRUE);
-		}
-		else
-		{
-			m_btnConsult.SetBitMap(IDB_BMP_IN_CONSULT, IDB_BMP_IN_CONSULT);
-			m_btnConsult.EnableWindow(FALSE);
-		}
-		m_btnConsult.Invalidate();
-	}
-	if((m_btnStatus.btnTransfer ^ m_lastBtnStatus.btnTransfer) && m_intEnableSeniorCall)
-	{
-		if(m_btnStatus.btnTransfer)
-		{
-			m_btnTransfer.SetBitMap(IDB_BMP_TRANSFER, IDB_BMP_MS_TRANSFER);
-			m_btnTransfer.EnableWindow(TRUE);
-		}
-		else
-		{
-			m_btnTransfer.SetBitMap(IDB_BMP_IN_TRANSFER, IDB_BMP_IN_TRANSFER);
-			m_btnTransfer.EnableWindow(FALSE);
-		}
-		m_btnTransfer.Invalidate();
-	}
-	if((m_btnStatus.btnConference ^ m_lastBtnStatus.btnConference) && m_intEnableSeniorCall)
-	{
-		if(m_btnStatus.btnConference)
-		{
-			m_btnConference.SetBitMap(IDB_BMP_CONFERENCE, IDB_BMP_MS_CONFERENCE);
-			m_btnConference.EnableWindow(TRUE);
-		}
-		else
-		{
-			m_btnConference.SetBitMap(IDB_BMP_IN_CONFERENCE, IDB_BMP_IN_CONFERENCE);
-			m_btnConference.EnableWindow(FALSE);
-		}
-		m_btnConference.Invalidate();
-	}
-	if((m_btnStatus.btnSSTransfer ^ m_lastBtnStatus.btnSSTransfer) && m_intEnableSeniorCall)
-	{
-		if(m_btnStatus.btnSSTransfer)
-		{
-			m_btnSingleStepTransfer.SetBitMap(IDB_BMP_SSTRANSFER, IDB_BMP_MS_SSTRANSFER);
-			m_btnSingleStepTransfer.EnableWindow(TRUE);
-		}
-		else
-		{
-			m_btnSingleStepTransfer.SetBitMap(IDB_BMP_IN_SSTRANSFER, IDB_BMP_IN_SSTRANSFER);
-			m_btnSingleStepTransfer.EnableWindow(FALSE);
-		}
-		m_btnSingleStepTransfer.Invalidate();
-	}
-	if(m_btnStatus.btnRest ^ m_lastBtnStatus.btnRest)
-	{
-		if(m_btnStatus.btnRest)
-		{
-			m_btnRest.SetBitMap(IDB_BMP_REST, IDB_BMP_MS_REST);
-			m_btnRest.EnableWindow(TRUE);
-			m_cmbRest.EnableWindow(TRUE);
-		}
-		else
-		{
-			m_btnRest.SetBitMap(IDB_BMP_IN_REST, IDB_BMP_IN_REST);
-			m_btnRest.EnableWindow(FALSE);
-			m_cmbRest.EnableWindow(FALSE);
-		}
-		m_btnRest.Invalidate();
-	}
-	if(m_btnStatus.btnReady ^ m_lastBtnStatus.btnReady)
-	{
-		if(m_btnStatus.btnReady)
-		{
-			m_btnReady.SetBitMap(IDB_BMP_READY, IDB_BMP_MS_READY);
-			m_btnReady.EnableWindow(TRUE);
-		}
-		else
-		{
-			m_btnReady.SetBitMap(IDB_BMP_IN_READY, IDB_BMP_IN_READY);
-			m_btnReady.EnableWindow(FALSE);
-		}
-		m_btnReady.Invalidate();
-	}
-	if(m_btnStatus.btnBusy ^ m_lastBtnStatus.btnBusy)
-	{
-		if(m_btnStatus.btnBusy)
-		{
-			m_btnBusy.SetBitMap(IDB_BMP_BUSY, IDB_BMP_MS_BUSY);
-			m_btnBusy.EnableWindow(TRUE);
-		}
-		else
-		{
-			m_btnBusy.SetBitMap(IDB_BMP_IN_BUSY, IDB_BMP_IN_BUSY);
-			m_btnBusy.EnableWindow(FALSE);
-		}
-		m_btnBusy.Invalidate();
-	}
-	if(m_btnStatus.btnSkill ^ m_lastBtnStatus.btnSkill)
-	{
-		if(m_btnStatus.btnSkill)
-		{
-			m_btnSkillChange.SetBitMap(IDB_BMP_SKILLCHANGE, IDB_BMP_MS_SKILLCHANGE);
-			m_btnSkillChange.EnableWindow(TRUE);
-			m_cmbSkill.EnableWindow(TRUE);
-		}
-		else
-		{
-			m_btnSkillChange.SetBitMap(IDB_BMP_IN_SKILLCHANGE, IDB_BMP_IN_SKILLCHANGE);
-			m_btnSkillChange.EnableWindow(FALSE);
-			m_cmbSkill.EnableWindow(FALSE);
-		}
-		m_btnSkillChange.Invalidate();
-	}
-}
-
-void CCCBar::PostMessageEx(const acd::AgentStatusT &agentStatus, const acd::CallEventReasonT &reason)
-{
-	acd::AgentEventT *pAE = new acd::AgentEventT;
-	pAE->agentId = m_strAgentID;
-	pAE->eventId = acd::CallEventTypeT::CeUnKnownEvent;
-	pAE->agentDn = m_strDN;
-	pAE->callId = "";
-	pAE->sessionId = 0;
-	pAE->agentStatus = agentStatus;
-	pAE->originalCallid = "";
-	pAE->partyNum = 0;
-	pAE->otherParty = "";
-	pAE->otherAttr = acd::PartyAttributeT::PaUnknown;
-	pAE->originatingParty = "";
-	pAE->originalAni = m_orgCallingNo;
-	pAE->originalDnis = m_orgCalledNo;
-	pAE->reason = reason;
-	if(!m_lDetaTime)
-	{
-		pAE->timestamp = CTime::GetCurrentTime().GetTime() * 1000000;
-	}
-	else
-	{
-		pAE->timestamp = static_cast<int64_t>(GetTickCount()) * 1000 + static_cast<int64_t>(m_lDetaTime);
-	}
-
-	LONGLONG address = reinterpret_cast<LONGLONG>(pAE);
-	int ladr = LOLONG(address);
-	int hadr = HILONG(address);
-	PostMessage(WM_AGENTEVENT, ladr, hadr);
-}
-
-void CCCBar::PostMessageEx(const acd::OtherEventTypeT &otherEventType)
-{
-	acd::OtherEventT *pOE = new acd::OtherEventT;
-	pOE->agentId = m_strAgentID;
-	pOE->eventType = otherEventType;
-	pOE->agentDn = m_strDN;
-	pOE->callId = "";
-	pOE->sessionId = 0;
-	pOE->originalAni = m_orgCallingNo;
-	pOE->originalDnis = m_orgCalledNo;
-	if(!m_lDetaTime)
-	{
-		pOE->timestamp = CTime::GetCurrentTime().GetTime() * 1000000;
-	}
-	else
-	{
-		pOE->timestamp = static_cast<int64_t>(GetTickCount()) * 1000 + static_cast<int64_t>(m_lDetaTime);
-	}
-
-	LONGLONG address = reinterpret_cast<LONGLONG>(pOE);
-	int ladr = LOLONG(address);
-	int hadr = HILONG(address);
-	PostMessage(WM_OTHEREVENT, ladr, hadr);
-}
-
-void CCCBar::Backup()
-{
-	LONG ret = AGENTBARERROR_SUCCESS;
-	// Ç©³ö×øÏ¯
-	PostMessageEx(acd::AgentStatusT::AsUnLoginState, acd::CallEventReasonT::CerUnloginBackup);
-	// ·¢ËÍ¶ÏÁ¬ÏûÏ¢
-	PostMessageEx(acd::OtherEventTypeT::ACDDisconnect);
-	// ·þÎñµ¹»»
-	m_acd.AcdBackup();
-	// ³¢ÊÔÖØÁ¬
-	int tryTime = TIMES_HEARTBEAT_EXCEPTION;
-	while(tryTime--)
-	{
-		ret = m_acd.AcdSignIn(m_strAgentID, m_strDN, m_strPassWord, m_intStatusChangeType, !!m_intAutoAnswer, !!m_intForceSignIn, m_strServiceList);
-		if(ret == acd::AcdResultT::ArNotMaster)// ·ÇÖ÷
-		{
-			bgcc::TimeUtil::safe_sleep_ms(TIMESPAN_HEARTBEAT);
-		}
-		else
-		{
-			break;
-		}
-	}
-	if(ret == AGENTBARERROR_SUCCESS)
-	{
-		// µ¹»»³É¹¦
-		PostMessageEx(acd::OtherEventTypeT::ACDMasterChange);
-	}
-	else
-	{
-		// µ¹»»Ê§°Ü
-		PostMessageEx(acd::OtherEventTypeT::ACDOperationFailed);
-	}
-}
-
-void CCCBar::ReSignIn()
-{
-	LONG ret = AGENTBARERROR_SUCCESS;
-	// Ç©³ö×øÏ¯
-	PostMessageEx(acd::AgentStatusT::AsUnLoginState, acd::CallEventReasonT::CerUnloginResignin);
-	// ³¢ÊÔÖØÇ©
-	ret = m_acd.AcdSignIn(m_strAgentID, m_strDN, m_strPassWord, m_intStatusChangeType, !!m_intAutoAnswer, !!m_intForceSignIn, m_strServiceList);
-	if(ret == AGENTBARERROR_SUCCESS)
-	{
-		// ÖØÇ©³É¹¦
-		PostMessageEx(acd::OtherEventTypeT::ACDReLoginSuccess);
-	}
-	else
-	{
-		// ÖØÇ©Ê§°Ü
-		PostMessageEx(acd::OtherEventTypeT::ACDReLoginFailed);
-	}
-}
-
-BOOL CCCBar::OnEraseBkgnd(CDC* pDC)
-{
-	CBrush * p_OldBrush = pDC->SelectObject(&m_BrushTop);
-	pDC->FillRect(&m_RectTop, &m_BrushTop);
-	pDC->SelectObject(p_OldBrush);
-
-	p_OldBrush = pDC->SelectObject(&m_BrushBottom);
-	pDC->FillRect(&m_RectBottom, &m_BrushBottom);
-	pDC->SelectObject(p_OldBrush);
-
-	p_OldBrush = NULL;
-
-	return TRUE;
-}
-
-BOOL CCCBar::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message)
-{
-	switch(pWnd->GetDlgCtrlID())
-	{
-		case IDC_BUTTON_SIGNINOUT:
-		case IDC_BUTTON_ANSWER:
-		case IDC_BUTTON_CALLOUT:
-		case IDC_BUTTON_HUNGUP:
-		case IDC_BUTTON_HOLD:
-		case IDC_BUTTON_CONSULT:
-		case IDC_BUTTON_TRANSFER:
-		case IDC_BUTTON_CONFERENCE:
-		case IDC_BUTTON_SINGLESTEPTRANSFER:
-		case IDC_BUTTON_REST:
-		case IDC_BUTTON_READY:
-		case IDC_BUTTON_BUSY:
-		case IDC_BUTTON_SKILLCHANGE:
-		case IDC_BUTTON_FENGEONE:
-		case IDC_BUTTON_FENGETWO:
-		case IDC_BUTTON_FENGETHREE:
-		case IDC_BUTTON_FENGEFOUR:
-			if(pWnd->IsWindowEnabled())
-			{
-				if(GetCursor() != AfxGetApp()->LoadStandardCursor(IDC_HAND))
-				{
-					SetCursor(AfxGetApp()->LoadStandardCursor(IDC_HAND));
-				}
-			}
-			break;
-		default :
-			if(GetCursor() != AfxGetApp()->LoadStandardCursor(IDC_ARROW))
-			{
-				SetCursor(AfxGetApp()->LoadStandardCursor(IDC_ARROW));
-			}	
-			break;
-	}
-	return TRUE;
-}
-
-void CCCBar::OnTimer(UINT nIDEvent)
-{
-	// TODO: ÔÚ´ËÌí¼ÓÏûÏ¢´¦Àí³ÌÐò´úÂëºÍ/»òµ÷ÓÃÄ¬ÈÏÖµ
-	switch(nIDEvent)
-	{
-	case TIMER_STATUS://×´Ì¬¶¨Ê±Æ÷
-		{
-			CTime curentTime = CTime::GetCurrentTime();
-			CTimeSpan timeSpan = curentTime - m_lastStatusTime;
-			if(timeSpan.GetTotalSeconds() > 60 || timeSpan.GetTotalSeconds() < 0)
-			{
-				m_beginStatusTime += timeSpan;
-			}
-			timeSpan = curentTime - m_beginStatusTime;
-			m_lastStatusTime = curentTime;
-
-			m_stcStateTime.SetStaticexText(timeSpan.Format("%H:%M:%S"));
-			m_stcStateTime.Invalidate();
-			break;
-		}
-	case TIMER_TALK:
-		{
-			CTime curentTime = CTime::GetCurrentTime();
-			CTimeSpan timeSpan = curentTime - m_lastTalkTime;
-			m_totalTime += timeSpan;
-			if(timeSpan.GetTotalSeconds() > 60 || timeSpan.GetTotalSeconds() < 0)
-			{
-				m_beginTalkTime += timeSpan;
-			}
-			timeSpan = curentTime - m_beginTalkTime;
-			m_lastTalkTime = curentTime;
-
-			m_stcTalkTime.SetStaticexText(timeSpan.Format("%H:%M:%S"));
-			m_stcTalkTime.Invalidate();
-
-			m_stcTotalTalkTime.SetStaticexText(m_totalTime.Format("%H:%M:%S"));
-			m_stcTotalTalkTime.Invalidate();
-
-			break;
-		}
-	default:
-		break;
-	}
-
-	CDialog::OnTimer(nIDEvent);
-}
-
-void CCCBar::OnDestroy()
-{
-	// TODO: ÔÚ´Ë´¦Ìí¼ÓÏûÏ¢´¦Àí³ÌÐò´úÂë
-	if(m_AgentStatus == acd::AgentStatusT::AsUnknownState)
-	{
-		// ²»´¦Àí
-	}
-	else if(m_AgentStatus == acd::AgentStatusT::AsUnLoginState)
-	{
-		// Î´µÇÂ¼Ôò·´³õÊ¼»¯
-		m_acd.AcdUnInitial();
-		if(m_intIsSIPPhone)
-		{
-			m_sip.SipUnInitial();
-		}
-	}
-	else
-	{
-		// ÏÈ¹Ò¶Ï£¬ºóÇ©³ö£¬×îºó·´³õÊ¼»¯BGCCºÍSIP
-		m_acd.AcdReset(m_strAgentID);
-		m_acd.AcdUnInitial();
-		if(m_intIsSIPPhone)
-		{
-			m_sip.SipUnInitial();
-		}
-	}
-	m_BrushTop.DeleteObject();
-	m_BrushBottom.DeleteObject();
-	CImgMgr::Instance().UnLoadImg();
-	CDialog::OnDestroy();
-}
-
-void CCCBar::OnBnClickedButtonSigninout()
-{
-	// TODO: ÔÚ´ËÌí¼Ó¿Ø¼þÍ¨Öª´¦Àí³ÌÐò´úÂë
-	BeginWaitCursor();
-	if(m_AgentStatus == acd::AgentStatusT::AsUnLoginState)
-	{
-		LONG ret =  BSignIn();
-		if(AGENTBARERROR_SUCCESS != ret)
-		{
-			string mes;
-			Tool::GetAcdResult_Str(ret, mes);
-			CInfo info;
-			info.SetInfo(IDI_ICON_ERROR, "Ç©ÈëÊ§°Ü£º%s", mes.c_str());
-			info.DoModal();
-		}
-	}
-	else
-	{
-		LONG ret = BSignOut();
-		if(AGENTBARERROR_SUCCESS != ret)
-		{
-			string mes;
-			Tool::GetAcdResult_Str(ret, mes);
-			CInfo info;
-			info.SetInfo(IDI_ICON_ERROR, "Ç©³öÊ§°Ü£º%s", mes.c_str());
-			info.DoModal();
-		}
-	}
-	EndWaitCursor();
-}
-
-void CCCBar::OnBnClickedButtonAnswer()
-{
-	// TODO: ÔÚ´ËÌí¼Ó¿Ø¼þÍ¨Öª´¦Àí³ÌÐò´úÂë
-	BeginWaitCursor();
-	LONG ret = BAnswer();
-	if(AGENTBARERROR_SUCCESS != ret)
-	{
-		string mes;
-		Tool::GetAcdResult_Str(ret, mes);
-		CInfo info;
-		info.SetInfo(IDI_ICON_ERROR, "½ÓÌýÊ§°Ü£º%s", mes.c_str());
-		info.DoModal();
-	}
-	EndWaitCursor();
-}
-
-void CCCBar::OnBnClickedButtonCallout()
-{
-	// TODO: ÔÚ´ËÌí¼Ó¿Ø¼þÍ¨Öª´¦Àí³ÌÐò´úÂë
-	BeginWaitCursor();
-	CRect rect;
-	m_btnCallOut.GetWindowRect(&rect);
-	m_dlgCallOut.SetPosition(rect.right, rect.bottom);
-	if(m_dlgCallOut.DoModal() == IDOK)
-	{
-		if(m_AgentStatus == acd::AgentStatusT::AsBusyState)// Íâºô
-		{
-			if(m_dlgCallOut.GetAgentOrOut() == 0)//ÍâÏß
-			{
-				// ÊÇ·ñ·¢ÆðÍâºô
-				m_intIsCallOut = TRUE;
-				p_m_BarCtrl->OnBeforeOutCall(m_dlgCallOut.GetNumber(), acd::PartyAttributeT::PaNormal, m_strDN, m_dlgCallOut.GetNumber(), 1, CTime::GetCurrentTime().GetTime() * 1000000);
-				if(!m_intIsCallOut)
-				{
-					Tool::m_Logger.WriteLog("CCCBar", "OnBnClickedButtonCallout", "IsCallOut Error", m_intIsCallOut);
-					return;
-				}
-				// ·¢ÆðÍâºô
-				CString showANI, showDNIS;
-				switch(m_intANIChangeType)
-				{
-				case ANICHANGE_SYSTEM:
-					break;
-				case ANICHANGE_TRANSFER:
-					showDNIS = m_strDN;
-					break;
-				case ANICHANGE_SPECIAL:
-					break;
-				default:
-					break;
-				}
-				LONG ret = BMakeCall(m_dlgCallOut.GetNumber(), showANI, showDNIS, acd::CallModeT::CmNormal, acd::CallTypeT::CtOut);
-				if(AGENTBARERROR_SUCCESS != ret)
-				{
-					string mes;
-					Tool::GetAcdResult_Str(ret, mes);
-					CInfo info;
-					info.SetInfo(IDI_ICON_ERROR, "ºô³öÊ§°Ü£º%s", mes.c_str());
-					info.DoModal();
-				}
-			}
-			else//×øÏ¯
-			{
-				CString showANI, showDNIS;
-				switch(m_intANIChangeType)
-				{
-				case ANICHANGE_SYSTEM:
-					break;
-				case ANICHANGE_TRANSFER:
-					showDNIS = m_strDN;
-					break;
-				case ANICHANGE_SPECIAL:
-					break;
-				default:
-					break;
-				}
-				LONG ret = BMakeCall(m_dlgCallOut.GetNumber(), showANI, showDNIS, acd::CallModeT::CmNormal, acd::CallTypeT::CtAgent);
-				if(AGENTBARERROR_SUCCESS != ret)
-				{
-					string mes;
-					Tool::GetAcdResult_Str(ret, mes);
-					CInfo info;
-					info.SetInfo(IDI_ICON_ERROR, "ºô³öÊ§°Ü£º%s", mes.c_str());
-					info.DoModal();
-				}
-			}
-		}
-		else// ¶þ´Î²¦ºÅ
-		{
-			LONG ret = BSendDTMF(m_dlgCallOut.GetNumber());
-			if(AGENTBARERROR_SUCCESS != ret)
-			{
-				string mes;
-				Tool::GetAcdResult_Str(ret, mes);
-				CInfo info;
-				info.SetInfo(IDI_ICON_ERROR, "²¦´ò·Ö»úÊ§°Ü£º%s", mes.c_str());
-				info.DoModal();
-			}
-		}
-	}
-	EndWaitCursor();
-}
-
-void CCCBar::OnBnClickedButtonHungup()
-{
-	// TODO: ÔÚ´ËÌí¼Ó¿Ø¼þÍ¨Öª´¦Àí³ÌÐò´úÂë
-	BeginWaitCursor();
-	LONG ret = BReleaseCall();
-	if(AGENTBARERROR_SUCCESS != ret)
-	{
-		string mes;
-		Tool::GetAcdResult_Str(ret, mes);
-		CInfo info;
-		info.SetInfo(IDI_ICON_ERROR, "¹Ò¶ÏÊ§°Ü£º%s", mes.c_str());
-		info.DoModal();
-	}
-	EndWaitCursor();
-}
-
-void CCCBar::OnBnClickedButtonHold()
-{
-	// TODO: ÔÚ´ËÌí¼Ó¿Ø¼þÍ¨Öª´¦Àí³ÌÐò´úÂë
-	BeginWaitCursor();
-	if(m_AgentStatus == acd::AgentStatusT::AsConnectedState)
-	{
-		LONG ret = BHold();
-		if(AGENTBARERROR_SUCCESS != ret)
-		{
-			string mes;
-			Tool::GetAcdResult_Str(ret, mes);
-			CInfo info;
-			info.SetInfo(IDI_ICON_ERROR, "±£³ÖÊ§°Ü£º%s", mes.c_str());
-			info.DoModal();
-		}
-	}
-	else
-	{
-		LONG ret = BRetrieve();
-		if(AGENTBARERROR_SUCCESS != ret)
-		{
-			string mes;
-			Tool::GetAcdResult_Str(ret, mes);
-			CInfo info;
-			info.SetInfo(IDI_ICON_ERROR, "±£³Ö½Ó»ØÊ§°Ü£º%s", mes.c_str());
-			info.DoModal();
-		}
-	}
-	EndWaitCursor();
-}
-
-void CCCBar::OnBnClickedButtonConsult()
-{
-	// TODO: ÔÚ´ËÌí¼Ó¿Ø¼þÍ¨Öª´¦Àí³ÌÐò´úÂë
-	BeginWaitCursor();
-	if(m_AgentStatus == acd::AgentStatusT::AsConnectedState)
-	{
-		CRect rect;
-		m_btnConsult.GetWindowRect(&rect);
-		m_dlgCallOut.SetPosition(rect.right, rect.bottom);
-		if(m_dlgCallOut.DoModal() == IDOK)
-		{
-			if(m_dlgCallOut.GetAgentOrOut() == 0)// ÍâÏß
-			{
-				// ÊÇ·ñ·¢ÆðÍâºô
-				m_intIsCallOut = TRUE;
-				p_m_BarCtrl->OnBeforeOutCall(m_dlgCallOut.GetNumber(), acd::PartyAttributeT::PaNormal, m_strDN, m_dlgCallOut.GetNumber(), 2, CTime::GetCurrentTime().GetTime() * 1000000);
-				if(!m_intIsCallOut)
-				{
-					Tool::m_Logger.WriteLog("CCCBar", "OnBnClickedButtonConsult", "IsCallOut Error", m_intIsCallOut);
-					return;
-				}
-				// ·¢Æð×ÉÑ¯
-				CString showANI, showDNIS;
-				switch(m_intANIChangeType)
-				{
-				case ANICHANGE_SYSTEM:
-					break;
-				case ANICHANGE_TRANSFER:
-					showDNIS = m_strDN;
-					break;
-				case ANICHANGE_SPECIAL:
-					break;
-				default:
-					break;
-				}
-				LONG ret = BConsult(m_dlgCallOut.GetNumber(), showANI, showDNIS, acd::CallTypeT::CtOut);
-				if(AGENTBARERROR_SUCCESS != ret)
-				{
-					string mes;
-					Tool::GetAcdResult_Str(ret, mes);
-					CInfo info;
-					info.SetInfo(IDI_ICON_ERROR, "×ÉÑ¯Ê§°Ü£º%s", mes.c_str());
-					info.DoModal();
-				}
-			}
-			else// ×øÏ¯
-			{
-				CString showANI, showDNIS;
-				switch(m_intANIChangeType)
-				{
-				case ANICHANGE_SYSTEM:
-					break;
-				case ANICHANGE_TRANSFER:
-					showDNIS = m_strDN;
-					break;
-				case ANICHANGE_SPECIAL:
-					break;
-				default:
-					break;
-				}
-				LONG ret = BConsult(m_dlgCallOut.GetNumber(), showANI, showDNIS, acd::CallTypeT::CtAgent);
-				if(AGENTBARERROR_SUCCESS != ret)
-				{
-					string mes;
-					Tool::GetAcdResult_Str(ret, mes);
-					CInfo info;
-					info.SetInfo(IDI_ICON_ERROR, "×ÉÑ¯Ê§°Ü£º%s", mes.c_str());
-					info.DoModal();
-				}
-			}
-		}
-	}
-	else
-	{
-		LONG ret = BReconnect();
-		if(AGENTBARERROR_SUCCESS != ret)
-		{
-			string mes;
-			Tool::GetAcdResult_Str(ret, mes);
-			CInfo info;
-			info.SetInfo(IDI_ICON_ERROR, "×ÉÑ¯½Ó»ØÊ§°Ü£º%s", mes.c_str());
-			info.DoModal();
-		}
-	}
-	EndWaitCursor();
-}
-
-void CCCBar::OnBnClickedButtonTransfer()
-{
-	// TODO: ÔÚ´ËÌí¼Ó¿Ø¼þÍ¨Öª´¦Àí³ÌÐò´úÂë
-	BeginWaitCursor();
-	LONG ret = BTransfer();
-	if(AGENTBARERROR_SUCCESS != ret)
-	{
-		string mes;
-		Tool::GetAcdResult_Str(ret, mes);
-		CInfo info;
-		info.SetInfo(IDI_ICON_ERROR, "×ÉÑ¯×ªÒÆÊ§°Ü£º%s", mes.c_str());
-		info.DoModal();
-	}
-	EndWaitCursor();
-}
-
-void CCCBar::OnBnClickedButtonConference()
-{
-	// TODO: ÔÚ´ËÌí¼Ó¿Ø¼þÍ¨Öª´¦Àí³ÌÐò´úÂë
-	BeginWaitCursor();
-	LONG ret = BConference();
-	if(AGENTBARERROR_SUCCESS != ret)
-	{
-		string mes;
-		Tool::GetAcdResult_Str(ret, mes);
-		CInfo info;
-		info.SetInfo(IDI_ICON_ERROR, "×ÉÑ¯»áÒéÊ§°Ü£º%s", mes.c_str());
-		info.DoModal();
-	}
-	EndWaitCursor();
-}
-
-void CCCBar::OnBnClickedButtonSinglesteptransfer()
-{
-	// TODO: ÔÚ´ËÌí¼Ó¿Ø¼þÍ¨Öª´¦Àí³ÌÐò´úÂë
-	BeginWaitCursor();
-	CRect rect;
-	m_btnSingleStepTransfer.GetWindowRect(&rect);
-	m_dlgCallOut.SetPosition(rect.right, rect.bottom);
-	if(m_dlgCallOut.DoModal() == IDOK)
-	{
-		if(m_dlgCallOut.GetAgentOrOut() == 0)// ÍâÏß
-		{
-			// ÊÇ·ñ·¢ÆðÍâºô
-			m_intIsCallOut = TRUE;
-			p_m_BarCtrl->OnBeforeOutCall(m_dlgCallOut.GetNumber(), acd::PartyAttributeT::PaNormal, m_strDN, m_dlgCallOut.GetNumber(), 3, CTime::GetCurrentTime().GetTime() * 1000000);
-			if(!m_intIsCallOut)
-			{
-				Tool::m_Logger.WriteLog("CCCBar", "OnBnClickedButtonSinglesteptransfer", "IsCallOut Error", m_intIsCallOut);
-				return;
-			}
-			// ·¢Æð×ªÒÆ
-			CString showANI, showDNIS;
-			switch(m_intANIChangeType)
-			{
-			case ANICHANGE_SYSTEM:
-				break;
-			case ANICHANGE_TRANSFER:
-				showDNIS = m_strDN;
-				break;
-			case ANICHANGE_SPECIAL:
-				break;
-			default:
-				break;
-			}
-			LONG ret = BSingleStepTransfer(m_dlgCallOut.GetNumber(), showANI, showDNIS, FALSE, acd::CallTypeT::CtOut);
-			if(AGENTBARERROR_SUCCESS != ret)
-			{
-				string mes;
-				Tool::GetAcdResult_Str(ret, mes);
-				CInfo info;
-				info.SetInfo(IDI_ICON_ERROR, "Í¨»°×ªÒÆÊ§°Ü£º%s", mes.c_str());
-				info.DoModal();
-			}
-		}
-		else// ×øÏ¯
-		{
-			CString showANI, showDNIS;
-			switch(m_intANIChangeType)
-			{
-			case ANICHANGE_SYSTEM:
-				break;
-			case ANICHANGE_TRANSFER:
-				showDNIS = m_strDN;
-				break;
-			case ANICHANGE_SPECIAL:
-				break;
-			default:
-				break;
-			}
-			LONG ret = BSingleStepTransfer(m_dlgCallOut.GetNumber(), showANI, showDNIS, FALSE, acd::CallTypeT::CtAgent);
-			if(AGENTBARERROR_SUCCESS != ret)
-			{
-				string mes;
-				Tool::GetAcdResult_Str(ret, mes);
-				CInfo info;
-				info.SetInfo(IDI_ICON_ERROR, "Í¨»°×ªÒÆÊ§°Ü£º%s", mes.c_str());
-				info.DoModal();
-			}
-		}
-	}
-	EndWaitCursor();
-}
-
-void CCCBar::OnBnClickedButtonRest()
-{
-	// TODO: ÔÚ´ËÌí¼Ó¿Ø¼þÍ¨Öª´¦Àí³ÌÐò´úÂë
-	BeginWaitCursor();
-	// È¡ÐÝÏ¢Ô­Òò
-	int index = m_cmbRest.GetCurSel();
-	CString reason;
-	if(index != -1)
-		m_cmbRest.GetLBText(index, reason);
-	LONG ret = BSetRest(reason);
-	if(AGENTBARERROR_SUCCESS != ret)
-	{
-		string mes;
-		Tool::GetAcdResult_Str(ret, mes);
-		CInfo info;
-		info.SetInfo(IDI_ICON_ERROR, "ÐÝÏ¢Ê§°Ü£º%s", mes.c_str());
-		info.DoModal();
-	}
-	EndWaitCursor();
-}
-
-void CCCBar::OnBnClickedButtonReady()
-{
-	// TODO: ÔÚ´ËÌí¼Ó¿Ø¼þÍ¨Öª´¦Àí³ÌÐò´úÂë
-	BeginWaitCursor();
-	LONG ret = BSetIdle();
-	if(AGENTBARERROR_SUCCESS != ret)
-	{
-		string mes;
-		Tool::GetAcdResult_Str(ret, mes);
-		CInfo info;
-		info.SetInfo(IDI_ICON_ERROR, "Ó¦´ð¾ÍÐ÷Ê§°Ü£º%s", mes.c_str());
-		info.DoModal();
-	}
-	EndWaitCursor();
-}
-
-void CCCBar::OnBnClickedButtonBusy()
-{
-	// TODO: ÔÚ´ËÌí¼Ó¿Ø¼þÍ¨Öª´¦Àí³ÌÐò´úÂë
-	BeginWaitCursor();
-	LONG ret = BSetBusy();
-	if(AGENTBARERROR_SUCCESS != ret)
-	{
-		string mes;
-		Tool::GetAcdResult_Str(ret, mes);
-		CInfo info;
-		info.SetInfo(IDI_ICON_ERROR, "½ÓÌý¾ÍÐ÷Ê§°Ü£º%s", mes.c_str());
-		info.DoModal();
-	}
-	EndWaitCursor();
-}
-
-void CCCBar::OnBnClickedButtonSkillchange()
-{
-	// TODO: ÔÚ´ËÌí¼Ó¿Ø¼þÍ¨Öª´¦Àí³ÌÐò´úÂë
-	BeginWaitCursor();
-	LONG ret = BResetSkill("");
-	if(AGENTBARERROR_SUCCESS != ret)
-	{
-		string mes;
-		Tool::GetAcdResult_Str(ret, mes);
-		CInfo info;
-		info.SetInfo(IDI_ICON_ERROR, "¼¼ÄÜÇÐ»»Ê§°Ü£º%s", mes.c_str());
-		info.DoModal();
-	}
-	EndWaitCursor();
-}
-
-LRESULT CCCBar::OnAgentEvent(WPARAM wParam, LPARAM lParam)
-{
-	LONGLONG address = MAKELONGLONG(wParam, lParam);
-	acd::AgentEventT *pAE = reinterpret_cast<acd::AgentEventT *>(address);
-	Tool::WriteAgentEventLog(pAE, "out");
-
-	m_AgentStatus = pAE->agentStatus;
-	m_btnStatus.Reset();
-	m_beginStatusTime = CTime::GetCurrentTime();
-
-	m_strActiveCallID = pAE->callId;
-
-	try
-	{
-		switch(m_AgentStatus.get_value())
-		{
-		case acd::AgentStatusT::AsUnknownState:
-			{
-				m_stcAgentState.SetStaticexText("Î´Öª×´Ì¬");
-				break;
-			}
-		case acd::AgentStatusT::AsUnLoginState:
-			{
-				m_btnStatus.btnLogin = true;
-				m_stcAgentState.SetStaticexText("Î´Ç©Èë");
-				// ÖÕÖ¹×´Ì¬¶¨Ê±Æ÷£¬ËùÓÐÊ±¼ä¹éÁã
-				if(m_intIsSignIn)
-				{
-					KillTimer(TIMER_STATUS);
-					m_stcStateTime.SetStaticexText("00:00:00");
-					m_stcStateTime.Invalidate();
-					KillTimer(TIMER_TALK);
-					m_stcTalkTime.SetStaticexText("00:00:00");
-					m_stcTalkTime.Invalidate();
-					if(m_thrd_heartbeat.is_valid()){
-						m_thrd_heartbeat->stop();
-						m_thrd_heartbeat->join();
-						m_thrd_heartbeat=bgcc::SharedPointer<bgcc::Thread>(NULL);
-					}
-
-					m_totalTime = 0;
-					m_stcTotalTalkTime.SetStaticexText("00:00:00");
-					m_stcTotalTalkTime.Invalidate();
-				}
-				m_intIsSignIn = FALSE;
-				// ÊÂ¼þ»Øµ÷
-				p_m_BarCtrl->OnUnLogin(pAE->eventId.get_value(), pAE->callId.c_str(), pAE->sessionId, pAE->partyNum, pAE->otherParty.c_str(), pAE->otherAttr.get_value(), 
-					pAE->originatingParty.c_str(), pAE->originalAni.c_str(), pAE->originalDnis.c_str(), pAE->reason.get_value(), pAE->timestamp);
-				break;
-			}
-		case acd::AgentStatusT::AsReadyState:
-			{
-				m_btnStatus.btnLogout = true;
-				m_btnStatus.btnRest = true;
-				m_btnStatus.btnBusy = true;
-				m_btnStatus.btnSkill = true;
-				m_stcAgentState.SetStaticexText("½ÓÌý¾ÍÐ÷");
-				// Æô¶¯×´Ì¬¶¨Ê±Æ÷¡¢ÖÕÖ¹Í¨»°¶¨Ê±Æ÷
-				if(pAE->reason == acd::CallEventReasonT::CerIdleSelfLogin || pAE->reason == acd::CallEventReasonT::CerIdleOtherLogin)
-				{
-					SetTimer(TIMER_STATUS, TIMESPAN_STATUS, NULL);
-					m_thrd_heartbeat=bgcc::SharedPointer<bgcc::Thread>(new bgcc::Thread(bgcc::SharedPointer<HeartBeatTask>(new HeartBeatTask(this))));
-					if(m_thrd_heartbeat.is_valid()){
-						m_thrd_heartbeat->start();
-					}
-					m_lastStatusTime = CTime::GetCurrentTime();
-					// ³õÊ¼»¯ÐÝÏ¢Ô­Òò
-					m_cmbRest.ResetContent();
-					acd::StringListT reasons;
-					if(BGetRestReason(reasons) == AGENTBARERROR_SUCCESS)
-					{
-						for(acd::StringListT::iterator it = reasons.begin(); it != reasons.end(); it++)
-						{
-							m_cmbRest.AddString((*it).c_str());
-						}
-						if(m_cmbRest.GetCount() > 0)
-							m_cmbRest.SetCurSel(0);
-					}
-				}
-				else if(pAE->reason == acd::CallEventReasonT::CerIdleNormalSelfHangup 
-					|| pAE->reason == acd::CallEventReasonT::CerIdleNormalOtherHangup
-					|| pAE->reason == acd::CallEventReasonT::CerIdleErrorOtherHangup
-					|| pAE->reason == acd::CallEventReasonT::CerIdleErrorSelfHangup )
-				{
-					KillTimer(TIMER_TALK);
-				}
-				m_intIsSignIn = TRUE;
-				// ÊÂ¼þ»Øµ÷
-				p_m_BarCtrl->OnReady(pAE->eventId.get_value(), pAE->callId.c_str(), pAE->sessionId, pAE->partyNum, pAE->otherParty.c_str(), pAE->otherAttr.get_value(), 
-					pAE->originatingParty.c_str(), pAE->originalAni.c_str(), pAE->originalDnis.c_str(), pAE->reason.get_value(), pAE->timestamp);
-				break;
-			}
-		case acd::AgentStatusT::AsBusyState:
-			{
-				m_btnStatus.btnLogout = true;
-				m_btnStatus.btnCallout = true;
-				m_btnStatus.btnRest = true;
-				m_btnStatus.btnReady = true;
-				m_btnStatus.btnSkill = true;
-				m_stcAgentState.SetStaticexText("ºô³ö¾ÍÐ÷");
-				// Æô¶¯×´Ì¬¶¨Ê±Æ÷¡¢ÖÕÖ¹Í¨»°¶¨Ê±Æ÷
-				if(pAE->reason == acd::CallEventReasonT::CerIdleSelfLogin || pAE->reason == acd::CallEventReasonT::CerIdleOtherLogin)
-				{
-					SetTimer(TIMER_STATUS, TIMESPAN_STATUS, NULL);
-					m_thrd_heartbeat=bgcc::SharedPointer<bgcc::Thread>(new bgcc::Thread(bgcc::SharedPointer<HeartBeatTask>(new HeartBeatTask(this))));
-					if(m_thrd_heartbeat.is_valid()){
-						m_thrd_heartbeat->start();
-					}
-					m_lastStatusTime = CTime::GetCurrentTime();
-					// ³õÊ¼»¯ÐÝÏ¢Ô­Òò
-					m_cmbRest.ResetContent();
-					acd::StringListT reasons;
-					if(BGetRestReason(reasons) == AGENTBARERROR_SUCCESS)
-					{
-						for(acd::StringListT::iterator it = reasons.begin(); it != reasons.end(); it++)
-						{
-							m_cmbRest.AddString((*it).c_str());
-						}
-						if(m_cmbRest.GetCount() > 0)
-							m_cmbRest.SetCurSel(0);
-					}
-				}
-				else if(pAE->reason == acd::CallEventReasonT::CerIdleNormalSelfHangup 
-					|| pAE->reason == acd::CallEventReasonT::CerIdleNormalOtherHangup
-					|| pAE->reason == acd::CallEventReasonT::CerIdleErrorOtherHangup
-					|| pAE->reason == acd::CallEventReasonT::CerIdleErrorSelfHangup )
-				{
-					KillTimer(TIMER_TALK);
-				}
-				m_intIsSignIn = TRUE;
-				// ÊÂ¼þ»Øµ÷
-				p_m_BarCtrl->OnBusy(pAE->eventId.get_value(), pAE->callId.c_str(), pAE->sessionId, pAE->partyNum, pAE->otherParty.c_str(), pAE->otherAttr.get_value(), 
-					pAE->originatingParty.c_str(), pAE->originalAni.c_str(), pAE->originalDnis.c_str(), pAE->reason.get_value(), pAE->timestamp);
-				break;
-			}
-		case acd::AgentStatusT::AsRestState:
-			{
-				m_btnStatus.btnReady = true;
-				m_btnStatus.btnBusy = true;
-				m_stcAgentState.SetStaticexText("ÐÝÏ¢");
-				// ÊÂ¼þ»Øµ÷
-				p_m_BarCtrl->OnRest(pAE->eventId.get_value(), pAE->callId.c_str(), pAE->sessionId, pAE->partyNum, pAE->otherParty.c_str(), pAE->otherAttr.get_value(), 
-					pAE->originatingParty.c_str(), pAE->originalAni.c_str(), pAE->originalDnis.c_str(), pAE->reason.get_value(), pAE->timestamp);
-				break;
-			}
-		case acd::AgentStatusT::AsLockState:
-			{
-				m_stcAgentState.SetStaticexText("Ô¤Õ¼");
-				// ÊÂ¼þ»Øµ÷
-				p_m_BarCtrl->OnLock(pAE->eventId.get_value(), pAE->callId.c_str(), pAE->sessionId, pAE->partyNum, pAE->otherParty.c_str(), pAE->otherAttr.get_value(), 
-					pAE->originatingParty.c_str(), pAE->originalAni.c_str(), pAE->originalDnis.c_str(), pAE->reason.get_value(), pAE->timestamp);
-				break;
-			}
-		case acd::AgentStatusT::AsAlertingState:
-			{
-				// Ô­Ê¼Ö÷±»½Ð
-				m_callingNo = pAE->otherParty.c_str();
-				m_orgCallingNo = pAE->originalAni.c_str();
-				m_calledNo = pAE->agentDn.c_str();
-				m_orgCalledNo = pAE->originalDnis.c_str();
-				//
-				if(m_intIsSIPPhone)		// xiangmao
-				{
-					m_btnStatus.btnAnswer = true;
-					if(m_intAutoAnswer)
-						BAnswer();
-				}
-				m_stcAgentState.SetStaticexText("ÕñÁå");
-				// ÊÂ¼þ»Øµ÷
-				p_m_BarCtrl->OnAlerting(pAE->eventId.get_value(), pAE->callId.c_str(), pAE->sessionId, pAE->partyNum, pAE->otherParty.c_str(), pAE->otherAttr.get_value(), 
-					pAE->originatingParty.c_str(), pAE->originalAni.c_str(), pAE->originalDnis.c_str(), pAE->reason.get_value(), pAE->timestamp);
-				break;
-			}
-		case acd::AgentStatusT::AsHalfAlertingState:
-			{
-				if(m_intIsSIPPhone)		// xiangmao
-				{
-					m_btnStatus.btnAnswer = true;
-					if(m_intAutoAnswer)
-						BAnswer();
-				}
-				m_stcAgentState.SetStaticexText("°ëÕñÁå");
-				// ÊÂ¼þ»Øµ÷
-				p_m_BarCtrl->OnHarfAlerting(pAE->eventId.get_value(), pAE->callId.c_str(), pAE->sessionId, pAE->partyNum, pAE->otherParty.c_str(), pAE->otherAttr.get_value(), 
-					pAE->originatingParty.c_str(), pAE->originalAni.c_str(), pAE->originalDnis.c_str(), pAE->reason.get_value(), pAE->timestamp);
-				break;
-			}
-		case acd::AgentStatusT::AsConnectingState:
-			{
-				// Ô­Ê¼Ö÷±»½Ð
-				m_callingNo = pAE->agentDn.c_str();
-				m_orgCallingNo = pAE->originalAni.c_str();
-				m_calledNo = pAE->otherParty.c_str();
-				m_orgCalledNo = pAE->originalDnis.c_str();
-				//
-				m_btnStatus.btnHangup = true;
-				m_stcAgentState.SetStaticexText("ºô³öÖÐ");
-				// ÊÂ¼þ»Øµ÷
-				p_m_BarCtrl->OnConnecting(pAE->eventId.get_value(), pAE->callId.c_str(), pAE->sessionId, pAE->partyNum, pAE->otherParty.c_str(), pAE->otherAttr.get_value(), 
-					pAE->originatingParty.c_str(), pAE->originalAni.c_str(), pAE->originalDnis.c_str(), pAE->reason.get_value(), pAE->timestamp);
-				break;
-			}
-		case acd::AgentStatusT::AsConnectedState:
-			{
-				// Ô­Ê¼Ö÷±»½Ð
-				m_btnStatus.btnSenddtmf = true;
-				m_btnStatus.btnHangup = true;
-				m_btnStatus.btnHold = true;
-				m_btnStatus.btnConsult = true;
-				m_btnStatus.btnSSTransfer = true;
-				m_stcAgentState.SetStaticexText("Í¨»°");
-				// ¿ªÊ¼Í¨»°¶¨Ê±Æ÷
-				if(pAE->reason == acd::CallEventReasonT::CerTalkSelfCreat || pAE->reason == acd::CallEventReasonT::CerTalkOtherCreat)
-				{
-					SetTimer(TIMER_TALK, TIMESPAN_TALK, NULL);
-					m_beginTalkTime = CTime::GetCurrentTime();
-					m_lastTalkTime = m_beginTalkTime;
-				}
-				// ÊÂ¼þ»Øµ÷
-				p_m_BarCtrl->OnConnected(pAE->eventId.get_value(), pAE->callId.c_str(), pAE->sessionId, pAE->partyNum, pAE->otherParty.c_str(), pAE->otherAttr.get_value(), 
-					pAE->originatingParty.c_str(), pAE->originalAni.c_str(), pAE->originalDnis.c_str(), pAE->reason.get_value(), pAE->timestamp);
-				break;
-			}
-		case acd::AgentStatusT::AsHalfConnectedState:
-			{
-				m_stcAgentState.SetStaticexText("°ëÍ¨»°");
-				// ÊÂ¼þ»Øµ÷
-				p_m_BarCtrl->OnHarfConnected(pAE->eventId.get_value(), pAE->callId.c_str(), pAE->sessionId, pAE->partyNum, pAE->otherParty.c_str(), pAE->otherAttr.get_value(), 
-					pAE->originatingParty.c_str(), pAE->originalAni.c_str(), pAE->originalDnis.c_str(), pAE->reason.get_value(), pAE->timestamp);
-				break;
-			}
-		case acd::AgentStatusT::AsInternalConnectedState:
-			{
-				m_btnStatus.btnHangup = true;
-				m_stcAgentState.SetStaticexText("ÄÚ²¿Í¨»°");
-				// ¿ªÊ¼Í¨»°¶¨Ê±Æ÷
-				if(pAE->reason == acd::CallEventReasonT::CerTalkSelfCreat || pAE->reason == acd::CallEventReasonT::CerTalkOtherCreat)
-				{
-					SetTimer(TIMER_TALK, TIMESPAN_TALK, NULL);
-					m_beginTalkTime = CTime::GetCurrentTime();
-					m_lastTalkTime = m_beginTalkTime;
-				}
-				// ÊÂ¼þ»Øµ÷
-				p_m_BarCtrl->OnInternalConnected(pAE->eventId.get_value(), pAE->callId.c_str(), pAE->sessionId, pAE->partyNum, pAE->otherParty.c_str(), pAE->otherAttr.get_value(), 
-					pAE->originatingParty.c_str(), pAE->originalAni.c_str(), pAE->originalDnis.c_str(), pAE->reason.get_value(), pAE->timestamp);
-				break;
-			}
-		case acd::AgentStatusT::AsSuspendedState:
-			{
-				m_btnStatus.btnRetrieve = true;
-				m_stcAgentState.SetStaticexText("±£³Ö");
-				// ÊÂ¼þ»Øµ÷
-				p_m_BarCtrl->OnSuspended(pAE->eventId.get_value(), pAE->callId.c_str(), pAE->sessionId, pAE->partyNum, pAE->otherParty.c_str(), pAE->otherAttr.get_value(), 
-					pAE->originatingParty.c_str(), pAE->originalAni.c_str(), pAE->originalDnis.c_str(), pAE->reason.get_value(), pAE->timestamp);
-				break;
-			}
-		case acd::AgentStatusT::AsConsultConnectingState:
-			{
-				m_btnStatus.btnReconnect = true;
-				m_stcAgentState.SetStaticexText("×ÉÑ¯");
-				// ÊÂ¼þ»Øµ÷
-				p_m_BarCtrl->OnConsultConnecting(pAE->eventId.get_value(), pAE->callId.c_str(), pAE->sessionId, pAE->partyNum, pAE->otherParty.c_str(), pAE->otherAttr.get_value(), 
-					pAE->originatingParty.c_str(), pAE->originalAni.c_str(), pAE->originalDnis.c_str(), pAE->reason.get_value(), pAE->timestamp);
-				break;
-			}
-		case acd::AgentStatusT::AsConsultConnectedState:
-			{
-				m_btnStatus.btnReconnect = true;
-				m_btnStatus.btnTransfer = true;
-				m_btnStatus.btnConference = true;
-				m_stcAgentState.SetStaticexText("×ÉÑ¯Í¨»°");
-				// ÊÂ¼þ»Øµ÷
-				p_m_BarCtrl->OnConsultConnected(pAE->eventId.get_value(), pAE->callId.c_str(), pAE->sessionId, pAE->partyNum, pAE->otherParty.c_str(), pAE->otherAttr.get_value(), 
-					pAE->originatingParty.c_str(), pAE->originalAni.c_str(), pAE->originalDnis.c_str(), pAE->reason.get_value(), pAE->timestamp);
-				break;
-			}
-		case acd::AgentStatusT::AsConferenceState:
-			{
-				m_btnStatus.btnHangup = true;
-				m_stcAgentState.SetStaticexText("»áÒé");
-				// ÊÂ¼þ»Øµ÷
-				p_m_BarCtrl->OnConference(pAE->eventId.get_value(), pAE->callId.c_str(), pAE->sessionId, pAE->partyNum, pAE->otherParty.c_str(), pAE->otherAttr.get_value(), 
-					pAE->originatingParty.c_str(), pAE->originalAni.c_str(), pAE->originalDnis.c_str(), pAE->reason.get_value(), pAE->timestamp);
-				break;
-			}
-		case acd::AgentStatusT::AsMonitorState:
-			{
-				// Ô­Ê¼Ö÷±»½Ð
-				m_callingNo = pAE->agentDn.c_str();
-				m_orgCallingNo = pAE->originalAni.c_str();
-				m_calledNo = pAE->otherParty.c_str();
-				m_orgCalledNo = pAE->originalDnis.c_str();
-				//
-				m_btnStatus.btnHangup = true;
-				m_stcAgentState.SetStaticexText("¼àÌý");
-				// Æô¶¯Í¨»°¶¨Ê±Æ÷
-				SetTimer(TIMER_TALK, TIMESPAN_TALK, NULL);
-				m_beginTalkTime = CTime::GetCurrentTime();
-				m_lastTalkTime = m_beginTalkTime;
-				// ÊÂ¼þ»Øµ÷
-				p_m_BarCtrl->OnMonitor(pAE->eventId.get_value(), pAE->callId.c_str(), pAE->sessionId, pAE->partyNum, pAE->otherParty.c_str(), pAE->otherAttr.get_value(), 
-					pAE->originatingParty.c_str(), pAE->originalAni.c_str(), pAE->originalDnis.c_str(), pAE->reason.get_value(), pAE->timestamp);
-				break;
-			}
-		case acd::AgentStatusT::AsInsertState:
-			{
-				// Ô­Ê¼Ö÷±»½Ð
-				m_callingNo = pAE->agentDn.c_str();
-				m_orgCallingNo = pAE->originalAni.c_str();
-				m_calledNo = pAE->otherParty.c_str();
-				m_orgCalledNo = pAE->originalDnis.c_str();
-				//
-				m_btnStatus.btnHangup = true;
-				m_stcAgentState.SetStaticexText("Ç¿²å");
-				// Æô¶¯Í¨»°¶¨Ê±Æ÷
-				SetTimer(TIMER_TALK, TIMESPAN_TALK, NULL);
-				m_beginTalkTime = CTime::GetCurrentTime();
-				m_lastTalkTime = m_beginTalkTime;
-				// ÊÂ¼þ»Øµ÷
-				p_m_BarCtrl->OnInsert(pAE->eventId.get_value(), pAE->callId.c_str(), pAE->sessionId, pAE->partyNum, pAE->otherParty.c_str(), pAE->otherAttr.get_value(), 
-					pAE->originatingParty.c_str(), pAE->originalAni.c_str(), pAE->originalDnis.c_str(), pAE->reason.get_value(), pAE->timestamp);
-				break;
-			}
-		case acd::AgentStatusT::AsMonitoredState:
-			{
-				m_btnStatus.btnHangup = true;
-				m_stcAgentState.SetStaticexText("±»¼àÌý");
-				// ÊÂ¼þ»Øµ÷
-				p_m_BarCtrl->OnMonitored(pAE->eventId.get_value(), pAE->callId.c_str(), pAE->sessionId, pAE->partyNum, pAE->otherParty.c_str(), pAE->otherAttr.get_value(), 
-					pAE->originatingParty.c_str(), pAE->originalAni.c_str(), pAE->originalDnis.c_str(), pAE->reason.get_value(), pAE->timestamp);
-				break;
-			}
-		case acd::AgentStatusT::AsInsertedState:
-			{
-				m_btnStatus.btnHangup = true;
-				m_stcAgentState.SetStaticexText("±»Ç¿²å");
-				// ÊÂ¼þ»Øµ÷
-				p_m_BarCtrl->OnInserted(pAE->eventId.get_value(), pAE->callId.c_str(), pAE->sessionId, pAE->partyNum, pAE->otherParty.c_str(), pAE->otherAttr.get_value(), 
-					pAE->originatingParty.c_str(), pAE->originalAni.c_str(), pAE->originalDnis.c_str(), pAE->reason.get_value(), pAE->timestamp);
-				break;
-			}
-		default:
-			{
-				m_stcAgentState.SetStaticexText("´íÎó×´Ì¬");
-				break;
-			}
-		}
-	}
-	catch(...)
-	{
-		Tool::m_Logger.WriteLog("CCCBar", "OnAgentEvent", "catch Error", AGENTBARERROR_BAR_OUTEVENTERROR);
-	}
-
-	SetButton();
-	m_stcAgentState.Invalidate();
-    p_m_BarCtrl->OnBtnStatus(m_btnStatus.StatusAsLonglong(), m_stcAgentState.GetStaticexText());  // Í¨Öª×´Ì¬¸Ä±ä
-
-	m_lastBtnStatus = m_btnStatus;
-
-	delete pAE;
-	return 0;
-}
-
-LRESULT CCCBar::OnMediaEvent(WPARAM wParam, LPARAM lParam)
-{
-	LONGLONG address = MAKELONGLONG(wParam, lParam);
-	acd::MediaEventT *pME = reinterpret_cast<acd::MediaEventT *>(address);
-	Tool::WriteMediaEventLog(pME, "out");
-
-	try
-	{
-		switch(pME->eventType.get_value())
-		{
-		case acd::MediaEventTypeT::MeUnKownEvent:
-			break;
-		case acd::MediaEventTypeT::MeTpRecordStarted:
-			p_m_BarCtrl->OnBeginRecord(pME->callId.c_str(), pME->sessionId, pME->buffer.c_str(), pME->reason.get_value(), pME->timestamp);
-			break;
-		case acd::MediaEventTypeT::MeTpRecordDone:
-			p_m_BarCtrl->OnEndRecord(pME->callId.c_str(), pME->sessionId, pME->buffer.c_str(), pME->reason.get_value(), pME->timestamp);
-			break;
-		default:
-			break;
-		}
-	}
-	catch(...)
-	{
-		Tool::m_Logger.WriteLog("CCCBar", "OnMediaEvent", "catch Error", AGENTBARERROR_BAR_OUTEVENTERROR);
-	}
-
-	delete pME;
-	return 0;
-}
-
-LRESULT CCCBar::OnRouteEvent(WPARAM wParam, LPARAM lParam)
-{
-	LONGLONG address = MAKELONGLONG(wParam, lParam);
-	acd::RouteEventT *pQE = reinterpret_cast<acd::RouteEventT *>(address);
-	Tool::WriteRouteEventLog(pQE, "out");
-
-	try
-	{
-		switch(pQE->eventType.get_value())
-		{
-		case acd::RouteEventTypeT::ReInQueue:
-			p_m_BarCtrl->OnInprivatequeue(pQE->callId.c_str(), pQE->sessionId, pQE->requestId, pQE->originalAni.c_str(), pQE->originalDnis.c_str(), 0, pQE->timestamp);
-			break;
-		case acd::RouteEventTypeT::ReOutQueue:
-			p_m_BarCtrl->OnOutprivatequeue(pQE->callId.c_str(), pQE->sessionId, pQE->requestId, pQE->originalAni.c_str(), pQE->originalDnis.c_str(), 0, pQE->timestamp);
-			break;
-		default:
-			break;
-		}
-	}
-	catch(...)
-	{
-		Tool::m_Logger.WriteLog("CCCBar", "OnRouteEvent", "catch Error", AGENTBARERROR_BAR_OUTEVENTERROR);
-	}
-
-	delete pQE;
-	return 0;
-}
-
-LRESULT CCCBar::OnOtherEvent(WPARAM wParam, LPARAM lParam)
-{
-	LONGLONG address = MAKELONGLONG(wParam, lParam);
-	acd::OtherEventT *pOE = reinterpret_cast<acd::OtherEventT *>(address);
-	Tool::WriteOtherEventLog(pOE, "out");
-
-	try
-	{
-		switch(pOE->eventType.get_value())
-		{
-		case acd::OtherEventTypeT::IMSDisconnect:
-			{
-				Tool::m_Logger.WriteLog("CCCBar", "OnOtherEvent", "IMS Disconnect", EVENTREASON_IMS_DISCONNECT);
-				p_m_BarCtrl->OnCTIDisconnect(pOE->callId.c_str(), pOE->sessionId, pOE->originalAni.c_str(), pOE->originalDnis.c_str(), EVENTREASON_IMS_DISCONNECT, pOE->timestamp);
-				break;
-			}
-		case acd::OtherEventTypeT::IMSMasterChange:
-			{
-				CInfo info;
-				info.SetInfo(IDI_ICON_INFOMATION, "IMSÖ÷±¸µ¹»»Íê³É£¡");
-				info.DoModal();
-				Tool::m_Logger.WriteLog("CCCBar", "OnOtherEvent", "IMS MasterChange", EVENTREASON_IMS_MASTERCHANGE);
-				p_m_BarCtrl->OnCTIMasterChanged(pOE->callId.c_str(), pOE->sessionId, pOE->originalAni.c_str(), pOE->originalDnis.c_str(), EVENTREASON_IMS_MASTERCHANGE, pOE->timestamp);
-				break;
-			}
-		case acd::OtherEventTypeT::IMSOperationFailed:
-			{
-				CInfo info;
-				info.SetInfo(IDI_ICON_INFOMATION, "±¾·½Î´Ó¦´ð£¡");
-				info.DoModal();
-				Tool::m_Logger.WriteLog("CCCBar", "OnOtherEvent", "IMS OperationFailed", EVENTREASON_IMS_OPERATIONFAILED);
-				p_m_BarCtrl->OnOperationFailed(pOE->callId.c_str(), pOE->sessionId, pOE->originalAni.c_str(), pOE->originalDnis.c_str(), EVENTREASON_IMS_OPERATIONFAILED, pOE->timestamp);
-				break;
-			}
-		case acd::OtherEventTypeT::ACDDisconnect:
-			{
-				Tool::m_Logger.WriteLog("CCCBar", "OnOtherEvent", "ACD Disconnect", EVENTREASON_ACD_DISCONNECT);
-				p_m_BarCtrl->OnCTIDisconnect(pOE->callId.c_str(), pOE->sessionId, pOE->originalAni.c_str(), pOE->originalDnis.c_str(), EVENTREASON_ACD_DISCONNECT, pOE->timestamp);
-				break;
-			}
-		case acd::OtherEventTypeT::ACDMasterChange:
-			{
-				CInfo info;
-				info.SetInfo(IDI_ICON_INFOMATION, "ACDÖ÷±¸µ¹»»Íê³É£¡");
-				info.DoModal();
-				Tool::m_Logger.WriteLog("CCCBar", "OnOtherEvent", "ACD MasterChange", EVENTREASON_ACD_MASTERCHANGE);
-				p_m_BarCtrl->OnCTIMasterChanged(pOE->callId.c_str(), pOE->sessionId, pOE->originalAni.c_str(), pOE->originalDnis.c_str(), EVENTREASON_ACD_MASTERCHANGE, pOE->timestamp);
-				break;
-			}
-		case acd::OtherEventTypeT::ACDOperationFailed:
-			{
-				CInfo info;
-				info.SetInfo(IDI_ICON_INFOMATION, "ÍøÂç»òÕßACD·þÎñÒì³££¡");
-				info.DoModal();
-				Tool::m_Logger.WriteLog("CCCBar", "OnOtherEvent", "ACD OperationFailed", EVENTREASON_ACD_OPERATIONFAILED);
-				p_m_BarCtrl->OnOperationFailed(pOE->callId.c_str(), pOE->sessionId, pOE->originalAni.c_str(), pOE->originalDnis.c_str(), EVENTREASON_ACD_OPERATIONFAILED, pOE->timestamp);
-				break;
-			}
-		case acd::OtherEventTypeT::ACDReLoginSuccess:
-			{
-				CInfo info;
-				info.SetInfo(IDI_ICON_INFOMATION, "ACDÖØÇ©³É¹¦£¡");
-				info.DoModal();
-				Tool::m_Logger.WriteLog("CCCBar", "OnOtherEvent", "ACD ReLoginSuccess", EVENTREASON_ACD_RELOGINSUCCESS);
-				p_m_BarCtrl->OnCTIMasterChanged(pOE->callId.c_str(), pOE->sessionId, pOE->originalAni.c_str(), pOE->originalDnis.c_str(), EVENTREASON_ACD_RELOGINSUCCESS, pOE->timestamp);
-				break;
-			}
-		case acd::OtherEventTypeT::ACDReLoginFailed:
-			{
-				CInfo info;
-				info.SetInfo(IDI_ICON_INFOMATION, "ACDÖØÇ©Ê§°Ü£¡");
-				info.DoModal();
-				Tool::m_Logger.WriteLog("CCCBar", "OnOtherEvent", "ACD ReLoginFailed", EVENTREASON_ACD_RELOGINFAILED);
-				p_m_BarCtrl->OnOperationFailed(pOE->callId.c_str(), pOE->sessionId, pOE->originalAni.c_str(), pOE->originalDnis.c_str(), EVENTREASON_ACD_RELOGINFAILED, pOE->timestamp);
-				break;
-			}
-		default:
-			break;
-		}
-	}
-	catch(...)
-	{
-		Tool::m_Logger.WriteLog("CCCBar", "OnOtherEvent", "catch Error", AGENTBARERROR_BAR_OUTEVENTERROR);
-	}
-
-	delete pOE;
-	return 0;
-}
-
-LONG CCCBar::BInitial()
-{
-	Tool::m_Logger.SetLogLevel(m_intLogLevel);
-
-	LONG ret = AGENTBARERROR_SUCCESS;
-	if(m_AgentStatus != acd::AgentStatusT::AsUnknownState)
-	{
-		ret = AGENTBARERROR_BAR_WRONGSTATE;
-		Tool::m_Logger.WriteLog("CCCBar", "BInitial", "Status Error", ret);
-	}
-	else
-	{
-		if(m_intIsSIPPhone)
-		{
-			ret = m_sip.SipInitial();
-			if(ret != AGENTBARERROR_SUCCESS)
-				return ret;
-		}
-
-		ret = m_acd.AcdInitial(m_strMainCTIIP, m_strBackCTIIP, m_intCTIPort);
-		if(ret == AGENTBARERROR_SUCCESS)
-		{
-			m_btnStatus.btnLogin = true;
-			SetButton();
-
-			m_AgentStatus = acd::AgentStatusT::AsUnLoginState;
-			m_intIsInitial = TRUE;
-
-			m_lastBtnStatus = m_btnStatus;
-		}
-	}
-	return ret;
-}
-
-LONG CCCBar::BUnInitial()
-{
-	LONG ret = AGENTBARERROR_SUCCESS;
-	if(m_AgentStatus != acd::AgentStatusT::AsUnLoginState)
-	{
-		ret = AGENTBARERROR_BAR_WRONGSTATE;
-		Tool::m_Logger.WriteLog("CCCBar", "BUnInitial", "Status Error", ret);
-	}
-	else
-	{
-		ret = m_acd.AcdUnInitial();
-		if(ret == AGENTBARERROR_SUCCESS)
-		{
-			m_btnStatus.Reset();
-			SetButton();
-
-			m_AgentStatus = acd::AgentStatusT::AsUnknownState;
-			m_intIsInitial = FALSE;
-
-			m_lastBtnStatus.Reset();
-		}
-		else
-		{
-			return ret;
-		}
-
-		if(m_intIsSIPPhone)
-		{
-			ret = m_sip.SipUnInitial();
-		}
-	}
-	return ret;
-}
-
-LONG CCCBar::BSignIn()
-{
-	LONG ret = AGENTBARERROR_SUCCESS;
-	if(m_AgentStatus != acd::AgentStatusT::AsUnLoginState)
-	{
-		ret = AGENTBARERROR_BAR_WRONGSTATE;
-		Tool::m_Logger.WriteLog("CCCBar", "BSignIn", "Status Error", ret);
-	}
-	else
-	{
-		m_lDetaTime = 0;
-		if(m_intIsSIPPhone)
-		{
-			ret = m_sip.SipRegister(m_strSIPServerIP, m_intSIPServerPort, m_strPhoneNum, m_strPhonePwd, m_intTimeOut);
-			if(ret != AGENTBARERROR_SUCCESS)
-				return ret;
-		}
-
-		// ³¢ÊÔÖ÷
-		ret = m_acd.AcdSignIn(m_strAgentID, m_strDN, m_strPassWord, m_intStatusChangeType, !!m_intAutoAnswer, !!m_intForceSignIn, m_strServiceList);
-		if(ret == AGENTBARERROR_BGCC_EXCEPTION || ret == acd::AcdResultT::ArNotMaster)// Ö÷¹ÊÕÏ
-		{
-			// ³¢ÊÔ±¸
-			m_acd.AcdBackup();
-			ret = m_acd.AcdSignIn(m_strAgentID, m_strDN, m_strPassWord, m_intStatusChangeType, !!m_intAutoAnswer, !!m_intForceSignIn, m_strServiceList);
-		}
-		
-		if(AGENTBARERROR_SUCCESS == ret)
-		{
-			LONGLONG timestamp = 0;
-			DWORD start_call = GetTickCount();
-			ret = m_acd.AcdSynchronizeCTITime(m_strAgentID, timestamp);
-			DWORD end_call = GetTickCount();
-			if(AGENTBARERROR_SUCCESS == ret)
-			{
-				m_lDetaTime = timestamp - static_cast<LONGLONG>(start_call) * 1000 - (static_cast<LONGLONG>(end_call) - static_cast<LONGLONG>(start_call)) * 1000 / 2;
-			}
-			Tool::m_Logger.WriteLog(Level_High, "[CCCBar-BSignIn] [out] datetime:%I64d", m_lDetaTime);
-		}
-	}
-	return ret;
-}
-
-LONG CCCBar::BSignOut()
-{
-	LONG ret = AGENTBARERROR_SUCCESS;
-	if(m_AgentStatus != acd::AgentStatusT::AsReadyState && m_AgentStatus != acd::AgentStatusT::AsBusyState)
-	{
-		ret = AGENTBARERROR_BAR_WRONGSTATE;
-		Tool::m_Logger.WriteLog("CCCBar", "BSignOut", "Status Error", ret);
-	}
-	else
-	{
-		ret = m_acd.AcdSignOut(m_strAgentID);
-		if(ret != AGENTBARERROR_SUCCESS)
-		{
-			return ret;
-		}
-
-		if(m_intIsSIPPhone)
-		{
-			ret = m_sip.SipUnRegister();
-		}
-	}
-	return ret;
-}
-
-LONG CCCBar::BSetIdle()
-{
-	LONG ret = AGENTBARERROR_SUCCESS;
-	if(m_AgentStatus != acd::AgentStatusT::AsBusyState && m_AgentStatus != acd::AgentStatusT::AsRestState)
-	{
-		ret = AGENTBARERROR_BAR_WRONGSTATE;
-		Tool::m_Logger.WriteLog("CCCBar", "BSetIdle", "Status Error", ret);
-	}
-	else
-	{
-		ret = m_acd.AcdSetAgentStatus(m_strAgentID, acd::AgentStatusT::AsReadyState);
-	}
-	return ret;
-}
-
-LONG CCCBar::BSetBusy()
-{
-	LONG ret = AGENTBARERROR_SUCCESS;
-	if(m_AgentStatus != acd::AgentStatusT::AsReadyState && m_AgentStatus != acd::AgentStatusT::AsRestState)
-	{
-		ret = AGENTBARERROR_BAR_WRONGSTATE;
-		Tool::m_Logger.WriteLog("CCCBar", "BSetBusy", "Status Error", ret);
-	}
-	else
-	{
-		ret = m_acd.AcdSetAgentStatus(m_strAgentID, acd::AgentStatusT::AsBusyState);
-	}
-	return ret;
-}
-
-LONG CCCBar::BSetRest(const char *reason)
-{
-	LONG ret = AGENTBARERROR_SUCCESS;
-	if(m_AgentStatus != acd::AgentStatusT::AsReadyState && m_AgentStatus != acd::AgentStatusT::AsBusyState)
-	{
-		ret = AGENTBARERROR_BAR_WRONGSTATE;
-		Tool::m_Logger.WriteLog("CCCBar", "BSetRest", "Status Error", ret);
-	}
-	else
-	{
-		ret = m_acd.AcdSetAgentStatus(m_strAgentID, acd::AgentStatusT::AsRestState, reason);
-	}
-	return ret;
-}
-
-LONG CCCBar::BGetAgentStatus(acd::AgentStatusT &agentStatus)
-{
-	LONG ret = AGENTBARERROR_SUCCESS;
-	if(m_AgentStatus == acd::AgentStatusT::AsUnknownState || m_AgentStatus == acd::AgentStatusT::AsUnLoginState)
-	{
-		ret = AGENTBARERROR_BAR_WRONGSTATE;
-		Tool::m_Logger.WriteLog("CCCBar", "BGetAgentStatus", "Status Error", ret);
-	}
-	else
-	{
-		agentStatus = m_AgentStatus;
-	}
-	return ret;
-}
-
-LONG CCCBar::BResetSkill(const char *skillList)
-{
-	LONG ret = AGENTBARERROR_SUCCESS;
-	if(m_AgentStatus != acd::AgentStatusT::AsReadyState && m_AgentStatus != acd::AgentStatusT::AsBusyState)
-	{
-		ret = AGENTBARERROR_BAR_WRONGSTATE;
-		Tool::m_Logger.WriteLog("CCCBar", "BResetSkill", "Status Error", ret);
-	}
-	else
-	{
-		ret = m_acd.AcdResetSkill(m_strAgentID, skillList);
-	}
-	return ret;
-}
-
-LONG CCCBar::BReset()
-{
-	LONG ret = AGENTBARERROR_SUCCESS;
-	if(m_AgentStatus == acd::AgentStatusT::AsUnknownState || m_AgentStatus == acd::AgentStatusT::AsUnLoginState)
-	{
-		ret = AGENTBARERROR_BAR_WRONGSTATE;
-		Tool::m_Logger.WriteLog("CCCBar", "BReset", "Status Error", ret);
-	}
-	else
-	{
-		// ¹Ò¶Ï¡¢Ç©³ö
-		ret = m_acd.AcdReset(m_strAgentID);
-		if(ret == AGENTBARERROR_SUCCESS)
-		{
-			// Ç©³ö×øÏ¯
-			PostMessageEx(acd::AgentStatusT::AsUnLoginState, acd::CallEventReasonT::CerUnloginSelfForceout);
-		}
-		else
-		{
-			return ret;
-		}
-
-		if(m_intIsSIPPhone)
-		{
-			ret = m_sip.SipUnRegister();
-		}
-	}
-	return ret;
-}
-
-LONG CCCBar::BMakeCall(const char *dest, const char *showANI, const char *showDest, acd::CallModeT callMode, acd::CallTypeT callType)
-{
-	LONG ret = AGENTBARERROR_SUCCESS;
-	if(m_AgentStatus != acd::AgentStatusT::AsBusyState)
-	{
-		ret = AGENTBARERROR_BAR_WRONGSTATE;
-		Tool::m_Logger.WriteLog("CCCBar", "BMakeCall", "Status Error", ret);
-	}
-	else
-	{
-		CString callerId;
-		switch(callType.get_value())
-		{
-		case acd::CallTypeT::CtAgent:
-			callerId = m_strAgentTag + m_strDN;
-			break;
-		case acd::CallTypeT::CtOut:
-			callerId = m_strDN;
-			break;
-		default:
-			callerId = m_strDN;
-			break;
-		}
-		ret = m_acd.AcdOutboundCall(m_strAgentID, callerId, dest, showANI, showDest, m_intTimeOut, callMode, callType);
-	}
-	return ret;
-}
-
-LONG CCCBar::BAnswer()
-{
-	LONG ret = AGENTBARERROR_SUCCESS;
-	if(m_AgentStatus != acd::AgentStatusT::AsAlertingState && m_AgentStatus != acd::AgentStatusT::AsHalfAlertingState)
-	{
-		ret = AGENTBARERROR_BAR_WRONGSTATE;
-		Tool::m_Logger.WriteLog("CCCBar", "BAnswer", "Status Error", ret);
-	}
-	else
-	{
-		if(m_intIsSIPPhone)		// suxiangmao
-		{
-			ret = m_sip.SipAnswercall();
-		}
-		else
-		{
-			ret = AGENTBARERROR_BAR_ANSWERERROR;
-		}
-	}
-	return ret;
-}
-
-LONG CCCBar::BReleaseCall()
-{
-	LONG ret = AGENTBARERROR_SUCCESS;
-	if(m_AgentStatus == acd::AgentStatusT::AsUnknownState || m_AgentStatus == acd::AgentStatusT::AsUnLoginState)
-	{
-		ret = AGENTBARERROR_BAR_WRONGSTATE;
-		Tool::m_Logger.WriteLog("CCCBar", "BReleaseCall", "Status Error", ret);
-	}
-	else
-	{
-		ret = m_acd.AcdReleaseCall(m_strAgentID);
-	}
-	return ret;
-}
-
-LONG CCCBar::BHold()
-{
-	LONG ret = AGENTBARERROR_SUCCESS;
-	if(m_AgentStatus != acd::AgentStatusT::AsConnectedState)
-	{
-		ret = AGENTBARERROR_BAR_WRONGSTATE;
-		Tool::m_Logger.WriteLog("CCCBar", "BHold", "Status Error", ret);
-	}
-	else
-	{
-		ret = m_acd.AcdHold(m_strAgentID);
-	}
-	return ret;
-}
-
-LONG CCCBar::BRetrieve()
-{
-	LONG ret = AGENTBARERROR_SUCCESS;
-	if(m_AgentStatus != acd::AgentStatusT::AsSuspendedState)
-	{
-		ret = AGENTBARERROR_BAR_WRONGSTATE;
-		Tool::m_Logger.WriteLog("CCCBar", "BRetrieve", "Status Error", ret);
-	}
-	else
-	{
-		ret = m_acd.AcdRetrieve(m_strAgentID);
-	}	
-	return ret;
-}
-
-LONG CCCBar::BConsult(const char *consultNum, const char *showANI, const char *showDest, acd::CallTypeT callType)
-{
-	LONG ret = AGENTBARERROR_SUCCESS;
-	if(m_AgentStatus != acd::AgentStatusT::AsConnectedState)
-	{
-		ret = AGENTBARERROR_BAR_WRONGSTATE;
-		Tool::m_Logger.WriteLog("CCCBar", "BConsult", "Status Error", ret);
-	}
-	else
-	{
-		CString callerId;
-		switch(callType.get_value())
-		{
-		case acd::CallTypeT::CtAgent:
-			callerId = m_strAgentTag + m_strDN;
-			break;
-		case acd::CallTypeT::CtOut:
-			callerId = m_strDN;
-			break;
-		default:
-			callerId = m_strDN;
-			break;
-		}
-		ret = m_acd.AcdConsult(m_strAgentID, callerId, consultNum, showANI, showDest, callType);
-	}
-	return ret;
-}
-
-LONG CCCBar::BReconnect()
-{
-	LONG ret = AGENTBARERROR_SUCCESS;
-	if(m_AgentStatus != acd::AgentStatusT::AsConsultConnectingState && m_AgentStatus != acd::AgentStatusT::AsConsultConnectedState)
-	{
-		ret = AGENTBARERROR_BAR_WRONGSTATE;
-		Tool::m_Logger.WriteLog("CCCBar", "BReconnect", "Status Error", ret);
-	}
-	else
-	{
-		ret = m_acd.AcdConsultReconnect(m_strAgentID);
-	}
-	return ret;
-}
-
-LONG CCCBar::BTransfer()
-{
-	LONG ret = AGENTBARERROR_SUCCESS;
-	if(m_AgentStatus != acd::AgentStatusT::AsConsultConnectedState)
-	{
-		ret = AGENTBARERROR_BAR_WRONGSTATE;
-		Tool::m_Logger.WriteLog("CCCBar", "BTransfer", "Status Error", ret);
-	}
-	else
-	{
-		ret = m_acd.AcdConsultTransfer(m_strAgentID);
-	}
-	return ret;
-}
-
-LONG CCCBar::BSingleStepTransfer(const char *transferNum, const char *showANI, const char *showDest, BOOL transferStyle, acd::CallTypeT callType)
-{
-	LONG ret = AGENTBARERROR_SUCCESS;
-	if(m_AgentStatus != acd::AgentStatusT::AsConnectedState)
-	{
-		ret = AGENTBARERROR_BAR_WRONGSTATE;
-		Tool::m_Logger.WriteLog("CCCBar", "BSingleStepTransfer", "Status Error", ret);
-	}
-	else
-	{
-		CString callerId;
-		switch(callType.get_value())
-		{
-		case acd::CallTypeT::CtAgent:
-			callerId = m_strAgentTag + m_strDN;
-			break;
-		case acd::CallTypeT::CtOut:
-			callerId = m_strDN;
-			break;
-		default:
-			callerId = m_strDN;
-			break;
-		}
-		ret = m_acd.AcdSingleStepTransfer(m_strAgentID, callerId, transferNum, showANI, showDest, !!transferStyle, callType);
-	}
-	return ret;
-}
-
-LONG CCCBar::BConference()
-{
-	LONG ret = AGENTBARERROR_SUCCESS;
-	if(m_AgentStatus != acd::AgentStatusT::AsConsultConnectedState)
-	{
-		ret = AGENTBARERROR_BAR_WRONGSTATE;
-		Tool::m_Logger.WriteLog("CCCBar", "BConference", "Status Error", ret);
-	}
-	else
-	{
-		ret = m_acd.AcdConsultConference(m_strAgentID);
-	}
-	return ret;
-}
-
-LONG CCCBar::BListen(const char *destAgentId, const char *forCallerDispNum, const char *forCalleeDispNum)
-{
-	LONG ret = AGENTBARERROR_SUCCESS;
-	if(m_AgentStatus != acd::AgentStatusT::AsReadyState && m_AgentStatus != acd::AgentStatusT::AsBusyState)
-	{
-		ret = AGENTBARERROR_BAR_WRONGSTATE;
-		Tool::m_Logger.WriteLog("CCCBar", "BListen", "Status Error", ret);
-	}
-	else
-	{
-		ret = m_acd.AcdListen(m_strAgentID, m_strAgentTag + m_strDN, destAgentId, forCallerDispNum, forCalleeDispNum);
-	}
-	return ret;
-}
-
-LONG CCCBar::BStopListen(const char *destAgentId)
-{
-	LONG ret = AGENTBARERROR_SUCCESS;
-	if(m_AgentStatus != acd::AgentStatusT::AsMonitorState)
-	{
-		ret = AGENTBARERROR_BAR_WRONGSTATE;
-		Tool::m_Logger.WriteLog("CCCBar", "BStopListen", "Status Error", ret);
-	}
-	else
-	{
-		ret = m_acd.AcdStopListen(m_strAgentID, destAgentId);
-	}
-	return ret;
-}
-
-LONG CCCBar::BInsert(const char *destAgentId, const char *forCallerDispNum, const char *forCalleeDispNum)
-{
-	LONG ret = AGENTBARERROR_SUCCESS;
-	if(m_AgentStatus != acd::AgentStatusT::AsReadyState && m_AgentStatus != acd::AgentStatusT::AsBusyState)
-	{
-		ret = AGENTBARERROR_BAR_WRONGSTATE;
-		Tool::m_Logger.WriteLog("CCCBar", "BInsert", "Status Error", ret);
-	}
-	else
-	{
-		ret = m_acd.AcdInsert(m_strAgentID, m_strAgentTag + m_strDN, destAgentId, forCallerDispNum, forCalleeDispNum);
-	}
-	return ret;
-}
-
-LONG CCCBar::BStopInsert(const char *destAgentId)
-{
-	LONG ret = AGENTBARERROR_SUCCESS;
-	if(m_AgentStatus != acd::AgentStatusT::AsInsertState)
-	{
-		ret = AGENTBARERROR_BAR_WRONGSTATE;
-		Tool::m_Logger.WriteLog("CCCBar", "BStopInsert", "Status Error", ret);
-	}
-	else
-	{
-		ret = m_acd.AcdStopInsert(m_strAgentID, destAgentId);
-	}
-	return ret;
-}
-
-LONG CCCBar::BSwitchInsertorListen(const char *destAgentId, const char *forCallerDispNum, const char *forCalleeDispNum)
-{
-	LONG ret = AGENTBARERROR_SUCCESS;
-	if(m_AgentStatus != acd::AgentStatusT::AsMonitorState && m_AgentStatus != acd::AgentStatusT::AsInsertState)
-	{
-		ret = AGENTBARERROR_BAR_WRONGSTATE;
-		Tool::m_Logger.WriteLog("CCCBar", "BSwitchInsertorListen", "Status Error", ret);
-	}
-	else
-	{
-		ret = m_acd.AcdSwitchInsertorListen(m_strAgentID, m_strAgentTag + m_strDN, destAgentId, forCallerDispNum, forCalleeDispNum);
-	}
-	return ret;
-}
-
-LONG CCCBar::BSendDTMF(const char *digitals)
-{
-	LONG ret = AGENTBARERROR_SUCCESS;
-	if(m_AgentStatus != acd::AgentStatusT::AsConnectedState)
-	{
-		ret = AGENTBARERROR_BAR_WRONGSTATE;
-		Tool::m_Logger.WriteLog("CCCBar", "BSendDTMF", "Status Error", ret);
-	}
-	else
-	{
-		ret = m_acd.AcdSendDTMF(m_strAgentID, digitals);
-	}
-	return ret;
-}
-
-LONG CCCBar::BGetRestReason(acd::StringListT &restReason)
-{
-	LONG ret = AGENTBARERROR_SUCCESS;
-	if(m_AgentStatus == acd::AgentStatusT::AsUnknownState || m_AgentStatus == acd::AgentStatusT::AsUnLoginState)
-	{
-		ret = AGENTBARERROR_BAR_WRONGSTATE;
-		Tool::m_Logger.WriteLog("CCCBar", "BGetRestReason", "Status Error", ret);
-	}
-	else
-	{
-		ret = m_acd.AcdGetRestReason(m_strAgentID, restReason);
-	}
-	return ret;
-}
-
-LONG CCCBar::BSynchronizeCTITime()
-{
-	LONG ret = AGENTBARERROR_SUCCESS;
-	if(m_AgentStatus == acd::AgentStatusT::AsUnknownState || m_AgentStatus == acd::AgentStatusT::AsUnLoginState)
-	{
-		ret = AGENTBARERROR_BAR_WRONGSTATE;
-		Tool::m_Logger.WriteLog("CCCBar", "BSynchronizeCTITime", "Status Error", ret);
-	}
-	else
-	{
-		LONGLONG timestamp = 0;
-		ret = m_acd.AcdSynchronizeCTITime(m_strAgentID, timestamp);
-		if(ret == AGENTBARERROR_SUCCESS)
-		{
-			// »ñÈ¡µ±Ç°Ê±¼ä
-			CTime serverTime(timestamp / 1000000);
-			CTimeSpan timeSpan = serverTime - CTime::GetCurrentTime();
-			// ÉèÖÃ±¾µØÊ±¼ä
-			SYSTEMTIME systemTime;
-			serverTime.GetAsSystemTime(systemTime);
-			SetLocalTime(&systemTime);
-			// ÖØÖÃÊ±¼ä
-			if(m_beginStatusTime.GetTime() != 0)
-				m_beginStatusTime += timeSpan;
-			if(m_beginTalkTime.GetTime() != 0)
-				m_beginTalkTime += timeSpan;
-			if(m_lastStatusTime.GetTime() != 0)
-				m_lastStatusTime += timeSpan;
-			if(m_lastTalkTime.GetTime() != 0)
-				m_lastTalkTime += timeSpan;
-		}
-	}
-	return ret;
-}
-
-LONG CCCBar::BHeartbeat()
-{
-	LONG ret = AGENTBARERROR_SUCCESS;
-	if(m_AgentStatus == acd::AgentStatusT::AsUnknownState || m_AgentStatus == acd::AgentStatusT::AsUnLoginState)
-	{
-		ret = AGENTBARERROR_BAR_WRONGSTATE;
-		Tool::m_Logger.WriteLog("CCCBar", "BHeartbeat", "Status Error", ret);
-	}
-	else
-	{
-		ret = m_acd.AcdHeartbeat(m_strAgentID);
-		if(ret == AGENTBARERROR_SUCCESS)
-		{
-			m_heartbeatCount = 0;
-            // Í¨ÖªÐÄÌø³É¹¦
-            LONGLONG timestamp = 0;
-            if(!m_lDetaTime)
-            {
-                timestamp = CTime::GetCurrentTime().GetTime() * 1000000;
-            }
-            else
-            {
-                timestamp = static_cast<LONGLONG>(GetTickCount()) * 1000 + m_lDetaTime;
-            }
-            p_m_BarCtrl->OnHeartbeat(timestamp);
-		}
-		else if(ret == acd::AcdResultT::ArNotMaster)
-		{
-			m_heartbeatCount = 0;
-			// µ¹»»
-			Backup();
-		}
-		else if(ret == acd::AcdResultT::ArNoSignin)
-		{
-			m_heartbeatCount = 0;
-			// ÖØÇ©
-			ReSignIn();
-		}
-		else
-		{
-			m_heartbeatCount++;
-		}
-		if(m_heartbeatCount == TIMES_HEARTBEAT_EXCEPTION)
-		{
-			m_heartbeatCount = 0;
-			// µ¹»»
-			Backup();
-		}
-	}
-	return ret;
-}
-
-AcdClient &CCCBar::GetAcdClient()
-{
-	return m_acd;
-}
-
-// suxiangmao
-SipphoneClient &CCCBar::GetSipphoneClient()
-{
-	return m_sip;
-}
-
-LONG CCCBar::BTransferIVR(const char *transferNum, const char *callerNum)
-{
-	LONG ret = AGENTBARERROR_SUCCESS;
-	if(m_AgentStatus != acd::AgentStatusT::AsConnectedState){
-		ret = AGENTBARERROR_BAR_WRONGSTATE;
-		Tool::m_Logger.WriteLog("CCCBar", "BTransferIVR", "Status Error", ret);
-	}
-	else{
-		ret = m_acd.AcdSingleStepTransfer(m_strAgentID, m_strCustomerTag + m_strDN, transferNum, 
-			(callerNum?callerNum:m_strActiveCallID.c_str()), (callerNum?callerNum:m_strActiveCallID.c_str()), false, acd::CallTypeT::CtOut);
-	}
-	return ret;	
-}
-
-int32_t HeartBeatTask::operator()(const bool *isstopped, void *param)
-{
-	int32_t time_count=100;
-
-	if(!m_bar){
-		return -1;
-	}
-
-	while(!(*isstopped)){
-		m_bar->BHeartbeat();
-
-		time_count=100;
-		while(!(*isstopped)&&(time_count--)){
-			bgcc::TimeUtil::safe_sleep_ms(100);
-		}
-	}
-
-	return 0;
-}
+// *****************************************************************************
+//  Name:		CCCBar£¬¿Ø¼þ½çÃæ
+//  Author:		Yanhl
+//  Version:	1.0
+// *****************************************************************************
+
+#include "CCBar.h"
+#include "CCAgentBarCtrl.h"
+#include "Info.h"
+#include "ImgMgr.h"
+// CCCBar ¶Ô»°¿ò
+
+IMPLEMENT_DYNAMIC(CCCBar, CDialog)
+CCCBar::CCCBar(CWnd* pParent) : CDialog(CCCBar::IDD, pParent), m_AgentStatus(acd::AgentStatusT::AsUnknownState), m_totalTime(0), m_heartbeatCount(0), m_lDetaTime(0), 
+	m_intStatusChangeType(acd::StatusChangeT::ScReady), m_intAutoAnswer(TRUE), m_intForceSignIn(TRUE), m_intCTIPort(10000), m_intTimeOut(3000), 
+	m_intIsInitial(FALSE), m_intIsSignIn(FALSE), m_intIsSIPPhone(FALSE), m_intSIPServerPort(5060), m_intANIChangeType(ANICHANGE_SYSTEM), 
+	m_intIsShowCallOut(TRUE), m_intIsCallOut(TRUE), m_intLogLevel(Level_High), m_intEnableSeniorCall(FALSE)
+{
+	p_m_BarCtrl = dynamic_cast<CCCAgentBarCtrl *>(pParent);
+
+	// ³õÊ¼»¯¹¤¾ß×é¼þ£¨ÈÕÖ¾µÈ£©
+	Tool::Init(AfxGetInstanceHandle());
+}
+
+CCCBar::~CCCBar()
+{
+	if(m_thrd_heartbeat.is_valid()){
+		m_thrd_heartbeat->stop();
+		m_thrd_heartbeat->join();
+		m_thrd_heartbeat = bgcc::SharedPointer<bgcc::Thread>(NULL);
+	}
+	Tool::UnInit();
+}
+
+void CCCBar::DoDataExchange(CDataExchange* pDX)
+{
+	CDialog::DoDataExchange(pDX);
+	DDX_Control(pDX, IDC_BUTTON_SIGNINOUT, m_btnSignInOut);
+	DDX_Control(pDX, IDC_BUTTON_ANSWER, m_btnAnswer);
+	DDX_Control(pDX, IDC_BUTTON_CALLOUT, m_btnCallOut);
+	DDX_Control(pDX, IDC_BUTTON_HUNGUP, m_btnHangup);
+	DDX_Control(pDX, IDC_BUTTON_HOLD, m_btnHold);
+	DDX_Control(pDX, IDC_BUTTON_CONSULT, m_btnConsult);
+	DDX_Control(pDX, IDC_BUTTON_TRANSFER, m_btnTransfer);
+	DDX_Control(pDX, IDC_BUTTON_CONFERENCE, m_btnConference);
+	DDX_Control(pDX, IDC_BUTTON_SINGLESTEPTRANSFER, m_btnSingleStepTransfer);
+	DDX_Control(pDX, IDC_BUTTON_REST, m_btnRest);
+	DDX_Control(pDX, IDC_BUTTON_READY, m_btnReady);
+	DDX_Control(pDX, IDC_BUTTON_BUSY, m_btnBusy);
+	DDX_Control(pDX, IDC_BUTTON_SKILLCHANGE, m_btnSkillChange);
+	DDX_Control(pDX, IDC_BUTTON_FENGEONE, m_btnFengeOne);
+	DDX_Control(pDX, IDC_BUTTON_FENGETWO, m_btnFengeTwo);
+	DDX_Control(pDX, IDC_BUTTON_FENGETHREE, m_btnFengeThree);
+	DDX_Control(pDX, IDC_BUTTON_FENGEFOUR, m_btnFengeFour);
+	DDX_Control(pDX, IDC_STATIC_AGENTSTATE, m_stcAgentState);
+	DDX_Control(pDX, IDC_STATIC_AGENTSTATE_TIME, m_stcStateTime);
+	DDX_Control(pDX, IDC_STATIC_TALK, m_stcTalk);
+	DDX_Control(pDX, IDC_STATIC_TALK_TIME, m_stcTalkTime);
+	DDX_Control(pDX, IDC_STATIC_TOTAL, m_stcTotalTalk);
+	DDX_Control(pDX, IDC_STATIC_TOTAL_TIME, m_stcTotalTalkTime);
+	DDX_Control(pDX, IDC_COMBO_REST, m_cmbRest);
+	DDX_Control(pDX, IDC_COMBO_SKILL, m_cmbSkill);
+}
+
+BOOL CCCBar::OnInitDialog()
+{
+	CDialog::OnInitDialog();
+
+	// TODO:  ÔÚ´ËÌí¼Ó¶îÍâµÄ³õÊ¼»¯
+	if(CImgMgr::Instance().LoadImg())
+	{
+		CBitmap *pBit = CImgMgr::Instance().Get(IDB_BMP_BACKGROUND);
+		if(pBit == NULL)
+			return FALSE;
+
+		m_BrushTop.CreatePatternBrush(pBit);
+		m_BrushBottom.CreateSolidBrush(RGB(170,211,253));
+
+		m_stcAgentState.SetColor(RGB(170,211,253), RGB(5, 75, 144));
+		m_stcStateTime.SetColor(RGB(233,191,145), RGB(5, 75, 144));
+
+		m_stcTalk.SetColor(RGB(170,211,253), RGB(5, 75, 144));
+		m_stcTalkTime.SetColor(RGB(233,191,145), RGB(5, 75, 144));
+
+		m_stcTotalTalk.SetColor(RGB(170,211,253), RGB(5, 75, 144));
+		m_stcTotalTalkTime.SetColor(RGB(233,191,145),RGB(5, 75, 144));
+	}
+	else
+	{
+		m_BrushTop.CreateSolidBrush(RGB(240,240,240));
+		m_BrushBottom.CreateSolidBrush(RGB(225,225,225));
+		
+		m_stcAgentState.SetColor(RGB(128,255,255), RGB(250, 0, 0));
+		m_stcStateTime.SetColor(RGB(92,80,35), RGB(255, 255, 255));
+
+		m_stcTalk.SetColor(RGB(128,255,255), RGB(255, 0, 0));
+		m_stcTalkTime.SetColor(RGB(92,80,35), RGB(255, 255, 255));
+
+		m_stcTotalTalk.SetColor(RGB(128,255,255), RGB(255, 0, 0));
+		m_stcTotalTalkTime.SetColor(RGB(92,80,35), RGB(255, 255, 255));
+	}
+
+	CRect rect;
+	GetClientRect(&rect);
+	rect.right = rect.left + BAR_WIDTH;											//¿í1440
+	rect.bottom = rect.top + BAR_HEIGHT;										//¸ß84
+
+	m_RectTop.left = rect.left;
+	m_RectTop.top = rect.top;
+	m_RectTop.right = rect.right;
+	m_RectTop.bottom = rect.top + TOP_HEIGHT;
+
+	m_RectBottom.left = rect.left;
+	m_RectBottom.top = rect.top + TOP_HEIGHT;
+	m_RectBottom.right = rect.right;
+	m_RectBottom.bottom = rect.bottom;
+
+	//¿í150
+	m_stcAgentState.SetWidth(150);
+	m_stcAgentState.SetStaticexText("Î´Ç©Èë");
+	m_stcAgentState.SetFont(110, "ËÎÌå");
+	m_stcAgentState.SetWindowpos(m_RectBottom.left, m_RectBottom.top);
+	
+
+	//¿í100
+	m_stcStateTime.SetWidth(100);
+	m_stcStateTime.SetStaticexText("00:00:00");
+	m_stcStateTime.SetFont(110, "ËÎÌå");
+	m_stcStateTime.SetWindowpos(m_RectBottom.left + 150, m_RectBottom.top);
+
+	//¿í150
+	m_stcTalk.SetWidth(150);
+	m_stcTalk.SetStaticexText("µ±Ç°Í¨»°Ê±³¤");
+	m_stcTalk.SetFont(110, "ËÎÌå");
+	m_stcTalk.SetWindowpos(m_RectBottom.left + 250, m_RectBottom.top);
+
+	//¿í100
+	m_stcTalkTime.SetWidth(100);
+	m_stcTalkTime.SetStaticexText("00:00:00");
+	m_stcTalkTime.SetFont(110, "ËÎÌå");
+	m_stcTalkTime.SetWindowpos(m_RectBottom.left + 400, m_RectBottom.top);
+
+	//¿í150
+	m_stcTotalTalk .SetWidth(150);
+	m_stcTotalTalk.SetStaticexText("×ÜÍ¨»°Ê±³¤");
+	m_stcTotalTalk.SetFont(110, "ËÎÌå");
+	m_stcTotalTalk.SetWindowpos(m_RectBottom.left + 500, m_RectBottom.top);
+
+	//¿í100
+	m_stcTotalTalkTime.SetWidth(100);
+	m_stcTotalTalkTime.SetStaticexText("00:00:00");
+	m_stcTotalTalkTime.SetFont(110, "ËÎÌå");
+	m_stcTotalTalkTime.SetWindowpos(m_RectBottom.left + 650, m_RectBottom.top);
+
+	m_btnSignInOut.SetButtonPos(m_RectTop.left + 10, m_RectTop.top + BAR_TOP_POSITION);
+	m_btnSignInOut.SetBitMap(IDB_BMP_IN_SIGNIN, IDB_BMP_IN_SIGNIN);
+	m_btnSignInOut.EnableWindow(FALSE);
+
+	m_btnFengeOne.SetButtonPos(m_RectTop.left + 62,  m_RectTop.top + BAR_TOP_POSITION);
+	m_btnFengeOne.SetBitMap(IDB_BMP_FENGE, IDB_BMP_FENGE);
+	m_btnFengeOne.EnableWindow(FALSE);
+
+	m_btnAnswer.SetButtonPos(m_RectTop.left + 74, m_RectTop.top + BAR_TOP_POSITION);
+	m_btnAnswer.SetBitMap(IDB_BMP_IN_ANSWER, IDB_BMP_IN_ANSWER);
+	m_btnAnswer.EnableWindow(FALSE);
+
+	m_btnCallOut.SetButtonPos(m_RectTop.left + 126,  m_RectTop.top + BAR_TOP_POSITION);
+	m_btnCallOut.SetBitMap(IDB_BMP_IN_CALLOUT, IDB_BMP_IN_CALLOUT);
+	m_btnCallOut.EnableWindow(FALSE);
+
+	m_btnHangup.SetButtonPos(m_RectTop.left + 178,  m_RectTop.top + BAR_TOP_POSITION);
+	m_btnHangup.SetBitMap(IDB_BMP_IN_HANGUP, IDB_BMP_IN_HANGUP);
+	m_btnHangup.EnableWindow(FALSE);
+
+	m_btnFengeTwo.SetButtonPos(m_RectTop.left + 230, m_RectTop.top + BAR_TOP_POSITION);
+	m_btnFengeTwo.SetBitMap(IDB_BMP_FENGE, IDB_BMP_FENGE);
+	m_btnFengeTwo.EnableWindow(FALSE);
+
+	m_btnHold.SetButtonPos(m_RectTop.left + 242, m_RectTop.top + BAR_TOP_POSITION);
+	m_btnHold.SetBitMap(IDB_BMP_IN_HOLD, IDB_BMP_IN_HOLD);
+	m_btnHold.EnableWindow(FALSE);
+
+	m_btnFengeThree.SetButtonPos(m_RectTop.left + 294, m_RectTop.top + BAR_TOP_POSITION);
+	m_btnFengeThree.SetBitMap(IDB_BMP_FENGE, IDB_BMP_FENGE);
+	m_btnFengeThree.EnableWindow(FALSE);
+
+	m_btnConsult.SetButtonPos(m_RectTop.left + 306, m_RectTop.top + BAR_TOP_POSITION);
+	m_btnConsult.SetBitMap(IDB_BMP_IN_CONSULT, IDB_BMP_IN_CONSULT);
+	m_btnConsult.EnableWindow(FALSE);
+
+	m_btnTransfer.SetButtonPos(m_RectTop.left + 358, m_RectTop.top + BAR_TOP_POSITION);
+	m_btnTransfer.SetBitMap(IDB_BMP_IN_TRANSFER, IDB_BMP_IN_TRANSFER);
+	m_btnTransfer.EnableWindow(FALSE);
+
+	m_btnConference.SetButtonPos(m_RectTop.left + 410, m_RectTop.top + BAR_TOP_POSITION);
+	m_btnConference.SetBitMap(IDB_BMP_IN_CONFERENCE, IDB_BMP_IN_CONFERENCE);
+	m_btnConference.EnableWindow(FALSE);
+
+	m_btnSingleStepTransfer.SetButtonPos(m_RectTop.left + 462, m_RectTop.top + BAR_TOP_POSITION);
+	m_btnSingleStepTransfer.SetBitMap(IDB_BMP_IN_SSTRANSFER, IDB_BMP_IN_SSTRANSFER);
+	m_btnSingleStepTransfer.EnableWindow(FALSE);
+
+	m_btnFengeFour.SetButtonPos(m_RectTop.left + 514, m_RectTop.top + BAR_TOP_POSITION);
+	m_btnFengeFour.SetBitMap(IDB_BMP_FENGE, IDB_BMP_FENGE);
+	m_btnFengeFour.EnableWindow(FALSE);
+
+	m_btnRest.SetButtonPos(m_RectTop.left + 526, m_RectTop.top + BAR_TOP_POSITION);
+	m_btnRest.SetBitMap(IDB_BMP_IN_REST, IDB_BMP_IN_REST);
+	m_btnRest.EnableWindow(FALSE);
+
+	m_cmbRest.MoveWindow(m_RectTop.left + 578, m_RectTop.top + BAR_TOP_POSITION, 76, 80);
+	m_cmbRest.EnableWindow(FALSE);
+
+	m_btnReady.SetButtonPos(m_RectTop.left + 658, m_RectTop.top + BAR_TOP_POSITION); 
+	m_btnReady.SetBitMap(IDB_BMP_IN_READY, IDB_BMP_IN_READY);
+	m_btnReady.EnableWindow(FALSE);
+
+	m_btnBusy.SetButtonPos(m_RectTop.left + 710, m_RectTop.top + BAR_TOP_POSITION);
+	m_btnBusy.SetBitMap(IDB_BMP_IN_BUSY, IDB_BMP_IN_BUSY);
+	m_btnBusy.EnableWindow(FALSE);
+
+	m_btnSkillChange.SetButtonPos(m_RectTop.left + 762 ,m_RectTop.top + BAR_TOP_POSITION);
+	m_btnSkillChange.SetBitMap(IDB_BMP_IN_SKILLCHANGE, IDB_BMP_IN_SKILLCHANGE);
+	m_btnSkillChange.EnableWindow(FALSE);
+
+	m_cmbSkill.MoveWindow(m_RectTop.left + 814, m_RectTop.top + BAR_TOP_POSITION, 152, 80);
+	m_cmbSkill.EnableWindow(FALSE);
+
+	m_btnSkillChange.ShowWindow(SW_HIDE);
+	m_cmbSkill.ShowWindow(SW_HIDE);
+
+	return TRUE;
+}
+
+BEGIN_MESSAGE_MAP(CCCBar, CDialog)
+	ON_WM_ERASEBKGND()
+	ON_WM_SETCURSOR()
+	ON_WM_TIMER()
+	ON_WM_DESTROY()
+	ON_BN_CLICKED(IDC_BUTTON_SIGNINOUT, OnBnClickedButtonSigninout)
+	ON_BN_CLICKED(IDC_BUTTON_ANSWER, OnBnClickedButtonAnswer)
+	ON_BN_CLICKED(IDC_BUTTON_CALLOUT, OnBnClickedButtonCallout)
+	ON_BN_CLICKED(IDC_BUTTON_HUNGUP, OnBnClickedButtonHungup)
+	ON_BN_CLICKED(IDC_BUTTON_HOLD, OnBnClickedButtonHold)
+	ON_BN_CLICKED(IDC_BUTTON_CONSULT, OnBnClickedButtonConsult)
+	ON_BN_CLICKED(IDC_BUTTON_TRANSFER, OnBnClickedButtonTransfer)
+	ON_BN_CLICKED(IDC_BUTTON_CONFERENCE, OnBnClickedButtonConference)
+	ON_BN_CLICKED(IDC_BUTTON_SINGLESTEPTRANSFER, OnBnClickedButtonSinglesteptransfer)
+	ON_BN_CLICKED(IDC_BUTTON_REST, OnBnClickedButtonRest)
+	ON_BN_CLICKED(IDC_BUTTON_READY, OnBnClickedButtonReady)
+	ON_BN_CLICKED(IDC_BUTTON_BUSY, OnBnClickedButtonBusy)
+	ON_BN_CLICKED(IDC_BUTTON_SKILLCHANGE, OnBnClickedButtonSkillchange)
+	ON_MESSAGE(WM_AGENTEVENT, OnAgentEvent)
+	ON_MESSAGE(WM_MEDIAEVENT, OnMediaEvent)
+	ON_MESSAGE(WM_QUEUEEVENT, OnRouteEvent)
+	ON_MESSAGE(WM_OTHEREVENT, OnOtherEvent)
+END_MESSAGE_MAP()
+
+void CCCBar::SetButton()
+{
+	if(m_btnStatus.btnLogin ^ m_lastBtnStatus.btnLogin || m_btnStatus.btnLogout ^ m_lastBtnStatus.btnLogout)
+	{
+		if(m_btnStatus.btnLogin)
+		{
+			m_btnSignInOut.SetBitMap(IDB_BMP_SIGNIN, IDB_BMP_MS_SIGNIN);
+			m_btnSignInOut.EnableWindow(TRUE);
+		}
+		else if(m_btnStatus.btnLogout)
+		{
+			m_btnSignInOut.SetBitMap(IDB_BMP_SIGNOUT, IDB_BMP_MS_SIGNOUT);
+			m_btnSignInOut.EnableWindow(TRUE);
+		}
+		else if(m_lastBtnStatus.btnLogin)
+		{
+			m_btnSignInOut.SetBitMap(IDB_BMP_IN_SIGNIN, IDB_BMP_IN_SIGNIN);
+			m_btnSignInOut.EnableWindow(FALSE);
+		}
+		else
+		{
+			m_btnSignInOut.SetBitMap(IDB_BMP_IN_SIGNOUT, IDB_BMP_IN_SIGNOUT);
+			m_btnSignInOut.EnableWindow(FALSE);
+		}
+		m_btnSignInOut.Invalidate();
+	}
+	if(m_btnStatus.btnAnswer ^ m_lastBtnStatus.btnAnswer)
+	{
+		if(m_btnStatus.btnAnswer)
+		{
+			m_btnAnswer.SetBitMap(IDB_BMP_ANSWER, IDB_BMP_MS_ANSWER);
+			m_btnAnswer.EnableWindow(TRUE);
+		}
+		else
+		{
+			m_btnAnswer.SetBitMap(IDB_BMP_IN_ANSWER, IDB_BMP_IN_ANSWER);
+			m_btnAnswer.EnableWindow(FALSE);
+		}
+		m_btnAnswer.Invalidate();
+	}
+	if((m_btnStatus.btnCallout ^ m_lastBtnStatus.btnCallout || m_btnStatus.btnSenddtmf ^ m_lastBtnStatus.btnSenddtmf) && m_intIsShowCallOut)
+	{
+		if(m_btnStatus.btnCallout)
+		{
+			m_btnCallOut.SetBitMap(IDB_BMP_CALLOUT, IDB_BMP_MS_CALLOUT);
+			m_btnCallOut.EnableWindow(TRUE);
+		}
+		else if(m_btnStatus.btnSenddtmf)
+		{
+			m_btnCallOut.SetBitMap(IDB_BMP_SENDDTMF, IDB_BMP_MS_SENDDTMF);
+			m_btnCallOut.EnableWindow(TRUE);
+		}
+		else
+		{
+			m_btnCallOut.SetBitMap(IDB_BMP_IN_CALLOUT, IDB_BMP_IN_CALLOUT);
+			m_btnCallOut.EnableWindow(FALSE);
+		}
+		m_btnCallOut.Invalidate();
+	}
+	if(m_btnStatus.btnHangup ^ m_lastBtnStatus.btnHangup)
+	{
+		if(m_btnStatus.btnHangup)
+		{
+			m_btnHangup.SetBitMap(IDB_BMP_HANGUP, IDB_BMP_MS_HANGUP);
+			m_btnHangup.EnableWindow(TRUE);
+		}
+		else
+		{
+			m_btnHangup.SetBitMap(IDB_BMP_IN_HANGUP, IDB_BMP_IN_HANGUP);
+			m_btnHangup.EnableWindow(FALSE);
+		}
+		m_btnHangup.Invalidate();
+	}
+	if(m_btnStatus.btnHold ^ m_lastBtnStatus.btnHold || m_btnStatus.btnRetrieve ^ m_lastBtnStatus.btnRetrieve)
+	{
+		if(m_btnStatus.btnHold)
+		{
+			m_btnHold.SetBitMap(IDB_BMP_HOLD, IDB_BMP_MS_HOLD);
+			m_btnHold.EnableWindow(TRUE);
+		}
+		else if(m_btnStatus.btnRetrieve)
+		{
+			m_btnHold.SetBitMap(IDB_BMP_RETRIEVE, IDB_BMP_MS_RETRIEVE);
+			m_btnHold.EnableWindow(TRUE);
+		}
+		else
+		{
+			m_btnHold.SetBitMap(IDB_BMP_IN_HOLD, IDB_BMP_IN_HOLD);
+			m_btnHold.EnableWindow(FALSE);
+		}
+		m_btnHold.Invalidate();
+	}
+	if((m_btnStatus.btnConsult ^ m_lastBtnStatus.btnConsult || m_btnStatus.btnReconnect ^ m_lastBtnStatus.btnReconnect) && m_intEnableSeniorCall)
+	{
+		if(m_btnStatus.btnConsult)
+		{
+			m_btnConsult.SetBitMap(IDB_BMP_CONSULT, IDB_BMP_MS_CONSULT);
+			m_btnConsult.EnableWindow(TRUE);
+		}
+		else if(m_btnStatus.btnReconnect)
+		{
+			m_btnConsult.SetBitMap(IDB_BMP_RECONNECT, IDB_BMP_MS_RECONNECT);
+			m_btnConsult.EnableWindow(TRUE);
+		}
+		else
+		{
+			m_btnConsult.SetBitMap(IDB_BMP_IN_CONSULT, IDB_BMP_IN_CONSULT);
+			m_btnConsult.EnableWindow(FALSE);
+		}
+		m_btnConsult.Invalidate();
+	}
+	if((m_btnStatus.btnTransfer ^ m_lastBtnStatus.btnTransfer) && m_intEnableSeniorCall)
+	{
+		if(m_btnStatus.btnTransfer)
+		{
+			m_btnTransfer.SetBitMap(IDB_BMP_TRANSFER, IDB_BMP_MS_TRANSFER);
+			m_btnTransfer.EnableWindow(TRUE);
+		}
+		else
+		{
+			m_btnTransfer.SetBitMap(IDB_BMP_IN_TRANSFER, IDB_BMP_IN_TRANSFER);
+			m_btnTransfer.EnableWindow(FALSE);
+		}
+		m_btnTransfer.Invalidate();
+	}
+	if((m_btnStatus.btnConference ^ m_lastBtnStatus.btnConference) && m_intEnableSeniorCall)
+	{
+		if(m_btnStatus.btnConference)
+		{
+			m_btnConference.SetBitMap(IDB_BMP_CONFERENCE, IDB_BMP_MS_CONFERENCE);
+			m_btnConference.EnableWindow(TRUE);
+		}
+		else
+		{
+			m_btnConference.SetBitMap(IDB_BMP_IN_CONFERENCE, IDB_BMP_IN_CONFERENCE);
+			m_btnConference.EnableWindow(FALSE);
+		}
+		m_btnConference.Invalidate();
+	}
+	if((m_btnStatus.btnSSTransfer ^ m_lastBtnStatus.btnSSTransfer) && m_intEnableSeniorCall)
+	{
+		if(m_btnStatus.btnSSTransfer)
+		{
+			m_btnSingleStepTransfer.SetBitMap(IDB_BMP_SSTRANSFER, IDB_BMP_MS_SSTRANSFER);
+			m_btnSingleStepTransfer.EnableWindow(TRUE);
+		}
+		else
+		{
+			m_btnSingleStepTransfer.SetBitMap(IDB_BMP_IN_SSTRANSFER, IDB_BMP_IN_SSTRANSFER);
+			m_btnSingleStepTransfer.EnableWindow(FALSE);
+		}
+		m_btnSingleStepTransfer.Invalidate();
+	}
+	if(m_btnStatus.btnRest ^ m_lastBtnStatus.btnRest)
+	{
+		if(m_btnStatus.btnRest)
+		{
+			m_btnRest.SetBitMap(IDB_BMP_REST, IDB_BMP_MS_REST);
+			m_btnRest.EnableWindow(TRUE);
+			m_cmbRest.EnableWindow(TRUE);
+		}
+		else
+		{
+			m_btnRest.SetBitMap(IDB_BMP_IN_REST, IDB_BMP_IN_REST);
+			m_btnRest.EnableWindow(FALSE);
+			m_cmbRest.EnableWindow(FALSE);
+		}
+		m_btnRest.Invalidate();
+	}
+	if(m_btnStatus.btnReady ^ m_lastBtnStatus.btnReady)
+	{
+		if(m_btnStatus.btnReady)
+		{
+			m_btnReady.SetBitMap(IDB_BMP_READY, IDB_BMP_MS_READY);
+			m_btnReady.EnableWindow(TRUE);
+		}
+		else
+		{
+			m_btnReady.SetBitMap(IDB_BMP_IN_READY, IDB_BMP_IN_READY);
+			m_btnReady.EnableWindow(FALSE);
+		}
+		m_btnReady.Invalidate();
+	}
+	if(m_btnStatus.btnBusy ^ m_lastBtnStatus.btnBusy)
+	{
+		if(m_btnStatus.btnBusy)
+		{
+			m_btnBusy.SetBitMap(IDB_BMP_BUSY, IDB_BMP_MS_BUSY);
+			m_btnBusy.EnableWindow(TRUE);
+		}
+		else
+		{
+			m_btnBusy.SetBitMap(IDB_BMP_IN_BUSY, IDB_BMP_IN_BUSY);
+			m_btnBusy.EnableWindow(FALSE);
+		}
+		m_btnBusy.Invalidate();
+	}
+	if(m_btnStatus.btnSkill ^ m_lastBtnStatus.btnSkill)
+	{
+		if(m_btnStatus.btnSkill)
+		{
+			m_btnSkillChange.SetBitMap(IDB_BMP_SKILLCHANGE, IDB_BMP_MS_SKILLCHANGE);
+			m_btnSkillChange.EnableWindow(TRUE);
+			m_cmbSkill.EnableWindow(TRUE);
+		}
+		else
+		{
+			m_btnSkillChange.SetBitMap(IDB_BMP_IN_SKILLCHANGE, IDB_BMP_IN_SKILLCHANGE);
+			m_btnSkillChange.EnableWindow(FALSE);
+			m_cmbSkill.EnableWindow(FALSE);
+		}
+		m_btnSkillChange.Invalidate();
+	}
+}
+
+void CCCBar::PostMessageEx(const acd::AgentStatusT &agentStatus, const acd::CallEventReasonT &reason)
+{
+	acd::AgentEventT *pAE = new acd::AgentEventT;
+	pAE->agentId = m_strAgentID;
+	pAE->eventId = acd::CallEventTypeT::CeUnKnownEvent;
+	pAE->agentDn = m_strDN;
+	pAE->callId = "";
+	pAE->sessionId = 0;
+	pAE->agentStatus = agentStatus;
+	pAE->originalCallid = "";
+	pAE->partyNum = 0;
+	pAE->otherParty = "";
+	pAE->otherAttr = acd::PartyAttributeT::PaUnknown;
+	pAE->originatingParty = "";
+	pAE->originalAni = m_orgCallingNo;
+	pAE->originalDnis = m_orgCalledNo;
+	pAE->reason = reason;
+	if(!m_lDetaTime)
+	{
+		pAE->timestamp = CTime::GetCurrentTime().GetTime() * 1000000;
+	}
+	else
+	{
+		pAE->timestamp = static_cast<int64_t>(GetTickCount()) * 1000 + static_cast<int64_t>(m_lDetaTime);
+	}
+
+	LONGLONG address = reinterpret_cast<LONGLONG>(pAE);
+	int ladr = LOLONG(address);
+	int hadr = HILONG(address);
+	PostMessage(WM_AGENTEVENT, ladr, hadr);
+}
+
+void CCCBar::PostMessageEx(const acd::OtherEventTypeT &otherEventType)
+{
+	acd::OtherEventT *pOE = new acd::OtherEventT;
+	pOE->agentId = m_strAgentID;
+	pOE->eventType = otherEventType;
+	pOE->agentDn = m_strDN;
+	pOE->callId = "";
+	pOE->sessionId = 0;
+	pOE->originalAni = m_orgCallingNo;
+	pOE->originalDnis = m_orgCalledNo;
+	if(!m_lDetaTime)
+	{
+		pOE->timestamp = CTime::GetCurrentTime().GetTime() * 1000000;
+	}
+	else
+	{
+		pOE->timestamp = static_cast<int64_t>(GetTickCount()) * 1000 + static_cast<int64_t>(m_lDetaTime);
+	}
+
+	LONGLONG address = reinterpret_cast<LONGLONG>(pOE);
+	int ladr = LOLONG(address);
+	int hadr = HILONG(address);
+	PostMessage(WM_OTHEREVENT, ladr, hadr);
+}
+
+void CCCBar::Backup()
+{
+	LONG ret = AGENTBARERROR_SUCCESS;
+	// Ç©³ö×øÏ¯
+	PostMessageEx(acd::AgentStatusT::AsUnLoginState, acd::CallEventReasonT::CerUnloginBackup);
+	// ·¢ËÍ¶ÏÁ¬ÏûÏ¢
+	PostMessageEx(acd::OtherEventTypeT::ACDDisconnect);
+	// ·þÎñµ¹»»
+	m_acd.AcdBackup();
+	// ³¢ÊÔÖØÁ¬
+	int tryTime = TIMES_HEARTBEAT_EXCEPTION;
+	while(tryTime--)
+	{
+		ret = m_acd.AcdSignIn(m_strAgentID, m_strDN, m_strPassWord, m_intStatusChangeType, !!m_intAutoAnswer, !!m_intForceSignIn, m_strServiceList);
+		if(ret == acd::AcdResultT::ArNotMaster)// ·ÇÖ÷
+		{
+			bgcc::TimeUtil::safe_sleep_ms(TIMESPAN_HEARTBEAT);
+		}
+		else
+		{
+			break;
+		}
+	}
+	if(ret == AGENTBARERROR_SUCCESS)
+	{
+		// µ¹»»³É¹¦
+		PostMessageEx(acd::OtherEventTypeT::ACDMasterChange);
+	}
+	else
+	{
+		// µ¹»»Ê§°Ü
+		PostMessageEx(acd::OtherEventTypeT::ACDOperationFailed);
+	}
+}
+
+void CCCBar::ReSignIn()
+{
+	LONG ret = AGENTBARERROR_SUCCESS;
+	// Ç©³ö×øÏ¯
+	PostMessageEx(acd::AgentStatusT::AsUnLoginState, acd::CallEventReasonT::CerUnloginResignin);
+	// ³¢ÊÔÖØÇ©
+	ret = m_acd.AcdSignIn(m_strAgentID, m_strDN, m_strPassWord, m_intStatusChangeType, !!m_intAutoAnswer, !!m_intForceSignIn, m_strServiceList);
+	if(ret == AGENTBARERROR_SUCCESS)
+	{
+		// ÖØÇ©³É¹¦
+		PostMessageEx(acd::OtherEventTypeT::ACDReLoginSuccess);
+	}
+	else
+	{
+		// ÖØÇ©Ê§°Ü
+		PostMessageEx(acd::OtherEventTypeT::ACDReLoginFailed);
+	}
+}
+
+BOOL CCCBar::OnEraseBkgnd(CDC* pDC)
+{
+	CBrush * p_OldBrush = pDC->SelectObject(&m_BrushTop);
+	pDC->FillRect(&m_RectTop, &m_BrushTop);
+	pDC->SelectObject(p_OldBrush);
+
+	p_OldBrush = pDC->SelectObject(&m_BrushBottom);
+	pDC->FillRect(&m_RectBottom, &m_BrushBottom);
+	pDC->SelectObject(p_OldBrush);
+
+	p_OldBrush = NULL;
+
+	return TRUE;
+}
+
+BOOL CCCBar::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message)
+{
+	switch(pWnd->GetDlgCtrlID())
+	{
+		case IDC_BUTTON_SIGNINOUT:
+		case IDC_BUTTON_ANSWER:
+		case IDC_BUTTON_CALLOUT:
+		case IDC_BUTTON_HUNGUP:
+		case IDC_BUTTON_HOLD:
+		case IDC_BUTTON_CONSULT:
+		case IDC_BUTTON_TRANSFER:
+		case IDC_BUTTON_CONFERENCE:
+		case IDC_BUTTON_SINGLESTEPTRANSFER:
+		case IDC_BUTTON_REST:
+		case IDC_BUTTON_READY:
+		case IDC_BUTTON_BUSY:
+		case IDC_BUTTON_SKILLCHANGE:
+		case IDC_BUTTON_FENGEONE:
+		case IDC_BUTTON_FENGETWO:
+		case IDC_BUTTON_FENGETHREE:
+		case IDC_BUTTON_FENGEFOUR:
+			if(pWnd->IsWindowEnabled())
+			{
+				if(GetCursor() != AfxGetApp()->LoadStandardCursor(IDC_HAND))
+				{
+					SetCursor(AfxGetApp()->LoadStandardCursor(IDC_HAND));
+				}
+			}
+			break;
+		default :
+			if(GetCursor() != AfxGetApp()->LoadStandardCursor(IDC_ARROW))
+			{
+				SetCursor(AfxGetApp()->LoadStandardCursor(IDC_ARROW));
+			}	
+			break;
+	}
+	return TRUE;
+}
+
+void CCCBar::OnTimer(UINT nIDEvent)
+{
+	// TODO: ÔÚ´ËÌí¼ÓÏûÏ¢´¦Àí³ÌÐò´úÂëºÍ/»òµ÷ÓÃÄ¬ÈÏÖµ
+	switch(nIDEvent)
+	{
+	case TIMER_STATUS://×´Ì¬¶¨Ê±Æ÷
+		{
+			CTime curentTime = CTime::GetCurrentTime();
+			CTimeSpan timeSpan = curentTime - m_lastStatusTime;
+			if(timeSpan.GetTotalSeconds() > 60 || timeSpan.GetTotalSeconds() < 0)
+			{
+				m_beginStatusTime += timeSpan;
+			}
+			timeSpan = curentTime - m_beginStatusTime;
+			m_lastStatusTime = curentTime;
+
+			m_stcStateTime.SetStaticexText(timeSpan.Format("%H:%M:%S"));
+			m_stcStateTime.Invalidate();
+			break;
+		}
+	case TIMER_TALK:
+		{
+			CTime curentTime = CTime::GetCurrentTime();
+			CTimeSpan timeSpan = curentTime - m_lastTalkTime;
+			m_totalTime += timeSpan;
+			if(timeSpan.GetTotalSeconds() > 60 || timeSpan.GetTotalSeconds() < 0)
+			{
+				m_beginTalkTime += timeSpan;
+			}
+			timeSpan = curentTime - m_beginTalkTime;
+			m_lastTalkTime = curentTime;
+
+			m_stcTalkTime.SetStaticexText(timeSpan.Format("%H:%M:%S"));
+			m_stcTalkTime.Invalidate();
+
+			m_stcTotalTalkTime.SetStaticexText(m_totalTime.Format("%H:%M:%S"));
+			m_stcTotalTalkTime.Invalidate();
+
+			break;
+		}
+	default:
+		break;
+	}
+
+	CDialog::OnTimer(nIDEvent);
+}
+
+void CCCBar::OnDestroy()
+{
+	// TODO: ÔÚ´Ë´¦Ìí¼ÓÏûÏ¢´¦Àí³ÌÐò´úÂë
+	if(m_AgentStatus == acd::AgentStatusT::AsUnknownState)
+	{
+		// ²»´¦Àí
+	}
+	else if(m_AgentStatus == acd::AgentStatusT::AsUnLoginState)
+	{
+		// Î´µÇÂ¼Ôò·´³õÊ¼»¯
+		m_acd.AcdUnInitial();
+		if(m_intIsSIPPhone)
+		{
+			m_sip.SipUnInitial();
+		}
+	}
+	else
+	{
+		// ÏÈ¹Ò¶Ï£¬ºóÇ©³ö£¬×îºó·´³õÊ¼»¯BGCCºÍSIP
+		m_acd.AcdReset(m_strAgentID);
+		m_acd.AcdUnInitial();
+		if(m_intIsSIPPhone)
+		{
+			m_sip.SipUnInitial();
+		}
+	}
+	m_BrushTop.DeleteObject();
+	m_BrushBottom.DeleteObject();
+	CImgMgr::Instance().UnLoadImg();
+	CDialog::OnDestroy();
+}
+
+void CCCBar::OnBnClickedButtonSigninout()
+{
+	// TODO: ÔÚ´ËÌí¼Ó¿Ø¼þÍ¨Öª´¦Àí³ÌÐò´úÂë
+	BeginWaitCursor();
+	if(m_AgentStatus == acd::AgentStatusT::AsUnLoginState)
+	{
+		LONG ret =  BSignIn();
+		if(AGENTBARERROR_SUCCESS != ret)
+		{
+			string mes;
+			Tool::GetAcdResult_Str(ret, mes);
+			CInfo info;
+			info.SetInfo(IDI_ICON_ERROR, "Ç©ÈëÊ§°Ü£º%s", mes.c_str());
+			info.DoModal();
+		}
+	}
+	else
+	{
+		LONG ret = BSignOut();
+		if(AGENTBARERROR_SUCCESS != ret)
+		{
+			string mes;
+			Tool::GetAcdResult_Str(ret, mes);
+			CInfo info;
+			info.SetInfo(IDI_ICON_ERROR, "Ç©³öÊ§°Ü£º%s", mes.c_str());
+			info.DoModal();
+		}
+	}
+	EndWaitCursor();
+}
+
+void CCCBar::OnBnClickedButtonAnswer()
+{
+	// TODO: ÔÚ´ËÌí¼Ó¿Ø¼þÍ¨Öª´¦Àí³ÌÐò´úÂë
+	BeginWaitCursor();
+	LONG ret = BAnswer();
+	if(AGENTBARERROR_SUCCESS != ret)
+	{
+		string mes;
+		Tool::GetAcdResult_Str(ret, mes);
+		CInfo info;
+		info.SetInfo(IDI_ICON_ERROR, "½ÓÌýÊ§°Ü£º%s", mes.c_str());
+		info.DoModal();
+	}
+	EndWaitCursor();
+}
+
+void CCCBar::OnBnClickedButtonCallout()
+{
+	// TODO: ÔÚ´ËÌí¼Ó¿Ø¼þÍ¨Öª´¦Àí³ÌÐò´úÂë
+	BeginWaitCursor();
+	CRect rect;
+	m_btnCallOut.GetWindowRect(&rect);
+	m_dlgCallOut.SetPosition(rect.right, rect.bottom);
+	if(m_dlgCallOut.DoModal() == IDOK)
+	{
+		if(m_AgentStatus == acd::AgentStatusT::AsBusyState)// Íâºô
+		{
+			if(m_dlgCallOut.GetAgentOrOut() == 0)//ÍâÏß
+			{
+				// ÊÇ·ñ·¢ÆðÍâºô
+				m_intIsCallOut = TRUE;
+				p_m_BarCtrl->OnBeforeOutCall(m_dlgCallOut.GetNumber(), acd::PartyAttributeT::PaNormal, m_strDN, m_dlgCallOut.GetNumber(), 1, CTime::GetCurrentTime().GetTime() * 1000000);
+				if(!m_intIsCallOut)
+				{
+					Tool::m_Logger.WriteLog("CCCBar", "OnBnClickedButtonCallout", "IsCallOut Error", m_intIsCallOut);
+					return;
+				}
+				// ·¢ÆðÍâºô
+				CString showANI, showDNIS;
+				switch(m_intANIChangeType)
+				{
+				case ANICHANGE_SYSTEM:
+					break;
+				case ANICHANGE_TRANSFER:
+					showDNIS = m_strDN;
+					break;
+				case ANICHANGE_SPECIAL:
+					break;
+				default:
+					break;
+				}
+				LONG ret = BMakeCall(m_dlgCallOut.GetNumber(), showANI, showDNIS, acd::CallModeT::CmNormal, acd::CallTypeT::CtOut);
+				if(AGENTBARERROR_SUCCESS != ret)
+				{
+					string mes;
+					Tool::GetAcdResult_Str(ret, mes);
+					CInfo info;
+					info.SetInfo(IDI_ICON_ERROR, "ºô³öÊ§°Ü£º%s", mes.c_str());
+					info.DoModal();
+				}
+			}
+			else//×øÏ¯
+			{
+				CString showANI, showDNIS;
+				switch(m_intANIChangeType)
+				{
+				case ANICHANGE_SYSTEM:
+					break;
+				case ANICHANGE_TRANSFER:
+					showDNIS = m_strDN;
+					break;
+				case ANICHANGE_SPECIAL:
+					break;
+				default:
+					break;
+				}
+				LONG ret = BMakeCall(m_dlgCallOut.GetNumber(), showANI, showDNIS, acd::CallModeT::CmNormal, acd::CallTypeT::CtAgent);
+				if(AGENTBARERROR_SUCCESS != ret)
+				{
+					string mes;
+					Tool::GetAcdResult_Str(ret, mes);
+					CInfo info;
+					info.SetInfo(IDI_ICON_ERROR, "ºô³öÊ§°Ü£º%s", mes.c_str());
+					info.DoModal();
+				}
+			}
+		}
+		else// ¶þ´Î²¦ºÅ
+		{
+			LONG ret = BSendDTMF(m_dlgCallOut.GetNumber());
+			if(AGENTBARERROR_SUCCESS != ret)
+			{
+				string mes;
+				Tool::GetAcdResult_Str(ret, mes);
+				CInfo info;
+				info.SetInfo(IDI_ICON_ERROR, "²¦´ò·Ö»úÊ§°Ü£º%s", mes.c_str());
+				info.DoModal();
+			}
+		}
+	}
+	EndWaitCursor();
+}
+
+void CCCBar::OnBnClickedButtonHungup()
+{
+	// TODO: ÔÚ´ËÌí¼Ó¿Ø¼þÍ¨Öª´¦Àí³ÌÐò´úÂë
+	BeginWaitCursor();
+	LONG ret = BReleaseCall();
+	if(AGENTBARERROR_SUCCESS != ret)
+	{
+		string mes;
+		Tool::GetAcdResult_Str(ret, mes);
+		CInfo info;
+		info.SetInfo(IDI_ICON_ERROR, "¹Ò¶ÏÊ§°Ü£º%s", mes.c_str());
+		info.DoModal();
+	}
+	EndWaitCursor();
+}
+
+void CCCBar::OnBnClickedButtonHold()
+{
+	// TODO: ÔÚ´ËÌí¼Ó¿Ø¼þÍ¨Öª´¦Àí³ÌÐò´úÂë
+	BeginWaitCursor();
+	if(m_AgentStatus == acd::AgentStatusT::AsConnectedState)
+	{
+		LONG ret = BHold();
+		if(AGENTBARERROR_SUCCESS != ret)
+		{
+			string mes;
+			Tool::GetAcdResult_Str(ret, mes);
+			CInfo info;
+			info.SetInfo(IDI_ICON_ERROR, "±£³ÖÊ§°Ü£º%s", mes.c_str());
+			info.DoModal();
+		}
+	}
+	else
+	{
+		LONG ret = BRetrieve();
+		if(AGENTBARERROR_SUCCESS != ret)
+		{
+			string mes;
+			Tool::GetAcdResult_Str(ret, mes);
+			CInfo info;
+			info.SetInfo(IDI_ICON_ERROR, "±£³Ö½Ó»ØÊ§°Ü£º%s", mes.c_str());
+			info.DoModal();
+		}
+	}
+	EndWaitCursor();
+}
+
+void CCCBar::OnBnClickedButtonConsult()
+{
+	// TODO: ÔÚ´ËÌí¼Ó¿Ø¼þÍ¨Öª´¦Àí³ÌÐò´úÂë
+	BeginWaitCursor();
+	if(m_AgentStatus == acd::AgentStatusT::AsConnectedState)
+	{
+		CRect rect;
+		m_btnConsult.GetWindowRect(&rect);
+		m_dlgCallOut.SetPosition(rect.right, rect.bottom);
+		if(m_dlgCallOut.DoModal() == IDOK)
+		{
+			if(m_dlgCallOut.GetAgentOrOut() == 0)// ÍâÏß
+			{
+				// ÊÇ·ñ·¢ÆðÍâºô
+				m_intIsCallOut = TRUE;
+				p_m_BarCtrl->OnBeforeOutCall(m_dlgCallOut.GetNumber(), acd::PartyAttributeT::PaNormal, m_strDN, m_dlgCallOut.GetNumber(), 2, CTime::GetCurrentTime().GetTime() * 1000000);
+				if(!m_intIsCallOut)
+				{
+					Tool::m_Logger.WriteLog("CCCBar", "OnBnClickedButtonConsult", "IsCallOut Error", m_intIsCallOut);
+					return;
+				}
+				// ·¢Æð×ÉÑ¯
+				CString showANI, showDNIS;
+				switch(m_intANIChangeType)
+				{
+				case ANICHANGE_SYSTEM:
+					break;
+				case ANICHANGE_TRANSFER:
+					showDNIS = m_strDN;
+					break;
+				case ANICHANGE_SPECIAL:
+					break;
+				default:
+					break;
+				}
+				LONG ret = BConsult(m_dlgCallOut.GetNumber(), showANI, showDNIS, acd::CallTypeT::CtOut);
+				if(AGENTBARERROR_SUCCESS != ret)
+				{
+					string mes;
+					Tool::GetAcdResult_Str(ret, mes);
+					CInfo info;
+					info.SetInfo(IDI_ICON_ERROR, "×ÉÑ¯Ê§°Ü£º%s", mes.c_str());
+					info.DoModal();
+				}
+			}
+			else// ×øÏ¯
+			{
+				CString showANI, showDNIS;
+				switch(m_intANIChangeType)
+				{
+				case ANICHANGE_SYSTEM:
+					break;
+				case ANICHANGE_TRANSFER:
+					showDNIS = m_strDN;
+					break;
+				case ANICHANGE_SPECIAL:
+					break;
+				default:
+					break;
+				}
+				LONG ret = BConsult(m_dlgCallOut.GetNumber(), showANI, showDNIS, acd::CallTypeT::CtAgent);
+				if(AGENTBARERROR_SUCCESS != ret)
+				{
+					string mes;
+					Tool::GetAcdResult_Str(ret, mes);
+					CInfo info;
+					info.SetInfo(IDI_ICON_ERROR, "×ÉÑ¯Ê§°Ü£º%s", mes.c_str());
+					info.DoModal();
+				}
+			}
+		}
+	}
+	else
+	{
+		LONG ret = BReconnect();
+		if(AGENTBARERROR_SUCCESS != ret)
+		{
+			string mes;
+			Tool::GetAcdResult_Str(ret, mes);
+			CInfo info;
+			info.SetInfo(IDI_ICON_ERROR, "×ÉÑ¯½Ó»ØÊ§°Ü£º%s", mes.c_str());
+			info.DoModal();
+		}
+	}
+	EndWaitCursor();
+}
+
+void CCCBar::OnBnClickedButtonTransfer()
+{
+	// TODO: ÔÚ´ËÌí¼Ó¿Ø¼þÍ¨Öª´¦Àí³ÌÐò´úÂë
+	BeginWaitCursor();
+	LONG ret = BTransfer();
+	if(AGENTBARERROR_SUCCESS != ret)
+	{
+		string mes;
+		Tool::GetAcdResult_Str(ret, mes);
+		CInfo info;
+		info.SetInfo(IDI_ICON_ERROR, "×ÉÑ¯×ªÒÆÊ§°Ü£º%s", mes.c_str());
+		info.DoModal();
+	}
+	EndWaitCursor();
+}
+
+void CCCBar::OnBnClickedButtonConference()
+{
+	// TODO: ÔÚ´ËÌí¼Ó¿Ø¼þÍ¨Öª´¦Àí³ÌÐò´úÂë
+	BeginWaitCursor();
+	LONG ret = BConference();
+	if(AGENTBARERROR_SUCCESS != ret)
+	{
+		string mes;
+		Tool::GetAcdResult_Str(ret, mes);
+		CInfo info;
+		info.SetInfo(IDI_ICON_ERROR, "×ÉÑ¯»áÒéÊ§°Ü£º%s", mes.c_str());
+		info.DoModal();
+	}
+	EndWaitCursor();
+}
+
+void CCCBar::OnBnClickedButtonSinglesteptransfer()
+{
+	// TODO: ÔÚ´ËÌí¼Ó¿Ø¼þÍ¨Öª´¦Àí³ÌÐò´úÂë
+	BeginWaitCursor();
+	CRect rect;
+	m_btnSingleStepTransfer.GetWindowRect(&rect);
+	m_dlgCallOut.SetPosition(rect.right, rect.bottom);
+	if(m_dlgCallOut.DoModal() == IDOK)
+	{
+		if(m_dlgCallOut.GetAgentOrOut() == 0)// ÍâÏß
+		{
+			// ÊÇ·ñ·¢ÆðÍâºô
+			m_intIsCallOut = TRUE;
+			p_m_BarCtrl->OnBeforeOutCall(m_dlgCallOut.GetNumber(), acd::PartyAttributeT::PaNormal, m_strDN, m_dlgCallOut.GetNumber(), 3, CTime::GetCurrentTime().GetTime() * 1000000);
+			if(!m_intIsCallOut)
+			{
+				Tool::m_Logger.WriteLog("CCCBar", "OnBnClickedButtonSinglesteptransfer", "IsCallOut Error", m_intIsCallOut);
+				return;
+			}
+			// ·¢Æð×ªÒÆ
+			CString showANI, showDNIS;
+			switch(m_intANIChangeType)
+			{
+			case ANICHANGE_SYSTEM:
+				break;
+			case ANICHANGE_TRANSFER:
+				showDNIS = m_strDN;
+				break;
+			case ANICHANGE_SPECIAL:
+				break;
+			default:
+				break;
+			}
+			LONG ret = BSingleStepTransfer(m_dlgCallOut.GetNumber(), showANI, showDNIS, FALSE, acd::CallTypeT::CtOut);
+			if(AGENTBARERROR_SUCCESS != ret)
+			{
+				string mes;
+				Tool::GetAcdResult_Str(ret, mes);
+				CInfo info;
+				info.SetInfo(IDI_ICON_ERROR, "Í¨»°×ªÒÆÊ§°Ü£º%s", mes.c_str());
+				info.DoModal();
+			}
+		}
+		else// ×øÏ¯
+		{
+			CString showANI, showDNIS;
+			switch(m_intANIChangeType)
+			{
+			case ANICHANGE_SYSTEM:
+				break;
+			case ANICHANGE_TRANSFER:
+				showDNIS = m_strDN;
+				break;
+			case ANICHANGE_SPECIAL:
+				break;
+			default:
+				break;
+			}
+			LONG ret = BSingleStepTransfer(m_dlgCallOut.GetNumber(), showANI, showDNIS, FALSE, acd::CallTypeT::CtAgent);
+			if(AGENTBARERROR_SUCCESS != ret)
+			{
+				string mes;
+				Tool::GetAcdResult_Str(ret, mes);
+				CInfo info;
+				info.SetInfo(IDI_ICON_ERROR, "Í¨»°×ªÒÆÊ§°Ü£º%s", mes.c_str());
+				info.DoModal();
+			}
+		}
+	}
+	EndWaitCursor();
+}
+
+void CCCBar::OnBnClickedButtonRest()
+{
+	// TODO: ÔÚ´ËÌí¼Ó¿Ø¼þÍ¨Öª´¦Àí³ÌÐò´úÂë
+	BeginWaitCursor();
+	// È¡ÐÝÏ¢Ô­Òò
+	int index = m_cmbRest.GetCurSel();
+	CString reason;
+	if(index != -1)
+		m_cmbRest.GetLBText(index, reason);
+	LONG ret = BSetRest(reason);
+	if(AGENTBARERROR_SUCCESS != ret)
+	{
+		string mes;
+		Tool::GetAcdResult_Str(ret, mes);
+		CInfo info;
+		info.SetInfo(IDI_ICON_ERROR, "ÐÝÏ¢Ê§°Ü£º%s", mes.c_str());
+		info.DoModal();
+	}
+	EndWaitCursor();
+}
+
+void CCCBar::OnBnClickedButtonReady()
+{
+	// TODO: ÔÚ´ËÌí¼Ó¿Ø¼þÍ¨Öª´¦Àí³ÌÐò´úÂë
+	BeginWaitCursor();
+	LONG ret = BSetIdle();
+	if(AGENTBARERROR_SUCCESS != ret)
+	{
+		string mes;
+		Tool::GetAcdResult_Str(ret, mes);
+		CInfo info;
+		info.SetInfo(IDI_ICON_ERROR, "Ó¦´ð¾ÍÐ÷Ê§°Ü£º%s", mes.c_str());
+		info.DoModal();
+	}
+	EndWaitCursor();
+}
+
+void CCCBar::OnBnClickedButtonBusy()
+{
+	// TODO: ÔÚ´ËÌí¼Ó¿Ø¼þÍ¨Öª´¦Àí³ÌÐò´úÂë
+	BeginWaitCursor();
+	LONG ret = BSetBusy();
+	if(AGENTBARERROR_SUCCESS != ret)
+	{
+		string mes;
+		Tool::GetAcdResult_Str(ret, mes);
+		CInfo info;
+		info.SetInfo(IDI_ICON_ERROR, "½ÓÌý¾ÍÐ÷Ê§°Ü£º%s", mes.c_str());
+		info.DoModal();
+	}
+	EndWaitCursor();
+}
+
+void CCCBar::OnBnClickedButtonSkillchange()
+{
+	// TODO: ÔÚ´ËÌí¼Ó¿Ø¼þÍ¨Öª´¦Àí³ÌÐò´úÂë
+	BeginWaitCursor();
+	LONG ret = BResetSkill("");
+	if(AGENTBARERROR_SUCCESS != ret)
+	{
+		string mes;
+		Tool::GetAcdResult_Str(ret, mes);
+		CInfo info;
+		info.SetInfo(IDI_ICON_ERROR, "¼¼ÄÜÇÐ»»Ê§°Ü£º%s", mes.c_str());
+		info.DoModal();
+	}
+	EndWaitCursor();
+}
+
+LRESULT CCCBar::OnAgentEvent(WPARAM wParam, LPARAM lParam)
+{
+	LONGLONG address = MAKELONGLONG(wParam, lParam);
+	acd::AgentEventT *pAE = reinterpret_cast<acd::AgentEventT *>(address);
+	Tool::WriteAgentEventLog(pAE, "out");
+
+	m_AgentStatus = pAE->agentStatus;
+	m_btnStatus.Reset();
+	m_beginStatusTime = CTime::GetCurrentTime();
+
+	m_strActiveCallID = pAE->callId;
+
+	try
+	{
+		switch(m_AgentStatus.get_value())
+		{
+		case acd::AgentStatusT::AsUnknownState:
+			{
+				m_stcAgentState.SetStaticexText("Î´Öª×´Ì¬");
+				break;
+			}
+		case acd::AgentStatusT::AsUnLoginState:
+			{
+				m_btnStatus.btnLogin = true;
+				m_stcAgentState.SetStaticexText("Î´Ç©Èë");
+				// ÖÕÖ¹×´Ì¬¶¨Ê±Æ÷£¬ËùÓÐÊ±¼ä¹éÁã
+				if(m_intIsSignIn)
+				{
+					KillTimer(TIMER_STATUS);
+					m_stcStateTime.SetStaticexText("00:00:00");
+					m_stcStateTime.Invalidate();
+					KillTimer(TIMER_TALK);
+					m_stcTalkTime.SetStaticexText("00:00:00");
+					m_stcTalkTime.Invalidate();
+					if(m_thrd_heartbeat.is_valid()){
+						m_thrd_heartbeat->stop();
+						m_thrd_heartbeat->join();
+						m_thrd_heartbeat=bgcc::SharedPointer<bgcc::Thread>(NULL);
+					}
+
+					m_totalTime = 0;
+					m_stcTotalTalkTime.SetStaticexText("00:00:00");
+					m_stcTotalTalkTime.Invalidate();
+				}
+				m_intIsSignIn = FALSE;
+				// ÊÂ¼þ»Øµ÷
+				p_m_BarCtrl->OnUnLogin(pAE->eventId.get_value(), pAE->callId.c_str(), pAE->sessionId, pAE->partyNum, pAE->otherParty.c_str(), pAE->otherAttr.get_value(), 
+					pAE->originatingParty.c_str(), pAE->originalAni.c_str(), pAE->originalDnis.c_str(), pAE->reason.get_value(), pAE->timestamp);
+				break;
+			}
+		case acd::AgentStatusT::AsReadyState:
+			{
+				m_btnStatus.btnLogout = true;
+				m_btnStatus.btnRest = true;
+				m_btnStatus.btnBusy = true;
+				m_btnStatus.btnSkill = true;
+				m_stcAgentState.SetStaticexText("½ÓÌý¾ÍÐ÷");
+				// Æô¶¯×´Ì¬¶¨Ê±Æ÷¡¢ÖÕÖ¹Í¨»°¶¨Ê±Æ÷
+				if(pAE->reason == acd::CallEventReasonT::CerIdleSelfLogin || pAE->reason == acd::CallEventReasonT::CerIdleOtherLogin)
+				{
+					SetTimer(TIMER_STATUS, TIMESPAN_STATUS, NULL);
+					m_thrd_heartbeat=bgcc::SharedPointer<bgcc::Thread>(new bgcc::Thread(bgcc::SharedPointer<HeartBeatTask>(new HeartBeatTask(this))));
+					if(m_thrd_heartbeat.is_valid()){
+						m_thrd_heartbeat->start();
+					}
+					m_lastStatusTime = CTime::GetCurrentTime();
+					// ³õÊ¼»¯ÐÝÏ¢Ô­Òò
+					m_cmbRest.ResetContent();
+					acd::StringListT reasons;
+					if(BGetRestReason(reasons) == AGENTBARERROR_SUCCESS)
+					{
+						for(acd::StringListT::iterator it = reasons.begin(); it != reasons.end(); it++)
+						{
+							m_cmbRest.AddString((*it).c_str());
+						}
+						if(m_cmbRest.GetCount() > 0)
+							m_cmbRest.SetCurSel(0);
+					}
+				}
+				else if(pAE->reason == acd::CallEventReasonT::CerIdleNormalSelfHangup 
+					|| pAE->reason == acd::CallEventReasonT::CerIdleNormalOtherHangup
+					|| pAE->reason == acd::CallEventReasonT::CerIdleErrorOtherHangup
+					|| pAE->reason == acd::CallEventReasonT::CerIdleErrorSelfHangup )
+				{
+					KillTimer(TIMER_TALK);
+				}
+				m_intIsSignIn = TRUE;
+				// ÊÂ¼þ»Øµ÷
+				p_m_BarCtrl->OnReady(pAE->eventId.get_value(), pAE->callId.c_str(), pAE->sessionId, pAE->partyNum, pAE->otherParty.c_str(), pAE->otherAttr.get_value(), 
+					pAE->originatingParty.c_str(), pAE->originalAni.c_str(), pAE->originalDnis.c_str(), pAE->reason.get_value(), pAE->timestamp);
+				break;
+			}
+		case acd::AgentStatusT::AsBusyState:
+			{
+				m_btnStatus.btnLogout = true;
+				m_btnStatus.btnCallout = true;
+				m_btnStatus.btnRest = true;
+				m_btnStatus.btnReady = true;
+				m_btnStatus.btnSkill = true;
+				m_stcAgentState.SetStaticexText("ºô³ö¾ÍÐ÷");
+				// Æô¶¯×´Ì¬¶¨Ê±Æ÷¡¢ÖÕÖ¹Í¨»°¶¨Ê±Æ÷
+				if(pAE->reason == acd::CallEventReasonT::CerIdleSelfLogin || pAE->reason == acd::CallEventReasonT::CerIdleOtherLogin)
+				{
+					SetTimer(TIMER_STATUS, TIMESPAN_STATUS, NULL);
+					m_thrd_heartbeat=bgcc::SharedPointer<bgcc::Thread>(new bgcc::Thread(bgcc::SharedPointer<HeartBeatTask>(new HeartBeatTask(this))));
+					if(m_thrd_heartbeat.is_valid()){
+						m_thrd_heartbeat->start();
+					}
+					m_lastStatusTime = CTime::GetCurrentTime();
+					// ³õÊ¼»¯ÐÝÏ¢Ô­Òò
+					m_cmbRest.ResetContent();
+					acd::StringListT reasons;
+					if(BGetRestReason(reasons) == AGENTBARERROR_SUCCESS)
+					{
+						for(acd::StringListT::iterator it = reasons.begin(); it != reasons.end(); it++)
+						{
+							m_cmbRest.AddString((*it).c_str());
+						}
+						if(m_cmbRest.GetCount() > 0)
+							m_cmbRest.SetCurSel(0);
+					}
+				}
+				else if(pAE->reason == acd::CallEventReasonT::CerIdleNormalSelfHangup 
+					|| pAE->reason == acd::CallEventReasonT::CerIdleNormalOtherHangup
+					|| pAE->reason == acd::CallEventReasonT::CerIdleErrorOtherHangup
+					|| pAE->reason == acd::CallEventReasonT::CerIdleErrorSelfHangup )
+				{
+					KillTimer(TIMER_TALK);
+				}
+				m_intIsSignIn = TRUE;
+				// ÊÂ¼þ»Øµ÷
+				p_m_BarCtrl->OnBusy(pAE->eventId.get_value(), pAE->callId.c_str(), pAE->sessionId, pAE->partyNum, pAE->otherParty.c_str(), pAE->otherAttr.get_value(), 
+					pAE->originatingParty.c_str(), pAE->originalAni.c_str(), pAE->originalDnis.c_str(), pAE->reason.get_value(), pAE->timestamp);
+				break;
+			}
+		case acd::AgentStatusT::AsRestState:
+			{
+				m_btnStatus.btnReady = true;
+				m_btnStatus.btnBusy = true;
+				m_stcAgentState.SetStaticexText("ÐÝÏ¢");
+				int index = m_cmbRest.GetCurSel();
+				CString reason;
+				if(index != -1)
+					m_cmbRest.GetLBText(index, reason);
+				// ÊÂ¼þ»Øµ÷
+				p_m_BarCtrl->OnRest(pAE->eventId.get_value(), pAE->callId.c_str(), pAE->sessionId, pAE->partyNum, pAE->otherParty.c_str(), pAE->otherAttr.get_value(), 
+					pAE->originatingParty.c_str(), pAE->originalAni.c_str(), pAE->originalDnis.c_str(), pAE->reason.get_value(), pAE->timestamp, reason);
+				break;
+			}
+		case acd::AgentStatusT::AsLockState:
+			{
+				m_stcAgentState.SetStaticexText("Ô¤Õ¼");
+				// ÊÂ¼þ»Øµ÷
+				p_m_BarCtrl->OnLock(pAE->eventId.get_value(), pAE->callId.c_str(), pAE->sessionId, pAE->partyNum, pAE->otherParty.c_str(), pAE->otherAttr.get_value(), 
+					pAE->originatingParty.c_str(), pAE->originalAni.c_str(), pAE->originalDnis.c_str(), pAE->reason.get_value(), pAE->timestamp);
+				break;
+			}
+		case acd::AgentStatusT::AsAlertingState:
+			{
+				// Ô­Ê¼Ö÷±»½Ð
+				m_callingNo = pAE->otherParty.c_str();
+				m_orgCallingNo = pAE->originalAni.c_str();
+				m_calledNo = pAE->agentDn.c_str();
+				m_orgCalledNo = pAE->originalDnis.c_str();
+				//
+				if(m_intIsSIPPhone)		// xiangmao
+				{
+					m_btnStatus.btnAnswer = true;
+					if(m_intAutoAnswer)
+						BAnswer();
+				}
+				m_stcAgentState.SetStaticexText("ÕñÁå");
+				// ÊÂ¼þ»Øµ÷
+				p_m_BarCtrl->OnAlerting(pAE->eventId.get_value(), pAE->callId.c_str(), pAE->sessionId, pAE->partyNum, pAE->otherParty.c_str(), pAE->otherAttr.get_value(), 
+					pAE->originatingParty.c_str(), pAE->originalAni.c_str(), pAE->originalDnis.c_str(), pAE->reason.get_value(), pAE->timestamp);
+				break;
+			}
+		case acd::AgentStatusT::AsHalfAlertingState:
+			{
+				if(m_intIsSIPPhone)		// xiangmao
+				{
+					m_btnStatus.btnAnswer = true;
+					if(m_intAutoAnswer)
+						BAnswer();
+				}
+				m_stcAgentState.SetStaticexText("°ëÕñÁå");
+				// ÊÂ¼þ»Øµ÷
+				p_m_BarCtrl->OnHarfAlerting(pAE->eventId.get_value(), pAE->callId.c_str(), pAE->sessionId, pAE->partyNum, pAE->otherParty.c_str(), pAE->otherAttr.get_value(), 
+					pAE->originatingParty.c_str(), pAE->originalAni.c_str(), pAE->originalDnis.c_str(), pAE->reason.get_value(), pAE->timestamp);
+				break;
+			}
+		case acd::AgentStatusT::AsConnectingState:
+			{
+				// Ô­Ê¼Ö÷±»½Ð
+				m_callingNo = pAE->agentDn.c_str();
+				m_orgCallingNo = pAE->originalAni.c_str();
+				m_calledNo = pAE->otherParty.c_str();
+				m_orgCalledNo = pAE->originalDnis.c_str();
+				//
+				m_btnStatus.btnHangup = true;
+				m_stcAgentState.SetStaticexText("ºô³öÖÐ");
+				// ÊÂ¼þ»Øµ÷
+				p_m_BarCtrl->OnConnecting(pAE->eventId.get_value(), pAE->callId.c_str(), pAE->sessionId, pAE->partyNum, pAE->otherParty.c_str(), pAE->otherAttr.get_value(), 
+					pAE->originatingParty.c_str(), pAE->originalAni.c_str(), pAE->originalDnis.c_str(), pAE->reason.get_value(), pAE->timestamp);
+				break;
+			}
+		case acd::AgentStatusT::AsConnectedState:
+			{
+				// Ô­Ê¼Ö÷±»½Ð
+				m_btnStatus.btnSenddtmf = true;
+				m_btnStatus.btnHangup = true;
+				m_btnStatus.btnHold = true;
+				m_btnStatus.btnConsult = true;
+				m_btnStatus.btnSSTransfer = true;
+				m_stcAgentState.SetStaticexText("Í¨»°");
+				// ¿ªÊ¼Í¨»°¶¨Ê±Æ÷
+				if(pAE->reason == acd::CallEventReasonT::CerTalkSelfCreat || pAE->reason == acd::CallEventReasonT::CerTalkOtherCreat)
+				{
+					SetTimer(TIMER_TALK, TIMESPAN_TALK, NULL);
+					m_beginTalkTime = CTime::GetCurrentTime();
+					m_lastTalkTime = m_beginTalkTime;
+				}
+				// ÊÂ¼þ»Øµ÷
+				p_m_BarCtrl->OnConnected(pAE->eventId.get_value(), pAE->callId.c_str(), pAE->sessionId, pAE->partyNum, pAE->otherParty.c_str(), pAE->otherAttr.get_value(), 
+					pAE->originatingParty.c_str(), pAE->originalAni.c_str(), pAE->originalDnis.c_str(), pAE->reason.get_value(), pAE->timestamp);
+				break;
+			}
+		case acd::AgentStatusT::AsHalfConnectedState:
+			{
+				m_stcAgentState.SetStaticexText("°ëÍ¨»°");
+				// ÊÂ¼þ»Øµ÷
+				p_m_BarCtrl->OnHarfConnected(pAE->eventId.get_value(), pAE->callId.c_str(), pAE->sessionId, pAE->partyNum, pAE->otherParty.c_str(), pAE->otherAttr.get_value(), 
+					pAE->originatingParty.c_str(), pAE->originalAni.c_str(), pAE->originalDnis.c_str(), pAE->reason.get_value(), pAE->timestamp);
+				break;
+			}
+		case acd::AgentStatusT::AsInternalConnectedState:
+			{
+				m_btnStatus.btnHangup = true;
+				m_stcAgentState.SetStaticexText("ÄÚ²¿Í¨»°");
+				// ¿ªÊ¼Í¨»°¶¨Ê±Æ÷
+				if(pAE->reason == acd::CallEventReasonT::CerTalkSelfCreat || pAE->reason == acd::CallEventReasonT::CerTalkOtherCreat)
+				{
+					SetTimer(TIMER_TALK, TIMESPAN_TALK, NULL);
+					m_beginTalkTime = CTime::GetCurrentTime();
+					m_lastTalkTime = m_beginTalkTime;
+				}
+				// ÊÂ¼þ»Øµ÷
+				p_m_BarCtrl->OnInternalConnected(pAE->eventId.get_value(), pAE->callId.c_str(), pAE->sessionId, pAE->partyNum, pAE->otherParty.c_str(), pAE->otherAttr.get_value(), 
+					pAE->originatingParty.c_str(), pAE->originalAni.c_str(), pAE->originalDnis.c_str(), pAE->reason.get_value(), pAE->timestamp);
+				break;
+			}
+		case acd::AgentStatusT::AsSuspendedState:
+			{
+				m_btnStatus.btnRetrieve = true;
+				m_stcAgentState.SetStaticexText("±£³Ö");
+				// ÊÂ¼þ»Øµ÷
+				p_m_BarCtrl->OnSuspended(pAE->eventId.get_value(), pAE->callId.c_str(), pAE->sessionId, pAE->partyNum, pAE->otherParty.c_str(), pAE->otherAttr.get_value(), 
+					pAE->originatingParty.c_str(), pAE->originalAni.c_str(), pAE->originalDnis.c_str(), pAE->reason.get_value(), pAE->timestamp);
+				break;
+			}
+		case acd::AgentStatusT::AsConsultConnectingState:
+			{
+				m_btnStatus.btnReconnect = true;
+				m_stcAgentState.SetStaticexText("×ÉÑ¯");
+				// ÊÂ¼þ»Øµ÷
+				p_m_BarCtrl->OnConsultConnecting(pAE->eventId.get_value(), pAE->callId.c_str(), pAE->sessionId, pAE->partyNum, pAE->otherParty.c_str(), pAE->otherAttr.get_value(), 
+					pAE->originatingParty.c_str(), pAE->originalAni.c_str(), pAE->originalDnis.c_str(), pAE->reason.get_value(), pAE->timestamp);
+				break;
+			}
+		case acd::AgentStatusT::AsConsultConnectedState:
+			{
+				m_btnStatus.btnReconnect = true;
+				m_btnStatus.btnTransfer = true;
+				m_btnStatus.btnConference = true;
+				m_stcAgentState.SetStaticexText("×ÉÑ¯Í¨»°");
+				// ÊÂ¼þ»Øµ÷
+				p_m_BarCtrl->OnConsultConnected(pAE->eventId.get_value(), pAE->callId.c_str(), pAE->sessionId, pAE->partyNum, pAE->otherParty.c_str(), pAE->otherAttr.get_value(), 
+					pAE->originatingParty.c_str(), pAE->originalAni.c_str(), pAE->originalDnis.c_str(), pAE->reason.get_value(), pAE->timestamp);
+				break;
+			}
+		case acd::AgentStatusT::AsConferenceState:
+			{
+				m_btnStatus.btnHangup = true;
+				m_stcAgentState.SetStaticexText("»áÒé");
+				// ÊÂ¼þ»Øµ÷
+				p_m_BarCtrl->OnConference(pAE->eventId.get_value(), pAE->callId.c_str(), pAE->sessionId, pAE->partyNum, pAE->otherParty.c_str(), pAE->otherAttr.get_value(), 
+					pAE->originatingParty.c_str(), pAE->originalAni.c_str(), pAE->originalDnis.c_str(), pAE->reason.get_value(), pAE->timestamp);
+				break;
+			}
+		case acd::AgentStatusT::AsMonitorState:
+			{
+				// Ô­Ê¼Ö÷±»½Ð
+				m_callingNo = pAE->agentDn.c_str();
+				m_orgCallingNo = pAE->originalAni.c_str();
+				m_calledNo = pAE->otherParty.c_str();
+				m_orgCalledNo = pAE->originalDnis.c_str();
+				//
+				m_btnStatus.btnHangup = true;
+				m_stcAgentState.SetStaticexText("¼àÌý");
+				// Æô¶¯Í¨»°¶¨Ê±Æ÷
+				SetTimer(TIMER_TALK, TIMESPAN_TALK, NULL);
+				m_beginTalkTime = CTime::GetCurrentTime();
+				m_lastTalkTime = m_beginTalkTime;
+				// ÊÂ¼þ»Øµ÷
+				p_m_BarCtrl->OnMonitor(pAE->eventId.get_value(), pAE->callId.c_str(), pAE->sessionId, pAE->partyNum, pAE->otherParty.c_str(), pAE->otherAttr.get_value(), 
+					pAE->originatingParty.c_str(), pAE->originalAni.c_str(), pAE->originalDnis.c_str(), pAE->reason.get_value(), pAE->timestamp);
+				break;
+			}
+		case acd::AgentStatusT::AsInsertState:
+			{
+				// Ô­Ê¼Ö÷±»½Ð
+				m_callingNo = pAE->agentDn.c_str();
+				m_orgCallingNo = pAE->originalAni.c_str();
+				m_calledNo = pAE->otherParty.c_str();
+				m_orgCalledNo = pAE->originalDnis.c_str();
+				//
+				m_btnStatus.btnHangup = true;
+				m_stcAgentState.SetStaticexText("Ç¿²å");
+				// Æô¶¯Í¨»°¶¨Ê±Æ÷
+				SetTimer(TIMER_TALK, TIMESPAN_TALK, NULL);
+				m_beginTalkTime = CTime::GetCurrentTime();
+				m_lastTalkTime = m_beginTalkTime;
+				// ÊÂ¼þ»Øµ÷
+				p_m_BarCtrl->OnInsert(pAE->eventId.get_value(), pAE->callId.c_str(), pAE->sessionId, pAE->partyNum, pAE->otherParty.c_str(), pAE->otherAttr.get_value(), 
+					pAE->originatingParty.c_str(), pAE->originalAni.c_str(), pAE->originalDnis.c_str(), pAE->reason.get_value(), pAE->timestamp);
+				break;
+			}
+		case acd::AgentStatusT::AsMonitoredState:
+			{
+				m_btnStatus.btnHangup = true;
+				m_stcAgentState.SetStaticexText("±»¼àÌý");
+				// ÊÂ¼þ»Øµ÷
+				p_m_BarCtrl->OnMonitored(pAE->eventId.get_value(), pAE->callId.c_str(), pAE->sessionId, pAE->partyNum, pAE->otherParty.c_str(), pAE->otherAttr.get_value(), 
+					pAE->originatingParty.c_str(), pAE->originalAni.c_str(), pAE->originalDnis.c_str(), pAE->reason.get_value(), pAE->timestamp);
+				break;
+			}
+		case acd::AgentStatusT::AsInsertedState:
+			{
+				m_btnStatus.btnHangup = true;
+				m_stcAgentState.SetStaticexText("±»Ç¿²å");
+				// ÊÂ¼þ»Øµ÷
+				p_m_BarCtrl->OnInserted(pAE->eventId.get_value(), pAE->callId.c_str(), pAE->sessionId, pAE->partyNum, pAE->otherParty.c_str(), pAE->otherAttr.get_value(), 
+					pAE->originatingParty.c_str(), pAE->originalAni.c_str(), pAE->originalDnis.c_str(), pAE->reason.get_value(), pAE->timestamp);
+				break;
+			}
+		default:
+			{
+				m_stcAgentState.SetStaticexText("´íÎó×´Ì¬");
+				break;
+			}
+		}
+	}
+	catch(...)
+	{
+		Tool::m_Logger.WriteLog("CCCBar", "OnAgentEvent", "catch Error", AGENTBARERROR_BAR_OUTEVENTERROR);
+	}
+
+	SetButton();
+	m_stcAgentState.Invalidate();
+    p_m_BarCtrl->OnBtnStatus(m_btnStatus.StatusAsLonglong(), m_stcAgentState.GetStaticexText());  // Í¨Öª×´Ì¬¸Ä±ä
+
+	m_lastBtnStatus = m_btnStatus;
+
+	delete pAE;
+	return 0;
+}
+
+LRESULT CCCBar::OnMediaEvent(WPARAM wParam, LPARAM lParam)
+{
+	LONGLONG address = MAKELONGLONG(wParam, lParam);
+	acd::MediaEventT *pME = reinterpret_cast<acd::MediaEventT *>(address);
+	Tool::WriteMediaEventLog(pME, "out");
+
+	try
+	{
+		switch(pME->eventType.get_value())
+		{
+		case acd::MediaEventTypeT::MeUnKownEvent:
+			break;
+		case acd::MediaEventTypeT::MeTpRecordStarted:
+			p_m_BarCtrl->OnBeginRecord(pME->callId.c_str(), pME->sessionId, pME->buffer.c_str(), pME->reason.get_value(), pME->timestamp);
+			break;
+		case acd::MediaEventTypeT::MeTpRecordDone:
+			p_m_BarCtrl->OnEndRecord(pME->callId.c_str(), pME->sessionId, pME->buffer.c_str(), pME->reason.get_value(), pME->timestamp);
+			break;
+		default:
+			break;
+		}
+	}
+	catch(...)
+	{
+		Tool::m_Logger.WriteLog("CCCBar", "OnMediaEvent", "catch Error", AGENTBARERROR_BAR_OUTEVENTERROR);
+	}
+
+	delete pME;
+	return 0;
+}
+
+LRESULT CCCBar::OnRouteEvent(WPARAM wParam, LPARAM lParam)
+{
+	LONGLONG address = MAKELONGLONG(wParam, lParam);
+	acd::RouteEventT *pQE = reinterpret_cast<acd::RouteEventT *>(address);
+	Tool::WriteRouteEventLog(pQE, "out");
+
+	try
+	{
+		switch(pQE->eventType.get_value())
+		{
+		case acd::RouteEventTypeT::ReInQueue:
+			p_m_BarCtrl->OnInprivatequeue(pQE->callId.c_str(), pQE->sessionId, pQE->requestId, pQE->originalAni.c_str(), pQE->originalDnis.c_str(), 0, pQE->timestamp);
+			break;
+		case acd::RouteEventTypeT::ReOutQueue:
+			p_m_BarCtrl->OnOutprivatequeue(pQE->callId.c_str(), pQE->sessionId, pQE->requestId, pQE->originalAni.c_str(), pQE->originalDnis.c_str(), 0, pQE->timestamp);
+			break;
+		default:
+			break;
+		}
+	}
+	catch(...)
+	{
+		Tool::m_Logger.WriteLog("CCCBar", "OnRouteEvent", "catch Error", AGENTBARERROR_BAR_OUTEVENTERROR);
+	}
+
+	delete pQE;
+	return 0;
+}
+
+LRESULT CCCBar::OnOtherEvent(WPARAM wParam, LPARAM lParam)
+{
+	LONGLONG address = MAKELONGLONG(wParam, lParam);
+	acd::OtherEventT *pOE = reinterpret_cast<acd::OtherEventT *>(address);
+	Tool::WriteOtherEventLog(pOE, "out");
+
+	try
+	{
+		switch(pOE->eventType.get_value())
+		{
+		case acd::OtherEventTypeT::IMSDisconnect:
+			{
+				Tool::m_Logger.WriteLog("CCCBar", "OnOtherEvent", "IMS Disconnect", EVENTREASON_IMS_DISCONNECT);
+				p_m_BarCtrl->OnCTIDisconnect(pOE->callId.c_str(), pOE->sessionId, pOE->originalAni.c_str(), pOE->originalDnis.c_str(), EVENTREASON_IMS_DISCONNECT, pOE->timestamp);
+				break;
+			}
+		case acd::OtherEventTypeT::IMSMasterChange:
+			{
+				CInfo info;
+				info.SetInfo(IDI_ICON_INFOMATION, "IMSÖ÷±¸µ¹»»Íê³É£¡");
+				info.DoModal();
+				Tool::m_Logger.WriteLog("CCCBar", "OnOtherEvent", "IMS MasterChange", EVENTREASON_IMS_MASTERCHANGE);
+				p_m_BarCtrl->OnCTIMasterChanged(pOE->callId.c_str(), pOE->sessionId, pOE->originalAni.c_str(), pOE->originalDnis.c_str(), EVENTREASON_IMS_MASTERCHANGE, pOE->timestamp);
+				break;
+			}
+		case acd::OtherEventTypeT::IMSOperationFailed:
+			{
+				CInfo info;
+				info.SetInfo(IDI_ICON_INFOMATION, "±¾·½Î´Ó¦´ð£¡");
+				info.DoModal();
+				Tool::m_Logger.WriteLog("CCCBar", "OnOtherEvent", "IMS OperationFailed", EVENTREASON_IMS_OPERATIONFAILED);
+				p_m_BarCtrl->OnOperationFailed(pOE->callId.c_str(), pOE->sessionId, pOE->originalAni.c_str(), pOE->originalDnis.c_str(), EVENTREASON_IMS_OPERATIONFAILED, pOE->timestamp);
+				break;
+			}
+		case acd::OtherEventTypeT::ACDDisconnect:
+			{
+				Tool::m_Logger.WriteLog("CCCBar", "OnOtherEvent", "ACD Disconnect", EVENTREASON_ACD_DISCONNECT);
+				p_m_BarCtrl->OnCTIDisconnect(pOE->callId.c_str(), pOE->sessionId, pOE->originalAni.c_str(), pOE->originalDnis.c_str(), EVENTREASON_ACD_DISCONNECT, pOE->timestamp);
+				break;
+			}
+		case acd::OtherEventTypeT::ACDMasterChange:
+			{
+				CInfo info;
+				info.SetInfo(IDI_ICON_INFOMATION, "ACDÖ÷±¸µ¹»»Íê³É£¡");
+				info.DoModal();
+				Tool::m_Logger.WriteLog("CCCBar", "OnOtherEvent", "ACD MasterChange", EVENTREASON_ACD_MASTERCHANGE);
+				p_m_BarCtrl->OnCTIMasterChanged(pOE->callId.c_str(), pOE->sessionId, pOE->originalAni.c_str(), pOE->originalDnis.c_str(), EVENTREASON_ACD_MASTERCHANGE, pOE->timestamp);
+				break;
+			}
+		case acd::OtherEventTypeT::ACDOperationFailed:
+			{
+				CInfo info;
+				info.SetInfo(IDI_ICON_INFOMATION, "ÍøÂç»òÕßACD·þÎñÒì³££¡");
+				info.DoModal();
+				Tool::m_Logger.WriteLog("CCCBar", "OnOtherEvent", "ACD OperationFailed", EVENTREASON_ACD_OPERATIONFAILED);
+				p_m_BarCtrl->OnOperationFailed(pOE->callId.c_str(), pOE->sessionId, pOE->originalAni.c_str(), pOE->originalDnis.c_str(), EVENTREASON_ACD_OPERATIONFAILED, pOE->timestamp);
+				break;
+			}
+		case acd::OtherEventTypeT::ACDReLoginSuccess:
+			{
+				CInfo info;
+				info.SetInfo(IDI_ICON_INFOMATION, "ACDÖØÇ©³É¹¦£¡");
+				info.DoModal();
+				Tool::m_Logger.WriteLog("CCCBar", "OnOtherEvent", "ACD ReLoginSuccess", EVENTREASON_ACD_RELOGINSUCCESS);
+				p_m_BarCtrl->OnCTIMasterChanged(pOE->callId.c_str(), pOE->sessionId, pOE->originalAni.c_str(), pOE->originalDnis.c_str(), EVENTREASON_ACD_RELOGINSUCCESS, pOE->timestamp);
+				break;
+			}
+		case acd::OtherEventTypeT::ACDReLoginFailed:
+			{
+				CInfo info;
+				info.SetInfo(IDI_ICON_INFOMATION, "ACDÖØÇ©Ê§°Ü£¡");
+				info.DoModal();
+				Tool::m_Logger.WriteLog("CCCBar", "OnOtherEvent", "ACD ReLoginFailed", EVENTREASON_ACD_RELOGINFAILED);
+				p_m_BarCtrl->OnOperationFailed(pOE->callId.c_str(), pOE->sessionId, pOE->originalAni.c_str(), pOE->originalDnis.c_str(), EVENTREASON_ACD_RELOGINFAILED, pOE->timestamp);
+				break;
+			}
+		default:
+			break;
+		}
+	}
+	catch(...)
+	{
+		Tool::m_Logger.WriteLog("CCCBar", "OnOtherEvent", "catch Error", AGENTBARERROR_BAR_OUTEVENTERROR);
+	}
+
+	delete pOE;
+	return 0;
+}
+
+LONG CCCBar::BInitial()
+{
+	Tool::m_Logger.SetLogLevel(m_intLogLevel);
+
+	LONG ret = AGENTBARERROR_SUCCESS;
+	if(m_AgentStatus != acd::AgentStatusT::AsUnknownState)
+	{
+		ret = AGENTBARERROR_BAR_WRONGSTATE;
+		Tool::m_Logger.WriteLog("CCCBar", "BInitial", "Status Error", ret);
+	}
+	else
+	{
+		if(m_intIsSIPPhone)
+		{
+			ret = m_sip.SipInitial();
+			if(ret != AGENTBARERROR_SUCCESS)
+				return ret;
+		}
+
+		ret = m_acd.AcdInitial(m_strMainCTIIP, m_strBackCTIIP, m_intCTIPort);
+		if(ret == AGENTBARERROR_SUCCESS)
+		{
+			m_btnStatus.btnLogin = true;
+			SetButton();
+
+			m_AgentStatus = acd::AgentStatusT::AsUnLoginState;
+			m_intIsInitial = TRUE;
+
+			m_lastBtnStatus = m_btnStatus;
+		}
+	}
+	return ret;
+}
+
+LONG CCCBar::BUnInitial()
+{
+	LONG ret = AGENTBARERROR_SUCCESS;
+	if(m_AgentStatus != acd::AgentStatusT::AsUnLoginState)
+	{
+		ret = AGENTBARERROR_BAR_WRONGSTATE;
+		Tool::m_Logger.WriteLog("CCCBar", "BUnInitial", "Status Error", ret);
+	}
+	else
+	{
+		ret = m_acd.AcdUnInitial();
+		if(ret == AGENTBARERROR_SUCCESS)
+		{
+			m_btnStatus.Reset();
+			SetButton();
+
+			m_AgentStatus = acd::AgentStatusT::AsUnknownState;
+			m_intIsInitial = FALSE;
+
+			m_lastBtnStatus.Reset();
+		}
+		else
+		{
+			return ret;
+		}
+
+		if(m_intIsSIPPhone)
+		{
+			ret = m_sip.SipUnInitial();
+		}
+	}
+	return ret;
+}
+
+LONG CCCBar::BSignIn()
+{
+	LONG ret = AGENTBARERROR_SUCCESS;
+	if(m_AgentStatus != acd::AgentStatusT::AsUnLoginState)
+	{
+		ret = AGENTBARERROR_BAR_WRONGSTATE;
+		Tool::m_Logger.WriteLog("CCCBar", "BSignIn", "Status Error", ret);
+	}
+	else
+	{
+		m_lDetaTime = 0;
+		if(m_intIsSIPPhone)
+		{
+			ret = m_sip.SipRegister(m_strSIPServerIP, m_intSIPServerPort, m_strPhoneNum, m_strPhonePwd, m_intTimeOut);
+			if(ret != AGENTBARERROR_SUCCESS)
+				return ret;
+		}
+
+		// ³¢ÊÔÖ÷
+		ret = m_acd.AcdSignIn(m_strAgentID, m_strDN, m_strPassWord, m_intStatusChangeType, !!m_intAutoAnswer, !!m_intForceSignIn, m_strServiceList);
+		if(ret == AGENTBARERROR_BGCC_EXCEPTION || ret == acd::AcdResultT::ArNotMaster)// Ö÷¹ÊÕÏ
+		{
+			// ³¢ÊÔ±¸
+			m_acd.AcdBackup();
+			ret = m_acd.AcdSignIn(m_strAgentID, m_strDN, m_strPassWord, m_intStatusChangeType, !!m_intAutoAnswer, !!m_intForceSignIn, m_strServiceList);
+		}
+		
+		if(AGENTBARERROR_SUCCESS == ret)
+		{
+			LONGLONG timestamp = 0;
+			DWORD start_call = GetTickCount();
+			ret = m_acd.AcdSynchronizeCTITime(m_strAgentID, timestamp);
+			DWORD end_call = GetTickCount();
+			if(AGENTBARERROR_SUCCESS == ret)
+			{
+				m_lDetaTime = timestamp - static_cast<LONGLONG>(start_call) * 1000 - (static_cast<LONGLONG>(end_call) - static_cast<LONGLONG>(start_call)) * 1000 / 2;
+			}
+			Tool::m_Logger.WriteLog(Level_High, "[CCCBar-BSignIn] [out] datetime:%I64d", m_lDetaTime);
+		}
+	}
+	return ret;
+}
+
+LONG CCCBar::BSignOut()
+{
+	LONG ret = AGENTBARERROR_SUCCESS;
+	if(m_AgentStatus != acd::AgentStatusT::AsReadyState && m_AgentStatus != acd::AgentStatusT::AsBusyState)
+	{
+		ret = AGENTBARERROR_BAR_WRONGSTATE;
+		Tool::m_Logger.WriteLog("CCCBar", "BSignOut", "Status Error", ret);
+	}
+	else
+	{
+		ret = m_acd.AcdSignOut(m_strAgentID);
+		if(ret != AGENTBARERROR_SUCCESS)
+		{
+			return ret;
+		}
+
+		if(m_intIsSIPPhone)
+		{
+			ret = m_sip.SipUnRegister();
+		}
+	}
+	return ret;
+}
+
+LONG CCCBar::BSetIdle()
+{
+	LONG ret = AGENTBARERROR_SUCCESS;
+	if(m_AgentStatus != acd::AgentStatusT::AsBusyState && m_AgentStatus != acd::AgentStatusT::AsRestState)
+	{
+		ret = AGENTBARERROR_BAR_WRONGSTATE;
+		Tool::m_Logger.WriteLog("CCCBar", "BSetIdle", "Status Error", ret);
+	}
+	else
+	{
+		ret = m_acd.AcdSetAgentStatus(m_strAgentID, acd::AgentStatusT::AsReadyState);
+	}
+	return ret;
+}
+
+LONG CCCBar::BSetBusy()
+{
+	LONG ret = AGENTBARERROR_SUCCESS;
+	if(m_AgentStatus != acd::AgentStatusT::AsReadyState && m_AgentStatus != acd::AgentStatusT::AsRestState)
+	{
+		ret = AGENTBARERROR_BAR_WRONGSTATE;
+		Tool::m_Logger.WriteLog("CCCBar", "BSetBusy", "Status Error", ret);
+	}
+	else
+	{
+		ret = m_acd.AcdSetAgentStatus(m_strAgentID, acd::AgentStatusT::AsBusyState);
+	}
+	return ret;
+}
+
+LONG CCCBar::BSetRest(const char *reason)
+{
+	LONG ret = AGENTBARERROR_SUCCESS;
+	if(m_AgentStatus != acd::AgentStatusT::AsReadyState && m_AgentStatus != acd::AgentStatusT::AsBusyState)
+	{
+		ret = AGENTBARERROR_BAR_WRONGSTATE;
+		Tool::m_Logger.WriteLog("CCCBar", "BSetRest", "Status Error", ret);
+	}
+	else
+	{
+		ret = m_acd.AcdSetAgentStatus(m_strAgentID, acd::AgentStatusT::AsRestState, reason);
+	}
+	return ret;
+}
+
+LONG CCCBar::BGetAgentStatus(acd::AgentStatusT &agentStatus)
+{
+	LONG ret = AGENTBARERROR_SUCCESS;
+	if(m_AgentStatus == acd::AgentStatusT::AsUnknownState || m_AgentStatus == acd::AgentStatusT::AsUnLoginState)
+	{
+		ret = AGENTBARERROR_BAR_WRONGSTATE;
+		Tool::m_Logger.WriteLog("CCCBar", "BGetAgentStatus", "Status Error", ret);
+	}
+	else
+	{
+		agentStatus = m_AgentStatus;
+	}
+	return ret;
+}
+
+LONG CCCBar::BResetSkill(const char *skillList)
+{
+	LONG ret = AGENTBARERROR_SUCCESS;
+	if(m_AgentStatus != acd::AgentStatusT::AsReadyState && m_AgentStatus != acd::AgentStatusT::AsBusyState)
+	{
+		ret = AGENTBARERROR_BAR_WRONGSTATE;
+		Tool::m_Logger.WriteLog("CCCBar", "BResetSkill", "Status Error", ret);
+	}
+	else
+	{
+		ret = m_acd.AcdResetSkill(m_strAgentID, skillList);
+	}
+	return ret;
+}
+
+LONG CCCBar::BReset()
+{
+	LONG ret = AGENTBARERROR_SUCCESS;
+	if(m_AgentStatus == acd::AgentStatusT::AsUnknownState || m_AgentStatus == acd::AgentStatusT::AsUnLoginState)
+	{
+		ret = AGENTBARERROR_BAR_WRONGSTATE;
+		Tool::m_Logger.WriteLog("CCCBar", "BReset", "Status Error", ret);
+	}
+	else
+	{
+		// ¹Ò¶Ï¡¢Ç©³ö
+		ret = m_acd.AcdReset(m_strAgentID);
+		if(ret == AGENTBARERROR_SUCCESS)
+		{
+			// Ç©³ö×øÏ¯
+			PostMessageEx(acd::AgentStatusT::AsUnLoginState, acd::CallEventReasonT::CerUnloginSelfForceout);
+		}
+		else
+		{
+			return ret;
+		}
+
+		if(m_intIsSIPPhone)
+		{
+			ret = m_sip.SipUnRegister();
+		}
+	}
+	return ret;
+}
+
+LONG CCCBar::BMakeCall(const char *dest, const char *showANI, const char *showDest, acd::CallModeT callMode, acd::CallTypeT callType)
+{
+	LONG ret = AGENTBARERROR_SUCCESS;
+    string t_dest = string(dest);
+    unsigned int len = t_dest.length();
+	m_singlestepTransferNum = "";
+    for (int i = 0; i < len; i++){
+        if ((t_dest.at(i) < '0' || t_dest.at(i) > '9') && t_dest.at(i) != '-'){
+            ret = AGENTBARERROR_BAR_WRONGNUM;
+            Tool::m_Logger.WriteLog("CCCBar", "BMakeCall", "dest num is not in true format", ret);
+            return ret;
+        }
+    }
+	if(m_AgentStatus != acd::AgentStatusT::AsBusyState)
+	{
+		ret = AGENTBARERROR_BAR_WRONGSTATE;
+		Tool::m_Logger.WriteLog("CCCBar", "BMakeCall", "Status Error", ret);
+	}
+	else
+	{
+		CString callerId;
+		switch(callType.get_value())
+		{
+		case acd::CallTypeT::CtAgent:
+			callerId = m_strAgentTag + m_strDN;
+			break;
+		case acd::CallTypeT::CtOut:
+			callerId = m_strDN;
+			break;
+		default:
+			callerId = m_strDN;
+			break;
+		}
+		ret = m_acd.AcdOutboundCall(m_strAgentID, callerId, dest, showANI, showDest, m_intTimeOut, callMode, callType);
+	}
+	return ret;
+}
+
+LONG CCCBar::BAnswer()
+{
+	LONG ret = AGENTBARERROR_SUCCESS;
+	if(m_AgentStatus != acd::AgentStatusT::AsAlertingState && m_AgentStatus != acd::AgentStatusT::AsHalfAlertingState)
+	{
+		ret = AGENTBARERROR_BAR_WRONGSTATE;
+		Tool::m_Logger.WriteLog("CCCBar", "BAnswer", "Status Error", ret);
+	}
+	else
+	{
+		if(m_intIsSIPPhone)		// suxiangmao
+		{
+			ret = m_sip.SipAnswercall();
+		}
+		else
+		{
+			ret = AGENTBARERROR_BAR_ANSWERERROR;
+		}
+	}
+	return ret;
+}
+
+LONG CCCBar::BReleaseCall()
+{
+	LONG ret = AGENTBARERROR_SUCCESS;
+	if(m_AgentStatus == acd::AgentStatusT::AsUnknownState || m_AgentStatus == acd::AgentStatusT::AsUnLoginState)
+	{
+		ret = AGENTBARERROR_BAR_WRONGSTATE;
+		Tool::m_Logger.WriteLog("CCCBar", "BReleaseCall", "Status Error", ret);
+	}
+	else
+	{
+		ret = m_acd.AcdReleaseCall(m_strAgentID);
+	}
+	return ret;
+}
+
+LONG CCCBar::BHold()
+{
+	LONG ret = AGENTBARERROR_SUCCESS;
+	if(m_AgentStatus != acd::AgentStatusT::AsConnectedState)
+	{
+		ret = AGENTBARERROR_BAR_WRONGSTATE;
+		Tool::m_Logger.WriteLog("CCCBar", "BHold", "Status Error", ret);
+	}
+	else
+	{
+		ret = m_acd.AcdHold(m_strAgentID);
+	}
+	return ret;
+}
+
+LONG CCCBar::BRetrieve()
+{
+	LONG ret = AGENTBARERROR_SUCCESS;
+	if(m_AgentStatus != acd::AgentStatusT::AsSuspendedState)
+	{
+		ret = AGENTBARERROR_BAR_WRONGSTATE;
+		Tool::m_Logger.WriteLog("CCCBar", "BRetrieve", "Status Error", ret);
+	}
+	else
+	{
+		ret = m_acd.AcdRetrieve(m_strAgentID);
+	}	
+	return ret;
+}
+
+LONG CCCBar::BConsult(const char *consultNum, const char *showANI, const char *showDest, 
+                        acd::CallTypeT callType)
+{
+	LONG ret = AGENTBARERROR_SUCCESS;
+	if(m_AgentStatus != acd::AgentStatusT::AsConnectedState)
+	{
+		ret = AGENTBARERROR_BAR_WRONGSTATE;
+		Tool::m_Logger.WriteLog("CCCBar", "BConsult", "Status Error", ret);
+	}
+	else
+	{
+		CString callerId;
+		switch(callType.get_value())
+		{
+		case acd::CallTypeT::CtAgent:
+			callerId = m_strAgentTag + m_strDN;
+			break;
+		case acd::CallTypeT::CtOut:
+			callerId = m_strDN;
+			break;
+		default:
+                    CString ss;
+                    ss.Format("%d", callType);
+                    callerId = ss + "#" + m_strDN;
+                    break;
+		}
+		ret = m_acd.AcdConsult(m_strAgentID, callerId, consultNum, showANI, showDest, callType);
+	}
+	return ret;
+}
+
+LONG CCCBar::BReconnect()
+{
+	LONG ret = AGENTBARERROR_SUCCESS;
+	if(m_AgentStatus != acd::AgentStatusT::AsConsultConnectingState && m_AgentStatus != acd::AgentStatusT::AsConsultConnectedState)
+	{
+		ret = AGENTBARERROR_BAR_WRONGSTATE;
+		Tool::m_Logger.WriteLog("CCCBar", "BReconnect", "Status Error", ret);
+	}
+	else
+	{
+		ret = m_acd.AcdConsultReconnect(m_strAgentID);
+	}
+	return ret;
+}
+
+LONG CCCBar::BTransfer()
+{
+	LONG ret = AGENTBARERROR_SUCCESS;
+	if(m_AgentStatus != acd::AgentStatusT::AsConsultConnectedState)
+	{
+		ret = AGENTBARERROR_BAR_WRONGSTATE;
+		Tool::m_Logger.WriteLog("CCCBar", "BTransfer", "Status Error", ret);
+	}
+	else
+	{
+		ret = m_acd.AcdConsultTransfer(m_strAgentID);
+	}
+	return ret;
+}
+
+LONG CCCBar::BSingleStepTransfer(const char *transferNum, const char *showANI, const char *showDest, BOOL transferStyle, acd::CallTypeT callType)
+{
+	LONG ret = AGENTBARERROR_SUCCESS;
+	if(m_AgentStatus != acd::AgentStatusT::AsConnectedState)
+	{
+		ret = AGENTBARERROR_BAR_WRONGSTATE;
+		Tool::m_Logger.WriteLog("CCCBar", "BSingleStepTransfer", "Status Error", ret);
+	}
+	else
+	{
+		CString callerId;
+		switch(callType.get_value())
+		{
+		case acd::CallTypeT::CtAgent:
+			callerId = m_strAgentTag + m_strDN;
+			m_singlestepTransferNum = transferNum;
+			break;
+		case acd::CallTypeT::CtOut:
+			callerId = m_strDN;
+			m_singlestepTransferNum = transferNum;
+			break;
+		default:
+			callerId = m_strDN;
+			break;
+		}
+		ret = m_acd.AcdSingleStepTransfer(m_strAgentID, callerId, transferNum, showANI, showDest, !!transferStyle, callType);
+	}
+	return ret;
+}
+
+LONG CCCBar::BConference()
+{
+	LONG ret = AGENTBARERROR_SUCCESS;
+	if(m_AgentStatus != acd::AgentStatusT::AsConsultConnectedState)
+	{
+		ret = AGENTBARERROR_BAR_WRONGSTATE;
+		Tool::m_Logger.WriteLog("CCCBar", "BConference", "Status Error", ret);
+	}
+	else
+	{
+		ret = m_acd.AcdConsultConference(m_strAgentID);
+	}
+	return ret;
+}
+
+LONG CCCBar::BListen(const char *destAgentId, const char *forCallerDispNum, const char *forCalleeDispNum)
+{
+	LONG ret = AGENTBARERROR_SUCCESS;
+	m_singlestepTransferNum = "";
+	if(m_AgentStatus != acd::AgentStatusT::AsReadyState && m_AgentStatus != acd::AgentStatusT::AsBusyState)
+	{
+		ret = AGENTBARERROR_BAR_WRONGSTATE;
+		Tool::m_Logger.WriteLog("CCCBar", "BListen", "Status Error", ret);
+	}
+	else
+	{
+		ret = m_acd.AcdListen(m_strAgentID, m_strAgentTag + m_strDN, destAgentId, forCallerDispNum, forCalleeDispNum);
+	}
+	return ret;
+}
+
+LONG CCCBar::BStopListen(const char *destAgentId)
+{
+	LONG ret = AGENTBARERROR_SUCCESS;
+	if(m_AgentStatus != acd::AgentStatusT::AsMonitorState)
+	{
+		ret = AGENTBARERROR_BAR_WRONGSTATE;
+		Tool::m_Logger.WriteLog("CCCBar", "BStopListen", "Status Error", ret);
+	}
+	else
+	{
+		ret = m_acd.AcdStopListen(m_strAgentID, destAgentId);
+	}
+	return ret;
+}
+
+LONG CCCBar::BInsert(const char *destAgentId, const char *forCallerDispNum, const char *forCalleeDispNum)
+{
+	LONG ret = AGENTBARERROR_SUCCESS;
+	m_singlestepTransferNum = "";
+	if(m_AgentStatus != acd::AgentStatusT::AsReadyState && m_AgentStatus != acd::AgentStatusT::AsBusyState)
+	{
+		ret = AGENTBARERROR_BAR_WRONGSTATE;
+		Tool::m_Logger.WriteLog("CCCBar", "BInsert", "Status Error", ret);
+	}
+	else
+	{
+		ret = m_acd.AcdInsert(m_strAgentID, m_strAgentTag + m_strDN, destAgentId, forCallerDispNum, forCalleeDispNum);
+	}
+	return ret;
+}
+
+LONG CCCBar::BStopInsert(const char *destAgentId)
+{
+	LONG ret = AGENTBARERROR_SUCCESS;
+	if(m_AgentStatus != acd::AgentStatusT::AsInsertState)
+	{
+		ret = AGENTBARERROR_BAR_WRONGSTATE;
+		Tool::m_Logger.WriteLog("CCCBar", "BStopInsert", "Status Error", ret);
+	}
+	else
+	{
+		ret = m_acd.AcdStopInsert(m_strAgentID, destAgentId);
+	}
+	return ret;
+}
+
+LONG CCCBar::BSwitchInsertorListen(const char *destAgentId, const char *forCallerDispNum, const char *forCalleeDispNum)
+{
+	LONG ret = AGENTBARERROR_SUCCESS;
+	if(m_AgentStatus != acd::AgentStatusT::AsMonitorState && m_AgentStatus != acd::AgentStatusT::AsInsertState)
+	{
+		ret = AGENTBARERROR_BAR_WRONGSTATE;
+		Tool::m_Logger.WriteLog("CCCBar", "BSwitchInsertorListen", "Status Error", ret);
+	}
+	else
+	{
+		ret = m_acd.AcdSwitchInsertorListen(m_strAgentID, m_strAgentTag + m_strDN, destAgentId, forCallerDispNum, forCalleeDispNum);
+	}
+	return ret;
+}
+
+LONG CCCBar::BSendDTMF(const char *digitals)
+{
+	LONG ret = AGENTBARERROR_SUCCESS;
+	if(m_AgentStatus != acd::AgentStatusT::AsConnectedState)
+	{
+		ret = AGENTBARERROR_BAR_WRONGSTATE;
+		Tool::m_Logger.WriteLog("CCCBar", "BSendDTMF", "Status Error", ret);
+	}
+	else
+	{
+		ret = m_acd.AcdSendDTMF(m_strAgentID, digitals);
+	}
+	return ret;
+}
+
+LONG CCCBar::BGetRestReason(acd::StringListT &restReason)
+{
+	LONG ret = AGENTBARERROR_SUCCESS;
+	if(m_AgentStatus == acd::AgentStatusT::AsUnknownState || m_AgentStatus == acd::AgentStatusT::AsUnLoginState)
+	{
+		ret = AGENTBARERROR_BAR_WRONGSTATE;
+		Tool::m_Logger.WriteLog("CCCBar", "BGetRestReason", "Status Error", ret);
+	}
+	else
+	{
+		ret = m_acd.AcdGetRestReason(m_strAgentID, restReason);
+	}
+	return ret;
+}
+
+LONG CCCBar::BSynchronizeCTITime()
+{
+	LONG ret = AGENTBARERROR_SUCCESS;
+	if(m_AgentStatus == acd::AgentStatusT::AsUnknownState || m_AgentStatus == acd::AgentStatusT::AsUnLoginState)
+	{
+		ret = AGENTBARERROR_BAR_WRONGSTATE;
+		Tool::m_Logger.WriteLog("CCCBar", "BSynchronizeCTITime", "Status Error", ret);
+	}
+	else
+	{
+		LONGLONG timestamp = 0;
+		ret = m_acd.AcdSynchronizeCTITime(m_strAgentID, timestamp);
+		if(ret == AGENTBARERROR_SUCCESS)
+		{
+			// »ñÈ¡µ±Ç°Ê±¼ä
+			CTime serverTime(timestamp / 1000000);
+			CTimeSpan timeSpan = serverTime - CTime::GetCurrentTime();
+			// ÉèÖÃ±¾µØÊ±¼ä
+			SYSTEMTIME systemTime;
+			serverTime.GetAsSystemTime(systemTime);
+			SetLocalTime(&systemTime);
+			// ÖØÖÃÊ±¼ä
+			if(m_beginStatusTime.GetTime() != 0)
+				m_beginStatusTime += timeSpan;
+			if(m_beginTalkTime.GetTime() != 0)
+				m_beginTalkTime += timeSpan;
+			if(m_lastStatusTime.GetTime() != 0)
+				m_lastStatusTime += timeSpan;
+			if(m_lastTalkTime.GetTime() != 0)
+				m_lastTalkTime += timeSpan;
+		}
+	}
+	return ret;
+}
+
+LONG CCCBar::BHeartbeat()
+{
+	LONG ret = AGENTBARERROR_SUCCESS;
+	if(m_AgentStatus == acd::AgentStatusT::AsUnknownState || m_AgentStatus == acd::AgentStatusT::AsUnLoginState)
+	{
+		ret = AGENTBARERROR_BAR_WRONGSTATE;
+		Tool::m_Logger.WriteLog("CCCBar", "BHeartbeat", "Status Error", ret);
+	}
+	else
+	{
+		ret = m_acd.AcdHeartbeat(m_strAgentID);
+		if(ret == AGENTBARERROR_SUCCESS)
+		{
+			m_heartbeatCount = 0;
+            // Í¨ÖªÐÄÌø³É¹¦
+            LONGLONG timestamp = 0;
+            if(!m_lDetaTime)
+            {
+                timestamp = CTime::GetCurrentTime().GetTime() * 1000000;
+            }
+            else
+            {
+                timestamp = static_cast<LONGLONG>(GetTickCount()) * 1000 + m_lDetaTime;
+            }
+            p_m_BarCtrl->OnHeartbeat(timestamp);
+		}
+		else if(ret == acd::AcdResultT::ArNotMaster)
+		{
+			m_heartbeatCount = 0;
+			// µ¹»»
+			Backup();
+		}
+		else if(ret == acd::AcdResultT::ArNoSignin)
+		{
+			m_heartbeatCount = 0;
+			// ÖØÇ©
+			ReSignIn();
+		}
+		else
+		{
+			m_heartbeatCount++;
+		}
+		if(m_heartbeatCount == TIMES_HEARTBEAT_EXCEPTION)
+		{
+			m_heartbeatCount = 0;
+			// µ¹»»
+			Backup();
+		}
+	}
+	return ret;
+}
+
+AcdClient &CCCBar::GetAcdClient()
+{
+	return m_acd;
+}
+
+// suxiangmao
+SipphoneClient &CCCBar::GetSipphoneClient()
+{
+	return m_sip;
+}
+
+LONG CCCBar::BTransferIVR(const char *transferNum, const char *callerNum)
+{
+	LONG ret = AGENTBARERROR_SUCCESS;
+	if(m_AgentStatus != acd::AgentStatusT::AsConnectedState){
+		ret = AGENTBARERROR_BAR_WRONGSTATE;
+		Tool::m_Logger.WriteLog("CCCBar", "BTransferIVR", "Status Error", ret);
+	}
+	else{
+		ret = m_acd.AcdSingleStepTransfer(m_strAgentID, m_strCustomerTag + m_strDN, transferNum, 
+			(callerNum?callerNum:m_strActiveCallID.c_str()), (callerNum?callerNum:m_strActiveCallID.c_str()), false, acd::CallTypeT::CtOut);
+	}
+	return ret;	
+}
+
+int32_t HeartBeatTask::operator()(const bool *isstopped, void *param)
+{
+	int32_t time_count=100;
+
+	if(!m_bar){
+		return -1;
+	}
+
+	while(!(*isstopped)){
+		m_bar->BHeartbeat();
+
+		time_count=100;
+		while(!(*isstopped)&&(time_count--)){
+			bgcc::TimeUtil::safe_sleep_ms(100);
+		}
+	}
+
+	return 0;
+}
diff --git a/tools/agentbar/agentbarsrc/ConstDef.h b/tools/agentbar/agentbarsrc/ConstDef.h
index 404ed4b..0da6afe 100644
--- a/tools/agentbar/agentbarsrc/ConstDef.h
+++ b/tools/agentbar/agentbarsrc/ConstDef.h
@@ -87,7 +87,8 @@ enum AGENTBARERROR
 	AGENTBARERROR_BAR_OUTEVENTERROR,
 	AGENTBARERROR_BAR_ANSWERERROR,
 	AGENTBARERROR_JSON_READERROR,
-	AGENTBARERROR_SOFTPHONE_ERROR					//suxiangmao
+        AGENTBARERROR_SOFTPHONE_ERROR,					//suxiangmao
+        AGENTBARERROR_BAR_WRONGNUM                                 //liuqiang
 };
 
 // Ö÷½Ð±ä»»ÀàÐÍ
diff --git "a/tools/agentbar/agentbarsrc/res/\346\217\220\347\244\272_\350\255\246\345\221\212.ICO" b/tools/agentbar/agentbarsrc/res/alert.ICO
old mode 100644
new mode 100755
similarity index 100%
rename from "tools/agentbar/agentbarsrc/res/\346\217\220\347\244\272_\350\255\246\345\221\212.ICO"
rename to tools/agentbar/agentbarsrc/res/alert.ICO
diff --git "a/tools/agentbar/agentbarsrc/res/\346\217\220\347\244\272_\351\224\231\350\257\257.ICO" b/tools/agentbar/agentbarsrc/res/error.ICO
old mode 100644
new mode 100755
similarity index 100%
rename from "tools/agentbar/agentbarsrc/res/\346\217\220\347\244\272_\351\224\231\350\257\257.ICO"
rename to tools/agentbar/agentbarsrc/res/error.ICO
diff --git "a/tools/agentbar/agentbarsrc/res/\346\217\220\347\244\272_\344\277\241\346\201\257.ICO" b/tools/agentbar/agentbarsrc/res/info.ICO
old mode 100644
new mode 100755
similarity index 100%
rename from "tools/agentbar/agentbarsrc/res/\346\217\220\347\244\272_\344\277\241\346\201\257.ICO"
rename to tools/agentbar/agentbarsrc/res/info.ICO
diff --git "a/tools/agentbar/agentbarsrc/res/\346\227\240\346\225\210_\346\216\245\345\220\254.bmp" b/tools/agentbar/agentbarsrc/res/invalid_answer.bmp
similarity index 100%
rename from "tools/agentbar/agentbarsrc/res/\346\227\240\346\225\210_\346\216\245\345\220\254.bmp"
rename to tools/agentbar/agentbarsrc/res/invalid_answer.bmp
diff --git "a/tools/agentbar/agentbarsrc/res/\346\227\240\346\225\210_\345\221\274\345\207\272\345\260\261\347\273\252.bmp" b/tools/agentbar/agentbarsrc/res/invalid_busy.bmp
similarity index 100%
rename from "tools/agentbar/agentbarsrc/res/\346\227\240\346\225\210_\345\221\274\345\207\272\345\260\261\347\273\252.bmp"
rename to tools/agentbar/agentbarsrc/res/invalid_busy.bmp
diff --git "a/tools/agentbar/agentbarsrc/res/\346\227\240\346\225\210_\345\221\274\345\207\272.bmp" b/tools/agentbar/agentbarsrc/res/invalid_callout.bmp
similarity index 100%
rename from "tools/agentbar/agentbarsrc/res/\346\227\240\346\225\210_\345\221\274\345\207\272.bmp"
rename to tools/agentbar/agentbarsrc/res/invalid_callout.bmp
diff --git "a/tools/agentbar/agentbarsrc/res/\346\227\240\346\225\210_\345\222\250\350\257\242\344\274\232\350\256\256.bmp" b/tools/agentbar/agentbarsrc/res/invalid_conference.bmp
similarity index 100%
rename from "tools/agentbar/agentbarsrc/res/\346\227\240\346\225\210_\345\222\250\350\257\242\344\274\232\350\256\256.bmp"
rename to tools/agentbar/agentbarsrc/res/invalid_conference.bmp
diff --git "a/tools/agentbar/agentbarsrc/res/\346\227\240\346\225\210_\345\222\250\350\257\242.bmp" b/tools/agentbar/agentbarsrc/res/invalid_consult.bmp
similarity index 100%
rename from "tools/agentbar/agentbarsrc/res/\346\227\240\346\225\210_\345\222\250\350\257\242.bmp"
rename to tools/agentbar/agentbarsrc/res/invalid_consult.bmp
diff --git "a/tools/agentbar/agentbarsrc/res/\346\227\240\346\225\210_\346\213\250\346\211\223\345\210\206\346\234\272.bmp" b/tools/agentbar/agentbarsrc/res/invalid_dtmf.bmp
similarity index 100%
rename from "tools/agentbar/agentbarsrc/res/\346\227\240\346\225\210_\346\213\250\346\211\223\345\210\206\346\234\272.bmp"
rename to tools/agentbar/agentbarsrc/res/invalid_dtmf.bmp
diff --git "a/tools/agentbar/agentbarsrc/res/\346\227\240\346\225\210_\346\214\202\346\226\255.bmp" b/tools/agentbar/agentbarsrc/res/invalid_hangup.bmp
similarity index 100%
rename from "tools/agentbar/agentbarsrc/res/\346\227\240\346\225\210_\346\214\202\346\226\255.bmp"
rename to tools/agentbar/agentbarsrc/res/invalid_hangup.bmp
diff --git "a/tools/agentbar/agentbarsrc/res/\346\227\240\346\225\210_\344\277\235\346\214\201.bmp" b/tools/agentbar/agentbarsrc/res/invalid_hold.bmp
similarity index 100%
rename from "tools/agentbar/agentbarsrc/res/\346\227\240\346\225\210_\344\277\235\346\214\201.bmp"
rename to tools/agentbar/agentbarsrc/res/invalid_hold.bmp
diff --git "a/tools/agentbar/agentbarsrc/res/\346\227\240\346\225\210_\346\216\245\345\220\254\345\260\261\347\273\252.bmp" b/tools/agentbar/agentbarsrc/res/invalid_ready.bmp
similarity index 100%
rename from "tools/agentbar/agentbarsrc/res/\346\227\240\346\225\210_\346\216\245\345\220\254\345\260\261\347\273\252.bmp"
rename to tools/agentbar/agentbarsrc/res/invalid_ready.bmp
diff --git "a/tools/agentbar/agentbarsrc/res/\346\227\240\346\225\210_\345\222\250\350\257\242\346\216\245\345\233\236.bmp" b/tools/agentbar/agentbarsrc/res/invalid_reconnect.bmp
similarity index 100%
rename from "tools/agentbar/agentbarsrc/res/\346\227\240\346\225\210_\345\222\250\350\257\242\346\216\245\345\233\236.bmp"
rename to tools/agentbar/agentbarsrc/res/invalid_reconnect.bmp
diff --git "a/tools/agentbar/agentbarsrc/res/\346\227\240\346\225\210_\344\274\221\346\201\257.bmp" b/tools/agentbar/agentbarsrc/res/invalid_rest.bmp
similarity index 100%
rename from "tools/agentbar/agentbarsrc/res/\346\227\240\346\225\210_\344\274\221\346\201\257.bmp"
rename to tools/agentbar/agentbarsrc/res/invalid_rest.bmp
diff --git "a/tools/agentbar/agentbarsrc/res/\346\227\240\346\225\210_\344\277\235\346\214\201\346\216\245\345\233\236.bmp" b/tools/agentbar/agentbarsrc/res/invalid_retrieve.bmp
similarity index 100%
rename from "tools/agentbar/agentbarsrc/res/\346\227\240\346\225\210_\344\277\235\346\214\201\346\216\245\345\233\236.bmp"
rename to tools/agentbar/agentbarsrc/res/invalid_retrieve.bmp
diff --git "a/tools/agentbar/agentbarsrc/res/\346\227\240\346\225\210_\347\255\276\345\205\245.bmp" b/tools/agentbar/agentbarsrc/res/invalid_signin.bmp
similarity index 100%
rename from "tools/agentbar/agentbarsrc/res/\346\227\240\346\225\210_\347\255\276\345\205\245.bmp"
rename to tools/agentbar/agentbarsrc/res/invalid_signin.bmp
diff --git "a/tools/agentbar/agentbarsrc/res/\346\227\240\346\225\210_\347\255\276\345\207\272.bmp" b/tools/agentbar/agentbarsrc/res/invalid_signout.bmp
similarity index 100%
rename from "tools/agentbar/agentbarsrc/res/\346\227\240\346\225\210_\347\255\276\345\207\272.bmp"
rename to tools/agentbar/agentbarsrc/res/invalid_signout.bmp
diff --git "a/tools/agentbar/agentbarsrc/res/\346\227\240\346\225\210_\346\212\200\350\203\275\345\210\207\346\215\242.bmp" b/tools/agentbar/agentbarsrc/res/invalid_skillchange.bmp
similarity index 100%
rename from "tools/agentbar/agentbarsrc/res/\346\227\240\346\225\210_\346\212\200\350\203\275\345\210\207\346\215\242.bmp"
rename to tools/agentbar/agentbarsrc/res/invalid_skillchange.bmp
diff --git "a/tools/agentbar/agentbarsrc/res/\346\227\240\346\225\210_\351\200\232\350\257\235\350\275\254\347\247\273.bmp" b/tools/agentbar/agentbarsrc/res/invalid_sstransfer.bmp
similarity index 100%
rename from "tools/agentbar/agentbarsrc/res/\346\227\240\346\225\210_\351\200\232\350\257\235\350\275\254\347\247\273.bmp"
rename to tools/agentbar/agentbarsrc/res/invalid_sstransfer.bmp
diff --git "a/tools/agentbar/agentbarsrc/res/\346\227\240\346\225\210_\345\222\250\350\257\242\350\275\254\347\247\273.bmp" b/tools/agentbar/agentbarsrc/res/invalid_transfer.bmp
similarity index 100%
rename from "tools/agentbar/agentbarsrc/res/\346\227\240\346\225\210_\345\222\250\350\257\242\350\275\254\347\247\273.bmp"
rename to tools/agentbar/agentbarsrc/res/invalid_transfer.bmp
diff --git "a/tools/agentbar/agentbarsrc/res/\351\274\240\346\240\207\347\273\217\350\277\207_\346\216\245\345\220\254.bmp" b/tools/agentbar/agentbarsrc/res/over_answer.bmp
old mode 100644
new mode 100755
similarity index 100%
rename from "tools/agentbar/agentbarsrc/res/\351\274\240\346\240\207\347\273\217\350\277\207_\346\216\245\345\220\254.bmp"
rename to tools/agentbar/agentbarsrc/res/over_answer.bmp
diff --git "a/tools/agentbar/agentbarsrc/res/\351\274\240\346\240\207\347\273\217\350\277\207_\345\221\274\345\207\272\345\260\261\347\273\252.bmp" b/tools/agentbar/agentbarsrc/res/over_busy.bmp
old mode 100644
new mode 100755
similarity index 100%
rename from "tools/agentbar/agentbarsrc/res/\351\274\240\346\240\207\347\273\217\350\277\207_\345\221\274\345\207\272\345\260\261\347\273\252.bmp"
rename to tools/agentbar/agentbarsrc/res/over_busy.bmp
diff --git "a/tools/agentbar/agentbarsrc/res/\351\274\240\346\240\207\347\273\217\350\277\207_\345\221\274\345\207\272.bmp" b/tools/agentbar/agentbarsrc/res/over_callout.bmp
old mode 100644
new mode 100755
similarity index 100%
rename from "tools/agentbar/agentbarsrc/res/\351\274\240\346\240\207\347\273\217\350\277\207_\345\221\274\345\207\272.bmp"
rename to tools/agentbar/agentbarsrc/res/over_callout.bmp
diff --git "a/tools/agentbar/agentbarsrc/res/\351\274\240\346\240\207\347\273\217\350\277\207_\345\222\250\350\257\242\344\274\232\350\256\256.bmp" b/tools/agentbar/agentbarsrc/res/over_conference.bmp
old mode 100644
new mode 100755
similarity index 100%
rename from "tools/agentbar/agentbarsrc/res/\351\274\240\346\240\207\347\273\217\350\277\207_\345\222\250\350\257\242\344\274\232\350\256\256.bmp"
rename to tools/agentbar/agentbarsrc/res/over_conference.bmp
diff --git "a/tools/agentbar/agentbarsrc/res/\351\274\240\346\240\207\347\273\217\350\277\207_\345\222\250\350\257\242.bmp" b/tools/agentbar/agentbarsrc/res/over_consult.bmp
old mode 100644
new mode 100755
similarity index 100%
rename from "tools/agentbar/agentbarsrc/res/\351\274\240\346\240\207\347\273\217\350\277\207_\345\222\250\350\257\242.bmp"
rename to tools/agentbar/agentbarsrc/res/over_consult.bmp
diff --git "a/tools/agentbar/agentbarsrc/res/\351\274\240\346\240\207\347\273\217\350\277\207_\346\213\250\346\211\223\345\210\206\346\234\272.bmp" b/tools/agentbar/agentbarsrc/res/over_dtmf.bmp
old mode 100644
new mode 100755
similarity index 100%
rename from "tools/agentbar/agentbarsrc/res/\351\274\240\346\240\207\347\273\217\350\277\207_\346\213\250\346\211\223\345\210\206\346\234\272.bmp"
rename to tools/agentbar/agentbarsrc/res/over_dtmf.bmp
diff --git "a/tools/agentbar/agentbarsrc/res/\351\274\240\346\240\207\347\273\217\350\277\207_\346\214\202\346\226\255.bmp" b/tools/agentbar/agentbarsrc/res/over_hangup.bmp
old mode 100644
new mode 100755
similarity index 100%
rename from "tools/agentbar/agentbarsrc/res/\351\274\240\346\240\207\347\273\217\350\277\207_\346\214\202\346\226\255.bmp"
rename to tools/agentbar/agentbarsrc/res/over_hangup.bmp
diff --git "a/tools/agentbar/agentbarsrc/res/\351\274\240\346\240\207\347\273\217\350\277\207_\344\277\235\346\214\201.bmp" b/tools/agentbar/agentbarsrc/res/over_hold.bmp
old mode 100644
new mode 100755
similarity index 100%
rename from "tools/agentbar/agentbarsrc/res/\351\274\240\346\240\207\347\273\217\350\277\207_\344\277\235\346\214\201.bmp"
rename to tools/agentbar/agentbarsrc/res/over_hold.bmp
diff --git "a/tools/agentbar/agentbarsrc/res/\351\274\240\346\240\207\347\273\217\350\277\207_\346\216\245\345\220\254\345\260\261\347\273\252.bmp" b/tools/agentbar/agentbarsrc/res/over_ready.bmp
old mode 100644
new mode 100755
similarity index 100%
rename from "tools/agentbar/agentbarsrc/res/\351\274\240\346\240\207\347\273\217\350\277\207_\346\216\245\345\220\254\345\260\261\347\273\252.bmp"
rename to tools/agentbar/agentbarsrc/res/over_ready.bmp
diff --git "a/tools/agentbar/agentbarsrc/res/\351\274\240\346\240\207\347\273\217\350\277\207_\345\222\250\350\257\242\346\216\245\345\233\236.bmp" b/tools/agentbar/agentbarsrc/res/over_reconnect.bmp
old mode 100644
new mode 100755
similarity index 100%
rename from "tools/agentbar/agentbarsrc/res/\351\274\240\346\240\207\347\273\217\350\277\207_\345\222\250\350\257\242\346\216\245\345\233\236.bmp"
rename to tools/agentbar/agentbarsrc/res/over_reconnect.bmp
diff --git "a/tools/agentbar/agentbarsrc/res/\351\274\240\346\240\207\347\273\217\350\277\207_\344\274\221\346\201\257.bmp" b/tools/agentbar/agentbarsrc/res/over_rest.bmp
old mode 100644
new mode 100755
similarity index 100%
rename from "tools/agentbar/agentbarsrc/res/\351\274\240\346\240\207\347\273\217\350\277\207_\344\274\221\346\201\257.bmp"
rename to tools/agentbar/agentbarsrc/res/over_rest.bmp
diff --git "a/tools/agentbar/agentbarsrc/res/\351\274\240\346\240\207\347\273\217\350\277\207_\344\277\235\346\214\201\346\216\245\345\233\236.bmp" b/tools/agentbar/agentbarsrc/res/over_retrieve.bmp
old mode 100644
new mode 100755
similarity index 100%
rename from "tools/agentbar/agentbarsrc/res/\351\274\240\346\240\207\347\273\217\350\277\207_\344\277\235\346\214\201\346\216\245\345\233\236.bmp"
rename to tools/agentbar/agentbarsrc/res/over_retrieve.bmp
diff --git "a/tools/agentbar/agentbarsrc/res/\351\274\240\346\240\207\347\273\217\350\277\207_\347\255\276\345\205\245.bmp" b/tools/agentbar/agentbarsrc/res/over_signin.bmp
old mode 100644
new mode 100755
similarity index 100%
rename from "tools/agentbar/agentbarsrc/res/\351\274\240\346\240\207\347\273\217\350\277\207_\347\255\276\345\205\245.bmp"
rename to tools/agentbar/agentbarsrc/res/over_signin.bmp
diff --git "a/tools/agentbar/agentbarsrc/res/\351\274\240\346\240\207\347\273\217\350\277\207_\347\255\276\345\207\272.bmp" b/tools/agentbar/agentbarsrc/res/over_signout.bmp
old mode 100644
new mode 100755
similarity index 100%
rename from "tools/agentbar/agentbarsrc/res/\351\274\240\346\240\207\347\273\217\350\277\207_\347\255\276\345\207\272.bmp"
rename to tools/agentbar/agentbarsrc/res/over_signout.bmp
diff --git "a/tools/agentbar/agentbarsrc/res/\351\274\240\346\240\207\347\273\217\350\277\207_\346\212\200\350\203\275\345\210\207\346\215\242.bmp" b/tools/agentbar/agentbarsrc/res/over_skillchange.bmp
old mode 100644
new mode 100755
similarity index 100%
rename from "tools/agentbar/agentbarsrc/res/\351\274\240\346\240\207\347\273\217\350\277\207_\346\212\200\350\203\275\345\210\207\346\215\242.bmp"
rename to tools/agentbar/agentbarsrc/res/over_skillchange.bmp
diff --git "a/tools/agentbar/agentbarsrc/res/\351\274\240\346\240\207\347\273\217\350\277\207_\351\200\232\350\257\235\350\275\254\347\247\273.bmp" b/tools/agentbar/agentbarsrc/res/over_sstransfer.bmp
old mode 100644
new mode 100755
similarity index 100%
rename from "tools/agentbar/agentbarsrc/res/\351\274\240\346\240\207\347\273\217\350\277\207_\351\200\232\350\257\235\350\275\254\347\247\273.bmp"
rename to tools/agentbar/agentbarsrc/res/over_sstransfer.bmp
diff --git "a/tools/agentbar/agentbarsrc/res/\351\274\240\346\240\207\347\273\217\350\277\207_\345\222\250\350\257\242\350\275\254\347\247\273.bmp" b/tools/agentbar/agentbarsrc/res/over_transfer.bmp
old mode 100644
new mode 100755
similarity index 100%
rename from "tools/agentbar/agentbarsrc/res/\351\274\240\346\240\207\347\273\217\350\277\207_\345\222\250\350\257\242\350\275\254\347\247\273.bmp"
rename to tools/agentbar/agentbarsrc/res/over_transfer.bmp
diff --git "a/tools/agentbar/agentbarsrc/res/\345\210\206\351\232\224\347\254\246.bmp" b/tools/agentbar/agentbarsrc/res/split.bmp
old mode 100644
new mode 100755
similarity index 100%
rename from "tools/agentbar/agentbarsrc/res/\345\210\206\351\232\224\347\254\246.bmp"
rename to tools/agentbar/agentbarsrc/res/split.bmp
diff --git "a/tools/agentbar/agentbarsrc/res/\346\234\211\346\225\210_\346\216\245\345\220\254.bmp" b/tools/agentbar/agentbarsrc/res/valid_answer.bmp
old mode 100644
new mode 100755
similarity index 100%
rename from "tools/agentbar/agentbarsrc/res/\346\234\211\346\225\210_\346\216\245\345\220\254.bmp"
rename to tools/agentbar/agentbarsrc/res/valid_answer.bmp
diff --git "a/tools/agentbar/agentbarsrc/res/\346\234\211\346\225\210_\345\221\274\345\207\272\345\260\261\347\273\252.bmp" b/tools/agentbar/agentbarsrc/res/valid_busy.bmp
old mode 100644
new mode 100755
similarity index 100%
rename from "tools/agentbar/agentbarsrc/res/\346\234\211\346\225\210_\345\221\274\345\207\272\345\260\261\347\273\252.bmp"
rename to tools/agentbar/agentbarsrc/res/valid_busy.bmp
diff --git "a/tools/agentbar/agentbarsrc/res/\346\234\211\346\225\210_\345\221\274\345\207\272.bmp" b/tools/agentbar/agentbarsrc/res/valid_callout.bmp
old mode 100644
new mode 100755
similarity index 100%
rename from "tools/agentbar/agentbarsrc/res/\346\234\211\346\225\210_\345\221\274\345\207\272.bmp"
rename to tools/agentbar/agentbarsrc/res/valid_callout.bmp
diff --git "a/tools/agentbar/agentbarsrc/res/\346\234\211\346\225\210_\345\222\250\350\257\242\344\274\232\350\256\256.bmp" b/tools/agentbar/agentbarsrc/res/valid_conference.bmp
old mode 100644
new mode 100755
similarity index 100%
rename from "tools/agentbar/agentbarsrc/res/\346\234\211\346\225\210_\345\222\250\350\257\242\344\274\232\350\256\256.bmp"
rename to tools/agentbar/agentbarsrc/res/valid_conference.bmp
diff --git "a/tools/agentbar/agentbarsrc/res/\346\234\211\346\225\210_\345\222\250\350\257\242.bmp" b/tools/agentbar/agentbarsrc/res/valid_consult.bmp
old mode 100644
new mode 100755
similarity index 100%
rename from "tools/agentbar/agentbarsrc/res/\346\234\211\346\225\210_\345\222\250\350\257\242.bmp"
rename to tools/agentbar/agentbarsrc/res/valid_consult.bmp
diff --git "a/tools/agentbar/agentbarsrc/res/\346\234\211\346\225\210_\346\213\250\346\211\223\345\210\206\346\234\272.bmp" b/tools/agentbar/agentbarsrc/res/valid_dtmf.bmp
old mode 100644
new mode 100755
similarity index 100%
rename from "tools/agentbar/agentbarsrc/res/\346\234\211\346\225\210_\346\213\250\346\211\223\345\210\206\346\234\272.bmp"
rename to tools/agentbar/agentbarsrc/res/valid_dtmf.bmp
diff --git "a/tools/agentbar/agentbarsrc/res/\346\234\211\346\225\210_\346\214\202\346\226\255.bmp" b/tools/agentbar/agentbarsrc/res/valid_hangup.bmp
old mode 100644
new mode 100755
similarity index 100%
rename from "tools/agentbar/agentbarsrc/res/\346\234\211\346\225\210_\346\214\202\346\226\255.bmp"
rename to tools/agentbar/agentbarsrc/res/valid_hangup.bmp
diff --git "a/tools/agentbar/agentbarsrc/res/\346\234\211\346\225\210_\344\277\235\346\214\201.bmp" b/tools/agentbar/agentbarsrc/res/valid_hold.bmp
old mode 100644
new mode 100755
similarity index 100%
rename from "tools/agentbar/agentbarsrc/res/\346\234\211\346\225\210_\344\277\235\346\214\201.bmp"
rename to tools/agentbar/agentbarsrc/res/valid_hold.bmp
diff --git "a/tools/agentbar/agentbarsrc/res/\346\234\211\346\225\210_\346\216\245\345\220\254\345\260\261\347\273\252.bmp" b/tools/agentbar/agentbarsrc/res/valid_ready.bmp
old mode 100644
new mode 100755
similarity index 100%
rename from "tools/agentbar/agentbarsrc/res/\346\234\211\346\225\210_\346\216\245\345\220\254\345\260\261\347\273\252.bmp"
rename to tools/agentbar/agentbarsrc/res/valid_ready.bmp
diff --git "a/tools/agentbar/agentbarsrc/res/\346\234\211\346\225\210_\345\222\250\350\257\242\346\216\245\345\233\236.bmp" b/tools/agentbar/agentbarsrc/res/valid_reconnect.bmp
old mode 100644
new mode 100755
similarity index 100%
rename from "tools/agentbar/agentbarsrc/res/\346\234\211\346\225\210_\345\222\250\350\257\242\346\216\245\345\233\236.bmp"
rename to tools/agentbar/agentbarsrc/res/valid_reconnect.bmp
diff --git "a/tools/agentbar/agentbarsrc/res/\346\234\211\346\225\210_\344\274\221\346\201\257.bmp" b/tools/agentbar/agentbarsrc/res/valid_rest.bmp
old mode 100644
new mode 100755
similarity index 100%
rename from "tools/agentbar/agentbarsrc/res/\346\234\211\346\225\210_\344\274\221\346\201\257.bmp"
rename to tools/agentbar/agentbarsrc/res/valid_rest.bmp
diff --git "a/tools/agentbar/agentbarsrc/res/\346\234\211\346\225\210_\344\277\235\346\214\201\346\216\245\345\233\236.bmp" b/tools/agentbar/agentbarsrc/res/valid_retrieve.bmp
old mode 100644
new mode 100755
similarity index 100%
rename from "tools/agentbar/agentbarsrc/res/\346\234\211\346\225\210_\344\277\235\346\214\201\346\216\245\345\233\236.bmp"
rename to tools/agentbar/agentbarsrc/res/valid_retrieve.bmp
diff --git "a/tools/agentbar/agentbarsrc/res/\346\234\211\346\225\210_\347\255\276\345\205\245.bmp" b/tools/agentbar/agentbarsrc/res/valid_signin.bmp
old mode 100644
new mode 100755
similarity index 100%
rename from "tools/agentbar/agentbarsrc/res/\346\234\211\346\225\210_\347\255\276\345\205\245.bmp"
rename to tools/agentbar/agentbarsrc/res/valid_signin.bmp
diff --git "a/tools/agentbar/agentbarsrc/res/\346\234\211\346\225\210_\347\255\276\345\207\272.bmp" b/tools/agentbar/agentbarsrc/res/valid_signout.bmp
old mode 100644
new mode 100755
similarity index 100%
rename from "tools/agentbar/agentbarsrc/res/\346\234\211\346\225\210_\347\255\276\345\207\272.bmp"
rename to tools/agentbar/agentbarsrc/res/valid_signout.bmp
diff --git "a/tools/agentbar/agentbarsrc/res/\346\234\211\346\225\210_\346\212\200\350\203\275\345\210\207\346\215\242.bmp" b/tools/agentbar/agentbarsrc/res/valid_skillchange.bmp
old mode 100644
new mode 100755
similarity index 100%
rename from "tools/agentbar/agentbarsrc/res/\346\234\211\346\225\210_\346\212\200\350\203\275\345\210\207\346\215\242.bmp"
rename to tools/agentbar/agentbarsrc/res/valid_skillchange.bmp
diff --git "a/tools/agentbar/agentbarsrc/res/\346\234\211\346\225\210_\351\200\232\350\257\235\350\275\254\347\247\273.bmp" b/tools/agentbar/agentbarsrc/res/valid_sstransfer.bmp
old mode 100644
new mode 100755
similarity index 100%
rename from "tools/agentbar/agentbarsrc/res/\346\234\211\346\225\210_\351\200\232\350\257\235\350\275\254\347\247\273.bmp"
rename to tools/agentbar/agentbarsrc/res/valid_sstransfer.bmp
diff --git "a/tools/agentbar/agentbarsrc/res/\346\234\211\346\225\210_\345\222\250\350\257\242\350\275\254\347\247\273.bmp" b/tools/agentbar/agentbarsrc/res/valid_transfer.bmp
old mode 100644
new mode 100755
similarity index 100%
rename from "tools/agentbar/agentbarsrc/res/\346\234\211\346\225\210_\345\222\250\350\257\242\350\275\254\347\247\273.bmp"
rename to tools/agentbar/agentbarsrc/res/valid_transfer.bmp
diff --git "a/tools/agentbar/agentbarsrc/res/\346\227\240\346\225\210_\345\220\216\345\244\204\347\220\206.bmp" "b/tools/agentbar/agentbarsrc/res/\346\227\240\346\225\210_\345\220\216\345\244\204\347\220\206.bmp"
deleted file mode 100644
index 08a32d1..0000000
Binary files "a/tools/agentbar/agentbarsrc/res/\346\227\240\346\225\210_\345\220\216\345\244\204\347\220\206.bmp" and /dev/null differ
diff --git "a/tools/agentbar/agentbarsrc/res/\346\227\240\346\225\210_\345\276\205\346\234\272.bmp" "b/tools/agentbar/agentbarsrc/res/\346\227\240\346\225\210_\345\276\205\346\234\272.bmp"
deleted file mode 100644
index 5eb78ce..0000000
Binary files "a/tools/agentbar/agentbarsrc/res/\346\227\240\346\225\210_\345\276\205\346\234\272.bmp" and /dev/null differ
diff --git "a/tools/agentbar/agentbarsrc/res/\346\227\240\346\225\210_\347\246\273\345\270\255.bmp" "b/tools/agentbar/agentbarsrc/res/\346\227\240\346\225\210_\347\246\273\345\270\255.bmp"
deleted file mode 100644
index d2aa016..0000000
Binary files "a/tools/agentbar/agentbarsrc/res/\346\227\240\346\225\210_\347\246\273\345\270\255.bmp" and /dev/null differ
diff --git "a/tools/agentbar/agentbarsrc/res/\346\234\211\346\225\210_\345\220\216\345\244\204\347\220\206.bmp" "b/tools/agentbar/agentbarsrc/res/\346\234\211\346\225\210_\345\220\216\345\244\204\347\220\206.bmp"
deleted file mode 100644
index 047f841..0000000
Binary files "a/tools/agentbar/agentbarsrc/res/\346\234\211\346\225\210_\345\220\216\345\244\204\347\220\206.bmp" and /dev/null differ
diff --git "a/tools/agentbar/agentbarsrc/res/\346\234\211\346\225\210_\345\276\205\346\234\272.bmp" "b/tools/agentbar/agentbarsrc/res/\346\234\211\346\225\210_\345\276\205\346\234\272.bmp"
deleted file mode 100644
index dec4749..0000000
Binary files "a/tools/agentbar/agentbarsrc/res/\346\234\211\346\225\210_\345\276\205\346\234\272.bmp" and /dev/null differ
diff --git "a/tools/agentbar/agentbarsrc/res/\346\234\211\346\225\210_\347\246\273\345\270\255.bmp" "b/tools/agentbar/agentbarsrc/res/\346\234\211\346\225\210_\347\246\273\345\270\255.bmp"
deleted file mode 100644
index 951e697..0000000
Binary files "a/tools/agentbar/agentbarsrc/res/\346\234\211\346\225\210_\347\246\273\345\270\255.bmp" and /dev/null differ
diff --git "a/tools/agentbar/agentbarsrc/res/\351\274\240\346\240\207\347\273\217\350\277\207_\345\220\216\345\244\204\347\220\206.bmp" "b/tools/agentbar/agentbarsrc/res/\351\274\240\346\240\207\347\273\217\350\277\207_\345\220\216\345\244\204\347\220\206.bmp"
deleted file mode 100644
index 984ecab..0000000
Binary files "a/tools/agentbar/agentbarsrc/res/\351\274\240\346\240\207\347\273\217\350\277\207_\345\220\216\345\244\204\347\220\206.bmp" and /dev/null differ
diff --git "a/tools/agentbar/agentbarsrc/res/\351\274\240\346\240\207\347\273\217\350\277\207_\345\276\205\346\234\272.bmp" "b/tools/agentbar/agentbarsrc/res/\351\274\240\346\240\207\347\273\217\350\277\207_\345\276\205\346\234\272.bmp"
deleted file mode 100644
index 54b9097..0000000
Binary files "a/tools/agentbar/agentbarsrc/res/\351\274\240\346\240\207\347\273\217\350\277\207_\345\276\205\346\234\272.bmp" and /dev/null differ
diff --git "a/tools/agentbar/agentbarsrc/res/\351\274\240\346\240\207\347\273\217\350\277\207_\347\246\273\345\270\255.bmp" "b/tools/agentbar/agentbarsrc/res/\351\274\240\346\240\207\347\273\217\350\277\207_\347\246\273\345\270\255.bmp"
deleted file mode 100644
index 0d26ded..0000000
Binary files "a/tools/agentbar/agentbarsrc/res/\351\274\240\346\240\207\347\273\217\350\277\207_\347\246\273\345\270\255.bmp" and /dev/null differ
diff --git a/tools/agentbar/agentbartest/CCAgentBarTest.vcxproj b/tools/agentbar/agentbartest/CCAgentBarTest.vcxproj
new file mode 100755
index 0000000..da6381d
--- /dev/null
+++ b/tools/agentbar/agentbartest/CCAgentBarTest.vcxproj
@@ -0,0 +1,141 @@
+ï»¿<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup Label="ProjectConfigurations">
+    <ProjectConfiguration Include="Debug|Win32">
+      <Configuration>Debug</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|Win32">
+      <Configuration>Release</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Template|Win32">
+      <Configuration>Template</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+  </ItemGroup>
+  <PropertyGroup Label="Globals">
+    <ProjectGuid>{FB287ABC-BD08-4ED5-8205-FB79F12FBAA0}</ProjectGuid>
+    <Keyword>MFCProj</Keyword>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseOfMfc>Static</UseOfMfc>
+    <CharacterSet>MultiByte</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseOfMfc>Static</UseOfMfc>
+    <CharacterSet>MultiByte</CharacterSet>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+  <ImportGroup Label="ExtensionSettings">
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <PropertyGroup Label="UserMacros" />
+  <PropertyGroup>
+    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\bin\</OutDir>
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Debug\</IntDir>
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</LinkIncremental>
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\bin\</OutDir>
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Release\</IntDir>
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
+  </PropertyGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <ClCompile>
+      <Optimization>Disabled</Optimization>
+      <PreprocessorDefinitions>WIN32;_WINDOWS;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <MinimalRebuild>true</MinimalRebuild>
+      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+      <TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
+      <PrecompiledHeader>Use</PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+    </ClCompile>
+    <Link>
+      <OutputFile>$(OutDir)$(ProjectName)d.exe</OutputFile>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <SubSystem>Windows</SubSystem>
+      <TargetMachine>MachineX86</TargetMachine>
+    </Link>
+    <Midl>
+      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <MkTypLibCompatible>false</MkTypLibCompatible>
+    </Midl>
+    <ResourceCompile>
+      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <Culture>0x0804</Culture>
+      <AdditionalIncludeDirectories>$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+    </ResourceCompile>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <ClCompile>
+      <PreprocessorDefinitions>WIN32;_WINDOWS;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <MinimalRebuild>false</MinimalRebuild>
+      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+      <TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
+      <PrecompiledHeader>Use</PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+    </ClCompile>
+    <Link>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <SubSystem>Windows</SubSystem>
+      <OptimizeReferences>true</OptimizeReferences>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <TargetMachine>MachineX86</TargetMachine>
+    </Link>
+    <Midl>
+      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <MkTypLibCompatible>false</MkTypLibCompatible>
+    </Midl>
+    <ResourceCompile>
+      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <Culture>0x0804</Culture>
+      <AdditionalIncludeDirectories>$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+    </ResourceCompile>
+  </ItemDefinitionGroup>
+  <ItemGroup>
+    <ClCompile Include="ccagentbarctrl.cpp" />
+    <ClCompile Include="CCAgentBarTest.cpp" />
+    <ClCompile Include="CCAgentBarTestDlg.cpp" />
+    <ClCompile Include="stdafx.cpp">
+      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
+      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
+    </ClCompile>
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="ccagentbarctrl.h" />
+    <ClInclude Include="CCAgentBarTest.h" />
+    <ClInclude Include="CCAgentBarTestDlg.h" />
+    <ClInclude Include="Resource.h" />
+    <ClInclude Include="stdafx.h" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="res\CCAgentBarTest.ico" />
+    <None Include="res\CCAgentBarTest.rc2" />
+    <None Include="ReadMe.txt" />
+  </ItemGroup>
+  <ItemGroup>
+    <ResourceCompile Include="CCAgentBarTest.rc" />
+  </ItemGroup>
+  <ItemGroup>
+    <Manifest Include="res\CCAgentBarTest.manifest" />
+  </ItemGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+  <ImportGroup Label="ExtensionTargets">
+  </ImportGroup>
+  <ProjectExtensions>
+    <VisualStudio>
+      <UserProperties RESOURCE_FILE="CCAgentBarTest.rc" _x007B_6D4733B4-8E49-495C-9F2B-27606CEB20E3_x007D_="CCcagentbarctrl" />
+    </VisualStudio>
+  </ProjectExtensions>
+</Project>
\ No newline at end of file
diff --git a/tools/agentbar/build.bat b/tools/agentbar/build.bat
index c55a70a..6f4f9bb 100644
--- a/tools/agentbar/build.bat
+++ b/tools/agentbar/build.bat
@@ -2,23 +2,24 @@
 if exist output rd /q /s output
 if not exist output mkdir output
 
-set LIBINIT="C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\Tools\vsvars32.bat"
-set CMD_VC2003="C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\IDE\Devenv"
+set LIBINIT="%VS100COMNTOOLS%/../Tools/vsvars32.bat"
+set CMD_VS2010="%VS100COMNTOOLS%/../IDE/Devenv"
 
-rem "build image plugin "
-%CMD_VC2003% "ccl_imgex\ccl_imgex.vcproj" /rebuild Release /project ccl_imgex
+rem "build image plugin"
+%CMD_VS2010% "ccl_imgex\ccl_imgex.vcxproj" /rebuild Release /project ccl_imgex
 
-rem "build main activex "
-%CMD_VC2003% "agentbarsrc\CCAgentBar.vcproj" /rebuild Release /project CCAgentBar
+rem "build main activex"
+%CMD_VS2010% "agentbarsrc\CCAgentBar.vcxproj" /rebuild Release /project CCAgentBar
 
 rem "build test project"
-%CMD_VC2003% "agentbartest\CCAgentBarTest.vcproj" /rebuild Debug /project CCAgentBarTest
-%CMD_VC2003% "agentbartest\CCAgentBarTest.vcproj" /rebuild Release /project CCAgentBarTest
+%CMD_VS2010% "agentbartest\CCAgentBarTest.vcxproj" /rebuild Release /project CCAgentBarTest
 
 call %LIBINIT%
 rem "create cab package"
-cabarc.exe -s 6144 n bin\CCAgentBar.cab bin\CCAgentBar.inf bin\CCAgentBar.ocx bin\ccl_imgex.dll
-signcode.exe -spc bin\CCAgentBar.spc -v bin\CCAgentBar.pvk bin\CCAgentBar.cab
+copy .\bin\cabarc.exe .\
+copy .\bin\signcode.exe .\
+cabarc.exe -s 6144 n .\bin\CCAgentBar.cab .\bin\CCAgentBar.inf .\bin\CCAgentBar.ocx .\bin\ccl_imgex.dll
+signcode.exe -spc .\bin\CCAgentBar.spc -v .\bin\CCAgentBar.pvk .\bin\CCAgentBar.cab
 
 copy .\bin\CCAgentBar.ocx output\
 copy .\bin\ccl_imgex.dll output\
diff --git a/tools/agentbar/ccl_imgex/ccl_imgex.rc b/tools/agentbar/ccl_imgex/ccl_imgex.rc
index fa39977..20aaa1c 100644
--- a/tools/agentbar/ccl_imgex/ccl_imgex.rc
+++ b/tools/agentbar/ccl_imgex/ccl_imgex.rc
@@ -90,58 +90,58 @@ END
 // Bitmap
 //
 
-IDB_BMP_SIGNIN          BITMAP                  "img\\ÓÐÐ§_Ç©Èë.bmp"
-IDB_BMP_SIGNOUT         BITMAP                  "img\\ÓÐÐ§_Ç©³ö.bmp"
-IDB_BMP_ANSWER          BITMAP                  "img\\ÓÐÐ§_½ÓÌý.bmp"
-IDB_BMP_CALLOUT         BITMAP                  "img\\ÓÐÐ§_ºô³ö.bmp"
-IDB_BMP_SENDDTMF        BITMAP                  "img\\ÓÐÐ§_²¦´ò·Ö»ú.bmp"
-IDB_BMP_HANGUP          BITMAP                  "img\\ÓÐÐ§_¹Ò¶Ï.bmp"
-IDB_BMP_HOLD            BITMAP                  "img\\ÓÐÐ§_±£³Ö.bmp"
-IDB_BMP_RETRIEVE        BITMAP                  "img\\ÓÐÐ§_±£³Ö½Ó»Ø.bmp"
-IDB_BMP_CONSULT         BITMAP                  "img\\ÓÐÐ§_×ÉÑ¯.bmp"
-IDB_BMP_RECONNECT       BITMAP                  "img\\ÓÐÐ§_×ÉÑ¯½Ó»Ø.bmp"
-IDB_BMP_TRANSFER        BITMAP                  "img\\ÓÐÐ§_×ÉÑ¯×ªÒÆ.bmp"
-IDB_BMP_CONFERENCE      BITMAP                  "img\\ÓÐÐ§_×ÉÑ¯»áÒé.bmp"
-IDB_BMP_SSTRANSFER      BITMAP                  "img\\ÓÐÐ§_Í¨»°×ªÒÆ.bmp"
-IDB_BMP_REST            BITMAP                  "img\\ÓÐÐ§_ÐÝÏ¢.bmp"
-IDB_BMP_READY           BITMAP                  "img\\ÓÐÐ§_½ÓÌý¾ÍÐ÷.bmp"
-IDB_BMP_BUSY            BITMAP                  "img\\ÓÐÐ§_ºô³ö¾ÍÐ÷.bmp"
-IDB_BMP_SKILLCHANGE     BITMAP                  "img\\ÓÐÐ§_¼¼ÄÜÇÐ»».bmp"
-IDB_BMP_FENGE           BITMAP                  "img\\·Ö¸ôÌõ.bmp"
-IDB_BMP_MS_SIGNIN       BITMAP                  "img\\Êó±ê¾­¹ý_Ç©Èë.bmp"
-IDB_BMP_MS_SIGNOUT      BITMAP                  "img\\Êó±ê¾­¹ý_Ç©³ö.bmp"
-IDB_BMP_MS_ANSWER       BITMAP                  "img\\Êó±ê¾­¹ý_½ÓÌý.bmp"
-IDB_BMP_MS_CALLOUT      BITMAP                  "img\\Êó±ê¾­¹ý_ºô³ö.bmp"
-IDB_BMP_MS_SENDDTMF     BITMAP                  "img\\Êó±ê¾­¹ý_²¦´ò·Ö»ú.bmp"
-IDB_BMP_MS_HANGUP       BITMAP                  "img\\Êó±ê¾­¹ý_¹Ò¶Ï.bmp"
-IDB_BMP_MS_HOLD         BITMAP                  "img\\Êó±ê¾­¹ý_±£³Ö.bmp"
-IDB_BMP_MS_RETRIEVE     BITMAP                  "img\\Êó±ê¾­¹ý_±£³Ö½Ó»Ø.bmp"
-IDB_BMP_MS_CONSULT      BITMAP                  "img\\Êó±ê¾­¹ý_×ÉÑ¯.bmp"
-IDB_BMP_MS_RECONNECT    BITMAP                  "img\\Êó±ê¾­¹ý_×ÉÑ¯½Ó»Ø.bmp"
-IDB_BMP_MS_TRANSFER     BITMAP                  "img\\Êó±ê¾­¹ý_×ÉÑ¯×ªÒÆ.bmp"
-IDB_BMP_MS_CONFERENCE   BITMAP                  "img\\Êó±ê¾­¹ý_×ÉÑ¯»áÒé.bmp"
-IDB_BMP_MS_SSTRANSFER   BITMAP                  "img\\Êó±ê¾­¹ý_Í¨»°×ªÒÆ.bmp"
-IDB_BMP_MS_REST         BITMAP                  "img\\Êó±ê¾­¹ý_ÐÝÏ¢.bmp"
-IDB_BMP_MS_READY        BITMAP                  "img\\Êó±ê¾­¹ý_½ÓÌý¾ÍÐ÷.bmp"
-IDB_BMP_MS_BUSY         BITMAP                  "img\\Êó±ê¾­¹ý_ºô³ö¾ÍÐ÷.bmp"
-IDB_BMP_MS_SKILLCHANGE  BITMAP                  "img\\Êó±ê¾­¹ý_¼¼ÄÜÇÐ»».bmp"
-IDB_BMP_IN_SIGNIN       BITMAP                  "img\\ÎÞÐ§_Ç©Èë.bmp"
-IDB_BMP_IN_SIGNOUT      BITMAP                  "img\\ÎÞÐ§_Ç©³ö.bmp"
-IDB_BMP_IN_ANSWER       BITMAP                  "img\\ÎÞÐ§_½ÓÌý.bmp"
-IDB_BMP_IN_CALLOUT      BITMAP                  "img\\ÎÞÐ§_ºô³ö.bmp"
-IDB_BMP_IN_SENDDTMF     BITMAP                  "img\\ÎÞÐ§_²¦´ò·Ö»ú.bmp"
-IDB_BMP_IN_HANGUP       BITMAP                  "img\\ÎÞÐ§_¹Ò¶Ï.bmp"
-IDB_BMP_IN_HOLD         BITMAP                  "img\\ÎÞÐ§_±£³Ö.bmp"
-IDB_BMP_IN_RETRIEVE     BITMAP                  "img\\ÎÞÐ§_±£³Ö½Ó»Ø.bmp"
-IDB_BMP_IN_CONSULT      BITMAP                  "img\\ÎÞÐ§_×ÉÑ¯.bmp"
-IDB_BMP_IN_RECONNECT    BITMAP                  "img\\ÎÞÐ§_×ÉÑ¯½Ó»Ø.bmp"
-IDB_BMP_IN_TRANSFER     BITMAP                  "img\\ÎÞÐ§_×ÉÑ¯×ªÒÆ.bmp"
-IDB_BMP_IN_CONFERENCE   BITMAP                  "img\\ÎÞÐ§_×ÉÑ¯»áÒé.bmp"
-IDB_BMP_IN_SSTRANSFER   BITMAP                  "img\\ÎÞÐ§_Í¨»°×ªÒÆ.bmp"
-IDB_BMP_IN_REST         BITMAP                  "img\\ÎÞÐ§_ÐÝÏ¢.bmp"
-IDB_BMP_IN_READY        BITMAP                  "img\\ÎÞÐ§_½ÓÌý¾ÍÐ÷.bmp"
-IDB_BMP_IN_BUSY         BITMAP                  "img\\ÎÞÐ§_ºô³ö¾ÍÐ÷.bmp"
-IDB_BMP_IN_SKILLCHANGE  BITMAP                  "img\\ÎÞÐ§_¼¼ÄÜÇÐ»».bmp"
+IDB_BMP_SIGNIN          BITMAP                  "img\\valid_signin.bmp"
+IDB_BMP_SIGNOUT         BITMAP                  "img\\valid_signout.bmp"
+IDB_BMP_ANSWER          BITMAP                  "img\\valid_answer.bmp"
+IDB_BMP_CALLOUT         BITMAP                  "img\\valid_callout.bmp"
+IDB_BMP_SENDDTMF        BITMAP                  "img\\valid_dtmf.bmp"
+IDB_BMP_HANGUP          BITMAP                  "img\\valid_hangup.bmp"
+IDB_BMP_HOLD            BITMAP                  "img\\valid_hold.bmp"
+IDB_BMP_RETRIEVE        BITMAP                  "img\\valid_retrieve.bmp"
+IDB_BMP_CONSULT         BITMAP                  "img\\valid_consult.bmp"
+IDB_BMP_RECONNECT       BITMAP                  "img\\valid_reconnect.bmp"
+IDB_BMP_TRANSFER        BITMAP                  "img\\valid_transfer.bmp"
+IDB_BMP_CONFERENCE      BITMAP                  "img\\valid_conference.bmp"
+IDB_BMP_SSTRANSFER      BITMAP                  "img\\valid_sstransfer.bmp"
+IDB_BMP_REST            BITMAP                  "img\\valid_rest.bmp"
+IDB_BMP_READY           BITMAP                  "img\\valid_ready.bmp"
+IDB_BMP_BUSY            BITMAP                  "img\\valid_busy.bmp"
+IDB_BMP_SKILLCHANGE     BITMAP                  "img\\valid_skillchange.bmp"
+IDB_BMP_FENGE           BITMAP                  "img\\split.bmp"
+IDB_BMP_MS_SIGNIN       BITMAP                  "img\\over_signin.bmp"
+IDB_BMP_MS_SIGNOUT      BITMAP                  "img\\over_signout.bmp"
+IDB_BMP_MS_ANSWER       BITMAP                  "img\\over_answer.bmp"
+IDB_BMP_MS_CALLOUT      BITMAP                  "img\\over_callout.bmp"
+IDB_BMP_MS_SENDDTMF     BITMAP                  "img\\over_dtmf.bmp"
+IDB_BMP_MS_HANGUP       BITMAP                  "img\\over_hangup.bmp"
+IDB_BMP_MS_HOLD         BITMAP                  "img\\over_hold.bmp"
+IDB_BMP_MS_RETRIEVE     BITMAP                  "img\\over_retrieve.bmp"
+IDB_BMP_MS_CONSULT      BITMAP                  "img\\over_consult.bmp"
+IDB_BMP_MS_RECONNECT    BITMAP                  "img\\over_reconnect.bmp"
+IDB_BMP_MS_TRANSFER     BITMAP                  "img\\over_transfer.bmp"
+IDB_BMP_MS_CONFERENCE   BITMAP                  "img\\over_conference.bmp"
+IDB_BMP_MS_SSTRANSFER   BITMAP                  "img\\over_sstransfer.bmp"
+IDB_BMP_MS_REST         BITMAP                  "img\\over_rest.bmp"
+IDB_BMP_MS_READY        BITMAP                  "img\\over_ready.bmp"
+IDB_BMP_MS_BUSY         BITMAP                  "img\\over_busy.bmp"
+IDB_BMP_MS_SKILLCHANGE  BITMAP                  "img\\over_skillchange.bmp"
+IDB_BMP_IN_SIGNIN       BITMAP                  "img\\invalid_signin.bmp"
+IDB_BMP_IN_SIGNOUT      BITMAP                  "img\\invalid_signout.bmp"
+IDB_BMP_IN_ANSWER       BITMAP                  "img\\invalid_answer.bmp"
+IDB_BMP_IN_CALLOUT      BITMAP                  "img\\invalid_callout.bmp"
+IDB_BMP_IN_SENDDTMF     BITMAP                  "img\\invalid_dtmf.bmp"
+IDB_BMP_IN_HANGUP       BITMAP                  "img\\invalid_hangup.bmp"
+IDB_BMP_IN_HOLD         BITMAP                  "img\\invalid_hold.bmp"
+IDB_BMP_IN_RETRIEVE     BITMAP                  "img\\invalid_retrieve.bmp"
+IDB_BMP_IN_CONSULT      BITMAP                  "img\\invalid_consult.bmp"
+IDB_BMP_IN_RECONNECT    BITMAP                  "img\\invalid_reconnect.bmp"
+IDB_BMP_IN_TRANSFER     BITMAP                  "img\\invalid_transfer.bmp"
+IDB_BMP_IN_CONFERENCE   BITMAP                  "img\\invalid_conference.bmp"
+IDB_BMP_IN_SSTRANSFER   BITMAP                  "img\\invalid_sstransfer.bmp"
+IDB_BMP_IN_REST         BITMAP                  "img\\invalid_rest.bmp"
+IDB_BMP_IN_READY        BITMAP                  "img\\invalid_ready.bmp"
+IDB_BMP_IN_BUSY         BITMAP                  "img\\invalid_busy.bmp"
+IDB_BMP_IN_SKILLCHANGE  BITMAP                  "img\\invalid_skillchange.bmp"
 IDB_BMP_BACKGROUND      BITMAP                  "img\\BACKGROUND.bmp"
 #endif    // ÖÐÎÄ(ÖÐ»ªÈËÃñ¹²ºÍ¹ú) resources
 /////////////////////////////////////////////////////////////////////////////
diff --git a/tools/agentbar/ccl_imgex/ccl_imgex.vcproj b/tools/agentbar/ccl_imgex/ccl_imgex.vcproj
index 6c6614d..026cb2d 100644
--- a/tools/agentbar/ccl_imgex/ccl_imgex.vcproj
+++ b/tools/agentbar/ccl_imgex/ccl_imgex.vcproj
@@ -77,169 +77,6 @@
 			<File
 				RelativePath=".\ccl_imgex.rc">
 			</File>
-			<Filter
-				Name="img"
-				Filter="">
-				<File
-					RelativePath=".\img\BACKGROUND.bmp">
-				</File>
-				<File
-					RelativePath=".\img\·Ö¸ôÌõ.bmp">
-				</File>
-				<File
-					RelativePath=".\img\ÎÞÐ§_ÐÝÏ¢.bmp">
-				</File>
-				<File
-					RelativePath=".\img\ÎÞÐ§_±£³Ö.bmp">
-				</File>
-				<File
-					RelativePath=".\img\ÎÞÐ§_±£³Ö½Ó»Ø.bmp">
-				</File>
-				<File
-					RelativePath=".\img\ÎÞÐ§_ºô³ö.bmp">
-				</File>
-				<File
-					RelativePath=".\img\ÎÞÐ§_ºô³ö¾ÍÐ÷.bmp">
-				</File>
-				<File
-					RelativePath=".\img\ÎÞÐ§_×ÉÑ¯.bmp">
-				</File>
-				<File
-					RelativePath=".\img\ÎÞÐ§_×ÉÑ¯»áÒé.bmp">
-				</File>
-				<File
-					RelativePath=".\img\ÎÞÐ§_×ÉÑ¯½Ó»Ø.bmp">
-				</File>
-				<File
-					RelativePath=".\img\ÎÞÐ§_×ÉÑ¯×ªÒÆ.bmp">
-				</File>
-				<File
-					RelativePath=".\img\ÎÞÐ§_¼¼ÄÜÇÐ»».bmp">
-				</File>
-				<File
-					RelativePath=".\img\ÎÞÐ§_²¦´ò·Ö»ú.bmp">
-				</File>
-				<File
-					RelativePath=".\img\ÎÞÐ§_¹Ò¶Ï.bmp">
-				</File>
-				<File
-					RelativePath=".\img\ÎÞÐ§_½ÓÌý.bmp">
-				</File>
-				<File
-					RelativePath=".\img\ÎÞÐ§_½ÓÌý¾ÍÐ÷.bmp">
-				</File>
-				<File
-					RelativePath=".\img\ÎÞÐ§_Ç©Èë.bmp">
-				</File>
-				<File
-					RelativePath=".\img\ÎÞÐ§_Ç©³ö.bmp">
-				</File>
-				<File
-					RelativePath=".\img\ÎÞÐ§_Í¨»°×ªÒÆ.bmp">
-				</File>
-				<File
-					RelativePath=".\img\ÓÐÐ§_ÐÝÏ¢.bmp">
-				</File>
-				<File
-					RelativePath=".\img\ÓÐÐ§_±£³Ö.bmp">
-				</File>
-				<File
-					RelativePath=".\img\ÓÐÐ§_±£³Ö½Ó»Ø.bmp">
-				</File>
-				<File
-					RelativePath=".\img\ÓÐÐ§_ºô³ö.bmp">
-				</File>
-				<File
-					RelativePath=".\img\ÓÐÐ§_ºô³ö¾ÍÐ÷.bmp">
-				</File>
-				<File
-					RelativePath=".\img\ÓÐÐ§_×ÉÑ¯.bmp">
-				</File>
-				<File
-					RelativePath=".\img\ÓÐÐ§_×ÉÑ¯»áÒé.bmp">
-				</File>
-				<File
-					RelativePath=".\img\ÓÐÐ§_×ÉÑ¯½Ó»Ø.bmp">
-				</File>
-				<File
-					RelativePath=".\img\ÓÐÐ§_×ÉÑ¯×ªÒÆ.bmp">
-				</File>
-				<File
-					RelativePath=".\img\ÓÐÐ§_¼¼ÄÜÇÐ»».bmp">
-				</File>
-				<File
-					RelativePath=".\img\ÓÐÐ§_²¦´ò·Ö»ú.bmp">
-				</File>
-				<File
-					RelativePath=".\img\ÓÐÐ§_¹Ò¶Ï.bmp">
-				</File>
-				<File
-					RelativePath=".\img\ÓÐÐ§_½ÓÌý.bmp">
-				</File>
-				<File
-					RelativePath=".\img\ÓÐÐ§_½ÓÌý¾ÍÐ÷.bmp">
-				</File>
-				<File
-					RelativePath=".\img\ÓÐÐ§_Ç©Èë.bmp">
-				</File>
-				<File
-					RelativePath=".\img\ÓÐÐ§_Ç©³ö.bmp">
-				</File>
-				<File
-					RelativePath=".\img\ÓÐÐ§_Í¨»°×ªÒÆ.bmp">
-				</File>
-				<File
-					RelativePath=".\img\Êó±ê¾­¹ý_ÐÝÏ¢.bmp">
-				</File>
-				<File
-					RelativePath=".\img\Êó±ê¾­¹ý_±£³Ö.bmp">
-				</File>
-				<File
-					RelativePath=".\img\Êó±ê¾­¹ý_±£³Ö½Ó»Ø.bmp">
-				</File>
-				<File
-					RelativePath=".\img\Êó±ê¾­¹ý_ºô³ö.bmp">
-				</File>
-				<File
-					RelativePath=".\img\Êó±ê¾­¹ý_ºô³ö¾ÍÐ÷.bmp">
-				</File>
-				<File
-					RelativePath=".\img\Êó±ê¾­¹ý_×ÉÑ¯.bmp">
-				</File>
-				<File
-					RelativePath=".\img\Êó±ê¾­¹ý_×ÉÑ¯»áÒé.bmp">
-				</File>
-				<File
-					RelativePath=".\img\Êó±ê¾­¹ý_×ÉÑ¯½Ó»Ø.bmp">
-				</File>
-				<File
-					RelativePath=".\img\Êó±ê¾­¹ý_×ÉÑ¯×ªÒÆ.bmp">
-				</File>
-				<File
-					RelativePath=".\img\Êó±ê¾­¹ý_¼¼ÄÜÇÐ»».bmp">
-				</File>
-				<File
-					RelativePath=".\img\Êó±ê¾­¹ý_²¦´ò·Ö»ú.bmp">
-				</File>
-				<File
-					RelativePath=".\img\Êó±ê¾­¹ý_¹Ò¶Ï.bmp">
-				</File>
-				<File
-					RelativePath=".\img\Êó±ê¾­¹ý_½ÓÌý.bmp">
-				</File>
-				<File
-					RelativePath=".\img\Êó±ê¾­¹ý_½ÓÌý¾ÍÐ÷.bmp">
-				</File>
-				<File
-					RelativePath=".\img\Êó±ê¾­¹ý_Ç©Èë.bmp">
-				</File>
-				<File
-					RelativePath=".\img\Êó±ê¾­¹ý_Ç©³ö.bmp">
-				</File>
-				<File
-					RelativePath=".\img\Êó±ê¾­¹ý_Í¨»°×ªÒÆ.bmp">
-				</File>
-			</Filter>
 		</Filter>
 	</Files>
 	<Globals>
diff --git a/tools/agentbar/ccl_imgex/ccl_imgex.vcxproj b/tools/agentbar/ccl_imgex/ccl_imgex.vcxproj
new file mode 100755
index 0000000..05525d0
--- /dev/null
+++ b/tools/agentbar/ccl_imgex/ccl_imgex.vcxproj
@@ -0,0 +1,60 @@
+ï»¿<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup Label="ProjectConfigurations">
+    <ProjectConfiguration Include="Release|Win32">
+      <Configuration>Release</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+  </ItemGroup>
+  <PropertyGroup Label="Globals">
+    <ProjectGuid>{FB16FD44-B2E7-4C15-BCC3-04D6DC54E219}</ProjectGuid>
+    <Keyword>Win32Proj</Keyword>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <CharacterSet>MultiByte</CharacterSet>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+  <ImportGroup Label="ExtensionSettings">
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <PropertyGroup Label="UserMacros" />
+  <PropertyGroup>
+    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\bin\</OutDir>
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Release\</IntDir>
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
+  </PropertyGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <ClCompile>
+      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;CCL_IMGEX_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+    </ClCompile>
+    <Link>
+      <OutputFile>$(OutDir)ccl_imgex.dll</OutputFile>
+      <GenerateDebugInformation>false</GenerateDebugInformation>
+      <SubSystem>Windows</SubSystem>
+      <OptimizeReferences>true</OptimizeReferences>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <NoEntryPoint>true</NoEntryPoint>
+      <ImportLibrary>$(OutDir)ccl_imgex.lib</ImportLibrary>
+      <TargetMachine>MachineX86</TargetMachine>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemGroup>
+    <ClInclude Include="resource.h" />
+  </ItemGroup>
+  <ItemGroup>
+    <ResourceCompile Include="ccl_imgex.rc" />
+  </ItemGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+  <ImportGroup Label="ExtensionTargets">
+  </ImportGroup>
+</Project>
\ No newline at end of file
diff --git a/tools/agentbar/ccl_imgex/img/invalid_answer.bmp b/tools/agentbar/ccl_imgex/img/invalid_answer.bmp
new file mode 100755
index 0000000..01d329f
Binary files /dev/null and b/tools/agentbar/ccl_imgex/img/invalid_answer.bmp differ
diff --git a/tools/agentbar/ccl_imgex/img/invalid_busy.bmp b/tools/agentbar/ccl_imgex/img/invalid_busy.bmp
new file mode 100755
index 0000000..0b1b381
Binary files /dev/null and b/tools/agentbar/ccl_imgex/img/invalid_busy.bmp differ
diff --git a/tools/agentbar/ccl_imgex/img/invalid_callout.bmp b/tools/agentbar/ccl_imgex/img/invalid_callout.bmp
new file mode 100755
index 0000000..f058678
Binary files /dev/null and b/tools/agentbar/ccl_imgex/img/invalid_callout.bmp differ
diff --git a/tools/agentbar/ccl_imgex/img/invalid_conference.bmp b/tools/agentbar/ccl_imgex/img/invalid_conference.bmp
new file mode 100755
index 0000000..f4fb280
Binary files /dev/null and b/tools/agentbar/ccl_imgex/img/invalid_conference.bmp differ
diff --git a/tools/agentbar/ccl_imgex/img/invalid_consult.bmp b/tools/agentbar/ccl_imgex/img/invalid_consult.bmp
new file mode 100755
index 0000000..2aa0729
Binary files /dev/null and b/tools/agentbar/ccl_imgex/img/invalid_consult.bmp differ
diff --git a/tools/agentbar/ccl_imgex/img/invalid_dtmf.bmp b/tools/agentbar/ccl_imgex/img/invalid_dtmf.bmp
new file mode 100755
index 0000000..576b4a3
Binary files /dev/null and b/tools/agentbar/ccl_imgex/img/invalid_dtmf.bmp differ
diff --git a/tools/agentbar/ccl_imgex/img/invalid_hangup.bmp b/tools/agentbar/ccl_imgex/img/invalid_hangup.bmp
new file mode 100755
index 0000000..8e6860d
Binary files /dev/null and b/tools/agentbar/ccl_imgex/img/invalid_hangup.bmp differ
diff --git a/tools/agentbar/ccl_imgex/img/invalid_hold.bmp b/tools/agentbar/ccl_imgex/img/invalid_hold.bmp
new file mode 100755
index 0000000..b67f49b
Binary files /dev/null and b/tools/agentbar/ccl_imgex/img/invalid_hold.bmp differ
diff --git a/tools/agentbar/ccl_imgex/img/invalid_ready.bmp b/tools/agentbar/ccl_imgex/img/invalid_ready.bmp
new file mode 100755
index 0000000..1298ea8
Binary files /dev/null and b/tools/agentbar/ccl_imgex/img/invalid_ready.bmp differ
diff --git a/tools/agentbar/ccl_imgex/img/invalid_reconnect.bmp b/tools/agentbar/ccl_imgex/img/invalid_reconnect.bmp
new file mode 100755
index 0000000..2f30796
Binary files /dev/null and b/tools/agentbar/ccl_imgex/img/invalid_reconnect.bmp differ
diff --git a/tools/agentbar/ccl_imgex/img/invalid_rest.bmp b/tools/agentbar/ccl_imgex/img/invalid_rest.bmp
new file mode 100755
index 0000000..fb9828d
Binary files /dev/null and b/tools/agentbar/ccl_imgex/img/invalid_rest.bmp differ
diff --git a/tools/agentbar/ccl_imgex/img/invalid_retrieve.bmp b/tools/agentbar/ccl_imgex/img/invalid_retrieve.bmp
new file mode 100755
index 0000000..d9f2e83
Binary files /dev/null and b/tools/agentbar/ccl_imgex/img/invalid_retrieve.bmp differ
diff --git a/tools/agentbar/ccl_imgex/img/invalid_signin.bmp b/tools/agentbar/ccl_imgex/img/invalid_signin.bmp
new file mode 100755
index 0000000..714fc5d
Binary files /dev/null and b/tools/agentbar/ccl_imgex/img/invalid_signin.bmp differ
diff --git a/tools/agentbar/ccl_imgex/img/invalid_signout.bmp b/tools/agentbar/ccl_imgex/img/invalid_signout.bmp
new file mode 100755
index 0000000..ab2ffc9
Binary files /dev/null and b/tools/agentbar/ccl_imgex/img/invalid_signout.bmp differ
diff --git a/tools/agentbar/ccl_imgex/img/invalid_skillchange.bmp b/tools/agentbar/ccl_imgex/img/invalid_skillchange.bmp
new file mode 100755
index 0000000..06146b0
Binary files /dev/null and b/tools/agentbar/ccl_imgex/img/invalid_skillchange.bmp differ
diff --git a/tools/agentbar/ccl_imgex/img/invalid_sstransfer.bmp b/tools/agentbar/ccl_imgex/img/invalid_sstransfer.bmp
new file mode 100755
index 0000000..294873c
Binary files /dev/null and b/tools/agentbar/ccl_imgex/img/invalid_sstransfer.bmp differ
diff --git a/tools/agentbar/ccl_imgex/img/invalid_transfer.bmp b/tools/agentbar/ccl_imgex/img/invalid_transfer.bmp
new file mode 100755
index 0000000..7ed452b
Binary files /dev/null and b/tools/agentbar/ccl_imgex/img/invalid_transfer.bmp differ
diff --git a/tools/agentbar/ccl_imgex/img/over_answer.bmp b/tools/agentbar/ccl_imgex/img/over_answer.bmp
new file mode 100755
index 0000000..f172d0d
Binary files /dev/null and b/tools/agentbar/ccl_imgex/img/over_answer.bmp differ
diff --git a/tools/agentbar/ccl_imgex/img/over_busy.bmp b/tools/agentbar/ccl_imgex/img/over_busy.bmp
new file mode 100755
index 0000000..387b4ba
Binary files /dev/null and b/tools/agentbar/ccl_imgex/img/over_busy.bmp differ
diff --git a/tools/agentbar/ccl_imgex/img/over_callout.bmp b/tools/agentbar/ccl_imgex/img/over_callout.bmp
new file mode 100755
index 0000000..259052c
Binary files /dev/null and b/tools/agentbar/ccl_imgex/img/over_callout.bmp differ
diff --git a/tools/agentbar/ccl_imgex/img/over_conference.bmp b/tools/agentbar/ccl_imgex/img/over_conference.bmp
new file mode 100755
index 0000000..b859f27
Binary files /dev/null and b/tools/agentbar/ccl_imgex/img/over_conference.bmp differ
diff --git a/tools/agentbar/ccl_imgex/img/over_consult.bmp b/tools/agentbar/ccl_imgex/img/over_consult.bmp
new file mode 100755
index 0000000..80c677f
Binary files /dev/null and b/tools/agentbar/ccl_imgex/img/over_consult.bmp differ
diff --git a/tools/agentbar/ccl_imgex/img/over_dtmf.bmp b/tools/agentbar/ccl_imgex/img/over_dtmf.bmp
new file mode 100755
index 0000000..7407bf1
Binary files /dev/null and b/tools/agentbar/ccl_imgex/img/over_dtmf.bmp differ
diff --git a/tools/agentbar/ccl_imgex/img/over_hangup.bmp b/tools/agentbar/ccl_imgex/img/over_hangup.bmp
new file mode 100755
index 0000000..71321ee
Binary files /dev/null and b/tools/agentbar/ccl_imgex/img/over_hangup.bmp differ
diff --git a/tools/agentbar/ccl_imgex/img/over_hold.bmp b/tools/agentbar/ccl_imgex/img/over_hold.bmp
new file mode 100755
index 0000000..864a482
Binary files /dev/null and b/tools/agentbar/ccl_imgex/img/over_hold.bmp differ
diff --git a/tools/agentbar/ccl_imgex/img/over_ready.bmp b/tools/agentbar/ccl_imgex/img/over_ready.bmp
new file mode 100755
index 0000000..881bd15
Binary files /dev/null and b/tools/agentbar/ccl_imgex/img/over_ready.bmp differ
diff --git a/tools/agentbar/ccl_imgex/img/over_reconnect.bmp b/tools/agentbar/ccl_imgex/img/over_reconnect.bmp
new file mode 100755
index 0000000..0dd869d
Binary files /dev/null and b/tools/agentbar/ccl_imgex/img/over_reconnect.bmp differ
diff --git a/tools/agentbar/ccl_imgex/img/over_rest.bmp b/tools/agentbar/ccl_imgex/img/over_rest.bmp
new file mode 100755
index 0000000..7618c6a
Binary files /dev/null and b/tools/agentbar/ccl_imgex/img/over_rest.bmp differ
diff --git a/tools/agentbar/ccl_imgex/img/over_retrieve.bmp b/tools/agentbar/ccl_imgex/img/over_retrieve.bmp
new file mode 100755
index 0000000..f50676f
Binary files /dev/null and b/tools/agentbar/ccl_imgex/img/over_retrieve.bmp differ
diff --git a/tools/agentbar/ccl_imgex/img/over_signin.bmp b/tools/agentbar/ccl_imgex/img/over_signin.bmp
new file mode 100755
index 0000000..d9abd35
Binary files /dev/null and b/tools/agentbar/ccl_imgex/img/over_signin.bmp differ
diff --git a/tools/agentbar/ccl_imgex/img/over_signout.bmp b/tools/agentbar/ccl_imgex/img/over_signout.bmp
new file mode 100755
index 0000000..117acdb
Binary files /dev/null and b/tools/agentbar/ccl_imgex/img/over_signout.bmp differ
diff --git a/tools/agentbar/ccl_imgex/img/over_skillchange.bmp b/tools/agentbar/ccl_imgex/img/over_skillchange.bmp
new file mode 100755
index 0000000..6c09e4f
Binary files /dev/null and b/tools/agentbar/ccl_imgex/img/over_skillchange.bmp differ
diff --git a/tools/agentbar/ccl_imgex/img/over_sstransfer.bmp b/tools/agentbar/ccl_imgex/img/over_sstransfer.bmp
new file mode 100755
index 0000000..25993b7
Binary files /dev/null and b/tools/agentbar/ccl_imgex/img/over_sstransfer.bmp differ
diff --git a/tools/agentbar/ccl_imgex/img/over_transfer.bmp b/tools/agentbar/ccl_imgex/img/over_transfer.bmp
new file mode 100755
index 0000000..ea0d75c
Binary files /dev/null and b/tools/agentbar/ccl_imgex/img/over_transfer.bmp differ
diff --git a/tools/agentbar/ccl_imgex/img/split.bmp b/tools/agentbar/ccl_imgex/img/split.bmp
new file mode 100755
index 0000000..b8b82d8
Binary files /dev/null and b/tools/agentbar/ccl_imgex/img/split.bmp differ
diff --git a/tools/agentbar/ccl_imgex/img/valid_answer.bmp b/tools/agentbar/ccl_imgex/img/valid_answer.bmp
new file mode 100755
index 0000000..35eb100
Binary files /dev/null and b/tools/agentbar/ccl_imgex/img/valid_answer.bmp differ
diff --git a/tools/agentbar/ccl_imgex/img/valid_busy.bmp b/tools/agentbar/ccl_imgex/img/valid_busy.bmp
new file mode 100755
index 0000000..8adcbd9
Binary files /dev/null and b/tools/agentbar/ccl_imgex/img/valid_busy.bmp differ
diff --git a/tools/agentbar/ccl_imgex/img/valid_callout.bmp b/tools/agentbar/ccl_imgex/img/valid_callout.bmp
new file mode 100755
index 0000000..688e6a4
Binary files /dev/null and b/tools/agentbar/ccl_imgex/img/valid_callout.bmp differ
diff --git a/tools/agentbar/ccl_imgex/img/valid_conference.bmp b/tools/agentbar/ccl_imgex/img/valid_conference.bmp
new file mode 100755
index 0000000..8d66174
Binary files /dev/null and b/tools/agentbar/ccl_imgex/img/valid_conference.bmp differ
diff --git a/tools/agentbar/ccl_imgex/img/valid_consult.bmp b/tools/agentbar/ccl_imgex/img/valid_consult.bmp
new file mode 100755
index 0000000..a3842d5
Binary files /dev/null and b/tools/agentbar/ccl_imgex/img/valid_consult.bmp differ
diff --git a/tools/agentbar/ccl_imgex/img/valid_dtmf.bmp b/tools/agentbar/ccl_imgex/img/valid_dtmf.bmp
new file mode 100755
index 0000000..fbb8766
Binary files /dev/null and b/tools/agentbar/ccl_imgex/img/valid_dtmf.bmp differ
diff --git a/tools/agentbar/ccl_imgex/img/valid_hangup.bmp b/tools/agentbar/ccl_imgex/img/valid_hangup.bmp
new file mode 100755
index 0000000..facb046
Binary files /dev/null and b/tools/agentbar/ccl_imgex/img/valid_hangup.bmp differ
diff --git a/tools/agentbar/ccl_imgex/img/valid_hold.bmp b/tools/agentbar/ccl_imgex/img/valid_hold.bmp
new file mode 100755
index 0000000..dff5f80
Binary files /dev/null and b/tools/agentbar/ccl_imgex/img/valid_hold.bmp differ
diff --git a/tools/agentbar/ccl_imgex/img/valid_ready.bmp b/tools/agentbar/ccl_imgex/img/valid_ready.bmp
new file mode 100755
index 0000000..4bbec55
Binary files /dev/null and b/tools/agentbar/ccl_imgex/img/valid_ready.bmp differ
diff --git a/tools/agentbar/ccl_imgex/img/valid_reconnect.bmp b/tools/agentbar/ccl_imgex/img/valid_reconnect.bmp
new file mode 100755
index 0000000..11de65f
Binary files /dev/null and b/tools/agentbar/ccl_imgex/img/valid_reconnect.bmp differ
diff --git a/tools/agentbar/ccl_imgex/img/valid_rest.bmp b/tools/agentbar/ccl_imgex/img/valid_rest.bmp
new file mode 100755
index 0000000..79dc31b
Binary files /dev/null and b/tools/agentbar/ccl_imgex/img/valid_rest.bmp differ
diff --git a/tools/agentbar/ccl_imgex/img/valid_retrieve.bmp b/tools/agentbar/ccl_imgex/img/valid_retrieve.bmp
new file mode 100755
index 0000000..835044b
Binary files /dev/null and b/tools/agentbar/ccl_imgex/img/valid_retrieve.bmp differ
diff --git a/tools/agentbar/ccl_imgex/img/valid_signin.bmp b/tools/agentbar/ccl_imgex/img/valid_signin.bmp
new file mode 100755
index 0000000..6c190ec
Binary files /dev/null and b/tools/agentbar/ccl_imgex/img/valid_signin.bmp differ
diff --git a/tools/agentbar/ccl_imgex/img/valid_signout.bmp b/tools/agentbar/ccl_imgex/img/valid_signout.bmp
new file mode 100755
index 0000000..7b29173
Binary files /dev/null and b/tools/agentbar/ccl_imgex/img/valid_signout.bmp differ
diff --git a/tools/agentbar/ccl_imgex/img/valid_skillchange.bmp b/tools/agentbar/ccl_imgex/img/valid_skillchange.bmp
new file mode 100755
index 0000000..7e7e188
Binary files /dev/null and b/tools/agentbar/ccl_imgex/img/valid_skillchange.bmp differ
diff --git a/tools/agentbar/ccl_imgex/img/valid_sstransfer.bmp b/tools/agentbar/ccl_imgex/img/valid_sstransfer.bmp
new file mode 100755
index 0000000..12763a7
Binary files /dev/null and b/tools/agentbar/ccl_imgex/img/valid_sstransfer.bmp differ
diff --git a/tools/agentbar/ccl_imgex/img/valid_transfer.bmp b/tools/agentbar/ccl_imgex/img/valid_transfer.bmp
new file mode 100755
index 0000000..c4a4f86
Binary files /dev/null and b/tools/agentbar/ccl_imgex/img/valid_transfer.bmp differ
diff --git "a/tools/agentbar/ccl_imgex/img/\345\210\206\351\232\224\346\235\241.bmp" "b/tools/agentbar/ccl_imgex/img/\345\210\206\351\232\224\346\235\241.bmp"
deleted file mode 100644
index 93ca63c..0000000
Binary files "a/tools/agentbar/ccl_imgex/img/\345\210\206\351\232\224\346\235\241.bmp" and /dev/null differ
diff --git "a/tools/agentbar/ccl_imgex/img/\346\227\240\346\225\210_\344\274\221\346\201\257.bmp" "b/tools/agentbar/ccl_imgex/img/\346\227\240\346\225\210_\344\274\221\346\201\257.bmp"
deleted file mode 100644
index ec23927..0000000
Binary files "a/tools/agentbar/ccl_imgex/img/\346\227\240\346\225\210_\344\274\221\346\201\257.bmp" and /dev/null differ
diff --git "a/tools/agentbar/ccl_imgex/img/\346\227\240\346\225\210_\344\277\235\346\214\201.bmp" "b/tools/agentbar/ccl_imgex/img/\346\227\240\346\225\210_\344\277\235\346\214\201.bmp"
deleted file mode 100644
index 76cdb93..0000000
Binary files "a/tools/agentbar/ccl_imgex/img/\346\227\240\346\225\210_\344\277\235\346\214\201.bmp" and /dev/null differ
diff --git "a/tools/agentbar/ccl_imgex/img/\346\227\240\346\225\210_\344\277\235\346\214\201\346\216\245\345\233\236.bmp" "b/tools/agentbar/ccl_imgex/img/\346\227\240\346\225\210_\344\277\235\346\214\201\346\216\245\345\233\236.bmp"
deleted file mode 100644
index 730e370..0000000
Binary files "a/tools/agentbar/ccl_imgex/img/\346\227\240\346\225\210_\344\277\235\346\214\201\346\216\245\345\233\236.bmp" and /dev/null differ
diff --git "a/tools/agentbar/ccl_imgex/img/\346\227\240\346\225\210_\345\221\274\345\207\272.bmp" "b/tools/agentbar/ccl_imgex/img/\346\227\240\346\225\210_\345\221\274\345\207\272.bmp"
deleted file mode 100644
index e3fc3f3..0000000
Binary files "a/tools/agentbar/ccl_imgex/img/\346\227\240\346\225\210_\345\221\274\345\207\272.bmp" and /dev/null differ
diff --git "a/tools/agentbar/ccl_imgex/img/\346\227\240\346\225\210_\345\221\274\345\207\272\345\260\261\347\273\252.bmp" "b/tools/agentbar/ccl_imgex/img/\346\227\240\346\225\210_\345\221\274\345\207\272\345\260\261\347\273\252.bmp"
deleted file mode 100644
index 2255c01..0000000
Binary files "a/tools/agentbar/ccl_imgex/img/\346\227\240\346\225\210_\345\221\274\345\207\272\345\260\261\347\273\252.bmp" and /dev/null differ
diff --git "a/tools/agentbar/ccl_imgex/img/\346\227\240\346\225\210_\345\222\250\350\257\242.bmp" "b/tools/agentbar/ccl_imgex/img/\346\227\240\346\225\210_\345\222\250\350\257\242.bmp"
deleted file mode 100644
index 511203a..0000000
Binary files "a/tools/agentbar/ccl_imgex/img/\346\227\240\346\225\210_\345\222\250\350\257\242.bmp" and /dev/null differ
diff --git "a/tools/agentbar/ccl_imgex/img/\346\227\240\346\225\210_\345\222\250\350\257\242\344\274\232\350\256\256.bmp" "b/tools/agentbar/ccl_imgex/img/\346\227\240\346\225\210_\345\222\250\350\257\242\344\274\232\350\256\256.bmp"
deleted file mode 100644
index 00a9538..0000000
Binary files "a/tools/agentbar/ccl_imgex/img/\346\227\240\346\225\210_\345\222\250\350\257\242\344\274\232\350\256\256.bmp" and /dev/null differ
diff --git "a/tools/agentbar/ccl_imgex/img/\346\227\240\346\225\210_\345\222\250\350\257\242\346\216\245\345\233\236.bmp" "b/tools/agentbar/ccl_imgex/img/\346\227\240\346\225\210_\345\222\250\350\257\242\346\216\245\345\233\236.bmp"
deleted file mode 100644
index 59147da..0000000
Binary files "a/tools/agentbar/ccl_imgex/img/\346\227\240\346\225\210_\345\222\250\350\257\242\346\216\245\345\233\236.bmp" and /dev/null differ
diff --git "a/tools/agentbar/ccl_imgex/img/\346\227\240\346\225\210_\345\222\250\350\257\242\350\275\254\347\247\273.bmp" "b/tools/agentbar/ccl_imgex/img/\346\227\240\346\225\210_\345\222\250\350\257\242\350\275\254\347\247\273.bmp"
deleted file mode 100644
index 6625f83..0000000
Binary files "a/tools/agentbar/ccl_imgex/img/\346\227\240\346\225\210_\345\222\250\350\257\242\350\275\254\347\247\273.bmp" and /dev/null differ
diff --git "a/tools/agentbar/ccl_imgex/img/\346\227\240\346\225\210_\346\212\200\350\203\275\345\210\207\346\215\242.bmp" "b/tools/agentbar/ccl_imgex/img/\346\227\240\346\225\210_\346\212\200\350\203\275\345\210\207\346\215\242.bmp"
deleted file mode 100644
index 36cf288..0000000
Binary files "a/tools/agentbar/ccl_imgex/img/\346\227\240\346\225\210_\346\212\200\350\203\275\345\210\207\346\215\242.bmp" and /dev/null differ
diff --git "a/tools/agentbar/ccl_imgex/img/\346\227\240\346\225\210_\346\213\250\346\211\223\345\210\206\346\234\272.bmp" "b/tools/agentbar/ccl_imgex/img/\346\227\240\346\225\210_\346\213\250\346\211\223\345\210\206\346\234\272.bmp"
deleted file mode 100644
index 7ef61a2..0000000
Binary files "a/tools/agentbar/ccl_imgex/img/\346\227\240\346\225\210_\346\213\250\346\211\223\345\210\206\346\234\272.bmp" and /dev/null differ
diff --git "a/tools/agentbar/ccl_imgex/img/\346\227\240\346\225\210_\346\214\202\346\226\255.bmp" "b/tools/agentbar/ccl_imgex/img/\346\227\240\346\225\210_\346\214\202\346\226\255.bmp"
deleted file mode 100644
index 3510090..0000000
Binary files "a/tools/agentbar/ccl_imgex/img/\346\227\240\346\225\210_\346\214\202\346\226\255.bmp" and /dev/null differ
diff --git "a/tools/agentbar/ccl_imgex/img/\346\227\240\346\225\210_\346\216\245\345\220\254.bmp" "b/tools/agentbar/ccl_imgex/img/\346\227\240\346\225\210_\346\216\245\345\220\254.bmp"
deleted file mode 100644
index efe243d..0000000
Binary files "a/tools/agentbar/ccl_imgex/img/\346\227\240\346\225\210_\346\216\245\345\220\254.bmp" and /dev/null differ
diff --git "a/tools/agentbar/ccl_imgex/img/\346\227\240\346\225\210_\346\216\245\345\220\254\345\260\261\347\273\252.bmp" "b/tools/agentbar/ccl_imgex/img/\346\227\240\346\225\210_\346\216\245\345\220\254\345\260\261\347\273\252.bmp"
deleted file mode 100644
index cf305cf..0000000
Binary files "a/tools/agentbar/ccl_imgex/img/\346\227\240\346\225\210_\346\216\245\345\220\254\345\260\261\347\273\252.bmp" and /dev/null differ
diff --git "a/tools/agentbar/ccl_imgex/img/\346\227\240\346\225\210_\347\255\276\345\205\245.bmp" "b/tools/agentbar/ccl_imgex/img/\346\227\240\346\225\210_\347\255\276\345\205\245.bmp"
deleted file mode 100644
index 9359788..0000000
Binary files "a/tools/agentbar/ccl_imgex/img/\346\227\240\346\225\210_\347\255\276\345\205\245.bmp" and /dev/null differ
diff --git "a/tools/agentbar/ccl_imgex/img/\346\227\240\346\225\210_\347\255\276\345\207\272.bmp" "b/tools/agentbar/ccl_imgex/img/\346\227\240\346\225\210_\347\255\276\345\207\272.bmp"
deleted file mode 100644
index 37a0bcc..0000000
Binary files "a/tools/agentbar/ccl_imgex/img/\346\227\240\346\225\210_\347\255\276\345\207\272.bmp" and /dev/null differ
diff --git "a/tools/agentbar/ccl_imgex/img/\346\227\240\346\225\210_\351\200\232\350\257\235\350\275\254\347\247\273.bmp" "b/tools/agentbar/ccl_imgex/img/\346\227\240\346\225\210_\351\200\232\350\257\235\350\275\254\347\247\273.bmp"
deleted file mode 100644
index ee8a7f9..0000000
Binary files "a/tools/agentbar/ccl_imgex/img/\346\227\240\346\225\210_\351\200\232\350\257\235\350\275\254\347\247\273.bmp" and /dev/null differ
diff --git "a/tools/agentbar/ccl_imgex/img/\346\234\211\346\225\210_\344\274\221\346\201\257.bmp" "b/tools/agentbar/ccl_imgex/img/\346\234\211\346\225\210_\344\274\221\346\201\257.bmp"
deleted file mode 100644
index 2e6fbf8..0000000
Binary files "a/tools/agentbar/ccl_imgex/img/\346\234\211\346\225\210_\344\274\221\346\201\257.bmp" and /dev/null differ
diff --git "a/tools/agentbar/ccl_imgex/img/\346\234\211\346\225\210_\344\277\235\346\214\201.bmp" "b/tools/agentbar/ccl_imgex/img/\346\234\211\346\225\210_\344\277\235\346\214\201.bmp"
deleted file mode 100644
index 29b6083..0000000
Binary files "a/tools/agentbar/ccl_imgex/img/\346\234\211\346\225\210_\344\277\235\346\214\201.bmp" and /dev/null differ
diff --git "a/tools/agentbar/ccl_imgex/img/\346\234\211\346\225\210_\344\277\235\346\214\201\346\216\245\345\233\236.bmp" "b/tools/agentbar/ccl_imgex/img/\346\234\211\346\225\210_\344\277\235\346\214\201\346\216\245\345\233\236.bmp"
deleted file mode 100644
index b27aa64..0000000
Binary files "a/tools/agentbar/ccl_imgex/img/\346\234\211\346\225\210_\344\277\235\346\214\201\346\216\245\345\233\236.bmp" and /dev/null differ
diff --git "a/tools/agentbar/ccl_imgex/img/\346\234\211\346\225\210_\345\221\274\345\207\272.bmp" "b/tools/agentbar/ccl_imgex/img/\346\234\211\346\225\210_\345\221\274\345\207\272.bmp"
deleted file mode 100644
index ba231ab..0000000
Binary files "a/tools/agentbar/ccl_imgex/img/\346\234\211\346\225\210_\345\221\274\345\207\272.bmp" and /dev/null differ
diff --git "a/tools/agentbar/ccl_imgex/img/\346\234\211\346\225\210_\345\221\274\345\207\272\345\260\261\347\273\252.bmp" "b/tools/agentbar/ccl_imgex/img/\346\234\211\346\225\210_\345\221\274\345\207\272\345\260\261\347\273\252.bmp"
deleted file mode 100644
index 45f92e2..0000000
Binary files "a/tools/agentbar/ccl_imgex/img/\346\234\211\346\225\210_\345\221\274\345\207\272\345\260\261\347\273\252.bmp" and /dev/null differ
diff --git "a/tools/agentbar/ccl_imgex/img/\346\234\211\346\225\210_\345\222\250\350\257\242.bmp" "b/tools/agentbar/ccl_imgex/img/\346\234\211\346\225\210_\345\222\250\350\257\242.bmp"
deleted file mode 100644
index 0ee0d70..0000000
Binary files "a/tools/agentbar/ccl_imgex/img/\346\234\211\346\225\210_\345\222\250\350\257\242.bmp" and /dev/null differ
diff --git "a/tools/agentbar/ccl_imgex/img/\346\234\211\346\225\210_\345\222\250\350\257\242\344\274\232\350\256\256.bmp" "b/tools/agentbar/ccl_imgex/img/\346\234\211\346\225\210_\345\222\250\350\257\242\344\274\232\350\256\256.bmp"
deleted file mode 100644
index 9512e88..0000000
Binary files "a/tools/agentbar/ccl_imgex/img/\346\234\211\346\225\210_\345\222\250\350\257\242\344\274\232\350\256\256.bmp" and /dev/null differ
diff --git "a/tools/agentbar/ccl_imgex/img/\346\234\211\346\225\210_\345\222\250\350\257\242\346\216\245\345\233\236.bmp" "b/tools/agentbar/ccl_imgex/img/\346\234\211\346\225\210_\345\222\250\350\257\242\346\216\245\345\233\236.bmp"
deleted file mode 100644
index 33e50dd..0000000
Binary files "a/tools/agentbar/ccl_imgex/img/\346\234\211\346\225\210_\345\222\250\350\257\242\346\216\245\345\233\236.bmp" and /dev/null differ
diff --git "a/tools/agentbar/ccl_imgex/img/\346\234\211\346\225\210_\345\222\250\350\257\242\350\275\254\347\247\273.bmp" "b/tools/agentbar/ccl_imgex/img/\346\234\211\346\225\210_\345\222\250\350\257\242\350\275\254\347\247\273.bmp"
deleted file mode 100644
index 11b31fe..0000000
Binary files "a/tools/agentbar/ccl_imgex/img/\346\234\211\346\225\210_\345\222\250\350\257\242\350\275\254\347\247\273.bmp" and /dev/null differ
diff --git "a/tools/agentbar/ccl_imgex/img/\346\234\211\346\225\210_\346\212\200\350\203\275\345\210\207\346\215\242.bmp" "b/tools/agentbar/ccl_imgex/img/\346\234\211\346\225\210_\346\212\200\350\203\275\345\210\207\346\215\242.bmp"
deleted file mode 100644
index 4e7a1e0..0000000
Binary files "a/tools/agentbar/ccl_imgex/img/\346\234\211\346\225\210_\346\212\200\350\203\275\345\210\207\346\215\242.bmp" and /dev/null differ
diff --git "a/tools/agentbar/ccl_imgex/img/\346\234\211\346\225\210_\346\213\250\346\211\223\345\210\206\346\234\272.bmp" "b/tools/agentbar/ccl_imgex/img/\346\234\211\346\225\210_\346\213\250\346\211\223\345\210\206\346\234\272.bmp"
deleted file mode 100644
index 52d3235..0000000
Binary files "a/tools/agentbar/ccl_imgex/img/\346\234\211\346\225\210_\346\213\250\346\211\223\345\210\206\346\234\272.bmp" and /dev/null differ
diff --git "a/tools/agentbar/ccl_imgex/img/\346\234\211\346\225\210_\346\214\202\346\226\255.bmp" "b/tools/agentbar/ccl_imgex/img/\346\234\211\346\225\210_\346\214\202\346\226\255.bmp"
deleted file mode 100644
index 4ac5439..0000000
Binary files "a/tools/agentbar/ccl_imgex/img/\346\234\211\346\225\210_\346\214\202\346\226\255.bmp" and /dev/null differ
diff --git "a/tools/agentbar/ccl_imgex/img/\346\234\211\346\225\210_\346\216\245\345\220\254.bmp" "b/tools/agentbar/ccl_imgex/img/\346\234\211\346\225\210_\346\216\245\345\220\254.bmp"
deleted file mode 100644
index ab80624..0000000
Binary files "a/tools/agentbar/ccl_imgex/img/\346\234\211\346\225\210_\346\216\245\345\220\254.bmp" and /dev/null differ
diff --git "a/tools/agentbar/ccl_imgex/img/\346\234\211\346\225\210_\346\216\245\345\220\254\345\260\261\347\273\252.bmp" "b/tools/agentbar/ccl_imgex/img/\346\234\211\346\225\210_\346\216\245\345\220\254\345\260\261\347\273\252.bmp"
deleted file mode 100644
index 8955f45..0000000
Binary files "a/tools/agentbar/ccl_imgex/img/\346\234\211\346\225\210_\346\216\245\345\220\254\345\260\261\347\273\252.bmp" and /dev/null differ
diff --git "a/tools/agentbar/ccl_imgex/img/\346\234\211\346\225\210_\347\255\276\345\205\245.bmp" "b/tools/agentbar/ccl_imgex/img/\346\234\211\346\225\210_\347\255\276\345\205\245.bmp"
deleted file mode 100644
index 421a8a5..0000000
Binary files "a/tools/agentbar/ccl_imgex/img/\346\234\211\346\225\210_\347\255\276\345\205\245.bmp" and /dev/null differ
diff --git "a/tools/agentbar/ccl_imgex/img/\346\234\211\346\225\210_\347\255\276\345\207\272.bmp" "b/tools/agentbar/ccl_imgex/img/\346\234\211\346\225\210_\347\255\276\345\207\272.bmp"
deleted file mode 100644
index 5c65d0c..0000000
Binary files "a/tools/agentbar/ccl_imgex/img/\346\234\211\346\225\210_\347\255\276\345\207\272.bmp" and /dev/null differ
diff --git "a/tools/agentbar/ccl_imgex/img/\346\234\211\346\225\210_\351\200\232\350\257\235\350\275\254\347\247\273.bmp" "b/tools/agentbar/ccl_imgex/img/\346\234\211\346\225\210_\351\200\232\350\257\235\350\275\254\347\247\273.bmp"
deleted file mode 100644
index 723fdca..0000000
Binary files "a/tools/agentbar/ccl_imgex/img/\346\234\211\346\225\210_\351\200\232\350\257\235\350\275\254\347\247\273.bmp" and /dev/null differ
diff --git "a/tools/agentbar/ccl_imgex/img/\351\274\240\346\240\207\347\273\217\350\277\207_\344\274\221\346\201\257.bmp" "b/tools/agentbar/ccl_imgex/img/\351\274\240\346\240\207\347\273\217\350\277\207_\344\274\221\346\201\257.bmp"
deleted file mode 100644
index e170ebf..0000000
Binary files "a/tools/agentbar/ccl_imgex/img/\351\274\240\346\240\207\347\273\217\350\277\207_\344\274\221\346\201\257.bmp" and /dev/null differ
diff --git "a/tools/agentbar/ccl_imgex/img/\351\274\240\346\240\207\347\273\217\350\277\207_\344\277\235\346\214\201.bmp" "b/tools/agentbar/ccl_imgex/img/\351\274\240\346\240\207\347\273\217\350\277\207_\344\277\235\346\214\201.bmp"
deleted file mode 100644
index 753a49a..0000000
Binary files "a/tools/agentbar/ccl_imgex/img/\351\274\240\346\240\207\347\273\217\350\277\207_\344\277\235\346\214\201.bmp" and /dev/null differ
diff --git "a/tools/agentbar/ccl_imgex/img/\351\274\240\346\240\207\347\273\217\350\277\207_\344\277\235\346\214\201\346\216\245\345\233\236.bmp" "b/tools/agentbar/ccl_imgex/img/\351\274\240\346\240\207\347\273\217\350\277\207_\344\277\235\346\214\201\346\216\245\345\233\236.bmp"
deleted file mode 100644
index 1301eeb..0000000
Binary files "a/tools/agentbar/ccl_imgex/img/\351\274\240\346\240\207\347\273\217\350\277\207_\344\277\235\346\214\201\346\216\245\345\233\236.bmp" and /dev/null differ
diff --git "a/tools/agentbar/ccl_imgex/img/\351\274\240\346\240\207\347\273\217\350\277\207_\345\221\274\345\207\272.bmp" "b/tools/agentbar/ccl_imgex/img/\351\274\240\346\240\207\347\273\217\350\277\207_\345\221\274\345\207\272.bmp"
deleted file mode 100644
index 503a8a1..0000000
Binary files "a/tools/agentbar/ccl_imgex/img/\351\274\240\346\240\207\347\273\217\350\277\207_\345\221\274\345\207\272.bmp" and /dev/null differ
diff --git "a/tools/agentbar/ccl_imgex/img/\351\274\240\346\240\207\347\273\217\350\277\207_\345\221\274\345\207\272\345\260\261\347\273\252.bmp" "b/tools/agentbar/ccl_imgex/img/\351\274\240\346\240\207\347\273\217\350\277\207_\345\221\274\345\207\272\345\260\261\347\273\252.bmp"
deleted file mode 100644
index 9b19693..0000000
Binary files "a/tools/agentbar/ccl_imgex/img/\351\274\240\346\240\207\347\273\217\350\277\207_\345\221\274\345\207\272\345\260\261\347\273\252.bmp" and /dev/null differ
diff --git "a/tools/agentbar/ccl_imgex/img/\351\274\240\346\240\207\347\273\217\350\277\207_\345\222\250\350\257\242.bmp" "b/tools/agentbar/ccl_imgex/img/\351\274\240\346\240\207\347\273\217\350\277\207_\345\222\250\350\257\242.bmp"
deleted file mode 100644
index 8ae510f..0000000
Binary files "a/tools/agentbar/ccl_imgex/img/\351\274\240\346\240\207\347\273\217\350\277\207_\345\222\250\350\257\242.bmp" and /dev/null differ
diff --git "a/tools/agentbar/ccl_imgex/img/\351\274\240\346\240\207\347\273\217\350\277\207_\345\222\250\350\257\242\344\274\232\350\256\256.bmp" "b/tools/agentbar/ccl_imgex/img/\351\274\240\346\240\207\347\273\217\350\277\207_\345\222\250\350\257\242\344\274\232\350\256\256.bmp"
deleted file mode 100644
index 1a94094..0000000
Binary files "a/tools/agentbar/ccl_imgex/img/\351\274\240\346\240\207\347\273\217\350\277\207_\345\222\250\350\257\242\344\274\232\350\256\256.bmp" and /dev/null differ
diff --git "a/tools/agentbar/ccl_imgex/img/\351\274\240\346\240\207\347\273\217\350\277\207_\345\222\250\350\257\242\346\216\245\345\233\236.bmp" "b/tools/agentbar/ccl_imgex/img/\351\274\240\346\240\207\347\273\217\350\277\207_\345\222\250\350\257\242\346\216\245\345\233\236.bmp"
deleted file mode 100644
index fd2d7f5..0000000
Binary files "a/tools/agentbar/ccl_imgex/img/\351\274\240\346\240\207\347\273\217\350\277\207_\345\222\250\350\257\242\346\216\245\345\233\236.bmp" and /dev/null differ
diff --git "a/tools/agentbar/ccl_imgex/img/\351\274\240\346\240\207\347\273\217\350\277\207_\345\222\250\350\257\242\350\275\254\347\247\273.bmp" "b/tools/agentbar/ccl_imgex/img/\351\274\240\346\240\207\347\273\217\350\277\207_\345\222\250\350\257\242\350\275\254\347\247\273.bmp"
deleted file mode 100644
index f0a58c2..0000000
Binary files "a/tools/agentbar/ccl_imgex/img/\351\274\240\346\240\207\347\273\217\350\277\207_\345\222\250\350\257\242\350\275\254\347\247\273.bmp" and /dev/null differ
diff --git "a/tools/agentbar/ccl_imgex/img/\351\274\240\346\240\207\347\273\217\350\277\207_\346\212\200\350\203\275\345\210\207\346\215\242.bmp" "b/tools/agentbar/ccl_imgex/img/\351\274\240\346\240\207\347\273\217\350\277\207_\346\212\200\350\203\275\345\210\207\346\215\242.bmp"
deleted file mode 100644
index 4dbb2ff..0000000
Binary files "a/tools/agentbar/ccl_imgex/img/\351\274\240\346\240\207\347\273\217\350\277\207_\346\212\200\350\203\275\345\210\207\346\215\242.bmp" and /dev/null differ
diff --git "a/tools/agentbar/ccl_imgex/img/\351\274\240\346\240\207\347\273\217\350\277\207_\346\213\250\346\211\223\345\210\206\346\234\272.bmp" "b/tools/agentbar/ccl_imgex/img/\351\274\240\346\240\207\347\273\217\350\277\207_\346\213\250\346\211\223\345\210\206\346\234\272.bmp"
deleted file mode 100644
index 3d9d4cd..0000000
Binary files "a/tools/agentbar/ccl_imgex/img/\351\274\240\346\240\207\347\273\217\350\277\207_\346\213\250\346\211\223\345\210\206\346\234\272.bmp" and /dev/null differ
diff --git "a/tools/agentbar/ccl_imgex/img/\351\274\240\346\240\207\347\273\217\350\277\207_\346\214\202\346\226\255.bmp" "b/tools/agentbar/ccl_imgex/img/\351\274\240\346\240\207\347\273\217\350\277\207_\346\214\202\346\226\255.bmp"
deleted file mode 100644
index 70e5024..0000000
Binary files "a/tools/agentbar/ccl_imgex/img/\351\274\240\346\240\207\347\273\217\350\277\207_\346\214\202\346\226\255.bmp" and /dev/null differ
diff --git "a/tools/agentbar/ccl_imgex/img/\351\274\240\346\240\207\347\273\217\350\277\207_\346\216\245\345\220\254.bmp" "b/tools/agentbar/ccl_imgex/img/\351\274\240\346\240\207\347\273\217\350\277\207_\346\216\245\345\220\254.bmp"
deleted file mode 100644
index 973270c..0000000
Binary files "a/tools/agentbar/ccl_imgex/img/\351\274\240\346\240\207\347\273\217\350\277\207_\346\216\245\345\220\254.bmp" and /dev/null differ
diff --git "a/tools/agentbar/ccl_imgex/img/\351\274\240\346\240\207\347\273\217\350\277\207_\346\216\245\345\220\254\345\260\261\347\273\252.bmp" "b/tools/agentbar/ccl_imgex/img/\351\274\240\346\240\207\347\273\217\350\277\207_\346\216\245\345\220\254\345\260\261\347\273\252.bmp"
deleted file mode 100644
index 425c7e8..0000000
Binary files "a/tools/agentbar/ccl_imgex/img/\351\274\240\346\240\207\347\273\217\350\277\207_\346\216\245\345\220\254\345\260\261\347\273\252.bmp" and /dev/null differ
diff --git "a/tools/agentbar/ccl_imgex/img/\351\274\240\346\240\207\347\273\217\350\277\207_\347\255\276\345\205\245.bmp" "b/tools/agentbar/ccl_imgex/img/\351\274\240\346\240\207\347\273\217\350\277\207_\347\255\276\345\205\245.bmp"
deleted file mode 100644
index a363cfb..0000000
Binary files "a/tools/agentbar/ccl_imgex/img/\351\274\240\346\240\207\347\273\217\350\277\207_\347\255\276\345\205\245.bmp" and /dev/null differ
diff --git "a/tools/agentbar/ccl_imgex/img/\351\274\240\346\240\207\347\273\217\350\277\207_\347\255\276\345\207\272.bmp" "b/tools/agentbar/ccl_imgex/img/\351\274\240\346\240\207\347\273\217\350\277\207_\347\255\276\345\207\272.bmp"
deleted file mode 100644
index ea62a27..0000000
Binary files "a/tools/agentbar/ccl_imgex/img/\351\274\240\346\240\207\347\273\217\350\277\207_\347\255\276\345\207\272.bmp" and /dev/null differ
diff --git "a/tools/agentbar/ccl_imgex/img/\351\274\240\346\240\207\347\273\217\350\277\207_\351\200\232\350\257\235\350\275\254\347\247\273.bmp" "b/tools/agentbar/ccl_imgex/img/\351\274\240\346\240\207\347\273\217\350\277\207_\351\200\232\350\257\235\350\275\254\347\247\273.bmp"
deleted file mode 100644
index a99e563..0000000
Binary files "a/tools/agentbar/ccl_imgex/img/\351\274\240\346\240\207\347\273\217\350\277\207_\351\200\232\350\257\235\350\275\254\347\247\273.bmp" and /dev/null differ
diff --git a/tools/agentbar/clean.bat b/tools/agentbar/clean.bat
index 67462d1..59d3b9d 100644
--- a/tools/agentbar/clean.bat
+++ b/tools/agentbar/clean.bat
@@ -1,17 +1,14 @@
 
 if exist output rd /q /s output
 if not exist output mkdir output
-set CMD_VC2003="c:/Program Files/Microsoft Visual Studio .NET 2003/Common7/IDE/Devenv"
 
-chmod +x bin/*.exe
+set CMD_VS2010="%VS100COMNTOOLS%/../IDE/Devenv"
 
 rem "build image plugin "
-%CMD_VC2003% "ccl_imgex\ccl_imgex.vcproj" /clean Release /project ccl_imgex
+%CMD_VS2010% "ccl_imgex\ccl_imgex.vcxproj" /clean Release /project ccl_imgex
 
 rem "build main activex "
-%CMD_VC2003% "agentbarsrc\CCAgentBar.vcproj" /clean Release /project CCAgentBar
-%CMD_VC2003% "agentbarsrc\CCAgentBar.vcproj" /clean Debug /project CCAgentBar
+%CMD_VS2010% "agentbarsrc\CCAgentBar.vcxproj" /clean Release /project CCAgentBar
 
 rem "build test project"
-%CMD_VC2003% "agentbartest\CCAgentBarTest.vcproj" /clean Debug /project CCAgentBarTest
-%CMD_VC2003% "agentbartest\CCAgentBarTest.vcproj" /clean Release /project CCAgentBarTest
+%CMD_VS2010% "agentbartest\CCAgentBarTest.vcxproj" /clean Release /project CCAgentBarTest
diff --git a/tools/agentbar/doc/develop_manual.pdf b/tools/agentbar/doc/develop_manual.pdf
index 66be8b8..71deb58 100644
Binary files a/tools/agentbar/doc/develop_manual.pdf and b/tools/agentbar/doc/develop_manual.pdf differ
diff --git a/tools/sipphone/PhoneLib/phonelib.cpp b/tools/sipphone/PhoneLib/phonelib.cpp
index 3883c6b..2eb9a28 100644
--- a/tools/sipphone/PhoneLib/phonelib.cpp
+++ b/tools/sipphone/PhoneLib/phonelib.cpp
@@ -174,7 +174,7 @@ static void default_config(struct app_config *cfg)
 	//	    pj_get_sys_info()->info.ptr);
 
 	pj_ansi_sprintf(tmp, "PJSUA v%s %s", pj_get_version(),
-		"Windows");//baidu
+		"Windows");
 	pj_strdup2_with_null(app_config.pool, &cfg->cfg.user_agent, tmp);
 
 	pjsua_logging_config_default(&cfg->log_cfg);
@@ -2113,7 +2113,6 @@ pj_status_t phonelib_init(int local_sip_port,const char* log_file, int log_level
 		if (status != PJ_SUCCESS)
 			goto on_error;
 	}
-	////////baidu:special
 	status = pjsua_start();
 	if (status != PJ_SUCCESS)  
 		goto on_error;
diff --git a/tools/sipphone/SIPPhoneTest/SIPPhoneDlg.cpp b/tools/sipphone/SIPPhoneTest/SIPPhoneDlg.cpp
index 2d80900..ebc43ec 100644
--- a/tools/sipphone/SIPPhoneTest/SIPPhoneDlg.cpp
+++ b/tools/sipphone/SIPPhoneTest/SIPPhoneDlg.cpp
@@ -258,7 +258,7 @@ BOOL CSIPPhoneDlg::OnInitDialog()
 	char logfile[512];
 
 
-	::GetPrivateProfileString("settings","sipip","10.36.159.60",sipip,256,path);
+	::GetPrivateProfileString("settings","sipip","127.0.0.1",sipip,256,path);
 	::GetPrivateProfileString("settings","account","1105",account,256,path);
 	::GetPrivateProfileString("settings","pass","1234",pass,256,path);
 
