diff --git a/.gitignore b/.gitignore
index a80993a56d6799c99f1445a3ec3e03d687ac4450..2cc26a700279f4d94da66367e58bbcc01be93670 100644
--- a/.gitignore
+++ b/.gitignore
@@ -64,7 +64,7 @@ doc/*.html
 /libs/dbus/ltmain.sh
 /libs/dbus/missing
 /src/dbus/org.sflphone.SFLphone.service
-
+/libs/sipUpdate
 
 # Ignore sflphone-gtk stuff
 /sflphone-gtk/config.*
diff --git a/INSTALL b/INSTALL
index e3819dedb696c608ef43fdbbc85eb2b08dfa4db2..23e5f25d0e5f85798dcfb368ecb2f04f59777f61 100644
--- a/INSTALL
+++ b/INSTALL
@@ -1,7 +1,7 @@
 Installation Instructions
 *************************
 
-Copyright (C) 1999, 2000, 2001, 2002, 2004, 2005, 2006, 2007, 2008 Free
+Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005 Free
 Software Foundation, Inc.
 
 This file is free documentation; the Free Software Foundation gives
diff --git a/configure.ac b/configure.ac
index a2862648f8229b93330cb68282b07e461c002df6..9144cfc1c7c3bb27444077ed0ab4480f0d92c3ec 100644
--- a/configure.ac
+++ b/configure.ac
@@ -57,7 +57,7 @@ AC_CONFIG_FILES([platform/debian/changelog \
   platform/fedora/sflphone-fc6.spec])
   
 dnl the file stamp-h.in should be there before (instead of AC_CONFIG_HEADERS(config.h))
-AM_CONFIG_HEADER(config.h)
+dnl AM_CONFIG_HEADER(config.h)
 
 dnl Get project version
 VERSION=`sed -ne 's/^#define SFLPHONED_VERSION "\(.*\)"/\1/p' ${srcdir}/src/global.h`
diff --git a/doc/images/polytechnique.jpg b/doc/images/polytechnique.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..232b9ea23d3eb7b00c5de119d2505e0e8a06fcad
Binary files /dev/null and b/doc/images/polytechnique.jpg differ
diff --git a/platform/debian/SFLautopackage.sh b/platform/debian/autopackage.sh
similarity index 83%
rename from platform/debian/SFLautopackage.sh
rename to platform/debian/autopackage.sh
index 5ab8c5397b96edc033f6c38e6ae88747139a7710..6fedd7edb24b9b18e0641d5b354c0f5163174c4c 100755
--- a/platform/debian/SFLautopackage.sh
+++ b/platform/debian/autopackage.sh
@@ -2,7 +2,7 @@
 
 # @author: Emmanuel Milou - emmanuel.milou@savoirfairelinux.com
 # Build a binary debian package of sflphone
-# Pre: make install of the all repository
+# Pre requisite: make install of the all repository
 
 if [ $1 = "-h" ]
 then
@@ -24,7 +24,7 @@ essential="no"
 arch="$2"
 homepage="http://www.sflphone.org"
 maintainer="SavoirFaireLinux Inc <emmanuel.milou@savoirfairelinux.com>"
-desc="SFLphone - Answer the call\n SFLphone is meant to be a robust enterprise-class desktop phone. It is design with a hundred-calls-a-day receptionist in mind. It can work for you, too.\n .\n SFLphone is released under the GNU General Public License.\n .\n SFLphone is being developed by the global community, and maintained by Savoir-faire Linux, a Montreal, Quebec, Canada-based Linux consulting company."
+desc="SFLphone - SIP and IAX2 compatible softphone\n SFLphone is meant to be a robust enterprise-class desktop phone. It is design with a hundred-calls-a-day receptionist in mind. It can work for you, too.\n .\n SFLphone is released under the GNU General Public License.\n .\n SFLphone is being developed by the global community, and maintained by Savoir-faire Linux, a Montreal, Quebec, Canada-based Linux consulting company."
 
 # Get the needed stuff
 
@@ -66,6 +66,7 @@ cp $sharedir/sflphone/ringtones/* $sfldir$sharedir/sflphone/ringtones
 #/usr/share/locale/fr/LC_MESSAGES
 mkdir -p $sfldir$sharedir/locale/fr/LC_MESSAGES
 cp $sharedir/locale/fr/LC_MESSAGES/sflphone.mo	$sfldir$sharedir/locale/fr/LC_MESSAGES
+cp $sharedir/locale/es/LC_MESSAGES/sflphone.mo	$sfldir$sharedir/locale/es/LC_MESSAGES
 
 # DEBIAN files
 mkdir -p $debdir 
diff --git a/platform/debian/SFLupdate.sh b/platform/debian/update.sh
similarity index 100%
rename from platform/debian/SFLupdate.sh
rename to platform/debian/update.sh
diff --git a/platform/debian/upload_to_rep.sh b/platform/debian/upload.sh
similarity index 100%
rename from platform/debian/upload_to_rep.sh
rename to platform/debian/upload.sh
diff --git a/sflphone-gtk/pixmaps/incoming.svg b/sflphone-gtk/pixmaps/incoming.svg
new file mode 100644
index 0000000000000000000000000000000000000000..7cbe926b7291788554bbf27630dd339e6587fb28
--- /dev/null
+++ b/sflphone-gtk/pixmaps/incoming.svg
@@ -0,0 +1,163 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:xlink="http://www.w3.org/1999/xlink"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="24"
+   height="24"
+   id="svg2"
+   sodipodi:version="0.32"
+   inkscape:version="0.46"
+   version="1.0"
+   sodipodi:docbase="/home/plbeaudoin/SFLPhone/sflphone/sflphone-gtk/pixmaps"
+   sodipodi:docname="incoming.svg"
+   inkscape:output_extension="org.inkscape.output.svg.inkscape"
+   sodipodi:modified="true">
+  <defs
+     id="defs4">
+    <linearGradient
+       inkscape:collect="always"
+       id="linearGradient2505">
+      <stop
+         style="stop-color:#008000;stop-opacity:1;"
+         offset="0"
+         id="stop2507" />
+      <stop
+         style="stop-color:#008000;stop-opacity:0;"
+         offset="1"
+         id="stop2509" />
+    </linearGradient>
+    <inkscape:perspective
+       sodipodi:type="inkscape:persp3d"
+       inkscape:vp_x="0 : 12 : 1"
+       inkscape:vp_y="0 : 1000 : 0"
+       inkscape:vp_z="24 : 12 : 1"
+       inkscape:persp3d-origin="12 : 8 : 1"
+       id="perspective4177" />
+    <linearGradient
+       id="linearGradient4269">
+      <stop
+         style="stop-color:#26b000;stop-opacity:1;"
+         offset="0"
+         id="stop4271" />
+      <stop
+         style="stop-color:#26b000;stop-opacity:0;"
+         offset="1"
+         id="stop4273" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient4183">
+      <stop
+         id="stop4185"
+         offset="0"
+         style="stop-color:#26b000;stop-opacity:1;" />
+      <stop
+         id="stop4187"
+         offset="1"
+         style="stop-color:#145f00;stop-opacity:1;" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient4167">
+      <stop
+         style="stop-color:#80000e;stop-opacity:1;"
+         offset="0"
+         id="stop4169" />
+      <stop
+         style="stop-color:#b00014;stop-opacity:0;"
+         offset="1"
+         id="stop4171" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient2505"
+       id="linearGradient2511"
+       x1="17.620802"
+       y1="9.4159222"
+       x2="-3.8121746"
+       y2="9.3760633"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.668614,0,0,1,3.7748346,0.1767767)" />
+  </defs>
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="11.313708"
+     inkscape:cx="18.87396"
+     inkscape:cy="2.756874"
+     inkscape:document-units="px"
+     inkscape:current-layer="layer1"
+     width="32px"
+     height="32px"
+     showguides="true"
+     inkscape:guide-bbox="true"
+     inkscape:window-width="1331"
+     inkscape:window-height="922"
+     inkscape:window-x="169"
+     inkscape:window-y="24"
+     showgrid="false">
+    <sodipodi:guide
+       orientation="vertical"
+       position="15.982143"
+       id="guide3146" />
+  </sodipodi:namedview>
+  <metadata
+     id="metadata7">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     inkscape:label="Calque 1"
+     inkscape:groupmode="layer"
+     id="layer1">
+    <path
+       style="opacity:1;fill:url(#linearGradient2511);fill-opacity:1;stroke:none;stroke-width:0.62500000000000000;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+       d="M 1.2259613,4.6445578 L 9.5484692,4.6445578 L 9.5484692,0.60013384 L 15.849421,9.5528402 L 9.5484692,18.505547 L 9.5484692,14.461122 L 1.2259613,14.461122 L 1.2259613,4.6445578 z"
+       id="rect4262" />
+    <g
+       id="g4160"
+       transform="matrix(0.3274903,-0.8169208,-0.8169208,-0.3274903,19.715453,28.330727)"
+       style="fill:#008000">
+      <path
+         sodipodi:nodetypes="cccsccsccsccc"
+         id="path3153"
+         d="M 16.100095,4.59375 C 10.946289,4.7477067 7.2256019,5.7999634 3.4220983,7.28125 L 3.2345983,10.227679 C 3.7846813,10.972881 5.0136533,11.508929 6.4220983,11.508929 C 7.7912983,11.508929 8.9758403,11.004648 9.5470983,10.290179 L 9.5470983,9.1875 C 11.968608,8.682612 12.862258,8.4375 16.125,8.4375 C 19.479577,8.4375001 20.38467,8.6842603 22.807982,9.15625 L 22.807982,10.165179 C 23.37924,10.879648 24.563781,11.383929 25.932982,11.383929 C 27.341427,11.383929 28.53915,10.847881 29.089232,10.102679 L 28.901732,7.15625 C 24.491586,5.413068 20.816266,4.6964725 16.100095,4.59375 z"
+         style="opacity:1;fill:#008000;fill-opacity:1;stroke:#0f5600;stroke-width:0.62500000000000000;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+      <path
+         sodipodi:nodetypes="cccsccc"
+         id="path3161"
+         d="M 6.4075414,13.019293 C 7.7882612,13.019293 8.983936,12.610489 9.5600003,12.01696 L 9.5600003,10.430989 C 8.8231919,11.109285 7.789205,11.494948 6.4075414,11.494948 C 4.9854414,11.494948 3.9881276,11.13019 3.2127675,10.48174 L 3.2127675,11.966208 C 3.7674786,12.585269 4.9872465,13.019293 6.4075414,13.019293 z"
+         style="opacity:1;fill:#008000;fill-opacity:1;stroke:#0f5600;stroke-width:0.57204323999999995;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+      <path
+         sodipodi:nodetypes="cccsccc"
+         id="path4140"
+         d="M 25.967532,12.944669 C 27.348252,12.944669 28.543927,12.535865 29.119991,11.942336 L 29.119991,10.356365 C 28.383183,11.034661 27.349196,11.420324 25.967532,11.420324 C 24.545432,11.420324 23.548118,11.055566 22.772758,10.407116 L 22.772758,11.891584 C 23.327469,12.510645 24.547237,12.944669 25.967532,12.944669 z"
+         style="opacity:1;fill:#008000;fill-opacity:1;stroke:#0f5600;stroke-width:0.57204323999999995;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+      <path
+         sodipodi:nodetypes="cccsccc"
+         id="path4246"
+         d="M 6.6822725,11.157918 C 8.0629923,11.157918 8.7535908,10.73333 9.3296551,10.139801 L 9.8978659,7.4805434 C 9.1610575,8.1588394 8.1270706,8.5445024 6.745407,8.5445024 C 5.323307,8.5445024 4.4996132,8.1797444 3.7242531,7.5312944 L 3.4874986,10.104833 C 4.0422097,10.723894 5.2619776,11.157918 6.6822725,11.157918 z"
+         style="opacity:1;fill:#008000;fill-opacity:1;stroke:none;stroke-width:0.57204323999999995;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+      <path
+         sodipodi:nodetypes="cccsccc"
+         id="path4258"
+         d="M 25.633599,11.055324 C 24.252879,11.055324 23.56228,10.630736 22.986216,10.037207 L 22.418005,7.3779497 C 23.154814,8.0562457 24.188801,8.4419087 25.570464,8.4419087 C 26.992564,8.4419087 27.816258,8.0771507 28.591618,7.4287007 L 28.828373,10.002239 C 28.273662,10.6213 27.053894,11.055324 25.633599,11.055324 z"
+         style="opacity:1;fill:#008000;fill-opacity:1;stroke:none;stroke-width:0.57204323999999995;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+    </g>
+  </g>
+</svg>
diff --git a/sflphone-gtk/pixmaps/outgoing.svg b/sflphone-gtk/pixmaps/outgoing.svg
new file mode 100644
index 0000000000000000000000000000000000000000..047a422d19a4045c46c15120f2852690aae7ef80
--- /dev/null
+++ b/sflphone-gtk/pixmaps/outgoing.svg
@@ -0,0 +1,163 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:xlink="http://www.w3.org/1999/xlink"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="24"
+   height="24"
+   id="svg2"
+   sodipodi:version="0.32"
+   inkscape:version="0.46"
+   version="1.0"
+   sodipodi:docbase="/home/plbeaudoin/SFLPhone/sflphone/sflphone-gtk/pixmaps"
+   sodipodi:docname="outgoing.svg"
+   inkscape:output_extension="org.inkscape.output.svg.inkscape"
+   sodipodi:modified="true">
+  <defs
+     id="defs4">
+    <linearGradient
+       inkscape:collect="always"
+       id="linearGradient2607">
+      <stop
+         style="stop-color:#008000;stop-opacity:1;"
+         offset="0"
+         id="stop2609" />
+      <stop
+         style="stop-color:#008000;stop-opacity:0;"
+         offset="1"
+         id="stop2611" />
+    </linearGradient>
+    <inkscape:perspective
+       sodipodi:type="inkscape:persp3d"
+       inkscape:vp_x="0 : 12 : 1"
+       inkscape:vp_y="0 : 1000 : 0"
+       inkscape:vp_z="24 : 12 : 1"
+       inkscape:persp3d-origin="12 : 8 : 1"
+       id="perspective4177" />
+    <linearGradient
+       id="linearGradient4269">
+      <stop
+         style="stop-color:#26b000;stop-opacity:1;"
+         offset="0"
+         id="stop4271" />
+      <stop
+         style="stop-color:#26b000;stop-opacity:0;"
+         offset="1"
+         id="stop4273" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient4183">
+      <stop
+         id="stop4185"
+         offset="0"
+         style="stop-color:#26b000;stop-opacity:1;" />
+      <stop
+         id="stop4187"
+         offset="1"
+         style="stop-color:#145f00;stop-opacity:1;" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient4167">
+      <stop
+         style="stop-color:#80000e;stop-opacity:1;"
+         offset="0"
+         id="stop4169" />
+      <stop
+         style="stop-color:#b00014;stop-opacity:0;"
+         offset="1"
+         id="stop4171" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient2607"
+       id="linearGradient2613"
+       x1="8.7504473"
+       y1="9.6810875"
+       x2="26.544411"
+       y2="9.906394"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.8461123,0,0,1,1.3448205,-0.1767767)" />
+  </defs>
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="11.313708"
+     inkscape:cx="18.87396"
+     inkscape:cy="2.756874"
+     inkscape:document-units="px"
+     inkscape:current-layer="layer1"
+     width="32px"
+     height="32px"
+     showguides="true"
+     inkscape:guide-bbox="true"
+     inkscape:window-width="1331"
+     inkscape:window-height="922"
+     inkscape:window-x="169"
+     inkscape:window-y="24"
+     showgrid="false">
+    <sodipodi:guide
+       orientation="vertical"
+       position="15.982143"
+       id="guide3146" />
+  </sodipodi:namedview>
+  <metadata
+     id="metadata7">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     inkscape:label="Calque 1"
+     inkscape:groupmode="layer"
+     id="layer1">
+    <path
+       style="opacity:1;fill:url(#linearGradient2613);fill-opacity:1;stroke:none;stroke-width:0.625;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+       d="M 8.738971,4.8213345 L 17.312996,4.8213345 L 17.312996,0.77691046 L 23.804372,9.7296169 L 17.312996,18.682323 L 17.312996,14.637898 L 8.738971,14.637898 L 8.738971,4.8213345 z"
+       id="rect4262" />
+    <g
+       id="g4160"
+       transform="matrix(-0.3526524,-0.8063782,0.8063782,-0.3526524,5.2455765,28.387663)"
+       style="fill:#008000">
+      <path
+         sodipodi:nodetypes="cccsccsccsccc"
+         id="path3153"
+         d="M 16.100095,4.59375 C 10.946289,4.7477067 7.2256019,5.7999634 3.4220983,7.28125 L 3.2345983,10.227679 C 3.7846813,10.972881 5.0136533,11.508929 6.4220983,11.508929 C 7.7912983,11.508929 8.9758403,11.004648 9.5470983,10.290179 L 9.5470983,9.1875 C 11.968608,8.682612 12.862258,8.4375 16.125,8.4375 C 19.479577,8.4375001 20.38467,8.6842603 22.807982,9.15625 L 22.807982,10.165179 C 23.37924,10.879648 24.563781,11.383929 25.932982,11.383929 C 27.341427,11.383929 28.53915,10.847881 29.089232,10.102679 L 28.901732,7.15625 C 24.491586,5.413068 20.816266,4.6964725 16.100095,4.59375 z"
+         style="opacity:1;fill:#008000;fill-opacity:1;stroke:#0f5600;stroke-width:0.62500000000000000;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+      <path
+         sodipodi:nodetypes="cccsccc"
+         id="path3161"
+         d="M 6.4075414,13.019293 C 7.7882612,13.019293 8.983936,12.610489 9.5600003,12.01696 L 9.5600003,10.430989 C 8.8231919,11.109285 7.789205,11.494948 6.4075414,11.494948 C 4.9854414,11.494948 3.9881276,11.13019 3.2127675,10.48174 L 3.2127675,11.966208 C 3.7674786,12.585269 4.9872465,13.019293 6.4075414,13.019293 z"
+         style="opacity:1;fill:#008000;fill-opacity:1;stroke:#0f5600;stroke-width:0.57204323999999995;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+      <path
+         sodipodi:nodetypes="cccsccc"
+         id="path4140"
+         d="M 25.967532,12.944669 C 27.348252,12.944669 28.543927,12.535865 29.119991,11.942336 L 29.119991,10.356365 C 28.383183,11.034661 27.349196,11.420324 25.967532,11.420324 C 24.545432,11.420324 23.548118,11.055566 22.772758,10.407116 L 22.772758,11.891584 C 23.327469,12.510645 24.547237,12.944669 25.967532,12.944669 z"
+         style="opacity:1;fill:#008000;fill-opacity:1;stroke:#0f5600;stroke-width:0.57204323999999995;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+      <path
+         sodipodi:nodetypes="cccsccc"
+         id="path4246"
+         d="M 6.6822725,11.157918 C 8.0629923,11.157918 8.7535908,10.73333 9.3296551,10.139801 L 9.8978659,7.4805434 C 9.1610575,8.1588394 8.1270706,8.5445024 6.745407,8.5445024 C 5.323307,8.5445024 4.4996132,8.1797444 3.7242531,7.5312944 L 3.4874986,10.104833 C 4.0422097,10.723894 5.2619776,11.157918 6.6822725,11.157918 z"
+         style="opacity:1;fill:#008000;fill-opacity:1;stroke:none;stroke-width:0.57204323999999995;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+      <path
+         sodipodi:nodetypes="cccsccc"
+         id="path4258"
+         d="M 25.633599,11.055324 C 24.252879,11.055324 23.56228,10.630736 22.986216,10.037207 L 22.418005,7.3779497 C 23.154814,8.0562457 24.188801,8.4419087 25.570464,8.4419087 C 26.992564,8.4419087 27.816258,8.0771507 28.591618,7.4287007 L 28.828373,10.002239 C 28.273662,10.6213 27.053894,11.055324 25.633599,11.055324 z"
+         style="opacity:1;fill:#008000;fill-opacity:1;stroke:none;stroke-width:0.57204323999999995;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+    </g>
+  </g>
+</svg>
diff --git a/sflphone-gtk/src/actions.c b/sflphone-gtk/src/actions.c
index 1eaa1c32b8635fd90795d1cab7bbf249c23a0426..2025c4379454621bd321170b5bab0a6bd07345aa 100644
--- a/sflphone-gtk/src/actions.c
+++ b/sflphone-gtk/src/actions.c
@@ -590,9 +590,17 @@ sflphone_place_call ( call_t * c )
   if(c->state == CALL_STATE_DIALING)
   {
     if( account_list_get_size() == 0 )
+    {
       notify_no_accounts();
+      call_list_remove(current_calls , c->callID);
+      update_call_tree_remove(current_calls, c);
+    }
     else if( account_list_get_by_state( ACCOUNT_STATE_REGISTERED ) == NULL )
+    {
       notify_no_registered_accounts();
+      call_list_remove(current_calls , c->callID);
+      update_call_tree_remove(current_calls, c);
+    }
     else
     {
       account_t * current = account_list_get_current();
diff --git a/sflphone-gtk/src/configwindow.c b/sflphone-gtk/src/configwindow.c
index d43ec5b6e5330fb2beb57f769b38668cb963c225..e89ef3c9843f59ae01d6d821ff3968f0c60e4c33 100644
--- a/sflphone-gtk/src/configwindow.c
+++ b/sflphone-gtk/src/configwindow.c
@@ -1360,6 +1360,7 @@ show_accounts_window( void )
 	gtk_container_add(GTK_CONTAINER(accountFrame) , tab);
 
       gtk_dialog_run( dialog );
+
       dialogOpen=FALSE;
       gtk_widget_destroy(GTK_WIDGET(dialog));
 }
diff --git a/sflphone-gtk/src/menus.c b/sflphone-gtk/src/menus.c
index 199959ee36ccc2b54a79fd70f5741936155ca180..ce1cec622dd305241f25f8fe7443eccadf1d01eb 100644
--- a/sflphone-gtk/src/menus.c
+++ b/sflphone-gtk/src/menus.c
@@ -113,14 +113,16 @@ help_about ( void * foo)
   gchar *artists[] = {
     "Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com>", 
     NULL};
+  gchar *translators[] = {
+    "<maxime.chambreuil@savoirfairelinux.com>",
+    NULL};
 
   gtk_show_about_dialog( GTK_WINDOW(get_main_window()),
       "name", PACKAGE,
       "title", _("About SFLphone"),
       "version", VERSION,
       "website", "http://www.sflphone.org",
-      "copyright", "Copyright © 2004-2007 Savoir-faire Linux Inc.",
-      "translator-credits", "", 
+      "copyright", "Copyright © 2004-2008 Savoir-faire Linux Inc.",
       "comments", _("SFLphone is a VoIP client compatible with SIP and IAX2 protocols."),
       "artists", artists,
       "authors", authors,
diff --git a/sflphone-gtk/src/sflnotify.c b/sflphone-gtk/src/sflnotify.c
index 14b17ff8af1588d3a0aa611fc29bb5bb1a5d28bb..d29fec3dc7e594a4f4db1a870f8bd4b00af28367 100644
--- a/sflphone-gtk/src/sflnotify.c
+++ b/sflphone-gtk/src/sflnotify.c
@@ -34,8 +34,6 @@ notify_incoming_call( call_t* c  )
       (gchar*)g_hash_table_lookup(account_list_get_by_id(c->accountID)->properties , ACCOUNT_ALIAS) ) ;
   callerid = g_markup_printf_escaped(_("<i>From:</i> %s") , c->from);
 
-
-  //pixbuf = gdk_pixbuf_new_from_file(ICON_DIR "/sflphone.png", NULL);
   pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/ring.svg", NULL);
 
   notification = notify_notification_new( title, 
@@ -175,8 +173,9 @@ notify_no_accounts(  )
  void
 setup_accounts_cb( NotifyNotification *notification, gpointer data )
 {
+  //gtk_widget_set_parent( show_accounts_window() , GTK_WIDGET(get_main_window()));
   show_accounts_window();
-  //g_object_unref( notification );
+  g_object_unref( notification );
 }
 
   void
diff --git a/sflphone-gtk/src/sflphone_const.h b/sflphone-gtk/src/sflphone_const.h
index b3b565949daefc444905d63ea3929eee63fa008b..9ddd22e2a217eef7e15c281640386040ed8210d3 100644
--- a/sflphone-gtk/src/sflphone_const.h
+++ b/sflphone-gtk/src/sflphone_const.h
@@ -87,6 +87,6 @@
 /** Desktop notifications - Time before to close the notification*/
 #define __TIMEOUT_MODE      "default"
 /** Desktop notifications - Time before to close the notification*/
