How often does your IP change?
If the IP address changes as a result of the modem losing sync, any calls in progress will be dropped, even if you fix the firewall issue.
If line noise at your location is causing sync loss, fix your wiring / filter setup. If the trouble is in the outside plant, get your ISP to fix it.
With proper setup, a brief sync loss should not result in an IP address change. The modem should be set as a dumb bridge, with PPPoE (or whatever your ISP uses) done in the router.
If your knocking scheme will work with TCP, Tomato already has a built-in netcat. If you need UDP, you could build one or modify busybox. »
www.linuxquestions.org/q ··· -942766/If you have a constantly running PC, Mac or Linux box at your location, you could run a knocking script there.
Or, you could run a script on the PBX. For example, when your phones get flagged as unreachable (or periodically), it would check the dynamic DNS name of your phones and update iptables accordingly.