Ignore:
Timestamp:
Nov 11, 2006 4:16:04 PM (18 years ago)
Author:
bennylp
Message:

Attended call transfer implementation. The changes involves:

  • Added support for SIP Replaces extension (RFC 3891)
  • Added pjsua_call_xfer_replaces() to perform attended call transfer.
  • PJSUA checks and process Replaces header in incoming calls
  • Added pjsip_ua_find_dialog() API.
  • Added pjsip_endpt_has_capability() API.
  • Added pjsip_endpt_send_response2() API.
  • etc.
File:
1 edited

Legend:

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

    r780 r797  
    146146        while (param != &uri->header_param) { 
    147147            pjsip_hdr *hdr; 
     148            int c; 
     149 
     150            c = param->value.ptr[param->value.slen]; 
     151            param->value.ptr[param->value.slen] = '\0'; 
    148152 
    149153            hdr = pjsip_parse_hdr(dlg->pool, &param->name, param->value.ptr, 
    150154                                  param->value.slen, NULL); 
     155 
     156            param->value.ptr[param->value.slen] = (char)c; 
     157 
    151158            if (hdr == NULL) { 
    152159                status = PJSIP_EINVALIDURI; 
     
    208215    } 
    209216 
     217    /* Remove header param from remote.info_str, if any */ 
     218    if (PJSIP_URI_SCHEME_IS_SIP(dlg->remote.info->uri) || 
     219        PJSIP_URI_SCHEME_IS_SIPS(dlg->remote.info->uri)) 
     220    { 
     221        pjsip_sip_uri *sip_uri = pjsip_uri_get_uri(dlg->remote.info->uri); 
     222        if (!pj_list_empty(&sip_uri->header_param)) { 
     223            pj_str_t tmp; 
     224 
     225            /* Remove all header param */ 
     226            pj_list_init(&sip_uri->header_param); 
     227 
     228            /* Print URI */ 
     229            tmp.ptr = pj_pool_alloc(dlg->pool, dlg->remote.info_str.slen); 
     230            tmp.slen = pjsip_uri_print(PJSIP_URI_IN_FROMTO_HDR, 
     231                                       sip_uri, tmp.ptr,  
     232                                       dlg->remote.info_str.slen); 
     233 
     234            if (tmp.slen < 1) { 
     235                status = PJSIP_EURITOOLONG; 
     236                goto on_error; 
     237            } 
     238 
     239            /* Assign remote.info_str */ 
     240            dlg->remote.info_str = tmp; 
     241        } 
     242    } 
     243 
     244 
    210245    /* Initialize remote's CSeq to -1. */ 
    211246    dlg->remote.cseq = dlg->remote.first_cseq = -1; 
     
    362397        tmp.slen = len; 
    363398 
    364     /* Save the local info. */ 
     399    /* Save the remote info. */ 
    365400    pj_strdup(dlg->pool, &dlg->remote.info_str, &tmp); 
    366401 
Note: See TracChangeset for help on using the changeset viewer.