Browse code

kazoo: use hardcoded max size of routing key

lazedo authored on 23/06/2017 20:18:13
Showing 1 changed files
... ...
@@ -30,6 +30,7 @@
30 30
 #define DBK_DEFS_H_
31 31
 
32 32
 #define BLF_MAX_DIALOGS 8
33
+#define MAX_ROUTING_KEY_SIZE 255
33 34
 
34 35
 #define BLF_JSON_AMQP_RECEIVED	"AMQP-Received"
35 36
 #define BLF_JSON_AMQP_CONSUMER	"AMQP-Consumer"
Browse code

kazoo: add alternative name for sender

lazedo authored on 17/04/2017 17:08:42
Showing 1 changed files
... ...
@@ -52,6 +52,7 @@
52 52
 #define BLF_JSON_CALLID    	"Call-ID"
53 53
 #define BLF_JSON_DIALOGID   "Dialog-ID"
54 54
 #define BLF_JSON_SENDER    	"Sender-URI"
55
+#define BLF_JSON_SWITCH_URI	"Switch-URI"
55 56
 #define BLF_JSON_ETAG    	"ETag"
56 57
 #define BLF_JSON_TOTAG     	"To-Tag"
57 58
 #define BLF_JSON_FROMTAG   	"From-Tag"
Browse code

kazoo: add time msg was received

lazedo authored on 14/04/2017 15:58:48
Showing 1 changed files
... ...
@@ -30,6 +30,14 @@
30 30
 #define DBK_DEFS_H_
31 31
 
32 32
 #define BLF_MAX_DIALOGS 8
33
+
34
+#define BLF_JSON_AMQP_RECEIVED	"AMQP-Received"
35
+#define BLF_JSON_AMQP_CONSUMER	"AMQP-Consumer"
36
+#define BLF_JSON_AMQP_PUBLISHED	"AMQP-Published"
37
+#define BLF_JSON_AMQP_SENT	    "AMQP-Sent"
38
+#define BLF_JSON_AMQP_PIPE_IN	"AMQP-Pipe-In"
39
+#define BLF_JSON_AMQP_PIPE_OUT	"AMQP-Pipe-Out"
40
+
33 41
 #define BLF_JSON_PRES		"Presentity"
34 42
 #define BLF_JSON_PRES_USER	"Presentity-User"
35 43
 #define BLF_JSON_PRES_REALM	"Presentity-Realm"
Browse code

kazoo: add more explicit fields to kz_pua

kz_pua.c was reformatted

lazedo authored on 14/04/2017 03:54:57
Showing 1 changed files
... ...
@@ -42,6 +42,9 @@
42 42
 #define BLF_JSON_TO_REALM	"To-Realm"
43 43
 #define BLF_JSON_TO_URI		"To-URI"
44 44
 #define BLF_JSON_CALLID    	"Call-ID"
45
+#define BLF_JSON_DIALOGID   "Dialog-ID"
46
+#define BLF_JSON_SENDER    	"Sender-URI"
47
+#define BLF_JSON_ETAG    	"ETag"
45 48
 #define BLF_JSON_TOTAG     	"To-Tag"
46 49
 #define BLF_JSON_FROMTAG   	"From-Tag"
47 50
 #define BLF_JSON_STATE     	"State"
Browse code

kazoo : add broker zone to received payload

Luis Azedo authored on 05/04/2017 22:19:41 • lazedo committed on 05/04/2017 22:34:21
Showing 1 changed files
... ...
@@ -57,6 +57,7 @@
57 57
 #define BLF_JSON_TYPE           "Type"
58 58
 #define BLF_JSON_MSG_ID         "Msg-ID"
59 59
 #define BLF_JSON_DIRECTION      "Direction"
60
+#define BLF_JSON_BROKER_ZONE    "AMQP-Broker-Zone"
60 61
 
61 62
 #define BLF_JSON_CONTACT   	"Contact"
62 63
 #define BLF_JSON_EVENT_PKG      "Event-Package"
Browse code

core, lib, modules: restructured source code tree

