Changeset 2712


Ignore:
Timestamp:
May 18, 2009 7:24:37 PM (11 years ago)
Author:
bennylp
Message:

Fixed ticket #854: Adding SOFTWARE attribute in all outgoing requests causes compatibility problem with older STUN server (thanks Alexei Kuznetsov for the report)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/branches/projects/sipit24/pjnath/src/pjnath/stun_session.c

    r2589 r2712  
    220220    /* If the agent is sending a request, it SHOULD add a SOFTWARE attribute 
    221221     * to the request. The server SHOULD include a SOFTWARE attribute in all  
    222      * responses  
     222     * responses. 
     223     * 
     224     * If magic value is not PJ_STUN_MAGIC, only apply the attribute for 
     225     * responses. 
    223226     */ 
    224     if (sess->srv_name.slen && !PJ_STUN_IS_INDICATION(msg->hdr.type) && 
    225         pj_stun_msg_find_attr(msg, PJ_STUN_ATTR_SOFTWARE, 0)==NULL)  
     227    if (sess->srv_name.slen &&  
     228        pj_stun_msg_find_attr(msg, PJ_STUN_ATTR_SOFTWARE, 0)==NULL && 
     229        (PJ_STUN_IS_RESPONSE(msg->hdr.type) || 
     230         PJ_STUN_IS_REQUEST(msg->hdr.type) && msg->hdr.magic==PJ_STUN_MAGIC))  
    226231    { 
    227232        pj_stun_msg_add_string_attr(pool, msg, PJ_STUN_ATTR_SOFTWARE, 
Note: See TracChangeset for help on using the changeset viewer.