I am an expereinced computer engineer in VOIP esp. Asterisk, i have configured many voip gateways in asterisk. reading you problem, it can be some problem with the networking or the asterisk.
This problem can be solved by just troubleshooting in the asterisk by turning on the debugging mode.
I can really help you solve the problem, trust my words.
Thanking you,
With Regards,
Pramod