- Timestamp:
- Feb 11, 2011 7:39:14 AM (14 years ago)
- Location:
- pjproject/trunk/pjsip
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/include/pjsip-simple/evsub.h
r2394 r3412 381 381 382 382 /** 383 * Add a list of headers to the subscription instance. The list of headers 384 * will be added to outgoing presence subscription requests. 385 * 386 * @param sub Subscription instance. 387 * @param hdr_list List of headers to be added. 388 * 389 * @return PJ_SUCCESS on success. 390 */ 391 PJ_DECL(pj_status_t) pjsip_evsub_add_header( pjsip_evsub *sub, 392 const pjsip_hdr *hdr_list ); 393 394 395 /** 383 396 * Accept the incoming subscription request by sending 2xx response to 384 397 * incoming SUBSCRIBE request. -
pjproject/trunk/pjsip/include/pjsip-simple/presence.h
r3337 r3412 181 181 pjsip_tx_data **p_tdata); 182 182 183 184 /** 185 * Add a list of headers to the subscription instance. The list of headers 186 * will be added to outgoing presence subscription requests. 187 * 188 * @param sub Subscription instance. 189 * @param hdr_list List of headers to be added. 190 * 191 * @return PJ_SUCCESS on success. 192 */ 193 PJ_DECL(pj_status_t) pjsip_pres_add_header( pjsip_evsub *sub, 194 const pjsip_hdr *hdr_list ); 183 195 184 196 -
pjproject/trunk/pjsip/include/pjsua-lib/pjsua.h
r3366 r3412 2139 2139 pjsip_hdr reg_hdr_list; 2140 2140 2141 /** 2142 * The optional custom SIP headers to be put in the presence 2143 * subscription request. 2144 */ 2145 pjsip_hdr sub_hdr_list; 2146 2141 2147 /** 2142 2148 * Subscribe to message waiting indication events (RFC 3842). -
pjproject/trunk/pjsip/src/pjsip-simple/evsub.c
r3341 r3412 228 228 pjsip_expires_hdr *expires; /**< Expires header */ 229 229 pjsip_accept_hdr *accept; /**< Local Accept header. */ 230 pjsip_hdr sub_hdr_list; /**< User-defined header. */ 230 231 231 232 pj_time_val refresh_time; /**< Time to refresh. */ … … 724 725 sub->accept = (pjsip_accept_hdr*) 725 726 pjsip_hdr_clone(sub->pool, pkg->pkg_accept); 727 pj_list_init(&sub->sub_hdr_list); 726 728 727 729 sub->timer.user_data = sub; … … 1028 1030 mod_evsub.allow_events_hdr)); 1029 1031 1030 1032 1033 /* Add custom headers */ 1034 { 1035 const pjsip_hdr *hdr = sub->sub_hdr_list.next; 1036 while (hdr != &sub->sub_hdr_list) { 1037 pjsip_msg_add_hdr( tdata->msg, (pjsip_hdr*) 1038 pjsip_hdr_shallow_clone(tdata->pool, hdr)); 1039 hdr = hdr->next; 1040 } 1041 } 1042 1043 1031 1044 *p_tdata = tdata; 1032 1045 … … 1036 1049 pjsip_dlg_dec_lock(sub->dlg); 1037 1050 return status; 1051 } 1052 1053 1054 /* 1055 * Add custom headers. 1056 */ 1057 PJ_DEF(pj_status_t) pjsip_evsub_add_header( pjsip_evsub *sub, 1058 const pjsip_hdr *hdr_list ) 1059 { 1060 const pjsip_hdr *hdr; 1061 1062 PJ_ASSERT_RETURN(sub && hdr_list, PJ_EINVAL); 1063 1064 hdr = hdr_list->next; 1065 while (hdr != hdr_list) { 1066 pj_list_push_back(&sub->sub_hdr_list, (pjsip_hdr*) 1067 pjsip_hdr_clone(sub->pool, hdr)); 1068 hdr = hdr->next; 1069 } 1070 1071 return PJ_SUCCESS; 1038 1072 } 1039 1073 -
pjproject/trunk/pjsip/src/pjsip-simple/presence.c
r3363 r3412 357 357 358 358 /* 359 * Add custom headers. 360 */ 361 PJ_DEF(pj_status_t) pjsip_pres_add_header( pjsip_evsub *sub, 362 const pjsip_hdr *hdr_list ) 363 { 364 return pjsip_evsub_add_header( sub, hdr_list ); 365 } 366 367 368 /* 359 369 * Accept incoming subscription. 360 370 */ -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_core.c
r3366 r3412 191 191 #endif 192 192 pj_list_init(&cfg->reg_hdr_list); 193 pj_list_init(&cfg->sub_hdr_list); 193 194 cfg->call_hold_type = PJSUA_CALL_HOLD_TYPE_DEFAULT; 194 195 } -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_pres.c
r3339 r3412 891 891 uapres->remote[status] = '\0'; 892 892 893 pjsip_evsub_add_header(sub, &acc->cfg.sub_hdr_list); 893 894 pjsip_evsub_set_mod_data(sub, pjsua_var.mod.id, uapres); 894 895
Note: See TracChangeset
for help on using the changeset viewer.