-#define __TIMEOUT_TIME      30000       // 30 secondes
+#define __TIMEOUT_TIME      18000       // 30 secondes
 
 #endif
diff --git a/src/audio/audiodevice.cpp b/src/audio/audiodevice.cpp
index 765fc6be9b1ab3f995370420552a1a48e108aca7..a4672da846bd13b1b2e369824ae9d007fc73690a 100644
--- a/src/audio/audiodevice.cpp
+++ b/src/audio/audiodevice.cpp
@@ -22,8 +22,8 @@
 
 const double AudioDevice::DEFAULT_RATE = 8000.0;
 
-AudioDevice::AudioDevice(int id, const std::string& apiName, const std::string& name) : 
-  _id(id), _apiName(apiName), _name(name)
+AudioDevice::AudioDevice(int id, const std::string& name) : 
+  _id(id), _name(name)
 {
   _rate = DEFAULT_RATE;
 }
diff --git a/src/audio/audiodevice.h b/src/audio/audiodevice.h
index acdfee46368c8f9d187a6d82556600ad4ef8dabb..ccc5840324208bd5f161a1438bd21abcc5b08f5e 100644
--- a/src/audio/audiodevice.h
+++ b/src/audio/audiodevice.h
@@ -20,36 +20,61 @@
 #ifndef _AUDIO_DEVICE_H
 #define _AUDIO_DEVICE_H
 
