Registration update after NAT detection

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Michael

You probably want to check out these settings in pjsua.h

/**
     * This option is used to update the transport address and the Contact
     * header of REGISTER request. When this option is  enabled, the
library
     * will keep track of the public IP address from the response of
REGISTER
     * request. Once it detects that the address has changed, it will
     * unregister current Contact, update the Contact with transport address
     * learned from Via header, and register a new Contact to the registrar.
     * This will also update the public name of UDP transport if STUN is
     * configured.
     *
     * See also contact_rewrite_method field.
     *
     * Default: 1 (yes)
     */
    pj_bool_t allow_contact_rewrite;

    /**
     * Specify how Contact update will be done with the registration, if
     * \a allow_contact_rewrite is enabled.
     *
     * If set to 1, the Contact update will be done by sending
unregistration
     * to the currently registered Contact, while simultaneously sending new
     * registration (with different Call-ID) for the updated Contact.
     *
     * If set to 2, the Contact update will be done in a single, current
     * registration session, by removing the current binding (by setting its
     * Contact's expires parameter to zero) and adding a new Contact
binding,
     * all done in a single request.
     *
     * Value 1 is the legacy behavior.
     *
     * Default value: PJSUA_CONTACT_REWRITE_METHOD (2)
     */
    int     contact_rewrite_method;


/Johan

Hi!
Just started to play with pjsip some days ago and took the sample
"simple_pjsua.c" for my first tries. I noticed following problem and
don't know how to solve:
I'm behind a NAT router and use the SIP server from sipgate.at. So
when I start my app it first registers with "user@<internal IP>" and
after the external IP was detected by pjnath it sends out a second
registration with "user@<external IP>" but doesn't unregister
"user@<interal IP>".
So when i make a call to that account immediately after registration i
get two invites for the same call. I want to autoanswer an incoming
call so the same call gets answered twice and pjsip has two active
calls in his status.
Is there any switch in pjsip that the first registration is cleared
before the registrationin in the SIP registrar gets invalid after
timeout or do you know any method to filter invites that belong to the
same call?

/Michael

-- 

Johan Lantz
Head of IMS Products
GENAKER - Esi Mobile Solutions SL
www.genaker.net
Phone +34 622 271 645
Fax: +34 933 316 99

[image: web] <http://www.genaker.net/>[image:
blogger]<http://genaker.blogspot.com/>[image:
yout] <http://www.youtube.com/genakertv>[image:
twitter]<http://www.twitter.com/genaker>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20110704/4e364de4/attachment.html>


[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux