Browse code

fixes for SEMS on Solaris contributed by Richard Newman rnewman at twinql dot com

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

Stefan Sayer authored on 28/01/2008 18:17:36
Showing 53 changed files
... ...
@@ -31,8 +31,17 @@ LDFLAGS = -lm
31 31
 
32 32
 OS     = $(shell uname -s | sed -e s/SunOS/solaris/ | tr "[A-Z]" "[a-z]")
33 33
 
34
+# Additions for Solaris support.
34 35
 ifeq ($(OS),solaris)
35 36
 	GETARCH=uname -p
37
+	CPPFLAGS += -DHAVE_SYS_SOCKIO_H -DBSD_COMP -include compat/solaris.h -fPIC
38
+        CFLAGS += -DHAVE_SYS_SOCKIO_H -DBSD_COMP -fPIC
39
+        # For nanosleep.
40
+        LDFLAGS += -lrt
41
+        # For inet_aton.
42
+        LDFLAGS += -lresolv
43
+
44
+	exclude_modules += adpcm binrpcctrl gsm ilbc speex
36 45
 else
37 46
 	GETARCH=uname -m
38 47
 endif
... ...
@@ -52,6 +61,7 @@ endif
52 61
 # need OS specific for this ?
53 62
 CXX = g++
54 63
 CC = gcc
64
+
55 65
 LD = $(CC)
56 66
 
57 67
 
... ...
@@ -77,7 +87,7 @@ else
77 87
 ifeq ($(OS), netbsd)
78 88
 	LDFLAGS += -rdynamic -pthread
79 89
 else
80
-	LDFLAGS+= -ldl -lsocket -lnsl -lpthread
90
+	LDFLAGS+= -fPIC -ldl -lsocket -lnsl -lpthread
81 91
 	TARGET=solaris
82 92
 endif
83 93
 endif
... ...
@@ -41,14 +41,14 @@ AmAudioQueue::AmAudioQueue()
41 41
 
