Skip to content

iuridiniz/freeswitch_module_golang_sample

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

freeswitch_module_golang_sample

Sample module for FreeSWITCH using golang

tl; dr

git clone https://github.com/iuridiniz/freeswitch_module_golang_sample.git mod_hello_world
cd mod_hello_world
make && make install

fs_cli -x 'load mod_hello_world'
fs_cli -x 'hello my friend'

Requirements

Working gcc, golang, make and freeswitch with dev files.

Compiling

Just call make

make

Makefile will use a freeswitch compiled and installed in /usr/local/freeswitch, you can change by passing FREESWITCH_DIR=/path/to/your/freeswitch to make:

make FREESWITCH_DIR="/opt/freeswitch"

Also, this program will try to use go tool from your PATH, but you can change this by passing GO_BINARY=/path/to/your/go to make:

make GO_BINARY="/host/home/iuri/.local/opt/go-1.17.2.linux-amd64/bin/go"

Install

make install

Test

On fs_cli, call:

freeswitch@localhost> load mod_hello_world
freeswitch@localhost> hello golang

File Descriptions

  • fs.c: Contains C helper functions for interacting with FreeSWITCH.
  • fs.h: Header file for fs.c, defining the interface for the C helper functions.
  • mod_hello_world.go: The main Go source file for the FreeSWITCH module, containing the module's logic and interaction points with FreeSWITCH.

About

Sample module for FreeSWITCH using golang

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •