Browse code

core:zrtp: make ZRTP debug logging configurable

Stefan Sayer authored on 03/11/2014 16:46:54
Showing 1 changed files
... ...
@@ -222,6 +222,7 @@ struct AmConfig
222 222
 
223 223
 #ifdef WITH_ZRTP
224 224
   static bool enable_zrtp;
225
+  static bool enable_zrtp_debuglog;
225 226
 #endif
226 227
 
227 228
   static unsigned int SessionLimit;
Browse code

zrtp: updated ZRTP support, compiles with the current zfone SDK

use the zfone SDK from https://github.com/traviscross/libzrtp

Stefan Sayer authored on 30/10/2014 22:31:46
Showing 1 changed files
... ...
@@ -220,6 +220,10 @@ struct AmConfig
220 220
   /* this is regex->application mapping is used if  App_MAPPING */
221 221
   static RegexMappingVector AppMapping; 
222 222
 
223
+#ifdef WITH_ZRTP
224
+  static bool enable_zrtp;
225
+#endif
226
+
223 227
   static unsigned int SessionLimit;
224 228
   static unsigned int SessionLimitErrCode;
225 229
   static string SessionLimitErrReason;
Browse code

sip: moved resolve_targets() to resolver

Raphael Coeffic authored on 19/11/2013 12:31:01
Showing 1 changed files
... ...
@@ -196,8 +196,6 @@ struct AmConfig
196 196
   static bool UseRawSockets;
197 197
   /** Ignore Low CSeq on NOTIFY  - for RFC 3265 instead of 5057 */
198 198
   static bool IgnoreNotifyLowerCSeq;
199
-  /** skip DNS SRV lookup for resolving destination address*/
200
-  static bool DisableDNSSRV;
201 199
   /** Server/User-Agent header (optional) */
202 200
   static string Signature;
203 201
   /** Value of Max-Forward header field for new requests */
Browse code

sip: added tcp_connect_timeout & tcp_idle_timeout

Both options can be set per signalling interface ([tcp-option]_[interface name]=[time in milliseconds]). When set to 0, the feature is disabled.

Raphael Coeffic authored on 13/11/2013 17:33:32
Showing 1 changed files
... ...
@@ -110,6 +110,9 @@ struct AmConfig
110 110
      */
111 111
     unsigned int SigSockOpts;
112 112
 
113
+    unsigned int tcp_connect_timeout;
114
+    unsigned int tcp_idle_timeout;
115
+
113 116
     /** RTP interface index */
114 117
     int RtpInterface;
115 118
 
Browse code

Merge branch 'master' into 1.6-dev

Václav Kubart authored on 12/11/2013 06:30:28
Showing 0 changed files
Browse code

core: CPS limiter Calls-per-sec limiting capability, similar to the maximum number of calls limiter. There is a "soft limit" that is intended to use by the applications: if the app uses async processing and detects that the incoming workload is too much for the currenti capacity (which can depend on for example the remote DB engine's load), it can slewi it back to some percent of the current CPS; then when the circumstances are restored it can switch the CPS limit back to the configuration (or XMLRPC/stats interface) mandated value.

Szókovács Róbert authored on 07/11/2013 14:59:47
Showing 1 changed files
... ...
@@ -224,6 +224,9 @@ struct AmConfig
224 224
   static unsigned int OptionsSessionLimitErrCode;
225 225
   static string OptionsSessionLimitErrReason;
226 226
 
227
+  static unsigned int CPSLimitErrCode;
228
+  static string CPSLimitErrReason;
229
+
227 230
   static bool AcceptForkedDialogs;
228 231
 
229 232
   static bool ShutdownMode;
Browse code

core: add link MTU detection to be used by raw sockets

Raphael Coeffic authored on 17/10/2013 15:14:32
Showing 1 changed files
... ...
@@ -154,9 +154,10 @@ struct AmConfig
154 154
     list<IPAddr> addrs;
155 155
     // identical to those returned by SIOCGIFFLAGS
156 156
     unsigned int flags;
157
+    unsigned int mtu;
157 158
   };
158 159
 
159
-  static list<SysIntf> SysIfs;
160
+  static vector<SysIntf> SysIfs;
160 161
 
161 162
   static int insert_SIP_interface(const SIP_interface& intf);
162 163
   static int insert_RTP_interface(const RTP_interface& intf);
Browse code

udp: raw socket support

To use this feature, set following in sems.conf:
use_raw_sockets=yes

Raphael Coeffic authored on 15/10/2013 07:42:43
Showing 1 changed files
... ...
@@ -188,6 +188,8 @@ struct AmConfig
188 188
   static bool ForceSymmetricRtp;
189 189
   /** turn on SIP NAT handling (remote signaling address learning) */
190 190
   static bool SipNATHandling;
191
+  /** use raw socket to send UDP packets (root permission required) */
192
+  static bool UseRawSockets;
191 193
   /** Ignore Low CSeq on NOTIFY  - for RFC 3265 instead of 5057 */
192 194
   static bool IgnoreNotifyLowerCSeq;
193 195
   /** skip DNS SRV lookup for resolving destination address*/
Browse code

core/sbc: use PublicIP everywhere an external IP is required

fixes the issue where the local IP was used in reg-cached contacts.

Raphael Coeffic authored on 22/08/2013 07:14:38 • Václav Kubart committed on 16/10/2013 09:19:51
Showing 1 changed files
... ...
@@ -94,6 +94,10 @@ struct AmConfig
94 94
     unsigned int NetIfIdx;
95 95
 
96 96
     IP_interface();
97
+
98
+    string getIP() {
99
+      return PublicIP.empty() ?	LocalIP : PublicIP;
100
+    }
97 101
   };
98 102
 
