Too Many Hops from outbound SIP proxy

I am trying to use a commercial SIP/PSTN gateway together with Asterisk and XLite as a SIP client. The gateway seems to work fine when registrating for both incoming and outgoing calls. However, when trying to use XLite to dial out through the gateway I get the error

SIP/2.0 483 Too Many Hops

As I understand it, this is because the SIP header Max-Forwards has been exceeded.

Conecting to the gateway directly using XLite works just fine. I am certain the gateway (running Hotsip) is interoperable with Asterisk. (The company uses Asterisk and SIP for implementing a commercial VoIP PBX service.)

While searching on the internet I found the following bug:
lists.digium.com/pipermail/aster … 01114.html

The bug report seems to be quite old but still, the Max-Forwards header does seem to be missing from the SIP debug messages below… It looks like the bug has been fixed:

[bugs.digium.com/view.php?id=5474](http://bugs.digium.com/view.php?id=5474)

I am using Debian and have tried Asterisk from the stable, testing and unstable distributions. The latest version tried is

1.2.0 and judging by the release dates the fix should be included. (It is not in the changelog however.)

Could this bug be the cause of the my problems? Or am I on the wrong track? Any ideas?

Sincerly,

Kris

– SIP Log –

Sip read:
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 123.123.123.123:5060;branch=z9hG4bK3fb3744c
To: sip:6512436@outbound.provider.com
From: “A User” sip:user@123.123.123.123;tag=as06c4d36d
Call-ID: 21c3cdd13cddbf553f55fdc934ff78c2@123.123.123.123
CSeq: 102 INVITE
Server: sapphire/1.6.2.0253
Content-Length: 0

8 headers, 0 lines

Sip read:
SIP/2.0 483 Too Many Hops
Via: SIP/2.0/UDP 123.123.123.123:5060;branch=z9hG4bK3fb3744c
To: sip:6512436@outbound.provider.com
From: “A User” sip:user@123.123.123.123;tag=as06c4d36d
Call-ID: 21c3cdd13cddbf553f55fdc934ff78c2@123.123.123.123
CSeq: 102 INVITE
Server: sapphire/1.6.2.0253
Content-Length: 0

– sip.conf –

[general]
context=internal
realm=dom.com
port=5060
bindaddr=0.0.0.0
srvlookup=yes
nat=yes

[provider-out]
type=peer
secret=very
username=user
fromuser=user
host=outbound.provider.com

I probably should have included the relevant part of extensions.conf

[internal] exten => _.,1,Answer() exten => _.,2,Dial(SIP/${EXTEN}@provider-out,,r)

The idea is that the number dialled should be sent to the SIP/PSTN-gateway. This seems to work just fine only I get the “Too Many Hops” error from the gateway.

This is more and more looking like a bug to me. As I understand it I am actually trying to use Asterisk as a SIP client when dialling the provider-out SIP proxy but Asterisk is not adding the (required?) SIP header “Max-Forwards” to the SIP message.

Maybe I should post this to the Devel list instead?

/Kris