Ignore:
Timestamp:
Sep 28, 2010 7:43:18 AM (11 years ago)
Author:
bennylp
Message:

Closed #1139 (Support for tel: URI in PJSUA-LIB):

  • added new PJSUA API: pjsua_verify_url() which can be used for tel: URI
  • modified and tested according to spec
  • added new PJSIP error code, PJSIP_ENOROUTESET, to indicate that route set is needed to send to tel: URI
  • added couple of unit tests (we can't cover the whole tel: URI scenario yet)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/src/pjsua-lib/pjsua_core.c

    r3313 r3323  
    24052405} 
    24062406 
    2407  
    2408 /* 
    2409  * Verify that valid SIP url is given. 
    2410  */ 
    2411 PJ_DEF(pj_status_t) pjsua_verify_sip_url(const char *c_url) 
     2407/* 
     2408 * Verify that valid url is given. 
     2409 */ 
     2410PJ_DEF(pj_status_t) pjsua_verify_url(const char *c_url) 
    24122411{ 
    24132412    pjsip_uri *p; 
     
    24162415    int len = (c_url ? pj_ansi_strlen(c_url) : 0); 
    24172416 
    2418     if (!len) return -1; 
     2417    if (!len) return PJSIP_EINVALIDURI; 
    24192418 
    24202419    pool = pj_pool_create(&pjsua_var.cp.factory, "check%p", 1024, 0, NULL); 
    2421     if (!pool) return -1; 
     2420    if (!pool) return PJ_ENOMEM; 
     2421 
     2422    url = (char*) pj_pool_alloc(pool, len+1); 
     2423    pj_ansi_strcpy(url, c_url); 
     2424 
     2425    p = pjsip_parse_uri(pool, url, len, 0); 
     2426 
     2427    pj_pool_release(pool); 
     2428    return p ? 0 : PJSIP_EINVALIDURI; 
     2429} 
     2430 
     2431/* 
     2432 * Verify that valid SIP url is given. 
     2433 */ 
     2434PJ_DEF(pj_status_t) pjsua_verify_sip_url(const char *c_url) 
     2435{ 
     2436    pjsip_uri *p; 
     2437    pj_pool_t *pool; 
     2438    char *url; 
     2439    int len = (c_url ? pj_ansi_strlen(c_url) : 0); 
     2440 
     2441    if (!len) return PJSIP_EINVALIDURI; 
     2442 
     2443    pool = pj_pool_create(&pjsua_var.cp.factory, "check%p", 1024, 0, NULL); 
     2444    if (!pool) return PJ_ENOMEM; 
    24222445 
    24232446    url = (char*) pj_pool_alloc(pool, len+1); 
     
    24322455 
    24332456    pj_pool_release(pool); 
    2434     return p ? 0 : -1; 
     2457    return p ? 0 : PJSIP_EINVALIDURI; 
    24352458} 
    24362459 
Note: See TracChangeset for help on using the changeset viewer.