99 103
   struct SIP_interface : public IP_interface {
Browse code

core: sip_nat_handling config option to learn next_hop from remote IP

Stefan Sayer authored on 29/07/2013 13:42:50
Showing 1 changed files
... ...
@@ -182,6 +182,8 @@ struct AmConfig
182 182
   static bool ForceOutboundIf;
183 183
   /** force comedia style remote address learning */
184 184
   static bool ForceSymmetricRtp;
185
+  /** turn on SIP NAT handling (remote signaling address learning) */
186
+  static bool SipNATHandling;
185 187
   /** Ignore Low CSeq on NOTIFY  - for RFC 3265 instead of 5057 */
186 188
   static bool IgnoreNotifyLowerCSeq;
187 189
   /** skip DNS SRV lookup for resolving destination address*/
Browse code

core: force_symmetric_rtp option to force comedia style remote RTP address learning for NAT

Stefan Sayer authored on 24/07/2013 15:03:24
Showing 1 changed files
... ...
@@ -180,6 +180,8 @@ struct AmConfig
180 180
   static bool ProxyStickyAuth;
181 181
   /** force the outbound network interface / short-circuit the routing table */
182 182
   static bool ForceOutboundIf;
183
+  /** force comedia style remote address learning */
184
+  static bool ForceSymmetricRtp;
183 185
   /** Ignore Low CSeq on NOTIFY  - for RFC 3265 instead of 5057 */
184 186
   static bool IgnoreNotifyLowerCSeq;
185 187
   /** skip DNS SRV lookup for resolving destination address*/
Browse code

new interface config

Allows for signaling-only or media-only interfaces.

The parameter "additional_interfaces" has been renamed to
"interfaces". When not present, SEMS will look for IP config
parameters without any suffixes (sip_ip, media_ip, etc...).

If the "media_ip_[interface name]" is set, the interface is considered
to be a media interface. If the "sip_ip_[interface name]" parameter
is defined, the interface is considered to be a media interface. If
both parameters are defined for the same interface, it is a signaling
and media interface.

Raphael Coeffic authored on 29/10/2012 08:55:54
Showing 1 changed files
... ...
@@ -83,35 +83,43 @@ struct AmConfig
83 83
 
84 84
     string name;
85 85
 
86
-    /** local IP for SDP media advertising */
87
-    string LocalIP;
88
-    
89
-    /** public IP for SDP media advertising; we actually
90
-     *  bind to local IP, but advertise public IP. */ 
86
+    /** Used for binding socket */
87
+    string       LocalIP;
88
+        
89
+    /** Used in Contact-HF */
91 90
     string PublicIP;
92
-    
93
-    /** Lowest local RTP port */
94
-    int RtpLowPort;
95
-    /** Highest local RTP port */
96
-    int RtpHighPort;
97
-    
98
-    /** the interface SIP requests are sent from - needed for registrar_client */
99
-    string LocalSIPIP;
100
-    /** the port SIP requests are sent from - optional (default 5060) */
101
-    int LocalSIPPort;
102 91
 
103
-    /** Network interface name and index for media */
104
-    string       MediaIf;
105
-    unsigned int MediaIfIdx;
92
+    /** Network interface name and index */
93
+    string       NetIf;
94
+    unsigned int NetIfIdx;
95
+
96
+    IP_interface();
97
+  };
106 98
 
107
-    /** Network interface name and index for signaling */
108
-    string       SipIf;
109
-    unsigned int SipIfIdx;
99
+  struct SIP_interface : public IP_interface {
110 100
 
111
-    /** options for the signaling socket (@see trsp_socket::socket_options) */
101
+    /** Used for binding SIP socket */
102
+    unsigned int LocalPort;
103
+        
104
+    /** options for the signaling socket 
105
+     * (@see trsp_socket::socket_options) 
106
+     */
112 107
     unsigned int SigSockOpts;
113 108
 
114
-    IP_interface();
109
+    /** RTP interface index */
110
+    int RtpInterface;
111
+
112
+    SIP_interface();
113
+  };
114
+
115
+  struct RTP_interface : public IP_interface {
116
+
117
+    /** Lowest local RTP port */
118
+    int RtpLowPort;
119
+    /** Highest local RTP port */
120
+    int RtpHighPort;
121
+
122
+    RTP_interface();
115 123
 
116 124
     int getNextRtpPort();
117 125
 
... ...
@@ -120,8 +128,11 @@ struct AmConfig
120 128
     AmMutex next_rtp_port_mut;
121 129
   };
122 130
 
123
-  static vector<IP_interface>       Ifs;
124
-  static map<string,unsigned short> If_names;
131
+  static vector<SIP_interface>      SIP_Ifs;
132
+  static vector<RTP_interface>      RTP_Ifs;
133
+  static map<string,unsigned short> SIP_If_names;
134
+  static map<string,unsigned short> RTP_If_names;
135
+  static map<string,unsigned short> LocalSIPIP2If;
125 136
 
126 137
   struct IPAddr {
127 138
     string addr;
... ...
@@ -142,8 +153,9 @@ struct AmConfig
142 153
   };
143 154
 
144 155
   static list<SysIntf> SysIfs;
145
-  static multimap<string,unsigned short> LocalSIPIP2If;
146 156
 
157
+  static int insert_SIP_interface(const SIP_interface& intf);
158
+  static int insert_RTP_interface(const RTP_interface& intf);
147 159
   static int finalizeIPConfig();
148 160
 
149 161
   static void dump_Ifs();
Browse code

support for forcing outbound network interface on packets sent (RTP/SIP)

Raphael Coeffic authored on 13/11/2012 13:01:13
Showing 1 changed files
... ...
@@ -100,6 +100,14 @@ struct AmConfig
100 100
     /** the port SIP requests are sent from - optional (default 5060) */
101 101
     int LocalSIPPort;
102 102
 
103
+    /** Network interface name and index for media */
104
+    string       MediaIf;
105
+    unsigned int MediaIfIdx;
106
+
107
+    /** Network interface name and index for signaling */
108
+    string       SipIf;
109
+    unsigned int SipIfIdx;
110
+
103 111
     /** options for the signaling socket (@see trsp_socket::socket_options) */
104 112
     unsigned int SigSockOpts;
105 113
 
... ...
@@ -158,6 +166,8 @@ struct AmConfig
158 166
   static bool NextHop1stReq;
159 167
   /** update ruri-host to previously resolved IP:port on SIP auth */
160 168
   static bool ProxyStickyAuth;
169
+  /** force the outbound network interface / short-circuit the routing table */
170
+  static bool ForceOutboundIf;
161 171
   /** Ignore Low CSeq on NOTIFY  - for RFC 3265 instead of 5057 */
