Documentation ¶
Overview ¶
const ACCE164S = ` CREATE TABLE IF NOT EXISTS %s (
acce164_uuid uuid NOT NULL DEFAULT gen_random_uuid(), account_id varchar NOT NULL, account_domain varchar NOT NULL, gateway_name varchar NOT NULL, e164_number varchar NOT NULL, acce164_isdefault bool NOT NULL DEFAULT false, CONSTRAINT acce164_pkey PRIMARY KEY (acce164_uuid)
); COMMENT ON TABLE %s IS 'account e164 number for outgoing call'; ALTER TABLE %s ADD CONSTRAINT acce164_fk FOREIGN KEY (account_id,account_domain) REFERENCES %s(account_id,account_domain) ON DELETE CASCADE ON UPDATE CASCADE; ALTER TABLE %s ADD CONSTRAINT acce164_fk_1 FOREIGN KEY (gateway_name) REFERENCES %s(gateway_name) ON DELETE CASCADE ON UPDATE CASCADE; ALTER TABLE %s ADD CONSTRAINT acce164_fk_2 FOREIGN KEY (e164_number) REFERENCES %s(e164_number) ON DELETE CASCADE ON UPDATE CASCADE; `
const E164ACCS = ` CREATE TABLE IF NOT EXISTS %s (
e164acc_uuid uuid NOT NULL DEFAULT gen_random_uuid(), gateway_name varchar NOT NULL, e164_number varchar NOT NULL, account_id varchar NULL DEFAULT '', account_domain varchar NULL DEFAULT '', fifo_name varchar NULL DEFAULT '', e164acc_isfifo bool NOT NULL DEFAULT false, CONSTRAINT e164acc_pkey PRIMARY KEY (e164acc_uuid)
); COMMENT ON TABLE %s IS 'gateway e164 receive incoming call, bridge account@domain or fifo fifo@fifoname in'; ALTER TABLE %s ADD CONSTRAINT e164acc_fk FOREIGN KEY (account_id,account_domain) REFERENCES %s(account_id,account_domain) ON DELETE CASCADE ON UPDATE CASCADE; ALTER TABLE %s ADD CONSTRAINT e164acc_fk_1 FOREIGN KEY (gateway_name) REFERENCES %s(gateway_name) ON DELETE CASCADE ON UPDATE CASCADE; ALTER TABLE %s ADD CONSTRAINT e164acc_fk_2 FOREIGN KEY (e164_number) REFERENCES %s(e164_number) ON DELETE CASCADE ON UPDATE CASCADE; ALTER TABLE %s ADD CONSTRAINT e164acc_fk_3 FOREIGN KEY (fifo_name) REFERENCES %s(fifo_name) ON DELETE CASCADE ON UPDATE CASCADE; `
const E164S = ` CREATE TABLE IF NOT EXISTS %s (
e164_uuid uuid NOT NULL DEFAULT gen_random_uuid(), gateway_name varchar NOT NULL DEFAULT '', e164_number varchar NOT NULL, e164_enable bool NULL DEFAULT true, e164_lockin bool NULL DEFAULT false, e164_lockout bool NULL DEFAULT false, CONSTRAINT e164s_pkey PRIMARY KEY (e164_uuid), CONSTRAINT e164s_un UNIQUE (e164_number)
); COMMENT ON TABLE %s IS 'phone numbers of external gateway'; `
const FIFOS = ` CREATE TABLE IF NOT EXISTS %s (
fifo_uuid uuid NOT NULL DEFAULT gen_random_uuid(), fifo_name varchar NOT NULL, fifo_importance varchar NULL DEFAULT 0, fifo_announce varchar NULL DEFAULT '', fifo_holdmusic varchar NULL DEFAULT '', CONSTRAINT fifos_pkey PRIMARY KEY (fifo_uuid), CONSTRAINT fifos_un UNIQUE (fifo_name)
); COMMENT ON TABLE %s IS 'mod_fifo fifos'; `
const OUTGOINGCALLS = ` CREATE TABLE IF NOT EXISTS %s (
uuidjob uuid NOT NULL, uuida uuid NOT NULL, uuidb uuid NOT NULL, id varchar NOT NULL DEFAULT '', domain varchar NOT NULL DEFAULT '', e164 varchar NOT NULL DEFAULT '', gateway varchar NOT NULL DEFAULT '', ani varchar NOT NULL DEFAULT '', destination varchar NOT NULL DEFAULT '', CONSTRAINT outgoingcalls_pkey PRIMARY KEY (uuidjob)
); COMMENT ON TABLE %s IS 'outgoingcalls bgapi command originate a bridge b'; `
Index ¶
- Constants
- func CreateBgjob(in Bgjob) error
- func CreateCdrAleg(in *CDRLEG) (e error)
- func CreateCdrBleg(in *CDRLEG) (e error)
- func GetGatewaydb() *sqlx.DB
- func GetServerdb() *sqlx.DB
- func GetSwitchdb() *sqlx.DB
- func GetTablesGatewayPrifex() string
- func GetTablesServerPrifex() string
- func Initdb()
- func InsertCallDetailRecord(isbleg bool, in *CDRLEG) error
- func IsExistCallDetailRecordUuid(isbleg bool, uuid string) (bool, error)
- func IsExistCdrsAlegUuid(uuid string) (bool, error)
- func IsExistCdrsBlegUuid(uuid string) (bool, error)
- func SelectAccountsDistinctDomain() ([]string, error)
- type ACCE164
- func DeleteAcce164sAcce164(uuid string) (ACCE164, error)
- func DeleteE164accsE164acc(uuid string) (ACCE164, error)
- func InsertAcce164s(in []ACCE164) ([]ACCE164, error)
- func SelectAcce164sWithCondition(condition string) ([]ACCE164, error)
- func UpdateAcce164sAcce164(uuid string, in ACCE164) (ACCE164, error)
- type Account
- func DeleteAccountsAccount(uuid string) (out Account, e error)
- func GetAccountsAccount(id, domain string) (*Account, error)
- func InsertAccounts(in []Account) (rt []Account, e error)
- func SelectAccountsWithCondition(condition string) (rt []Account, e error)
- func UpdateAccountsAccount(uuid string, in Account) (out Account, e error)
- type Bgjob
- type Blacklist
- func DeleteBlacklistsBlacklist(uuid string) (Blacklist, error)
- func InsertBlacklists(in []Blacklist) ([]Blacklist, error)
- func IsExistBlacklist(caller, callee string) (Blacklist, bool)
- func SelectBlacklistsWithCondition(condition string) ([]Blacklist, error)
- func UpdateBlacklistsBlacklist(uuid string, in Blacklist) (Blacklist, error)
- type CDRLEG
- type Conf
- func DeleteConfsConf(uuid string) (Conf, error)
- func GetConfsConfWithCondition(condition string) (Conf, error)
- func InsertConfs(in []Conf) ([]Conf, error)
- func InsertConfsConf(in Conf) (Conf, error)
- func SelectConfsWithCondition(condition string) ([]Conf, error)
- func UpdateConfsConf(uuid string, in Conf) (Conf, error)
- type E164
- type E164ACC
- type Fifo
- type FifoMember
- type Gateway
- type OUTGOINGCALL
Constants ¶
const ACCE164S = `` /* 855-byte string literal not displayed */
const ACCOUNTS = `` /* 533-byte string literal not displayed */
const BGJOBS = `` /* 303-byte string literal not displayed */
const BLACKLISTS = `` /* 296-byte string literal not displayed */
fs server --run table define
const CDR_LEG = `` /* 1209-byte string literal not displayed */
CDR_LEG mod_odbc_cdr table define
const CONFS = `` /* 332-byte string literal not displayed */
fs gateway -run table define
const DATABASE_DROP = `drop database if exists %s;`
const DBUSER_AUTH = "grant all privileges on database %s to %s"
const DB_CREATE = "create database %s with owner %s"
const DEFAULT_ACCE164S = `` /* 328-byte string literal not displayed */
const DEFAULT_ACCOUNTS = `` /* 200-byte string literal not displayed */
const DEFAULT_BLACKLISTS = `
insert into %s(blacklist_caller,blacklist_callee)values
('13012345678','1000'),
('1000','13012345678')
`
const DEFAULT_E164ACCES = `` /* 166-byte string literal not displayed */
const DEFAULT_E164S = `
insert into %s(gateway_name,e164_number)values
('myfsgateway','1000'),
('','10010'),
('','10086')
`
const DEFAULT_FIFOMEMBERS = `` /* 266-byte string literal not displayed */
const DEFAULT_FIFOS = `
insert into %s(fifo_name)values
('fifomember@fifos'),
('fifoconsumer@fifos')
`
const DEFAULT_GATEWAYS = `` /* 647-byte string literal not displayed */
const E164ACCS = `` /* 1030-byte string literal not displayed */
const E164S = `` /* 426-byte string literal not displayed */
const FIFOMEMBERS = `` /* 508-byte string literal not displayed */
const FIFOS = `` /* 368-byte string literal not displayed */
const GATEWAYS = `` /* 766-byte string literal not displayed */
const OUTGOINGCALLS = `` /* 451-byte string literal not displayed */
const USER_CREATE = "create user %s with password '%s'"
const USER_CREATE = "create user fsdba with password 'fsdba'" const DB_CREATE = "create database freeswitch with owner fsdba" const DBUSER_AUTH = "grant all privileges on database freeswitch to fsdba" const DATABASE_USER_DROP = `drop database if exists freeswitch; drop user if exists fsdba;`
const USER_DROP = `drop user if exists %s;`
Variables ¶
This section is empty.
Functions ¶
func GetGatewaydb ¶
func GetServerdb ¶
func GetSwitchdb ¶
func GetTablesGatewayPrifex ¶
func GetTablesGatewayPrifex() string
func GetTablesServerPrifex ¶
func GetTablesServerPrifex() string
func InsertCallDetailRecord ¶
InsertCallDetailRecord
func IsExistCallDetailRecordUuid ¶
IsExistCallDetailRecordUuid
Types ¶
type ACCE164 ¶
type ACCE164 struct { AEuuid string `db:"acce164_uuid" json:"uuid"` Aid string `db:"account_id" json:"id"` Adomain string `db:"account_domain" json:"domain"` Gname string `db:"gateway_name" json:"name"` Enumber string `db:"e164_number" json:"number"` Isdefault bool `db:"acce164_isdefault" json:"isdefault"` }
acce164 struct
func DeleteAcce164sAcce164 ¶
DeleteAcce164sAcce164
func DeleteE164accsE164acc ¶
DeleteE164accsE164acc
func SelectAcce164sWithCondition ¶
SelectAcce164sWithCondition
type Account ¶
type Account struct { Auuid string `db:"account_uuid" json:"uuid"` Aid string `db:"account_id" json:"id"` Aname string `db:"account_name" json:"name"` Aauth string `db:"account_auth" json:"auth"` Apassword string `db:"account_password" json:"password"` Aa1hash string `db:"account_a1hash" json:"a1hash"` Agroup string `db:"account_group" json:"group"` Adomain string `db:"account_domain" json:"domain"` Aproxy string `db:"account_proxy" json:"proxy"` Acacheable string `db:"account_cacheable" json:"cacheable"` }
func DeleteAccountsAccount ¶
func GetAccountsAccount ¶
func InsertAccounts ¶
type Bgjob ¶
type Bgjob struct { Juuid string `db:"job_uuid" json:"uuid"` Jcmd string `db:"job_cmd" json:"cmd"` Jcmdarg string `db:"job_cmdarg" json:"cmdarg"` Jcontent string `db:"job_content" json:"content"` }
func SelectBgjobsWithCondition ¶
SelectBgjobsWithCondition
type Blacklist ¶
type Blacklist struct { Buuid string `db:"blacklist_uuid" json:"uuid"` Bcaller string `db:"blacklist_caller" json:"caller"` Bcallee string `db:"blacklist_callee" json:"callee"` }
func DeleteBlacklistsBlacklist ¶
DeleteBlacklistsBlacklist
func IsExistBlacklist ¶
IsExistBlacklist
func SelectBlacklistsWithCondition ¶
SelectBlacklistsWithCondition
type CDRLEG ¶
type CDRLEG struct { UUID string `db:"uuid" json:"uuid"` OtherUUID string `db:"otheruuid" json:"otheruuid"` BondUUID string `db:"bonduuid" json:"bonduuid"` Name string `db:"name" json:"name"` Direction string `db:"direction" json:"direction"` Sofiaprofile string `db:"sofiaprofile" json:"sofiaprofile"` Indomain string `db:"indomain" json:"indomain"` Ingateway string `db:"ingateway" json:"ingateway"` Outdomain string `db:"outdomain" json:"outdomain"` Outgateway string `db:"outgateway" json:"outgateway"` Ani string `db:"ani" json:"ani"` Destination string `db:"destination" json:"destination"` Calleridname string `db:"calleridname" json:"calleridname"` Calleridnumber string `db:"calleridnumber" json:"calleridnumber"` Calleeidname string `db:"calleeidname" json:"calleeidname"` Calleeidnumber string `db:"calleeidnumber" json:"calleeidnumber"` App string `db:"app" json:"app"` Appdata string `db:"appdata" json:"appdata"` Appdialstatus string `db:"dialstatus" json:"dialstatus"` Cause string `db:"cause" json:"cause"` Q850 string `db:"q850" json:"q850"` Disposition string `db:"disposition" json:"disposition"` Protocause string `db:"protocause" json:"protocause"` Phrase string `db:"phrase" json:"phrase"` Startepoch string `db:"startepoch" json:"startepoch"` Answerepoch string `db:"answerepoch" json:"answerepoch"` Endepoch string `db:"endepoch" json:"endepoch"` Waitsec string `db:"waitsec" json:"waitsec"` Billsec string `db:"billsec" json:"billsec"` Duration string `db:"duration" json:"duration"` }
func SelectCallDetailRecordsWithCondition ¶
SelectCallDetailRecordsWithCondition
type Conf ¶
type Conf struct { Cuuid string `db:"conf_uuid" json:"uuid"` Cfilename string `db:"conf_filename" json:"filename"` Cprofile string `db:"conf_profile" json:"profile"` Ccontent string `db:"conf_content" json:"content"` Cnewcontent string `db:"conf_newcontent" json:"newcontent"` }
func GetConfsConfWithCondition ¶
GetConfsConfWithCondition
func SelectConfsWithCondition ¶
SelectConfsWithCondition
type E164 ¶
type E164 struct { Euuid string `db:"e164_uuid" json:"uuid"` Gname string `db:"gateway_name" json:"gname"` Enumber string `db:"e164_number" json:"number"` Eenable bool `db:"e164_enable" json:"enable"` Elockin bool `db:"e164_lockin" json:"lockin"` Elockout bool `db:"e164_lockout" json:"lockout"` }
func DeleteE164sE164 ¶
func InsertE164s ¶
type E164ACC ¶
type E164ACC struct { EAuuid string `db:"e164acc_uuid" json:"uuid"` Gname string `db:"gateway_name" json:"gname"` Enumber string `db:"e164_number" json:"number"` Aid string `db:"account_id" json:"id"` Adomain string `db:"account_domain" json:"domain"` Fname string `db:"fifo_name" json:"fname"` Isfifo bool `db:"e164acc_isfifo" json:"isfifo"` }
e164acc struct
func SelectE164accsWithCondition ¶
SelectE164accsWithCondition
type Fifo ¶
type Fifo struct { Fuuid string `db:"fifo_uuid" json:"uuid"` Fname string `db:"fifo_name" json:"name"` Fimportance string `db:"fifo_importance" json:"importance"` Fannounce string `db:"fifo_announce" json:"announce"` Fholdmusic string `db:"fifo_holdmusic" json:"holdmusic"` }
func SelectFifosWithCondition ¶
SelectFifosWithCondition
type FifoMember ¶
type FifoMember struct { Muuid string `db:"fifomember_uuid" json:"uuid"` Fname string `db:"fifo_name" json:"name"` Mstring string `db:"member_string" json:"string"` Msimo string `db:"member_simo" json:"simo"` Mtimeout string `db:"member_timeout" json:"timeout"` Mlag string `db:"member_lag" json:"lag"` }
func DeleteFifomembersFifomember ¶
func DeleteFifomembersFifomember(uuid string) (FifoMember, error)
DeleteFifomembersFifomember
func InsertFifoMembers ¶
func InsertFifoMembers(in []FifoMember) ([]FifoMember, error)
InsertFifoMembers
func SelectFifomembersWithCondition ¶
func SelectFifomembersWithCondition(condition string) ([]FifoMember, error)
SelectFifomembersWithCondition
func UpdateFifomembersFifomember ¶
func UpdateFifomembersFifomember(uuid string, in FifoMember) (FifoMember, error)
UpdateFifomembersFifomember
type Gateway ¶
type Gateway struct { Guuid string `db:"gateway_uuid" json:"uuid"` Pname string `db:"profile_name" json:"pname"` Gname string `db:"gateway_name" json:"gname"` Gusername string `db:"gateway_username" json:"username"` Grealm string `db:"gateway_realm" json:"realm"` Gfromuser string `db:"gateway_fromuser" json:"fromuser"` Gfromdomain string `db:"gateway_fromdomain" json:"fromdomain"` Gpassword string `db:"gateway_password" json:"password"` Gextension string `db:"gateway_extension" json:"extension"` Gproxy string `db:"gateway_proxy" json:"proxy"` Gregisterproxy string `db:"gateway_registerproxy" json:"registerproxy"` Gexpire string `db:"gateway_expire" json:"expire"` Gregister string `db:"gateway_register" json:"register"` Gcalleridinfrom string `db:"gateway_calleridinfrom" json:"calleridinfrom"` Gextensionincontact string `db:"gateway_extensionincontact" json:"extensionincontact"` Goptionping string `db:"gateway_optionping" json:"optionping"` }
func DeleteGatewaysGateway ¶
func InsertGateways ¶
type OUTGOINGCALL ¶
type OUTGOINGCALL struct { Jobuuid string `db:"uuidjob" json:"uuidjob"` Auuid string `db:"uuida" json:"uuida"` Buuid string `db:"uuidb" json:"uuidb"` Id string `db:"id" json:"id"` Domain string `db:"domain" json:"domain"` E164 string `db:"e164" json:"e164"` Gateway string `db:"gateway" json:"gateway"` Ani string `db:"ani" json:"ani"` Destination string `db:"destination" json:"destination"` }
OUTGOINGCALL struct
func InsertOutgoingcalls ¶
func InsertOutgoingcalls(in []OUTGOINGCALL) ([]OUTGOINGCALL, error)
InsertOutgoingcalls
func SelectOutgoingcallsWithCondition ¶
func SelectOutgoingcallsWithCondition(condition string) ([]OUTGOINGCALL, error)
SelectOutgoingcallsWithCondition