Ignore:
Timestamp:
Nov 11, 2006 9:25:55 PM (18 years ago)
Author:
bennylp
Message:

Add pjsip_regc_add_headers() APi to set headers to be added
to the REGISTER request. This solves the problem where headers

registered in the initial REGISTER request (such as User-Agent
header) are not sent in subsequent reregistration request.

File:
1 edited

Legend:

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

    r781 r799  
    551551    } 
    552552 
     553    /* Add other request headers. */ 
     554    if (pjsua_var.ua_cfg.user_agent.slen) { 
     555        pjsip_hdr hdr_list; 
     556        const pj_str_t STR_USER_AGENT = { "User-Agent", 10 }; 
     557        pjsip_generic_string_hdr *h; 
     558 
     559        pool = pj_pool_create_on_buf(NULL, contact_buf, sizeof(contact_buf)); 
     560        pj_list_init(&hdr_list); 
     561 
     562        h = pjsip_generic_string_hdr_create(pool, &STR_USER_AGENT,  
     563                                            &pjsua_var.ua_cfg.user_agent); 
     564        pj_list_push_back(&hdr_list, (pjsip_hdr*)h); 
     565 
     566        pjsip_regc_add_headers(acc->regc, &hdr_list); 
     567    } 
     568 
    553569    return PJ_SUCCESS; 
    554570} 
     
    597613 
    598614    if (status == PJ_SUCCESS) { 
    599         pjsua_process_msg_data(tdata, NULL); 
     615        //pjsua_process_msg_data(tdata, NULL); 
    600616        status = pjsip_regc_send( pjsua_var.acc[acc_id].regc, tdata ); 
    601617    } 
Note: See TracChangeset for help on using the changeset viewer.