Ignore:
Timestamp:
Sep 28, 2010 7:43:18 AM (14 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_acc.c

    r3322 r3323  
    120120    pjsua_acc *acc = &pjsua_var.acc[acc_id]; 
    121121    pjsip_name_addr *name_addr; 
    122     pjsip_sip_uri *sip_uri, *sip_reg_uri; 
     122    pjsip_sip_uri *sip_reg_uri; 
    123123    pj_status_t status; 
    124124    unsigned i; 
     
    137137 
    138138    /* Local URI MUST be a SIP or SIPS: */ 
    139  
    140139    if (!PJSIP_URI_SCHEME_IS_SIP(name_addr) &&  
    141140        !PJSIP_URI_SCHEME_IS_SIPS(name_addr))  
    142141    { 
    143         pjsua_perror(THIS_FILE, "Invalid local URI",  
    144                      PJSIP_EINVALIDSCHEME); 
    145         return PJSIP_EINVALIDSCHEME; 
    146     } 
    147  
    148  
    149     /* Get the SIP URI object: */ 
    150     sip_uri = (pjsip_sip_uri*) pjsip_uri_get_uri(name_addr); 
     142        acc->display = name_addr->display; 
     143        acc->user_part = name_addr->display; 
     144        acc->srv_domain = pj_str(""); 
     145        acc->srv_port = 0; 
     146    } else { 
     147        pjsip_sip_uri *sip_uri; 
     148 
     149        /* Get the SIP URI object: */ 
     150        sip_uri = (pjsip_sip_uri*) pjsip_uri_get_uri(name_addr); 
     151 
     152        /* Save the user and domain part. These will be used when finding an 
     153         * account for incoming requests. 
     154         */ 
     155        acc->display = name_addr->display; 
     156        acc->user_part = sip_uri->user; 
     157        acc->srv_domain = sip_uri->host; 
     158        acc->srv_port = 0; 
     159    } 
    151160 
    152161 
     
    177186        sip_reg_uri = NULL; 
    178187    } 
    179  
    180     /* Save the user and domain part. These will be used when finding an  
    181      * account for incoming requests. 
    182      */ 
    183     acc->display = name_addr->display; 
    184     acc->user_part = sip_uri->user; 
    185     acc->srv_domain = sip_uri->host; 
    186     acc->srv_port = 0; 
    187188 
    188189    if (sip_reg_uri) { 
     
    21612162        /* For non-SIP scheme, route set should be configured */ 
    21622163        if (!PJSIP_URI_SCHEME_IS_SIP(uri) && !PJSIP_URI_SCHEME_IS_SIPS(uri)) 
    2163             return PJSIP_EINVALIDREQURI; 
     2164            return PJSIP_ENOROUTESET; 
    21642165 
    21652166        sip_uri = (pjsip_sip_uri*)pjsip_uri_get_uri(uri); 
Note: See TracChangeset for help on using the changeset viewer.