Changeset 4267


Ignore:
Timestamp:
Sep 28, 2012 6:17:11 AM (12 years ago)
Author:
nanang
Message:

Close #1587: Added settings to accept call replace when in early state and as UAS: accept_replace_in_early_state in pjsip_cfg_t and PJSIP_ACCEPT_REPLACE_IN_EARLY_STATE macro.

Location:
pjproject/trunk/pjsip
Files:
3 edited

Legend:

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

    r4228 r4267  
    7777         */ 
    7878        pj_bool_t allow_port_in_fromto_hdr; 
     79 
     80        /** 
     81         * Accept call replace in early state when invite is not initiated 
     82         * by the user agent. RFC 3891 Section 3 disallows this, however, 
     83         * for better interoperability reason, this might be ignored. 
     84         * 
     85         * Default is PJSIP_ACCEPT_REPLACE_IN_EARLY_STATE. 
     86         */ 
     87        pj_bool_t accept_replace_in_early_state; 
    7988 
    8089        /** 
     
    276285 
    277286/** 
     287 * Accept call replace in early state when invite is not initiated 
     288 * by the user agent. RFC 3891 Section 3 disallows this, however, 
     289 * for better interoperability reason, this might be ignored. 
     290 * 
     291 * This option can also be controlled at run-time by the 
     292 * \a accept_replace_in_early_state setting in pjsip_cfg_t. 
     293 * 
     294 * Default is 0 (no). 
     295 */ 
     296#ifndef PJSIP_ACCEPT_REPLACE_IN_EARLY_STATE 
     297#   define PJSIP_ACCEPT_REPLACE_IN_EARLY_STATE      0 
     298#endif 
     299 
     300 
     301/** 
    278302 * This setting controls the threshold of the UDP packet, which if it's 
    279303 * larger than this value the request will be sent with TCP. This setting 
  • pjproject/trunk/pjsip/src/pjsip-ua/sip_replaces.c

    r3999 r4267  
    306306     * Exist) response to the new INVITE. 
    307307     */ 
    308     if (inv->state <= PJSIP_INV_STATE_EARLY && inv->role != PJSIP_ROLE_UAC) { 
     308    if (inv->state <= PJSIP_INV_STATE_EARLY && inv->role != PJSIP_ROLE_UAC && 
     309        pjsip_cfg()->endpt.accept_replace_in_early_state == PJ_FALSE) 
     310    { 
    309311        code = PJSIP_SC_CALL_TSX_DOES_NOT_EXIST; 
    310312        warn_text = "Found early INVITE session but not initiated by this UA"; 
  • pjproject/trunk/pjsip/src/pjsip/sip_config.c

    r3999 r4267  
    2727    { 
    2828       PJSIP_ALLOW_PORT_IN_FROMTO_HDR, 
     29       PJSIP_ACCEPT_REPLACE_IN_EARLY_STATE, 
    2930       0, 
    3031       PJSIP_DONT_SWITCH_TO_TCP 
Note: See TracChangeset for help on using the changeset viewer.