Browse code

modules_k/*: moved k modules in directory modules/

Daniel-Constantin Mierla authored on 20/01/2013 11:57:52
Showing 1 changed files
1 1
deleted file mode 100644
... ...
@@ -1,145 +0,0 @@
1
-/* $Id$
2
- *
3
- * Copyright (C) 2006-2007 VozTelecom Sistemas S.L
4
- *
5
- * This file is part of Kamailio, a free SIP server.
6
- *
7
- * Kamailio is free software; you can redistribute it and/or modify
8
- * it under the terms of the GNU General Public License as published by
9
- * the Free Software Foundation; either version 2 of the License, or
10
- * (at your option) any later version
11
- *
12
- * Kamailio is distributed in the hope that it will be useful,
13
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
- * GNU General Public License for more details.
16
- *
17
- * You should have received a copy of the GNU General Public License 
18
- * along with this program; if not, write to the Free Software 
19
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
20
- */
21
-
22
-/*
23
- * =====================================================================================
24
- * 
25
- *        Filename:  xaddress.c
26
- * 
27
- *     Description:  Address manipulation tools
28
- * 
29
- *         Version:  1.0
30
- *         Created:  17/11/05 02:09:44 CET
31
- *        Revision:  none
32
- *        Compiler:  gcc
33
- * 
34
- *          Author:  Elias Baixas (EB), elias@conillera.net
35
- *         Company:  VozTele.com
36
- * 
37
- * =====================================================================================
38
- */
39
-#define _GNU_SOURCE
40
-#include <stdio.h>
41
-#include <string.h>
42
-#include <netinet/in.h>
43
-#include "../../mem/mem.h"
44
-#include "../../parser/parse_cseq.h"
45
-#include "../../dprint.h"
46
-#include "../../ut.h"
47
-#include "xaddress.h"/*for SLOG*/
48
-
49
-/* Encoder for CSeq header
50
- * Returns the length of the encoded structure in bytes
51
- * FORMAT (byte meanings):
52
- * 1: method_id
53
- * 4: cseqnum in network byte order
54
- * 2: HDR-based ptr to the method number + number length
55
- * 2: HDR-based ptr to the method name + method length
56
- *
57
- */
58
-int encode_cseq(char *hdrstart,int hdrlen,struct cseq_body *body,unsigned char *where)
59
-{
60
-   unsigned int cseqnum;
61
-   unsigned char i;
62
-
63
-   /*which is the first bit set to 1 ? if i==0, the first bit, 
64
-    * if i==31, the last, if i==32, none*/
65
-   for(i=0;(!(body->method_id & (0x01<<i))) && i<32;i++);
66
-   if(i==32)
67
-      i=0;
68
-   else
69
-      i++;
70
-   where[0]=i;
71
-   if(str2int(&body->number,&cseqnum)<0){
72
-      LM_ERR("str2int(cseq number)\n");
73
-      return -1;
74
-   }
75
-   cseqnum=htonl(cseqnum);
76
-   memcpy(&where[1],&cseqnum,4);/*I use 4 because 3261 says CSEq num must be 32 bits long*/
77
-   where[5]=(unsigned char)(body->number.s-hdrstart);
78
-   where[6]=(unsigned char)(body->number.len);
79
-   where[7]=(unsigned char)(body->method.s-hdrstart);
80
-   where[8]=(unsigned char)(body->method.len);
81
-   return 9;
82
-}
83
-
84
-int print_encoded_cseq(FILE *fd,char *hdr,int hdrlen,unsigned char* payload,int paylen,char *prefix)
85
-{
86
-   unsigned int cseqnum;
87
-   char *what;
88
-
89
-   memcpy(&cseqnum,&payload[1],4);
90
-   cseqnum=ntohl(cseqnum);
91
-   fprintf(fd,"%sCSEQ NUMBER=%d==%.*s\n",prefix,cseqnum,payload[6],&hdr[payload[5]]);
92
-   switch(payload[0]){
93
-      case 0:
94
-	 what="UNDEFINED";
95
-	 break;
96
-      case 1:
97
-	 what="INVITE";
98
-	 break;
99
-      case 2:
100
-	 what="CANCEL";
101
-	 break;
102
-      case 3:
103
-	 what="ACK";
104
-	 break;
105
-      case 4:
106
-	 what="BYE";
107
-	 break;
108
-      case 5:
109
-	 what="INFO";
110
-	 break;
111
-      case 6:
112
-	 what="OPTIONS";
113
-	 break;
114
-      case 7:
115
-	 what="UPDATE";
116
-	 break;
117
-      case 8:
118
-	 what="REGISTER";
119
-	 break;
120
-      case 9:
121
-	 what="MESSAGE";
122
-	 break;
123
-      case 10:
124
-	 what="SUBSCRIBE";
125
-	 break;
126
-      case 11:
127
-	 what="NOTIFY";
128
-	 break;
129
-      case 12:
130
-	 what="PRACK";
131
-	 break;
132
-      case 13:
133
-	 what="REFER";
134
-	 break;
135
-      case 14:
136
-	 what="OTHER";
137
-	 break;
138
-      default:
139
-	 what="UNKNOWN?";
140
-	 break;
141
-   }
142
-   fprintf(fd,"%sCSEQ METHOD=%s==%.*s\n",prefix,what,payload[8],&hdr[payload[7]]);
143
-   return 1;
144
-
145
-}
Browse code