162 172
   static bool IgnoreNotifyLowerCSeq;
163 173
   /** skip DNS SRV lookup for resolving destination address*/
... ...
@@ -169,7 +179,7 @@ struct AmConfig
169 179
   /** If 200 OK reply should be limited to preferred codec only */
170 180
   static bool SingleCodecInOK;
171 181
   static vector <string> CodecOrder;
172
-  
182
+
173 183
   enum ApplicationSelector {
174 184
     App_RURIUSER,
175 185
     App_RURIPARAM,
Browse code

fixed IPv6 support

limitations: IPv6 DNS lookups are not supported yet.

Raphael Coeffic authored on 19/11/2012 16:23:06
Showing 1 changed files
... ...
@@ -115,9 +115,20 @@ struct AmConfig
115 115
   static vector<IP_interface>       Ifs;
116 116
   static map<string,unsigned short> If_names;
117 117
 
118
+  struct IPAddr {
119
+    string addr;
120
+    short  family;
121
+    
122
+    IPAddr(const string& addr, const short family)
123
+      : addr(addr), family(family) {}
124
+
125
+    IPAddr(const IPAddr& ip)
126
+      : addr(ip.addr), family(ip.family) {}
127
+  };
128
+
118 129
   struct SysIntf {
119 130
     string       name;
120
-    list<string> addrs;
131
+    list<IPAddr> addrs;
121 132
     // identical to those returned by SIOCGIFFLAGS
122 133
     unsigned int flags;
123 134
   };
... ...
@@ -262,7 +273,7 @@ struct AmConfig
262 273
 };
263 274
 
264 275
 /** Get the PF_INET address associated with the network interface */
265
-string fixIface2IP(const string& dev_name);
276
+string fixIface2IP(const string& dev_name, bool v6_for_sip);
266 277
 
267 278
 #endif
268 279
 
Browse code

sbc: add next_hop_1st_req flag

this new flag allows to decide whether or not next_hop should be used only for the first request within a dialog (=true), or for each and every request.

Raphael Coeffic authored on 12/09/2012 21:05:53
Showing 1 changed files
... ...
@@ -143,6 +143,8 @@ struct AmConfig
143 143
   static bool ForceOutboundProxy;
144 144
   /** force next hop IP[:port] */
145 145
   static string NextHop;
146
+  /** use next hop only on 1st request within a dialog */
147
+  static bool NextHop1stReq;
146 148
   /** update ruri-host to previously resolved IP:port on SIP auth */
147 149
   static bool ProxyStickyAuth;
148 150
   /** Ignore Low CSeq on NOTIFY  - for RFC 3265 instead of 5057 */
Browse code

transcoder: statistics about used codecs can be put into all requests and replies

Václav Kubart authored on 25/04/2012 14:14:52
Showing 1 changed files
... ...
@@ -187,8 +187,18 @@ struct AmConfig
187 187
   static unsigned int ShutdownModeErrCode;
188 188
   static string ShutdownModeErrReason;
189 189
 
190
+  /** header containing the transcoder's outgoing codec statistics which should
191
+   * be present in replies to OPTIONS requests */
190 192
   static string OptionsTranscoderOutStatsHdr;
193
+  /** header containing the transcoder's incoming codec statistics which should
194
+   * be present in replies to OPTIONS requests */
191 195
   static string OptionsTranscoderInStatsHdr;
196
+  /** header containing the transcoder's outgoing codec statistics which should
197
+   * be present in every message leaving server */
198
+  static string TranscoderOutStatsHdr;
199
+  /** header containing the transcoder's incoming codec statistics which should
200
+   * be present in every message leaving server */
201
+  static string TranscoderInStatsHdr;
192 202
 
193 203
   static Am100rel::State rel100;
194 204
 
Browse code

transcoder: statistics about used codecs can be put into OPTIONS replies

Václav Kubart authored on 25/04/2012 12:05:57
Showing 1 changed files
... ...
@@ -187,6 +187,9 @@ struct AmConfig
187 187
   static unsigned int ShutdownModeErrCode;
188 188
   static string ShutdownModeErrReason;
189 189
 
190
+  static string OptionsTranscoderOutStatsHdr;
191
+  static string OptionsTranscoderInStatsHdr;
192
+
190 193
   static Am100rel::State rel100;
191 194
 
192 195
   /** Time of no RTP after which Session is regarded as dead, 0 for no Timeout */
Browse code

option to ignore low CSeq for NOTIFY for old event sub implementations

new sems.conf option:

Ignore too low CSeq for NOTIFYs? [yes | no]

May be necessary to interwork with simplistic/old (following 3265
instead of 5057) SIP event notification implementations.

ignore_notify_lower_cseq=yes

Stefan Sayer authored on 11/04/2012 15:34:03
Showing 1 changed files
... ...
@@ -145,6 +145,8 @@ struct AmConfig
145 145
   static string NextHop;
146 146
   /** update ruri-host to previously resolved IP:port on SIP auth */
147 147
   static bool ProxyStickyAuth;
148
+  /** Ignore Low CSeq on NOTIFY  - for RFC 3265 instead of 5057 */
149
+  static bool IgnoreNotifyLowerCSeq;
148 150
   /** skip DNS SRV lookup for resolving destination address*/
149 151
   static bool DisableDNSSRV;
150 152
   /** Server/User-Agent header (optional) */
Browse code

core: merged next_hop_ip and next_hop_port parameters into next_hop

Additionally, the next_hop parameter now supports either a hostname, or a list of IP/port pairs which will be tried successively if timer M expires (see sip_timers.h).

Raphael Coeffic authored on 11/04/2012 13:55:02
Showing 1 changed files
... ...
@@ -141,10 +141,8 @@ struct AmConfig
141 141
   static string OutboundProxy;
142 142
   /** force Outbound Proxy to be used for in dialog requests */
143 143
   static bool ForceOutboundProxy;
144
-  /** force next hop IP */
145
-  static string NextHopIP;
146
-  /** force next hop port */
147
-  static unsigned int NextHopPort;
144
+  /** force next hop IP[:port] */
145
+  static string NextHop;
148 146
   /** update ruri-host to previously resolved IP:port on SIP auth */
