Pārlūkot izejas kodu

pua: support as-feature-event

Victor Seva 9 mēneši atpakaļ
vecāks
revīzija
1422dde302
3 mainītis faili ar 21 papildinājumiem un 0 dzēšanām
  1. 13 0
      src/modules/pua/add_events.c
  2. 2 0
      src/modules/pua/add_events.h
  3. 6 0
      src/modules/pua/hash.h

+ 13 - 0
src/modules/pua/add_events.c

@@ -109,6 +109,13 @@ int pua_add_events(void)
 		return -1;
 	}
 
+	if(add_pua_event(DFKS_EVENT, "as-feature-event",
+			   "application/x-as-feature-event+xml", dfks_process_body)
+			< 0) {
+		LM_ERR("while adding event as-feature-event\n");
+		return -1;
+	}
+
 	return 0;
 }
 
@@ -382,3 +389,9 @@ int dlg_process_body(publ_info_t *publ, str **fin_body, int ver, str **tuple)
 	*fin_body = publ->body;
 	return 0;
 }
+
+int dfks_process_body(publ_info_t *publ, str **fin_body, int ver, str **tuple)
+{
+	*fin_body = publ->body;
+	return 0;
+}

+ 2 - 0
src/modules/pua/add_events.h

@@ -44,5 +44,7 @@ int dlg_process_body(
 		struct publ_info *publ, str **fin_body, int ver, str **tuple);
 int reginfo_process_body(
 		struct publ_info *publ, str **fin_body, int ver, str **tuple);
+int dfks_process_body(
+		struct publ_info *publ, str **fin_body, int ver, str **tuple);
 
 #endif

+ 6 - 0
src/modules/pua/hash.h

@@ -43,6 +43,7 @@
 #define DIALOG_EVENT 1 << 5
 #define REGINFO_EVENT 1 << 6
 #define XCAPDIFF_EVENT 1 << 7
+#define DFKS_EVENT 1 << 8
 
 #define UL_PUBLISH 1 << 0
 #define BLA_PUBLISH 1 << 1
@@ -60,6 +61,8 @@
 #define REGINFO_SUBSCRIBE 1 << 13
 #define XCAPDIFF_PUBLISH 1 << 14
 #define XCAPDIFF_SUBSCRIBE 1 << 15
+#define DFKS_PUBLISH 1 << 16
+#define DFKS_SUBSCRIBE 1 << 17
 
 #define NO_UPDATEDB_FLAG 1 << 0
 #define UPDATEDB_FLAG 1 << 1
@@ -175,6 +178,9 @@ static inline int get_event_flag(str *event)
 		case 15:
 			if(strncmp(event->s, "message-summary", 15) == 0)
 				return MSGSUM_EVENT;
+		case 16:
+			if(strncmp(event->s, "as-feature-event", 16) == 0)
+				return DFKS_EVENT;
 	}
 
 	LM_ERR("Unknown event string\n");