-
 #include <string>
 
 #define AUDIODEVICERATE 8000
 
 /**
- * @file audiodevice.c
+ * @file audiodevice.h
  * @brief Container device for attribute storage
  * Have almost only get/set method
  */
 class AudioDevice {
 public:
-  AudioDevice(int id, const std::string& apiName, const std::string& name);
+  /**
+   * Constructor
+   * @param id Identifier
+   * @param name Name
+   */
+  AudioDevice(int id, const std::string& name);
+  
+  /**
+   * Destructor
+   */
   ~AudioDevice();
 
+  /** Default sample rate */
   const static double DEFAULT_RATE;
 
+  /**
+   * Read accessor to the ID
+   * @return int	The ID of the audiodevice
+   */
   int getId() { return _id; }
-  const std::string& getApiName() {return _apiName; }
+  
+  /**
+   * Read accessor to the name
+   * @return std::string&  A string description
+   */
   const std::string& getName() {return _name; }
 
+  /**
+   * Write accessor to the sample rate
+   * @param rate  The sample rate
+   */
   void setRate(double rate) { _rate = rate;}
+  
+  /**
+   * Read accessor to the sample rate
+   * @return double The sample rate
+   */
   double getRate() { return _rate; }
 
 private:
 
   /** Integer id of the device, can not be 0 */
   int _id;
-  /** Host API Name, ex: OSS, ALSA */
-  std::string _apiName;
+
   /** Name of the device */
   std::string _name;
   
diff --git a/src/audio/audiofile.h b/src/audio/audiofile.h
index d615e358f42477eaaebd1675a323ecc913811dc7..1de076de13f992ee77ebf2112a51fa5b0a3548be 100644
--- a/src/audio/audiofile.h
+++ b/src/audio/audiofile.h
@@ -28,22 +28,57 @@
 #include "codecDescriptor.h"
 
 /**
-	@author Yan Morin <yan.morin@savoirfairelinux.com>
-*/
+ * @file audiofile.h
+ * @brief A class to manage sound files
+ */
+
 class AudioFile : public AudioLoop
 {
 public:
+  /**
+   * Constructor
+   */
   AudioFile();
+  
+  /**
+   * Destructor
+   */
   ~AudioFile();
 
-  bool loadFile(const std::string& filename, AudioCodec *codec , unsigned int sampleRate/*=8000*/);
+  /**
+   * Load a sound file in memory
+   * @param filename  The absolute path to the file
+   * @param codec     The codec to decode and encode it
+   * @param sampleRate	The sample rate to read it
+   * @return bool   True on success
+   */
+  bool loadFile(const std::string& filename, AudioCodec *codec , unsigned int sampleRate);
+  
+  /**
+   * Start the sound file
+   */
   void start() { _start = true; }
+  
+  /**
+   * Stop the sound file
+   */
   void stop()  { _start = false; }
+  
+  /**
+   * Tells whether or not the file is playing
+   * @return bool True if yes
+   *		  false otherwise
+   */
   bool isStarted() { return _start; }
 
 private:
+  /** The absolute path to the sound file */
   std::string _filename;
+  
+  /** Your preferred codec */ 
   AudioCodec* _codec;
+  
+  /** Start or not */
   bool _start;
 };
 
diff --git a/src/audio/audiolayer.cpp b/src/audio/audiolayer.cpp
index ff13e4f9c566082804bbfee7751873cd63f8c4fc..c893eb95cf12bc314d72d7ca12c5f9d64c5bf4c3 100644
--- a/src/audio/audiolayer.cpp
+++ b/src/audio/audiolayer.cpp
@@ -1,9 +1,8 @@
 /*
- *  Copyright (C) 2005 Savoir-Faire Linux inc.
+ *  Copyright (C) 2008 Savoir-Faire Linux inc.
  *  Author: Yan Morin <yan.morin@savoirfairelinux.com>
  *  Author: Jerome Oufella <jerome.oufella@savoirfairelinux.com> 
  *  Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com>
- *  Author: Guillaume Carmel-Archambault <guillaume.carmel-archambault@savoirfairelinux.com>
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -37,7 +36,6 @@
 
   AudioLayer::AudioLayer(ManagerImpl* manager)
   :   _defaultVolume(100)
-  , _errorMessage(-1)
   , _manager(manager)
   , _PlaybackHandle( NULL )
   , _CaptureHandle( NULL )
@@ -123,13 +121,6 @@ AudioLayer::stopStream(void)
   _urgentBuffer.flush();
 }
 
-  int
-AudioLayer::getDeviceCount()
-{
-  // TODO: everything
-  return 1;
-}
-
 void AudioLayer::AlsaCallBack( snd_async_handler_t* pcm_callback )
 { 
   ( ( AudioLayer *)snd_async_handler_get_callback_private( pcm_callback )) -> playTones();
@@ -141,7 +132,7 @@ AudioLayer::fillHWBuffer( void)
   unsigned char* data;
   int pcmreturn, l1, l2;
   short s1, s2;
-  int periodSize = 256 ;
+  int periodSize = 128 ;
   int frames = periodSize >> 2 ;
   _debug("frames  = %d\n");
 
@@ -326,8 +317,6 @@ AudioLayer::open_device(std::string pcm_p, std::string pcm_c, int flag)
     if( err = snd_pcm_hw_params_set_format( _CaptureHandle, hwParams, SND_PCM_FORMAT_S16_LE) < 0) _debugAlsa(" Cannot set sample format (%s)\n", snd_strerror(err));
     if( err = snd_pcm_hw_params_set_rate_near( _CaptureHandle, hwParams, &rate_in, &dir) < 0) _debugAlsa(" Cannot set sample rate (%s)\n", snd_strerror(err));
     if( err = snd_pcm_hw_params_set_channels( _CaptureHandle, hwParams, 1) < 0) _debugAlsa(" Cannot set channel count (%s)\n", snd_strerror(err));
-    //if( err = snd_pcm_hw_params_set_period_size_near( _CaptureHandle, hwParams, &period_size_in , &dir) < 0) _debugAlsa(" Cannot set period size (%s)\n", snd_strerror(err));
-    //if( err = snd_pcm_hw_params_set_buffer_size_near( _CaptureHandle, hwParams, &buffer_size_in ) < 0) _debugAlsa(" Cannot set buffer size (%s)\n", snd_strerror(err));
     if( err = snd_pcm_hw_params_set_period_time_near( _CaptureHandle, hwParams, &period_time , &dir) < 0) _debugAlsa(" Cannot set period time (%s)\n", snd_strerror(err));
     if( err = snd_pcm_hw_params_set_buffer_time_near( _CaptureHandle, hwParams, &buffer_time , &dir) < 0) _debugAlsa(" Cannot set buffer time (%s)\n", snd_strerror(err));
     if( err = snd_pcm_hw_params_get_period_size( hwParams, &period_size_in , &dir) < 0) _debugAlsa(" Cannot get period size (%s)\n", snd_strerror(err));
@@ -581,9 +570,9 @@ AudioLayer::getSoundCardsInfo( int stream )
 AudioLayer::closeCaptureStream( void)
 {
   if(_CaptureHandle){
-      snd_pcm_drop( _CaptureHandle );
-      snd_pcm_close( _CaptureHandle );
-      _CaptureHandle = 0;
+    snd_pcm_drop( _CaptureHandle );
+    snd_pcm_close( _CaptureHandle );
+    _CaptureHandle = 0;
   }
 }
 
@@ -591,9 +580,9 @@ AudioLayer::closeCaptureStream( void)
 AudioLayer::closePlaybackStream( void)
 {
   if(_PlaybackHandle){
-      snd_pcm_drop( _PlaybackHandle );
-      snd_pcm_close( _PlaybackHandle );
-      _PlaybackHandle = 0;
+    snd_pcm_drop( _PlaybackHandle );
+    snd_pcm_close( _PlaybackHandle );
+    _PlaybackHandle = 0;
   }
 }
 
diff --git a/src/audio/audiolayer.h b/src/audio/audiolayer.h
index 18426aa57af21daf3008ee15b9f0bea541fdc8b6..f303167348215b7cf36ec4608351739e997891f1 100644
--- a/src/audio/audiolayer.h
+++ b/src/audio/audiolayer.h
@@ -1,9 +1,8 @@
 /*
- *  Copyright (C) 2004-2005 Savoir-Faire Linux inc.
+ *  Copyright (C) 2004-2008 Savoir-Faire Linux inc.
  *  Author: Yan Morin <yan.morin@savoirfairelinux.com>
  *  Author:  Jerome Oufella <jerome.oufella@savoirfairelinux.com> 
  *  Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com>
- *  Author: Guillaume Carmel-Archambault <guillaume.carmel-archambault@savoirfairelinux.com>
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -23,29 +22,40 @@
 #ifndef _AUDIO_LAYER_H
 #define _AUDIO_LAYER_H
 
-#include <cc++/thread.h> // for ost::Mutex
-
 #include "../global.h"
 #include "audiodevice.h"
 #include "ringbuffer.h"
 
+#include <cc++/thread.h> // for ost::Mutex
 #include <vector>
 #include <alsa/asoundlib.h>
 #include <iostream>
-#include <fstream>
 #include <istream>
 #include <sstream>
 #define FRAME_PER_BUFFER	160
 
-
 class RingBuffer;
 class ManagerImpl;
 
+/** Associate a sound card index to its string description */
 typedef std::pair<int , std::string> HwIDPair;
 
+/**
+ * @file  audiolayer.h
+ * @brief Main sound class. Manages the data transfers between the application and the hardware. 
+ */
+
 class AudioLayer {
   public:
+    /**
+     * Constructor
+     * @param manager An instance of managerimpl
+     */
     AudioLayer(ManagerImpl* manager);
+    
+    /**
+     * Destructor
+     */
     ~AudioLayer(void);
 
     /**
@@ -61,7 +71,7 @@ class AudioLayer {
      *			  SFL_PCM_BOTH
      * @param plugin	  The alsa plugin ( dmix , default , front , surround , ...)
      */
-    bool openDevice(int, int, int, int, int, std::string);
+    bool openDevice(int indexIn, int indexOut, int sampleRate, int frameSize, int stream, std::string plugin);
 
     /**
      * Start the capture stream and prepare the playback stream. 
@@ -107,8 +117,9 @@ class AudioLayer {
 
     /**
      * Send samples to the audio device. 
-     * @params buffer The buffer containing the data to be played ( voice and DTMF )
-     * @params toCopy The number of samples, in bytes
+     * @param buffer The buffer containing the data to be played ( voice and DTMF )
+     * @param toCopy The number of samples, in bytes
+     * @param isTalking	If whether or not the conversation is running
      * @return int The number of bytes played
      */
     int playSamples(void* buffer, int toCopy, bool isTalking);
@@ -116,8 +127,8 @@ class AudioLayer {
     /**
      * Send a chunk of data to the hardware buffer to start the playback
      * Copy data in the urgent buffer. 
-     * @params buffer The buffer containing the data to be played ( ringtones )
-     * @params toCopy The size of the buffer
+     * @param buffer The buffer containing the data to be played ( ringtones )
+     * @param toCopy The size of the buffer
      * @return int  The number of bytes copied in the urgent buffer
      */
     int putUrgent(void* buffer, int toCopy);
@@ -147,29 +158,57 @@ class AudioLayer {
 
     /**
      * Scan the sound card available on the system
-     * @param flag To indicate whether we are looking for capture devices or playback devices
+     * @param stream To indicate whether we are looking for capture devices or playback devices
      *		   SFL_PCM_CAPTURE
      *		   SFL_PCM_PLAYBACK
      *		   SFL_PCM_BOTH
      * @return std::vector<std::string> The vector containing the string description of the card
      */
     std::vector<std::string> getSoundCardsInfo( int stream );
+
+    /**
+     * Check if the given index corresponds to an existing sound card and supports the specified streaming mode
+     * @param card   An index
+     * @param stream  The stream mode
+     *		  SFL_PCM_CAPTURE
+     *		  SFL_PCM_PLAYBACK
+     *		  SFL_PCM_BOTH
+     * @return bool True if it exists and supports the mode
+     *		    false otherwise
+     */
     bool soundCardIndexExist( int card , int stream );
+    
+    /**
+     * An index is associated with its string description
+     * @param description The string description
+     * @return	int	  Its index
+     */
     int soundCardGetIndex( std::string description );
 
+    /**
+     * Write accessor to the error state
+     * @param error The error code
+     *		    Could be: ALSA_PLAYBACK_DEVICE
+     *			      ALSA_CAPTURE_DEVICE
+     */  
     void setErrorMessage(const int& error) { _errorMessage = error; }
+    
+    /**
+     * Read accessor to the error state
+     * @return int  The error code
+     */
     int getErrorMessage() { return _errorMessage; }
 
     /**
      * Get the index of the audio card for capture
-     * @return _indexIn The index of the card used for capture
+     * @return int The index of the card used for capture
      *			0 for the first available card on the system, 1 ...
      */
     int getIndexIn() { return _indexIn; }
 
     /**
      * Get the index of the audio card for playback
-     * @return _indexOut The index of the card used for playback
+     * @return int The index of the card used for playback
      *			0 for the first available card on the system, 1 ...
      */
     int getIndexOut() { return _indexOut; }
@@ -193,7 +232,6 @@ class AudioLayer {
      * @return std::string  The name of the audio plugin
      */
     std::string getAudioPlugin( void ) { return _audioPlugin; }
-    std::ofstream _fstream;
     /**
      * Get the current state. Conversation or not
      * @return bool true if playSamples has been called  
@@ -201,14 +239,11 @@ class AudioLayer {
      */
     bool getCurrentState( void ) { return _talk; }
 
-    int getDeviceCount();
-
     /**
      * Toggle echo testing on/off
      */
     void toggleEchoTesting();
 
-
   private:
 
     /**
@@ -231,8 +266,9 @@ class AudioLayer {
     /**
      * Callback used for asynchronous playback.
      * Called when a certain amount of data is written ot the device
+     * @param pcm_callback  The callback pointer
      */
-    static void AlsaCallBack( snd_async_handler_t* );
+    static void AlsaCallBack( snd_async_handler_t* pcm_callback);
 
     /**
      * Callback used for asynchronous playback.
@@ -244,8 +280,8 @@ class AudioLayer {
      * Open the specified device.
      * ALSA Library API
      * @param pcm_p The string name for the playback device
-     *	      pcm_c The string name for the capture device
-     *	      flag  To indicate which kind of stream you want to open
+     * @param pcm_c The string name for the capture device
+     * @param flag  To indicate which kind of stream you want to open
      *		    SFL_PCM_CAPTURE
      *		    SFL_PCM_PLAYBACK
      *		    SFL_PCM_BOTH
@@ -258,7 +294,7 @@ class AudioLayer {
      * Copy a data buffer in the internal ring buffer
      * ALSA Library API
      * @param buffer The data to be copied
-     *	      length The size of the buffer
+     * @param length The size of the buffer
      * @return int The number of frames actually copied
      */
     int write( void* buffer, int length);
@@ -267,7 +303,7 @@ class AudioLayer {
      * Read data from the internal ring buffer
      * ALSA Library API
      * @param buffer  The buffer to stock the read data
-     *	      toCopy  The number of bytes to get
+     * @param toCopy  The number of bytes to get
      * @return int The number of frames actually read
      */
     int read( void* buffer, int toCopy);
@@ -277,16 +313,31 @@ class AudioLayer {
      * ALSA Library API
      */
     void handle_xrun_capture( void );
-    void handle_xrun_playback( void );
 
-    ManagerImpl* _manager; // augment coupling, reduce indirect access
+    /**
+     * Recover from XRUN state for playback
+     * ALSA Library API
+     */
+    void handle_xrun_playback( void );
+    
+    /** Augment coupling, reduce indirect access */
+    ManagerImpl* _manager; 
 
     /**
-     * Handles to manipulate capture and playback streams
+     * Handles to manipulate playback stream
      * ALSA Library API
      */
     snd_pcm_t* _PlaybackHandle;
+
+    /**
+     * Handles to manipulate capture stream
+     * ALSA Library API
+     */
     snd_pcm_t* _CaptureHandle;
+    
+    /**
+     * Alsa parameter - Size of a period in the hardware ring buffer
+     */
     snd_pcm_uframes_t _periodSize;
 
     /**
@@ -299,6 +350,12 @@ class AudioLayer {
      */
     RingBuffer _urgentBuffer;
     
+    /**
+     * Volume is controlled by the application. Data buffer are modified here to adjust to the right volume selected by the user on the main interface
+     * @param buffer  The buffer to adjust
+     * @param len The number of bytes
+     * @param stream  The stream mode ( PLAYBACK - CAPTURE )
+     */
     void * adjustVolume( void * , int , int);
 
     /**
@@ -316,9 +373,13 @@ class AudioLayer {
     bool deviceClosed;
 
     /**
-     * Number of audio cards on which stream has been opened 
+     * Number of audio cards on which capture stream has been opened 
      */
     int _indexIn;
+
+    /**
+     * Number of audio cards on which playback stream has been opened 
+     */
     int _indexOut;
 
     /**
@@ -341,12 +402,12 @@ class AudioLayer {
     /**
      * Input channel (mic) should be 1 mono
      */
-    unsigned int _inChannel; // mic
+    unsigned int _inChannel; 
 
     /**
      * Output channel (stereo) should be 1 mono
      */
-    unsigned int _outChannel; // speaker
+    unsigned int _outChannel; 
 
     /**
      * Default volume for incoming RTP and Urgent sounds.
@@ -358,12 +419,13 @@ class AudioLayer {
      */
     bool _echoTesting;
 
+    /** Vector to manage all soundcard index - description association of the system */
     std::vector<HwIDPair> IDSoundCards;
 
+    /** Contains the current error code */
     int _errorMessage;
-    ost::Mutex _mutex;
 
+    ost::Mutex _mutex;
 };
 
 #endif // _AUDIO_LAYER_H_
-
diff --git a/src/audio/audioloop.h b/src/audio/audioloop.h
index 647455edf7dc54a1c006e8564bda9ecaf7a4eadf..1e950c2ac75a0e0a7fe3ee0b41a428cd700accbc 100644
--- a/src/audio/audioloop.h
+++ b/src/audio/audioloop.h
@@ -26,33 +26,58 @@
 #include "../global.h" // for int16 declaration
 
 /**
- * @author Yan Morin <yan.morin@savoirfairelinux.com>
+ * @file audioloop.h
+ * @brief Loop on a sound file
  */
+
 class AudioLoop {
 public:
+  /**
+   * Constructor
+   */
   AudioLoop();
+  
+  /**
+   * Virtual destructor
+   */
   virtual ~AudioLoop();
 
   /**
-   * get the next fragment of the tone
+   * Get the next fragment of the tone
    * the function change the intern position, and will loop
+   * @param output  The data buffer
    * @param nb of int16 to send
+   * @param volume  The volume
    * @return the number of int16 sent (nb*2)
    */
   int getNext(SFLDataFormat* output, int nb, short volume=100);
+  
+  /**
+   * Reset the pointer position
+   */ 
   void reset() { _pos = 0; }
-  unsigned int getMonoSize() { return _size; }
+
+  /**
+   * Accessor to the size of the buffer
+   * @return unsigned int The size
+   */
   unsigned int getSize() { return _size; }
   
 
 
 protected:
+  /** The data buffer */
   SFLDataFormat* _buffer;
-  int _size; // number of int16 inside the buffer, not the delay
-  int _pos; // current position, set to 0, when initialize
-  int _sampleRate; // last samplerate
-};
 
+  /** Number of int16 inside the buffer, not the delay */
+  int _size;  
+
+  /** current position, set to 0, when initialize */
+  int _pos;  
+
+  /** Sample rate */
+  int _sampleRate; 
+};
 
 #endif // __AUDIOLOOP_H__
 
diff --git a/src/audio/audiortp.cpp b/src/audio/audiortp.cpp
index 01f4729704b3095ac603758289e2f466b42ff9da..e98458bdc36af9fdd2098d8ffe81bb465eb94dcf 100644
--- a/src/audio/audiortp.cpp
+++ b/src/audio/audiortp.cpp
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2004-2007 Savoir-Faire Linux inc.
+ *  Copyright (C) 2004-2008 Savoir-Faire Linux inc.
  *  Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com>
  *  Author: Alexandre Bourget <alexandre.bourget@savoirfairelinux.com>
  *  Author: Yan Morin <yan.morin@savoirfairelinux.com>
@@ -97,7 +97,6 @@ AudioRtp::closeRtpSession () {
 // AudioRtpRTX Class                                                          //
 ////////////////////////////////////////////////////////////////////////////////
 AudioRtpRTX::AudioRtpRTX (SIPCall *sipcall, bool sym)
-  : _fstream("/tmp/audio.gsm", std::ofstream::binary|std::ios::out|std::ios::app)
 {
   setCancel(cancelDeferred);
   time = new ost::Time();
diff --git a/src/audio/audiortp.h b/src/audio/audiortp.h
index 0947543ed07596a6be47f45a4c810d2281dcea35..0b735ac890414ed4a27b7556432d18111b0779d1 100644
--- a/src/audio/audiortp.h
+++ b/src/audio/audiortp.h
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2004-2007 Savoir-Faire Linux inc.
+ *  Copyright (C) 2004-2008 Savoir-Faire Linux inc.
  *  Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com>
  *  Author: Alexandre Bourget <alexandre.bourget@savoirfairelinux.com>
  *  Author: Yan Morin <yan.morin@savoirfairelinux.com>
@@ -24,19 +24,20 @@
 
 #include <cstdio>
 #include <cstdlib>
-#include <fstream> // fstream + iostream for _fstream debugging...
 #include <iostream>
-
 #include <ccrtp/rtp.h>
 #include <cc++/numbers.h>
 
 #include <samplerate.h>
-
 #include "../global.h"
 
 #define UP_SAMPLING 0
 #define DOWN_SAMPLING 1
 
+/**
+ * @file audiortp.h
+ * @brief Manage the real-time data transport in a SIP call
+ */
 
 class SIPCall;
 
@@ -44,101 +45,170 @@ class SIPCall;
 // Two pair of sockets
 ///////////////////////////////////////////////////////////////////////////////
 class AudioRtpRTX : public ost::Thread, public ost::TimerPort {
-	public:
-		AudioRtpRTX (SIPCall *, bool);
-		~AudioRtpRTX();
-
-		ost::Time *time; 	// For incoming call notification 
-		virtual void run ();
-
-	private:
-		SIPCall* _ca;
-		ost::RTPSession *_sessionSend;
-		ost::RTPSession *_sessionRecv;
-		ost::SymmetricRTPSession *_session;
-		ost::Semaphore _start;
-		bool _sym;
-
-		/** When we receive data, we decode it inside this buffer */
-		int16* _receiveDataDecoded;
-		/** Buffers used for send data from the mic */
-		unsigned char* _sendDataEncoded;
-		int16* _intBufferDown;
-
-		/** After that we send the data inside this buffer if there is a format conversion or rate conversion */
-		/** Also use for getting mic-ringbuffer data */
-		SFLDataFormat* _dataAudioLayer;
-
-		/** Buffers used for sample rate conversion */
-		float32* _floatBufferDown;
-		float32* _floatBufferUp;
-
-		/** Debugging output file */
-		std::ofstream _fstream;
-		FILE* fd;
-
-		/** libsamplerate converter for incoming voice */
-		SRC_STATE*    _src_state_spkr;
-		/** libsamplerate converter for outgoing voice */
-		SRC_STATE*    _src_state_mic;
-		/** libsamplerate error */
-		int           _src_err;
-
-		// Variables to process audio stream
-		int _layerSampleRate;  // sample rate for playing sound (typically 44100HZ)
-		int _codecSampleRate; // sample rate of the codec we use to encode and decode (most of time 8000HZ)
-		int _layerFrameSize; // length of the sound frame we capture in ms(typically 20ms)
-
-		void initAudioRtpSession(void);
-		/**
- 		 * Get the data from the mic, encode it and send it through the RTP session
- 		 */ 		 	
-		void sendSessionFromMic(int);
-		/**
- 		 * Get the data from the RTP packets, decode it and send it to the sound card
- 		 */		 	
-		void receiveSessionForSpkr(int&);
-		/**
- 		 * Init the buffers used for processing sound data
- 		 */ 
-		void initBuffers(void);
-		/**
- 		 * Call the appropriate function, up or downsampling
- 		 */ 
-		int reSampleData(int, int ,int);
-		/**
- 		 * Upsample the data from the clock rate of the codec to the sample rate of the layer
- 		 * @param int The clock rate of the codec
- 		 * @param int The number of samples we have in the buffer
- 		 * @return int The number of samples after the operation
- 		 */
-		int upSampleData(int, int);
-		/**
- 		 * Downsample the data from the sample rate of the layer to the clock rate of the codec
- 		 *  @param int The clock rate of the codec
- 		 *  @param int The number of samples we have in the buffer 
- 		 *  @return int The number of samples after the operation
- 		 */
-		int downSampleData(int, int);
-
-		AudioCodec* _audiocodec;	
+  public:
+    /**
+     * Constructor
+     * @param sipcall The pointer on the SIP call
+     * @param sym     Tells whether or not the voip links are symmetric
+     */
+    AudioRtpRTX (SIPCall* sipcall, bool sym);
+
+    /**
+     * Destructor
+     */
+    ~AudioRtpRTX();
+
+    /** For incoming call notification */ 
+    ost::Time *time;
+
+    /** Thread associated method */    
+    virtual void run ();
+
+  private:
+    /** A SIP call */
+    SIPCall* _ca;
+
+    /** RTP session to send data */
+    ost::RTPSession *_sessionSend;
+    
+    /** RTP session to receive data */
+    ost::RTPSession *_sessionRecv;
+
+    /** RTP symmetric session ( receive and send data in the same session ) */
+    ost::SymmetricRTPSession *_session;
+
+    /** Semaphore */
+    ost::Semaphore _start;
+
+    /** Is the session symmetric or not */
+    bool _sym;
+
+    /** When we receive data, we decode it inside this buffer */
+    int16* _receiveDataDecoded;
+
+    /** Buffers used for send data from the mic */
+    unsigned char* _sendDataEncoded;
+    
+    /** Downsampled int16 buffer */
+    int16* _intBufferDown;
+
+    /** After that we send the data inside this buffer if there is a format conversion or rate conversion */
+    /** Also use for getting mic-ringbuffer data */
+    SFLDataFormat* _dataAudioLayer;
+
+    /** Downsampled float buffer */
+    float32* _floatBufferDown;
+
+    /** Upsampled float buffer */
+    float32* _floatBufferUp;
+
+    /** libsamplerate converter for incoming voice */
+    SRC_STATE*    _src_state_spkr;
+
+    /** libsamplerate converter for outgoing voice */
+    SRC_STATE*    _src_state_mic;
+
+    /** libsamplerate error */
+    int _src_err;
+
+    /** Variables to process audio stream: sample rate for playing sound (typically 44100HZ) */
+    int _layerSampleRate;  
+
+    /** Sample rate of the codec we use to encode and decode (most of time 8000HZ) */
+    int _codecSampleRate; 
+
+    /** Length of the sound frame we capture in ms(typically 20ms) */
+    int _layerFrameSize; 
+
+    /**
+     * Init the RTP session. Create either symmetric or double sessions to manage data transport
+     * Set the payloads according to the manager preferences
+     */
+    void initAudioRtpSession(void);
+    
+    /**
+     * Get the data from the mic, encode it and send it through the RTP session
+     * @param timestamp	To manage time and synchronizing
+     */ 		 	
+    void sendSessionFromMic(int timestamp);
+    
+    /**
+     * Get the data from the RTP packets, decode it and send it to the sound card
+     * @param countTime	To manage time and synchronizing
+     */		 	
+    void receiveSessionForSpkr(int& countTime);
+
+    /**
+     * Init the buffers used for processing sound data
+     */ 
+    void initBuffers(void);
+
+    /**
+     * Call the appropriate function, up or downsampling
+     * @param sampleRate_codec	The sample rate of the codec selected to encode/decode the data
+     * @param nbSamples		Number of samples to process
+     * @param status  Type of resampling
+     *		      UPSAMPLING
+     *		      DOWNSAMPLING
+     * @return int The number of samples after process
+     */ 
+    int reSampleData(int sampleRate_codec, int nbSamples, int status);
+    
+    /**
+     * Upsample the data from the clock rate of the codec to the sample rate of the layer
+     * @param sampleRate_codec	The sample rate of the codec selected to encode/decode the data
+     * @param nbSamples		Number of samples to process
+     * @return int The number of samples after process
+     */
+    int upSampleData(int sampleRate_codec, int nbSamples);
+    
+    /**
+     * Downsample the data from the sample rate of the layer to the clock rate of the codec
+     * @param sampleRate_codec	The sample rate of the codec selected to encode/decode the data
+     * @param nbSamples		Number of samples to process
+     * @return int The number of samples after process
+     */
+    int downSampleData(int sampleRate_codec, int nbSamples);
+
+    /** The audio codec used during the session */
+    AudioCodec* _audiocodec;	
 };
 
 ///////////////////////////////////////////////////////////////////////////////
 // Main class rtp
 ///////////////////////////////////////////////////////////////////////////////
 class AudioRtp {
-	public:
-		AudioRtp();
-		~AudioRtp();
-
-		int 			createNewSession (SIPCall *);
-		void			closeRtpSession	 ();
-
-	private:
-		AudioRtpRTX*	        _RTXThread;
-		bool			_symmetric;
-		ost::Mutex            _threadMutex;
+  public:
+    /**
+     * Constructor
+     */
+    AudioRtp();
+    
+    /**
+     * Destructor
+     */
+    ~AudioRtp();
+
+    /**
+     * Create a brand new RTP session by calling the AudioRtpRTX constructor
+     * @param ca A pointer on a SIP call
+     */
+    int createNewSession (SIPCall *ca);
+    
+    /**
+     * Close a RTP session and kills the remaining threads
+     */
+    void closeRtpSession( void );
+
+  private:
+    /** The RTP thread */
+    AudioRtpRTX* _RTXThread;
+    
+    /** Symmetric session or not */
+    bool _symmetric;
+
+    /** Mutex */
+    ost::Mutex _threadMutex;
 };
 
 #endif // __AUDIO_RTP_H__
diff --git a/src/audio/codecDescriptor.cpp b/src/audio/codecDescriptor.cpp
index 6ff16d5c86680cd639a2c879db8cebebaf879d32..ba6ca1e681b1219f2f61895335ac53766cb76a7a 100644
--- a/src/audio/codecDescriptor.cpp
+++ b/src/audio/codecDescriptor.cpp
@@ -26,10 +26,6 @@
 
 CodecDescriptor::CodecDescriptor() 
 {
-  //init();
-  //#ifdef HAVE_SPEEX
-  //_codecMap[PAYLOAD_CODEC_SPEEX] = new CodecSpeex(PAYLOAD_CODEC_SPEEX); // TODO: this is a variable payload!
-  //#endif
 }
 
 CodecDescriptor::~CodecDescriptor()
@@ -54,7 +50,6 @@ CodecDescriptor::init()
   _nbCodecs = CodecDynamicList.size();
   if( _nbCodecs <= 0 ){
     _debug(" Error - No codecs available in directory %s\n" , CODECS_DIR);
-    //exit(0);
   }
 
   int i;
diff --git a/src/audio/codecDescriptor.h b/src/audio/codecDescriptor.h
index fd5775fa8d52fb7392b60ca5753b4bfa2a9d009a..92093cd32ee33034df0870e43476233f8d463ea6 100644
--- a/src/audio/codecDescriptor.h
+++ b/src/audio/codecDescriptor.h
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2004-2005 Savoir-Faire Linux inc.
+ *  Copyright (C) 2004-2008 Savoir-Faire Linux inc.
  *  Author: Yan Morin <yan.morin@savoirfairelinux.com>
  *  Author: Laurielle Lea <laurielle.lea@savoirfairelinux.com>
  *  Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com>
@@ -19,37 +19,36 @@
  *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-
 #ifndef __CODEC_DESCRIPTOR_H__
 #define __CODEC_DESCRIPTOR_H__
 
 #include <string>
 #include <map>
 #include <vector>
-// To read directories content
 #include <dirent.h>
 
 #include "../global.h"
 #include "../user_cfg.h"
 #include "codecs/audiocodec.h"
 
+/** Enumeration that contains known audio payloads */
 typedef enum {
-// http://www.iana.org/assignments/rtp-parameters
-// http://www.gnu.org/software/ccrtp/doc/refman/html/formats_8h.html#a0
-// 0 PCMU A 8000 1 [RFC3551]
+  // http://www.iana.org/assignments/rtp-parameters
+  // http://www.gnu.org/software/ccrtp/doc/refman/html/formats_8h.html#a0
+  // 0 PCMU A 8000 1 [RFC3551]
   PAYLOAD_CODEC_ULAW = 0, 
-// 3 GSM  A 8000 1 [RFC3551]
+  // 3 GSM  A 8000 1 [RFC3551]
   PAYLOAD_CODEC_GSM = 3,
-// 8 PCMA A 8000 1 [RFC3551]
+  // 8 PCMA A 8000 1 [RFC3551]
   PAYLOAD_CODEC_ALAW = 8,
-// http://www.ietf.org/rfc/rfc3952.txt
-// 97 iLBC/8000
+  // http://www.ietf.org/rfc/rfc3952.txt
+  // 97 iLBC/8000
   PAYLOAD_CODEC_ILBC_20 = 97,
   PAYLOAD_CODEC_ILBC_30 = 98,
-// http://www.speex.org/drafts/draft-herlein-speex-rtp-profile-00.txt
-//  97 speex/8000
-// http://support.xten.com/viewtopic.php?p=8684&sid=3367a83d01fdcad16c7459a79859b08e
-// 100 speex/16000
+  // http://www.speex.org/drafts/draft-herlein-speex-rtp-profile-00.txt
+  //  97 speex/8000
+  // http://support.xten.com/viewtopic.php?p=8684&sid=3367a83d01fdcad16c7459a79859b08e
+  // 100 speex/16000
   PAYLOAD_CODEC_SPEEX_8000 = 110,
   PAYLOAD_CODEC_SPEEX_16000 = 111,
   PAYLOAD_CODEC_SPEEX_32000 = 112
@@ -61,200 +60,212 @@ typedef enum {
 typedef std::map<AudioCodecType, std::string> CodecMap;
 /** The struct to reflect the order the user wants to use the codecs */
 typedef std::vector<AudioCodecType> CodecOrder;
-
+/** Enable us to keep the handle pointer on the codec dynamicaly loaded so that we could destroy when we dont need it anymore */
 typedef std::pair<AudioCodec* , void*> CodecHandlePointer;
+/** Maps a pointer on an audiocodec object to a payload */
 typedef std::map<AudioCodecType , AudioCodec*> CodecsMap;
 
-class CodecDescriptor {
-public:
-  /**
-   * Initialize all codec 
-   */
-  CodecDescriptor();
-  ~CodecDescriptor(); 
-
-  /**
-   * Accessor to data structures
-   */
-  CodecsMap& getCodecsMap() { return _CodecsMap; }
-  CodecOrder& getActiveCodecs() { return _codecOrder; }
-
-  /**
-   * Get codec name by its payload
-   * @param payload the payload looked for
-   *                same as getPayload()
-   * @return the name of the codec
-   */
-  std::string getCodecName(AudioCodecType payload);
-  
-  /**
-   * Get the codec object associated with the payload
-   * @param payload The payload looked for
-   * @return AudioCodec* A pointer on a AudioCodec object
-   */
-  AudioCodec* getCodec( AudioCodecType payload );
-
-  /**
-   * Initialiaze the map with all the supported codecs, even those inactive
-   */  
-  void init();
-
-  /**
-   * Set the default codecs order
-   */   
-  void setDefaultOrder();
-  
-  /**
-   * Check in the map codec if the specified codec is supported 
-   * @param payload unique identifier of a codec (RFC)
-   * @return true if the codec specified is supported
-   * 	     false otherwise
-   */
-  bool isActive(AudioCodecType payload);
-
- /**
-  * Remove the codec with payload payload from the list
-  * @param payload the codec to erase
-  */ 
-  void removeCodec(AudioCodecType payload);
-
- /**
-  * Add a codec in the list.
-  * @param payload the codec to add
-  */
-  void addCodec(AudioCodecType payload);
-
- /**
-  * Get the bit rate of the specified codec.
-  * @param payload The payload of the codec
-  * @return double The bit rate 
-  */  
-  double getBitRate(AudioCodecType payload);
-
- /**
-  * Get the bandwidth for one call with the specified codec.
-  * The value has been calculated with the further information:
-  * RTp communication, SIP protocol (the value with IAX2 is very close), no RTCP, one simultaneous call, for one channel (the incoming one).
-  * @param payload The payload of the codec 
-  * @return double The bandwidth
-  */
-  double getBandwidthPerCall(AudioCodecType payload);
-
-
- /**
-  * Get the clock rate of the specified codec
-  * @param payload The payload of the codec
-  * @return int The clock rate of the specified codec
-  */
-  int getSampleRate(AudioCodecType payload);
-
-  /**
-   * Get the number of channels
-   * @param payload The payload of the codec
-   * @return int  Number of channels
-   */
-  int getChannel(AudioCodecType payload);
-
-/**
- * Set the order of codecs by their payload
- * @param list The ordered list sent by DBus
+/*
+ * @file codecdescriptor.h
+ * @brief Handle audio codecs, load them in memory
  */
-  void saveActiveCodecs(const std::vector<std::string>& list);
- 
-
-  std::string getDescription( std::string );
-  /**
-   * Get the number of codecs loaded in dynamic memory
-   */
-  int getCodecsNumber( void ) { return _nbCodecs; }
-  
-  /**
-   * Unreferences the codecs loaded in memory
-   */
-  void deleteHandlePointer( void );
-  
-  /**
-   * Get the first element of the CodecsMap struct. 
-   * i.e the one with the lowest payload
-   * @return AudioCodec	The pointer on the codec object
-   */
-  AudioCodec* getFirstCodecAvailable( void );
-
-private:
-
-  /**
-   * Scan the installation directory ( --prefix configure option )
-   * And load the dynamic library 
-   * @return std::vector<AudioCodec*> The list of the codec object successfully loaded in memory
-   */
-  std::vector<AudioCodec *> scanCodecDirectory( void ); 
-  
-  /**
-   * Load a codec
-   * @param std::string	The path of the shared ( dynamic ) library.
-   * @return AudioCodec*  the pointer of the object loaded.
-   */
-  AudioCodec* loadCodec( std::string );
-  
-  /**
-   * Unload a codec
-   * @param CodecHandlePointer	The map containing the pointer on the object and the pointer on the handle function
-   */
-  void unloadCodec( CodecHandlePointer );
-
-  /**
-   * Check if the files found in searched directories seems valid
-   * @param std::string	The name of the file
-   * @return true if the file name begins with libcodec_ and ends with .so
-   *	     false otherwise
-   */
-  bool seemsValid( std::string );
-
-  /**
-   * Check if the codecs shared library has already been scanned during the session
-   * Useful not to load twice the same codec saved in the different directory
-   * @param std::string	The complete name of the shared directory ( without the path )
-   * @return true if the codecs has been scanned
-   *	    false otherwise
-   */
-  bool alreadyInCache( std::string );
-  
-  /**
-   *  Check if the audiocodec object has been successfully created
-   *  @param payload  The payload of the codec
-   *  @return true if the audiocodec has been created
-   *	      false otherwise
-   */
-  bool isCodecLoaded( int payload );
-  
-  /**
-   * Map the payload of a codec and the object associated ( AudioCodec * )
-   */
-  CodecsMap _CodecsMap;
-  
-  /**
-   * Vector containing the order of the codecs
-   */
-  CodecOrder _codecOrder;
-  
-  /**
-   * Vector containing the complete name of the codec shared library scanned
-   */
-  std::vector<std::string> _Cache;
-
-  /**
-   * Number of codecs loaded
-   */
-  int _nbCodecs;
-  
-  /**
-   * Vector containing pairs
-   * Pair between pointer on function handle and pointer on audiocodec object
-   */
-  std::vector< CodecHandlePointer > _CodecInMemory;
 
+class CodecDescriptor {
+  public:
+    /**
+     * Constructor 
+     */
+    CodecDescriptor();
+
+    /**
+     * Destructor 
+     */
+    ~CodecDescriptor(); 
+
+    /**
+     * Accessor to data structures
+     * @return CodecsMap& The available codec
+     */
+    CodecsMap& getCodecsMap() { return _CodecsMap; }
+
+    /**
+     * Accessor to data structures
+     * @return CodecOrder& The list that reflects the user's choice
+     */
+    CodecOrder& getActiveCodecs() { return _codecOrder; }
+
+    /**
+     * Get codec name by its payload
+     * @param payload the payload looked for
+     *                same as getPayload()
+     * @return std::string  The name of the codec
+     */
+    std::string getCodecName(AudioCodecType payload);
+
+    /**
+     * Get the codec object associated with the payload
+     * @param payload The payload looked for
+     * @return AudioCodec* A pointer on a AudioCodec object
+     */
+    AudioCodec* getCodec( AudioCodecType payload );
+
+    /**
+     * Initialiaze the map with all the supported codecs, even those inactive
+     */  
+    void init();
+
+    /**
+     * Set the default codecs order
+     */   
+    void setDefaultOrder();
+
+    /**
+     * Check in the map codec if the specified codec is supported 
+     * @param payload unique identifier of a codec (RFC)
+     * @return bool True if the codec specified is supported
+     *		  false otherwise
+     */
+    bool isActive(AudioCodecType payload);
+
+    /**
+     * Remove the codec with payload payload from the list
+     * @param payload the codec to erase
+     */ 
+    void removeCodec(AudioCodecType payload);
+
+    /**
+     * Add a codec in the list.
+     * @param payload the codec to add
+     */
+    void addCodec(AudioCodecType payload);
+
+    /**
+     * Get the bit rate of the specified codec.
+     * @param payload The payload of the codec
+     * @return double The bit rate 
+     */  
+    double getBitRate(AudioCodecType payload);
+
+    /**
+     * Get the bandwidth for one call with the specified codec.
+     * The value has been calculated with the further information:
+     * RTp communication, SIP protocol (the value with IAX2 is very close), no RTCP, one simultaneous call, for one channel (the incoming one).
+     * @param payload The payload of the codec 
+     * @return double The bandwidth
+     */
+    double getBandwidthPerCall(AudioCodecType payload);
 
-};
 
+    /**
+     * Get the clock rate of the specified codec
+     * @param payload The payload of the codec
+     * @return int The clock rate of the specified codec
+     */
+    int getSampleRate(AudioCodecType payload);
+
+    /**
+     * Get the number of channels
+     * @param payload The payload of the codec
+     * @return int  Number of channels
+     */
+    int getChannel(AudioCodecType payload);
+
+    /**
+     * Set the order of codecs by their payload
+     * @param list The ordered list sent by DBus
+     */
+    void saveActiveCodecs(const std::vector<std::string>& list);
+
+    /**
+     * Get the number of codecs loaded in dynamic memory
+     * @return int The number
+     */
+    int getCodecsNumber( void ) { return _nbCodecs; }
+
+    /**
+     * Unreferences the codecs loaded in memory
+     */
+    void deleteHandlePointer( void );
+
+    /**
+     * Get the first element of the CodecsMap struct. 
+     * i.e the one with the lowest payload
+     * @return AudioCodec	The pointer on the codec object
+     */
+    AudioCodec* getFirstCodecAvailable( void );
+
+  private:
+
+    /**
+     * Scan the installation directory ( --prefix configure option )
+     * And load the dynamic library 
+     * @return std::vector<AudioCodec*> The list of the codec object successfully loaded in memory
+     */
+    std::vector<AudioCodec *> scanCodecDirectory( void ); 
+
+    /**
+     * Load a codec
+     * @param std::string	The path of the shared ( dynamic ) library.
+     * @return AudioCodec*  the pointer of the object loaded.
+     */
+    AudioCodec* loadCodec( std::string );
+
+    /**
+     * Unload a codec
+     * @param CodecHandlePointer	The map containing the pointer on the object and the pointer on the handle function
+     */
+    void unloadCodec( CodecHandlePointer );
+
+    /**
+     * Check if the files found in searched directories seems valid
+     * @param std::string	The name of the file
+     * @return bool True if the file name begins with libcodec_ and ends with .so
+     *		false otherwise
+     */
+    bool seemsValid( std::string );
+
+    /**
+     * Check if the codecs shared library has already been scanned during the session
+     * Useful not to load twice the same codec saved in the different directory
+     * @param std::string	The complete name of the shared directory ( without the path )
+     * @return bool True if the codecs has been scanned
+     *	    false otherwise
+     */
+    bool alreadyInCache( std::string );
+
+    /**
+     *  Check if the audiocodec object has been successfully created
+     *  @param payload  The payload of the codec
+     *  @return bool  True if the audiocodec has been created
+     *		false otherwise
+     */
+    bool isCodecLoaded( int payload );
+
+    /**
+     * Map the payload of a codec and the object associated ( AudioCodec * )
+     */
+    CodecsMap _CodecsMap;
+
+    /**
+     * Vector containing the order of the codecs
+     */
+    CodecOrder _codecOrder;
+
+    /**
+     * Vector containing the complete name of the codec shared library scanned
+     */
+    std::vector<std::string> _Cache;
+
+    /**
+     * Number of codecs loaded
+     */
+    int _nbCodecs;
+
+    /**
+     * Vector containing pairs
+     * Pair between pointer on function handle and pointer on audiocodec object
+     */
+    std::vector< CodecHandlePointer > _CodecInMemory;
+};
 
 #endif // __CODEC_DESCRIPTOR_H__
diff --git a/src/audio/common.h b/src/audio/common.h
index fb2cb85c834069230c1f350bb2ed82047d00146e..5be3d28e17ef2af2cf2548cc4d4d037e0436f953 100644
--- a/src/audio/common.h
+++ b/src/audio/common.h
@@ -41,12 +41,10 @@ typedef signed short   int16;	/**< An 16 bit signed integer (2s complement) */
 typedef signed int     int32;	/**< An 32 bit signed integer (2s complement) */
 typedef unsigned int   uint;	/**< An unsigned integer or at least 32 bits */
 
-
 #ifndef NULL
 #define NULL 0		/**< Used to represent a null pointer type */
 #endif
 
-
 #ifdef _MSC_VER		// Compiling for Microsoft Visual C++
 
 #define DEBUGGER	{ _asm int 3 }			/**< Invoke debugger */
@@ -59,17 +57,13 @@ typedef unsigned int   uint;	/**< An unsigned integer or at least 32 bits */
 #define DEBUGGER							/**< Invoke debugger */
 #define IMPORT								/**< Mark a function which is to be imported from a DLL */
 #define EXPORT								/**< Mark a function to be exported from a DLL */
-//#define ASSERT(c)							/**< Assert that expression 'c' is true */
 
 #endif
 
-
 #ifdef DEBUG
 #define ASSERT_DEBUG(c) ASSERT(c)	/**< Assert that expression 'c' is true (when compiled for debugging)*/
 #else
 #define ASSERT_DEBUG(c)
 #endif
 
-
 #endif
-
diff --git a/src/audio/dtmf.h b/src/audio/dtmf.h
index b3713eadd050fbd404c279779ed55dc377a1a61c..a456975178ec217a44ee278af20f687ed55831f1 100644
--- a/src/audio/dtmf.h
+++ b/src/audio/dtmf.h
@@ -28,29 +28,39 @@
 #include "dtmfgenerator.h"
 
 /**
- * DMTF library to generate a dtmf sample
+ * @file dtmf.h
+ * @brief DMTF library to generate a dtmf sample
  */
 class DTMF {
-public:
-       /**
-        * Create a new DTMF.
-        * @param samplingRate frequency of the sample (ex: 8000 hz)
-        */
-	DTMF (unsigned int sampleRate);
-	~DTMF (void);
-	
-	void startTone		(char);
-	/**
-	 * Copy the sound inside the sampling* buffer 
-	 * @param buffer : a SFLDataFormat* buffer
-	 * @param n      : 
-	 */
-	bool generateDTMF	(SFLDataFormat* buffer, size_t n);
+  public:
+    /**
+     * Create a new DTMF.
+     * @param sampleRate frequency of the sample (ex: 8000 hz)
+     */
+    DTMF (unsigned int sampleRate);
+    
+   /**
+    * Destructor
+    */ 
+    ~DTMF (void);
 
-	char currentTone;
-	char newTone;
+    /**
+     * Start the done for th given dtmf
+     * @param code  The DTMF code
+     */
+    void startTone(char code);
+    
+    /**
+     * Copy the sound inside the sampling* buffer 
+     * @param buffer : a SFLDataFormat* buffer
+     * @param n      : The size to generate
+     */
+    bool generateDTMF	(SFLDataFormat* buffer, size_t n);
 
-	DTMFGenerator dtmfgenerator;
+    char currentTone;
+    char newTone;
+
+    DTMFGenerator dtmfgenerator;
 };
 
 #endif // __KEY_DTMF_H_
diff --git a/src/audio/dtmfgenerator.h b/src/audio/dtmfgenerator.h
index 71b25852e513112f270142914b908f185e8df009..376d31ce82b6b93ec974127b4f1c2edb87f7c4e2 100644
--- a/src/audio/dtmfgenerator.h
+++ b/src/audio/dtmfgenerator.h
@@ -28,85 +28,108 @@
 #include <exception>
 #include <string.h>
 
-//#include "tonegenerator.h"
 #include "tone.h"
 
 #define NUM_TONES 16
 
 /*
- * DMTF Generator Exception
+ * @file dtmfgenerator.h
+ * @brief DMTF Generator Exception
  */
 class DTMFException : public std::exception
 {
-private:
-	const char* reason;
-public:
-	DTMFException(const char* _reason) throw();
-	virtual ~DTMFException() throw();
-	virtual const char* what() const throw();
+  private:
+    /** Message */
+    const char* reason;
+  public:
+    /**
+     * Constructor
+     * @param _reason An error message
+     */
+    DTMFException(const char* _reason) throw();
+
+    /**
+     * Destructor
+     */
+    virtual ~DTMFException() throw();
+
+    /**
+     * @return const char* The error
+     */
+    virtual const char* what() const throw();
 };
 
-
 /*
- * DTMF Tone Generator
+ * @file dtmfgenerator.h
+ * @brief DTMF Tone Generator
  */
 class DTMFGenerator 
 {
-private:
-	struct DTMFTone {
-		unsigned char code; // Code of the tone
-		int lower;          // Lower frequency
-		int higher;         // Higher frequency
-	};
-
-/*
- * State of the DTMF generator
- */
-	struct DTMFState {
-		unsigned int offset;   // Offset in the sample currently being played
-		SFLDataFormat* sample;         // Currently generated code
-	};
-
-	DTMFState state;
-	static const DTMFTone tones[NUM_TONES];
-
-	SFLDataFormat* samples[NUM_TONES];        // Generated samples
-
-  /**
-   * Sampling rate of generated dtmf
-   */
-  int _sampleRate;
-  Tone tone;
-
-public:
-  /**
-   * DTMF Generator contains frequency of each keys
-   * and can build one DTMF.
-   * @param sampleRate frequency of the sample (ex: 8000 hz)
-   */
-	DTMFGenerator(unsigned int sampleRate);
-	~DTMFGenerator();
-
-/*
- * Get n samples of the signal of code code
- * @param buffer a SFLDataFormat pointer to an allocated buffer
- * @param n      number of sampling to get, should be lower or equal to buffer size
- * @parma code   dtmf code to get sound
- */
-	void getSamples(SFLDataFormat* buffer, size_t n, unsigned char code) throw (DTMFException);
-
-/*
- * Get next n samples (continues where previous call to
- * genSample or genNextSamples stopped
- * @param buffer a SFLDataFormat pointer to an allocated buffer 
- * @param n      number of sampling to get, should be lower or equal to buffer size
- */
-	void getNextSamples(SFLDataFormat* buffer, size_t n) throw (DTMFException);
-
-private:
-	SFLDataFormat* generateSample(unsigned char code) throw (DTMFException);
-
+  private:
+    /** Struct to handle a DTMF */
+    struct DTMFTone {
+      unsigned char code; /** Code of the tone */
+      int lower;          /** Lower frequency */
+      int higher;         /** Higher frequency */
+    };
+
+     /** State of the DTMF generator */
+    struct DTMFState {
+      unsigned int offset;   /** Offset in the sample currently being played */
+      SFLDataFormat* sample;         /** Currently generated code */
+    };
+
+    /** State of the DTMF generator */
+    DTMFState state;
+    
+    /** The different kind of tones */
+    static const DTMFTone tones[NUM_TONES];
+
+    /** Generated samples */
+    SFLDataFormat* samples[NUM_TONES];  
+
+    /** Sampling rate of generated dtmf */
+    int _sampleRate;
+
+    /** A tone object */
+    Tone tone;
+
+  public:
+    /**
+     * DTMF Generator contains frequency of each keys
+     * and can build one DTMF.
+     * @param sampleRate frequency of the sample (ex: 8000 hz)
+     */
+    DTMFGenerator(unsigned int sampleRate);
+    
+    /**
+     * Destructor
+     */
+    ~DTMFGenerator();
+
+    /*
+     * Get n samples of the signal of code code
+     * @param buffer a SFLDataFormat pointer to an allocated buffer
+     * @param n      number of sampling to get, should be lower or equal to buffer size
+     * @param code   dtmf code to get sound
+     */
+    void getSamples(SFLDataFormat* buffer, size_t n, unsigned char code) throw (DTMFException);
+
+    /*
+     * Get next n samples (continues where previous call to
+     * genSample or genNextSamples stopped
+     * @param buffer a SFLDataFormat pointer to an allocated buffer 
+     * @param n      number of sampling to get, should be lower or equal to buffer size
+     */
+    void getNextSamples(SFLDataFormat* buffer, size_t n) throw (DTMFException);
+
+  private:
+    /**
+     * Generate samples for a specific dtmf code
+     * @param code The code
+     * @return SFLDataFormat* The generated data
+     */
+    SFLDataFormat* generateSample(unsigned char code) throw (DTMFException);
 };
 
-
 #endif // DTMFGENERATOR_H
diff --git a/src/audio/ringbuffer.h b/src/audio/ringbuffer.h
index 1a06c8e723b849af13784ed60e59a8efd60efc5e..b6ae54473a8e3db2d8f44f83bb1fba48c4fba3a0 100644
--- a/src/audio/ringbuffer.h
+++ b/src/audio/ringbuffer.h
@@ -26,40 +26,81 @@
 typedef unsigned char* samplePtr;
 
 class RingBuffer {
- public:
-   RingBuffer(int size);
-   ~RingBuffer();
+  public:
+    /**
+     * Constructor
+     * @param size  Size of the buffer to create
+     */
+    RingBuffer(int size);
 
-   // To set counters to 0
-   void flush (void);
-   
-   //
-   // For the writer only:
-   //
-   int AvailForPut (void) const;
-   int Put (void*, int, unsigned short volume = 100);
+    /**
+     * Destructor
+     */
+    ~RingBuffer();
 
-   //
-   // For the reader only:
-   //
-   int AvailForGet (void) const;
-   int Get (void *, int, unsigned short volume = 100);
-   int Discard(int);
+    /**
+     * Reset the counters to 0
+     */
+    void flush (void);
 
-   int Len() const;
-   /**
-    * Debug function print mEnd, mStart, mBufferSize
-    */
-   void debug();
-   
- private:
+    /**
+     * To get how much space is available in the buffer to write in
+     * @return int The available size
+     */
+    int AvailForPut (void) const;
 
-   int           mStart;
-   int           mEnd;
-   int           mBufferSize;
-   samplePtr     mBuffer;
-};
+    /**
+     * Write data in the ring buffer
+     * @param buffer Data to copied
+     * @param toCopy Number of bytes to copy
+     * @param volume The volume
+     * @return int Number of bytes copied
+     */
+    int Put (void* buffer, int toCopy, unsigned short volume = 100);
 
-#endif /*  __RING_BUFFER__ */
+    /**
+     * To get how much space is available in the buffer to read in
+     * @return int The available size
+     */
+    int AvailForGet (void) const;
+
+    /**
+     * Get data in the ring buffer
+     * @param buffer Data to copied
+     * @param toCopy Number of bytes to copy
+     * @param volume The volume
+     * @return int Number of bytes copied
+     */
+    int Get (void* buffer, int toCopy, unsigned short volume = 100);
+
+    /**
+     * Discard data from the buffer
+     * @param toDiscard Number of bytes to discard
+     * @return int Number of bytes discarded 
+     */
+    int Discard(int toDiscard);
 
+    /**
+     * Total length of the ring buffer
+     * @return int  
+     */
+    int Len() const;
+    
+    /**
+     * Debug function print mEnd, mStart, mBufferSize
+     */
+    void debug();
 
+  private:
+
+    /** Pointer on the first data */
+    int           mStart;
+    /** Pointer on the last data */
+    int           mEnd;
+    /** Buffer size */
+    int           mBufferSize;
+    /** Data */
+    samplePtr     mBuffer;
+};
+
+#endif /*  __RING_BUFFER__ */
diff --git a/src/audio/tone.h b/src/audio/tone.h
index a9de7a3d34fd351edab86ce735cd3c34e97582c3..e75a865e7d2fd45287514e892c144f3565fe0181 100644
--- a/src/audio/tone.h
+++ b/src/audio/tone.h
@@ -29,17 +29,24 @@
 #define TONE_NBCOUNTRY 7
 
 /**
- * Tone sample (dial, busy, ring, congestion)
- * @author Yan Morin <yan.morin@savoirfairelinux.com>
+ * @file tone.h
+ * @brief Tone sample (dial, busy, ring, congestion)
  */
 class Tone : public AudioLoop {
 public:
   /**
+   * Constructor
    * @param definition String that contain frequency/time of the tone
    * @param sampleRate SampleRating of audio tone
    */
   Tone(const std::string& definition, unsigned int sampleRate);
+  
+  /**
+   * Destructor 
+   */
   ~Tone();
+
+  /** The different kind of tones */
   enum TONEID {
     TONE_DIALTONE = 0,
     TONE_BUSY,
@@ -47,8 +54,12 @@ public:
     TONE_CONGESTION,
     TONE_NULL
   };
+
   /**
-   * add a simple or double sin to the buffer, it double the sin in stereo 
+   * Add a simple or double sin to the buffer, it double the sin in stereo 
+   * @param buffer  The data
+   * @param frequency1 The first frequency
+   * @param frequency2	The second frequency
    * @param nb are the number of int16 (mono) to generate
    * by example nb=5 generate 10 int16, 5 for the left, 5 for the right
    */
@@ -58,9 +69,11 @@ private:
 
   /**
    * allocate the memory with the definition
+   * @param definition String that contain frequency/time of the tone.
    */
   void genBuffer(const std::string& definition);
 
+  /** Sample rate */
   unsigned int _sampleRate;
 };
 
diff --git a/src/audio/tonegenerator.cpp b/src/audio/tonegenerator.cpp
index 2ef0ac0b276bcce60700e3c3a3fdda5d6f2ceb53..37cfd1eaaab1def74be072e130876ce41b129873 100644
--- a/src/audio/tonegenerator.cpp
+++ b/src/audio/tonegenerator.cpp
@@ -41,9 +41,6 @@ ToneGenerator::~ToneGenerator (void) {
 /**
  * Calculate superposition of 2 sinus 
  *
- * @param	lower frequency
- * @param	higher frequency
- * @param	ptr for result buffer
  */
 void
 ToneGenerator::generateSin (int lowerfreq, int higherfreq, int16* ptr, int len) const {
diff --git a/src/audio/tonegenerator.h b/src/audio/tonegenerator.h
index b649398378e4d31b6d33b51e8872ead688e45c7b..062caebd518387c129a363a70702ce454331e764 100644
--- a/src/audio/tonegenerator.h
+++ b/src/audio/tonegenerator.h
@@ -27,35 +27,49 @@
 #include "../global.h"
 
 /**
- * Sine generator to create tone with string definition
+ * @file tonegenerator.h
+ * @brief Sine generator to create tone with string definition
  */
+
 class ToneGenerator {
-public:
-	ToneGenerator (unsigned int sampleRate);
-	~ToneGenerator (void);
-	
-	/**
-	 * Calculate sinus with superposition of 2 frequencies
-	 */
-	void generateSin	(int, int, int16 *, int len) const;
-
-
-	///////////////////////////
-	// Public members variable
-	//////////////////////////
-	int16 *sample;
-	int freq1, freq2;
-	int time;
-	int totalbytes;
-	
-private:
-	/*
-	 * Initialisation of the supported tones according to the countries.
-	 */
-	void		initTone (void);
-
-	int16 _buf[SIZEBUF];
-  int _sampleRate;
+  public:
+    /**
+     * Constructor
+     * @param sampleRate  The sample rate of the generated samples
+     */
+    ToneGenerator (unsigned int sampleRate);
+    
+    /**
+     * Destructor
+     */
+    ~ToneGenerator (void);
+
+    /**
+     * Calculate sinus with superposition of 2 frequencies
+     * @param lowerfreq	Lower frequency
+     * @param higherfreq  Higher frequency
+     * @param ptr For result buffer
+     * @param len The length of the data to be generated
+     */
+    void generateSin	(int, int, int16 *, int len) const;
+
+
+    ///////////////////////////
+    // Public members variable
+    //////////////////////////
+    int16 *sample;
+    int freq1, freq2;
+    int time;
+    int totalbytes;
+
+  private:
+    /*
+     * Initialisation of the supported tones according to the countries.
+     */
+    void		initTone (void);
+
+    int16 _buf[SIZEBUF];
+    int _sampleRate;
 };
 
 #endif // __TONE_GENRATOR_H__
diff --git a/src/audio/tonelist.h b/src/audio/tonelist.h
index 20d681ccac17a4f4b59f8dc2bd6d3103a2151ce1..a381193c025b9d4cad54a4a527bbdc84c34397ed 100644
--- a/src/audio/tonelist.h
+++ b/src/audio/tonelist.h
@@ -25,13 +25,22 @@
 #include "tone.h"
 
 /**
- * @author Yan Morin <yan.morin@savoirfairelinux.com>
+ * @file tonelist.h
+ * @brief Manages the different kind of tones according to the country
  */
 class ToneList {
 public:
+  /**
+   * Constructor
+   */
   ToneList();
+
+  /**
+   * Destructor
+   */
   ~ToneList();
 
+  /** Countries */ 
   enum COUNTRYID {
     ZID_NORTH_AMERICA = 0,
     ZID_FRANCE,
@@ -43,22 +52,26 @@ public:
   };
 
   /**
-    * get the string definition of a tone
+    * Get the string definition of a tone
     * return the default country or default tone if id are invalid
-    * @param country the country Id, see ToneList constructor for the list
-    * @param toneId  toneId
-    * @return a string definition of the tone
+    * @param countryId	The country Id, see ToneList constructor for the list
+    * @param toneId  The toneId
+    * @return std::string A string definition of the tone
     */
   std::string getDefinition(COUNTRYID countryId, Tone::TONEID toneId);
+
   /**
-   * get the country id associate to a country name
+   * Get the country id associate to a country name
    * return the default country id if not found
    * The default tone/country are set inside the ToneList constructor
    * @param countryName countryName, see the ToneList constructor list
-   * @return Country Id or default Id
+   * @return COUNTRYID	Country Id or default Id
    */
   COUNTRYID getCountryId(const std::string& countryName);
+
+  /** @return int The number of tones */
   int getNbTone() { return _nbTone; }
+
 private:
   void initToneDefinition();
   std::string _toneZone[TONE_NBCOUNTRY][TONE_NBTONE];
diff --git a/src/config/config.h b/src/config/config.h
index f937b332d2108a01d11a0c969373eb8fce942e3f..5bcb9aa216987771f491e44c88ca42012a125b13 100644
--- a/src/config/config.h
+++ b/src/config/config.h
@@ -26,131 +26,153 @@
 #include <list>
 
 /**
- * Configuration namespace for ConfigTree object (like .ini files)
+ * @file config.h
+ * @brief Configuration namespace for ConfigTree object (like .ini files)
  */
 namespace Conf {
 
-class ConfigTreeItem;
-typedef std::map<std::string, ConfigTreeItem> ItemMap;
-typedef std::map<std::string, ItemMap*> SectionMap;
-typedef std::list<std::string> TokenList;
-
-class ConfigTreeItemException {
-public:
-  ConfigTreeItemException() {}
-  ~ConfigTreeItemException() {}
-};
-
-class ConfigTree;
-class ConfigTreeIterator 
-{
-public:
-  TokenList begin();
-  const TokenList& end() const { return _endToken; }
-  TokenList next();
-  
-private:
-  friend class ConfigTree;
-  ConfigTreeIterator(ConfigTree *configTree) : _tree(configTree) {}
-
-  ConfigTree* _tree;
-  TokenList _endToken;
-  SectionMap::iterator _iter;
-  ItemMap::iterator _iterItem;
-};
-
-class ConfigTree {
-public:
-  ConfigTree();
-  ~ConfigTree();
-
-  void createSection(const std::string& section);
-  void removeSection(const std::string& section);
-  /**
-   * Return an array of strings, listing the sections of the config file
-   *
-   * This will be mainly used to filter which sections are an
-   * "Account" definition.
-   *
-   * @return array Strings of the sections
-   */
-  TokenList getSections();
-
-  void addConfigTreeItem(const std::string& section, const ConfigTreeItem item);
-  /**
-   * Set a configuration value.
-   *
-   * @param section Write to this [section] of the .ini file
-   * @param itemName The itemName= in the .ini file
-   * @param value The value to assign to that itemName
-   */
-  bool setConfigTreeItem(const std::string& section, const std::string& itemName, const std::string& value);
-
-  /**
-   * Get a value.
-   *
-   * This function does all the validity tests, so none are needed throughout
-   * the program.
-   *
-   * @param section The name of the [section] in the .ini file.
-   * @param itemName The name of the item= in the .ini file.
-   * @return The value of the corresponding item. The default value if the section exists
-   *         but the item doesn't.
-   */
-  std::string getConfigTreeItemValue(const std::string& section, const std::string& itemName);
-  int getConfigTreeItemIntValue(const std::string& section, const std::string& itemName);
-
-  /**
-   * Flush data to .ini file
-   */
-  bool saveConfigTree(const std::string& fileName);
-
-  /**
-   * Load data (and fill ConfigTree) from disk
-   */
-  int  populateFromFile(const std::string& fileName);
-
-  bool getConfigTreeItemToken(const std::string& section, const std::string& itemName, TokenList& arg);
-
-private:
-  ConfigTreeItem* getConfigTreeItem(const std::string& section, const std::string& itemName);
-
-  /**
-   * List of sections. Each sections has an ItemList as child
-   */
-  SectionMap _sections;
-  friend class ConfigTreeIterator;
-
-public:
-  ConfigTreeIterator createIterator() {
-    return ConfigTreeIterator(this);
-  }
-};
-
-class ConfigTreeItem {
-public:
-  ConfigTreeItem() : _defaultValue(""), _type("string") {}
-  // defaultvalue = value
-  ConfigTreeItem(const std::string& name, const std::string& value, const std::string& type) : 
-    _name(name), _value(value), 
-    _defaultValue(value), _type(type) {}
-  ConfigTreeItem(const std::string& name, const std::string& value, const std::string& defaultValue, const std::string& type) : 
-    _name(name), _value(value), 
-    _defaultValue(defaultValue), _type(type) {}
-  ~ConfigTreeItem() {}
-
-  void setValue(const std::string& value) { _value = value; }
-  const std::string getName() const { return _name; }
-  const std::string getValue() const  { return _value; }
-  const std::string getDefaultValue() const  { return _defaultValue; }
-  const std::string getType() const  { return _type; }
-
-private:
-  std::string _name;
-  std::string _value;
-  std::string _defaultValue;
-  std::string _type;
-};
+  class ConfigTreeItem;
+  typedef std::map<std::string, ConfigTreeItem> ItemMap;
+  typedef std::map<std::string, ItemMap*> SectionMap;
+  typedef std::list<std::string> TokenList;
+
+  class ConfigTreeItemException {
+    public:
+      /**
+       * Constructor
+       * */
+      ConfigTreeItemException() {}
+      
+      /**
+       * Destructor
+       * */
+      ~ConfigTreeItemException() {}
+  };
+
+  class ConfigTree;
+  class ConfigTreeIterator 
+  {
+    public:
+      /**
+       * Parsing method
+       * @return TokenList
+       */
+      TokenList begin();
+
+      /**
+       * Parsing method
+       * @return TokenList
+       */
+      const TokenList& end() const { return _endToken; }
+
+      /**
+       * Parsing method
+       * @return TokenList
+       */
+      TokenList next();
+
+    private:
+      friend class ConfigTree;
+      ConfigTreeIterator(ConfigTree *configTree) : _tree(configTree) {}
+
+      ConfigTree* _tree;
+      TokenList _endToken;
+      SectionMap::iterator _iter;
+      ItemMap::iterator _iterItem;
+  };
+
+  class ConfigTree {
+    public:
+      ConfigTree();
+      ~ConfigTree();
+
+      void createSection(const std::string& section);
+      void removeSection(const std::string& section);
+      /**
+       * Return an array of strings, listing the sections of the config file
+       *
+       * This will be mainly used to filter which sections are an
+       * "Account" definition.
+       *
+       * @return array Strings of the sections
+       */
+      TokenList getSections();
+
+      void addConfigTreeItem(const std::string& section, const ConfigTreeItem item);
+      /**
+       * Set a configuration value.
+       *
+       * @param section Write to this [section] of the .ini file
+       * @param itemName The itemName= in the .ini file
+       * @param value The value to assign to that itemName
+       */
+      bool setConfigTreeItem(const std::string& section, const std::string& itemName, const std::string& value);
+
+      /**
+       * Get a value.
+       *
+       * This function does all the validity tests, so none are needed throughout
+       * the program.
+       *
+       * @param section The name of the [section] in the .ini file.
+       * @param itemName The name of the item= in the .ini file.
+       * @return The value of the corresponding item. The default value if the section exists
+       *         but the item doesn't.
+       */
+      std::string getConfigTreeItemValue(const std::string& section, const std::string& itemName);
+      int getConfigTreeItemIntValue(const std::string& section, const std::string& itemName);
+
+      /**
+       * Flush data to .ini file
+       */
+      bool saveConfigTree(const std::string& fileName);
+
+      /**
+       * Load data (and fill ConfigTree) from disk
+       */
+      int  populateFromFile(const std::string& fileName);
+
+      bool getConfigTreeItemToken(const std::string& section, const std::string& itemName, TokenList& arg);
+
+    private:
+      ConfigTreeItem* getConfigTreeItem(const std::string& section, const std::string& itemName);
+
+      /**
+       * List of sections. Each sections has an ItemList as child
+       */
+      SectionMap _sections;
+      friend class ConfigTreeIterator;
+
+    public:
+      ConfigTreeIterator createIterator() {
+	return ConfigTreeIterator(this);
+      }
+  };
+
+  class ConfigTreeItem {
+    public:
+      ConfigTreeItem() : _defaultValue(""), _type("string") {}
+      // defaultvalue = value
+      ConfigTreeItem(const std::string& name, const std::string& value, const std::string& type) : 
+	_name(name), _value(value), 
+	_defaultValue(value), _type(type) {}
+      ConfigTreeItem(const std::string& name, const std::string& value, const std::string& defaultValue, const std::string& type) : 
+	_name(name), _value(value), 
+	_defaultValue(defaultValue), _type(type) {}
+      ~ConfigTreeItem() {}
+
+      void setValue(const std::string& value) { _value = value; }
+      const std::string getName() const { return _name; }
+      const std::string getValue() const  { return _value; }
+      const std::string getDefaultValue() const  { return _defaultValue; }
+      const std::string getType() const  { return _type; }
+
+    private:
+      std::string _name;
+      std::string _value;
+      std::string _defaultValue;
+      std::string _type;
+  };
 
 } // end namespace ConfigTree
 
diff --git a/src/iaxaccount.h b/src/iaxaccount.h
index 2cdfb6232ad0dc338cdb708d69bfdbb7ed34b7f2..0d52718e5791b8c76fe4306614a579a78b5ca8ce 100644
--- a/src/iaxaccount.h
+++ b/src/iaxaccount.h
@@ -25,7 +25,7 @@
 
 /**
  * @file: iaxaccount.h
- * @brief: an IAX Account specify IAX specific functions and objects (IAXCall/IAXVoIPLink)
+ * @brief An IAX Account specify IAX specific functions and objects (IAXCall/IAXVoIPLink)
  */
 class IAXAccount : public Account
 {
diff --git a/src/iaxcall.h b/src/iaxcall.h
index ccfe8c41d5dd3e69b9ba9ef1089cf52c0b225a8f..1fdf5d75e68c78ba1b0721fa39bd532bff355e28 100644
--- a/src/iaxcall.h
+++ b/src/iaxcall.h
@@ -26,7 +26,7 @@
 
 /**
  * @file: iaxcall.h
- * @brief:  IAXCall are IAX implementation of a normal Call 
+ * @brief IAXCall are IAX implementation of a normal Call 
  */
 
 class IAXCall : public Call
diff --git a/src/iaxvoiplink.cpp b/src/iaxvoiplink.cpp
index 510ba7642f75e2b19daadb9a2376078d5ef5fefe..2e78672d32c5479b094cdaddfdf6c675fb32ae58 100644
--- a/src/iaxvoiplink.cpp
+++ b/src/iaxvoiplink.cpp
@@ -706,6 +706,9 @@ IAXVoIPLink::iaxHandleCallEvent(iax_event* event, IAXCall* call)
     Manager::instance().peerRingingCall(call->getCallId());
     break;
     
+  case IAX_IE_MSGCOUNT:	
+   // _debug("messssssssssssssssssssssssssssssssssssssssssssssssages\n");
+    break;
   case IAX_EVENT_PONG:
     break;
     
@@ -928,6 +931,10 @@ IAXVoIPLink::iaxHandlePrecallEvent(iax_event* event)
     
     break;
     
+  case IAX_IE_MSGCOUNT:	
+    //_debug("messssssssssssssssssssssssssssssssssssssssssssssssages\n");
+    break;
+
   default:
     _debug("Unknown event type (in precall): %d\n", event->etype);
   }