Ignore:
Timestamp:
Apr 2, 2007 11:44:47 AM (17 years ago)
Author:
bennylp
Message:

Ticket #205: merged proxy functionalities from stable to trunk

File:
1 edited

Legend:

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

    r1099 r1127  
    926926 
    927927 
     928/* 
     929 * Create arbitrary requests for this account.  
     930 */ 
     931PJ_DEF(pj_status_t) pjsua_acc_create_request(pjsua_acc_id acc_id, 
     932                                             const pjsip_method *method, 
     933                                             const pj_str_t *target, 
     934                                             pjsip_tx_data **p_tdata) 
     935{ 
     936    pjsip_tx_data *tdata; 
     937    pjsua_acc *acc; 
     938    pjsip_route_hdr *r; 
     939    pj_status_t status; 
     940 
     941    PJ_ASSERT_RETURN(method && target && p_tdata, PJ_EINVAL); 
     942    PJ_ASSERT_RETURN(pjsua_acc_is_valid(acc_id), PJ_EINVAL); 
     943 
     944    acc = &pjsua_var.acc[acc_id]; 
     945 
     946    status = pjsip_endpt_create_request(pjsua_var.endpt, method, target,  
     947                                        &acc->cfg.id, target, 
     948                                        NULL, NULL, -1, NULL, &tdata); 
     949    if (status != PJ_SUCCESS) { 
     950        pjsua_perror(THIS_FILE, "Unable to create request", status); 
     951        return status; 
     952    } 
     953 
     954    /* Copy routeset */ 
     955    r = acc->route_set.next; 
     956    while (r != &acc->route_set) { 
     957        pjsip_msg_add_hdr(tdata->msg, pjsip_hdr_clone(tdata->pool, r)); 
     958        r = r->next; 
     959    } 
     960     
     961    /* Done */ 
     962    *p_tdata = tdata; 
     963    return PJ_SUCCESS; 
     964} 
     965 
     966 
    928967PJ_DEF(pj_status_t) pjsua_acc_create_uac_contact( pj_pool_t *pool, 
    929968                                                  pj_str_t *contact, 
Note: See TracChangeset for help on using the changeset viewer.