149 147
   static bool ProxyStickyAuth;
150 148
   /** skip DNS SRV lookup for resolving destination address*/
Browse code

adds support for wideband audio

Raphael Coeffic authored on 21/02/2012 17:26:22
Showing 1 changed files
... ...
@@ -32,6 +32,7 @@
32 32
 #include "AmDtmfDetector.h"
33 33
 #include "AmSipDialog.h"
34 34
 #include "AmUtils.h"
35
+#include "AmAudio.h"
35 36
 
36 37
 #include <string>
37 38
 using std::string;
... ...
@@ -206,6 +207,8 @@ struct AmConfig
206 207
 
207 208
   static int UnhandledReplyLoglevel;
208 209
 
210
+  static AmAudio::ResamplingImplementationType ResamplingImplementationType;
211
+
209 212
   /** Read global configuration file and insert values. Maybe overwritten by
210 213
    * command line arguments */
211 214
   static int readConfiguration();
Browse code

core/sbc: removed next_hop_for_replies.

Raphael Coeffic authored on 04/02/2012 14:31:50
Showing 1 changed files
... ...
@@ -144,8 +144,6 @@ struct AmConfig
144 144
   static string NextHopIP;
145 145
   /** force next hop port */
146 146
   static unsigned int NextHopPort;
147
-  /** force next hop for replies, too */
148
-  static bool NextHopForReplies;
149 147
   /** update ruri-host to previously resolved IP:port on SIP auth */
150 148
   static bool ProxyStickyAuth;
151 149
   /** skip DNS SRV lookup for resolving destination address*/
Browse code

core: added force_via_address interface option.

Raphael Coeffic authored on 03/02/2012 19:50:40
Showing 1 changed files
... ...
@@ -99,6 +99,9 @@ struct AmConfig
99 99
     /** the port SIP requests are sent from - optional (default 5060) */
100 100
     int LocalSIPPort;
101 101
 
102
+    /** options for the signaling socket (@see trsp_socket::socket_options) */
103
+    unsigned int SigSockOpts;
104
+
102 105
     IP_interface();
103 106
 
104 107
     int getNextRtpPort();
Browse code

b/f: fixes support for additional IPs (e.g. VIPs).

- reverts LocalSIPIP2If to a multimap.
- adds support for LocalSIPIP2If in trans_layer as well.

Raphael Coeffic authored on 27/01/2012 14:48:52
Showing 1 changed files
... ...
@@ -110,7 +110,6 @@ struct AmConfig
110 110
 
111 111
   static vector<IP_interface>       Ifs;
112 112
   static map<string,unsigned short> If_names;
113
-  static map<string,unsigned short> LocalSIPIP2If;
114 113
 
115 114
   struct SysIntf {
116 115
     string       name;
... ...
@@ -120,6 +119,7 @@ struct AmConfig
120 119
   };
121 120
 
122 121
   static list<SysIntf> SysIfs;
122
+  static multimap<string,unsigned short> LocalSIPIP2If;
123 123
 
124 124
   static int finalizeIPConfig();
125 125
 
Browse code

core: interfaces fetching overhaul.

Raphael Coeffic authored on 26/01/2012 08:54:38
Showing 1 changed files
... ...
@@ -108,9 +108,18 @@ struct AmConfig
108 108
     AmMutex next_rtp_port_mut;
109 109
   };
110 110
 
111
-  static vector<IP_interface>            Ifs;
112
-  static map<string,unsigned short>      If_names;
113
-  static multimap<string,unsigned short> LocalSIPIP2If;
111
+  static vector<IP_interface>       Ifs;
112
+  static map<string,unsigned short> If_names;
113
+  static map<string,unsigned short> LocalSIPIP2If;
114
+
115
+  struct SysIntf {
116
+    string       name;
117
+    list<string> addrs;
118
+    // identical to those returned by SIOCGIFFLAGS
119
+    unsigned int flags;
120
+  };
121
+
122
+  static list<SysIntf> SysIfs;
114 123
 
115 124
   static int finalizeIPConfig();
116 125
 
Browse code

added thread-pool support for the RTP receiver

- new config parameter: rtp_receiver_threads

Raphael Coeffic authored on 20/01/2012 15:49:22
Showing 1 changed files
... ...
@@ -120,6 +120,8 @@ struct AmConfig
120 120
   static int SessionProcessorThreads;
121 121
   /** number of media processor threads */
122 122
   static int MediaProcessorThreads;
123
+  /** number of RTP receiver threads */
124
+  static int RTPReceiverThreads;
123 125
   /** number of SIP server threads */
124 126
   static int SIPServerThreads;
125 127
   /** Outbound Proxy (optional, outgoing calls only) */
... ...
@@ -222,6 +224,8 @@ struct AmConfig
222 224
   static int setSessionProcessorThreads(const string& th);
223 225
   /** Setter for parameter MediaProcessorThreads, returns 0 on invalid value */
224 226
   static int setMediaProcessorThreads(const string& th);
227
+  /** Setter for parameter RTPReceiverThreads, returns 0 on invalid value */
228
+  static int setRTPReceiverThreads(const string& th);
225 229
   /** Setter for parameter SIPServerThreads, returns 0 on invalid value */
226 230
   static int setSIPServerThreads(const string& th);
227 231
   /** Setter for parameter DeadRtpTime, returns 0 on invalid value */
Browse code

100rel: isolate from AmSipDialog into a separate class.

Raphael Coeffic authored on 05/12/2011 16:37:41
Showing 1 changed files
... ...
@@ -174,7 +174,7 @@ struct AmConfig
174 174
   static unsigned int ShutdownModeErrCode;
175 175
   static string ShutdownModeErrReason;
176 176
 
177
-  static AmSipDialog::Rel100State rel100;
177
+  static Am100rel::State rel100;
178 178
 
179 179
   /** Time of no RTP after which Session is regarded as dead, 0 for no Timeout */
180 180
   static unsigned int DeadRtpTime;
Browse code

renamed getLocalIP to a more useful name (fixIface2IP).

Also made the function non-static to be accessed from other classes.

