- Notifications
You must be signed in to change notification settings - Fork45
A GoLang FreeSWITCH ESL Library
License
NotificationsYou must be signed in to change notification settings
percipia/eslgo
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
eslgo is aFreeSWITCH™ ESL library for GoLang.eslgo was written from the ground up in idiomatic Go for use in our production products tested handling thousands of calls per second.
go get github.com/percipia/eslgo
github.com/percipia/eslgo v1.4.1
- Inbound ESL Connection
- Outbound ESL Server
- Event listeners by UUID or All events
- Unique-Id
- Application-UUID
- Job-UUID
- Context support for canceling requests
- All command types abstracted out
- You can also send custom data by implementing the
Command
interfaceBuildMessage() string
- You can also send custom data by implementing the
- Basic Helpers for common tasks
- DTMF
- Call origination
- Call answer/hangup
- Audio playback
There are some buildable examples under theexample
directory as well
package mainimport ("context""fmt""github.com/percipia/eslgo""log")funcmain() {// Start listening, this is a blocking functionlog.Fatalln(eslgo.ListenAndServe(":8084",handleConnection))}funchandleConnection(ctx context.Context,conn*eslgo.Conn,response*eslgo.RawResponse) {fmt.Printf("Got connection! %#v\n",response)// Place the call in the foreground(api) to user 100 and playback an audio file as the bLeg and no exported variablesresponse,err:=conn.OriginateCall(ctx,false, eslgo.Leg{CallURL:"user/100"}, eslgo.Leg{CallURL:"&playback(misc/ivr-to_hear_screaming_monkeys.wav)"},map[string]string{})fmt.Println("Call Originated: ",response,err)}
package mainimport ("context""fmt""github.com/percipia/eslgo""time")funcmain() {// Connect to FreeSWITCHconn,err:=eslgo.Dial("127.0.0.1:8021","ClueCon",func() {fmt.Println("Inbound Connection Disconnected")})iferr!=nil {fmt.Println("Error connecting",err)return}// Create a basic contextctx,cancel:=context.WithTimeout(context.Background(),5*time.Minute)defercancel()// Place the call in the background(bgapi) to user 100 and playback an audio file as the bLeg and no exported variablesresponse,err:=conn.OriginateCall(ctx,true, eslgo.Leg{CallURL:"user/100"}, eslgo.Leg{CallURL:"&playback(misc/ivr-to_hear_screaming_monkeys.wav)"},map[string]string{})fmt.Println("Call Originated: ",response,err)// Close the connection after sleeping for a bittime.Sleep(60*time.Second)conn.ExitAndClose()}
About
A GoLang FreeSWITCH ESL Library
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
No packages published
Uh oh!
There was an error while loading.Please reload this page.
Contributors6
Uh oh!
There was an error while loading.Please reload this page.