@@ -1,3 +1,6 @@
+2006-06-29
+ * added function has_to_tag common for more presence modules
+
2006-06-28
* optimalization of dstring operations (internal buffers allocated in PKG
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)
return 0;
}
+/**
+ * Verifies presence of the To-tag in message. Returns 1 if
+ * the tag is present, 0 if not, -1 on error.
+ */
+int has_to_tag(struct sip_msg *_m)
+{
+ struct to_body *to = (struct to_body*)_m->to->parsed;
+ if (!to) return -1;
+ if (to->tag_value.len > 0) return 1;
+ return 0;
+}
#endif
@@ -20,6 +20,12 @@ int supports_extension(struct sip_msg *m, str *extension);
* 0 if not or an error occured while parsing */
int requires_extension(struct sip_msg *m, str *extension);
+int has_to_tag(struct sip_msg *_m);