astercc支持的短信(SMS)供应商列表

短信服务器的坐席工作界面介绍

为系统或团队添加短信服务器(核心:短信供应商),astercc系统群发短信(注:坐席一次只能发一条信息)时,将使用自带的一个短信供应商(此处以”上海希奥信息科技有限公司“为例,简称:希奥)群发短信。

用于坐席页面登录→[消息]→[短信]发送模块。

通过菜单列表[群发信息管理]→[短信服务器]进入如下界面

配置短信服务器

点击[添加]按钮,打开添加短信服务器界面

添加完成后的短信服务器编辑页面

短信服务器界面各字段含义如下:

团队:如果不选择团队,代表此短信服务器用于系统级别的短信发送;指定团队,对应的团队发短信可使用此服务器

服务器类型:即:短信供应商。只要你的用户名、密码正确,并且对应用户余额充足,所发短信均可送达目标。设置此类短信服务器需要填写用户名和密码,坐席系统外发短信时,会向短信供应商提交审核,审核通过后,即可发送短信。可以这样理解,有人用你的手机(手机运营商是希奥 而不是中国移动、联通、电信)然后发了一条短信

服务器名称:团队下的服务器名称,因为有可以有多个服务器,以免混淆,所以设置此项

用户名:即在希奥开户时的用户名

密码:对应的密码

状态:可用

是否默认:在一个团队中,可以用多家SMS供应商,但只能有一个服务器是默认的,也就是在不选定用哪家服务器发短信时所选择的

余额:点击右面的[余额查询]按钮,可以查询到团队在此短信供应商的余额,方便用户及时充值

短信供应商的四种配置方法

使用系统自带SMS供应商发送短信

在上面“短信服务器的配置”一节中可知道,系统自带sms服务器供应商是:上海希奥信息科技有限公司。只需购买上海希奥的帐号密码,点击[群发信息管理]→[短信服务器]→[添加],设置好 “用户名”和“密码”,点击[保存]。

使用串口短信猫发送短信

使用系统列表内SMS供应商发送短信

首先登录服务器,登录后查看短信供应商列表,我们会看到有: 1.驿家365短信供应商(eaka365) 2.亿美短信供应商 3.瑞特维短信供应商 4.点点客短信供应商 … …

 vim /home/coder/astercc_dev/astcc_smsman.pl 
如果选择以上列表短信供应商的客户,只需将 [供应商、供应商提供的帐号(或序号)、密码],填写到相应位置。

####驿家365短信供应商(eaka365)接口,需要修改{ my $serialpass = ''; my $key = '*';}

sub sms_eaka{
        my $smsStuff = shift;

        $query = "UPDATE ".$db_prefix."batchcontacts SET status  = 'pending', `contacttime` = now() WHERE id = '$smsStuff->{'id'}';";
        &executeQuery($query);

        my $nsPrefix = 'ns'.(int(rand(8999))+1000);
        my $softwareSerialNo = '3SDK-VFG-0130-KKRUR';
        my $serialpass = '********';
        my $key = '*********';
        my $sendTime = '';
        my $mobiles = $smsStuff->{'target'};
        my $smsContent = $batchcontact_archive_list{$smsStuff->{'batchcontact_archive_id'}}{'content'}."【驿家365】";
        my $addSerial = '';
        my $srcCharset = 'UTF-8';
        my $smsPriority = 5;
        my $xmldata = '<?xml version="1.0" encoding="'.$srcCharset.'"?><SOAP-ENV:Envelope xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><'.$nsPrefix.':sendSMS xmlns:'.$nsPrefix.'="http://sdkhttp.eucp.b2m.cn/"><arg0 xsi:type="xsd:string">'.$softwareSerialNo.'</arg0><arg1 xsi:type="xsd:string">'.$key.'</arg1><arg2 xsi:type="xsd:string">'.$sendTime.'</arg2><arg4 xsi:type="xsd:string">'.$smsContent.'</arg4><arg5 xsi:type="xsd:string">'.$addSerial.'</arg5><arg6 xsi:type="xsd:string">'.$srcCharset.'</arg6><arg7 xsi:type="xsd:int">'.$smsPriority.'</arg7><arg3 xsi:type="xsd:string">'.$mobiles.'</arg3></'.$nsPrefix.':sendSMS></SOAP-ENV:Body></SOAP-ENV:Envelope>';
        my $response    = $ua->post('http://sdkhttp.eucp.b2m.cn/sdk/SDKService?wsdl',
                'Host' => 'sdkhttp.eucp.b2m.cn',
                'User-Agent' => 'NuSOAP/0.9.5 (1.123)',
                'Content-Type' => 'text/xml; charset='.$srcCharset,
                'SOAPAction' => '""',
                'Content' => $xmldata
        );
        my $response_content = $response->content;
        my $response_code = XMLin($response_content);
        my $refcode = $response_code->{'S:Body'}->{'ns2:sendSMSResponse'}->{'return'};

        &debug($refcode);

        if($refcode eq "0"){
                # success
                $query = "UPDATE ".$db_prefix."batchcontacts SET status='success',`contacttime`=now() WHERE id='".$smsStuff->{'id'}."';";
        }else{
                # falied
                $query = "UPDATE ".$db_prefix."batchcontacts SET status='error',`responsenote`='".$refcode."',`contacttime`=now() WHERE id='".$smsStuff->{'id'}."';";
        }

        &executeQuery($query);
        return;
}

