[Devel] registrar/usrloc issue

Ovidiu Sas sip.nslu at gmail.com
Wed Mar 7 15:41:02 CET 2007


Hi Bogdan,

Thank you for double checking :-)
I didn't wait for the binding to expire and therefore I didn't notice
the second issue.


Regards,
Ovidiu Sas

On 3/7/07, Bogdan-Andrei Iancu <bogdan at voice-system.ro> wrote:
> Hi Ovidiu,
>
> the DB constrain was relaxed - "callid", "cseq" and "received" fields
> may vary and it is complicated (and useless) to get a unique DB
> constrain - this is already done by the usrloc module.
> So, I replaced the "unique" with an "index". It should work now.
>
> Your report also revealed a bug in usrloc module - for identifying a
> contact at update/delete DB ops, the module was using only AOR+contact,
> pair which is insufficient. In your case, let's say the insert was
> successful; when the old contact expired, the delete DB query will
> actually erased both DB record (as they have same AOR ad contact).
> So, the callid is also used as contact record identifier (as it is
> constant across the contact lifetime).
>
> regards,
> bogdan
>
> Bogdan-Andrei Iancu wrote:
> > most probably...along with received to avoid duplicity due NATs...
> >
> > regards,
> > bogdan
> >
> > Ovidiu Sas wrote:
> >> how about cseq?
> >>
> >> Let's say the network is down and the phone is trying to register.
> >> The registration will time out and the cseq will increase.
> >> The username, domain, contact and callid will remain the same and as a
> >> result the db update will fail.
> >>
> >>
> >> Regards,
> >> Ovidiu Sas
> >>
> >> On 3/6/07, Bogdan-Andrei Iancu <bogdan at voice-system.ro> wrote:
> >>> Hi Ovidiu,
> >>>
> >>> This comes from the DB table constrains:
> >>>     UNIQUE KEY udc_loc (username, domain, contact)
> >>>
> >>> I guess callid must be also added.
> >>>
> >>> regards,
> >>> bogdan
> >>>
> >>> Ovidiu Sas wrote:
> >>> > Hi,
> >>> >
> >>> >
> >>> > If I have a user registered and I try to re-register the same user on
> >>> > top of the existing registration, I have the following error:
> >>> >
> >>> > submit_query: Duplicate entry
> >>> > 'line-6--sip:line-6 at 192.168.2.102:5060;transport=udp' for key 2
> >>> > db_insert: Error while submitting query
> >>> > db_insert_ucontact(): Error while inserting contact
> >>> > ERROR:usrloc:insert_ucontact: failed to insert in database
> >>> >
> >>> > The in memory location table is showing two registrations, but the
> >>> > location database is not updated:
> >>> >        AOR:: line-6
> >>> >                Contact::
> >>> sip:line-6 at 192.168.2.102:5060;transport=udp Q=
> >>> >                        Expires:: 575
> >>> >                        Callid::
> >>> > 00036be7-b1240007-7f2e7bf5-340423fb at 192.168.2.102
> >>> >                        Cseq:: 530
> >>> >                        User-agent:: Cisco-CP7960G/8.0
> >>> >                        State:: CS_SYNC
> >>> >                        Flags:: 0
> >>> >                        Cflag:: 0
> >>> >                        Socket:: udp:192.168.2.22:5060
> >>> >                        Methods:: 4294967295
> >>> >                Contact::
> >>> sip:line-6 at 192.168.2.102:5060;transport=udp Q=
> >>> >                        Expires:: 3584
> >>> >                        Callid::
> >>> > 00036be7-b1240007-2af7c4c8-77777b7e at 192.168.2.102
> >>> >                        Cseq:: 102
> >>> >                        User-agent:: Cisco-CP7960G/8.0
> >>> >                        State:: CS_SYNC
> >>> >                        Flags:: 0
> >>> >                        Cflag:: 0
> >>> >                        Socket:: udp:192.168.2.22:5060
> >>> >                        Methods:: 4294967295
> >>> >
> >>> > If I restart openser, I will loose the second binding due to the fact
> >>> > that was not saved into the database.
> >>> >
> >>> > '/opt/sbin/openserctl ul show' after restart:
> >>> >        AOR:: line-6
> >>> >                Contact::
> >>> sip:line-6 at 192.168.2.102:5060;transport=udp Q=
> >>> >                        Expires:: 397
> >>> >                        Callid::
> >>> > 00036be7-b1240007-7f2e7bf5-340423fb at 192.168.2.102
> >>> >                        Cseq:: 530
> >>> >                        User-agent:: Cisco-CP7960G/8.0
> >>> >                        State:: CS_SYNC
> >>> >                        Flags:: 0
> >>> >                        Cflag:: 0
> >>> >                        Socket:: udp:192.168.2.22:5060
> >>> >                        Methods:: 4294967295
> >>> >
> >>> > The phone will consider itself registered for an hour, but the
> >>> binding
> >>> > will expire sooner on the server due to old biding timeout.
> >>> >
> >>> >
> >>> > Regards,
> >>> > Ovidiu Sas
> >>> >
>
>



More information about the Devel mailing list