Skip to content

Instantly share code, notes, and snippets.

@mfrischknecht
Created December 2, 2019 20:38
Show Gist options
  • Save mfrischknecht/da7c3c9f456289cd8a7bdc847f8806b1 to your computer and use it in GitHub Desktop.
Save mfrischknecht/da7c3c9f456289cd8a7bdc847f8806b1 to your computer and use it in GitHub Desktop.
Ring a SIP phone using pjsip
#!/usr/bin/env bash
target_number="$1"
user="<sip_user>"
password="<sip_password>"
registrar="fritz.box"
sound_file="/path/to/sound_file.wav"
duration=20 #in seconds
( sleep $duration; echo q ) \
| pjsua \
--id "sip:$user@$registrar" \
--registrar "sip:$registrar;transport=tcp" \
--realm "$registrar" \
--username "$user" \
--password "$password" \
--local-port 5061 \
--null-audio \
--auto-play --play-file "$sound_file" \
"sip:$target_number@$registrar"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment