| 两侧同时换到之前的修订记录前一修订版后一修订版 | 前一修订版 |
| zh:常见问题及解答:如何为astercc系统配置多台php服务器 [2016/05/04 13:09] – liuxl | zh:常见问题及解答:如何为astercc系统配置多台php服务器 [2016/11/23 01:38] (当前版本) – liuxl |
|---|
| |
| <note> 注:做分布之前,先确保所有服务器的asterCC的版本必须是一样的,其次 安装相同的模块。 </note> | <note> 注:做分布之前,先确保所有服务器的asterCC的版本必须是一样的,其次 安装相同的模块。 </note> |
| | |
| | <note important>多台集群服务器,请确保除了CTI上的asterccd进程正常启动外其它服务器该进程停止运行,且设置chkconfig关闭asterccd开机自动启动。mysql上crontab -e内设置的astercc定时任务全部用“#”号注释掉。</note> |
| |
| 1.对系统进行分布配置前,首先需要将CTI机器上的数据库备份。 | 1.对系统进行分布配置前,首先需要将CTI机器上的数据库备份。 |
| 同PHP1 | 同PHP1 |
| |
| <note tip><code> | <code> |
| 端口说明:请按实际情况,对/etc/sysconfig/iptables文件中端口进行保留。 | 端口说明:请按实际情况,对/etc/sysconfig/iptables文件中端口进行保留。 |
| 21:FTP默认端口 | 21:FTP默认端口 |
| 9000:php默认端口 | 9000:php默认端口 |
| 10000:20000:Asterisk中RTP要使用的端口 | 10000:20000:Asterisk中RTP要使用的端口 |
| </code></note> | </code> |
| |
| |
| 6.在CTI、PHP1上安装samba服务,执行:yum install samba | 6.在CTI、PHP1上安装samba服务,执行命令: |
| | <code> yum install samba </code> |
| |
| |
| 7.安装完成后,分别创建samba用户及密码,如:sbu/123456, | 7.安装完成后,分别创建samba用户及密码,如:sbu/123456, |
| 先执行: | 先执行: |
| useradd sbu | <code> useradd sbu </code> |
| 再执行,并在提示时输入123456: | 再执行,并在提示时输入123456: |
| smbpasswd -a sbu | <code> smbpasswd -a sbu </code> |
| |
| 8.修改samba配置文件 /etc/samba/smb.conf,在smb.conf 文件末尾添加如下内容: | 8.修改samba配置文件 /etc/samba/smb.conf,在smb.conf 文件末尾添加如下内容: |
| |
| CTI机器上: | CTI机器上: |
| | <code> |
| [ccastspool] | [ccastspool] |
| path = /var/spool/asterisk | path = /var/spool/asterisk |
| directory mask = 777 | directory mask = 777 |
| force user = asterisk | force user = asterisk |
| | </code> |
| |
| PHP1机器上: | PHP1机器上: |
| | <code> |
| [ccdata] | [ccdata] |
| path = /var/www/html/asterCC/data | path = /var/www/html/asterCC/data |
| directory mask = 777 | directory mask = 777 |
| force user = asterisk | force user = asterisk |
| | </code> |
| |
| |
| 9.配置完成后,重启Samba 服务配置生效,执行命令:service smb restart | 9.配置完成后,重启Samba 服务配置生效,执行命令: |
| | <code> service smb restart </code> |
| |
| 10.将samba的文件,相互挂载。(注:挂载之前,请先将本机要mount过来的代码进行备份。比如:在CTI机器上,需要mount PHP1机器上的ccdata 到CTI机器的 /var/www/html/asterCC/data 目录,那么需要在CTI机器上,将/var/www/html/asterCC/data 进行备份,备份过程此处不做详细讲述) | 10.将samba的文件,相互挂载。(注:挂载之前,请先将本机要mount过来的代码进行备份。比如:在CTI机器上,需要mount PHP1机器上的ccdata 到CTI机器的 /var/www/html/asterCC/data 目录,那么需要在CTI机器上,将/var/www/html/asterCC/data 进行备份,备份过程此处不做详细讲述) |
| |
| CTI机器上,依次执行命令,进行挂载: | CTI机器上,依次执行命令,进行挂载: |
| mount -t cifs -o username=sbu,password=123456 //192.168.1.61/ccdate /var/www/html/asterCC/data | <code> |
| | mount -t cifs -o username=sbu,password=123456 //192.168.1.61/ccdata /var/www/html/asterCC/data |
| mount -t cifs -o username=sbu,password=123456 //192.168.1.61/ccstatistics /var/www/html/asterCC/statistics | mount -t cifs -o username=sbu,password=123456 //192.168.1.61/ccstatistics /var/www/html/asterCC/statistics |
| | </code> |
| |
| PHP1机器上,依次执行命令,进行挂载: | PHP1机器上,依次执行命令,进行挂载: |
| | <code> |
| mount -t cifs -o username=sbu,password=123456 //192.168.1.62/ccastspool /var/spool/asterisk | mount -t cifs -o username=sbu,password=123456 //192.168.1.62/ccastspool /var/spool/asterisk |
| mount -t cifs -o username=sbu,password=123456 //192.168.1.62/ccscripts /opt/asterisk/scripts/astercc | mount -t cifs -o username=sbu,password=123456 //192.168.1.62/ccscripts /opt/asterisk/scripts/astercc |
| mount -t cifs -o username=sbu,password=123456 //192.168.1.62/ccastlib /var/lib/asterisk | mount -t cifs -o username=sbu,password=123456 //192.168.1.62/ccastlib /var/lib/asterisk |
| mount -t cifs -o username=sbu,password=123456 //192.168.1.62/ccastetc /etc/asterisk | mount -t cifs -o username=sbu,password=123456 //192.168.1.62/ccastetc /etc/asterisk |
| | </code> |
| |
| PHP2机器上,依次执行命令,进行挂载: | PHP2机器上,依次执行命令,进行挂载: |
| | <code> |
| mount -t cifs -o username=sbu,password=123456 //192.168.1.61/ccstatistics /var/www/html/asterCC/statistics | mount -t cifs -o username=sbu,password=123456 //192.168.1.61/ccstatistics /var/www/html/asterCC/statistics |
| mount -t cifs -o username=sbu,password=123456 //192.168.1.61/ccdata /var/www/html/asterCC/data | mount -t cifs -o username=sbu,password=123456 //192.168.1.61/ccdata /var/www/html/asterCC/data |
| mount -t cifs -o username=sbu,password=123456 //192.168.1.62/ccastetc /etc/asterisk | mount -t cifs -o username=sbu,password=123456 //192.168.1.62/ccastetc /etc/asterisk |
| mount -t cifs -o username=sbu,password=123456 //192.168.1.62/ccscripts /opt/asterisk/scripts/astercc | mount -t cifs -o username=sbu,password=123456 //192.168.1.62/ccscripts /opt/asterisk/scripts/astercc |
| | </code> |
| | |
| |
| 11.修改 /etc/php-fpm.d/www.conf 配置文件内容 | 11.修改 /etc/php-fpm.d/www.conf 配置文件内容 |
| CTI机器上: | CTI机器上: |
| | <code> |
| [www] | [www] |
| listen=127.0.0.1 | listen=127.0.0.1:9000 |
| listen.allowed_clients=127.0.0.1 | listen.allowed_clients=127.0.0.1 |
| | </code> |
| |
| | {{:zh:常见问题及解答:selection_052.png?750|}} |
| |
| PHP1机器上: | PHP1机器上: |
| | <code> |
| [www] | [www] |
| listen=192.168.1.61:9000 | listen=192.168.1.61:9000 |
| listen.allowed_clients=127.0.0.1,192.168.1.61,192.168.1.62 | listen.allowed_clients=127.0.0.1,192.168.1.61,192.168.1.62 |
| | </code> |
| |
| PHP2机器上: | PHP2机器上: |
| | <code> |
| [www] | [www] |
| listen=192.168.1.70:9000 | listen=192.168.1.70:9000 |
| listen.allowed_clients=127.0.0.1,192.168.1.70,192.168.1.62 | listen.allowed_clients=127.0.0.1,192.168.1.70,192.168.1.62 |
| | </code> |
| |
| |
| 12.修改/usr/local/nginx/conf/nginx.conf 配置文件 | 12.修改/usr/local/nginx/conf/nginx.conf 配置文件 |
| CTI机器上: | CTI机器上: |
| 12-1:在http中添加以下内容: | |
| http{ | |
| |
| | 12-1:在http中添加以下内容: |
| | <code> |
| upstream myphp { | upstream myphp { |
| #ip_hash; PHP负载均衡 | #ip_hash; PHP负载均衡 |
| server 192.168.1.70:9000 weight=2; | server 192.168.1.70:9000 weight=2; |
| } | } |
| | </code> |
| |
| } | {{:zh:常见问题及解答:selection_050.png?750|}} |
| |
| 注:http中server内的listen xxxx default,是指的页面访问的端口号。 | <note> 注:http中server内的listen xxxx default,是指的页面访问的端口号。 </note> |
| |
| 12-2:在location中前面位置添加以下内容,并将默认配置的fastcgi_pass 127.0.0.1:9000; 用#号注释掉: | 12-2:在location中前面位置添加以下内容,并将默认配置的fastcgi_pass 127.0.0.1:9000; 用#号注释掉: |
| location ~ .*\.(php|php5)?$ | <code> |
| { | |
| #这个表示login和reload时,使用本机的PHP服务,因此CTI的php-fpm服务是开启的,而且开机自启动 | #这个表示login和reload时,使用本机的PHP服务,因此CTI的php-fpm服务是开启的,而且开机自启动 |
| set $target myphp; | set $target myphp; |
| } | } |
| fastcgi_pass $target; | fastcgi_pass $target; |
| |
| #fastcgi_pass 127.0.0.1:9000; | #fastcgi_pass 127.0.0.1:9000; |
| } | </code> |
| | |
| | {{:zh:常见问题及解答:selection_051.png?750|}} |
| | |
| | <note> 注:PHP1与PHP2机器上,这些配置都不用管,因为PHP1和PHP2上不使用nginx服务,默认fastcgi_pass 均为 127.0.0.1:9000; |
| |
| 注:PHP1与PHP2机器上,这些配置都不用管,因为PHP1和PHP2上不使用nginx服务,默认fastcgi_pass 均为 127.0.0.1:9000; 。 | |
| 如果只使用1台服务器(如:PHP1)运行PHP服务,而不使用PHP负载均衡,那么,CTI中不需要添加任何的内容。并且,location中第一句set $target myphp; 内容也需要修改成PHP1的地址加端口,即:set $target 192.168.1.61:9000; | 如果只使用1台服务器(如:PHP1)运行PHP服务,而不使用PHP负载均衡,那么,CTI中不需要添加任何的内容。并且,location中第一句set $target myphp; 内容也需要修改成PHP1的地址加端口,即:set $target 192.168.1.61:9000; |
| | </note> |
| |
| |
| |
| CTI机器上: | CTI机器上: |
| 13-1:先拷贝到mount的目录:cp -Rp /var/www/html/asterCC/app/views/agents/agentsxindesk.ctp /var/www/html/asterCC/statistics/agentsxindesk.ctp | |
| 再:ln -s /var/www/html/asterCC/statistics/agentsxindesk.ctp /var/www/html/asterCC/app/views/agents/agentsxindesk.ctp | |
| |
| 13-2:拷贝:cp -Rp /var/www/html/asterCC/app/config/database.php /var/www/html/asterCC/statistics/database.php | 13-1:先拷贝到mount的目录: |
| 再:ln -s /var/www/html/asterCC/statistics/database.php /var/www/html/asterCC/app/config/database.php | <code> cp -Rp /var/www/html/asterCC/app/views/agents/agentsxindesk.ctp /var/www/html/asterCC/statistics/agentsxindesk.ctp </code> |
| | 再执行: |
| | <code> ln -s /var/www/html/asterCC/statistics/agentsxindesk.ctp /var/www/html/asterCC/app/views/agents/agentsxindesk.ctp </code> |
| | |
| | 13-2:拷贝: |
| | <code> cp -Rp /var/www/html/asterCC/app/config/database.php /var/www/html/asterCC/statistics/database.php </code> |
| | 再执行: |
| | <code> ln -s /var/www/html/asterCC/statistics/database.php /var/www/html/asterCC/app/config/database.php </code> |
| |
| 13-3:/opt/asterisk/scripts/astercc/identity.astercc 文件,不用做任何操作,但要保证该文件,是最开始CTI机器上mount前备份过的文件。 | 13-3:/opt/asterisk/scripts/astercc/identity.astercc 文件,不用做任何操作,但要保证该文件,是最开始CTI机器上mount前备份过的文件。 |
| 13-4:/opt/asterisk/scripts/astercc/license.astercc文件, 不用做任何操作,但要保证该文件,是最开始CTI机器上mount前备份过的文件。 | 13-4:/opt/asterisk/scripts/astercc/license.astercc文件, 不用做任何操作,但要保证该文件,是最开始CTI机器上mount前备份过的文件。 |
| |
| 13-5:拷贝:cp -Rp /usr/local/conf/hcdesk.conf /opt/asterisk/scripts/astercc/hcdesk.conf | 13-5:拷贝: |
| 再:ln -s /opt/asterisk/scripts/astercc/hcdesk.conf /usr/local/conf/hcdesk.conf | <code> cp -Rp /usr/local/conf/hcdesk.conf /opt/asterisk/scripts/astercc/hcdesk.conf </code> |
| | 再执行: |
| | <code> ln -s /opt/asterisk/scripts/astercc/hcdesk.conf /usr/local/conf/hcdesk.conf </code> |
| |
| |
| 13-6: 拷贝:cp -Rp /etc/astercc.conf /opt/asterisk/scripts/astercc/astercc.conf | 13-6:拷贝: |
| 再:ln -s /opt/asterisk/scripts/astercc/astercc.conf /etc/astercc.conf | <code> cp -Rp /etc/astercc.conf /opt/asterisk/scripts/astercc/astercc.conf </code> |
| | 再执行: |
| | <code> ln -s /opt/asterisk/scripts/astercc/astercc.conf /etc/astercc.conf </code> |
| |
| |
| PHP1机器上: | PHP1机器上: |
| | |
| 13-7:将本机的agentsxindesk.ctp文件备份成agentsxindesk.ctp.bak | 13-7:将本机的agentsxindesk.ctp文件备份成agentsxindesk.ctp.bak |
| 备份:mv /var/www/html/asterCC/app/views/agents/agentsxindesk.ctp /var/www/html/asterCC/app/views/agents/agentsxindesk.ctp.bak。 | 备份: |
| 再:ln -s /var/www/html/asterCC/statistics/agentsxindesk.ctp /var/www/html/asterCC/app/views/agents/agentsxindesk.ctp | <code> mv /var/www/html/asterCC/app/views/agents/agentsxindesk.ctp /var/www/html/asterCC/app/views/agents/agentsxindesk.ctp.bak </code> |
| | 再执行: |
| | <code> ln -s /var/www/html/asterCC/statistics/agentsxindesk.ctp /var/www/html/asterCC/app/views/agents/agentsxindesk.ctp </code> |
| |
| 13-8:备份:mv /var/www/html/asterCC/app/config/database.php /var/www/html/asterCC/app/config/database.php.bak。 | 13-8:备份: |
| 再:ln -s /var/www/html/asterCC/statistics/database.php /var/www/html/asterCC/app/config/database.php | <code> mv /var/www/html/asterCC/app/config/database.php /var/www/html/asterCC/app/config/database.php.bak </code> |
| | 再执行: |
| | <code> ln -s /var/www/html/asterCC/statistics/database.php /var/www/html/asterCC/app/config/database.php </code> |
| |
| |
| 13-9:将本机的hcdesk.conf文件备份成hcdesk.conf.bak | 13-9:将本机的hcdesk.conf文件备份成hcdesk.conf.bak |
| 备份: mv /usr/local/conf/hcdesk.conf /usr/local/conf/hcdesk.conf.bak | 备份: |
| 再: ln -s /opt/asterisk/scripts/astercc/hcdesk.conf /usr/local/conf/hcdesk.conf | <code> mv /usr/local/conf/hcdesk.conf /usr/local/conf/hcdesk.conf.bak </code> |
| | 再执行: |
| | <code> ln -s /opt/asterisk/scripts/astercc/hcdesk.conf /usr/local/conf/hcdesk.conf </code> |
| |
| 13-10:将本机的astercc.conf文件备份成astercc.conf.bak | 13-10:将本机的astercc.conf文件备份成astercc.conf.bak |
| 备份: mv /etc/astercc.conf /etc/astercc.conf.bak | 备份: |
| 再: ln -s /opt/asterisk/scripts/astercc/astercc.conf /etc/astercc.conf | <code> mv /etc/astercc.conf /etc/astercc.conf.bak </code> |
| | 再执行: |
| | <code> ln -s /opt/asterisk/scripts/astercc/astercc.conf /etc/astercc.conf </code> |
| |
| |
| PHP2机器上: | PHP2机器上: |
| | |
| 13-11:将本机的agentsxindesk.ctp文件备份成agentsxindesk.ctp.bak | 13-11:将本机的agentsxindesk.ctp文件备份成agentsxindesk.ctp.bak |
| 备份:mv /var/www/html/asterCC/app/views/agents/agentsxindesk.ctp /var/www/html/asterCC/app/views/agents/agentsxindesk.ctp.bak。 | 备份: |
| 再:ln -s /var/www/html/asterCC/statistics/agentsxindesk.ctp /var/www/html/asterCC/app/views/agents/agentsxindesk.ctp | <code> mv /var/www/html/asterCC/app/views/agents/agentsxindesk.ctp /var/www/html/asterCC/app/views/agents/agentsxindesk.ctp.bak </code> |
| | 再执行: |
| | <code> ln -s /var/www/html/asterCC/statistics/agentsxindesk.ctp /var/www/html/asterCC/app/views/agents/agentsxindesk.ctp </code> |
| |
| 13-12:备份:mv /var/www/html/asterCC/app/config/database.php /var/www/html/asterCC/app/config/database.php.bak。 | 13-12:备份: |
| 再:ln -s /var/www/html/asterCC/statistics/database.php /var/www/html/asterCC/app/config/database.php | <code> mv /var/www/html/asterCC/app/config/database.php /var/www/html/asterCC/app/config/database.php.bak </code> |
| | 再执行: |
| | <code> ln -s /var/www/html/asterCC/statistics/database.php /var/www/html/asterCC/app/config/database.php </code> |
| |
| 13-13:将本机的hcdesk.conf文件备份成hcdesk.conf.bak | 13-13:将本机的hcdesk.conf文件备份成hcdesk.conf.bak |
| 备份: mv /usr/local/conf/hcdesk.conf /usr/local/conf/hcdesk.conf.bak | 备份: |
| 再: ln -s /opt/asterisk/scripts/astercc/hcdesk.conf /usr/local/conf/hcdesk.conf | <code> mv /usr/local/conf/hcdesk.conf /usr/local/conf/hcdesk.conf.bak </code> |
| | 再执行: |
| | <code> ln -s /opt/asterisk/scripts/astercc/hcdesk.conf /usr/local/conf/hcdesk.conf </code> |
| |
| 13-14:将本机的astercc.conf文件备份成astercc.conf.bak | 13-14:将本机的astercc.conf文件备份成astercc.conf.bak |
| 备份: mv /etc/astercc.conf /etc/astercc.conf.bak | 备份: |
| 再: ln -s /opt/asterisk/scripts/astercc/astercc.conf /etc/astercc.conf | <code> mv /etc/astercc.conf /etc/astercc.conf.bak </code> |
| | 再执行: |
| | <code> ln -s /opt/asterisk/scripts/astercc/astercc.conf /etc/astercc.conf </code> |
| |
| |
| 14.修改一些文件的内容 | 14.修改一些文件的内容 |
| | |
| CTI机器上: | CTI机器上: |
| /etc/asterisk/manager.conf 文件中,在文件最后面,添加所在网段的信息如下,然后保存退出,执行命令:asterisk -rx “manager reload” | |
| | /etc/asterisk/manager.conf 文件中,在文件最后面,添加所在网段的信息如下,然后保存退出,执行命令: |
| | <code> asterisk -rx "manager reload" </code> |
| | |
| | <code> |
| [astercc] | [astercc] |
| secret = asterccsecret | secret = asterccsecret |
| read = system,call,agent | read = system,call,agent |
| write = system,call,agent,user,config,command,reporting,originate | write = system,call,agent,user,config,command,reporting,originate |
| | </code> |
| |
| /etc/astercc.conf 文件中,[asterisk]标签下,server填写CTI的IP | /etc/astercc.conf 文件中,[asterisk]标签下,server填写CTI的IP |
| | <code> |
| [asterisk] | [asterisk] |
| server = 192.168.1.62 | server = 192.168.1.62 |
| username = astercc | username = astercc |
| secret = asterccsecret | secret = asterccsecret |
| | </code> |
| |
| |
| |
| 16.crontab文件内容,执行:crontab -e 进行对其内容的编辑。crontab 中监测启动的程序,互补即可,不要有重复运行的。 | 16.crontab文件内容,执行:crontab -e 进行对其内容的编辑。crontab 中监测启动的程序,互补即可,不要有重复运行的。 |
| | |
| CTI: | CTI: |
| | |
| | <code> |
| 30 12 * * * /opt/asterisk/scripts/astercc/processmonitors -d | 30 12 * * * /opt/asterisk/scripts/astercc/processmonitors -d |
| 30 20 * * * /opt/asterisk/scripts/astercc/processmonitors -d | 30 20 * * * /opt/asterisk/scripts/astercc/processmonitors -d |
| 10 0 * * * /opt/asterisk/scripts/astercc/agent_report -d | 10 0 * * * /opt/asterisk/scripts/astercc/agent_report -d |
| 20 0 * * * /opt/asterisk/scripts/astercc/agentgroup_report -d | 20 0 * * * /opt/asterisk/scripts/astercc/agentgroup_report -d |
| | </code> |
| |
| MySQL: | MySQL: |
| |
| PHP1 和 PHP2,两台机器需要根据配置和负载来划分执行哪些脚本,两台机器不要都执行,做到互补以下脚本即可: | PHP1 和 PHP2,两台机器需要根据配置和负载来划分执行哪些脚本,两台机器不要都执行,做到互补以下脚本即可: |
| | <code> |
| * * * * * /var/www/html/asterCC/cake/console/cake -app /var/www/html/asterCC/app checkonline >/dev/null 2>&1 | * * * * * /var/www/html/asterCC/cake/console/cake -app /var/www/html/asterCC/app checkonline >/dev/null 2>&1 |
| * 2 * * * /opt/asterisk/scripts/astercc/astcc_backup.sh >/dev/null 2>&1 | * 2 * * * /opt/asterisk/scripts/astercc/astcc_backup.sh >/dev/null 2>&1 |
| * * * * * /var/www/html/asterCC/cake/console/cake -app /var/www/html/asterCC/app asterccfilter >/dev/null 2>&1 | * * * * * /var/www/html/asterCC/cake/console/cake -app /var/www/html/asterCC/app asterccfilter >/dev/null 2>&1 |
| * * * * * /opt/asterisk/scripts/astercc/astcc_historydata -d | * * * * * /opt/asterisk/scripts/astercc/astcc_historydata -d |
| | </code> |
| |
| |
| 17.mount 挂载的检测,需要添加到crontab中。 | 17.mount 挂载的检测,需要添加到crontab中。 |
| CTI: | CTI: |
| | <code> |
| */5 * * * * dfccdata=`df |grep ccdata`; [ "X${dfccdata}" = "X" ] && `mount -t cifs -o username=sbu,password=123456 //192.168.1.61/ccdata /var/www/html/asterCC/data`; | */5 * * * * dfccdata=`df |grep ccdata`; [ "X${dfccdata}" = "X" ] && `mount -t cifs -o username=sbu,password=123456 //192.168.1.61/ccdata /var/www/html/asterCC/data`; |
| */5 * * * * dfccstatistics=`df |grep ccstatistics`; [ "X${dfccstatistics}" = "X" ] && `mount -t cifs -o username=sbu,password=123456 //192.168.1.61/ccstatistics /var/www/html/asterCC/statistics`; | */5 * * * * dfccstatistics=`df |grep ccstatistics`; [ "X${dfccstatistics}" = "X" ] && `mount -t cifs -o username=sbu,password=123456 //192.168.1.61/ccstatistics /var/www/html/asterCC/statistics`; |
| | </code> |
| |
| |
| PHP1: | PHP1: |
| | <code> |
| */5 * * * * dfccastspool=`df |grep ccastspool`; [ "X${dfccastspool}" = "X" ] && `mount -t cifs -o username=sbu,password=123456 //192.168.1.62/ccastspool /var/spool/asterisk/`; | */5 * * * * dfccastspool=`df |grep ccastspool`; [ "X${dfccastspool}" = "X" ] && `mount -t cifs -o username=sbu,password=123456 //192.168.1.62/ccastspool /var/spool/asterisk/`; |
| */5 * * * * dfastetc=`df |grep etc/asterisk`; [ "X${dfastetc}" = "X" ] && `mount -t cifs -o username=sbu,password=123456 //192.168.1.62/ccastetc /etc/asterisk/`; | */5 * * * * dfastetc=`df |grep etc/asterisk`; [ "X${dfastetc}" = "X" ] && `mount -t cifs -o username=sbu,password=123456 //192.168.1.62/ccastetc /etc/asterisk/`; |
| */5 * * * * dfccastlib=`df |grep ccastlib`; [ "X${dfccastlib}" = "X" ] && `mount -t cifs -o username=sbu,password=123456 //192.168.1.62/ccastlib /var/lib/asterisk/`; | */5 * * * * dfccastlib=`df |grep ccastlib`; [ "X${dfccastlib}" = "X" ] && `mount -t cifs -o username=sbu,password=123456 //192.168.1.62/ccastlib /var/lib/asterisk/`; |
| */5 * * * * dfccscripts=`df |grep ccscripts`; [ "X${dfccscripts}" = "X" ] && `mount -t cifs -o username=sbu,password=123456 //192.168.1.62/ccscripts /opt/asterisk/scripts/astercc/`; | */5 * * * * dfccscripts=`df |grep ccscripts`; [ "X${dfccscripts}" = "X" ] && `mount -t cifs -o username=sbu,password=123456 //192.168.1.62/ccscripts /opt/asterisk/scripts/astercc/`; |
| | </code> |
| |
| |
| PHP2: | PHP2: |
| | <code> |
| */5 * * * * dfccdata=`df |grep ccdata`; [ "X${dfccdata}" = "X" ] && `mount -t cifs -o username=sbu,password=123456 //192.168.1.61/ccdata /var/www/html/asterCC/data`; | */5 * * * * dfccdata=`df |grep ccdata`; [ "X${dfccdata}" = "X" ] && `mount -t cifs -o username=sbu,password=123456 //192.168.1.61/ccdata /var/www/html/asterCC/data`; |
| */5 * * * * dfccstatistics=`df |grep ccstatistics`; [ "X${dfccstatistics}" = "X" ] && `mount -t cifs -o username=sbu,password=123456 //192.168.1.61/ccstatistics /var/www/html/asterCC/statistics`; | */5 * * * * dfccstatistics=`df |grep ccstatistics`; [ "X${dfccstatistics}" = "X" ] && `mount -t cifs -o username=sbu,password=123456 //192.168.1.61/ccstatistics /var/www/html/asterCC/statistics`; |
| */5 * * * * dfccastlib=`df |grep ccastlib`; [ "X${dfccastlib}" = "X" ] && `mount -t cifs -o username=sbu,password=123456 //192.168.1.62/ccastlib /var/lib/asterisk/`; | */5 * * * * dfccastlib=`df |grep ccastlib`; [ "X${dfccastlib}" = "X" ] && `mount -t cifs -o username=sbu,password=123456 //192.168.1.62/ccastlib /var/lib/asterisk/`; |
| */5 * * * * dfccscripts=`df |grep ccscripts`; [ "X${dfccscripts}" = "X" ] && `mount -t cifs -o username=sbu,password=123456 //192.168.1.62/ccscripts /opt/asterisk/scripts/astercc/`; | */5 * * * * dfccscripts=`df |grep ccscripts`; [ "X${dfccscripts}" = "X" ] && `mount -t cifs -o username=sbu,password=123456 //192.168.1.62/ccscripts /opt/asterisk/scripts/astercc/`; |
| | </code> |
| |
| |
| 18.最后, | 18.最后, |
| CTI机器上执行:/opt/asterisk/scripts/astercc/asterccc --RNI | |
| PHP1机器上执行:/opt/asterisk/scripts/astercc/asterccc --ADI | 在CTI机器上执行: |
| PHP2机器上执行:/opt/asterisk/scripts/astercc/asterccc --ADI | <code> /opt/asterisk/scripts/astercc/asterccc --RNI </code> |
| | 在PHP1机器上执行: |
| | <code> /opt/asterisk/scripts/astercc/asterccc --ADI </code> |
| | 在PHP2机器上执行: |
| | <code> /opt/asterisk/scripts/astercc/asterccc --ADI </code> |
| |
| 正常在CTI上会提示:001,在PHP1上会提示002,在PHP2上会提示003,再重新做授权。在CTI上重启asterccd服务,看是否有报错。 | 正常在CTI上会提示:001,在PHP1上会提示002,在PHP2上会提示003,再重新做授权。在CTI上重启asterccd服务,看是否有报错。 |
| |
| |
| |
| |
| |
| |