Skip to content
/ gophone Public

Gophone CLI SIP phone powered by SIPGO

License

BSD-2-Clause, Unknown licenses found

Licenses found

BSD-2-Clause
LICENSE
Unknown
LICENSE-THIRD-PARTY.md
Notifications You must be signed in to change notification settings

emiago/gophone

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 

Repository files navigation

SIPGO

GOPHONE is single binary CLI SIP Softphone written in GO and powered by sipgox and sipgo

gophone dial -media=audio sip:[email protected]:5060

NOT Open Source, but most of code is on libraries mentioned with exception for some some audio processing and media setup. This also shows power of this libs. It is mainly developed for simple automated testing purpose.

Any feature/bug or supporting this is open for discussion, but for now development time/focus is more on libraries.

Cross Platform builds:

For audio it expected you have some preinstalled libraries.

Major features:

  • 3 actions: Dial, Answer or Register
  • Media IO control: speaker, mic, file
  • RTP statistics during call
  • Offline Speech To text Transcription of phone call using whisper models
  • Provides also json type output for easier filtering and post verification

Roadmap/Features:

  • Use flags to automate call scenario of one endpoint
  • Dial Answer Register
  • Media encoders: ulaw, alaw
  • Media IO: rtp logging, speaker, microphone
  • RTP stats: packets, packet loss, talking/silence
  • Different responses NoAnswer,Busy
  • Offline Speech To text Transcription for output.
  • Offline Speech To text Transcription for input
  • Sending DTMF rfc4733 with delay control
  • Simple INTERACTIVE mode Commands via STDIN
  • BlindTransfer automation as subcommand of dial/answer
  • AttendedTransfer automation as subcommand of dial/answer
  • Recording audio for easier visiting later
  • Better events logging in Structured logging for easier JSON verification.
  • Logging SIP traces to file
  • Loadtest examples

Quick start

Install

gophone is single binary so you only need to download and run it.

You can Download from here or here quick links

Usage

$>gophone -h
Usage of gophone command:

Commands:
  dial          Dial destination.
  answer        Answer call
  register      Send register request only without answer.

  -t string
    	Transport udp|tcp|tls|ws|wss (default "udp")

Enviroment variables:
  LOG_LEVEL=debug|info|error            Log level for output. Default=info
  LOG_FORMAT=json|console               Log format for output. Default=console
  LOG_NOCOLOR                           Disable color
  SIP_DEBUG                             LOG SIP traffic. Used with LOG_LEVEL=debug
  RTP_DEBUG                             LOG RTP traffic. Used with LOG_LEVEL=debug
  RTCP_DEBUG                            LOG RTCP traffic. Used with LOG_LEVEL=debug
  GOPHONE_MEDIA=<same as -media>        Sets default media in case of calls


gophone is CLI SIP softphone powered by sipgo library.
To find more information about tool and licences visit
https://github.com/emiago/gophone

Answer:
gophone answer -l 127.0.0.200:5060 
gophone answer -l 127.0.0.200:5060 -code 486 -reason Busy

Answer with register:
gophone  answer -ua alice -username alice1234 -password 1234 -register "127.0.0.1:5060"

Dial:
gophone dial sip:[email protected]:5060
gophone dial -sipheader="X-AccountId:test123" sip:1234@server:5060

Register:
gophone register -username=sipgo -password=1234 127.0.0.1:5060 

With digest authentication:
gophone dial -ua alice -username=alice1234 -password=1234 "sip:echo@server:5060"

With media:
gophone dial -media=audio sip:1234@localhost:5060
gophone dial -media=mic sip:1234@localhost:5060
gophone answer -media=speaker

With transcribe:
gophone dial -media=log -transcribe sip:1234@localhost:5060

With DTMF:
gophone dial -dtmf=79 -dtmf_delay=8s -dtmf_digit_delay=1s -media=speaker sip:1234@localhost:5060

With INTERACTIVE mode:
echo "wait=3s; dtmf=123; hangup;" | gophone dial -i -media=speaker sip:[email protected]:5060

Output example

Running a full call and transcription output at end.

output with transcription

Using jq and json format to verify output

Using json allows some post verification for your call setup.

output with jq filtering

Useful filtering

gophone ... | jq 'select(.caller=="Dial" and .event=="SIP")'
gophone ... | jq 'select(.caller=="Dial" and .event=="DialogState")'

Media Testing with transcriber

CALLTRANSCRIPTION=$(LOG_FORMAT=json gophone dial -transcribe sip:[email protected] \
    | jq -r 'select(.caller=="Transcriber" and .text != null) | .text')

test "Please enter your PIN. Your answer is, 1234." = $CALLTRANSCRIPTION

MacOS malware detect

gophone CLI tool is not signed by Apple Developer Program and may be shown as Malware by your Gatekeeper. This is something Apple started to require on newer OS (From Catalina v10.15). FYI: in order to sign binary Apple requires annual payment. This project is not yet sponsored or had requirement todo so.

For allowing unsigned CLI tool to run here are some articles to check.

About

Gophone CLI SIP phone powered by SIPGO

Resources

License

BSD-2-Clause, Unknown licenses found

Licenses found

BSD-2-Clause
LICENSE
Unknown
LICENSE-THIRD-PARTY.md

Stars

Watchers

Forks

Packages

No packages published