Created
December 2, 2019 20:38
-
-
Save mfrischknecht/da7c3c9f456289cd8a7bdc847f8806b1 to your computer and use it in GitHub Desktop.
Ring a SIP phone using pjsip
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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