Ignore:
Timestamp:
Dec 2, 2007 3:40:52 PM (17 years ago)
Author:
bennylp
Message:

More ticket #421: fixed SIP messaging components to support IPv6 format

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/src/pjsip/sip_uri.c

    r1417 r1610  
    266266    /* Print host. */ 
    267267    pj_assert(url->host.slen != 0); 
    268     copy_advance_check(buf, url->host); 
     268    /* Detect IPv6 IP address */ 
     269    if (pj_memchr(url->host.ptr, ':', url->host.slen)) { 
     270        copy_advance_pair_quote_cond(buf, "", 0, url->host, '[', ']'); 
     271    } else { 
     272        copy_advance_check(buf, url->host); 
     273    } 
    269274 
    270275    /* Only print port if it is explicitly specified.  
     
    312317 
    313318    /* maddr param is not allowed in From and To header. */ 
    314     if (context != PJSIP_URI_IN_FROMTO_HDR) { 
    315         copy_advance_pair_escape(buf, ";maddr=", 7, url->maddr_param, 
    316                                  pc->pjsip_PARAM_CHAR_SPEC); 
     319    if (context != PJSIP_URI_IN_FROMTO_HDR && url->maddr_param.slen) { 
     320        /* Detect IPv6 IP address */ 
     321        if (pj_memchr(url->maddr_param.ptr, ':', url->maddr_param.slen)) { 
     322            copy_advance_pair_quote_cond(buf, ";maddr=", 7, url->maddr_param, 
     323                                         '[', ']'); 
     324        } else { 
     325            copy_advance_pair_escape(buf, ";maddr=", 7, url->maddr_param, 
     326                                     pc->pjsip_PARAM_CHAR_SPEC); 
     327        } 
    317328    } 
    318329 
Note: See TracChangeset for help on using the changeset viewer.