SIP Call loop problem

We are having a call loop problem for calls destined to a DID that exists on the local pbx.

An example of the scenario -
We have a PBX configured to accepting incoming calls for 15555555555, this PBX also has extension 100 configured on it. Out-going calls are routed through a SIP Proxy. If a call is placed to 15555555555 from the PSTN or another IP PBX the call is set up and completes fine. If extension 100 calls 15555555555 the INVITE is routed out to the SIP Proxy, which determines that the destination is the same PBX that it just received the request from and it relays it back. Asterisk then re-legs the call back out the SIP Proxy, and this continues causing an infinite loop. The only thing that stops the loop is the proxy hitting a memory limit and killing off the calls.

We are running Asterisk 1.4.22, and OpenSips 1.4.2 for the SIP Proxy. The Asterisk PBX and the SIP Proxy are on different networks that are routable to each other, and are not behind NAT.

This used to work, and I think an update to Asterisk may have changed something. Unfortunately we only recently became aware of this issue, which makes it hard to pinpoint when it was introduced. We do however have another PBX that is still running 1.4.17, and it behaves similarly for the outbound calling to a DID that exists on the local PBX, however Asterisk detects the loop that is caused and is then able to handle the call properly, which is not happening now.

I don’t think this is a dialplan issue, but something with how Asterisk is handling SIP. I have read over the documentation and could not find any
settings in sip.conf that might affect this.

The PBX’s that this is affecting are in a multi-tenant configuration, so ideally I would like the signaling to go through the proxy for accounting. However I would be happy if I could just get the calls to complete correctly.

Here is part of the call log from the PBX that is not working properly:
– Executing [dial-SIP@macro-tl-dialout-base:5] Dial(“SIP/105-jaynetest-b5f0cae0”, “SIP/13187519155@vocalser2|60”) in new stack
– Called 13187519155@vocalser2
[Dec 5 13:28:17] WARNING[3023]: chan_sip.c:2933 create_addr: No such host: 13187519155
[Dec 5 13:28:17] WARNING[3023]: chan_sip.c:2933 create_addr: No such host: 13187519155
[Dec 5 13:28:17] WARNING[3023]: chan_sip.c:2933 create_addr: No such host: 13187519155
[Dec 5 13:28:17] WARNING[3023]: chan_sip.c:2933 create_addr: No such host: 13187519155
[Dec 5 13:28:17] WARNING[3023]: chan_sip.c:2933 create_addr: No such host: 13187519155
[Dec 5 13:28:17] WARNING[3023]: chan_sip.c:2933 create_addr: No such host: 13187519155
-----does this for awhile------
== Spawn extension (macro-tl-dialout-base, dial-SIP, 5) exited non-zero on ‘SIP/105-jaynetest-b5f0cae0’ in macro ‘tl-dialout-base’
== Spawn extension (macro-tl-dialout-base, dial-SIP, 5) exited non-zero on ‘SIP/105-jaynetest-b5f0cae0’ in macro ‘tl-dialout-1-trunk’
== Spawn extension (macro-tl-dialout-base, dial-SIP, 5) exited non-zero on ‘SIP/105-jaynetest-b5f0cae0’
[Dec 5 13:28:17] NOTICE[3023]: chan_sip.c:14615 handle_request_invite: Unable to create/find SIP channel for this INVITE

And here is an example from the PBX that works on the older version of Asterisk:
– Executing [s@macro-dialout-trunk:20] Dial(“SIP/8256-b7b11488”, “SIP/vocalser/15854198256|300|W”) in new stack
– Called vocalser/15854198256
– Got SIP response 482 “Loop Detected” back from 208.34.86.40
– Now forwarding SIP/8256-b7b11488 to ‘Local/15854198256@from-pstn’ (thanks to SIP/vocalser-085bfb98)
– Executing [15854198256@from-pstn:1] Set(“Local/15854198256@from-pstn-d899,2”, “__FROM_DID=15854198256”) in new stack

Has anyone else run into this problem? Or know of a fix?

Thanks for any input.

Going to go read some change logs for awhile now.