Compare commits

..

No commits in common. "9ddb54d319151fd43a9836fe0c030645f487d381" and "c07cb297e32eb0aec722df023c23f561426a0008" have entirely different histories.

5 changed files with 69 additions and 87 deletions

Binary file not shown.

View File

@ -1 +1 @@
<sip:yellow@probablycorey.sip.twilio.com>;auth_pass=zgm-kwx2bug5hwf3YGF;unregister_on_exit=yes
<sip:yellow@probablycorey.sip.twilio.com;transport=tls>;auth_pass=zgm-kwx2bug5hwf3YGF;unregister_on_exit=yes

View File

@ -1,26 +1,75 @@
call_max_calls 4
#
# baresip configuration
#
#------------------------------------------------------------------------------
# Core
poll_method epoll # poll, select, epoll ..
# Call
call_local_timeout 120
call_max_calls 4
# Audio
audio_player alsa,default
audio_source alsa,default
audio_alert alsa,default
audio_alert none
audio_alert_enable no
audio_level no
ring_aufile /dev/null
ausrc_format s16 # s16, float, ..
auplay_format s16 # s16, float, ..
auenc_format s16 # s16, float, ..
audec_format s16 # s16, float, ..
audio_buffer 20-160 # ms
# AVT - Audio/Video Transport
rtp_tos 184
rtcp_mux no
jitter_buffer_delay 5-10 # frames
rtp_stats no
# Modules
#------------------------------------------------------------------------------
# Modules
module_path /usr/lib/baresip/modules
# Audio codec Modules
# UI Modules
#module stdio.so
# Audio codec Modules (in order)
module g711.so
# Audio driver Modules
module alsa.so
# Application Modules
module_app account.so
module_app menu.so
# Media NAT modules
module stun.so
module turn.so
module ice.so
# STUN Server
stun_host stun.l.google.com
stun_port 19302
module httpd.so
#------------------------------------------------------------------------------
# Temporary Modules (loaded then unloaded)
module uuid.so
module account.so
#------------------------------------------------------------------------------
# Application Modules
module_app contact.so
module_app debug_cmd.so
module_app menu.so
http_listen 0.0.0.0:8000 # httpd - HTTP Serve

View File

@ -73,12 +73,9 @@ export class WaitingSounds {
log(`🛑 Stopping waiting sounds. Has typingPlayback: ${!!this.typingPlayback}`)
if (!this.typingPlayback) return
// Quicky undefine this to stop the loops
const typingPlayback = this.typingPlayback
this.typingPlayback = undefined
await Promise.all([typingPlayback.stop(), this.speakingPlayback?.finished()])
await Promise.all([this.typingPlayback.stop(), this.speakingPlayback?.finished()])
log("🛑 Waiting sounds stopped")
this.typingPlayback = undefined
}
}

View File

@ -1,64 +0,0 @@
#!/bin/bash
# Test script to call the Pi's baresip every 5 minutes
# This will help verify the NAT connection stays alive
ACCOUNT_SID="AC1290bf86af061f24406c6762f48fa24e"
AUTH_TOKEN="6bfac57e5e26ea52c841594ef8d99ed1"
FROM_NUMBER="+13476229543"
TO_SIP="sip:yellow@probablycorey.sip.us1.twilio.com"
LOG_FILE="baresip-test-results.log"
echo "=== Baresip Call Test Started at $(date) ===" | tee -a $LOG_FILE
echo "Will call every 5 minutes. Press Ctrl+C to stop." | tee -a $LOG_FILE
echo "" | tee -a $LOG_FILE
call_count=0
while true; do
call_count=$((call_count + 1))
echo "[$(date)] Test call #$call_count" | tee -a $LOG_FILE
# Make the call
CALL_SID=$(curl -s -X POST "https://api.twilio.com/2010-04-01/Accounts/$ACCOUNT_SID/Calls.json" \
-u "$ACCOUNT_SID:$AUTH_TOKEN" \
--data-urlencode "Url=http://demo.twilio.com/docs/voice.xml" \
--data-urlencode "To=$TO_SIP" \
--data-urlencode "From=$FROM_NUMBER" \
| jq -r '.sid')
echo " Call SID: $CALL_SID" | tee -a $LOG_FILE
# Wait for call to complete
sleep 10
# Check status
STATUS=$(curl -s "https://api.twilio.com/2010-04-01/Accounts/$ACCOUNT_SID/Calls/$CALL_SID.json" \
-u "$ACCOUNT_SID:$AUTH_TOKEN" \
| jq -r '.status')
echo " Status: $STATUS" | tee -a $LOG_FILE
# Check for errors
ERROR=$(curl -s "https://api.twilio.com/2010-04-01/Accounts/$ACCOUNT_SID/Calls/$CALL_SID/Notifications.json" \
-u "$ACCOUNT_SID:$AUTH_TOKEN" \
| jq -r '.notifications[0].error_code // "none"')
if [ "$ERROR" != "none" ]; then
echo " ❌ ERROR: $ERROR" | tee -a $LOG_FILE
ERROR_MSG=$(curl -s "https://api.twilio.com/2010-04-01/Accounts/$ACCOUNT_SID/Calls/$CALL_SID/Notifications.json" \
-u "$ACCOUNT_SID:$AUTH_TOKEN" \
| jq -r '.notifications[0].message_text')
echo " Message: $ERROR_MSG" | tee -a $LOG_FILE
elif [ "$STATUS" = "no-answer" ] || [ "$STATUS" = "completed" ]; then
echo " ✓ Success" | tee -a $LOG_FILE
else
echo " ⚠ Unexpected status: $STATUS" | tee -a $LOG_FILE
fi
echo "" | tee -a $LOG_FILE
# Wait 5 minutes (minus the 10 seconds we already waited)
echo " Waiting 5 minutes until next call..." | tee -a $LOG_FILE
sleep 290
done