Failed to authenicate on invite (dial cmd)

I recently upgraded to asterisk 1.4.2 because of the following problem, but was forced to go back to asterisk 1.2.13 because MOH wasn’t working when used in the dial command.

The problem on asterisk 1.2.13 is this:

I have dial() in extensions.conf to dial out to my home landline and mobile from my server:

exten => _X.,4,Dial(SIP/enginout/0882425603&SIP/enginout/0423289232,45,m(default))

When I dial the number for the incoming voip trunk from an external telephone it answers fine then initiates the command above, both my landline and my mobile ring, but when I answer either of them both the calling party and myself are disconnected and the following error is displayed:

– Attempting native bridge of SIP/202.61.14.137-08194000 and SIP/enginout-086d6000
Apr 18 15:54:21 NOTICE[72350]: chan_sip.c:9810 handle_response_invite: Failed to authenticate on INVITE to ‘sip:0884640161@voice.mibroadband.com.au;tag=as6557605d’

This problem isn’t present in 1.4.2 but because moh doesn’t work in the dial command it’s useless.

The configurations for sip.conf, musiconhold.conf and extensions.conf are the same for both versions. One has one problem the other has another problem so I’ve posted both issues on the forum in seperate posts and hope I get a solution for at least one of them.

Tried googling both the issues extensively and got nothing for either.

Kind Regards,

Jay

Do you both register and auth? Posting relevant portions of sip.conf still helps. It’s not obvious why you requested one number and the error message concerns another.

0884640161 is the incoming number from the SIP trunk (number causing the problem)

0882425603 is the landline i am trying to dial using the dial command

Here is the relevant section of my sip.conf (incoming voip trunk):

[enginin]
type=user
fromdomain=voice.mibroadband.com.au
host=mel.byo.engin.com.au
username=0884640161
secret=********
context=default
canreinvite=no
insecure=very

sip.conf ([general]):

[general]
srvlookup=yes
context=default ; Default context for incoming calls
host=intel-scb2.corra.com.au
bindport=5060 ; UDP Port to bind to (SIP standard port is 5060)
rtpstart=9999
rtpend=20001
dtmfmode=rfc2833
musiconhold=default
musicclass=default
disallow=all
allow=alaw
allow=ulaw
maxexpirey=3600
defaultexpirey=600
register => 0884640161:*****@byo.engin.com.au/0884640161

extensions.conf incoming-sip dialplan:

[default]
exten => _X.,1,Ringing()
exten => _X.,2,Wait(1)
exten => _X.,3,Answer()
exten => _X.,4,Dial(SIP/enginout/0882425603,50,m(default))
exten => _X.,5,Goto(mainmenu,s,1)

Thanks for your help valley.
[/quote]

You only showed [enginin] in sip.conf, but it’s [enginout] that we are looking at, right?

The reason I didn’t show enginout was because if I call the [default] context from an internal extension and answer from the landline or mobile it works fine.

The only time that it comes up with the error is when the call is coming through enginin. If enginout is relevant see below:

[enginout]
type=peer
callerid=“Corra” <0884640161>
realm=mobileinnovations.com.au
fromdomain=voice.mibroadband.com.au
username=0884640161
fromuser=0884640161
host=mel.byo.engin.com.au
secret=*******
qualify=no
insecure=very
disallow=all
allow=alaw
allow=ulaw
allow=gsm
musiconhold=default
dtmfmode=rfc2833
canreinvite=no
port=5060
context=outgoing

Remember that this config works on asterisk 1.4.2 (can’t use because of an unrelated issue though) Thanks for your ongoing help valley.

This looks to me like an outbound authentication issue. (Don’t know how it works in 1.4.) Try add

auth=0884640161:*******@mobileinnovations.com.au

in [enginout].

Thanks for the suggestion, tried that and get exactly the same error. The reason I think this is an [enginin] issue is that If I dial from an internal extension (xlite connected to asterisk):

[1000]
type=friend
nat=yes
host=dynamic
username=1000
secret=********
dtmfmode=rfc2833
mailbox=1000
callerid=“Corra” <0884640161>
disallow=all
allow=alaw
allow=ulaw
context=outgoing

Then the call goes through sucessfully when I answer:

– Executing Dial(“SIP/1000-086d6000”, “SIP/enginout/0882425603&SIP/enginout/0423289232|50|m(default)”) in new stack
– Called enginout/0882425603
– Called enginout/0423289232
– Started music on hold, class ‘default’, on SIP/1000-086d6000
– SIP/enginout-086df000 is making progress passing it to SIP/1000-086d6000
– SIP/enginout-086df000 answered SIP/1000-086d6000

The only time the error occurs is when the call comes in through [enginin].

Can you please post your xlite softphone proxy/domain settings.

Thanks,
suresh

My X-lite configuration is just the standard extension username and password and ip address of my asterisk box.

Please note that I have tried with SPA-3000 ATA and Billion 7401VGPM modems and they have both dialed the external landline and mobile through SIP trunk without an issue.

Because of this I’m pretty sure [enginin] in sip.conf is causing the problems I have described.

Are you sure you are allowed to have more than one concurrent calls? If this is a residential kind of offer, they may limit your concurrent calls to 1.

This is what I initially thought but I signed up with another SIP provider and routed the calls out that provider and still picked up the same error from the [enginin] side.

Also as I’ve stated before, the same configuration works fine in asterisk 1.4.2.

Cheers,

Jay

You are right. Why would Asterisk - or any party, want to INVITE sip:0884640161@voice.mibroadband.com.au at this stage?

Two suggestions. One is a comprehensive comparison between 1.2 and 1.4. Enable sip debug in both, remove MOH from both. Just compare how SIP messages fly. If identical, this would indicate a bug in 1.2.

The other is take out username/secret from enginin. See if anything changes.

Thanks Valley. I deleted username and secret from [enginin] and the call never gets answered (which is what I would expect considering it hasn’t authed). For my next step I might try installing Asterisk 1.2 on a linux machine instead of freebsd and see if that works. Thanks for your suggestions.

Cheers,

Jay

I had a similar problem when downgrading from Asterisk 1.4 to 1.2 to be able to Ubuntu 6.06 LTS builds. When I set up Asterisk 1.2, all my incoming calls failed with the same “Failed to authenticate on INVITE” error.

After numerous hours of trying … it turned out this strange INVITE is actually a re-INVITE caused by my Dial( ) script. That suggests that some where the canreinvite is “true”. Since Asterisk 1.2 has this very confusing concept of user/peer/friend and a very messy configuration overall, it’s almost impossible to know for sure whether a setting is actually applied in any given scenario.

So, to make sure canreinvite is set to ‘no’, I just add it to the general section in sip.conf (in 1.2):

[general]
canreinvite=no

Try this and see if it fixes your problem. If you don’t want to set it for all cases, I still suggest you set no as default and set yes to only special cases.

Hope this helps.