Documentation ¶
Index ¶
- Constants
- type Event
- type FSEvent
- func (fsev FSEvent) GetAccount() string
- func (fsev FSEvent) GetCallDestNr() string
- func (fsev FSEvent) GetDestination() string
- func (fsev FSEvent) GetDirection() string
- func (fsev FSEvent) GetEndTime() (t time.Time, err error)
- func (fsev FSEvent) GetFallbackSubj() string
- func (fsev FSEvent) GetName() string
- func (fsev FSEvent) GetOrigId() string
- func (fsev FSEvent) GetReqType() string
- func (fsev FSEvent) GetStartTime(field string) (t time.Time, err error)
- func (fsev FSEvent) GetSubject() string
- func (fsev FSEvent) GetTOR() string
- func (fsev FSEvent) GetTenant() string
- func (fsev FSEvent) GetUUID() string
- func (fsev FSEvent) MissingParameter() bool
- func (fsev FSEvent) New(body string) Event
- func (fsev FSEvent) String() (result string)
- type FSSessionManager
- func (sm *FSSessionManager) Connect(cgrCfg *config.CGRConfig) (err error)
- func (sm *FSSessionManager) DisconnectSession(s *Session, notify string)
- func (sm *FSSessionManager) GetDbLogger() engine.DataStorage
- func (sm *FSSessionManager) GetDebitPeriod() time.Duration
- func (sm *FSSessionManager) GetSession(uuid string) *Session
- func (sm *FSSessionManager) LoopAction(s *Session, cd *engine.CallDescriptor, index float64)
- func (sm *FSSessionManager) OnChannelAnswer(ev Event)
- func (sm *FSSessionManager) OnChannelHangupComplete(ev Event)
- func (sm *FSSessionManager) OnChannelPark(ev Event)
- func (sm *FSSessionManager) OnHeartBeat(ev Event)
- func (sm *FSSessionManager) RemoveSession(s *Session)
- func (sm *FSSessionManager) Shutdown() (err error)
- type Session
- type SessionManager
Constants ¶
const ( // Freswitch event proprities names DIRECTION = "Call-Direction" ORIG_ID = "variable_sip_call_id" //- originator_id - match cdrs SUBJECT = "variable_cgr_subject" ACCOUNT = "variable_cgr_account" DESTINATION = "variable_cgr_destination" REQTYPE = "variable_cgr_reqtype" //prepaid or postpaid TOR = "variable_cgr_tor" UUID = "Unique-ID" // -Unique ID for this call leg CSTMID = "variable_cgr_tenant" CALL_DEST_NR = "Caller-Destination-Number" PARK_TIME = "Caller-Profile-Created-Time" START_TIME = "Caller-Channel-Answered-Time" END_TIME = "Caller-Channel-Hangup-Time" NAME = "Event-Name" HEARTBEAT = "HEARTBEAT" ANSWER = "CHANNEL_ANSWER" HANGUP = "CHANNEL_HANGUP_COMPLETE" PARK = "CHANNEL_PARK" AUTH_OK = "+AUTH_OK" DISCONNECT = "+SWITCH DISCONNECT" INSUFFICIENT_FUNDS = "-INSUFFICIENT_FUNDS" MISSING_PARAMETER = "-MISSING_PARAMETER" SYSTEM_ERROR = "-SYSTEM_ERROR" MANAGER_REQUEST = "+MANAGER_REQUEST" USERNAME = "Caller-Username" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Event ¶
type Event interface { New(string) Event GetName() string GetDirection() string GetOrigId() string GetSubject() string GetAccount() string GetDestination() string GetCallDestNr() string GetTOR() string GetUUID() string GetTenant() string GetReqType() string GetStartTime(string) (time.Time, error) GetEndTime() (time.Time, error) GetFallbackSubj() string MissingParameter() bool }
type FSEvent ¶
Event type holding a mapping of all event's proprieties
func (FSEvent) GetAccount ¶
func (FSEvent) GetCallDestNr ¶
Original dialed destination number, useful in case of unpark
func (FSEvent) GetDestination ¶
Charging destination number
func (FSEvent) GetDirection ¶
func (FSEvent) GetFallbackSubj ¶
func (FSEvent) GetReqType ¶
func (FSEvent) GetStartTime ¶
func (FSEvent) GetSubject ¶
func (FSEvent) MissingParameter ¶
type FSSessionManager ¶
type FSSessionManager struct {
// contains filtered or unexported fields
}
The freeswitch session manager type holding a buffer for the network connection and the active sessions
func NewFSSessionManager ¶
func NewFSSessionManager(storage engine.DataStorage, connector engine.Connector, debitPeriod time.Duration) *FSSessionManager
func (*FSSessionManager) Connect ¶
func (sm *FSSessionManager) Connect(cgrCfg *config.CGRConfig) (err error)
Connects to the freeswitch mod_event_socket server and starts listening for events.
func (*FSSessionManager) DisconnectSession ¶
func (sm *FSSessionManager) DisconnectSession(s *Session, notify string)
Disconnects a session by sending hangup command to freeswitch
func (*FSSessionManager) GetDbLogger ¶
func (sm *FSSessionManager) GetDbLogger() engine.DataStorage
func (*FSSessionManager) GetDebitPeriod ¶
func (sm *FSSessionManager) GetDebitPeriod() time.Duration
func (*FSSessionManager) GetSession ¶
func (sm *FSSessionManager) GetSession(uuid string) *Session
Searches and return the session with the specifed uuid
func (*FSSessionManager) LoopAction ¶
func (sm *FSSessionManager) LoopAction(s *Session, cd *engine.CallDescriptor, index float64)
func (*FSSessionManager) OnChannelAnswer ¶
func (sm *FSSessionManager) OnChannelAnswer(ev Event)
func (*FSSessionManager) OnChannelHangupComplete ¶
func (sm *FSSessionManager) OnChannelHangupComplete(ev Event)
func (*FSSessionManager) OnChannelPark ¶
func (sm *FSSessionManager) OnChannelPark(ev Event)
func (*FSSessionManager) OnHeartBeat ¶
func (sm *FSSessionManager) OnHeartBeat(ev Event)
func (*FSSessionManager) RemoveSession ¶
func (sm *FSSessionManager) RemoveSession(s *Session)
Remove session from sessin list
func (*FSSessionManager) Shutdown ¶
func (sm *FSSessionManager) Shutdown() (err error)
type Session ¶
Session type holding the call information fields, a session delegate for specific actions and a channel to signal end of the debit loop.
func NewSession ¶
func NewSession(ev Event, sm SessionManager) (s *Session)
Creates a new session and starts the debit loop
func (*Session) SaveOperations ¶
func (s *Session) SaveOperations()