Changeset 1837 for pjproject


Ignore:
Timestamp:
Mar 2, 2008 10:37:41 AM (17 years ago)
Author:
bennylp
Message:

Ticket #498: Option in client registration to ignore Contact address in REGISTER response

Location:
pjproject/trunk/pjsip
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/include/pjsip/sip_config.h

    r1818 r1837  
    2424 * @brief Compile time configuration. 
    2525 */ 
    26 #include <pj/config.h> 
     26#include <pj/types.h> 
    2727 
    2828/** 
     
    104104    /* Dialog layer settings .. TODO */ 
    105105 
     106    /** Client registration settings. */ 
     107    struct { 
     108        /** 
     109         * Specify whether client registration should check for its  
     110         * registered contact in Contact header of successful REGISTE  
     111         * response to determine whether registration has been successful.  
     112         * This setting may be disabled if non-compliant registrar is unable 
     113         * to return correct Contact header. 
     114         * 
     115         * Default is PJSIP_REGISTER_CLIENT_CHECK_CONTACT 
     116         */ 
     117        pj_bool_t   check_contact; 
     118 
     119    } regc; 
     120 
    106121} pjsip_cfg_t; 
    107122 
     
    700715 
    701716/** 
     717 * Specify whether client registration should check for its registered 
     718 * contact in Contact header of successful REGISTE response to determine 
     719 * whether registration has been successful. This setting may be disabled 
     720 * if non-compliant registrar is unable to return correct Contact header. 
     721 * 
     722 * This setting can be changed in run-time with using pjsip_cfg(). 
     723 * 
     724 * Default is 1 
     725 */ 
     726#ifndef PJSIP_REGISTER_CLIENT_CHECK_CONTACT 
     727#   define PJSIP_REGISTER_CLIENT_CHECK_CONTACT  1 
     728#endif 
     729 
     730 
     731/** 
    702732 * @} 
    703733 */ 
  • pjproject/trunk/pjsip/src/pjsip-ua/sip_reg.c

    r1593 r1837  
    724724            /* Enumerate all Contact headers found in the response and 
    725725             * find the Contact(s) that we register. 
     726             * 
     727             * Note:  
     728             *  by default we require that the exact same URI that we 
     729             *  register is returned in the 200/OK response (by exact, 
     730             *  meaning all URI components including transport param), 
     731             *  otherwise if we don't detect that our URI is there, we 
     732             *  treat registration as failed. 
     733             * 
     734             *  If your registrar server couldn't do this, you can 
     735             *  disable this exact URI checking. See the compile time 
     736             *  setting PJSIP_REGISTER_CLIENT_CHECK_CONTACT or the 
     737             *  corresponding run-time setting in pjsip_cfg(). 
    726738             */ 
    727             for (i=0; i<contact_cnt; ++i) { 
     739            for (i=0; i<contact_cnt && pjsip_cfg()->regc.check_contact; ++i) { 
    728740                pjsip_contact_hdr *our_contact; 
    729741 
     
    761773             * means we have been unregistered. 
    762774             */ 
    763             if (!has_our_contact) 
     775            if (pjsip_cfg()->regc.check_contact && !has_our_contact) 
    764776                expiration = 0; 
    765777 
  • pjproject/trunk/pjsip/src/pjsip/sip_config.c

    r1818 r1837  
    3030       PJSIP_T4_TIMEOUT, 
    3131       PJSIP_TD_TIMEOUT 
     32    }, 
     33 
     34    /* Client registration client */ 
     35    { 
     36        PJSIP_REGISTER_CLIENT_CHECK_CONTACT 
    3237    } 
    3338}; 
Note: See TracChangeset for help on using the changeset viewer.