- new folder src/ to hold the source code for main project applications
- main.c is in src/
- all core files are subfolder are in src/core/
- modules are in src/modules/
- libs are in src/lib/
- application Makefiles are in src/
- application binary is built in src/ (src/kamailio)

Daniel-Constantin Mierla authored on 07/12/2016 11:03:51
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,141 @@
1
+/*
2
+ * $Id$
3
+ *
4
+ * Kazoo module interface
5
+ *
6
+ * Copyright (C) 2010-2014 2600Hz
7
+ *
8
+ * This file is part of Kamailio, a free SIP server.
9
+ *
10
+ * Kamailio is free software; you can redistribute it and/or modify
11
+ * it under the terms of the GNU General Public License as published by
12
+ * the Free Software Foundation; either version 2 of the License, or
13
+ * (at your option) any later version
14
+ *
15
+ * Kamailio is distributed in the hope that it will be useful,
16
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
17
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
+ * GNU General Public License for more details.
19
+ *
20
+ * You should have received a copy of the GNU General Public License
21
+ * along with this program; if not, write to the Free Software
22
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
23
+ *
24
+ * History:
25
+ * --------
26
+ * 2014-08  first version (2600hz)
27
+ */
28
+
29
+#ifndef DBK_DEFS_H_
30
+#define DBK_DEFS_H_
31
+
32
+#define BLF_MAX_DIALOGS 8
33
+#define BLF_JSON_PRES		"Presentity"
34
+#define BLF_JSON_PRES_USER	"Presentity-User"
35
+#define BLF_JSON_PRES_REALM	"Presentity-Realm"
36
+#define BLF_JSON_FROM      	"From"
37
+#define BLF_JSON_FROM_USER 	"From-User"
38
+#define BLF_JSON_FROM_REALM	"From-Realm"
39
+#define BLF_JSON_FROM_URI	"From-URI"
40
+#define BLF_JSON_TO        	"To"
41
+#define BLF_JSON_TO_USER 	"To-User"
42
+#define BLF_JSON_TO_REALM	"To-Realm"
43
+#define BLF_JSON_TO_URI		"To-URI"
44
+#define BLF_JSON_CALLID    	"Call-ID"
45
+#define BLF_JSON_TOTAG     	"To-Tag"
46
+#define BLF_JSON_FROMTAG   	"From-Tag"
47
+#define BLF_JSON_STATE     	"State"
48
+#define BLF_JSON_USER      	"User"
49
+#define BLF_JSON_QUEUE     	"Queue"
50
+#define BLF_JSON_EXPIRES	"Expires"
51
+#define BLF_JSON_APP_NAME       "App-Name"
52
+#define BLF_JSON_APP_VERSION    "App-Version"
53
+#define BLF_JSON_NODE           "Node"
54
+#define BLF_JSON_SERVERID       "Server-ID"
55
+#define BLF_JSON_EVENT_CATEGORY "Event-Category"
56
+#define BLF_JSON_EVENT_NAME     "Event-Name"
57
+#define BLF_JSON_TYPE           "Type"
58
+#define BLF_JSON_MSG_ID         "Msg-ID"
59
+#define BLF_JSON_DIRECTION      "Direction"
60
+
61
+#define BLF_JSON_CONTACT   	"Contact"
62
+#define BLF_JSON_EVENT_PKG      "Event-Package"
63
+#define MWI_JSON_WAITING        "Messages-Waiting"
64
+#define MWI_JSON_NEW            "Messages-New"
65
+#define MWI_JSON_SAVED          "Messages-Saved"
66
+#define MWI_JSON_URGENT         "Messages-Urgent"
67
+#define MWI_JSON_URGENT_SAVED   "Messages-Urgent-Saved"
68
+#define MWI_JSON_ACCOUNT        "Message-Account"
69
+#define MWI_JSON_FROM      	"From"
70
+#define MWI_JSON_TO        	"To"
71
+
72
+#define DIALOGINFO_BODY_BUFFER_SIZE 8192
73
+#define MWI_BODY_BUFFER_SIZE 2048
74
+#define PRESENCE_BODY_BUFFER_SIZE 4096
75
+
76
+#define MWI_BODY             "Messages-Waiting: %.*s\r\nMessage-Account: %.*s\r\nVoice-Message: %.*s/%.*s (%.*s/%.*s)\r\n"
77
+#define PRESENCE_BODY        "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\
78
+<presence xmlns=\"urn:ietf:params:xml:ns:pidf\" xmlns:dm=\"urn:ietf:params:xml:ns:pidf:data-model\" xmlns:rpid=\"urn:ietf:params:xml:ns:pidf:rpid\" xmlns:c=\"urn:ietf:params:xml:ns:pidf:cipid\" entity=\"%s\"> \
79
+<tuple xmlns=\"urn:ietf:params:xml:ns:pidf\" id=\"%s\">\
80
+<status>\
81
+<basic>%s</basic>\
82
+</status>\
83
+</tuple>\
84
+<note xmlns=\"urn:ietf:params:xml:ns:pidf\">%s</note>\
85
+<dm:person xmlns:dm=\"urn:ietf:params:xml:ns:pidf:data-model\" xmlns:rpid=\"urn:ietf:params:xml:ns:pidf:rpid\" id=\"1\">\
86
+<rpid:activities>%s</rpid:activities>\
87
+<dm:note>%s</dm:note>\
88
+</dm:person>\
89
+</presence>"
90
+
91
+#define DIALOGINFO_EMPTY_BODY "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\
92
+<dialog-info xmlns=\"urn:ietf:params:xml:ns:dialog-info\" version=\"1\" state=\"full\" entity=\"%.*s\"> \
93
+<dialog call-id=\"76001e23e09704ea9e1257ebea85e1f3\" direction=\"initiator\">\
94
+<state>terminated</state>\
95
+</dialog>\
96
+</dialog-info>"
97
+
98
+#define LOCAL_TAG "local-tag=\"%.*s\""
99
+#define REMOTE_TAG "remote-tag=\"%.*s\""
100
+
101
+#define DIALOGINFO_BODY "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\
102
+<dialog-info xmlns=\"urn:ietf:params:xml:ns:dialog-info\" version=\"1\" state=\"full\" entity=\"%.*s\">\
103
+<dialog id=\"%.*s\" call-id=\"%.*s\" %.*s %.*s direction=\"%.*s\">\
104
+<state>%.*s</state>\
105
+<local>\
106
+<identity display=\"%.*s\">%.*s</identity>\
107
+<target uri=\"%.*s\"/>\
108
+</local>\
109
+<remote>\
110
+<identity display=\"%.*s\">%.*s</identity>\
111
+<target uri=\"%.*s\"/>\
112
+</remote>\
113
+</dialog>\
114
+</dialog-info>"
115
+
116
+#define DIALOGINFO_BODY_2 "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\
117
+<dialog-info xmlns=\"urn:ietf:params:xml:ns:dialog-info\" version=\"1\" state=\"full\" entity=\"%.*s\">\
118
+<dialog id=\"%.*s\" call-id=\"%.*s\" %.*s %.*s direction=\"%.*s\">\
119
+<state>%.*s</state>\
120
+<local>\
121
+<identity display=\"%.*s\">%.*s</identity>\
122
+</local>\
123
+<remote>\
124
+<identity display=\"%.*s\">%.*s</identity>\
125
+</remote>\
126
+</dialog>\
127
+</dialog-info>"
128
+
129
+#define json_extract_field(json_name, field)  do {                      \
130
+    struct json_object* obj =  kz_json_get_object(json_obj, json_name); \
131
+    field.s = (char*)json_object_get_string(obj);                       \
132
+    if (field.s == NULL) {                                              \
133
+      LM_DBG("Json-c error - failed to extract field [%s]\n", json_name); \
134
+      field.s = "";                                                     \
135
+    } else {                                                            \
136
+      field.len = strlen(field.s);                                      \
137
+    }                                                                   \
138
+    LM_DBG("%s: [%s]\n", json_name, field.s?field.s:"Empty");           \
139
+  } while (0);
140
+
141
+#endif /* DBK_DEFS_H_ */