####亿美短信供应商接口,需要修改{my $serialpass = ''; my $key = '';}

sub sms_yimei {
        my $smsStuff = shift;

        $query = "UPDATE ".$db_prefix."batchcontacts SET status  = 'pending', `contacttime` = now() WHERE id = '$smsStuff->{'id'}';";
        &executeQuery($query);

        my $nsPrefix = 'ns'.(int(rand(8999))+1000);
        my $softwareSerialNo = '6SDK-EMY-6688-KEWMK';
        my $serialpass = '********';
        my $key = '********';
        my $sendTime = '';
        my $mobiles = $smsStuff->{'target'};
        my $smsContent = $batchcontact_archive_list{$smsStuff->{'batchcontact_archive_id'}}{'content'};
        my $addSerial = '';
        my $srcCharset = 'UTF-8';
        my $smsPriority = 5;
        my $xmldata = '<?xml version="1.0" encoding="'.$srcCharset.'"?><SOAP-ENV:Envelope xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><'.$nsPrefix.':sendSMS xmlns:'.$nsPrefix.'="http://sdkhttp.eucp.b2m.cn/"><arg0 xsi:type="xsd:string">'.$softwareSerialNo.'</arg0><arg1 xsi:type="xsd:string">'.$key.'</arg1><arg2 xsi:type="xsd:string">'.$sendTime.'</arg2><arg4 xsi:type="xsd:string">'.$smsContent.'</arg4><arg5 xsi:type="xsd:string">'.$addSerial.'</arg5><arg6 xsi:type="xsd:string">'.$srcCharset.'</arg6><arg7 xsi:type="xsd:int">'.$smsPriority.'</arg7><arg3 xsi:type="xsd:string">'.$mobiles.'</arg3></'.$nsPrefix.':sendSMS></SOAP-ENV:Body></SOAP-ENV:Envelope>';
        my $response    = $ua->post('http://sdk4report.eucp.b2m.cn:8080/sdk/SDKService?wsdl',
                'Host' => 'sdkhttp.eucp.b2m.cn',
                'User-Agent' => 'NuSOAP/0.9.5 (1.123)',
                'Content-Type' => 'text/xml; charset='.$srcCharset,
                'SOAPAction' => '""',
                'Content' => $xmldata
        );
        my $response_content = $response->content;
        my $response_code = XMLin($response_content);
        my $refcode = $response_code->{'S:Body'}->{'ns2:sendSMSResponse'}->{'return'};

        &debug($refcode);

        if($refcode eq "0"){
                # success
                $query = "UPDATE ".$db_prefix."batchcontacts SET status='success',`contacttime`=now() WHERE id='".$smsStuff->{'id'}."';";
        }else{
                # falied
                $query = "UPDATE ".$db_prefix."batchcontacts SET status='error',`responsenote`='".$refcode."',`contacttime`=now() WHERE id='".$smsStuff->{'id'}."';";
        }

        &executeQuery($query);

        return;
}

####瑞特维短信供应商接口,需要修改{#my $serialNu = '';#序列号 #my $serialpw = '';#密码}

sub sms_dnhttp {
        my $smsStuff = shift;
        my $message = $batchcontact_archive_list{$smsStuff->{'batchcontact_archive_id'}}{'content'};#内容
        #老版本
        #my $serialNu = '********';#序列号
        #my $serialpw = '********';#密码
        #my $billcode1 = 'sms6007';#计费代码1
        #my $billcode2 = '116';#计费代码2

        #修正
        my $serialNu = '********';#序列号
        my $serialpw = '********';#密码
        my $billcode1 = 'sms60';#计费代码1
        my $billcode2 = '111';#计费代码2        
        my $numberCount = 1;#条数
        
        #先获取审核信息id
        my $audit_response      = $ua->post('http://202.85.215.208/SmsService/Service/auditMessage',
                {
                        serialNu    => $serialNu,
                        serialpw    => $serialpw,
                        smcontent   => $message,
                        numberCount => $numberCount,
                        billcode    => $billcode1,
                }
        );
        my $auditId = $audit_response->content;#获取审核信息id

        &debug($auditId);

        if ($auditId > 0) {
                #进行短信发送
                my $send_response       = $ua->post('http://202.85.215.208/SmsService/Service/sendSMS',
                        {
                                phonenumber => $smsStuff->{'target'},
                                smscontent  => $message,
                                billcode    => $billcode2,
                                seqno       => $serialNu,
                                sendtime    => "",
                                oldpw       => $serialpw,
                                auditId     => $auditId,
                        }
                );
                my $backmsg = $send_response->content;

                &debug($backmsg);
                if($backmsg eq "0"){
                        # success
                        $query = "UPDATE ".$db_prefix."batchcontacts SET status  = 'success', contacttime = now() WHERE id = '$smsStuff->{'id'}' ";
                }else{
                        # falied
                        $query = "UPDATE ".$db_prefix."batchcontacts SET status  = 'error', responsenote = '$backmsg', contacttime = now() WHERE id = '$smsStuff->{'id'}' ";
                }
        }else{
                # falied
                $query = "UPDATE ".$db_prefix."batchcontacts SET status  = 'error', responsenote = '$auditId', contacttime = now() WHERE id = '$smsStuff->{'id'}' ";
        }
        &executeQuery($query);
        return;
}

