tools

package
v0.0.0-...-78f9e34 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 24, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CallDataPool = sync.Pool{
	New: func() interface{} {
		return &CallData{}
	},
}

Functions

func CallDataPut

func CallDataPut(data *CallData)

func ErrorCheckOfRecover

func ErrorCheckOfRecover(n interface{}, log *logrus.Logger)

func GetDBTable

func GetDBTable(s string) (db, table string, err error)

func GetFunctionName

func GetFunctionName(i interface{}, seps ...rune) string

自定义Panic异常处理,调用方式: 例如Test()函数, 指定defer ErrorCheckOfRecover(Test)

func GetHomeDirectory

func GetHomeDirectory() (s *string, err error)

func IsValidDate

func IsValidDate(date string) bool

func IsValidIPAddr

func IsValidIPAddr(ip string) bool

func JsonStr2Bson

func JsonStr2Bson(str string) (interface{}, error)

func StringToFloat32

func StringToFloat32(s string) float32

func StringToInt64

func StringToInt64(s string) int64

Types

type CallData

type CallData struct {
	Id                  string
	Callere164          string // 计费的主叫号码
	Calleraccesse164    string // VOS5000收到的原始主叫
	Calleee164          string
	Calleeaccesse164    string
	Callerip            string
	Callergatewayid     string
	Callerproductid     string
	Callertogatewaye164 string
	Callertype          int64
	Calleeip            string
	Calleegatewayid     string
	Calleeproductid     string
	Calleetogatewaye164 string
	Calleetype          int64
	Billingmode         int64
	Calllevel           int64
	Agentfeetime        int64
	Starttime           int64
	Stoptime            int64
	Callerpdd           int64
	Calleepdd           int64
	Holdtime            int64 // 通话的时长(秒)
	Callerareacode      string
	Feetime             int64 // 通话计费时长(秒)
	Fee                 float32
	Suitefee            float32
	Suitefeetime        int64
	Incomefee           float32
	Customeraccount     string
	Customername        string
	Calleeareacode      string
	Agentfee            float32
	Agentsuitefee       float32
	Agentsuitefeetime   int64
	Agentaccount        string
	Agentname           string
	Flowno              int64
	Softswitchname      string
	Softswitchcallid    int64
	Callercallid        string
	Calleecallid        string
	Enddirection        int64
	Endreason           int64
	Billingtype         int64
	Cdrlevel            int64
	Agentcdr_id         int64
	Failed_gateways     string
}

func CallDataGet

func CallDataGet() *CallData

type CallDataBatchSet

type CallDataBatchSet struct {
	Id                  []*string
	Callere164          []*string // 计费的主叫号码
	Calleraccesse164    []*string // VOS5000收到的原始主叫
	Calleee164          []*string
	Calleeaccesse164    []*string
	Callerip            []*string
	Callergatewayid     []*string
	Callerproductid     []*string
	Callertogatewaye164 []*string
	Callertype          []*int64
	Calleeip            []*string
	Calleegatewayid     []*string
	Calleeproductid     []*string
	Calleetogatewaye164 []*string
	Calleetype          []*int64
	Billingmode         []*int64
	Calllevel           []*int64
	Agentfeetime        []*int64
	Starttime           []*int64
	Stoptime            []*int64
	Callerpdd           []*int64
	Calleepdd           []*int64
	Holdtime            []*int64 // 通话的时长(秒)
	Callerareacode      []*string
	Feetime             []*int64 // 通话计费时长(秒)
	Fee                 []*float32
	Suitefee            []*float32
	Suitefeetime        []*int64
	Incomefee           []*float32
	Customeraccount     []*string
	Customername        []*string
	Calleeareacode      []*string
	Agentfee            []*float32
	Agentsuitefee       []*float32
	Agentsuitefeetime   []*int64
	Agentaccount        []*string
	Agentname           []*string
	Flowno              []*int64
	Softswitchname      []*string
	Softswitchcallid    []*int64
	Callercallid        []*string
	Calleecallid        []*string
	Enddirection        []*int64
	Endreason           []*int64
	Billingtype         []*int64
	Cdrlevel            []*int64
	Agentcdr_id         []*int64
	Failed_gateways     []*string
}

type PAuth

type PAuth struct {
	Address  string
	Port     string
	User     string
	Password string
	SID      string
}

func SplitServerAuth

func SplitServerAuth(r string) (a []PAuth, platform string, service string, err error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL