Changeset 1390


Ignore:
Timestamp:
Jun 26, 2007 8:23:18 AM (17 years ago)
Author:
bennylp
Message:

Ticket #342: added configuration to control whether Allow header should be included in outgoing INVITE requests

Location:
pjproject/trunk/pjsip
Files:
3 edited

Legend:

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

    r1389 r1390  
    159159 
    160160/** 
     161 * Send Allow header in dialog establishing requests? 
     162 * RFC 3261 Allow header SHOULD be included in dialog establishing 
     163 * requests to inform remote agent about which SIP requests are 
     164 * allowed within dialog. 
     165 * 
     166 * Note that there is also an undocumented variable defined in sip_dialog.c 
     167 * to control whether Allow header should be included. The default value  
     168 * of this variable is PJSIP_INCLUDE_ALLOW_HDR_IN_DLG. 
     169 * To change PJSIP behavior during run-time, application can use the  
     170 * following construct: 
     171 * 
     172 \verbatim 
     173   extern pj_bool_t pjsip_include_allow_hdr_in_dlg; 
     174  
     175   // do not transmit Allow header 
     176   pjsip_include_allow_hdr_in_dlg = PJ_FALSE; 
     177 \endverbatim 
     178 * 
     179 * Default is 1 (Yes) 
     180 */ 
     181#ifndef PJSIP_INCLUDE_ALLOW_HDR_IN_DLG 
     182#   define PJSIP_INCLUDE_ALLOW_HDR_IN_DLG       1 
     183#endif 
     184 
     185 
     186/** 
    161187 * Allow SIP modules removal or insertions during operation? 
    162188 * If yes, then locking will be employed when endpoint need to 
  • pjproject/trunk/pjsip/src/pjsip-ua/sip_inv.c

    r1379 r1390  
    114114}; 
    115115 
     116/* Config */ 
     117extern pj_bool_t pjsip_include_allow_hdr_in_dlg; 
    116118 
    117119/* 
     
    11541156 
    11551157    /* Add Allow header. */ 
    1156     hdr = pjsip_endpt_get_capability(inv->dlg->endpt, PJSIP_H_ALLOW, NULL); 
    1157     if (hdr) { 
    1158         pjsip_msg_add_hdr(tdata->msg, (pjsip_hdr*) 
    1159                           pjsip_hdr_shallow_clone(tdata->pool, hdr)); 
     1158    if (pjsip_include_allow_hdr_in_dlg) { 
     1159        hdr = pjsip_endpt_get_capability(inv->dlg->endpt, PJSIP_H_ALLOW, NULL); 
     1160        if (hdr) { 
     1161            pjsip_msg_add_hdr(tdata->msg, (pjsip_hdr*) 
     1162                              pjsip_hdr_shallow_clone(tdata->pool, hdr)); 
     1163        } 
    11601164    } 
    11611165 
  • pjproject/trunk/pjsip/src/pjsip/sip_dialog.c

    r1340 r1390  
    4040long pjsip_dlg_lock_tls_id; 
    4141 
     42/* Config */ 
     43pj_bool_t pjsip_include_allow_hdr_in_dlg = PJSIP_INCLUDE_ALLOW_HDR_IN_DLG; 
     44 
     45 
    4246PJ_DEF(pj_bool_t) pjsip_method_creates_dialog(const pjsip_method *m) 
    4347{ 
     
    11971201 
    11981202        /* Add Allow header in 2xx and 405 response. */ 
    1199         if ((st_class==2 || st_code==405) && 
     1203        if (((st_class==2 && pjsip_include_allow_hdr_in_dlg) 
     1204             || st_code==405) && 
    12001205            pjsip_msg_find_hdr(tdata->msg, PJSIP_H_ALLOW, NULL)==NULL)  
    12011206        { 
Note: See TracChangeset for help on using the changeset viewer.