In digging into the whole question of reinvites more, I have found a number of issues that relate. So here is what I have learned so far.
I have three incoming line accounts with Broadvoice. Registrations look like this in sip.conf:
register => 7075044511:passwd:7075044511@sip.broadvoice.com/7075044511
register => 7075044514:Npasswd:7075044514@sip.broadvoice.com/7075044514
register => 7029910135:passwd:7029910135@sip.broadvoice.com/7029910135
I have three peers set up for these three lines: also in sip.conf
[sip.broadvoice.com]
;context=from-broadvoice
type=peer
;user=phone
host=sip.broadvoice.com
fromdomain=sip.broadvoice.com
fromuser=7075044511
secret=Xpasswd
username=7075044511
insecure=very
authname=7075044511
dtmfmode=auto
dtmf=inband
;Disable canreinvite if you are behind a NAT
canreinvite=yes
[broadvoice2]
;context=from-broadvoice
type=peer
;user=phone
host=sip.broadvoice.com
fromdomain=sip.broadvoice.com
fromuser=7029910135
secret=passwd
username=7029910135
insecure=very
authname=7029910135
dtmfmode= auto
;dtmf=inband
;Disable canreinvite if you are behind a NAT
canreinvite=yes
[broadvoice3]
;context=from-broadvoice
type=peer
user=phone
host=sip.broadvoice.com
fromdomain=sip.broadvoice.com
fromuser=7075044514
secret=passwd
username=7075044514
insecure=very
authname=7075044514
dtmfmode=auto
dtmf=inband
;Disable canreinvite if you are behind a NAT
canreinvite=yes
When a call comes in on any of three lines, sip does a search by IP address (all three are the same) and matches to the last peer in the sequence. INthis case, line 7075044514. No matter which line the call comes in on, the channel is identified as 7075044514.
As far as canreinvite is concerned, only calls that actually come in on 7075044514 will accept a reinvite. Calls coming in on the other two lines simply hang up when they are answered (as soon as the reinvite is attempted). It appears that the reinvite is rejected because the wrong secret is returned. (the asterisk log shows authentication fails).
Two things about this behaviour don’t seem right to me.
First, it would seem that if the reinvite fails, asterisk should simply continue to handle the call through the server, rather than hanging up on the caller.
Second, there must be some way around this behaviour, but I can’t find it. I have tried setting the three peers to users, but in this case none of the inbound lines will reinvite. Not sure what is causing this. The only difference as far as the channel identifier is concerned is that the channel comes up as SIP/147.135.20.128 (that is the IP of the BV server originating the call).
Anybody has anything to add to this, it would be greatly appreciated.