Changeset 167 for pjproject/trunk/pjsip/src/pjsip-ua/sip_reg.c
- Timestamp:
- Feb 9, 2006 9:30:09 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/src/pjsip-ua/sip_reg.c
- Property svn:keywords set to id
r141 r167 42 42 struct pjsip_regc 43 43 { 44 pj_pool_t 45 pjsip_endpoint *endpt;46 pj_bool_t _delete_flag;47 int pending_tsx;48 49 void *token;50 pjsip_regc_cb *cb;51 52 pj_str_t str_srv_url;53 pjsip_uri *srv_url;54 pjsip_cid_hdr *cid_hdr;55 pjsip_cseq_hdr *cseq_hdr;56 pjsip_from_hdr *from_hdr;57 pjsip_to_hdr *to_hdr;58 char *contact_buf;44 pj_pool_t *pool; 45 pjsip_endpoint *endpt; 46 pj_bool_t _delete_flag; 47 int pending_tsx; 48 49 void *token; 50 pjsip_regc_cb *cb; 51 52 pj_str_t str_srv_url; 53 pjsip_uri *srv_url; 54 pjsip_cid_hdr *cid_hdr; 55 pjsip_cseq_hdr *cseq_hdr; 56 pjsip_from_hdr *from_hdr; 57 pjsip_to_hdr *to_hdr; 58 char *contact_buf; 59 59 pjsip_generic_string_hdr *contact_hdr; 60 pjsip_expires_hdr *expires_hdr; 61 pjsip_contact_hdr *unreg_contact_hdr; 62 pjsip_expires_hdr *unreg_expires_hdr; 63 pj_uint32_t expires; 60 pjsip_expires_hdr *expires_hdr; 61 pjsip_contact_hdr *unreg_contact_hdr; 62 pjsip_expires_hdr *unreg_expires_hdr; 63 pj_uint32_t expires; 64 pjsip_route_hdr route_set; 64 65 65 66 /* Authorization sessions. */ 66 pjsip_auth_clt_sess auth_sess;67 pjsip_auth_clt_sess auth_sess; 67 68 68 69 /* Auto refresh registration. */ 69 pj_bool_t auto_reg;70 pj_timer_entry timer;70 pj_bool_t auto_reg; 71 pj_timer_entry timer; 71 72 }; 72 73 … … 99 100 if (status != PJ_SUCCESS) 100 101 return status; 102 103 pj_list_init(®c->route_set); 101 104 102 105 /* Done */ … … 247 250 PJ_ASSERT_RETURN(regc && count && cred, PJ_EINVAL); 248 251 return pjsip_auth_clt_set_credentials(®c->auth_sess, count, cred); 252 } 253 254 PJ_DEF(pj_status_t) pjsip_regc_set_route_set( pjsip_regc *regc, 255 const pjsip_route_hdr *route_set) 256 { 257 const pjsip_route_hdr *chdr; 258 259 PJ_ASSERT_RETURN(regc && route_set, PJ_EINVAL); 260 261 pj_list_init(®c->route_set); 262 263 chdr = route_set->next; 264 while (chdr != route_set) { 265 pj_list_push_back(®c->route_set, pjsip_hdr_clone(regc->pool, chdr)); 266 chdr = chdr->next; 267 } 268 269 return PJ_SUCCESS; 249 270 } 250 271 … … 273 294 /* Add cached authorization headers. */ 274 295 pjsip_auth_clt_init_req( ®c->auth_sess, tdata ); 296 297 /* Add Route headers from route set, ideally after Via header */ 298 if (!pj_list_empty(®c->route_set)) { 299 pjsip_hdr *route_pos; 300 const pjsip_route_hdr *route; 301 302 route_pos = pjsip_msg_find_hdr(tdata->msg, PJSIP_H_VIA, NULL); 303 if (!route_pos) 304 route_pos = &tdata->msg->hdr; 305 306 route = regc->route_set.next; 307 while (route != ®c->route_set) { 308 pjsip_hdr *new_hdr = pjsip_hdr_shallow_clone(tdata->pool, route); 309 pj_list_insert_after(route_pos, new_hdr); 310 route_pos = new_hdr; 311 route = route->next; 312 } 313 } 275 314 276 315 /* Done. */
Note: See TracChangeset
for help on using the changeset viewer.