Browse code

core: include channels to SDP payload if channels == 2 - this is to make opus rtpmap standards compliant

Juha Heinanen authored on 12/12/2014 05:06:46
Showing 1 changed files
... ...
@@ -422,7 +422,8 @@ void AmPlugIn::getPayloads(vector<SdpPayload>& pl_vec) const
422 422
   for (std::map<int,int>::const_iterator it = payload_order.begin(); it != payload_order.end(); ++it) {
423 423
     std::map<int,amci_payload_t*>::const_iterator pl_it = payloads.find(it->second);
424 424
     if(pl_it != payloads.end()){
425
-      pl_vec.push_back(SdpPayload(pl_it->first, pl_it->second->name, pl_it->second->advertised_sample_rate, 0));
425
+      // if channels==2 use that value; otherwise don't add channels param
426
+      pl_vec.push_back(SdpPayload(pl_it->first, pl_it->second->name, pl_it->second->advertised_sample_rate, pl_it->second->channels==2?2:0));
426 427
     } else {
427 428
       ERROR("Payload %d (from the payload_order map) was not found in payloads map!\n", it->second);
428 429
     }
Browse code

core: b/f: call all onLoad() functions In case of multiple plugin factories in the same .so, only for the last one (in the order of the loading, as written in the source code) was called.

Szókovács Róbert authored on 21/10/2013 13:07:03
Showing 1 changed files
... ...
@@ -202,13 +202,10 @@ int AmPlugIn::load(const string& directory, const string& plugins)
202 202
       string plugin_file = directory + "/" + plugin_name;
203 203
 
204 204
       DBG("loading %s ...\n",plugin_file.c_str());
205
-      AmPluginFactory* plugin = NULL;
206
-      if( (err = loadPlugIn(plugin_file, plugin_name, plugin)) < 0 ) {
205
+      if( (err = loadPlugIn(plugin_file, plugin_name, loaded_plugins)) < 0 ) {
207 206
         ERROR("while loading plug-in '%s'\n",plugin_file.c_str());
208 207
         return -1;
209 208
       }
210
-      if (NULL != plugin)
211
-	loaded_plugins.push_back(plugin);
212 209
     }
213 210
     
214 211
     closedir(dir);
... ...
@@ -232,14 +229,11 @@ int AmPlugIn::load(const string& directory, const string& plugins)
232 229
 
233 230
       plugin_file = directory + "/"  + plugin_file;
234 231
       DBG("loading %s...\n",plugin_file.c_str());
235
-      AmPluginFactory* plugin = NULL;
236
-      if( (err = loadPlugIn(plugin_file, plugin_file, plugin)) < 0 ) {
232
+      if( (err = loadPlugIn(plugin_file, plugin_file, loaded_plugins)) < 0 ) {
237 233
         ERROR("while loading plug-in '%s'\n",plugin_file.c_str());
238 234
         // be strict here: if plugin not loaded, stop!
239 235
         return err; 
240 236
       }
241
-      if (NULL != plugin)
242
-	loaded_plugins.push_back(plugin);
243 237
     }
244 238
   }
245 239
 
... ...
@@ -269,10 +263,9 @@ void AmPlugIn::set_load_rtld_global(const string& plugin_name) {
269 263
 }
270 264
 
