Changeset 3326


Ignore:
Timestamp:
Sep 28, 2010 10:48:48 AM (11 years ago)
Author:
nanang
Message:

Close #1137: added field reg_hdr_list into pjsua_acc_config to specify custom headers for REGISTER requests of the account.

Location:
pjproject/trunk/pjsip
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/include/pjsua-lib/pjsua.h

    r3323 r3326  
    20792079    pj_str_t        reg_uri; 
    20802080 
     2081    /**  
     2082     * The optional custom SIP headers to be put in the registration 
     2083     * request. 
     2084     */ 
     2085    pjsip_hdr       reg_hdr_list; 
     2086 
    20812087    /** 
    20822088     * Subscribe to message waiting indication events (RFC 3842). 
  • pjproject/trunk/pjsip/src/pjsua-lib/pjsua_acc.c

    r3323 r3326  
    9090    for (i=0; i<src->cred_count; ++i) { 
    9191        pjsip_cred_dup(pool, &dst->cred_info[i], &src->cred_info[i]); 
     92    } 
     93 
     94    pj_list_init(&dst->reg_hdr_list); 
     95    if (!pj_list_empty(&src->reg_hdr_list)) { 
     96        const pjsip_hdr *hdr; 
     97 
     98        hdr = src->reg_hdr_list.next; 
     99        while (hdr != &src->reg_hdr_list) { 
     100            pj_list_push_back(&dst->reg_hdr_list, pjsip_hdr_clone(pool, hdr)); 
     101            hdr = hdr->next; 
     102        } 
    92103    } 
    93104 
     
    16571668            pjsip_regc_set_route_set( acc->regc, &route_set ); 
    16581669    } 
     1670 
     1671    /* Add custom request headers specified in the account config */ 
     1672    pjsip_regc_add_headers(acc->regc, &acc->cfg.reg_hdr_list); 
    16591673 
    16601674    /* Add other request headers. */ 
  • pjproject/trunk/pjsip/src/pjsua-lib/pjsua_core.c

    r3323 r3326  
    189189    cfg->use_stream_ka = (PJMEDIA_STREAM_ENABLE_KA != 0); 
    190190#endif 
     191    pj_list_init(&cfg->reg_hdr_list); 
    191192} 
    192193 
Note: See TracChangeset for help on using the changeset viewer.