1. FSGUIV2.3.3.0 版本发布及调用源码及业务逻辑:
  2. 宁卫通信
  3. 新闻动态
  4. 宁卫新闻
  5. FSGUIV2.3.3.0 版本发布及调用源码及业务逻辑

FSGUIV2.3.3.0 版本发布及调用源码及业务逻辑

下载:

V2.3.3.0 alpha RPMhttp://pan.baidu.com/s/1ge37vO3

V2.3.3.0 alpha ISO包: http://pan.baidu.com/s/1c2kqSt6

 

更新说明:

 

2017-4-14

 

增加呼出放音后再转呼给其他分机或外线的接口:

呼叫两个通道且放音,originate_playring

这个接口可以替代原上一个接口originage,即我们不指定播放的ring_id即可

 

Job_uuid 源主叫uuid get_uuid获得

Callername sip里的name

Callernum  aleg  号码

Calleenum bleg 号码

A_gatewayname  如果a是外线,则要指定a的出局网关

B_gatewayname  如果b是外线,则要指定b的出局网关

A_effective_caller_id_num  ab显示的号码

B_effective_caller_id_num  baa上显示的号码

A_external   false,true,标记a是不是外线

B_external   false,true,标记b是不是外线

Ring_id ,     上传后的彩铃id,在这里以字符串发送

先呼内线再呼外线

 

 curl -H "Content-Type:application/json" -d '{"Job_uuid":"1234","Callername":"1001","Callernum":"1001","Calleenum":"018621575908","A_gatewayname":"nwaycall","B_gatewayname":"nwaycall","A_effective_caller_id_num":"18621575908","B_effective_caller_id_num":"13671947488","A_external":"false","B_external":"true","Ring_id":"35"}'  -H"Authorization:Nway token" http://127.0.0.1:8085/api/originate_playring

先呼外线再呼内线

 

  curl -H "Content-Type:application/json" -d '{"Job_uuid":"1234","Callername":"18621575908","Callernum":"018621575908","Calleenum":"1001","A_gatewayname":"nwaycall","B_gatewayname":"nwaycall",

  "A_effective_caller_id_num":"18621575908",

 "B_effective_caller_id_num":"13671947488","A_external":"true","B_external":"false","Ring_id":"35"}'  -H "Authorization:Nway token"http://127.0.0.1:8085/api/originate_playring

两线均为外线

 

   curl -H "Content-Type:application/json" -d                                                                                                     '{"Job_uuid":"1234","Callername":"18621575908","Callernum":"018621575908","Calleenum":"013671947488","A_gatewayname":"nwaycall","B_gatewayname":"nwaycall","A_effective_caller_id_num":"18621575908","B_effective_caller_id_num":"13671947488","A_external":"true","B_external":"true","Ring_id":"35"}'  -H "Authorization:Nway token"http://127.0.0.1:8085/api/originate_playring

增加路由和IVR过程中由外部的URL来控制业务流程:

增加接口操作类型:external_execute_uri 

IVR明细或路由明细中配置,且配置了相关的url后,则按以下业务逻辑处理

//定义

SRCNUMBER      = "SrcNumber"

    INGATEWAY      = "InGateway"

    OUTGATEWAY     = "OutGateway"

    DESTNUMBER     = "DestNumber"

    DOAMIN         = "Domain"

    STATUS         = "Status"

    STATUS_SUCCESS = "Success"

    STATUS_FAILED  = "Failed"

    UUID           = "Uuid"

    RESSTRING      = "restring"

    //返回的控制消息指令

    CTRL_RINGFILE      = "RingFile"

    CTRL_DTMF          = "Dtmf"

    CTRL_DATA          = "Data"

    CTRL_DIGIT_LEN     = "DigitLen"

    CTRL_SHORTRING     = "ShortRing"

    CTRL_VALIDRING     = "ValidRing"

    CTRL_MAX_TIMEOUT   = "MaxTimeout"

    CTRL_INNER_TIMEOUT = "InnerTimeout"

 

    //OPERATE,从远程接收的命令

    COMMAND    = "Cmd"

    BRIDGE     = "bridge"

    DTMF       = "dtmf"

    PLAYRING   = "playring"

    BRIDGEGROUP = "bridgeGroup"//转给座席组

    TTS        = "tts"         //由远程返回tts数据,通过配好的tts后播放

    CONFERENCE = "conference"

    HANGUP     = "hangup"

 

//处理由远程返回的http

        if C[COMMAND] == BRIDGE {

            //Cmd=bridge,Data=8888

            

            ...

        } else if C[COMMAND] == BRIDGEGROUP {

            //Cmd=bridgeGroup,Data=9000

            

            ...

        } else if C[COMMAND] == DTMF {

           //Cmd=dtmf,RingFile=/tmp/longfile.wav,ShortRing=/tmp/shortfile.wav,ValidRing=/tmp/validfile.wav,DigitLen=18,MaxTimeout=360,InnerTimeout=60

            var digitlen int = 1

            var maxtimeout int = 360

            var innertimeout int = 20

            var err2 error

 

             ....

            dtmf, resErr := PlayGetDigits(c,C[CTRL_RINGFILE], C[CTRL_VALIDRING], "#", digitlen,maxtimeout, innertimeout, 3)

            ...

        }else if C[COMMAND] == PLAYRING {

            //Cmd=playring,Data=/tmp/av.mpt

             

            ...

        } else if C[COMMAND] == TTS {

            //Cmd=tts,Data="你好,你的订单号是12345678"  //暂不实现

        } else if C[COMMAND] == CONFERENCE {

            //Cmd=conference,Data=6000

            

             ...

        } else if C[COMMAND] == HANGUP {

            //Cmd=hangup

            

             ...

        }