| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 | 
							- package model
 
- import "strings"
 
- type PresenceStateChange struct {
 
- 	Event      string `json:"event"`
 
- 	Status     string `json:"status"`
 
- 	Message    string `json:"message"`
 
- 	Presentity string `json:"presentity"`
 
- 	Extension  string `json:"extension"`
 
- 	DndStatus  string `json:"dndStatus"`
 
- }
 
- type Hangup struct {
 
- 	AccountCode       string `json:"accountCode"`
 
- 	CallerIDName      string `json:"callerIDName"`
 
- 	CallerIDNum       string `json:"callerIDNumber"`
 
- 	Cause             string `json:"cause"`
 
- 	Causetxt          string `json:"causetxt"`
 
- 	Channel           string `json:"channel"`
 
- 	ChannelState      string `json:"channelState"`
 
- 	ChannelStateDesc  string `json:"channelStateDesc"`
 
- 	ConnectedLineName string `json:"connectedLineName"`
 
- 	ConnectedLineNum  string `json:"connectedLineNumber"`
 
- 	Context           string `json:"context"`
 
- 	Event             string `json:"event"`
 
- 	Exten             string `json:"exten"`
 
- 	Linkedid          string `json:"linkedid"`
 
- 	Priority          string `json:"priority"`
 
- 	Privilege         string `json:"privilege"`
 
- 	Timestamp         string `json:"timestamp"`
 
- 	Uniqueid          string `json:"uniqueid"`
 
- }
 
- type Newstate struct {
 
- 	AccountCode       string `json:"accountCode"`
 
- 	CallerIDName      string `json:"callerIDName"`
 
- 	CallerIDNum       string `json:"callerIDNumber"`
 
- 	Channel           string `json:"channel"`
 
- 	ChannelState      string `json:"channelState"`
 
- 	ChannelStateDesc  string `json:"channelStateDesc"`
 
- 	ConnectedLineName string `json:"connectedLineName"`
 
- 	ConnectedLineNum  string `json:"connectedLineNumber"`
 
- 	Context           string `json:"context"`
 
- 	Event             string `json:"event"`
 
- 	Exten             string `json:"exten"`
 
- 	Language          string `json:"language"`
 
- 	Linkedid          string `json:"linkedid"`
 
- 	Priority          string `json:"priority"`
 
- 	Privilege         string `json:"privilege"`
 
- 	Timestamp         string `json:"timestamp"`
 
- 	Uniqueid          string `json:"uniqueid"`
 
- }
 
- type SuccessfulAuth struct {
 
- 	Event         string `json:"event"`
 
- 	AccountID     string `json:"accountID"`
 
- 	RemoteAddress string `json:"remoteAddress"`
 
- 	Address       string `json:"address"`
 
- }
 
- func (event *SuccessfulAuth) GetAddress() {
 
- 	data := strings.Split(event.RemoteAddress, "/")
 
- 	if len(data) == 4 {
 
- 		event.Address = data[2]
 
- 	} else {
 
- 		event.Address = event.RemoteAddress
 
- 	}
 
- }
 
- type MessageWaiting struct {
 
- 	Event     string `json:"event"`
 
- 	Extension string `json:"extension"`
 
- 	New       string `json:"new"`
 
- 	Old       string `json:"old"`
 
- 	Mailbox   string `json:"mainbox"`
 
- }
 
- func (event *MessageWaiting) GetExtension() {
 
- 	data := strings.Split(event.Mailbox, "@")
 
- 	if len(data) == 2 {
 
- 		event.Extension = data[0]
 
- 	}
 
- }
 
 
  |