Changeset 1217


Ignore:
Timestamp:
Apr 28, 2007 1:00:33 PM (12 years ago)
Author:
bennylp
Message:

Fixed ticket #238: allow colon in Via parameters

Location:
pjproject/branches/split-3rd-party/pjsip/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • pjproject/branches/split-3rd-party/pjsip/src/pjsip/sip_msg.c

    r1127 r1217  
    17261726    copy_advance_pair(buf, ";received=", 10, hdr->recvd_param); 
    17271727    copy_advance_pair(buf, ";branch=", 8, hdr->branch_param); 
    1728      
     1728 
     1729    /* Via's via-extension params should be printed with token spec 
     1730     * according to RFC 3261's generic-param production, but some 
     1731     * endpoint uses pname/pvalue production for these params, by 
     1732     * sending to us Via parameter containing ":". 
     1733     *  
     1734     * So for interoperability sake, lets allow ":" in Via param. 
     1735 
    17291736    printed = pjsip_param_print_on(&hdr->other_param, buf, endbuf-buf,  
    17301737                                   &pjsip_TOKEN_SPEC, 
    1731                                    &pjsip_TOKEN_SPEC, ';'); 
     1738                                   &pjsip_TOKEN_SPEC, ';'); 
     1739     */ 
     1740    printed = pjsip_param_print_on(&hdr->other_param, buf, endbuf-buf,  
     1741                                   &pjsip_PARAM_CHAR_SPEC, 
     1742                                   &pjsip_PARAM_CHAR_SPEC, ';'); 
     1743 
    17321744    if (printed < 0) 
    17331745        return -1; 
  • pjproject/branches/split-3rd-party/pjsip/src/pjsip/sip_parser.c

    r1084 r1217  
    18441844        pj_str_t pname, pvalue; 
    18451845 
     1846        /* Via's via-extension params should be printed with token spec 
     1847         * according to RFC 3261's generic-param production, but some 
     1848         * endpoint uses pname/pvalue production for these params, by 
     1849         * sending to us Via parameter containing ":". 
     1850         *  
     1851         * So for interoperability sake, lets allow ":" in Via param. 
    18461852        int_parse_param( scanner, pool, &pname, &pvalue); 
     1853         */ 
     1854 
     1855        int_parse_uri_param(scanner, pool, &pname, &pvalue); 
    18471856 
    18481857        if (!parser_stricmp(pname, pjsip_BRANCH_STR) && pvalue.slen) { 
  • pjproject/branches/split-3rd-party/pjsip/src/test-pjsip/msg_test.c

    r1082 r1217  
    7878    /* Typical response message. */ 
    7979    "SIP/2.0 200 OK\r\n" 
    80     "Via: SIP/2.0/SCTP server10.biloxi.com;branch=z9hG4bKnashds8;rport;received=192.0.2.1\r\n" 
     80    "Via: SIP/2.0/SCTP server10.biloxi.com;branch=z9hG4bKnashds8;rport;received=192.0.2.1;param=a:b\r\n" 
    8181    "Via: SIP/2.0/UDP bigbox3.site3.atlanta.com;branch=z9hG4bK77ef4c2312983.1;received=192.0.2.2\r\n" 
    8282    "Via: SIP/2.0/UDP pc33.atlanta.com;branch=z9hG4bK776asdhds ;received=192.0.2.3\r\n" 
     
    176176        } 
    177177    } 
     178    if (!pj_list_empty(&err_list)) { 
     179        PJ_LOG(3,(THIS_FILE, "   Syntax error in line %d col %d", 
     180                      err_list.next->line, err_list.next->col)); 
     181        status = -11; 
     182        goto on_return; 
     183    } 
     184 
    178185    pj_get_timestamp(&t2); 
    179186    pj_sub_timestamp(&t2, &t1); 
     
    554561    pjsip_cseq_hdr *cseq; 
    555562    pjsip_msg *msg = pjsip_msg_create(pool, PJSIP_RESPONSE_MSG); 
     563    pjsip_param *param; 
    556564    pjsip_msg_body *body; 
    557565 
     
    560568    msg->line.status.reason = pj_str("OK"); 
    561569 
    562     //"Via: SIP/2.0/SCTP server10.biloxi.com;branch=z9hG4bKnashds8;rport;received=192.0.2.1\r\n" 
     570    //"Via: SIP/2.0/SCTP server10.biloxi.com;branch=z9hG4bKnashds8;rport;received=192.0.2.1;param=a:b\r\n" 
    563571    via = pjsip_via_hdr_create(pool); 
    564572    pjsip_msg_add_hdr(msg, (pjsip_hdr*)via); 
     
    568576    via->rport_param = 0; 
    569577    via->recvd_param = pj_str("192.0.2.1"); 
     578 
     579    param = pj_pool_zalloc(pool, sizeof(pjsip_param)); 
     580    param->name = pj_str("param"); 
     581    param->value = pj_str("a:b"); 
     582    pj_list_push_back(&via->other_param, param); 
    570583 
    571584    //"Via: SIP/2.0/UDP bigbox3.site3.atlanta.com;branch=z9hG4bK77ef4c2312983.1;received=192.0.2.2\r\n" 
Note: See TracChangeset for help on using the changeset viewer.