Raphael Coeffic authored on 20/09/2011 13:52:30
Showing 1 changed files
... ...
@@ -229,6 +229,9 @@ struct AmConfig
229 229
 
230 230
 };
231 231
 
232
+/** Get the PF_INET address associated with the network interface */
233
+string fixIface2IP(const string& dev_name);
234
+
232 235
 #endif
233 236
 
234 237
 // Local Variables:
Browse code

Merge branch 'master' into offer_answer

Raphael Coeffic authored on 23/05/2011 09:19:45
Showing 0 changed files
Browse code

adds next_hop core config option

Stefan Sayer authored on 19/05/2011 16:03:23
Showing 1 changed files
... ...
@@ -126,6 +126,12 @@ struct AmConfig
126 126
   static string OutboundProxy;
127 127
   /** force Outbound Proxy to be used for in dialog requests */
128 128
   static bool ForceOutboundProxy;
129
+  /** force next hop IP */
130
+  static string NextHopIP;
131
+  /** force next hop port */
132
+  static unsigned int NextHopPort;
133
+  /** force next hop for replies, too */
134
+  static bool NextHopForReplies;
129 135
   /** update ruri-host to previously resolved IP:port on SIP auth */
130 136
   static bool ProxyStickyAuth;
131 137
   /** skip DNS SRV lookup for resolving destination address*/
Browse code

first load of fixes after merge from master.

Raphael Coeffic authored on 05/04/2011 14:12:22
Showing 1 changed files
... ...
@@ -168,7 +168,7 @@ struct AmConfig
168 168
   static unsigned int ShutdownModeErrCode;
169 169
   static string ShutdownModeErrReason;
170 170
 
171
-  static AmSipDialog::provisional_100rel rel100;
171
+  static AmSipDialog::Rel100State rel100;
172 172
 
173 173
   /** Time of no RTP after which Session is regarded as dead, 0 for no Timeout */
174 174
   static unsigned int DeadRtpTime;
Browse code

added support for forked INVITEs

If an INVITE has been forked and more than one branch is aimed at SEMS,
then the branch parameter of the top-via is necessary to distinguish the
different sessions.

By default, SEMS will now accept forked INVITEs.
This behavior can be switched off by setting "accept_forked_dialogs" to "no" (default=yes).

Raphael Coeffic authored on 12/10/2010 13:51:16
Showing 1 changed files
... ...
@@ -162,6 +162,8 @@ struct AmConfig
162 162
   static unsigned int OptionsSessionLimitErrCode;
163 163
   static string OptionsSessionLimitErrReason;
164 164
 
165
+  static bool AcceptForkedDialogs;
166
+
165 167
   static bool ShutdownMode;
166 168
   static unsigned int ShutdownModeErrCode;
167 169
   static string ShutdownModeErrReason;
Browse code

adds shutdownmode, in which calls are replied with defined err

based on a patch by Robert Szokovacs

Stefan Sayer authored on 23/02/2011 12:25:32
Showing 1 changed files
... ...
@@ -162,6 +162,10 @@ struct AmConfig
162 162
   static unsigned int OptionsSessionLimitErrCode;
163 163
   static string OptionsSessionLimitErrReason;
164 164
 
165
+  static bool ShutdownMode;
166
+  static unsigned int ShutdownModeErrCode;
167
+  static string ShutdownModeErrReason;
168
+
165 169
   static AmSipDialog::provisional_100rel rel100;
166 170
 
167 171
   /** Time of no RTP after which Session is regarded as dead, 0 for no Timeout */
Browse code

moved IP related config to AmConfig

Raphael Coeffic authored on 14/02/2011 16:38:01
Showing 1 changed files
... ...
@@ -112,31 +112,9 @@ struct AmConfig
112 112
   static map<string,unsigned short>      If_names;
113 113
   static multimap<string,unsigned short> LocalSIPIP2If;
114 114
 
115
-  static void dump_Ifs();
116
-
117
-  static string& LocalIP() {
118
-    return (Ifs[0].LocalIP);
119
-  }
120
-
121
-  static string& PublicIP() {
122
-    return (Ifs[0].PublicIP);
123
-  }
124
-
125
-  static int& RtpLowPort() {
126
-    return (Ifs[0].RtpLowPort);
127
-  }
115
+  static int finalizeIPConfig();
128 116
 
129
-  static int& RtpHighPort() {
130
-    return (Ifs[0].RtpHighPort);
131
-  }
132
-
133
-  static string& LocalSIPIP() {
134
-    return (Ifs[0].LocalSIPIP);
135
-  }
136
-
137
-  static int& LocalSIPPort() {
138
-    return (Ifs[0].LocalSIPPort);
139
-  }
117
+  static void dump_Ifs();
140 118
 
141 119
   /** number of session (signaling/application) processor threads */
142 120
   static int SessionProcessorThreads;
Browse code

adds multihomed support for RTP streams

Raphael Coeffic authored on 14/02/2011 14:41:14
Showing 1 changed files
... ...
@@ -98,6 +98,14 @@ struct AmConfig
98 98
     string LocalSIPIP;
99 99
     /** the port SIP requests are sent from - optional (default 5060) */
100 100
     int LocalSIPPort;
101
+
102
+    IP_interface();
103
+
104
+    int getNextRtpPort();
105
+
106
+  private:
107
+    int next_rtp_port;
108
+    AmMutex next_rtp_port_mut;
101 109
   };
102 110
 
103 111
   static vector<IP_interface>            Ifs;
Browse code

adds a method to dump the configured interfaces.

Raphael Coeffic authored on 13/02/2011 14:29:59
Showing 1 changed files
... ...
@@ -80,6 +80,8 @@ struct AmConfig
80 80
 
