As far as I can fathom, ser recieves an INVITE forwarded/routed from the gateway, then ser requests auth/cred, then gateway responds with an ACK and at that point everything just stops.
Maybe you should not request auth/cred when the INVITE comes from the IP of the gateway. I would suspect the gateway is unable to provide credentials. You can use the trusted table to add the IPs of those gateways that you "trust". For example the below code snippet with only ask for credentials when the source IP is not in the trusted table.
if (method=="INVITE" & !allow_trusted()) { if (!proxy_authorize( "yourrealm" /* realm */, "subscriber" /* table name */)) { proxy_challenge( "yourrealm" /* realm */, "0" /* no qop */ ); break; };
Assistance is much appreciated, as I'm unable to determine what may be causing the issue.