linux-fax-stack/docker/t38modem/services/t38modem.sh

23 lines
613 B
Bash
Raw Normal View History

2024-12-20 14:53:12 +00:00
#!/usr/bin/env bash
PTTY=$(seq -f "+${1}-%g" -s "," "${T38MODEM_MODEM_COUNT}")
CMD=(
"t38modem"
"--ptty" "${PTTY}"
"--sip-proxy" "${T38MODEM_SIP_USERNAME}:${T38MODEM_SIP_PASSWORD}@${T38MODEM_SIP_SERVER}"
"--sip-register" "${T38MODEM_SIP_USERNAME}@${T38MODEM_SIP_SERVER},${T38MODEM_SIP_PASSWORD}"
"--sip-listen" "udp\$:5060"
"--stun" "${T38MODEM_STUN_SERVER}"
"--route" "t38:.*=sip:<dn>@${T38MODEM_SIP_SERVER}"
"--route" "sip:.*=t38:<dn>"
)
if [ "$T38MODEM_DISABLE_T38" = true ]; then
cmd+=("--disable-t38-mode" "--audio")
fi
CMD+=("${T38MODEM_CMD_ARGS}")
exec "${CMD[@]}"