Replaced dprintf for fprintf (dprintf is somewhat gnu-specific and does not compile on Mac). even though it was just used for debugging (not on the module) it prevented compilation

git-svn-id: https://openser.svn.sourceforge.net/svnroot/openser/trunk@5192 689a6050-402a-0410-94f2-e92a70836424

Elias Baixas authored on 13/11/2008 10:18:48
Showing 1 changed files
... ...
@@ -81,14 +81,14 @@ int encode_cseq(char *hdrstart,int hdrlen,struct cseq_body *body,unsigned char *
81 81
    return 9;
82 82
 }
83 83
 
84
-int print_encoded_cseq(int fd,char *hdr,int hdrlen,unsigned char* payload,int paylen,char *prefix)
84
+int print_encoded_cseq(FILE *fd,char *hdr,int hdrlen,unsigned char* payload,int paylen,char *prefix)
85 85
 {
86 86
    unsigned int cseqnum;
87 87
    char *what;
88 88
 
89 89
    memcpy(&cseqnum,&payload[1],4);
90 90
    cseqnum=ntohl(cseqnum);
91
-   dprintf(fd,"%sCSEQ NUMBER=%d==%.*s\n",prefix,cseqnum,payload[6],&hdr[payload[5]]);
91
+   fprintf(fd,"%sCSEQ NUMBER=%d==%.*s\n",prefix,cseqnum,payload[6],&hdr[payload[5]]);
92 92
    switch(payload[0]){
93 93
       case 0:
94 94
 	 what="UNDEFINED";
... ...
@@ -139,7 +139,7 @@ int print_encoded_cseq(int fd,char *hdr,int hdrlen,unsigned char* payload,int pa
139 139
 	 what="UNKNOWN?";
140 140
 	 break;
141 141
    }
142
-   dprintf(fd,"%sCSEQ METHOD=%s==%.*s\n",prefix,what,payload[8],&hdr[payload[7]]);
142
+   fprintf(fd,"%sCSEQ METHOD=%s==%.*s\n",prefix,what,payload[8],&hdr[payload[7]]);
143 143
    return 1;
144 144
 
145 145
 }
Browse code

- change name in copyright headers

git-svn-id: https://openser.svn.sourceforge.net/svnroot/openser/trunk@4518 689a6050-402a-0410-94f2-e92a70836424

Henning Westerholt authored on 28/07/2008 15:39:28
Showing 1 changed files
... ...
@@ -2,14 +2,14 @@
2 2
  *
3 3
  * Copyright (C) 2006-2007 VozTelecom Sistemas S.L
4 4
  *
5
- * This file is part of openser, a free SIP server.
5
+ * This file is part of Kamailio, a free SIP server.
6 6
  *
7
- * openser is free software; you can redistribute it and/or modify
7
+ * Kamailio is free software; you can redistribute it and/or modify
8 8
  * it under the terms of the GNU General Public License as published by
9 9
  * the Free Software Foundation; either version 2 of the License, or
10 10
  * (at your option) any later version
11 11
  *
12
- * openser is distributed in the hope that it will be useful,
12
+ * Kamailio is distributed in the hope that it will be useful,
13 13
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 14
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 15
  * GNU General Public License for more details.
Browse code

- changed LOG with LM_*

git-svn-id: https://openser.svn.sourceforge.net/svnroot/openser/trunk@2943 689a6050-402a-0410-94f2-e92a70836424

Anca Vamanu authored on 19/10/2007 15:15:01
Showing 1 changed files
... ...
@@ -69,7 +69,7 @@ int encode_cseq(char *hdrstart,int hdrlen,struct cseq_body *body,unsigned char *
69 69
       i++;
70 70
    where[0]=i;
71 71
    if(str2int(&body->number,&cseqnum)<0){
72
-      LOG(L_ERR,"str2int(cseq number)\n");
72
+      LM_ERR("str2int(cseq number)\n");
73 73
       return -1;
74 74
    }
75 75
    cseqnum=htonl(cseqnum);
Browse code

- added license and copyright

git-svn-id: https://openser.svn.sourceforge.net/svnroot/openser/trunk@1819 689a6050-402a-0410-94f2-e92a70836424

Daniel-Constantin Mierla authored on 11/03/2007 19:20:59
Showing 1 changed files
... ...
@@ -1,4 +1,24 @@
1
-/* $Id$ */
1
+/* $Id$
2
+ *
3
+ * Copyright (C) 2006-2007 VozTelecom Sistemas S.L
4
+ *
5
+ * This file is part of openser, a free SIP server.
6
+ *
7
+ * openser is free software; you can redistribute it and/or modify
8
+ * it under the terms of the GNU General Public License as published by
9
+ * the Free Software Foundation; either version 2 of the License, or
10
+ * (at your option) any later version
11
+ *
12
+ * openser is distributed in the hope that it will be useful,
13
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
+ * GNU General Public License for more details.
16
+ *
17
+ * You should have received a copy of the GNU General Public License 
18
+ * along with this program; if not, write to the Free Software 
19
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
20
+ */
21
+
2 22
 /*
3 23
  * =====================================================================================
4 24
  * 
Browse code

reverted to old logging system. fixed a couple of warnings regarding printf("%d",(int)sizeof(something))

git-svn-id: https://openser.svn.sourceforge.net/svnroot/openser/trunk@1767 689a6050-402a-0410-94f2-e92a70836424

Elias Baixas authored on 08/03/2007 11:08:03
Showing 1 changed files
... ...
@@ -49,7 +49,7 @@ int encode_cseq(char *hdrstart,int hdrlen,struct cseq_body *body,unsigned char *
49 49
       i++;
50 50
    where[0]=i;
51 51
    if(str2int(&body->number,&cseqnum)<0){
52
-      SLOG(L_ERR,"str2int(cseq number)\n");
52
+      LOG(L_ERR,"str2int(cseq number)\n");
53 53
       return -1;
54 54
    }
55 55
    cseqnum=htonl(cseqnum);
Browse code

Changed the logging system

git-svn-id: https://openser.svn.sourceforge.net/svnroot/openser/trunk@1725 689a6050-402a-0410-94f2-e92a70836424

Elias Baixas authored on 01/03/2007 17:25:55
Showing 1 changed files
... ...
@@ -24,6 +24,7 @@
24 24
 #include "../../parser/parse_cseq.h"
25 25
 #include "../../dprint.h"
26 26
 #include "../../ut.h"
27
+#include "xaddress.h"/*for SLOG*/
27 28
 
28 29
 /* Encoder for CSeq header
29 30
  * Returns the length of the encoded structure in bytes
... ...
@@ -48,7 +49,7 @@ int encode_cseq(char *hdrstart,int hdrlen,struct cseq_body *body,unsigned char *
48 49
       i++;
49 50
    where[0]=i;
50 51
    if(str2int(&body->number,&cseqnum)<0){
51
-      LOG(L_ERR,"ERROR: encode_cseq: str2int(cseq number)\n");
52
+      SLOG(L_ERR,"str2int(cseq number)\n");
52 53
       return -1;
53 54
    }
54 55
    cseqnum=htonl(cseqnum);
Browse code

Added code files for SEAS module

git-svn-id: https://openser.svn.sourceforge.net/svnroot/openser/trunk@1448 689a6050-402a-0410-94f2-e92a70836424

Elias Baixas authored on 22/12/2006 17:07:44
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,124 @@
1
+/* $Id$ */
2
+/*
3
+ * =====================================================================================
4
+ * 
5
+ *        Filename:  xaddress.c
6
+ * 
7
+ *     Description:  Address manipulation tools
8
+ * 
9
+ *         Version:  1.0
10
+ *         Created:  17/11/05 02:09:44 CET
11
+ *        Revision:  none
12
+ *        Compiler:  gcc
13
+ * 
14
+ *          Author:  Elias Baixas (EB), elias@conillera.net
15
+ *         Company:  VozTele.com
16
+ * 
17
+ * =====================================================================================
18
+ */
19
+#define _GNU_SOURCE
20
+#include <stdio.h>
21
+#include <string.h>
22
+#include <netinet/in.h>
23
+#include "../../mem/mem.h"
24
+#include "../../parser/parse_cseq.h"
25
+#include "../../dprint.h"
26
+#include "../../ut.h"
27
+
28
+/* Encoder for CSeq header
29
+ * Returns the length of the encoded structure in bytes
30
+ * FORMAT (byte meanings):
31
+ * 1: method_id
32
+ * 4: cseqnum in network byte order
33
+ * 2: HDR-based ptr to the method number + number length
34
+ * 2: HDR-based ptr to the method name + method length
35
+ *
36
+ */
37
+int encode_cseq(char *hdrstart,int hdrlen,struct cseq_body *body,unsigned char *where)
38
+{
39
+   unsigned int cseqnum;
40
+   unsigned char i;
41
+
42
+   /*which is the first bit set to 1 ? if i==0, the first bit, 
43
+    * if i==31, the last, if i==32, none*/
44
+   for(i=0;(!(body->method_id & (0x01<<i))) && i<32;i++);
45
+   if(i==32)
46
+      i=0;
47
+   else
48
+      i++;
49
+   where[0]=i;
50
+   if(str2int(&body->number,&cseqnum)<0){
51
+      LOG(L_ERR,"ERROR: encode_cseq: str2int(cseq number)\n");
52
+      return -1;
53
+   }
54
+   cseqnum=htonl(cseqnum);
55
+   memcpy(&where[1],&cseqnum,4);/*I use 4 because 3261 says CSEq num must be 32 bits long*/
56
+   where[5]=(unsigned char)(body->number.s-hdrstart);
57
+   where[6]=(unsigned char)(body->number.len);
58
+   where[7]=(unsigned char)(body->method.s-hdrstart);
59
+   where[8]=(unsigned char)(body->method.len);
60
+   return 9;
61
+}
62
+
63
+int print_encoded_cseq(int fd,char *hdr,int hdrlen,unsigned char* payload,int paylen,char *prefix)
64
+{
65
+   unsigned int cseqnum;
66
+   char *what;
67
+
68
+   memcpy(&cseqnum,&payload[1],4);
69
+   cseqnum=ntohl(cseqnum);
70
+   dprintf(fd,"%sCSEQ NUMBER=%d==%.*s\n",prefix,cseqnum,payload[6],&hdr[payload[5]]);
71
+   switch(payload[0]){
72
+      case 0:
73
+	 what="UNDEFINED";
74
+	 break;
75
+      case 1:
76
+	 what="INVITE";
77
+	 break;
78
+      case 2:
79
+	 what="CANCEL";
80
+	 break;
81
+      case 3:
82
+	 what="ACK";
83
+	 break;
84
+      case 4:
85
+	 what="BYE";
86
+	 break;
87
+      case 5:
88
+	 what="INFO";
89
+	 break;
90
+      case 6:
91
+	 what="OPTIONS";
92
+	 break;
93
+      case 7:
94
+	 what="UPDATE";
95
+	 break;
96
+      case 8:
97
+	 what="REGISTER";
98
+	 break;
99
+      case 9:
100
+	 what="MESSAGE";
101
+	 break;
102
+      case 10:
103
+	 what="SUBSCRIBE";
104
+	 break;
105
+      case 11:
106
+	 what="NOTIFY";
107
+	 break;
108
+      case 12:
109
+	 what="PRACK";
110
+	 break;
111
+      case 13:
112
+	 what="REFER";
113
+	 break;
114
+      case 14:
115
+	 what="OTHER";
116
+	 break;
117
+      default:
118
+	 what="UNKNOWN?";
119
+	 break;
120
+   }
121
+   dprintf(fd,"%sCSEQ METHOD=%s==%.*s\n",prefix,what,payload[8],&hdr[payload[7]]);
122
+   return 1;
123
+
124
+}