Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/cgrates/fsock
/ functions
Functions
186 in github.com/cgrates/fsock
⨍
Functions
186
◇
Types & classes
10
↓ 20 callers
Method
Write
(b []byte)
fsock_test.go:158
↓ 18 callers
Method
Close
()
utils.go:22
↓ 13 callers
Function
splitIgnoreGroups
splitIgnoreGroups splits a string by a separator, excluding elements enclosed in {}, [], or ().
utils.go:113
↓ 11 callers
Method
Err
(string)
utils.go:26
↓ 10 callers
Method
connect
connect establishes a connection to FreeSWITCH using the provided configuration details. This method is not thread-safe and should be called with exte
fsock.go:90
↓ 10 callers
Function
headerVal
headerVal extracts a header's value from a content string.
utils.go:158
↓ 7 callers
Function
MapChanData
MapChanData parses channel information from a given string coming from fsock into a slice of maps, where each map contains individual channel data.
utils.go:60
↓ 7 callers
Function
toJSON
(v interface{})
utils_test.go:356
↓ 6 callers
Method
readHeaders
readHeaders reads and parses the headers from a FreeSWITCH response.
fsconn.go:100
↓ 5 callers
Method
PopFSock
()
fsockpool.go:76
↓ 5 callers
Method
Read
(b []byte)
fsock_test.go:154
↓ 5 callers
Method
auth
auth authenticates the connection with FreeSWITCH using the provided password.
fsconn.go:135
↓ 5 callers
Method
connected
connected checks if socket connected. Not thread safe.
fsock.go:160
↓ 5 callers
Method
filterEvents
filterEvents will filter the Events coming from FreeSWITCH.
fsconn.go:152
↓ 5 callers
Method
reconnectIfNeeded
reconnectIfNeeded if not connected, attempt reconnect if allowed
fsock.go:189
↓ 5 callers
Method
send
send will send the content over the connection.
fsconn.go:180
↓ 4 callers
Method
Send
Send will send the content over the connection, exposing synchronous interface outside
fsconn.go:337
↓ 4 callers
Method
eventsPlain
eventsPlain will subscribe for events in plain mode.
fsconn.go:188
↓ 4 callers
Method
readBody
readBody reads the specified number of bytes from the buffer. The number of bytes to read is given by 'noBytes', which is determined from the content-
fsconn.go:246
↓ 3 callers
Method
Connected
Connected adds up locking on top of normal connected method.
fsock.go:153
↓ 3 callers
Method
Disconnect
Disconnect adds up locking for disconnect
fsock.go:165
↓ 3 callers
Function
EventToMap
(event string)
utils.go:81
↓ 3 callers
Function
NewFSock
NewFSock connects to FS and starts buffering input.
fsock.go:26
↓ 3 callers
Method
PushFSock
(fsk *FSock)
fsockpool.go:98
↓ 3 callers
Method
SendCmd
Generic proxy for commands
fsock.go:207
↓ 3 callers
Method
SendMsgCmdWithBody
SendMsgCmdWithBody command
fsock.go:232
↓ 3 callers
Method
disconnect
Disconnect disconnects from socket
fsock.go:172
↓ 3 callers
Method
doBackgroundJob
bgapi event lisen fuction
fsconn.go:315
↓ 3 callers
Function
fillBuffer
(buf *bytes.Buffer, content string)
fsock_test.go:964
↓ 3 callers
Function
genUUID
helper function for uuid generation
utils.go:102
↓ 3 callers
Function
mockFreeSWITCH
mockFreeSWITCH acts as a FreeSWITCH server. It goes through auth and then executes fn. The fn parameter can be customized based on the needs of the te
fsock_test.go:997
↓ 3 callers
Method
readEvent
readEvent will read one Event from FreeSWITCH, made out of headers and body (if present).
fsconn.go:227
↓ 3 callers
Method
readEvents
readEvents continuously reads and processes events from the network buffer. It stops and exits the loop if an error is encountered, after sending it t
fsconn.go:259
↓ 3 callers
Function
urlDecode
urlDecode decodes URL-encoded FS event header values, reverting to the original on error.
utils.go:173
↓ 2 callers
Method
Connect
Connect adds locking to connect method.
fsock.go:80
↓ 2 callers
Function
FSEventStrToMap
FSEventStrToMap transforms an FreeSWITCH event string into a map, optionally filtering headers.
utils.go:44
↓ 2 callers
Method
Info
(string)
utils.go:27
↓ 2 callers
Method
LocalAddr
()
fsock.go:268
↓ 2 callers
Method
ReconnectIfNeeded
ReconnectIfNeeded adds up locking to reconnectIfNeeded
fsock.go:182
↓ 2 callers
Method
SendBgapiCmd
Send BGAPI command
fsock.go:259
↓ 2 callers
Method
SendCmdWithArgs
(cmd string, args map[string]string, body string)
fsock.go:216
↓ 2 callers
Method
SendEventWithBody
SendEventWithBody command
fsock.go:246
↓ 2 callers
Method
Warning
(string)
utils.go:29
↓ 2 callers
Method
dispatchEvent
Dispatch events to handlers in async mode
fsconn.go:288
↓ 2 callers
Function
getMapKeys
(m map[string][]func(string, int))
utils.go:180
↓ 2 callers
Method
signalError
signalError handles logging or sending the error to the stopError channel.
fsock.go:138
↓ 1 callers
Method
Alert
(string)
utils.go:33
↓ 1 callers
Method
Close
()
utils.go:34
↓ 1 callers
Method
Crit
(string)
utils.go:35
↓ 1 callers
Method
Debug
(string)
utils.go:36
↓ 1 callers
Method
Emerg
(string)
utils.go:37
↓ 1 callers
Method
Err
(string)
utils.go:38
↓ 1 callers
Method
Info
(string)
utils.go:39
↓ 1 callers
Function
NewFSConn
NewFSConn constructs and connects a FSConn
fsconn.go:27
↓ 1 callers
Function
NewFSockPool
Instantiates a new FSockPool
fsockpool.go:18
↓ 1 callers
Method
Notice
(string)
utils.go:40
↓ 1 callers
Method
SendApiCmd
Send API command
fsock.go:227
↓ 1 callers
Method
SendEvent
SendEvent command
fsock.go:254
↓ 1 callers
Method
SendMsgCmd
SendMsgCmd command
fsock.go:241
↓ 1 callers
Method
Warning
(string)
utils.go:41
↓ 1 callers
Method
handleConnectionError
handleConnectionError listens for connection errors and decides whether to attempt a reconnection. It logs errors and manages the stopError channel si
fsock.go:111
Method
Alert
(string)
utils.go:21
Method
Alert
(string)
fsock_test.go:618
Function
BenchmarkFSockReadBody
(b *testing.B)
fsock_test.go:969
Function
BenchmarkHeaderVal
*********************** Benchmarks ************************/
utils_test.go:790
Function
BenchmarkSplitIgnoreGroupsPreallocatedSlice
(b *testing.B)
utils_test.go:822
Function
BenchmarkSplitIgnoreGroupsUnallocatedSlice
* $ go test -bench=. -run=^$ -benchtime=1s -count=5 -benchmem goos: linux goarch: amd64 pkg: github.com/cgrates/fsock cpu: Intel(R) Core(TM) i7-10510
utils_test.go:814
Method
Close
()
fsock_test.go:142
Method
Close
()
fsock_test.go:178
Method
Close
()
fsock_test.go:212
Method
Close
()
fsock_test.go:622
Method
Crit
(string)
utils.go:23
Method
Crit
(string)
fsock_test.go:626
Method
Debug
(string)
utils.go:24
Method
Debug
(string)
fsock_test.go:630
Method
Disconnect
Disconnect will disconnect the fsConn from FreeSWITCH
fsconn.go:392
Method
Emerg
(string)
utils.go:25
Method
Emerg
(string)
fsock_test.go:634
Method
Err
(s string)
fsock_test.go:638
Method
Info
(string)
fsock_test.go:644
Method
LocalAddr
()
fsock_test.go:146
Method
LocalAddr
()
fsock_test.go:182
Method
LocalAddr
()
fsock_test.go:216
Method
LocalAddr
LocalAddr returns the local address of the connection
fsconn.go:397
Method
Notice
(string)
utils.go:28
Method
Notice
(string)
fsock_test.go:648
Method
Read
(b []byte)
fsock_test.go:190
Method
Read
(b []byte)
fsock_test.go:224
Method
RemoteAddr
()
fsock_test.go:150
Method
RemoteAddr
()
fsock_test.go:186
Method
RemoteAddr
()
fsock_test.go:220
Method
SendBgapiCmd
Send BGAPI command
fsconn.go:377
Method
SetDeadline
(t time.Time)
fsock_test.go:162
Method
SetDeadline
(t time.Time)
fsock_test.go:198
Method
SetDeadline
(t time.Time)
fsock_test.go:232
Method
SetReadDeadline
(t time.Time)
fsock_test.go:166
Method
SetReadDeadline
(t time.Time)
fsock_test.go:202
Method
SetReadDeadline
(t time.Time)
fsock_test.go:236
Method
SetWriteDeadline
(t time.Time)
fsock_test.go:170
Method
SetWriteDeadline
(t time.Time)
fsock_test.go:206
next →
1–100 of 186, ranked by callers