Browse code

- reset_avp_list added

Jan Janak authored on 18/07/2006 11:51:25
Showing 2 changed files
... ...
@@ -624,6 +624,24 @@ inline void destroy_avp_list(avp_list_t* list)
624 624
 	*list = 0;
625 625
 }
626 626
 
627
+int reset_avp_list(int flags)
628
+{
629
+    int i;
630
+    if (flags & AVP_CLASS_URI) {
631
+	if (flags & AVP_TRACK_FROM) i = IDX_FROM_URI;
632
+	else i = IDX_TO_URI;
633
+    } else if (flags & AVP_CLASS_USER) {
634
+	if (flags & AVP_TRACK_FROM) i = IDX_FROM_USER;
635
+	else i = IDX_TO_USER;
636
+    } else if (flags & AVP_CLASS_DOMAIN) {
637
+	if (flags & AVP_TRACK_FROM) i = IDX_FROM_DOMAIN;
638
+	else i = IDX_TO_DOMAIN;
639
+    } else return -1;
640
+
641
+    crt_list[i] = &def_list[i];
642
+    destroy_avp_list(crt_list[i]);
643
+    return 0;
644
+}
627 645
 
628 646
 void reset_avps(void)
629 647
 {
... ...
@@ -66,7 +66,6 @@
66 66
 #define AVP_FR_INV_TIMER "fr_inv_timer"  /* Value of final response invite timer */
67 67
 #define AVP_RPID         "rpid"          /* Remote-Party-ID */
68 68
 #define AVP_GFLAGS       "gflags"        /* global flags */
69
-#define AVP_FLAGS	 "flags"	 /* message flags */
70 69
 
71 70
 struct str_int_data {
72 71
 	str name;
... ...
@@ -173,6 +172,8 @@ avp_t *search_avp_by_index( avp_flags_t flags, avp_name_t name,
173 173
 avp_t *search_avp (avp_ident_t ident, avp_value_t* val, struct search_state* state);
174 174
 avp_t *search_next_avp(struct search_state* state, avp_value_t *val);
175 175
 
176
+/* Reset one avp list */
177
+int reset_avp_list(int flags);
176 178
 
177 179
 /* free functions */
178 180
 void reset_avps(void);