####点点客短信供应商接口,需要修改{my $userName = '';#用户名 my $idString = '';#密码}

sub sms_whhttp {
        my $smsStuff = shift;
        my $msgContent = $batchcontact_archive_list{$smsStuff->{'batchcontact_archive_id'}}{'content'};#内容
        my $userName = '********';#用户名
        my $idType = 1;#明文
        my $idString = '********';#密码
        my $sendTime = '';#为空 立即发送
        my $destNumber = $smsStuff->{'target'};#目标号码

        #进行短信发送
        my $send_response       = $ua->post('http://newweb1.dodoca.com:8080/NOSmsPlatform/http/DodocaInterface/smsSendExt',
                {
                        userName    => $userName,
                        idType      => $idType,
                        idString    => $idString,
                        msgContent  => $msgContent,
                        destNumber  => $destNumber,
                        sendTime    => $sendTime,
                }
        );

        my $backmsg = $send_response->content;
        my $xmlmsg = XMLin($backmsg);
        my @resary = split("," , trim($xmlmsg->{'result'}));
        my $backcode = $resary[0];

        &debug($backcode);

        if($backcode eq "1"){
                # succ
                $query = "UPDATE ".$db_prefix."batchcontacts SET status  = 'success',responsenote = '$xmlmsg->{'taskId'}', contacttime = now() WHERE id = '$smsStuff->{'id'}' ";
        }else{
                # err
                $query = "UPDATE ".$db_prefix."batchcontacts SET status  = 'error', responsenote = '$xmlmsg->{'result'}', contacttime = now() WHERE id = '$smsStuff->{'id'}' ";
        }
        &executeQuery($query);

        return;
}
sub debug{
        my $message = shift;
        my $time=scalar localtime;
        if ($debug > 0) {
                open (HDW,">>$Bin/astcc_smsman.txt");
                print HDW $time," ",$message,"\n";
                close HDW;
                if ($ARGV[0] eq '-d'){          # output to file

                }else{
                        print $time," ",$message,"\n";
                }
        }
}

sub trim($)
{
        my $string = shift;
        $string =~ s/^\s+//;
        $string =~ s/\s+$//;
        return $string;
}

sub become_daemon {
    die "Can't fork" unless defined (my $child = fork);
    exit 0 if $child;#kill父进程
    setsid();
    open( STDIN, "</dev/null" );
    open( STDOUT, ">/dev/null" );
    open( STDERR, ">&STDOUT" );

        $SIG{__WARN__} = sub {
                &debug ("NOTE! " . join(" ", @_));
        };

        $SIG{__DIE__} = sub {
                &debug ("FATAL! " . join(" ", @_));
                unlink $pidFile;
                exit;
        };

        $SIG{HUP} = $SIG{INT} = $SIG{TERM} = sub {
                # Any sort of death trigger results in death of all
                my $sig = shift;
                $SIG{$sig} = 'IGNORE';
                die "killed by $sig\n";
                exit;
        };

    umask(0);
        #$ENV{PATH} = '/bin:/sbin:/usr/bin:/usr/sbin';
    return $$;
}
sub connect_mysql
{
        my      %info = @_;
        my      $dbh = DBI->connect("DBI:mysql:database=$info{'dbname'};host=$info{'dbhost'};port=$info{'dbport'}",$info{'dbuser'},$info{'dbpasswd'});
        return($dbh);
}

sub executeQuery
{
        my      $query = shift;
        return if ($query eq '');

        my      $queryType = shift;

        if (!$dbh->ping) {
                 &debug("Reconnect database");
                 $dbh = &connect_mysql(%dbInfo);
        }
        if ($debug > 10 && $internal_debug >0) {
                &debug("$query");
        }
        $dbh->do("SET NAMES 'utf8'");
        if ($queryType eq '') {
                        my $affect = $dbh->do($query) or &debug($dbh->errstr."($query)");
                        if ($affect eq '0E0'){
                                return 0;
                        }else{
                                return $affect;
                        }
        }elsif ($queryType eq 'rows'){
                        my $rows = $dbh->prepare($query);
                        $rows->execute() or &debug($dbh->errstr);
                        return $rows;
        }elsif ($queryType eq 'insert'){
                $dbh->do($query) or &debug($dbh->errstr);
                return $dbh->{q{mysql_insertid}};
        }
}

使用第三方短信平台发送短信

zh/实际案例指导/astercc支持的sms供应商列表.txt · 最后更改: 2017/12/12 11:05 (外部编辑)
Recent changes RSS feed Debian Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki