diff --git a/src/audio/audiolayer.cpp b/src/audio/audiolayer.cpp index 6e5b6ce506c5baa8e6c3bab85dfa37f9c8e1ad0c..f25d89da920fc7d410541a2f0f6d80ba7d47bd16 100644 --- a/src/audio/audiolayer.cpp +++ b/src/audio/audiolayer.cpp @@ -1,5 +1,6 @@ /** * Copyright (C) 2005 Savoir-Faire Linux inc. + * Author: Yan Morin <yan.morin@savoirfairelinux.com> * Author: Jerome Oufella <jerome.oufella@savoirfairelinux.com> * * This program is free software; you can redistribute it and/or modify diff --git a/src/audio/audiolayer.h b/src/audio/audiolayer.h index 93ff22563a57af60718851ac5feb4c94a3b51ebf..11c359451bc4105924cae2d32873a759910aa883 100644 --- a/src/audio/audiolayer.h +++ b/src/audio/audiolayer.h @@ -1,5 +1,6 @@ /** * Copyright (C) 2004-2005 Savoir-Faire Linux inc. + * Author: Yan Morin <yan.morin@savoirfairelinux.com> * Author: Jerome Oufella <jerome.oufella@savoirfairelinux.com> * * This program is free software; you can redistribute it and/or modify diff --git a/src/audio/audiortp.cpp b/src/audio/audiortp.cpp index 9763451c9115716ec1f150306f942d0143382486..4bee10d241f001ae3533d08eb6ef6a4700ad2f02 100644 --- a/src/audio/audiortp.cpp +++ b/src/audio/audiortp.cpp @@ -1,5 +1,6 @@ /** - * Copyright (C) 2004 Savoir-Faire Linux inc. + * Copyright (C) 2004-2005 Savoir-Faire Linux inc. + * Author: Yan Morin <yan.morin@savoirfairelinux.com> * Author: Laurielle Lea <laurielle.lea@savoirfairelinux.com> * * This program is free software; you can redistribute it and/or modify diff --git a/src/audio/audiortp.h b/src/audio/audiortp.h index b38f100b60c082586af29c0b3333a69f8dedd6a2..d32960312cb7b550577b7ea4dbb5cd54460a3034 100644 --- a/src/audio/audiortp.h +++ b/src/audio/audiortp.h @@ -1,5 +1,6 @@ /** - * Copyright (C) 2004 Savoir-Faire Linux inc. + * Copyright (C) 2004-2005 Savoir-Faire Linux inc. + * Author: Yan Morin <yan.morin@savoirfairelinux.com> * Author: Laurielle Lea <laurielle.lea@savoirfairelinux.com> * * This program is free software; you can redistribute it and/or modify diff --git a/src/audio/codecDescriptor.cpp b/src/audio/codecDescriptor.cpp index 4c7daeab1b5412aef5dc66aa5bd845325baf786b..1c6ed5261a30bedcf7ac11bed643375641323652 100644 --- a/src/audio/codecDescriptor.cpp +++ b/src/audio/codecDescriptor.cpp @@ -1,5 +1,6 @@ /** * Copyright (C) 2004-2005 Savoir-Faire Linux inc. + * Author: Yan Morin <yan.morin@savoirfairelinux.com> * Author: Laurielle Lea <laurielle.lea@savoirfairelinux.com> * * This program is free software; you can redistribute it and/or modify @@ -25,13 +26,21 @@ #include "ulaw.h" #include "codecDescriptor.h" - const char* CODEC_ALAW = "G711a"; const char* CODEC_ULAW = "G711u"; const char* CODEC_GSM = "GSM"; const char* CODEC_ILBC = "iLBC"; const char* CODEC_SPEEX = "SPEEX"; +CodecDescriptorMap::CodecDescriptorMap() +{ + _codecMap[PAYLOAD_CODEC_ALAW] = CODEC_ALAW; + _codecMap[PAYLOAD_CODEC_ULAW] = CODEC_ULAW; + _codecMap[PAYLOAD_CODEC_GSM] = CODEC_GSM; +// theses one are not implemented yet.. +// _codecMap[PAYLOAD_CODEC_ILBC] = CODEC_ILBC; +// _codecMap[PAYLOAD_CODEC_SPEEX] = CODEC_SPEEX; +} CodecDescriptor::CodecDescriptor (int payload) { @@ -39,13 +48,13 @@ CodecDescriptor::CodecDescriptor (int payload) _codecName = rtpmapPayload(_payload); } -CodecDescriptor::CodecDescriptor (const string& name) +CodecDescriptor::CodecDescriptor (const std::string& name) { _codecName = name; _payload = matchPayloadCodec(name); } -CodecDescriptor::CodecDescriptor (int payload, const string& name) +CodecDescriptor::CodecDescriptor (int payload, const std::string& name) { _payload = payload; _codecName = name; @@ -56,7 +65,7 @@ CodecDescriptor::~CodecDescriptor (void) } AudioCodec* -CodecDescriptor::alloc (int payload, const string& name) +CodecDescriptor::alloc (int payload, const std::string& name) { switch(payload) { case PAYLOAD_CODEC_ULAW: @@ -87,19 +96,19 @@ CodecDescriptor::getPayload (void) } void -CodecDescriptor::setNameCodec (const string& name) +CodecDescriptor::setNameCodec (const std::string& name) { _codecName = name; } -string +std::string CodecDescriptor::getNameCodec (void) { return _codecName; } int -CodecDescriptor::matchPayloadCodec (const string& codecname) { +CodecDescriptor::matchPayloadCodec (const std::string& codecname) { if (codecname == CODEC_ALAW) { return PAYLOAD_CODEC_ALAW; } else if (codecname == CODEC_ULAW) { @@ -114,8 +123,10 @@ CodecDescriptor::matchPayloadCodec (const string& codecname) { return -1; } -string +std::string CodecDescriptor::rtpmapPayload (int payload) { + // we don't want to use the CodecDescriptorMap Here + // we create one, but in MainManager for the list switch (payload) { case PAYLOAD_CODEC_ALAW: return string("PCMA"); diff --git a/src/audio/codecDescriptor.h b/src/audio/codecDescriptor.h index e3e63e36a5c03086bd729eaa31f7494abf785d9d..4ca94aea42402656a83343789ac7829d654ead1b 100644 --- a/src/audio/codecDescriptor.h +++ b/src/audio/codecDescriptor.h @@ -1,5 +1,6 @@ /** * Copyright (C) 2004-2005 Savoir-Faire Linux inc. + * Author: Yan Morin <yan.morin@savoirfairelinux.com> * Author: Laurielle Lea <laurielle.lea@savoirfairelinux.com> * * This program is free software; you can redistribute it and/or modify @@ -22,46 +23,62 @@ #define __CODEC_DESCRIPTOR_H__ #include <string> - -using namespace std; +#include <map> typedef enum { - PAYLOAD_CODEC_ULAW = 0, - PAYLOAD_CODEC_GSM = 3, - PAYLOAD_CODEC_ALAW = 8, - PAYLOAD_CODEC_ILBC = 97, - PAYLOAD_CODEC_SPEEX = 110 + PAYLOAD_CODEC_ULAW = 0, + PAYLOAD_CODEC_GSM = 3, + PAYLOAD_CODEC_ALAW = 8, + PAYLOAD_CODEC_ILBC = 97, + PAYLOAD_CODEC_SPEEX = 110 } codecType; +/** + * This class should be singleton + * But I didn't want to add Singleton template to it.. and an extra header + * I didn't want to make my own Singleton structure to not + * add an extra function to delete the new CodecDescriptorMap + * when the application stop + */ +typedef std::map<codecType, std::string> CodecMap; +class CodecDescriptorMap { +public: + CodecDescriptorMap(); + ~CodecDescriptorMap() {}; + CodecMap getMap() const { return _codecMap; } // by Copy +private: + CodecMap _codecMap; +}; class AudioCodec; class CodecDescriptor { public: + CodecDescriptor (int payload); - CodecDescriptor (const string& name); - CodecDescriptor (int payload, const string& name); + CodecDescriptor (const std::string& name); + CodecDescriptor (int payload, const std::string& name); ~CodecDescriptor (void); - AudioCodec* alloc (int payload, const string& name); + AudioCodec* alloc (int payload, const std::string& name); void setPayload (int payload); int getPayload (void); - void setNameCodec (const string& name); - string getNameCodec (void); + void setNameCodec (const std::string& name); + std::string getNameCodec (void); /* * Match codec name to the payload */ - int matchPayloadCodec (const string&); + int matchPayloadCodec (const std::string&); /* * Match a payload to the codec name */ - string rtpmapPayload (int); + std::string rtpmapPayload (int); private: int _payload; - string _codecName; + std::string _codecName; }; #endif // __CODEC_DESCRIPTOR_H__ diff --git a/src/audio/dtmfgenerator.cpp b/src/audio/dtmfgenerator.cpp index 13f267bccf855a4500c69611bca3bcc4d2be7392..aaf2d68a40c87801b77eaf688dbb48b07c28aa00 100644 --- a/src/audio/dtmfgenerator.cpp +++ b/src/audio/dtmfgenerator.cpp @@ -1,5 +1,6 @@ -/* +/** * Copyright (C) 2004-2005 Savoir-Faire Linux inc. + * Author: Yan Morin <yan.morin@savoirfairelinux.com> * Author: Laurielle Lea <laurielle.lea@savoirfairelinux.com> * * Portions (c) 2003 iptel.org diff --git a/src/audio/tonegenerator.cpp b/src/audio/tonegenerator.cpp index 689b1c330fc4dd36eedb472c2fe10f74adbd82a5..9bbc64327b55e6b5b3b0dd07f80786e984a699da 100644 --- a/src/audio/tonegenerator.cpp +++ b/src/audio/tonegenerator.cpp @@ -1,5 +1,6 @@ /** * Copyright (C) 2004-2005 Savoir-Faire Linux inc. + * Author: Yan Morin <yan.morin@savoirfairelinux.com> * Author: Laurielle Lea <laurielle.lea@savoirfairelinux.com> * * This program is free software; you can redistribute it and/or modify diff --git a/src/audio/tonegenerator.h b/src/audio/tonegenerator.h index 22c687a31faa776750f047b74524d3d100d56a1a..c41c1abfe4e4fea277c571d5e694d48e9601ea6b 100644 --- a/src/audio/tonegenerator.h +++ b/src/audio/tonegenerator.h @@ -1,5 +1,6 @@ /** * Copyright (C) 2004-2005 Savoir-Faire Linux inc. + * Author: Yan Morin <yan.morin@savoirfairelinux.com> * Author: Laurielle Lea <laurielle.lea@savoirfairelinux.com> * * This program is free software; you can redistribute it and/or modify diff --git a/src/call.cpp b/src/call.cpp index 6349a4f2670ea10a4c9038a41ee0a0b0303c014c..49914e0ce4b338d021cf6efc4ef767b26a1da9a6 100644 --- a/src/call.cpp +++ b/src/call.cpp @@ -1,5 +1,6 @@ /** * Copyright (C) 2004-2005 Savoir-Faire Linux inc. + * Author: Yan Morin <yan.morin@savoirfairelinux.com> * Author: Laurielle Lea <laurielle.lea@savoirfairelinux.com> * * This program is free software; you can redistribute it and/or modify diff --git a/src/call.h b/src/call.h index 6f768f3ee0c657c6ce6236b0f2bdeaa4e1036167..df13ddcb1de408733917733ae073a483c7060f90 100644 --- a/src/call.h +++ b/src/call.h @@ -1,5 +1,6 @@ /** * Copyright (C) 2004-2005 Savoir-Faire Linux inc. + * Author: Yan Morin <yan.morin@savoirfairelinux.com> * Author: Laurielle Lea <laurielle.lea@savoirfairelinux.com> * * This program is free software; you can redistribute it and/or modify diff --git a/src/global.h b/src/global.h index 0dead4b834af440cf26f04e0313ddbe57971e1c3..26a754377f1f3b733af870ab215932c6261a2bf2 100644 --- a/src/global.h +++ b/src/global.h @@ -1,5 +1,6 @@ /** * Copyright (C) 2004-2005 Savoir-Faire Linux inc. + * Author: Yan Morin <yan.morin@savoirfairelinux.com> * Author: Laurielle Lea <laurielle.lea@savoirfairelinux.com> * * This program is free software; you can redistribute it and/or modify diff --git a/src/gui/guiframework.cpp b/src/gui/guiframework.cpp index b3ac45db05257e95bfd2145d123e94c152d0e6ab..e2f11ed328a9ceec46238a5d3b338e79d0ac83b7 100644 --- a/src/gui/guiframework.cpp +++ b/src/gui/guiframework.cpp @@ -1,5 +1,6 @@ /** * Copyright (C) 2004-2005 Savoir-Faire Linux inc. + * Author: Yan Morin <yan.morin@savoirfairelinux.com> * Author: Laurielle Lea <laurielle.lea@savoirfairelinux.com> * * This program is free software; you can redistribute it and/or modify diff --git a/src/gui/guiframework.h b/src/gui/guiframework.h index 7bc27b20015d87562214978c2b572323502fd4d1..7690eb071e613874fa16890d72b0a34e8b2fa344 100644 --- a/src/gui/guiframework.h +++ b/src/gui/guiframework.h @@ -1,5 +1,6 @@ /** * Copyright (C) 2004-2005 Savoir-Faire Linux inc. + * Author: Yan Morin <yan.morin@savoirfairelinux.com> * Author: Laurielle Lea <laurielle.lea@savoirfairelinux.com> * * This program is free software; you can redistribute it and/or modify diff --git a/src/main.cpp b/src/main.cpp index b4f65b54c54c3a4d6e7c0fbc76f5ff2a4a4cf2b3..d9119195e3808c91f96fe31fb0cf707bdbfc3957 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,5 +1,6 @@ /** * Copyright (C) 2004-2005 Savoir-Faire Linux inc. + * Author: Yan Morin <yan.morin@savoirfairelinux.com> * Author: Laurielle Lea <laurielle.lea@savoirfairelinux.com> * * This program is free software; you can redistribute it and/or modify diff --git a/src/managerimpl.cpp b/src/managerimpl.cpp index 0a8f9afe9cfe94ce50a98da7987364d3c6535399..e999aadfe010e9bbcb12f11d05c8733708d226b8 100644 --- a/src/managerimpl.cpp +++ b/src/managerimpl.cpp @@ -1,5 +1,6 @@ /** * Copyright (C) 2004-2005 Savoir-Faire Linux inc. + * Author: Yan Morin <yan.morin@savoirfairelinux.com> * Author : Laurielle Lea <laurielle.lea@savoirfairelinux.com> * * This program is free software; you can redistribute it and/or modify @@ -39,7 +40,6 @@ #include "manager.h" #include "audio/audiocodec.h" #include "audio/audiolayer.h" -#include "audio/codecDescriptor.h" #include "audio/ringbuffer.h" #include "audio/tonegenerator.h" #include "call.h" @@ -94,6 +94,8 @@ ManagerImpl::ManagerImpl (void) _toneType = 0; _nbIncomingWaitingCall=0; + + _codecMap = CodecDescriptorMap().getMap(); } ManagerImpl::~ManagerImpl (void) @@ -1473,7 +1475,19 @@ bool ManagerImpl::getConfigList(const std::string& sequenceId, const std::string& name) { bool returnValue = false; - if (name=="") { + if (name=="codecdescriptor") { + TokenList tk; + CodecMap::iterator iter = _codecMap.begin(); + + while( iter != _codecMap.end() ) { + tk.clear(); + std::ostringstream strType; + strType << iter->first; + tk.push_back(strType.str()); + tk.push_back(iter->second); + _gui->sendMessage("100", sequenceId, tk); + iter++; + } returnValue = true; } else if (name=="") { returnValue = true; diff --git a/src/managerimpl.h b/src/managerimpl.h index 955bd8ba740d093ac49ac05d5a73593578aad1f0..3b0dff412a1915b8e8b400a3fc07b04261fa2e5f 100644 --- a/src/managerimpl.h +++ b/src/managerimpl.h @@ -1,5 +1,6 @@ /** * Copyright (C) 2004-2005 Savoir-Faire Linux inc. + * Author: Yan Morin <yan.morin@savoirfairelinux.com> * Author: Laurielle Lea <laurielle.lea@savoirfairelinux.com> * * This program is free software; you can redistribute it and/or modify @@ -30,6 +31,7 @@ #include "observer.h" #include "config/config.h" #include "audio/dtmf.h" +#include "audio/codecDescriptor.h" class AudioLayer; class CodecDescriptor; @@ -346,6 +348,9 @@ private: */ CodecDescriptorVector _codecDescVector; + // map of codec (for configlist request) + CodecMap _codecMap; + /* * Mutex to protect access to code section */ diff --git a/src/sipcall.cpp b/src/sipcall.cpp index 2e0ee55e900b351153023f18513247361c795c33..45cc65dcc311cbeb430baa3a5936e3fa4ea82b2f 100644 --- a/src/sipcall.cpp +++ b/src/sipcall.cpp @@ -1,6 +1,7 @@ -/* - * Copyright (C) 2004-2005 Savoir-Faire Linux inc. - * Author: Laurielle Lea <laurielle.lea@savoirfairelinux.com> +/** + * Copyright (C) 2004-2005 Savoir-Faire Linux inc. + * Author: Yan Morin <yan.morin@savoirfairelinux.com> + * Author: Laurielle Lea <laurielle.lea@savoirfairelinux.com> * * Portions Copyright (C) 2002,2003 Aymeric Moizard <jack@atosc.org> * diff --git a/src/sipcall.h b/src/sipcall.h index 649ec244c997f22a59137323abfa372039209561..1fdcf5189ff2bc04505785416923b48aa4e886c6 100644 --- a/src/sipcall.h +++ b/src/sipcall.h @@ -1,5 +1,6 @@ -/* +/** * Copyright (C) 2004-2005 Savoir-Faire Linux inc. + * Author: Yan Morin <yan.morin@savoirfairelinux.com> * Author: Laurielle Lea <laurielle.lea@savoirfairelinux.com> * * Portions Copyright (C) 2002,2003 Aymeric Moizard <jack@atosc.org> diff --git a/src/sipvoiplink.cpp b/src/sipvoiplink.cpp index 588ddad1918647bc1b153afbb59a4f28b14ba632..b815973c9eb3291b74b702298fc4f8d73b0696f7 100644 --- a/src/sipvoiplink.cpp +++ b/src/sipvoiplink.cpp @@ -1,5 +1,6 @@ /** * Copyright (C) 2004-2005 Savoir-Faire Linux inc. + * Author: Yan Morin <yan.morin@savoirfairelinux.com> * Author : Laurielle Lea <laurielle.lea@savoirfairelinux.com> * * Portions Copyright (C) 2002,2003 Aymeric Moizard <jack@atosc.org> diff --git a/src/sipvoiplink.h b/src/sipvoiplink.h index 3e1b1988b6646b502e1c31023aa0d049f7a8f700..c5f2fd92fcf3b2a10a6d79ebd10855a3afe5b6aa 100644 --- a/src/sipvoiplink.h +++ b/src/sipvoiplink.h @@ -1,5 +1,6 @@ /** * Copyright (C) 2004-2005 Savoir-Faire Linux inc. + * Author: Yan Morin <yan.morin@savoirfairelinux.com> * Author : Laurielle Lea <laurielle.lea@savoirfairelinux.com> * * Portions Copyright (C) 2002,2003 Aymeric Moizard <jack@atosc.org> diff --git a/src/user_cfg.h b/src/user_cfg.h index 8c7dffb3297a8ae9220acbea6e386bf4cf8cdd72..144d2e976f10256adb72632a0537daf70498291d 100644 --- a/src/user_cfg.h +++ b/src/user_cfg.h @@ -1,5 +1,6 @@ /** * Copyright (C) 2004-2005 Savoir-Faire Linux inc. + * Author: Yan Morin <yan.morin@savoirfairelinux.com> * Author: Laurielle Lea <laurielle.lea@savoirfairelinux.com> * * This program is free software; you can redistribute it and/or modify diff --git a/src/voIPLink.cpp b/src/voIPLink.cpp index a7de97c22768746f8dc93e123c7355813e6c85b0..9ad71e03167f585ab710d9d453c608dd284f7180 100644 --- a/src/voIPLink.cpp +++ b/src/voIPLink.cpp @@ -1,5 +1,6 @@ /** * Copyright (C) 2005 Savoir-Faire Linux inc. + * Author: Yan Morin <yan.morin@savoirfairelinux.com> * Author : Laurielle Lea <laurielle.lea@savoirfairelinux.com> * * This program is free software; you can redistribute it and/or modify diff --git a/src/voIPLink.h b/src/voIPLink.h index 104eb530601c1b7ec0773bb439ad5856973715c3..54b35de28ebb4c636e6948be420f6127ce8a2bbb 100644 --- a/src/voIPLink.h +++ b/src/voIPLink.h @@ -1,5 +1,6 @@ /** * Copyright (C) 2005 Savoir-Faire Linux inc. + * Author: Yan Morin <yan.morin@savoirfairelinux.com> * Author : Laurielle Lea <laurielle.lea@savoirfairelinux.com> * * This program is free software; you can redistribute it and/or modify