Summary:ASTERISK-06547: Reinvite failures
Reporter:Bill Neely (billn)Labels:
Date Opened:2006-03-14 18:36:00.000-0600Date Closed:2006-05-31 08:52:53
Versions:Frequency of
Environment:Attachments:( 0) sip-bv.txt
Description:Reinvites are issued by asterisk after a connection is made. The purpose is to route the actual voice traffic directly from user to user without going through the asterisk server.

There is a known issue (5177) which identifies a problem with authenticating two or more different trunks originating from the same IP on an asterisk server. For inbound calls, asterisk always uses the first set of paramaeters in memory (the last one in the sip.conf file). When the reinvite is issued, asterisk provides the authentication parameters of the first one in memory, and, unless this happens to match the trunk of the inbound call, the reinvite fails for bad authentication parameters.

The effect of this is that on an asterisk server with multiple inbound trunks from the same provider, the reinvites will fail for all but the credentials last in the sip.conf. So, the practical solution to this is to turn off  canreinvite throughout the system. This forces all of the voice traffic through the asterisk server. 15-20 concurrent calls will easily max out a T1. This makes it extremely hard to build a large asterisk installation with multiple trunks and hundreds of extensions.

A worse effect is that when a reinvite fails on an inbound call, asterisk does not fall back to the canreinvite=no condition. It simply terminates the call. If at least this behaviour could be changed until 5177 is resolved, the canreinvites could be left on, and those authenticated would reroute off server and those that didn't auth would have to route through the server.
Comments:By: Olle Johansson (oej) 2006-03-15 02:19:49.000-0600

Please read the bug guidelines. This is not a bug in the "Applications/general category", I am guessing it's about SIP. If it is about SIP, please follow the guidelines and attach a SIP debug trace of a failed call.


By: Olle Johansson (oej) 2006-03-15 02:29:09.000-0600

Please check out the branch "test-this-branch" and test the new functions for sip registration and peer matching.

By: Bill Neely (billn) 2006-03-16 13:25:41.000-0600

I'll run the test branch and let you know. If it is a no-go, I'll compile and run a back trace for you.

By: Bill Neely (billn) 2006-03-16 14:43:21.000-0600

I'm a little slow. What is the svn command to get that branch.
svn checkout http://svn.digium.com/svn/asterisk/branches/test-this-branch dosn't seem to be right

By: Bill Neely (billn) 2006-03-16 14:48:02.000-0600

NeverMind. Found it under oej

By: Bill Neely (billn) 2006-03-17 13:24:57.000-0600


Having some trouble getting register on Broadvoice with :"test-this-branch". I have been testing with BV, since I happen to have multiple trunks with them. The registration process with BV has always been something of a mystery to me. They appear to have a separate registration server (located by DNS):

Name:    proxy.dca2.broadvoice.com
Aliases:  sip.broadvoice.com

and a proxy server (located by entry in the /etc/hosts file)

Somehow asterisk sorts all of this out and manages to register for inbound calls using the following:

register => 7029910135:passwd:7029910135@broadvoice2/broadvoice2



dtmfmode= auto

I have been trying to get similar statemens to work with "test-this-branch", but I am not able to get BV to register and find the asterisk server for inbound calls.

I have tried several versions of the register statement:

register => 7029910135:passwd:7029910135@broadvoice2/broadvoice
register => 7029910135@sip.broadvoice.com:passwd:7029910135@broadvoice2/broadvoice
register => 7029910135:passwd:7029910135@sip.broadvoice.com/broadvoice

but, so far, I have been unable to convice the BV server that we are online and able to receive incoming calls. Unfortunately, nothing ever arrives at the asterisk server, so there is no useful log info to add. Maybe if you look at the code, you can see how asterisk sorts out the proxy server from the reg server and makes it all happen.

Happy to run any test that you specify.

By: Olle Johansson (oej) 2006-03-27 17:53:14.000-0600

Testing this with a broadvoice account myself... Hang on.

By: Spencer Ryan (sryan2k1) 2006-04-03 22:21:46

I just attached a debug from my server, With asterisk 1.2.4 a single inbound/outbound line worked fine with reinvites on, I changed no settings when going from the version of asterisk I was using to your version, when calling either of the numbers Broadvoice plays a message saying all numbers are busy or not responding (or something like that)

I noticed it's matching the peer correctly (at least it says it in bvout-1022 is the correct peer for that numeber)

The asterisk box never picks it up, I hope that helps!

By: Serge Vecher (serge-v) 2006-05-04 10:11:31

sryan2k1: please test Olle's test-this-branch at links above and report your results. Thanks!

By: Joshua C. Colp (jcolp) 2006-05-04 10:30:33

The SIP debug you provided shows that Asterisk is requesting Broadvoice to authenticate, which it can't. Can you please attach the sip.conf entry for bvout-1022? Thanks.

By: Olle Johansson (oej) 2006-05-17 12:14:00

We are waiting for a reply on joshnet's request. Thank you.

By: Serge Vecher (serge-v) 2006-05-31 08:52:52

Closing due to no response from either billn or sryan2k1. If the problem persists in latest trunk or test-this-branch, please feel free to reopen with requested debugging information. Thank you.