Browse code

added function has_to_tag into common libs

Vaclav Kubart authored on 11/07/2006 05:55:38
Showing 3 changed files
... ...
@@ -1,3 +1,6 @@
1
+2006-06-29
2
+	* added function has_to_tag common for more presence modules
3
+
1 4
 2006-06-28
2 5
 	* optimalization of dstring operations (internal buffers allocated in PKG
3 6
 	memory, some functions changed to macros, added function dstr_get_str_pkg)
... ...
@@ -132,4 +132,17 @@ int requires_extension(struct sip_msg *m, str *extension)
132 132
 	return 0;
133 133
 }
134 134
 
135
+/**
136
+ * Verifies presence of the To-tag in message. Returns 1 if
137
+ * the tag is present, 0 if not, -1 on error.
138
+ */
139
+int has_to_tag(struct sip_msg *_m)
140
+{
141
+	struct to_body *to = (struct to_body*)_m->to->parsed;
142
+	if (!to) return -1;
143
+	if (to->tag_value.len > 0) return 1;
144
+	return 0;
145
+}
146
+
147
+
135 148
 #endif
... ...
@@ -20,6 +20,12 @@ int supports_extension(struct sip_msg *m, str *extension);
20 20
  * 0 if not or an error occured while parsing */
21 21
 int requires_extension(struct sip_msg *m, str *extension);
22 22
 
23
+/**
24
+ * Verifies presence of the To-tag in message. Returns 1 if
25
+ * the tag is present, 0 if not, -1 on error.
26
+ */
27
+int has_to_tag(struct sip_msg *_m);
28
+
23 29
 #endif
24 30
 
25 31
 #endif