42 42
 AmAudioQueue::~AmAudioQueue() { 
43 43
   set<AmAudio*> deleted_audios; // don't delete them twice
44
-  for (list<AudioQueueEntry>::iterator it = inputQueue.begin();it != inputQueue.end(); it++) {
44
+  for (std::list<AudioQueueEntry>::iterator it = inputQueue.begin();it != inputQueue.end(); it++) {
45 45
     if (deleted_audios.find(it->audio) == deleted_audios.end()) {
46 46
       deleted_audios.insert(it->audio);
47 47
       delete it->audio;
48 48
     }
49 49
   }
50 50
 	
51
-  for (list<AudioQueueEntry>::iterator it = outputQueue.begin();it != outputQueue.end(); it++) {
51
+  for (std::list<AudioQueueEntry>::iterator it = outputQueue.begin();it != outputQueue.end(); it++) {
52 52
     if (deleted_audios.find(it->audio) == deleted_audios.end()) {
53 53
       deleted_audios.insert(it->audio);
54 54
       delete it->audio;
... ...
@@ -59,7 +59,7 @@ AmAudioQueue::~AmAudioQueue() {
59 59
 int AmAudioQueue::write(unsigned int user_ts, unsigned int size) {
60 60
   inputQueue_mut.lock();
61 61
   unsigned int size_trav = size;
62
-  for (list<AudioQueueEntry>::iterator it = inputQueue.begin(); it != inputQueue.end(); it++) {
62
+  for (std::list<AudioQueueEntry>::iterator it = inputQueue.begin(); it != inputQueue.end(); it++) {
63 63
     if (it->put) {
64 64
       if ((size_trav = it->audio->put(user_ts, samples, size_trav)) < 0)
65 65
 	break;
... ...
@@ -76,7 +76,7 @@ int AmAudioQueue::write(unsigned int user_ts, unsigned int size) {
76 76
 int AmAudioQueue::read(unsigned int user_ts, unsigned int size) {
77 77
   outputQueue_mut.lock();
78 78
   unsigned int size_trav = size;
79
-  for (list<AudioQueueEntry>::iterator it = outputQueue.begin(); it != outputQueue.end(); it++) {
79
+  for (std::list<AudioQueueEntry>::iterator it = outputQueue.begin(); it != outputQueue.end(); it++) {
80 80
     if (it->put) {
81 81
       if ((size_trav = it->audio->put(user_ts, samples, size_trav)) < 0)
82 82
 	break;
... ...
@@ -92,7 +92,7 @@ int AmAudioQueue::read(unsigned int user_ts, unsigned int size) {
92 92
 
93 93
 void AmAudioQueue::pushAudio(AmAudio* audio, QueueType type, Pos pos, bool write, bool read) {
94 94
   AmMutex* q_mut; 
95
-  list<AudioQueueEntry>* q; 
95
+  std::list<AudioQueueEntry>* q; 
96 96
   switch (type) {
97 97
   case OutputQueue: 
98 98
     q_mut = &outputQueue_mut;
... ...
@@ -122,7 +122,7 @@ int AmAudioQueue::popAudio(QueueType type, Pos pos) {
122 122
 
123 123
 AmAudio* AmAudioQueue::popAndGetAudio(QueueType type, Pos pos) {
124 124
   AmMutex* q_mut; 
125
-  list<AudioQueueEntry>* q; 
125
+  std::list<AudioQueueEntry>* q; 
126 126
   switch (type) {
127 127
   case OutputQueue: 
128 128
     q_mut = &outputQueue_mut;
... ...
@@ -154,7 +154,7 @@ AmAudio* AmAudioQueue::popAndGetAudio(QueueType type, Pos pos) {
154 154
 int AmAudioQueue::removeAudio(AmAudio* audio) {
155 155
   bool found = false;
156 156
   outputQueue_mut.lock();
157
-  for (list<AudioQueueEntry>::iterator it = outputQueue.begin(); 
157
+  for (std::list<AudioQueueEntry>::iterator it = outputQueue.begin(); 
158 158
        it != outputQueue.end(); it++) {
159 159
     if (it->audio == audio) {
160 160
       found = true;
... ...
@@ -167,7 +167,7 @@ int AmAudioQueue::removeAudio(AmAudio* audio) {
167 167
   if (found)
168 168
     return 0;
169 169
   inputQueue_mut.lock();
170
-  for (list<AudioQueueEntry>::iterator it = inputQueue.begin(); 
170
+  for (std::list<AudioQueueEntry>::iterator it = inputQueue.begin(); 
171 171
        it != inputQueue.end(); it++) {
172 172
     if (it->audio == audio) {
173 173
       found = true;
... ...
@@ -36,7 +36,6 @@
36 36
 #include "amci/codecs.h"
37 37
 
38 38
 #include <list>
39
-using namespace std;
40 39
 #include "SampleArray.h"
41 40
 
42 41
 /**
... ...
@@ -62,9 +61,9 @@ class AmAudioQueue : public AmAudio {
62 61
   SampleArrayShort sarr;
63 62
 
64 63
   AmMutex inputQueue_mut;
65
-  list<AudioQueueEntry> inputQueue;
64
+  std::list<AudioQueueEntry> inputQueue;
66 65
   AmMutex outputQueue_mut;
67
-  list<AudioQueueEntry> outputQueue;
66
+  std::list<AudioQueueEntry> outputQueue;
68 67
  public:
69 68
   AmAudioQueue();
70 69
   ~AmAudioQueue();
... ...
@@ -38,8 +38,6 @@
38 38
 #include <stdarg.h>
39 39
 
40 40
 #include <string>
41
-#include <map>
42
-using std::map;
43 41
 using std::string;
44 42
 
45 43
 /**
... ...
@@ -69,18 +69,18 @@ AmArg& AmArg::operator=(const AmArg& v) {
69 69
   return *this;
70 70
 }
71 71
 
72
-AmArg::AmArg(map<std::string, std::string>& v) 
72
+AmArg::AmArg(std::map<std::string, std::string>& v) 
73 73
   : type(Undef) {
74 74
   assertStruct();
75
-  for (map<std::string, std::string>::iterator it=
75
+  for (std::map<std::string, std::string>::iterator it=
76 76
 	 v.begin();it!= v.end();it++)
77 77
     (*v_struct)[it->first] = AmArg(it->second.c_str());
78 78
 }
79 79
 
80
-AmArg::AmArg(map<std::string, AmArg>& v) 
80
+AmArg::AmArg(std::map<std::string, AmArg>& v) 
81 81
   : type(Undef) {
82 82
   assertStruct();
83
-  for (map<std::string, AmArg>::iterator it=
83
+  for (std::map<std::string, AmArg>::iterator it=
84 84
 	 v.begin();it!= v.end();it++)
85 85
     (*v_struct)[it->first] = it->second;
86 86
 }
... ...
@@ -38,7 +38,6 @@ using std::vector;
38 38
 using std::string;
39 39
 
40 40
 #include <map>
41
-using std::map;
42 41
 
43 42
 #include "log.h"
44 43
 
... ...
@@ -64,13 +64,13 @@ int AmAudioRtpFormat::setCurrentPayload(int payload)
64 64
 {
65 65
   if (m_currentPayload != payload)
66 66
   {
67
-    map<int, SdpPayload *>::iterator p = m_sdpPayloadByPayload.find(payload);
67
+    std::map<int, SdpPayload *>::iterator p = m_sdpPayloadByPayload.find(payload);
68 68
     if (p == m_sdpPayloadByPayload.end())
69 69
     {
70 70
       ERROR("Could not find payload <%i>\n", payload);
71 71
       return -1;
72 72
     }
73
-    map<int, amci_payload_t *>::iterator pp = m_payloadPByPayload.find(payload);
73
+    std::map<int, amci_payload_t *>::iterator pp = m_payloadPByPayload.find(payload);
74 74
     if (pp == m_payloadPByPayload.end())
75 75
     {
76 76
       m_currentPayloadP = AmPlugIn::instance()->payload(p->second->int_pt);
... ...
@@ -86,7 +86,7 @@ int AmAudioRtpFormat::setCurrentPayload(int payload)
86 86
     m_currentPayload = payload;
87 87
     sdp_format_parameters = p->second->sdp_format_parameters;
88 88
 
89
-    map<int, CodecContainer *>::iterator c = m_codecContainerByPayload.find(payload);
89
+    std::map<int, CodecContainer *>::iterator c = m_codecContainerByPayload.find(payload);
90 90
     if (c == m_codecContainerByPayload.end())
91 91
     {
92 92
       codec = NULL;
... ...
@@ -123,7 +123,7 @@ int AmAudioRtpFormat::setCurrentPayload(int payload)
123 123
 
124 124
 AmAudioRtpFormat::~AmAudioRtpFormat()
125 125
 {
126
-  for (map<int, CodecContainer *>::iterator it = m_codecContainerByPayload.begin(); it != m_codecContainerByPayload.end(); ++it)
126
+  for (std::map<int, CodecContainer *>::iterator it = m_codecContainerByPayload.begin(); it != m_codecContainerByPayload.end(); ++it)
127 127
     delete it->second;
128 128
 }
129 129
 
... ...
@@ -39,7 +39,6 @@ using std::auto_ptr;
39 39
 #include <string>
40 40
 using std::string;
41 41
 #include <map>
42
-using std::map;
43 42
 
44 43
 #define PCM16_B2S(b) ((b) >> 1)
45 44
 #define PCM16_S2B(s) ((s) << 1)
... ...
@@ -214,9 +213,9 @@ class AmAudioRtpFormat: public AmAudioFormat
214 213
   vector<SdpPayload *> m_payloads;
215 214
   int m_currentPayload;
216 215
   amci_payload_t *m_currentPayloadP;
217
-  map<int, SdpPayload *> m_sdpPayloadByPayload;
218
-  map<int, amci_payload_t *> m_payloadPByPayload;
219
-  map<int, CodecContainer *> m_codecContainerByPayload;
216
+  std::map<int, SdpPayload *> m_sdpPayloadByPayload;
217
+  std::map<int, amci_payload_t *> m_payloadPByPayload;
218
+  std::map<int, CodecContainer *> m_codecContainerByPayload;
220 219
 
221 220
 protected:
222 221
   int getCodecId();
... ...
@@ -136,7 +136,7 @@ class AmB2ABSession: public AmSession
136 136
   string other_id;
137 137
  
138 138
   /** Requests received for relaying */
139
-  map<int,AmSipRequest> recvd_req;
139
+  std::map<int,AmSipRequest> recvd_req;
140 140
 
141 141
   void clear_other();
142 142
 
... ...
@@ -93,7 +93,7 @@ void AmB2BSession::onB2BEvent(B2BEvent* ev)
93 93
 
94 94
       if(reply_ev->forward){
95 95
 
96
-	map<int,AmSipRequest>::iterator t_req = recvd_req.find(reply_ev->reply.cseq);
96
+        std::map<int,AmSipRequest>::iterator t_req = recvd_req.find(reply_ev->reply.cseq);
97 97
 	if (t_req != recvd_req.end()) {
98 98
 	  relaySip(t_req->second,reply_ev->reply);
99 99
 		
... ...
@@ -132,7 +132,7 @@ void AmB2BSession::onSipRequest(const AmSipRequest& req)
132 132
     AmSession::onSipRequest(req);
133 133
   else {
134 134
     dlg.updateStatus(req);
135
-    recvd_req.insert(make_pair(req.cseq,req));
135
+    recvd_req.insert(std::make_pair(req.cseq,req));
136 136
   }
137 137
 
138 138
   relayEvent(new B2BSipRequestEvent(req,fwd));
... ...
@@ -122,7 +122,7 @@ class AmB2BSession: public AmSession
122 122
   TransMap relayed_req;
123 123
 
124 124
   /** Requests received for relaying */
125
-  map<int,AmSipRequest> recvd_req;
125
+  std::map<int,AmSipRequest> recvd_req;
126 126
 
127 127
   void clear_other();
128 128
 
... ...
@@ -42,7 +42,6 @@
42 42
 using std::string;
43 43
 
44 44
 #include <map>
45
-using std::map;
46 45
 
47 46
 #include <utility>
48 47
 using std::pair;
... ...
@@ -113,8 +112,8 @@ class AmCallWatcher
113 112
   public AmEventHandler
114 113
 {
115 114
  public:
116
-  typedef map<string, CallStatus*> CallStatusMap;
117
-  typedef map<string, pair<CallStatus*, time_t> > CallStatusTimedMap;
115
+  typedef std::map<string, CallStatus*> CallStatusMap;
116
+  typedef std::map<string, pair<CallStatus*, time_t> > CallStatusTimedMap;
118 117
 
119 118
  private:
120 119
   CallStatusMap states;
... ...
@@ -36,7 +36,7 @@
36 36
 #include <assert.h>
37 37
 #include <unistd.h>
38 38
 
39
-map<string,AmConferenceStatus*> AmConferenceStatus::cid2status;
39
+std::map<std::string,AmConferenceStatus*> AmConferenceStatus::cid2status;
40 40
 AmMutex                         AmConferenceStatus::cid2s_mut;
41 41
 
42 42
 //
... ...
@@ -49,7 +49,7 @@ AmConferenceChannel* AmConferenceStatus::getChannel(const string& cid,
49 49
   AmConferenceChannel* ch = 0;
50 50
 
51 51
   cid2s_mut.lock();
52
-  map<string,AmConferenceStatus*>::iterator it = cid2status.find(cid);
52
+  std::map<std::string,AmConferenceStatus*>::iterator it = cid2status.find(cid);
53 53
 
54 54
   if(it != cid2status.end()){
55 55
 
... ...
@@ -70,7 +70,7 @@ AmConferenceChannel* AmConferenceStatus::getChannel(const string& cid,
70 70
 size_t AmConferenceStatus::getConferenceSize(const string& cid) {
71 71
 
72 72
   cid2s_mut.lock();
73
-  map<string,AmConferenceStatus*>::iterator it = cid2status.find(cid);
73
+  std::map<std::string,AmConferenceStatus*>::iterator it = cid2status.find(cid);
74 74
 
75 75
   size_t res = 0;
76 76
   if(it != cid2status.end())
... ...
@@ -86,7 +86,7 @@ void AmConferenceStatus::postConferenceEvent(const string& cid,
86 86
   AmConferenceStatus*  st = 0;
87 87
 
88 88
   cid2s_mut.lock();
89
-  map<string,AmConferenceStatus*>::iterator it = cid2status.find(cid);
89
+  std::map<std::string,AmConferenceStatus*>::iterator it = cid2status.find(cid);
90 90
 
91 91
   if(it != cid2status.end()){
92 92
 
... ...
@@ -105,7 +105,7 @@ void AmConferenceStatus::postConferenceEvent(const string& cid,
105 105
 void AmConferenceStatus::releaseChannel(const string& cid, unsigned int ch_id)
106 106
 {
107 107
   cid2s_mut.lock();
108
-  map<string,AmConferenceStatus*>::iterator it = cid2status.find(cid);
108
+  std::map<std::string,AmConferenceStatus*>::iterator it = cid2status.find(cid);
109 109
 
110 110
   if(it != cid2status.end()){
111 111
 
... ...
@@ -139,7 +139,7 @@ void AmConferenceStatus::postConferenceEvent(int event_id, const string& sess_id
139 139
 {
140 140
   sessions_mut.lock();
141 141
   int participants = sessions.size();
142
-  for(map<string, unsigned int>::iterator it = sessions.begin(); 
142
+  for(std::map<std::string, unsigned int>::iterator it = sessions.begin(); 
143 143
       it != sessions.end(); it++){
144 144
     AmSessionContainer::instance()->postEvent(
145 145
 					      it->first,
... ...
@@ -155,7 +155,7 @@ AmConferenceChannel* AmConferenceStatus::getChannel(const string& sess_id)
155 155
   AmConferenceChannel* ch = 0;
156 156
 
157 157
   sessions_mut.lock();
158
-  map<string, unsigned int>::iterator it = sessions.find(sess_id);
158
+  std::map<std::string, unsigned int>::iterator it = sessions.find(sess_id);
159 159
   if(it != sessions.end()){
160 160
     ch = new AmConferenceChannel(this,it->second,false);    
161 161
   } else {
... ...
@@ -194,7 +194,7 @@ int AmConferenceStatus::releaseChannel(unsigned int ch_id)
194 194
   unsigned int participants=0;
195 195
 
196 196
   sessions_mut.lock();
197
-  map<unsigned int, SessInfo*>::iterator it = channels.find(ch_id);
197
+  std::map<unsigned int, SessInfo*>::iterator it = channels.find(ch_id);
198 198
   if(it != channels.end()){
199 199
 	
200 200
     SessInfo* si = it->second;
... ...
@@ -204,7 +204,7 @@ int AmConferenceStatus::releaseChannel(unsigned int ch_id)
204 204
     mixer.removeChannel(ch_id);
205 205
 
206 206
     participants = channels.size();
207
-    map<string, unsigned int>::iterator s_it;
207
+    std::map<std::string, unsigned int>::iterator s_it;
208 208
     for(s_it = sessions.begin(); s_it != sessions.end(); s_it++){
209 209
 	    
210 210
       AmSessionContainer::instance()->postEvent(
... ...
@@ -35,7 +35,6 @@
35 35
 
36 36
 #include <map>
37 37
 #include <string>
38
-using std::map;
39 38
 using std::string;
40 39
 
41 40
 class AmConferenceChannel;
... ...
@@ -68,7 +67,7 @@ struct ConferenceEvent: public AmEvent
68 67
  */
69 68
 class AmConferenceStatus
70 69
 {
71
-  static map<string,AmConferenceStatus*> cid2status;
70
+  static std::map<string,AmConferenceStatus*> cid2status;
72 71
   static AmMutex                         cid2s_mut;
73 72
 
74 73
   struct SessInfo {
... ...
@@ -87,10 +86,10 @@ class AmConferenceStatus
87 86
   AmMultiPartyMixer      mixer;
88 87
     
89 88
   // sess_id -> ch_id
90
-  map<string, unsigned int> sessions;
89
+  std::map<string, unsigned int> sessions;
91 90
 
92 91
   // ch_id -> sess_id
93
-  map<unsigned int, SessInfo*> channels;
92
+  std::map<unsigned int, SessInfo*> channels;
94 93
 
95 94
   AmMutex                      sessions_mut;
96 95
 
... ...
@@ -32,9 +32,7 @@
32 32
 #include "AmDtmfDetector.h"
33 33
 
34 34
 #include <string>
35
-#include <map>
36 35
 using std::string;
37
-using std::map;
38 36
 
39 37
 class AmSessionTimerConfig;
40 38
 
... ...
@@ -135,7 +135,7 @@ bool AmConfigReader::hasParameter(const string& param)
135 135
 
136 136
 const string& AmConfigReader::getParameter(const string& param, const string& defval)
137 137
 {
138
-  map<string,string>::iterator it = keys.find(param);
138
+  std::map<std::string,std::string>::iterator it = keys.find(param);
139 139
   if(it == keys.end())
140 140
     return defval;
141 141
   else
... ...
@@ -31,7 +31,6 @@
31 31
 #include <string>
32 32
 #include <map>
33 33
 using std::string;
34
-using std::map;
35 34
 
36 35
 
37 36
 #define MAX_CONFIG_LINE 512
... ...
@@ -45,7 +44,7 @@ using std::map;
45 44
 
46 45
 class AmConfigReader
47 46
 {
48
-  map<string,string> keys;
47
+  std::map<string,string> keys;
49 48
 
50 49
  public:
51 50
   int  loadFile(const string& path);
... ...
@@ -53,10 +52,10 @@ class AmConfigReader
53 52
   const string& getParameter(const string& param, const string& defval = "");
54 53
   unsigned int getParameterInt(const string& param, unsigned int defval = 0);
55 54
 
56
-  map<string,string>::const_iterator begin() const
55
+  std::map<string,string>::const_iterator begin() const
57 56
     { return keys.begin(); }
58 57
 
59
-  map<string,string>::const_iterator end() const
58
+  std::map<string,string>::const_iterator end() const
60 59
     { return keys.end(); }
61 60
 };
62 61
 
... ...
@@ -33,7 +33,6 @@
33 33
 
34 34
 #include <string>
35 35
 #include <memory>
36
-using namespace std;
37 36
 
38 37
 #ifdef USE_SPANDSP
39 38
 #include <math.h>
... ...
@@ -366,7 +365,7 @@ class AmDtmfDetector
366 365
   AmSession *m_session;
367 366
   AmRtpDtmfDetector m_rtpDetector;
368 367
   AmSipDtmfDetector m_sipDetector;
369
-  auto_ptr<AmInbandDtmfDetector> m_inbandDetector;
368
+  std::auto_ptr<AmInbandDtmfDetector> m_inbandDetector;
370 369
   Dtmf::InbandDetectorType m_inband_type;
371 370
 
372 371
   struct timeval m_startTime;
... ...
@@ -32,7 +32,6 @@
32 32
 #include "AmEvent.h"
33 33
 
34 34
 #include <queue>
35
-using std::queue;
36 35
 
37 36
 /** 
38 37
  * \brief Asynchronous event queue implementation 
... ...
@@ -46,7 +45,7 @@ class AmEventQueue
46 45
 {
47 46
 protected:
48 47
   AmEventHandler*   handler;
49
-  queue<AmEvent*>   ev_queue;
48
+  std::queue<AmEvent*>   ev_queue;
50 49
   AmMutex           m_queue;
51 50
   AmCondition<bool> ev_pending;
52 51
 
... ...
@@ -3,7 +3,6 @@
3 3
 #include "log.h"
4 4
 
5 5
 #include <string>
6
-using std::string;
7 6
 
8 7
 #include <unistd.h>
9 8
 #include <string.h>
... ...
@@ -61,7 +60,7 @@ void AmIcmpWatcher::run()
61 60
 
62 61
   struct icmp*       icmp_hdr;
63 62
   size_t             icmp_len;
64
-  string             icmp_type_str;
63
+  std::string        icmp_type_str;
65 64
 
66 65
   char               src_str[INET_ADDRSTRLEN];
67 66
   char               dst_str[INET_ADDRSTRLEN];
... ...
@@ -124,7 +123,7 @@ void AmIcmpWatcher::run()
124 123
       int dstport = ntohs(udp_hdr->uh_dport);
125 124
 	    
126 125
       stream_map_m.lock();
127
-      map<int,AmRtpStream*>::iterator str_it = stream_map.find(srcport);
126
+      std::map<int,AmRtpStream*>::iterator str_it = stream_map.find(srcport);
128 127
 
129 128
       if(str_it != stream_map.end()){
130 129
 
... ...
@@ -31,7 +31,6 @@
31 31
 #include "AmThread.h"
32 32
 
33 33
 #include <map>
34
-using std::map;
35 34
 
36 35
 #define ICMP_BUF_SIZE 512
37 36
 
... ...
@@ -46,7 +45,7 @@ class AmIcmpWatcher: public AmThread
46 45
   int raw_sd;
47 46
 
48 47
   /* RTP Stream map */
49
-  map<int,AmRtpStream*> stream_map;
48
+  std::map<int,AmRtpStream*> stream_map;
50 49
   AmMutex               stream_map_m;
51 50
 
52 51
   /* constructor & destructor are
... ...
@@ -95,7 +95,7 @@ int AmMailDeamon::sendQueued(AmMail* mail)
95 95
 
96 96
 void AmMailDeamon::run()
97 97
 {
98
-  queue<AmMail*> n_event_fifo;
98
+  std::queue<AmMail*> n_event_fifo;
99 99
   while(1){
100 100
 
101 101
     _run_cond.wait_for();
... ...
@@ -35,8 +35,6 @@
35 35
 #include <vector>
36 36
 #include <queue>
37 37
 using std::string;
38
-using std::vector;
39
-using std::queue;
40 38
 
41 39
 /**
42 40
  * \brief Email file attachement
... ...
@@ -59,7 +57,7 @@ struct Attachement
59 57
     : fp(_fp), filename(_file), content_type(_ct) {}
60 58
 };
61 59
 
62
-typedef vector<Attachement> Attachements;
60
+typedef std::vector<Attachement> Attachements;
63 61
 
64 62
 class AmMail;
65 63
 
... ...
@@ -109,7 +107,7 @@ class AmMailDeamon: public AmThread
109 107
   static AmMailDeamon* _instance;
110 108
 
111 109
   AmMutex      event_fifo_mut;
112
-  queue<AmMail*>   event_fifo;
110
+  std::queue<AmMail*>   event_fifo;
113 111
   AmCondition<bool> _run_cond;
114 112
 
115 113
   AmMailDeamon() : _run_cond(false) {}
... ...
@@ -32,6 +32,11 @@
32 32
 #include <sys/time.h>
33 33
 #include <signal.h>
34 34
 
35
+// Solaris seems to need this for nanosleep().
36
+#if defined (__SVR4) && defined (__sun)
37
+#include <time.h>
38
+#endif
39
+
35 40
 /** \brief Request event to the MediaProcessor (remove,...) */
36 41
 struct SchedRequest :
37 42
   public AmEvent
... ...
@@ -84,7 +89,7 @@ void AmMediaProcessor::addSession(AmSession* s,
84 89
   group_mut.lock();
85 90
     
86 91
   // callgroup already in a thread? 
87
-  map<string, unsigned int>::iterator it =
92
+  std::map<std::string, unsigned int>::iterator it =
88 93
     callgroup2thread.find(callgroup);
89 94
   if (it != callgroup2thread.end()) {
90 95
     // yes, use it
... ...
@@ -139,7 +144,7 @@ void AmMediaProcessor::removeFromProcessor(AmSession* s,
139 144
   unsigned int sched_thread = callgroup2thread[callgroup];
140 145
   DBG("  callgroup is '%s', thread %u\n", callgroup.c_str(), sched_thread);
141 146
   // erase callgroup membership entry
142
-  multimap<string, AmSession*>::iterator it = 
147
+  std::multimap<std::string, AmSession*>::iterator it = 
143 148
     callgroupmembers.lower_bound(callgroup);
144 149
   while ((it != callgroupmembers.end()) &&
145 150
          (it != callgroupmembers.upper_bound(callgroup))) {
... ...
@@ -34,8 +34,6 @@
34 34
 #include <set>
35 35
 using std::set;
36 36
 #include <map>
37
-using std::map;
38
-using std::multimap;
39 37
 
40 38
 struct SchedRequest;
41 39
 
... ...
@@ -90,9 +88,9 @@ class AmMediaProcessor
90 88
   unsigned int num_threads; 
91 89
   AmMediaProcessorThread**  threads;
92 90
   
93
-  map<string, unsigned int> callgroup2thread;
94
-  multimap<string, AmSession*> callgroupmembers;
95
-  map<AmSession*, string> session2callgroup;
91
+  std::map<string, unsigned int> callgroup2thread;
92
+  std::multimap<string, AmSession*> callgroupmembers;
93
+  std::map<AmSession*, string> session2callgroup;
96 94
   AmMutex group_mut;
97 95
 
98 96
   AmMediaProcessor();
... ...
@@ -39,7 +39,6 @@
39 39
 #endif
40 40
 
41 41
 #include <map>
42
-using std::map;
43 42
 
44 43
 /**
45 44
  * \brief Mixer for one conference.
... ...
@@ -49,8 +48,8 @@ using std::map;
49 48
  */
50 49
 class AmMultiPartyMixer
51 50
 {
52
-  typedef map<int,SampleArrayShort*> ChannelMap;
53
-  //typedef map<int,unsigned int>      ChannelOff;
51
+  typedef std::map<int,SampleArrayShort*> ChannelMap;
52
+  //typedef std::map<int,unsigned int>    ChannelOff;
54 53
 
55 54
   ChannelMap       channels;
56 55
   //ChannelOff       ch_offsets;
... ...
@@ -203,7 +203,7 @@ int AmPlugIn::load(const string& directory, const string& plugins)
203 203
   DBG("AmPlugIn: Initializing plugins...\n");
204 204
 
205 205
   // initialize base components
206
-  for(map<string,AmPluginFactory*>::iterator it = name2base.begin();
206
+  for(std::map<std::string,AmPluginFactory*>::iterator it = name2base.begin();
207 207
       it != name2base.end(); it++){
208 208
     err = it->second->onLoad();
209 209
     if(err)
... ...
@@ -211,7 +211,7 @@ int AmPlugIn::load(const string& directory, const string& plugins)
211 211
   }
212 212
 
213 213
   // initialize session event handlers
214
-  for(map<string,AmSessionEventHandlerFactory*>::iterator it = name2seh.begin();
214
+  for(std::map<std::string,AmSessionEventHandlerFactory*>::iterator it = name2seh.begin();
215 215
       it != name2seh.end(); it++){
216 216
     err = it->second->onLoad();
217 217
     if(err)
... ...
@@ -219,7 +219,7 @@ int AmPlugIn::load(const string& directory, const string& plugins)
219 219
   }
220 220
 
221 221
   // initialize DI component plugins
222
-  for(map<string,AmDynInvokeFactory*>::iterator it = name2di.begin();
222
+  for(std::map<std::string,AmDynInvokeFactory*>::iterator it = name2di.begin();
223 223
       it != name2di.end(); it++){
224 224
     err = it->second->onLoad();
225 225
     if(err)
... ...
@@ -227,7 +227,7 @@ int AmPlugIn::load(const string& directory, const string& plugins)
227 227
   }
228 228
 
229 229
   // load SIPEventHandlers 
230
-  for(map<string,AmSIPEventHandler*>::iterator it = name2sipeh.begin();
230
+  for(std::map<std::string,AmSIPEventHandler*>::iterator it = name2sipeh.begin();
231 231
       it != name2sipeh.end(); it++){
232 232
     err = it->second->onLoad();
233 233
     if(err)
... ...
@@ -238,7 +238,7 @@ int AmPlugIn::load(const string& directory, const string& plugins)
238 238
   }
239 239
 
240 240
   // init logging facilities
241
-  for(map<string,AmLoggingFacility*>::iterator it = name2logfac.begin();
241
+  for(std::map<std::string,AmLoggingFacility*>::iterator it = name2logfac.begin();
242 242
       it != name2logfac.end(); it++){
243 243
     err = it->second->onLoad();
244 244
     if(err)
... ...
@@ -248,8 +248,8 @@ int AmPlugIn::load(const string& directory, const string& plugins)
248 248
   }
249 249
 
250 250
     
251
-  map<string,AmSessionFactory*> apps(name2app);
252
-  for(map<string,AmSessionFactory*>::iterator it = apps.begin();
251
+  std::map<std::string,AmSessionFactory*> apps(name2app);
252
+  for(std::map<std::string,AmSessionFactory*>::iterator it = apps.begin();
253 253
       it != apps.end(); it++){
254 254
 
255 255
     err = it->second->onLoad();
... ...
@@ -350,14 +350,14 @@ amci_inoutfmt_t* AmPlugIn::fileFormat(const string& fmt_name, const string& ext)
350 350
 {
351 351
   if(!fmt_name.empty()){
352 352
 
353
-    map<string,amci_inoutfmt_t*>::iterator it = file_formats.find(fmt_name);
353
+    std::map<std::string,amci_inoutfmt_t*>::iterator it = file_formats.find(fmt_name);
354 354
     if ((it != file_formats.end()) &&
355 355
 	(ext.empty() || (ext == it->second->ext)))
356 356
       return it->second;
357 357
   }
358 358
   else if(!ext.empty()){
359 359
 	
360
-    map<string,amci_inoutfmt_t*>::iterator it = file_formats.begin();
360
+    std::map<std::string,amci_inoutfmt_t*>::iterator it = file_formats.begin();
361 361
     for(;it != file_formats.end();++it){
362 362
       if(ext == it->second->ext)
363 363
 	return it->second;
... ...
@@ -369,7 +369,7 @@ amci_inoutfmt_t* AmPlugIn::fileFormat(const string& fmt_name, const string& ext)
369 369
 
370 370
 amci_codec_t* AmPlugIn::codec(int id)
371 371
 {
372
-  map<int,amci_codec_t*>::iterator it = codecs.find(id);
372
+  std::map<int,amci_codec_t*>::iterator it = codecs.find(id);
373 373
   if(it != codecs.end())
374 374
     return it->second;
375 375
 
... ...
@@ -378,7 +378,7 @@ amci_codec_t* AmPlugIn::codec(int id)
378 378
 
379 379
 amci_payload_t*  AmPlugIn::payload(int payload_id)
380 380
 {
381
-  map<int,amci_payload_t*>::iterator it = payloads.find(payload_id);
381
+  std::map<int,amci_payload_t*>::iterator it = payloads.find(payload_id);
382 382
   if(it != payloads.end())
383 383
     return it->second;
384 384
 
... ...
@@ -405,7 +405,7 @@ amci_subtype_t* AmPlugIn::subtype(amci_inoutfmt_t* iofmt, int subtype)
405 405
 
406 406
 AmSessionFactory* AmPlugIn::getFactory4App(const string& app_name)
407 407
 {
408
-  map<string,AmSessionFactory*>::iterator it = name2app.find(app_name);
408
+  std::map<std::string,AmSessionFactory*>::iterator it = name2app.find(app_name);
409 409
   if(it != name2app.end())
410 410
     return it->second;
411 411
   return 0;
... ...
@@ -413,7 +413,7 @@ AmSessionFactory* AmPlugIn::getFactory4App(const string& app_name)
413 413
 
414 414
 AmSessionEventHandlerFactory* AmPlugIn::getFactory4Seh(const string& name)
415 415
 {
416
-  map<string,AmSessionEventHandlerFactory*>::iterator it = name2seh.find(name);
416
+  std::map<std::string,AmSessionEventHandlerFactory*>::iterator it = name2seh.find(name);
417 417
   if(it != name2seh.end())
418 418
     return it->second;
419 419
   return 0;
... ...
@@ -421,7 +421,7 @@ AmSessionEventHandlerFactory* AmPlugIn::getFactory4Seh(const string& name)
421 421
 
422 422
 AmDynInvokeFactory* AmPlugIn::getFactory4Di(const string& name)
423 423
 {
424
-  map<string,AmDynInvokeFactory*>::iterator it = name2di.find(name);
424
+  std::map<std::string,AmDynInvokeFactory*>::iterator it = name2di.find(name);
425 425
   if(it != name2di.end())
426 426
     return it->second;
427 427
   return 0;
... ...
@@ -429,7 +429,7 @@ AmDynInvokeFactory* AmPlugIn::getFactory4Di(const string& name)
429 429
 
430 430
 AmSIPEventHandler* AmPlugIn::getFactory4SIPeh(const string& name)
431 431
 {
432
-  map<string,AmSIPEventHandler*>::iterator it = name2sipeh.find(name);
432
+  std::map<std::string,AmSIPEventHandler*>::iterator it = name2sipeh.find(name);
433 433
   if(it != name2sipeh.end())
434 434
     return it->second;
435 435
   return 0;
... ...
@@ -437,7 +437,7 @@ AmSIPEventHandler* AmPlugIn::getFactory4SIPeh(const string& name)
437 437
 
438 438
 AmLoggingFacility* AmPlugIn::getFactory4LogFaclty(const string& name)
439 439
 {
440
-  map<string,AmLoggingFacility*>::iterator it = name2logfac.find(name);
440
+  std::map<std::string,AmLoggingFacility*>::iterator it = name2logfac.find(name);
441 441
   if(it != name2logfac.end())
442 442
     return it->second;
443 443
   return 0;
... ...
@@ -711,7 +711,7 @@ int AmPlugIn::addFileFormat(amci_inoutfmt_t* f)
711 711
 
712 712
 bool AmPlugIn::registerFactory4App(const string& app_name, AmSessionFactory* f)
713 713
 {
714
-  map<string,AmSessionFactory*>::iterator it = name2app.find(app_name);
714
+  std::map<std::string,AmSessionFactory*>::iterator it = name2app.find(app_name);
715 715
   if(it != name2app.end()){
716 716
     WARN("Application '%s' has already been registered and cannot be registered a second time\n",
717 717
 	 app_name.c_str());
... ...
@@ -34,9 +34,7 @@
34 34
 #include <vector>
35 35
 #include <set>
36 36
 using std::string;
37
-using std::map;
38 37
 using std::vector;
39
-using std::set;
40 38
 
41 39
 class AmPluginFactory;
42 40
 class AmSessionFactory;
... ...
@@ -68,21 +66,21 @@ class AmPlugIn
68 66
 
69 67
   vector<void*> dlls;
70 68
 
71
-  map<int,amci_codec_t*>       codecs;
72
-  map<int,amci_payload_t*>     payloads;
73
-  map<int,int>                 payload_order;
74
-  map<string,amci_inoutfmt_t*> file_formats;
75
-  map<string,AmSessionFactory*>  name2app;
76
-
77
-  map<string,AmSessionEventHandlerFactory*> name2seh;
78
-  map<string,AmPluginFactory*> name2base;
79
-  map<string,AmDynInvokeFactory*> name2di;
80
-  map<string,AmSIPEventHandler*> name2sipeh;
81
-  map<string,AmLoggingFacility*> name2logfac;
69
+  std::map<int,amci_codec_t*>       codecs;
70
+  std::map<int,amci_payload_t*>     payloads;
71
+  std::map<int,int>                 payload_order;
72
+  std::map<string,amci_inoutfmt_t*> file_formats;
73
+  std::map<string,AmSessionFactory*>  name2app;
74
+
75
+  std::map<string,AmSessionEventHandlerFactory*> name2seh;
76
+  std::map<string,AmPluginFactory*> name2base;
77
+  std::map<string,AmDynInvokeFactory*> name2di;
78
+  std::map<string,AmSIPEventHandler*> name2sipeh;
79
+  std::map<string,AmLoggingFacility*> name2logfac;
82 80
   AmCtrlInterface *ctrlIface;
83 81
 
84 82
   int dynamic_pl; // range: 96->127, see RFC 1890
85
-  set<string> excluded_payloads;  // don't load these payloads (named)
83
+  std::set<string> excluded_payloads;  // don't load these payloads (named)
86 84
     
87 85
   AmPlugIn();
88 86
   ~AmPlugIn();
... ...
@@ -122,9 +120,9 @@ class AmPlugIn
122 120
    */
123 121
   amci_payload_t*  payload(int payload_id);
124 122
   /** @return the suported payloads. */
125
-  const map<int,amci_payload_t*>& getPayloads() { return payloads; }
123
+  const std::map<int,amci_payload_t*>& getPayloads() { return payloads; }
126 124
   /** @return the order of payloads. */
127
-  const map<int,int>& getPayloadOrder() { return payload_order; }
125
+  const std::map<int,int>& getPayloadOrder() { return payload_order; }
128 126
   /** 
129 127
    * File format lookup according to the 
130 128
    * format name and/or file extension.
... ...
@@ -36,16 +36,16 @@ AmPromptCollection::AmPromptCollection()
36 36
 AmPromptCollection::~AmPromptCollection() 
37 37
 {
38 38
   // clean up
39
-  for (map<string, AudioFileEntry*>::iterator it=
39
+  for (std::map<std::string, AudioFileEntry*>::iterator it=
40 40
 	 store.begin(); it != store.end();it++)
41 41
     delete it->second;
42 42
 }
43 43
 
44 44
 int AmPromptCollection::configureModule(AmConfigReader& cfg, 
45
-					vector<pair<string, string> >& announcements,
45
+					std::vector<std::pair<std::string, std::string> >& announcements,
46 46
 					const char* mod_name) {
47 47
   int res = 0;
48
-  for (vector<pair<string, string> >::iterator it=
48
+  for (std::vector<std::pair<std::string, std::string> >::iterator it=
49 49
 	 announcements.begin(); it != announcements.end(); it++) {
50 50
     string fname = cfg.getParameter(it->first, "");
51 51
     if (fname.empty()){
... ...
@@ -61,8 +61,8 @@ int AmPromptCollection::configureModule(AmConfigReader& cfg,
61 61
   return res;
62 62
 }
63 63
 
64
-int AmPromptCollection::setPrompt(const string& name, 
65
-				  const string& filename,
64
+int AmPromptCollection::setPrompt(const std::string& name, 
65
+				  const std::string& filename,
66 66
 				  const char* mod_name) {
67 67
   if (!file_exists(filename)) {
68 68
     ERROR("'%s' prompt for module %s does not exist at '%s'.\n", 
... ...
@@ -105,10 +105,10 @@ AmCachedAudioFile* AudioFileEntry::getAudio(){
105 105
   return new AmCachedAudioFile(&cache);
106 106
 }
107 107
 
108
-int AmPromptCollection::addToPlaylist(const string& name, long sess_id, 
108
+int AmPromptCollection::addToPlaylist(const std::string& name, long sess_id, 
109 109
 				      AmPlaylist& list, bool front) {
110 110
   string s = name;
111
-  map<string, AudioFileEntry*>::iterator it=store.begin();
111
+  std::map<std::string, AudioFileEntry*>::iterator it=store.begin();
112 112
 
113 113
   while (it != store.end()) {
114 114
     if (!strcmp(it->first.c_str(), s.c_str()))
... ...
@@ -143,7 +143,7 @@ int AmPromptCollection::addToPlaylist(const string& name, long sess_id,
143 143
 
144 144
 void AmPromptCollection::cleanup(long sess_id) {
145 145
   items_mut.lock();
146
-  for (vector<AmCachedAudioFile*>::iterator it = 
146
+  for (std::vector<AmCachedAudioFile*>::iterator it = 
147 147
 	 items[sess_id].begin(); it!=items[sess_id].end(); it++)
148 148
     delete *it;
149 149
   items.erase(sess_id);
... ...
@@ -41,10 +41,10 @@
41 41
 
42 42
 #define AM_PROMPT_START \
43 43
 {   \
44
- vector<pair<string, string> > _prompt_names
44
+  std::vector<std::pair<string, string> > _prompt_names
45 45
 
46 46
 #define AM_PROMPT_ADD(_name, _default_file) \
47
- _prompt_names.push_back(make_pair(_name, _default_file))
47
+ _prompt_names.push_back(std::make_pair(_name, _default_file))
48 48
 
49 49
 #define AM_PROMPT_END(_prompts, _cfg, _MOD_NAME) \
50 50
   _prompts.configureModule(_cfg, _prompt_names, _MOD_NAME); \
... ...
@@ -53,9 +53,7 @@
53 53
 #include <map>
54 54
 #include <string>
55 55
 #include <utility>
56
-using std::map;
57 56
 using std::string;
58
-using std::pair;
59 57
 
60 58
 #include "AmCachedAudioFile.h"
61 59
 #include "AmPlaylist.h"
... ...
@@ -69,10 +67,10 @@ class AudioFileEntry;
69 67
 class AmPromptCollection {
70 68
 
71 69
   // loaded files
72
-  map<string, AudioFileEntry*> store;
70
+  std::map<string, AudioFileEntry*> store;
73 71
 
74 72
   // opened objects
75
-  map<long, vector<AmCachedAudioFile*> > items;
73
+  std::map<long, vector<AmCachedAudioFile*> > items;
76 74
   // mutex for the above
77 75
   AmMutex items_mut;
78 76
 
... ...
@@ -86,7 +84,7 @@ class AmPromptCollection {
86 84
    * @param announcements : name, default file for announcement
87 85
    */
88 86
   int configureModule(AmConfigReader& cfg, 
89
-		      vector<pair<string, string> >& announcements,
87
+		      vector<std::pair<string, string> >& announcements,
90 88
 		      const char* mod_name); 
91 89
   /**
92 90
    * add a prompt with explicit filename
... ...
@@ -31,7 +31,12 @@
31 31
 #include "log.h"
32 32
 
33 33
 #include <errno.h>
34
+
35
+// Not on Solaris!
36
+#if !defined (__SVR4) && !defined (__sun)
34 37
 #include <strings.h>
38
+#endif
39
+
35 40
 #include <sys/time.h>
36 41
 #include <sys/poll.h>
37 42
 
... ...
@@ -33,7 +33,6 @@
33 33
 #include <sys/select.h>
34 34
 
35 35
 #include <map>
36
-using std::map;
37 36
 using std::greater;
38 37
 
39 38
 class AmRtpStream;
... ...
@@ -47,7 +46,7 @@ class AmRtpStream;
47 46
  */
48 47
 class AmRtpReceiver: public AmThread {
49 48
 
50
-  typedef map<int, AmRtpStream*, greater<int> > Streams;
49
+  typedef std::map<int, AmRtpStream*, greater<int> > Streams;
51 50
 
52 51
   static AmRtpReceiver* _instance;
53 52
 
... ...
@@ -41,7 +41,6 @@
41 41
 #include <map>
42 42
 #include <memory>
43 43
 using std::string;
44
-using std::map;
45 44
 using std::auto_ptr;
46 45
 
47 46
 // return values of AmRtpStream::receive
... ...
@@ -58,7 +57,7 @@ struct amci_payload_t;
58 57
 class AmAudio;
59 58
 class AmSession;
60 59
 class SdpPayload;
61
-typedef map<unsigned int, AmRtpPacket, ts_less> ReceiveBuffer;
60
+typedef std::map<unsigned int, AmRtpPacket, ts_less> ReceiveBuffer;
62 61
 
63 62
 /**
64 63
  * \brief RTP implementation
... ...
@@ -38,7 +38,10 @@
38 38
 #include "amci/amci.h"
39 39
 #include "log.h"
40 40
 
41
+// Not on Solaris!
42
+#if !defined (__SVR4) && !defined (__sun)
41 43
 #include "strings.h"
44
+#endif
42 45
 
43 46
 inline char* get_next_line(char* s);
44 47
 inline bool parse_string_tok(char*& s, string& res, char sep_char = ' ');
... ...
@@ -249,8 +252,8 @@ int AmSdp::genResponse(const string& localip, int localport,
249 252
 int AmSdp::genRequest(const string& localip,int localport, string& out_buf)
250 253
 {
251 254
   AmPlugIn* plugin = AmPlugIn::instance();
252
-  const map<int,amci_payload_t*>& payloads = plugin->getPayloads();
253
-  const map<int,int>& payload_order = plugin->getPayloadOrder();
255
+  const std::map<int,amci_payload_t*>& payloads = plugin->getPayloads();
256
+  const std::map<int,int>& payload_order = plugin->getPayloadOrder();
254 257
 
255 258
   if(payloads.empty()){
256 259
     ERROR("no payload plugin loaded.\n");
... ...
@@ -275,7 +278,7 @@ int AmSdp::genRequest(const string& localip,int localport, string& out_buf)
275 278
     "t=0 0\r\n"
276 279
     "m=audio " + int2str(localport) + " RTP/AVP ";
277 280
     
278
-  map<int,int>::const_iterator it = payload_order.begin();
281
+  std::map<int,int>::const_iterator it = payload_order.begin();
279 282
   out_buf += int2str((it++)->second);
280 283
 
281 284
   for(; it != payload_order.end(); ++it)
... ...
@@ -284,7 +287,7 @@ int AmSdp::genRequest(const string& localip,int localport, string& out_buf)
284 287
   out_buf += "\r\n";
285 288
 
286 289
   for (it = payload_order.begin(); it != payload_order.end(); ++it) {
287
-      map<int,amci_payload_t*>::const_iterator it2 = payloads.find(it->second);
290
+      std::map<int,amci_payload_t*>::const_iterator it2 = payloads.find(it->second);
288 291
       if (it2 != payloads.end()) {
289 292
 	  out_buf += "a=rtpmap:" + int2str(it2->first) 
290 293
 	      + " " + string(it2->second->name) 
... ...
@@ -379,9 +382,9 @@ bool AmSdp::hasTelephoneEvent()
379 382
 int AmSdp::getDynPayload(const string& name, int rate)
380 383
 {
381 384
   AmPlugIn* pi = AmPlugIn::instance();
382
-  const map<int, amci_payload_t*>& ref_payloads = pi->getPayloads();
385
+  const std::map<int, amci_payload_t*>& ref_payloads = pi->getPayloads();
383 386
 
384
-  for(map<int, amci_payload_t*>::const_iterator pl_it = ref_payloads.begin();
387
+  for(std::map<int, amci_payload_t*>::const_iterator pl_it = ref_payloads.begin();
385 388
       pl_it != ref_payloads.end(); ++pl_it)
386 389
     if( !strcasecmp(name.c_str(), pl_it->second->name)
387 390
 	&&  (rate == pl_it->second->sample_rate) )
... ...
@@ -32,8 +32,6 @@
32 32
 #include <map>
33 33
 #include <vector>
34 34
 using std::string;
35
-using std::map;
36
-using std::vector;
37 35
 
38 36
 
39 37
 #define COMFORT_NOISE_PAYLOAD_TYPE 13 // RFC 3389
... ...
@@ -116,7 +114,7 @@ struct SdpMedia
116 114
   SdpConnection conn; // c=
117 115
   Direction     dir;  // a=direction
118 116
 
119
-  vector<SdpPayload> payloads;
117
+  std::vector<SdpPayload> payloads;
120 118
 
121 119
   SdpMedia() : conn() {}
122 120
 };
... ...
@@ -151,10 +149,10 @@ public:
151 149
   string           sessionName; // s= 
152 150
   string           uri;         // u=
153 151
   SdpConnection    conn;        // c=
154
-  vector<SdpMedia> media;       // m= ... [a=rtpmap:...]+
152
+  std::vector<SdpMedia> media;  // m= ... [a=rtpmap:...]+
155 153
 
156 154
   // Supported payloads
157
-  vector<SdpPayload*> sup_pl; 
155
+  std::vector<SdpPayload*> sup_pl; 
158 156
   // Is remote host requesting 
159 157
   // us to do passive RTP ?
160 158
   bool remote_active;
... ...
@@ -186,7 +184,7 @@ public:
186 184
    * Get a compatible payload from SDP offer/response. 
187 185
    * @return empty vector if error encountered.
188 186
    */
189
-  const vector<SdpPayload*>& getCompatiblePayloads(int media_type, string& addr, int& port);
187
+  const std::vector<SdpPayload*>& getCompatiblePayloads(int media_type, string& addr, int& port);
190 188
 
191 189
   /**
192 190
    * Test if remote UA supports 'telefone_event'.
... ...
@@ -44,9 +44,6 @@
44 44
 #include <map>
45 45
 using std::string;
46 46
 using std::vector;
47
-using std::queue;
48
-using std::map;
49
-using std::pair;
50 47
 
51 48
 class AmSessionFactory;
52 49
 class AmDtmfEvent;
... ...
@@ -32,14 +32,10 @@
32 32
 #include "AmSession.h"
33 33
 
34 34
 #include <string>
35
-#include <vector>
36 35
 #include <queue>
37 36
 #include <map>
38 37
 
39 38
 using std::string;
40
-using std::vector;
41
-using std::queue;
42
-using std::map;
43 39
 
44 40
 /**
45 41
  * \brief Centralized session container.
... ...
@@ -54,13 +50,13 @@ class AmSessionContainer : public AmThread
54 50
   static AmSessionContainer* _SessionContainer;
55 51
 
56 52
   // some typedefs ...
57
-  typedef map<string,AmSession*> SessionMap;
53
+  typedef std::map<string,AmSession*> SessionMap;
58 54
   typedef SessionMap::iterator SessionMapIter;
59 55
 
60
-  typedef map<string,string>     Dictionnary;
56
+  typedef std::map<string,string>     Dictionnary;
61 57
   typedef Dictionnary::iterator  DictIter;
62 58
 
63
-  typedef queue<AmSession*>      SessionQueue;
59
+  typedef std::queue<AmSession*>      SessionQueue;
64 60
 
65 61
   /** 
66 62
    * Container for active sessions 
... ...
@@ -34,8 +34,6 @@
34 34
 #include <vector>
35 35
 #include <map>
36 36
 using std::string;
37
-using std::vector;
38
-using std::map;
39 37
 
40 38
 #define CONTACT_USER_PREFIX "sems"
41 39
 
... ...
@@ -58,7 +56,7 @@ struct AmSipTransaction
58 56
   {}
59 57
 };
60 58
 
61
-typedef map<int,AmSipTransaction> TransMap;
59
+typedef std::map<int,AmSipTransaction> TransMap;
62 60
 
63 61
 /**
64 62
  * \brief base class for SIP request/reply event handler 
... ...
@@ -93,7 +91,7 @@ class AmSipDialog
93 91
   TransMap uac_trans;
94 92
 
95 93
   AmSipDialogEventHandler* hdl;
96
-  vector<string> route;        // record routing
94
+  std::vector<string> route;        // record routing
97 95
 
98 96
   int updateStatusReply(const AmSipRequest& req, 
99 97
 			unsigned int code);
... ...
@@ -262,7 +262,7 @@ void AmThreadWatcher::run()
262 262
     DBG("Thread watcher starting its work\n");
263 263
 
264 264
     try {
265
-      queue<AmThread*> n_thread_queue;
265
+      std::queue<AmThread*> n_thread_queue;
266 266
 
267 267
       while(!thread_queue.empty()){
268 268
 
... ...
@@ -31,7 +31,6 @@
31 31
 #include <pthread.h>
32 32
 
33 33
 #include <queue>
34
-using std::queue;
35 34
 
36 35
 /**
37 36
  * \brief C++ Wrapper class for pthread mutex
... ...
@@ -205,7 +204,7 @@ class AmThreadWatcher: public AmThread
205 204
   static AmThreadWatcher* _instance;
206 205
   static AmMutex          _inst_mut;
207 206
 
208
-  queue<AmThread*> thread_queue;
207
+  std::queue<AmThread*> thread_queue;
209 208
   AmMutex          q_mut;
210 209
 
211 210
   /** the daemon only runs if this is true */
... ...
@@ -30,12 +30,11 @@
30 30
 
31 31
 #include <map>
32 32
 #include <string>
33
-using std::map;
34 33
 using std::string;
35 34
 
36 35
 class AmMail;
37 36
 
38
-typedef map<string,string> EmailTmplDict;
37
+typedef std::map<std::string,std::string> EmailTmplDict;
39 38
 
40 39
 /** \brief loads, processes and outputs an email template file */
41 40
 class EmailTemplate
... ...
@@ -5,7 +5,9 @@ include $(COREPATH)/../Makefile.defs
5 5
 
6 6
 LDFLAGS  += $(module_ldflags)
7 7
 CPPFLAGS += -I $(COREPATH)
8
+CFLAGS   += -I $(COREPATH)
8 9
 CFLAGS   += $(module_cflags)
10
+CPPFLAGS += $(module_cflags)
9 11
 CXXFLAGS += $(module_cflags)
10 12
 
11 13
 app_module_dir = $(COREPATH)/lib
... ...
@@ -62,3 +62,4 @@ char *brpc_strerror();
62 62
 
63 63
 
64 64
 #endif /* __BRPC_ERRNO_H__ */
65
+
... ...
@@ -43,3 +43,4 @@ void brpc_mem_setup(
43 43
 
44 44
 #endif /* __BRPC_MEM_H__ */
45 45
 
46
+
... ...
@@ -27,3 +27,4 @@
27 27
 #endif /*BINRPC_REENTRANT*/
28 28
 
29 29
 #endif /* __BINRPC_TLS_H__ */
30
+
... ...
@@ -1,7 +1,12 @@
1 1
 COREPATH =../..
2 2
 plug_in_name = l16
3 3
 
4
-module_ldflags =
4
+module_ldflags = 
5 5
 module_cflags  = 
6 6
 
7
+ifeq ($(OS),solaris)
8
+	# For ntohs and friends.
9
+	module_ldflags += -lsocket -lnsl
10
+endif
11
+
7 12
 include ../Makefile.audio_module
... ...
@@ -29,6 +29,14 @@
29 29
    byte order, otherwise CODEC_PCM16 could be used right away
30 30
 */
31 31
 
32
+// For ntohs() on Solaris.
33
+#if defined (__SVR4) && defined (__sun)
34
+#include <sys/byteorder.h>
35
+#include <sys/types.h>
36
+#include <netinet/in.h>
37
+#include <inttypes.h>
38
+#endif
39
+
32 40
 #include <arpa/inet.h>
33 41
 
34 42
 #include "amci.h"
... ...
@@ -84,7 +84,7 @@ void UserTimer::checkTimers() {
84 84
   struct timeval cur_time;
85 85
   gettimeofday(&cur_time,NULL);
86 86
   
87
-  set<AmTimer>::iterator it = timers.begin();
87
+  std::set<AmTimer>::iterator it = timers.begin();
88 88
   
89 89
   while( timercmp(&it->time,&cur_time,<) 
90 90
 	 || timercmp(&it->time,&cur_time,==) ){
... ...
@@ -139,7 +139,7 @@ void UserTimer::removeTimer(int id, const string& session_id) {
139 139
 void UserTimer::unsafe_removeTimer(int id, const string& session_id) 
140 140
 {
141 141
   // erase old timer if exists
142
-  set<AmTimer>::iterator it = timers.begin(); 
142
+  std::set<AmTimer>::iterator it = timers.begin(); 
143 143
   while (it != timers.end()) {
144 144
     if ((it->id == id)&&(it->session_id == session_id)) {
145 145
       timers.erase(it);
... ...
@@ -152,7 +152,7 @@ void UserTimer::unsafe_removeTimer(int id, const string& session_id)
152 152
 void UserTimer::removeTimers(const string& session_id) {
153 153
   //  DBG("removing timers for <%s>\n", session_id.c_str());
154 154
   timers_mut.lock();
155
-  for (set<AmTimer>::iterator it = timers.begin(); 
155
+  for (std::set<AmTimer>::iterator it = timers.begin(); 
156 156
        it != timers.end(); it++) {
157 157
     if (it->session_id == session_id) {
158 158
       timers.erase(it);
... ...
@@ -165,7 +165,7 @@ void UserTimer::removeTimers(const string& session_id) {
165 165
 void UserTimer::removeUserTimers(const string& session_id) {
166 166
   //  DBG("removing User timers for <%s>\n", session_id.c_str());
167 167
   timers_mut.lock();
168
-  for (set<AmTimer>::iterator it = timers.begin(); 
168
+  for (std::set<AmTimer>::iterator it = timers.begin(); 
169 169
        it != timers.end(); it++) {
170 170
     if ((it->id > 0)&&(it->session_id == session_id)) {
171 171
       timers.erase(it);
... ...
@@ -8,7 +8,6 @@
8 8
 #include <arpa/inet.h>
9 9
 
10 10
 #include <map>
11
-using std::map;
12 11
 #include <string>
13 12
 using std::string;
14 13
 
... ...
@@ -33,7 +32,7 @@ void print_usage(const char * progname)
33 32
 }
34 33
 
35 34
 static int parse_args(int argc, char* argv[], const string& flags,
36
-		      const string& options, map<char,string>& args);
35
+		      const string& options, std::map<char,string>& args);
37 36
 
38 37
 
39 38
 /* returns non-zero if error occured */
... ...
@@ -73,7 +72,7 @@ int main(int argc, char** argv)
73 72
   int sd, err;
74 73
   struct sockaddr_in addr;
75 74
     
76
-  map<char,string> args;
75
+  std::map<char,string> args;
77 76
 
78 77
   if(parse_args(argc, argv, "h","spc", args)){
79 78
     print_usage(argv[0]);
... ...
@@ -84,7 +83,7 @@ int main(int argc, char** argv)
84 83
   string port="5040";
85 84
   string cmd="calls";
86 85
 
87
-  for(map<char,string>::iterator it = args.begin(); 
86
+  for(std::map<char,string>::iterator it = args.begin(); 
88 87
       it != args.end(); ++it){
89 88
 		
90 89
     if(it->second.empty())
... ...
@@ -142,7 +141,7 @@ int main(int argc, char** argv)
142 141
 static int parse_args(int argc, char* argv[],
143 142
 		      const string& flags,
144 143
 		      const string& options,
145
-		      map<char,string>& args)
144
+		      std::map<char,string>& args)
146 145
 {
147 146
   for(int i=1; i<argc; i++){
148 147
 
... ...
@@ -9,6 +9,11 @@ extra_clean = clean_md5
9 9
 module_ldflags = 
10 10
 module_cflags  = 
11 11
 
12
+ifeq ($(OS),solaris)
13
+	module_ldflags += -shared
14
+	module_cflags += -shared
15
+endif
16
+
12 17
 %.o : %.c %.d
13 18
 	$(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
14 19
 
... ...
@@ -31,7 +31,6 @@
31 31
 #include "AmUtils.h"
32 32
 
33 33
 #include <map>
34
-using std::map;
35 34
 
36 35
 #define MOD_NAME "uac_auth"
37 36
 
... ...
@@ -122,7 +121,7 @@ bool UACAuth::onSipReply(const AmSipReply& reply)
122 121
   if (reply.code==407 || reply.code==401) {
123 122
     DBG("SIP reply with code %d cseq %d .\n", reply.code, reply.cseq);
124 123
 		
125
-    map<unsigned int, SIPRequestInfo >::iterator ri = 
124
+    std::map<unsigned int, SIPRequestInfo >::iterator ri = 
126 125
       sent_requests.find(reply.cseq);
127 126
     if (ri!= sent_requests.end())
128 127
       {
... ...
@@ -35,7 +35,6 @@
35 35
 #include <string>
36 36
 using std::string;
37 37
 #include <map>
38
-using std::map;
39 38
 
40 39
 #define HASHLEN 16
41 40
 typedef unsigned char HASH[HASHLEN];
... ...
@@ -101,7 +100,7 @@ struct SIPRequestInfo {
101 100
 /** \brief SessionEventHandler for implementing uac authentication */
102 101
 class UACAuth : public AmSessionEventHandler
103 102
 {
104
-  map<unsigned int, SIPRequestInfo> sent_requests;
103
+  std::map<unsigned int, SIPRequestInfo> sent_requests;
105 104
 
106 105
   UACAuthCred* credential;
107 106
   AmSipDialog* dlg;
... ...
@@ -59,7 +59,6 @@
59 59
 
60 60
 #include <string>
61 61
 using std::string;
62
-using std::pair;
63 62
 using std::make_pair;
64 63
 
65 64
 #ifndef sighandler_t
... ...
@@ -74,7 +73,7 @@ int    is_main=1;
74 73
 
75 74
 
76 75
 static int parse_args(int argc, char* argv[], const string& flags,
77
-		      const string& options, map<char,string>& args);
76
+		      const string& options, std::map<char,string>& args);
78 77
 
79 78
 static void print_usage(char* progname);
80 79
 static void print_version();
... ...
@@ -147,9 +146,9 @@ int write_pid_file()
147 146
 }
148 147
 
149 148
 // returns 0 if OK
150
-static int use_args(char* progname, map<char,string>& args)
149
+static int use_args(char* progname, std::map<char,string>& args)
151 150
 {
152
-  for(map<char,string>::iterator it = args.begin(); 
151
+  for(std::map<char,string>::iterator it = args.begin(); 
153 152
       it != args.end(); ++it){
154 153
 	 
155 154
     if(it->second.empty())
... ...
@@ -205,7 +204,7 @@ static int use_args(char* progname, map<char,string>& args)
205 204
 
206 205
 int main(int argc, char* argv[])
207 206
 {
208
-  map<char,string> args;
207
+  std::map<char,string> args;
209 208
 
210 209
   if(parse_args(argc, argv, "hvE","ugPfiodxD", args)){
211 210
     print_usage(argv[0]);
... ...
@@ -227,7 +226,7 @@ int main(int argc, char* argv[])
227 226
   AmConfig::setStderr("yes");
228 227
   AmConfig::setLoglevel("1");
229 228
 
230
-  map<char,string>::iterator cfg_arg;
229
+  std::map<char,string>::iterator cfg_arg;
231 230
   if( (cfg_arg = args.find('f')) != args.end() )
232 231
     AmConfig::ConfigurationFile = cfg_arg->second;
233 232
 
... ...
@@ -423,7 +422,7 @@ static void print_version()
423 422
   printf("%s\n", DEFAULT_SIGNATURE);
424 423
 }
425 424
 
426
-static void getInterfaceList(int sd, vector<pair<string,string> >& if_list)
425
+static void getInterfaceList(int sd, std::vector<std::pair<string,string> >& if_list)
427 426
 {
428 427
   struct ifconf ifc;
429 428
   struct ifreq ifrs[MAX_NET_DEVICES];
... ...
@@ -469,7 +468,7 @@ static string getLocalIP(const string& dev_name)
469 468
   }	
470 469
 
471 470
   struct ifreq ifr;
472
-  vector<pair<string,string> > if_list;
471
+  std::vector<std::pair<string,string> > if_list;
473 472
 
474 473
   if(dev_name.empty())
475 474
     getInterfaceList(sd,if_list);
... ...
@@ -490,7 +489,7 @@ static string getLocalIP(const string& dev_name)
490 489
   }
491 490
 
492 491
   string local_ip;
493
-  for( vector<pair<string,string> >::iterator it = if_list.begin();
492
+  for( std::vector<std::pair<string,string> >::iterator it = if_list.begin();
494 493
        it != if_list.end(); ++it) {
495 494
 
496 495
     memset(&ifr,0,sizeof(struct ifreq));
... ...
@@ -530,7 +529,7 @@ static string getLocalIP(const string& dev_name)
530