81 81
   struct IP_interface {
82 82
 
83
+    string name;
84
+
83 85
     /** local IP for SDP media advertising */
84 86
     string LocalIP;
85 87
     
... ...
@@ -102,6 +104,8 @@ struct AmConfig
102 104
   static map<string,unsigned short>      If_names;
103 105
   static multimap<string,unsigned short> LocalSIPIP2If;
104 106
 
107
+  static void dump_Ifs();
108
+
105 109
   static string& LocalIP() {
106 110
     return (Ifs[0].LocalIP);
107 111
   }
Browse code

adds a reverse mapping between LocalSIPIP and interface.

Raphael Coeffic authored on 13/02/2011 14:28:55
Showing 1 changed files
... ...
@@ -37,6 +37,7 @@
37 37
 using std::string;
38 38
 #include <map>
39 39
 using std::map;
40
+using std::multimap;
40 41
 #include <utility>
41 42
 
42 43
 /**
... ...
@@ -97,8 +98,9 @@ struct AmConfig
97 98
     int LocalSIPPort;
98 99
   };
99 100
 
100
-  static vector<IP_interface>       Ifs;
101
-  static map<string,unsigned short> If_names;
101
+  static vector<IP_interface>            Ifs;
102
+  static map<string,unsigned short>      If_names;
103
+  static multimap<string,unsigned short> LocalSIPIP2If;
102 104
 
103 105
   static string& LocalIP() {
104 106
     return (Ifs[0].LocalIP);
Browse code

Wip: adds multiple interface to config reader

Raphael Coeffic authored on 02/02/2011 11:59:51
Showing 1 changed files
... ...
@@ -35,6 +35,8 @@
35 35
 
36 36
 #include <string>
37 37
 using std::string;
38
+#include <map>
39
+using std::map;
38 40
 #include <utility>
39 41
 
40 42
 /**
... ...
@@ -75,27 +77,59 @@ struct AmConfig
75 77
   
76 78
   static unsigned int MaxShutdownTime;
77 79
 
78
-  /** local IP for SDP media advertising */
79
-  static string LocalIP;
80
-  
81
-  /** public IP for SDP media advertising; we actually
82
-   *  bind to local IP, but advertise public IP. */ 
83
-  static string PublicIP;
84
-  
85
-  /** Lowest local RTP port */
86
-  static int RtpLowPort;
87
-  /** Highest local RTP port */
88
-  static int RtpHighPort;
80
+  struct IP_interface {
81
+
82
+    /** local IP for SDP media advertising */
83
+    string LocalIP;
84
+    
85
+    /** public IP for SDP media advertising; we actually
86
+     *  bind to local IP, but advertise public IP. */ 
87
+    string PublicIP;
88
+    
89
+    /** Lowest local RTP port */
90
+    int RtpLowPort;
91
+    /** Highest local RTP port */
92
+    int RtpHighPort;
93
+    
94
+    /** the interface SIP requests are sent from - needed for registrar_client */
95
+    string LocalSIPIP;
96
+    /** the port SIP requests are sent from - optional (default 5060) */
97
+    int LocalSIPPort;
98
+  };
99
+
100
+  static vector<IP_interface>       Ifs;
101
+  static map<string,unsigned short> If_names;
102
+
103
+  static string& LocalIP() {
104
+    return (Ifs[0].LocalIP);
105
+  }
106
+
107
+  static string& PublicIP() {
108
+    return (Ifs[0].PublicIP);
109
+  }
110
+
111
+  static int& RtpLowPort() {
112
+    return (Ifs[0].RtpLowPort);
113
+  }
114
+
115
+  static int& RtpHighPort() {
116
+    return (Ifs[0].RtpHighPort);
117
+  }
118
+
119
+  static string& LocalSIPIP() {
120
+    return (Ifs[0].LocalSIPIP);
121
+  }
122
+
123
+  static int& LocalSIPPort() {
124
+    return (Ifs[0].LocalSIPPort);
125
+  }
126
+
89 127
   /** number of session (signaling/application) processor threads */
90 128
   static int SessionProcessorThreads;
91 129
   /** number of media processor threads */
92 130
   static int MediaProcessorThreads;
93 131
   /** number of SIP server threads */
94 132
   static int SIPServerThreads;
95
-  /** the interface SIP requests are sent from - needed for registrar_client */
96
-  static string LocalSIPIP;
97
-  /** the port SIP requests are sent from - optional (default 5060) */
98
-  static int LocalSIPPort;
99 133
   /** Outbound Proxy (optional, outgoing calls only) */
100 134
   static string OutboundProxy;
101 135
   /** force Outbound Proxy to be used for in dialog requests */
... ...
@@ -188,6 +222,7 @@ struct AmConfig
188 222
   static int setSIPServerThreads(const string& th);
189 223
   /** Setter for parameter DeadRtpTime, returns 0 on invalid value */
190 224
   static int setDeadRtpTime(const string& drt);
225
+
191 226
 };
192 227
 
193 228
 #endif
Browse code

add sems.conf option skip_dns_srv

Stefan Sayer authored on 23/01/2011 21:56:10
Showing 1 changed files
... ...
@@ -102,6 +102,8 @@ struct AmConfig
102 102
   static bool ForceOutboundProxy;
103 103
   /** update ruri-host to previously resolved IP:port on SIP auth */
104 104
   static bool ProxyStickyAuth;
105
+  /** skip DNS SRV lookup for resolving destination address*/
106
+  static bool DisableDNSSRV;
105 107
   /** Server/User-Agent header (optional) */
106 108
   static string Signature;
107 109
   /** Value of Max-Forward header field for new requests */
Browse code

moved regex mapping file reading to AmUtils

Stefan Sayer authored on 07/01/2011 14:06:23
Showing 1 changed files
... ...
@@ -31,15 +31,12 @@
31 31
 #include "AmSdp.h"
32 32
 #include "AmDtmfDetector.h"
33 33
 #include "AmSipDialog.h"
34
+#include "AmUtils.h"
34 35
 
35 36
 #include <string>
36 37
 using std::string;
37 38
 #include <utility>
38 39
 
39
-#include <sys/types.h>
40
-#include <regex.h>
41
-
42
-
43 40
 /**
44 41
  * \brief holds the current configuration.
45 42
  *
... ...
@@ -127,8 +124,7 @@ struct AmConfig
127 124
   static ApplicationSelector AppSelect;
128 125
 
129 126
   /* this is regex->application mapping is used if  App_MAPPING */
130
-  typedef vector<std::pair<regex_t, string> > AppMappingVector;
131
-  static AppMappingVector AppMapping; 
127
+  static RegexMappingVector AppMapping; 
132 128
 
133 129
   static unsigned int SessionLimit;
