Just guessing, your provider can send calls from multiple IP addresses. They send first from an address that Asterisk doesn’t recognize, so it asks for authentication. After several retries, the provider gives up and attempts to resend from a different IP, which Asterisk does recognize and the call goes through.
If the above is correct, the solution is to edit Match/Permit for the trunk to include all the addresses from which the provider can send calls.
That got rid of the notices adding the providers IP ranges. But that line now always goes to VM ?
What I have is an inbound route going to a ring group with one extension.That group has it’s ‘Destination if no answer’ to ‘call flow control’ to VM or back to that extension. However, when I dial in that group goes instantly to VM (even setting CFC back to the extension). It does the same if I set the ring group to that extension too, the extension appears to be ok when ringing it directly.
The repeated notices are all for the same provider IP btw.
Basically it appears to really screw it up adding the providers IP ranges to Match/Permit for that provider. I removed them and it’s all back to normal with a ringing phone, I’ll ignore the notices for now I think !
Again just guessing, when the provider sends from the other server, the called number or caller number is formatted differently, so your routing logic treats the call differently. Another possibility is you have configured some type of failover at the provider (routing calls via a different number or provider).
But there is no need to guess. Temporarily set Match/Permit to allow all their IP addresses. At the Asterisk command prompt, type pjsip set logger on
make a test call in (that incorrectly goes to VM), paste the Asterisk log for the call (redacted as desired) at pastebin.com and post the link here. Then take the Match/Permit setting back out until we can find what is going wrong.