271 265
 int AmPlugIn::loadPlugIn(const string& file, const string& plugin_name,
272
-			 AmPluginFactory*& plugin)
266
+			 vector<AmPluginFactory*>& plugins)
273 267
 {
274
-
275
-  plugin = NULL; // default: not loaded
268
+  AmPluginFactory* plugin = NULL; // default: not loaded
276 269
   int dlopen_flags = RTLD_NOW;
277 270
 
278 271
   char* pname = strdup(plugin_name.c_str());
... ...
@@ -321,24 +314,28 @@ int AmPlugIn::loadPlugIn(const string& file, const string& plugin_name,
321 314
     if(loadAppPlugIn(plugin))
322 315
       goto error;
323 316
     has_sym=true;
317
+    if (NULL != plugin) plugins.push_back(plugin);
324 318
   }
325 319
   if((fc = (FactoryCreate)dlsym(h_dl,FACTORY_SESSION_EVENT_HANDLER_EXPORT_STR)) != NULL){
326 320
     plugin = (AmPluginFactory*)fc();
327 321
     if(loadSehPlugIn(plugin))
328 322
       goto error;
329 323
     has_sym=true;
324
+    if (NULL != plugin) plugins.push_back(plugin);
330 325
   }
331 326
   if((fc = (FactoryCreate)dlsym(h_dl,FACTORY_PLUGIN_EXPORT_STR)) != NULL){
332 327
     plugin = (AmPluginFactory*)fc();
333 328
     if(loadBasePlugIn(plugin))
334 329
       goto error;
335 330
     has_sym=true;
331
+    if (NULL != plugin) plugins.push_back(plugin);
336 332
   }
337 333
   if((fc = (FactoryCreate)dlsym(h_dl,FACTORY_PLUGIN_CLASS_EXPORT_STR)) != NULL){
338 334
     plugin = (AmPluginFactory*)fc();
339 335
     if(loadDiPlugIn(plugin))
340 336
       goto error;
341 337
     has_sym=true;
338
+    if (NULL != plugin) plugins.push_back(plugin);
342 339
   }
343 340
 
344 341
   if((fc = (FactoryCreate)dlsym(h_dl,FACTORY_LOG_FACILITY_EXPORT_STR)) != NULL){
... ...
@@ -346,6 +343,7 @@ int AmPlugIn::loadPlugIn(const string& file, const string& plugin_name,
346 343
     if(loadLogFacPlugIn(plugin))
347 344
       goto error;
348 345
     has_sym=true;
346
+    if (NULL != plugin) plugins.push_back(plugin);
349 347
   }
350 348
 
351 349
   if(!has_sym){
... ...
@@ -359,7 +357,6 @@ int AmPlugIn::loadPlugIn(const string& file, const string& plugin_name,
359 357
 
360 358
  error:
361 359
   dlclose(h_dl);
362
-  plugin = NULL;
363 360
   return -1;
364 361
 }
365 362
 
Browse code

reply to OPTIONS also if no application configured

reported by Julian Santer

Stefan Sayer authored on 12/09/2013 18:42:33
Showing 1 changed files
... ...
@@ -798,7 +798,7 @@ AmSessionFactory* AmPlugIn::findSessionFactory(const AmSipRequest& req, string&
798 798
     }
799 799
     
800 800
     if (m_app_name.empty()) {
801
-      ERROR("could not find any application matching configured criteria\n");
801
+      INFO("could not find any application matching configured criteria\n");
802 802
       return NULL;
803 803
     }
804 804
     
Browse code

plugins: do not unload shared libs if _DEBUG is set

... to allow better debugging (crashes when terminating sems, valgrind analysis)

Václav Kubart authored on 23/04/2013 09:16:24 • Raphael Coeffic committed on 22/05/2013 19:50:18
Showing 1 changed files
... ...
@@ -126,8 +126,11 @@ AmPlugIn::~AmPlugIn()
126 126
   std::for_each(name2di.begin(), name2di.end(), delete_plugin_factory);
127 127
   std::for_each(name2logfac.begin(), name2logfac.end(), delete_plugin_factory);
128 128
 
129
+  // if _DEBUG is set do not unload shared libs to allow better debugging
130
+#ifndef _DEBUG
129 131
   for(vector<void*>::iterator it=dlls.begin();it!=dlls.end();++it)
130 132
     dlclose(*it);
133
+#endif
131 134
 }
132 135
 
133 136
 void AmPlugIn::dispose()
Browse code

added reference counting to plug-in interfaces.

Allows to register the same plug-in factory under different purposes, but still destroying it correctly.

AmPluginFactory::onUnload() had to be removed as it would not have worked due to multiple inheritance from this same class. Instead, plug-in implementors should implement atomic_ref_cnt::on_destroy (new method) to achieve the same functionality.

Raphael Coeffic authored on 20/11/2012 14:32:47
Showing 1 changed files
... ...
@@ -110,21 +110,12 @@ AmPlugIn::AmPlugIn()
110 110
 {
111 111
 }
112 112
 
113
-static std::set<AmPluginFactory*> deleted_factories;
114
-static std::set<string> deleted_factories_names;
115 113
 
116 114
 static void delete_plugin_factory(std::pair<string, AmPluginFactory*> pf)
117 115
 {
118
-  if ((deleted_factories.find(pf.second) == deleted_factories.end()) &&
119
-      (deleted_factories_names.find(pf.first) == deleted_factories_names.end())) {
120
-    DBG("onUnload of plugin '%s'\n", pf.first.c_str());
121
-    pf.second->onUnload();
116
+  DBG("decreasing reference to plug-in factory: %s\n", pf.first.c_str());
117
+  dec_ref(pf.second);
122 118
 
123
-    DBG("deleting plug-in factory: %s\n", pf.first.c_str());
124
-    deleted_factories.insert(pf.second);
125
-    deleted_factories_names.insert(pf.first);
126
-    delete pf.second;
127
-  }
128 119
 }
129 120
 
130 121
 AmPlugIn::~AmPlugIn()
... ...
@@ -570,7 +561,11 @@ int AmPlugIn::loadAppPlugIn(AmPluginFactory* f)
570 561
   name2app.insert(std::make_pair(sf->getName(),sf));
571 562
   DBG("application '%s' loaded.\n",sf->getName().c_str());
572 563
 
573
-  module_objects.insert(std::make_pair(sf->getName(),sf));
564
+  inc_ref(sf);
565
+  if(!module_objects.insert(std::make_pair(sf->getName(),sf)).second){
566
+    // insertion failed
567
+    dec_ref(sf);
568
+  }
574 569
   name2app_mut.unlock();
575 570
 
576 571
   return 0;
... ...
@@ -589,7 +584,8 @@ int AmPlugIn::loadSehPlugIn(AmPluginFactory* f)
589 584
     ERROR("session component '%s' already loaded !\n",sf->getName().c_str());
590 585
     goto error;
591 586
   }
592
-      
587
+
588
+  inc_ref(sf);
593 589
   name2seh.insert(std::make_pair(sf->getName(),sf));
594 590
   DBG("session component '%s' loaded.\n",sf->getName().c_str());
595 591
 
... ...
@@ -601,7 +597,11 @@ int AmPlugIn::loadSehPlugIn(AmPluginFactory* f)
601 597
 
602 598
 int AmPlugIn::loadBasePlugIn(AmPluginFactory* f)
603 599
 {
604
-  name2base.insert(std::make_pair(f->getName(),f));
600
+  inc_ref(f);
601
+  if(!name2base.insert(std::make_pair(f->getName(),f)).second){
602
+    // insertion failed
603
+    dec_ref(f);
604
+  }
605 605
   return 0;
606 606
 }
607 607
 
... ...
@@ -813,7 +813,7 @@ AmSessionFactory* AmPlugIn::findSessionFactory(const AmSipRequest& req, string&
813 813
   ERROR(comp_name "'%s' already registered !\n", param_name.c_str());	\
814 814
   return false;								\
815 815
   }									\
816
-									\
816
+  inc_ref(f);								\
817 817
   instance()->map_name.insert(std::make_pair(param_name,f));		\
818 818
   DBG(comp_name " '%s' registered.\n",param_name.c_str());		\
819 819
   return true;
Browse code

b/f: load msg_storage with RTLD_GLOBAL

closes bug #0000082

in the meantime, also load_plugins_rtld_global=msg_storage helps

Stefan Sayer authored on 07/08/2012 14:07:14
Showing 1 changed files
... ...
@@ -288,7 +288,7 @@ int AmPlugIn::loadPlugIn(const string& file, const string& plugin_name,
288 288
   if (!strcmp(bname, "dsm.so") || !strcmp(bname, "ivr.so") ||
289 289
       !strcmp(bname, "py_sems.so") || !strcmp(bname, "sbc.so") ||
290 290
       !strcmp(bname, "diameter_client.so") || !strcmp(bname, "registrar_client.so") ||
291
-      !strcmp(bname, "uac_auth.so")
291
+      !strcmp(bname, "uac_auth.so") || !strcmp(bname, "msg_storage.so")
292 292
       ) {
293 293
       dlopen_flags = RTLD_NOW | RTLD_GLOBAL;
294 294
       DBG("using RTLD_NOW | RTLD_GLOBAL to dlopen '%s'\n", file.c_str());
Browse code

write allocated dynamic payload ID into the payload structure.

Raphael Coeffic authored on 24/04/2012 09:07:46
Showing 1 changed files
... ...
@@ -682,15 +682,15 @@ int AmPlugIn::addPayload(amci_payload_t* p)
682 682
       ERROR("payload id (%i) already supported\n",p->payload_id);
683 683
       return -1;
684 684
     }
685
-    payloads.insert(std::make_pair(p->payload_id,p));
686
-    id = p->payload_id;
687 685
   }
688 686
   else {
689
-    payloads.insert(std::make_pair(dynamic_pl,p));
690
-    id = dynamic_pl;
687
+    p->payload_id = dynamic_pl;
691 688
     dynamic_pl++;
692 689
   }
693 690
 
691
+  payloads.insert(std::make_pair(p->payload_id,p));
692
+  id = p->payload_id;
693
+
694 694
   for (i = 0; i < AmConfig::CodecOrder.size(); i++) {
695 695
       if (p->name == AmConfig::CodecOrder[i]) break;
696 696
   }
Browse code

b/f: fixed telephone-event payload type

this would have caused any codec dynamically inserted with id 101 to disappear after insertion of the built-in telephone-event payload.

Raphael Coeffic authored on 06/03/2012 09:24:26
Showing 1 changed files
... ...
@@ -93,7 +93,7 @@ amci_codec_t _codec_tevent = {
93 93
 };
94 94
 
95 95
 amci_payload_t _payload_tevent = { 
96
-  101,
96
+  -1,
97 97
   "telephone-event",
98 98
   8000, // telephone-event has always SR 8000 
99 99
   8000,
... ...
@@ -696,12 +696,12 @@ int AmPlugIn::addPayload(amci_payload_t* p)
696 696
   }
697 697
   if (i >= AmConfig::CodecOrder.size()) {
698 698
       payload_order.insert(std::make_pair(id + 100, id));
699
-      DBG("payload '%s' inserted with id %i and order %i\n",
700
-	  p->name, id, id + 100);
699
+      DBG("payload '%s/%i' inserted with id %i and order %i\n",
700
+	  p->name, p->sample_rate, id, id + 100);
701 701
   } else {
702 702
       payload_order.insert(std::make_pair(i, id));
703
-      DBG("payload '%s' inserted with id %i and order %i\n",
704
-	  p->name, id, i);
703
+      DBG("payload '%s/%i' inserted with id %i and order %i\n",
704
+	  p->name, p->sample_rate, id, i);
705 705
   }
706 706
 
707 707
   return 0;
Browse code

b/f: fix dynamic payload matching.

- encoding name is case-insensitive
- matching on advertised sample rate, as this is the clock rate used in the SDP.

Raphael Coeffic authored on 05/03/2012 07:35:55
Showing 1 changed files
... ...
@@ -413,8 +413,8 @@ int AmPlugIn::getDynPayload(const string& name, int rate, int encoding_param) co
413 413
   // find a dynamic payload by name/rate and encoding_param (channels, if > 0)
414 414
   for(std::map<int, amci_payload_t*>::const_iterator pl_it = payloads.begin();
415 415
       pl_it != payloads.end(); ++pl_it)
416
-    if( (name == pl_it->second->name)
417
-	&& (rate == pl_it->second->sample_rate) ) {
416
+    if( (!strcasecmp(name.c_str(),pl_it->second->name)
417
+	 && (rate == pl_it->second->advertised_sample_rate)) ) {
418 418
       if ((encoding_param > 0) && (pl_it->second->channels > 0) && 
419 419
 	  (encoding_param != pl_it->second->channels))
420 420
 	continue;
Browse code

core: simplified module initialization

Stefan Sayer authored on 02/03/2012 21:12:56
Showing 1 changed files
... ...
@@ -172,6 +172,8 @@ int AmPlugIn::load(const string& directory, const string& plugins)
172 172
 {
173 173
   int err=0;
174 174
   
175
+  vector<AmPluginFactory*> loaded_plugins;
176
+
175 177
   if (!plugins.length()) {
176 178
     INFO("AmPlugIn: loading modules in directory '%s':\n", directory.c_str());
177 179
 
... ...
@@ -206,10 +208,13 @@ int AmPlugIn::load(const string& directory, const string& plugins)
206 208
       string plugin_file = directory + "/" + plugin_name;
207 209
 
208 210
       DBG("loading %s ...\n",plugin_file.c_str());
209
-      if( (err = loadPlugIn(plugin_file, plugin_name)) < 0 ) {
211
+      AmPluginFactory* plugin = NULL;
212
+      if( (err = loadPlugIn(plugin_file, plugin_name, plugin)) < 0 ) {
210 213
         ERROR("while loading plug-in '%s'\n",plugin_file.c_str());
211 214
         return -1;
212 215
       }
216
+      if (NULL != plugin)
217
+	loaded_plugins.push_back(plugin);
213 218
     }
214 219
     
215 220
     closedir(dir);
... ...
@@ -233,98 +238,47 @@ int AmPlugIn::load(const string& directory, const string& plugins)
233 238
 
234 239
       plugin_file = directory + "/"  + plugin_file;
235 240
       DBG("loading %s...\n",plugin_file.c_str());
236
-      if( (err = loadPlugIn(plugin_file, plugin_file)) < 0 ) {
241
+      AmPluginFactory* plugin = NULL;
242
+      if( (err = loadPlugIn(plugin_file, plugin_file, plugin)) < 0 ) {
237 243
         ERROR("while loading plug-in '%s'\n",plugin_file.c_str());
238 244
         // be strict here: if plugin not loaded, stop!
239 245
         return err; 
240 246
       }
247
+      if (NULL != plugin)
248
+	loaded_plugins.push_back(plugin);
241 249
     }
242 250
   }
243 251
 
244 252
   DBG("AmPlugIn: modules loaded.\n");
245
-
246
-  std::map<string,AmSessionFactory*> app_load = name2app;
247
-  
248
-  set<string> loaded_modules;
249
-
250
-  DBG("AmPlugIn: Initializing plugins...\n");
251
-
252
-  // initialize base components
253
-  for(std::map<std::string,AmPluginFactory*>::iterator it = name2base.begin();
254
-      it != name2base.end(); it++){
255
-    if (loaded_modules.find(it->first) != loaded_modules.end())
256
-      continue;
257
-
258
-    err = it->second->onLoad();
253
+  DBG("Initializing %zd plugins...\n", loaded_plugins.size());
254
+  for (vector<AmPluginFactory*>::iterator it =
255
+	 loaded_plugins.begin(); it != loaded_plugins.end(); it++) {
256
+    int err = (*it)->onLoad();
259 257
     if(err)
260 258
       return err;
261
-
262
-    loaded_modules.insert(it->first);
263 259
   }
264 260
 
261
+  return 0;
262
+}
265 263
 
266
-  // initialize session event handlers
267
-  for(std::map<std::string,AmSessionEventHandlerFactory*>::iterator it = name2seh.begin();
268
-      it != name2seh.end(); it++){
269
-    if (loaded_modules.find(it->first) != loaded_modules.end())
270
-      continue;
271
-
272
-    err = it->second->onLoad();
273
-    if(err)
274
-      return err;
275
-    loaded_modules.insert(it->first);
276
-  }
277
-
278
-  // initialize DI component plugins
279
-  for(std::map<std::string,AmDynInvokeFactory*>::iterator it = name2di.begin();
280
-      it != name2di.end(); it++){
281
-    if (loaded_modules.find(it->first) != loaded_modules.end())
282
-      continue;
283
-
284
-    err = it->second->onLoad();
285
-    if(err)
286
-      return err;
287
-    loaded_modules.insert(it->first);
288
-  }
289
-
264
+void AmPlugIn::registerLoggingPlugins() {
290 265
   // init logging facilities
291 266
   for(std::map<std::string,AmLoggingFacility*>::iterator it = name2logfac.begin();
292 267
       it != name2logfac.end(); it++){
293
-
294
-    if (!(loaded_modules.find(it->first) != loaded_modules.end())) {
295
-      err = it->second->onLoad();
296
-      if(err)
297
-	return err;
298
-      loaded_modules.insert(it->first);
299
-    }
300 268
     // register for receiving logging messages
301 269
     register_log_hook(it->second);
302
-  }
303
-  
304
-  // application plugins
305
-  for(std::map<std::string,AmSessionFactory*>::iterator it = app_load.begin();
306
-      it != app_load.end(); it++){
307
-    if (loaded_modules.find(it->first) != loaded_modules.end())
308
-      continue;
309
-
310
-    err = it->second->onLoad();
311
-    if(err) 
312
-      return err;
313
-
314
-    loaded_modules.insert(it->first);
315
-  }
316
-
317
-  DBG("AmPlugIn: Initialized plugins.\n");
318
-
319
-  return 0;
270
+  }  
320 271
 }
321 272
 
322 273
 void AmPlugIn::set_load_rtld_global(const string& plugin_name) {
323 274
   rtld_global_plugins.insert(plugin_name);
324 275
 }
325 276
 
326
-int AmPlugIn::loadPlugIn(const string& file, const string& plugin_name)
277
+int AmPlugIn::loadPlugIn(const string& file, const string& plugin_name,
278
+			 AmPluginFactory*& plugin)
327 279
 {
280
+
281
+  plugin = NULL; // default: not loaded
328 282
   int dlopen_flags = RTLD_NOW;
329 283
 
330 284
   char* pname = strdup(plugin_name.c_str());
... ...
@@ -368,29 +322,34 @@ int AmPlugIn::loadPlugIn(const string& file, const string& plugin_name)
368 322
     goto end;
369 323
   }
370 324
 
371
-  if((fc = (FactoryCreate)dlsym(h_dl,FACTORY_SESSION_EXPORT_STR)) != NULL){
372
-    if(loadAppPlugIn((AmPluginFactory*)fc()))
325
+  if((fc = (FactoryCreate)dlsym(h_dl,FACTORY_SESSION_EXPORT_STR)) != NULL){  
326
+    plugin = (AmPluginFactory*)fc();
327
+    if(loadAppPlugIn(plugin))
373 328
       goto error;
374 329
     has_sym=true;
375 330
   }
376 331
   if((fc = (FactoryCreate)dlsym(h_dl,FACTORY_SESSION_EVENT_HANDLER_EXPORT_STR)) != NULL){
377
-    if(loadSehPlugIn((AmPluginFactory*)fc()))
332
+    plugin = (AmPluginFactory*)fc();
333
+    if(loadSehPlugIn(plugin))
378 334
       goto error;
379 335
     has_sym=true;
380 336
   }
381 337
   if((fc = (FactoryCreate)dlsym(h_dl,FACTORY_PLUGIN_EXPORT_STR)) != NULL){
382
-    if(loadBasePlugIn((AmPluginFactory*)fc()))
338
+    plugin = (AmPluginFactory*)fc();
339
+    if(loadBasePlugIn(plugin))
383 340
       goto error;
384 341
     has_sym=true;
385 342
   }
386 343
   if((fc = (FactoryCreate)dlsym(h_dl,FACTORY_PLUGIN_CLASS_EXPORT_STR)) != NULL){
387
-    if(loadDiPlugIn((AmPluginFactory*)fc()))
344
+    plugin = (AmPluginFactory*)fc();
345
+    if(loadDiPlugIn(plugin))
388 346
       goto error;
389 347
     has_sym=true;
390 348
   }
391 349
 
392 350
   if((fc = (FactoryCreate)dlsym(h_dl,FACTORY_LOG_FACILITY_EXPORT_STR)) != NULL){
393
-    if(loadLogFacPlugIn((AmPluginFactory*)fc()))
351
+    plugin = (AmPluginFactory*)fc();
352
+    if(loadLogFacPlugIn(plugin))
394 353
       goto error;
395 354
     has_sym=true;
396 355
   }
... ...
@@ -406,6 +365,7 @@ int AmPlugIn::loadPlugIn(const string& file, const string& plugin_name)
406 365
 
407 366
  error:
408 367
   dlclose(h_dl);
368
+  plugin = NULL;
409 369
   return -1;
410 370
 }
411 371
 
Browse code

adds support for wideband audio

Raphael Coeffic authored on 21/02/2012 17:26:22
Showing 1 changed files
... ...
@@ -93,9 +93,10 @@ amci_codec_t _codec_tevent = {
93 93
 };
94 94
 
95 95
 amci_payload_t _payload_tevent = { 
96
-  -1,
96
+  101,
97 97
   "telephone-event",
98 98
   8000, // telephone-event has always SR 8000 
99
+  8000,
99 100
   -1,
100 101
   CODEC_TELEPHONE_EVENT,
101 102
   -1 
... ...
@@ -470,7 +471,7 @@ void AmPlugIn::getPayloads(vector<SdpPayload>& pl_vec) const
470 471
   for (std::map<int,int>::const_iterator it = payload_order.begin(); it != payload_order.end(); ++it) {
471 472
     std::map<int,amci_payload_t*>::const_iterator pl_it = payloads.find(it->second);
472 473
     if(pl_it != payloads.end()){
473
-      pl_vec.push_back(SdpPayload(pl_it->first, pl_it->second->name, pl_it->second->sample_rate, 0));
474
+      pl_vec.push_back(SdpPayload(pl_it->first, pl_it->second->name, pl_it->second->advertised_sample_rate, 0));
474 475
     } else {
475 476
       ERROR("Payload %d (from the payload_order map) was not found in payloads map!\n", it->second);
476 477
     }
Browse code

b/f: don't delete registered app objects, e.g. DSM apps

fixes bug #68
https://bugtracker.iptel.org/view.php?id=68

Stefan Sayer authored on 05/01/2012 21:10:52
Showing 1 changed files
... ...
@@ -128,7 +128,7 @@ static void delete_plugin_factory(std::pair<string, AmPluginFactory*> pf)
128 128
 
129 129
 AmPlugIn::~AmPlugIn()
130 130
 {
131
-  std::for_each(name2app.begin(), name2app.end(), delete_plugin_factory);
131
+  std::for_each(module_objects.begin(), module_objects.end(), delete_plugin_factory);
132 132
   std::for_each(name2seh.begin(), name2seh.end(), delete_plugin_factory);
133 133
   std::for_each(name2base.begin(), name2base.end(), delete_plugin_factory);
134 134
   std::for_each(name2di.begin(), name2di.end(), delete_plugin_factory);
... ...
@@ -609,6 +609,7 @@ int AmPlugIn::loadAppPlugIn(AmPluginFactory* f)
609 609
   name2app.insert(std::make_pair(sf->getName(),sf));
610 610
   DBG("application '%s' loaded.\n",sf->getName().c_str());
611 611
 
612
+  module_objects.insert(std::make_pair(sf->getName(),sf));
612 613
   name2app_mut.unlock();
613 614
 
614 615
   return 0;
Browse code

better support for multiple SDP media + small fixes in related use cases.

Raphael Coeffic authored on 14/12/2011 15:31:00
Showing 1 changed files
... ...
@@ -467,7 +467,6 @@ int AmPlugIn::getDynPayload(const string& name, int rate, int encoding_param) co
467 467
 /** return 0, or -1 in case of error. */
468 468
 void AmPlugIn::getPayloads(vector<SdpPayload>& pl_vec) const
469 469
 {
470
-  pl_vec.clear();
471 470
   for (std::map<int,int>::const_iterator it = payload_order.begin(); it != payload_order.end(); ++it) {
472 471
     std::map<int,amci_payload_t*>::const_iterator pl_it = payloads.find(it->second);
473 472
     if(pl_it != payloads.end()){
Browse code

moved parts of SDP offer/answer generation into AmRtpStream

fixes support for multiple media lines in remote offers.

Raphael Coeffic authored on 13/12/2011 12:20:40
Showing 1 changed files
... ...
@@ -432,23 +432,23 @@ amci_inoutfmt_t* AmPlugIn::fileFormat(const string& fmt_name, const string& ext)
432 432
 
433 433
 amci_codec_t* AmPlugIn::codec(int id)
434 434
 {
435
-  std::map<int,amci_codec_t*>::iterator it = codecs.find(id);
435
+  std::map<int,amci_codec_t*>::const_iterator it = codecs.find(id);
436 436
   if(it != codecs.end())
437 437
     return it->second;
438 438
 
439 439
   return 0;
440 440
 }
441 441
 
442
-amci_payload_t*  AmPlugIn::payload(int payload_id)
442
+amci_payload_t*  AmPlugIn::payload(int payload_id) const
443 443
 {
444
-  std::map<int,amci_payload_t*>::iterator it = payloads.find(payload_id);
444
+  std::map<int,amci_payload_t*>::const_iterator it = payloads.find(payload_id);
445 445
   if(it != payloads.end())
446 446
     return it->second;
447 447
 
448 448
   return 0;
449 449
 }
450 450
 
451
-int AmPlugIn::getDynPayload(const string& name, int rate, int encoding_param) {
451
+int AmPlugIn::getDynPayload(const string& name, int rate, int encoding_param) const {
452 452
   // find a dynamic payload by name/rate and encoding_param (channels, if > 0)
453 453
   for(std::map<int, amci_payload_t*>::const_iterator pl_it = payloads.begin();
454 454
       pl_it != payloads.end(); ++pl_it)
... ...
@@ -465,7 +465,7 @@ int AmPlugIn::getDynPayload(const string& name, int rate, int encoding_param) {
465 465
 }
466 466
 
467 467
 /** return 0, or -1 in case of error. */
468
-void AmPlugIn::getPayloads(vector<SdpPayload>& pl_vec)
468
+void AmPlugIn::getPayloads(vector<SdpPayload>& pl_vec) const
469 469
 {
470 470
   pl_vec.clear();
471 471
   for (std::map<int,int>::const_iterator it = payload_order.begin(); it != payload_order.end(); ++it) {
Browse code

b/f: error msg when application plug-in does not exist

Raphael Coeffic authored on 26/10/2011 14:30:21
Showing 1 changed files
... ...
@@ -840,7 +840,7 @@ AmSessionFactory* AmPlugIn::findSessionFactory(const AmSipRequest& req, string&
840 840
     
841 841
     AmSessionFactory* session_factory = getFactory4App(m_app_name);
842 842
     if(!session_factory) {
843
-      ERROR("AmPlugIn::findSessionFactory: application '%s' not found !\n", app_name.c_str());
843
+      ERROR("AmPlugIn::findSessionFactory: application '%s' not found !\n", m_app_name.c_str());
844 844
     }
845 845
     
846 846
     app_name = m_app_name;
Browse code

added missing #include for basename()

Raphael Coeffic authored on 14/10/2011 12:35:09
Showing 1 changed files
... ...
@@ -43,6 +43,7 @@
43 43
 #include <dlfcn.h>
44 44
 #include <string.h>
45 45
 #include <errno.h>
46
+#include <libgen.h>
46 47
 
47 48
 #include <set>
48 49
 #include <vector>
Browse code

enable unloading of module for cleaner shutdown

Stefan Sayer authored on 12/10/2011 20:36:21
Showing 1 changed files
... ...
@@ -115,6 +115,9 @@ static void delete_plugin_factory(std::pair<string, AmPluginFactory*> pf)
115 115
 {
116 116
   if ((deleted_factories.find(pf.second) == deleted_factories.end()) &&
117 117
       (deleted_factories_names.find(pf.first) == deleted_factories_names.end())) {
118
+    DBG("onUnload of plugin '%s'\n", pf.first.c_str());
119
+    pf.second->onUnload();
120
+
118 121
     DBG("deleting plug-in factory: %s\n", pf.first.c_str());
119 122
     deleted_factories.insert(pf.second);
120 123
     deleted_factories_names.insert(pf.first);
Browse code

b/f: load some more mods with RTLD_GLOBAL (e.g. sbc)

Stefan Sayer authored on 07/10/2011 18:34:03
Showing 1 changed files
... ...
@@ -327,7 +327,10 @@ int AmPlugIn::loadPlugIn(const string& file, const string& plugin_name)
327 327
 
328 328
   // dsm, ivr and py_sems need RTLD_GLOBAL
329 329
   if (!strcmp(bname, "dsm.so") || !strcmp(bname, "ivr.so") ||
330
-      !strcmp(bname, "py_sems.so")) {
330
+      !strcmp(bname, "py_sems.so") || !strcmp(bname, "sbc.so") ||
331
+      !strcmp(bname, "diameter_client.so") || !strcmp(bname, "registrar_client.so") ||
332
+      !strcmp(bname, "uac_auth.so")
333
+      ) {
331 334
       dlopen_flags = RTLD_NOW | RTLD_GLOBAL;
332 335
       DBG("using RTLD_NOW | RTLD_GLOBAL to dlopen '%s'\n", file.c_str());
333 336
   }
Browse code

use RTLD_LOCAL for loading modules (except dsm, ivr, py_sems)

other modules which to load with RTLD_GLOBAL can be set in sems.conf option
e.g. load_plugins_rtld_global=mymod.so,myothermod.so

Stefan Sayer authored on 05/10/2011 12:17:02
Showing 1 changed files
... ...
@@ -201,7 +201,7 @@ int AmPlugIn::load(const string& directory, const string& plugins)
201 201
       string plugin_file = directory + "/" + plugin_name;
202 202
 
203 203
       DBG("loading %s ...\n",plugin_file.c_str());
204
-      if( (err = loadPlugIn(plugin_file)) < 0 ) {
204
+      if( (err = loadPlugIn(plugin_file, plugin_name)) < 0 ) {
205 205
         ERROR("while loading plug-in '%s'\n",plugin_file.c_str());
206 206
         return -1;
207 207
       }
... ...
@@ -228,7 +228,7 @@ int AmPlugIn::load(const string& directory, const string& plugins)
228 228
 
229 229
       plugin_file = directory + "/"  + plugin_file;
230 230
       DBG("loading %s...\n",plugin_file.c_str());
231
-      if( (err = loadPlugIn(plugin_file)) < 0 ) {
231
+      if( (err = loadPlugIn(plugin_file, plugin_file)) < 0 ) {
232 232
         ERROR("while loading plug-in '%s'\n",plugin_file.c_str());
233 233
         // be strict here: if plugin not loaded, stop!
234 234
         return err; 
... ...
@@ -314,9 +314,36 @@ int AmPlugIn::load(const string& directory, const string& plugins)
314 314
   return 0;
315 315
 }
316 316
 
317
-int AmPlugIn::loadPlugIn(const string& file)
317
+void AmPlugIn::set_load_rtld_global(const string& plugin_name) {
318
+  rtld_global_plugins.insert(plugin_name);
319
+}
320
+
321
+int AmPlugIn::loadPlugIn(const string& file, const string& plugin_name)
318 322
 {
319
-  void* h_dl = dlopen(file.c_str(),RTLD_NOW | RTLD_GLOBAL);
323
+  int dlopen_flags = RTLD_NOW;
324
+
325
+  char* pname = strdup(plugin_name.c_str());
326
+  char* bname = basename(pname);
327
+
328
+  // dsm, ivr and py_sems need RTLD_GLOBAL
329
+  if (!strcmp(bname, "dsm.so") || !strcmp(bname, "ivr.so") ||
330
+      !strcmp(bname, "py_sems.so")) {
331
+      dlopen_flags = RTLD_NOW | RTLD_GLOBAL;
332
+      DBG("using RTLD_NOW | RTLD_GLOBAL to dlopen '%s'\n", file.c_str());
333
+  }
334
+
335
+  // possibly others
336
+  for (std::set<string>::iterator it=rtld_global_plugins.begin();
337
+       it!=rtld_global_plugins.end();it++) {
338
+    if (!strcmp(bname, it->c_str())) {
339
+      dlopen_flags = RTLD_NOW | RTLD_GLOBAL;
340
+      DBG("using RTLD_NOW | RTLD_GLOBAL to dlopen '%s'\n", file.c_str());
341
+      break;
342
+    }
343
+  }
344
+  free(pname);
345
+
346
+  void* h_dl = dlopen(file.c_str(),dlopen_flags);
320 347
 
321 348
   if(!h_dl){
322 349
     ERROR("AmPlugIn::loadPlugIn: %s: %s\n",file.c_str(),dlerror());
Browse code

b/f: clear SDP before getSdpOffer/getSdpAnswer

Stefan Sayer authored on 23/06/2011 16:29:30
Showing 1 changed files
... ...
@@ -433,6 +433,7 @@ int AmPlugIn::getDynPayload(const string& name, int rate, int encoding_param) {
433 433
 /** return 0, or -1 in case of error. */
434 434
 void AmPlugIn::getPayloads(vector<SdpPayload>& pl_vec)
435 435
 {
436
+  pl_vec.clear();
436 437
   for (std::map<int,int>::const_iterator it = payload_order.begin(); it != payload_order.end(); ++it) {
437 438
     std::map<int,amci_payload_t*>::const_iterator pl_it = payloads.find(it->second);
438 439
     if(pl_it != payloads.end()){
Browse code

propagate app_name to everywhere it is needed.

Raphael Coeffic authored on 10/05/2011 14:36:36
Showing 1 changed files
... ...
@@ -774,40 +774,41 @@ bool AmPlugIn::registerApplication(const string& app_name, AmSessionFactory* f)
774 774
   return res;
775 775
 }
776 776
 
777
-AmSessionFactory* AmPlugIn::findSessionFactory(AmSipRequest& req)
777
+AmSessionFactory* AmPlugIn::findSessionFactory(const AmSipRequest& req, string& app_name)
778 778
 {
779
-    string app_name;
779
+    string m_app_name;
780 780
 
781 781
     switch (AmConfig::AppSelect) {
782 782
 	
783 783
     case AmConfig::App_RURIUSER:
784
-      app_name = req.user; 
784
+      m_app_name = req.user; 
785 785
       break;
786 786
     case AmConfig::App_APPHDR: 
787
-      app_name = getHeader(req.hdrs, APPNAME_HDR, true); 
787
+      m_app_name = getHeader(req.hdrs, APPNAME_HDR, true); 
788 788
       break;      
789 789
     case AmConfig::App_RURIPARAM: 
790
-      app_name = get_header_param(req.r_uri, "app");
790
+      m_app_name = get_header_param(req.r_uri, "app");
791 791
       break;
792 792
     case AmConfig::App_MAPPING:
793
-      app_name = ""; // no match if not found
794
-      run_regex_mapping(AmConfig::AppMapping, req.r_uri.c_str(), app_name);
793
+      m_app_name = ""; // no match if not found
794
+      run_regex_mapping(AmConfig::AppMapping, req.r_uri.c_str(), m_app_name);
795 795
       break;
796 796
     case AmConfig::App_SPECIFIED: 
797
-      app_name = AmConfig::Application; 
797
+      m_app_name = AmConfig::Application; 
798 798
       break;
799 799
     }
800 800
     
801
-    if (app_name.empty()) {
801
+    if (m_app_name.empty()) {
802 802
       ERROR("could not find any application matching configured criteria\n");
803 803
       return NULL;
804 804
     }
805 805
     
806
-    AmSessionFactory* session_factory = getFactory4App(app_name);
806
+    AmSessionFactory* session_factory = getFactory4App(m_app_name);
807 807
     if(!session_factory) {
808 808
       ERROR("AmPlugIn::findSessionFactory: application '%s' not found !\n", app_name.c_str());
809 809
     }
810 810
     
811
+    app_name = m_app_name;
811 812
     return session_factory;
812 813
 }
813 814
 
Browse code

Merge branch 'master' into offer_answer

Raphael Coeffic authored on 05/04/2011 12:09:31
Showing 0 changed files
Browse code

some DBG/INFO logging on startup

Stefan Sayer authored on 23/02/2011 22:38:29
Showing 1 changed files
... ...
@@ -168,11 +168,12 @@ int AmPlugIn::load(const string& directory, const string& plugins)
168 168
   int err=0;
169 169
   
170 170
   if (!plugins.length()) {
171
-    DBG("AmPlugIn: loading modules in directory '%s':\n", directory.c_str());
171
+    INFO("AmPlugIn: loading modules in directory '%s':\n", directory.c_str());
172 172
 
173 173
     DIR* dir = opendir(directory.c_str());
174 174
     if (!dir){
175
-      ERROR("while opening plug-in directory (%s): %s\n", directory.c_str(), strerror(errno));
175
+      ERROR("while opening plug-in directory (%s): %s\n",
176
+	    directory.c_str(), strerror(errno));
176 177
       return -1;
177 178
     }
178 179
     
... ...
@@ -209,7 +210,7 @@ int AmPlugIn::load(const string& directory, const string& plugins)
209 210
     closedir(dir);
210 211
   } 
211 212
   else {
212
-    DBG("AmPlugIn: loading modules '%s':\n", plugins.c_str());
213
+    INFO("AmPlugIn: loading modules: '%s'\n", plugins.c_str());
213 214
 
214 215
     vector<string> plugins_list = explode(plugins, ";");
215 216
     for (vector<string>::iterator it = plugins_list.begin(); 
Browse code

Merge branch 'master' into offer_answer

Raphael Coeffic authored on 18/02/2011 11:36:25
Showing 1 changed files
... ...
@@ -788,19 +788,10 @@ AmSessionFactory* AmPlugIn::findSessionFactory(AmSipRequest& req)
788 788
     case AmConfig::App_RURIPARAM: 
789 789
       app_name = get_header_param(req.r_uri, "app");
790 790
       break;
791
-    case AmConfig::App_MAPPING: 
792
-      {
793
-	for (AmConfig::AppMappingVector::iterator it = 
794
-	       AmConfig::AppMapping.begin(); 
795
-	     it != AmConfig::AppMapping.end(); it++){
796
-	  if (!regexec(&it->first, req.r_uri.c_str(), 0, NULL, 0)) {
797
-	    DBG("match of r_uri '%s' to application %s\n", 
798
-		req.r_uri.c_str(), it->second.c_str());
799
-	    app_name = it->second;
800
-	    break;
801
-	  }
802
-	}
803
-      } break;
791
+    case AmConfig::App_MAPPING:
792
+      app_name = ""; // no match if not found
793
+      run_regex_mapping(AmConfig::AppMapping, req.r_uri.c_str(), app_name);
794
+      break;
804 795
     case AmConfig::App_SPECIFIED: 
805 796
       app_name = AmConfig::Application; 
806 797
       break;
Browse code

removed cAmElCase in AmUtils

Stefan Sayer authored on 10/01/2011 17:58:56
Showing 1 changed files
... ...
@@ -782,7 +782,7 @@ AmSessionFactory* AmPlugIn::findSessionFactory(AmSipRequest& req)
782 782
       break;
783 783
     case AmConfig::App_MAPPING:
784 784
       req.cmd = ""; // no match if not found
785
-      runRegexMapping(AmConfig::AppMapping, req.r_uri.c_str(), req.cmd);
785
+      run_regex_mapping(AmConfig::AppMapping, req.r_uri.c_str(), req.cmd);
786 786
       break;
787 787
     case AmConfig::App_SPECIFIED: 
788 788
       req.cmd = AmConfig::Application; 
Browse code

moved regex mapping file reading to AmUtils

Stefan Sayer authored on 07/01/2011 14:06:23
Showing 1 changed files
... ...
@@ -780,20 +780,10 @@ AmSessionFactory* AmPlugIn::findSessionFactory(AmSipRequest& req)
780 780
     case AmConfig::App_RURIPARAM: 
781 781
       req.cmd = get_header_param(req.r_uri, "app");
782 782
       break;
783
-    case AmConfig::App_MAPPING: 
784
-      {
785
-	req.cmd = "";	
786
-	for (AmConfig::AppMappingVector::iterator it = 
787
-	       AmConfig::AppMapping.begin(); 
788
-	     it != AmConfig::AppMapping.end(); it++){
789
-	  if (!regexec(&it->first, req.r_uri.c_str(), 0, NULL, 0)) {
790
-	    DBG("match of r_uri '%s' to application %s\n", 
791
-	      req.r_uri.c_str(), it->second.c_str());
792
-	    req.cmd = it->second;
793
-	    break;
794
-	  }
795
-	}
796
-      } break;
783
+    case AmConfig::App_MAPPING:
784
+      req.cmd = ""; // no match if not found
785
+      runRegexMapping(AmConfig::AppMapping, req.r_uri.c_str(), req.cmd);
786
+      break;
797 787
     case AmConfig::App_SPECIFIED: 
798 788
       req.cmd = AmConfig::Application; 
799 789
       break;
Browse code

merged from 'master'.

Raphael Coeffic authored on 04/01/2011 13:41:17
Showing 0 changed files
Browse code

simplified module interface

// ---------------- simplified SEMS plug-in interface --------------------------
// - export module as basic SEMS plugin with EXPORT_MODULE_FUNC
// - in onLoad, register the capabilities you provide,
// e.g. AmPlugIn::registerApplication(...), AmPlugIn::registerDIInterface(...) etc

Stefan Sayer authored on 08/12/2010 13:00:15
Showing 1 changed files
... ...
@@ -243,15 +243,6 @@ int AmPlugIn::load(const string& directory, const string& plugins)
243 243
 
244 244
   DBG("AmPlugIn: Initializing plugins...\n");
245 245
 
246
-//   if (ctrlIface) {
247
-//     if ((err = ctrlIface->onLoad())) {
248
-//       ERROR("failed to initialize control interface.\n");
249
-//       return err;
250
-//     } else {
251
-// 	AmServer::instance()->regIface(ctrlIface->instance());
252
-//     }
253
-//   }
254
-
255 246
   // initialize base components
256 247
   for(std::map<std::string,AmPluginFactory*>::iterator it = name2base.begin();
257 248
       it != name2base.end(); it++){
... ...
@@ -290,17 +281,6 @@ int AmPlugIn::load(const string& directory, const string& plugins)
290 281
     loaded_modules.insert(it->first);
291 282
   }
292 283
 
293
-  // load SIPEventHandlers 
294
-//   for(std::map<std::string,AmSIPEventHandler*>::iterator it = name2sipeh.begin();
295
-//       it != name2sipeh.end(); it++){
296
-//     err = it->second->onLoad();
297
-//     if(err)
298
-//       return err;
299
-//     // register for receiving replys 
300
-//     //AmReplyHandler::get()->registerReplyHandler(it->second);
301
-//     AmSipDispatcher::instance()->registerReplyHandler(it->second);
302
-//   }
303
-
304 284
   // init logging facilities
305 285
   for(std::map<std::string,AmLoggingFacility*>::iterator it = name2logfac.begin();
306 286
       it != name2logfac.end(); it++){
... ...
@@ -373,26 +353,12 @@ int AmPlugIn::loadPlugIn(const string& file)
373 353
     has_sym=true;
374 354
   }
375 355
 
376
-//   if((fc = (FactoryCreate)dlsym(h_dl,FACTORY_SIP_EVENT_HANDLER_EXPORT_STR)) != NULL){
377
-//     if(loadSIPehPlugIn((AmPluginFactory*)fc()))
378
-//       goto error;
379
-//     has_sym=true;
380
-//   }
381
-
382 356
   if((fc = (FactoryCreate)dlsym(h_dl,FACTORY_LOG_FACILITY_EXPORT_STR)) != NULL){
383 357
     if(loadLogFacPlugIn((AmPluginFactory*)fc()))
384 358
       goto error;
385 359
     has_sym=true;
386 360
   }
387 361
 
388
-//   // try load a control plugin
389
-//   if ((fc = (FactoryCreate)dlsym(h_dl,FACTORY_CONTROL_INTERFACE_EXPORT_STR))) {
390
-//     if (loadCtrlFacPlugIn((AmPluginFactory*)fc()))
391
-//       goto error;
392
-//     assert(! has_sym);
393
-//     has_sym = true;
394
-//   }
395
-
396 362
   if(!has_sym){
397 363
     ERROR("Plugin type could not be detected (%s)(%s)\n",file.c_str(),dlerror());
398 364
     goto error;
... ...
@@ -527,14 +493,6 @@ AmDynInvokeFactory* AmPlugIn::getFactory4Di(const string& name)
527 493
   return 0;
528 494
 }
529 495
 
530
-// AmSIPEventHandler* AmPlugIn::getFactory4SIPeh(const string& name)
531
-// {
532
-//   std::map<std::string,AmSIPEventHandler*>::iterator it = name2sipeh.find(name);
533
-//   if(it != name2sipeh.end())
534
-//     return it->second;
535
-//   return 0;
536
-// }
537
-
538 496
 AmLoggingFacility* AmPlugIn::getFactory4LogFaclty(const string& name)
539 497
 {
540 498
   std::map<std::string,AmLoggingFacility*>::iterator it = name2logfac.find(name);
... ...
@@ -660,29 +618,6 @@ int AmPlugIn::loadDiPlugIn(AmPluginFactory* f)
660 618
   return -1;
661 619
 }
662 620
 
663
-// int AmPlugIn::loadSIPehPlugIn(AmPluginFactory* f)
664
-// {
665
-//   AmSIPEventHandler* sf = dynamic_cast<AmSIPEventHandler*>(f);
666
-//   if(!sf){
667
-//     ERROR("invalid SIP event handler plug-in!\n");
668
-//     goto error;
669
-//   }
670
-
671
-//   if(name2sipeh.find(sf->getName()) != name2sipeh.end()){
672
-//     ERROR("sip event handler component '%s' already loaded !\n",
673
-// 	  sf->getName().c_str());
674
-//     goto error;
675
-//   }
676
-      
677
-//   name2sipeh.insert(std::make_pair(sf->getName(),sf));
678
-//   DBG("sip event handler component '%s' loaded.\n",sf->getName().c_str());
679
-
680
-//   return 0;
681
-
682
-//  error:
683
-//   return -1;
684
-// }
685
-
686 621
 int AmPlugIn::loadLogFacPlugIn(AmPluginFactory* f)
687 622
 {
688 623
   AmLoggingFacility* sf = dynamic_cast<AmLoggingFacility*>(f);
... ...
@@ -706,27 +641,6 @@ int AmPlugIn::loadLogFacPlugIn(AmPluginFactory* f)
706 641
   return -1;
707 642
 }
708 643
 
709
-// int AmPlugIn::loadCtrlFacPlugIn(AmPluginFactory* f)
710
-// {
711
-//   AmCtrlInterfaceFactory *_ctrlIface = dynamic_cast<AmCtrlInterfaceFactory *>(f);
712
-//   if (! _ctrlIface) {
713
-//     ERROR("invalid control interface plugin.\n");
714
-//     return -1;
715
-//   }
716
-//   if (ctrlIface) {
717
-//     ERROR("one control interface already loaded (`%s'): can not load a "