134 130
   static unsigned int SessionLimitErrCode;
Browse code

rework of 100rel support

The 100rel logic moved in great part to AmSipDialog; this way, it can be
hooked directly to request/reply processing routines, the ones on top of
the transactional layer (::updateStatus(..)).
This allows to:
- better control when to push the messages into the AmSession's
onSipRequest/~Reply, fixing some issues with applications that received
replies, but without sending themselves the requests
- insert needed headers, no matter which request function is used
(::invite() vs. ..sendRequest())

bpintea authored on 19/11/2010 10:30:37
Showing 1 changed files
... ...
@@ -30,6 +30,7 @@
30 30
 
31 31
 #include "AmSdp.h"
32 32
 #include "AmDtmfDetector.h"
33
+#include "AmSipDialog.h"
33 34
 
34 35
 #include <string>
35 36
 using std::string;
... ...
@@ -137,7 +138,7 @@ struct AmConfig
137 138
   static unsigned int OptionsSessionLimitErrCode;
138 139
   static string OptionsSessionLimitErrReason;
139 140
 
140
-  static unsigned char rel100;
141
+  static AmSipDialog::provisional_100rel rel100;
141 142
 
142 143
   /** Time of no RTP after which Session is regarded as dead, 0 for no Timeout */
143 144
   static unsigned int DeadRtpTime;
Browse code

introduce proxy_sticky_auth feature

thanks to Tobias Lindgren for reporting

Stefan Sayer authored on 26/10/2010 14:53:59
Showing 1 changed files
... ...
@@ -102,6 +102,8 @@ struct AmConfig
102 102
   static string OutboundProxy;
103 103
   /** force Outbound Proxy to be used for in dialog requests */
104 104
   static bool ForceOutboundProxy;
105
+  /** update ruri-host to previously resolved IP:port on SIP auth */
106
+  static bool ProxyStickyAuth;
105 107
   /** Server/User-Agent header (optional) */
106 108
   static string Signature;
107 109
   /** Value of Max-Forward header field for new requests */
Browse code

added OpenSSL linking exception to license

Stefan Sayer authored on 23/09/2010 14:41:49
Showing 1 changed files
... ...
@@ -1,21 +1,21 @@
1 1
 /*
2
- * $Id$
3
- *
4 2
  * Copyright (C) 2002-2003 Fhg Fokus
5 3
  *
6
- * This file is part of sems, a free SIP media server.
4
+ * This file is part of SEMS, a free SIP media server.
7 5
  *
8
- * sems is free software; you can redistribute it and/or modify
6
+ * SEMS is free software; you can redistribute it and/or modify
9 7
  * it under the terms of the GNU General Public License as published by
10 8
  * the Free Software Foundation; either version 2 of the License, or
11
- * (at your option) any later version
9
+ * (at your option) any later version. This program is released under
10
+ * the GPL with the additional exemption that compiling, linking,
11
+ * and/or using OpenSSL is allowed.
12 12
  *
13
- * For a license to use the ser software under conditions
13
+ * For a license to use the SEMS software under conditions
14 14
  * other than those described here, or to purchase support for this
15 15
  * software, please contact iptel.org by e-mail at the following addresses:
16 16
  *    info@iptel.org
17 17
  *
18
- * sems is distributed in the hope that it will be useful,
18
+ * SEMS is distributed in the hope that it will be useful,
19 19
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 20
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21 21
  * GNU General Public License for more details.
Browse code

removed obsolete user_prefix_separator

Stefan Sayer authored on 22/09/2010 13:32:13
Showing 1 changed files
... ...
@@ -84,8 +84,6 @@ struct AmConfig
84 84
    *  bind to local IP, but advertise public IP. */ 
85 85
   static string PublicIP;
86 86
   
87
-  /** Separator character for uri application prefix (ex: voicemail+jiri@iptel.org) */
88
-  static string PrefixSep;
89 87
   /** Lowest local RTP port */
90 88
   static int RtpLowPort;
91 89
   /** Highest local RTP port */
Browse code

introduced max_shutdown_time, limits server stop

to prevent SEMS from stopping if there are hanging sessions,
a limit on the maximum shutdown time (actually time to wait
for sessions to stop) can be configured

default: 10 seconds
turn off by setting to 0

Stefan Sayer authored on 22/09/2010 13:28:25
Showing 1 changed files
... ...
@@ -75,6 +75,8 @@ struct AmConfig
75 75
   static string DaemonGid;
76 76
 #endif
77 77
   
78
+  static unsigned int MaxShutdownTime;
79
+
78 80
   /** local IP for SDP media advertising */
79 81
   static string LocalIP;
80 82
   
Browse code

Merge branch 'master' into bpintea/prack

Resolved conflicts:

core/AmSessionEventHandler.h
core/plug-in/uac_auth/UACAuth.cpp

b/f: missing 'old_dlg_status' param in some onReply's:

apps/auth_b2b/AuthB2B.cpp
apps/registrar_client/SIPRegistrarClient.cpp
apps/sst_b2b/SSTB2B.cpp

bpintea authored on 01/08/2010 14:44:27
Showing 0 changed files
Browse code

ignore SIGPIPE (like SIGCHLD)

Stefan Sayer authored on 01/07/2010 23:29:58
Showing 1 changed files
... ...
@@ -145,6 +145,8 @@ struct AmConfig
145 145
 
146 146
   static bool IgnoreSIGCHLD;
147 147
 
148
+  static bool IgnoreSIGPIPE;
149
+
148 150
   static bool LogSessions;
149 151
 
150 152
   static bool LogEvents;
Browse code

add support for 100rel extension (prack)

bpi authored on 20/06/2010 23:48:21
Showing 1 changed files
... ...
@@ -135,6 +135,8 @@ struct AmConfig
135 135
   static unsigned int OptionsSessionLimitErrCode;
136 136
   static string OptionsSessionLimitErrReason;
137 137
 
138
+  static unsigned char rel100;
139
+
138 140
   /** Time of no RTP after which Session is regarded as dead, 0 for no Timeout */
139 141
   static unsigned int DeadRtpTime;
140 142
 
Browse code

