[Asterisk-Dev] [BUG?] chan_sip, RFC 3261 and multiple UACs registering for one account

Hartwig Deneke hdeneke at web.de
Sat Aug 27 10:33:28 MST 2005


Dear Asterisk Dev Community,

I have spend some time trying to understand an issue which has
frequently come up on the Asterisk users mailing list, see references to
the bounty at voip-info.org[1] and several links to the mail archive[2]-[5].

My observations: I have a SIP Account at a VoIP provider (who is using
Asterisk). I am using a Sipura SPA2000 device (two phone device). If I
enter the same account information (only the SIP port differs), both
lines seem to register successfully, and can make outgoing calls.
However, incoming calls only get to the phone which registered last. It
is even more annoying if I want to make a quick phone-call from on a
hotspot using my notebook, as the registration will point to the
(possibly long disconnected) notebook (as a workaround, one can turn of
registration by the softphone, even though this is not always possible).

The usual response to this issue from the devlopers seems to be pretty
much along the lines of [5]
>Many people seem to want this feature.  I think they are just
>confused.

I think this reply is ignorant of the SIP standard, and hope to convince
you of this.

See RFC 3261, Section 10.2.1 Adding Bindings
>The REGISTER request sent to a registrar includes the contact
>address(es) to which SIP requests for the address-of-record should be
>forwarded.  The address-of-record is included in the To header field
>of the REGISTER request.
(...snip...)
>Once a client has established bindings at a registrar, it MAY send
>subsequent registrations containing new bindings or modifications to
>existing bindings as necessary.  The 2xx response to the REGISTER
>request will contain, in a Contact header field, a complete list of
>bindings that have been registered for this address-of-record at this
>registrar

Using sipsak, see http://sipsak.org, using the commands

bash> sipsak  -vvv -x 3600 -U -C 'sip:phone1 at somedomain.dyndns.org' -a
$pwd -s sip:$sipaccount@$sipprovider
followed by
bash>sipsak  -vvv -x 3600 -U -C 'sip:phone1 at somedomain.dyndns.org' -a
$pwd -s sip:$sipaccount@$sipprovider

The following contact header is then found in the reply, which shows
that the first registration is lost:
Contact: <sip:phone2@$somedomain.dyndns.org>;expires=3600


Hence, this explains the behavior I described in the beginning and seems
to violate the requirements of RFC 3261, unless I am totally confused.
According to the RFC, the location of all UA  for an address of record
should be returned. So if in the situation given above, once the
notebook removes its registration, the previous location could be
restored. However, I also think that it would be reasonable to that all
UA are contacted upon a SIP Invite. However, the RFC does not seem too
clear about this, but I think Section
16.6, Request Forwarding, is appicable

>As soon as the target set is non-empty, a proxy MAY begin forwarding
>the request.  A stateful proxy MAY process the set in any order.  It
>MAY process multiple targets serially, allowing each client
>transaction to complete before starting the next.  It MAY start
>client transactions with every target in parallel.  It also MAY
>arbitrarily divide the set into groups, processing the groups
>serially and processing the targets in each group in parallel.

While I do not know the version of Asterisk my VoIP provider uses, I did
check with the chan_sip source from the development version, and nothing
seems to have changed in this respect.

So what should be the behavior:
1. Optimal solution
-store multiple locations
-parallel forking of SIP message to multiple locations, if multiple user
locations are available

2. Half-Way Solution
-at least store all user locations, and try to contact them serially,
until a valid contact is found.

3. Lazy Solution
-to prevent overwriting of valid user locations, dis-allow all new
registrations while a user location is still valid. This might cause
some problems if a registration has gone stale, however.

Do you agree that this behavior is a violation of the SIP RFC? Which of
the proposed solutions would be acceptible? If time permits, I could
possibly work on a solution, but do not want to waste my time if there
is no consensus whether any of this is acceptible.

Thanks,
Hartwig


[1]http://voip-info.org/tiki-index.php?page=Asterisk+bounty+SIP+simultaneous+registry
[2]http://lists.digium.com/pipermail/asterisk-users/2004-February/037284.html
[3]http://lists.digium.com/pipermail/asterisk-users/2004-July/054106.html
[4]http://lists.digium.com/pipermail/asterisk-users/2005-August/119252.html
[5]http://lists.digium.com/pipermail/asterisk-users/2005-August/119394.html




More information about the asterisk-dev mailing list