* command-line parsing - options now properly override configuration settings - fix arguments checking and cleanup error messages - "-D" accepts string level (eg, "info"), etc. [ ...prepare for switching to getopt soon... ]

* signal handling and more gracious shutdown procedure
- fix possible race condition in the signal handler (eg, static
AmMutex and AmCondition)
- dispose instances synchronously in main() instead of in
the signal handler
- replace multiple "exit()"s by a single exit point
- remove PID file on failure exit

* add possibility to disable daemon mode at compile-time (see
DISABLE_DAEMON_MODE macro)



git-svn-id: http://svn.berlios.de/svnroot/repos/sems/trunk@1872 8eb893ce-cfd4-0310-b710-fb5ebe64c474

Ondrej Martine authored on 30/04/2010 14:09:07
Showing 1 changed files
... ...
@@ -59,8 +59,21 @@ struct AmConfig
59 59
   /** semicolon separated list of payloads to exclude from loading */
60 60
   static string ExcludePayloads;  
61 61
   //static unsigned int MaxRecordTime;
62
-  /** run the programm in daemon mode? */
63
-  static int DaemonMode;
62
+  /** log level */
63
+  static int LogLevel;
64
+  /** log to stderr */
65
+  static bool LogStderr;
66
+
67
+#ifndef DISABLE_DAEMON_MODE
68
+  /** run the program in daemon mode? */
69
+  static bool DaemonMode;
70
+  /** PID file when in daemon mode */
71
+  static string DaemonPidFile;
72
+  /** set UID when in daemon mode */
73
+  static string DaemonUid;
74
+  /** set GID when in daemon mode */
75
+  static string DaemonGid;
76
+#endif
64 77
   
65 78
   /** local IP for SDP media advertising */
66 79
   static string LocalIP;
... ...
@@ -138,9 +151,6 @@ struct AmConfig
138 151
 
139 152
   static int UnhandledReplyLoglevel;
140 153
 
141
-  /** Init function. Resolves SMTP server address. */
142
-  static int init();
143
-
144 154
   /** Read global configuration file and insert values. Maybe overwritten by
145 155
    * command line arguments */
146 156
   static int readConfiguration();
... ...
@@ -156,11 +166,15 @@ struct AmConfig
156 166
   /** Setter for RtpHighPort, returns 0 on invalid value */
157 167
   static int setRtpHighPort(const string& port);
158 168
   /** Setter for Loglevel, returns 0 on invalid value */
159
-  static int setLoglevel(const string& level);
160
-  /** Setter for parameter fork, returns 0 on invalid value */
161
-  static int setFork(const string& fork);
169
+  static int setLogLevel(const string& level, bool apply=true);
162 170
   /** Setter for parameter stderr, returns 0 on invalid value */
163
-  static int setStderr(const string& s);
171
+  static int setLogStderr(const string& s, bool apply=true);
172
+
173
+#ifndef DISABLE_DAEMON_MODE
174
+  /** Setter for parameter DaemonMode, returns 0 on invalid value */
175
+  static int setDaemonMode(const string& fork);
176
+#endif
177
+
164 178
   /** Setter for parameter SessionProcessorThreads, returns 0 on invalid value */
165 179
   static int setSessionProcessorThreads(const string& th);
166 180
   /** Setter for parameter MediaProcessorThreads, returns 0 on invalid value */
Browse code

added the max_forwards configuration option.

git-svn-id: http://svn.berlios.de/svnroot/repos/sems/trunk@1835 8eb893ce-cfd4-0310-b710-fb5ebe64c474

Raphael Coeffic authored on 27/04/2010 08:56:57
Showing 1 changed files
... ...
@@ -91,6 +91,8 @@ struct AmConfig
91 91
   static bool ForceOutboundProxy;
92 92
   /** Server/User-Agent header (optional) */
93 93
   static string Signature;
94
+  /** Value of Max-Forward header field for new requests */
95
+  static unsigned int MaxForwards;
94 96
   /** If 200 OK reply should be limited to preferred codec only */
95 97
   static bool SingleCodecInOK;
96 98
   static vector <string> CodecOrder;
Browse code

- simplified some code in the SIP stack - introduced outbound_proxy+force_outbound_proxy at the SIP dialog level (AmSipDialog) - outbound_proxy+force_outbound_proxy is configurable in the sems.conf

git-svn-id: http://svn.berlios.de/svnroot/repos/sems/trunk@1818 8eb893ce-cfd4-0310-b710-fb5ebe64c474

Raphael Coeffic authored on 22/04/2010 14:27:20
Showing 1 changed files
... ...
@@ -87,6 +87,8 @@ struct AmConfig
87 87
   static int LocalSIPPort;
88 88
   /** Outbound Proxy (optional, outgoing calls only) */
89 89
   static string OutboundProxy;
90
+  /** force Outbound Proxy to be used for in dialog requests */
91
+  static bool ForceOutboundProxy;
90 92
   /** Server/User-Agent header (optional) */
91 93
   static string Signature;
92 94
   /** If 200 OK reply should be limited to preferred codec only */
Browse code

- added support for multiple SIP/UDP receivers. - some cleanups.

git-svn-id: http://svn.berlios.de/svnroot/repos/sems/trunk@1804 8eb893ce-cfd4-0310-b710-fb5ebe64c474

Raphael Coeffic authored on 16/04/2010 15:33:37
Showing 1 changed files
... ...
@@ -79,6 +79,8 @@ struct AmConfig
79 79
   static int SessionProcessorThreads;
80 80
   /** number of media processor threads */
81 81
   static int MediaProcessorThreads;
82
+  /** number of SIP server threads */
83
+  static int SIPServerThreads;
82 84
   /** the interface SIP requests are sent from - needed for registrar_client */
83 85
   static string LocalSIPIP;
84 86
   /** the port SIP requests are sent from - optional (default 5060) */
... ...
@@ -159,6 +161,8 @@ struct AmConfig
159 161
   static int setSessionProcessorThreads(const string& th);
160 162
   /** Setter for parameter MediaProcessorThreads, returns 0 on invalid value */
161 163
   static int setMediaProcessorThreads(const string& th);
164
+  /** Setter for parameter SIPServerThreads, returns 0 on invalid value */