diff --git a/.gitignore b/.gitignore index 2cbf4e3093e8fd77c2e52b7905f1bbc26753f9e6..ccc5bb9604ef9601947060d0f4b11a847e7aada2 100644 --- a/.gitignore +++ b/.gitignore @@ -116,7 +116,7 @@ sflphone-client-gnome/man/Makefile /sflphone-client-gnome/src/dbus/marshaller.h # Ignore sflphone_kde stuff -/sflphone_kde/build +/sflphone-client-kde/build # Ignore sub-modules stuff ## libiax2 diff --git a/astylerc b/astylerc new file mode 100644 index 0000000000000000000000000000000000000000..14177d0fa0ef4086ca0e03957f3f17361d80b493 --- /dev/null +++ b/astylerc @@ -0,0 +1,15 @@ +# Filename: sflphone-common/astylerc +# Purpose: config file for astyle +# http://astyle.sourceforge.net/astyle.html +# Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com> +# Savoir-faire Linux Inc +# http://www.sflphone.org + +style=kr # Kernighan & Ritchie style formatting/indenting uses linux bracket +indent=spaces=4 # Use spaces instead of tabs for indentation +indent-classes # Indent 'class' and 'struct' blocks so that the blocks 'public:', 'protected:' and 'private:' are indented +indent-switches # Indent 'switch' blocks so that the 'case X:' statements are indented in the switch block +break-blocks # Pad empty lines around header blocks (e.g. 'if', 'while'...). +brackets=linux +unpad=paren +-d diff --git a/sflphone-client-gnome/configure.ac b/sflphone-client-gnome/configure.ac index 59d3abb03369f5d193217fd2ea7fc6d37fa1319e..1faa55dc8f89b6dc5660e7b3acc663f6ae1f359b 100644 --- a/sflphone-client-gnome/configure.ac +++ b/sflphone-client-gnome/configure.ac @@ -1,4 +1,4 @@ -AC_INIT([SFLphone],[0.9.5~beta],[sflphoneteam@savoirfairelinux.com],[sflphone-client-gnome]) +AC_INIT([SFLphone],[0.9.6~beta],[sflphoneteam@savoirfairelinux.com],[sflphone-client-gnome]) AM_CONFIG_HEADER(config.h) LT_INIT diff --git a/sflphone-client-gnome/man/Makefile.am b/sflphone-client-gnome/man/Makefile.am index eed294e21ef34f4537c829358d679429ead4f611..5101b6dc40b4a8e32f0daca6935eedb3dbc4ab3d 100644 --- a/sflphone-client-gnome/man/Makefile.am +++ b/sflphone-client-gnome/man/Makefile.am @@ -5,7 +5,7 @@ TEMPLATES=\ man_MANS = \ sflphone-client-gnome.1 \ - sflphone.1 + sflphone.1 POD2MAN=pod2man diff --git a/sflphone-client-gnome/pixmaps/accept.svg b/sflphone-client-gnome/pixmaps/accept.svg index 8d84af6b017730112f197bf2eafd5c0c00adbace..d6cb9bf031a1d48b147eb1a0996dbe688befd975 100644 --- a/sflphone-client-gnome/pixmaps/accept.svg +++ b/sflphone-client-gnome/pixmaps/accept.svg @@ -82,7 +82,7 @@ x2="15.630395" y2="8.5305319" gradientUnits="userSpaceOnUse" - gradientTransform="matrix(1.256521,0,0,-1.256521,-7.854319,28.773309)" /> + gradientTransform="matrix(1.6381002,0,0,-1.7663956,-14.178331,40.248782)" /> <linearGradient inkscape:collect="always" xlink:href="#linearGradient2433" @@ -112,7 +112,7 @@ inkscape:window-width="1331" inkscape:window-height="922" inkscape:window-x="169" - inkscape:window-y="24" + inkscape:window-y="25" showgrid="false"> <sodipodi:guide orientation="vertical" @@ -136,47 +136,7 @@ id="layer1"> <path style="opacity:1;fill:url(#linearGradient4275);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 7.3417195,21.902705 L 7.3417195,9.4553023 L 3.2972955,9.4553023 L 12.250001,0.03140142 L 21.202707,9.4553023 L 17.158282,9.4553023 L 17.158282,21.902705 L 7.3417195,21.902705 z " + d="M 5.6324267,30.590205 L 5.6324267,13.09186 L 0.3597955,13.09186 L 12.031251,-0.15609858 L 23.702707,13.09186 L 18.430074,13.09186 L 18.430074,30.590205 L 5.6324267,30.590205 z" id="rect4262" /> - <g - id="g2181" - transform="matrix(0.8753565,0,0,0.8754652,-11.955751,23.215691)" - style="fill:none;stroke:#000000;stroke-opacity:0.44968554"> - <path - style="opacity:1;fill:none;fill-opacity:1;stroke:#000000;stroke-width:0.65573961;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.44968554" - d="M 41.109694,-0.41817229 C 40.505298,0.20454826 39.040867,0.77635346 37.592239,0.77635106 C 36.102089,0.77635106 34.114653,0.15682998 33.532659,-0.49267807 L 33.569913,-2.0031726 L 33.569913,-3.0835065 C 31.027414,-3.5787101 30.997014,-3.8285637 27.525623,-3.8285643 C 24.054233,-3.8285649 23.830777,-3.5759718 21.29017,-3.0462535 L 21.29017,-0.3436665 C 20.685773,0.27905404 19.221343,0.87609843 17.772714,0.87609724 C 16.282564,0.87609724 14.623294,0.43325774 13.915083,-0.41817229 L 14.138601,-5.7646408 C 18.129172,-7.3187814 22.030595,-8.3970767 27.437882,-8.5586077 C 32.38601,-8.450833 36.259126,-7.7053161 40.886177,-5.8763994 L 41.109694,-0.41817229 z " - id="path2183" - sodipodi:nodetypes="csccczccsccccc" /> - </g> - <g - id="g4160" - transform="matrix(0.880119,0,0,0.880119,-2.1102174,12.142342)" - style="fill:url(#linearGradient2439);fill-opacity:1"> - <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:url(#linearGradient2439);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:url(#linearGradient2439);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:url(#linearGradient2439);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:url(#linearGradient2439);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:url(#linearGradient2439);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-client-gnome/pixmaps/busy.svg b/sflphone-client-gnome/pixmaps/busy.svg index 3f9adf3e27c52ad3c01af16ce290cf7faa7d7b72..c678dd2d4044060d58a5fb1740da85fcb21e1392 100644 --- a/sflphone-client-gnome/pixmaps/busy.svg +++ b/sflphone-client-gnome/pixmaps/busy.svg @@ -2,7 +2,7 @@ <!-- Created with Inkscape (http://www.inkscape.org/) --> <svg xmlns:dc="http://purl.org/dc/elements/1.1/" - xmlns:cc="http://web.resource.org/cc/" + 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" @@ -13,14 +13,21 @@ height="24" id="svg2" sodipodi:version="0.32" - inkscape:version="0.45" + inkscape:version="0.46" version="1.0" sodipodi:docbase="/home/plbeaudoin/SFLPhone/sflphone/sflphone-gtk/pixmaps" - sodipodi:docname="current (copie).svg" + sodipodi:docname="busy.svg" inkscape:output_extension="org.inkscape.output.svg.inkscape" sodipodi:modified="true"> <defs id="defs4"> + <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="perspective119" /> <linearGradient id="linearGradient4045"> <stop @@ -633,9 +640,10 @@ showguides="true" inkscape:guide-bbox="true" inkscape:window-width="1014" - inkscape:window-height="691" + inkscape:window-height="718" inkscape:window-x="5" - inkscape:window-y="425" /> + inkscape:window-y="425" + showgrid="false" /> <metadata id="metadata7"> <rdf:RDF> @@ -651,70 +659,21 @@ inkscape:label="Calque 1" inkscape:groupmode="layer" id="layer1"> - <g - id="g2364" - inkscape:label="Calque 1" - transform="translate(12.25524,-3.4355522)"> - <g - transform="translate(7.9455775,4.2707653)" - inkscape:label="Calque 1" - id="g2446"> - <g - id="g2181" - transform="matrix(-0.4376782,-0.758081,0.7581751,-0.4377326,3.5952686,30.820492)" - style="fill:none;stroke:#000000;stroke-opacity:0.44968555"> - <path - style="opacity:1;fill:none;fill-opacity:1;stroke:#000000;stroke-width:0.65573961;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.44968555" - d="M 41.109694,-0.41817229 C 40.505298,0.20454826 39.040867,0.77635346 37.592239,0.77635106 C 36.102089,0.77635106 34.114653,0.15682998 33.532659,-0.49267807 L 33.569913,-2.0031726 L 33.569913,-3.0835065 C 31.027414,-3.5787101 30.997014,-3.8285637 27.525623,-3.8285643 C 24.054233,-3.8285649 23.830777,-3.5759718 21.29017,-3.0462535 L 21.29017,-0.3436665 C 20.685773,0.27905404 19.221343,0.87609843 17.772714,0.87609724 C 16.282564,0.87609724 14.623294,0.43325774 13.915083,-0.41817229 L 14.138601,-5.7646408 C 18.129172,-7.3187814 22.030595,-8.3970767 27.437882,-8.5586077 C 32.38601,-8.450833 36.259126,-7.7053161 40.886177,-5.8763994 L 41.109694,-0.41817229 z " - id="path2183" - sodipodi:nodetypes="csccczccsccccc" /> - </g> - <g - id="g2451" - transform="matrix(-0.4400595,-0.7622054,0.7622054,-0.4400595,-10.917299,27.830684)"> - <path - sodipodi:nodetypes="cccsccsccsccc" - id="path2453" - 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:url(#linearGradient2483);fill-opacity:1;stroke:#903e00;stroke-width:0.625;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> - <path - sodipodi:nodetypes="cccsccc" - id="path2455" - 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:url(#linearGradient2485);fill-opacity:1;stroke:#903e00;stroke-width:0.57204324;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> - <path - sodipodi:nodetypes="cccsccc" - id="path2457" - 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:url(#linearGradient2487);fill-opacity:1;stroke:#903e00;stroke-width:0.57204324;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> - <path - sodipodi:nodetypes="cccsccc" - id="path2459" - d="M 6.6822725,11.157918 C 8.0629923,11.157918 8.7535908,10.73333 9.3296551,10.139801 L 9.0644746,7.3100024 C 8.3276662,7.9882984 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:url(#linearGradient2489);fill-opacity:1;stroke:none;stroke-width:0.57204324;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> - <path - sodipodi:nodetypes="cccsccc" - id="path2461" - 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:url(#linearGradient2491);fill-opacity:1;stroke:none;stroke-width:0.57204324;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> - </g> - </g> - </g> <g id="g2266" style="opacity:1;fill:#ff7105;fill-opacity:1;stroke:#903e00;stroke-opacity:1" - transform="matrix(1.2687892,0,0,1.2687892,-6.6211534,-0.9357295)"> + transform="matrix(2.238646,0,0,2.3688362,-29.259846,2.9955634)"> <g id="g3252"> <path sodipodi:type="arc" - style="opacity:1;fill:#2d2d2d;fill-opacity:0.52037615;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + style="opacity:1;fill:#2d2d2d;fill-opacity:0.52037617;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" id="path3240" sodipodi:cx="-19.445436" sodipodi:cy="8.8477116" sodipodi:rx="2.2728431" sodipodi:ry="2.2728431" - d="M -17.172593 8.8477116 A 2.2728431 2.2728431 0 1 1 -21.71828,8.8477116 A 2.2728431 2.2728431 0 1 1 -17.172593 8.8477116 z" + d="M -17.172593,8.8477116 A 2.2728431,2.2728431 0 1 1 -21.71828,8.8477116 A 2.2728431,2.2728431 0 1 1 -17.172593,8.8477116 z" transform="matrix(0.7168524,0,0,0.7168524,28.665086,-2.8957295)" /> <path sodipodi:type="arc" @@ -724,7 +683,7 @@ sodipodi:cy="8.8477116" sodipodi:rx="2.2728431" sodipodi:ry="2.2728431" - d="M -17.172593 8.8477116 A 2.2728431 2.2728431 0 1 1 -21.71828,8.8477116 A 2.2728431 2.2728431 0 1 1 -17.172593 8.8477116 z" + d="M -17.172593,8.8477116 A 2.2728431,2.2728431 0 1 1 -21.71828,8.8477116 A 2.2728431,2.2728431 0 1 1 -17.172593,8.8477116 z" transform="matrix(0.4763157,0,0,0.4763157,23.987745,-0.7675302)" /> </g> <g @@ -738,7 +697,7 @@ sodipodi:cy="8.8477116" sodipodi:rx="2.2728431" sodipodi:ry="2.2728431" - d="M -17.172593 8.8477116 A 2.2728431 2.2728431 0 1 1 -21.71828,8.8477116 A 2.2728431 2.2728431 0 1 1 -17.172593 8.8477116 z" + d="M -17.172593,8.8477116 A 2.2728431,2.2728431 0 1 1 -21.71828,8.8477116 A 2.2728431,2.2728431 0 1 1 -17.172593,8.8477116 z" transform="matrix(0.7168524,0,0,0.7168524,32.753628,-2.8464698)" /> <path sodipodi:type="arc" @@ -748,7 +707,7 @@ sodipodi:cy="8.8477116" sodipodi:rx="2.2728431" sodipodi:ry="2.2728431" - d="M -17.172593 8.8477116 A 2.2728431 2.2728431 0 1 1 -21.71828,8.8477116 A 2.2728431 2.2728431 0 1 1 -17.172593 8.8477116 z" + d="M -17.172593,8.8477116 A 2.2728431,2.2728431 0 1 1 -21.71828,8.8477116 A 2.2728431,2.2728431 0 1 1 -17.172593,8.8477116 z" transform="matrix(0.4763157,0,0,0.4763157,28.076287,-0.7182706)" /> </g> <g @@ -763,7 +722,7 @@ sodipodi:cy="8.8477116" sodipodi:rx="2.2728431" sodipodi:ry="2.2728431" - d="M -17.172593 8.8477116 A 2.2728431 2.2728431 0 1 1 -21.71828,8.8477116 A 2.2728431 2.2728431 0 1 1 -17.172593 8.8477116 z" + d="M -17.172593,8.8477116 A 2.2728431,2.2728431 0 1 1 -21.71828,8.8477116 A 2.2728431,2.2728431 0 1 1 -17.172593,8.8477116 z" transform="matrix(0.7168524,0,0,0.7168524,28.665086,-2.8957295)" /> <path sodipodi:type="arc" @@ -773,7 +732,7 @@ sodipodi:cy="8.8477116" sodipodi:rx="2.2728431" sodipodi:ry="2.2728431" - d="M -17.172593 8.8477116 A 2.2728431 2.2728431 0 1 1 -21.71828,8.8477116 A 2.2728431 2.2728431 0 1 1 -17.172593 8.8477116 z" + d="M -17.172593,8.8477116 A 2.2728431,2.2728431 0 1 1 -21.71828,8.8477116 A 2.2728431,2.2728431 0 1 1 -17.172593,8.8477116 z" transform="matrix(0.4763157,0,0,0.4763157,23.987745,-0.7675302)" /> </g> </g> diff --git a/sflphone-client-gnome/pixmaps/hang_up.svg b/sflphone-client-gnome/pixmaps/hang_up.svg index 8fa89cfe6e7eb35f4102ecfbdbc598fd183408c2..c013f8e41e15616c46c9c114a32c70c1663d196a 100644 --- a/sflphone-client-gnome/pixmaps/hang_up.svg +++ b/sflphone-client-gnome/pixmaps/hang_up.svg @@ -105,7 +105,7 @@ x2="15.806232" y2="6.6770978" gradientUnits="userSpaceOnUse" - gradientTransform="matrix(1.158192,0,0,1.158192,-6.593576,-2.538854)" /> + gradientTransform="matrix(1.6531793,0,0,1.489046,-14.42409,-10.196164)" /> <linearGradient id="linearGradient2278"> <stop @@ -677,10 +677,10 @@ height="32px" showguides="true" inkscape:guide-bbox="true" - inkscape:window-width="1014" - inkscape:window-height="722" - inkscape:window-x="5" - inkscape:window-y="49" + inkscape:window-width="1920" + inkscape:window-height="1123" + inkscape:window-x="0" + inkscape:window-y="25" showgrid="false"> <sodipodi:guide orientation="horizontal" @@ -708,65 +708,7 @@ id="layer1"> <path style="opacity:1;fill:url(#linearGradient4275);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 7.4133112,3.7940921 L 7.4133112,15.267435 L 3.6853797,15.267435 L 11.9375,23.953878 L 20.18962,15.267435 L 16.461688,15.267435 L 16.461688,3.7940921 L 7.4133112,3.7940921 z " + d="M 5.5690521,-2.0541222 L 5.5690521,12.696743 L 0.24787973,12.696743 L 12.026785,23.864592 L 23.805692,12.696743 L 18.484518,12.696743 L 18.484518,-2.0541222 L 5.5690521,-2.0541222 z" id="rect4262" /> - <g - id="g2407" - inkscape:label="Calque 1" - transform="matrix(-0.5,0.8660254,-0.8660254,-0.5,28.570435,0.9317453)" - style="fill:url(#linearGradient2506);fill-opacity:1"> - <g - transform="translate(14.730114,-3.4355522)" - inkscape:label="Calque 1" - id="g2364" - style="fill:url(#linearGradient2506);fill-opacity:1.0"> - <g - id="g2446" - inkscape:label="Calque 1" - transform="translate(7.9455775,4.2707653)" - style="fill:url(#linearGradient2506);fill-opacity:1.0"> - <g - style="fill:url(#linearGradient2506);stroke:#000000;stroke-opacity:0.44968554999999999;fill-opacity:1.0" - transform="matrix(-0.4376782,-0.758081,0.7581751,-0.4377326,3.5952686,30.820492)" - id="g2181"> - <path - sodipodi:nodetypes="csccczccsccccc" - id="path2183" - d="M 41.109694,-0.41817229 C 40.505298,0.20454826 39.040867,0.77635346 37.592239,0.77635106 C 36.102089,0.77635106 34.114653,0.15682998 33.532659,-0.49267807 L 33.569913,-2.0031726 L 33.569913,-3.0835065 C 31.027414,-3.5787101 30.997014,-3.8285637 27.525623,-3.8285643 C 24.054233,-3.8285649 23.830777,-3.5759718 21.29017,-3.0462535 L 21.29017,-0.3436665 C 20.685773,0.27905404 19.221343,0.87609843 17.772714,0.87609724 C 16.282564,0.87609724 14.623294,0.43325774 13.915083,-0.41817229 L 14.138601,-5.7646408 C 18.129172,-7.3187814 22.030595,-8.3970767 27.437882,-8.5586077 C 32.38601,-8.450833 36.259126,-7.7053161 40.886177,-5.8763994 L 41.109694,-0.41817229 z " - style="opacity:1;fill:url(#linearGradient2506);fill-opacity:1.0;stroke:#000000;stroke-width:0.65573961000000003;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.44968554999999999" /> - </g> - <g - transform="matrix(-0.4400595,-0.7622054,0.7622054,-0.4400595,-10.917299,27.830684)" - id="g2451" - style="fill:url(#linearGradient2506);fill-opacity:1.0"> - <path - style="opacity:1;fill:url(#linearGradient2506);fill-opacity:1.0;stroke:#561500;stroke-width:0.62500000000000000;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - 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 " - id="path2453" - sodipodi:nodetypes="cccsccsccsccc" /> - <path - style="opacity:1;fill:url(#linearGradient2506);fill-opacity:1.0;stroke:#561500;stroke-width:0.57204323999999995;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - 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 " - id="path2455" - sodipodi:nodetypes="cccsccc" /> - <path - style="opacity:1;fill:url(#linearGradient2506);fill-opacity:1.0;stroke:#561500;stroke-width:0.57204323999999995;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - 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 " - id="path2457" - sodipodi:nodetypes="cccsccc" /> - <path - style="opacity:1;fill:url(#linearGradient2506);fill-opacity:1.0;stroke:none;stroke-width:0.57204323999999995;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - d="M 6.6822725,11.157918 C 8.0629923,11.157918 8.7535908,10.73333 9.3296551,10.139801 L 9.0644746,7.3100024 C 8.3276662,7.9882984 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 " - id="path2459" - sodipodi:nodetypes="cccsccc" /> - <path - style="opacity:1;fill:url(#linearGradient2506);fill-opacity:1.0;stroke:none;stroke-width:0.57204323999999995;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - 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 " - id="path2461" - sodipodi:nodetypes="cccsccc" /> - </g> - </g> - </g> - </g> </g> </svg> diff --git a/sflphone-client-gnome/pixmaps/hold.svg b/sflphone-client-gnome/pixmaps/hold.svg index d074c3356c16bbf530c637f177bf5e84975c5fb3..75ba65ed25155ee445221b454c8554d1dfcb364b 100644 --- a/sflphone-client-gnome/pixmaps/hold.svg +++ b/sflphone-client-gnome/pixmaps/hold.svg @@ -2,7 +2,7 @@ <!-- Created with Inkscape (http://www.inkscape.org/) --> <svg xmlns:dc="http://purl.org/dc/elements/1.1/" - xmlns:cc="http://web.resource.org/cc/" + 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" @@ -13,7 +13,7 @@ height="24" id="svg2" sodipodi:version="0.32" - inkscape:version="0.45" + inkscape:version="0.46" version="1.0" sodipodi:docbase="/home/plbeaudoin/SFLPhone/sflphone/sflphone-gtk/pixmaps" sodipodi:docname="hold.svg" @@ -21,6 +21,13 @@ sodipodi:modified="true"> <defs id="defs4"> + <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="perspective129" /> <linearGradient id="linearGradient4269"> <stop @@ -112,7 +119,7 @@ x2="27.5625" y2="22.512505" gradientUnits="userSpaceOnUse" - gradientTransform="matrix(0.632388,0,0,0.632388,3.258093,0.894991)" /> + gradientTransform="matrix(1.6055426,0,0,1.3647733,-20.292209,-3.9676818)" /> <linearGradient id="linearGradient2278"> <stop @@ -715,26 +722,27 @@ borderopacity="1.0" inkscape:pageopacity="0.0" inkscape:pageshadow="2" - inkscape:zoom="2.8284271" - inkscape:cx="-65.93937" - inkscape:cy="-1.0287473" + inkscape:zoom="11.313708" + inkscape:cx="-28.190756" + inkscape:cy="13.113388" inkscape:document-units="px" inkscape:current-layer="layer1" width="32px" height="32px" showguides="true" inkscape:guide-bbox="true" - inkscape:window-width="1014" - inkscape:window-height="691" - inkscape:window-x="5" - inkscape:window-y="49"> + inkscape:window-width="1920" + inkscape:window-height="1123" + inkscape:window-x="0" + inkscape:window-y="25" + showgrid="false"> <sodipodi:guide orientation="horizontal" position="8.0357143" id="guide3144" /> <sodipodi:guide orientation="vertical" - position="15.982143" + position="14.230524,15.114408" id="guide3146" /> </sodipodi:namedview> <metadata @@ -753,66 +761,12 @@ inkscape:groupmode="layer" id="layer1"> <path - style="opacity:0.63862927;fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:0.45169228;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - d="M 21.038321,3.4034084 L 15.10969,4.9843766 L 15.10969,11.031579 C 14.669707,10.938077 14.114787,11.043637 13.588009,11.347773 C 12.710044,11.854667 12.265301,12.744435 12.599904,13.323983 C 12.934506,13.903532 13.915531,13.949451 14.793496,13.442556 C 15.520561,13.022784 15.945002,12.351704 15.880412,11.802301 L 15.900174,11.802301 L 15.900174,6.0120062 L 20.228074,4.8460419 L 20.228074,9.5494222 C 19.790115,9.4608922 19.227685,9.5646472 18.706392,9.8656162 C 17.828428,10.372509 17.383684,11.262277 17.718288,11.841826 C 18.05289,12.421374 19.033915,12.467291 19.911881,11.960398 C 20.638946,11.540626 21.083149,10.869547 21.018559,10.320144 L 21.038321,10.320144 L 21.038321,4.6286588 L 21.038321,3.4034084 z " + style="opacity:0.63862927;fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:0.96986693;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="M 21.083328,3.3115526 L 6.8454978,6.3466505 L 6.8454978,17.955899 C 5.7888622,17.776396 4.4562011,17.979047 3.191124,18.562919 C 1.0826581,19.53604 0.014591176,21.244191 0.81815278,22.356791 C 1.621712,23.469393 3.9776803,23.557546 6.0861461,22.584424 C 7.8322199,21.778558 8.8515308,20.490237 8.6964156,19.435509 L 8.7438748,19.435509 L 8.7438748,8.3194647 L 19.137489,6.0810794 L 19.137489,15.110496 C 18.085714,14.940539 16.735017,15.139724 15.483113,15.717517 C 13.374649,16.690635 12.30658,18.398786 13.110144,19.511388 C 13.913703,20.623988 16.269671,20.712138 18.37814,19.739019 C 20.124213,18.933153 21.190984,17.644834 21.035869,16.590106 L 21.083328,16.590106 L 21.083328,5.6637536 L 21.083328,3.3115526 z" id="path3384" /> <path - style="fill:url(#linearGradient2224);fill-opacity:1;stroke:#1d6a6f;stroke-width:0.45169228;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - d="M 20.490646,2.9897742 L 14.562015,4.5707424 L 14.562015,10.617945 C 14.122032,10.524443 13.567112,10.630003 13.040334,10.934139 C 12.162369,11.441033 11.717626,12.330801 12.052229,12.910349 C 12.386831,13.489898 13.367856,13.535817 14.245821,13.028922 C 14.972886,12.60915 15.397327,11.93807 15.332737,11.388667 L 15.352499,11.388667 L 15.352499,5.5983718 L 19.680399,4.4324077 L 19.680399,9.1357875 C 19.24244,9.047258 18.68001,9.1510128 18.158717,9.4519815 C 17.280753,9.9588749 16.836009,10.848643 17.170613,11.428192 C 17.505215,12.00774 18.48624,12.053657 19.364206,11.546764 C 20.091271,11.126992 20.535474,10.455913 20.470884,9.9065097 L 20.490646,9.9065097 L 20.490646,4.2150246 L 20.490646,2.9897742 z " + style="fill:url(#linearGradient2224);fill-opacity:1;stroke:#1d6a6f;stroke-width:1.05730486;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="M 23.458777,0.55312511 L 8.4068307,3.9650544 L 8.4068307,17.015683 C 7.2897768,16.813894 5.8809144,17.041706 4.5435004,17.698069 C 2.3144728,18.79201 1.1853339,20.712243 2.0348431,21.962981 C 2.8843497,23.213721 5.3750318,23.31282 7.6040594,22.218876 C 9.4499735,21.312955 10.527568,19.864679 10.363584,18.678999 L 10.413756,18.678999 L 10.413756,6.1828086 L 21.401676,3.6665107 L 21.401676,13.817 C 20.289761,13.625942 18.861831,13.849858 17.538343,14.499386 C 15.309318,15.593326 14.180177,17.513559 15.029689,18.764299 C 15.879195,20.015037 18.369878,20.114132 20.598908,19.020192 C 22.444821,18.114271 23.57259,16.665997 23.408604,15.480316 L 23.458777,15.480316 L 23.458777,3.1973704 L 23.458777,0.55312511 z" id="path1328" /> - <g - id="g2403" - inkscape:label="Calque 1" - transform="translate(-3.1142216,0.1467125)"> - <g - transform="translate(14.730114,-3.4355522)" - inkscape:label="Calque 1" - id="g2364"> - <g - id="g2446" - inkscape:label="Calque 1" - transform="translate(7.9455775,4.2707653)"> - <g - style="fill:none;stroke:#000000;stroke-opacity:0.44968555" - transform="matrix(-0.4376782,-0.758081,0.7581751,-0.4377326,3.5952686,30.820492)" - id="g2181"> - <path - sodipodi:nodetypes="csccczccsccccc" - id="path2183" - d="M 41.109694,-0.41817229 C 40.505298,0.20454826 39.040867,0.77635346 37.592239,0.77635106 C 36.102089,0.77635106 34.114653,0.15682998 33.532659,-0.49267807 L 33.569913,-2.0031726 L 33.569913,-3.0835065 C 31.027414,-3.5787101 30.997014,-3.8285637 27.525623,-3.8285643 C 24.054233,-3.8285649 23.830777,-3.5759718 21.29017,-3.0462535 L 21.29017,-0.3436665 C 20.685773,0.27905404 19.221343,0.87609843 17.772714,0.87609724 C 16.282564,0.87609724 14.623294,0.43325774 13.915083,-0.41817229 L 14.138601,-5.7646408 C 18.129172,-7.3187814 22.030595,-8.3970767 27.437882,-8.5586077 C 32.38601,-8.450833 36.259126,-7.7053161 40.886177,-5.8763994 L 41.109694,-0.41817229 z " - style="opacity:1;fill:none;fill-opacity:1;stroke:#000000;stroke-width:0.65573961;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.44968555" /> - </g> - <g - transform="matrix(-0.4400595,-0.7622054,0.7622054,-0.4400595,-10.917299,27.830684)" - id="g2451"> - <path - style="opacity:1;fill:url(#linearGradient2483);fill-opacity:1;stroke:#005653;stroke-width:0.625;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - 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 " - id="path2453" - sodipodi:nodetypes="cccsccsccsccc" /> - <path - style="opacity:1;fill:url(#linearGradient2485);fill-opacity:1;stroke:#005653;stroke-width:0.57204324;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - 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 " - id="path2455" - sodipodi:nodetypes="cccsccc" /> - <path - style="opacity:1;fill:url(#linearGradient2487);fill-opacity:1;stroke:#005653;stroke-width:0.57204324;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - 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 " - id="path2457" - sodipodi:nodetypes="cccsccc" /> - <path - style="opacity:1;fill:url(#linearGradient2489);fill-opacity:1;stroke:none;stroke-width:0.57204324;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - d="M 6.6822725,11.157918 C 8.0629923,11.157918 8.7535908,10.73333 9.3296551,10.139801 L 9.0644746,7.3100024 C 8.3276662,7.9882984 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 " - id="path2459" - sodipodi:nodetypes="cccsccc" /> - <path - style="opacity:1;fill:url(#linearGradient2491);fill-opacity:1;stroke:none;stroke-width:0.57204324;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - 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 " - id="path2461" - sodipodi:nodetypes="cccsccc" /> - </g> - </g> - </g> - </g> </g> </svg> diff --git a/sflphone-client-gnome/pixmaps/icon_accept.svg b/sflphone-client-gnome/pixmaps/icon_accept.svg index 14453ca69792590f2eeeef512b3f37e1647ac562..80517c6e9d194bc65b0ccd8f1bb18eb65a9a070b 100644 --- a/sflphone-client-gnome/pixmaps/icon_accept.svg +++ b/sflphone-client-gnome/pixmaps/icon_accept.svg @@ -125,7 +125,7 @@ gradientUnits="userSpaceOnUse" gradientTransform="matrix(0.875025,0,0,0.875025,0.666703,0.177907)" /> <linearGradient - gradientTransform="matrix(1.0511112,0,0,-0.7528043,-6.3612105,18.68452)" + gradientTransform="matrix(1.4520153,0,0,-1.1927438,-11.899734,29.02722)" gradientUnits="userSpaceOnUse" y2="6.6770978" x2="15.806232" @@ -330,7 +330,7 @@ borderopacity="1.0" inkscape:pageopacity="0.0" inkscape:pageshadow="2" - inkscape:zoom="11.313708" + inkscape:zoom="31.999999" inkscape:cx="20.635709" inkscape:cy="3.1660007" inkscape:document-units="px" @@ -339,10 +339,10 @@ height="16px" showguides="true" inkscape:guide-bbox="true" - inkscape:window-width="1014" - inkscape:window-height="722" - inkscape:window-x="336" - inkscape:window-y="209" + inkscape:window-width="1920" + inkscape:window-height="1123" + inkscape:window-x="0" + inkscape:window-y="25" showgrid="false"> <sodipodi:guide orientation="vertical" @@ -366,47 +366,7 @@ id="layer1"> <path style="opacity:1;fill:url(#linearGradient4275);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 4.8702645,10.451388 L 4.8702645,4.699571 L 2.2608109,4.699571 L 8.0370775,0.3448829 L 13.813346,4.699571 L 11.203891,4.699571 L 11.203891,10.451388 L 4.8702645,10.451388 z" + d="M 3.6155356,15.982638 L 3.6155356,6.8694541 L 0.010810802,6.8694541 L 7.9902027,-0.030117165 L 15.969596,6.8694541 L 12.364869,6.8694541 L 12.364869,15.982638 L 3.6155356,15.982638 z" id="rect4262" /> - <g - id="g2181" - transform="matrix(0.5647782,0,0,0.5334707,-7.4066678,15.009203)" - style="fill:none;stroke:#000000;stroke-opacity:0.44968555"> - <path - style="opacity:1;fill:none;fill-opacity:1;stroke:#000000;stroke-width:0.65573961;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.44968555" - d="M 41.109694,-0.41817229 C 40.505298,0.20454826 39.040867,0.77635346 37.592239,0.77635106 C 36.102089,0.77635106 34.114653,0.15682998 33.532659,-0.49267807 L 33.569913,-2.0031726 L 33.569913,-3.0835065 C 31.027414,-3.5787101 30.997014,-3.8285637 27.525623,-3.8285643 C 24.054233,-3.8285649 23.830777,-3.5759718 21.29017,-3.0462535 L 21.29017,-0.3436665 C 20.685773,0.27905404 19.221343,0.87609843 17.772714,0.87609724 C 16.282564,0.87609724 14.623294,0.43325774 13.915083,-0.41817229 L 14.138601,-5.7646408 C 18.129172,-7.3187814 22.030595,-8.3970767 27.437882,-8.5586077 C 32.38601,-8.450833 36.259126,-7.7053161 40.886177,-5.8763994 L 41.109694,-0.41817229 z" - id="path2183" - sodipodi:nodetypes="csccczccsccccc" /> - </g> - <g - id="g4160" - transform="matrix(0.5678511,0,0,0.5363064,-1.0543503,8.261584)" - style="fill:url(#linearGradient2439);fill-opacity:1"> - <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:url(#linearGradient4318);fill-opacity:1;stroke:#0f5600;stroke-width:0.625;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:url(#linearGradient4320);fill-opacity:1;stroke:#0f5600;stroke-width:0.57204324;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:url(#linearGradient4322);fill-opacity:1;stroke:#0f5600;stroke-width:0.57204324;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:url(#linearGradient4324);fill-opacity:1;stroke:none;stroke-width:0.57204324;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:url(#linearGradient4326);fill-opacity:1;stroke:none;stroke-width:0.57204324;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> - </g> </g> </svg> diff --git a/sflphone-client-gnome/pixmaps/icon_hangup.svg b/sflphone-client-gnome/pixmaps/icon_hangup.svg index 5ba9731254f90100f3a736c8169eca3c4cb8f50d..538a009d4ed516e2988d5a75251c1979d3096fc4 100644 --- a/sflphone-client-gnome/pixmaps/icon_hangup.svg +++ b/sflphone-client-gnome/pixmaps/icon_hangup.svg @@ -62,7 +62,7 @@ x2="15.806232" y2="6.6770978" gradientUnits="userSpaceOnUse" - gradientTransform="matrix(0.7424878,0,0,0.7680564,-3.8986663,-1.5618881)" /> + gradientTransform="matrix(1.1255039,0,0,0.9216648,-10.037974,-5.0755603)" /> <linearGradient inkscape:collect="always" id="linearGradient2433"> @@ -396,19 +396,19 @@ borderopacity="1.0" inkscape:pageopacity="0.0" inkscape:pageshadow="2" - inkscape:zoom="11.313708" - inkscape:cx="20.635709" - inkscape:cy="3.1660007" + inkscape:zoom="45.254832" + inkscape:cx="7.5252258" + inkscape:cy="6.7015348" inkscape:document-units="px" inkscape:current-layer="layer1" width="16px" height="16px" showguides="true" inkscape:guide-bbox="true" - inkscape:window-width="1014" - inkscape:window-height="722" - inkscape:window-x="336" - inkscape:window-y="209" + inkscape:window-width="1920" + inkscape:window-height="1123" + inkscape:window-x="0" + inkscape:window-y="25" showgrid="false"> <sodipodi:guide orientation="vertical" @@ -432,65 +432,7 @@ id="layer1"> <path style="opacity:1;fill:url(#linearGradient4275);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 5.0807981,2.6378122 L 5.0807981,10.246372 L 2.6909146,10.246372 L 7.981142,16.006797 L 13.271369,10.246372 L 10.881484,10.246372 L 10.881484,2.6378122 L 5.0807981,2.6378122 z" + d="M 3.5735926,-0.035935437 L 3.5735926,9.0943083 L -0.049124301,9.0943083 L 7.9700936,16.006797 L 15.989311,9.0943083 L 12.366591,9.0943083 L 12.366591,-0.035935437 L 3.5735926,-0.035935437 z" id="rect4262" /> - <g - id="g2407" - inkscape:label="Calque 1" - transform="matrix(-0.3205374,0.5743057,-0.5551872,-0.3315756,18.644099,0.7396437)" - style="fill:url(#linearGradient2506);fill-opacity:1"> - <g - transform="translate(14.730114,-3.4355522)" - inkscape:label="Calque 1" - id="g2364" - style="fill:url(#linearGradient3342);fill-opacity:1"> - <g - id="g2446" - inkscape:label="Calque 1" - transform="translate(7.9455775,4.2707653)" - style="fill:url(#linearGradient3340);fill-opacity:1"> - <g - style="fill:url(#linearGradient3326);fill-opacity:1;stroke:#000000;stroke-opacity:0.44968555" - transform="matrix(-0.4376782,-0.758081,0.7581751,-0.4377326,3.5952686,30.820492)" - id="g2181"> - <path - sodipodi:nodetypes="csccczccsccccc" - id="path2183" - d="M 41.109694,-0.41817229 C 40.505298,0.20454826 39.040867,0.77635346 37.592239,0.77635106 C 36.102089,0.77635106 34.114653,0.15682998 33.532659,-0.49267807 L 33.569913,-2.0031726 L 33.569913,-3.0835065 C 31.027414,-3.5787101 30.997014,-3.8285637 27.525623,-3.8285643 C 24.054233,-3.8285649 23.830777,-3.5759718 21.29017,-3.0462535 L 21.29017,-0.3436665 C 20.685773,0.27905404 19.221343,0.87609843 17.772714,0.87609724 C 16.282564,0.87609724 14.623294,0.43325774 13.915083,-0.41817229 L 14.138601,-5.7646408 C 18.129172,-7.3187814 22.030595,-8.3970767 27.437882,-8.5586077 C 32.38601,-8.450833 36.259126,-7.7053161 40.886177,-5.8763994 L 41.109694,-0.41817229 z" - style="opacity:1;fill:url(#linearGradient3324);fill-opacity:1;stroke:#000000;stroke-width:0.65573961;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.44968555" /> - </g> - <g - transform="matrix(-0.4400595,-0.7622054,0.7622054,-0.4400595,-10.917299,27.830684)" - id="g2451" - style="fill:url(#linearGradient3338);fill-opacity:1"> - <path - style="opacity:1;fill:url(#linearGradient3328);fill-opacity:1;stroke:#561500;stroke-width:0.625;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - 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" - id="path2453" - sodipodi:nodetypes="cccsccsccsccc" /> - <path - style="opacity:1;fill:url(#linearGradient3330);fill-opacity:1;stroke:#561500;stroke-width:0.57204324;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - 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" - id="path2455" - sodipodi:nodetypes="cccsccc" /> - <path - style="opacity:1;fill:url(#linearGradient3332);fill-opacity:1;stroke:#561500;stroke-width:0.57204324;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - 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" - id="path2457" - sodipodi:nodetypes="cccsccc" /> - <path - style="opacity:1;fill:url(#linearGradient3334);fill-opacity:1;stroke:none;stroke-width:0.57204324;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - d="M 6.6822725,11.157918 C 8.0629923,11.157918 8.7535908,10.73333 9.3296551,10.139801 L 9.0644746,7.3100024 C 8.3276662,7.9882984 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" - id="path2459" - sodipodi:nodetypes="cccsccc" /> - <path - style="opacity:1;fill:url(#linearGradient3336);fill-opacity:1;stroke:none;stroke-width:0.57204324;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - 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" - id="path2461" - sodipodi:nodetypes="cccsccc" /> - </g> - </g> - </g> - </g> </g> </svg> diff --git a/sflphone-client-gnome/pixmaps/icon_hold.svg b/sflphone-client-gnome/pixmaps/icon_hold.svg index b9e466482e648219dedbb39cb03eff94274b9198..cef71c9ffadb8b3923c8b8a403484fec9af9b67a 100644 --- a/sflphone-client-gnome/pixmaps/icon_hold.svg +++ b/sflphone-client-gnome/pixmaps/icon_hold.svg @@ -310,7 +310,7 @@ borderopacity="1.0" inkscape:pageopacity="0.0" inkscape:pageshadow="2" - inkscape:zoom="11.313708" + inkscape:zoom="22.627416" inkscape:cx="20.635709" inkscape:cy="3.1660007" inkscape:document-units="px" @@ -319,10 +319,10 @@ height="16px" showguides="true" inkscape:guide-bbox="true" - inkscape:window-width="1014" - inkscape:window-height="722" - inkscape:window-x="336" - inkscape:window-y="209" + inkscape:window-width="1920" + inkscape:window-height="1123" + inkscape:window-x="0" + inkscape:window-y="25" showgrid="false"> <sodipodi:guide orientation="vertical" @@ -345,70 +345,12 @@ inkscape:groupmode="layer" id="layer1"> <path - style="opacity:0.63862927;fill:#008080;fill-opacity:1;stroke:#000000;stroke-width:0.31366119;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - d="M 15.342084,2.182836 L 11.077403,3.2426444 L 11.077403,7.29641 C 10.760907,7.2337305 10.361733,7.3044931 9.9828016,7.5083723 C 9.3512499,7.8481706 9.0313299,8.4446298 9.2720221,8.833132 C 9.5127132,9.2216353 10.218401,9.2524174 10.849953,8.912618 C 11.372957,8.6312223 11.678273,8.1813613 11.631811,7.8130673 L 11.646027,7.8130673 L 11.646027,3.9315203 L 14.759243,3.149911 L 14.759243,6.3028409 C 14.444203,6.2434948 14.039627,6.3130472 13.664642,6.5148032 C 13.033091,6.8546005 12.713169,7.4510597 12.953863,7.839563 C 13.194554,8.2280652 13.900241,8.2588452 14.531794,7.9190479 C 15.054799,7.6376522 15.37433,7.1877912 15.327868,6.8194972 L 15.342084,6.8194972 L 15.342084,3.0041875 L 15.342084,2.182836 z" + style="opacity:0.63862927;fill:#008080;fill-opacity:1;stroke:#000000;stroke-width:0.68476206;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="M 15.465893,1.1170368 L 5.625403,3.3060834 L 5.625403,11.679183 C 4.8951078,11.549718 3.9740383,11.695879 3.0996773,12.116993 C 1.6424106,12.818852 0.90421485,14.050844 1.4595972,14.853301 C 2.0149772,15.655759 3.6433086,15.719339 5.100576,15.017479 C 6.3073756,14.436254 7.0118737,13.507061 6.9046654,12.746345 L 6.937468,12.746345 L 6.937468,4.7289645 L 14.121023,3.1145414 L 14.121023,9.6269546 C 13.394087,9.504375 12.460553,9.6480361 11.595299,10.064765 C 10.138033,10.766621 9.3998327,11.998613 9.9552193,12.801073 C 10.510599,13.603528 12.138929,13.667104 13.596198,12.965248 C 14.803001,12.384023 15.540298,11.45483 15.43309,10.694114 L 15.465893,10.694114 L 15.465893,2.8135479 L 15.465893,1.1170368 z" id="path3384" /> <path - style="fill:#008080;fill-opacity:1;stroke:#1d6a6f;stroke-width:0.31366119;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - d="M 14.948121,1.9055546 L 10.68344,2.965363 L 10.68344,7.019129 C 10.366945,6.9564495 9.9677696,7.0272121 9.5888392,7.2310913 C 8.9572871,7.5708895 8.637367,8.1673488 8.8780592,8.555851 C 9.1187504,8.9443543 9.8244374,8.9751363 10.45599,8.635337 C 10.978995,8.3539413 11.284311,7.9040803 11.237848,7.5357852 L 11.252064,7.5357852 L 11.252064,3.6542383 L 14.36528,2.8726298 L 14.36528,6.0255589 C 14.050241,5.9662127 13.645664,6.0357652 13.270679,6.2375212 C 12.639128,6.5773184 12.319207,7.1737787 12.5599,7.5622809 C 12.800591,7.9507842 13.506278,7.9815642 14.137831,7.6417669 C 14.660836,7.3603712 14.980367,6.9105102 14.933905,6.5422162 L 14.948121,6.5422162 L 14.948121,2.7269062 L 14.948121,1.9055546 z" + style="fill:#008080;fill-opacity:1;stroke:#1d6a6f;stroke-width:0.68476206;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="M 14.556848,0.54430888 L 4.7163575,2.7333555 L 4.7163575,11.106456 C 3.9860647,10.976991 3.0649919,11.123152 2.1906333,11.544267 C 0.7333655,12.246124 -0.004830459,13.478118 0.55055203,14.280574 C 1.1059322,15.083031 2.7342617,15.146611 4.1915305,14.444752 C 5.3983326,13.863527 6.1028304,12.934333 5.9956199,12.173616 L 6.0284225,12.173616 L 6.0284225,4.1562353 L 13.211978,2.5418139 L 13.211978,9.0542256 C 12.485045,8.9316454 11.551508,9.0753068 10.686253,9.492036 C 9.2289876,10.193891 8.4907895,11.425887 9.0461739,12.228342 C 9.6015536,13.0308 11.229883,13.094378 12.687154,12.392521 C 13.893955,11.811296 14.631253,10.882103 14.524046,10.121387 L 14.556848,10.121387 L 14.556848,2.2408202 L 14.556848,0.54430888 z" id="path1328" /> - <g - id="g2403" - inkscape:label="Calque 1" - transform="matrix(0.7193364,0,0,0.670354,-2.0317215,-3.0310309e-4)" - style="fill:#008080"> - <g - transform="translate(14.730114,-3.4355522)" - inkscape:label="Calque 1" - id="g2364" - style="fill:#008080"> - <g - id="g2446" - inkscape:label="Calque 1" - transform="translate(7.9455775,4.2707653)" - style="fill:#008080"> - <g - style="fill:#008080;stroke:#000000;stroke-opacity:0.44968555" - transform="matrix(-0.4376782,-0.758081,0.7581751,-0.4377326,3.5952686,30.820492)" - id="g2181"> - <path - sodipodi:nodetypes="csccczccsccccc" - id="path2183" - d="M 41.109694,-0.41817229 C 40.505298,0.20454826 39.040867,0.77635346 37.592239,0.77635106 C 36.102089,0.77635106 34.114653,0.15682998 33.532659,-0.49267807 L 33.569913,-2.0031726 L 33.569913,-3.0835065 C 31.027414,-3.5787101 30.997014,-3.8285637 27.525623,-3.8285643 C 24.054233,-3.8285649 23.830777,-3.5759718 21.29017,-3.0462535 L 21.29017,-0.3436665 C 20.685773,0.27905404 19.221343,0.87609843 17.772714,0.87609724 C 16.282564,0.87609724 14.623294,0.43325774 13.915083,-0.41817229 L 14.138601,-5.7646408 C 18.129172,-7.3187814 22.030595,-8.3970767 27.437882,-8.5586077 C 32.38601,-8.450833 36.259126,-7.7053161 40.886177,-5.8763994 L 41.109694,-0.41817229 z" - style="opacity:1;fill:#008080;fill-opacity:1;stroke:#000000;stroke-width:0.65573961;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.44968555" /> - </g> - <g - transform="matrix(-0.4400595,-0.7622054,0.7622054,-0.4400595,-10.917299,27.830684)" - id="g2451" - style="fill:#008080"> - <path - style="opacity:1;fill:#008080;fill-opacity:1;stroke:#005653;stroke-width:0.625;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - 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" - id="path2453" - sodipodi:nodetypes="cccsccsccsccc" /> - <path - style="opacity:1;fill:#008080;fill-opacity:1;stroke:#005653;stroke-width:0.57204324;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - 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" - id="path2455" - sodipodi:nodetypes="cccsccc" /> - <path - style="opacity:1;fill:#008080;fill-opacity:1;stroke:#005653;stroke-width:0.57204324;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - 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" - id="path2457" - sodipodi:nodetypes="cccsccc" /> - <path - style="opacity:1;fill:#008080;fill-opacity:1;stroke:none;stroke-width:0.57204324;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - d="M 6.6822725,11.157918 C 8.0629923,11.157918 8.7535908,10.73333 9.3296551,10.139801 L 9.0644746,7.3100024 C 8.3276662,7.9882984 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" - id="path2459" - sodipodi:nodetypes="cccsccc" /> - <path - style="opacity:1;fill:#008080;fill-opacity:1;stroke:none;stroke-width:0.57204324;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - 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" - id="path2461" - sodipodi:nodetypes="cccsccc" /> - </g> - </g> - </g> - </g> </g> </svg> diff --git a/sflphone-client-gnome/pixmaps/icon_unhold.svg b/sflphone-client-gnome/pixmaps/icon_unhold.svg index a4535824bd8cfa33b79fd0ac3ccc1bf06055ab60..2276826bf7c37cddfeaf8da4473e9c2cba9f0bd3 100644 --- a/sflphone-client-gnome/pixmaps/icon_unhold.svg +++ b/sflphone-client-gnome/pixmaps/icon_unhold.svg @@ -15,81 +15,154 @@ sodipodi:version="0.32" inkscape:version="0.46" version="1.0" - sodipodi:docbase="/home-local/plbeaudoin/SFLPhone/sflphone/sflphone-gtk/pixmaps" + sodipodi:docbase="/home/plbeaudoin/SFLPhone/sflphone/sflphone-gtk/pixmaps" sodipodi:docname="icon_unhold.svg" - inkscape:output_extension="org.inkscape.output.svg.inkscape"> + inkscape:output_extension="org.inkscape.output.svg.inkscape" + sodipodi:modified="true"> <defs id="defs4"> <linearGradient inkscape:collect="always" - id="linearGradient2500"> + xlink:href="#linearGradient4183" + id="linearGradient2224" + x1="16.826796" + y1="6.7288713" + x2="27.5625" + y2="22.512505" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(0.9873058,0,0,0.8976259,-13.270549,-2.4919705)" /> + <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="perspective159" /> + <linearGradient + id="linearGradient4269"> <stop - style="stop-color:#800000;stop-opacity:1;" + style="stop-color:#00a6b0;stop-opacity:1;" offset="0" - id="stop2502" /> + id="stop4271" /> <stop - style="stop-color:#800000;stop-opacity:0;" + style="stop-color:#00a6b0;stop-opacity:0;" offset="1" - id="stop2504" /> + id="stop4273" /> </linearGradient> <linearGradient - inkscape:collect="always" - xlink:href="#linearGradient2500" - id="linearGradient2506" - x1="4.9409747" - y1="16.528652" - x2="6.2092013" - y2="-3.3282857" - gradientUnits="userSpaceOnUse" /> + id="linearGradient4183"> + <stop + id="stop4185" + offset="0" + style="stop-color:#00a5b0;stop-opacity:1;" /> + <stop + id="stop4187" + offset="1" + style="stop-color:#00595f;stop-opacity:1;" /> + </linearGradient> <linearGradient - inkscape:collect="always" - id="linearGradient2433"> + id="linearGradient4167"> <stop - style="stop-color:#008000;stop-opacity:1;" + style="stop-color:#80000e;stop-opacity:1;" offset="0" - id="stop2435" /> + id="stop4169" /> <stop - style="stop-color:#008000;stop-opacity:0;" + style="stop-color:#b00014;stop-opacity:0;" offset="1" - id="stop2437" /> + id="stop4171" /> </linearGradient> <linearGradient - inkscape:collect="always" - xlink:href="#linearGradient2433" - id="linearGradient2439" - x1="2.965755" - y1="-0.80084854" - x2="32.578228" - y2="16.739393" - gradientUnits="userSpaceOnUse" /> - <inkscape:perspective - sodipodi:type="inkscape:persp3d" - inkscape:vp_x="0 : 8 : 1" - inkscape:vp_y="0 : 1000 : 0" - inkscape:vp_z="16 : 8 : 1" - inkscape:persp3d-origin="8 : 5.3333333 : 1" - id="perspective4283" /> + y2="13.920053" + x2="6.8378897" + y1="12.625902" + x1="2.0651877" + gradientTransform="matrix(-1,0,0,1,32.04188,-2.86473)" + gradientUnits="userSpaceOnUse" + id="linearGradient1416" + xlink:href="#linearGradient4250" + inkscape:collect="always" /> + <linearGradient + gradientTransform="translate(0.426158,-2.762136)" + gradientUnits="userSpaceOnUse" + y2="13.920053" + x2="6.8378897" + y1="12.625902" + x1="2.0651877" + id="linearGradient1414" + xlink:href="#linearGradient4250" + inkscape:collect="always" /> + <linearGradient + gradientUnits="userSpaceOnUse" + y2="10.576721" + x2="14.013638" + y1="2.7028866" + x1="15.647213" + id="linearGradient1412" + xlink:href="#linearGradient4183" + inkscape:collect="always" /> <linearGradient - id="linearGradient3370"> + gradientTransform="translate(-0.947018,-0.885198)" + gradientUnits="userSpaceOnUse" + y2="12.535715" + x2="31.31678" + y1="12.535715" + x1="24.397505" + id="linearGradient1410" + xlink:href="#linearGradient4183" + inkscape:collect="always" /> + <linearGradient + gradientTransform="translate(1.262691,-1.100752)" + gradientUnits="userSpaceOnUse" + y2="12.825893" + x2="7.9239235" + y1="12.825893" + x1="1.0046476" + id="linearGradient1408" + xlink:href="#linearGradient4183" + inkscape:collect="always" /> + <linearGradient + gradientTransform="translate(6.313453e-2,-0.384275)" + gradientUnits="userSpaceOnUse" + y2="16.478132" + x2="20.06057" + y1="23.946518" + x1="7.1249466" + id="linearGradient4173" + xlink:href="#linearGradient4167" + inkscape:collect="always" /> + <linearGradient + id="linearGradient1401"> + <stop + id="stop1403" + offset="0" + style="stop-color:#80000e;stop-opacity:1;" /> + <stop + id="stop1405" + offset="1" + style="stop-color:#b00014;stop-opacity:0;" /> + </linearGradient> + <linearGradient + id="linearGradient1395"> <stop - style="stop-color:#d7d7d7;stop-opacity:1;" + style="stop-color:#b00014;stop-opacity:1;" offset="0" - id="stop3372" /> + id="stop1397" /> <stop - style="stop-color:#7c7c7c;stop-opacity:1;" + style="stop-color:#70000c;stop-opacity:1;" offset="1" - id="stop3374" /> + id="stop1399" /> </linearGradient> <linearGradient - id="linearGradient3362"> + id="linearGradient4250" + inkscape:collect="always"> <stop - style="stop-color:#000000;stop-opacity:1;" + id="stop4252" offset="0" - id="stop3364" /> + style="stop-color:#b00014;stop-opacity:1;" /> <stop - style="stop-color:#ffffff;stop-opacity:1;" + id="stop4254" offset="1" - id="stop3366" /> + style="stop-color:#b00014;stop-opacity:0;" /> </linearGradient> <linearGradient id="linearGradient4045"> @@ -103,38 +176,107 @@ id="stop4049" /> </linearGradient> <linearGradient - id="linearGradient4269"> + id="linearGradient2292"> <stop style="stop-color:#1db000;stop-opacity:1;" offset="0" - id="stop4271" /> + id="stop2294" /> <stop style="stop-color:#1db000;stop-opacity:0;" offset="1" - id="stop4273" /> + id="stop2296" /> </linearGradient> <linearGradient - id="linearGradient4183"> + id="linearGradient2298"> <stop - id="stop4185" + id="stop2300" offset="0" style="stop-color:#1db000;stop-opacity:1;" /> <stop - id="stop4187" + id="stop2302" offset="1" style="stop-color:#0f5f00;stop-opacity:1;" /> </linearGradient> <linearGradient - id="linearGradient4167"> + id="linearGradient2304"> <stop style="stop-color:#80000e;stop-opacity:1;" offset="0" - id="stop4169" /> + id="stop2306" /> <stop style="stop-color:#b00014;stop-opacity:0;" offset="1" - id="stop4171" /> + id="stop2308" /> </linearGradient> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient4183" + id="linearGradient2310" + x1="10.57493" + y1="12.115559" + x2="-0.68574232" + y2="12.115559" + gradientUnits="userSpaceOnUse" + gradientTransform="translate(1.262691,-1.100752)" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient4183" + id="linearGradient2312" + x1="31.692968" + y1="11.264216" + x2="23.888865" + y2="13.35532" + gradientUnits="userSpaceOnUse" + gradientTransform="translate(-0.947018,-0.885198)" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient4183" + id="linearGradient2314" + x1="15.647213" + y1="2.7028866" + x2="14.013638" + y2="10.576721" + gradientUnits="userSpaceOnUse" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient4269" + id="linearGradient2316" + x1="7.8517423" + y1="15.912388" + x2="7.1114841" + y2="11.597325" + gradientUnits="userSpaceOnUse" + gradientTransform="translate(0.426158,-2.762136)" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient4269" + id="linearGradient2318" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(-1,0,0,1,32.04188,-2.86473)" + x1="2.0651877" + y1="12.625902" + x2="6.8378897" + y2="13.920053" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient4183" + id="linearGradient2320" + x1="16.826796" + y1="6.7288713" + x2="27.5625" + y2="22.512505" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(0.875025,0,0,0.875025,0.666703,0.177907)" /> + <linearGradient + gradientTransform="matrix(1.62913,0,0,-1.62913,-10.06608,39.71987)" + gradientUnits="userSpaceOnUse" + y2="6.6770978" + x2="15.806232" + y1="22.874208" + x1="15.630395" + id="linearGradient4275" + xlink:href="#linearGradient4269" + inkscape:collect="always" /> <linearGradient y2="13.920053" x2="6.8378897" @@ -229,7 +371,7 @@ <linearGradient inkscape:collect="always" xlink:href="#linearGradient4183" - id="linearGradient1408" + id="linearGradient2417" gradientUnits="userSpaceOnUse" gradientTransform="translate(1.262691,-1.100752)" x1="10.57493" @@ -239,7 +381,7 @@ <linearGradient inkscape:collect="always" xlink:href="#linearGradient4183" - id="linearGradient1410" + id="linearGradient2415" gradientUnits="userSpaceOnUse" gradientTransform="translate(-0.947018,-0.885198)" x1="31.692968" @@ -249,7 +391,7 @@ <linearGradient inkscape:collect="always" xlink:href="#linearGradient4269" - id="linearGradient1412" + id="linearGradient2413" gradientUnits="userSpaceOnUse" gradientTransform="translate(0.426158,-2.762136)" x1="7.8517423" @@ -259,49 +401,465 @@ <linearGradient inkscape:collect="always" xlink:href="#linearGradient4269" - id="linearGradient1414" + id="linearGradient2411" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(-1,0,0,1,32.04188,-2.86473)" + x1="2.0651877" + y1="12.625902" + x2="6.8378897" + y2="13.920053" /> + <radialGradient + inkscape:collect="always" + xlink:href="#linearGradient4045" + id="radialGradient4051" + cx="19.285715" + cy="9.8571424" + fx="19.285715" + fy="9.8571424" + r="10.885714" gradientUnits="userSpaceOnUse" + spreadMethod="reflect" + gradientTransform="matrix(0.418975,0,0,0.418975,11.20548,5.727248)" /> + <linearGradient + y2="13.920053" + x2="6.8378897" + y1="12.625902" + x1="2.0651877" gradientTransform="matrix(-1,0,0,1,32.04188,-2.86473)" + gradientUnits="userSpaceOnUse" + id="linearGradient2491" + xlink:href="#linearGradient4269" + inkscape:collect="always" /> + <linearGradient + y2="12.113755" + x2="7.293807" + y1="16.110582" + x1="11.408385" + gradientTransform="translate(0.426158,-2.762136)" + gradientUnits="userSpaceOnUse" + id="linearGradient2489" + xlink:href="#linearGradient4269" + inkscape:collect="always" /> + <linearGradient + y2="13.35532" + x2="23.888865" + y1="11.264216" + x1="31.692968" + gradientTransform="translate(-0.947018,-0.885198)" + gradientUnits="userSpaceOnUse" + id="linearGradient2487" + xlink:href="#linearGradient4183" + inkscape:collect="always" /> + <linearGradient + y2="12.949513" + x2="2.7672646" + y1="12.115559" + x1="10.57493" + gradientTransform="translate(1.262691,-1.100752)" + gradientUnits="userSpaceOnUse" + id="linearGradient2485" + xlink:href="#linearGradient4183" + inkscape:collect="always" /> + <linearGradient + y2="10.576721" + x2="14.013638" + y1="2.7028866" + x1="15.647213" + gradientUnits="userSpaceOnUse" + id="linearGradient2483" + xlink:href="#linearGradient4183" + inkscape:collect="always" /> + <linearGradient + id="linearGradient2416"> + <stop + style="stop-color:#26b000;stop-opacity:1;" + offset="0" + id="stop2418" /> + <stop + style="stop-color:#26b000;stop-opacity:0;" + offset="1" + id="stop2420" /> + </linearGradient> + <linearGradient + id="linearGradient2422"> + <stop + id="stop2424" + offset="0" + style="stop-color:#26b000;stop-opacity:1;" /> + <stop + id="stop2426" + offset="1" + style="stop-color:#145f00;stop-opacity:1;" /> + </linearGradient> + <linearGradient + id="linearGradient2428"> + <stop + style="stop-color:#80000e;stop-opacity:1;" + offset="0" + id="stop2430" /> + <stop + style="stop-color:#b00014;stop-opacity:0;" + offset="1" + id="stop2432" /> + </linearGradient> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient4183" + id="linearGradient2434" + x1="1.0046476" + y1="12.825893" + x2="7.9239235" + y2="12.825893" + gradientUnits="userSpaceOnUse" + gradientTransform="translate(1.9220986,-1.100752)" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient4183" + id="linearGradient2436" + x1="24.397505" + y1="12.535715" + x2="31.31678" + y2="12.535715" + gradientUnits="userSpaceOnUse" + gradientTransform="translate(-1.9107675,-0.885198)" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient4183" + id="linearGradient2438" + x1="15.647213" + y1="2.7028866" + x2="14.013638" + y2="10.576721" + gradientUnits="userSpaceOnUse" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient4269" + id="linearGradient2440" + x1="2.0651877" + y1="12.625902" + x2="6.8378897" + y2="13.920053" + gradientUnits="userSpaceOnUse" + gradientTransform="translate(1.1362892,-2.762136)" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient4269" + id="linearGradient2442" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(-1,0,0,1,31.179578,-2.86473)" x1="2.0651877" y1="12.625902" x2="6.8378897" y2="13.920053" /> <linearGradient inkscape:collect="always" - xlink:href="#linearGradient2500" - id="linearGradient3326" + xlink:href="#linearGradient4269" + id="linearGradient2444" + x1="15.630395" + y1="22.874208" + x2="15.630395" + y2="8.5305319" gradientUnits="userSpaceOnUse" - x1="4.9409747" - y1="16.528652" - x2="6.2092013" - y2="-3.3282857" /> + gradientTransform="matrix(1.256521,0,0,-1.256521,-7.854319,28.773309)" /> + <radialGradient + gradientTransform="matrix(0.418975,0,0,0.418975,11.20548,5.727248)" + spreadMethod="reflect" + gradientUnits="userSpaceOnUse" + r="10.885714" + fy="9.8571424" + fx="19.285715" + cy="9.8571424" + cx="19.285715" + id="radialGradient2342" + xlink:href="#linearGradient4045" + inkscape:collect="always" /> + <linearGradient + y2="13.920053" + x2="6.8378897" + y1="12.625902" + x1="2.0651877" + gradientTransform="matrix(-1,0,0,1,32.04188,-2.86473)" + gradientUnits="userSpaceOnUse" + id="linearGradient2340" + xlink:href="#linearGradient4269" + inkscape:collect="always" /> + <linearGradient + y2="11.597325" + x2="7.1114841" + y1="15.912388" + x1="7.8517423" + gradientTransform="translate(0.426158,-2.762136)" + gradientUnits="userSpaceOnUse" + id="linearGradient2338" + xlink:href="#linearGradient4269" + inkscape:collect="always" /> + <linearGradient + y2="13.35532" + x2="23.888865" + y1="11.264216" + x1="31.692968" + gradientTransform="translate(-0.947018,-0.885198)" + gradientUnits="userSpaceOnUse" + id="linearGradient2336" + xlink:href="#linearGradient4183" + inkscape:collect="always" /> + <linearGradient + y2="12.115559" + x2="-0.68574232" + y1="12.115559" + x1="10.57493" + gradientTransform="translate(1.262691,-1.100752)" + gradientUnits="userSpaceOnUse" + id="linearGradient2334" + xlink:href="#linearGradient4183" + inkscape:collect="always" /> + <linearGradient + y2="10.576721" + x2="14.013638" + y1="2.7028866" + x1="15.647213" + gradientUnits="userSpaceOnUse" + id="linearGradient2332" + xlink:href="#linearGradient4183" + inkscape:collect="always" /> + <linearGradient + id="linearGradient2326"> + <stop + style="stop-color:#26b000;stop-opacity:1;" + offset="0" + id="stop2328" /> + <stop + style="stop-color:#26b000;stop-opacity:0;" + offset="1" + id="stop2330" /> + </linearGradient> + <linearGradient + id="linearGradient2372"> + <stop + id="stop2322" + offset="0" + style="stop-color:#26b000;stop-opacity:1;" /> + <stop + id="stop2324" + offset="1" + style="stop-color:#145f00;stop-opacity:1;" /> + </linearGradient> + <linearGradient + id="linearGradient2376"> + <stop + style="stop-color:#80000e;stop-opacity:1;" + offset="0" + id="stop2316" /> + <stop + style="stop-color:#b00014;stop-opacity:0;" + offset="1" + id="stop2318" /> + </linearGradient> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient4183" + id="linearGradient2380" + x1="1.0046476" + y1="12.825893" + x2="7.9239235" + y2="12.825893" + gradientUnits="userSpaceOnUse" + gradientTransform="translate(1.262691,-1.100752)" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient4183" + id="linearGradient2382" + x1="24.397505" + y1="12.535715" + x2="31.31678" + y2="12.535715" + gradientUnits="userSpaceOnUse" + gradientTransform="translate(-0.947018,-0.885198)" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient4183" + id="linearGradient2308" + x1="15.647213" + y1="2.7028866" + x2="14.013638" + y2="10.576721" + gradientUnits="userSpaceOnUse" /> <linearGradient inkscape:collect="always" - xlink:href="#linearGradient2500" - id="linearGradient3338" + xlink:href="#linearGradient4269" + id="linearGradient2306" + x1="2.0651877" + y1="12.625902" + x2="6.8378897" + y2="13.920053" gradientUnits="userSpaceOnUse" - x1="4.9409747" - y1="16.528652" - x2="6.2092013" - y2="-3.3282857" /> + gradientTransform="translate(0.426158,-2.762136)" /> <linearGradient inkscape:collect="always" - xlink:href="#linearGradient2500" - id="linearGradient3340" + xlink:href="#linearGradient4269" + id="linearGradient2386" gradientUnits="userSpaceOnUse" - x1="4.9409747" - y1="16.528652" - x2="6.2092013" - y2="-3.3282857" /> + gradientTransform="matrix(-1,0,0,1,32.04188,-2.86473)" + x1="2.0651877" + y1="12.625902" + x2="6.8378897" + y2="13.920053" /> + <linearGradient + gradientTransform="matrix(0.875025,0,0,0.875025,0.666703,0.177907)" + gradientUnits="userSpaceOnUse" + y2="22.512505" + x2="27.5625" + y1="6.7288713" + x1="16.826796" + id="linearGradient2302" + xlink:href="#linearGradient4183" + inkscape:collect="always" /> + <linearGradient + id="linearGradient2296"> + <stop + id="stop2298" + offset="0" + style="stop-color:#80000e;stop-opacity:1;" /> + <stop + id="stop2391" + offset="1" + style="stop-color:#b00014;stop-opacity:0;" /> + </linearGradient> + <linearGradient + id="linearGradient2290"> + <stop + style="stop-color:#1db000;stop-opacity:1;" + offset="0" + id="stop2292" /> + <stop + style="stop-color:#0f5f00;stop-opacity:1;" + offset="1" + id="stop2395" /> + </linearGradient> + <linearGradient + id="linearGradient2284"> + <stop + id="stop2286" + offset="0" + style="stop-color:#1db000;stop-opacity:1;" /> + <stop + id="stop2288" + offset="1" + style="stop-color:#1db000;stop-opacity:0;" /> + </linearGradient> + <linearGradient + id="linearGradient2278"> + <stop + id="stop2280" + offset="0" + style="stop-color:#ffffff;stop-opacity:0" /> + <stop + id="stop2282" + offset="1" + style="stop-color:#fefee7;stop-opacity:0.89308178" /> + </linearGradient> + <linearGradient + gradientTransform="matrix(0.632388,0,0,0.632388,3.258093,0.894991)" + gradientUnits="userSpaceOnUse" + y2="22.512505" + x2="27.5625" + y1="6.7288713" + x1="16.826796" + id="linearGradient2355" + xlink:href="#linearGradient4183" + inkscape:collect="always" /> + <linearGradient + y2="13.920053" + x2="6.8378897" + y1="12.625902" + x1="2.0651877" + gradientTransform="matrix(-1,0,0,1,32.04188,-2.86473)" + gradientUnits="userSpaceOnUse" + id="linearGradient2353" + xlink:href="#linearGradient4269" + inkscape:collect="always" /> + <linearGradient + gradientTransform="translate(0.426158,-2.762136)" + gradientUnits="userSpaceOnUse" + y2="11.597325" + x2="7.1114841" + y1="15.912388" + x1="7.8517423" + id="linearGradient2351" + xlink:href="#linearGradient4269" + inkscape:collect="always" /> + <linearGradient + gradientUnits="userSpaceOnUse" + y2="10.576721" + x2="14.013638" + y1="2.7028866" + x1="15.647213" + id="linearGradient2349" + xlink:href="#linearGradient4183" + inkscape:collect="always" /> + <linearGradient + gradientTransform="translate(-0.947018,-0.885198)" + gradientUnits="userSpaceOnUse" + y2="13.35532" + x2="23.888865" + y1="11.264216" + x1="31.692968" + id="linearGradient2347" + xlink:href="#linearGradient4183" + inkscape:collect="always" /> + <linearGradient + gradientTransform="translate(1.262691,-1.100752)" + gradientUnits="userSpaceOnUse" + y2="12.115559" + x2="-0.68574232" + y1="12.115559" + x1="10.57493" + id="linearGradient2345" + xlink:href="#linearGradient4183" + inkscape:collect="always" /> + <linearGradient + id="linearGradient2339"> + <stop + id="stop2341" + offset="0" + style="stop-color:#80000e;stop-opacity:1;" /> + <stop + id="stop2343" + offset="1" + style="stop-color:#b00014;stop-opacity:0;" /> + </linearGradient> + <linearGradient + id="linearGradient2333"> + <stop + style="stop-color:#00a5b0;stop-opacity:1;" + offset="0" + id="stop2335" /> + <stop + style="stop-color:#00595f;stop-opacity:1;" + offset="1" + id="stop2337" /> + </linearGradient> + <linearGradient + id="linearGradient2327"> + <stop + id="stop2329" + offset="0" + style="stop-color:#00a6b0;stop-opacity:1;" /> + <stop + id="stop2331" + offset="1" + style="stop-color:#00a6b0;stop-opacity:0;" /> + </linearGradient> <linearGradient inkscape:collect="always" - xlink:href="#linearGradient2500" - id="linearGradient3342" + xlink:href="#linearGradient4183" + id="linearGradient2469" gradientUnits="userSpaceOnUse" - x1="4.9409747" - y1="16.528652" - x2="6.2092013" - y2="-3.3282857" /> + gradientTransform="matrix(0.684918,0,0,0.684918,2.618701,-0.775487)" + x1="16.826796" + y1="6.7288713" + x2="27.5625" + y2="22.512505" /> </defs> <sodipodi:namedview id="base" @@ -310,23 +868,27 @@ borderopacity="1.0" inkscape:pageopacity="0.0" inkscape:pageshadow="2" - inkscape:zoom="11.313708" - inkscape:cx="20.635709" - inkscape:cy="3.1660007" + inkscape:zoom="22.627417" + inkscape:cx="9.4712396" + inkscape:cy="9.7177026" inkscape:document-units="px" inkscape:current-layer="layer1" - width="16px" - height="16px" + width="32px" + height="32px" showguides="true" inkscape:guide-bbox="true" - inkscape:window-width="1014" - inkscape:window-height="722" - inkscape:window-x="336" - inkscape:window-y="209" + inkscape:window-width="1920" + inkscape:window-height="1123" + inkscape:window-x="0" + inkscape:window-y="25" showgrid="false"> + <sodipodi:guide + orientation="horizontal" + position="8.0357143" + id="guide3144" /> <sodipodi:guide orientation="vertical" - position="24.821428" + position="15.982143" id="guide3146" /> </sodipodi:namedview> <metadata @@ -344,98 +906,30 @@ inkscape:label="Calque 1" inkscape:groupmode="layer" id="layer1"> - <g - id="g2453" - inkscape:label="Calque 1" - transform="matrix(0.7134153,0,0,0.6688126,-0.1384675,-7.9825942e-2)" - style="fill:#008080"> - <path - id="path3384" - d="M 21.038321,3.4034084 L 15.10969,4.9843766 L 15.10969,11.031579 C 14.669707,10.938077 14.114787,11.043637 13.588009,11.347773 C 12.710044,11.854667 12.265301,12.744435 12.599904,13.323983 C 12.934506,13.903532 13.915531,13.949451 14.793496,13.442556 C 15.520561,13.022784 15.945002,12.351704 15.880412,11.802301 L 15.900174,11.802301 L 15.900174,6.0120062 L 20.228074,4.8460419 L 20.228074,9.5494222 C 19.790115,9.4608922 19.227685,9.5646472 18.706392,9.8656162 C 17.828428,10.372509 17.383684,11.262277 17.718288,11.841826 C 18.05289,12.421374 19.033915,12.467291 19.911881,11.960398 C 20.638946,11.540626 21.083149,10.869547 21.018559,10.320144 L 21.038321,10.320144 L 21.038321,4.6286588 L 21.038321,3.4034084 z" - style="opacity:0.08099688;fill:#008080;fill-opacity:1;stroke:#000000;stroke-width:0.45169228;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <path - id="path2456" - d="M 20.490646,2.9897742 L 14.562015,4.5707424 L 14.562015,10.617945 C 14.122032,10.524443 13.567112,10.630003 13.040334,10.934139 C 12.162369,11.441033 11.717626,12.330801 12.052229,12.910349 C 12.386831,13.489898 13.367856,13.535817 14.245821,13.028922 C 14.972886,12.60915 15.397327,11.93807 15.332737,11.388667 L 15.352499,11.388667 L 15.352499,5.5983718 L 19.680399,4.4324077 L 19.680399,9.1357875 C 19.24244,9.047258 18.68001,9.1510128 18.158717,9.4519815 C 17.280753,9.9588749 16.836009,10.848643 17.170613,11.428192 C 17.505215,12.00774 18.48624,12.053657 19.364206,11.546764 C 20.091271,11.126992 20.535474,10.455913 20.470884,9.9065097 L 20.490646,9.9065097 L 20.490646,4.2150246 L 20.490646,2.9897742 z" - style="opacity:0.32398753;fill:#008080;fill-opacity:1;stroke:#1d6a6f;stroke-width:0.45169228;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <g - transform="translate(-3.1142216,0.1467125)" - inkscape:label="Calque 1" - id="g2403" - style="fill:#008080"> - <g - id="g2364" - inkscape:label="Calque 1" - transform="translate(14.730114,-3.4355522)" - style="fill:#008080"> - <g - transform="translate(7.9455775,4.2707653)" - inkscape:label="Calque 1" - id="g2446" - style="fill:#008080"> - <g - id="g2181" - transform="matrix(-0.4376782,-0.758081,0.7581751,-0.4377326,3.5952686,30.820492)" - style="fill:#008080;stroke:#000000;stroke-opacity:0.44968555"> - <path - style="opacity:1;fill:#008080;fill-opacity:1;stroke:#000000;stroke-width:0.65573961;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.44968555" - d="M 41.109694,-0.41817229 C 40.505298,0.20454826 39.040867,0.77635346 37.592239,0.77635106 C 36.102089,0.77635106 34.114653,0.15682998 33.532659,-0.49267807 L 33.569913,-2.0031726 L 33.569913,-3.0835065 C 31.027414,-3.5787101 30.997014,-3.8285637 27.525623,-3.8285643 C 24.054233,-3.8285649 23.830777,-3.5759718 21.29017,-3.0462535 L 21.29017,-0.3436665 C 20.685773,0.27905404 19.221343,0.87609843 17.772714,0.87609724 C 16.282564,0.87609724 14.623294,0.43325774 13.915083,-0.41817229 L 14.138601,-5.7646408 C 18.129172,-7.3187814 22.030595,-8.3970767 27.437882,-8.5586077 C 32.38601,-8.450833 36.259126,-7.7053161 40.886177,-5.8763994 L 41.109694,-0.41817229 z" - id="path2183" - sodipodi:nodetypes="csccczccsccccc" /> - </g> - <g - id="g2451" - transform="matrix(-0.4400595,-0.7622054,0.7622054,-0.4400595,-10.917299,27.830684)" - style="fill:#008080"> - <path - sodipodi:nodetypes="cccsccsccsccc" - id="path2453" - 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:#008080;fill-opacity:1;stroke:#005653;stroke-width:0.625;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> - <path - sodipodi:nodetypes="cccsccc" - id="path2455" - 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:#008080;fill-opacity:1;stroke:#005653;stroke-width:0.57204324;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> - <path - sodipodi:nodetypes="cccsccc" - id="path2457" - 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:#008080;fill-opacity:1;stroke:#005653;stroke-width:0.57204324;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> - <path - sodipodi:nodetypes="cccsccc" - id="path2459" - d="M 6.6822725,11.157918 C 8.0629923,11.157918 8.7535908,10.73333 9.3296551,10.139801 L 9.0644746,7.3100024 C 8.3276662,7.9882984 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:#008080;fill-opacity:1;stroke:none;stroke-width:0.57204324;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> - <path - sodipodi:nodetypes="cccsccc" - id="path2461" - 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:#008080;fill-opacity:1;stroke:none;stroke-width:0.57204324;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> - </g> - </g> - </g> - </g> - </g> <g id="g1418" inkscape:label="Calque 1" - transform="matrix(0.4731337,0,0,0.4435535,21.103584,1.7278131)" - style="fill:#008080;stroke:#006c73;stroke-width:3.68368101;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"> + transform="matrix(1.1069148,0,0,1.113575,29.062061,0.1793429)" + style="stroke:#006c73;stroke-width:3.68368101;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"> <g id="g1444" transform="matrix(0.491592,0,0,0.491592,-26.9581,-0.76797)" - style="fill:#008080;stroke:#006c73;stroke-width:7.49337053;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"> + style="stroke:#006c73;stroke-width:7.49337053;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"> <path - style="fill:#008080;fill-opacity:0.75;fill-rule:evenodd;stroke:#006c73;stroke-width:7.49337053;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#006c73;stroke-width:7.49337053;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" d="M 5.3208165,5.0274423 L 27.017246,26.72387" id="path1332" sodipodi:nodetypes="cc" /> <path - style="fill:#008080;fill-opacity:0.75;fill-rule:evenodd;stroke:#006c73;stroke-width:7.49337053;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#006c73;stroke-width:7.49337053;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" d="M 5.3208161,26.72387 L 27.017246,5.0274427" id="path1334" sodipodi:nodetypes="cc" /> </g> </g> + <path + style="opacity:0.62999998;fill:url(#linearGradient2224);fill-opacity:1;stroke:#1d6a6f;stroke-width:0.67240757;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="M 13.633502,0.48141261 L 4.3775215,2.7254748 L 4.3775215,11.309013 C 3.6906049,11.176294 2.8242449,11.326128 2.001821,11.757825 C 0.63111188,12.477321 -0.063236118,13.740279 0.45915758,14.562903 C 0.98154968,15.385528 2.5131595,15.450707 3.8838686,14.731208 C 5.0189874,14.135374 5.6816389,13.182828 5.5807992,12.402993 L 5.6116518,12.402993 L 5.6116518,4.1841155 L 12.368517,2.5291195 L 12.368517,9.205204 C 11.684761,9.079544 10.806676,9.226816 9.9928152,9.654017 C 8.6221082,10.373513 7.9277592,11.63647 8.4501542,12.459096 C 8.9725452,13.28172 10.504156,13.346895 11.874867,12.627399 C 13.009985,12.031566 13.70349,11.07902 13.602649,10.299185 L 13.633502,10.299185 L 13.633502,2.2205609 L 13.633502,0.48141261 z" + id="path1328" /> </g> </svg> diff --git a/sflphone-client-gnome/pixmaps/incoming.svg b/sflphone-client-gnome/pixmaps/incoming.svg index 7f68789769e55902650229d7f89c8f31c227f5a5..3cd35ac1499be20876f4cd79689549ef53b991bd 100644 --- a/sflphone-client-gnome/pixmaps/incoming.svg +++ b/sflphone-client-gnome/pixmaps/incoming.svg @@ -21,6 +21,55 @@ sodipodi:modified="true"> <defs id="defs4"> + <linearGradient + y2="13.920053" + x2="6.8378897" + y1="12.625902" + x1="2.0651877" + gradientTransform="matrix(-1,0,0,1,32.04188,-2.86473)" + gradientUnits="userSpaceOnUse" + id="linearGradient2491" + xlink:href="#linearGradient4269" + inkscape:collect="always" /> + <linearGradient + y2="12.113755" + x2="7.293807" + y1="16.110582" + x1="11.408385" + gradientTransform="translate(0.426158,-2.762136)" + gradientUnits="userSpaceOnUse" + id="linearGradient2489" + xlink:href="#linearGradient4269" + inkscape:collect="always" /> + <linearGradient + y2="13.35532" + x2="23.888865" + y1="11.264216" + x1="31.692968" + gradientTransform="translate(-0.947018,-0.885198)" + gradientUnits="userSpaceOnUse" + id="linearGradient2487" + xlink:href="#linearGradient4183" + inkscape:collect="always" /> + <linearGradient + y2="12.949513" + x2="2.7672646" + y1="12.115559" + x1="10.57493" + gradientTransform="translate(1.262691,-1.100752)" + gradientUnits="userSpaceOnUse" + id="linearGradient2485" + xlink:href="#linearGradient4183" + inkscape:collect="always" /> + <linearGradient + y2="10.576721" + x2="14.013638" + y1="2.7028866" + x1="15.647213" + gradientUnits="userSpaceOnUse" + id="linearGradient2483" + xlink:href="#linearGradient4183" + inkscape:collect="always" /> <linearGradient inkscape:collect="always" id="linearGradient2772"> @@ -94,7 +143,7 @@ x2="-3.8121746" y2="9.3760633" gradientUnits="userSpaceOnUse" - gradientTransform="matrix(0.668614,0,0,1,3.7748346,0.1767767)" /> + gradientTransform="matrix(-0.8262245,0,0,1.1530286,21.450158,0.7307096)" /> <linearGradient inkscape:collect="always" xlink:href="#linearGradient2772" @@ -121,14 +170,14 @@ height="32px" showguides="true" inkscape:guide-bbox="true" - inkscape:window-width="1331" - inkscape:window-height="922" - inkscape:window-x="169" - inkscape:window-y="24" + inkscape:window-width="1920" + inkscape:window-height="1123" + inkscape:window-x="0" + inkscape:window-y="25" showgrid="false"> <sodipodi:guide orientation="vertical" - position="15.982143" + position="16.970563,9.4575536" id="guide3146" /> </sodipodi:namedview> <metadata @@ -147,38 +196,57 @@ 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" + style="opacity:1;fill:url(#linearGradient2511);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 24.599869,5.8821885 L 14.31552,5.8821885 L 14.31552,1.2188523 L 6.5292625,11.541578 L 14.31552,21.864303 L 14.31552,17.200965 L 24.599869,17.200965 L 24.599869,5.8821885 z" id="rect4262" /> <g - id="g4160" - transform="matrix(0.3274903,-0.8169208,-0.8169208,-0.3274903,19.715453,28.330727)" - style="fill:url(#linearGradient2778);fill-opacity:1"> - <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:url(#linearGradient2778);fill-opacity:1.0;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:url(#linearGradient2778);fill-opacity:1.0;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:url(#linearGradient2778);fill-opacity:1.0;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:url(#linearGradient2778);fill-opacity:1.0;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:url(#linearGradient2778);fill-opacity:1.0;stroke:none;stroke-width:0.57204323999999995;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + id="g2364" + inkscape:label="Calque 1" + transform="matrix(0.7988192,0.4342103,-0.432441,0.795564,14.187414,0.5419157)"> + <g + transform="translate(7.9455775,4.2707653)" + inkscape:label="Calque 1" + id="g2446"> + <g + id="g2181" + transform="matrix(-0.4376782,-0.758081,0.7581751,-0.4377326,3.5952686,30.820492)" + style="fill:none;stroke:#000000;stroke-opacity:0.44968555"> + <path + style="opacity:1;fill:none;fill-opacity:1;stroke:#000000;stroke-width:0.65573961;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.44968555" + d="M 41.109694,-0.41817229 C 40.505298,0.20454826 39.040867,0.77635346 37.592239,0.77635106 C 36.102089,0.77635106 34.114653,0.15682998 33.532659,-0.49267807 L 33.569913,-2.0031726 L 33.569913,-3.0835065 C 31.027414,-3.5787101 30.997014,-3.8285637 27.525623,-3.8285643 C 24.054233,-3.8285649 23.830777,-3.5759718 21.29017,-3.0462535 L 21.29017,-0.3436665 C 20.685773,0.27905404 19.221343,0.87609843 17.772714,0.87609724 C 16.282564,0.87609724 14.623294,0.43325774 13.915083,-0.41817229 L 14.138601,-5.7646408 C 18.129172,-7.3187814 22.030595,-8.3970767 27.437882,-8.5586077 C 32.38601,-8.450833 36.259126,-7.7053161 40.886177,-5.8763994 L 41.109694,-0.41817229 z" + id="path2183" + sodipodi:nodetypes="csccczccsccccc" /> + </g> + <g + id="g2451" + transform="matrix(-0.4400595,-0.7622054,0.7622054,-0.4400595,-10.917299,27.830684)"> + <path + sodipodi:nodetypes="cccsccsccsccc" + id="path2453" + 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:url(#linearGradient2483);fill-opacity:1;stroke:#0f5600;stroke-width:0.625;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <path + sodipodi:nodetypes="cccsccc" + id="path2455" + 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:url(#linearGradient2485);fill-opacity:1;stroke:#0f5600;stroke-width:0.57204324;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <path + sodipodi:nodetypes="cccsccc" + id="path2457" + 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:url(#linearGradient2487);fill-opacity:1;stroke:#0f5600;stroke-width:0.57204324;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <path + sodipodi:nodetypes="cccsccc" + id="path2459" + d="M 6.6822725,11.157918 C 8.0629923,11.157918 8.7535908,10.73333 9.3296551,10.139801 L 9.0644746,7.3100024 C 8.3276662,7.9882984 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:url(#linearGradient2489);fill-opacity:1;stroke:none;stroke-width:0.57204324;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <path + sodipodi:nodetypes="cccsccc" + id="path2461" + 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:url(#linearGradient2491);fill-opacity:1;stroke:none;stroke-width:0.57204324;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + </g> + </g> </g> </g> </svg> diff --git a/sflphone-client-gnome/pixmaps/mailbox.svg b/sflphone-client-gnome/pixmaps/mailbox.svg index 34f9fbd6b66c4d84337ca23dd4c3de14203455c6..2a2cec4ac01bc0dfcc164407ddb34643bef7c9fd 100644 --- a/sflphone-client-gnome/pixmaps/mailbox.svg +++ b/sflphone-client-gnome/pixmaps/mailbox.svg @@ -60,7 +60,7 @@ xlink:href="#linearGradient6984" id="linearGradient6335" gradientUnits="userSpaceOnUse" - gradientTransform="matrix(0.4012864,0,0,0.2705794,6.757826,-10.140964)" + gradientTransform="matrix(0.6363867,0,0,0.4838745,-2.7900741,-17.395207)" x1="14.125" y1="79.81311" x2="14.125" @@ -70,7 +70,7 @@ xlink:href="#linearGradient6945" id="radialGradient6338" gradientUnits="userSpaceOnUse" - gradientTransform="matrix(1.0466849,0,0,0.5986706,-3.652096,-30.756483)" + gradientTransform="matrix(1.659903,0,0,1.0705967,-19.298824,-54.261732)" cx="13.107393" cy="61.48016" fx="13.107393" @@ -114,7 +114,7 @@ xlink:href="#linearGradient7088" id="linearGradient7351" gradientUnits="userSpaceOnUse" - gradientTransform="matrix(0.4012507,0,0,0.2842508,6.356883,-0.2587693)" + gradientTransform="matrix(0.6363302,0,0,0.5083228,-3.4259158,0.2770224)" x1="9.9965248" y1="21.246521" x2="9.9965248" @@ -140,7 +140,7 @@ y1="19.584124" x2="9.0107775" y2="24.779999" - gradientTransform="matrix(0.4097916,0,0,0.2742861,6.147632,-0.2598906)" /> + gradientTransform="matrix(0.6498748,0,0,0.490503,-3.75776,0.2750172)" /> <linearGradient inkscape:collect="always" id="linearGradient7067"> @@ -158,7 +158,7 @@ xlink:href="#linearGradient7067" id="radialGradient7354" gradientUnits="userSpaceOnUse" - gradientTransform="matrix(0.6113826,0,0,0.3630152,1.435442,-2.6744773)" + gradientTransform="matrix(0.9695713,0,0,0.6491763,-11.230666,-4.0429636)" cx="26.762928" cy="25.349953" fx="26.762928" @@ -181,7 +181,7 @@ xlink:href="#linearGradient7002" id="linearGradient6357" gradientUnits="userSpaceOnUse" - gradientTransform="matrix(0.4012864,0,0,0.3083575,6.35654,-0.4859523)" + gradientTransform="matrix(0.6363867,0,0,0.5514327,-3.4264602,-0.1292465)" x1="15.75" y1="24.561808" x2="15.75" @@ -191,7 +191,7 @@ xlink:href="#linearGradient6945" id="radialGradient6362" gradientUnits="userSpaceOnUse" - gradientTransform="matrix(1.0466849,0,0,-0.5986706,-3.652096,46.20464)" + gradientTransform="matrix(1.659903,0,0,-1.0705967,-19.298824,83.367071)" cx="13.107393" cy="61.48016" fx="13.107393" @@ -601,15 +601,6 @@ x2="25.153345" y2="24.96549" gradientUnits="userSpaceOnUse" /> - <linearGradient - inkscape:collect="always" - xlink:href="#linearGradient2542" - id="linearGradient6010" - gradientUnits="userSpaceOnUse" - x1="-2.1546042" - y1="-7.1975217" - x2="25.153345" - y2="24.96549" /> <linearGradient inkscape:collect="always" xlink:href="#linearGradient2542" @@ -619,51 +610,6 @@ y1="-7.1975217" x2="25.153345" y2="24.96549" /> - <linearGradient - inkscape:collect="always" - xlink:href="#linearGradient2542" - id="linearGradient6014" - gradientUnits="userSpaceOnUse" - x1="-2.1546042" - y1="-7.1975217" - x2="25.153345" - y2="24.96549" /> - <linearGradient - inkscape:collect="always" - xlink:href="#linearGradient2542" - id="linearGradient6016" - gradientUnits="userSpaceOnUse" - x1="-2.1546042" - y1="-7.1975217" - x2="25.153345" - y2="24.96549" /> - <linearGradient - inkscape:collect="always" - xlink:href="#linearGradient2542" - id="linearGradient6018" - gradientUnits="userSpaceOnUse" - x1="-2.1546042" - y1="-7.1975217" - x2="25.153345" - y2="24.96549" /> - <linearGradient - inkscape:collect="always" - xlink:href="#linearGradient2542" - id="linearGradient6020" - gradientUnits="userSpaceOnUse" - x1="-2.1546042" - y1="-7.1975217" - x2="25.153345" - y2="24.96549" /> - <linearGradient - inkscape:collect="always" - xlink:href="#linearGradient2542" - id="linearGradient6022" - gradientUnits="userSpaceOnUse" - x1="-2.1546042" - y1="-7.1975217" - x2="25.153345" - y2="24.96549" /> <linearGradient inkscape:collect="always" xlink:href="#linearGradient2542" @@ -715,52 +661,6 @@ inkscape:label="Calque 1" inkscape:groupmode="layer" id="layer1"> - <g - id="g2446" - inkscape:label="Calque 1" - transform="matrix(1.0000089,0,0,0.9411362,19.312133,1.5877181)" - style="fill:url(#linearGradient2548);fill-opacity:1"> - <g - style="fill:url(#linearGradient6012);fill-opacity:1;stroke:#000000;stroke-opacity:0.44968555" - transform="matrix(-0.4376782,-0.758081,0.7581751,-0.4377326,3.5952686,30.820492)" - id="g2181"> - <path - sodipodi:nodetypes="csccczccsccccc" - id="path2183" - d="M 41.109694,-0.41817229 C 40.505298,0.20454826 39.040867,0.77635346 37.592239,0.77635106 C 36.102089,0.77635106 34.114653,0.15682998 33.532659,-0.49267807 L 33.569913,-2.0031726 L 33.569913,-3.0835065 C 31.027414,-3.5787101 30.997014,-3.8285637 27.525623,-3.8285643 C 24.054233,-3.8285649 23.830777,-3.5759718 21.29017,-3.0462535 L 21.29017,-0.3436665 C 20.685773,0.27905404 19.221343,0.87609843 17.772714,0.87609724 C 16.282564,0.87609724 14.623294,0.43325774 13.915083,-0.41817229 L 14.138601,-5.7646408 C 18.129172,-7.3187814 22.030595,-8.3970767 27.437882,-8.5586077 C 32.38601,-8.450833 36.259126,-7.7053161 40.886177,-5.8763994 L 41.109694,-0.41817229 z" - style="opacity:1;fill:url(#linearGradient6010);fill-opacity:1;stroke:#000000;stroke-width:0.65573961;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.44968555" /> - </g> - <g - transform="matrix(-0.4400595,-0.7622054,0.7622054,-0.4400595,-10.917299,27.830684)" - id="g2451" - style="fill:url(#linearGradient6024);fill-opacity:1"> - <path - style="opacity:1;fill:url(#linearGradient6014);fill-opacity:1;stroke:#0f5600;stroke-width:0.625;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - 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" - id="path2453" - sodipodi:nodetypes="cccsccsccsccc" /> - <path - style="opacity:1;fill:url(#linearGradient6016);fill-opacity:1;stroke:#0f5600;stroke-width:0.57204324;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - 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" - id="path2455" - sodipodi:nodetypes="cccsccc" /> - <path - style="opacity:1;fill:url(#linearGradient6018);fill-opacity:1;stroke:#0f5600;stroke-width:0.57204324;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - 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" - id="path2457" - sodipodi:nodetypes="cccsccc" /> - <path - style="opacity:1;fill:url(#linearGradient6020);fill-opacity:1;stroke:none;stroke-width:0.57204324;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - d="M 6.6822725,11.157918 C 8.0629923,11.157918 8.7535908,10.73333 9.3296551,10.139801 L 9.0644746,7.3100024 C 8.3276662,7.9882984 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" - id="path2459" - sodipodi:nodetypes="cccsccc" /> - <path - style="opacity:1;fill:url(#linearGradient6022);fill-opacity:1;stroke:none;stroke-width:0.57204324;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - 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" - id="path2461" - sodipodi:nodetypes="cccsccc" /> - </g> - </g> <path sodipodi:type="inkscape:offset" inkscape:radius="-1.0012817" @@ -772,7 +672,7 @@ <g style="opacity:0.7;display:inline" id="g6055" - transform="matrix(8.6952354e-3,0,0,4.3474898e-3,24.921352,10.188454)"> + transform="matrix(1.3789487e-2,0,0,7.7745724e-3,26.01486,18.959687)"> <rect y="-150.69685" x="-1559.2523" @@ -793,11 +693,11 @@ </g> <path style="fill:url(#radialGradient6362);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.99999988;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dashoffset:0.69999992;stroke-opacity:0.99236642" - d="M 16.188056,1.113594 C 13.97187,1.113594 13.780337,1.3834096 13.379051,1.6532259 L 8.964902,4.621197 L 8.964902,5.000626 L 8.964902,5.051216 L 8.964902,10.987159 C 8.964902,11.198554 9.214813,11.366588 9.52921,11.366588 L 22.846901,11.366588 C 23.161299,11.366588 23.41121,11.198553 23.41121,10.987159 L 23.41121,5.051216 L 23.41121,5.000626 L 23.41121,4.621197 L 18.997061,1.6532259 C 18.595773,1.3834096 18.395131,1.113594 16.188056,1.113594 z" + d="M 12.165015,2.7312062 C 8.6504387,2.7312062 8.3466935,3.2137146 7.7103073,3.6962245 L 0.71005448,9.003817 L 0.71005448,9.682347 L 0.71005448,9.772816 L 0.71005448,20.388003 C 0.71005448,20.76604 1.10638,21.066531 1.6049719,21.066531 L 22.725056,21.066531 C 23.223651,21.066531 23.619975,20.766038 23.619975,20.388003 L 23.619975,9.772816 L 23.619975,9.682347 L 23.619975,9.003817 L 16.619723,3.6962245 C 15.983333,3.2137146 15.665143,2.7312062 12.165015,2.7312062 z" id="rect5931" /> <path - style="fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#888a85;stroke-width:0.30473173;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dashoffset:0.69999992;stroke-opacity:0.99236642" - d="M 23.41121,5.321032 L 23.41121,4.621197 L 18.997061,1.6532259 C 18.595773,1.3834096 18.395131,1.113594 16.188056,1.113594 C 13.97187,1.113594 13.780337,1.3834096 13.379052,1.6532259 L 8.964902,4.621197 L 8.964902,5.321032" + style="fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#888a85;stroke-width:0.51318032;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dashoffset:0.69999992;stroke-opacity:0.99236642" + d="M 23.619975,10.255326 L 23.619975,9.003817 L 16.619723,3.6962245 C 15.983333,3.2137146 15.665143,2.7312062 12.165015,2.7312062 C 8.6504387,2.7312062 8.3466935,3.2137146 7.7103083,3.6962245 L 0.71005448,9.003817 L 0.71005448,10.255326" id="path7161" sodipodi:nodetypes="ccccccc" /> <path @@ -807,42 +707,42 @@ style="fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:0.93754596;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dashoffset:0.69999992;stroke-opacity:0.99236642" id="path6064" d="M 24.5,5.5 C 21.798121,5.5 20.393246,5.7355566 19.65625,6.03125 C 18.919254,6.3269434 18.748198,6.6268011 18.1875,7.1875 L 7.5,17.875 L 7.5,18.90625 L 7.5,19.09375 L 7.5,41.09375 C 7.5,41.355066 7.6449379,41.500001 7.90625,41.5 L 41.09375,41.5 C 41.355064,41.5 41.5,41.355064 41.5,41.09375 L 41.5,19.09375 L 41.5,18.90625 L 41.5,17.875 L 30.8125,7.1875 C 30.254438,6.6294378 30.053706,6.3277326 29.3125,6.03125 C 28.571294,5.7347674 27.190282,5.499999 24.5,5.5 z" - transform="matrix(0.3930408,0,0,0.2687896,6.558557,-0.1264191)" /> + transform="matrix(0.6233103,0,0,0.4806737,-3.106088,0.5137033)" /> <path style="opacity:0.07462685;fill:url(#linearGradient6357);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1" - d="M 16.188056,6.91463 C 15.171363,6.91463 14.542242,6.991393 14.106382,7.11699 C 13.670523,7.242587 13.441752,7.425347 13.241109,7.579526 L 9.316027,11.135275 C 9.456261,11.243035 9.320187,11.231636 9.52921,11.231636 L 22.846901,11.231636 C 23.055924,11.231636 22.944931,11.146672 23.085164,11.038914 L 19.135002,7.579526 C 18.934358,7.425347 18.705589,7.242587 18.269729,7.11699 C 17.83387,6.991393 17.20475,6.91463 16.188056,6.91463 z" + d="M 12.165015,13.105141 C 10.552675,13.105141 9.5549726,13.242417 8.8637572,13.46702 C 8.1725419,13.691621 7.8097425,14.018451 7.4915491,14.294166 L 1.2668919,20.652877 C 1.4892844,20.845585 1.2734892,20.825198 1.6049719,20.825198 L 22.725056,20.825198 C 23.056538,20.825198 22.880518,20.67326 23.10291,20.480555 L 16.838479,14.294166 C 16.520284,14.018451 16.157487,13.691621 15.466271,13.46702 C 14.775057,13.242417 13.777355,13.105141 12.165015,13.105141 z" id="path7000" sodipodi:nodetypes="csccccccsc" /> <path - style="fill:url(#radialGradient7354);fill-opacity:1;fill-rule:evenodd;stroke:url(#linearGradient7356);stroke-width:0.30473173;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.69999992;stroke-opacity:0.99236642" - d="M 10.565694,1.7972574 C 10.27826,1.7972574 10.040649,1.9364716 10.040649,2.1144009 L 10.040649,6.374407 L 13.178116,8.474411 C 13.370391,8.603106 13.560773,8.771945 13.984893,8.88584 C 14.409012,8.999736 15.043577,9.06584 16.187523,9.06584 C 17.326866,9.065841 17.965155,8.999626 18.390152,8.88584 C 18.815149,8.772055 19.004106,8.603472 19.196928,8.474411 L 22.334395,6.374407 L 22.334395,2.1144009 C 22.334395,1.9364716 22.096784,1.7972574 21.80935,1.7972574 L 10.565694,1.7972574 z" + style="fill:url(#radialGradient7354);fill-opacity:1;fill-rule:evenodd;stroke:url(#linearGradient7356);stroke-width:0.51318032;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.69999992;stroke-opacity:0.99236642" + d="M 3.2486974,3.9537947 C 2.7928654,3.9537947 2.416046,4.20275 2.416046,4.5209391 L 2.416046,12.139066 L 7.3916506,15.89448 C 7.6965728,16.124625 7.9984941,16.42656 8.6710917,16.630237 C 9.3436882,16.833913 10.350022,16.952127 12.164169,16.952127 C 13.971015,16.95213 14.983258,16.833718 15.657245,16.630237 C 16.331235,16.426754 16.630895,16.125279 16.936686,15.89448 L 21.91229,12.139066 L 21.91229,4.5209391 C 21.91229,4.20275 21.535471,3.9537947 21.079638,3.9537947 L 3.2486974,3.9537947 z" id="rect7037" /> <path - style="fill:none;fill-opacity:1;fill-rule:evenodd;stroke:url(#linearGradient7351);stroke-width:0.30473176;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dashoffset:0.69999992;stroke-opacity:0.99236642" - d="M 10.682864,2.157365 C 10.594986,2.157365 10.570012,2.1867693 10.570012,2.201779 L 10.570012,7.060693 L 13.529236,9.157045 C 13.747933,9.311973 13.85466,9.428411 14.181269,9.521241 C 14.517977,9.616942 15.090513,9.690015 16.187522,9.690015 C 17.279895,9.690015 17.856423,9.616835 18.193775,9.521241 C 18.521106,9.428487 18.626148,9.312654 18.845808,9.157045 L 21.805032,7.060693 L 21.805032,2.201779 C 21.805032,2.1867685 21.780059,2.157365 21.69218,2.157365 L 10.682864,2.157365 z" + style="fill:none;fill-opacity:1;fill-rule:evenodd;stroke:url(#linearGradient7351);stroke-width:0.51318043;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dashoffset:0.69999992;stroke-opacity:0.99236642" + d="M 3.4345134,4.5977714 C 3.2951507,4.5977714 3.2555452,4.6503549 3.2555452,4.6771964 L 3.2555452,13.366344 L 7.94848,17.115228 C 8.2953043,17.392285 8.4645602,17.600509 8.9825176,17.766516 C 9.5164922,17.937659 10.424458,18.068334 12.164168,18.068334 C 13.896526,18.068334 14.810822,17.937467 15.345817,17.766516 C 15.864921,17.600645 16.031504,17.393503 16.379856,17.115228 L 21.072791,13.366344 L 21.072791,4.6771964 C 21.072791,4.6503534 21.033187,4.5977714 20.893822,4.5977714 L 3.4345134,4.5977714 z" id="path7081" sodipodi:nodetypes="ccccsssccccc" /> <rect style="fill:#d3d7cf;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.69999992;stroke-opacity:0.99236642" id="rect7096" - width="4.7199154" - height="0.21114101" - x="11.467583" - y="2.7136545" - rx="0.19307812" - ry="0.12387425" /> + width="7.485157" + height="0.37758133" + x="4.6789727" + y="5.5925789" + rx="0.30619618" + ry="0.22152303" /> <rect style="fill:#d3d7cf;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.69999992;stroke-opacity:0.99236642" id="rect7110" - width="2.1400123" - height="0.24408528" - x="18.862514" - y="2.6943941" - rx="0.19022335" - ry="0.12204266" /> + width="3.3937743" + height="0.43649527" + x="16.406347" + y="5.5581346" + rx="0.30166888" + ry="0.21824767" /> <g id="g7169" - transform="matrix(0.4012864,0,0,0.2698156,6.35654,-0.1005756)"> + transform="matrix(0.6363867,0,0,0.4825084,-3.4264602,0.5599189)"> <path sodipodi:nodetypes="ccssscccssscc" id="path7112" @@ -864,16 +764,16 @@ </g> <path style="fill:url(#radialGradient6338);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.89999998;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - d="M 16.188056,7.858985 C 14.181623,7.858985 13.780337,8.128801 13.379051,8.398616 L 9.127924,11.256976 C 9.230501,11.325945 9.372011,11.366587 9.52921,11.366588 L 22.846901,11.366588 C 23.0041,11.366588 23.145611,11.325945 23.248188,11.256976 L 18.997061,8.398616 C 18.595773,8.128801 18.194488,7.858985 16.188056,7.858985 z" + d="M 12.165015,14.793922 C 8.9830786,14.793922 8.3466935,15.27643 7.7103073,15.758938 L 0.96858565,20.870515 C 1.1312592,20.99385 1.3556753,21.06653 1.6049719,21.066531 L 22.725056,21.066531 C 22.974353,21.066531 23.19877,20.99385 23.361442,20.870515 L 16.619723,15.758938 C 15.983333,15.27643 15.346949,14.793922 12.165015,14.793922 z" id="path6902" /> <path style="opacity:0.55597014;fill:url(#linearGradient6335);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.99999988;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dashoffset:0.69999992;stroke-opacity:0.99236642" - d="M 9.165544,10.127122 L 9.165544,10.989594 C 9.165544,11.130569 9.320136,11.234807 9.52921,11.234807 L 22.846901,11.234807 C 23.055975,11.234807 23.210567,11.130569 23.210567,10.989594 L 23.210567,10.127122 L 9.165544,10.127122 z" + d="M 1.028246,18.850008 L 1.028246,20.392359 C 1.028246,20.644461 1.2734083,20.83087 1.6049719,20.83087 L 22.725056,20.83087 C 23.056619,20.83087 23.30178,20.644461 23.30178,20.392359 L 23.30178,18.850008 L 1.028246,18.850008 z" id="path6980" sodipodi:nodetypes="ccccccc" /> <g id="g4724" - transform="matrix(0.3804467,0,0,0.2440853,7.247005,0.7417114)"> + transform="matrix(0.6033378,0,0,0.4364954,-2.0143013,2.0661723)"> <rect ry="0.50750387" rx="0.50750387" @@ -939,13 +839,13 @@ style="fill:#d3d7cf;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.69999992;stroke-opacity:0.99236642" /> </g> <path - style="fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#888a85;stroke-width:0.30473167;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dashoffset:0.69999992;stroke-opacity:0.99236642" - d="M 8.964902,5.051216 L 8.964902,11.025618 C 8.964902,11.238381 9.214813,11.407505 9.52921,11.407504 L 22.846901,11.407504 C 23.161299,11.407504 23.41121,11.238381 23.41121,11.025618 L 23.41121,5.051216" + style="fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#888a85;stroke-width:0.51318026;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dashoffset:0.69999992;stroke-opacity:0.99236642" + d="M 0.71005448,9.772816 L 0.71005448,20.456781 C 0.71005448,20.837262 1.10638,21.139703 1.6049719,21.139702 L 22.725056,21.139702 C 23.223651,21.139702 23.619975,20.837262 23.619975,20.456781 L 23.619975,9.772816" id="path7174" sodipodi:nodetypes="cccccc" /> <g id="g6320" - transform="matrix(0.4012863,0,0,0.2792136,-16.215815,-0.4952216)"> + transform="matrix(0.6363866,0,0,0.4993148,-39.223209,-0.1458227)"> <path sodipodi:nodetypes="ccssscccccc" id="path7039" @@ -958,14 +858,14 @@ style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.89999998;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> </g> <path - style="opacity:0.594697;fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:0.30473173;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dashoffset:0.69999992;stroke-opacity:0.99236642" - d="M 9.511652,10.85791 C 9.511652,10.989937 9.568618,11.063164 9.671325,11.063164 L 22.715365,11.063164 C 22.818072,11.063164 22.875038,10.989936 22.875038,10.85791" + style="opacity:0.594697;fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:0.51318032;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dashoffset:0.69999992;stroke-opacity:0.99236642" + d="M 1.5771273,20.156868 C 1.5771273,20.392971 1.6674678,20.523921 1.8303473,20.523921 L 22.516457,20.523921 C 22.679338,20.523921 22.769677,20.39297 22.769677,20.156868" id="path7293" sodipodi:nodetypes="cccc" /> <g style="display:inline" id="g5992" - transform="matrix(0.4832429,0,0,0.3617094,9.10997,-13.531936)"> + transform="matrix(0.7663589,0,0,0.6468413,0.9401131,-23.459248)"> <path transform="matrix(1.14985,0,0,1.14985,-23.09153,35.3537)" d="M 47.000506,9.3411446 A 8.341651,8.341651 0 1 1 30.317204,9.3411446 A 8.341651,8.341651 0 1 1 47.000506,9.3411446 z" @@ -994,12 +894,12 @@ sodipodi:type="star" /> </g> <rect - ry="0.12387425" - rx="0.19307812" - y="3.2018204" - x="11.467583" - height="0.21114101" - width="1.8427882" + ry="0.22152303" + rx="0.30619618" + y="6.46556" + x="4.6789727" + height="0.37758133" + width="2.9224164" id="rect4708" style="fill:#d3d7cf;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.69999992;stroke-opacity:0.99236642" /> </g> diff --git a/sflphone-client-gnome/pixmaps/missed.svg b/sflphone-client-gnome/pixmaps/missed.svg index c35efb7abf490ff188eee8aa96429746ab49a3ed..5bd54cc8f6e8f36aa535c6c0a3b90fc84e79b103 100644 --- a/sflphone-client-gnome/pixmaps/missed.svg +++ b/sflphone-client-gnome/pixmaps/missed.svg @@ -105,7 +105,7 @@ x2="15.806232" y2="6.6770978" gradientUnits="userSpaceOnUse" - gradientTransform="matrix(9.8321849e-3,-1.1581503,1.1581503,9.8321849e-3,-9.5427776,27.711489)" /> + gradientTransform="matrix(-1.1831553e-2,-1.6938645,-1.3936595,1.4380162e-2,32.146661,38.77996)" /> <linearGradient id="linearGradient2278"> <stop @@ -760,7 +760,7 @@ inkscape:pageshadow="2" inkscape:zoom="22.4" inkscape:cx="16.277456" - inkscape:cy="16.683708" + inkscape:cy="14.897994" inkscape:document-units="px" inkscape:current-layer="layer1" width="32px" @@ -798,65 +798,7 @@ id="layer1"> <path style="opacity:1;fill:url(#linearGradient4275);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 -3.0911512,13.758869 L 8.3817787,13.856269 L 8.3501307,17.584066 L 17.106315,9.4059846 L 8.4902397,1.0804202 L 8.4585927,4.8082179 L -3.0143372,4.7108178 L -3.0911512,13.758869 z" + d="M 24.383101,18.373414 L 10.577158,18.515867 L 10.61524,23.967995 L 0.0784916,12.007059 L 10.44664,-0.16957984 L 10.484722,5.2825487 L 24.290665,5.1400952 L 24.383101,18.373414 z" id="rect4262" /> - <g - id="g2407" - inkscape:label="Calque 1" - transform="matrix(-0.5300637,-0.8479578,0.8479578,-0.5300637,12.117465,28.739892)" - style="fill:url(#linearGradient2506);fill-opacity:1"> - <g - transform="translate(14.730114,-3.4355522)" - inkscape:label="Calque 1" - id="g2364" - style="fill:url(#linearGradient3949);fill-opacity:1"> - <g - id="g2446" - inkscape:label="Calque 1" - transform="translate(7.9455775,4.2707653)" - style="fill:url(#linearGradient3947);fill-opacity:1"> - <g - style="fill:url(#linearGradient3933);fill-opacity:1;stroke:#000000;stroke-opacity:0.44968555" - transform="matrix(-0.4376782,-0.758081,0.7581751,-0.4377326,3.5952686,30.820492)" - id="g2181"> - <path - sodipodi:nodetypes="csccczccsccccc" - id="path2183" - d="M 41.109694,-0.41817229 C 40.505298,0.20454826 39.040867,0.77635346 37.592239,0.77635106 C 36.102089,0.77635106 34.114653,0.15682998 33.532659,-0.49267807 L 33.569913,-2.0031726 L 33.569913,-3.0835065 C 31.027414,-3.5787101 30.997014,-3.8285637 27.525623,-3.8285643 C 24.054233,-3.8285649 23.830777,-3.5759718 21.29017,-3.0462535 L 21.29017,-0.3436665 C 20.685773,0.27905404 19.221343,0.87609843 17.772714,0.87609724 C 16.282564,0.87609724 14.623294,0.43325774 13.915083,-0.41817229 L 14.138601,-5.7646408 C 18.129172,-7.3187814 22.030595,-8.3970767 27.437882,-8.5586077 C 32.38601,-8.450833 36.259126,-7.7053161 40.886177,-5.8763994 L 41.109694,-0.41817229 z" - style="opacity:1;fill:url(#linearGradient3931);fill-opacity:1;stroke:#000000;stroke-width:0.65573961;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.44968555" /> - </g> - <g - transform="matrix(-0.4400595,-0.7622054,0.7622054,-0.4400595,-10.917299,27.830684)" - id="g2451" - style="fill:url(#linearGradient3945);fill-opacity:1"> - <path - style="opacity:1;fill:url(#linearGradient3935);fill-opacity:1;stroke:#561500;stroke-width:0.625;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - 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" - id="path2453" - sodipodi:nodetypes="cccsccsccsccc" /> - <path - style="opacity:1;fill:url(#linearGradient3937);fill-opacity:1;stroke:#561500;stroke-width:0.57204324;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - 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" - id="path2455" - sodipodi:nodetypes="cccsccc" /> - <path - style="opacity:1;fill:url(#linearGradient3939);fill-opacity:1;stroke:#561500;stroke-width:0.57204324;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - 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" - id="path2457" - sodipodi:nodetypes="cccsccc" /> - <path - style="opacity:1;fill:url(#linearGradient3941);fill-opacity:1;stroke:none;stroke-width:0.57204324;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - d="M 6.6822725,11.157918 C 8.0629923,11.157918 8.7535908,10.73333 9.3296551,10.139801 L 9.0644746,7.3100024 C 8.3276662,7.9882984 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" - id="path2459" - sodipodi:nodetypes="cccsccc" /> - <path - style="opacity:1;fill:url(#linearGradient3943);fill-opacity:1;stroke:none;stroke-width:0.57204324;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - 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" - id="path2461" - sodipodi:nodetypes="cccsccc" /> - </g> - </g> - </g> - </g> </g> </svg> diff --git a/sflphone-client-gnome/pixmaps/outgoing.svg b/sflphone-client-gnome/pixmaps/outgoing.svg index e6a945c28c4d8fd195fa7f74a175f91cae5284b1..aa0fb5e8866c172d7066efa8dbe317d26e773204 100644 --- a/sflphone-client-gnome/pixmaps/outgoing.svg +++ b/sflphone-client-gnome/pixmaps/outgoing.svg @@ -21,6 +21,55 @@ sodipodi:modified="true"> <defs id="defs4"> + <linearGradient + y2="13.920053" + x2="6.8378897" + y1="12.625902" + x1="2.0651877" + gradientTransform="matrix(-1,0,0,1,32.04188,-2.86473)" + gradientUnits="userSpaceOnUse" + id="linearGradient2491" + xlink:href="#linearGradient4269" + inkscape:collect="always" /> + <linearGradient + y2="12.113755" + x2="7.293807" + y1="16.110582" + x1="11.408385" + gradientTransform="translate(0.426158,-2.762136)" + gradientUnits="userSpaceOnUse" + id="linearGradient2489" + xlink:href="#linearGradient4269" + inkscape:collect="always" /> + <linearGradient + y2="13.35532" + x2="23.888865" + y1="11.264216" + x1="31.692968" + gradientTransform="translate(-0.947018,-0.885198)" + gradientUnits="userSpaceOnUse" + id="linearGradient2487" + xlink:href="#linearGradient4183" + inkscape:collect="always" /> + <linearGradient + y2="12.949513" + x2="2.7672646" + y1="12.115559" + x1="10.57493" + gradientTransform="translate(1.262691,-1.100752)" + gradientUnits="userSpaceOnUse" + id="linearGradient2485" + xlink:href="#linearGradient4183" + inkscape:collect="always" /> + <linearGradient + y2="10.576721" + x2="14.013638" + y1="2.7028866" + x1="15.647213" + gradientUnits="userSpaceOnUse" + id="linearGradient2483" + xlink:href="#linearGradient4183" + inkscape:collect="always" /> <linearGradient inkscape:collect="always" id="linearGradient3003"> @@ -94,7 +143,7 @@ x2="26.544411" y2="9.906394" gradientUnits="userSpaceOnUse" - gradientTransform="matrix(0.8461123,0,0,1,1.3448205,-0.1767767)" /> + gradientTransform="matrix(0.8560405,0,0,1.1184736,0.9045039,6.3789889e-2)" /> <linearGradient inkscape:collect="always" xlink:href="#linearGradient3003" @@ -124,7 +173,7 @@ inkscape:window-width="1331" inkscape:window-height="922" inkscape:window-x="169" - inkscape:window-y="24" + inkscape:window-y="25" showgrid="false"> <sodipodi:guide orientation="vertical" @@ -148,37 +197,56 @@ 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" + d="M 8.3854173,5.6540458 L 17.06005,5.6540458 L 17.06005,1.1304639 L 23.627595,11.14383 L 17.06005,21.157198 L 17.06005,16.633614 L 8.3854173,16.633614 L 8.3854173,5.6540458 z" id="rect4262" /> <g - id="g4160" - transform="matrix(-0.3526524,-0.8063782,0.8063782,-0.3526524,5.2455765,28.387663)" - style="fill:url(#linearGradient3009);fill-opacity:1"> - <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:url(#linearGradient3009);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:url(#linearGradient3009);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:url(#linearGradient3009);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:url(#linearGradient3009);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:url(#linearGradient3009);fill-opacity:1;stroke:none;stroke-width:0.57204323999999995;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + id="g2364" + inkscape:label="Calque 1" + transform="matrix(0.8084692,0.4159668,-0.4142718,0.8051747,13.838027,0.5188541)"> + <g + transform="translate(7.9455775,4.2707653)" + inkscape:label="Calque 1" + id="g2446"> + <g + id="g2181" + transform="matrix(-0.4376782,-0.758081,0.7581751,-0.4377326,3.5952686,30.820492)" + style="fill:none;stroke:#000000;stroke-opacity:0.44968555"> + <path + style="opacity:1;fill:none;fill-opacity:1;stroke:#000000;stroke-width:0.65573961;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.44968555" + d="M 41.109694,-0.41817229 C 40.505298,0.20454826 39.040867,0.77635346 37.592239,0.77635106 C 36.102089,0.77635106 34.114653,0.15682998 33.532659,-0.49267807 L 33.569913,-2.0031726 L 33.569913,-3.0835065 C 31.027414,-3.5787101 30.997014,-3.8285637 27.525623,-3.8285643 C 24.054233,-3.8285649 23.830777,-3.5759718 21.29017,-3.0462535 L 21.29017,-0.3436665 C 20.685773,0.27905404 19.221343,0.87609843 17.772714,0.87609724 C 16.282564,0.87609724 14.623294,0.43325774 13.915083,-0.41817229 L 14.138601,-5.7646408 C 18.129172,-7.3187814 22.030595,-8.3970767 27.437882,-8.5586077 C 32.38601,-8.450833 36.259126,-7.7053161 40.886177,-5.8763994 L 41.109694,-0.41817229 z" + id="path2183" + sodipodi:nodetypes="csccczccsccccc" /> + </g> + <g + id="g2451" + transform="matrix(-0.4400595,-0.7622054,0.7622054,-0.4400595,-10.917299,27.830684)"> + <path + sodipodi:nodetypes="cccsccsccsccc" + id="path2453" + 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:url(#linearGradient2483);fill-opacity:1;stroke:#0f5600;stroke-width:0.625;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <path + sodipodi:nodetypes="cccsccc" + id="path2455" + 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:url(#linearGradient2485);fill-opacity:1;stroke:#0f5600;stroke-width:0.57204324;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <path + sodipodi:nodetypes="cccsccc" + id="path2457" + 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:url(#linearGradient2487);fill-opacity:1;stroke:#0f5600;stroke-width:0.57204324;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <path + sodipodi:nodetypes="cccsccc" + id="path2459" + d="M 6.6822725,11.157918 C 8.0629923,11.157918 8.7535908,10.73333 9.3296551,10.139801 L 9.0644746,7.3100024 C 8.3276662,7.9882984 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:url(#linearGradient2489);fill-opacity:1;stroke:none;stroke-width:0.57204324;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <path + sodipodi:nodetypes="cccsccc" + id="path2461" + 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:url(#linearGradient2491);fill-opacity:1;stroke:none;stroke-width:0.57204324;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + </g> + </g> </g> </g> </svg> diff --git a/sflphone-client-gnome/pixmaps/rec_call.svg b/sflphone-client-gnome/pixmaps/rec_call.svg index 45b6bf69abd8adab3e14d4eaa3c4e1e7edfc5c5d..7cb0e2993bb63a55b1165992369d2a2ca514f07e 100644 --- a/sflphone-client-gnome/pixmaps/rec_call.svg +++ b/sflphone-client-gnome/pixmaps/rec_call.svg @@ -1281,8 +1281,8 @@ inkscape:guide-bbox="true" inkscape:window-width="1600" inkscape:window-height="926" - inkscape:window-x="0" - inkscape:window-y="220" + inkscape:window-x="318" + inkscape:window-y="25" showgrid="false"> <sodipodi:guide orientation="vertical" @@ -1304,55 +1304,6 @@ inkscape:label="Calque 1" inkscape:groupmode="layer" id="layer1"> - <g - id="g2364" - inkscape:label="Calque 1" - transform="translate(14.730114,-3.4355522)"> - <g - transform="translate(7.9455775,4.2707653)" - inkscape:label="Calque 1" - id="g2446"> - <g - id="g2181" - transform="matrix(-0.4376782,-0.758081,0.7581751,-0.4377326,3.5952686,30.820492)" - style="fill:none;stroke:#000000;stroke-opacity:0.44968555"> - <path - style="opacity:1;fill:none;fill-opacity:1;stroke:#000000;stroke-width:0.65573961;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.44968555" - d="M 41.109694,-0.41817229 C 40.505298,0.20454826 39.040867,0.77635346 37.592239,0.77635106 C 36.102089,0.77635106 34.114653,0.15682998 33.532659,-0.49267807 L 33.569913,-2.0031726 L 33.569913,-3.0835065 C 31.027414,-3.5787101 30.997014,-3.8285637 27.525623,-3.8285643 C 24.054233,-3.8285649 23.830777,-3.5759718 21.29017,-3.0462535 L 21.29017,-0.3436665 C 20.685773,0.27905404 19.221343,0.87609843 17.772714,0.87609724 C 16.282564,0.87609724 14.623294,0.43325774 13.915083,-0.41817229 L 14.138601,-5.7646408 C 18.129172,-7.3187814 22.030595,-8.3970767 27.437882,-8.5586077 C 32.38601,-8.450833 36.259126,-7.7053161 40.886177,-5.8763994 L 41.109694,-0.41817229 z " - id="path2183" - sodipodi:nodetypes="csccczccsccccc" /> - </g> - <g - id="g2451" - transform="matrix(-0.4400595,-0.7622054,0.7622054,-0.4400595,-10.917299,27.830684)"> - <path - sodipodi:nodetypes="cccsccsccsccc" - id="path2453" - 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:url(#linearGradient2483);fill-opacity:1;stroke:#0f5600;stroke-width:0.625;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> - <path - sodipodi:nodetypes="cccsccc" - id="path2455" - 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:url(#linearGradient2485);fill-opacity:1;stroke:#0f5600;stroke-width:0.57204324;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> - <path - sodipodi:nodetypes="cccsccc" - id="path2457" - 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:url(#linearGradient2487);fill-opacity:1;stroke:#0f5600;stroke-width:0.57204324;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> - <path - sodipodi:nodetypes="cccsccc" - id="path2459" - d="M 6.6822725,11.157918 C 8.0629923,11.157918 8.7535908,10.73333 9.3296551,10.139801 L 9.0644746,7.3100024 C 8.3276662,7.9882984 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:url(#linearGradient2489);fill-opacity:1;stroke:none;stroke-width:0.57204324;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> - <path - sodipodi:nodetypes="cccsccc" - id="path2461" - 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:url(#linearGradient2491);fill-opacity:1;stroke:none;stroke-width:0.57204324;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> - </g> - </g> - </g> <path sodipodi:nodetypes="csc" id="path3488" @@ -1361,7 +1312,7 @@ <g id="g2892" inkscape:label="Calque 1" - transform="translate(-53.149937,4.9260696)"> + transform="matrix(2.4164115,0,0,2.4438688,-160.27663,6.5985522)"> <g transform="matrix(4.9064853e-2,-8.3536268e-2,8.8523433e-2,4.8433051e-2,48.54228,7.2086084)" inkscape:label="Layer 1" diff --git a/sflphone-client-gnome/pixmaps/refuse.svg b/sflphone-client-gnome/pixmaps/refuse.svg index a0d5b756dfb3ee07b3491e14ee68734d5ac1900a..ad6c913df3efd112148fa9fb7eabd7fe1c186f45 100644 --- a/sflphone-client-gnome/pixmaps/refuse.svg +++ b/sflphone-client-gnome/pixmaps/refuse.svg @@ -2,23 +2,31 @@ <!-- Created with Inkscape (http://www.inkscape.org/) --> <svg xmlns:dc="http://purl.org/dc/elements/1.1/" - xmlns:cc="http://web.resource.org/cc/" + 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://inkscape.sourceforge.net/DTD/sodipodi-0.dtd" + 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.43" + inkscape:version="0.46" version="1.0" sodipodi:docbase="/home/pierre/SFLPhone-0.8/pixmaps" - sodipodi:docname="refuse.svg"> + sodipodi:docname="refuse.svg" + inkscape:output_extension="org.inkscape.output.svg.inkscape"> <defs id="defs4"> + <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="perspective5582" /> <linearGradient inkscape:collect="always" id="linearGradient4250"> @@ -120,7 +128,7 @@ borderopacity="1.0" inkscape:pageopacity="0.0" inkscape:pageshadow="2" - inkscape:zoom="11.2" + inkscape:zoom="22.4" inkscape:cx="21.034591" inkscape:cy="10.811622" inkscape:document-units="px" @@ -129,10 +137,11 @@ height="32px" showguides="true" inkscape:guide-bbox="true" - inkscape:window-width="1014" - inkscape:window-height="691" + inkscape:window-width="1920" + inkscape:window-height="1123" inkscape:window-x="0" - inkscape:window-y="25"> + inkscape:window-y="25" + showgrid="false"> <sodipodi:guide orientation="horizontal" position="8.0357143" @@ -158,43 +167,14 @@ inkscape:groupmode="layer" id="layer1"> <path - style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#5c0008;stroke-width:4.48463202;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - d="M 3.7084718,3.5269014 L 20.778737,20.597165" + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#5c0008;stroke-width:4.82362747;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="M 2.6726121,1.9553274 L 20.966382,20.383025" id="path1332" sodipodi:nodetypes="cc" /> <path - style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#5c0008;stroke-width:4.48463202;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - d="M 3.7084715,20.597165 L 20.778737,3.5269017" + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#5c0008;stroke-width:4.94175196;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="M 2.240603,20.368605 L 21.755534,2.2376046" id="path1334" sodipodi:nodetypes="cc" /> - <g - id="g4160" - transform="matrix(0.786778,0,0,0.786778,-0.726628,4.603105)"> - <path - sodipodi:nodetypes="cccsccsccsccc" - id="path3153" - d="M 16.100095,4.59375 C 10.946289,4.7477067 6.5661943,5.7999634 2.7626907,7.28125 L 2.5751907,10.227679 C 3.1252737,10.972881 4.3542457,11.508929 5.7626907,11.508929 C 7.1318907,11.508929 8.3164327,11.004648 8.8876907,10.290179 L 8.8876907,9.1875 C 11.3092,8.682612 12.862258,8.4375 16.125,8.4375 C 19.479577,8.4375001 21.34842,8.6842603 23.771732,9.15625 L 23.771732,10.165179 C 24.34299,10.879648 25.527531,11.383929 26.896732,11.383929 C 28.305177,11.383929 29.5029,10.847881 30.052982,10.102679 L 29.865482,7.15625 C 25.053357,5.4212686 21.355113,4.6256244 16.100095,4.59375 z " - style="opacity:1;fill:url(#linearGradient4203);fill-opacity:1;stroke:#5c0008;stroke-width:0.625;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> - <path - sodipodi:nodetypes="cccsccc" - id="path3161" - d="M 5.7481338,13.019293 C 7.1288536,13.019293 8.3245284,12.610489 8.9005927,12.01696 L 8.9005927,10.430989 C 8.1637843,11.109285 7.1297974,11.494948 5.7481338,11.494948 C 4.3260338,11.494948 3.32872,11.13019 2.5533599,10.48174 L 2.5533599,11.966208 C 3.108071,12.585269 4.3278389,13.019293 5.7481338,13.019293 z " - style="opacity:1;fill:url(#linearGradient4181);fill-opacity:1;stroke:#5c0008;stroke-width:0.57204324;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> - <path - sodipodi:nodetypes="cccsccc" - id="path4140" - d="M 26.931282,12.944669 C 28.312002,12.944669 29.507677,12.535865 30.083741,11.942336 L 30.083741,10.356365 C 29.346933,11.034661 28.312946,11.420324 26.931282,11.420324 C 25.509182,11.420324 24.511868,11.055566 23.736508,10.407116 L 23.736508,11.891584 C 24.291219,12.510645 25.510987,12.944669 26.931282,12.944669 z " - style="opacity:1;fill:url(#linearGradient4195);fill-opacity:1;stroke:#5c0008;stroke-width:0.57204324;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> - <path - sodipodi:nodetypes="cccsccc" - id="path4246" - d="M 5.9721413,11.157918 C 7.3528611,11.157918 8.0434596,10.73333 8.6195239,10.139801 L 9.1877347,7.4805434 C 8.4509263,8.1588394 7.4169394,8.5445024 6.0352758,8.5445024 C 4.6131758,8.5445024 3.789482,8.1797444 3.0141219,7.5312944 L 2.7773674,10.104833 C 3.3320785,10.723894 4.5518464,11.157918 5.9721413,11.157918 z " - style="opacity:1;fill:url(#linearGradient4256);fill-opacity:1;stroke:none;stroke-width:0.57204324;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> - <path - sodipodi:nodetypes="cccsccc" - id="path4258" - d="M 26.495901,11.055324 C 25.115181,11.055324 24.424582,10.630736 23.848518,10.037207 L 23.280307,7.3779497 C 24.017116,8.0562457 25.051103,8.4419087 26.432766,8.4419087 C 27.854866,8.4419087 28.67856,8.0771507 29.45392,7.4287007 L 29.690675,10.002239 C 29.135964,10.6213 27.916196,11.055324 26.495901,11.055324 z " - style="opacity:1;fill:url(#linearGradient4260);fill-opacity:1;stroke:none;stroke-width:0.57204324;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> - </g> </g> </svg> diff --git a/sflphone-client-gnome/pixmaps/transfert.svg b/sflphone-client-gnome/pixmaps/transfert.svg index 84db1e97ae5ed384267866bec699a8d422175461..3558b81d3f342c9201aa161d2a8d9342b13a5438 100644 --- a/sflphone-client-gnome/pixmaps/transfert.svg +++ b/sflphone-client-gnome/pixmaps/transfert.svg @@ -2,7 +2,7 @@ <!-- Created with Inkscape (http://www.inkscape.org/) --> <svg xmlns:dc="http://purl.org/dc/elements/1.1/" - xmlns:cc="http://web.resource.org/cc/" + 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" @@ -13,7 +13,7 @@ height="24" id="svg2" sodipodi:version="0.32" - inkscape:version="0.45" + inkscape:version="0.46" version="1.0" sodipodi:docbase="/home/plbeaudoin/SFLPhone/sflphone/sflphone-gtk/pixmaps" sodipodi:docname="transfert.svg" @@ -21,6 +21,13 @@ sodipodi:modified="true"> <defs id="defs4"> + <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="perspective141" /> <linearGradient id="linearGradient4269"> <stop @@ -112,7 +119,7 @@ x2="15.630395" y2="6.2345462" gradientUnits="userSpaceOnUse" - gradientTransform="matrix(1.360718e-8,1.128928,1.128928,-1.360718e-8,-1.7295474,-9.642166)" /> + gradientTransform="matrix(1.7459007e-8,1.6859456,1.4484972,-2.0321018e-8,-9.2269374,-14.960696)" /> <linearGradient id="linearGradient4045"> <stop @@ -797,7 +804,7 @@ borderopacity="1.0" inkscape:pageopacity="0.0" inkscape:pageshadow="2" - inkscape:zoom="1" + inkscape:zoom="16" inkscape:cx="2.1796211" inkscape:cy="7.7965211" inkscape:document-units="px" @@ -809,7 +816,8 @@ inkscape:window-width="1014" inkscape:window-height="1091" inkscape:window-x="5" - inkscape:window-y="49" /> + inkscape:window-y="49" + showgrid="false" /> <metadata id="metadata7"> <rdf:RDF> @@ -826,67 +834,8 @@ inkscape:groupmode="layer" id="layer1"> <path - style="opacity:1;fill:url(#linearGradient4275);fill-opacity:1.0;stroke:none;stroke-width:0.625;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - d="M 4.4433805,4.0108013 L 15.626822,4.0108014 L 15.626822,0.3770651 L 24.09378,8.4206747 L 15.626822,16.464286 L 15.626823,12.83055 L 4.4433806,12.83055 L 4.4433805,4.0108013 z " + style="opacity:1;fill:url(#linearGradient4275);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 -1.3066195,5.4287015 L 13.042554,5.4287016 L 13.042554,0.0020650992 L 23.90628,12.014424 L 13.042554,24.026786 L 13.042555,18.60015 L -1.3066194,18.60015 L -1.3066195,5.4287015 z" id="rect4262" /> - <g - id="g2441" - inkscape:label="Calque 1" - transform="translate(-0.6011619,-0.1264495)"> - <g - transform="translate(-3.1142216,0.1467125)" - inkscape:label="Calque 1" - id="g2403"> - <g - id="g2364" - inkscape:label="Calque 1" - transform="translate(14.730114,-3.4355522)"> - <g - transform="translate(7.9455775,4.2707653)" - inkscape:label="Calque 1" - id="g2446"> - <g - id="g2181" - transform="matrix(-0.4376782,-0.758081,0.7581751,-0.4377326,3.5952686,30.820492)" - style="fill:none;stroke:#000000;stroke-opacity:0.44968555"> - <path - style="opacity:1;fill:none;fill-opacity:1;stroke:#000000;stroke-width:0.65573961;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.44968555" - d="M 41.109694,-0.41817229 C 40.505298,0.20454826 39.040867,0.77635346 37.592239,0.77635106 C 36.102089,0.77635106 34.114653,0.15682998 33.532659,-0.49267807 L 33.569913,-2.0031726 L 33.569913,-3.0835065 C 31.027414,-3.5787101 30.997014,-3.8285637 27.525623,-3.8285643 C 24.054233,-3.8285649 23.830777,-3.5759718 21.29017,-3.0462535 L 21.29017,-0.3436665 C 20.685773,0.27905404 19.221343,0.87609843 17.772714,0.87609724 C 16.282564,0.87609724 14.623294,0.43325774 13.915083,-0.41817229 L 14.138601,-5.7646408 C 18.129172,-7.3187814 22.030595,-8.3970767 27.437882,-8.5586077 C 32.38601,-8.450833 36.259126,-7.7053161 40.886177,-5.8763994 L 41.109694,-0.41817229 z " - id="path2183" - sodipodi:nodetypes="csccczccsccccc" /> - </g> - <g - id="g2451" - transform="matrix(-0.4400595,-0.7622054,0.7622054,-0.4400595,-10.917299,27.830684)"> - <path - sodipodi:nodetypes="cccsccsccsccc" - id="path2453" - 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:url(#linearGradient2483);fill-opacity:1;stroke:#20246f;stroke-width:0.625;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> - <path - sodipodi:nodetypes="cccsccc" - id="path2455" - 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:url(#linearGradient2485);fill-opacity:1;stroke:#20246f;stroke-width:0.57204324;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> - <path - sodipodi:nodetypes="cccsccc" - id="path2457" - 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:url(#linearGradient2487);fill-opacity:1;stroke:#20246f;stroke-width:0.57204324;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> - <path - sodipodi:nodetypes="cccsccc" - id="path2459" - d="M 6.6822725,11.157918 C 8.0629923,11.157918 8.7535908,10.73333 9.3296551,10.139801 L 9.0644746,7.3100024 C 8.3276662,7.9882984 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:url(#linearGradient2489);fill-opacity:1;stroke:none;stroke-width:0.57204324;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> - <path - sodipodi:nodetypes="cccsccc" - id="path2461" - 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:url(#linearGradient2491);fill-opacity:1;stroke:none;stroke-width:0.57204324;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> - </g> - </g> - </g> - </g> - </g> </g> </svg> diff --git a/sflphone-client-gnome/pixmaps/unhold.svg b/sflphone-client-gnome/pixmaps/unhold.svg index 99af96c926a9a8c345ac050874a231f197693486..990d0858b76abfa9277547780354f69b6f3c6316 100644 --- a/sflphone-client-gnome/pixmaps/unhold.svg +++ b/sflphone-client-gnome/pixmaps/unhold.svg @@ -2,7 +2,7 @@ <!-- Created with Inkscape (http://www.inkscape.org/) --> <svg xmlns:dc="http://purl.org/dc/elements/1.1/" - xmlns:cc="http://web.resource.org/cc/" + 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" @@ -13,7 +13,7 @@ height="24" id="svg2" sodipodi:version="0.32" - inkscape:version="0.45" + inkscape:version="0.46" version="1.0" sodipodi:docbase="/home/plbeaudoin/SFLPhone/sflphone/sflphone-gtk/pixmaps" sodipodi:docname="unhold.svg" @@ -21,6 +21,23 @@ sodipodi:modified="true"> <defs id="defs4"> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient4183" + id="linearGradient2224" + x1="16.826796" + y1="6.7288713" + x2="27.5625" + y2="22.512505" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(1.4697442,0,0,1.3148911,-19.618932,-3.3102571)" /> + <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="perspective159" /> <linearGradient id="linearGradient4269"> <stop @@ -851,19 +868,20 @@ borderopacity="1.0" inkscape:pageopacity="0.0" inkscape:pageshadow="2" - inkscape:zoom="1" + inkscape:zoom="22.627417" inkscape:cx="16.940055" - inkscape:cy="2.9986718" + inkscape:cy="10.06974" inkscape:document-units="px" inkscape:current-layer="layer1" width="32px" height="32px" showguides="true" inkscape:guide-bbox="true" - inkscape:window-width="1014" - inkscape:window-height="691" - inkscape:window-x="5" - inkscape:window-y="49"> + inkscape:window-width="1920" + inkscape:window-height="1123" + inkscape:window-x="0" + inkscape:window-y="25" + showgrid="false"> <sodipodi:guide orientation="horizontal" position="8.0357143" @@ -888,93 +906,30 @@ inkscape:label="Calque 1" inkscape:groupmode="layer" id="layer1"> - <g - id="g2453" - inkscape:label="Calque 1" - transform="translate(0.8512452,-8.3578138e-2)"> - <path - id="path3384" - d="M 21.038321,3.4034084 L 15.10969,4.9843766 L 15.10969,11.031579 C 14.669707,10.938077 14.114787,11.043637 13.588009,11.347773 C 12.710044,11.854667 12.265301,12.744435 12.599904,13.323983 C 12.934506,13.903532 13.915531,13.949451 14.793496,13.442556 C 15.520561,13.022784 15.945002,12.351704 15.880412,11.802301 L 15.900174,11.802301 L 15.900174,6.0120062 L 20.228074,4.8460419 L 20.228074,9.5494222 C 19.790115,9.4608922 19.227685,9.5646472 18.706392,9.8656162 C 17.828428,10.372509 17.383684,11.262277 17.718288,11.841826 C 18.05289,12.421374 19.033915,12.467291 19.911881,11.960398 C 20.638946,11.540626 21.083149,10.869547 21.018559,10.320144 L 21.038321,10.320144 L 21.038321,4.6286588 L 21.038321,3.4034084 z " - style="opacity:0.08099688;fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:0.45169228;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <path - id="path2456" - d="M 20.490646,2.9897742 L 14.562015,4.5707424 L 14.562015,10.617945 C 14.122032,10.524443 13.567112,10.630003 13.040334,10.934139 C 12.162369,11.441033 11.717626,12.330801 12.052229,12.910349 C 12.386831,13.489898 13.367856,13.535817 14.245821,13.028922 C 14.972886,12.60915 15.397327,11.93807 15.332737,11.388667 L 15.352499,11.388667 L 15.352499,5.5983718 L 19.680399,4.4324077 L 19.680399,9.1357875 C 19.24244,9.047258 18.68001,9.1510128 18.158717,9.4519815 C 17.280753,9.9588749 16.836009,10.848643 17.170613,11.428192 C 17.505215,12.00774 18.48624,12.053657 19.364206,11.546764 C 20.091271,11.126992 20.535474,10.455913 20.470884,9.9065097 L 20.490646,9.9065097 L 20.490646,4.2150246 L 20.490646,2.9897742 z " - style="fill:url(#linearGradient2469);fill-opacity:1;stroke:#1d6a6f;stroke-width:0.45169228;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;opacity:0.32398754" /> - <g - transform="translate(-3.1142216,0.1467125)" - inkscape:label="Calque 1" - id="g2403"> - <g - id="g2364" - inkscape:label="Calque 1" - transform="translate(14.730114,-3.4355522)"> - <g - transform="translate(7.9455775,4.2707653)" - inkscape:label="Calque 1" - id="g2446"> - <g - id="g2181" - transform="matrix(-0.4376782,-0.758081,0.7581751,-0.4377326,3.5952686,30.820492)" - style="fill:none;stroke:#000000;stroke-opacity:0.44968555"> - <path - style="opacity:1;fill:none;fill-opacity:1;stroke:#000000;stroke-width:0.65573961;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.44968555" - d="M 41.109694,-0.41817229 C 40.505298,0.20454826 39.040867,0.77635346 37.592239,0.77635106 C 36.102089,0.77635106 34.114653,0.15682998 33.532659,-0.49267807 L 33.569913,-2.0031726 L 33.569913,-3.0835065 C 31.027414,-3.5787101 30.997014,-3.8285637 27.525623,-3.8285643 C 24.054233,-3.8285649 23.830777,-3.5759718 21.29017,-3.0462535 L 21.29017,-0.3436665 C 20.685773,0.27905404 19.221343,0.87609843 17.772714,0.87609724 C 16.282564,0.87609724 14.623294,0.43325774 13.915083,-0.41817229 L 14.138601,-5.7646408 C 18.129172,-7.3187814 22.030595,-8.3970767 27.437882,-8.5586077 C 32.38601,-8.450833 36.259126,-7.7053161 40.886177,-5.8763994 L 41.109694,-0.41817229 z " - id="path2183" - sodipodi:nodetypes="csccczccsccccc" /> - </g> - <g - id="g2451" - transform="matrix(-0.4400595,-0.7622054,0.7622054,-0.4400595,-10.917299,27.830684)"> - <path - sodipodi:nodetypes="cccsccsccsccc" - id="path2453" - 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:url(#linearGradient2483);fill-opacity:1;stroke:#005653;stroke-width:0.625;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> - <path - sodipodi:nodetypes="cccsccc" - id="path2455" - 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:url(#linearGradient2485);fill-opacity:1;stroke:#005653;stroke-width:0.57204324;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> - <path - sodipodi:nodetypes="cccsccc" - id="path2457" - 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:url(#linearGradient2487);fill-opacity:1;stroke:#005653;stroke-width:0.57204324;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> - <path - sodipodi:nodetypes="cccsccc" - id="path2459" - d="M 6.6822725,11.157918 C 8.0629923,11.157918 8.7535908,10.73333 9.3296551,10.139801 L 9.0644746,7.3100024 C 8.3276662,7.9882984 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:url(#linearGradient2489);fill-opacity:1;stroke:none;stroke-width:0.57204324;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> - <path - sodipodi:nodetypes="cccsccc" - id="path2461" - 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:url(#linearGradient2491);fill-opacity:1;stroke:none;stroke-width:0.57204324;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> - </g> - </g> - </g> - </g> - </g> <g id="g1418" inkscape:label="Calque 1" - transform="matrix(0.6631953,0,0,0.6631953,30.626397,2.6191805)" - style="stroke:#006c73;stroke-width:3.68368111;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"> + transform="matrix(1.6477991,0,0,1.631225,43.39914,0.6028274)" + style="stroke:#006c73;stroke-width:3.68368101;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"> <g id="g1444" transform="matrix(0.491592,0,0,0.491592,-26.9581,-0.76797)" - style="stroke:#006c73;stroke-width:7.49337075;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"> + style="stroke:#006c73;stroke-width:7.49337053;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"> <path - style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#006c73;stroke-width:7.49337075;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#006c73;stroke-width:7.49337053;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" d="M 5.3208165,5.0274423 L 27.017246,26.72387" id="path1332" sodipodi:nodetypes="cc" /> <path - style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#006c73;stroke-width:7.49337075;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#006c73;stroke-width:7.49337053;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" d="M 5.3208161,26.72387 L 27.017246,5.0274427" id="path1334" sodipodi:nodetypes="cc" /> </g> </g> + <path + style="opacity:0.62999998;fill:url(#linearGradient2224);fill-opacity:1;stroke:#1d6a6f;stroke-width:0.99294412;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="M 20.431551,1.0453154 L 6.6527151,4.3325393 L 6.6527151,16.90617 C 5.6301427,16.711756 4.3404434,16.931242 3.1161493,17.563615 C 1.0756551,18.617572 0.042019996,20.467621 0.81967684,21.672645 C 1.5973312,22.877671 3.8773489,22.973148 5.917843,21.919187 C 7.6076278,21.046377 8.5940782,19.651036 8.4439641,18.508692 L 8.4898925,18.508692 L 8.4898925,6.4692351 L 18.548442,4.0449073 L 18.548442,13.824398 C 17.530574,13.640323 16.22342,13.856055 15.011874,14.481843 C 12.971382,15.5358 11.937745,17.385848 12.715404,18.590874 C 13.493058,19.795898 15.773077,19.891371 17.813573,18.837414 C 19.503357,17.964605 20.535738,16.569265 20.385622,15.42692 L 20.431551,15.42692 L 20.431551,3.592914 L 20.431551,1.0453154 z" + id="path1328" /> </g> </svg> diff --git a/sflphone-client-gnome/src/Makefile.am b/sflphone-client-gnome/src/Makefile.am index a483cc3fc1effe5f3a465b60973f26c2cd0a26b9..b32b86fac2ee9c4e00f0dcbaf2cb3d9b4f25dd63 100644 --- a/sflphone-client-gnome/src/Makefile.am +++ b/sflphone-client-gnome/src/Makefile.am @@ -18,18 +18,17 @@ sflphone_client_gnome_SOURCES = \ dialpad.c \ menus.c \ toolbar.c \ - call.c \ + callable_obj.c \ actions.c \ accountlist.c \ sliders.c \ statusicon.c \ codeclist.c \ - timestamp.c \ reqaccount.c noinst_HEADERS = actions.h sflnotify.h mainwindow.h dialpad.h codeclist.h \ - assistant.h timestamp.h reqaccount.h errors.h sflphone_const.h \ - menus.h accountlist.h sliders.h statusicon.h call.h toolbar.h + assistant.h reqaccount.h errors.h sflphone_const.h \ + menus.h accountlist.h sliders.h statusicon.h callable_obj.h toolbar.h sflphone_client_gnome_LDADD = $(DEPS_LIBS) $(NOTIFY_LIBS) $(SFLPHONEGTK_LIBS) $(LIBSEXY_LIBS) $(LOG4C) diff --git a/sflphone-client-gnome/src/accountlist.c b/sflphone-client-gnome/src/accountlist.c index 8a6cbe26b7f867bc681db5eb24689967afd1c585..cd635575ff56021e1dda0dd4343caa37915b87fd 100644 --- a/sflphone-client-gnome/src/accountlist.c +++ b/sflphone-client-gnome/src/accountlist.c @@ -72,6 +72,12 @@ account_list_add (account_t * c) g_queue_push_tail (accountQueue, (gpointer *) c); } +void +account_list_add_at_nth (account_t * c, guint pos) +{ + g_queue_push_nth (accountQueue, (gpointer *) c, pos); +} + void account_list_remove (const gchar * accountID) diff --git a/sflphone-client-gnome/src/accountlist.h b/sflphone-client-gnome/src/accountlist.h index f60fd702951b225535097bd1bcf917defd580337..260eec094e48065e2a1168a1a5267432ab2e6586 100644 --- a/sflphone-client-gnome/src/accountlist.h +++ b/sflphone-client-gnome/src/accountlist.h @@ -86,6 +86,13 @@ void account_list_clean (); */ void account_list_add (account_t * a); +/** + * This function append an account to list at a given position. + * @param a The account you want to add + * @param pos THe position in the list to insert the account + */ +void account_list_add_at_nth (account_t * a, guint pos); + /** * This function remove an account from list. * @param accountID The accountID of the account you want to remove diff --git a/sflphone-client-gnome/src/actions.c b/sflphone-client-gnome/src/actions.c index 120024a7c3d8eb8fc9e1463c25212bbcc1828a76..4e632c9ca245a117de4dc626474625a8e87f4d77 100644 --- a/sflphone-client-gnome/src/actions.c +++ b/sflphone-client-gnome/src/actions.c @@ -20,11 +20,11 @@ #include <actions.h> #include <dbus/dbus.h> -#include <mainwindow.h> -#include <menus.h> #include <statusicon.h> -#include <toolbar.h> #include <contacts/searchbar.h> +#include <menus.h> +#include <toolbar.h> + #include <gtk/gtk.h> #include <string.h> #include <glib/gprintf.h> @@ -105,6 +105,9 @@ sflphone_quit () if (quit) { + // Save the history + sflphone_save_history (); + dbus_unregister(getpid()); dbus_clean (); //call_list_clean(); TODO @@ -115,27 +118,27 @@ sflphone_quit () } void -sflphone_hold(call_t * c ) +sflphone_hold (callable_obj_t * c ) { - c->state = CALL_STATE_HOLD; + c->_state = CALL_STATE_HOLD; calltree_update_call(current_calls,c); update_menus(); } void -sflphone_ringing(call_t * c ) +sflphone_ringing(callable_obj_t * c ) { - c->state = CALL_STATE_RINGING; + c->_state = CALL_STATE_RINGING; calltree_update_call(current_calls,c); update_menus(); } void -sflphone_hung_up( call_t * c) +sflphone_hung_up( callable_obj_t * c) { - calllist_remove( current_calls, c->callID); + calllist_remove( current_calls, c->_callID); calltree_remove_call(current_calls, c); - c->state = CALL_STATE_DIALING; + c->_state = CALL_STATE_DIALING; update_menus(); #if GTK_CHECK_VERSION(2,10,0) status_tray_icon_blink( FALSE ); @@ -232,13 +235,20 @@ gboolean sflphone_init() else { dbus_register(getpid(), "Gtk+ Client"); - current_calls = calltab_init(NULL); - contacts = calltab_init("contacts"); - history = calltab_init("history"); + + current_calls = calltab_init(FALSE, CURRENT_CALLS); + contacts = calltab_init(TRUE, CONTACTS); + history = calltab_init(TRUE, HISTORY); + account_list_init (); codec_list_init(); + + // Fetch the configured accounts sflphone_fill_account_list(FALSE); + + // Fetch the audio codecs sflphone_fill_codec_list(); + return TRUE; } } @@ -246,41 +256,39 @@ gboolean sflphone_init() void sflphone_hang_up() { - call_t * selectedCall = calltab_get_selected_call(current_calls); + callable_obj_t * selectedCall = calltab_get_selected_call(current_calls); if(selectedCall) { - switch(selectedCall->state) + switch(selectedCall->_state) { case CALL_STATE_DIALING: dbus_hang_up (selectedCall); break; case CALL_STATE_RINGING: dbus_hang_up (selectedCall); - selectedCall->state = CALL_STATE_DIALING; - selectedCall->_stop = 0; + selectedCall->_state = CALL_STATE_DIALING; + //selectedCall->_stop = 0; break; case CALL_STATE_CURRENT: case CALL_STATE_HOLD: case CALL_STATE_BUSY: case CALL_STATE_RECORD: dbus_hang_up (selectedCall); - selectedCall->state = CALL_STATE_DIALING; - (void) time(&selectedCall->_stop); + selectedCall->_state = CALL_STATE_DIALING; + set_timestamp (&selectedCall->_time_stop); break; case CALL_STATE_FAILURE: dbus_hang_up (selectedCall); - selectedCall->state = CALL_STATE_DIALING; - selectedCall->_stop = 0; + selectedCall->_state = CALL_STATE_DIALING; break; case CALL_STATE_INCOMING: dbus_refuse (selectedCall); - selectedCall->state = CALL_STATE_DIALING; - selectedCall->_stop = 0; + selectedCall->_state = CALL_STATE_DIALING; DEBUG("from sflphone_hang_up : "); stop_notification(); break; case CALL_STATE_TRANSFERT: dbus_hang_up (selectedCall); - (void) time(&selectedCall->_stop); + set_timestamp (&selectedCall->_time_stop); break; default: WARN("Should not happen in sflphone_hang_up()!"); @@ -295,16 +303,16 @@ sflphone_hang_up() sflphone_pick_up() { DEBUG("sflphone_pick_up\n"); - call_t * selectedCall = calltab_get_selected_call(active_calltree); + callable_obj_t * selectedCall = calltab_get_selected_call(active_calltree); if(selectedCall) { - switch(selectedCall->state) + switch(selectedCall->_state) { case CALL_STATE_DIALING: sflphone_place_call (selectedCall); break; case CALL_STATE_INCOMING: - selectedCall->history_state = INCOMING; + selectedCall->_history_state = INCOMING; calltree_update_call( history , selectedCall ); dbus_accept (selectedCall); DEBUG("from sflphone_pick_up : "); stop_notification(); @@ -314,7 +322,7 @@ sflphone_pick_up() break; case CALL_STATE_TRANSFERT: dbus_transfert (selectedCall); - (void) time(&selectedCall->_stop); + set_timestamp (&selectedCall->_time_stop); break; case CALL_STATE_CURRENT: case CALL_STATE_RECORD: @@ -331,16 +339,16 @@ sflphone_pick_up() else { sflphone_new_call(); } - + } void sflphone_on_hold () { - call_t * selectedCall = calltab_get_selected_call(current_calls); + callable_obj_t * selectedCall = calltab_get_selected_call(current_calls); if(selectedCall) { - switch(selectedCall->state) + switch(selectedCall->_state) { case CALL_STATE_CURRENT: dbus_hold (selectedCall); @@ -359,10 +367,10 @@ sflphone_on_hold () void sflphone_off_hold () { - call_t * selectedCall = calltab_get_selected_call(current_calls); + callable_obj_t * selectedCall = calltab_get_selected_call(current_calls); if(selectedCall) { - switch(selectedCall->state) + switch(selectedCall->_state) { case CALL_STATE_HOLD: dbus_unhold (selectedCall); @@ -374,48 +382,48 @@ sflphone_off_hold () } if(dbus_get_is_recording(selectedCall)) - { + { DEBUG("Currently recording!"); - } + } else - { + { DEBUG("Not recording currently"); - } + } } void -sflphone_fail( call_t * c ) +sflphone_fail( callable_obj_t * c ) { - c->state = CALL_STATE_FAILURE; + c->_state = CALL_STATE_FAILURE; calltree_update_call(current_calls,c); update_menus(); } void -sflphone_busy( call_t * c ) +sflphone_busy( callable_obj_t * c ) { - c->state = CALL_STATE_BUSY; + c->_state = CALL_STATE_BUSY; calltree_update_call(current_calls, c); update_menus(); } void -sflphone_current( call_t * c ) +sflphone_current( callable_obj_t * c ) { - if( c->state != CALL_STATE_HOLD ) - (void) time(&c->_start); - c->state = CALL_STATE_CURRENT; + if( c->_state != CALL_STATE_HOLD ) + set_timestamp (&c->_time_start); + c->_state = CALL_STATE_CURRENT; calltree_update_call(current_calls,c); update_menus(); } void -sflphone_record( call_t * c ) +sflphone_record( callable_obj_t * c ) { - if( c->state != CALL_STATE_HOLD ) - (void) time(&c->_start); - c->state = CALL_STATE_RECORD; + if( c->_state != CALL_STATE_HOLD ) + set_timestamp (&c->_time_start); + c->_state = CALL_STATE_RECORD; calltree_update_call(current_calls,c); update_menus(); } @@ -423,11 +431,11 @@ sflphone_record( call_t * c ) void sflphone_set_transfert() { - call_t * c = calltab_get_selected_call(current_calls); + callable_obj_t * c = calltab_get_selected_call(current_calls); if(c) { - c->state = CALL_STATE_TRANSFERT; - c->to = g_strdup(""); + c->_state = CALL_STATE_TRANSFERT; + c->_trsft_to = g_strdup(""); calltree_update_call(current_calls,c); update_menus(); } @@ -437,11 +445,11 @@ sflphone_set_transfert() void sflphone_unset_transfert() { - call_t * c = calltab_get_selected_call(current_calls); + callable_obj_t * c = calltab_get_selected_call(current_calls); if(c) { - c->state = CALL_STATE_CURRENT; - c->to = g_strdup(""); + c->_state = CALL_STATE_CURRENT; + c->_trsft_to = g_strdup(""); calltree_update_call(current_calls,c); update_menus(); } @@ -449,9 +457,15 @@ sflphone_unset_transfert() } void -sflphone_incoming_call (call_t * c) +sflphone_display_transfer_status(const gchar* message) +{ + statusbar_push_message( message , __MSG_ACCOUNT_DEFAULT); +} + + void +sflphone_incoming_call (callable_obj_t * c) { - c->history_state = MISSED; + c->_history_state = MISSED; calllist_add ( current_calls, c ); calllist_add( history, c ); calltree_add_call( current_calls , c ); @@ -460,10 +474,10 @@ sflphone_incoming_call (call_t * c) } void -process_dialing(call_t * c, guint keyval, gchar * key) +process_dialing(callable_obj_t * c, guint keyval, gchar * key) { // We stop the tone - if(strlen(c->to) == 0 && c->state != CALL_STATE_TRANSFERT){ + if(strlen(c->_peer_number) == 0 && c->_state != CALL_STATE_TRANSFERT){ dbus_start_tone( FALSE , 0 ); //dbus_play_dtmf( key ); } @@ -482,23 +496,23 @@ process_dialing(call_t * c, guint keyval, gchar * key) break; case 65288: /* BACKSPACE */ { /* Brackets mandatory because of local vars */ - gchar * before = c->to; - if(strlen(c->to) >= 1){ + gchar * before = c->_peer_number; + if(strlen(c->_peer_number) >= 1){ - c->to = g_strndup(c->to, strlen(c->to) -1); + c->_peer_number = g_strndup(c->_peer_number, strlen(c->_peer_number) -1); g_free(before); - DEBUG("TO: backspace %s", c->to); + DEBUG("TO: backspace %s", c->_peer_number); - if(c->state == CALL_STATE_DIALING) + if(c->_state == CALL_STATE_DIALING) { - g_free(c->from); - c->from = g_strconcat("\"\" <", c->to, ">", NULL); + //g_free(c->_peer_name); + //c->_peer_name = g_strconcat("\"\" <", c->_peer_number, ">", NULL); } calltree_update_call(current_calls,c); } - else if(strlen(c->to) == 0) + else if(strlen(c->_peer_number) == 0) { - if(c->state != CALL_STATE_TRANSFERT) + if(c->_state != CALL_STATE_TRANSFERT) dbus_hang_up(c); } } @@ -514,17 +528,20 @@ process_dialing(call_t * c, guint keyval, gchar * key) if (keyval < 127 || (keyval > 65400 && keyval < 65466)) { - if(c->state != CALL_STATE_TRANSFERT) + if (c->_state == CALL_STATE_TRANSFERT) + { + c->_trsft_to = g_strconcat(c->_trsft_to, key, NULL); + } + else + { dbus_play_dtmf( key ); - gchar * before = c->to; - c->to = g_strconcat(c->to, key, NULL); - g_free(before); - DEBUG("TO:default %s", c->to); + c->_peer_number = g_strconcat(c->_peer_number, key, NULL); + } - if(c->state == CALL_STATE_DIALING) + if(c->_state == CALL_STATE_DIALING) { - g_free(c->from); - c->from = g_strconcat("\"\" <", c->to, ">", NULL); + //g_free(c->_peer_name); + //c->_peer_name = g_strconcat("\"\" <", c->_peer_number, ">", NULL); } calltree_update_call(current_calls,c); } @@ -533,13 +550,12 @@ process_dialing(call_t * c, guint keyval, gchar * key) } - call_t * + callable_obj_t * sflphone_new_call() { - call_t *c; - gchar *from, *to; - + callable_obj_t *c; + gchar *peer_name, *peer_number; DEBUG("sflphone_new_call\n"); sflphone_on_hold(); @@ -548,12 +564,12 @@ sflphone_new_call() if( calllist_get_size(current_calls) == 0 ) dbus_start_tone( TRUE , ( voice_mails > 0 )? TONE_WITH_MESSAGE : TONE_WITHOUT_MESSAGE) ; - to = g_strdup(""); - from = g_strconcat("\"\" <>", NULL); - create_new_call (to, from, CALL_STATE_DIALING, "", &c); + peer_number = g_strdup(""); + peer_name = g_strdup (""); + create_new_call (CALL, CALL_STATE_DIALING, "", "", peer_name, peer_number, &c); - calllist_add(current_calls,c); - calltree_add_call(current_calls,c); + calllist_add (current_calls,c); + calltree_add_call (current_calls,c); update_menus(); return c; @@ -564,7 +580,7 @@ sflphone_new_call() sflphone_keypad( guint keyval, gchar * key) { DEBUG("sflphone_keypad \n"); - call_t * c = calltab_get_selected_call(current_calls); + callable_obj_t * c = calltab_get_selected_call(current_calls); if((active_calltree != current_calls) || (active_calltree == current_calls && !c)) { @@ -585,7 +601,7 @@ sflphone_keypad( guint keyval, gchar * key) else if(c) { DEBUG("call"); - switch(c->state) + switch(c->_state) { case CALL_STATE_DIALING: // Currently dialing => edit number DEBUG("Writing a number\n"); @@ -597,7 +613,7 @@ sflphone_keypad( guint keyval, gchar * key) { case 65307: /* ESCAPE */ dbus_hang_up(c); - (void) time(&c->_stop); + set_timestamp (&c->_time_stop); calltree_update_call( history , c ); break; default: @@ -610,7 +626,7 @@ sflphone_keypad( guint keyval, gchar * key) //c->from = g_strconcat("\"",call_get_name(c) ,"\" <", temp, ">", NULL); //g_free(before); //g_free(temp); - //update_call_tree(current_calls,c); + //update_callable_obj_tree(current_calls,c); } break; } @@ -620,7 +636,7 @@ sflphone_keypad( guint keyval, gchar * key) { case 65293: /* ENTER */ case 65421: /* ENTER numpad */ - c->history_state = INCOMING; + c->_history_state = INCOMING; calltree_update_call( history , c ); dbus_accept(c); DEBUG("from sflphone_keypad ( enter ) : "); stop_notification(); @@ -637,12 +653,12 @@ sflphone_keypad( guint keyval, gchar * key) case 65293: /* ENTER */ case 65421: /* ENTER numpad */ dbus_transfert(c); - (void) time(&c->_stop); + set_timestamp (&c->_time_stop); break; case 65307: /* ESCAPE */ sflphone_unset_transfert(c); break; - default: // When a call is on transfert, typing new numbers will add it to c->to + default: // When a call is on transfert, typing new numbers will add it to c->_peer_number process_dialing(c, keyval, key); break; } @@ -665,12 +681,12 @@ sflphone_keypad( guint keyval, gchar * key) case CALL_STATE_RINGING: case CALL_STATE_BUSY: case CALL_STATE_FAILURE: - c->_stop = 0; + //c->_stop = 0; switch (keyval) { case 65307: /* ESCAPE */ dbus_hang_up(c); - c->_stop = 0; + //c->_stop = 0; calltree_update_call( history , c ); break; } @@ -678,10 +694,10 @@ sflphone_keypad( guint keyval, gchar * key) default: break; } - + } else { - sflphone_new_call(); + sflphone_new_call(); } } @@ -692,81 +708,85 @@ sflphone_keypad( guint keyval, gchar * key) * Else, check if it an IP call. if not, popup an error message */ void -sflphone_place_call ( call_t * c ) +sflphone_place_call ( callable_obj_t * c ) { - if (c->state == CALL_STATE_DIALING && g_str_has_prefix (c->to, "sip:")) + if (c) { - dbus_place_call (c); - } - - else { - if(c->state == CALL_STATE_DIALING && strcmp(c->to, "") != 0) + if (c->_state == CALL_STATE_DIALING && g_str_has_prefix (c->_peer_number, "sip:")) { + dbus_place_call (c); + } - if( account_list_get_size() == 0 ) - { - notify_no_accounts(); - sflphone_fail(c); - } + else { - else if( account_list_get_by_state( ACCOUNT_STATE_REGISTERED ) == NULL ) + if(c->_state == CALL_STATE_DIALING && strcmp(c->_peer_number, "") != 0) { - notify_no_registered_accounts(); - sflphone_fail(c); - } - else - { - - account_t * current; + if( account_list_get_size() == 0 ) + { + notify_no_accounts(); + sflphone_fail(c); + } - if(g_strcasecmp(c->accountID, "") != 0) { - current = account_list_get_by_id(c->accountID); - } else { - current = account_list_get_current(); + else if( account_list_get_by_state( ACCOUNT_STATE_REGISTERED ) == NULL ) + { + notify_no_registered_accounts(); + sflphone_fail(c); } - // DEBUG("sflphone_place_call :: c->accountID : %i",c->accountID); - // account_t * current = c->accountID; + else + { + account_t * current; - if( current ) - { + if(g_strcasecmp(c->_accountID, "") != 0) { + current = account_list_get_by_id(c->_accountID); + } else { + current = account_list_get_current(); + } + // DEBUG("sflphone_place_call :: c->accountID : %i",c->accountID); + + // account_t * current = c->accountID; - if(g_strcasecmp(g_hash_table_lookup( current->properties, "Status"),"REGISTERED")==0) + + if( current ) { - // OK, everything alright - the call is made with the current account - c -> accountID = current -> accountID; - dbus_place_call(c); + + if(g_strcasecmp(g_hash_table_lookup( current->properties, "Status"),"REGISTERED")==0) + { + // OK, everything alright - the call is made with the current account + c->_accountID = current -> accountID; + dbus_place_call(c); + } + else + { + // Current account is not registered + // So we place a call with the first registered account + // And we switch the current account + current = account_list_get_by_state( ACCOUNT_STATE_REGISTERED ); + c->_accountID = current -> accountID; + dbus_place_call(c); + notify_current_account( current ); + } } else { - // Current account is not registered + + // No current accounts have been setup. // So we place a call with the first registered account - // And we switch the current account + // and we change the current account current = account_list_get_by_state( ACCOUNT_STATE_REGISTERED ); - c -> accountID = current -> accountID; + c->_accountID = current -> accountID; dbus_place_call(c); notify_current_account( current ); } } - else - { - - // No current accounts have been setup. - // So we place a call with the first registered account - // and we change the current account - current = account_list_get_by_state( ACCOUNT_STATE_REGISTERED ); - c -> accountID = current -> accountID; - dbus_place_call(c); - notify_current_account( current ); - } + // Update history + c->_history_state = OUTGOING; + calllist_add(history, c); } - // Update history - c->history_state = OUTGOING; - calllist_add(history, c); } } } @@ -775,22 +795,22 @@ sflphone_place_call ( call_t * c ) sflphone_display_selected_codec (const gchar* codecName) { - call_t * selectedCall; + callable_obj_t * selectedCall; gchar* msg; account_t* acc; selectedCall = calltab_get_selected_call(current_calls); if (selectedCall) { - if(selectedCall->accountID != NULL){ - acc = account_list_get_by_id(selectedCall->accountID); + if(selectedCall->_accountID != NULL){ + acc = account_list_get_by_id(selectedCall->_accountID); if (!acc) { msg = g_markup_printf_escaped (_("IP call - %s"), codecName); } else { msg = g_markup_printf_escaped(_("Using %s (%s) - Codec: %s") , - (gchar*)g_hash_table_lookup( acc->properties , ACCOUNT_ALIAS), - (gchar*)g_hash_table_lookup( acc->properties , ACCOUNT_TYPE), - codecName); + (gchar*)g_hash_table_lookup( acc->properties , ACCOUNT_ALIAS), + (gchar*)g_hash_table_lookup( acc->properties , ACCOUNT_TYPE), + codecName); } statusbar_push_message( msg , __MSG_ACCOUNT_DEFAULT); g_free(msg); @@ -801,24 +821,24 @@ sflphone_display_selected_codec (const gchar* codecName) gchar* sflphone_get_current_codec_name() { - call_t * selectedCall = calltab_get_selected_call(current_calls); + callable_obj_t * selectedCall = calltab_get_selected_call(current_calls); return dbus_get_current_codec_name(selectedCall); } void sflphone_rec_call() { - call_t * selectedCall = calltab_get_selected_call(current_calls); + callable_obj_t * selectedCall = calltab_get_selected_call(current_calls); dbus_set_record(selectedCall); - switch(selectedCall->state) + switch(selectedCall->_state) { case CALL_STATE_CURRENT: - selectedCall->state = CALL_STATE_RECORD; + selectedCall->_state = CALL_STATE_RECORD; break; case CALL_STATE_RECORD: - selectedCall->state = CALL_STATE_CURRENT; + selectedCall->_state = CALL_STATE_CURRENT; break; default: WARN("Should not happen in sflphone_off_hold ()!"); @@ -842,38 +862,42 @@ sflphone_fill_codec_list() gchar** details; gchar** pl; - for(pl=order; *order; order++) + if (codecs) { - codec_t * c = g_new0(codec_t, 1); - c->_payload = atoi(*order); - details = (gchar **)dbus_codec_details(c->_payload); - //DEBUG("Codec details: %s / %s / %s / %s",details[0],details[1],details[2],details[3]); + for(pl=order; *order; order++) + { + codec_t * c = g_new0(codec_t, 1); + c->_payload = atoi(*order); + details = (gchar **)dbus_codec_details(c->_payload); - c->name = details[0]; - c->is_active = TRUE; - c->sample_rate = atoi(details[1]); - c->_bitrate = atof(details[2]); - c->_bandwidth = atof(details[3]); - codec_list_add(c); - } + //DEBUG("Codec details: %s / %s / %s / %s",details[0],details[1],details[2],details[3]); - for(pl=codecs; *codecs; codecs++) - { - details = (gchar **)dbus_codec_details(atoi(*codecs)); - if(codec_list_get_by_payload(atoi(*codecs))!=NULL){ - // does nothing - the codec is already in the list, so is active. - } - else{ - codec_t* c = g_new0(codec_t, 1); - c->_payload = atoi(*codecs); c->name = details[0]; - c->is_active = FALSE; + c->is_active = TRUE; c->sample_rate = atoi(details[1]); c->_bitrate = atof(details[2]); c->_bandwidth = atof(details[3]); codec_list_add(c); } + + for(pl=codecs; *codecs; codecs++) + { + details = (gchar **)dbus_codec_details(atoi(*codecs)); + if(codec_list_get_by_payload(atoi(*codecs))!=NULL){ + // does nothing - the codec is already in the list, so is active. + } + else{ + codec_t* c = g_new0(codec_t, 1); + c->_payload = atoi(*codecs); + c->name = details[0]; + c->is_active = FALSE; + c->sample_rate = atoi(details[1]); + c->_bitrate = atof(details[2]); + c->_bandwidth = atof(details[3]); + codec_list_add(c); + } + } } if( codec_list_get_size() == 0) { @@ -884,11 +908,88 @@ sflphone_fill_codec_list() } } -void format_phone_number (gchar **number) { +void sflphone_fill_call_list (void) +{ + + gchar** calls = (gchar**)dbus_get_call_list(); + gchar** pl; + GHashTable *call_details; + callable_obj_t *c; + gchar *callID; + + if(calls) + { + for(pl=calls; *calls; calls++) + { + c = g_new0(callable_obj_t, 1); + callID = (gchar*)(*calls); + call_details = dbus_get_call_details(callID); + create_new_call_from_details (callID, call_details, &c); + c->_callID = g_strdup(callID); + + // Add it to the list + DEBUG ("Add call retrieved from server side: %s\n", c->_callID); + calllist_add (current_calls, c); + // Update the GUI + calltree_add_call (current_calls, c); + } + } +} + +void sflphone_fill_history (void) +{ + GHashTable *entries; + GHashTableIter iter; + gpointer key, value; + callable_obj_t *history_entry; - gchar *_number; + DEBUG ("Loading history ..."); - _number = *number; + entries = dbus_get_history (); + if (entries) + { + // Init the iterator + g_hash_table_iter_init (&iter, entries); + while (g_hash_table_iter_next (&iter, &key, &value)) + { + /* do something with key and value */ + create_history_entry_from_serialized_form ((gchar*)key, (gchar*)value, &history_entry); + // Add it and update the GUI + calllist_add (history, history_entry); + } + } +} - //strip_spaces (&_number); +void sflphone_save_history (void) +{ + GQueue *items; + gint size; + int i; + callable_obj_t *current; + GHashTable *result = NULL; + gchar *key, *value; + + DEBUG ("Saving history ..."); + + result = g_hash_table_new(NULL, g_str_equal); + items = history->callQueue; + size = calllist_get_size (history); + + for (i=0; i<size; i++) + { + current = g_queue_peek_nth (items, i); + if (current) + { + value = serialize_history_entry (current); + key = convert_timestamp_to_gchar (current->_time_start); + g_hash_table_replace(result, (gpointer) key, + (gpointer) value); + } + } + + dbus_set_history (result); + + // Decrement the reference count + g_hash_table_unref(result); } + diff --git a/sflphone-client-gnome/src/actions.h b/sflphone-client-gnome/src/actions.h index 19a22694d6b11a29bf3700c4e02d41a74187c125..4c1951d5412a63f7763948dd35ec4a8f04a84b3b 100644 --- a/sflphone-client-gnome/src/actions.h +++ b/sflphone-client-gnome/src/actions.h @@ -23,6 +23,7 @@ #include <libintl.h> #include <locale.h> + #include <accountlist.h> #include <codeclist.h> #include <sflphone_const.h> @@ -64,9 +65,9 @@ void sflphone_off_hold (); /** * Open a new call - * @return call_t* A pointer on the call structure + * @return callable_obj_t* A pointer on the call structure */ -call_t * sflphone_new_call(); +callable_obj_t * sflphone_new_call(); /** * Notify voice mails to the application @@ -95,43 +96,43 @@ void sflphone_pick_up (); * Put the call on hold state * @param c The current call */ -void sflphone_hold ( call_t * c); +void sflphone_hold ( callable_obj_t * c); /** * Put the call in Ringing state * @param c* The current call */ -void sflphone_ringing(call_t * c ); +void sflphone_ringing(callable_obj_t * c ); /** * Put the call in Busy state * @param c* The current call */ -void sflphone_busy( call_t * c ); +void sflphone_busy( callable_obj_t * c ); /** * Put the call in Failure state * @param c* The current call */ -void sflphone_fail( call_t * c ); +void sflphone_fail( callable_obj_t * c ); /** * Put the call in Current state * @param c The current call */ -void sflphone_current ( call_t * c); +void sflphone_current ( callable_obj_t * c); /** * The callee has hung up * @param c The current call */ -void sflphone_hung_up( call_t * c); +void sflphone_hung_up( callable_obj_t * c); /** * Incoming call * @param c The incoming call */ -void sflphone_incoming_call ( call_t * c); +void sflphone_incoming_call ( callable_obj_t * c); /** * Dial the number @@ -142,16 +143,18 @@ void sflphone_incoming_call ( call_t * c); void sflphone_keypad ( guint keyval, gchar * key); /** - * Place a call with a filled call_t.to + * Place a call with a filled callable_obj_t.to * @param c A call in CALL_STATE_DIALING state */ -void sflphone_place_call ( call_t * c ); +void sflphone_place_call ( callable_obj_t * c ); /** * Initialize the accounts data structure */ void sflphone_fill_account_list(gboolean toolbarInitialized); +void sflphone_fill_call_list (void); + /** * Set an account as current. The current account is to one used to place calls with by default * The current account is the first in the account list ( index 0 ) @@ -163,7 +166,7 @@ void sflphone_set_current_account(); */ void sflphone_fill_codec_list(); -void sflphone_record (call_t *c); +void sflphone_record (callable_obj_t *c); void sflphone_rec_call (void); @@ -173,4 +176,8 @@ void sflphone_display_selected_codec (const gchar* codecName); void status_bar_display_account (); +void sflphone_fill_history (void); + +void sflphone_save_history (void); + #endif diff --git a/sflphone-client-gnome/src/assistant.c b/sflphone-client-gnome/src/assistant.c index 374ea0539f25d960555f18f4ee8c30c826c6d21b..a642da19bc35a1e351f2669cc45b88110309d025 100644 --- a/sflphone-client-gnome/src/assistant.c +++ b/sflphone-client-gnome/src/assistant.c @@ -135,8 +135,7 @@ static void iax_apply_callback( void ) { sprintf(message, MESSAGE_SUMMARY, gtk_entry_get_text (GTK_ENTRY(wiz->iax_alias)), gtk_entry_get_text (GTK_ENTRY(wiz->iax_server)), - gtk_entry_get_text (GTK_ENTRY(wiz->iax_username)), - gtk_entry_get_text (GTK_ENTRY(wiz->iax_password)) + gtk_entry_get_text (GTK_ENTRY(wiz->iax_username)) ) ; gtk_label_set_text (GTK_LABEL(wiz->label_summary), message); } @@ -231,7 +230,7 @@ GtkWidget* build_sfl_or_account() { GtkWidget* build_sip_account_configuration( void ) { GtkWidget* table; GtkWidget* label; - GtkWidget* image; + GtkWidget *image; wiz->sip_account = create_vbox( GTK_ASSISTANT_PAGE_CONTENT , _("SIP account configuration") , _("Please fill the following information:")); // table @@ -327,7 +326,7 @@ GtkWidget* build_email_configuration( void ) { GtkWidget* build_iax_account_configuration( void ) { GtkWidget* label; GtkWidget* table; - GtkWidget* image; + GtkWidget *image; wiz->iax_account = create_vbox( GTK_ASSISTANT_PAGE_CONFIRM , _("IAX2 account configuration") , _("Please fill the following information:")); diff --git a/sflphone-client-gnome/src/call.c b/sflphone-client-gnome/src/call.c deleted file mode 100644 index 5ab52ee258452e52d2dd907cb93f90ceee3198d4..0000000000000000000000000000000000000000 --- a/sflphone-client-gnome/src/call.c +++ /dev/null @@ -1,126 +0,0 @@ -/* - * Copyright (C) 2009 Savoir-Faire Linux inc. - * Author: Julien Bonjean <julien.bonjean@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 - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#include <call.h> - -/* GCompareFunc to compare a callID (gchar* and a call_t) */ -gint -is_callID_callstruct ( gconstpointer a, gconstpointer b) -{ - call_t * c = (call_t*)a; - if(g_strcasecmp(c->callID, (const gchar*) b) == 0) - { - return 0; - } - else - { - return 1; - } -} - -/* GCompareFunc to get current call (gchar* and a call_t) */ -gint -get_state_callstruct ( gconstpointer a, gconstpointer b) -{ - call_t * c = (call_t*)a; - if( c->state == *((call_state_t*)b)) - { - return 0; - } - else - { - return 1; - } -} - -gchar * -call_get_name (const call_t * c) -{ - gchar * end = g_strrstr(c->from, "\""); - if (!end) { - return g_strndup(c->from, 0); - } else { - gchar * name = c->from +1; - return g_strndup(name, end - name); - } -} - -gchar * -call_get_number (const call_t * c) -{ - gchar * number = g_strrstr(c->from, "<") + 1; - gchar * end = g_strrstr(c->from, ">"); - number = g_strndup(number, end - number ); - return number; -} - -gchar * -call_get_recipient( const call_t * c ) -{ - return c->to; -} - -void create_new_call (gchar *to, gchar *from, call_state_t state, gchar *accountID, call_t **new_call) { - - gchar *call_id; - call_t *call; - - call = g_new0 (call_t, 1); - call->to = g_strdup (to); - call->from = g_strdup (from); - call->state = state; - call->accountID = g_strdup (accountID); - call->_start = 0; - call->_stop = 0; - - call_id = g_new0(gchar, 30); - g_sprintf(call_id, "%d", rand()); - call->callID = g_strdup (call_id); - - *new_call = call; -} - -void create_new_call_from_details (const gchar *call_id, GHashTable *details, call_t **call) -{ - gchar *from, *to, *accountID; - call_t *new_call; - // GHashTable *call_details; - - accountID = g_hash_table_lookup (details, "ACCOUNTID"); - to = g_hash_table_lookup (details, "PEER_NUMBER"); - from = g_markup_printf_escaped("\"\" <%s>", to); - - create_new_call (from, from, CALL_STATE_DIALING, accountID, &new_call); - *call = new_call; -} - - - void -free_call_t (call_t *c) -{ - g_free (c->callID); - g_free (c->accountID); - g_free (c->from); - g_free (c->to); - g_free (c); -} - -void attach_thumbnail (call_t *call, GdkPixbuf *pixbuf) { - call->contact_thumbnail = pixbuf; -} diff --git a/sflphone-client-gnome/src/call.h b/sflphone-client-gnome/src/call.h deleted file mode 100644 index b32ba9920ce0a95ca27853e6b982bccca77f08c7..0000000000000000000000000000000000000000 --- a/sflphone-client-gnome/src/call.h +++ /dev/null @@ -1,155 +0,0 @@ -/* - * Copyright (C) 2009 Savoir-Faire Linux inc. - * Author: Julien Bonjean <julien.bonjean@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 - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#ifndef __CALLL_H__ -#define __CALLL_H__ - -#include <gtk/gtk.h> -#include <glib/gprintf.h> -#include <stdlib.h> - -/** - * @enum history_state - * This enum have all the state a call can take in the history - */ -typedef enum -{ - NONE, - INCOMING, - OUTGOING, - MISSED -} history_state_t; - -/** - * @enum contact_type - * This enum have all types of contacts: HOME phone, cell phone, etc... - */ -typedef enum -{ - CONTACT_PHONE_HOME, - CONTACT_PHONE_BUSINESS, - CONTACT_PHONE_MOBILE -} contact_type_t; - -/** - * @enum call_type - * This enum have all types of call - */ -typedef enum -{ - CALL, - HISTORY, - CONTACT -} call_type_t; - - -/** @enum call_state_t - * This enum have all the states a call can take. - */ -typedef enum -{ /** Invalid state */ - CALL_STATE_INVALID = 0, - /** Ringing incoming call */ - CALL_STATE_INCOMING, - /** Ringing outgoing call */ - CALL_STATE_RINGING, - /** Call to which the user can speak and hear */ - CALL_STATE_CURRENT, - /** Call which numbers are being added by the user */ - CALL_STATE_DIALING, - /** Call is on hold */ - CALL_STATE_HOLD, - /** Call has failed */ - CALL_STATE_FAILURE, - /** Call is busy */ - CALL_STATE_BUSY, - /** Call is being transfert. During this state, the user can enter the new number. */ - CALL_STATE_TRANSFERT, - /** Call is on hold */ - CALL_STATE_RECORD -} call_state_t; - - -/** @struct call_t - * @brief Call information. - * This struct holds information about a call. - */ -typedef struct { - /** Type of call entry */ - call_type_t call_type; - /** Unique identifier of the call */ - gchar * callID; - /** The account used to place/receive the call */ - gchar * accountID; - /** The information about the calling person. See call_get_name() and call_get_number() - * on how to get the name and number separately. */ - gchar * from; - /** The number we are calling. Only used when dialing out */ - gchar * to; - /** The current state of the call */ - call_state_t state; - /** The history state if necessary */ - history_state_t history_state; - - GdkPixbuf *contact_thumbnail; - - time_t _start; - time_t _stop; - -} call_t; - - -/* GCompareFunc to compare a callID (gchar* and a call_t) */ -gint -is_callID_callstruct ( gconstpointer, gconstpointer); - -/* GCompareFunc to get current call (gchar* and a call_t) */ -gint -get_state_callstruct ( gconstpointer, gconstpointer); - -/** This function parse the call_t.from field to return the name - * @param c The call - * @return The full name of the caller or an empty string */ -gchar * -call_get_name (const call_t *); - -/** - * This function parse the call_t.from field to return the number - * @param c The call - * @return The number of the caller - */ -gchar * -call_get_number (const call_t *); - -gchar * -call_get_recipient( const call_t *); - -void -create_new_call (gchar *, gchar *, call_state_t, gchar *, call_t **); - -void -create_new_call_from_details (const gchar *, GHashTable *, call_t **); - -void -attach_thumbnail (call_t *, GdkPixbuf *); - -void -free_call_t (call_t *c); - -#endif diff --git a/sflphone-client-gnome/src/callable_obj.c b/sflphone-client-gnome/src/callable_obj.c new file mode 100644 index 0000000000000000000000000000000000000000..99a46a8dcae524e182723094e388d1343255822f --- /dev/null +++ b/sflphone-client-gnome/src/callable_obj.c @@ -0,0 +1,329 @@ +/* + * Copyright (C) 2009 Savoir-Faire Linux inc. + * Author: Julien Bonjean <julien.bonjean@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 + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include <callable_obj.h> + +gint is_callID_callstruct ( gconstpointer a, gconstpointer b) +{ + callable_obj_t * c = (callable_obj_t*)a; + if(g_strcasecmp(c->_callID, (const gchar*) b) == 0) + { + return 0; + } + else + { + return 1; + } +} + +gint get_state_callstruct ( gconstpointer a, gconstpointer b) +{ + callable_obj_t * c = (callable_obj_t*)a; + if( c->_state == *((call_state_t*)b)) + { + return 0; + } + else + { + return 1; + } +} + +gchar* call_get_peer_name (const gchar *format) +{ + gchar *end, *name; + + end = g_strrstr (format, "\""); + if (!end) { + return g_strndup (format, 0); + } else { + name = format +1; + return g_strndup(name, end - name); + } +} + +gchar* call_get_peer_number (const gchar *format) +{ + gchar * number = g_strrstr(format, "<") + 1; + gchar * end = g_strrstr(format, ">"); + number = g_strndup(number, end - number ); + return number; +} + + +void create_new_call (callable_type_t type, call_state_t state, gchar* callID , gchar* accountID, gchar* peer_name, gchar* peer_number, callable_obj_t ** new_call) +{ + + callable_obj_t *obj; + gchar *call_id; + + // Allocate memory + obj = g_new0 (callable_obj_t, 1); + + // Set fields + obj->_type = type; + obj->_state = state; + obj->_accountID = g_strdup (accountID); + obj->_peer_name = g_strdup (peer_name); + obj->_peer_number = g_strdup (peer_number); + obj->_peer_info = g_strdup (get_peer_info (peer_name, peer_number)); + obj->_trsft_to = ""; + set_timestamp (&(obj->_time_start)); + set_timestamp (&(obj->_time_stop)); + + if (g_strcasecmp (callID, "") == 0) + call_id = generate_call_id (); + else + call_id = callID; + // Set the ID + obj->_callID = g_strdup (call_id); + + *new_call = obj; +} + +void create_new_call_from_details (const gchar *call_id, GHashTable *details, callable_obj_t **call) +{ + gchar *peer_name, *peer_number, *accountID, *state_str; + callable_obj_t *new_call; + call_state_t state; + + accountID = g_hash_table_lookup (details, "ACCOUNTID"); + peer_number = g_hash_table_lookup (details, "PEER_NUMBER"); + peer_name = g_strdup (""); + state_str = g_hash_table_lookup (details, "CALL_STATE"); + + if (g_strcasecmp (state_str, "CURRENT") == 0) + state = CALL_STATE_CURRENT; + + else if (g_strcasecmp (state_str, "HOLD") == 0) + state = CALL_STATE_HOLD; + + else if (g_strcasecmp (state_str, "BUSY") == 0) + state = CALL_STATE_BUSY; + + else + state = CALL_STATE_FAILURE; + + create_new_call (CALL, state, (gchar*)call_id, accountID, peer_name, peer_number, &new_call); + *call = new_call; +} + +void create_history_entry_from_serialized_form (gchar *timestamp, gchar *details, callable_obj_t **call) +{ + gchar *peer_name=""; + gchar *peer_number="", *accountID="", *time_stop=""; + callable_obj_t *new_call; + history_state_t history_state = MISSED; + char *ptr; + const char *delim="|"; + int token=0; + + // details is in serialized form, i e: calltype%to%from%callid + + if ((ptr = strtok(details, delim)) != NULL) { + do { + switch (token) + { + case 0: + history_state = get_history_state_from_id (ptr); + break; + case 1: + peer_number = ptr; + break; + case 2: + peer_name = ptr; + break; + case 3: + time_stop = ptr; + break; + case 4: + accountID = ptr; + break; + default: + break; + } + token ++; + } while ((ptr = strtok(NULL, delim)) != NULL); + + } + if (g_strcasecmp (peer_name, "empty") == 0) + peer_name=""; + create_new_call (HISTORY_ENTRY, CALL_STATE_DIALING, "", accountID, peer_name, peer_number, &new_call); + new_call->_history_state = history_state; + new_call->_time_start = convert_gchar_to_timestamp (timestamp); + new_call->_time_stop = convert_gchar_to_timestamp (time_stop); + + *call = new_call; +} + +void free_callable_obj_t (callable_obj_t *c) +{ + g_free (c->_callID); + g_free (c->_accountID); + g_free (c->_peer_name); + g_free (c->_peer_number); + g_free (c->_peer_info); + g_free (c); +} + +void attach_thumbnail (callable_obj_t *call, GdkPixbuf *pixbuf) { + call->_contact_thumbnail = pixbuf; +} + +gchar* generate_call_id (void) +{ + gchar *call_id; + + call_id = g_new0(gchar, 30); + g_sprintf(call_id, "%d", rand()); + return call_id; +} + +gchar* get_peer_info (gchar* number, gchar* name) +{ + gchar *info; + + info = g_strconcat("\"", name, "\" <", number, ">", NULL); + return info; +} + +history_state_t get_history_state_from_id (gchar *indice){ + + history_state_t state; + + if (g_strcasecmp (indice, "0") ==0) + state = MISSED; + else if (g_strcasecmp (indice, "1") ==0) + state = INCOMING; + else if (g_strcasecmp (indice, "2") ==0) + state = OUTGOING; + else + state = MISSED; + + return state; +} + +gchar* get_call_duration (callable_obj_t *obj) +{ + + gchar *res; + int duration; + time_t start, end; + + start = obj->_time_start; + end = obj->_time_stop; + + if (start == end) + return g_markup_printf_escaped("<small>Duration:</small> 0:00"); + + duration = (int)end - (int)start; + + if( duration / 60 == 0 ) + { + if( duration < 10 ) + res = g_markup_printf_escaped("00:0%i", duration); + else + res = g_markup_printf_escaped("00:%i", duration); + } + else + { + if( duration%60 < 10 ) + res = g_markup_printf_escaped("%i:0%i" , duration/60 , duration%60); + else + res = g_markup_printf_escaped("%i:%i" , duration/60 , duration%60); + } + return g_markup_printf_escaped("<small>Duration:</small> %s", res); + +} + +gchar* serialize_history_entry (callable_obj_t *entry) +{ + // "0|514-276-5468|Savoir-faire Linux|144562458" for instance + + gchar* result; + gchar* separator = "|"; + gchar* history_state, *timestamp; + + // Need the string form for the history state + history_state = get_history_id_from_state (entry->_history_state); + // and the timestamps + timestamp = convert_timestamp_to_gchar (entry->_time_stop); + + result = g_strconcat (history_state, separator, + entry->_peer_number, separator, + g_strcasecmp (entry->_peer_name,"") ==0 ? "empty": entry->_peer_name, separator, + timestamp, separator, + g_strcasecmp (entry->_accountID,"") ==0 ? "empty": entry->_accountID, + NULL); + + return result; +} + +gchar* get_history_id_from_state (history_state_t state) +{ + // Refer to history_state_t enum in callable_obj.h + switch (state) + { + case MISSED: + return "0"; + case INCOMING: + return "1"; + case OUTGOING: + return "2"; + default: + return "0"; + } +} + +gchar* get_formatted_start_timestamp (callable_obj_t *obj) +{ + struct tm* ptr; + time_t lt; + unsigned char str[100]; + + if (obj) + { + lt = obj->_time_start; + ptr = localtime(<); + + // result function of the current locale + strftime((char *)str, 100, "%x %X", (const struct tm *)ptr); + return g_markup_printf_escaped("\n%s\n" , str); + } + return ""; +} + +void set_timestamp (time_t *timestamp) +{ + time_t tmp; + + // Set to the current value + (void) time(&tmp); + *timestamp=tmp; +} + +gchar* convert_timestamp_to_gchar (time_t timestamp) +{ + return g_markup_printf_escaped ("%i", (int)timestamp); +} + +time_t convert_gchar_to_timestamp (gchar *timestamp) +{ + return (time_t) atoi (timestamp); +} diff --git a/sflphone-client-gnome/src/callable_obj.h b/sflphone-client-gnome/src/callable_obj.h new file mode 100644 index 0000000000000000000000000000000000000000..92e3df016b3a191c522a05d2f1fc1ce4bcd9e914 --- /dev/null +++ b/sflphone-client-gnome/src/callable_obj.h @@ -0,0 +1,180 @@ +/* + * Copyright (C) 2009 Savoir-Faire Linux inc. + * Author: Julien Bonjean <julien.bonjean@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 + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#ifndef __CALLABLE_OBJ_H__ +#define __CALLABLE_OBJ_H__ + +#include <gtk/gtk.h> +#include <glib/gprintf.h> +#include <stdlib.h> +#include <time.h> + +/** + * @enum history_state + * This enum have all the state a call can take in the history + */ +typedef enum +{ + MISSED, + INCOMING, + OUTGOING +} history_state_t; + +/** + * @enum contact_type + * This enum have all types of contacts: HOME phone, cell phone, etc... + */ +typedef enum +{ + CONTACT_PHONE_HOME, + CONTACT_PHONE_BUSINESS, + CONTACT_PHONE_MOBILE +} contact_type_t; + +/** + * @enum callable_obj_type + * This enum have all types of items + */ +typedef enum +{ + CALL, + HISTORY_ENTRY, + CONTACT +} callable_type_t; + + +/** @enum call_state_t + * This enum have all the states a call can take. + */ +typedef enum +{ + CALL_STATE_INVALID = 0, + CALL_STATE_INCOMING, + CALL_STATE_RINGING, + CALL_STATE_CURRENT, + CALL_STATE_DIALING, + CALL_STATE_HOLD, + CALL_STATE_FAILURE, + CALL_STATE_BUSY, + CALL_STATE_TRANSFERT, + CALL_STATE_RECORD +} call_state_t; + + +/** @struct callable_obj_t + * @brief Call information. + * This struct holds information about a call. + */ +typedef struct { + + callable_type_t _type; // CALL - HISTORY ENTRY - CONTACT + call_state_t _state; // The state of the call + gchar* _callID; // The call ID + gchar* _accountID; // The account the call is made with + time_t _time_start; // The timestamp the call was initiating + time_t _time_stop; // The timestamp the call was over + history_state_t _history_state; // The history state if necessary + + /** + * The information about the person we are talking + */ + gchar *_peer_name; + gchar *_peer_number; + + /** + * Used to contain the transfer information + */ + gchar *_trsft_to; + + /** + * A well-formatted phone information + */ + gchar *_peer_info; + + /** + * The thumbnail, if callable_obj_type=CONTACT + */ + GdkPixbuf *_contact_thumbnail; + +} callable_obj_t; + +void create_new_call (callable_type_t, call_state_t, gchar*, gchar*, gchar*, gchar*, callable_obj_t **); + +void create_new_call_from_details (const gchar *, GHashTable *, callable_obj_t **); + +void create_history_entry_from_serialized_form (gchar *, gchar *, callable_obj_t **); + +/* + * GCompareFunc to compare a callID (gchar* and a callable_obj_t) + */ +gint is_callID_callstruct ( gconstpointer, gconstpointer); + +/* + * GCompareFunc to get current call (gchar* and a callable_obj_t) + */ +gint get_state_callstruct ( gconstpointer, gconstpointer); + +/** + * This function parse the callable_obj_t.from field to return the name + * @param c The call + * @return The full name of the caller or an empty string + */ +gchar* call_get_peer_name (const gchar*); + +/** + * This function parse the callable_obj_t.from field to return the number + * @param c The call + * @return The number of the caller + */ +gchar* call_get_peer_number (const gchar*); + + + + +void +attach_thumbnail (callable_obj_t *, GdkPixbuf *); + +void +free_callable_obj_t (callable_obj_t *c); + +/** + * @return gchar* A random ID + */ +gchar* generate_call_id (void); + +gchar* get_peer_info (gchar*, gchar*); + +history_state_t get_history_state_from_id (gchar *indice); + +gchar* get_call_duration (callable_obj_t *obj); + +gchar* serialize_history_entry (callable_obj_t *entry); + +gchar* get_history_id_from_state (history_state_t state); + +gchar* get_formatted_start_timestamp (callable_obj_t *obj); + +void set_timestamp (time_t*); + +gchar* convert_timestamp_to_gchar (time_t); + +time_t convert_gchar_to_timestamp (gchar*); + + +#endif diff --git a/sflphone-client-gnome/src/config/accountwindow.c b/sflphone-client-gnome/src/config/accountwindow.c index 1058d295b609e592fbcac13245afca95399cda38..198d0c9eba3fb9bbd2133ab293aab40264ef0763 100644 --- a/sflphone-client-gnome/src/config/accountwindow.c +++ b/sflphone-client-gnome/src/config/accountwindow.c @@ -21,6 +21,7 @@ #include <actions.h> #include <mainwindow.h> #include <accountlist.h> +#include <accountwindow.h> // From version 2.16, gtk provides the functionalities libsexy used to provide #if GTK_CHECK_VERSION(2,16,0) @@ -71,7 +72,6 @@ is_iax_enabled(void) show_account_window (account_t * a) { gint response; - GtkWidget *image; currentAccount = a; @@ -86,6 +86,11 @@ show_account_window (account_t * a) /* TODO: add curProxy, and add boxes for Proxy support */ gchar * curMailbox = ""; +#if GTK_CHECK_VERSION(2,16,0) +#else + GtkWidget *image; +#endif + // Load from SIP/IAX/Unknown ? if(a) { diff --git a/sflphone-client-gnome/src/config/accountwindow.h b/sflphone-client-gnome/src/config/accountwindow.h index 2b393a332d9d1102f3c6b66b2483d95c8d9f7642..c7e5e53e0b2e412855eff5247a5c4988001b6f67 100644 --- a/sflphone-client-gnome/src/config/accountwindow.h +++ b/sflphone-client-gnome/src/config/accountwindow.h @@ -24,6 +24,8 @@ * @brief The window to edit account details. */ +#include "utils.h" +#include "configwindow.h" /** * Display the main account widget diff --git a/sflphone-client-gnome/src/config/addressbook-config.c b/sflphone-client-gnome/src/config/addressbook-config.c index a9f0eae296cb912d9bbbf9779f282f201abe2333..6a866d1bce5d900166552ab3c784b981b38634cb 100644 --- a/sflphone-client-gnome/src/config/addressbook-config.c +++ b/sflphone-client-gnome/src/config/addressbook-config.c @@ -25,6 +25,8 @@ AddressBook_Config *addressbook_config; GtkWidget *book_tree_view; +GtkWidget *photo, *cards_label, *scale_label, *scrolled_label, *scrolled_window, *scale_button, *business, *mobile, *home; + enum { COLUMN_BOOK_ACTIVE, COLUMN_BOOK_NAME, COLUMN_BOOK_UID @@ -97,11 +99,51 @@ addressbook_config_save_parameters(void) g_hash_table_unref(params); } +void +enable_options(){ + + if (!addressbook_config->enable) + { + DEBUG("Disable addressbook options\n"); + gtk_widget_set_sensitive(photo, FALSE); + gtk_widget_set_sensitive(scrolled_label, FALSE); + gtk_widget_set_sensitive(cards_label, FALSE); + gtk_widget_set_sensitive(scrolled_window, FALSE); + gtk_widget_set_sensitive(scale_button, FALSE); + gtk_widget_set_sensitive(scale_label, FALSE); + gtk_widget_set_sensitive(business, FALSE); + gtk_widget_set_sensitive(mobile, FALSE); + gtk_widget_set_sensitive(home, FALSE); + gtk_widget_set_sensitive(book_tree_view, FALSE); + + + } + else + { + DEBUG("Enable addressbook options\n"); + gtk_widget_set_sensitive(photo, TRUE); + gtk_widget_set_sensitive(scrolled_label, TRUE); + gtk_widget_set_sensitive(cards_label, TRUE); + gtk_widget_set_sensitive(scrolled_window, TRUE); + gtk_widget_set_sensitive(scale_button, TRUE); + gtk_widget_set_sensitive(scale_label, TRUE); + gtk_widget_set_sensitive(business, TRUE); + gtk_widget_set_sensitive(mobile, TRUE); + gtk_widget_set_sensitive(home, TRUE); + gtk_widget_set_sensitive(book_tree_view, TRUE); + } +} + static void enable_cb (GtkWidget *widget) { + addressbook_config->enable = (guint) gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)); + + enable_options(); + + } static void @@ -248,13 +290,12 @@ addressbook_config_fill_book_list() create_addressbook_settings() { - GtkWidget *ret, *result_frame, *table, *value, *label, *photo, *item; + GtkWidget *ret, *result_frame, *table, *value, *label, *item; GtkListStore *store; GtkCellRenderer *renderer; GtkTreeSelection *tree_selection; GtkTreeViewColumn *tree_view_column; - GtkWidget *scrolled_window, *hbox; // Load the user value addressbook_config_load_parameters(&addressbook_config); @@ -262,15 +303,10 @@ create_addressbook_settings() ret = gtk_vbox_new(FALSE, 10); gtk_container_set_border_width(GTK_CONTAINER(ret), 10); - gnome_main_section_new (_("General"), &result_frame); + gnome_main_section_new_with_table (_("General"), &result_frame, &table, 3, 3); gtk_box_pack_start(GTK_BOX(ret), result_frame, FALSE, FALSE, 0); - gtk_widget_show (result_frame); + // gtk_widget_show (result_frame); - table = gtk_table_new ( 3, 3, FALSE/* homogeneous */); - gtk_table_set_row_spacings( GTK_TABLE(table), 8); - gtk_table_set_col_spacings( GTK_TABLE(table), 8); - gtk_widget_show(table); - gtk_container_add( GTK_CONTAINER (result_frame) , table ); // PHOTO DISPLAY item = gtk_check_button_new_with_mnemonic( _("_Use Evolution address books")); @@ -279,71 +315,61 @@ create_addressbook_settings() gtk_table_attach ( GTK_TABLE( table ), item, 1, 3, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); // SCALE BUTTON - NUMBER OF RESULTS - hbox = gtk_hbox_new(FALSE, 0); - label = gtk_label_new (_("Download limit:")); - gtk_box_pack_start(GTK_BOX(hbox),label,FALSE,FALSE,0); + scale_button = gtk_hbox_new(FALSE, 0); + scale_label = gtk_label_new (_("Download limit:")); + gtk_box_pack_start(GTK_BOX(scale_button),scale_label,FALSE,FALSE,0); value = gtk_spin_button_new_with_range(1, 500, 1); - gtk_label_set_mnemonic_widget (GTK_LABEL (label), value); + gtk_label_set_mnemonic_widget (GTK_LABEL (scale_label), value); gtk_spin_button_set_value (GTK_SPIN_BUTTON( value ) , addressbook_config->max_results); g_signal_connect (G_OBJECT (value) , "value-changed" , G_CALLBACK(max_results_cb), NULL ); - gtk_box_pack_start(GTK_BOX(hbox),value,TRUE,TRUE,10); - gtk_table_attach ( GTK_TABLE( table ), hbox, 1, 3, 1, 2, GTK_EXPAND | GTK_FILL, GTK_EXPAND |GTK_FILL, 0, 0); - gtk_widget_show_all(hbox); + gtk_box_pack_start(GTK_BOX(scale_button),value,TRUE,TRUE,10); + gtk_table_attach ( GTK_TABLE( table ), scale_button, 1, 2, 1, 2, GTK_EXPAND | GTK_FILL, GTK_EXPAND |GTK_FILL, 0, 0); + cards_label = gtk_label_new(_("cards")); + gtk_table_attach( GTK_TABLE(table), cards_label, 2, 3, 1, 2, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + gtk_widget_show_all(scale_button); + // PHOTO DISPLAY photo = gtk_check_button_new_with_mnemonic( _("_Display contact photo if available")); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(photo), addressbook_config->display_contact_photo); g_signal_connect (G_OBJECT(photo) , "clicked" , G_CALLBACK (display_contact_photo_cb), NULL); gtk_table_attach ( GTK_TABLE( table ), photo, 1, 3, 2, 3, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + // Fields - gnome_main_section_new (_("Fields"), &result_frame); + gnome_main_section_new_with_table (_("Fields from Evolution's address books"), &result_frame, &table, 1, 3); gtk_box_pack_start(GTK_BOX(ret), result_frame, FALSE, FALSE, 0); - gtk_widget_show (result_frame); - - table = gtk_table_new ( 5, 3, FALSE); - gtk_table_set_row_spacings( GTK_TABLE(table), 8); - gtk_table_set_col_spacings( GTK_TABLE(table), 8); - gtk_widget_show(table); - gtk_container_add( GTK_CONTAINER (result_frame) , table ); - - label = gtk_label_new (_("Use the following fields from Evolution's address books:")); - gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); - gtk_table_attach ( GTK_TABLE( table ), label, 1, 4, 1, 2, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - - - item = gtk_check_button_new_with_mnemonic( _("_Business phone")); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(item), addressbook_config->search_phone_business); - g_signal_connect (G_OBJECT(item) , "clicked" , G_CALLBACK (search_phone_business_cb) , NULL); - gtk_table_attach ( GTK_TABLE( table ), item, 1, 4, 2, 3, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - - item = gtk_check_button_new_with_mnemonic( _("_Home phone")); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(item), addressbook_config->search_phone_home); - g_signal_connect (G_OBJECT(item) , "clicked" , G_CALLBACK (search_phone_home_cb) , NULL); - gtk_table_attach ( GTK_TABLE( table ), item, 1, 4, 3, 4, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - - item = gtk_check_button_new_with_mnemonic( _("_Mobile phone")); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(item), addressbook_config->search_phone_mobile); - g_signal_connect (G_OBJECT(item) , "clicked" , G_CALLBACK (search_phone_mobile_cb) , NULL); - gtk_table_attach ( GTK_TABLE( table ), item, 1, 4, 4, 5, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - + // gtk_widget_show (result_frame); + + business = gtk_check_button_new_with_mnemonic( _("_Business phone")); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(business), addressbook_config->search_phone_business); + g_signal_connect (G_OBJECT(business) , "clicked" , G_CALLBACK (search_phone_business_cb) , NULL); + gtk_table_attach ( GTK_TABLE( table ), business, 0, 1, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + gtk_widget_set_sensitive(business, FALSE); + + home = gtk_check_button_new_with_mnemonic( _("_Home phone")); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(home), addressbook_config->search_phone_home); + g_signal_connect (G_OBJECT(home) , "clicked" , G_CALLBACK (search_phone_home_cb) , NULL); + gtk_table_attach ( GTK_TABLE( table ), home, 0, 1, 1, 2, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + gtk_widget_set_sensitive(home, FALSE); + + mobile = gtk_check_button_new_with_mnemonic( _("_Mobile phone")); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(mobile), addressbook_config->search_phone_mobile); + g_signal_connect (G_OBJECT(mobile) , "clicked" , G_CALLBACK (search_phone_mobile_cb) , NULL); + gtk_table_attach ( GTK_TABLE( table ), mobile, 0, 1, 2, 3, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + // Address Book - gnome_main_section_new (_("Address Books"), &result_frame); + gnome_main_section_new_with_table (_("Address Books"), &result_frame, &table, 2, 3); gtk_box_pack_start(GTK_BOX(ret), result_frame, TRUE, TRUE, 0); gtk_widget_show (result_frame); - table = gtk_table_new ( 2, 3, FALSE/* homogeneous */); - gtk_table_set_row_spacings( GTK_TABLE(table), 8); - gtk_table_set_col_spacings( GTK_TABLE(table), 8); - gtk_widget_show(table); - gtk_container_add( GTK_CONTAINER (result_frame) , table ); - - label = gtk_label_new (_("Select which Evolution address books to use:")); - gtk_misc_set_alignment(GTK_MISC(label), 0.00, 0.1); + scrolled_label = gtk_label_new (_("Select which Evolution address books to use:")); + gtk_misc_set_alignment(GTK_MISC(scrolled_label), 0.00, 0.2); - gtk_table_attach ( GTK_TABLE( table ), label, 1, 4, 1, 2, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + gtk_table_attach ( GTK_TABLE( table ), scrolled_label, 1, 4, 1, 2, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + gtk_widget_set_sensitive(scrolled_label, FALSE); scrolled_window = gtk_scrolled_window_new(NULL, NULL); gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolled_window), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); @@ -352,6 +378,7 @@ create_addressbook_settings() gtk_table_attach ( GTK_TABLE( table ), scrolled_window, 1, 4, 2, 3, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + store = gtk_list_store_new(3, G_TYPE_BOOLEAN, // Active G_TYPE_STRING, // uid @@ -384,6 +411,8 @@ create_addressbook_settings() gtk_widget_show_all(ret); + enable_options(); + return ret; } diff --git a/sflphone-client-gnome/src/config/audioconf.c b/sflphone-client-gnome/src/config/audioconf.c index 7d4e0ee0ac17c483cbc30b82fe3dfe4e1455c93d..363e22b5d1848702619fcb819717e30b3b25e3d8 100644 --- a/sflphone-client-gnome/src/config/audioconf.c +++ b/sflphone-client-gnome/src/config/audioconf.c @@ -393,10 +393,12 @@ codec_active_toggled(GtkCellRendererToggle *renderer UNUSED, gchar *path, gpoint // printf("%s, %s\n", name, srate); // codec_list_get_by_name(name); - if ((strcmp(name,"speex")==0) && (strcmp(srate,"8 kHz")==0)) + if ((g_strcasecmp(name,"speex")==0) && (g_strcasecmp(srate,"8 kHz")==0)) codec = codec_list_get_by_payload(110); - else if ((strcmp(name,"speex")==0) && (strcmp(srate,"16 kHz")==0)) + else if ((g_strcasecmp(name,"speex")==0) && (g_strcasecmp(srate,"16 kHz")==0)) codec = codec_list_get_by_payload(111); + else if ((g_strcasecmp(name,"speex")==0) && (g_strcasecmp(srate,"32 kHz")==0)) + codec = codec_list_get_by_payload(112); else codec = codec_list_get_by_name(name); @@ -641,27 +643,6 @@ select_audio_manager( void ) //gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(pulse) )? dbus_set_audio_manager( PULSEAUDIO ):dbus_set_audio_manager( ALSA ); } -GtkWidget* api_box() -{ - GtkWidget *ret; - GtkWidget *alsa; - - ret = gtk_hbox_new(FALSE, 10); - gtk_widget_show( ret ); - - pulse = gtk_radio_button_new_with_mnemonic( NULL , _("Pulseaudio")); - gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON(pulse), !SHOW_ALSA_CONF ); - gtk_box_pack_start( GTK_BOX(ret) , pulse , TRUE , TRUE , 1); - alsa = gtk_radio_button_new_with_mnemonic_from_widget(GTK_RADIO_BUTTON(pulse), _("ALSA")); - gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON(alsa), SHOW_ALSA_CONF ); - gtk_box_pack_end( GTK_BOX(ret) , alsa , TRUE , TRUE , 1); - g_signal_connect(G_OBJECT(alsa), "clicked", G_CALLBACK(select_audio_manager), NULL); - // gtk_misc_set_alignment(GTK_MISC(alsa), 0.2, 0.4); - gtk_widget_show_all(ret); - - return ret; -} - GtkWidget* alsa_box() { GtkWidget *ret; @@ -726,6 +707,7 @@ GtkWidget* alsa_box() gtk_misc_set_alignment(GTK_MISC(item), 0, 0.5); gtk_table_attach(GTK_TABLE(table), item, 1, 2, 3, 4, GTK_FILL | GTK_EXPAND, GTK_SHRINK, 0, 0); gtk_widget_show(item); + // Set choices of output devices inputlist = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_INT); config_window_fill_input_audio_device_list(); @@ -747,35 +729,6 @@ GtkWidget* alsa_box() return ret; } -GtkWidget* ringtones_box() -{ - GtkWidget *ret; - GtkWidget *enableTone; - GtkWidget *fileChooser; - - // check button to enable ringtones - ret = gtk_hbox_new( TRUE , 1); - enableTone = gtk_check_button_new_with_mnemonic( _("_Enable ringtones")); - // gtk_misc_set_alignment(GTK_MISC(enableTone), 0.2, 0.5); - gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON(enableTone), dbus_is_ringtone_enabled() ); - gtk_box_pack_start( GTK_BOX(ret) , enableTone , TRUE , TRUE , 1); - g_signal_connect(G_OBJECT( enableTone) , "clicked" , G_CALLBACK( ringtone_enabled ) , NULL); - // file chooser button - fileChooser = gtk_file_chooser_button_new(_("Choose a ringtone"), GTK_FILE_CHOOSER_ACTION_OPEN); - gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER( fileChooser) , g_get_home_dir()); - gtk_file_chooser_set_filename(GTK_FILE_CHOOSER( fileChooser) , get_ringtone_choice()); - g_signal_connect( G_OBJECT( fileChooser ) , "selection_changed" , G_CALLBACK( ringtone_changed ) , NULL ); - GtkFileFilter *filter = gtk_file_filter_new(); - gtk_file_filter_set_name( filter , _("Audio Files") ); - gtk_file_filter_add_pattern(filter , "*.wav" ); - gtk_file_filter_add_pattern(filter , "*.ul" ); - gtk_file_filter_add_pattern(filter , "*.au" ); - gtk_file_chooser_add_filter( GTK_FILE_CHOOSER( fileChooser ) , filter); - gtk_box_pack_start( GTK_BOX(ret) , fileChooser , TRUE , TRUE , 1); - - return ret; -} - GtkWidget* noise_box() { GtkWidget *ret; @@ -813,21 +766,30 @@ GtkWidget* create_audio_configuration() // Main widget GtkWidget *ret; // Main frames - GtkWidget *sound_conf; GtkWidget *codecs_conf; - GtkWidget *ringtones_conf; // Sub boxes GtkWidget *box; + GtkWidget *frame; ret = gtk_vbox_new(FALSE, 10); gtk_container_set_border_width(GTK_CONTAINER(ret), 10); - // Box for the audio manager selection - gnome_main_section_new (_("Sound Manager"), &sound_conf); - gtk_box_pack_start(GTK_BOX(ret), sound_conf, FALSE, FALSE, 0); - gtk_widget_show( sound_conf ); - box = api_box(); - gtk_container_add( GTK_CONTAINER(sound_conf) , box ); + GtkWidget *alsa; + GtkWidget *table; + + gnome_main_section_new_with_table (_("Sound Manager"), &frame, &table, 1, 2); + gtk_box_pack_start(GTK_BOX(ret), frame, FALSE, FALSE, 0); + + pulse = gtk_radio_button_new_with_mnemonic( NULL , _("_Pulseaudio")); + gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON(pulse), !SHOW_ALSA_CONF ); + gtk_table_attach ( GTK_TABLE( table ), pulse, 0, 1, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + + + alsa = gtk_radio_button_new_with_mnemonic_from_widget(GTK_RADIO_BUTTON(pulse), _("_ALSA")); + gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON(alsa), SHOW_ALSA_CONF ); + g_signal_connect(G_OBJECT(alsa), "clicked", G_CALLBACK(select_audio_manager), NULL); + gtk_table_attach ( GTK_TABLE( table ), alsa, 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + // Box for the ALSA configuration gnome_main_section_new (_("ALSA configuration"), &alsa_conf); @@ -870,11 +832,30 @@ GtkWidget* create_audio_configuration() */ // Box for the ringtones - gnome_main_section_new (_("Ringtones"), &ringtones_conf); - gtk_box_pack_start(GTK_BOX(ret), ringtones_conf, FALSE, FALSE, 0); - gtk_widget_show( ringtones_conf ); - box = ringtones_box(); - gtk_container_add( GTK_CONTAINER(ringtones_conf) , box ); + gnome_main_section_new_with_table (_("Ringtones"), &frame, &table, 1, 2); + gtk_box_pack_start(GTK_BOX(ret), frame, FALSE, FALSE, 0); + + GtkWidget *enableTone; + GtkWidget *fileChooser; + + enableTone = gtk_check_button_new_with_mnemonic( _("_Enable ringtones")); + gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON(enableTone), dbus_is_ringtone_enabled() ); + g_signal_connect(G_OBJECT( enableTone) , "clicked" , G_CALLBACK( ringtone_enabled ) , NULL); + gtk_table_attach ( GTK_TABLE( table ), enableTone, 0, 1, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + + // file chooser button + fileChooser = gtk_file_chooser_button_new(_("Choose a ringtone"), GTK_FILE_CHOOSER_ACTION_OPEN); + gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER( fileChooser) , g_get_home_dir()); + gtk_file_chooser_set_filename(GTK_FILE_CHOOSER( fileChooser) , get_ringtone_choice()); + g_signal_connect( G_OBJECT( fileChooser ) , "selection_changed" , G_CALLBACK( ringtone_changed ) , NULL ); + + GtkFileFilter *filter = gtk_file_filter_new(); + gtk_file_filter_set_name( filter , _("Audio Files") ); + gtk_file_filter_add_pattern(filter , "*.wav" ); + gtk_file_filter_add_pattern(filter , "*.ul" ); + gtk_file_filter_add_pattern(filter , "*.au" ); + gtk_file_chooser_add_filter( GTK_FILE_CHOOSER( fileChooser ) , filter); + gtk_table_attach ( GTK_TABLE( table ), fileChooser, 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); gtk_widget_show_all(ret); diff --git a/sflphone-client-gnome/src/config/configwindow.c b/sflphone-client-gnome/src/config/configwindow.c index e120047410dc5172d7af4cd2606db6737aaf10b7..6117837739e39e9204fc27f8cf5cd130876389f9 100644 --- a/sflphone-client-gnome/src/config/configwindow.c +++ b/sflphone-client-gnome/src/config/configwindow.c @@ -59,9 +59,13 @@ GtkWidget * stunEnable; GtkWidget * stunFrame; GtkWidget * stunServer; GtkWidget * applyButton; +GtkWidget *history_value; GtkWidget* status; +static int history_limit; +static gboolean history_enabled = TRUE; + account_t *selectedAccount; // Account properties @@ -85,6 +89,7 @@ GtkWidget * widg; void config_window_fill_account_list() { + if(accDialogOpen) { GtkTreeIter iter; @@ -94,9 +99,10 @@ config_window_fill_account_list() for(i = 0; i < account_list_get_size(); i++) { account_t * a = account_list_get_nth (i); + if (a) { - DEBUG("fill account list : %s" , (gchar*)g_hash_table_lookup(a->properties, ACCOUNT_ENABLED)); + gtk_list_store_append (accountStore, &iter); gtk_list_store_set(accountStore, &iter, COLUMN_ACCOUNT_ALIAS, g_hash_table_lookup(a->properties, ACCOUNT_ALIAS), // Name @@ -181,12 +187,21 @@ set_mail_notif( ) dbus_set_mail_notify( ); } - void -update_max_value( GtkRange* scale ) +static void history_limit_cb (GtkSpinButton *button, void *ptr) { - dbus_set_max_calls(gtk_range_get_value( GTK_RANGE( scale ))); + history_limit = gtk_spin_button_get_value_as_int((GtkSpinButton *)(ptr)); } +static void history_enabled_cb (GtkWidget *widget) +{ + history_enabled = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)); + gtk_widget_set_sensitive (GTK_WIDGET (history_value), history_enabled); + + // Toggle it through D-Bus + dbus_set_history_enabled (); +} + + void clean_history( void ) { @@ -257,6 +272,7 @@ enable_account(GtkCellRendererToggle *rend UNUSED, gchar* path, gpointer data ) // Modify account state g_hash_table_replace( acc->properties , g_strdup(ACCOUNT_ENABLED) , g_strdup((enable == 1)? "TRUE":"FALSE")); + dbus_send_register( acc->accountID , enable ); } @@ -542,9 +558,6 @@ GtkWidget* create_stun_tab() return tableNat; } - - - GtkWidget* create_general_settings () { @@ -554,47 +567,40 @@ create_general_settings () GtkWidget *ret; - GtkWidget *notifBox; GtkWidget *notifAll; // GtkWidget *widg; GtkWidget *mutewidget; - - GtkWidget *trayBox; GtkWidget *trayItem; - GtkWidget *frame; - GtkWidget *vbox; - GtkWidget *hbox; - GtkWidget *value; + GtkWidget *history_w; GtkWidget *label; - GtkWidget *cleanButton; GtkWidget *entryPort; + GtkWidget *table; + + // Load history configuration + history_load_configuration (); // Main widget ret = gtk_vbox_new(FALSE, 10); gtk_container_set_border_width(GTK_CONTAINER(ret), 10); // Notifications Frame - gnome_main_section_new (_("Desktop Notifications"), &frame); + gnome_main_section_new_with_table (_("Desktop Notifications"), &frame, &table, 2, 1); gtk_box_pack_start(GTK_BOX(ret), frame, FALSE, FALSE, 0); - notifBox = gtk_vbox_new(FALSE, 10); - gtk_widget_show( notifBox ); - gtk_container_add( GTK_CONTAINER(frame) , notifBox); - gtk_container_set_border_width(GTK_CONTAINER(notifBox), 2); - // Notification All notifAll = gtk_check_button_new_with_mnemonic( _("_Enable notifications")); - gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON(notifAll), dbus_get_notify() ); - gtk_box_pack_start( GTK_BOX(notifBox) , notifAll , TRUE , TRUE , 1); + gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON(notifAll), dbus_get_notify() ); g_signal_connect(G_OBJECT( notifAll ) , "clicked" , G_CALLBACK( set_notif_level ) , NULL ); - + gtk_table_attach( GTK_TABLE(table), notifAll, 0, 1, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 5); + // Notification widg = gtk_check_button_new_with_mnemonic( _("Enable voicemail _notifications")); gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON(widg), dbus_get_mail_notify() ); - gtk_box_pack_start( GTK_BOX(notifBox) , widg , TRUE , TRUE , 1); g_signal_connect(G_OBJECT( widg ) , "clicked" , G_CALLBACK( set_mail_notif ) , NULL); + gtk_table_attach( GTK_TABLE(table), widg, 0, 1, 1, 2, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 5); + if (dbus_get_notify()) gtk_widget_set_sensitive(widg, TRUE); @@ -602,66 +608,50 @@ create_general_settings () gtk_widget_set_sensitive(widg, FALSE); // System Tray option frame - gnome_main_section_new (_("System Tray Icon"), &frame); + gnome_main_section_new_with_table (_("System Tray Icon"), &frame, &table, 3, 1); gtk_box_pack_start(GTK_BOX(ret), frame, FALSE, FALSE, 0); - gtk_widget_show (frame); - - trayBox = gtk_vbox_new(FALSE, 10); - gtk_widget_show( trayBox ); - gtk_container_add( GTK_CONTAINER(frame) , trayBox); GtkWidget* trayItem1 = gtk_radio_button_new_with_mnemonic(NULL, _("_Popup main window on incoming call")); gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON(trayItem1), dbus_popup_mode() ); - gtk_box_pack_start( GTK_BOX(trayBox) , trayItem1 , TRUE , TRUE , 1); - g_signal_connect(G_OBJECT( trayItem1 ) , "clicked" , G_CALLBACK( set_popup_mode ) , NULL); + g_signal_connect(G_OBJECT( trayItem1 ), "clicked", G_CALLBACK( set_popup_mode ) , NULL); + gtk_table_attach( GTK_TABLE(table), trayItem1, 0, 1, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 5); trayItem = gtk_radio_button_new_with_mnemonic_from_widget(GTK_RADIO_BUTTON(trayItem1), _("Ne_ver popup main window")); gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON(trayItem), !dbus_popup_mode() ); - gtk_box_pack_start( GTK_BOX(trayBox) , trayItem , TRUE , TRUE , 1); + gtk_table_attach( GTK_TABLE(table), trayItem, 0, 1, 1, 2, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 5); trayItem = gtk_check_button_new_with_mnemonic(_("Hide SFLphone window on _startup")); gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON(trayItem), dbus_is_start_hidden() ); - gtk_box_pack_start( GTK_BOX(trayBox) , trayItem , TRUE , TRUE , 1); g_signal_connect(G_OBJECT( trayItem ) , "clicked" , G_CALLBACK( start_hidden ) , NULL); + gtk_table_attach( GTK_TABLE(table), trayItem, 0, 1, 2, 3, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 5); - /** HISTORY CONFIGURATION */ - gnome_main_section_new (_("Calls History"), &frame); + // HISTORY CONFIGURATION + gnome_main_section_new_with_table (_("Calls History"), &frame, &table, 3, 1); gtk_box_pack_start(GTK_BOX(ret), frame, FALSE, FALSE, 0); - gtk_widget_show( frame ); - - hbox = gtk_hbox_new(FALSE, 10); - gtk_widget_show( hbox ); - gtk_container_add( GTK_CONTAINER(frame) , hbox); - - label = gtk_label_new_with_mnemonic(_("_History size limit")); - gtk_misc_set_alignment(GTK_MISC(label), 0.03, 0.4); - gtk_box_pack_start( GTK_BOX(hbox) , label , TRUE , TRUE , 0); - - value = gtk_hscale_new_with_range(0.0 , 50.0 , 5.0); - gtk_label_set_mnemonic_widget (GTK_LABEL (label), value); - gtk_scale_set_digits( GTK_SCALE(value) , 0); - gtk_scale_set_value_pos( GTK_SCALE(value) , GTK_POS_RIGHT); - gtk_range_set_value( GTK_RANGE( value ) , dbus_get_max_calls()); - gtk_box_pack_start( GTK_BOX(hbox) , value , TRUE , TRUE , 0); - g_signal_connect( G_OBJECT( value) , "value-changed" , G_CALLBACK( update_max_value ) , NULL); - - cleanButton = gtk_button_new_from_stock( GTK_STOCK_CLEAR ); - gtk_box_pack_end( GTK_BOX(hbox) , cleanButton , FALSE , TRUE , 0); - g_signal_connect( G_OBJECT( cleanButton ) , "clicked" , G_CALLBACK( clean_history ) , NULL); + history_w = gtk_check_button_new_with_mnemonic(_("_Keep my history for at least")); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (history_w), history_enabled); + g_signal_connect (G_OBJECT (history_w) , "clicked" , G_CALLBACK (history_enabled_cb) , NULL); + gtk_table_attach( GTK_TABLE(table), history_w, 0, 1, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 5); + + history_value = gtk_spin_button_new_with_range(1, 99, 1); + gtk_spin_button_set_value (GTK_SPIN_BUTTON(history_value), history_limit); + g_signal_connect( G_OBJECT (history_value) , "value-changed" , G_CALLBACK (history_limit_cb) , history_value); + gtk_widget_set_sensitive (GTK_WIDGET (history_value), gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (history_w))); + gtk_table_attach( GTK_TABLE(table), history_value, 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 5); + + label = gtk_label_new(_(" days")); + gtk_table_attach( GTK_TABLE(table), label, 2, 3, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 5); + /** PULSEAUDIO CONFIGURATION */ - gnome_main_section_new (_("PulseAudio sound server"), &frame); + gnome_main_section_new_with_table (_("PulseAudio sound server"), &frame, &table, 1, 1); gtk_box_pack_start(GTK_BOX(ret), frame, FALSE, FALSE, 0); - gtk_widget_show( frame ); - vbox = gtk_vbox_new(FALSE, 10); - gtk_widget_show( vbox ); - gtk_container_add( GTK_CONTAINER(frame) , vbox); - - mutewidget = gtk_check_button_new_with_mnemonic( _("Mute other applications during a _call")); + mutewidget = gtk_check_button_new_with_mnemonic( _("_Mute other applications during a call")); gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON(mutewidget), dbus_get_pulse_app_volume_control() ); - gtk_box_pack_start( GTK_BOX(vbox) , mutewidget , TRUE , TRUE , 1); g_signal_connect(G_OBJECT( mutewidget ) , "clicked" , G_CALLBACK( set_pulse_app_volume_control ) , NULL); + gtk_table_attach( GTK_TABLE(table), mutewidget, 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 5); + n = account_list_get_sip_account_number(); DEBUG("sip account number = %i", n); @@ -671,31 +661,30 @@ create_general_settings () if(curPort <= 0 || curPort > 65535) curPort = 5060; - gnome_main_section_new (_("SIP Port"), &frame); + gnome_main_section_new_with_table (_("SIP Port"), &frame, &table, 1, 3); gtk_box_pack_start(GTK_BOX(ret), frame, FALSE, FALSE, 0); - gtk_widget_show( frame ); + // gtk_widget_show( frame ); gtk_widget_set_sensitive( GTK_WIDGET(frame), (n==0)?FALSE:TRUE ); - hbox = gtk_hbox_new(FALSE, 10); - gtk_widget_show( hbox ); - gtk_container_add( GTK_CONTAINER(frame) , hbox); + // hbox = gtk_hbox_new(FALSE, 10); + // gtk_widget_show( hbox ); + // gtk_container_add( GTK_CONTAINER(frame) , hbox); GtkWidget *applyButton = gtk_button_new_from_stock(GTK_STOCK_APPLY); //gtk_widget_set_size_request(applyButton, 100, 35); //gtk_widget_set_sensitive( GTK_WIDGET(applyButton), (n==0)?FALSE:TRUE ); label = gtk_label_new(_("Port:")); - gtk_misc_set_alignment(GTK_MISC(label), 0.03, 0.4); + // gtk_misc_set_alignment(GTK_MISC(label), 0.03, 0.4); entryPort = gtk_spin_button_new_with_range(1, 65535, 1); gtk_label_set_mnemonic_widget (GTK_LABEL (label), entryPort); gtk_spin_button_set_value(GTK_SPIN_BUTTON(entryPort), curPort); - - gtk_box_pack_start( GTK_BOX(hbox) , label , TRUE , TRUE , 1); - gtk_box_pack_start( GTK_BOX(hbox) , entryPort , TRUE , TRUE , 1); - gtk_box_pack_start( GTK_BOX(hbox) , applyButton , FALSE , FALSE , 1); - g_signal_connect( G_OBJECT( applyButton) , "clicked" , G_CALLBACK( update_port ) , entryPort); + gtk_table_attach( GTK_TABLE(table), label, 0, 1, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 5); + gtk_table_attach( GTK_TABLE(table), entryPort, 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 5); + gtk_table_attach( GTK_TABLE(table), applyButton, 2, 3, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 5); + gtk_widget_show_all(ret); return ret; @@ -707,6 +696,7 @@ record_path_changed( GtkFileChooser *chooser , GtkLabel *label UNUSED) gchar* path; path = gtk_file_chooser_get_uri( GTK_FILE_CHOOSER( chooser )); + path = g_strndup (path + 7, strlen(path) - 7); dbus_set_record_path( path ); } @@ -729,33 +719,36 @@ create_recording_settings () gtk_container_set_border_width(GTK_CONTAINER(ret), 10); // Recorded file saving path - gnome_main_section_new (_("General"), &savePathFrame); + gnome_main_section_new_with_table (_("General"), &savePathFrame, &table, 1, 2); gtk_box_pack_start(GTK_BOX(ret), savePathFrame, FALSE, FALSE, 5); - table = gtk_table_new(1, 2, FALSE); - gtk_table_set_row_spacings( GTK_TABLE(table), 10); - gtk_table_set_col_spacings( GTK_TABLE(table), 10); - gtk_widget_show(table); - gtk_container_add(GTK_CONTAINER(savePathFrame), table); - // label - label = gtk_label_new_with_mnemonic(_("_Recordings folder")); + label = gtk_label_new(_("Recordings folder")); gtk_table_attach( GTK_TABLE(table), label, 0, 1, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 5); - gtk_misc_set_alignment(GTK_MISC(label), 0.08, 0.5); + // gtk_misc_set_alignment(GTK_MISC(label), 0.08, 0.5); // folder chooser button folderChooser = gtk_file_chooser_button_new(_("Select a folder"), GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER); gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER( folderChooser), dftPath); - gtk_table_attach(GTK_TABLE(table), folderChooser, 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 5); g_signal_connect( G_OBJECT( folderChooser ) , "selection_changed" , G_CALLBACK( record_path_changed ) , NULL ); + gtk_table_attach(GTK_TABLE(table), folderChooser, 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 5); gtk_widget_show_all(ret); return ret; } +void save_configuration_parameters (void) { + // Address book config + addressbook_config_save_parameters (); + hooks_save_parameters (); + + // History config + dbus_set_history_limit (history_limit); + +} /** * Show configuration window with tabs @@ -788,16 +781,16 @@ show_config_window () gtk_container_set_border_width(GTK_CONTAINER(notebook), 10); gtk_widget_show(notebook); - // General settings tab - tab = create_general_settings(); - gtk_notebook_append_page(GTK_NOTEBOOK(notebook), tab, gtk_label_new(_("General Settings"))); - gtk_notebook_page_num(GTK_NOTEBOOK(notebook), tab); - // Audio tab tab = create_audio_configuration(); gtk_notebook_append_page(GTK_NOTEBOOK(notebook), tab, gtk_label_new(_("Audio Settings"))); gtk_notebook_page_num(GTK_NOTEBOOK(notebook), tab); + // General settings tab + tab = create_general_settings(); + gtk_notebook_append_page(GTK_NOTEBOOK(notebook), tab, gtk_label_new(_("General Settings"))); + gtk_notebook_page_num(GTK_NOTEBOOK(notebook), tab); + // Recording tab tab = create_recording_settings(); gtk_notebook_append_page(GTK_NOTEBOOK(notebook), tab, gtk_label_new(_("Recordings"))); @@ -882,14 +875,17 @@ show_accounts_window( void ) toolbar_update_buttons(); } +void history_load_configuration () +{ + history_limit = dbus_get_history_limit (); + history_enabled = TRUE; + if (dbus_get_history_enabled () == 0) + history_enabled = FALSE; +} + void config_window_set_stun_visible() { gtk_widget_set_sensitive( GTK_WIDGET(stunFrame), TRUE ); } -void save_configuration_parameters (void) { - addressbook_config_save_parameters (); - hooks_save_parameters (); - -} diff --git a/sflphone-client-gnome/src/config/configwindow.h b/sflphone-client-gnome/src/config/configwindow.h index 4585b99ff665943f58a990346aeaa0b59ba5723c..4965710c65f56857c19da65f6cce6a3a65cd64b8 100644 --- a/sflphone-client-gnome/src/config/configwindow.h +++ b/sflphone-client-gnome/src/config/configwindow.h @@ -118,4 +118,6 @@ void config_window_set_stun_visible(); void save_configuration_parameters (void); +void history_load_configuration (void); + #endif diff --git a/sflphone-client-gnome/src/config/hooks-config.c b/sflphone-client-gnome/src/config/hooks-config.c index 4d9ece57aee93ab4d5dc109dc0dfce7ecfd6b265..a13d2f9598fbaf835a0031b9912f6ee938d5677d 100644 --- a/sflphone-client-gnome/src/config/hooks-config.c +++ b/sflphone-client-gnome/src/config/hooks-config.c @@ -127,61 +127,50 @@ GtkWidget* create_hooks_settings (){ ret = gtk_vbox_new(FALSE, 10); gtk_container_set_border_width(GTK_CONTAINER(ret), 10); - gnome_main_section_new (_("URL Passing"), &frame); + gnome_main_section_new_with_table (_("URL Passing"), &frame, &table, 5, 2); gtk_box_pack_start(GTK_BOX(ret), frame, FALSE, FALSE, 0); gtk_widget_show (frame); - table = gtk_table_new ( 6, 2, FALSE/* homogeneous */); - gtk_table_set_row_spacings( GTK_TABLE(table), 10); - gtk_table_set_col_spacings( GTK_TABLE(table), 10); - gtk_widget_show(table); - gtk_container_add( GTK_CONTAINER (frame) , table ); - label = gtk_label_new(_("SFLphone can run custom commands if incoming calls come with an URL attached.\nIn this case, %s will be replaced with the passed URL.")); + label = gtk_label_new(_("Custom commands on incoming calls with URL,")); gtk_table_attach ( GTK_TABLE( table ), label, 0, 2, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + label = gtk_label_new(_("%s will be replaced with the passed URL.")); + gtk_table_attach ( GTK_TABLE( table ), label, 0, 2, 1, 2, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + widg = gtk_check_button_new_with_mnemonic( _("Trigger on specific _SIP header")); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(widg), (g_strcasecmp (_urlhook_config->sip_enabled, "1")==0)?TRUE:FALSE); g_signal_connect (G_OBJECT(widg) , "clicked" , G_CALLBACK (sip_enabled_cb), NULL); - gtk_table_attach ( GTK_TABLE( table ), widg, 0, 1, 1, 2, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + gtk_table_attach ( GTK_TABLE( table ), widg, 0, 1, 2, 3, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - // label = gtk_label_new_with_mnemonic (_("FIXME: ")); - // gtk_table_attach ( GTK_TABLE( table ), label, 1, 2, 1, 3, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); field = gtk_entry_new (); - gtk_label_set_mnemonic_widget (GTK_LABEL (label), field); gtk_entry_set_text(GTK_ENTRY(field), _urlhook_config->sip_field); - gtk_table_attach ( GTK_TABLE( table ), field, 1, 2, 1, 2, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + gtk_table_attach ( GTK_TABLE( table ), field, 1, 2, 2, 3, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); widg = gtk_check_button_new_with_mnemonic( _("Trigger on _IAX2 URL")); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(widg), (g_strcasecmp (_urlhook_config->iax2_enabled, "1")==0)?TRUE:FALSE); g_signal_connect (G_OBJECT(widg) , "clicked" , G_CALLBACK (iax2_enabled_cb), NULL); - gtk_table_attach ( GTK_TABLE( table ), widg, 0, 2, 2, 3, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + gtk_table_attach ( GTK_TABLE( table ), widg, 0, 2, 3, 4, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - label = gtk_label_new_with_mnemonic (_("_Command to run: ")); + label = gtk_label_new_with_mnemonic (_("Command to _run: ")); gtk_misc_set_alignment(GTK_MISC(label), 0.05, 0.5); - gtk_table_attach ( GTK_TABLE( table ), label, 0, 1, 3, 4, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + gtk_table_attach ( GTK_TABLE( table ), label, 0, 1, 4, 5, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); command = gtk_entry_new (); gtk_label_set_mnemonic_widget (GTK_LABEL (label), command); gtk_entry_set_text(GTK_ENTRY(command), _urlhook_config->command); - gtk_table_attach ( GTK_TABLE( table ), command, 1, 2, 3, 4, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 10); + gtk_table_attach ( GTK_TABLE( table ), command, 1, 2, 4, 5, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 10); + - gnome_main_section_new (_("Phone Number Rewriting"), &frame); + + gnome_main_section_new_with_table (_("Phone Number Rewriting"), &frame, &table, 4, 2); gtk_box_pack_start(GTK_BOX(ret), frame, FALSE, FALSE, 0); gtk_widget_show (frame); - table = gtk_table_new ( 4, 2, FALSE/* homogeneous */); - gtk_table_set_row_spacings( GTK_TABLE(table), 10); - gtk_table_set_col_spacings( GTK_TABLE(table), 10); - gtk_widget_show(table); - gtk_container_add( GTK_CONTAINER (frame) , table ); - widg = gtk_check_button_new_with_mnemonic( _("_Prefix dialed numbers with:")); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(widg), (g_strcasecmp (_urlhook_config->phone_number_enabled, "1")==0)?TRUE:FALSE); g_signal_connect (G_OBJECT(widg) , "clicked" , G_CALLBACK (phone_number_enabled_cb), NULL); gtk_table_attach ( GTK_TABLE( table ), widg, 0, 1, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - // label = gtk_label_new (_("Prepend: ")); - // gtk_table_attach ( GTK_TABLE( table ), label, 0, 1, 1, 2, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); prefix = gtk_entry_new (); gtk_label_set_mnemonic_widget (GTK_LABEL (label), prefix); gtk_entry_set_text(GTK_ENTRY(prefix), _urlhook_config->phone_number_prefix); diff --git a/sflphone-client-gnome/src/config/hooks-config.h b/sflphone-client-gnome/src/config/hooks-config.h index d4651fbe3729deb99910b26ef0cd2bf2ab4bcb8c..3d8c303b0a8e02a9a24c26372ded4983075ce3d0 100644 --- a/sflphone-client-gnome/src/config/hooks-config.h +++ b/sflphone-client-gnome/src/config/hooks-config.h @@ -24,6 +24,7 @@ #include <glib/gtypes.h> #include "actions.h" +#include "utils.h" G_BEGIN_DECLS diff --git a/sflphone-client-gnome/src/config/utils.c b/sflphone-client-gnome/src/config/utils.c index 0fdb4003c8a4849f6225c3014180aef9daf0c553..8bb8019452c0ed073fdd052cfec89f063f434982 100644 --- a/sflphone-client-gnome/src/config/utils.c +++ b/sflphone-client-gnome/src/config/utils.c @@ -19,9 +19,9 @@ #include "utils.h" -void gnome_main_section_new (gchar *title, GtkWidget **frame) +void gnome_main_section_new_with_table (gchar *title, GtkWidget **frame, GtkWidget **table, gint nb_col, gint nb_row) { - GtkWidget *_frame, *label; + GtkWidget *_frame, *_table, *label, *align; PangoAttrList *attrs = NULL; PangoAttribute *attr = NULL; @@ -38,9 +38,41 @@ void gnome_main_section_new (gchar *title, GtkWidget **frame) label = gtk_frame_get_label_widget (GTK_FRAME (_frame)); gtk_label_set_attributes (GTK_LABEL (label), attrs); pango_attr_list_unref (attrs); + + align = gtk_alignment_new( 0.08, 0.2, 0.1, 0.1 ); + gtk_container_add( GTK_CONTAINER(_frame), align ); + + _table = gtk_table_new(nb_col, nb_row, FALSE); + gtk_table_set_row_spacings( GTK_TABLE(_table), 2); + gtk_table_set_col_spacings( GTK_TABLE(_table), 2); + gtk_widget_show(_table); + gtk_container_add( GTK_CONTAINER(align), _table ); + *table = _table; *frame = _frame; } +void gnome_main_section_new (gchar *title, GtkWidget **frame) +{ + GtkWidget *_frame, *label; + PangoAttrList *attrs = NULL; + PangoAttribute *attr = NULL; + + + attrs = pango_attr_list_new (); + attr = pango_attr_weight_new (PANGO_WEIGHT_BOLD); + attr->start_index = 0; + attr->end_index = -1; + pango_attr_list_insert (attrs, attr); + + _frame = gtk_frame_new (title); + gtk_frame_set_shadow_type (GTK_FRAME (_frame), GTK_SHADOW_NONE); + gtk_container_set_border_width(GTK_CONTAINER(_frame), 2); + + label = gtk_frame_get_label_widget (GTK_FRAME (_frame)); + gtk_label_set_attributes (GTK_LABEL (label), attrs); + pango_attr_list_unref (attrs); + *frame = _frame; +} diff --git a/sflphone-client-gnome/src/config/utils.h b/sflphone-client-gnome/src/config/utils.h index e52ed7acb14c08d0fa38779559066b63d0ca6f26..37d34459b821826a77681eafaef7fd2836d7f501 100644 --- a/sflphone-client-gnome/src/config/utils.h +++ b/sflphone-client-gnome/src/config/utils.h @@ -25,6 +25,7 @@ G_BEGIN_DECLS void gnome_main_section_new (gchar *title, GtkWidget**); +void gnome_main_section_new_with_table (gchar *title, GtkWidget**, GtkWidget**, gint nb_col, gint nb_row); G_END_DECLS diff --git a/sflphone-client-gnome/src/contacts/addressbook.c b/sflphone-client-gnome/src/contacts/addressbook.c index 5043c040fd30e0dda2971c0df1d2e107f357a8ec..cadaa21d135de7746ce69e36db878a723e12e153 100644 --- a/sflphone-client-gnome/src/contacts/addressbook.c +++ b/sflphone-client-gnome/src/contacts/addressbook.c @@ -143,12 +143,12 @@ handler_async_search(GList *hits, gpointer user_data) GList *i; GdkPixbuf *photo = NULL; AddressBook_Config *addressbook_config; - call_t *j; + callable_obj_t *j; // freeing calls - while ((j = (call_t *) g_queue_pop_tail(contacts->callQueue)) != NULL) + while ((j = (callable_obj_t *) g_queue_pop_tail(contacts->callQueue)) != NULL) { - free_call_t(j); + free_callable_obj_t(j); } // Retrieve the address book parameters diff --git a/sflphone-client-gnome/src/contacts/calllist.c b/sflphone-client-gnome/src/contacts/calllist.c index d92589553b357c92ce49ea3b1714fd48c45bb665..3573e0194cb09da5b7843078f0a39d0bb6ed87ad 100644 --- a/sflphone-client-gnome/src/contacts/calllist.c +++ b/sflphone-client-gnome/src/contacts/calllist.c @@ -24,14 +24,12 @@ // TODO : sflphoneGTK : try to do this more generic void calllist_add_contact (gchar *contact_name, gchar *contact_phone, contact_type_t type, GdkPixbuf *photo){ - gchar *from; - call_t *new_call; + callable_obj_t *new_call; GdkPixbuf *pixbuf; /* Check if the information is valid */ if (g_strcasecmp (contact_phone, EMPTY_ENTRY) != 0){ - from = g_strconcat("\"" , contact_name, "\"<", contact_phone, ">", NULL); - create_new_call (from, from, CALL_STATE_DIALING, "", &new_call); + create_new_call (CONTACT, CALL_STATE_DIALING, "", "", contact_name, contact_phone, &new_call); // Attach a pixbuf to a contact if (photo) { @@ -80,27 +78,25 @@ calllist_reset (calltab_t* tab) tab->callQueue = g_queue_new(); } -void -calllist_add (calltab_t* tab, call_t * c) +void calllist_add_history_entry (callable_obj_t *obj) { - if( tab == history ) - { - // First case: can still add calls to the list - if( calllist_get_size(tab) < dbus_get_max_calls() ) + int state = dbus_get_history_enabled (); + if (state == 1) { - g_queue_push_tail (tab->callQueue, (gpointer *) c); - calltree_add_call( history , c ); + g_queue_push_tail (history->callQueue, (gpointer *) obj); + calltree_add_call (history, obj); } - // List full -> Remove the last call from history and preprend the new call to the list - else +} + +void +calllist_add (calltab_t* tab, callable_obj_t * c) +{ + if( tab == history ) { - calltree_remove_call( history , (call_t*)g_queue_pop_head( tab -> callQueue ) ); - g_queue_push_tail (tab->callQueue, (gpointer *) c); - calltree_add_call( history , c ); + calllist_add_history_entry (c); } - } - else - g_queue_push_tail (tab->callQueue, (gpointer *) c); + else + g_queue_push_tail (tab->callQueue, (gpointer *) c); } // TODO : sflphoneGTK : try to do this more generic @@ -113,7 +109,7 @@ calllist_clean_history( void ) for( i = 0 ; i < size ; i++ ) { DEBUG("Delete calls"); - call_t* c = calllist_get_nth( history , i ); + callable_obj_t* c = calllist_get_nth( history , i ); // Delete the call from the call tree DEBUG("Delete calls"); calltree_remove_call(history , c); @@ -123,9 +119,9 @@ calllist_clean_history( void ) // TODO : sflphoneGTK : try to do this more generic void -calllist_remove_from_history( call_t* c ) +calllist_remove_from_history( callable_obj_t* c ) { - calllist_remove( history, c->callID ); + calllist_remove( history, c->_callID ); calltree_remove_call( history, c ); DEBUG("Size of history = %i" , calllist_get_size( history )); } @@ -133,7 +129,7 @@ calllist_remove_from_history( call_t* c ) void calllist_remove (calltab_t* tab, const gchar * callID) { - call_t * c = calllist_get(tab, callID); + callable_obj_t * c = calllist_get(tab, callID); if (c) { g_queue_remove(tab->callQueue, c); @@ -141,13 +137,13 @@ calllist_remove (calltab_t* tab, const gchar * callID) } -call_t * +callable_obj_t * calllist_get_by_state (calltab_t* tab, call_state_t state ) { GList * c = g_queue_find_custom (tab->callQueue, &state, get_state_callstruct); if (c) { - return (call_t *)c->data; + return (callable_obj_t *)c->data; } else { @@ -162,19 +158,19 @@ calllist_get_size (calltab_t* tab) return g_queue_get_length (tab->callQueue); } -call_t * +callable_obj_t * calllist_get_nth (calltab_t* tab, guint n ) { return g_queue_peek_nth (tab->callQueue, n); } -call_t * +callable_obj_t * calllist_get (calltab_t* tab, const gchar * callID ) { GList * c = g_queue_find_custom (tab->callQueue, callID, is_callID_callstruct); if (c) { - return (call_t *)c->data; + return (callable_obj_t *)c->data; } else { diff --git a/sflphone-client-gnome/src/contacts/calllist.h b/sflphone-client-gnome/src/contacts/calllist.h index d1e308eca3acc965a1f8f14d88db0c91deccc0e2..3caccad439c4689374c411b296125ac8cff5bf18 100644 --- a/sflphone-client-gnome/src/contacts/calllist.h +++ b/sflphone-client-gnome/src/contacts/calllist.h @@ -20,7 +20,7 @@ #ifndef __CALLLIST_H__ #define __CALLLIST_H__ -#include <call.h> +#include <callable_obj.h> #include <gtk/gtk.h> /** @file calllist.h @@ -31,16 +31,19 @@ typedef struct { GtkListStore* store; GtkWidget* view; GtkWidget* tree; - GtkWidget* searchbar; + GtkWidget* searchbar; // Calllist vars GQueue* callQueue; - call_t* selectedCall; + callable_obj_t* selectedCall; + gchar *_name; } calltab_t; void calllist_add_contact (gchar *, gchar *, contact_type_t, GdkPixbuf *); +void calllist_add_history_entry (callable_obj_t *obj); + /** This function initialize a call list. */ void calllist_init (calltab_t* tab); @@ -65,7 +68,7 @@ call_history_set_max_calls( const gdouble number ); * @param c The call you want to add * */ void -calllist_add (calltab_t* tab, call_t * c); +calllist_add (calltab_t* tab, callable_obj_t * c); /** This function remove a call from list. * @param callID The callID of the call you want to remove @@ -77,7 +80,7 @@ calllist_remove (calltab_t* tab, const gchar * callID); * This is usefull for unique states as DIALING and CURRENT. * @param state The state * @return A call or NULL */ -call_t * +callable_obj_t * calllist_get_by_state (calltab_t* tab, call_state_t state); /** Return the number of calls in the list @@ -88,13 +91,13 @@ calllist_get_size (calltab_t* tab); /** Return the call at the nth position in the list * @param n The position of the call you want * @return A call or NULL */ -call_t * +callable_obj_t * calllist_get_nth (calltab_t* tab, guint n ); /** Return the call corresponding to the callID * @param n The callID of the call you want * @return A call or NULL */ -call_t * +callable_obj_t * calllist_get (calltab_t* tab, const gchar * callID ); /** @@ -108,6 +111,12 @@ calllist_clean_history(); * @param c The call to remove */ void -calllist_remove_from_history( call_t* c); +calllist_remove_from_history( callable_obj_t* c); + +/** + * Initialize a non-empty call list + */ +void +calllist_set_list (calltab_t* tab, gchar **call_list); #endif diff --git a/sflphone-client-gnome/src/contacts/calltab.c b/sflphone-client-gnome/src/contacts/calltab.c index 2fa6c2eea8e831b22403fc49a0855964dafe8530..00cfc85343213d062e0b11d96d35dc2737300745 100644 --- a/sflphone-client-gnome/src/contacts/calltab.c +++ b/sflphone-client-gnome/src/contacts/calltab.c @@ -23,8 +23,7 @@ #include <calltree.h> #include <contacts/searchbar.h> -calltab_t* -calltab_init(gchar* searchbar_type) +calltab_t* calltab_init (gboolean searchbar_type, gchar *name) { calltab_t* ret; @@ -33,11 +32,12 @@ calltab_init(gchar* searchbar_type) ret->store = NULL; ret->view = NULL; ret->tree = NULL; - ret->searchbar = NULL; + ret->searchbar = NULL; ret->callQueue = NULL; ret->selectedCall = NULL; + ret->_name = g_strdup (name); - calltree_create(ret, searchbar_type); + calltree_create (ret, searchbar_type); calllist_init(ret); @@ -45,20 +45,25 @@ calltab_init(gchar* searchbar_type) } void -calltab_select_call (calltab_t* tab, call_t * c ) +calltab_select_call (calltab_t* tab, callable_obj_t * c ) { tab->selectedCall = c; } -call_t * +callable_obj_t * calltab_get_selected_call (calltab_t* tab) { return tab->selectedCall; } void -calltab_create_searchbar(calltab_t* tab, gchar* searchbar_type) +calltab_create_searchbar (calltab_t* tab) { - tab->searchbar = searchbar_new(searchbar_type); + if (g_strcasecmp (tab->_name, HISTORY) == 0) + tab->searchbar = history_searchbar_new (); + else if (g_strcasecmp (tab->_name, CONTACTS) == 0) + tab->searchbar = contacts_searchbar_new (); + else + ERROR ("Current calls tab does not need a searchbar\n"); } diff --git a/sflphone-client-gnome/src/contacts/calltab.h b/sflphone-client-gnome/src/contacts/calltab.h index 65320cc3bb7637cf205871d75e8b8596de71f35c..25c3ddb70f99effcd6f507e3a169821e9ca25eb5 100644 --- a/sflphone-client-gnome/src/contacts/calltab.h +++ b/sflphone-client-gnome/src/contacts/calltab.h @@ -28,20 +28,20 @@ calltab_t* current_calls; calltab_t* history; calltab_t* contacts; -calltab_t* calltab_init(gchar* searchbar_type); +calltab_t* calltab_init (gboolean searchbar_type, gchar *name); /** Mark a call as selected. There can be only one selected call. This call * is the currently highlighted one in the list. * @param c The call */ void -calltab_select_call (calltab_t*, call_t *); +calltab_select_call (calltab_t*, callable_obj_t *); /** Return the selected call. * @return The number of the caller */ -call_t * +callable_obj_t * calltab_get_selected_call (calltab_t*); void -calltab_create_searchbar(calltab_t *, gchar *); +calltab_create_searchbar (calltab_t *); #endif diff --git a/sflphone-client-gnome/src/contacts/calltree.c b/sflphone-client-gnome/src/contacts/calltree.c index 6c6e771dc308c92c1584a30e9b7c033c0b2b6220..2eb489fa725500504404a34c4462174b0526d473 100644 --- a/sflphone-client-gnome/src/contacts/calltree.c +++ b/sflphone-client-gnome/src/contacts/calltree.c @@ -24,7 +24,7 @@ #include <calllist.h> #include <toolbar.h> #include <mainwindow.h> - +#include <history.h> GtkWidget *sw; GtkCellRenderer *rend; @@ -32,7 +32,6 @@ GtkTreeViewColumn *col; GtkTreeSelection *sel; - /** * Show popup menu */ @@ -58,7 +57,7 @@ selected(GtkTreeSelection *sel, void* data UNUSED ) val.g_type = 0; gtk_tree_model_get_value (model, &iter, 2, &val); - calltab_select_call(active_calltree, (call_t*) g_value_get_pointer(&val)); + calltab_select_call(active_calltree, (callable_obj_t*) g_value_get_pointer(&val)); g_value_unset(&val); toolbar_update_buttons(); @@ -72,9 +71,9 @@ void row_activated(GtkTreeView *tree_view UNUSED, GtkTreeViewColumn *column UNUSED, void * data UNUSED) { - call_t* selectedCall; - call_t* new_call; - gchar *to, *from, *account_id; + callable_obj_t* selectedCall; + callable_obj_t* new_call; + gchar *account_id; DEBUG("double click action"); @@ -85,7 +84,7 @@ void row_activated(GtkTreeView *tree_view UNUSED, // Get the right event from the right calltree if( active_calltree == current_calls ) { - switch(selectedCall->state) + switch(selectedCall->_state) { case CALL_STATE_INCOMING: dbus_accept(selectedCall); @@ -111,12 +110,10 @@ void row_activated(GtkTreeView *tree_view UNUSED, // If history or contact: double click action places a new call else { - to = g_strdup(call_get_number(selectedCall)); - from = g_strconcat("\"", call_get_name (selectedCall), "\" <", call_get_number(selectedCall), ">",NULL); - account_id = g_strdup (selectedCall->accountID); + account_id = g_strdup (selectedCall->_accountID); // Create a new call - create_new_call (to, from, CALL_STATE_DIALING, account_id, &new_call); + create_new_call (CALL, CALL_STATE_DIALING, "", account_id, selectedCall->_peer_name, selectedCall->_peer_number, &new_call); calllist_add(current_calls, new_call); calltree_add_call(current_calls, new_call); @@ -149,32 +146,6 @@ button_pressed(GtkWidget* widget, GdkEventButton *event, gpointer user_data UNUS return FALSE; } - - static gboolean -on_key_released (GtkWidget *widget UNUSED, - GdkEventKey *event, - gpointer user_data UNUSED) -{ - DEBUG("key-release-event signal cought by on_key_released callback \n"); - // If a modifier key is pressed, it's a shortcut, pass along - if(event->state & GDK_CONTROL_MASK || - event->state & GDK_MOD1_MASK || - event->keyval == 60 || // < - event->keyval == 62 || // > - event->keyval == 34 || // " - event->keyval == 65361 || // left arrow - event->keyval == 65363 || // right arrow - event->keyval >= 65470 || // F-keys - event->keyval == 32 // space - ) - return FALSE; - else - sflphone_keypad(event->keyval, event->string); - - - return TRUE; -} - /** * Reset call tree */ @@ -186,20 +157,20 @@ calltree_reset (calltab_t* tab) void focus_on_calltree_out(){ - DEBUG("set_focus_on_calltree_out \n"); - // gtk_widget_grab_focus(GTK_WIDGET(sw)); - focus_is_on_calltree = FALSE; + DEBUG("set_focus_on_calltree_out \n"); + // gtk_widget_grab_focus(GTK_WIDGET(sw)); + focus_is_on_calltree = FALSE; } void focus_on_calltree_in(){ - DEBUG("set_focus_on_calltree_in \n"); - // gtk_widget_grab_focus(GTK_WIDGET(sw)); - focus_is_on_calltree = TRUE; + DEBUG("set_focus_on_calltree_in \n"); + // gtk_widget_grab_focus(GTK_WIDGET(sw)); + focus_is_on_calltree = TRUE; } void -calltree_create (calltab_t* tab, gchar* searchbar_type) +calltree_create (calltab_t* tab, gboolean searchbar_type) { // GtkWidget *sw; // GtkCellRenderer *rend; @@ -245,9 +216,9 @@ calltree_create (calltab_t* tab, gchar* searchbar_type) // G_CALLBACK (on_key_released), NULL); g_signal_connect_after (G_OBJECT (tab->view), "focus-in-event", - G_CALLBACK (focus_on_calltree_in), NULL); + G_CALLBACK (focus_on_calltree_in), NULL); g_signal_connect_after (G_OBJECT (tab->view), "focus-out-event", - G_CALLBACK (focus_on_calltree_out), NULL); + G_CALLBACK (focus_on_calltree_out), NULL); gtk_widget_grab_focus(GTK_WIDGET(tab->view)); @@ -275,27 +246,21 @@ calltree_create (calltab_t* tab, gchar* searchbar_type) gtk_box_pack_start(GTK_BOX(tab->tree), sw, TRUE, TRUE, 0); - // no search bar if tab is either "history" or "addressbook" + // search bar if tab is either "history" or "addressbook" if(searchbar_type){ - calltab_create_searchbar(tab,searchbar_type); + calltab_create_searchbar (tab); gtk_box_pack_start(GTK_BOX(tab->tree), tab->searchbar, FALSE, TRUE, 0); } gtk_widget_show(tab->tree); - - - // gtk_widget_show(tab->searchbar); - - //toolbar_update_buttons(); - } void -calltree_remove_call (calltab_t* tab, call_t * c) +calltree_remove_call (calltab_t* tab, callable_obj_t * c) { GtkTreeIter iter; GValue val; - call_t * iterCall; + callable_obj_t * iterCall; GtkListStore* store = tab->store; int nbChild = gtk_tree_model_iter_n_children(GTK_TREE_MODEL(store), NULL); @@ -307,7 +272,7 @@ calltree_remove_call (calltab_t* tab, call_t * c) val.g_type = 0; gtk_tree_model_get_value (GTK_TREE_MODEL(store), &iter, 2, &val); - iterCall = (call_t*) g_value_get_pointer(&val); + iterCall = (callable_obj_t*) g_value_get_pointer(&val); g_value_unset(&val); if(iterCall == c) @@ -316,19 +281,19 @@ calltree_remove_call (calltab_t* tab, call_t * c) } } } - call_t * selectedCall = calltab_get_selected_call(tab); + callable_obj_t * selectedCall = calltab_get_selected_call(tab); if(selectedCall == c) calltab_select_call(tab, NULL); toolbar_update_buttons(); } void -calltree_update_call (calltab_t* tab, call_t * c) +calltree_update_call (calltab_t* tab, callable_obj_t * c) { GdkPixbuf *pixbuf=NULL; GtkTreeIter iter; GValue val; - call_t * iterCall; + callable_obj_t * iterCall; GtkListStore* store = tab->store; int nbChild = gtk_tree_model_iter_n_children(GTK_TREE_MODEL(store), NULL); @@ -340,7 +305,7 @@ calltree_update_call (calltab_t* tab, call_t * c) val.g_type = 0; gtk_tree_model_get_value (GTK_TREE_MODEL(store), &iter, 2, &val); - iterCall = (call_t*) g_value_get_pointer(&val); + iterCall = (callable_obj_t*) g_value_get_pointer(&val); g_value_unset(&val); if(iterCall == c) @@ -349,23 +314,25 @@ calltree_update_call (calltab_t* tab, call_t * c) gchar * description; gchar * date=""; gchar * duration=""; - if(c->state == CALL_STATE_TRANSFERT) + if(c->_state == CALL_STATE_TRANSFERT) { - description = g_markup_printf_escaped("<b>%s</b> <i>%s</i>\n<i>Transfert to:</i> %s", - call_get_number(c), - call_get_name(c), - c->to); + description = g_markup_printf_escaped("<b>%s</b> <i>%s</i>\n<i>Transfert to:%s</i> ", + c->_peer_number, + c->_peer_name, + c->_trsft_to + ); } else { description = g_markup_printf_escaped("<b>%s</b> <i>%s</i>", - call_get_number(c), - call_get_name(c)); + c->_peer_number, + c->_peer_name ); + } if( tab == current_calls ) { - switch(c->state) + switch(c->_state) { case CALL_STATE_HOLD: pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/hold.svg", NULL); @@ -397,7 +364,7 @@ calltree_update_call (calltab_t* tab, call_t * c) } else { - switch(c->history_state) + switch(c->_history_state) { case OUTGOING: DEBUG("Outgoing state"); @@ -415,8 +382,8 @@ calltree_update_call (calltab_t* tab, call_t * c) DEBUG("No history state"); break; } - date = timestamp_get_call_date(); - duration = process_call_duration(c); + date = get_formatted_start_timestamp (c); + duration = get_call_duration (c); duration = g_strconcat( date , duration , NULL); description = g_strconcat( description , duration, NULL); } @@ -443,32 +410,91 @@ calltree_update_call (calltab_t* tab, call_t * c) toolbar_update_buttons(); } - void -calltree_add_call (calltab_t* tab, call_t * c) +void calltree_add_history_entry (callable_obj_t * c) { - if( tab == history && ( calllist_get_size( tab ) > dbus_get_max_calls() ) ) + + if (dbus_get_history_enabled () == 0) return; GdkPixbuf *pixbuf=NULL; GtkTreeIter iter; - GtkTreeSelection* sel; - GtkTreeModel *model; - GtkTreePath *path; + + // New call in the list + gchar * description, *date="", *duration=""; + description = g_markup_printf_escaped("<b>%s</b> <i>%s</i>", + c->_peer_number, + c->_peer_name); + + gtk_list_store_prepend (history->store, &iter); + + switch(c->_history_state) + { + case INCOMING: + pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/incoming.svg", NULL); + break; + case OUTGOING: + pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/outgoing.svg", NULL); + break; + case MISSED: + pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/missed.svg", NULL); + break; + default: + WARN("History - Should not happen!"); + } + + date = get_formatted_start_timestamp (c); + duration = get_call_duration (c); + duration = g_strconcat( date , duration , NULL); + description = g_strconcat( description , duration, NULL); + + //Resize it + if(pixbuf) + { + if(gdk_pixbuf_get_width(pixbuf) > 32 || gdk_pixbuf_get_height(pixbuf) > 32) + { + pixbuf = gdk_pixbuf_scale_simple(pixbuf, 32, 32, GDK_INTERP_BILINEAR); + } + } + gtk_list_store_set(history->store, &iter, + 0, pixbuf, // Icon + 1, description, // Description + 2, c, // Pointer + -1); + + if (pixbuf != NULL) + g_object_unref(G_OBJECT(pixbuf)); + + gtk_tree_view_set_model (GTK_TREE_VIEW(history->view), GTK_TREE_MODEL(history->store)); + history_reinit(history); +} + +void calltree_add_call (calltab_t* tab, callable_obj_t * c) +{ + + if (tab == history) + { + calltree_add_history_entry (c); + return; + } + + GdkPixbuf *pixbuf=NULL; + GtkTreeIter iter; // New call in the list gchar * description; gchar * date=""; + gchar *duration=""; description = g_markup_printf_escaped("<b>%s</b> <i>%s</i>", - call_get_number(c), - call_get_name(c)); + c->_peer_number, + c->_peer_name); gtk_list_store_prepend (tab->store, &iter); - + if( tab == current_calls ) { - switch(c->state) + switch(c->_state) { case CALL_STATE_INCOMING: pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/ring.svg", NULL); @@ -479,32 +505,25 @@ calltree_add_call (calltab_t* tab, call_t * c) case CALL_STATE_RINGING: pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/ring.svg", NULL); break; - default: - WARN("Update calltree add - Should not happen!"); - } - } - - else if (tab == history) { - switch(c->history_state) - { - case INCOMING: - pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/incoming.svg", NULL); + case CALL_STATE_CURRENT: + // If the call has been initiated by a another client and, when we start, it is already current + pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/current.svg", NULL); break; - case OUTGOING: - pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/outgoing.svg", NULL); + case CALL_STATE_HOLD: + // If the call has been initiated by a another client and, when we start, it is already current + pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/hold.svg", NULL); break; - case MISSED: - pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/missed.svg", NULL); + case CALL_STATE_FAILURE: + // If the call has been initiated by a another client and, when we start, it is already current + pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/fail.svg", NULL); break; default: - WARN("History - Should not happen!"); + WARN("Update calltree add - Should not happen!"); } - date = timestamp_get_call_date(); - description = g_strconcat( date , description , NULL); } else if (tab == contacts) { - pixbuf = c->contact_thumbnail; + pixbuf = c->_contact_thumbnail; description = g_strconcat( description , NULL); } @@ -512,7 +531,7 @@ calltree_add_call (calltab_t* tab, call_t * c) WARN ("This widget doesn't exist - This is a bug in the application."); } - + //Resize it if(pixbuf) { @@ -527,17 +546,26 @@ calltree_add_call (calltab_t* tab, call_t * c) 2, c, // Pointer -1); - + if (pixbuf != NULL) g_object_unref(G_OBJECT(pixbuf)); + // history_reinit (tab); + + // sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(tab->view)); + // gtk_tree_selection_select_iter(GTK_TREE_SELECTION(sel), &iter); + + // history_reinit (tab); + gtk_tree_view_set_model(GTK_TREE_VIEW(tab->view), GTK_TREE_MODEL(tab->store)); - + + // gtk_tree_view_set_model (GTK_TREE_VIEW (tab->view), GTK_TREE_MODEL (history_filter)); + gtk_tree_selection_select_iter(gtk_tree_view_get_selection(GTK_TREE_VIEW(tab->view)), &iter); toolbar_update_buttons(); - + } void calltree_display (calltab_t *tab) { diff --git a/sflphone-client-gnome/src/contacts/calltree.h b/sflphone-client-gnome/src/contacts/calltree.h index 09d5ad6887eed8e64af16c9c801ae1c26d9d5538..eedcc1d3ca7a3debebf3ba11a43154447d535d34 100644 --- a/sflphone-client-gnome/src/contacts/calltree.h +++ b/sflphone-client-gnome/src/contacts/calltree.h @@ -22,7 +22,6 @@ #include <gtk/gtk.h> #include <calltab.h> -#include <timestamp.h> #include <mainwindow.h> /** @file calltree.h @@ -34,28 +33,28 @@ * @return GtkWidget* A new widget */ void -calltree_create(calltab_t* tab, gchar* searchbar_type); +calltree_create(calltab_t* tab, gboolean searchbar_type); /** * Add a call in the calltree * @param c The call to add */ void -calltree_add_call (calltab_t* ct, call_t * c); +calltree_add_call (calltab_t* ct, callable_obj_t * c); /* * Update the call tree if the call state changes * @param c The call to update */ void -calltree_update_call (calltab_t* ct, call_t * c); +calltree_update_call (calltab_t* ct, callable_obj_t * c); /** * Remove a call from the call tree * @param c The call to remove */ void -calltree_remove_call (calltab_t* ct, call_t * c); +calltree_remove_call (calltab_t* ct, callable_obj_t * c); void calltree_reset (calltab_t* tab); diff --git a/sflphone-client-gnome/src/contacts/history.c b/sflphone-client-gnome/src/contacts/history.c index 7999bf3b25f7c9659a076e27a94915294dd293eb..c547ac0fcab219d4d1cb72c706e3c64773f69753 100644 --- a/sflphone-client-gnome/src/contacts/history.c +++ b/sflphone-client-gnome/src/contacts/history.c @@ -28,64 +28,87 @@ GtkWidget * history_searchbar_widget; static GtkTreeModel* history_create_filter (GtkTreeModel*); static gboolean history_is_visible (GtkTreeModel*, GtkTreeIter*, gpointer); +void history_search (SearchType search_type) +{ + if(history_filter != NULL) { + gtk_tree_model_filter_refilter (GTK_TREE_MODEL_FILTER (history_filter)); + } +} -void -history_search(GtkEntry* entry UNUSED){ - - - if(history_filter != NULL) { - - gtk_tree_model_filter_refilter(GTK_TREE_MODEL_FILTER(history_filter)); - - } +void history_init (void) +{ + history_filter = history_create_filter (GTK_TREE_MODEL (history->store)); + gtk_tree_view_set_model (GTK_TREE_VIEW (history->view), GTK_TREE_MODEL (history_filter)); } -void -history_init(){ - - history_filter = history_create_filter(GTK_TREE_MODEL(history->store)); - gtk_tree_view_set_model(GTK_TREE_VIEW(history->view), GTK_TREE_MODEL(history_filter)); - +void history_reinit (calltab_t* history) +{ + history_filter = history_create_filter (GTK_TREE_MODEL (history->store)); + gtk_tree_view_set_model (GTK_TREE_VIEW (history->view), GTK_TREE_MODEL (history_filter)); } -void history_set_searchbar_widget(GtkWidget *searchbar){ - history_searchbar_widget = searchbar; +void history_set_searchbar_widget (GtkWidget *searchbar) +{ + history_searchbar_widget = searchbar; } -static GtkTreeModel* -history_create_filter (GtkTreeModel* child) { +static GtkTreeModel* history_create_filter (GtkTreeModel* child) +{ + GtkTreeModel* ret; - GtkTreeModel* ret; - GtkTreePath *path; - - DEBUG("Create Filter\n"); - ret = gtk_tree_model_filter_new(child, NULL); - gtk_tree_model_filter_set_visible_func(GTK_TREE_MODEL_FILTER(ret), history_is_visible, NULL, NULL); - return GTK_TREE_MODEL(ret); + DEBUG("Create Filter\n"); + ret = gtk_tree_model_filter_new (child, NULL); + gtk_tree_model_filter_set_visible_func (GTK_TREE_MODEL_FILTER (ret), history_is_visible, NULL, NULL); + return GTK_TREE_MODEL (ret); } -static gboolean -history_is_visible (GtkTreeModel* model, GtkTreeIter* iter, gpointer data UNUSED) { - - if( SHOW_SEARCHBAR ) +static gboolean history_is_visible (GtkTreeModel* model, GtkTreeIter* iter, gpointer data UNUSED) +{ + if (SHOW_SEARCHBAR) { - GValue val; + GValue val, obj; + callable_obj_t *history_entry = NULL; gchar* text = NULL; gchar* search = (gchar*)gtk_entry_get_text(GTK_ENTRY(history_searchbar_widget)); memset (&val, 0, sizeof(val)); - gtk_tree_model_get_value(GTK_TREE_MODEL(model), iter, 1, &val); + memset (&obj, 0, sizeof(obj)); + + // Fetch the call description + gtk_tree_model_get_value (GTK_TREE_MODEL(model), iter, 1, &val); if(G_VALUE_HOLDS_STRING(&val)){ text = (gchar *)g_value_get_string(&val); } - if(text != NULL && - ( g_ascii_strncasecmp(search, _("Search history"), 14) != 0 && g_ascii_strncasecmp(search, _("Search contact"), 14) != 0)){ - return g_regex_match_simple(search, text, G_REGEX_CASELESS, 0); + + // Fetch the call type + gtk_tree_model_get_value (GTK_TREE_MODEL(model), iter, 2, &obj); + if (G_VALUE_HOLDS_POINTER (&obj)){ + history_entry = (gpointer) g_value_get_pointer (&obj); } + + if(text != NULL) + { + if (history_entry) + { + // Filter according to the type of call + // MISSED, INCOMING, OUTGOING, ALL + if ((int)get_current_history_search_type () == SEARCH_ALL) + return g_regex_match_simple(search, text, G_REGEX_CASELESS, 0); + else + { + // We need a match on the history_state_t and the current search type + return (history_entry->_history_state + 1) == (int)get_current_history_search_type () && + g_regex_match_simple(search, text, G_REGEX_CASELESS, 0); + } + } + } + + // Clean up g_value_unset (&val); + g_value_unset (&obj); + return TRUE; } - return TRUE; } diff --git a/sflphone-client-gnome/src/contacts/history.h b/sflphone-client-gnome/src/contacts/history.h index e4265a3690b7183a656ae16ac4fb8d58ca2837a9..34eaaafbfbb0bdfbdd7034c313d612cd1260020d 100644 --- a/sflphone-client-gnome/src/contacts/history.h +++ b/sflphone-client-gnome/src/contacts/history.h @@ -27,11 +27,17 @@ #include <gtk/gtk.h> #include <sflphone_const.h> +typedef enum { + SEARCH_ALL, + SEARCH_MISSED, + SEARCH_INCOMING, + SEARCH_OUTGOING +} SearchType; + /** * Execute a search in history */ -void -history_search(GtkEntry* entry UNUSED); +void history_search (SearchType search_type); /** * Initialize history @@ -39,6 +45,9 @@ history_search(GtkEntry* entry UNUSED); void history_init(); + +void history_reinit (calltab_t* history); + /** * Set history search bar widget (needed for is_visible) */ diff --git a/sflphone-client-gnome/src/contacts/searchbar.c b/sflphone-client-gnome/src/contacts/searchbar.c index cad09e0670dff097bac9d077cce265f251418f91..764516345a3158481170274b5e63ec80ca99a5da 100644 --- a/sflphone-client-gnome/src/contacts/searchbar.c +++ b/sflphone-client-gnome/src/contacts/searchbar.c @@ -23,114 +23,256 @@ #include <searchbar.h> #include <calltree.h> -const GdkColor BLACK_COLOR = { 0, 0, 0, 0 }; -const GdkColor GRAY_COLOR = { 0, 30000, 30000, 30000 }; - GtkWidget * searchbox; -void searchbar_entry_changed (GtkEntry* entry, gchar* arg1 UNUSED, gpointer data UNUSED){ - // gtk_widget_grab_focus (GTK_WIDGET(searchbox)); +static GtkWidget *menu = NULL; + +/** + * Searchbar icons + */ +GdkPixbuf *incoming_pixbuf = NULL; +GdkPixbuf *outgoing_pixbuf = NULL; +GdkPixbuf *missed_pixbuf = NULL; +void searchbar_entry_changed (GtkEntry* entry, gchar* arg1 UNUSED, gpointer data UNUSED) +{ if (active_calltree == contacts) { - addressbook_search(entry); + addressbook_search (entry); } else if (active_calltree == history) { - history_search(entry); + history_search (HistorySearchType); } - } -// static void -// focus_in_event(GtkWidget *widget, GdkEventFocus *event, gpointer data) -// { - -// } +#if GTK_CHECK_VERSION(2,16,0) + +static void search_all (GtkWidget *item, GtkEntry *entry) +{ + HistorySearchType = SEARCH_ALL; + + gtk_entry_set_icon_from_stock (entry, GTK_ENTRY_ICON_PRIMARY, GTK_STOCK_FIND); + gtk_entry_set_icon_tooltip_text (entry, GTK_ENTRY_ICON_PRIMARY, + _("Search all\n" + "Click here to change the search type")); + history_search (HistorySearchType); +} -void searchbar_clear_entry_if_default (GtkWidget* widget, gpointer user_data UNUSED) { +static void search_by_missed (GtkWidget *item, GtkEntry *entry) +{ + HistorySearchType = SEARCH_MISSED; + + gtk_entry_set_icon_from_pixbuf (entry, GTK_ENTRY_ICON_PRIMARY, missed_pixbuf); + gtk_entry_set_icon_tooltip_text (entry, GTK_ENTRY_ICON_PRIMARY, + _("Search by missed call\n" + "Click here to change the search type")); + + history_search (HistorySearchType); +} + +static void search_by_incoming (GtkWidget *item, GtkEntry *entry) +{ + HistorySearchType = SEARCH_INCOMING; + + gtk_entry_set_icon_from_pixbuf (entry, GTK_ENTRY_ICON_PRIMARY, incoming_pixbuf); + gtk_entry_set_icon_tooltip_text (entry, GTK_ENTRY_ICON_PRIMARY, + _("Search by incoming call\n" + "Click here to change the search type")); + + history_search (HistorySearchType); +} + +static void search_by_outgoing (GtkWidget *item, GtkEntry *entry) +{ + HistorySearchType = SEARCH_OUTGOING; - DEBUG("searchbar_clear_entry_if_default\n"); - gtk_widget_modify_text(widget, GTK_STATE_NORMAL, &BLACK_COLOR); - if(g_ascii_strncasecmp(gtk_entry_get_text(GTK_ENTRY(widget)), "Search history", 14) == 0 - || g_ascii_strncasecmp(gtk_entry_get_text(GTK_ENTRY(widget)), "Search contact", 14) == 0 ) - gtk_entry_set_text(GTK_ENTRY(widget), ""); + gtk_entry_set_icon_from_pixbuf (entry, GTK_ENTRY_ICON_PRIMARY, outgoing_pixbuf); + gtk_entry_set_icon_tooltip_text (entry, GTK_ENTRY_ICON_PRIMARY, + _("Search by outgoing call\n" + "Click here to change the search type")); - // gtk_widget_grab_focus (GTK_WIDGET(searchbox));1 + history_search (HistorySearchType); +} +static void icon_press_cb (GtkEntry *entry, gint position, GdkEventButton *event, gpointer data) +{ + if (position == GTK_ENTRY_ICON_PRIMARY && active_calltree == history) + gtk_menu_popup (GTK_MENU (menu), NULL, NULL, NULL, NULL, + event->button, event->time); + else + gtk_entry_set_text (entry, ""); +} + +static void text_changed_cb (GtkEntry *entry, GParamSpec *pspec) +{ + gboolean has_text; + + has_text = gtk_entry_get_text_length (entry) > 0; + gtk_entry_set_icon_sensitive (entry, GTK_ENTRY_ICON_SECONDARY, has_text); } +#endif + void focus_on_searchbar_out(){ - DEBUG("set_focus_on_searchbar_out \n"); - // gtk_widget_grab_focus(GTK_WIDGET(sw)); - focus_is_on_searchbar = FALSE; + DEBUG("set_focus_on_searchbar_out \n"); + // gtk_widget_grab_focus(GTK_WIDGET(sw)); + focus_is_on_searchbar = FALSE; } void focus_on_searchbar_in(){ - DEBUG("set_focus_on_searchbar_in \n"); - // gtk_widget_grab_focus(GTK_WIDGET(sw)); - focus_is_on_searchbar = TRUE; + DEBUG("set_focus_on_searchbar_in \n"); + // gtk_widget_grab_focus(GTK_WIDGET(sw)); + focus_is_on_searchbar = TRUE; } - -void -searchbar_init(calltab_t *tab) +void searchbar_init(calltab_t *tab) { - if (tab == contacts) { + if (g_strcasecmp (tab->_name, CONTACTS) == 0) + { addressbook_init(); - } - else if (tab == history) { + } + else if (g_strcasecmp (tab->_name, HISTORY) == 0) + { history_init(); - } + } + else + ERROR ("searchbar.c - searchbar_init should not happen within this widget\n"); } -GtkWidget* searchbar_new(gchar* searchbar_type) { +GtkWidget* history_searchbar_new (void) +{ + + GtkWidget *ret, *item, *image; - // GtkWidget * searchbox; - GtkWidget* image; - GtkWidget* ret = gtk_hbox_new(FALSE, 0); + ret = gtk_hbox_new(FALSE, 0); #if GTK_CHECK_VERSION(2,16,0) - searchbox = gtk_entry_new(); - gtk_entry_set_icon_from_stock (GTK_ENTRY (searchbox), GTK_ENTRY_ICON_PRIMARY, GTK_STOCK_FIND); - gtk_entry_set_icon_from_stock (GTK_ENTRY (searchbox), GTK_ENTRY_ICON_SECONDARY, GTK_STOCK_CLEAR); + + searchbox = gtk_entry_new(); + gtk_entry_set_icon_from_stock (GTK_ENTRY (searchbox), GTK_ENTRY_ICON_SECONDARY, GTK_STOCK_CLEAR); + + missed_pixbuf = gdk_pixbuf_new_from_file (ICONS_DIR "/missed.svg", NULL); + incoming_pixbuf = gdk_pixbuf_new_from_file (ICONS_DIR "/incoming.svg", NULL); + outgoing_pixbuf = gdk_pixbuf_new_from_file (ICONS_DIR "/outgoing.svg", NULL); + + // Set the clean insensitive + text_changed_cb (GTK_ENTRY (searchbox), NULL); + + g_signal_connect (searchbox, "icon-press", G_CALLBACK (icon_press_cb), NULL); + g_signal_connect (searchbox, "notify::text", G_CALLBACK (text_changed_cb), NULL); + //g_signal_connect (searchbox, "activate", G_CALLBACK (activate_cb), NULL); + + // Set up the search icon + search_all (NULL, GTK_ENTRY (searchbox)); + + // Create the menu + menu = gtk_menu_new (); + gtk_menu_attach_to_widget (GTK_MENU (menu), searchbox, NULL); + + image = gtk_image_new_from_stock (GTK_STOCK_FIND, GTK_ICON_SIZE_MENU); + item = gtk_image_menu_item_new_with_label ("Search all"); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item), image); + g_signal_connect (item, "activate", G_CALLBACK (search_all), searchbox); + gtk_menu_shell_append (GTK_MENU_SHELL (menu), item); + + item = gtk_image_menu_item_new_with_label ("Search by missed call"); + image = gtk_image_new_from_file (ICONS_DIR "/missed.svg"); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item), image); + g_signal_connect (item, "activate", G_CALLBACK (search_by_missed), searchbox); + gtk_menu_shell_append (GTK_MENU_SHELL (menu), item); + + item = gtk_image_menu_item_new_with_label ("Search by incoming call"); + image = gtk_image_new_from_file (ICONS_DIR "/incoming.svg"); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item), image); + g_signal_connect (item, "activate", G_CALLBACK (search_by_incoming), searchbox); + gtk_menu_shell_append (GTK_MENU_SHELL (menu), item); + + item = gtk_image_menu_item_new_with_label ("Search by outgoing call"); + image = gtk_image_new_from_file (ICONS_DIR "/outgoing.svg"); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item), image); + g_signal_connect (item, "activate", G_CALLBACK (search_by_outgoing), searchbox); + gtk_menu_shell_append (GTK_MENU_SHELL (menu), item); + + gtk_widget_show_all (menu); + #else - searchbox = sexy_icon_entry_new(); - image = gtk_image_new_from_stock( GTK_STOCK_FIND , GTK_ICON_SIZE_SMALL_TOOLBAR); - sexy_icon_entry_set_icon( SEXY_ICON_ENTRY(searchbox), SEXY_ICON_ENTRY_PRIMARY , GTK_IMAGE(image) ); - sexy_icon_entry_add_clear_button( SEXY_ICON_ENTRY(searchbox) ); + + searchbox = sexy_icon_entry_new(); + image = gtk_image_new_from_stock( GTK_STOCK_FIND , GTK_ICON_SIZE_SMALL_TOOLBAR); + sexy_icon_entry_set_icon( SEXY_ICON_ENTRY(searchbox), SEXY_ICON_ENTRY_PRIMARY , GTK_IMAGE(image) ); + sexy_icon_entry_add_clear_button( SEXY_ICON_ENTRY(searchbox) ); #endif - // GTK_WIDGET_SET_FLAGS (GTK_WIDGET(searchbox),GTK_CAN_FOCUS); - // gtk_widget_set_name (searchbox, "searchbar"); + g_signal_connect_after(GTK_ENTRY(searchbox), "changed", G_CALLBACK(searchbar_entry_changed), NULL); + g_signal_connect_after (G_OBJECT (searchbox), "focus-in-event", + G_CALLBACK (focus_on_searchbar_in), NULL); + g_signal_connect_after (G_OBJECT (searchbox), "focus-out-event", + G_CALLBACK (focus_on_searchbar_out), NULL); - gtk_widget_modify_text(searchbox, GTK_STATE_NORMAL, &GRAY_COLOR); + gtk_box_pack_start(GTK_BOX(ret), searchbox, TRUE, TRUE, 0); + history_set_searchbar_widget(searchbox); + + return ret; +} - gtk_entry_set_text(GTK_ENTRY(searchbox), _("Search contact")); - g_signal_connect_after(GTK_ENTRY(searchbox), "changed", G_CALLBACK(searchbar_entry_changed), NULL); - g_signal_connect_after(GTK_ENTRY(searchbox), "grab-focus", G_CALLBACK(searchbar_clear_entry_if_default), NULL); +GtkWidget* contacts_searchbar_new () { - g_signal_connect_after (G_OBJECT (searchbox), "focus-in-event", - G_CALLBACK (focus_on_searchbar_in), NULL); - g_signal_connect_after (G_OBJECT (searchbox), "focus-out-event", - G_CALLBACK (focus_on_searchbar_out), NULL); + GtkWidget *ret; - gtk_box_pack_start(GTK_BOX(ret), searchbox, TRUE, TRUE, 0); + ret = gtk_hbox_new(FALSE, 0); + +#if GTK_CHECK_VERSION(2,16,0) + + GdkPixbuf *pixbuf; + + searchbox = gtk_entry_new(); + gtk_entry_set_icon_from_stock (GTK_ENTRY (searchbox), GTK_ENTRY_ICON_SECONDARY, GTK_STOCK_CLEAR); + pixbuf = gdk_pixbuf_new_from_file (ICONS_DIR "/stock_person.svg", NULL); + gtk_entry_set_icon_from_pixbuf (GTK_ENTRY (searchbox), GTK_ENTRY_ICON_PRIMARY, pixbuf); + gtk_entry_set_icon_tooltip_text (GTK_ENTRY (searchbox), GTK_ENTRY_ICON_PRIMARY, + "Search contacts\n" + "GNOME evolution backend"); + + + // Set the clean insensitive + text_changed_cb (GTK_ENTRY (searchbox), NULL); + + g_signal_connect (searchbox, "notify::text", G_CALLBACK (text_changed_cb), NULL); + g_signal_connect (searchbox, "icon-press", G_CALLBACK (icon_press_cb), NULL); + +#else + + GtkWidget *image; + + searchbox = sexy_icon_entry_new(); + image = gtk_image_new_from_stock( GTK_STOCK_FIND , GTK_ICON_SIZE_SMALL_TOOLBAR); + sexy_icon_entry_set_icon( SEXY_ICON_ENTRY(searchbox), SEXY_ICON_ENTRY_PRIMARY , GTK_IMAGE(image) ); + sexy_icon_entry_add_clear_button( SEXY_ICON_ENTRY(searchbox) ); +#endif + + g_signal_connect_after(GTK_ENTRY(searchbox), "changed", G_CALLBACK(searchbar_entry_changed), NULL); + + g_signal_connect_after (G_OBJECT (searchbox), "focus-in-event", + G_CALLBACK (focus_on_searchbar_in), NULL); + g_signal_connect_after (G_OBJECT (searchbox), "focus-out-event", + G_CALLBACK (focus_on_searchbar_out), NULL); + + gtk_box_pack_start(GTK_BOX(ret), searchbox, TRUE, TRUE, 0); - if(g_strcmp0(searchbar_type,"history") == 0) - { - gtk_entry_set_text(GTK_ENTRY(searchbox), _("Search history")); - history_set_searchbar_widget(searchbox); - } - return ret; } void activateWaitingLayer() { - gtk_widget_show(waitingLayer); + gtk_widget_show(waitingLayer); } void deactivateWaitingLayer() { - gtk_widget_hide(waitingLayer); + gtk_widget_hide(waitingLayer); +} + +SearchType get_current_history_search_type (void) +{ + return HistorySearchType; } diff --git a/sflphone-client-gnome/src/contacts/searchbar.h b/sflphone-client-gnome/src/contacts/searchbar.h index f7ed3035200642cb71612d6322e2ce8793ca436b..8354dac96a1905b19667191181dbe9e83ff0623d 100644 --- a/sflphone-client-gnome/src/contacts/searchbar.h +++ b/sflphone-client-gnome/src/contacts/searchbar.h @@ -41,14 +41,19 @@ #include <addressbook.h> #include <history.h> - GdkPixbuf *waitingPixOff; +SearchType HistorySearchType; + /** * Create a new search bar with "type" passed in * parameter */ -GtkWidget* searchbar_new(gchar*); +GtkWidget* history_searchbar_new (void); +GtkWidget* contacts_searchbar_new (void); + +SearchType get_current_history_search_type (void); + /** * Initialize a specific search bar diff --git a/sflphone-client-gnome/src/dbus/callmanager-introspec.xml b/sflphone-client-gnome/src/dbus/callmanager-introspec.xml index dbc84d3542c77ceba6beb6f07f3904aa2e4d8ce8..539c13b6e78ccaaafc0049e473a739e43fb99584 100644 --- a/sflphone-client-gnome/src/dbus/callmanager-introspec.xml +++ b/sflphone-client-gnome/src/dbus/callmanager-introspec.xml @@ -67,6 +67,10 @@ <arg type="a{ss}" name="infos" direction="out"/> </method> + <method name="getCallList"> + <arg type="as" name="list" direction="out"/> + </method> + <method name="getCurrentCallID"> <arg type="s" name="callID" direction="out"/> </method> @@ -107,6 +111,13 @@ <arg type="s" name="device" direction="out"/> <arg type="d" name="value" direction="out"/> </signal> + + <signal name="transferSucceded"> + </signal> + + <signal name="transferFailed"> + </signal> + <!-- <signal name="error"> diff --git a/sflphone-client-gnome/src/dbus/configurationmanager-introspec.xml b/sflphone-client-gnome/src/dbus/configurationmanager-introspec.xml index 9a4375bb0cfce1a67ff8790ae119202015d0ce16..7e3888c2338960ea9c20d4d0d7e0fed94c09a4cf 100644 --- a/sflphone-client-gnome/src/dbus/configurationmanager-introspec.xml +++ b/sflphone-client-gnome/src/dbus/configurationmanager-introspec.xml @@ -210,6 +210,13 @@ <method name="setSearchbar"> </method> + <method name="setHistoryEnabled"> + </method> + + <method name="getHistoryEnabled"> + <arg type="i" name="state" direction="out"/> + </method> + <method name="getVolumeControls"> <arg type="i" name="state" direction="out"/> </method> @@ -217,12 +224,12 @@ <method name="setVolumeControls"> </method> - <method name="getMaxCalls"> - <arg type="i" name="calls" direction="out"/> + <method name="getHistoryLimit"> + <arg type="i" name="days" direction="out"/> </method> - <method name="setMaxCalls"> - <arg type="i" name="calls" direction="in"/> + <method name="setHistoryLimit"> + <arg type="i" name="days" direction="in"/> </method> <method name="startHidden"> @@ -302,6 +309,16 @@ <arg type="a{ss}" name="settings" direction="in"/> </method> + <method name="getHistory"> + <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="MapStringString"/> + <arg type="a{ss}" name="entries" direction="out"/> + </method> + + <method name="setHistory"> + <annotation name="com.trolltech.QtDBus.QtTypeName.In0" value="MapStringString"/> + <arg type="a{ss}" name="entries" direction="in"/> + </method> + <!-- ///////////////////////////// --> <!-- @@ -313,7 +330,7 @@ --> <signal name="accountsChanged"> - </signal> + </signal> <signal name="errorAlert"> <arg type="i" name="code" direction="out"/> diff --git a/sflphone-client-gnome/src/dbus/dbus.c b/sflphone-client-gnome/src/dbus/dbus.c index 4a827626394e972a86a24b156ea5d37bec1c6858..97ee5588913a567e7890461b4c387fe9025cdf20 100644 --- a/sflphone-client-gnome/src/dbus/dbus.c +++ b/sflphone-client-gnome/src/dbus/dbus.c @@ -39,306 +39,360 @@ DBusGProxy * callManagerProxy; DBusGProxy * configurationManagerProxy; DBusGProxy * instanceProxy; -static void + static void incoming_call_cb (DBusGProxy *proxy UNUSED, - const gchar* accountID, - const gchar* callID, - const gchar* from, - void * foo UNUSED ) -{ - DEBUG ("Incoming call! %s",callID); - call_t * c = g_new0 (call_t, 1); - c->accountID = g_strdup(accountID); - c->callID = g_strdup(callID); - c->from = g_strdup(from); - c->state = CALL_STATE_INCOMING; - #if GTK_CHECK_VERSION(2,10,0) - status_tray_icon_blink( TRUE ); - #endif - notify_incoming_call( c ); - sflphone_incoming_call (c); -} - -static void + const gchar* accountID, + const gchar* callID, + const gchar* from, + void * foo UNUSED ) +{ + DEBUG ("Incoming call! %s",callID); + + callable_obj_t * c; + gchar *peer_name, *peer_number; + // We receive the from field under a formatted way. We want to extract the number and the name of the caller + peer_name = call_get_peer_name (from); + peer_number = call_get_peer_number (from); + + create_new_call (CALL, CALL_STATE_INCOMING, g_strdup(callID), g_strdup(accountID), peer_name, peer_number, &c); +#if GTK_CHECK_VERSION(2,10,0) + status_tray_icon_blink( TRUE ); +#endif + + set_timestamp (&c->_time_start); + notify_incoming_call (c); + sflphone_incoming_call (c); +} + + static void curent_selected_codec (DBusGProxy *proxy UNUSED, - const gchar* callID, - const gchar* codecName, - void * foo UNUSED ) + const gchar* callID, + const gchar* codecName, + void * foo UNUSED ) { - DEBUG ("%s codec decided for call %s",codecName,callID); - sflphone_display_selected_codec (codecName); + DEBUG ("%s codec decided for call %s",codecName,callID); + sflphone_display_selected_codec (codecName); } -static void + static void volume_changed_cb (DBusGProxy *proxy UNUSED, - const gchar* device, - const gdouble value, - void * foo UNUSED ) + const gchar* device, + const gdouble value, + void * foo UNUSED ) { - DEBUG ("Volume of %s changed to %f.",device, value); - set_slider(device, value); + DEBUG ("Volume of %s changed to %f.",device, value); + set_slider(device, value); } -static void + static void voice_mail_cb (DBusGProxy *proxy UNUSED, - const gchar* accountID, - const guint nb, - void * foo UNUSED ) + const gchar* accountID, + const guint nb, + void * foo UNUSED ) { - DEBUG ("%d Voice mail waiting!",nb); - sflphone_notify_voice_mail (accountID , nb); + DEBUG ("%d Voice mail waiting!",nb); + sflphone_notify_voice_mail (accountID , nb); } -static void + static void incoming_message_cb (DBusGProxy *proxy UNUSED, - const gchar* accountID UNUSED, - const gchar* msg, - void * foo UNUSED ) + const gchar* accountID UNUSED, + const gchar* msg, + void * foo UNUSED ) { - DEBUG ("Message %s!",msg); + DEBUG ("Message %s!",msg); } -static void + static void call_state_cb (DBusGProxy *proxy UNUSED, - const gchar* callID, - const gchar* state, - void * foo UNUSED ) + const gchar* callID, + const gchar* state, + void * foo UNUSED ) { - DEBUG ("Call %s state %s",callID, state); - call_t * c = calllist_get(current_calls, callID); - if(c) - { - if ( strcmp(state, "HUNGUP") == 0 ) - { - if(c->state==CALL_STATE_CURRENT) - { - // peer hung up, the conversation was established, so _start has been initialized with the current time value - DEBUG("call state current"); - (void) time(&c->_stop); - calltree_update_call( history, c ); - } - stop_notification(); - sflphone_hung_up (c); - calltree_update_call( history, c ); - } - else if ( strcmp(state, "UNHOLD_CURRENT") == 0 ) - { - sflphone_current (c); - } - else if ( strcmp(state, "UNHOLD_RECORD") == 0 ) - { - sflphone_record (c); - } - else if ( strcmp(state, "HOLD") == 0 ) - { - sflphone_hold (c); - } - else if ( strcmp(state, "RINGING") == 0 ) + DEBUG ("Call %s state %s",callID, state); + callable_obj_t * c = calllist_get(current_calls, callID); + if(c) { - sflphone_ringing (c); - } - else if ( strcmp(state, "CURRENT") == 0 ) - { - sflphone_current (c); - } - else if ( strcmp(state, "FAILURE") == 0 ) - { - sflphone_fail (c); + if ( strcmp(state, "HUNGUP") == 0 ) + { + if(c->_state==CALL_STATE_CURRENT) + { + // peer hung up, the conversation was established, so _start has been initialized with the current time value + DEBUG("call state current"); + set_timestamp (&c->_time_start); + calltree_update_call( history, c ); + } + stop_notification(); + sflphone_hung_up (c); + calltree_update_call( history, c ); + } + else if ( strcmp(state, "UNHOLD_CURRENT") == 0 ) + { + sflphone_current (c); + } + else if ( strcmp(state, "UNHOLD_RECORD") == 0 ) + { + sflphone_record (c); + } + else if ( strcmp(state, "HOLD") == 0 ) + { + sflphone_hold (c); + } + else if ( strcmp(state, "RINGING") == 0 ) + { + sflphone_ringing (c); + } + else if ( strcmp(state, "CURRENT") == 0 ) + { + sflphone_current (c); + } + else if ( strcmp(state, "FAILURE") == 0 ) + { + sflphone_fail (c); + } + else if ( strcmp(state, "BUSY") == 0 ) + { + sflphone_busy (c); + } } - else if ( strcmp(state, "BUSY") == 0 ) + else { - sflphone_busy (c); + // The callID is unknow, threat it like a new call + // If it were an incoming call, we won't be here + // It means that a new call has been initiated with an other client (cli for instance) + if ( strcmp(state, "RINGING") == 0 ) + { + callable_obj_t *new_call; + GHashTable *call_details; + gchar *type; + + DEBUG ("New ringing call! accountID: %s", callID); + + // We fetch the details associated to the specified call + call_details = dbus_get_call_details (callID); + create_new_call_from_details (callID, call_details, &new_call); + + // Restore the callID to be synchronous with the daemon + new_call->_callID = g_strdup(callID); + type = g_hash_table_lookup (call_details, "CALL_TYPE"); + + if (g_strcasecmp (type, "0") == 0) + { + g_print ("incoming\n"); + new_call->_history_state = INCOMING; + } + else + { + g_print ("outgoing\n"); + new_call->_history_state = OUTGOING; + } + + calllist_add (current_calls, new_call); + calllist_add (history, new_call); + calltree_add_call (current_calls, new_call); + update_menus (); + calltree_display (current_calls); + + //sflphone_incoming_call (new_call); + } } - } - else - { - // The callID is unknow, threat it like a new call - // If it were an incoming call, we won't be here - // It means that a new call has been initiated with an other client (cli for instance) - if ( strcmp(state, "RINGING") == 0 ) - { - call_t *new_call; - GHashTable *call_details; - - DEBUG ("New ringing call! accountID: %s", callID); +} - // We fetch the details associated to the specified call - call_details = dbus_get_call_details (callID); - create_new_call_from_details (callID, call_details, &new_call); - // Restore the callID to be synchronous with the daemon - new_call->callID = g_strdup(callID); + static void +accounts_changed_cb (DBusGProxy *proxy UNUSED, + void * foo UNUSED ) +{ + DEBUG ("Accounts changed"); + sflphone_fill_account_list(TRUE); + config_window_fill_account_list(); - sflphone_incoming_call (new_call); - } - } + // Update the status bar in case something happened + // Should fix ticket #1215 + status_bar_display_account(); } -static void -accounts_changed_cb (DBusGProxy *proxy UNUSED, - void * foo UNUSED ) + + static void +transfer_succeded_cb (DBusGProxy *proxy UNUSED, + void * foo UNUSED ) { - DEBUG ("Accounts changed"); - sflphone_fill_account_list(TRUE); - config_window_fill_account_list(); + DEBUG ("Transfer succeded\n"); + sflphone_display_transfer_status("Transfer successfull"); +} - // Update the status bar in case something happened - // Should fix ticket #1215 - status_bar_display_account(); + + static void +transfer_failed_cb (DBusGProxy *proxy UNUSED, + void * foo UNUSED ) +{ + DEBUG ("Transfer failed\n"); + sflphone_display_transfer_status("Transfer failed"); } -static void + + static void error_alert(DBusGProxy *proxy UNUSED, - int errCode, - void * foo UNUSED ) + int errCode, + void * foo UNUSED ) { - ERROR ("Error notifying : (%i)", errCode); - sflphone_throw_exception( errCode ); + ERROR ("Error notifying : (%i)", errCode); + sflphone_throw_exception( errCode ); } -gboolean + gboolean dbus_connect () { - GError *error = NULL; - connection = NULL; - instanceProxy = NULL; + GError *error = NULL; + connection = NULL; + instanceProxy = NULL; - g_type_init (); + g_type_init (); - connection = dbus_g_bus_get (DBUS_BUS_SESSION, &error); + connection = dbus_g_bus_get (DBUS_BUS_SESSION, &error); - if (error) - { - ERROR ("Failed to open connection to bus: %s", + if (error) + { + ERROR ("Failed to open connection to bus: %s", error->message); - g_error_free (error); - return FALSE; - } - - /* Create a proxy object for the "bus driver" (name "org.freedesktop.DBus") */ - - - instanceProxy = dbus_g_proxy_new_for_name (connection, - "org.sflphone.SFLphone", - "/org/sflphone/SFLphone/Instance", - "org.sflphone.SFLphone.Instance"); - /* - instanceProxy = dbus_g_proxy_new_for_name_owner (connection, - "org.sflphone.SFLphone", - "/org/sflphone/SFLphone/Instance", - "org.sflphone.SFLphone.Instance", - &error); - */ - - if (instanceProxy==NULL) - { - ERROR ("Failed to get proxy to Instance"); - return FALSE; - } - - - DEBUG ("DBus connected to Instance"); - - - callManagerProxy = dbus_g_proxy_new_for_name (connection, - "org.sflphone.SFLphone", - "/org/sflphone/SFLphone/CallManager", - "org.sflphone.SFLphone.CallManager"); - - /* - callManagerProxy = dbus_g_proxy_new_for_name_owner (connection, - "org.sflphone.SFLphone", - "/org/sflphone/SFLphone/CallManager", - "org.sflphone.SFLphone.CallManager", - &error); - */ - if (callManagerProxy==NULL) - { - ERROR ("Failed to get proxy to CallManagers"); - return FALSE; - } - - DEBUG ("DBus connected to CallManager"); - /* Incoming call */ - dbus_g_object_register_marshaller(g_cclosure_user_marshal_VOID__STRING_STRING_STRING, - G_TYPE_NONE, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INVALID); - dbus_g_proxy_add_signal (callManagerProxy, - "incomingCall", G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INVALID); - dbus_g_proxy_connect_signal (callManagerProxy, - "incomingCall", G_CALLBACK(incoming_call_cb), NULL, NULL); - - /* Current codec */ - dbus_g_object_register_marshaller(g_cclosure_user_marshal_VOID__STRING_STRING_STRING, - G_TYPE_NONE, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INVALID); - dbus_g_proxy_add_signal (callManagerProxy, - "currentSelectedCodec", G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INVALID); - dbus_g_proxy_connect_signal (callManagerProxy, - "currentSelectedCodec", G_CALLBACK(curent_selected_codec), NULL, NULL); - - /* Register a marshaller for STRING,STRING */ - dbus_g_object_register_marshaller(g_cclosure_user_marshal_VOID__STRING_STRING, - G_TYPE_NONE, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INVALID); - dbus_g_proxy_add_signal (callManagerProxy, - "callStateChanged", G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INVALID); - dbus_g_proxy_connect_signal (callManagerProxy, - "callStateChanged", G_CALLBACK(call_state_cb), NULL, NULL); - - dbus_g_object_register_marshaller(g_cclosure_user_marshal_VOID__STRING_INT, - G_TYPE_NONE, G_TYPE_STRING, G_TYPE_INT, G_TYPE_INVALID); - dbus_g_proxy_add_signal (callManagerProxy, - "voiceMailNotify", G_TYPE_STRING, G_TYPE_INT, G_TYPE_INVALID); - dbus_g_proxy_connect_signal (callManagerProxy, - "voiceMailNotify", G_CALLBACK(voice_mail_cb), NULL, NULL); - - dbus_g_proxy_add_signal (callManagerProxy, - "incomingMessage", G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INVALID); - dbus_g_proxy_connect_signal (callManagerProxy, - "incomingMessage", G_CALLBACK(incoming_message_cb), NULL, NULL); - - dbus_g_object_register_marshaller(g_cclosure_user_marshal_VOID__STRING_DOUBLE, - G_TYPE_NONE, G_TYPE_STRING, G_TYPE_DOUBLE, G_TYPE_INVALID); - dbus_g_proxy_add_signal (callManagerProxy, - "volumeChanged", G_TYPE_STRING, G_TYPE_DOUBLE, G_TYPE_INVALID); - dbus_g_proxy_connect_signal (callManagerProxy, - "volumeChanged", G_CALLBACK(volume_changed_cb), NULL, NULL); - - - configurationManagerProxy = dbus_g_proxy_new_for_name (connection, - "org.sflphone.SFLphone", - "/org/sflphone/SFLphone/ConfigurationManager", - "org.sflphone.SFLphone.ConfigurationManager"); - - - /* - configurationManagerProxy = dbus_g_proxy_new_for_name_owner (connection, - "org.sflphone.SFLphone", - "/org/sflphone/SFLphone/ConfigurationManager", - "org.sflphone.SFLphone.ConfigurationManager", - &error); - */ - if (!configurationManagerProxy) - { - ERROR ("Failed to get proxy to ConfigurationManager"); - return FALSE; - } - DEBUG ("DBus connected to ConfigurationManager"); - dbus_g_proxy_add_signal (configurationManagerProxy, - "accountsChanged", G_TYPE_INVALID); - dbus_g_proxy_connect_signal (configurationManagerProxy, - "accountsChanged", G_CALLBACK(accounts_changed_cb), NULL, NULL); - - dbus_g_object_register_marshaller(g_cclosure_user_marshal_VOID__INT, - G_TYPE_NONE, G_TYPE_INT , G_TYPE_INVALID); - dbus_g_proxy_add_signal (configurationManagerProxy, - "errorAlert", G_TYPE_INT , G_TYPE_INVALID); - dbus_g_proxy_connect_signal (configurationManagerProxy, - "errorAlert", G_CALLBACK(error_alert), NULL, NULL); - return TRUE; -} - -void + g_error_free (error); + return FALSE; + } + + /* Create a proxy object for the "bus driver" (name "org.freedesktop.DBus") */ + + + instanceProxy = dbus_g_proxy_new_for_name (connection, + "org.sflphone.SFLphone", + "/org/sflphone/SFLphone/Instance", + "org.sflphone.SFLphone.Instance"); + /* + instanceProxy = dbus_g_proxy_new_for_name_owner (connection, + "org.sflphone.SFLphone", + "/org/sflphone/SFLphone/Instance", + "org.sflphone.SFLphone.Instance", + &error); + */ + + if (instanceProxy==NULL) + { + ERROR ("Failed to get proxy to Instance"); + return FALSE; + } + + + DEBUG ("DBus connected to Instance"); + + + callManagerProxy = dbus_g_proxy_new_for_name (connection, + "org.sflphone.SFLphone", + "/org/sflphone/SFLphone/CallManager", + "org.sflphone.SFLphone.CallManager"); + + /* + callManagerProxy = dbus_g_proxy_new_for_name_owner (connection, + "org.sflphone.SFLphone", + "/org/sflphone/SFLphone/CallManager", + "org.sflphone.SFLphone.CallManager", + &error); + */ + if (callManagerProxy==NULL) + { + ERROR ("Failed to get proxy to CallManagers"); + return FALSE; + } + + DEBUG ("DBus connected to CallManager"); + /* Incoming call */ + dbus_g_object_register_marshaller(g_cclosure_user_marshal_VOID__STRING_STRING_STRING, + G_TYPE_NONE, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INVALID); + dbus_g_proxy_add_signal (callManagerProxy, + "incomingCall", G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INVALID); + dbus_g_proxy_connect_signal (callManagerProxy, + "incomingCall", G_CALLBACK(incoming_call_cb), NULL, NULL); + + /* Current codec */ + dbus_g_object_register_marshaller(g_cclosure_user_marshal_VOID__STRING_STRING_STRING, + G_TYPE_NONE, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INVALID); + dbus_g_proxy_add_signal (callManagerProxy, + "currentSelectedCodec", G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INVALID); + dbus_g_proxy_connect_signal (callManagerProxy, + "currentSelectedCodec", G_CALLBACK(curent_selected_codec), NULL, NULL); + + /* Register a marshaller for STRING,STRING */ + dbus_g_object_register_marshaller(g_cclosure_user_marshal_VOID__STRING_STRING, + G_TYPE_NONE, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INVALID); + dbus_g_proxy_add_signal (callManagerProxy, + "callStateChanged", G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INVALID); + dbus_g_proxy_connect_signal (callManagerProxy, + "callStateChanged", G_CALLBACK(call_state_cb), NULL, NULL); + + dbus_g_object_register_marshaller(g_cclosure_user_marshal_VOID__STRING_INT, + G_TYPE_NONE, G_TYPE_STRING, G_TYPE_INT, G_TYPE_INVALID); + dbus_g_proxy_add_signal (callManagerProxy, + "voiceMailNotify", G_TYPE_STRING, G_TYPE_INT, G_TYPE_INVALID); + dbus_g_proxy_connect_signal (callManagerProxy, + "voiceMailNotify", G_CALLBACK(voice_mail_cb), NULL, NULL); + + dbus_g_proxy_add_signal (callManagerProxy, + "incomingMessage", G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INVALID); + dbus_g_proxy_connect_signal (callManagerProxy, + "incomingMessage", G_CALLBACK(incoming_message_cb), NULL, NULL); + + dbus_g_object_register_marshaller(g_cclosure_user_marshal_VOID__STRING_DOUBLE, + G_TYPE_NONE, G_TYPE_STRING, G_TYPE_DOUBLE, G_TYPE_INVALID); + dbus_g_proxy_add_signal (callManagerProxy, + "volumeChanged", G_TYPE_STRING, G_TYPE_DOUBLE, G_TYPE_INVALID); + dbus_g_proxy_connect_signal (callManagerProxy, + "volumeChanged", G_CALLBACK(volume_changed_cb), NULL, NULL); + + dbus_g_proxy_add_signal (callManagerProxy, + "transferSucceded", G_TYPE_INVALID); + dbus_g_proxy_connect_signal (callManagerProxy, + "transferSucceded", G_CALLBACK(transfer_succeded_cb), NULL, NULL); + + dbus_g_proxy_add_signal (callManagerProxy, + "transferFailed", G_TYPE_INVALID); + dbus_g_proxy_connect_signal (callManagerProxy, + "transferFailed", G_CALLBACK(transfer_failed_cb), NULL, NULL); + + + configurationManagerProxy = dbus_g_proxy_new_for_name (connection, + "org.sflphone.SFLphone", + "/org/sflphone/SFLphone/ConfigurationManager", + "org.sflphone.SFLphone.ConfigurationManager"); + + + /* + configurationManagerProxy = dbus_g_proxy_new_for_name_owner (connection, + "org.sflphone.SFLphone", + "/org/sflphone/SFLphone/ConfigurationManager", + "org.sflphone.SFLphone.ConfigurationManager", + &error); + */ + if (!configurationManagerProxy) + { + ERROR ("Failed to get proxy to ConfigurationManager"); + return FALSE; + } + DEBUG ("DBus connected to ConfigurationManager"); + dbus_g_proxy_add_signal (configurationManagerProxy, + "accountsChanged", G_TYPE_INVALID); + dbus_g_proxy_connect_signal (configurationManagerProxy, + "accountsChanged", G_CALLBACK(accounts_changed_cb), NULL, NULL); + + dbus_g_object_register_marshaller(g_cclosure_user_marshal_VOID__INT, + G_TYPE_NONE, G_TYPE_INT , G_TYPE_INVALID); + dbus_g_proxy_add_signal (configurationManagerProxy, + "errorAlert", G_TYPE_INT , G_TYPE_INVALID); + dbus_g_proxy_connect_signal (configurationManagerProxy, + "errorAlert", G_CALLBACK(error_alert), NULL, NULL); + return TRUE; +} + + void dbus_clean () { g_object_unref (callManagerProxy); @@ -347,102 +401,102 @@ dbus_clean () } -void -dbus_hold (const call_t * c) + void +dbus_hold (const callable_obj_t * c) { - GError *error = NULL; - org_sflphone_SFLphone_CallManager_hold ( callManagerProxy, c->callID, &error); - if (error) - { - ERROR ("Failed to call hold() on CallManager: %s", + GError *error = NULL; + org_sflphone_SFLphone_CallManager_hold ( callManagerProxy, c->_callID, &error); + if (error) + { + ERROR ("Failed to call hold() on CallManager: %s", error->message); - g_error_free (error); - } + g_error_free (error); + } } -void -dbus_unhold (const call_t * c) + void +dbus_unhold (const callable_obj_t * c) { - GError *error = NULL; - org_sflphone_SFLphone_CallManager_unhold ( callManagerProxy, c->callID, &error); - if (error) - { - ERROR ("Failed to call unhold() on CallManager: %s", + GError *error = NULL; + org_sflphone_SFLphone_CallManager_unhold ( callManagerProxy, c->_callID, &error); + if (error) + { + ERROR ("Failed to call unhold() on CallManager: %s", error->message); - g_error_free (error); - } + g_error_free (error); + } } -void -dbus_hang_up (const call_t * c) + void +dbus_hang_up (const callable_obj_t * c) { - GError *error = NULL; - org_sflphone_SFLphone_CallManager_hang_up ( callManagerProxy, c->callID, &error); - if (error) - { - ERROR ("Failed to call hang_up() on CallManager: %s", + GError *error = NULL; + org_sflphone_SFLphone_CallManager_hang_up ( callManagerProxy, c->_callID, &error); + if (error) + { + ERROR ("Failed to call hang_up() on CallManager: %s", error->message); - g_error_free (error); - } + g_error_free (error); + } } -void -dbus_transfert (const call_t * c) + void +dbus_transfert (const callable_obj_t * c) { - GError *error = NULL; - org_sflphone_SFLphone_CallManager_transfert ( callManagerProxy, c->callID, c->to, &error); - if (error) - { - ERROR ("Failed to call transfert() on CallManager: %s", + GError *error = NULL; + org_sflphone_SFLphone_CallManager_transfert ( callManagerProxy, c->_callID, c->_trsft_to, &error); + if (error) + { + ERROR ("Failed to call transfert() on CallManager: %s", error->message); - g_error_free (error); - } + g_error_free (error); + } } -void -dbus_accept (const call_t * c) + void +dbus_accept (const callable_obj_t * c) { #if GTK_CHECK_VERSION(2,10,0) - status_tray_icon_blink( FALSE ); + status_tray_icon_blink( FALSE ); #endif - GError *error = NULL; - org_sflphone_SFLphone_CallManager_accept ( callManagerProxy, c->callID, &error); - if (error) - { - ERROR ("Failed to call accept(%s) on CallManager: %s", c->callID, + GError *error = NULL; + org_sflphone_SFLphone_CallManager_accept ( callManagerProxy, c->_callID, &error); + if (error) + { + ERROR ("Failed to call accept(%s) on CallManager: %s", c->_callID, (error->message == NULL ? g_quark_to_string(error->domain): error->message)); - g_error_free (error); - } + g_error_free (error); + } } -void -dbus_refuse (const call_t * c) + void +dbus_refuse (const callable_obj_t * c) { #if GTK_CHECK_VERSION(2,10,0) - status_tray_icon_blink( FALSE ); + status_tray_icon_blink( FALSE ); #endif - GError *error = NULL; - org_sflphone_SFLphone_CallManager_refuse ( callManagerProxy, c->callID, &error); - if (error) - { - ERROR ("Failed to call refuse() on CallManager: %s", + GError *error = NULL; + org_sflphone_SFLphone_CallManager_refuse ( callManagerProxy, c->_callID, &error); + if (error) + { + ERROR ("Failed to call refuse() on CallManager: %s", error->message); - g_error_free (error); - } + g_error_free (error); + } } -void -dbus_place_call (const call_t * c) + void +dbus_place_call (const callable_obj_t * c) { - GError *error = NULL; - org_sflphone_SFLphone_CallManager_place_call ( callManagerProxy, c->accountID, c->callID, c->to, &error); - if (error) - { - ERROR ("Failed to call placeCall() on CallManager: %s", + GError *error = NULL; + org_sflphone_SFLphone_CallManager_place_call ( callManagerProxy, c->_accountID, c->_callID, c->_peer_number, &error); + if (error) + { + ERROR ("Failed to call placeCall() on CallManager: %s", error->message); - g_error_free (error); - } + g_error_free (error); + } } gchar** dbus_account_list() @@ -453,13 +507,13 @@ gchar** dbus_account_list() if(!org_sflphone_SFLphone_ConfigurationManager_get_account_list ( configurationManagerProxy, &array, &error)) { if(error->domain == DBUS_GERROR && error->code == DBUS_GERROR_REMOTE_EXCEPTION) - { + { ERROR ("Caught remote method (get_account_list) exception %s: %s", dbus_g_error_get_name(error), error->message); - } + } else - { + { ERROR("Error while calling get_account_list: %s", error->message); - } + } g_error_free (error); return NULL; } @@ -478,13 +532,13 @@ GHashTable* dbus_account_details(gchar * accountID) if(!org_sflphone_SFLphone_ConfigurationManager_get_account_details( configurationManagerProxy, accountID, &details, &error)) { if(error->domain == DBUS_GERROR && error->code == DBUS_GERROR_REMOTE_EXCEPTION) - { + { ERROR ("Caught remote method (get_account_details) exception %s: %s", dbus_g_error_get_name(error), error->message); - } + } else - { + { ERROR("Error while calling get_account_details: %s", error->message); - } + } g_error_free (error); return NULL; } @@ -493,241 +547,241 @@ GHashTable* dbus_account_details(gchar * accountID) } } -void + void dbus_send_register ( gchar* accountID , const guint expire) { - GError *error = NULL; - org_sflphone_SFLphone_ConfigurationManager_send_register ( configurationManagerProxy, accountID, expire ,&error); - if (error) - { - ERROR ("Failed to call send_register() on ConfigurationManager: %s", + GError *error = NULL; + org_sflphone_SFLphone_ConfigurationManager_send_register ( configurationManagerProxy, accountID, expire ,&error); + if (error) + { + ERROR ("Failed to call send_register() on ConfigurationManager: %s", error->message); - g_error_free (error); - } + g_error_free (error); + } } -void + void dbus_remove_account(gchar * accountID) { - GError *error = NULL; - org_sflphone_SFLphone_ConfigurationManager_remove_account ( - configurationManagerProxy, - accountID, - &error); - if (error) - { - ERROR ("Failed to call remove_account() on ConfigurationManager: %s", - error->message); - g_error_free (error); - } + GError *error = NULL; + org_sflphone_SFLphone_ConfigurationManager_remove_account ( + configurationManagerProxy, + accountID, + &error); + if (error) + { + ERROR ("Failed to call remove_account() on ConfigurationManager: %s", + error->message); + g_error_free (error); + } } -void + void dbus_set_account_details(account_t *a) { - GError *error = NULL; - org_sflphone_SFLphone_ConfigurationManager_set_account_details ( - configurationManagerProxy, - a->accountID, - a->properties, - &error); - if (error) - { - ERROR ("Failed to call set_account_details() on ConfigurationManager: %s", + GError *error = NULL; + org_sflphone_SFLphone_ConfigurationManager_set_account_details ( + configurationManagerProxy, + a->accountID, + a->properties, + &error); + if (error) + { + ERROR ("Failed to call set_account_details() on ConfigurationManager: %s", error->message); - g_error_free (error); - } + g_error_free (error); + } } -guint + gchar* dbus_add_account(account_t *a) { - gint accountId; - GError *error = NULL; - org_sflphone_SFLphone_ConfigurationManager_add_account ( - configurationManagerProxy, - a->properties, - &accountId, - &error); - if (error) - { - ERROR ("Failed to call add_account() on ConfigurationManager: %s", + gchar* accountId; + GError *error = NULL; + org_sflphone_SFLphone_ConfigurationManager_add_account ( + configurationManagerProxy, + a->properties, + &accountId, + &error); + if (error) + { + ERROR ("Failed to call add_account() on ConfigurationManager: %s", error->message); - g_error_free (error); - } - return (guint) accountId; + g_error_free (error); + } + return accountId; } -void + void dbus_set_volume(const gchar * device, gdouble value) { - GError *error = NULL; - org_sflphone_SFLphone_CallManager_set_volume( - callManagerProxy, - device, - value, - &error); + GError *error = NULL; + org_sflphone_SFLphone_CallManager_set_volume( + callManagerProxy, + device, + value, + &error); - if (error) - { - ERROR ("Failed to call set_volume() on callManagerProxy: %s", + if (error) + { + ERROR ("Failed to call set_volume() on callManagerProxy: %s", error->message); - g_error_free (error); - } + g_error_free (error); + } } -gdouble + gdouble dbus_get_volume(const gchar * device) { - gdouble value; - GError *error = NULL; + gdouble value; + GError *error = NULL; - org_sflphone_SFLphone_CallManager_get_volume( - callManagerProxy, - device, - &value, - &error); + org_sflphone_SFLphone_CallManager_get_volume( + callManagerProxy, + device, + &value, + &error); - if (error) - { - ERROR ("Failed to call get_volume() on callManagerProxy: %s", + if (error) + { + ERROR ("Failed to call get_volume() on callManagerProxy: %s", error->message); - g_error_free (error); - } - return value; + g_error_free (error); + } + return value; } -void + void dbus_play_dtmf(const gchar * key) { - GError *error = NULL; + GError *error = NULL; - org_sflphone_SFLphone_CallManager_play_dt_mf( - callManagerProxy, - key, - &error); + org_sflphone_SFLphone_CallManager_play_dt_mf( + callManagerProxy, + key, + &error); - if (error) - { - ERROR ("Failed to call playDTMF() on callManagerProxy: %s", + if (error) + { + ERROR ("Failed to call playDTMF() on callManagerProxy: %s", error->message); - g_error_free (error); - } + g_error_free (error); + } } -void + void dbus_start_tone(const int start , const guint type ) { - GError *error = NULL; + GError *error = NULL; - org_sflphone_SFLphone_CallManager_start_tone( - callManagerProxy, - start, - type, - &error); + org_sflphone_SFLphone_CallManager_start_tone( + callManagerProxy, + start, + type, + &error); - if (error) - { - ERROR ("Failed to call startTone() on callManagerProxy: %s", + if (error) + { + ERROR ("Failed to call startTone() on callManagerProxy: %s", error->message); - g_error_free (error); - } + g_error_free (error); + } } -void + void dbus_register(int pid, gchar * name) { - GError *error = NULL; + GError *error = NULL; - org_sflphone_SFLphone_Instance_register( - instanceProxy, - pid, - name, - &error); + org_sflphone_SFLphone_Instance_register( + instanceProxy, + pid, + name, + &error); - if (error) - { - ERROR ("Failed to call register() on instanceProxy: %s", + if (error) + { + ERROR ("Failed to call register() on instanceProxy: %s", error->message); - g_error_free (error); - } + g_error_free (error); + } } -void + void dbus_unregister(int pid) { - GError *error = NULL; + GError *error = NULL; - org_sflphone_SFLphone_Instance_unregister( - instanceProxy, - pid, - &error); + org_sflphone_SFLphone_Instance_unregister( + instanceProxy, + pid, + &error); - if (error) - { - ERROR ("Failed to call unregister() on instanceProxy: %s", + if (error) + { + ERROR ("Failed to call unregister() on instanceProxy: %s", error->message); - g_error_free (error); - } + g_error_free (error); + } } -gchar** + gchar** dbus_codec_list() { - GError *error = NULL; - gchar** array; - org_sflphone_SFLphone_ConfigurationManager_get_codec_list ( - configurationManagerProxy, - &array, - &error); + GError *error = NULL; + gchar** array; + org_sflphone_SFLphone_ConfigurationManager_get_codec_list ( + configurationManagerProxy, + &array, + &error); - if (error) - { - ERROR ("Failed to call get_codec_list() on ConfigurationManager: %s", - error->message); - g_error_free (error); - } - return array; + if (error) + { + ERROR ("Failed to call get_codec_list() on ConfigurationManager: %s", + error->message); + g_error_free (error); + } + return array; } -gchar** + gchar** dbus_codec_details( int payload ) { - GError *error = NULL; - gchar ** array; - org_sflphone_SFLphone_ConfigurationManager_get_codec_details ( - configurationManagerProxy, - payload, - &array, - &error); - - if (error) - { - ERROR ("Failed to call get_codec_details() on ConfigurationManager: %s", - error->message); - g_error_free (error); - } - return array; + GError *error = NULL; + gchar ** array; + org_sflphone_SFLphone_ConfigurationManager_get_codec_details ( + configurationManagerProxy, + payload, + &array, + &error); + + if (error) + { + ERROR ("Failed to call get_codec_details() on ConfigurationManager: %s", + error->message); + g_error_free (error); + } + return array; } -gchar* -dbus_get_current_codec_name(const call_t * c) + gchar* +dbus_get_current_codec_name(const callable_obj_t * c) { - DEBUG("dbus_get_current_codec_name : CallID : %s", c->callID); + DEBUG("dbus_get_current_codec_name : CallID : %s", c->_callID); gchar* codecName; GError* error = NULL; org_sflphone_SFLphone_CallManager_get_current_codec_name ( - callManagerProxy, - c->callID, - &codecName, - &error); + callManagerProxy, + c->_callID, + &codecName, + &error); if(error) { g_error_free(error); @@ -740,119 +794,119 @@ dbus_get_current_codec_name(const call_t * c) -gchar** + gchar** dbus_get_active_codec_list() { - gchar ** array; - GError *error = NULL; - org_sflphone_SFLphone_ConfigurationManager_get_active_codec_list ( - configurationManagerProxy, - &array, - &error); + gchar ** array; + GError *error = NULL; + org_sflphone_SFLphone_ConfigurationManager_get_active_codec_list ( + configurationManagerProxy, + &array, + &error); - if (error) - { - ERROR ("Failed to call get_active_codec_list() on ConfigurationManager: %s", - error->message); - g_error_free (error); - } - return array; + if (error) + { + ERROR ("Failed to call get_active_codec_list() on ConfigurationManager: %s", + error->message); + g_error_free (error); + } + return array; } -void + void dbus_set_active_codec_list(const gchar** list) { - GError *error = NULL; - org_sflphone_SFLphone_ConfigurationManager_set_active_codec_list ( - configurationManagerProxy, - list, - &error); + GError *error = NULL; + org_sflphone_SFLphone_ConfigurationManager_set_active_codec_list ( + configurationManagerProxy, + list, + &error); - if (error) - { - ERROR ("Failed to call set_active_codec_list() on ConfigurationManager: %s", - error->message); - g_error_free (error); - } + if (error) + { + ERROR ("Failed to call set_active_codec_list() on ConfigurationManager: %s", + error->message); + g_error_free (error); + } } /** * Get a list of input supported audio plugins */ -gchar** + gchar** dbus_get_input_audio_plugin_list() { - gchar** array; - GError* error = NULL; - org_sflphone_SFLphone_ConfigurationManager_get_input_audio_plugin_list( - configurationManagerProxy, - &array, - &error); - if(error) - { - ERROR("Failed to call get_input_audio_plugin_list() on ConfigurationManager: %s", error->message); - g_error_free(error); - } - return array; + gchar** array; + GError* error = NULL; + org_sflphone_SFLphone_ConfigurationManager_get_input_audio_plugin_list( + configurationManagerProxy, + &array, + &error); + if(error) + { + ERROR("Failed to call get_input_audio_plugin_list() on ConfigurationManager: %s", error->message); + g_error_free(error); + } + return array; } /** * Get a list of output supported audio plugins */ -gchar** + gchar** dbus_get_output_audio_plugin_list() { - gchar** array; - GError* error = NULL; - - if(!org_sflphone_SFLphone_ConfigurationManager_get_output_audio_plugin_list( configurationManagerProxy, &array, &error)) - { - if(error->domain == DBUS_GERROR && error->code == DBUS_GERROR_REMOTE_EXCEPTION) - { - ERROR ("Caught remote method (get_output_audio_plugin_list) exception %s: %s", dbus_g_error_get_name(error), error->message); - } - else - { - ERROR("Error while calling get_out_audio_plugin_list: %s", error->message); - } - g_error_free (error); - return NULL; - } - else{ - return array; - } -} - -void + gchar** array; + GError* error = NULL; + + if(!org_sflphone_SFLphone_ConfigurationManager_get_output_audio_plugin_list( configurationManagerProxy, &array, &error)) + { + if(error->domain == DBUS_GERROR && error->code == DBUS_GERROR_REMOTE_EXCEPTION) + { + ERROR ("Caught remote method (get_output_audio_plugin_list) exception %s: %s", dbus_g_error_get_name(error), error->message); + } + else + { + ERROR("Error while calling get_out_audio_plugin_list: %s", error->message); + } + g_error_free (error); + return NULL; + } + else{ + return array; + } +} + + void dbus_set_input_audio_plugin(gchar* audioPlugin) { - GError* error = NULL; - org_sflphone_SFLphone_ConfigurationManager_set_input_audio_plugin( - configurationManagerProxy, - audioPlugin, - &error); - if(error) - { - ERROR("Failed to call set_input_audio_plugin() on ConfigurationManager: %s", error->message); - g_error_free(error); - } + GError* error = NULL; + org_sflphone_SFLphone_ConfigurationManager_set_input_audio_plugin( + configurationManagerProxy, + audioPlugin, + &error); + if(error) + { + ERROR("Failed to call set_input_audio_plugin() on ConfigurationManager: %s", error->message); + g_error_free(error); + } } -void + void dbus_set_output_audio_plugin(gchar* audioPlugin) { - GError* error = NULL; - org_sflphone_SFLphone_ConfigurationManager_set_output_audio_plugin( - configurationManagerProxy, - audioPlugin, - &error); - if(error) - { - ERROR("Failed to call set_output_audio_plugin() on ConfigurationManager: %s", error->message); - g_error_free(error); - } + GError* error = NULL; + org_sflphone_SFLphone_ConfigurationManager_set_output_audio_plugin( + configurationManagerProxy, + audioPlugin, + &error); + if(error) + { + ERROR("Failed to call set_output_audio_plugin() on ConfigurationManager: %s", error->message); + g_error_free(error); + } } /** @@ -860,491 +914,518 @@ dbus_set_output_audio_plugin(gchar* audioPlugin) */ gchar** dbus_get_audio_output_device_list() { - gchar** array; - GError* error = NULL; - org_sflphone_SFLphone_ConfigurationManager_get_audio_output_device_list( - configurationManagerProxy, - &array, - &error); - if(error) - { - ERROR("Failed to call get_audio_output_device_list() on ConfigurationManager: %s", error->message); - g_error_free(error); - } - return array; + gchar** array; + GError* error = NULL; + org_sflphone_SFLphone_ConfigurationManager_get_audio_output_device_list( + configurationManagerProxy, + &array, + &error); + if(error) + { + ERROR("Failed to call get_audio_output_device_list() on ConfigurationManager: %s", error->message); + g_error_free(error); + } + return array; } /** * Set audio output device from its index */ -void + void dbus_set_audio_output_device(const int index) { - GError* error = NULL; - org_sflphone_SFLphone_ConfigurationManager_set_audio_output_device( - configurationManagerProxy, - index, - &error); - if(error) - { - ERROR("Failed to call set_audio_output_device() on ConfigurationManager: %s", error->message); - g_error_free(error); - } + GError* error = NULL; + org_sflphone_SFLphone_ConfigurationManager_set_audio_output_device( + configurationManagerProxy, + index, + &error); + if(error) + { + ERROR("Failed to call set_audio_output_device() on ConfigurationManager: %s", error->message); + g_error_free(error); + } } /** * Get all input devices index supported by current audio manager */ -gchar** + gchar** dbus_get_audio_input_device_list() { - gchar** array; - GError* error = NULL; - org_sflphone_SFLphone_ConfigurationManager_get_audio_input_device_list( - configurationManagerProxy, - &array, - &error); - if(error) - { - ERROR("Failed to call get_audio_input_device_list() on ConfigurationManager: %s", error->message); - g_error_free(error); - } - return array; + gchar** array; + GError* error = NULL; + org_sflphone_SFLphone_ConfigurationManager_get_audio_input_device_list( + configurationManagerProxy, + &array, + &error); + if(error) + { + ERROR("Failed to call get_audio_input_device_list() on ConfigurationManager: %s", error->message); + g_error_free(error); + } + return array; } /** * Set audio input device from its index */ -void + void dbus_set_audio_input_device(const int index) { - GError* error = NULL; - org_sflphone_SFLphone_ConfigurationManager_set_audio_input_device( - configurationManagerProxy, - index, - &error); - if(error) - { - ERROR("Failed to call set_audio_input_device() on ConfigurationManager: %s", error->message); - g_error_free(error); - } + GError* error = NULL; + org_sflphone_SFLphone_ConfigurationManager_set_audio_input_device( + configurationManagerProxy, + index, + &error); + if(error) + { + ERROR("Failed to call set_audio_input_device() on ConfigurationManager: %s", error->message); + g_error_free(error); + } } /** * Get output device index and input device index */ -gchar** + gchar** dbus_get_current_audio_devices_index() { - gchar** array; - GError* error = NULL; - org_sflphone_SFLphone_ConfigurationManager_get_current_audio_devices_index( - configurationManagerProxy, - &array, - &error); - if(error) - { - ERROR("Failed to call get_current_audio_devices_index() on ConfigurationManager: %s", error->message); - g_error_free(error); - } - return array; + gchar** array; + GError* error = NULL; + org_sflphone_SFLphone_ConfigurationManager_get_current_audio_devices_index( + configurationManagerProxy, + &array, + &error); + if(error) + { + ERROR("Failed to call get_current_audio_devices_index() on ConfigurationManager: %s", error->message); + g_error_free(error); + } + return array; } /** * Get index */ -int + int dbus_get_audio_device_index(const gchar *name) { - int index; - GError* error = NULL; - org_sflphone_SFLphone_ConfigurationManager_get_audio_device_index( - configurationManagerProxy, - name, - &index, - &error); - if(error) - { - ERROR("Failed to call get_audio_device_index() on ConfigurationManager: %s", error->message); - g_error_free(error); - } - return index; + int index; + GError* error = NULL; + org_sflphone_SFLphone_ConfigurationManager_get_audio_device_index( + configurationManagerProxy, + name, + &index, + &error); + if(error) + { + ERROR("Failed to call get_audio_device_index() on ConfigurationManager: %s", error->message); + g_error_free(error); + } + return index; } /** * Get audio plugin */ -gchar* + gchar* dbus_get_current_audio_output_plugin() { - gchar* plugin=""; - GError* error = NULL; - org_sflphone_SFLphone_ConfigurationManager_get_current_audio_output_plugin( - configurationManagerProxy, - &plugin, - &error); - if(error) - { - ERROR("Failed to call get_current_audio_output_plugin() on ConfigurationManager: %s", error->message); - g_error_free(error); - } - return plugin; + gchar* plugin=""; + GError* error = NULL; + org_sflphone_SFLphone_ConfigurationManager_get_current_audio_output_plugin( + configurationManagerProxy, + &plugin, + &error); + if(error) + { + ERROR("Failed to call get_current_audio_output_plugin() on ConfigurationManager: %s", error->message); + g_error_free(error); + } + return plugin; } -gchar* + gchar* dbus_get_ringtone_choice() { - gchar* tone; - GError* error = NULL; - org_sflphone_SFLphone_ConfigurationManager_get_ringtone_choice( - configurationManagerProxy, - &tone, - &error); - if(error) - { - g_error_free(error); - } - return tone; + gchar* tone; + GError* error = NULL; + org_sflphone_SFLphone_ConfigurationManager_get_ringtone_choice( + configurationManagerProxy, + &tone, + &error); + if(error) + { + g_error_free(error); + } + return tone; } -void + void dbus_set_ringtone_choice( const gchar* tone ) { - GError* error = NULL; - org_sflphone_SFLphone_ConfigurationManager_set_ringtone_choice( - configurationManagerProxy, - tone, - &error); - if(error) - { - g_error_free(error); - } + GError* error = NULL; + org_sflphone_SFLphone_ConfigurationManager_set_ringtone_choice( + configurationManagerProxy, + tone, + &error); + if(error) + { + g_error_free(error); + } } -int + int dbus_is_ringtone_enabled() { - int res; - GError* error = NULL; - org_sflphone_SFLphone_ConfigurationManager_is_ringtone_enabled( - configurationManagerProxy, - &res, - &error); - if(error) - { - g_error_free(error); - } - return res; + int res; + GError* error = NULL; + org_sflphone_SFLphone_ConfigurationManager_is_ringtone_enabled( + configurationManagerProxy, + &res, + &error); + if(error) + { + g_error_free(error); + } + return res; } -void + void dbus_ringtone_enabled() { - GError* error = NULL; - org_sflphone_SFLphone_ConfigurationManager_ringtone_enabled( - configurationManagerProxy, - &error); - if(error) - { - g_error_free(error); - } + GError* error = NULL; + org_sflphone_SFLphone_ConfigurationManager_ringtone_enabled( + configurationManagerProxy, + &error); + if(error) + { + g_error_free(error); + } } -int + int dbus_is_iax2_enabled() { - int res; - GError* error = NULL; - org_sflphone_SFLphone_ConfigurationManager_is_iax2_enabled( - configurationManagerProxy, - &res, - &error); - if(error) - { - g_error_free(error); - } - return res; + int res; + GError* error = NULL; + org_sflphone_SFLphone_ConfigurationManager_is_iax2_enabled( + configurationManagerProxy, + &res, + &error); + if(error) + { + g_error_free(error); + } + return res; } -int + int dbus_get_dialpad() { - int state; - GError* error = NULL; - org_sflphone_SFLphone_ConfigurationManager_get_dialpad( - configurationManagerProxy, - &state, - &error); - if(error) - { - g_error_free(error); - } - return state; + int state; + GError* error = NULL; + org_sflphone_SFLphone_ConfigurationManager_get_dialpad( + configurationManagerProxy, + &state, + &error); + if(error) + { + g_error_free(error); + } + return state; } -void + void dbus_set_dialpad( ) { - GError* error = NULL; - org_sflphone_SFLphone_ConfigurationManager_set_dialpad( - configurationManagerProxy, - &error); - if(error) - { - g_error_free(error); - } + GError* error = NULL; + org_sflphone_SFLphone_ConfigurationManager_set_dialpad( + configurationManagerProxy, + &error); + if(error) + { + g_error_free(error); + } } -int + int dbus_get_searchbar() { - int state; - GError* error = NULL; - if(!org_sflphone_SFLphone_ConfigurationManager_get_searchbar( configurationManagerProxy, &state, &error)) + int state; + GError* error = NULL; + if(!org_sflphone_SFLphone_ConfigurationManager_get_searchbar( configurationManagerProxy, &state, &error)) { if(error->domain == DBUS_GERROR && error->code == DBUS_GERROR_REMOTE_EXCEPTION) - { + { ERROR ("Caught remote method (get_searchbar) exception %s: %s", dbus_g_error_get_name(error), error->message); - } + } else - { + { ERROR("Error while calling get_searchbar: %s", error->message); - } + } g_error_free (error); return -1; } - else + else { - return state; + return state; } } -void + void dbus_set_searchbar( ) { - GError* error = NULL; - org_sflphone_SFLphone_ConfigurationManager_set_searchbar( - configurationManagerProxy, - &error); - if(error) - { - g_error_free(error); - } + GError* error = NULL; + org_sflphone_SFLphone_ConfigurationManager_set_searchbar( + configurationManagerProxy, + &error); + if(error) + { + g_error_free(error); + } } -int + int dbus_get_volume_controls() { - int state; - GError* error = NULL; - org_sflphone_SFLphone_ConfigurationManager_get_volume_controls( - configurationManagerProxy, - &state, - &error); - if(error) - { - g_error_free(error); - } - return state; + int state; + GError* error = NULL; + org_sflphone_SFLphone_ConfigurationManager_get_volume_controls( + configurationManagerProxy, + &state, + &error); + if(error) + { + g_error_free(error); + } + return state; } -void + void dbus_set_volume_controls( ) { - GError* error = NULL; - org_sflphone_SFLphone_ConfigurationManager_set_volume_controls( - configurationManagerProxy, - &error); - if(error) - { - g_error_free(error); - } -} - - -void -dbus_set_record(const call_t * c) -{ - DEBUG("calling dbus_set_record on CallManager"); - DEBUG("CallID : %s", c->callID); - GError* error = NULL; - org_sflphone_SFLphone_CallManager_set_recording ( - callManagerProxy, - c->callID, - &error); - if(error) - { - g_error_free(error); - } -} - -gboolean -dbus_get_is_recording(const call_t * c) -{ - DEBUG("calling dbus_get_is_recording on CallManager"); - GError* error = NULL; - gboolean isRecording; - org_sflphone_SFLphone_CallManager_get_is_recording ( - callManagerProxy, - c->callID, - &isRecording, - &error); - if(error) - { - g_error_free(error); - } - //DEBUG("RECORDING: %i",isRecording); - return isRecording; -} - -void + GError* error = NULL; + org_sflphone_SFLphone_ConfigurationManager_set_volume_controls( + configurationManagerProxy, + &error); + if(error) + { + g_error_free(error); + } +} + + + void +dbus_set_record(const callable_obj_t * c) +{ + DEBUG("calling dbus_set_record on CallManager"); + DEBUG("CallID : %s", c->_callID); + GError* error = NULL; + org_sflphone_SFLphone_CallManager_set_recording ( + callManagerProxy, + c->_callID, + &error); + if(error) + { + g_error_free(error); + } +} + + gboolean +dbus_get_is_recording(const callable_obj_t * c) +{ + DEBUG("calling dbus_get_is_recording on CallManager"); + GError* error = NULL; + gboolean isRecording; + org_sflphone_SFLphone_CallManager_get_is_recording ( + callManagerProxy, + c->_callID, + &isRecording, + &error); + if(error) + { + g_error_free(error); + } + //DEBUG("RECORDING: %i",isRecording); + return isRecording; +} + + void dbus_set_record_path(const gchar* path) { - GError* error = NULL; - org_sflphone_SFLphone_ConfigurationManager_set_record_path ( - configurationManagerProxy, - path, - &error); - if(error) - { - g_error_free(error); - } + GError* error = NULL; + org_sflphone_SFLphone_ConfigurationManager_set_record_path ( + configurationManagerProxy, + path, + &error); + if(error) + { + g_error_free(error); + } } gchar* dbus_get_record_path(void) { - GError* error = NULL; - gchar *path; - org_sflphone_SFLphone_ConfigurationManager_get_record_path ( - configurationManagerProxy, - &path, - &error); - if(error) - { - g_error_free(error); - } - return path; -} - -void -dbus_set_max_calls( const guint calls ) -{ - GError* error = NULL; - org_sflphone_SFLphone_ConfigurationManager_set_max_calls( - configurationManagerProxy, - calls, - &error); - if(error) - { - g_error_free(error); - } -} - -guint -dbus_get_max_calls( void ) -{ - GError* error = NULL; - gint calls; - org_sflphone_SFLphone_ConfigurationManager_get_max_calls( - configurationManagerProxy, - &calls, - &error); - if(error) - { - g_error_free(error); - } - return (guint)calls; -} - -void + GError* error = NULL; + gchar *path; + org_sflphone_SFLphone_ConfigurationManager_get_record_path ( + configurationManagerProxy, + &path, + &error); + if(error) + { + g_error_free(error); + } + return path; +} + +void dbus_set_history_limit (const guint days) +{ + GError* error = NULL; + org_sflphone_SFLphone_ConfigurationManager_set_history_limit( + configurationManagerProxy, + days, + &error); + if(error) + { + g_error_free(error); + } +} + +void dbus_set_history_enabled () +{ + GError* error = NULL; + org_sflphone_SFLphone_ConfigurationManager_set_history_enabled( + configurationManagerProxy, + &error); + if(error) + { + g_error_free(error); + } +} + +int dbus_get_history_enabled () +{ + int state; + GError* error = NULL; + org_sflphone_SFLphone_ConfigurationManager_get_history_enabled( + configurationManagerProxy, + &state, + &error); + if(error) + { + g_error_free(error); + } + return state; +} + + + +guint dbus_get_history_limit (void) +{ + GError* error = NULL; + gint days=30; + org_sflphone_SFLphone_ConfigurationManager_get_history_limit( + configurationManagerProxy, + &days, + &error); + if(error) + { + g_error_free(error); + } + return (guint)days; +} + + void dbus_start_hidden( void ) { - GError* error = NULL; - org_sflphone_SFLphone_ConfigurationManager_start_hidden( - configurationManagerProxy, - &error); - if(error) - { - g_error_free(error); - } + GError* error = NULL; + org_sflphone_SFLphone_ConfigurationManager_start_hidden( + configurationManagerProxy, + &error); + if(error) + { + g_error_free(error); + } } -int + int dbus_is_start_hidden( void ) { - GError* error = NULL; - int state; - org_sflphone_SFLphone_ConfigurationManager_is_start_hidden( - configurationManagerProxy, - &state, - &error); - if(error) - { - g_error_free(error); - } - return state; + GError* error = NULL; + int state; + org_sflphone_SFLphone_ConfigurationManager_is_start_hidden( + configurationManagerProxy, + &state, + &error); + if(error) + { + g_error_free(error); + } + return state; } -int + int dbus_popup_mode( void ) { - GError* error = NULL; - int state; - org_sflphone_SFLphone_ConfigurationManager_popup_mode( - configurationManagerProxy, - &state, - &error); - if(error) - { - g_error_free(error); - } - return state; + GError* error = NULL; + int state; + org_sflphone_SFLphone_ConfigurationManager_popup_mode( + configurationManagerProxy, + &state, + &error); + if(error) + { + g_error_free(error); + } + return state; } -void + void dbus_switch_popup_mode( void ) { - GError* error = NULL; - org_sflphone_SFLphone_ConfigurationManager_switch_popup_mode( - configurationManagerProxy, - &error); - if(error) - { - g_error_free(error); - } + GError* error = NULL; + org_sflphone_SFLphone_ConfigurationManager_switch_popup_mode( + configurationManagerProxy, + &error); + if(error) + { + g_error_free(error); + } } -void + void dbus_set_notify( void ) { - GError* error = NULL; - org_sflphone_SFLphone_ConfigurationManager_set_notify( - configurationManagerProxy, - &error); - if(error) - { - g_error_free(error); - } + GError* error = NULL; + org_sflphone_SFLphone_ConfigurationManager_set_notify( + configurationManagerProxy, + &error); + if(error) + { + g_error_free(error); + } } -guint + guint dbus_get_notify( void ) { - gint level; - GError* error = NULL; - if( !org_sflphone_SFLphone_ConfigurationManager_get_notify( configurationManagerProxy,&level, &error) ) + gint level; + GError* error = NULL; + if( !org_sflphone_SFLphone_ConfigurationManager_get_notify( configurationManagerProxy,&level, &error) ) { if(error->domain == DBUS_GERROR && error->code == DBUS_GERROR_REMOTE_EXCEPTION) - { + { ERROR ("Caught remote method (get_notify) exception %s: %s", dbus_g_error_get_name(error), error->message); - } + } else - { + { ERROR ("Error while calling get_notify: %s", error->message); - } + } g_error_free (error); return 0; } @@ -1354,150 +1435,150 @@ dbus_get_notify( void ) } -void + void dbus_set_mail_notify( void ) { - GError* error = NULL; - org_sflphone_SFLphone_ConfigurationManager_set_mail_notify( - configurationManagerProxy, - &error); - if(error) - { - g_error_free(error); - } + GError* error = NULL; + org_sflphone_SFLphone_ConfigurationManager_set_mail_notify( + configurationManagerProxy, + &error); + if(error) + { + g_error_free(error); + } } -guint + guint dbus_get_mail_notify( void ) { - gint level; - GError* error = NULL; - org_sflphone_SFLphone_ConfigurationManager_get_mail_notify( - configurationManagerProxy, - &level, - &error); - if(error) - { - ERROR("Error calling dbus_get_mail_notif_level"); - g_error_free(error); - } + gint level; + GError* error = NULL; + org_sflphone_SFLphone_ConfigurationManager_get_mail_notify( + configurationManagerProxy, + &level, + &error); + if(error) + { + ERROR("Error calling dbus_get_mail_notif_level"); + g_error_free(error); + } - return (guint)level; + return (guint)level; } -void + void dbus_set_audio_manager( int api ) { - GError* error = NULL; - org_sflphone_SFLphone_ConfigurationManager_set_audio_manager( - configurationManagerProxy, - api, - &error); - if(error) - { - g_error_free(error); - } + GError* error = NULL; + org_sflphone_SFLphone_ConfigurationManager_set_audio_manager( + configurationManagerProxy, + api, + &error); + if(error) + { + g_error_free(error); + } } -int + int dbus_get_audio_manager( void ) { - int api; - GError* error = NULL; - org_sflphone_SFLphone_ConfigurationManager_get_audio_manager( - configurationManagerProxy, - &api, - &error); - if(error) - { - ERROR("Error calling dbus_get_audio_manager"); - g_error_free(error); - } + int api; + GError* error = NULL; + org_sflphone_SFLphone_ConfigurationManager_get_audio_manager( + configurationManagerProxy, + &api, + &error); + if(error) + { + ERROR("Error calling dbus_get_audio_manager"); + g_error_free(error); + } - return api; + return api; } -void + void dbus_set_pulse_app_volume_control( void ) { - GError* error = NULL; - org_sflphone_SFLphone_ConfigurationManager_set_pulse_app_volume_control( - configurationManagerProxy, - &error); - if(error) - { - g_error_free(error); - } + GError* error = NULL; + org_sflphone_SFLphone_ConfigurationManager_set_pulse_app_volume_control( + configurationManagerProxy, + &error); + if(error) + { + g_error_free(error); + } } -int + int dbus_get_pulse_app_volume_control( void ) { - int state; - GError* error = NULL; - org_sflphone_SFLphone_ConfigurationManager_get_pulse_app_volume_control( - configurationManagerProxy, - &state, - &error); - return state; + int state; + GError* error = NULL; + org_sflphone_SFLphone_ConfigurationManager_get_pulse_app_volume_control( + configurationManagerProxy, + &state, + &error); + return state; } -void + void dbus_set_sip_port( const guint portNum ) { - GError* error = NULL; - org_sflphone_SFLphone_ConfigurationManager_set_sip_port( - configurationManagerProxy, - portNum, - &error); - if(error) - { - g_error_free(error); - } + GError* error = NULL; + org_sflphone_SFLphone_ConfigurationManager_set_sip_port( + configurationManagerProxy, + portNum, + &error); + if(error) + { + g_error_free(error); + } } -guint + guint dbus_get_sip_port( void ) { - GError* error = NULL; - gint portNum; - org_sflphone_SFLphone_ConfigurationManager_get_sip_port( - configurationManagerProxy, - &portNum, - &error); - if(error) - { - g_error_free(error); - } - return (guint)portNum; + GError* error = NULL; + gint portNum; + org_sflphone_SFLphone_ConfigurationManager_get_sip_port( + configurationManagerProxy, + &portNum, + &error); + if(error) + { + g_error_free(error); + } + return (guint)portNum; } gchar* dbus_get_stun_server (void) { - GError* error = NULL; - gchar* server; - org_sflphone_SFLphone_ConfigurationManager_get_stun_server( - configurationManagerProxy, - &server, - &error); - if(error) - { - g_error_free(error); - } - return server; + GError* error = NULL; + gchar* server; + org_sflphone_SFLphone_ConfigurationManager_get_stun_server( + configurationManagerProxy, + &server, + &error); + if(error) + { + g_error_free(error); + } + return server; } void dbus_set_stun_server( gchar* server) { - GError* error = NULL; - org_sflphone_SFLphone_ConfigurationManager_set_stun_server( - configurationManagerProxy, - server, - &error); - if(error) - { - g_error_free(error); - } + GError* error = NULL; + org_sflphone_SFLphone_ConfigurationManager_set_stun_server( + configurationManagerProxy, + server, + &error); + if(error) + { + g_error_free(error); + } } gint dbus_stun_is_enabled (void) @@ -1505,14 +1586,14 @@ gint dbus_stun_is_enabled (void) GError* error = NULL; gint stun; org_sflphone_SFLphone_ConfigurationManager_is_stun_enabled( - configurationManagerProxy, - &stun, - &error); - if(error) - { - g_error_free(error); - } - return stun; + configurationManagerProxy, + &stun, + &error); + if(error) + { + g_error_free(error); + } + return stun; } void dbus_enable_stun (void) @@ -1520,12 +1601,12 @@ void dbus_enable_stun (void) GError* error = NULL; org_sflphone_SFLphone_ConfigurationManager_enable_stun( - configurationManagerProxy, - &error); - if(error) - { - g_error_free(error); - } + configurationManagerProxy, + &error); + if(error) + { + g_error_free(error); + } } GHashTable* dbus_get_addressbook_settings (void) { @@ -1623,6 +1704,20 @@ GHashTable* dbus_get_call_details (const gchar *callID) return details; } +gchar** dbus_get_call_list (void) +{ + GError *error = NULL; + gchar **list = NULL; + + org_sflphone_SFLphone_CallManager_get_call_list (callManagerProxy, &list, &error); + if (error){ + ERROR ("Error calling org_sflphone_SFLphone_CallManager_get_call_list"); + g_error_free (error); + } + + return list; +} + void dbus_set_accounts_order (const gchar* order) { GError *error = NULL; @@ -1634,3 +1729,27 @@ void dbus_set_accounts_order (const gchar* order) { } } +GHashTable* dbus_get_history (void) +{ + GError *error = NULL; + GHashTable *entries = NULL; + + org_sflphone_SFLphone_ConfigurationManager_get_history (configurationManagerProxy, &entries, &error); + if (error){ + ERROR ("Error calling org_sflphone_SFLphone_CallManager_get_history"); + g_error_free (error); + } + + return entries; +} + +void dbus_set_history (GHashTable* entries) +{ + GError *error = NULL; + + org_sflphone_SFLphone_ConfigurationManager_set_history (configurationManagerProxy, entries, &error); + if (error){ + ERROR ("Error calling org_sflphone_SFLphone_CallManager_set_history"); + g_error_free (error); + } +} diff --git a/sflphone-client-gnome/src/dbus/dbus.h b/sflphone-client-gnome/src/dbus/dbus.h index c16ec70726472085c35d48b8488a3677c496f5fb..0c46d263da68011555309b6e774fa8de6377b6d8 100644 --- a/sflphone-client-gnome/src/dbus/dbus.h +++ b/sflphone-client-gnome/src/dbus/dbus.h @@ -28,7 +28,6 @@ #include <accountlist.h> #include <calllist.h> #include <sflnotify.h> -#include <calltree.h> /** @file dbus.h * @brief General DBus functions wrappers. @@ -49,43 +48,43 @@ void dbus_clean (); * CallManager - Hold a call * @param c The call to hold */ -void dbus_hold (const call_t * c ); +void dbus_hold (const callable_obj_t * c ); /** * CallManager - Unhold a call * @param c The call to unhold */ -void dbus_unhold (const call_t * c ); +void dbus_unhold (const callable_obj_t * c ); /** * CallManager - Hang up a call * @param c The call to hang up */ -void dbus_hang_up (const call_t * c ); +void dbus_hang_up (const callable_obj_t * c ); /** * CallManager - Transfer a call * @param c The call to transfer */ -void dbus_transfert (const call_t * c); +void dbus_transfert (const callable_obj_t * c); /** * CallManager - Accept a call * @param c The call to accept */ -void dbus_accept (const call_t * c); +void dbus_accept (const callable_obj_t * c); /** * CallManager - Refuse a call * @param c The call to refuse */ -void dbus_refuse (const call_t * c); +void dbus_refuse (const callable_obj_t * c); /** * CallManager - Place a call * @param c The call to place */ -void dbus_place_call (const call_t * c); +void dbus_place_call (const callable_obj_t * c); /** @@ -120,7 +119,7 @@ void dbus_send_register( gchar* accountID , const guint expire ); * ConfigurationManager - Add an account to the list * @param a The account to add */ -guint dbus_add_account(account_t *a); +gchar* dbus_add_account(account_t *a); /** * ConfigurationManager - Remove an account from the list @@ -181,9 +180,9 @@ void dbus_set_active_codec_list( const gchar** list ); /** * CallManager - return the codec name - * @param call_t* current call + * @param callable_obj_t* current call */ -gchar* dbus_get_current_codec_name(const call_t * c); +gchar* dbus_get_current_codec_name(const callable_obj_t * c); /** * ConfigurationManager - Get the list of available input audio plugins @@ -342,15 +341,20 @@ int dbus_get_volume_controls( void ); void dbus_start_hidden( void ); /** - * ConfigurationManager - Gives the maximum number of calls the user wants to have in the history - * @return double The maximum number of calls + * ConfigurationManager - Gives the maximum number of days the user wants to have in the history + * @return double The maximum number of days */ -guint dbus_get_max_calls( void ); +guint dbus_get_history_limit( void ); /** - * ConfigurationManager - Gives the maximum number of calls the user wants to have in the history + * ConfigurationManager - Gives the maximum number of days the user wants to have in the history */ -void dbus_set_max_calls( const guint calls ); +void dbus_set_history_limit (const guint days); + +void dbus_set_history_enabled (void); + +int dbus_get_history_enabled (void); + /** * ConfigurationManager - Configure the start-up option * @return int 1 if SFLphone should start in the system tray @@ -443,7 +447,7 @@ void dbus_set_stun_server( gchar* server); gint dbus_stun_is_enabled (void); void dbus_enable_stun (void); -void dbus_set_record (const call_t * c); +void dbus_set_record (const callable_obj_t * c); void dbus_set_record_path (const gchar *path); gchar* dbus_get_record_path (void); @@ -477,10 +481,18 @@ GHashTable* dbus_get_hook_settings (void); void dbus_set_hook_settings (GHashTable *); -gboolean dbus_get_is_recording(const call_t *); +gboolean dbus_get_is_recording(const callable_obj_t *); GHashTable* dbus_get_call_details (const gchar* callID); +gchar** dbus_get_call_list (void); + void dbus_set_accounts_order (const gchar* order); +GHashTable* dbus_get_history (void); + +void dbus_set_history (GHashTable* entries); + +void sflphone_display_transfer_status (const gchar* message); + #endif diff --git a/sflphone-client-gnome/src/dbus/marshaller.list b/sflphone-client-gnome/src/dbus/marshaller.list index 1e1491713ab928c90d18a8c179e6be6b5fa1d9a3..587c7ce061fe83c9558e7641c5aa54d7a0ea5a89 100644 --- a/sflphone-client-gnome/src/dbus/marshaller.list +++ b/sflphone-client-gnome/src/dbus/marshaller.list @@ -3,3 +3,4 @@ VOID:STRING,STRING VOID:INT VOID:STRING,INT VOID:STRING,DOUBLE +VOID:STRING diff --git a/sflphone-client-gnome/src/errors.c b/sflphone-client-gnome/src/errors.c index fb4b4ae9355f40800558fef790ccaab4a4a6a8d2..d9f933ce78ef7a29dd343af5fe362788a419b024 100644 --- a/sflphone-client-gnome/src/errors.c +++ b/sflphone-client-gnome/src/errors.c @@ -18,6 +18,7 @@ */ #include <errors.h> +#include <sflphone_const.h> void sflphone_throw_exception( int err ) diff --git a/sflphone-client-gnome/src/errors.h b/sflphone-client-gnome/src/errors.h index f1176bc191cd5e0358cb75bd68f3cb2f6bc99fca..7c4eed2a0f0b9b5cd241768777444442d8729a92 100644 --- a/sflphone-client-gnome/src/errors.h +++ b/sflphone-client-gnome/src/errors.h @@ -26,7 +26,6 @@ #include <stdlib.h> -#include <sflphone_const.h> #include <mainwindow.h> /** diff --git a/sflphone-client-gnome/src/main.c b/sflphone-client-gnome/src/main.c index bedccadc0e93908ddb1f63f917e9e9391c806ae1..64ba26c23b26753b7a890ba55ed059bdc6f2d847 100644 --- a/sflphone-client-gnome/src/main.c +++ b/sflphone-client-gnome/src/main.c @@ -100,10 +100,16 @@ There is NO WARRANTY, to the extent permitted by law.\n\n"); } #endif - status_bar_display_account(); + status_bar_display_account(); - /* start the main loop */ - gtk_main(); + // Load the history + sflphone_fill_history (); + + // Get the active calls at startup + sflphone_fill_call_list (); + + /* start the main loop */ + gtk_main(); } // Cleanly stop logging diff --git a/sflphone-client-gnome/src/mainwindow.c b/sflphone-client-gnome/src/mainwindow.c index 1db50d7282e3881c999dc9c0207c794428097cda..9b987c66b1ac7652c90da6e7448fa70229fa72aa 100644 --- a/sflphone-client-gnome/src/mainwindow.c +++ b/sflphone-client-gnome/src/mainwindow.c @@ -21,8 +21,8 @@ #include <toolbar.h> #include <config.h> #include <actions.h> -#include <calltab.h> #include <calltree.h> +#include <calltab.h> #include <configwindow.h> #include <dialpad.h> #include <mainwindow.h> diff --git a/sflphone-client-gnome/src/menus.c b/sflphone-client-gnome/src/menus.c index bb2797cb8452ca023e37d42e43f9eff208ba448f..db443f2a523ac0b208115078f7789297c9dbf81a 100644 --- a/sflphone-client-gnome/src/menus.c +++ b/sflphone-client-gnome/src/menus.c @@ -58,11 +58,11 @@ void update_menus() gtk_widget_set_sensitive( GTK_WIDGET(recordMenu), FALSE); gtk_widget_set_sensitive( GTK_WIDGET(copyMenu), FALSE); - call_t * selectedCall = calltab_get_selected_call(active_calltree); + callable_obj_t * selectedCall = calltab_get_selected_call(active_calltree); if (selectedCall) { gtk_widget_set_sensitive( GTK_WIDGET(copyMenu), TRUE); - switch(selectedCall->state) + switch(selectedCall->_state) { case CALL_STATE_INCOMING: gtk_widget_set_sensitive( GTK_WIDGET(pickUpMenu), TRUE); @@ -211,11 +211,11 @@ switch_account( GtkWidget* item , gpointer data UNUSED) static void call_hold (void* foo UNUSED) { - call_t * selectedCall = calltab_get_selected_call(current_calls); + callable_obj_t * selectedCall = calltab_get_selected_call(current_calls); if(selectedCall) { - if(selectedCall->state == CALL_STATE_HOLD) + if(selectedCall->_state == CALL_STATE_HOLD) { gtk_image_menu_item_set_image( GTK_IMAGE_MENU_ITEM ( holdMenu ), gtk_image_new_from_file( ICONS_DIR "/icon_unhold.svg")); sflphone_off_hold(); @@ -257,7 +257,7 @@ call_wizard ( void * foo UNUSED) static void remove_from_history( void * foo UNUSED) { - call_t* c = calltab_get_selected_call( history ); + callable_obj_t* c = calltab_get_selected_call( history ); if(c){ DEBUG("Remove the call from the history"); calllist_remove_from_history( c ); @@ -267,17 +267,13 @@ remove_from_history( void * foo UNUSED) static void call_back( void * foo UNUSED) { - call_t *selected_call, *new_call; - gchar *to, *from; - + callable_obj_t *selected_call, *new_call; + selected_call = calltab_get_selected_call( active_calltree ); if( selected_call ) { - to = g_strdup(call_get_number(selected_call)); - from = g_strconcat("\"\" <", call_get_number(selected_call), ">",NULL); - - create_new_call (to, from, CALL_STATE_DIALING, "", &new_call); + create_new_call (CALL, CALL_STATE_DIALING, "", "", selected_call->_peer_name, selected_call->_peer_number, &new_call); calllist_add(current_calls, new_call); calltree_add_call(current_calls, new_call); @@ -296,7 +292,7 @@ create_call_menu() menu = gtk_menu_new (); - image = gtk_image_new_from_file( ICONS_DIR "/icon_call.svg"); + image = gtk_image_new_from_file( ICONS_DIR "/icon_dialpad.svg"); newCallMenu = gtk_image_menu_item_new_with_mnemonic(_("_New call")); gtk_image_menu_item_set_image( GTK_IMAGE_MENU_ITEM ( newCallMenu ), image ); gtk_menu_shell_append (GTK_MENU_SHELL (menu), newCallMenu); @@ -409,17 +405,17 @@ edit_accounts ( void * foo UNUSED) edit_copy ( void * foo UNUSED) { GtkClipboard* clip = gtk_clipboard_get(GDK_SELECTION_CLIPBOARD); - call_t * selectedCall = calltab_get_selected_call(current_calls); + callable_obj_t * selectedCall = calltab_get_selected_call(current_calls); gchar * no = NULL; if(selectedCall) { - switch(selectedCall->state) + switch(selectedCall->_state) { case CALL_STATE_TRANSFERT: case CALL_STATE_DIALING: case CALL_STATE_RINGING: - no = selectedCall->to; + no = selectedCall->_peer_number; break; case CALL_STATE_CURRENT: case CALL_STATE_HOLD: @@ -427,10 +423,10 @@ edit_copy ( void * foo UNUSED) case CALL_STATE_FAILURE: case CALL_STATE_INCOMING: default: - no = call_get_number(selectedCall); + no = selectedCall->_peer_number; break; } - + DEBUG("Clipboard number: %s\n", no); gtk_clipboard_set_text (clip, no, strlen(no) ); } @@ -441,26 +437,25 @@ edit_copy ( void * foo UNUSED) edit_paste ( void * foo UNUSED) { GtkClipboard* clip = gtk_clipboard_get(GDK_SELECTION_CLIPBOARD); - call_t * selectedCall = calltab_get_selected_call(current_calls); + callable_obj_t * selectedCall = calltab_get_selected_call(current_calls); gchar * no = gtk_clipboard_wait_for_text (clip); if(no && selectedCall) { - switch(selectedCall->state) + switch(selectedCall->_state) { case CALL_STATE_TRANSFERT: case CALL_STATE_DIALING: // Add the text to the number { - gchar * before = selectedCall->to; - selectedCall->to = g_strconcat(selectedCall->to, no, NULL); - g_free(before); - DEBUG("TO: %s", selectedCall->to); + gchar * before; + before = selectedCall->_peer_number; + DEBUG("TO: %s\n", before); + selectedCall->_peer_number = g_strconcat(before, no, NULL); - if(selectedCall->state == CALL_STATE_DIALING) + if(selectedCall->_state == CALL_STATE_DIALING) { - g_free(selectedCall->from); - selectedCall->from = g_strconcat("\"\" <", selectedCall->to, ">", NULL); + selectedCall->_peer_info = g_strconcat("\"\" <", selectedCall->_peer_number, ">", NULL); } calltree_update_call(current_calls, selectedCall); } @@ -473,13 +468,11 @@ edit_paste ( void * foo UNUSED) { // Create a new call to hold the new text selectedCall = sflphone_new_call(); - gchar * before = selectedCall->to; - selectedCall->to = g_strconcat(selectedCall->to, no, NULL); - g_free(before); - DEBUG("TO: %s", selectedCall->to); + gchar * before = selectedCall->_peer_number; + selectedCall->_peer_number = g_strconcat(selectedCall->_peer_number, no, NULL); + DEBUG("TO: %s", selectedCall->_peer_number); - g_free(selectedCall->from); - selectedCall->from = g_strconcat("\"\" <", selectedCall->to, ">", NULL); + selectedCall->_peer_info = g_strconcat("\"\" <", selectedCall->_peer_number, ">", NULL); calltree_update_call(current_calls, selectedCall); } @@ -494,11 +487,9 @@ edit_paste ( void * foo UNUSED) DEBUG("<%s>", oneNo); dbus_play_dtmf(oneNo); - gchar * temp = g_strconcat(call_get_number(selectedCall), oneNo, NULL); - gchar * before = selectedCall->from; - selectedCall->from = g_strconcat("\"",call_get_name(selectedCall) ,"\" <", temp, ">", NULL); - g_free(before); - g_free(temp); + gchar * temp = g_strconcat(selectedCall->_peer_number, oneNo, NULL); + selectedCall->_peer_info = get_peer_info (temp, selectedCall->_peer_name); + // g_free(temp); calltree_update_call(current_calls, selectedCall); } @@ -511,13 +502,13 @@ edit_paste ( void * foo UNUSED) { selectedCall = sflphone_new_call(); - gchar * before = selectedCall->to; - selectedCall->to = g_strconcat(selectedCall->to, no, NULL); + gchar * before = selectedCall->_peer_number; + selectedCall->_peer_number = g_strconcat(selectedCall->_peer_number, no, NULL); g_free(before); - DEBUG("TO: %s", selectedCall->to); + DEBUG("TO: %s", selectedCall->_peer_number); - g_free(selectedCall->from); - selectedCall->from = g_strconcat("\"\" <", selectedCall->to, ">", NULL); + g_free(selectedCall->_peer_info); + selectedCall->_peer_info = g_strconcat("\"\" <", selectedCall->_peer_number, ">", NULL); calltree_update_call(current_calls,selectedCall); } @@ -558,7 +549,7 @@ create_edit_menu() menu_items = gtk_separator_menu_item_new (); gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_items); - menu_items = gtk_image_menu_item_new_with_mnemonic(_("_Clear history")); + menu_items = gtk_image_menu_item_new_with_mnemonic(_("Clear _history")); image = gtk_image_new_from_stock( GTK_STOCK_CLEAR , GTK_ICON_SIZE_MENU ); gtk_image_menu_item_set_image( GTK_IMAGE_MENU_ITEM ( menu_items ), image ); gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_items); @@ -577,7 +568,7 @@ create_edit_menu() NULL); gtk_widget_show (menu_items); - menu_items = gtk_image_menu_item_new_from_stock( GTK_STOCK_PREFERENCES, get_accel_group()); + menu_items = gtk_image_menu_item_new_from_stock( GTK_STOCK_PREFERENCES, NULL); gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_items); g_signal_connect_swapped (G_OBJECT (menu_items), "activate", G_CALLBACK (edit_preferences), @@ -714,7 +705,7 @@ create_menus ( ) static void edit_number_cb (GtkWidget *widget UNUSED, gpointer user_data) { - show_edit_number ((call_t*)user_data); + show_edit_number ((callable_obj_t*)user_data); } @@ -726,11 +717,11 @@ show_popup_menu (GtkWidget *my_widget, GdkEventButton *event) gboolean pickup = FALSE, hangup = FALSE, hold = FALSE, copy = FALSE, record = FALSE; gboolean accounts = FALSE; - call_t * selectedCall = calltab_get_selected_call(current_calls); + callable_obj_t * selectedCall = calltab_get_selected_call(current_calls); if (selectedCall) { copy = TRUE; - switch(selectedCall->state) + switch(selectedCall->_state) { case CALL_STATE_INCOMING: pickup = TRUE; @@ -827,7 +818,7 @@ show_popup_menu (GtkWidget *my_widget, GdkEventButton *event) menu_items = gtk_check_menu_item_new_with_mnemonic (_("On _Hold")); gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_items); gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu_items), - (selectedCall->state == CALL_STATE_HOLD ? TRUE : FALSE)); + (selectedCall->_state == CALL_STATE_HOLD ? TRUE : FALSE)); g_signal_connect(G_OBJECT (menu_items), "activate", G_CALLBACK (call_hold), NULL); @@ -876,7 +867,7 @@ show_popup_menu_history(GtkWidget *my_widget, GdkEventButton *event) gboolean remove = FALSE; gboolean edit = FALSE; - call_t * selectedCall = calltab_get_selected_call( history ); + callable_obj_t * selectedCall = calltab_get_selected_call( history ); if (selectedCall) { remove = TRUE; @@ -948,7 +939,7 @@ show_popup_menu_contacts(GtkWidget *my_widget, GdkEventButton *event) gboolean accounts = FALSE; gboolean edit = FALSE; - call_t * selectedCall = calltab_get_selected_call( contacts ); + callable_obj_t * selectedCall = calltab_get_selected_call( contacts ); if (selectedCall) { pickup = TRUE; @@ -1020,7 +1011,7 @@ void add_registered_accounts_to_menu (GtkWidget *menu) { for( i = 0 ; i < account_list_get_size() ; i++ ){ acc = account_list_get_nth(i); // Display only the registered accounts - if( g_strcasecmp( account_state_name(acc -> state) , account_state_name(ACCOUNT_STATE_REGISTERED) ) == 0 ){ + if( g_strcasecmp( account_state_name(acc->state) , account_state_name(ACCOUNT_STATE_REGISTERED) ) == 0 ){ alias = g_strconcat( g_hash_table_lookup(acc->properties , ACCOUNT_ALIAS) , " - ",g_hash_table_lookup(acc->properties , ACCOUNT_TYPE), NULL); menu_items = gtk_check_menu_item_new_with_mnemonic(alias); gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_items); @@ -1042,18 +1033,15 @@ void add_registered_accounts_to_menu (GtkWidget *menu) { static void ok_cb (GtkWidget *widget UNUSED, gpointer userdata) { - gchar *new_number, *from; - call_t *modified_call, *original; + gchar *new_number; + callable_obj_t *modified_call, *original; // Change the number of the selected call before calling new_number = (gchar*) gtk_entry_get_text (GTK_ENTRY (editable_num)); - original = (call_t*)userdata; - - // Edit the from field with the updated phone number value - from = g_strconcat("\"", call_get_name (original), "\" <", new_number, ">",NULL); + original = (callable_obj_t*)userdata; // Create the new call - create_new_call (g_strdup (new_number), from, CALL_STATE_DIALING, g_strdup (original->accountID), &modified_call); + create_new_call (CALL, CALL_STATE_DIALING, "", g_strdup (original->_accountID), original->_peer_name, g_strdup (new_number), &modified_call); // Update the internal data structure and the GUI calllist_add(current_calls, modified_call); @@ -1070,7 +1058,7 @@ static void on_delete (GtkWidget * widget) gtk_widget_destroy (widget); } -void show_edit_number (call_t *call) { +void show_edit_number (callable_obj_t *call) { GtkWidget *ok, *hbox, *image; GdkPixbuf *pixbuf; @@ -1093,7 +1081,7 @@ void show_edit_number (call_t *call) { gtk_widget_set_tooltip_text(GTK_WIDGET(editable_num), _("Edit the phone number before making a call")); #endif if (call) - gtk_entry_set_text(GTK_ENTRY(editable_num), g_strdup (call_get_number (call))); + gtk_entry_set_text(GTK_ENTRY(editable_num), g_strdup (call->_peer_number)); else ERROR ("This a bug, the call should be defined. menus.c line 1051"); diff --git a/sflphone-client-gnome/src/menus.h b/sflphone-client-gnome/src/menus.h index 125bd1a298c6270a43720706f058ba3b52eb37bd..b74c75249b9e5092384557e147c7573050d86fe9 100644 --- a/sflphone-client-gnome/src/menus.h +++ b/sflphone-client-gnome/src/menus.h @@ -21,7 +21,7 @@ #define __MENUS_H__ #include <gtk/gtk.h> -#include <call.h> +#include <callable_obj.h> /** @file menus.h * @brief The menus of the main window. */ @@ -55,5 +55,5 @@ void show_popup_menu_contacts (GtkWidget *my_widget, GdkEventButton *event); void add_registered_accounts_to_menu (GtkWidget *menu); -void show_edit_number (call_t *call); +void show_edit_number (callable_obj_t *call); #endif diff --git a/sflphone-client-gnome/src/sflnotify.c b/sflphone-client-gnome/src/sflnotify.c index 882aeb5407b90c4e21a05c3d444872204f5912a7..48e568fe49dc5704e00d3dbc5423d1c488c7439f 100644 --- a/sflphone-client-gnome/src/sflnotify.c +++ b/sflphone-client-gnome/src/sflnotify.c @@ -58,21 +58,21 @@ void create_new_gnome_notification (gchar *title, gchar *body, NotifyUrgency urg void -notify_incoming_call (call_t* c) +notify_incoming_call (callable_obj_t* c) { gchar* callerid; gchar* title; - if (g_strcasecmp (c->accountID,"") == 0) { + if (g_strcasecmp (c->_accountID,"") == 0) { title = g_markup_printf_escaped ("IP-to-IP call"); } else { title = g_markup_printf_escaped(_("%s account: %s") , - (gchar*)g_hash_table_lookup(account_list_get_by_id(c->accountID)->properties , ACCOUNT_TYPE) , - (gchar*)g_hash_table_lookup(account_list_get_by_id(c->accountID)->properties , ACCOUNT_ALIAS) ) ; + (gchar*)g_hash_table_lookup(account_list_get_by_id(c->_accountID)->properties , ACCOUNT_TYPE) , + (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); + callerid = g_markup_printf_escaped(_("<i>From:</i> %s") , c->_peer_number); create_new_gnome_notification (title, callerid, @@ -177,6 +177,5 @@ void free_notification (GnomeNotification *g) { g_free(g->title); g_free(g->body); - g_free(g->notification); g_free(g); } diff --git a/sflphone-client-gnome/src/sflnotify.h b/sflphone-client-gnome/src/sflnotify.h index 1f0fdff962ba1c3b8028a036d79ca90a5cc3cdf9..5dd74b03ae7740c6c8dede65e58e1980b9028a8c 100644 --- a/sflphone-client-gnome/src/sflnotify.h +++ b/sflphone-client-gnome/src/sflnotify.h @@ -49,7 +49,7 @@ void free_notification (GnomeNotification *g); * A dialog box is attached to the status icon * @param c The incoming call */ -void notify_incoming_call( call_t* c); +void notify_incoming_call( callable_obj_t* c); /** * Notify voice mails count diff --git a/sflphone-client-gnome/src/sflphone_const.h b/sflphone-client-gnome/src/sflphone_const.h index 9ae9bbb696a50aa3a6b8207c7f5a8f30ab0dd8e3..f576ea22a2f459e2802ef330f8d5a91b47faa7cc 100644 --- a/sflphone-client-gnome/src/sflphone_const.h +++ b/sflphone-client-gnome/src/sflphone_const.h @@ -31,6 +31,10 @@ #define LOGO ICONS_DIR "/sflphone.svg" #define LOGO_SMALL ICONS_DIR "/sflphone_small.svg" +#define CURRENT_CALLS "current_calls" +#define HISTORY "history" +#define CONTACTS "contacts" + /** Locale */ #define _(STRING) gettext( STRING ) diff --git a/sflphone-client-gnome/src/timestamp.c b/sflphone-client-gnome/src/timestamp.c deleted file mode 100644 index ba364ee5dffcec60d7e9b1e28889db483d0c2976..0000000000000000000000000000000000000000 --- a/sflphone-client-gnome/src/timestamp.c +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (C) 2008 Savoir-Faire Linux inc. - * Author: Emmanuel Milou <emmanuel.milou@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 - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#include <timestamp.h> - - - gchar* -timestamp_get_call_date( void ) -{ - struct tm* ptr; - time_t lt; - unsigned char str[100]; - - time(<); - ptr = gmtime(<); - - // result function of the current locale - strftime((char *)str, 100, "%c", - (const struct tm *)ptr); - return g_markup_printf_escaped("\n%s\n" , str); -} - - gchar* -process_call_duration( call_t* c ) -{ - gchar * res; - DEBUG("Start = %i - Stop = %i - Call duration = %i", (int)c->_start , (int)c->_stop , (int)(c->_stop - c->_start)); - - if( c->history_state == MISSED && c->_stop == 0 ) - return g_markup_printf_escaped(_("<small>Missed call</small>")); - - int duration = c->_stop - c->_start; - - if( duration / 60 == 0 ) - { - if( duration < 10 ) - res = g_markup_printf_escaped("00:0%i", duration); - else - res = g_markup_printf_escaped("00:%i", duration); - } - else - { - if( duration%60 < 10 ) - res = g_markup_printf_escaped("%i:0%i" , duration/60 , duration%60); - else - res = g_markup_printf_escaped("%i:%i" , duration/60 , duration%60); - } - return g_markup_printf_escaped(_("<small>Duration:</small> %s"), res); -} - diff --git a/sflphone-client-gnome/src/timestamp.h b/sflphone-client-gnome/src/timestamp.h deleted file mode 100644 index 20e7a4a6242bc4d758ba29e728c82872653655db..0000000000000000000000000000000000000000 --- a/sflphone-client-gnome/src/timestamp.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (C) 2008 Savoir-Faire Linux inc. - * Author: Emmanuel Milou <emmanuel.milou@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 - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - - -#ifndef __TIMESTAMP_H__ -#define __TIMESTAMP_H__ - -/** @file timestamp.h - * @brief Introduces time notion in SFLphone, like call duration, call time, etc... - * Useful for the history - */ - -#include <time.h> -#include <gtk/gtk.h> - -#include <calllist.h> -#include <sflphone_const.h> - -gchar* timestamp_get_call_date( void ); - -gchar* process_call_duration( call_t* c ); - -#endif diff --git a/sflphone-client-gnome/src/toolbar.c b/sflphone-client-gnome/src/toolbar.c index 68ed11fce3223fcf4b8dc9a8320be40f05f108bf..7b9f52b78fc9727e8dd91944f1eab6941c135e72 100644 --- a/sflphone-client-gnome/src/toolbar.c +++ b/sflphone-client-gnome/src/toolbar.c @@ -39,7 +39,7 @@ rec_button( GtkWidget *widget UNUSED, gpointer data UNUSED) call_mailbox( GtkWidget* widget UNUSED, gpointer data UNUSED) { account_t* current; - call_t *mailbox_call; + callable_obj_t *mailbox_call; gchar *to, *from, *account_id; current = account_list_get_current (); @@ -50,8 +50,8 @@ call_mailbox( GtkWidget* widget UNUSED, gpointer data UNUSED) from = g_markup_printf_escaped(_("\"Voicemail\" <%s>"), to); account_id = g_strdup (current->accountID); - create_new_call (to, from, CALL_STATE_DIALING, account_id, &mailbox_call); - DEBUG("TO : %s" , mailbox_call->to); + create_new_call (CALL, CALL_STATE_DIALING, "", account_id, "Voicemail", to, &mailbox_call); + DEBUG("TO : %s" , mailbox_call->_peer_number); calllist_add( current_calls , mailbox_call ); calltree_add_call( current_calls , mailbox_call ); update_menus(); @@ -66,9 +66,8 @@ call_mailbox( GtkWidget* widget UNUSED, gpointer data UNUSED) call_button( GtkWidget *widget UNUSED, gpointer data UNUSED) { DEBUG("------ call_button -----"); - call_t * selectedCall; - call_t* new_call; - gchar *to, *from; + callable_obj_t * selectedCall; + callable_obj_t* new_call; selectedCall = calltab_get_selected_call(active_calltree); @@ -78,14 +77,7 @@ call_button( GtkWidget *widget UNUSED, gpointer data UNUSED) else if(calllist_get_size(active_calltree) > 0){ if( selectedCall) { - DEBUG("Calling a called num"); - - to = g_strdup(call_get_number(selectedCall)); - from = g_strconcat("\"\" <", call_get_number(selectedCall), ">",NULL); - - create_new_call (to, from, CALL_STATE_DIALING, "", &new_call); - - DEBUG("call : from : %s to %s", new_call->from, new_call->to); + create_new_call (CALL, CALL_STATE_DIALING, "", "", "", selectedCall->_peer_number, &new_call); calllist_add(current_calls, new_call); calltree_add_call(current_calls, new_call); @@ -172,7 +164,7 @@ GtkWidget *create_toolbar () gtk_toolbar_set_orientation(GTK_TOOLBAR(ret), GTK_ORIENTATION_HORIZONTAL); gtk_toolbar_set_style(GTK_TOOLBAR(ret), GTK_TOOLBAR_ICONS); - image = gtk_image_new_from_file( ICONS_DIR "/call.svg"); + image = gtk_image_new_from_file( ICONS_DIR "/dial.svg"); callButton = gtk_tool_button_new (image, _("Place a call")); #if GTK_CHECK_VERSION(2,12,0) gtk_widget_set_tooltip_text(GTK_WIDGET(callButton), _("Place a call")); @@ -316,10 +308,10 @@ toolbar_update_buttons () gtk_toggle_tool_button_set_active(GTK_TOGGLE_TOOL_BUTTON(transfertButton), FALSE); gtk_signal_handler_unblock(transfertButton, transfertButtonConnId); - call_t * selectedCall = calltab_get_selected_call(active_calltree); + callable_obj_t * selectedCall = calltab_get_selected_call(active_calltree); if (selectedCall) { - switch(selectedCall->state) + switch(selectedCall->_state) { case CALL_STATE_INCOMING: gtk_widget_set_sensitive( GTK_WIDGET(pickupButton), TRUE); diff --git a/sflphone-client-gnome/src/toolbar.h b/sflphone-client-gnome/src/toolbar.h index bddeb2cb7dee1a0b44ed6b3d0c1c08f7f875203d..5af6e834e9de2cbac201408566cb3eaa0ecb0fcf 100644 --- a/sflphone-client-gnome/src/toolbar.h +++ b/sflphone-client-gnome/src/toolbar.h @@ -20,10 +20,11 @@ #ifndef __TOOLBAR_H__ #define __TOOLBAR_H__ -#include <call.h> +#include <callable_obj.h> #include <gtk/gtk.h> #include <menus.h> #include <sflphone_const.h> +#include <actions.h> GtkWidget * toolbar; GtkToolItem * pickupButton; diff --git a/sflphone-client-kde/CMakeLists.txt b/sflphone-client-kde/CMakeLists.txt index 2b41f54214fc01961621d8b916ba31280ab210da..aaa0aebe205ab8407ccfb3d3dea6ad151692a155 100644 --- a/sflphone-client-kde/CMakeLists.txt +++ b/sflphone-client-kde/CMakeLists.txt @@ -17,7 +17,7 @@ INCLUDE ( KDE4Defaults ) MESSAGE("cmake install prefix is : ${CMAKE_INSTALL_PREFIX}") -INCLUDE_DIRECTORIES ( ${KDE4_INCLUDES} ${QT_INCLUDES} ) +INCLUDE_DIRECTORIES ( ${KDE4_INCLUDES} ${QT_INCLUDES} ${CMAKE_CURRENT_BINARY_DIR}) INCLUDE ( ${CMAKE_ROOT}/Modules/CheckIncludeFiles.cmake ) INCLUDE( ${QT_USE_FILE} ) @@ -27,5 +27,6 @@ add_subdirectory(src) add_subdirectory(doc) add_subdirectory(man) add_subdirectory(data) +add_subdirectory(po) diff --git a/sflphone-client-kde/INSTALL b/sflphone-client-kde/INSTALL index c3ff7117560cc3dfc0ebfcac9372724969446242..d53870cafa091920ece773c92156d91055e61b35 100644 --- a/sflphone-client-kde/INSTALL +++ b/sflphone-client-kde/INSTALL @@ -50,6 +50,13 @@ Options You can change the prefix of the installation using: - .config.sh -DCMAKE_INSTALL_PREFIX="expected_prefix_directory" + .config.sh --prefix="expected_prefix_directory" + +By default, it is set to /usr/local. + +****************************************************** + +You can enable debug messages using: + + .config.sh --with-debug -By default, it is set to /usr. \ No newline at end of file diff --git a/sflphone-client-kde/cmake/TargetDistclean.cmake b/sflphone-client-kde/cmake/TargetDistclean.cmake index 8fdf46feeeec3fdd99189acb1086128a6afe28c2..eeb8861e42aa2eba1d5b17b3abff7776cbcd161d 100644 --- a/sflphone-client-kde/cmake/TargetDistclean.cmake +++ b/sflphone-client-kde/cmake/TargetDistclean.cmake @@ -46,6 +46,10 @@ IF (UNIX) data/*.cmake data/Makefile data/CMakeFiles + data/icons/*.cmake + data/icons/*.make + data/icons/Makefile + data/icons/CMakeFiles src/*.cmake src/Makefile src/CMakeFiles @@ -59,6 +63,12 @@ IF (UNIX) src/*_automoc.cpp src/sflphone-client-kde src/sflphone-client-kde.shell + src/*.moc + src/kcfg_*.cpp + src/kcfg_*.h + po/*.cmake + po/Makefile + po/CMakeFiles ) SET(DISTCLEANED_REC @@ -71,7 +81,17 @@ IF (UNIX) DEPENDS clean COMMENT "distribution clean" COMMAND rm - ARGS -Rf CMakeTmp CMakeFiles ${DISTCLEANED} + ARGS -Rf CMakeTmp CMakeFiles ${DISTCLEANED} `find ./po -maxdepth 2 -name 'Makefile'` `find ./po -maxdepth 2 -name 'CMakeFiles'` `find ./po -maxdepth 2 -name '*.gmo'` `find ./po -maxdepth 2 -name '*.cmake'` +# COMMAND find +# ARGS "./po ( -name 'Makefile' -o -name 'CMakeFiles' -o -name '*.gmo' -o -name '*.cmake' ) -maxdepth 2 -exec rm -rf {} \;" +# COMMAND rm +# ARGS -Rf `find ./po -maxdepth 2 -name 'Makefile'` +# COMMAND find +# ARGS ./po -maxdepth 2 -name 'CMakeFiles' -exec rm -rf {} \; +# COMMAND find +# ARGS ./po -maxdepth 2 -name '*.gmo' -exec rm -rf {} \; +# COMMAND find +# ARGS ./po -maxdepth 2 -name '*.cmake' -exec rm -rf {} \; # COMMAND find # ARGS ". \( -name 'Makefile' -o -name 'CMakeFiles' \) -exec rm -rf {} \;" TARGET distclean diff --git a/sflphone-client-kde/config.sh b/sflphone-client-kde/config.sh index 931c28bc5e15f6222cbceb638bcdbc6357ca29ac..8c37d45a0da5d06c46f9ac0533dd5428a5a269ad 100755 --- a/sflphone-client-kde/config.sh +++ b/sflphone-client-kde/config.sh @@ -15,12 +15,29 @@ fi cd build -autocmd cmake $@ .. +# prefix=`echo $@ | grep -q "--prefix="` +# +# if $prefix +# then options=$@" -DCMAKE_INSTALL_PREFIX="$prefix_env + +# debug=`echo $@ | grep -q "debug"` + +options=`echo $@ | sed "s/--prefix=/-DCMAKE_INSTALL_PREFIX=/g" | sed "s/--with-debug//g"` + +if `echo $@ | grep -q "\--with-debug"` +then echo "Enable debug messages" +options="$options -DCMAKE_BUILD_TYPE=Debug" +else echo "Disable debug messages" +options="$options -DCMAKE_BUILD_TYPE=Release" +fi + +echo "Passing argument '$options' to cmake" + +autocmd cmake $options .. -echo $@ echo "**********************************************" echo "Configuration done!" -echo "Run \`cd build\' to go to the build directory." -echo "Then run \`make\'to build the software." +echo "Run \`cd build' to go to the build directory." +echo "Then run \`make'to build the software." echo "**********************************************" diff --git a/sflphone-client-kde/data/CMakeLists.txt b/sflphone-client-kde/data/CMakeLists.txt index c7fb198d7e1bface2b84ab5c33074c2bf52a3af3..99e05c78c1279021a50ae6f5353146244484aa83 100644 --- a/sflphone-client-kde/data/CMakeLists.txt +++ b/sflphone-client-kde/data/CMakeLists.txt @@ -1,4 +1,6 @@ +add_subdirectory(icons) + INSTALL( FILES sflphone-client-kde.desktop DESTINATION ${XDG_APPS_INSTALL_DIR} ) INSTALL( FILES sflphone-client-kdeui.rc DESTINATION ${DATA_INSTALL_DIR}/sflphone-client-kde ) diff --git a/sflphone-client-kde/data/icons/CMakeLists.txt b/sflphone-client-kde/data/icons/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..106884f432c1d1e0b0584959af854c79ede4ea6d --- /dev/null +++ b/sflphone-client-kde/data/icons/CMakeLists.txt @@ -0,0 +1 @@ +kde4_install_icons( ${ICON_INSTALL_DIR} ) diff --git a/sflphone-client-kde/data/icons/hi128-apps-sflphone-client-kde.png b/sflphone-client-kde/data/icons/hi128-apps-sflphone-client-kde.png new file mode 100644 index 0000000000000000000000000000000000000000..0766c5015c37940a5bbb5a98373dde11b6fd3684 Binary files /dev/null and b/sflphone-client-kde/data/icons/hi128-apps-sflphone-client-kde.png differ diff --git a/sflphone-client-kde/data/icons/hi16-apps-sflphone-client-kde.png b/sflphone-client-kde/data/icons/hi16-apps-sflphone-client-kde.png new file mode 100644 index 0000000000000000000000000000000000000000..a11d421fcee468f74620fab0855c9d0308be40e6 Binary files /dev/null and b/sflphone-client-kde/data/icons/hi16-apps-sflphone-client-kde.png differ diff --git a/sflphone-client-kde/data/icons/hi22-apps-sflphone-client-kde.png b/sflphone-client-kde/data/icons/hi22-apps-sflphone-client-kde.png new file mode 100644 index 0000000000000000000000000000000000000000..2000c5fe0e6eeac4fa1414ebf55ad6159e89f3a1 Binary files /dev/null and b/sflphone-client-kde/data/icons/hi22-apps-sflphone-client-kde.png differ diff --git a/sflphone-client-kde/data/icons/hi32-apps-sflphone-client-kde.png b/sflphone-client-kde/data/icons/hi32-apps-sflphone-client-kde.png new file mode 100644 index 0000000000000000000000000000000000000000..611b982155f5e83662fa5404d1473dbfa9cd8d4a Binary files /dev/null and b/sflphone-client-kde/data/icons/hi32-apps-sflphone-client-kde.png differ diff --git a/sflphone-client-kde/data/icons/hi48-apps-sflphone-client-kde.png b/sflphone-client-kde/data/icons/hi48-apps-sflphone-client-kde.png new file mode 100644 index 0000000000000000000000000000000000000000..c643513125209fa828c79b9e8d30d34558aff8c0 Binary files /dev/null and b/sflphone-client-kde/data/icons/hi48-apps-sflphone-client-kde.png differ diff --git a/sflphone-client-kde/data/icons/hi64-apps-sflphone-client-kde.png b/sflphone-client-kde/data/icons/hi64-apps-sflphone-client-kde.png new file mode 100644 index 0000000000000000000000000000000000000000..9ffd3ca53c30493b08dc80fcfbd879ec7e4fa8f0 Binary files /dev/null and b/sflphone-client-kde/data/icons/hi64-apps-sflphone-client-kde.png differ diff --git a/sflphone-client-kde/data/icons/hisc-apps-sflphone-client-kde.svgz b/sflphone-client-kde/data/icons/hisc-apps-sflphone-client-kde.svgz new file mode 100644 index 0000000000000000000000000000000000000000..53105ea7c77c3ad52bd9f04e508febbd9f50a464 Binary files /dev/null and b/sflphone-client-kde/data/icons/hisc-apps-sflphone-client-kde.svgz differ diff --git a/sflphone-client-kde/data/icons/small/hi16-apps-sflphone-client-kde.svgz b/sflphone-client-kde/data/icons/small/hi16-apps-sflphone-client-kde.svgz new file mode 100644 index 0000000000000000000000000000000000000000..cb77652079d1223c0043b797d4ff391047f0c032 Binary files /dev/null and b/sflphone-client-kde/data/icons/small/hi16-apps-sflphone-client-kde.svgz differ diff --git a/sflphone-client-kde/data/icons/small/hi32-apps-sflphone-client-kde.svg b/sflphone-client-kde/data/icons/small/hi32-apps-sflphone-client-kde.svg new file mode 100644 index 0000000000000000000000000000000000000000..6a20cae05ad29065321ee5c4727c027468f64c1b --- /dev/null +++ b/sflphone-client-kde/data/icons/small/hi32-apps-sflphone-client-kde.svg @@ -0,0 +1,781 @@ +<?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="16" + height="16" + id="svg2" + sodipodi:version="0.32" + inkscape:version="0.46" + version="1.0" + sodipodi:docbase="/home/david/oxygen/trunk/scalable/apps/small/16x16" + sodipodi:docname="hi32-apps-sflphone-client-kde.svg" + inkscape:output_extension="org.inkscape.output.svg.inkscape" + inkscape:export-filename="/home/david/graphics-document-viewer.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90"> + <defs + id="defs4"> + <linearGradient + inkscape:collect="always" + id="linearGradient4999"> + <stop + style="stop-color:#ffffff;stop-opacity:1;" + offset="0" + id="stop5001" /> + <stop + style="stop-color:#ffffff;stop-opacity:0;" + offset="1" + id="stop5003" /> + </linearGradient> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient4999" + id="linearGradient5299" + gradientUnits="userSpaceOnUse" + x1="698.38525" + y1="245.5472" + x2="702.81964" + y2="977.78302" /> + <linearGradient + inkscape:collect="always" + id="linearGradient4991"> + <stop + style="stop-color:#ffffff;stop-opacity:1;" + offset="0" + id="stop4993" /> + <stop + style="stop-color:#ffffff;stop-opacity:0;" + offset="1" + id="stop4995" /> + </linearGradient> + <radialGradient + inkscape:collect="always" + xlink:href="#linearGradient4991" + id="radialGradient5297" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(1,0,0,0.8097086,0,99.14184)" + cx="736.5" + cy="640.93073" + fx="736.5" + fy="640.93073" + r="91.964203" /> + <linearGradient + inkscape:collect="always" + id="linearGradient4684"> + <stop + style="stop-color:#ffffff;stop-opacity:1;" + offset="0" + id="stop4686" /> + <stop + style="stop-color:#ffffff;stop-opacity:0;" + offset="1" + id="stop4688" /> + </linearGradient> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient4684" + id="linearGradient5308" + gradientUnits="userSpaceOnUse" + x1="52.987782" + y1="-84.148399" + x2="127.02813" + y2="99.500687" + gradientTransform="matrix(0.173669,0,0,0.174326,5.746764e-4,-16.089201)" /> + <linearGradient + inkscape:collect="always" + id="linearGradient3803"> + <stop + style="stop-color:#ffffff;stop-opacity:1;" + offset="0" + id="stop3805" /> + <stop + style="stop-color:#ffffff;stop-opacity:0;" + offset="1" + id="stop3807" /> + </linearGradient> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3803" + id="linearGradient3809" + x1="12.663443" + y1="8.5301828" + x2="41.858654" + y2="57.533279" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(0.2705584,0,0,0.2715818,-0.2334952,-16.324153)" /> + <inkscape:perspective + sodipodi:type="inkscape:persp3d" + inkscape:vp_x="0 : 8 : 1" + inkscape:vp_y="0 : 1000 : 0" + inkscape:vp_z="16 : 8 : 1" + inkscape:persp3d-origin="8 : 5.3333333 : 1" + id="perspective2966" /> + <linearGradient + inkscape:collect="always" + id="linearGradient3491"> + <stop + style="stop-color:#000000;stop-opacity:1;" + offset="0" + id="stop3493" /> + <stop + style="stop-color:#000000;stop-opacity:0;" + offset="1" + id="stop3495" /> + </linearGradient> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3491" + id="linearGradient3497" + x1="9.4819469" + y1="-13.32653" + x2="10.666382" + y2="-14.316705" + gradientUnits="userSpaceOnUse" /> + <linearGradient + y2="723.96979" + x2="-2309.3169" + y1="122.62138" + x1="-2325.3611" + gradientUnits="userSpaceOnUse" + id="linearGradient7282" + xlink:href="#linearGradient3794" + inkscape:collect="always" /> + <linearGradient + y2="344.25839" + x2="-2305.0696" + y1="275.5253" + x1="-2282.2617" + gradientUnits="userSpaceOnUse" + id="linearGradient7280" + xlink:href="#linearGradient3794" + inkscape:collect="always" /> + <linearGradient + y2="-39.337055" + x2="-2266.7681" + y1="568.77667" + x1="-2266.7681" + gradientUnits="userSpaceOnUse" + id="linearGradient7278" + xlink:href="#linearGradient2948" + inkscape:collect="always" /> + <linearGradient + y2="-39.337055" + x2="-2266.7681" + y1="568.77667" + x1="-2266.7681" + gradientUnits="userSpaceOnUse" + id="linearGradient7276" + xlink:href="#linearGradient2948" + inkscape:collect="always" /> + <linearGradient + y2="428.47058" + x2="-2255.8958" + y1="169.81215" + x1="-2255.8958" + gradientUnits="userSpaceOnUse" + id="linearGradient7274" + xlink:href="#linearGradient2948" + inkscape:collect="always" /> + <linearGradient + y2="323.11444" + x2="-2255.8958" + y1="169.81215" + x1="-2255.8958" + gradientUnits="userSpaceOnUse" + id="linearGradient7272" + xlink:href="#linearGradient2948" + inkscape:collect="always" /> + <linearGradient + y2="723.96979" + x2="-2309.3169" + y1="122.62138" + x1="-2325.3611" + gradientUnits="userSpaceOnUse" + id="linearGradient7270" + xlink:href="#linearGradient3794" + inkscape:collect="always" /> + <linearGradient + y2="344.25839" + x2="-2305.0696" + y1="275.5253" + x1="-2282.2617" + gradientUnits="userSpaceOnUse" + id="linearGradient7268" + xlink:href="#linearGradient3794" + inkscape:collect="always" /> + <linearGradient + y2="-39.337055" + x2="-2266.7681" + y1="568.77667" + x1="-2266.7681" + gradientUnits="userSpaceOnUse" + id="linearGradient7266" + xlink:href="#linearGradient2948" + inkscape:collect="always" /> + <linearGradient + y2="-39.337055" + x2="-2266.7681" + y1="568.77667" + x1="-2266.7681" + gradientUnits="userSpaceOnUse" + id="linearGradient7264" + xlink:href="#linearGradient2948" + inkscape:collect="always" /> + <linearGradient + y2="428.47058" + x2="-2255.8958" + y1="169.81215" + x1="-2255.8958" + gradientUnits="userSpaceOnUse" + id="linearGradient7262" + xlink:href="#linearGradient2948" + inkscape:collect="always" /> + <linearGradient + y2="323.11444" + x2="-2255.8958" + y1="169.81215" + x1="-2255.8958" + gradientUnits="userSpaceOnUse" + id="linearGradient7260" + xlink:href="#linearGradient2948" + inkscape:collect="always" /> + <linearGradient + y2="924.16333" + x2="-4511.1455" + y1="890.18469" + x1="-1898.5033" + gradientUnits="userSpaceOnUse" + id="linearGradient7258" + xlink:href="#linearGradient3091" + inkscape:collect="always" /> + <linearGradient + y2="1340.8041" + x2="-2050.8284" + y1="515.37079" + x1="-3230.7649" + gradientUnits="userSpaceOnUse" + id="linearGradient7256" + xlink:href="#linearGradient3091" + inkscape:collect="always" /> + <linearGradient + id="linearGradient5934"> + <stop + style="stop-color:#18689a;stop-opacity:1;" + offset="0" + id="stop5936" /> + <stop + style="stop-color:#3ba1e1;stop-opacity:1;" + offset="1" + id="stop5938" /> + </linearGradient> + <linearGradient + id="linearGradient2870"> + <stop + id="stop2872" + offset="0" + style="stop-color:#e2e2e2;stop-opacity:1;" /> + <stop + id="stop2874" + offset="1" + style="stop-color:#212121;stop-opacity:1;" /> + </linearGradient> + <linearGradient + id="linearGradient2886"> + <stop + style="stop-color:#ffffff;stop-opacity:1;" + offset="0" + id="stop2888" /> + <stop + id="stop3000" + offset="0.69" + style="stop-color:#c0c0c0;stop-opacity:1;" /> + <stop + style="stop-color:#d8d8d8;stop-opacity:1;" + offset="1" + id="stop2890" /> + </linearGradient> + <linearGradient + id="linearGradient2948" + inkscape:collect="always"> + <stop + id="stop2950" + offset="0" + style="stop-color:#000000;stop-opacity:1;" /> + <stop + id="stop2952" + offset="1" + style="stop-color:#000000;stop-opacity:0;" /> + </linearGradient> + <linearGradient + id="linearGradient3091" + inkscape:collect="always"> + <stop + id="stop3093" + offset="0" + style="stop-color:#fefefe;stop-opacity:1;" /> + <stop + id="stop3095" + offset="1" + style="stop-color:#fefefe;stop-opacity:0;" /> + </linearGradient> + <linearGradient + id="linearGradient3137"> + <stop + id="stop3139" + offset="0" + style="stop-color:#fefefe;stop-opacity:1;" /> + <stop + id="stop3141" + offset="1" + style="stop-color:#a2a2a2;stop-opacity:1;" /> + </linearGradient> + <linearGradient + id="linearGradient3794" + inkscape:collect="always"> + <stop + id="stop3796" + offset="0" + style="stop-color:#000000;stop-opacity:1;" /> + <stop + id="stop3798" + offset="1" + style="stop-color:#000000;stop-opacity:0;" /> + </linearGradient> + <linearGradient + id="linearGradient4162"> + <stop + id="stop4164" + offset="0" + style="stop-color:#000000;stop-opacity:0.28;" /> + <stop + id="stop4166" + offset="1" + style="stop-color:#000000;stop-opacity:0;" /> + </linearGradient> + <linearGradient + id="linearGradient4534" + inkscape:collect="always"> + <stop + id="stop4536" + offset="0" + style="stop-color:#ffffff;stop-opacity:1;" /> + <stop + id="stop4538" + offset="1" + style="stop-color:#ffffff;stop-opacity:0;" /> + </linearGradient> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient4162" + id="linearGradient2814" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(1.0833333,0,0,1.2956349,1053.8042,-153.14233)" + x1="-2180.8767" + y1="-260.6424" + x2="-1234.0055" + y2="686.2287" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3091" + id="linearGradient2816" + gradientUnits="userSpaceOnUse" + x1="-3230.7649" + y1="515.37079" + x2="-2050.8284" + y2="1340.8041" /> + <radialGradient + inkscape:collect="always" + xlink:href="#linearGradient2886" + id="radialGradient2818" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(1,5.4112362e-7,-2.012705e-7,0.3719492,6.6810889e-5,208.48054)" + cx="-1732.9094" + cy="331.94702" + fx="-1732.9094" + fy="331.94702" + r="143.2121" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3137" + id="linearGradient2820" + gradientUnits="userSpaceOnUse" + x1="-1893.7939" + y1="331.26584" + x2="-1876.7727" + y2="350.78738" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3091" + id="linearGradient2822" + gradientUnits="userSpaceOnUse" + x1="-1898.5033" + y1="890.18469" + x2="-4511.1455" + y2="924.16333" /> + <radialGradient + inkscape:collect="always" + xlink:href="#linearGradient2886" + id="radialGradient2824" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(1,0,0,0.5862344,0,152.49099)" + spreadMethod="reflect" + cx="-1629.0024" + cy="98.046616" + fx="-1629.0024" + fy="98.046616" + r="341.55664" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient2948" + id="linearGradient2826" + gradientUnits="userSpaceOnUse" + x1="-2255.8958" + y1="169.81215" + x2="-2255.8958" + y2="323.11444" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient2948" + id="linearGradient2828" + gradientUnits="userSpaceOnUse" + x1="-2255.8958" + y1="169.81215" + x2="-2255.8958" + y2="428.47058" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient2948" + id="linearGradient2830" + gradientUnits="userSpaceOnUse" + x1="-2266.7681" + y1="568.77667" + x2="-2266.7681" + y2="-39.337055" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient2948" + id="linearGradient2832" + gradientUnits="userSpaceOnUse" + x1="-2266.7681" + y1="568.77667" + x2="-2266.7681" + y2="-39.337055" /> + <radialGradient + inkscape:collect="always" + xlink:href="#linearGradient2886" + id="radialGradient2834" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(1,2.6562553e-7,-2.2224032e-6,8.3666767,7.0294537e-4,-2330.077)" + cx="-1915.2924" + cy="316.29968" + fx="-1915.2924" + fy="316.29968" + r="43.099361" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3794" + id="linearGradient2836" + gradientUnits="userSpaceOnUse" + x1="-2282.2617" + y1="275.5253" + x2="-2305.0696" + y2="344.25839" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3794" + id="linearGradient2838" + gradientUnits="userSpaceOnUse" + x1="-2325.3611" + y1="122.62138" + x2="-2309.3169" + y2="723.96979" /> + <radialGradient + inkscape:collect="always" + xlink:href="#linearGradient2886" + id="radialGradient2840" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(1,5.4112362e-7,-2.012705e-7,0.3719492,6.6810889e-5,208.48054)" + cx="-1732.9094" + cy="331.94702" + fx="-1732.9094" + fy="331.94702" + r="143.2121" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3137" + id="linearGradient2842" + gradientUnits="userSpaceOnUse" + x1="-1893.7939" + y1="331.26584" + x2="-1876.7727" + y2="350.78738" /> + <radialGradient + inkscape:collect="always" + xlink:href="#linearGradient2886" + id="radialGradient2844" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(-1,0,0,0.5862344,-2188.8406,152.49099)" + spreadMethod="reflect" + cx="-1629.0024" + cy="98.046616" + fx="-1629.0024" + fy="98.046616" + r="341.55664" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient2948" + id="linearGradient2846" + gradientUnits="userSpaceOnUse" + x1="-2255.8958" + y1="169.81215" + x2="-2255.8958" + y2="323.11444" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient2948" + id="linearGradient2848" + gradientUnits="userSpaceOnUse" + x1="-2255.8958" + y1="169.81215" + x2="-2255.8958" + y2="428.47058" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient2948" + id="linearGradient2850" + gradientUnits="userSpaceOnUse" + x1="-2266.7681" + y1="568.77667" + x2="-2266.7681" + y2="-39.337055" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient2948" + id="linearGradient2852" + gradientUnits="userSpaceOnUse" + x1="-2266.7681" + y1="568.77667" + x2="-2266.7681" + y2="-39.337055" /> + <radialGradient + inkscape:collect="always" + xlink:href="#linearGradient2886" + id="radialGradient2854" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(-1,2.6562553e-7,2.2224032e-6,8.3666767,-2188.8413,-2330.077)" + cx="-1915.2924" + cy="316.29968" + fx="-1915.2924" + fy="316.29968" + r="43.099361" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3794" + id="linearGradient2856" + gradientUnits="userSpaceOnUse" + x1="-2282.2617" + y1="275.5253" + x2="-2305.0696" + y2="344.25839" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3794" + id="linearGradient2858" + gradientUnits="userSpaceOnUse" + x1="-2325.3611" + y1="122.62138" + x2="-2309.3169" + y2="723.96979" /> + <radialGradient + inkscape:collect="always" + xlink:href="#linearGradient3137" + id="radialGradient2860" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(1,3.781366e-7,-3.2292777e-7,0.8539977,8.9288564e-5,37.369658)" + cx="-1092.8789" + cy="276.49725" + fx="-1092.8789" + fy="276.49725" + r="127.73754" /> + <radialGradient + inkscape:collect="always" + xlink:href="#linearGradient2870" + id="radialGradient2862" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(0.7746364,0.4472365,-0.4660621,0.8072432,-144.92805,587.20425)" + cx="-1093.5826" + cy="217.83733" + fx="-1093.5826" + fy="217.83733" + r="123.63598" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient4162" + id="linearGradient2864" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(1,0,0,0.7247709,2807.0235,194.64859)" + x1="-3887.8772" + y1="877.09351" + x2="-3887.8772" + y2="63.463501" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient4162" + id="linearGradient2866" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(1,0,0,0.7247709,2807.0235,194.64859)" + x1="-3887.8772" + y1="746.12317" + x2="-3887.8772" + y2="587.34491" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient4534" + id="linearGradient2868" + gradientUnits="userSpaceOnUse" + x1="-2180.8767" + y1="-260.6424" + x2="-1234.0055" + y2="686.2287" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient4534" + id="linearGradient2871" + gradientUnits="userSpaceOnUse" + x1="-2160.2458" + y1="-240.01169" + x2="-1234.0055" + y2="686.2287" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient4162" + id="linearGradient2873" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(1.0833333,0,0,1.2956349,149.4705,-161.14233)" + x1="-2180.8767" + y1="-260.6424" + x2="-1234.0055" + y2="686.2287" /> + </defs> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + gridtolerance="10000" + guidetolerance="10" + objecttolerance="10" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="2.4960938" + inkscape:cx="8" + inkscape:cy="8" + inkscape:document-units="px" + inkscape:current-layer="layer1" + width="16px" + height="16px" + showgrid="false" + showborder="false" + inkscape:grid-points="true" + inkscape:window-width="748" + inkscape:window-height="774" + inkscape:window-x="0" + inkscape:window-y="58" + inkscape:showpageshadow="false"> + <inkscape:grid + id="GridFromPre046Settings" + type="xygrid" + originx="0px" + originy="0px" + spacingx="1px" + spacingy="1px" + color="#0000ff" + empcolor="#0000ff" + opacity="0.2" + empopacity="0.4" + empspacing="4" /> + </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="Layer 1" + inkscape:groupmode="layer" + id="layer1"> + <g + style="display:inline" + id="g5868" + transform="matrix(0.173669,0,0,0.174326,-72.419415,-92.051412)"> + <path + transform="matrix(0.9959566,0,0,1.2202117,1.6861043,-136.53125)" + d="M 602,544.5 A 92.5,75.5 0 1 1 417,544.5 A 92.5,75.5 0 1 1 602,544.5 z" + sodipodi:ry="75.5" + sodipodi:rx="92.5" + sodipodi:cy="544.5" + sodipodi:cx="509.5" + id="path4987" + style="fill:#00252b;fill-opacity:1;fill-rule:evenodd" + sodipodi:type="arc" /> + <path + transform="matrix(0.9200853,0,0,1.1406537,-168.51683,-66.406557)" + d="M 827,521 A 90.5,73 0 1 1 646,521 A 90.5,73 0 1 1 827,521 z" + sodipodi:ry="73" + sodipodi:rx="90.5" + sodipodi:cy="521" + sodipodi:cx="736.5" + id="path4989" + style="opacity:0.83064515;fill:url(#radialGradient5297);fill-opacity:1;fill-rule:evenodd;stroke:url(#linearGradient5299);stroke-width:2.92839932;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + sodipodi:type="arc" /> + </g> + <path + style="opacity:1;fill:#006f82;fill-opacity:0;fill-rule:evenodd;stroke:#006f82;stroke-width:0.28191236;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline" + d="M 2.6069946,0.54910198 L 2.6055771,-0.099666752 L 2.8164858,0.95425507 L 2.8141804,-0.099991964 L 3.1640995,0.9266844 L 3.1614423,-0.28975618 L 3.4429478,1.2506338 L 3.5073405,-1.1012556 L 3.72239,1.8449054 L 4.0622041,-1.7508906 L 4.1411304,2.5470893 L 4.4118271,-0.85937424 L 4.625631,1.5191149 L 4.7599147,-0.67069203 L 4.9741304,1.8970225 L 5.1048093,-1.9417329 L 5.5330088,3.0855654 L 5.3800527,-3.2667341 L 6.1615382,4.3280635 L 5.9364518,-3.2135349 L 6.5790389,4.4625735 L 6.2835316,-3.4843962 L 6.7141524,2.6512146 L 6.8446533,-1.2686398 L 7.0617062,2.5966102 L 7.3293879,-2.1884838 L 7.3382512,1.8663126 L 7.6747002,-3.2703033 L 7.6184571,2.8120031 L 7.9542564,-2.6219686 L 8.1085081,4.3250342 L 8.5077563,-3.8933365 L 8.5967296,5.0000787 L 8.9229558,-4.8130735 L 9.0847112,5.5669907 L 9.338687,-5.4895219 L 9.5028098,5.9718155 L 9.685593,-5.8414779 L 10.060561,6.6467546 L 10.036104,-4.5444835 L 10.336396,5.5920776 L 10.45609,-3.2746295 L 10.681472,4.4021287 L 10.806596,-1.9776351 L 11.166795,3.7526023 L 11.224395,-1.707965 L 11.444757,3.6710755 L 11.642254,-1.4112613 L 11.930022,2.9945221 L 11.781738,-1.222254 L 12.346758,2.777615 L 12.200187,-0.65522999 L 12.621295,1.1282304 L 12.726505,-7.1420034 L 13.107918,1.0734102 L 13.151581,-8.3581575 L 13.386175,1.1270414 L 13.779937,-7.1953276 L 13.824553,5.9976764 L 14.19602,-7.7102185 L 14.371253,6.4287067 L 14.488228,-8.4961904 L 14.990198,8.1010368 L 14.899761,-8.6860537 L 15.40361,8.7716012 L 15.439011,-9.2556758 L 15.768486,9.4188537 L 15.727256,-9.4461407 L 16.181738,10.015608 L 16.144465,-9.4467907 L 16.814173,10.636994 L 16.853223,-3.3116119 L 17.106022,9.6883621 L 17.063895,-2.3658164 L 17.712155,10.312643 L 17.412337,-2.0149402 L 17.679509,10.338299 L 17.257021,-9.4485207 L 18.352565,9.7676773 L 17.53587,-9.1245694 L 18.704673,9.3877306 L 18.18338,-8.827906 L 19.324689,9.1430032 L 19.205411,-8.8027822 C 19.205411,-8.8027822 19.664499,10.362247 19.803275,10.226868 C 19.942045,10.091493 20.109774,-8.614964 20.109774,-8.614964 L 20.148701,9.1961009 L 20.458454,-8.1559615 L 20.501159,8.9788209 L 20.80648,-7.9943089 L 20.848069,8.6286114 L 21.295173,-7.1030104 L 21.39787,8.0724425 L 21.852572,-6.5902698 L 21.886678,6.6078305 L 22.212483,-5.8059473 L 22.504428,2.9197299 L 22.7703,-5.1030285 L 22.990522,2.6208277 L 23.531987,-4.1572975 L 23.824944,5.0285534 L 23.956542,-3.2072384 L 24.321023,4.485083 L 24.433579,-2.8322256 L 24.805704,3.5383642 L 24.931729,-2.4278376 L 25.483376,2.6738694 L 25.425746,-1.5091968 L 25.917074,2.9964681 L 25.982971,-1.0772321 L 26.723408,2.1864728 L 26.748315,-0.86375092 L 27.305164,2.322313 L 27.326534,-0.45933052 L 27.794625,1.1558416 L 27.901769,-1.4107869 L 28.100138,1.643531 L 28.284214,0.05104591 C 28.284214,0.05104591 28.580257,1.0188261 28.579961,0.88366608 C 28.579663,0.74850806 28.985357,0.29229348 28.915281,0.049112065 C 28.845218,-0.1940655 29.210562,0.66832968 29.210562,0.66832968" + id="path4922" + sodipodi:nodetypes="ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccscccccccccccccccccccccccccccccccccccc" /> + <path + style="opacity:0.07000002;fill:url(#linearGradient5308);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:12.29699993;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline" + d="M 15.685059,-14.171613 C 8.1008684,-13.978526 2.0086222,-7.7375854 2.0086222,-0.078445316 C 2.0086222,2.2206366 2.5597288,4.3882408 3.5336546,6.3062426 C 3.2949782,5.2768126 3.1700337,4.205026 3.1700337,3.1030039 C 3.1700337,-4.6777095 9.458699,-10.995611 17.21009,-10.995611 C 22.670274,-10.995611 27.40266,-7.8590901 29.725114,-3.2871341 C 28.27676,-9.5232827 22.700358,-14.171613 16.048678,-14.171613 C 15.927562,-14.171613 15.805442,-14.174678 15.685059,-14.171613 z" + id="path4679" /> + <path + id="path3760" + d="M 23.691842,9.2006092 C 23.598484,9.4475433 22.631394,10.365494 22.180179,10.635462 L 21.681377,10.933903 L 19.629076,8.2492422 L 17.576776,5.5645855 L 17.930036,5.1970172 C 18.275752,4.8372965 19.313091,4.1385288 19.650303,4.0382177 C 19.796709,3.9946677 20.09174,4.342695 21.774869,6.5444334 C 22.849871,7.9506633 23.71251,9.1459453 23.691842,9.2006092 z M 13.419661,-4.1930503 C 13.342524,-3.9890191 12.122128,-2.9446885 11.724398,-2.7423592 L 11.363046,-2.5585401 L 9.3403065,-5.2522454 L 7.3175634,-7.9459547 L 8.0140105,-8.5225982 C 8.3970575,-8.8397544 8.8993669,-9.1775161 9.1302536,-9.2731827 L 9.5500496,-9.4471218 L 11.509157,-6.8843692 C 12.822708,-5.1660854 13.452253,-4.2792527 13.419661,-4.1930503 z M 21.318362,11.183854 C 21.305384,11.218124 21.079254,11.355997 20.815851,11.49024 C 18.745871,12.545229 15.418963,11.303354 12.286903,8.3065443 C 11.178311,7.245823 8.8914692,4.4043332 7.9880622,2.9650658 C 6.2446713,0.18757893 5.4248053,-2.1442783 5.44897,-4.2565999 C 5.4640515,-5.5748644 5.8950782,-6.6871677 6.6679963,-7.4024174 L 6.9330208,-7.6476703 L 8.9660248,-5.0279638 L 10.999033,-2.4082574 L 10.834604,-2.1223744 C 10.607486,-1.7275008 10.648568,-1.2096042 10.969518,-0.42161547 C 11.372323,0.5673418 14.568096,4.7456921 15.425468,5.4043706 C 16.099223,5.9219821 16.513712,6.0730931 17.011879,5.9827268 L 17.364643,5.9187361 L 19.3533,8.5201446 C 20.447064,9.9509184 21.331342,11.149586 21.318362,11.183854 z" + style="opacity:0.32000002;fill:#000000;fill-opacity:1;display:inline" /> + <path + style="fill:#dfdfdf;fill-opacity:1;display:inline" + d="M 24.663582,8.2251927 C 24.570224,8.4721247 23.603134,9.390077 23.15192,9.6600453 L 22.653118,9.9584864 L 20.600817,7.2738257 L 18.548516,4.589169 L 18.901776,4.2216007 C 19.247492,3.8618796 20.284832,3.1631133 20.622045,3.0628036 C 20.768451,3.0192502 21.06348,3.3672797 22.746609,5.5690169 C 23.821611,6.9752489 24.68425,8.1705288 24.663582,8.2251927 z M 14.391401,-5.1684676 C 14.314264,-4.9644364 13.093866,-3.9201038 12.696138,-3.7177744 L 12.334786,-3.5339554 L 10.312045,-6.2276625 L 8.2893038,-8.92137 L 8.9857509,-9.4980155 C 9.368798,-9.8151695 9.8711073,-10.152931 10.101994,-10.2486 L 10.52179,-10.422539 L 12.480899,-7.8597847 C 13.794448,-6.1415027 14.423991,-5.254668 14.391401,-5.1684676 z M 22.290102,10.208438 C 22.277124,10.242707 22.050994,10.380579 21.787591,10.514826 C 19.717611,11.569813 16.390703,10.327935 13.258643,7.3311278 C 12.150052,6.2704065 9.8632076,3.4289175 8.9598007,1.9896506 C 7.2164098,-0.78783838 6.3965457,-3.1196934 6.4207105,-5.232015 C 6.4357919,-6.5502815 6.8668187,-7.6625832 7.6397367,-8.3778347 L 7.9047612,-8.6230856 L 9.9377653,-6.003379 L 11.970774,-3.3836725 L 11.806345,-3.0977895 C 11.579227,-2.7029182 11.620308,-2.1850215 11.941258,-1.3970328 C 12.344063,-0.40807349 15.539837,3.7702768 16.39721,4.4289541 C 17.070963,4.9465676 17.485453,5.0976766 17.983619,5.0073103 L 18.336384,4.9433196 L 20.325041,7.5447281 C 21.418804,8.9755039 22.303082,10.17417 22.290102,10.208438 z" + id="path3218" /> + <g + transform="matrix(0.1619567,0,0,0.1625693,-28.880339,-84.45656)" + id="g3787" + style="fill:#ffffff;fill-opacity:0;display:inline"> + <path + id="path3789" + d="M 324.6064,576.10592 C 324.02996,577.62486 318.05867,583.27138 315.27265,584.93202 L 312.1928,586.7678 L 299.5209,570.25386 L 286.84899,553.73994 L 289.03019,551.47895 C 291.16481,549.26622 297.56985,544.96795 299.65197,544.35092 C 300.55595,544.08302 302.37761,546.22382 312.77007,559.7672 C 319.40765,568.41724 324.73401,575.76967 324.6064,576.10592 z M 261.18093,493.71856 C 260.70464,494.9736 253.16932,501.39752 250.71354,502.64209 L 248.48238,503.7728 L 235.99299,487.20322 L 223.50359,470.63363 L 227.80379,467.08656 C 230.16891,465.13567 233.27042,463.05802 234.69603,462.46955 L 237.28805,461.39961 L 249.38455,477.16367 C 257.49505,487.73321 261.38216,493.18832 261.18093,493.71856 z M 309.95137,588.3053 C 309.87124,588.51609 308.475,589.36418 306.84862,590.18996 C 294.06756,596.67941 273.5256,589.04036 254.18672,570.60633 C 247.34174,564.0816 233.22165,546.60297 227.64357,537.74972 C 216.87902,520.66478 211.81677,506.32102 211.96598,493.32766 C 212.0591,485.21872 214.72047,478.3767 219.49284,473.97704 L 221.12923,472.46844 L 233.682,488.58283 L 246.23478,504.69722 L 245.21952,506.45575 C 243.81718,508.8847 244.07084,512.0704 246.05254,516.91749 C 248.53966,523.00079 268.27193,548.70275 273.56577,552.75442 C 277.72586,555.93837 280.28512,556.86788 283.36104,556.31202 L 285.53918,555.9184 L 297.81812,571.92023 C 304.57154,580.72124 310.03151,588.09451 309.95137,588.3053 z" + style="opacity:0.32000002;fill:#ffffff;fill-opacity:0" /> + <path + style="fill:#ffffff;fill-opacity:0" + d="M 330.6064,570.10592 C 330.02996,571.62486 324.05867,577.27138 321.27265,578.93202 L 318.1928,580.7678 L 305.5209,564.25386 L 292.84899,547.73994 L 295.03019,545.47895 C 297.16481,543.26622 303.56985,538.96795 305.65197,538.35092 C 306.55595,538.08302 308.37761,540.22382 318.77007,553.7672 C 325.40765,562.41724 330.73401,569.76967 330.6064,570.10592 z M 267.18093,487.71856 C 266.70464,488.9736 259.16932,495.39752 256.71354,496.64209 L 254.48238,497.7728 L 241.99299,481.20322 L 229.50359,464.63363 L 233.80379,461.08656 C 236.16891,459.13567 239.27042,457.05802 240.69603,456.46955 L 243.28805,455.39961 L 255.38455,471.16367 C 263.49505,481.73321 267.38216,487.18832 267.18093,487.71856 z M 315.95137,582.3053 C 315.87124,582.51609 314.475,583.36418 312.84862,584.18996 C 300.06756,590.67941 279.5256,583.04036 260.18672,564.60633 C 253.34174,558.0816 239.22165,540.60297 233.64357,531.74972 C 222.87902,514.66478 217.81677,500.32102 217.96598,487.32766 C 218.0591,479.21872 220.72047,472.3767 225.49284,467.97704 L 227.12923,466.46844 L 239.682,482.58283 L 252.23478,498.69722 L 251.21952,500.45575 C 249.81718,502.8847 250.07084,506.0704 252.05254,510.91749 C 254.53966,517.00079 274.27193,542.70275 279.56577,546.75442 C 283.72586,549.93837 286.28512,550.86788 289.36104,550.31202 L 291.53918,549.9184 L 303.81812,565.92023 C 310.57154,574.72124 316.03151,582.09451 315.95137,582.3053 z" + id="path3791" /> + </g> + <path + style="fill:url(#linearGradient3809);fill-opacity:1;stroke:none;display:inline" + d="M 10.521198,-10.425737 L 10.098451,-10.247512 C 9.8675644,-10.151843 9.365445,-9.8178162 8.9823979,-9.5006622 L 8.2890919,-8.9235502 L 10.309825,-6.224705 L 11.383604,-4.7989016 C 11.832076,-5.6704481 12.373307,-6.4725964 12.981588,-7.2007037 C 12.819168,-7.4158626 12.674145,-7.6123132 12.482746,-7.8626837 L 10.521198,-10.425737 z M 7.9086201,-8.6265075 L 7.6380613,-8.3803866 C 6.8651432,-7.6651369 6.4356299,-6.5499989 6.4205485,-5.2317344 C 6.3963837,-3.1194127 7.2136425,-0.78684309 8.9570336,1.9906438 C 9.1957939,2.3710265 9.5361637,2.8480184 9.9208964,3.3655274 C 9.8637975,2.8392407 9.8278923,2.3051816 9.8278923,1.761497 C 9.8278923,-0.46148867 10.314124,-2.5591336 11.180684,-4.3915277 L 9.9378073,-6.0040451 L 7.9086201,-8.6265075 z" + id="path3798" /> + </g> +</svg> diff --git a/sflphone-client-kde/data/sflphone-client-kde.desktop b/sflphone-client-kde/data/sflphone-client-kde.desktop index b3298aaca04a17141009e57adf5c7dd99a514098..1b74b87e517b7317ea7712fc8ad400ec93b94beb 100644 --- a/sflphone-client-kde/data/sflphone-client-kde.desktop +++ b/sflphone-client-kde/data/sflphone-client-kde.desktop @@ -1,38 +1,12 @@ [Desktop Entry] -# Name=KApp4 -# Name[nds]=KProg4 -# Name[sv]=KDE 4-program -# Name[zh_TW]=KApp4 程式 -# Exec=kapp4 %i -caption "%c" -# Icon=kapp4 Type=Application X-DocPath=sflphone-client-kde/index.html -# GenericName=A KDE4 Application -# GenericName[ca]=Una aplicació del KDE4 -# GenericName[da]=Et KDE4-program -# GenericName[de]=Eine KDE 4-Anwendung -# GenericName[el]=Μία εφαρμογή του KDE4 -# GenericName[es]=Una aplicación para KDE4 -# GenericName[et]=KDE4 rakendus -# GenericName[hu]=KDE4-alapú alkalmazás -# GenericName[it]=Applicazione KDE4 -# GenericName[nds]=En KDE4-Programm -# GenericName[nl]=Een KDE4-programma -# GenericName[pl]=Program dla KDE4 -# GenericName[pt]=Uma Aplicação do KDE4 -# GenericName[pt_BR]=Uma Aplicação do KDE4 -# GenericName[ru]=Приложение KDE 4 -# GenericName[sk]=KDE4 aplikácia -# GenericName[sr]=KDE4 програм -# GenericName[sr@Latn]=KDE4 program -# GenericName[sv]=Ett KDE 4-program -# GenericName[zh_TW]=KDE4 應用程式 Terminal=false Name=SFLphone VoIP KDE4 client GenericName=Telephone Comment=Call and receive calls with SIP or IAX protocols Exec=sflphone-client-kde -Icon=sflphone.png +Icon=sflphone.svg StartupNotify=true Categories=Network;Telephony; diff --git a/sflphone-client-kde/data/sflphone-client-kdeui.rc b/sflphone-client-kde/data/sflphone-client-kdeui.rc index 291817af5d2f8d8e1bae50704b8de5c326653f0e..a9111dba1061b649b2f2ba81eed118ba4deef20a 100644 --- a/sflphone-client-kde/data/sflphone-client-kdeui.rc +++ b/sflphone-client-kde/data/sflphone-client-kdeui.rc @@ -1,11 +1,14 @@ <?xml version="1.0" encoding="UTF-8"?> -<gui name="tutorial3" +<!--<gui name="tutorial3" version="1" xmlns="http://www.kde.org/standards/kxmlgui/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.kde.org/standards/kxmlgui/1.0 http://www.kde.org/standards/kxmlgui/1.0/kxmlgui.xsd" > + --> +<gui name="sflphone-client-kde" version="1"> + <MenuBar> <Menu name="Actions" > <text>Actions</text> @@ -20,6 +23,8 @@ <Separator /> <Action name="action_mailBox" /> <Separator /> + <Action name="action_close" /> + <Separator /> <Action name="action_quit" /> </Menu> <Menu name="Settings" > @@ -27,12 +32,24 @@ <Action name="action_displayVolumeControls" /> <Action name="action_displayDialpad" /> <Separator /> - <Action name="action_configureAccounts" /> - <Action name="action_configureAudio" /> +<!-- <Action name="action_configureAccounts" /> --> +<!-- <Action name="action_configureAudio" /> --> <Action name="action_configureSflPhone" /> <Separator /> <Action name="action_accountCreationWizard" /> </Menu> </MenuBar> + <!--<ToolBar name="mainToolBar" position="Top" noMerge="1" fullWidth="true" newline="true" > + <Action name="action_accept" /> + <Action name="action_refuse" /> + <Action name="action_hold" /> + <Action name="action_transfer" /> + <Action name="action_record" /> + <Separator /> + <Action name="action_history" /> + <Action name="action_addressBook" /> + <Separator /> + <Action name="action_mailBox" /> + </ToolBar> --> </gui> \ No newline at end of file diff --git a/sflphone-client-kde/doc/CMakeLists.txt b/sflphone-client-kde/doc/CMakeLists.txt index 9c366d939ca52853864cfe0fe473c26f17383f22..18fe46cc14b30bbdd39367623dbd6d53cc1de1a3 100644 --- a/sflphone-client-kde/doc/CMakeLists.txt +++ b/sflphone-client-kde/doc/CMakeLists.txt @@ -2,4 +2,4 @@ # # -kde4_create_handbook(index.docbook INSTALL_DESTINATION ${HTML_INSTALL_DIR}/en SUBDIR sflphone-client-kde) +KDE4_CREATE_HANDBOOK(index.docbook INSTALL_DESTINATION ${HTML_INSTALL_DIR}/en SUBDIR sflphone-client-kde) diff --git a/sflphone-client-kde/po/CMakeLists.txt b/sflphone-client-kde/po/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..7addefd5a57ceaee920dfac5a20a78da5ab50474 --- /dev/null +++ b/sflphone-client-kde/po/CMakeLists.txt @@ -0,0 +1,10 @@ +find_package(Gettext REQUIRED) +if (NOT GETTEXT_MSGMERGE_EXECUTABLE) +MESSAGE(FATAL_ERROR "Please install msgmerge binary") +endif (NOT GETTEXT_MSGMERGE_EXECUTABLE) +if (NOT GETTEXT_MSGFMT_EXECUTABLE) +MESSAGE(FATAL_ERROR "Please install msgmerge binary") +endif (NOT GETTEXT_MSGFMT_EXECUTABLE) + +add_subdirectory(fr) + diff --git a/sflphone-client-kde/po/README b/sflphone-client-kde/po/README new file mode 100644 index 0000000000000000000000000000000000000000..ab2bcad9f3573ccd744aa27f191b2d5eedafdcb8 --- /dev/null +++ b/sflphone-client-kde/po/README @@ -0,0 +1,19 @@ +If you need to update translations files, just execute: + + ./update.sh + +in the current directory. + + + +If you want to do it yourself, do the following steps: + + xgettext --c++ --kde -ktr2i18n -kki18nc:2c,1 -kki18n -o sflphone-client-kde.pot ../src/*.cpp ../src/*.h ../build/src/*.h ../build/src/*.cpp + +This command will update the template file with the current source files. +To be able to add strings from the ui files, and other non-c++ files which generates some c++ source, you have to first build and make the project in build directory (see the INSTALL file in root directory sflphone-client-kde). + + for fichier in `find . -name *.po ` ; do msgmerge --update $fichier sflphone-client-kde.pot ; done + +This command will update the po files in every subdirectory with the new pot file. +You will then be able to translate the new strings in each po file. \ No newline at end of file diff --git a/sflphone-client-kde/po/de/CMakeLists.txt b/sflphone-client-kde/po/de/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..4a149a88288f30056f97c7b088b95fa735979025 --- /dev/null +++ b/sflphone-client-kde/po/de/CMakeLists.txt @@ -0,0 +1,2 @@ +file(GLOB _po_files *.po) +GETTEXT_PROCESS_PO_FILES(de ALL INSTALL_DESTINATION ${LOCALE_INSTALL_DIR} ${_po_files} ) diff --git a/sflphone-client-kde/po/de/sflphone-client-kde.po b/sflphone-client-kde/po/de/sflphone-client-kde.po new file mode 100644 index 0000000000000000000000000000000000000000..ccbeede61592a5763e3af4c480a68b36ed2542a1 --- /dev/null +++ b/sflphone-client-kde/po/de/sflphone-client-kde.po @@ -0,0 +1,610 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2009-06-17 15:48-0400\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: LANGUAGE <LL@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: ../src/AccountWizard.cpp:161 ../src/AccountWizard.cpp:275 +msgid "Account Creation Wizard" +msgstr "" + +#: ../src/AccountWizard.cpp:200 +msgid "Creation of account succeed with these parameters" +msgstr "" + +#: ../src/AccountWizard.cpp:211 +msgid "Creation of account has failed for the reason" +msgstr "" + +#: ../src/AccountWizard.cpp:217 +msgid "Register of account succeed with these parameters" +msgstr "" + +#: ../src/AccountWizard.cpp:253 ../src/AccountWizard.cpp:437 +msgid "Alias" +msgstr "" + +#: ../src/AccountWizard.cpp:254 ../src/AccountWizard.cpp:438 +msgid "Server" +msgstr "" + +#: ../src/AccountWizard.cpp:255 ../src/AccountWizard.cpp:439 +msgid "User" +msgstr "" + +#: ../src/AccountWizard.cpp:256 ../src/AccountWizard.cpp:440 +msgid "Password" +msgstr "" + +#: ../src/AccountWizard.cpp:257 +msgid "Protocol" +msgstr "" + +#: ../src/AccountWizard.cpp:258 +msgid "Mailbox" +msgstr "" + +#: ../src/AccountWizard.cpp:276 +msgid "Welcome to the Account creation wizard of SFLPhone" +msgstr "" + +#: ../src/AccountWizard.cpp:278 +msgid "This wizard will help you setting up an account." +msgstr "" + +#: ../src/AccountWizard.cpp:306 ../build/src/ui_ConfigDialog.h:1259 +msgid "Accounts" +msgstr "" + +#: ../src/AccountWizard.cpp:307 +msgid "Please choose between those options :" +msgstr "" + +#: ../src/AccountWizard.cpp:309 +msgid "Create a free SIP/IAX2 account on sflphone.org" +msgstr "" + +#: ../src/AccountWizard.cpp:310 +msgid "Register an existing SIP/IAX2 account" +msgstr "" + +#: ../src/AccountWizard.cpp:349 +msgid "VoIP Protocols" +msgstr "" + +#: ../src/AccountWizard.cpp:350 +msgid "Choose the account type" +msgstr "" + +#: ../src/AccountWizard.cpp:352 +msgid "Register a SIP (Session Initiation Protocol) account" +msgstr "" + +#: ../src/AccountWizard.cpp:353 +msgid "Register a IAX2 (InterAsterisk eXchange) account" +msgstr "" + +#: ../src/AccountWizard.cpp:392 +msgid "Optionnal Email Address" +msgstr "" + +#: ../src/AccountWizard.cpp:393 +msgid "This email address will be used to send your voicemail messages." +msgstr "" + +#: ../src/AccountWizard.cpp:395 +msgid "Email address" +msgstr "" + +#: ../src/AccountWizard.cpp:429 +msgid "SIP Account Settings" +msgstr "" + +#: ../src/AccountWizard.cpp:433 +msgid "IAX2 Account Settings" +msgstr "" + +#: ../src/AccountWizard.cpp:435 +msgid "Please full these settings fields." +msgstr "" + +#: ../src/AccountWizard.cpp:512 +msgid "Network Address Translation (NAT)" +msgstr "" + +#: ../src/AccountWizard.cpp:513 +msgid "" +"You should probably enable this option if you're placed under a firewall" +msgstr "" + +#: ../src/AccountWizard.cpp:515 +msgid "Enable STUN" +msgstr "" + +#: ../src/AccountWizard.cpp:516 +msgid "Stun Server" +msgstr "" + +#: ../src/AccountWizard.cpp:550 +msgid "Account Definition Finished" +msgstr "" + +#: ../src/AccountWizard.cpp:551 +msgid "" +"After checking the settings you chose, click \"Finish\" to create the " +"account." +msgstr "" + +#: ../src/Call.cpp:116 +msgid "Transfer to : " +msgstr "" + +#: ../src/ConfigDialog.cpp:131 ../src/ConfigDialog.cpp:263 +msgid "Attention : SIP port must be over 1024 !" +msgstr "" + +#: ../src/ConfigDialog.cpp:136 ../src/ConfigDialog.cpp:266 +msgid "Attention : SIP port must be under 65536 !" +msgstr "" + +#: ../src/main.cpp:49 ../src/main.cpp:50 +msgctxt "Your names" +msgid "NAME OF TRANSLATORS" +msgstr "" + +#: ../src/main.cpp:50 ../src/main.cpp:51 +msgctxt "Your emails" +msgid "EMAIL OF TRANSLATORS" +msgstr "" + +#: ../src/SFLPhone.cpp:55 ../src/sflphone_kdeview.cpp:1051 +#: ../src/sflphone_kdeview.cpp:1056 ../src/sflphone_kdeview.cpp:1061 +msgid "SFLPhone" +msgstr "" + +#: ../src/SFLPhone.cpp:154 +msgid "You still have some calls open. Please close all calls before quitting." +msgstr "" + +#: ../src/SFLPhone.cpp:182 +msgid "Incoming call" +msgstr "" + +#: ../src/SFLPhone.cpp:183 +msgid "You have an incoming call from" +msgstr "" + +#: ../src/SFLPhone.cpp:183 +msgid "Click to accept or refuse it." +msgstr "" + +#: ../src/sflphone_kdeview.cpp:1051 +msgid "Main screen" +msgstr "" + +#: ../src/sflphone_kdeview.cpp:1056 ../build/src/ui_ConfigDialog.h:1271 +#: ../build/src/ui_dlggeneralbase.h:160 +msgid "Call history" +msgstr "" + +#: ../src/sflphone_kdeview.cpp:1061 +#: ../build/src/ui_sflphone_kdeview_base.h:507 +msgid "Address book" +msgstr "" + +#: ../src/sflphone_kdeview.cpp:1075 ../src/sflphone_kdeview.cpp:1131 +msgid "Edit before call" +msgstr "" + +#: ../src/sflphone_const.h:56 +msgid "Call" +msgstr "" + +#: ../src/sflphone_const.h:57 +msgid "Hang up" +msgstr "" + +#: ../src/sflphone_const.h:58 +msgid "Hold" +msgstr "" + +#: ../src/sflphone_const.h:59 +msgid "Transfer" +msgstr "" + +#: ../src/sflphone_const.h:60 ../build/src/ui_ConfigDialog.h:1263 +msgid "Record" +msgstr "" + +#: ../src/sflphone_const.h:61 +msgid "Accept" +msgstr "" + +#: ../src/sflphone_const.h:62 +msgid "Refuse" +msgstr "" + +#: ../src/sflphone_const.h:63 +msgid "Unhold" +msgstr "" + +#: ../src/sflphone_const.h:64 +msgid "Give up transfer" +msgstr "" + +#: ../src/sflphone_const.h:65 +msgid "Call back" +msgstr "" + +#: ../src/sflphone_const.h:66 +msgid "Give up search" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1249 +msgid "Configuration Dialog" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1250 +msgid "about" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1255 ../build/src/ui_ConfigDialog.h:1337 +msgid "General" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1257 +msgid "Display" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1261 +msgid "Audio" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1265 +msgid "Address Book" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1267 +msgid "Hooks" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1270 +msgid "Configure general settings" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1272 ../build/src/ui_dlggeneralbase.h:161 +msgid "&Capacity" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1273 ../build/src/ui_dlggeneralbase.h:162 +msgid "C&lear history" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1274 ../build/src/ui_dlggeneralbase.h:163 +msgid "Connection" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1275 ../build/src/ui_dlggeneralbase.h:164 +msgid "SIP &Port" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1276 ../build/src/ui_dlggeneralbase.h:165 +msgid "Attention " +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1277 +msgid "Configure display" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1278 +msgid "Enable notifications" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1279 +msgid "On incoming &calls" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1280 +msgid "On &messages" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1281 +msgid "Show main window" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1282 +msgid "On &start" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1283 +msgid "On &incoming calls" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1284 +msgid "Configure user accounts" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1286 +msgid "Remove this account" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1287 +msgid "Backspace, Return" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1288 +msgid "Add a new account" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1289 +msgid "Down" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1290 +msgid "Up" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1291 +msgid "Apply" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1292 +msgid "&Alias" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1293 +msgid "&Protocol" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1296 +msgid "SIP" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1297 +msgid "IAX" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1299 +msgid "&Server" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1300 +msgid "&User" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1301 +msgid "Pass&word" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1302 +#: ../build/src/ui_sflphone_kdeview_base.h:498 +msgid "&Mailbox" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1303 +msgid "State" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1306 +msgid "Stun settings will be applied on each account" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1307 +msgid "&Enable Stun" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1308 +msgid "Configure audio settings" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1310 +msgid "Audio &device" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1313 +msgid "ALSA" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1314 +msgid "PulseAudio" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1316 +msgid "&Enable ringtones" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1317 +msgid "&Codecs" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1321 +msgid "Active" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1323 +msgid "Name" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1325 +msgid "Frequency" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1327 +msgid "Bitrate" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1329 +msgid "Bandwidth" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1330 +msgid "ALSA settings" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1331 +msgid "&In" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1332 +msgid "&Out" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1333 +msgid "ALSA &plugin" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1334 +msgid "PulseAudio settings" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1335 +msgid "Mute other applications during a call" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1336 +msgid "Configure record settings" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1338 +msgid "Destination folder" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1339 +msgid "Configure address book settings" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1340 +msgid "Maximum &results" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1341 +msgid "Display &photo if available" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1342 +msgid "Display phone numbers of these &types :" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1343 +msgid "&Work" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1344 +msgid "&Mobile" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1345 +msgid "&Home" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1346 +msgid "Configure hooks settings" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1347 +msgid "URL Argument" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1348 +msgid "SIP Protocol" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1349 +msgid "IAX2 Protocol" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1350 +msgid "SIP Header" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1351 +msgid "Command" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1352 +msgid "Phone number formatting" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1353 +msgid "Add phone number prefix" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1354 +msgid "Prepend" +msgstr "" + +#: ../build/src/ui_dlggeneralbase.h:159 +#: ../build/src/ui_sflphone_kdeview_base.h:492 +msgid "Form" +msgstr "" + +#: ../build/src/ui_sflphone_kdeview_base.h:493 +msgid "&Pick up" +msgstr "" + +#: ../build/src/ui_sflphone_kdeview_base.h:494 +msgid "&Hang up" +msgstr "" + +#: ../build/src/ui_sflphone_kdeview_base.h:495 +msgid "H&old" +msgstr "" + +#: ../build/src/ui_sflphone_kdeview_base.h:496 +msgid "&Transfer" +msgstr "" + +#: ../build/src/ui_sflphone_kdeview_base.h:497 +msgid "H&istory" +msgstr "" + +#: ../build/src/ui_sflphone_kdeview_base.h:499 +msgid "Configure &accounts" +msgstr "" + +#: ../build/src/ui_sflphone_kdeview_base.h:500 +msgid "Configure a&udio" +msgstr "" + +#: ../build/src/ui_sflphone_kdeview_base.h:501 +msgid "&Configure SFLPhone" +msgstr "" + +#: ../build/src/ui_sflphone_kdeview_base.h:502 +msgid "Display &volume bars" +msgstr "" + +#: ../build/src/ui_sflphone_kdeview_base.h:503 +msgid "&About" +msgstr "" + +#: ../build/src/ui_sflphone_kdeview_base.h:504 +msgid "Display &dialpad" +msgstr "" + +#: ../build/src/ui_sflphone_kdeview_base.h:505 +msgid "&Record" +msgstr "" + +#: ../build/src/ui_sflphone_kdeview_base.h:506 +msgid "Account creation &wizard" +msgstr "" + +#: ../build/src/ui_sflphone_kdeview_base.h:508 +msgid "Attention:number of results exceeds max displayed." +msgstr "" + +#~ msgid "Account Wizard" +#~ msgstr "SFLphone Konto (Konfigurationsassistent)" diff --git a/sflphone-client-kde/po/es/CMakeLists.txt b/sflphone-client-kde/po/es/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..906dea91f03c04b48b3a8ee534cb8a75423d0bb2 --- /dev/null +++ b/sflphone-client-kde/po/es/CMakeLists.txt @@ -0,0 +1,2 @@ +file(GLOB _po_files *.po) +GETTEXT_PROCESS_PO_FILES(es ALL INSTALL_DESTINATION ${LOCALE_INSTALL_DIR} ${_po_files} ) diff --git a/sflphone-client-kde/po/es/sflphone-client-kde.po b/sflphone-client-kde/po/es/sflphone-client-kde.po new file mode 100644 index 0000000000000000000000000000000000000000..d8af45b68bdc669a021952c89c623dfdfc4621c0 --- /dev/null +++ b/sflphone-client-kde/po/es/sflphone-client-kde.po @@ -0,0 +1,607 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2009-06-17 15:48-0400\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: LANGUAGE <LL@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: ../src/AccountWizard.cpp:161 ../src/AccountWizard.cpp:275 +msgid "Account Creation Wizard" +msgstr "" + +#: ../src/AccountWizard.cpp:200 +msgid "Creation of account succeed with these parameters" +msgstr "" + +#: ../src/AccountWizard.cpp:211 +msgid "Creation of account has failed for the reason" +msgstr "" + +#: ../src/AccountWizard.cpp:217 +msgid "Register of account succeed with these parameters" +msgstr "" + +#: ../src/AccountWizard.cpp:253 ../src/AccountWizard.cpp:437 +msgid "Alias" +msgstr "" + +#: ../src/AccountWizard.cpp:254 ../src/AccountWizard.cpp:438 +msgid "Server" +msgstr "" + +#: ../src/AccountWizard.cpp:255 ../src/AccountWizard.cpp:439 +msgid "User" +msgstr "" + +#: ../src/AccountWizard.cpp:256 ../src/AccountWizard.cpp:440 +msgid "Password" +msgstr "" + +#: ../src/AccountWizard.cpp:257 +msgid "Protocol" +msgstr "" + +#: ../src/AccountWizard.cpp:258 +msgid "Mailbox" +msgstr "" + +#: ../src/AccountWizard.cpp:276 +msgid "Welcome to the Account creation wizard of SFLPhone" +msgstr "" + +#: ../src/AccountWizard.cpp:278 +msgid "This wizard will help you setting up an account." +msgstr "" + +#: ../src/AccountWizard.cpp:306 ../build/src/ui_ConfigDialog.h:1259 +msgid "Accounts" +msgstr "" + +#: ../src/AccountWizard.cpp:307 +msgid "Please choose between those options :" +msgstr "" + +#: ../src/AccountWizard.cpp:309 +msgid "Create a free SIP/IAX2 account on sflphone.org" +msgstr "" + +#: ../src/AccountWizard.cpp:310 +msgid "Register an existing SIP/IAX2 account" +msgstr "" + +#: ../src/AccountWizard.cpp:349 +msgid "VoIP Protocols" +msgstr "" + +#: ../src/AccountWizard.cpp:350 +msgid "Choose the account type" +msgstr "" + +#: ../src/AccountWizard.cpp:352 +msgid "Register a SIP (Session Initiation Protocol) account" +msgstr "" + +#: ../src/AccountWizard.cpp:353 +msgid "Register a IAX2 (InterAsterisk eXchange) account" +msgstr "" + +#: ../src/AccountWizard.cpp:392 +msgid "Optionnal Email Address" +msgstr "" + +#: ../src/AccountWizard.cpp:393 +msgid "This email address will be used to send your voicemail messages." +msgstr "" + +#: ../src/AccountWizard.cpp:395 +msgid "Email address" +msgstr "" + +#: ../src/AccountWizard.cpp:429 +msgid "SIP Account Settings" +msgstr "" + +#: ../src/AccountWizard.cpp:433 +msgid "IAX2 Account Settings" +msgstr "" + +#: ../src/AccountWizard.cpp:435 +msgid "Please full these settings fields." +msgstr "" + +#: ../src/AccountWizard.cpp:512 +msgid "Network Address Translation (NAT)" +msgstr "" + +#: ../src/AccountWizard.cpp:513 +msgid "" +"You should probably enable this option if you're placed under a firewall" +msgstr "" + +#: ../src/AccountWizard.cpp:515 +msgid "Enable STUN" +msgstr "" + +#: ../src/AccountWizard.cpp:516 +msgid "Stun Server" +msgstr "" + +#: ../src/AccountWizard.cpp:550 +msgid "Account Definition Finished" +msgstr "" + +#: ../src/AccountWizard.cpp:551 +msgid "" +"After checking the settings you chose, click \"Finish\" to create the " +"account." +msgstr "" + +#: ../src/Call.cpp:116 +msgid "Transfer to : " +msgstr "" + +#: ../src/ConfigDialog.cpp:131 ../src/ConfigDialog.cpp:263 +msgid "Attention : SIP port must be over 1024 !" +msgstr "" + +#: ../src/ConfigDialog.cpp:136 ../src/ConfigDialog.cpp:266 +msgid "Attention : SIP port must be under 65536 !" +msgstr "" + +#: ../src/main.cpp:49 ../src/main.cpp:50 +msgctxt "Your names" +msgid "NAME OF TRANSLATORS" +msgstr "" + +#: ../src/main.cpp:50 ../src/main.cpp:51 +msgctxt "Your emails" +msgid "EMAIL OF TRANSLATORS" +msgstr "" + +#: ../src/SFLPhone.cpp:55 ../src/sflphone_kdeview.cpp:1051 +#: ../src/sflphone_kdeview.cpp:1056 ../src/sflphone_kdeview.cpp:1061 +msgid "SFLPhone" +msgstr "" + +#: ../src/SFLPhone.cpp:154 +msgid "You still have some calls open. Please close all calls before quitting." +msgstr "" + +#: ../src/SFLPhone.cpp:182 +msgid "Incoming call" +msgstr "" + +#: ../src/SFLPhone.cpp:183 +msgid "You have an incoming call from" +msgstr "" + +#: ../src/SFLPhone.cpp:183 +msgid "Click to accept or refuse it." +msgstr "" + +#: ../src/sflphone_kdeview.cpp:1051 +msgid "Main screen" +msgstr "" + +#: ../src/sflphone_kdeview.cpp:1056 ../build/src/ui_ConfigDialog.h:1271 +#: ../build/src/ui_dlggeneralbase.h:160 +msgid "Call history" +msgstr "" + +#: ../src/sflphone_kdeview.cpp:1061 +#: ../build/src/ui_sflphone_kdeview_base.h:507 +msgid "Address book" +msgstr "" + +#: ../src/sflphone_kdeview.cpp:1075 ../src/sflphone_kdeview.cpp:1131 +msgid "Edit before call" +msgstr "" + +#: ../src/sflphone_const.h:56 +msgid "Call" +msgstr "" + +#: ../src/sflphone_const.h:57 +msgid "Hang up" +msgstr "" + +#: ../src/sflphone_const.h:58 +msgid "Hold" +msgstr "" + +#: ../src/sflphone_const.h:59 +msgid "Transfer" +msgstr "" + +#: ../src/sflphone_const.h:60 ../build/src/ui_ConfigDialog.h:1263 +msgid "Record" +msgstr "" + +#: ../src/sflphone_const.h:61 +msgid "Accept" +msgstr "" + +#: ../src/sflphone_const.h:62 +msgid "Refuse" +msgstr "" + +#: ../src/sflphone_const.h:63 +msgid "Unhold" +msgstr "" + +#: ../src/sflphone_const.h:64 +msgid "Give up transfer" +msgstr "" + +#: ../src/sflphone_const.h:65 +msgid "Call back" +msgstr "" + +#: ../src/sflphone_const.h:66 +msgid "Give up search" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1249 +msgid "Configuration Dialog" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1250 +msgid "about" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1255 ../build/src/ui_ConfigDialog.h:1337 +msgid "General" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1257 +msgid "Display" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1261 +msgid "Audio" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1265 +msgid "Address Book" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1267 +msgid "Hooks" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1270 +msgid "Configure general settings" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1272 ../build/src/ui_dlggeneralbase.h:161 +msgid "&Capacity" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1273 ../build/src/ui_dlggeneralbase.h:162 +msgid "C&lear history" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1274 ../build/src/ui_dlggeneralbase.h:163 +msgid "Connection" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1275 ../build/src/ui_dlggeneralbase.h:164 +msgid "SIP &Port" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1276 ../build/src/ui_dlggeneralbase.h:165 +msgid "Attention " +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1277 +msgid "Configure display" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1278 +msgid "Enable notifications" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1279 +msgid "On incoming &calls" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1280 +msgid "On &messages" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1281 +msgid "Show main window" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1282 +msgid "On &start" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1283 +msgid "On &incoming calls" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1284 +msgid "Configure user accounts" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1286 +msgid "Remove this account" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1287 +msgid "Backspace, Return" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1288 +msgid "Add a new account" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1289 +msgid "Down" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1290 +msgid "Up" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1291 +msgid "Apply" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1292 +msgid "&Alias" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1293 +msgid "&Protocol" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1296 +msgid "SIP" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1297 +msgid "IAX" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1299 +msgid "&Server" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1300 +msgid "&User" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1301 +msgid "Pass&word" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1302 +#: ../build/src/ui_sflphone_kdeview_base.h:498 +msgid "&Mailbox" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1303 +msgid "State" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1306 +msgid "Stun settings will be applied on each account" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1307 +msgid "&Enable Stun" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1308 +msgid "Configure audio settings" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1310 +msgid "Audio &device" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1313 +msgid "ALSA" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1314 +msgid "PulseAudio" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1316 +msgid "&Enable ringtones" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1317 +msgid "&Codecs" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1321 +msgid "Active" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1323 +msgid "Name" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1325 +msgid "Frequency" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1327 +msgid "Bitrate" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1329 +msgid "Bandwidth" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1330 +msgid "ALSA settings" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1331 +msgid "&In" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1332 +msgid "&Out" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1333 +msgid "ALSA &plugin" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1334 +msgid "PulseAudio settings" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1335 +msgid "Mute other applications during a call" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1336 +msgid "Configure record settings" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1338 +msgid "Destination folder" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1339 +msgid "Configure address book settings" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1340 +msgid "Maximum &results" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1341 +msgid "Display &photo if available" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1342 +msgid "Display phone numbers of these &types :" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1343 +msgid "&Work" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1344 +msgid "&Mobile" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1345 +msgid "&Home" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1346 +msgid "Configure hooks settings" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1347 +msgid "URL Argument" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1348 +msgid "SIP Protocol" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1349 +msgid "IAX2 Protocol" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1350 +msgid "SIP Header" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1351 +msgid "Command" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1352 +msgid "Phone number formatting" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1353 +msgid "Add phone number prefix" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1354 +msgid "Prepend" +msgstr "" + +#: ../build/src/ui_dlggeneralbase.h:159 +#: ../build/src/ui_sflphone_kdeview_base.h:492 +msgid "Form" +msgstr "" + +#: ../build/src/ui_sflphone_kdeview_base.h:493 +msgid "&Pick up" +msgstr "" + +#: ../build/src/ui_sflphone_kdeview_base.h:494 +msgid "&Hang up" +msgstr "" + +#: ../build/src/ui_sflphone_kdeview_base.h:495 +msgid "H&old" +msgstr "" + +#: ../build/src/ui_sflphone_kdeview_base.h:496 +msgid "&Transfer" +msgstr "" + +#: ../build/src/ui_sflphone_kdeview_base.h:497 +msgid "H&istory" +msgstr "" + +#: ../build/src/ui_sflphone_kdeview_base.h:499 +msgid "Configure &accounts" +msgstr "" + +#: ../build/src/ui_sflphone_kdeview_base.h:500 +msgid "Configure a&udio" +msgstr "" + +#: ../build/src/ui_sflphone_kdeview_base.h:501 +msgid "&Configure SFLPhone" +msgstr "" + +#: ../build/src/ui_sflphone_kdeview_base.h:502 +msgid "Display &volume bars" +msgstr "" + +#: ../build/src/ui_sflphone_kdeview_base.h:503 +msgid "&About" +msgstr "" + +#: ../build/src/ui_sflphone_kdeview_base.h:504 +msgid "Display &dialpad" +msgstr "" + +#: ../build/src/ui_sflphone_kdeview_base.h:505 +msgid "&Record" +msgstr "" + +#: ../build/src/ui_sflphone_kdeview_base.h:506 +msgid "Account creation &wizard" +msgstr "" + +#: ../build/src/ui_sflphone_kdeview_base.h:508 +msgid "Attention:number of results exceeds max displayed." +msgstr "" diff --git a/sflphone-client-kde/po/fr/CMakeLists.txt b/sflphone-client-kde/po/fr/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..5d2f6efcd1ca746b47bea7a3749fa0da18be472b --- /dev/null +++ b/sflphone-client-kde/po/fr/CMakeLists.txt @@ -0,0 +1,2 @@ +file(GLOB _po_files *.po) +GETTEXT_PROCESS_PO_FILES(fr ALL INSTALL_DESTINATION ${LOCALE_INSTALL_DIR} ${_po_files} ) diff --git a/sflphone-client-kde/po/fr/sflphone-client-kde.po b/sflphone-client-kde/po/fr/sflphone-client-kde.po new file mode 100644 index 0000000000000000000000000000000000000000..fd63212aef25485185116a924b09f45c5cee4c8d --- /dev/null +++ b/sflphone-client-kde/po/fr/sflphone-client-kde.po @@ -0,0 +1,640 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2009-06-17 15:48-0400\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: LANGUAGE <LL@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: ../src/AccountWizard.cpp:161 ../src/AccountWizard.cpp:275 +msgid "Account Creation Wizard" +msgstr "Assistant de création de compte" + +#: ../src/AccountWizard.cpp:200 +#, fuzzy +msgid "Creation of account succeed with these parameters" +msgstr "Compte créé avec succès avec les paramètres :\n" + +#: ../src/AccountWizard.cpp:211 +#, fuzzy +msgid "Creation of account has failed for the reason" +msgstr "Création de compte échouée pour raison :\n" + +#: ../src/AccountWizard.cpp:217 +#, fuzzy +msgid "Register of account succeed with these parameters" +msgstr "Compte enregistré avec succès avec les paramètres :\n" + +#: ../src/AccountWizard.cpp:253 ../src/AccountWizard.cpp:437 +#, fuzzy +msgid "Alias" +msgstr "Alias" + +#: ../src/AccountWizard.cpp:254 ../src/AccountWizard.cpp:438 +#, fuzzy +msgid "Server" +msgstr "Serveur" + +#: ../src/AccountWizard.cpp:255 ../src/AccountWizard.cpp:439 +#, fuzzy +msgid "User" +msgstr "Utilisateur" + +#: ../src/AccountWizard.cpp:256 ../src/AccountWizard.cpp:440 +#, fuzzy +msgid "Password" +msgstr "Mot de passe *" + +#: ../src/AccountWizard.cpp:257 +#, fuzzy +msgid "Protocol" +msgstr "Protocole" + +#: ../src/AccountWizard.cpp:258 +#, fuzzy +msgid "Mailbox" +msgstr "Boîte vocale" + +#: ../src/AccountWizard.cpp:276 +msgid "Welcome to the Account creation wizard of SFLPhone" +msgstr "Bienvenue dans l'assistant de création de compte de SFLPhone" + +#: ../src/AccountWizard.cpp:278 +msgid "This wizard will help you setting up an account." +msgstr "Cet assistant va vous aider à créer et paramètrer un compte" + +#: ../src/AccountWizard.cpp:306 ../build/src/ui_ConfigDialog.h:1259 +msgid "Accounts" +msgstr "Comptes" + +#: ../src/AccountWizard.cpp:307 +msgid "Please choose between those options :" +msgstr "Choisissez une des options :" + +#: ../src/AccountWizard.cpp:309 +msgid "Create a free SIP/IAX2 account on sflphone.org" +msgstr "Créer un compte gratuit SIP/IAX2 sur sflphone.org" + +#: ../src/AccountWizard.cpp:310 +msgid "Register an existing SIP/IAX2 account" +msgstr "Enregistrer un compte SIP/IAX2 existant" + +#: ../src/AccountWizard.cpp:349 +msgid "VoIP Protocols" +msgstr "Protocoles VoIP" + +#: ../src/AccountWizard.cpp:350 +#, fuzzy +msgid "Choose the account type" +msgstr "Choisissez le type de compte :" + +#: ../src/AccountWizard.cpp:352 +#, fuzzy +msgid "Register a SIP (Session Initiation Protocol) account" +msgstr "Créer un compte SIP (Session Initiation Protocol)" + +#: ../src/AccountWizard.cpp:353 +#, fuzzy +msgid "Register a IAX2 (InterAsterisk eXchange) account" +msgstr "Créer un compte IAX2 (InterAsterisk eXchange)" + +#: ../src/AccountWizard.cpp:392 +msgid "Optionnal Email Address" +msgstr "Adresse email (optionnel)" + +#: ../src/AccountWizard.cpp:393 +msgid "This email address will be used to send your voicemail messages." +msgstr "" +"Cette adresse email sera utilisée pour l'envoi des messages vocaux et textes" + +#: ../src/AccountWizard.cpp:395 +msgid "Email address" +msgstr "Adresse email" + +#: ../src/AccountWizard.cpp:429 +msgid "SIP Account Settings" +msgstr "Paramètre du compte SIP" + +#: ../src/AccountWizard.cpp:433 +msgid "IAX2 Account Settings" +msgstr "Paramètre du compte IAX2" + +#: ../src/AccountWizard.cpp:435 +msgid "Please full these settings fields." +msgstr "Remplissez les champs suivants." + +#: ../src/AccountWizard.cpp:512 +msgid "Network Address Translation (NAT)" +msgstr "Traduction d'adresse réseau (NAT)" + +#: ../src/AccountWizard.cpp:513 +msgid "" +"You should probably enable this option if you're placed under a firewall" +msgstr "" + +#: ../src/AccountWizard.cpp:515 +msgid "Enable STUN" +msgstr "Activer STUN" + +#: ../src/AccountWizard.cpp:516 +msgid "Stun Server" +msgstr "Serveur STUN" + +#: ../src/AccountWizard.cpp:550 +msgid "Account Definition Finished" +msgstr "Définition du compte terminée" + +#: ../src/AccountWizard.cpp:551 +msgid "" +"After checking the settings you chose, click \"Finish\" to create the " +"account." +msgstr "" +"Une fois avoir vérifié vos paramètres, cliquez sur \"Terminer\" pour créer " +"le compte." + +#: ../src/Call.cpp:116 +msgid "Transfer to : " +msgstr " Transférer à : " + +#: ../src/ConfigDialog.cpp:131 ../src/ConfigDialog.cpp:263 +msgid "Attention : SIP port must be over 1024 !" +msgstr "Attention : le port SIP doit être supérieur à 1024 !" + +#: ../src/ConfigDialog.cpp:136 ../src/ConfigDialog.cpp:266 +msgid "Attention : SIP port must be under 65536 !" +msgstr "Attention : le port SIP doit être inférieur à 65536 !" + +#: ../src/main.cpp:49 ../src/main.cpp:50 +msgctxt "Your names" +msgid "NAME OF TRANSLATORS" +msgstr "" + +#: ../src/main.cpp:50 ../src/main.cpp:51 +msgctxt "Your emails" +msgid "EMAIL OF TRANSLATORS" +msgstr "" + +#: ../src/SFLPhone.cpp:55 ../src/sflphone_kdeview.cpp:1051 +#: ../src/sflphone_kdeview.cpp:1056 ../src/sflphone_kdeview.cpp:1061 +msgid "SFLPhone" +msgstr "SFLPhone" + +#: ../src/SFLPhone.cpp:154 +msgid "You still have some calls open. Please close all calls before quitting." +msgstr "" +"Il reste des appels ouverts. Veuillez les raccrocher avant de quitter " +"l'application." + +#: ../src/SFLPhone.cpp:182 +msgid "Incoming call" +msgstr "Appel entrant" + +#: ../src/SFLPhone.cpp:183 +msgid "You have an incoming call from" +msgstr "Vous avez un appel entrant de" + +#: ../src/SFLPhone.cpp:183 +msgid "Click to accept or refuse it." +msgstr "Cliquez sur ce message pour accepter ou refuser" + +#: ../src/sflphone_kdeview.cpp:1051 +msgid "Main screen" +msgstr "Écran principal" + +#: ../src/sflphone_kdeview.cpp:1056 ../build/src/ui_ConfigDialog.h:1271 +#: ../build/src/ui_dlggeneralbase.h:160 +msgid "Call history" +msgstr "Historique d'appel" + +#: ../src/sflphone_kdeview.cpp:1061 +#: ../build/src/ui_sflphone_kdeview_base.h:507 +msgid "Address book" +msgstr "Carnet d'adresse" + +#: ../src/sflphone_kdeview.cpp:1075 ../src/sflphone_kdeview.cpp:1131 +msgid "Edit before call" +msgstr "Éditer avant d'appeler" + +#: ../src/sflphone_const.h:56 +#, fuzzy +msgid "Call" +msgstr "Appeler" + +#: ../src/sflphone_const.h:57 +msgid "Hang up" +msgstr "Raccrocher" + +#: ../src/sflphone_const.h:58 +msgid "Hold" +msgstr "Mettre en attente" + +#: ../src/sflphone_const.h:59 +msgid "Transfer" +msgstr "Transférer" + +#: ../src/sflphone_const.h:60 ../build/src/ui_ConfigDialog.h:1263 +msgid "Record" +msgstr "Enregistrement" + +#: ../src/sflphone_const.h:61 +msgid "Accept" +msgstr "Accepter" + +#: ../src/sflphone_const.h:62 +msgid "Refuse" +msgstr "Refuser" + +#: ../src/sflphone_const.h:63 +msgid "Unhold" +msgstr "Reprendre l'appel" + +#: ../src/sflphone_const.h:64 +msgid "Give up transfer" +msgstr "Abander le transfert" + +#: ../src/sflphone_const.h:65 +msgid "Call back" +msgstr "Rappeler" + +#: ../src/sflphone_const.h:66 +msgid "Give up search" +msgstr "Abandonner la recherche" + +#: ../build/src/ui_ConfigDialog.h:1249 +msgid "Configuration Dialog" +msgstr "Dialogue de configuration" + +#: ../build/src/ui_ConfigDialog.h:1250 +msgid "about" +msgstr "À propos" + +#: ../build/src/ui_ConfigDialog.h:1255 ../build/src/ui_ConfigDialog.h:1337 +msgid "General" +msgstr "General" + +#: ../build/src/ui_ConfigDialog.h:1257 +msgid "Display" +msgstr "Affichage" + +#: ../build/src/ui_ConfigDialog.h:1261 +msgid "Audio" +msgstr "Audio" + +#: ../build/src/ui_ConfigDialog.h:1265 +msgid "Address Book" +msgstr "Carnet d'adresses" + +#: ../build/src/ui_ConfigDialog.h:1267 +msgid "Hooks" +msgstr "Ancrage" + +#: ../build/src/ui_ConfigDialog.h:1270 +msgid "Configure general settings" +msgstr "Configurer les paramètres généraux" + +#: ../build/src/ui_ConfigDialog.h:1272 ../build/src/ui_dlggeneralbase.h:161 +msgid "&Capacity" +msgstr "&Capacité" + +#: ../build/src/ui_ConfigDialog.h:1273 ../build/src/ui_dlggeneralbase.h:162 +msgid "C&lear history" +msgstr "&Effacer l'historique" + +#: ../build/src/ui_ConfigDialog.h:1274 ../build/src/ui_dlggeneralbase.h:163 +msgid "Connection" +msgstr "Connexion" + +#: ../build/src/ui_ConfigDialog.h:1275 ../build/src/ui_dlggeneralbase.h:164 +msgid "SIP &Port" +msgstr "Port &SIP" + +#: ../build/src/ui_ConfigDialog.h:1276 ../build/src/ui_dlggeneralbase.h:165 +msgid "Attention " +msgstr "Attention " + +#: ../build/src/ui_ConfigDialog.h:1277 +msgid "Configure display" +msgstr "Configurer les paramètres d'affichage" + +#: ../build/src/ui_ConfigDialog.h:1278 +msgid "Enable notifications" +msgstr "Activer les notifications" + +#: ../build/src/ui_ConfigDialog.h:1279 +msgid "On incoming &calls" +msgstr "Lors d'appels &entrants" + +#: ../build/src/ui_ConfigDialog.h:1280 +msgid "On &messages" +msgstr "Lors de &messages" + +#: ../build/src/ui_ConfigDialog.h:1281 +msgid "Show main window" +msgstr "Mettre la fenêtre principale au premier plan" + +#: ../build/src/ui_ConfigDialog.h:1282 +msgid "On &start" +msgstr "Au &démarrage" + +#: ../build/src/ui_ConfigDialog.h:1283 +msgid "On &incoming calls" +msgstr "Lors d'&appels entrants" + +#: ../build/src/ui_ConfigDialog.h:1284 +msgid "Configure user accounts" +msgstr "Configurer les comptes utilisateur" + +#: ../build/src/ui_ConfigDialog.h:1286 +msgid "Remove this account" +msgstr "Supprimer ce compte" + +#: ../build/src/ui_ConfigDialog.h:1287 +msgid "Backspace, Return" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1288 +msgid "Add a new account" +msgstr "Ajouter un nouveau compte" + +#: ../build/src/ui_ConfigDialog.h:1289 +msgid "Down" +msgstr "Descendre" + +#: ../build/src/ui_ConfigDialog.h:1290 +msgid "Up" +msgstr "Monter" + +#: ../build/src/ui_ConfigDialog.h:1291 +msgid "Apply" +msgstr "Appliquer" + +#: ../build/src/ui_ConfigDialog.h:1292 +#, fuzzy +msgid "&Alias" +msgstr "Alias *" + +#: ../build/src/ui_ConfigDialog.h:1293 +#, fuzzy +msgid "&Protocol" +msgstr "Protocole : " + +#: ../build/src/ui_ConfigDialog.h:1296 +msgid "SIP" +msgstr "SIP" + +#: ../build/src/ui_ConfigDialog.h:1297 +msgid "IAX" +msgstr "IAX" + +#: ../build/src/ui_ConfigDialog.h:1299 +#, fuzzy +msgid "&Server" +msgstr "Serveur *" + +#: ../build/src/ui_ConfigDialog.h:1300 +#, fuzzy +msgid "&User" +msgstr "Utilisateur *" + +#: ../build/src/ui_ConfigDialog.h:1301 +#, fuzzy +msgid "Pass&word" +msgstr "Mot de passe *" + +#: ../build/src/ui_ConfigDialog.h:1302 +#: ../build/src/ui_sflphone_kdeview_base.h:498 +#, fuzzy +msgid "&Mailbox" +msgstr "&Boîte vocale" + +#: ../build/src/ui_ConfigDialog.h:1303 +msgid "State" +msgstr "État" + +#: ../build/src/ui_ConfigDialog.h:1306 +msgid "Stun settings will be applied on each account" +msgstr "Les paramètres de STUN seront appliqués à tous les comptes" + +#: ../build/src/ui_ConfigDialog.h:1307 +#, fuzzy +msgid "&Enable Stun" +msgstr "Activer STUN" + +#: ../build/src/ui_ConfigDialog.h:1308 +msgid "Configure audio settings" +msgstr "Configurer les paramètres audio" + +#: ../build/src/ui_ConfigDialog.h:1310 +msgid "Audio &device" +msgstr "&Interface audio" + +#: ../build/src/ui_ConfigDialog.h:1313 +msgid "ALSA" +msgstr "ALSA" + +#: ../build/src/ui_ConfigDialog.h:1314 +msgid "PulseAudio" +msgstr "PulseAudio" + +#: ../build/src/ui_ConfigDialog.h:1316 +msgid "&Enable ringtones" +msgstr "&Activer les sonneries" + +#: ../build/src/ui_ConfigDialog.h:1317 +msgid "&Codecs" +msgstr "&Codecs" + +#: ../build/src/ui_ConfigDialog.h:1321 +msgid "Active" +msgstr "Activé" + +#: ../build/src/ui_ConfigDialog.h:1323 +msgid "Name" +msgstr "Nom" + +#: ../build/src/ui_ConfigDialog.h:1325 +msgid "Frequency" +msgstr "Fréquence" + +#: ../build/src/ui_ConfigDialog.h:1327 +msgid "Bitrate" +msgstr "Bitrate" + +#: ../build/src/ui_ConfigDialog.h:1329 +msgid "Bandwidth" +msgstr "Bande passante" + +#: ../build/src/ui_ConfigDialog.h:1330 +#, fuzzy +msgid "ALSA settings" +msgstr "Paramètre du compte SIP" + +#: ../build/src/ui_ConfigDialog.h:1331 +msgid "&In" +msgstr "&Entrée" + +#: ../build/src/ui_ConfigDialog.h:1332 +msgid "&Out" +msgstr "&Sortie" + +#: ../build/src/ui_ConfigDialog.h:1333 +msgid "ALSA &plugin" +msgstr "&Greffon ALSA" + +#: ../build/src/ui_ConfigDialog.h:1334 +msgid "PulseAudio settings" +msgstr "Paramètres de PulseAudio" + +#: ../build/src/ui_ConfigDialog.h:1335 +msgid "Mute other applications during a call" +msgstr "Couper le son des autres applications pendant un appel" + +#: ../build/src/ui_ConfigDialog.h:1336 +msgid "Configure record settings" +msgstr "Configurer les paramètres d'enregistrement" + +#: ../build/src/ui_ConfigDialog.h:1338 +msgid "Destination folder" +msgstr "Dossier de destination" + +#: ../build/src/ui_ConfigDialog.h:1339 +msgid "Configure address book settings" +msgstr "Configurer les paramètres du carnet d'adresse" + +#: ../build/src/ui_ConfigDialog.h:1340 +msgid "Maximum &results" +msgstr "Nombre de résultats maximum" + +#: ../build/src/ui_ConfigDialog.h:1341 +msgid "Display &photo if available" +msgstr "Afficher la &photo si disponible" + +#: ../build/src/ui_ConfigDialog.h:1342 +msgid "Display phone numbers of these &types :" +msgstr "Afficher les &numéros de téléphone" + +#: ../build/src/ui_ConfigDialog.h:1343 +msgid "&Work" +msgstr "&Professionnels" + +#: ../build/src/ui_ConfigDialog.h:1344 +msgid "&Mobile" +msgstr "&Mobiles" + +#: ../build/src/ui_ConfigDialog.h:1345 +msgid "&Home" +msgstr "P&ersonnels" + +#: ../build/src/ui_ConfigDialog.h:1346 +msgid "Configure hooks settings" +msgstr "Configurer les paramètres d'ancrage" + +#: ../build/src/ui_ConfigDialog.h:1347 +msgid "URL Argument" +msgstr "Argument URL" + +#: ../build/src/ui_ConfigDialog.h:1348 +#, fuzzy +msgid "SIP Protocol" +msgstr "Protocoles VoIP" + +#: ../build/src/ui_ConfigDialog.h:1349 +#, fuzzy +msgid "IAX2 Protocol" +msgstr "Protocoles VoIP" + +#: ../build/src/ui_ConfigDialog.h:1350 +msgid "SIP Header" +msgstr "Entête SIP" + +#: ../build/src/ui_ConfigDialog.h:1351 +msgid "Command" +msgstr "Commande" + +#: ../build/src/ui_ConfigDialog.h:1352 +msgid "Phone number formatting" +msgstr "Réécriture des numéros appelés" + +#: ../build/src/ui_ConfigDialog.h:1353 +msgid "Add phone number prefix" +msgstr "Ajouter un préfixe" + +#: ../build/src/ui_ConfigDialog.h:1354 +msgid "Prepend" +msgstr "Préfixe" + +#: ../build/src/ui_dlggeneralbase.h:159 +#: ../build/src/ui_sflphone_kdeview_base.h:492 +msgid "Form" +msgstr "" + +#: ../build/src/ui_sflphone_kdeview_base.h:493 +msgid "&Pick up" +msgstr "&Décrocher" + +#: ../build/src/ui_sflphone_kdeview_base.h:494 +#, fuzzy +msgid "&Hang up" +msgstr "&Raccrocher" + +#: ../build/src/ui_sflphone_kdeview_base.h:495 +#, fuzzy +msgid "H&old" +msgstr "&Mettre en attente" + +#: ../build/src/ui_sflphone_kdeview_base.h:496 +#, fuzzy +msgid "&Transfer" +msgstr "&Transférer" + +#: ../build/src/ui_sflphone_kdeview_base.h:497 +msgid "H&istory" +msgstr "&Historique" + +#: ../build/src/ui_sflphone_kdeview_base.h:499 +msgid "Configure &accounts" +msgstr "Configurer les &comptes" + +#: ../build/src/ui_sflphone_kdeview_base.h:500 +msgid "Configure a&udio" +msgstr "Configurer les paramètres &audio" + +#: ../build/src/ui_sflphone_kdeview_base.h:501 +msgid "&Configure SFLPhone" +msgstr "&Configurer SFLPhone" + +#: ../build/src/ui_sflphone_kdeview_base.h:502 +msgid "Display &volume bars" +msgstr "Afficher les barres de &volume" + +#: ../build/src/ui_sflphone_kdeview_base.h:503 +msgid "&About" +msgstr "À &propos" + +#: ../build/src/ui_sflphone_kdeview_base.h:504 +msgid "Display &dialpad" +msgstr "Afficher le &clavier" + +#: ../build/src/ui_sflphone_kdeview_base.h:505 +#, fuzzy +msgid "&Record" +msgstr "&Enregistrer" + +#: ../build/src/ui_sflphone_kdeview_base.h:506 +#, fuzzy +msgid "Account creation &wizard" +msgstr "Assistant de c&réation de compte" + +#: ../build/src/ui_sflphone_kdeview_base.h:508 +msgid "Attention:number of results exceeds max displayed." +msgstr "Attention:tous les résultats ne sont pas affichés." diff --git a/sflphone-client-kde/po/ru/CMakeLists.txt b/sflphone-client-kde/po/ru/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..26b2f5e87830030c94b7cc31b832d4997f709f8a --- /dev/null +++ b/sflphone-client-kde/po/ru/CMakeLists.txt @@ -0,0 +1,2 @@ +file(GLOB _po_files *.po) +GETTEXT_PROCESS_PO_FILES(ru ALL INSTALL_DESTINATION ${LOCALE_INSTALL_DIR} ${_po_files} ) diff --git a/sflphone-client-kde/po/ru/sflphone-client-kde.po b/sflphone-client-kde/po/ru/sflphone-client-kde.po new file mode 100644 index 0000000000000000000000000000000000000000..d8af45b68bdc669a021952c89c623dfdfc4621c0 --- /dev/null +++ b/sflphone-client-kde/po/ru/sflphone-client-kde.po @@ -0,0 +1,607 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2009-06-17 15:48-0400\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: LANGUAGE <LL@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: ../src/AccountWizard.cpp:161 ../src/AccountWizard.cpp:275 +msgid "Account Creation Wizard" +msgstr "" + +#: ../src/AccountWizard.cpp:200 +msgid "Creation of account succeed with these parameters" +msgstr "" + +#: ../src/AccountWizard.cpp:211 +msgid "Creation of account has failed for the reason" +msgstr "" + +#: ../src/AccountWizard.cpp:217 +msgid "Register of account succeed with these parameters" +msgstr "" + +#: ../src/AccountWizard.cpp:253 ../src/AccountWizard.cpp:437 +msgid "Alias" +msgstr "" + +#: ../src/AccountWizard.cpp:254 ../src/AccountWizard.cpp:438 +msgid "Server" +msgstr "" + +#: ../src/AccountWizard.cpp:255 ../src/AccountWizard.cpp:439 +msgid "User" +msgstr "" + +#: ../src/AccountWizard.cpp:256 ../src/AccountWizard.cpp:440 +msgid "Password" +msgstr "" + +#: ../src/AccountWizard.cpp:257 +msgid "Protocol" +msgstr "" + +#: ../src/AccountWizard.cpp:258 +msgid "Mailbox" +msgstr "" + +#: ../src/AccountWizard.cpp:276 +msgid "Welcome to the Account creation wizard of SFLPhone" +msgstr "" + +#: ../src/AccountWizard.cpp:278 +msgid "This wizard will help you setting up an account." +msgstr "" + +#: ../src/AccountWizard.cpp:306 ../build/src/ui_ConfigDialog.h:1259 +msgid "Accounts" +msgstr "" + +#: ../src/AccountWizard.cpp:307 +msgid "Please choose between those options :" +msgstr "" + +#: ../src/AccountWizard.cpp:309 +msgid "Create a free SIP/IAX2 account on sflphone.org" +msgstr "" + +#: ../src/AccountWizard.cpp:310 +msgid "Register an existing SIP/IAX2 account" +msgstr "" + +#: ../src/AccountWizard.cpp:349 +msgid "VoIP Protocols" +msgstr "" + +#: ../src/AccountWizard.cpp:350 +msgid "Choose the account type" +msgstr "" + +#: ../src/AccountWizard.cpp:352 +msgid "Register a SIP (Session Initiation Protocol) account" +msgstr "" + +#: ../src/AccountWizard.cpp:353 +msgid "Register a IAX2 (InterAsterisk eXchange) account" +msgstr "" + +#: ../src/AccountWizard.cpp:392 +msgid "Optionnal Email Address" +msgstr "" + +#: ../src/AccountWizard.cpp:393 +msgid "This email address will be used to send your voicemail messages." +msgstr "" + +#: ../src/AccountWizard.cpp:395 +msgid "Email address" +msgstr "" + +#: ../src/AccountWizard.cpp:429 +msgid "SIP Account Settings" +msgstr "" + +#: ../src/AccountWizard.cpp:433 +msgid "IAX2 Account Settings" +msgstr "" + +#: ../src/AccountWizard.cpp:435 +msgid "Please full these settings fields." +msgstr "" + +#: ../src/AccountWizard.cpp:512 +msgid "Network Address Translation (NAT)" +msgstr "" + +#: ../src/AccountWizard.cpp:513 +msgid "" +"You should probably enable this option if you're placed under a firewall" +msgstr "" + +#: ../src/AccountWizard.cpp:515 +msgid "Enable STUN" +msgstr "" + +#: ../src/AccountWizard.cpp:516 +msgid "Stun Server" +msgstr "" + +#: ../src/AccountWizard.cpp:550 +msgid "Account Definition Finished" +msgstr "" + +#: ../src/AccountWizard.cpp:551 +msgid "" +"After checking the settings you chose, click \"Finish\" to create the " +"account." +msgstr "" + +#: ../src/Call.cpp:116 +msgid "Transfer to : " +msgstr "" + +#: ../src/ConfigDialog.cpp:131 ../src/ConfigDialog.cpp:263 +msgid "Attention : SIP port must be over 1024 !" +msgstr "" + +#: ../src/ConfigDialog.cpp:136 ../src/ConfigDialog.cpp:266 +msgid "Attention : SIP port must be under 65536 !" +msgstr "" + +#: ../src/main.cpp:49 ../src/main.cpp:50 +msgctxt "Your names" +msgid "NAME OF TRANSLATORS" +msgstr "" + +#: ../src/main.cpp:50 ../src/main.cpp:51 +msgctxt "Your emails" +msgid "EMAIL OF TRANSLATORS" +msgstr "" + +#: ../src/SFLPhone.cpp:55 ../src/sflphone_kdeview.cpp:1051 +#: ../src/sflphone_kdeview.cpp:1056 ../src/sflphone_kdeview.cpp:1061 +msgid "SFLPhone" +msgstr "" + +#: ../src/SFLPhone.cpp:154 +msgid "You still have some calls open. Please close all calls before quitting." +msgstr "" + +#: ../src/SFLPhone.cpp:182 +msgid "Incoming call" +msgstr "" + +#: ../src/SFLPhone.cpp:183 +msgid "You have an incoming call from" +msgstr "" + +#: ../src/SFLPhone.cpp:183 +msgid "Click to accept or refuse it." +msgstr "" + +#: ../src/sflphone_kdeview.cpp:1051 +msgid "Main screen" +msgstr "" + +#: ../src/sflphone_kdeview.cpp:1056 ../build/src/ui_ConfigDialog.h:1271 +#: ../build/src/ui_dlggeneralbase.h:160 +msgid "Call history" +msgstr "" + +#: ../src/sflphone_kdeview.cpp:1061 +#: ../build/src/ui_sflphone_kdeview_base.h:507 +msgid "Address book" +msgstr "" + +#: ../src/sflphone_kdeview.cpp:1075 ../src/sflphone_kdeview.cpp:1131 +msgid "Edit before call" +msgstr "" + +#: ../src/sflphone_const.h:56 +msgid "Call" +msgstr "" + +#: ../src/sflphone_const.h:57 +msgid "Hang up" +msgstr "" + +#: ../src/sflphone_const.h:58 +msgid "Hold" +msgstr "" + +#: ../src/sflphone_const.h:59 +msgid "Transfer" +msgstr "" + +#: ../src/sflphone_const.h:60 ../build/src/ui_ConfigDialog.h:1263 +msgid "Record" +msgstr "" + +#: ../src/sflphone_const.h:61 +msgid "Accept" +msgstr "" + +#: ../src/sflphone_const.h:62 +msgid "Refuse" +msgstr "" + +#: ../src/sflphone_const.h:63 +msgid "Unhold" +msgstr "" + +#: ../src/sflphone_const.h:64 +msgid "Give up transfer" +msgstr "" + +#: ../src/sflphone_const.h:65 +msgid "Call back" +msgstr "" + +#: ../src/sflphone_const.h:66 +msgid "Give up search" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1249 +msgid "Configuration Dialog" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1250 +msgid "about" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1255 ../build/src/ui_ConfigDialog.h:1337 +msgid "General" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1257 +msgid "Display" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1261 +msgid "Audio" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1265 +msgid "Address Book" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1267 +msgid "Hooks" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1270 +msgid "Configure general settings" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1272 ../build/src/ui_dlggeneralbase.h:161 +msgid "&Capacity" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1273 ../build/src/ui_dlggeneralbase.h:162 +msgid "C&lear history" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1274 ../build/src/ui_dlggeneralbase.h:163 +msgid "Connection" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1275 ../build/src/ui_dlggeneralbase.h:164 +msgid "SIP &Port" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1276 ../build/src/ui_dlggeneralbase.h:165 +msgid "Attention " +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1277 +msgid "Configure display" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1278 +msgid "Enable notifications" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1279 +msgid "On incoming &calls" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1280 +msgid "On &messages" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1281 +msgid "Show main window" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1282 +msgid "On &start" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1283 +msgid "On &incoming calls" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1284 +msgid "Configure user accounts" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1286 +msgid "Remove this account" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1287 +msgid "Backspace, Return" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1288 +msgid "Add a new account" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1289 +msgid "Down" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1290 +msgid "Up" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1291 +msgid "Apply" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1292 +msgid "&Alias" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1293 +msgid "&Protocol" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1296 +msgid "SIP" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1297 +msgid "IAX" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1299 +msgid "&Server" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1300 +msgid "&User" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1301 +msgid "Pass&word" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1302 +#: ../build/src/ui_sflphone_kdeview_base.h:498 +msgid "&Mailbox" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1303 +msgid "State" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1306 +msgid "Stun settings will be applied on each account" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1307 +msgid "&Enable Stun" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1308 +msgid "Configure audio settings" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1310 +msgid "Audio &device" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1313 +msgid "ALSA" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1314 +msgid "PulseAudio" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1316 +msgid "&Enable ringtones" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1317 +msgid "&Codecs" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1321 +msgid "Active" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1323 +msgid "Name" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1325 +msgid "Frequency" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1327 +msgid "Bitrate" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1329 +msgid "Bandwidth" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1330 +msgid "ALSA settings" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1331 +msgid "&In" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1332 +msgid "&Out" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1333 +msgid "ALSA &plugin" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1334 +msgid "PulseAudio settings" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1335 +msgid "Mute other applications during a call" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1336 +msgid "Configure record settings" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1338 +msgid "Destination folder" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1339 +msgid "Configure address book settings" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1340 +msgid "Maximum &results" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1341 +msgid "Display &photo if available" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1342 +msgid "Display phone numbers of these &types :" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1343 +msgid "&Work" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1344 +msgid "&Mobile" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1345 +msgid "&Home" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1346 +msgid "Configure hooks settings" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1347 +msgid "URL Argument" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1348 +msgid "SIP Protocol" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1349 +msgid "IAX2 Protocol" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1350 +msgid "SIP Header" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1351 +msgid "Command" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1352 +msgid "Phone number formatting" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1353 +msgid "Add phone number prefix" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1354 +msgid "Prepend" +msgstr "" + +#: ../build/src/ui_dlggeneralbase.h:159 +#: ../build/src/ui_sflphone_kdeview_base.h:492 +msgid "Form" +msgstr "" + +#: ../build/src/ui_sflphone_kdeview_base.h:493 +msgid "&Pick up" +msgstr "" + +#: ../build/src/ui_sflphone_kdeview_base.h:494 +msgid "&Hang up" +msgstr "" + +#: ../build/src/ui_sflphone_kdeview_base.h:495 +msgid "H&old" +msgstr "" + +#: ../build/src/ui_sflphone_kdeview_base.h:496 +msgid "&Transfer" +msgstr "" + +#: ../build/src/ui_sflphone_kdeview_base.h:497 +msgid "H&istory" +msgstr "" + +#: ../build/src/ui_sflphone_kdeview_base.h:499 +msgid "Configure &accounts" +msgstr "" + +#: ../build/src/ui_sflphone_kdeview_base.h:500 +msgid "Configure a&udio" +msgstr "" + +#: ../build/src/ui_sflphone_kdeview_base.h:501 +msgid "&Configure SFLPhone" +msgstr "" + +#: ../build/src/ui_sflphone_kdeview_base.h:502 +msgid "Display &volume bars" +msgstr "" + +#: ../build/src/ui_sflphone_kdeview_base.h:503 +msgid "&About" +msgstr "" + +#: ../build/src/ui_sflphone_kdeview_base.h:504 +msgid "Display &dialpad" +msgstr "" + +#: ../build/src/ui_sflphone_kdeview_base.h:505 +msgid "&Record" +msgstr "" + +#: ../build/src/ui_sflphone_kdeview_base.h:506 +msgid "Account creation &wizard" +msgstr "" + +#: ../build/src/ui_sflphone_kdeview_base.h:508 +msgid "Attention:number of results exceeds max displayed." +msgstr "" diff --git a/sflphone-client-kde/po/sflphone-client-kde.pot b/sflphone-client-kde/po/sflphone-client-kde.pot index 0af5848a3410ca3cd5fb9146321509228ba4d4c9..3bf4ef029eed187fca57085a05532be356a43121 100644 --- a/sflphone-client-kde/po/sflphone-client-kde.pot +++ b/sflphone-client-kde/po/sflphone-client-kde.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-05-05 12:00-0400\n" +"POT-Creation-Date: 2009-06-17 15:48-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -16,210 +16,592 @@ msgstr "" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" -#: AccountWizard.cpp:163 -msgid "Account Wizard" -msgstr "" - -#: AccountWizard.cpp:198 -msgid "Creation of account succeed with parameters :\n" +#: ../src/AccountWizard.cpp:161 ../src/AccountWizard.cpp:275 +msgid "Account Creation Wizard" msgstr "" -#: AccountWizard.cpp:209 -msgid "Creation of account has failed for the reason :\n" +#: ../src/AccountWizard.cpp:200 +msgid "Creation of account succeed with these parameters" msgstr "" -#: AccountWizard.cpp:215 -msgid "Register of account succeed with parameters :\n" +#: ../src/AccountWizard.cpp:211 +msgid "Creation of account has failed for the reason" msgstr "" -#: AccountWizard.cpp:251 -msgid "Alias : " +#: ../src/AccountWizard.cpp:217 +msgid "Register of account succeed with these parameters" msgstr "" -#: AccountWizard.cpp:252 -msgid "Server : " +#: ../src/AccountWizard.cpp:253 ../src/AccountWizard.cpp:437 +msgid "Alias" msgstr "" -#: AccountWizard.cpp:253 -msgid "User : " +#: ../src/AccountWizard.cpp:254 ../src/AccountWizard.cpp:438 +msgid "Server" msgstr "" -#: AccountWizard.cpp:254 -msgid "Password : " +#: ../src/AccountWizard.cpp:255 ../src/AccountWizard.cpp:439 +msgid "User" msgstr "" -#: AccountWizard.cpp:255 -msgid "Protocol : " +#: ../src/AccountWizard.cpp:256 ../src/AccountWizard.cpp:440 +msgid "Password" msgstr "" -#: AccountWizard.cpp:256 -msgid "Mailbox : " +#: ../src/AccountWizard.cpp:257 +msgid "Protocol" msgstr "" -#: AccountWizard.cpp:273 -msgid "Account Creation Wizard" +#: ../src/AccountWizard.cpp:258 +msgid "Mailbox" msgstr "" -#: AccountWizard.cpp:274 +#: ../src/AccountWizard.cpp:276 msgid "Welcome to the Account creation wizard of SFLPhone" msgstr "" -#: AccountWizard.cpp:276 +#: ../src/AccountWizard.cpp:278 msgid "This wizard will help you setting up an account." msgstr "" -#: AccountWizard.cpp:304 +#: ../src/AccountWizard.cpp:306 ../build/src/ui_ConfigDialog.h:1259 msgid "Accounts" msgstr "" -#: AccountWizard.cpp:305 +#: ../src/AccountWizard.cpp:307 msgid "Please choose between those options :" msgstr "" -#: AccountWizard.cpp:307 +#: ../src/AccountWizard.cpp:309 msgid "Create a free SIP/IAX2 account on sflphone.org" msgstr "" -#: AccountWizard.cpp:308 +#: ../src/AccountWizard.cpp:310 msgid "Register an existing SIP/IAX2 account" msgstr "" -#: AccountWizard.cpp:347 +#: ../src/AccountWizard.cpp:349 msgid "VoIP Protocols" msgstr "" -#: AccountWizard.cpp:348 -msgid "Choose the account type :" +#: ../src/AccountWizard.cpp:350 +msgid "Choose the account type" msgstr "" -#: AccountWizard.cpp:350 -msgid "Create a SIP (Session Initiation Protocol) account" +#: ../src/AccountWizard.cpp:352 +msgid "Register a SIP (Session Initiation Protocol) account" msgstr "" -#: AccountWizard.cpp:351 -msgid "Create a IAX2 (InterAsterisk eXchange) account" +#: ../src/AccountWizard.cpp:353 +msgid "Register a IAX2 (InterAsterisk eXchange) account" msgstr "" -#: AccountWizard.cpp:390 +#: ../src/AccountWizard.cpp:392 msgid "Optionnal Email Address" msgstr "" -#: AccountWizard.cpp:391 +#: ../src/AccountWizard.cpp:393 msgid "This email address will be used to send your voicemail messages." msgstr "" -#: AccountWizard.cpp:393 +#: ../src/AccountWizard.cpp:395 msgid "Email address" msgstr "" -#: AccountWizard.cpp:427 +#: ../src/AccountWizard.cpp:429 msgid "SIP Account Settings" msgstr "" -#: AccountWizard.cpp:431 +#: ../src/AccountWizard.cpp:433 msgid "IAX2 Account Settings" msgstr "" -#: AccountWizard.cpp:433 +#: ../src/AccountWizard.cpp:435 msgid "Please full these settings fields." msgstr "" -#: AccountWizard.cpp:435 -msgid "Alias *" -msgstr "" - -#: AccountWizard.cpp:436 -msgid "Server *" -msgstr "" - -#: AccountWizard.cpp:437 -msgid "User *" -msgstr "" - -#: AccountWizard.cpp:438 -msgid "Password *" -msgstr "" - -#: AccountWizard.cpp:510 +#: ../src/AccountWizard.cpp:512 msgid "Network Address Translation (NAT)" msgstr "" -#: AccountWizard.cpp:511 +#: ../src/AccountWizard.cpp:513 msgid "" -"You should probably enable this option if you're placed under a firewall :" +"You should probably enable this option if you're placed under a firewall" msgstr "" -#: AccountWizard.cpp:513 +#: ../src/AccountWizard.cpp:515 msgid "Enable STUN" msgstr "" -#: AccountWizard.cpp:514 +#: ../src/AccountWizard.cpp:516 msgid "Stun Server" msgstr "" -#: AccountWizard.cpp:548 +#: ../src/AccountWizard.cpp:550 msgid "Account Definition Finished" msgstr "" -#: AccountWizard.cpp:549 +#: ../src/AccountWizard.cpp:551 msgid "" "After checking the settings you chose, click \"Finish\" to create the " "account." msgstr "" -#: Call.cpp:96 +#: ../src/Call.cpp:116 msgid "Transfer to : " msgstr "" -#: SFLPhone.cpp:109 +#: ../src/ConfigDialog.cpp:131 ../src/ConfigDialog.cpp:263 +msgid "Attention : SIP port must be over 1024 !" +msgstr "" + +#: ../src/ConfigDialog.cpp:136 ../src/ConfigDialog.cpp:266 +msgid "Attention : SIP port must be under 65536 !" +msgstr "" + +#: ../src/main.cpp:49 ../src/main.cpp:50 +msgctxt "Your names" +msgid "NAME OF TRANSLATORS" +msgstr "" + +#: ../src/main.cpp:50 ../src/main.cpp:51 +msgctxt "Your emails" +msgid "EMAIL OF TRANSLATORS" +msgstr "" + +#: ../src/SFLPhone.cpp:55 ../src/sflphone_kdeview.cpp:1051 +#: ../src/sflphone_kdeview.cpp:1056 ../src/sflphone_kdeview.cpp:1061 +msgid "SFLPhone" +msgstr "" + +#: ../src/SFLPhone.cpp:154 msgid "You still have some calls open. Please close all calls before quitting." msgstr "" -#: sflphone_kdeview.cpp:984 sflphone_kdeview.cpp:1040 +#: ../src/SFLPhone.cpp:182 +msgid "Incoming call" +msgstr "" + +#: ../src/SFLPhone.cpp:183 +msgid "You have an incoming call from" +msgstr "" + +#: ../src/SFLPhone.cpp:183 +msgid "Click to accept or refuse it." +msgstr "" + +#: ../src/sflphone_kdeview.cpp:1051 +msgid "Main screen" +msgstr "" + +#: ../src/sflphone_kdeview.cpp:1056 ../build/src/ui_ConfigDialog.h:1271 +#: ../build/src/ui_dlggeneralbase.h:160 +msgid "Call history" +msgstr "" + +#: ../src/sflphone_kdeview.cpp:1061 +#: ../build/src/ui_sflphone_kdeview_base.h:507 +msgid "Address book" +msgstr "" + +#: ../src/sflphone_kdeview.cpp:1075 ../src/sflphone_kdeview.cpp:1131 msgid "Edit before call" msgstr "" -#: sflphone_const.h:51 -msgctxt "ton pere" +#: ../src/sflphone_const.h:56 msgid "Call" msgstr "" -#: sflphone_const.h:52 +#: ../src/sflphone_const.h:57 msgid "Hang up" msgstr "" -#: sflphone_const.h:53 +#: ../src/sflphone_const.h:58 msgid "Hold" msgstr "" -#: sflphone_const.h:54 +#: ../src/sflphone_const.h:59 msgid "Transfer" msgstr "" -#: sflphone_const.h:55 +#: ../src/sflphone_const.h:60 ../build/src/ui_ConfigDialog.h:1263 msgid "Record" msgstr "" -#: sflphone_const.h:56 +#: ../src/sflphone_const.h:61 msgid "Accept" msgstr "" -#: sflphone_const.h:57 +#: ../src/sflphone_const.h:62 msgid "Refuse" msgstr "" -#: sflphone_const.h:58 +#: ../src/sflphone_const.h:63 msgid "Unhold" msgstr "" -#: sflphone_const.h:59 +#: ../src/sflphone_const.h:64 msgid "Give up transfer" msgstr "" -#: sflphone_const.h:60 +#: ../src/sflphone_const.h:65 msgid "Call back" msgstr "" -#: sflphone_const.h:61 +#: ../src/sflphone_const.h:66 msgid "Give up search" msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1249 +msgid "Configuration Dialog" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1250 +msgid "about" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1255 ../build/src/ui_ConfigDialog.h:1337 +msgid "General" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1257 +msgid "Display" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1261 +msgid "Audio" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1265 +msgid "Address Book" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1267 +msgid "Hooks" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1270 +msgid "Configure general settings" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1272 ../build/src/ui_dlggeneralbase.h:161 +msgid "&Capacity" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1273 ../build/src/ui_dlggeneralbase.h:162 +msgid "C&lear history" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1274 ../build/src/ui_dlggeneralbase.h:163 +msgid "Connection" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1275 ../build/src/ui_dlggeneralbase.h:164 +msgid "SIP &Port" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1276 ../build/src/ui_dlggeneralbase.h:165 +msgid "Attention " +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1277 +msgid "Configure display" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1278 +msgid "Enable notifications" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1279 +msgid "On incoming &calls" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1280 +msgid "On &messages" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1281 +msgid "Show main window" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1282 +msgid "On &start" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1283 +msgid "On &incoming calls" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1284 +msgid "Configure user accounts" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1286 +msgid "Remove this account" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1287 +msgid "Backspace, Return" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1288 +msgid "Add a new account" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1289 +msgid "Down" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1290 +msgid "Up" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1291 +msgid "Apply" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1292 +msgid "&Alias" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1293 +msgid "&Protocol" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1296 +msgid "SIP" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1297 +msgid "IAX" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1299 +msgid "&Server" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1300 +msgid "&User" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1301 +msgid "Pass&word" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1302 +#: ../build/src/ui_sflphone_kdeview_base.h:498 +msgid "&Mailbox" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1303 +msgid "State" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1306 +msgid "Stun settings will be applied on each account" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1307 +msgid "&Enable Stun" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1308 +msgid "Configure audio settings" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1310 +msgid "Audio &device" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1313 +msgid "ALSA" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1314 +msgid "PulseAudio" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1316 +msgid "&Enable ringtones" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1317 +msgid "&Codecs" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1321 +msgid "Active" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1323 +msgid "Name" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1325 +msgid "Frequency" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1327 +msgid "Bitrate" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1329 +msgid "Bandwidth" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1330 +msgid "ALSA settings" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1331 +msgid "&In" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1332 +msgid "&Out" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1333 +msgid "ALSA &plugin" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1334 +msgid "PulseAudio settings" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1335 +msgid "Mute other applications during a call" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1336 +msgid "Configure record settings" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1338 +msgid "Destination folder" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1339 +msgid "Configure address book settings" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1340 +msgid "Maximum &results" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1341 +msgid "Display &photo if available" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1342 +msgid "Display phone numbers of these &types :" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1343 +msgid "&Work" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1344 +msgid "&Mobile" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1345 +msgid "&Home" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1346 +msgid "Configure hooks settings" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1347 +msgid "URL Argument" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1348 +msgid "SIP Protocol" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1349 +msgid "IAX2 Protocol" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1350 +msgid "SIP Header" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1351 +msgid "Command" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1352 +msgid "Phone number formatting" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1353 +msgid "Add phone number prefix" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1354 +msgid "Prepend" +msgstr "" + +#: ../build/src/ui_dlggeneralbase.h:159 +#: ../build/src/ui_sflphone_kdeview_base.h:492 +msgid "Form" +msgstr "" + +#: ../build/src/ui_sflphone_kdeview_base.h:493 +msgid "&Pick up" +msgstr "" + +#: ../build/src/ui_sflphone_kdeview_base.h:494 +msgid "&Hang up" +msgstr "" + +#: ../build/src/ui_sflphone_kdeview_base.h:495 +msgid "H&old" +msgstr "" + +#: ../build/src/ui_sflphone_kdeview_base.h:496 +msgid "&Transfer" +msgstr "" + +#: ../build/src/ui_sflphone_kdeview_base.h:497 +msgid "H&istory" +msgstr "" + +#: ../build/src/ui_sflphone_kdeview_base.h:499 +msgid "Configure &accounts" +msgstr "" + +#: ../build/src/ui_sflphone_kdeview_base.h:500 +msgid "Configure a&udio" +msgstr "" + +#: ../build/src/ui_sflphone_kdeview_base.h:501 +msgid "&Configure SFLPhone" +msgstr "" + +#: ../build/src/ui_sflphone_kdeview_base.h:502 +msgid "Display &volume bars" +msgstr "" + +#: ../build/src/ui_sflphone_kdeview_base.h:503 +msgid "&About" +msgstr "" + +#: ../build/src/ui_sflphone_kdeview_base.h:504 +msgid "Display &dialpad" +msgstr "" + +#: ../build/src/ui_sflphone_kdeview_base.h:505 +msgid "&Record" +msgstr "" + +#: ../build/src/ui_sflphone_kdeview_base.h:506 +msgid "Account creation &wizard" +msgstr "" + +#: ../build/src/ui_sflphone_kdeview_base.h:508 +msgid "Attention:number of results exceeds max displayed." +msgstr "" diff --git a/sflphone-client-kde/po/sflphone-client-kde_fr.po b/sflphone-client-kde/po/sflphone-client-kde_fr.po deleted file mode 100644 index c02b586ab118e99401b9435e5353c0a5a31fa3fc..0000000000000000000000000000000000000000 --- a/sflphone-client-kde/po/sflphone-client-kde_fr.po +++ /dev/null @@ -1,225 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the PACKAGE package. -# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: PACKAGE VERSION\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-05-05 12:00-0400\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" -"Language-Team: LANGUAGE <LL@li.org>\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=CHARSET\n" -"Content-Transfer-Encoding: 8bit\n" - -#: AccountWizard.cpp:163 -msgid "Account Wizard" -msgstr "Assistant de création de compte" - -#: AccountWizard.cpp:198 -msgid "Creation of account succeed with parameters :\n" -msgstr "Compte créé avec succès avec les paramètres :\n" - -#: AccountWizard.cpp:209 -msgid "Creation of account has failed for the reason :\n" -msgstr "Création de compte échouée pour raison :\n" - -#: AccountWizard.cpp:215 -msgid "Register of account succeed with parameters :\n" -msgstr "Compte enregistré avec succès avec les paramètres :\n" - -#: AccountWizard.cpp:251 -msgid "Alias : " -msgstr "Alias : " - -#: AccountWizard.cpp:252 -msgid "Server : " -msgstr "Serveur : " - -#: AccountWizard.cpp:253 -msgid "User : " -msgstr "Utilisateur : " - -#: AccountWizard.cpp:254 -msgid "Password : " -msgstr "Mot de passe : " - -#: AccountWizard.cpp:255 -msgid "Protocol : " -msgstr "Protocole : " - -#: AccountWizard.cpp:256 -msgid "Mailbox : " -msgstr "Boîte vocale : " - -#: AccountWizard.cpp:273 -msgid "Account Creation Wizard" -msgstr "Assistant de création de compte" - -#: AccountWizard.cpp:274 -msgid "Welcome to the Account creation wizard of SFLPhone" -msgstr "Bienvenue dans l'assistant de création de compte de SFLPhone" - -#: AccountWizard.cpp:276 -msgid "This wizard will help you setting up an account." -msgstr "Cet assistant va vous aider à créer et paramètrer un compte" - -#: AccountWizard.cpp:304 -msgid "Accounts" -msgstr "Comptes" - -#: AccountWizard.cpp:305 -msgid "Please choose between those options :" -msgstr "Choisissez une des options :" - -#: AccountWizard.cpp:307 -msgid "Create a free SIP/IAX2 account on sflphone.org" -msgstr "Créer un compte gratuit SIP/IAX2 sur sflphone.org" - -#: AccountWizard.cpp:308 -msgid "Register an existing SIP/IAX2 account" -msgstr "Enregistrer un compte SIP/IAX2 existant" - -#: AccountWizard.cpp:347 -msgid "VoIP Protocols" -msgstr "Protocoles VoIP" - -#: AccountWizard.cpp:348 -msgid "Choose the account type :" -msgstr "Choisissez le type de compte :" - -#: AccountWizard.cpp:350 -msgid "Create a SIP (Session Initiation Protocol) account" -msgstr "Créer un compte SIP (Session Initiation Protocol)" - -#: AccountWizard.cpp:351 -msgid "Create a IAX2 (InterAsterisk eXchange) account" -msgstr "Créer un compte IAX2 (InterAsterisk eXchange)" - -#: AccountWizard.cpp:390 -msgid "Optionnal Email Address" -msgstr "Adresse email (optionnel)" - -#: AccountWizard.cpp:391 -msgid "This email address will be used to send your voicemail messages." -msgstr "Cette adresse email sera utilisée pour l'envoi des messages vocaux et textes" - -#: AccountWizard.cpp:393 -msgid "Email address" -msgstr "" - -#: AccountWizard.cpp:427 -msgid "SIP Account Settings" -msgstr "" - -#: AccountWizard.cpp:431 -msgid "IAX2 Account Settings" -msgstr "" - -#: AccountWizard.cpp:433 -msgid "Please full these settings fields." -msgstr "" - -#: AccountWizard.cpp:435 -msgid "Alias *" -msgstr "" - -#: AccountWizard.cpp:436 -msgid "Server *" -msgstr "" - -#: AccountWizard.cpp:437 -msgid "User *" -msgstr "" - -#: AccountWizard.cpp:438 -msgid "Password *" -msgstr "" - -#: AccountWizard.cpp:510 -msgid "Network Address Translation (NAT)" -msgstr "" - -#: AccountWizard.cpp:511 -msgid "" -"You should probably enable this option if you're placed under a firewall :" -msgstr "" - -#: AccountWizard.cpp:513 -msgid "Enable STUN" -msgstr "" - -#: AccountWizard.cpp:514 -msgid "Stun Server" -msgstr "" - -#: AccountWizard.cpp:548 -msgid "Account Definition Finished" -msgstr "" - -#: AccountWizard.cpp:549 -msgid "" -"After checking the settings you chose, click \"Finish\" to create the " -"account." -msgstr "" - -#: Call.cpp:96 -msgid "Transfer to : " -msgstr "" - -#: SFLPhone.cpp:109 -msgid "You still have some calls open. Please close all calls before quitting." -msgstr "" - -#: sflphone_kdeview.cpp:984 sflphone_kdeview.cpp:1040 -msgid "Edit before call" -msgstr "" - -#: sflphone_const.h:51 -msgctxt "ton pere" -msgid "Call" -msgstr "" - -#: sflphone_const.h:52 -msgid "Hang up" -msgstr "" - -#: sflphone_const.h:53 -msgid "Hold" -msgstr "" - -#: sflphone_const.h:54 -msgid "Transfer" -msgstr "" - -#: sflphone_const.h:55 -msgid "Record" -msgstr "" - -#: sflphone_const.h:56 -msgid "Accept" -msgstr "" - -#: sflphone_const.h:57 -msgid "Refuse" -msgstr "" - -#: sflphone_const.h:58 -msgid "Unhold" -msgstr "" - -#: sflphone_const.h:59 -msgid "Give up transfer" -msgstr "" - -#: sflphone_const.h:60 -msgid "Call back" -msgstr "" - -#: sflphone_const.h:61 -msgid "Give up search" -msgstr "" diff --git a/sflphone-client-kde/po/update.sh b/sflphone-client-kde/po/update.sh new file mode 100755 index 0000000000000000000000000000000000000000..3fe757660a4535a2639e9a29ef876d5e5c3a91c4 --- /dev/null +++ b/sflphone-client-kde/po/update.sh @@ -0,0 +1,6 @@ +xgettext --from-code=utf-8 --c++ --kde -ktr2i18n -kki18nc:1c,2 -kki18n -ki18n -ki18nc:1c,2 -o sflphone-client-kde.pot ../src/*.cpp ../src/*.h ../src/conf/*.h ../src/conf/*.cpp ../build/src/*.h ../build/src/*.cpp + +for fichier in `find . -name *.po ` +do +msgmerge --update $fichier sflphone-client-kde.pot +done \ No newline at end of file diff --git a/sflphone-client-kde/po/zh_CN/CMakeLists.txt b/sflphone-client-kde/po/zh_CN/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..d1c85c8e816bb5b893526c055313dd92ce209fd7 --- /dev/null +++ b/sflphone-client-kde/po/zh_CN/CMakeLists.txt @@ -0,0 +1,2 @@ +file(GLOB _po_files *.po) +GETTEXT_PROCESS_PO_FILES(zh_CN ALL INSTALL_DESTINATION ${LOCALE_INSTALL_DIR} ${_po_files} ) diff --git a/sflphone-client-kde/po/zh_CN/sflphone-client-kde.po b/sflphone-client-kde/po/zh_CN/sflphone-client-kde.po new file mode 100644 index 0000000000000000000000000000000000000000..d8af45b68bdc669a021952c89c623dfdfc4621c0 --- /dev/null +++ b/sflphone-client-kde/po/zh_CN/sflphone-client-kde.po @@ -0,0 +1,607 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2009-06-17 15:48-0400\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: LANGUAGE <LL@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: ../src/AccountWizard.cpp:161 ../src/AccountWizard.cpp:275 +msgid "Account Creation Wizard" +msgstr "" + +#: ../src/AccountWizard.cpp:200 +msgid "Creation of account succeed with these parameters" +msgstr "" + +#: ../src/AccountWizard.cpp:211 +msgid "Creation of account has failed for the reason" +msgstr "" + +#: ../src/AccountWizard.cpp:217 +msgid "Register of account succeed with these parameters" +msgstr "" + +#: ../src/AccountWizard.cpp:253 ../src/AccountWizard.cpp:437 +msgid "Alias" +msgstr "" + +#: ../src/AccountWizard.cpp:254 ../src/AccountWizard.cpp:438 +msgid "Server" +msgstr "" + +#: ../src/AccountWizard.cpp:255 ../src/AccountWizard.cpp:439 +msgid "User" +msgstr "" + +#: ../src/AccountWizard.cpp:256 ../src/AccountWizard.cpp:440 +msgid "Password" +msgstr "" + +#: ../src/AccountWizard.cpp:257 +msgid "Protocol" +msgstr "" + +#: ../src/AccountWizard.cpp:258 +msgid "Mailbox" +msgstr "" + +#: ../src/AccountWizard.cpp:276 +msgid "Welcome to the Account creation wizard of SFLPhone" +msgstr "" + +#: ../src/AccountWizard.cpp:278 +msgid "This wizard will help you setting up an account." +msgstr "" + +#: ../src/AccountWizard.cpp:306 ../build/src/ui_ConfigDialog.h:1259 +msgid "Accounts" +msgstr "" + +#: ../src/AccountWizard.cpp:307 +msgid "Please choose between those options :" +msgstr "" + +#: ../src/AccountWizard.cpp:309 +msgid "Create a free SIP/IAX2 account on sflphone.org" +msgstr "" + +#: ../src/AccountWizard.cpp:310 +msgid "Register an existing SIP/IAX2 account" +msgstr "" + +#: ../src/AccountWizard.cpp:349 +msgid "VoIP Protocols" +msgstr "" + +#: ../src/AccountWizard.cpp:350 +msgid "Choose the account type" +msgstr "" + +#: ../src/AccountWizard.cpp:352 +msgid "Register a SIP (Session Initiation Protocol) account" +msgstr "" + +#: ../src/AccountWizard.cpp:353 +msgid "Register a IAX2 (InterAsterisk eXchange) account" +msgstr "" + +#: ../src/AccountWizard.cpp:392 +msgid "Optionnal Email Address" +msgstr "" + +#: ../src/AccountWizard.cpp:393 +msgid "This email address will be used to send your voicemail messages." +msgstr "" + +#: ../src/AccountWizard.cpp:395 +msgid "Email address" +msgstr "" + +#: ../src/AccountWizard.cpp:429 +msgid "SIP Account Settings" +msgstr "" + +#: ../src/AccountWizard.cpp:433 +msgid "IAX2 Account Settings" +msgstr "" + +#: ../src/AccountWizard.cpp:435 +msgid "Please full these settings fields." +msgstr "" + +#: ../src/AccountWizard.cpp:512 +msgid "Network Address Translation (NAT)" +msgstr "" + +#: ../src/AccountWizard.cpp:513 +msgid "" +"You should probably enable this option if you're placed under a firewall" +msgstr "" + +#: ../src/AccountWizard.cpp:515 +msgid "Enable STUN" +msgstr "" + +#: ../src/AccountWizard.cpp:516 +msgid "Stun Server" +msgstr "" + +#: ../src/AccountWizard.cpp:550 +msgid "Account Definition Finished" +msgstr "" + +#: ../src/AccountWizard.cpp:551 +msgid "" +"After checking the settings you chose, click \"Finish\" to create the " +"account." +msgstr "" + +#: ../src/Call.cpp:116 +msgid "Transfer to : " +msgstr "" + +#: ../src/ConfigDialog.cpp:131 ../src/ConfigDialog.cpp:263 +msgid "Attention : SIP port must be over 1024 !" +msgstr "" + +#: ../src/ConfigDialog.cpp:136 ../src/ConfigDialog.cpp:266 +msgid "Attention : SIP port must be under 65536 !" +msgstr "" + +#: ../src/main.cpp:49 ../src/main.cpp:50 +msgctxt "Your names" +msgid "NAME OF TRANSLATORS" +msgstr "" + +#: ../src/main.cpp:50 ../src/main.cpp:51 +msgctxt "Your emails" +msgid "EMAIL OF TRANSLATORS" +msgstr "" + +#: ../src/SFLPhone.cpp:55 ../src/sflphone_kdeview.cpp:1051 +#: ../src/sflphone_kdeview.cpp:1056 ../src/sflphone_kdeview.cpp:1061 +msgid "SFLPhone" +msgstr "" + +#: ../src/SFLPhone.cpp:154 +msgid "You still have some calls open. Please close all calls before quitting." +msgstr "" + +#: ../src/SFLPhone.cpp:182 +msgid "Incoming call" +msgstr "" + +#: ../src/SFLPhone.cpp:183 +msgid "You have an incoming call from" +msgstr "" + +#: ../src/SFLPhone.cpp:183 +msgid "Click to accept or refuse it." +msgstr "" + +#: ../src/sflphone_kdeview.cpp:1051 +msgid "Main screen" +msgstr "" + +#: ../src/sflphone_kdeview.cpp:1056 ../build/src/ui_ConfigDialog.h:1271 +#: ../build/src/ui_dlggeneralbase.h:160 +msgid "Call history" +msgstr "" + +#: ../src/sflphone_kdeview.cpp:1061 +#: ../build/src/ui_sflphone_kdeview_base.h:507 +msgid "Address book" +msgstr "" + +#: ../src/sflphone_kdeview.cpp:1075 ../src/sflphone_kdeview.cpp:1131 +msgid "Edit before call" +msgstr "" + +#: ../src/sflphone_const.h:56 +msgid "Call" +msgstr "" + +#: ../src/sflphone_const.h:57 +msgid "Hang up" +msgstr "" + +#: ../src/sflphone_const.h:58 +msgid "Hold" +msgstr "" + +#: ../src/sflphone_const.h:59 +msgid "Transfer" +msgstr "" + +#: ../src/sflphone_const.h:60 ../build/src/ui_ConfigDialog.h:1263 +msgid "Record" +msgstr "" + +#: ../src/sflphone_const.h:61 +msgid "Accept" +msgstr "" + +#: ../src/sflphone_const.h:62 +msgid "Refuse" +msgstr "" + +#: ../src/sflphone_const.h:63 +msgid "Unhold" +msgstr "" + +#: ../src/sflphone_const.h:64 +msgid "Give up transfer" +msgstr "" + +#: ../src/sflphone_const.h:65 +msgid "Call back" +msgstr "" + +#: ../src/sflphone_const.h:66 +msgid "Give up search" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1249 +msgid "Configuration Dialog" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1250 +msgid "about" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1255 ../build/src/ui_ConfigDialog.h:1337 +msgid "General" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1257 +msgid "Display" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1261 +msgid "Audio" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1265 +msgid "Address Book" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1267 +msgid "Hooks" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1270 +msgid "Configure general settings" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1272 ../build/src/ui_dlggeneralbase.h:161 +msgid "&Capacity" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1273 ../build/src/ui_dlggeneralbase.h:162 +msgid "C&lear history" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1274 ../build/src/ui_dlggeneralbase.h:163 +msgid "Connection" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1275 ../build/src/ui_dlggeneralbase.h:164 +msgid "SIP &Port" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1276 ../build/src/ui_dlggeneralbase.h:165 +msgid "Attention " +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1277 +msgid "Configure display" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1278 +msgid "Enable notifications" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1279 +msgid "On incoming &calls" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1280 +msgid "On &messages" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1281 +msgid "Show main window" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1282 +msgid "On &start" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1283 +msgid "On &incoming calls" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1284 +msgid "Configure user accounts" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1286 +msgid "Remove this account" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1287 +msgid "Backspace, Return" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1288 +msgid "Add a new account" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1289 +msgid "Down" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1290 +msgid "Up" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1291 +msgid "Apply" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1292 +msgid "&Alias" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1293 +msgid "&Protocol" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1296 +msgid "SIP" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1297 +msgid "IAX" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1299 +msgid "&Server" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1300 +msgid "&User" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1301 +msgid "Pass&word" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1302 +#: ../build/src/ui_sflphone_kdeview_base.h:498 +msgid "&Mailbox" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1303 +msgid "State" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1306 +msgid "Stun settings will be applied on each account" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1307 +msgid "&Enable Stun" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1308 +msgid "Configure audio settings" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1310 +msgid "Audio &device" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1313 +msgid "ALSA" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1314 +msgid "PulseAudio" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1316 +msgid "&Enable ringtones" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1317 +msgid "&Codecs" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1321 +msgid "Active" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1323 +msgid "Name" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1325 +msgid "Frequency" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1327 +msgid "Bitrate" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1329 +msgid "Bandwidth" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1330 +msgid "ALSA settings" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1331 +msgid "&In" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1332 +msgid "&Out" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1333 +msgid "ALSA &plugin" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1334 +msgid "PulseAudio settings" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1335 +msgid "Mute other applications during a call" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1336 +msgid "Configure record settings" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1338 +msgid "Destination folder" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1339 +msgid "Configure address book settings" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1340 +msgid "Maximum &results" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1341 +msgid "Display &photo if available" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1342 +msgid "Display phone numbers of these &types :" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1343 +msgid "&Work" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1344 +msgid "&Mobile" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1345 +msgid "&Home" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1346 +msgid "Configure hooks settings" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1347 +msgid "URL Argument" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1348 +msgid "SIP Protocol" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1349 +msgid "IAX2 Protocol" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1350 +msgid "SIP Header" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1351 +msgid "Command" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1352 +msgid "Phone number formatting" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1353 +msgid "Add phone number prefix" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1354 +msgid "Prepend" +msgstr "" + +#: ../build/src/ui_dlggeneralbase.h:159 +#: ../build/src/ui_sflphone_kdeview_base.h:492 +msgid "Form" +msgstr "" + +#: ../build/src/ui_sflphone_kdeview_base.h:493 +msgid "&Pick up" +msgstr "" + +#: ../build/src/ui_sflphone_kdeview_base.h:494 +msgid "&Hang up" +msgstr "" + +#: ../build/src/ui_sflphone_kdeview_base.h:495 +msgid "H&old" +msgstr "" + +#: ../build/src/ui_sflphone_kdeview_base.h:496 +msgid "&Transfer" +msgstr "" + +#: ../build/src/ui_sflphone_kdeview_base.h:497 +msgid "H&istory" +msgstr "" + +#: ../build/src/ui_sflphone_kdeview_base.h:499 +msgid "Configure &accounts" +msgstr "" + +#: ../build/src/ui_sflphone_kdeview_base.h:500 +msgid "Configure a&udio" +msgstr "" + +#: ../build/src/ui_sflphone_kdeview_base.h:501 +msgid "&Configure SFLPhone" +msgstr "" + +#: ../build/src/ui_sflphone_kdeview_base.h:502 +msgid "Display &volume bars" +msgstr "" + +#: ../build/src/ui_sflphone_kdeview_base.h:503 +msgid "&About" +msgstr "" + +#: ../build/src/ui_sflphone_kdeview_base.h:504 +msgid "Display &dialpad" +msgstr "" + +#: ../build/src/ui_sflphone_kdeview_base.h:505 +msgid "&Record" +msgstr "" + +#: ../build/src/ui_sflphone_kdeview_base.h:506 +msgid "Account creation &wizard" +msgstr "" + +#: ../build/src/ui_sflphone_kdeview_base.h:508 +msgid "Attention:number of results exceeds max displayed." +msgstr "" diff --git a/sflphone-client-kde/po/zh_HK/CMakeLists.txt b/sflphone-client-kde/po/zh_HK/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..90a1ffa2411968a18799be5759069b0472534204 --- /dev/null +++ b/sflphone-client-kde/po/zh_HK/CMakeLists.txt @@ -0,0 +1,2 @@ +file(GLOB _po_files *.po) +GETTEXT_PROCESS_PO_FILES(zh_HK ALL INSTALL_DESTINATION ${LOCALE_INSTALL_DIR} ${_po_files} ) diff --git a/sflphone-client-kde/po/zh_HK/sflphone-client-kde.po b/sflphone-client-kde/po/zh_HK/sflphone-client-kde.po new file mode 100644 index 0000000000000000000000000000000000000000..d8af45b68bdc669a021952c89c623dfdfc4621c0 --- /dev/null +++ b/sflphone-client-kde/po/zh_HK/sflphone-client-kde.po @@ -0,0 +1,607 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2009-06-17 15:48-0400\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: LANGUAGE <LL@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: ../src/AccountWizard.cpp:161 ../src/AccountWizard.cpp:275 +msgid "Account Creation Wizard" +msgstr "" + +#: ../src/AccountWizard.cpp:200 +msgid "Creation of account succeed with these parameters" +msgstr "" + +#: ../src/AccountWizard.cpp:211 +msgid "Creation of account has failed for the reason" +msgstr "" + +#: ../src/AccountWizard.cpp:217 +msgid "Register of account succeed with these parameters" +msgstr "" + +#: ../src/AccountWizard.cpp:253 ../src/AccountWizard.cpp:437 +msgid "Alias" +msgstr "" + +#: ../src/AccountWizard.cpp:254 ../src/AccountWizard.cpp:438 +msgid "Server" +msgstr "" + +#: ../src/AccountWizard.cpp:255 ../src/AccountWizard.cpp:439 +msgid "User" +msgstr "" + +#: ../src/AccountWizard.cpp:256 ../src/AccountWizard.cpp:440 +msgid "Password" +msgstr "" + +#: ../src/AccountWizard.cpp:257 +msgid "Protocol" +msgstr "" + +#: ../src/AccountWizard.cpp:258 +msgid "Mailbox" +msgstr "" + +#: ../src/AccountWizard.cpp:276 +msgid "Welcome to the Account creation wizard of SFLPhone" +msgstr "" + +#: ../src/AccountWizard.cpp:278 +msgid "This wizard will help you setting up an account." +msgstr "" + +#: ../src/AccountWizard.cpp:306 ../build/src/ui_ConfigDialog.h:1259 +msgid "Accounts" +msgstr "" + +#: ../src/AccountWizard.cpp:307 +msgid "Please choose between those options :" +msgstr "" + +#: ../src/AccountWizard.cpp:309 +msgid "Create a free SIP/IAX2 account on sflphone.org" +msgstr "" + +#: ../src/AccountWizard.cpp:310 +msgid "Register an existing SIP/IAX2 account" +msgstr "" + +#: ../src/AccountWizard.cpp:349 +msgid "VoIP Protocols" +msgstr "" + +#: ../src/AccountWizard.cpp:350 +msgid "Choose the account type" +msgstr "" + +#: ../src/AccountWizard.cpp:352 +msgid "Register a SIP (Session Initiation Protocol) account" +msgstr "" + +#: ../src/AccountWizard.cpp:353 +msgid "Register a IAX2 (InterAsterisk eXchange) account" +msgstr "" + +#: ../src/AccountWizard.cpp:392 +msgid "Optionnal Email Address" +msgstr "" + +#: ../src/AccountWizard.cpp:393 +msgid "This email address will be used to send your voicemail messages." +msgstr "" + +#: ../src/AccountWizard.cpp:395 +msgid "Email address" +msgstr "" + +#: ../src/AccountWizard.cpp:429 +msgid "SIP Account Settings" +msgstr "" + +#: ../src/AccountWizard.cpp:433 +msgid "IAX2 Account Settings" +msgstr "" + +#: ../src/AccountWizard.cpp:435 +msgid "Please full these settings fields." +msgstr "" + +#: ../src/AccountWizard.cpp:512 +msgid "Network Address Translation (NAT)" +msgstr "" + +#: ../src/AccountWizard.cpp:513 +msgid "" +"You should probably enable this option if you're placed under a firewall" +msgstr "" + +#: ../src/AccountWizard.cpp:515 +msgid "Enable STUN" +msgstr "" + +#: ../src/AccountWizard.cpp:516 +msgid "Stun Server" +msgstr "" + +#: ../src/AccountWizard.cpp:550 +msgid "Account Definition Finished" +msgstr "" + +#: ../src/AccountWizard.cpp:551 +msgid "" +"After checking the settings you chose, click \"Finish\" to create the " +"account." +msgstr "" + +#: ../src/Call.cpp:116 +msgid "Transfer to : " +msgstr "" + +#: ../src/ConfigDialog.cpp:131 ../src/ConfigDialog.cpp:263 +msgid "Attention : SIP port must be over 1024 !" +msgstr "" + +#: ../src/ConfigDialog.cpp:136 ../src/ConfigDialog.cpp:266 +msgid "Attention : SIP port must be under 65536 !" +msgstr "" + +#: ../src/main.cpp:49 ../src/main.cpp:50 +msgctxt "Your names" +msgid "NAME OF TRANSLATORS" +msgstr "" + +#: ../src/main.cpp:50 ../src/main.cpp:51 +msgctxt "Your emails" +msgid "EMAIL OF TRANSLATORS" +msgstr "" + +#: ../src/SFLPhone.cpp:55 ../src/sflphone_kdeview.cpp:1051 +#: ../src/sflphone_kdeview.cpp:1056 ../src/sflphone_kdeview.cpp:1061 +msgid "SFLPhone" +msgstr "" + +#: ../src/SFLPhone.cpp:154 +msgid "You still have some calls open. Please close all calls before quitting." +msgstr "" + +#: ../src/SFLPhone.cpp:182 +msgid "Incoming call" +msgstr "" + +#: ../src/SFLPhone.cpp:183 +msgid "You have an incoming call from" +msgstr "" + +#: ../src/SFLPhone.cpp:183 +msgid "Click to accept or refuse it." +msgstr "" + +#: ../src/sflphone_kdeview.cpp:1051 +msgid "Main screen" +msgstr "" + +#: ../src/sflphone_kdeview.cpp:1056 ../build/src/ui_ConfigDialog.h:1271 +#: ../build/src/ui_dlggeneralbase.h:160 +msgid "Call history" +msgstr "" + +#: ../src/sflphone_kdeview.cpp:1061 +#: ../build/src/ui_sflphone_kdeview_base.h:507 +msgid "Address book" +msgstr "" + +#: ../src/sflphone_kdeview.cpp:1075 ../src/sflphone_kdeview.cpp:1131 +msgid "Edit before call" +msgstr "" + +#: ../src/sflphone_const.h:56 +msgid "Call" +msgstr "" + +#: ../src/sflphone_const.h:57 +msgid "Hang up" +msgstr "" + +#: ../src/sflphone_const.h:58 +msgid "Hold" +msgstr "" + +#: ../src/sflphone_const.h:59 +msgid "Transfer" +msgstr "" + +#: ../src/sflphone_const.h:60 ../build/src/ui_ConfigDialog.h:1263 +msgid "Record" +msgstr "" + +#: ../src/sflphone_const.h:61 +msgid "Accept" +msgstr "" + +#: ../src/sflphone_const.h:62 +msgid "Refuse" +msgstr "" + +#: ../src/sflphone_const.h:63 +msgid "Unhold" +msgstr "" + +#: ../src/sflphone_const.h:64 +msgid "Give up transfer" +msgstr "" + +#: ../src/sflphone_const.h:65 +msgid "Call back" +msgstr "" + +#: ../src/sflphone_const.h:66 +msgid "Give up search" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1249 +msgid "Configuration Dialog" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1250 +msgid "about" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1255 ../build/src/ui_ConfigDialog.h:1337 +msgid "General" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1257 +msgid "Display" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1261 +msgid "Audio" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1265 +msgid "Address Book" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1267 +msgid "Hooks" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1270 +msgid "Configure general settings" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1272 ../build/src/ui_dlggeneralbase.h:161 +msgid "&Capacity" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1273 ../build/src/ui_dlggeneralbase.h:162 +msgid "C&lear history" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1274 ../build/src/ui_dlggeneralbase.h:163 +msgid "Connection" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1275 ../build/src/ui_dlggeneralbase.h:164 +msgid "SIP &Port" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1276 ../build/src/ui_dlggeneralbase.h:165 +msgid "Attention " +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1277 +msgid "Configure display" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1278 +msgid "Enable notifications" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1279 +msgid "On incoming &calls" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1280 +msgid "On &messages" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1281 +msgid "Show main window" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1282 +msgid "On &start" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1283 +msgid "On &incoming calls" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1284 +msgid "Configure user accounts" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1286 +msgid "Remove this account" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1287 +msgid "Backspace, Return" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1288 +msgid "Add a new account" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1289 +msgid "Down" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1290 +msgid "Up" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1291 +msgid "Apply" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1292 +msgid "&Alias" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1293 +msgid "&Protocol" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1296 +msgid "SIP" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1297 +msgid "IAX" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1299 +msgid "&Server" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1300 +msgid "&User" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1301 +msgid "Pass&word" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1302 +#: ../build/src/ui_sflphone_kdeview_base.h:498 +msgid "&Mailbox" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1303 +msgid "State" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1306 +msgid "Stun settings will be applied on each account" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1307 +msgid "&Enable Stun" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1308 +msgid "Configure audio settings" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1310 +msgid "Audio &device" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1313 +msgid "ALSA" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1314 +msgid "PulseAudio" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1316 +msgid "&Enable ringtones" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1317 +msgid "&Codecs" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1321 +msgid "Active" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1323 +msgid "Name" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1325 +msgid "Frequency" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1327 +msgid "Bitrate" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1329 +msgid "Bandwidth" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1330 +msgid "ALSA settings" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1331 +msgid "&In" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1332 +msgid "&Out" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1333 +msgid "ALSA &plugin" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1334 +msgid "PulseAudio settings" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1335 +msgid "Mute other applications during a call" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1336 +msgid "Configure record settings" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1338 +msgid "Destination folder" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1339 +msgid "Configure address book settings" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1340 +msgid "Maximum &results" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1341 +msgid "Display &photo if available" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1342 +msgid "Display phone numbers of these &types :" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1343 +msgid "&Work" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1344 +msgid "&Mobile" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1345 +msgid "&Home" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1346 +msgid "Configure hooks settings" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1347 +msgid "URL Argument" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1348 +msgid "SIP Protocol" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1349 +msgid "IAX2 Protocol" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1350 +msgid "SIP Header" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1351 +msgid "Command" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1352 +msgid "Phone number formatting" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1353 +msgid "Add phone number prefix" +msgstr "" + +#: ../build/src/ui_ConfigDialog.h:1354 +msgid "Prepend" +msgstr "" + +#: ../build/src/ui_dlggeneralbase.h:159 +#: ../build/src/ui_sflphone_kdeview_base.h:492 +msgid "Form" +msgstr "" + +#: ../build/src/ui_sflphone_kdeview_base.h:493 +msgid "&Pick up" +msgstr "" + +#: ../build/src/ui_sflphone_kdeview_base.h:494 +msgid "&Hang up" +msgstr "" + +#: ../build/src/ui_sflphone_kdeview_base.h:495 +msgid "H&old" +msgstr "" + +#: ../build/src/ui_sflphone_kdeview_base.h:496 +msgid "&Transfer" +msgstr "" + +#: ../build/src/ui_sflphone_kdeview_base.h:497 +msgid "H&istory" +msgstr "" + +#: ../build/src/ui_sflphone_kdeview_base.h:499 +msgid "Configure &accounts" +msgstr "" + +#: ../build/src/ui_sflphone_kdeview_base.h:500 +msgid "Configure a&udio" +msgstr "" + +#: ../build/src/ui_sflphone_kdeview_base.h:501 +msgid "&Configure SFLPhone" +msgstr "" + +#: ../build/src/ui_sflphone_kdeview_base.h:502 +msgid "Display &volume bars" +msgstr "" + +#: ../build/src/ui_sflphone_kdeview_base.h:503 +msgid "&About" +msgstr "" + +#: ../build/src/ui_sflphone_kdeview_base.h:504 +msgid "Display &dialpad" +msgstr "" + +#: ../build/src/ui_sflphone_kdeview_base.h:505 +msgid "&Record" +msgstr "" + +#: ../build/src/ui_sflphone_kdeview_base.h:506 +msgid "Account creation &wizard" +msgstr "" + +#: ../build/src/ui_sflphone_kdeview_base.h:508 +msgid "Attention:number of results exceeds max displayed." +msgstr "" diff --git a/sflphone-client-kde/src/Account.cpp b/sflphone-client-kde/src/Account.cpp index 5939416faca9bed141fe62ddfe2174bb6e9904cf..e4cbead64c0b1c1c68c0b23bfaacdca60de756b1 100644 --- a/sflphone-client-kde/src/Account.cpp +++ b/sflphone-client-kde/src/Account.cpp @@ -22,6 +22,7 @@ #include "Account.h" #include <QtGui/QApplication> +#include <klocale.h> #include "sflphone_const.h" #include "configurationmanager_interface_singleton.h" @@ -30,36 +31,49 @@ const QString account_state_name(QString & s) { if(s == QString(ACCOUNT_STATE_REGISTERED)) - return QApplication::translate("ConfigurationDialog", "Registered", 0, QApplication::UnicodeUTF8); + return i18nc("account state", "Registered" ); if(s == QString(ACCOUNT_STATE_UNREGISTERED)) - return QApplication::translate("ConfigurationDialog", "Not Registered", 0, QApplication::UnicodeUTF8); + return i18nc("account state", "Not Registered"); if(s == QString(ACCOUNT_STATE_TRYING)) - return QApplication::translate("ConfigurationDialog", "Trying...", 0, QApplication::UnicodeUTF8); + return i18nc("account state", "Trying..."); if(s == QString(ACCOUNT_STATE_ERROR)) - return QApplication::translate("ConfigurationDialog", "Error", 0, QApplication::UnicodeUTF8); + return i18nc("account state", "Error"); if(s == QString(ACCOUNT_STATE_ERROR_AUTH)) - return QApplication::translate("ConfigurationDialog", "Bad authentification", 0, QApplication::UnicodeUTF8); + return i18nc("account state", "Bad authentification"); if(s == QString(ACCOUNT_STATE_ERROR_NETWORK)) - return QApplication::translate("ConfigurationDialog", "Network unreachable", 0, QApplication::UnicodeUTF8); + return i18nc("account state", "Network unreachable"); if(s == QString(ACCOUNT_STATE_ERROR_HOST)) - return QApplication::translate("ConfigurationDialog", "Host unreachable", 0, QApplication::UnicodeUTF8); + return i18nc("account state", "Host unreachable"); if(s == QString(ACCOUNT_STATE_ERROR_CONF_STUN)) - return QApplication::translate("ConfigurationDialog", "Stun configuration error", 0, QApplication::UnicodeUTF8); + return i18nc("account state", "Stun configuration error"); if(s == QString(ACCOUNT_STATE_ERROR_EXIST_STUN)) - return QApplication::translate("ConfigurationDialog", "Stun server invalid", 0, QApplication::UnicodeUTF8); - return QApplication::translate("ConfigurationDialog", "Invalid", 0, QApplication::UnicodeUTF8); + return i18nc("account state", "Stun server invalid"); + return i18nc("account state", "Invalid"); } //Constructors -Account::Account():accountId(NULL){} +Account::Account():accountId(NULL), item(NULL), itemWidget(NULL){} void Account::initAccountItem() { + if(item != NULL) + { + delete item; + } item = new QListWidgetItem(); item->setSizeHint(QSize(140,25)); item->setFlags(Qt::ItemIsSelectable|Qt::ItemIsDragEnabled|Qt::ItemIsDropEnabled|Qt::ItemIsEnabled); + initAccountItemWidget(); +} + +void Account::initAccountItemWidget() +{ + if(itemWidget != NULL) + { + delete itemWidget; + } bool enabled = getAccountDetail(ACCOUNT_ENABLED) == ACCOUNT_ENABLED_TRUE; itemWidget = new AccountItemWidget(); itemWidget->setEnabled(enabled); @@ -83,6 +97,7 @@ Account * Account::buildExistingAccountFromId(QString _accountId) ConfigurationManagerInterface & configurationManager = ConfigurationManagerInterfaceSingleton::getInstance(); Account * a = new Account(); a->accountId = new QString(_accountId); + qDebug() << "getAccountDetails 1 sent"; a->accountDetails = new MapStringString( configurationManager.getAccountDetails(_accountId).value() ); a->initAccountItem(); return a; @@ -132,39 +147,13 @@ MapStringString & Account::getAccountDetails() const QListWidgetItem * Account::getItem() { - if(!item) - qDebug() << "null" ; - return item; -} - -QListWidgetItem * Account::renewItem() -{ - if(!item) - qDebug() << "null" ; - item = new QListWidgetItem(*item); + if(!item) { qDebug() << "null" ; } return item; } AccountItemWidget * Account::getItemWidget() { - delete itemWidget; - bool enabled = getAccountDetail(ACCOUNT_ENABLED) == ACCOUNT_ENABLED_TRUE; - QString alias = getAccountDetail(ACCOUNT_ALIAS); - itemWidget = new AccountItemWidget(); - itemWidget->setEnabled(enabled); - itemWidget->setAccountText(alias); - if(isNew() || !enabled) - { - itemWidget->setState(AccountItemWidget::Unregistered); - } - else if(getAccountDetail(ACCOUNT_STATUS) == ACCOUNT_STATE_REGISTERED) - { - itemWidget->setState(AccountItemWidget::Registered); - } - else - { - itemWidget->setState(AccountItemWidget::NotWorking); - } + if(itemWidget == NULL) { qDebug() << "null"; } return itemWidget; } @@ -176,9 +165,9 @@ QString Account::getStateName(QString & state) QColor Account::getStateColor() { if(getAccountDetail(ACCOUNT_STATUS) == ACCOUNT_STATE_UNREGISTERED) - return Qt::black; + { return Qt::black; } if(getAccountDetail(ACCOUNT_STATUS) == ACCOUNT_STATE_REGISTERED) - return Qt::darkGreen; + { return Qt::darkGreen; } return Qt::red; } @@ -186,9 +175,9 @@ QColor Account::getStateColor() QString Account::getStateColorName() { if(getAccountDetail(ACCOUNT_STATUS) == ACCOUNT_STATE_UNREGISTERED) - return "black"; + { return "black"; } if(getAccountDetail(ACCOUNT_STATUS) == ACCOUNT_STATE_REGISTERED) - return "darkGreen"; + { return "darkGreen"; } return "red"; } @@ -225,6 +214,34 @@ void Account::setAccountId(QString id) accountId = new QString(id); } +void Account::updateState() +{ + qDebug() << "updateState"; + if(! isNew()) + { + ConfigurationManagerInterface & configurationManager = ConfigurationManagerInterfaceSingleton::getInstance(); + MapStringString details = configurationManager.getAccountDetails(getAccountId()).value(); + AccountItemWidget * itemWidget = getItemWidget(); + QString status = details[ACCOUNT_STATUS]; + setAccountDetail(ACCOUNT_STATUS, status); + if(getAccountDetail(ACCOUNT_ENABLED) != ACCOUNT_ENABLED_TRUE ) + { + qDebug() << "itemWidget->setState(AccountItemWidget::Unregistered);"; + itemWidget->setState(AccountItemWidget::Unregistered); + } + else if(getAccountDetail(ACCOUNT_STATUS) == ACCOUNT_STATE_REGISTERED) + { + qDebug() << "itemWidget->setState(AccountItemWidget::Registered);"; + itemWidget->setState(AccountItemWidget::Registered); + } + else + { + qDebug() << "itemWidget->setState(AccountItemWidget::NotWorking);"; + itemWidget->setState(AccountItemWidget::NotWorking); + } + } +} + //Operators bool Account::operator==(const Account& a)const { diff --git a/sflphone-client-kde/src/Account.h b/sflphone-client-kde/src/Account.h index a31c9a2ba671a0157803cf9a8ece86f244852e8c..e1463bb64e3b280999f25f7a14e1bc7b49392187 100644 --- a/sflphone-client-kde/src/Account.h +++ b/sflphone-client-kde/src/Account.h @@ -26,11 +26,9 @@ #include <QtGui/QListWidgetItem> #include <QtGui/QColor> -// #include "metatypes.h" +#include "typedefs.h" #include "AccountItemWidget.h" -typedef QMap<QString, QString> MapStringString; - const QString account_state_name(QString & s); class Account{ @@ -58,7 +56,6 @@ public: QString & getAccountId(); MapStringString & getAccountDetails() const; QListWidgetItem * getItem(); - QListWidgetItem * renewItem(); AccountItemWidget * getItemWidget(); QString getStateName(QString & state); QColor getStateColor(); @@ -67,11 +64,15 @@ public: QString getAlias(); //Setters - void initAccountItem(); void setAccountId(QString id); void setAccountDetails(MapStringString m); void setAccountDetail(QString param, QString val); + //Updates + void initAccountItem(); + void initAccountItemWidget(); + void updateState(); + //Operators bool operator==(const Account&)const; diff --git a/sflphone-client-kde/src/AccountItemWidget.cpp b/sflphone-client-kde/src/AccountItemWidget.cpp index eb4beda0638cf8a6e17887b409c06ce0f2b18e3b..ab841e83a60a089db27df0bae82344571972aa49 100644 --- a/sflphone-client-kde/src/AccountItemWidget.cpp +++ b/sflphone-client-kde/src/AccountItemWidget.cpp @@ -30,7 +30,8 @@ AccountItemWidget::AccountItemWidget(QWidget *parent) : QWidget(parent) { checkBox = new QCheckBox(this); - led = new KLed(this); + checkBox->setObjectName("checkBox"); + led = new QLabel(); led->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed)); textLabel = new QLabel(); @@ -45,6 +46,11 @@ AccountItemWidget::AccountItemWidget(QWidget *parent) state = Unregistered; enabled = false; updateDisplay(); + +// connect(checkBox, SIGNAL(stateChanged(int)), +// this, SLOT(on_checkBox_stateChanged())); + + QMetaObject::connectSlotsByName(this); } @@ -61,16 +67,13 @@ void AccountItemWidget::updateStateDisplay() switch(state) { case Registered: - led->setState(KLed::On); - led->setColor(QColor(0,255,0)); + led->setPixmap(QPixmap(ICON_ACCOUNT_LED_GREEN)); break; case Unregistered: - led->setState(KLed::Off); - led->setColor(QColor(0,255,0)); + led->setPixmap(QPixmap(ICON_ACCOUNT_LED_GRAY)); break; case NotWorking: - led->setState(KLed::On); - led->setColor(QColor(255,0,0)); + led->setPixmap(QPixmap(ICON_ACCOUNT_LED_RED)); break; default: qDebug() << "Calling AccountItemWidget::setState with value " << state << ", not part of enum AccountItemWidget::State."; @@ -92,14 +95,12 @@ void AccountItemWidget::setState(int state) { this->state = state; updateStateDisplay(); - //emit stateChanged; } void AccountItemWidget::setEnabled(bool enabled) { this->enabled = enabled; updateEnabledDisplay(); - //emit enabledChanged; } void AccountItemWidget::setAccountText(QString text) @@ -111,3 +112,8 @@ bool AccountItemWidget::getEnabled() { return checkBox->checkState(); } + +void AccountItemWidget::on_checkBox_stateChanged() +{ + emit checkStateChanged(); +} diff --git a/sflphone-client-kde/src/AccountItemWidget.h b/sflphone-client-kde/src/AccountItemWidget.h index 7d26ccd616ba398578038849033f954d268cc790..25c1a688dc1fb7c88a753d793a1de68ce69db6f5 100644 --- a/sflphone-client-kde/src/AccountItemWidget.h +++ b/sflphone-client-kde/src/AccountItemWidget.h @@ -28,7 +28,7 @@ #include <kled.h> /** - @author Jérémy Quentin <jeremy.quentin@gmail.com> + @author Jérémy Quentin <jeremy.quentin@savoirfairelinux.com> */ class AccountItemWidget : public QWidget { @@ -38,7 +38,7 @@ private: int state; bool enabled; - KLed * led; + QLabel * led; QCheckBox * checkBox; QLabel * textLabel; @@ -64,7 +64,12 @@ public: void updateEnabledDisplay(); void updateDisplay(); +private slots: + void on_checkBox_stateChanged(); + +signals: + void checkStateChanged(); }; diff --git a/sflphone-client-kde/src/AccountList.cpp b/sflphone-client-kde/src/AccountList.cpp index f40b7d8ad12ec9ba72448291637c4e4ef9ef8597..3f53f475fdb6502359b1db9726ce391bd7364772 100644 --- a/sflphone-client-kde/src/AccountList.cpp +++ b/sflphone-client-kde/src/AccountList.cpp @@ -24,7 +24,6 @@ #include "configurationmanager_interface_singleton.h" -QString AccountList::firstAccount = QString(); //Constructors @@ -37,16 +36,11 @@ AccountList::AccountList(QStringList & _accountIds) } } -AccountList::AccountList() +AccountList::AccountList(bool fill) { -// firstAccount = QString(); - ConfigurationManagerInterface & configurationManager = ConfigurationManagerInterfaceSingleton::getInstance(); - //ask for the list of accounts ids to the configurationManager - QStringList accountIds = configurationManager.getAccountList().value(); + qDebug() << "AccountList()"; accounts = new QVector<Account *>(); - for (int i = 0; i < accountIds.size(); ++i){ - (*accounts) += Account::buildExistingAccountFromId(accountIds[i]); - } + updateAccounts(); } void AccountList::update() @@ -65,6 +59,18 @@ void AccountList::update() } } +void AccountList::updateAccounts() +{ + qDebug() << "updateAccounts"; + ConfigurationManagerInterface & configurationManager = ConfigurationManagerInterfaceSingleton::getInstance(); + QStringList accountIds = configurationManager.getAccountList().value(); + accounts->clear(); + for (int i = 0; i < accountIds.size(); ++i){ + (*accounts) += Account::buildExistingAccountFromId(accountIds[i]); + } + emit accountListUpdated(); +} + void AccountList::upAccount(int index) { if(index <= 0 || index >= size()) @@ -118,11 +124,6 @@ QVector<Account *> AccountList::registeredAccounts() const Account * AccountList::firstRegisteredAccount() const { - Account * first = getAccountById(firstAccount); - if(first && (first->getAccountDetail(ACCOUNT_STATUS) == ACCOUNT_STATE_REGISTERED)) - { - return first; - } Account * current; for (int i = 0; i < accounts->count(); ++i){ current = (*accounts)[i]; @@ -134,10 +135,6 @@ Account * AccountList::firstRegisteredAccount() const return NULL; } -void AccountList::setAccountFirst(Account * account) -{ - firstAccount = account->getAccountId(); -} AccountList::~AccountList() { @@ -162,6 +159,8 @@ Account & AccountList::getAccount (int i) Account * AccountList::getAccountById(const QString & id) const { + if(id.isEmpty()) + { return NULL; } for (int i = 0; i < accounts->size(); ++i) { if (!(*accounts)[i]->isNew() && (*accounts)[i]->getAccountId() == id) @@ -181,12 +180,8 @@ QVector<Account *> AccountList::getAccountByState(QString & state) } return v; } -/* -Account AccountList::getAccountByRow(int row) -{ - -} -*/ + + Account * AccountList::getAccountByItem(QListWidgetItem * item) { for (int i = 0; i < accounts->size(); ++i){ @@ -202,12 +197,6 @@ int AccountList::size() } //Setters -/* -void AccountList::addAccount(Account & account) -{ - accounts->add(account); -} -*/ Account * AccountList::addAccount(QString & alias) { Account * a = Account::buildNewAccountFromAlias(alias); diff --git a/sflphone-client-kde/src/AccountList.h b/sflphone-client-kde/src/AccountList.h index e7250b39e32942f1d685c8043c5844e0095af787..e1b00e77bb7d62ef68a8713644f06b8608e43f22 100644 --- a/sflphone-client-kde/src/AccountList.h +++ b/sflphone-client-kde/src/AccountList.h @@ -27,18 +27,24 @@ #include "Account.h" -class AccountList{ +class AccountList : public QObject{ + + Q_OBJECT private: QVector<Account *> * accounts; - static QString firstAccount; public: //Constructors & Destructors AccountList(QStringList & _accountIds); - AccountList(); + /** + * Constructs a new accountList, empty if fill = false + * filled with accounts from configurationManager.getAccountList() if true + * @param fill Whether to fill the list with accounts from configurationManager or not. + */ + AccountList(bool fill = true); ~AccountList(); //Getters @@ -56,7 +62,6 @@ public: Account * addAccount(QString & alias); void removeAccount(Account * account); void removeAccount(QListWidgetItem * item); - void setAccountFirst(Account * account); void upAccount(int index); void downAccount(int index); @@ -64,7 +69,19 @@ public: Account & operator[] (int i); const Account & operator[] (int i) const; QVector<Account *> registeredAccounts() const; + +public slots: + /** + * updates the list of accounts (removed, added, order...) with the configurationManager's list + */ void update(); + /** + * updates the list and the details of accounts with the configurationManager's list + */ + void updateAccounts(); + +signals: + void accountListUpdated(); }; diff --git a/sflphone-client-kde/src/AccountWizard.cpp b/sflphone-client-kde/src/AccountWizard.cpp index 4745593e5e1e28554f173d2750b8bb92e75612ef..ad55bc97dff472c0f7638209e76b9a0a77866fcf 100644 --- a/sflphone-client-kde/src/AccountWizard.cpp +++ b/sflphone-client-kde/src/AccountWizard.cpp @@ -3,12 +3,12 @@ * Author : Jérémy Quentin * * jeremy.quentin@savoirfairelinux.com * * * - * This program is free software; you can redistr2i18nibute it and/or modify * + * 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 * * the Free Software Foundation; either version 3 of the License, or * * (at your option) any later version. * * * - * This program is distr2i18nibuted in the hope that it will be useful, * + * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * @@ -158,8 +158,13 @@ AccountWizard::AccountWizard(QWidget * parent) setPage(Page_Conclusion, new WizardAccountConclusionPage); setStartId(Page_Intro); - setWindowTitle(tr2i18n("Account Wizard")); - setPixmap(QWizard::LogoPixmap, QPixmap(":/images/icons/sflphone.png")); + setWindowTitle(i18n("Account Creation Wizard")); + setWindowIcon(QIcon(ICON_SFLPHONE)); + setMinimumHeight(350); +// setPixmap(QWizard::LogoPixmap, QPixmap(ICON_SFLPHONE)); + setPixmap(QWizard::WatermarkPixmap, QPixmap(ICON_SFLPHONE)); +// setPixmap(QWizard::BannerPixmap, QPixmap(ICON_SFLPHONE)); +// setPixmap(QWizard::BackgroundPixmap, QPixmap(ICON_SFLPHONE)); } @@ -192,7 +197,7 @@ void AccountWizard::accept() rest_account acc = get_rest_account(SFL_ACCOUNT_HOST, charEmailAddress); if(acc.success) { - ret += tr2i18n("Creation of account succeed with parameters :\n"); + ret += i18n("Creation of account succeed with these parameters") + " :\n"; alias = QString(acc.user) + "@" + SFL_ACCOUNT_HOST; server = QString(SFL_ACCOUNT_HOST); user = QString(acc.user); @@ -203,13 +208,13 @@ void AccountWizard::accept() } else { - ret += tr2i18n("Creation of account has failed for the reason :\n"); + ret += i18n("Creation of account has failed for the reason") + " :\n"; ret += acc.reason; } } else { - ret += tr2i18n("Register of account succeed with parameters :\n"); + ret += i18n("Register of account succeed with these parameters") + " :\n"; bool SIPAccount = field(FIELD_SIP_ACCOUNT).toBool(); if(SIPAccount) { @@ -233,7 +238,7 @@ void AccountWizard::accept() } if(createAccount) { - mailbox = ACCOUNT_MAILBOX_DEFAULT_VALUE; +// mailbox = ACCOUNT_MAILBOX_DEFAULT_VALUE; enabled = ACCOUNT_ENABLED_TRUE; ConfigurationManagerInterface & configurationManager = ConfigurationManagerInterfaceSingleton::getInstance(); QString accountId = configurationManager.addAccount(accountDetails); @@ -245,12 +250,12 @@ void AccountWizard::accept() if(enableStun != configurationManager.isStunEnabled()) configurationManager.enableStun(); if(enableStun) configurationManager.setStunServer(stunServer); } - ret += tr2i18n("Alias : ") + alias + "\n"; - ret += tr2i18n("Server : ") + server + "\n"; - ret += tr2i18n("User : ") + user + "\n"; - ret += tr2i18n("Password : ") + password + "\n"; - ret += tr2i18n("Protocol : ") + protocol + "\n"; - ret += tr2i18n("Mailbox : ") + mailbox + "\n"; + ret += i18n("Alias") + " : " + alias + "\n"; + ret += i18n("Server") + " : " + server + "\n"; + ret += i18n("User") + " : " + user + "\n"; + ret += i18n("Password") + " : " + password + "\n"; + ret += i18n("Protocol") + " : " + protocol + "\n"; + ret += i18n("Mailbox") + " : " + mailbox + "\n"; } qDebug() << ret; QDialog::accept(); @@ -261,16 +266,16 @@ void AccountWizard::accept() /*************************************************************************** * Class WizardIntroPage * - * Widget of the intr2i18noduction page of the wizard * + * Widget of the introduction page of the wizard * ***************************************************************************/ WizardIntroPage::WizardIntroPage(QWidget *parent) : QWizardPage(parent) { - setTitle(tr2i18n("Account Creation Wizard")); - setSubTitle(tr2i18n("Welcome to the Account creation wizard of SFLPhone")); + setTitle(i18n("Account Creation Wizard")); + setSubTitle(i18n("Welcome to the Account creation wizard of SFLPhone")); - introLabel = new QLabel(tr2i18n("This wizard will help you setting up an account.")); + introLabel = new QLabel(i18n("This wizard will help you setting up an account.")); introLabel->setWordWrap(true); QVBoxLayout *layout = new QVBoxLayout; @@ -298,11 +303,11 @@ int WizardIntroPage::nextId() const WizardAccountAutoManualPage::WizardAccountAutoManualPage(QWidget *parent) : QWizardPage(parent) { - setTitle(tr2i18n("Accounts")); - setSubTitle(tr2i18n("Please choose between those options :")); + setTitle(i18n("Accounts")); + setSubTitle(i18n("Please choose between those options :")); - radioButton_SFL = new QRadioButton(tr2i18n("Create a free SIP/IAX2 account on sflphone.org")); - radioButton_manual = new QRadioButton(tr2i18n("Register an existing SIP/IAX2 account")); + radioButton_SFL = new QRadioButton(i18n("Create a free SIP/IAX2 account on sflphone.org")); + radioButton_manual = new QRadioButton(i18n("Register an existing SIP/IAX2 account")); radioButton_SFL->setChecked(true); registerField(FIELD_SFL_ACCOUNT, radioButton_SFL); @@ -341,11 +346,11 @@ int WizardAccountAutoManualPage::nextId() const WizardAccountTypePage::WizardAccountTypePage(QWidget *parent) : QWizardPage(parent) { - setTitle(tr2i18n("VoIP Protocols")); - setSubTitle(tr2i18n("Choose the account type :")); + setTitle(i18n("VoIP Protocols")); + setSubTitle(i18n("Choose the account type") + " :"); - radioButton_SIP = new QRadioButton(tr2i18n("Register a SIP (Session Initiation Protocol) account")); - radioButton_IAX = new QRadioButton(tr2i18n("Register a IAX2 (InterAsterisk eXchange) account")); + radioButton_SIP = new QRadioButton(i18n("Register a SIP (Session Initiation Protocol) account")); + radioButton_IAX = new QRadioButton(i18n("Register a IAX2 (InterAsterisk eXchange) account")); radioButton_SIP->setChecked(true); registerField(FIELD_SIP_ACCOUNT, radioButton_SIP); @@ -384,10 +389,10 @@ int WizardAccountTypePage::nextId() const WizardAccountEmailAddressPage::WizardAccountEmailAddressPage(QWidget *parent) : QWizardPage(parent) { - setTitle(tr2i18n("Optionnal Email Address")); - setSubTitle(tr2i18n("This email address will be used to send your voicemail messages.")); + setTitle(i18n("Optionnal Email Address")); + setSubTitle(i18n("This email address will be used to send your voicemail messages.")); - label_emailAddress = new QLabel(tr2i18n("Email address")); + label_emailAddress = new QLabel(i18n("Email address")); lineEdit_emailAddress = new QLineEdit(); registerField(FIELD_EMAIL_ADDRESS, lineEdit_emailAddress); @@ -421,18 +426,18 @@ WizardAccountFormPage::WizardAccountFormPage(int type, QWidget *parent) this->type = type; if(type == SIP) { - setTitle(tr2i18n("SIP Account Settings")); + setTitle(i18n("SIP Account Settings")); } else { - setTitle(tr2i18n("IAX2 Account Settings")); + setTitle(i18n("IAX2 Account Settings")); } - setSubTitle(tr2i18n("Please full these settings fields.")); + setSubTitle(i18n("Please full these settings fields.")); - label_alias = new QLabel(tr2i18n("Alias *")); - label_server = new QLabel(tr2i18n("Server *")); - label_user = new QLabel(tr2i18n("User *")); - label_password = new QLabel(tr2i18n("Password *")); + label_alias = new QLabel(i18n("Alias") + " *"); + label_server = new QLabel(i18n("Server") + " *"); + label_user = new QLabel(i18n("User") + " *"); + label_password = new QLabel(i18n("Password") + " *"); lineEdit_alias = new QLineEdit; lineEdit_server = new QLineEdit; @@ -504,11 +509,11 @@ int WizardAccountFormPage::nextId() const WizardAccountStunPage::WizardAccountStunPage(QWidget *parent) : QWizardPage(parent) { - setTitle(tr2i18n("Network Address Translation (NAT)")); - setSubTitle(tr2i18n("You should probably enable this option if you're placed under a firewall :")); + setTitle(i18n("Network Address Translation (NAT)")); + setSubTitle(i18n("You should probably enable this option if you're placed under a firewall")); - checkBox_enableStun = new QCheckBox(tr2i18n("Enable STUN")); - label_StunServer = new QLabel(tr2i18n("Stun Server")); + checkBox_enableStun = new QCheckBox(i18n("Enable STUN")); + label_StunServer = new QLabel(i18n("Stun Server")); lineEdit_StunServer = new QLineEdit(); registerField(FIELD_ENABLE_STUN, checkBox_enableStun); @@ -542,8 +547,8 @@ int WizardAccountStunPage::nextId() const WizardAccountConclusionPage::WizardAccountConclusionPage(QWidget *parent) : QWizardPage(parent) { - setTitle(tr2i18n("Account Definition Finished")); - setSubTitle(tr2i18n("After checking the settings you chose, click \"Finish\" to create the account.")); + setTitle(i18n("Account Definition Finished")); + setSubTitle(i18n("After checking the settings you chose, click \"Finish\" to create the account.")); QVBoxLayout *layout = new QVBoxLayout; setLayout(layout); diff --git a/sflphone-client-kde/src/AccountWizard.h b/sflphone-client-kde/src/AccountWizard.h index 0095856a18c523178e31eb77d9e1c1c863ddc1f0..afa7588db0ceaa37c9fa5adc890c2db37ca9a523 100644 --- a/sflphone-client-kde/src/AccountWizard.h +++ b/sflphone-client-kde/src/AccountWizard.h @@ -29,7 +29,7 @@ /** - @author Jérémy Quentin <jeremy.quentin@gmail.com> + @author Jérémy Quentin <jeremy.quentin@savoirfairelinux.com> */ class AccountWizard : public QWizard { diff --git a/sflphone-client-kde/src/ActionSetAccountFirst.cpp b/sflphone-client-kde/src/ActionSetAccountFirst.cpp index 6b29e6c6a4892502e68580ddcf7d52ca94996dc1..3033af2e2f65cd50cc311f5212cb33b5c8732af3 100644 --- a/sflphone-client-kde/src/ActionSetAccountFirst.cpp +++ b/sflphone-client-kde/src/ActionSetAccountFirst.cpp @@ -20,10 +20,12 @@ ***************************************************************************/ #include "ActionSetAccountFirst.h" +#include <klocale.h> ActionSetAccountFirst::ActionSetAccountFirst(Account * account, QObject *parent) - : QAction(account->getAlias(), parent) + : QAction((account == NULL) ? i18n("Default account") : account->getAlias(), parent) { + setCheckable(true); this->account = account; connect(this, SIGNAL(triggered()), this, SLOT(emitSetFirst())); diff --git a/sflphone-client-kde/src/ActionSetAccountFirst.h b/sflphone-client-kde/src/ActionSetAccountFirst.h index dd8914f474aaf5ec01e63ff064f3213f31756ded..4e832e0ae45288fa9399da38884c6d0118822246 100644 --- a/sflphone-client-kde/src/ActionSetAccountFirst.h +++ b/sflphone-client-kde/src/ActionSetAccountFirst.h @@ -27,7 +27,7 @@ #include "Account.h" /** - @author Jérémy Quentin <jeremy.quentin@gmail.com> + @author Jérémy Quentin <jeremy.quentin@savoirfairelinux.com> */ class ActionSetAccountFirst : public QAction { diff --git a/sflphone-client-kde/src/CMakeLists.txt b/sflphone-client-kde/src/CMakeLists.txt index 5762b2bb0708d223b02ad9978ea62cca129e25da..32540e27410f48052ba8ab62a9999a14b5ae47a6 100644 --- a/sflphone-client-kde/src/CMakeLists.txt +++ b/sflphone-client-kde/src/CMakeLists.txt @@ -1,17 +1,35 @@ -ADD_DEFINITIONS(${KDE4_DEFINITIONS} ${QT_DEFINITIONS} -fexceptions -DDATA_INSTALL_DIR="\\\"${DATA_INSTALL_DIR}\\\"" ) -SET ( KDE4_KABC_LIBS -lkabc ) +ADD_DEFINITIONS( + ${KDE4_DEFINITIONS} + ${QT_DEFINITIONS} + -fexceptions + -DDATA_INSTALL_DIR="\\\"${DATA_INSTALL_DIR}\\\"" + -DSHARE_INSTALL_PREFIX="\\\"${SHARE_INSTALL_PREFIX}\\\"" +) + +# add_definitions ( -DKDE_DEFAULT_DEBUG_AREA=9000 ) +# kde4_set_debug_area( 1234 ) +# IF(DEFINED DEBUG_DISABLED) +# MESSAGE("NO DEBUG OUTPUT") +# ADD_DEFINITIONS( -DQT_NO_DEBUG_OUTPUT ) +# ENDIF(DEFINED DEBUG_DISABLED) +MESSAGE("CMAKE_BUILD_TYPE = ${CMAKE_BUILD_TYPE}") -SET( - sflphone_client_kde_SRCS +IF(${CMAKE_BUILD_TYPE} MATCHES Release) + MESSAGE("NO DEBUG OUTPUT") + ADD_DEFINITIONS( -DQT_NO_DEBUG_OUTPUT ) +ENDIF(${CMAKE_BUILD_TYPE} MATCHES Release) + +SET ( KDE4_KABC_LIBS -lkabc ) + +SET( sflphone_client_kde_SRCS sflphone_kdeview.cpp SFLPhone.cpp - ConfigDialog.cpp main.cpp sflphone_const.h Account.cpp @@ -26,6 +44,16 @@ SET( ActionSetAccountFirst.cpp Contact.cpp ContactItemWidget.cpp + conf/ConfigurationDialog.cpp + conf/dlggeneral.cpp + conf/dlgdisplay.cpp + conf/dlgaccounts.cpp + conf/dlgaudio.cpp + conf/dlgrecord.cpp + conf/dlgaddressbook.cpp + conf/dlghooks.cpp + conf/ConfigurationSkeleton.cpp + Dialpad.cpp ) @@ -35,7 +63,7 @@ QT4_ADD_RESOURCES(QtApp_RCC_SRCS ${QtApp_RCCS}) # Build dbus interfaces -SET ( dbus_xml_introspecs_path ${CMAKE_CURRENT_SOURCE_DIR}/../../sflphone-common/src/dbus/) +SET ( dbus_xml_introspecs_path ${CMAKE_CURRENT_SOURCE_DIR}/dbus/) # configuration manager interface SET ( configurationmanager_xml ${dbus_xml_introspecs_path}/configurationmanager-introspec.xml ) @@ -81,8 +109,21 @@ QT4_ADD_DBUS_INTERFACE( # kde4_automoc(${sflphone_client_kde_SRCS}) +SET( config_ui_files + conf/dlggeneralbase.ui + conf/dlgdisplaybase.ui + conf/dlgaccountsbase.ui + conf/dlgaudiobase.ui + conf/dlgrecordbase.ui + conf/dlgaddressbookbase.ui + conf/dlghooksbase.ui +) + +KDE4_ADD_UI_FILES(sflphone_client_kde_SRCS ui/sflphone_kdeview_base.ui ${config_ui_files} ) + +KDE4_ADD_KCFG_FILES(sflphone_client_kde_SRCS conf/kcfg_settings.kcfgc) +INSTALL(FILES conf/sflphone-client-kde.kcfg DESTINATION ${KCFG_INSTALL_DIR}) -KDE4_ADD_UI_FILES(sflphone_client_kde_SRCS ui/sflphone_kdeview_base.ui ui/ConfigDialog.ui) KDE4_ADD_EXECUTABLE(sflphone-client-kde ${sflphone_client_kde_SRCS} ${QtApp_RCC_SRCS}) diff --git a/sflphone-client-kde/src/Call.cpp b/sflphone-client-kde/src/Call.cpp index d7aacb29495b2aff59c5890e6aa3073bc306ae55..e5f2e94c1f6cad8eee3ad25a3f2a25f44867b283 100644 --- a/sflphone-client-kde/src/Call.cpp +++ b/sflphone-client-kde/src/Call.cpp @@ -68,17 +68,17 @@ const function Call::actionPerformedFunctionMap[11][5] = const call_state Call::stateChangedStateMap [11][6] = { // RINGING CURRENT BUSY HOLD HUNGUP FAILURE -/*INCOMING */ {CALL_STATE_INCOMING , CALL_STATE_CURRENT , CALL_STATE_BUSY , CALL_STATE_HOLD , CALL_STATE_OVER , CALL_STATE_FAILURE }, -/*RINGING */ {CALL_STATE_RINGING , CALL_STATE_CURRENT , CALL_STATE_BUSY , CALL_STATE_HOLD , CALL_STATE_OVER , CALL_STATE_FAILURE }, -/*CURRENT */ {CALL_STATE_CURRENT , CALL_STATE_CURRENT , CALL_STATE_BUSY , CALL_STATE_HOLD , CALL_STATE_OVER , CALL_STATE_FAILURE }, -/*DIALING */ {CALL_STATE_RINGING , CALL_STATE_CURRENT , CALL_STATE_BUSY , CALL_STATE_HOLD , CALL_STATE_OVER , CALL_STATE_FAILURE }, -/*HOLD */ {CALL_STATE_HOLD , CALL_STATE_CURRENT , CALL_STATE_BUSY , CALL_STATE_HOLD , CALL_STATE_OVER , CALL_STATE_FAILURE }, -/*FAILURE */ {CALL_STATE_FAILURE , CALL_STATE_FAILURE , CALL_STATE_BUSY , CALL_STATE_FAILURE , CALL_STATE_OVER , CALL_STATE_FAILURE }, -/*BUSY */ {CALL_STATE_BUSY , CALL_STATE_CURRENT , CALL_STATE_BUSY , CALL_STATE_BUSY , CALL_STATE_OVER , CALL_STATE_FAILURE }, -/*TRANSFER */ {CALL_STATE_TRANSFER , CALL_STATE_TRANSFER , CALL_STATE_BUSY , CALL_STATE_TRANSF_HOLD , CALL_STATE_OVER , CALL_STATE_FAILURE }, -/*TRANSF_HOLD */ {CALL_STATE_TRANSF_HOLD , CALL_STATE_TRANSFER , CALL_STATE_BUSY , CALL_STATE_TRANSF_HOLD , CALL_STATE_OVER , CALL_STATE_FAILURE }, -/*OVER */ {CALL_STATE_OVER , CALL_STATE_OVER , CALL_STATE_OVER , CALL_STATE_OVER , CALL_STATE_OVER , CALL_STATE_OVER }, -/*ERROR */ {CALL_STATE_ERROR , CALL_STATE_ERROR , CALL_STATE_ERROR , CALL_STATE_ERROR , CALL_STATE_ERROR , CALL_STATE_ERROR } +/*INCOMING */ {CALL_STATE_INCOMING , CALL_STATE_CURRENT , CALL_STATE_BUSY , CALL_STATE_HOLD , CALL_STATE_OVER , CALL_STATE_FAILURE }, +/*RINGING */ {CALL_STATE_RINGING , CALL_STATE_CURRENT , CALL_STATE_BUSY , CALL_STATE_HOLD , CALL_STATE_OVER , CALL_STATE_FAILURE }, +/*CURRENT */ {CALL_STATE_CURRENT , CALL_STATE_CURRENT , CALL_STATE_BUSY , CALL_STATE_HOLD , CALL_STATE_OVER , CALL_STATE_FAILURE }, +/*DIALING */ {CALL_STATE_RINGING , CALL_STATE_CURRENT , CALL_STATE_BUSY , CALL_STATE_HOLD , CALL_STATE_OVER , CALL_STATE_FAILURE }, +/*HOLD */ {CALL_STATE_HOLD , CALL_STATE_CURRENT , CALL_STATE_BUSY , CALL_STATE_HOLD , CALL_STATE_OVER , CALL_STATE_FAILURE }, +/*FAILURE */ {CALL_STATE_FAILURE , CALL_STATE_FAILURE , CALL_STATE_BUSY , CALL_STATE_FAILURE , CALL_STATE_OVER , CALL_STATE_FAILURE }, +/*BUSY */ {CALL_STATE_BUSY , CALL_STATE_CURRENT , CALL_STATE_BUSY , CALL_STATE_BUSY , CALL_STATE_OVER , CALL_STATE_FAILURE }, +/*TRANSFER */ {CALL_STATE_TRANSFER , CALL_STATE_TRANSFER , CALL_STATE_BUSY , CALL_STATE_TRANSF_HOLD , CALL_STATE_OVER , CALL_STATE_FAILURE }, +/*TRANSF_HOLD */ {CALL_STATE_TRANSF_HOLD , CALL_STATE_TRANSFER , CALL_STATE_BUSY , CALL_STATE_TRANSF_HOLD , CALL_STATE_OVER , CALL_STATE_FAILURE }, +/*OVER */ {CALL_STATE_OVER , CALL_STATE_OVER , CALL_STATE_OVER , CALL_STATE_OVER , CALL_STATE_OVER , CALL_STATE_OVER }, +/*ERROR */ {CALL_STATE_ERROR , CALL_STATE_ERROR , CALL_STATE_ERROR , CALL_STATE_ERROR , CALL_STATE_ERROR , CALL_STATE_ERROR } }; const function Call::stateChangedFunctionMap[11][6] = @@ -113,7 +113,7 @@ void Call::initCallItem() labelIcon = new QLabel(); qDebug() << "labelIcon : " << labelIcon; labelCallNumber = new QLabel(peerPhoneNumber); - labelTransferPrefix = new QLabel(tr2i18n("Transfer to : ")); + labelTransferPrefix = new QLabel(i18n("Transfer to : ")); labelTransferNumber = new QLabel(); QSpacerItem * horizontalSpacer = new QSpacerItem(16777215, 20, QSizePolicy::Preferred, QSizePolicy::Minimum); @@ -139,15 +139,6 @@ void Call::initCallItem() descr->addLayout(transfer); mainLayout->addLayout(descr); mainLayout->addItem(horizontalSpacer); - -// QGridLayout * mainLayout = new QGridLayout(itemWidget); -// mainLayout->setMargin(3); -// mainLayout->setSpacing(3); -// mainLayout->addWidget(labelIcon, 0, 0, 2, 1); -// mainLayout->addWidget(labelCallNumber, 0, 1, 1, 2); -// mainLayout->addWidget(labelTransferPrefix, 1, 1, 1, 1); -// mainLayout->addWidget(labelTransferNumber, 1, 2, 1, 2); -// mainLayout->addItem(horizontalSpacer, 0, 3, 1, 3); itemWidget->setLayout(mainLayout); } @@ -157,13 +148,6 @@ void Call::setItemIcon(const QString pixmap) labelIcon->setPixmap(QPixmap(pixmap)); } -// void Call::setPeerName(const QString peerName) -// { -// qDebug() << "setPeerName(" << peerName; -// this->peerName = peerName; -// if(!labelPeerName) labelPeerName = new QLabel(peerName + " : "); -// labelPeerName->setText(peerName + " : "); -// } Call::Call(call_state startState, QString callId, QString peerName, QString peerNumber, QString account) { @@ -180,6 +164,26 @@ Call::Call(call_state startState, QString callId, QString peerName, QString peer this->stopTime = NULL; } +Call::Call(QString callId) +{ + CallManagerInterface & callManager = CallManagerInterfaceSingleton::getInstance(); + MapStringString details = callManager.getCallDetails(callId).value(); + qDebug() << "Constructing existing call with details : " << details; + this->callId = callId; + this->peerPhoneNumber = details[CALL_PEER_NUMBER]; + this->peerName = details[CALL_PEER_NAME]; + initCallItem(); + call_state startState = getStartStateFromDaemonCallState(details[CALL_STATE], details[CALL_TYPE]); + changeCurrentState(startState); + this->historyState = getHistoryStateFromDaemonCallState(details[CALL_STATE], details[CALL_TYPE]); + this->account = details[CALL_ACCOUNTID]; + this->recording = false; + this->startTime = new QDateTime(QDateTime::currentDateTime()); + this->stopTime = NULL; + this->historyItem = NULL; + this->historyItemWidget = NULL; +} + Call::~Call() { delete startTime; @@ -190,9 +194,9 @@ Call::~Call() //delete historyItemWidget; } -Call * Call::buildDialingCall(QString callId, const QString & peerName) +Call * Call::buildDialingCall(QString callId, const QString & peerName, QString account) { - Call * call = new Call(CALL_STATE_DIALING, callId, peerName); + Call * call = new Call(CALL_STATE_DIALING, callId, peerName, "", account); call->historyState = NONE; return call; } @@ -214,17 +218,97 @@ Call * Call::buildRingingCall(const QString & callId) { CallManagerInterface & callManager = CallManagerInterfaceSingleton::getInstance(); MapStringString details = callManager.getCallDetails(callId).value(); -// qDebug() << "Details : " << details.keys(); QString from = details[CALL_PEER_NUMBER]; QString account = details[CALL_ACCOUNTID]; QString peerName = details[CALL_PEER_NAME]; - //QString from = details[CALL_ACCOUNT]; Call * call = new Call(CALL_STATE_RINGING, callId, peerName, from, account); -// call->setPeerName(details[CALL_PEER_NAME]); call->historyState = OUTGOING; return call; } +Call * Call::buildHistoryCall(const QString & callId, uint startTimeStamp, uint stopTimeStamp, QString account, QString name, QString number, QString type) +{ + if(name == "empty") name = ""; + Call * call = new Call(CALL_STATE_OVER, callId, name, number, account); + call->startTime = new QDateTime(QDateTime::fromTime_t(startTimeStamp)); + call->stopTime = new QDateTime(QDateTime::fromTime_t(stopTimeStamp)); + call->historyState = getHistoryStateFromType(type); + return call; +} + + +history_state Call::getHistoryStateFromType(QString type) +{ + if(type == DAEMON_HISTORY_TYPE_MISSED) + { + return MISSED; + } + else if(type == DAEMON_HISTORY_TYPE_OUTGOING) + { + return OUTGOING; + } + else if(type == DAEMON_HISTORY_TYPE_INCOMING) + { + return INCOMING; + } +} + +call_state Call::getStartStateFromDaemonCallState(QString daemonCallState, QString daemonCallType) +{ + if(daemonCallState == DAEMON_CALL_STATE_INIT_CURRENT) + { + return CALL_STATE_CURRENT; + } + else if(daemonCallState == DAEMON_CALL_STATE_INIT_HOLD) + { + return CALL_STATE_HOLD; + } + else if(daemonCallState == DAEMON_CALL_STATE_INIT_BUSY) + { + return CALL_STATE_BUSY; + } + else if(daemonCallState == DAEMON_CALL_STATE_INIT_INACTIVE && daemonCallType == DAEMON_CALL_TYPE_INCOMING) + { + return CALL_STATE_INCOMING; + } + else if(daemonCallState == DAEMON_CALL_STATE_INIT_INACTIVE && daemonCallType == DAEMON_CALL_TYPE_OUTGOING) + { + return CALL_STATE_RINGING; + } + else + { + return CALL_STATE_FAILURE; + } +} + +history_state Call::getHistoryStateFromDaemonCallState(QString daemonCallState, QString daemonCallType) +{ + if((daemonCallState == DAEMON_CALL_STATE_INIT_CURRENT || daemonCallState == DAEMON_CALL_STATE_INIT_HOLD) && daemonCallType == DAEMON_CALL_TYPE_INCOMING) + { + return INCOMING; + } + else if((daemonCallState == DAEMON_CALL_STATE_INIT_CURRENT || daemonCallState == DAEMON_CALL_STATE_INIT_HOLD) && daemonCallType == DAEMON_CALL_TYPE_OUTGOING) + { + return OUTGOING; + } + else if(daemonCallState == DAEMON_CALL_STATE_INIT_BUSY) + { + return OUTGOING; + } + else if(daemonCallState == DAEMON_CALL_STATE_INIT_INACTIVE && daemonCallType == DAEMON_CALL_TYPE_INCOMING) + { + return INCOMING; + } + else if(daemonCallState == DAEMON_CALL_STATE_INIT_INACTIVE && daemonCallType == DAEMON_CALL_TYPE_OUTGOING) + { + return MISSED; + } + else + { + return NONE; + } +} + daemon_call_state Call::toDaemonCallState(const QString & stateName) { if(stateName == QString(CALL_STATE_CHANGE_HUNG_UP)) @@ -326,7 +410,6 @@ QWidget * Call::getHistoryItemWidget() descr->setMargin(0); descr->setSpacing(1); mainLayout->addWidget(labelHistoryIcon); - qDebug() << "descr->addWidget(labelPeerName);"; if(! peerName.isEmpty()) { labelHistoryPeerName = new QLabel(peerName); @@ -341,13 +424,6 @@ QWidget * Call::getHistoryItemWidget() return historyItemWidget; } -/* -layout->addWidget(labelIcon, 0, 0, 2, 1); - layout->addWidget(labelCallNumber, 0, 1, 1, 2); - layout->addWidget(labelTransferPrefix, 1, 1, 1, 1); - layout->addWidget(labelTransferNumber, 1, 2, 1, 2); - layout->addItem(horizontalSpacer, 0, 3, 1, 3); -*/ call_state Call::getState() const { return currentState; @@ -358,6 +434,11 @@ history_state Call::getHistoryState() const return historyState; } +bool Call::isHistory() const +{ + return (getState() == CALL_STATE_OVER); +} + call_state Call::stateChanged(const QString & newStateName) { call_state previousState = currentState; @@ -406,6 +487,11 @@ bool Call::getRecording() const return recording; } +QString Call::getAccountId() const +{ + return account; +} + /* void Call::putRecording() { @@ -483,7 +569,12 @@ void Call::call() { CallManagerInterface & callManager = CallManagerInterfaceSingleton::getInstance(); QString number = labelCallNumber->text(); - this->account = sflphone_kdeView::firstAccountId(); + qDebug() << "account = " << account; + if(account.isEmpty()) + { + qDebug() << "account is empty"; + this->account = sflphone_kdeView::firstRegisteredAccount()->getAccountId(); + } if(!account.isEmpty()) { qDebug() << "Calling " << number << " with account " << account << ". callId : " << callId; @@ -530,9 +621,10 @@ void Call::switchRecord() void Call::setRecord() { CallManagerInterface & callManager = CallManagerInterfaceSingleton::getInstance(); - qDebug() << "Setting record for call. callId : " << callId; + qDebug() << "Setting record " << !recording << " for call. callId : " << callId; callManager.setRecording(callId); recording = !recording; + updateItem(); } void Call::start() @@ -568,12 +660,13 @@ void Call::appendItemText(QString text) break; case CALL_STATE_CURRENT: //TODO replace account string by an Account instance and handle damn pointers to avoid detruction of Accounts - //if(peer == account->getAccountDetail(ACCOUNT_MAILBOX)) - if(peerPhoneNumber == configurationManager.getAccountDetails(account).value()[ACCOUNT_MAILBOX]) - { - text = QString(QChar(0x9A)); - } +// if(peerPhoneNumber == configurationManager.getAccountDetails(account).value()[ACCOUNT_MAILBOX]) +// { +// text = QString(QChar(0x9A)); +// } + text = QString(); editNumber = labelCallNumber; + break; default: qDebug() << "Type key on call not editable. Doing nothing."; @@ -618,17 +711,24 @@ void Call::changeCurrentState(call_state newState) void Call::updateItem() { - if(currentState == CALL_STATE_CURRENT && recording) - setItemIcon(ICON_CURRENT_REC); + if(currentState != CALL_STATE_OVER) + { + if(currentState == CALL_STATE_CURRENT && recording) + setItemIcon(ICON_CURRENT_REC); + else + { + QString str = QString(callStateIcons[currentState]); + setItemIcon(str); + } + bool transfer = currentState == CALL_STATE_TRANSFER || currentState == CALL_STATE_TRANSF_HOLD; + labelTransferPrefix->setVisible(transfer); + labelTransferNumber->setVisible(transfer); + if(!transfer) + labelTransferNumber->setText(""); + } else { - QString str(callStateIcons[currentState]); - setItemIcon(str); + qDebug() << "Updating item of call of state OVER. Doing nothing."; } - bool transfer = currentState == CALL_STATE_TRANSFER || currentState == CALL_STATE_TRANSF_HOLD; - labelTransferPrefix->setVisible(transfer); - labelTransferNumber->setVisible(transfer); - if(!transfer) - labelTransferNumber->setText(""); } diff --git a/sflphone-client-kde/src/Call.h b/sflphone-client-kde/src/Call.h index 9d2bea58a34fbd32837ba266ae78fae3c463396c..143c0cb4ebfa5075e9cedeb6951bffe468a832ef 100644 --- a/sflphone-client-kde/src/Call.h +++ b/sflphone-client-kde/src/Call.h @@ -180,12 +180,16 @@ private: public: //Constructors & Destructors + Call(QString callId); ~Call(); void initCallItem(); - static Call * buildDialingCall(QString callId, const QString & peerName); + static Call * buildDialingCall(QString callId, const QString & peerName, QString account = ""); static Call * buildIncomingCall(const QString & callId/*, const QString & from, const QString & account*/); static Call * buildRingingCall(const QString & callId); - + static Call * buildHistoryCall(const QString & callId, uint startTimeStamp, uint stopTimeStamp, QString account, QString name, QString number, QString type); + static history_state getHistoryStateFromType(QString type); + static call_state getStartStateFromDaemonCallState(QString daemonCallState, QString daemonCallType); + static history_state getHistoryStateFromDaemonCallState(QString daemonCallState, QString daemonCallType); //Getters QListWidgetItem * getItem(); @@ -199,6 +203,8 @@ public: call_state getCurrentState() const; history_state getHistoryState() const; bool getRecording() const; + QString getAccountId() const; + bool isHistory() const; //Automate calls call_state stateChanged(const QString & newState); diff --git a/sflphone-client-kde/src/CallList.cpp b/sflphone-client-kde/src/CallList.cpp index 3ee4851c2ee2a4d2b59fb0fb044544f79e69f3bc..ca189dee7763918ddb9e57d6b23890d990d74bab 100644 --- a/sflphone-client-kde/src/CallList.cpp +++ b/sflphone-client-kde/src/CallList.cpp @@ -21,10 +21,36 @@ #include "CallList.h" + +#include "callmanager_interface_singleton.h" +#include "configurationmanager_interface_singleton.h" + CallList::CallList() { + CallManagerInterface & callManager = CallManagerInterfaceSingleton::getInstance(); + ConfigurationManagerInterface & configurationManager = ConfigurationManagerInterfaceSingleton::getInstance(); + QStringList callList = callManager.getCallList(); + qDebug() << "Call List = " << callList; callIdCpt = 0; calls = new QVector<Call *>(); + for(int i = 0 ; i < callList.size() ; i++) + { + calls->append(new Call(callList[i])); + } + MapStringString historyMap = configurationManager.getHistory().value(); + qDebug() << "Call History = " << historyMap; + QMapIterator<QString, QString> i(historyMap); + while (i.hasNext()) { + i.next(); + uint startTimeStamp = i.key().toUInt(); + QStringList param = i.value().split("|"); + QString type = param[0]; + QString number = param[1]; + QString name = param[2]; + uint stopTimeStamp = param[3].toUInt(); + QString account = param[4]; + calls->append(Call::buildHistoryCall(getAndIncCallId(), startTimeStamp, stopTimeStamp, account, name, number, type)); + } } CallList::~CallList() @@ -113,9 +139,9 @@ int CallList::size() return calls->size(); } -Call * CallList::addDialingCall(const QString & peerName) +Call * CallList::addDialingCall(const QString & peerName, QString account) { - Call * call = Call::buildDialingCall(getAndIncCallId(), peerName); + Call * call = Call::buildDialingCall(getAndIncCallId(), peerName, account); calls->append(call); return call; } @@ -132,4 +158,17 @@ Call * CallList::addRingingCall(const QString & callId) Call * call = Call::buildRingingCall(callId); calls->append(call); return call; -} \ No newline at end of file +} + +void CallList::clearHistory() +{ + qDebug() << "clearHistory"; + Call * call; + QMutableVectorIterator<Call *> i(*calls); + while (i.hasNext()) + { + call = i.next(); + if (call->isHistory()) + { i.remove(); } + } +} diff --git a/sflphone-client-kde/src/CallList.h b/sflphone-client-kde/src/CallList.h index 9333abd03775479a7fa14e475039a5e66c7da81e..2ca3dd10b1f0d304b276bbc1db4df9c7acdda67a 100644 --- a/sflphone-client-kde/src/CallList.h +++ b/sflphone-client-kde/src/CallList.h @@ -28,8 +28,10 @@ #include "Call.h" -class CallList +class CallList : public QObject { +Q_OBJECT + private: QVector<Call *> * calls; @@ -51,14 +53,15 @@ public: int size(); //Setters - Call * addDialingCall(const QString & peerName = ""); + Call * addDialingCall(const QString & peerName = "", QString account = ""); Call * addIncomingCall(const QString & callId/*, const QString & from, const QString & account*/); Call * addRingingCall(const QString & callId); //GSetter QString getAndIncCallId(); - +public slots: + void clearHistory(); }; diff --git a/sflphone-client-kde/src/ConfigDialog.cpp b/sflphone-client-kde/src/ConfigDialog.cpp deleted file mode 100644 index 2e340c73fdc4e35bdffc9ca0d2e2b7534deefaca..0000000000000000000000000000000000000000 --- a/sflphone-client-kde/src/ConfigDialog.cpp +++ /dev/null @@ -1,791 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2009 by Savoir-Faire Linux * - * Author : Jérémy Quentin * - * jeremy.quentin@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 * - * the Free Software Foundation; either version 3 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ - - #include "ConfigDialog.h" - -#include <QtGui/QStyle> -#include <QErrorMessage> -#include <QtGui/QAbstractItemView> -#include <QtGui/QInputDialog> -#include <QtGui/QHeaderView> - - - -#include "sflphone_const.h" -// #include "metatypes.h" -#include "configurationmanager_interface_singleton.h" - -typedef QMap<QString, QString> MapStringString; -typedef QMap<QString, int> MapStringInt; - -AccountList * ConfigurationDialog::accountList; - -ConfigurationDialog::ConfigurationDialog(sflphone_kdeView *parent) : QDialog(parent) -{ - //configuration qt designer - setupUi(this); - - //configuration complémentaire - QStyle * style = QApplication::style(); - errorWindow = new QErrorMessage(this); - codecPayloads = new MapStringString(); - horizontalSlider_historyCapacity->setMaximum(MAX_HISTORY_CAPACITY); - label_WarningSIP->setVisible(false); - for(int i = 0 ; i < list_options->count() ; i++) - { - list_options->item(i)->setTextAlignment(Qt::AlignHCenter); - } - button_accountUp->setIcon(style->standardIcon(QStyle::SP_ArrowUp)); - button_accountDown->setIcon(style->standardIcon(QStyle::SP_ArrowDown)); - toolButton_codecUp->setIcon(style->standardIcon(QStyle::SP_ArrowUp)); - toolButton_codecDown->setIcon(style->standardIcon(QStyle::SP_ArrowDown)); - tableWidget_codecs->verticalHeader()->hide(); - tableWidget_codecs->setSelectionBehavior(QAbstractItemView::SelectRows); - //tableWidget_codecs->setStyleSheet("border-style: hidden;"); - - - - //TODO ajouter les items de l'interface audio ici avec les constantes - - -// accountsChangedEnableWarning = true; - - ConfigurationManagerInterface & configurationManager = ConfigurationManagerInterfaceSingleton::getInstance(); - connect(&configurationManager, SIGNAL(accountsChanged()), - this, SLOT(on1_accountsChanged())); - - connect(edit1_alias, SIGNAL(textChanged(const QString &)), - this, SLOT(changedAccountList())); - connect(edit2_protocol, SIGNAL(currentIndexChanged(int)), - this, SLOT(changedAccountList())); - connect(edit3_server, SIGNAL(textChanged(const QString &)), - this, SLOT(changedAccountList())); - connect(edit4_user, SIGNAL(textChanged(const QString &)), - this, SLOT(changedAccountList())); - connect(edit5_password, SIGNAL(textChanged(const QString &)), - this, SLOT(changedAccountList())); - connect(edit6_mailbox, SIGNAL(textChanged(const QString &)), - this, SLOT(changedAccountList())); - connect(button_accountUp, SIGNAL(clicked()), - this, SLOT(changedAccountList())); - connect(button_accountDown, SIGNAL(clicked()), - this, SLOT(changedAccountList())); - connect(button_accountAdd, SIGNAL(clicked()), - this, SLOT(changedAccountList())); - connect(button_accountRemove, SIGNAL(clicked()), - this, SLOT(changedAccountList())); - - - loadOptions(); - -} - -ConfigurationDialog::~ConfigurationDialog() -{ - delete accountList; - delete errorWindow; - delete codecPayloads; -} - -void ConfigurationDialog::changedAccountList() -{ - toolButton_accountsApply->setEnabled(true); -} - -AccountList * ConfigurationDialog::getAccountList() -{ - return accountList; -} - -void ConfigurationDialog::loadOptions() -{ - ConfigurationManagerInterface & configurationManager = ConfigurationManagerInterfaceSingleton::getInstance(); - - //////////////////////// - ////General settings//// - //////////////////////// - - //Call history settings - spinBox_historyCapacity->setValue(configurationManager.getMaxCalls()); - - //SIP port settings - int sipPort = configurationManager.getSipPort(); - if(sipPort<1025){ - spinBox_SIPPort->setMinimum(sipPort); - label_WarningSIP->setText(tr2i18n("Attention : SIP port must be over 1024 !")); - label_WarningSIP->setVisible(true); - } - if(sipPort>65535){ - spinBox_SIPPort->setMaximum(sipPort); - label_WarningSIP->setText(tr2i18n("Attention : SIP port must be under 65536 !")); - label_WarningSIP->setVisible(true); - } - spinBox_SIPPort->setValue(configurationManager.getSipPort()); - - //////////////////////// - ////Display settings//// - //////////////////////// - - //Notification settings - checkBox1_notifOnCalls->setCheckState(configurationManager.getNotify() ? Qt::Checked : Qt::Unchecked); - checkBox2_notifOnMessages->setCheckState(configurationManager.getMailNotify() ? Qt::Checked : Qt::Unchecked); - - //Window display settings - checkBox1_displayOnStart->setCheckState(configurationManager.isStartHidden() ? Qt::Unchecked : Qt::Checked); - checkBox2_displayOnCalls->setCheckState(configurationManager.popupMode() ? Qt::Checked : Qt::Unchecked); - - ///////////////////////// - ////Accounts settings//// - ///////////////////////// - - loadAccountList(); - - //Stun settings - checkBox_stun->setCheckState(configurationManager.isStunEnabled() ? Qt::Checked : Qt::Unchecked); - lineEdit_stun->setText(QString(configurationManager.getStunServer())); - - ////////////////////// - ////Audio settings//// - ////////////////////// - - //Audio Interface settings - int audioManager = configurationManager.getAudioManager(); - comboBox_interface->setCurrentIndex(audioManager); - stackedWidget_interfaceSpecificSettings->setCurrentIndex(audioManager); - - //ringtones settings - checkBox_ringtones->setCheckState(configurationManager.isRingtoneEnabled() ? Qt::Checked : Qt::Unchecked); - urlComboRequester_ringtone->setUrl(KUrl::fromPath(configurationManager.getRingtoneChoice())); - - //codecs settings - loadCodecs(); - - // - //alsa settings - comboBox1_alsaPlugin->clear(); - QStringList pluginList = configurationManager.getOutputAudioPluginList(); - comboBox1_alsaPlugin->addItems(pluginList); - comboBox1_alsaPlugin->setCurrentIndex(comboBox1_alsaPlugin->findText(configurationManager.getCurrentAudioOutputPlugin())); - - - comboBox2_in->clear(); - comboBox3_out->clear(); - - if(audioManager == ALSA) - { - QStringList devices = configurationManager.getCurrentAudioDevicesIndex(); - - int inputDevice = devices[1].toInt(); - qDebug() << "inputDevice = " << devices[1]; - QStringList inputDeviceList = configurationManager.getAudioInputDeviceList(); - comboBox2_in->addItems(inputDeviceList); - comboBox2_in->setCurrentIndex(inputDevice); - - int outputDevice = devices[0].toInt(); - qDebug() << "outputDevice = " << devices[0]; - QStringList outputDeviceList = configurationManager.getAudioOutputDeviceList(); - comboBox3_out->addItems(outputDeviceList); - comboBox3_out->setCurrentIndex(outputDevice); - } - - //pulseaudio settings - checkBox_pulseAudioVolumeAlter->setCheckState(configurationManager.getPulseAppVolumeControl() ? Qt::Checked : Qt::Unchecked); - - /////////////////////// - ////Record settings//// - /////////////////////// - - urlcomborequester_destinationFolder->setUrl(KUrl::fromPath(configurationManager.getRecordPath())); - - - ///////////////////////////// - ////Address book settings//// - ///////////////////////////// - - MapStringInt addressBookSettings = configurationManager.getAddressbookSettings().value(); - qDebug() << "getAddressbookSettings() : " << addressBookSettings; - spinBox_maxResults->setValue(addressBookSettings[ADDRESSBOOK_MAX_RESULTS]); - checkBox_displayPhoto->setChecked(addressBookSettings[ADDRESSBOOK_DISPLAY_CONTACT_PHOTO]); - checkBox_business->setChecked(addressBookSettings[ADDRESSBOOK_DISPLAY_BUSINESS]); - checkBox_mobile->setChecked(addressBookSettings[ADDRESSBOOK_DISPLAY_MOBILE]); - checkBox_home->setChecked(addressBookSettings[ADDRESSBOOK_DISPLAY_HOME]); - - ///////////////////////////// - ///////Hooks settings//////// - ///////////////////////////// - - MapStringString hooksSettings = configurationManager.getHookSettings().value(); - qDebug() << "getHooksSettings() : " << hooksSettings; - checkBox_addPrefix->setChecked(hooksSettings[HOOKS_ENABLED]=="1"); - lineEdit_prepend->setText(hooksSettings[HOOKS_ADD_PREFIX]); - checkBox_hooksSIP->setChecked(hooksSettings[HOOKS_SIP_ENABLED]=="1"); - checkBox_hooksIAX->setChecked(hooksSettings[HOOKS_IAX2_ENABLED]=="1"); - lineEdit_SIPHeader->setText(hooksSettings[HOOKS_SIP_FIELD]); - lineEdit_command->setText(hooksSettings[HOOKS_COMMAND]); - - - -} - - -void ConfigurationDialog::saveOptions() -{ - ConfigurationManagerInterface & configurationManager = ConfigurationManagerInterfaceSingleton::getInstance(); - - accountsChangedEnableWarning = false; - //////////////////////// - ////General settings//// - //////////////////////// - - //Call history settings - configurationManager.setMaxCalls(spinBox_historyCapacity->value()); - - //SIP port settings - int sipPort = spinBox_SIPPort->value(); - - if(sipPort<1025){ - errorWindow->showMessage("Attention : le port SIP doit être supérieur à 1024 !"); - } - if(sipPort>65535){ - errorWindow->showMessage("Attention : le port SIP doit être inférieur à 65536 !"); - } - configurationManager.setSipPort(sipPort); - - //////////////////////// - ////Display settings//// - //////////////////////// - - //Notification settings - if(checkBox1_notifOnCalls->checkState() != (configurationManager.getNotify() ? Qt::Checked : Qt::Unchecked)) configurationManager.setNotify(); - if(checkBox2_notifOnMessages->checkState() != (configurationManager.getMailNotify() ? Qt::Checked : Qt::Unchecked)) configurationManager.setMailNotify(); - - //Window display settings - //WARNING états inversés - if(checkBox1_displayOnStart->checkState() != (configurationManager.isStartHidden() ? Qt::Unchecked : Qt::Checked)) configurationManager.startHidden(); - if(checkBox2_displayOnCalls->checkState() != (configurationManager.popupMode() ? Qt::Checked : Qt::Unchecked)) configurationManager.switchPopupMode(); - - ///////////////////////// - ////Accounts settings//// - ///////////////////////// - - saveAccountList(); - - //Stun settings - if(checkBox_stun->checkState() != (configurationManager.isStunEnabled() ? Qt::Checked : Qt::Unchecked)) configurationManager.enableStun(); - configurationManager.setStunServer(lineEdit_stun->text()); - - ////////////////////// - ////Audio settings//// - ////////////////////// - - //Audio Interface settings - qDebug() << "setting audio manager"; - int manager = comboBox_interface->currentIndex(); - configurationManager.setAudioManager(manager); - - //ringtones settings - qDebug() << "setting ringtone options"; - if(checkBox_ringtones->checkState() != (configurationManager.isRingtoneEnabled() ? Qt::Checked : Qt::Unchecked)) configurationManager.ringtoneEnabled(); - configurationManager.setRingtoneChoice(urlComboRequester_ringtone->url().url()); - - //codecs settings - qDebug() << "saving codecs"; - saveCodecs(); - - //alsa settings - if(manager == ALSA) - { - qDebug() << "setting alsa settings"; - configurationManager.setOutputAudioPlugin(comboBox1_alsaPlugin->currentText()); - int audioInputDevice = comboBox2_in->currentIndex(); - if( audioInputDevice != -1) - { - configurationManager.setAudioInputDevice(audioInputDevice); - } - int audioOutputDevice = comboBox3_out->currentIndex(); - if( audioOutputDevice != -1) - { - configurationManager.setAudioOutputDevice(audioOutputDevice); - } - } - //pulseaudio settings - if(manager == PULSEAUDIO) - { - qDebug() << "setting pulseaudio settings"; - if(checkBox_pulseAudioVolumeAlter->checkState() != (configurationManager.getPulseAppVolumeControl() ? Qt::Checked : Qt::Unchecked)) configurationManager.setPulseAppVolumeControl(); - } - - /////////////////////// - ////Record settings//// - /////////////////////// - - configurationManager.setRecordPath(urlcomborequester_destinationFolder->url().url()); - - ///////////////////////////// - ////Address Book settings//// - ///////////////////////////// - - MapStringInt addressBookSettings = MapStringInt(); - addressBookSettings[ADDRESSBOOK_MAX_RESULTS] = spinBox_maxResults->value(); - addressBookSettings[ADDRESSBOOK_DISPLAY_CONTACT_PHOTO] = checkBox_displayPhoto->isChecked(); - addressBookSettings[ADDRESSBOOK_DISPLAY_BUSINESS] = checkBox_business->isChecked(); - addressBookSettings[ADDRESSBOOK_DISPLAY_MOBILE] = checkBox_mobile->isChecked(); - addressBookSettings[ADDRESSBOOK_DISPLAY_HOME] = checkBox_home->isChecked(); - configurationManager.setAddressbookSettings(addressBookSettings); - - ///////////////////////////// - ///////Hooks settings//////// - ///////////////////////////// - - MapStringString hooksSettings = MapStringString(); - hooksSettings[HOOKS_ENABLED] = checkBox_addPrefix->isChecked() ? "1" : "0"; - hooksSettings[HOOKS_ADD_PREFIX] = lineEdit_prepend->text(); - hooksSettings[HOOKS_SIP_ENABLED] = checkBox_hooksSIP->isChecked() ? "1" : "0"; - hooksSettings[HOOKS_IAX2_ENABLED] = checkBox_hooksIAX->isChecked() ? "1" : "0"; - hooksSettings[HOOKS_SIP_FIELD] = lineEdit_SIPHeader->text(); - hooksSettings[HOOKS_COMMAND] = lineEdit_command->text(); - configurationManager.setHookSettings(hooksSettings); - -// accountsChangedEnableWarning = true; -} - - -void ConfigurationDialog::loadAccountList() -{ - ConfigurationManagerInterface & configurationManager = ConfigurationManagerInterfaceSingleton::getInstance(); - //ask for the list of accounts ids to the configurationManager - QStringList accountIds = configurationManager.getAccountList().value(); - //create the AccountList object with the ids - accountList = new AccountList(accountIds); - //initialize the QListWidget object with the AccountList - listWidget_accountList->clear(); - for (int i = 0; i < accountList->size(); ++i){ - addAccountToAccountList(&(*accountList)[i]); - } - if (listWidget_accountList->count() > 0 && listWidget_accountList->currentItem() == NULL) - listWidget_accountList->setCurrentRow(0); - else - frame2_editAccounts->setEnabled(false); -} - - -void ConfigurationDialog::saveAccountList() -{ - //get the configurationManager instance - ConfigurationManagerInterface & configurationManager = ConfigurationManagerInterfaceSingleton::getInstance(); - //save the account being edited - if(listWidget_accountList->currentItem()) - saveAccount(listWidget_accountList->currentItem()); - //ask for the list of accounts ids to the configurationManager - QStringList accountIds= QStringList(configurationManager.getAccountList().value()); - //create or update each account from accountList - for (int i = 0; i < accountList->size(); i++){ - Account & current = (*accountList)[i]; - QString currentId; - //if the account has no instanciated id, it has just been created in the client - if(current.isNew()) - { - MapStringString details = current.getAccountDetails(); - currentId = configurationManager.addAccount(details); - current.setAccountId(currentId); - } - //if the account has an instanciated id but it's not in configurationManager - else{ - if(! accountIds.contains(current.getAccountId())) - { - qDebug() << "The account with id " << current.getAccountId() << " doesn't exist. It might have been removed by another SFLPhone client."; - currentId = QString(); - } - else - { - configurationManager.setAccountDetails(current.getAccountId(), current.getAccountDetails()); - currentId = QString(current.getAccountId()); - } - } - qDebug() << currentId << " : " << current.isChecked(); - configurationManager.sendRegister(currentId, current.isChecked() ? 1 : 0 ); - } - //remove accounts that are in the configurationManager but not in the client - for (int i = 0; i < accountIds.size(); i++) - { - if(! accountList->getAccountById(accountIds[i])) - { - qDebug() << "remove account " << accountIds[i]; - configurationManager.removeAccount(accountIds[i]); - } - } - configurationManager.setAccountsOrder(accountList->getOrderedList()); -} - -void ConfigurationDialog::loadAccount(QListWidgetItem * item) -{ - if(! item ) { qDebug() << "Attempting to load details of an account from a NULL item"; return; } - - Account * account = accountList->getAccountByItem(item); - if(! account ) { qDebug() << "Attempting to load details of an unexisting account"; return; } - - edit1_alias->setText( account->getAccountDetail(ACCOUNT_ALIAS)); - - QString protocolsTab[] = ACCOUNT_TYPES_TAB; - QList<QString> * protocolsList = new QList<QString>(); - for(int i = 0 ; i < (int) (sizeof(protocolsTab) / sizeof(QString)) ; i++) - { - protocolsList->append(protocolsTab[i]); - } - QString accountName = account->getAccountDetail(ACCOUNT_TYPE); - int protocolIndex = protocolsList->indexOf(accountName); - delete protocolsList; - - edit2_protocol->setCurrentIndex( (protocolIndex < 0) ? 0 : protocolIndex ); - edit3_server->setText( account->getAccountDetail(ACCOUNT_HOSTNAME)); - edit4_user->setText( account->getAccountDetail(ACCOUNT_USERNAME)); - edit5_password->setText( account->getAccountDetail(ACCOUNT_PASSWORD)); - edit6_mailbox->setText( account->getAccountDetail(ACCOUNT_MAILBOX)); - QString status = account->getAccountDetail(ACCOUNT_STATUS); - qDebug() << "Color : " << account->getStateColorName(); - edit7_state->setText( "<FONT COLOR=\"" + account->getStateColorName() + "\">" + status + "</FONT>" ); - //edit7_Etat->setTextColor( account->getStateColor ); -} - - -void ConfigurationDialog::saveAccount(QListWidgetItem * item) -{ - if(! item) { qDebug() << "Attempting to save details of an account from a NULL item"; return; } - - Account * account = accountList->getAccountByItem(item); - if(! account) { qDebug() << "Attempting to save details of an unexisting account : " << item->text(); return; } - - account->setAccountDetail(ACCOUNT_ALIAS, edit1_alias->text()); - QString protocolsTab[] = ACCOUNT_TYPES_TAB; - account->setAccountDetail(ACCOUNT_TYPE, protocolsTab[edit2_protocol->currentIndex()]); - account->setAccountDetail(ACCOUNT_HOSTNAME, edit3_server->text()); - account->setAccountDetail(ACCOUNT_USERNAME, edit4_user->text()); - account->setAccountDetail(ACCOUNT_PASSWORD, edit5_password->text()); - account->setAccountDetail(ACCOUNT_MAILBOX, edit6_mailbox->text()); - account->setAccountDetail(ACCOUNT_ENABLED, account->isChecked() ? ACCOUNT_ENABLED_TRUE : ACCOUNT_ENABLED_FALSE); -} - -void ConfigurationDialog::addAccountToAccountList(Account * account) -{ - qDebug() << "addAccountToAccountList"; - QListWidgetItem * item = account->getItem(); - QWidget * widget = account->getItemWidget(); - listWidget_accountList->addItem(item); - listWidget_accountList->setItemWidget(item, widget); -} - -void ConfigurationDialog::loadCodecs() -{ - ConfigurationManagerInterface & configurationManager = ConfigurationManagerInterfaceSingleton::getInstance(); - QStringList codecList = configurationManager.getCodecList(); - QStringList activeCodecList = configurationManager.getActiveCodecList(); - qDebug() << codecList; - qDebug() << activeCodecList; - tableWidget_codecs->setRowCount(0); - codecPayloads->clear(); - for(int i=0 ; i<codecList.size() ; i++) - { - bool ok; - qDebug() << codecList[i]; - QString payloadStr = QString(codecList[i]); - int payload = payloadStr.toInt(&ok); - if(!ok) - qDebug() << "The codec's payload sent by the configurationManager is not a number : " << codecList[i]; - else - { - QStringList details = configurationManager.getCodecDetails(payload); - tableWidget_codecs->insertRow(i); - QTableWidgetItem * headerItem = new QTableWidgetItem(""); - tableWidget_codecs->setVerticalHeaderItem (i, headerItem); - //headerItem->setVisible(false); - tableWidget_codecs->setItem(i,0,new QTableWidgetItem("")); - tableWidget_codecs->setItem(i,1,new QTableWidgetItem(details[CODEC_NAME])); - //qDebug() << "tableWidget_Codecs->itemAt(" << i << "," << 2 << ")->setText(" << details[CODEC_NAME] << ");"; - //tableWidget_Codecs->item(i,2)->setText(details[CODEC_NAME]); - tableWidget_codecs->setItem(i,2,new QTableWidgetItem(details[CODEC_SAMPLE_RATE])); - tableWidget_codecs->setItem(i,3,new QTableWidgetItem(details[CODEC_BIT_RATE])); - tableWidget_codecs->setItem(i,4,new QTableWidgetItem(details[CODEC_BANDWIDTH])); - tableWidget_codecs->item(i,0)->setFlags(Qt::ItemIsSelectable|Qt::ItemIsUserCheckable|Qt::ItemIsEnabled); - tableWidget_codecs->item(i,0)->setCheckState(activeCodecList.contains(codecList[i]) ? Qt::Checked : Qt::Unchecked); - tableWidget_codecs->item(i,1)->setFlags(Qt::ItemIsSelectable|Qt::ItemIsEnabled); - tableWidget_codecs->item(i,2)->setFlags(Qt::ItemIsSelectable|Qt::ItemIsEnabled); - tableWidget_codecs->item(i,3)->setFlags(Qt::ItemIsSelectable|Qt::ItemIsEnabled); - tableWidget_codecs->item(i,4)->setFlags(Qt::ItemIsSelectable|Qt::ItemIsEnabled); - - (*codecPayloads)[details[CODEC_NAME]] = payloadStr; - qDebug() << "Added to codecs : " << payloadStr << " , " << details[CODEC_NAME]; - } - } - tableWidget_codecs->resizeColumnsToContents(); - tableWidget_codecs->resizeRowsToContents(); -} - - -void ConfigurationDialog::saveCodecs() -{ - ConfigurationManagerInterface & configurationManager = ConfigurationManagerInterfaceSingleton::getInstance(); - QStringList activeCodecs; - for(int i = 0 ; i < tableWidget_codecs->rowCount() ; i++) - { - //qDebug() << "Checked if active : " << tableWidget_Codecs->item(i,1)->text(); - if(tableWidget_codecs->item(i,0)->checkState() == Qt::Checked) - { - //qDebug() << "Added to activeCodecs : " << tableWidget_Codecs->item(i,1)->text(); - activeCodecs << (*codecPayloads)[tableWidget_codecs->item(i,1)->text()]; - } - } - qDebug() << "Calling setActiveCodecList with list : " << activeCodecs ; - configurationManager.setActiveCodecList(activeCodecs); -} - -void ConfigurationDialog::setPage(int page) -{ - stackedWidget_options->setCurrentIndex(page); - list_options->setCurrentRow(page); -} - -void ConfigurationDialog::updateAccountListCommands() -{ - bool buttonsEnabled[4] = {true,true,true,true}; - if(! listWidget_accountList->currentItem()) - { - buttonsEnabled[0] = false; - buttonsEnabled[1] = false; - buttonsEnabled[3] = false; - } - else if(listWidget_accountList->currentRow() == 0) - { - buttonsEnabled[0] = false; - } - else if(listWidget_accountList->currentRow() == listWidget_accountList->count() - 1) - { - buttonsEnabled[1] = false; - } - button_accountUp->setEnabled(buttonsEnabled[0]); - button_accountDown->setEnabled(buttonsEnabled[1]); - button_accountAdd->setEnabled(buttonsEnabled[2]); - button_accountRemove->setEnabled(buttonsEnabled[3]); -} - -void ConfigurationDialog::updateCodecListCommands() -{ - bool buttonsEnabled[2] = {true,true}; - if(! tableWidget_codecs->currentItem()) - { - buttonsEnabled[0] = false; - buttonsEnabled[1] = false; - } - else if(tableWidget_codecs->currentRow() == 0) - { - buttonsEnabled[0] = false; - } - else if(tableWidget_codecs->currentRow() == tableWidget_codecs->rowCount() - 1) - { - buttonsEnabled[1] = false; - } - toolButton_codecUp->setEnabled(buttonsEnabled[0]); - toolButton_codecDown->setEnabled(buttonsEnabled[1]); -} - -void ConfigurationDialog::on_edit1_alias_textChanged(const QString & text) -{ - qDebug() << "on_edit1_alias_textChanged"; - AccountItemWidget * widget = (AccountItemWidget *) listWidget_accountList->itemWidget(listWidget_accountList->currentItem()); - widget->setAccountText(text); - changedAccountList(); -} - - -void ConfigurationDialog::on_spinBox_SIPPort_valueChanged ( int value ) -{ - qDebug() << "on_spinBox_SIPPort_valueChanged"; - if(value>1024 && value<65536) - label_WarningSIP->setVisible(false); - else - label_WarningSIP->setVisible(true); -} - - -void ConfigurationDialog::on_toolButton_codecUp_clicked() -{ - qDebug() << "on_toolButton_codecUp_clicked"; - int currentCol = tableWidget_codecs->currentColumn(); - int currentRow = tableWidget_codecs->currentRow(); - int nbCol = tableWidget_codecs->columnCount(); - for(int i = 0 ; i < nbCol ; i++) - { - QTableWidgetItem * item1 = tableWidget_codecs->takeItem(currentRow, i); - QTableWidgetItem * item2 = tableWidget_codecs->takeItem(currentRow - 1, i); - tableWidget_codecs->setItem(currentRow - 1, i , item1); - tableWidget_codecs->setItem(currentRow, i , item2); - } - tableWidget_codecs->setCurrentCell(currentRow - 1, currentCol); -} - -void ConfigurationDialog::on_toolButton_codecDown_clicked() -{ - qDebug() << "on_toolButton_codecDown_clicked"; - int currentCol = tableWidget_codecs->currentColumn(); - int currentRow = tableWidget_codecs->currentRow(); - int nbCol = tableWidget_codecs->columnCount(); - for(int i = 0 ; i < nbCol ; i++) - { - QTableWidgetItem * item1 = tableWidget_codecs->takeItem(currentRow, i); - QTableWidgetItem * item2 = tableWidget_codecs->takeItem(currentRow + 1, i); - tableWidget_codecs->setItem(currentRow + 1, i , item1); - tableWidget_codecs->setItem(currentRow, i , item2); - } - tableWidget_codecs->setCurrentCell(currentRow + 1, currentCol); -} - -void ConfigurationDialog::on_listWidget_accountList_currentItemChanged ( QListWidgetItem * current, QListWidgetItem * previous ) -{ - qDebug() << "on_listWidget_accountList_currentItemChanged : " << ((accountList->getAccountByItem(current) != NULL) ? accountList->getAccountByItem(current)->getAlias() : "null"); - if(previous) - saveAccount(previous); - if(current) - loadAccount(current); - updateAccountListCommands(); -} - -void ConfigurationDialog::on_button_accountUp_clicked() -{ - qDebug() << "on_button_accountUp_clicked"; - int currentRow = listWidget_accountList->currentRow(); - QListWidgetItem * prevItem = listWidget_accountList->takeItem(currentRow); - Account * account = accountList->getAccountByItem(prevItem); - //we need to build a new item to set the itemWidget back - QListWidgetItem * item = account->renewItem(); - accountList->upAccount(currentRow); - delete prevItem; - listWidget_accountList->insertItem(currentRow - 1 , item); - listWidget_accountList->setItemWidget(item, account->getItemWidget()); - listWidget_accountList->setCurrentItem(item); -} - -void ConfigurationDialog::on_button_accountDown_clicked() -{ - int currentRow = listWidget_accountList->currentRow(); - QListWidgetItem * prevItem = listWidget_accountList->takeItem(currentRow); - Account * account = accountList->getAccountByItem(prevItem); - QListWidgetItem * item = account->renewItem(); - accountList->downAccount(currentRow); - delete prevItem; - listWidget_accountList->insertItem(currentRow + 1 , item); - listWidget_accountList->setItemWidget(item, account->getItemWidget()); - listWidget_accountList->setCurrentItem(item); -} - -void ConfigurationDialog::on_button_accountAdd_clicked() -{ - qDebug() << "on_button_accountAdd_clicked"; - QString itemName = QInputDialog::getText(this, "New account", "Enter new account's alias"); - itemName = itemName.simplified(); - if (!itemName.isEmpty()) { - Account * account = accountList->addAccount(itemName); - addAccountToAccountList(account); - int r = listWidget_accountList->count() - 1; - listWidget_accountList->setCurrentRow(r); - frame2_editAccounts->setEnabled(true); - } -} - -void ConfigurationDialog::on_button_accountRemove_clicked() -{ - qDebug() << "on_button_accountRemove_clicked"; - int r = listWidget_accountList->currentRow(); - QListWidgetItem * item = listWidget_accountList->takeItem(r); - accountList->removeAccount(item); - listWidget_accountList->setCurrentRow( (r >= listWidget_accountList->count()) ? r-1 : r ); -} - -void ConfigurationDialog::on_toolButton_accountsApply_clicked() -{ - qDebug() << "on_toolButton_accountsApply_clicked"; - toolButton_accountsApply->setEnabled(false); - saveAccountList(); - loadAccountList(); -} - - -void ConfigurationDialog::on_buttonBoxDialog_clicked(QAbstractButton * button) -{ - qDebug() << "on_buttonBoxDialog_clicked"; - if(buttonBoxDialog->standardButton(button) == QDialogButtonBox::Apply) - { - this->saveOptions(); - this->loadOptions(); - } - if(buttonBoxDialog->standardButton(button) == QDialogButtonBox::RestoreDefaults) - { - this->loadOptions(); - } - if(buttonBoxDialog->standardButton(button) == QDialogButtonBox::Ok) - { - this->saveOptions(); - this->setVisible(false); - } - if(buttonBoxDialog->standardButton(button) == QDialogButtonBox::Cancel) - { - this->setVisible(false); - } -} - -void ConfigurationDialog::on_tableWidget_codecs_currentCellChanged(int currentRow) -{ - qDebug() << "on_tableWidget_codecs_currentCellChanged"; - int nbCol = tableWidget_codecs->columnCount(); - for(int i = 0 ; i < nbCol ; i++) - { - tableWidget_codecs->setRangeSelected(QTableWidgetSelectionRange(currentRow, 0, currentRow, nbCol - 1), true); - } - updateCodecListCommands(); -} - -void ConfigurationDialog::on1_accountsChanged() -{ - qDebug() << "on1_accountsChanged"; -// ConfigurationManagerInterface & configurationManager = ConfigurationManagerInterfaceSingleton::getInstance(); -// disconnect(&configurationManager, SIGNAL(accountsChanged()), -// this, SLOT(on1_accountsChanged())); -// accountList->update(); -// loadAccountList(); -// connect(&configurationManager, SIGNAL(accountsChanged()), -// this, SLOT(on1_accountsChanged())); - if(isVisible() && accountsChangedEnableWarning) - { - errorWindow->showMessage(tr2i18n("Accounts changed : another client may be changing accounts or an account is unstable. \nIf another client is changing the settings, you may cancel your changes to avoid overwriting one's changes.")); - } - if(! isVisible()) - { - loadAccountList(); - } -} - -void ConfigurationDialog::on1_parametersChanged() -{ - qDebug() << "on1_parametersChanged"; -} - -void ConfigurationDialog::on1_errorAlert(int code) -{ - qDebug() << "on1_errorAlert code : " << code ; -} diff --git a/sflphone-client-kde/src/Contact.h b/sflphone-client-kde/src/Contact.h index 0d62657eab85f15e4ad24c9be9d7f0e9dd3d5483..383aaa688e72391c83621a22d4e5573f85fe39b4 100644 --- a/sflphone-client-kde/src/Contact.h +++ b/sflphone-client-kde/src/Contact.h @@ -31,7 +31,7 @@ using namespace KABC; /** - @author Jérémy Quentin <jeremy.quentin@gmail.com> + @author Jérémy Quentin <jeremy.quentin@savoirfairelinux.com> */ class Contact{ private: diff --git a/sflphone-client-kde/src/ContactItemWidget.h b/sflphone-client-kde/src/ContactItemWidget.h index 491af56d961266b0a210c4edab5d23ad0f7341ed..a3d4e3d41ea41fb45b28ffc8bc27b69af78bc093 100644 --- a/sflphone-client-kde/src/ContactItemWidget.h +++ b/sflphone-client-kde/src/ContactItemWidget.h @@ -26,7 +26,7 @@ #include "Contact.h" /** - @author Jérémy Quentin <jeremy.quentin@gmail.com> + @author Jérémy Quentin <jeremy.quentin@savoirfairelinux.com> */ class ContactItemWidget : public QWidget { diff --git a/sflphone-client-kde/src/Dialpad.cpp b/sflphone-client-kde/src/Dialpad.cpp new file mode 100644 index 0000000000000000000000000000000000000000..ce98484b4c1c4781ed07d8ac6ce15b3dbf90dec6 --- /dev/null +++ b/sflphone-client-kde/src/Dialpad.cpp @@ -0,0 +1,134 @@ +/*************************************************************************** + * Copyright (C) 2009 by Savoir-Faire Linux * + * Author : Jérémy Quentin * + * jeremy.quentin@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 * + * the Free Software Foundation; either version 3 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#include "Dialpad.h" + +#include <QLabel> +#include <QDebug> + +Dialpad::Dialpad(QWidget *parent) + : QWidget(parent) +{ + gridLayout = new QGridLayout(this); + gridLayout->setObjectName(QString::fromUtf8("gridLayout")); + + pushButton_0 = new QPushButton(this); + pushButton_1 = new QPushButton(this); + pushButton_2 = new QPushButton(this); + pushButton_3 = new QPushButton(this); + pushButton_4 = new QPushButton(this); + pushButton_5 = new QPushButton(this); + pushButton_6 = new QPushButton(this); + pushButton_7 = new QPushButton(this); + pushButton_8 = new QPushButton(this); + pushButton_9 = new QPushButton(this); + pushButton_diese = new QPushButton(this); + pushButton_etoile = new QPushButton(this); + + pushButton_0->setObjectName(QString::fromUtf8("pushButton_0")); + pushButton_1->setObjectName(QString::fromUtf8("pushButton_1")); + pushButton_2->setObjectName(QString::fromUtf8("pushButton_2")); + pushButton_3->setObjectName(QString::fromUtf8("pushButton_3")); + pushButton_4->setObjectName(QString::fromUtf8("pushButton_4")); + pushButton_5->setObjectName(QString::fromUtf8("pushButton_5")); + pushButton_6->setObjectName(QString::fromUtf8("pushButton_6")); + pushButton_7->setObjectName(QString::fromUtf8("pushButton_7")); + pushButton_8->setObjectName(QString::fromUtf8("pushButton_8")); + pushButton_9->setObjectName(QString::fromUtf8("pushButton_9")); + pushButton_diese->setObjectName(QString::fromUtf8("pushButton_diese")); + pushButton_etoile->setObjectName(QString::fromUtf8("pushButton_etoile")); + + gridLayout->addWidget(pushButton_1, 0, 0); + gridLayout->addWidget(pushButton_2, 0, 1); + gridLayout->addWidget(pushButton_3, 0, 2); + gridLayout->addWidget(pushButton_4, 1, 0); + gridLayout->addWidget(pushButton_5, 1, 1); + gridLayout->addWidget(pushButton_6, 1, 2); + gridLayout->addWidget(pushButton_7, 2, 0); + gridLayout->addWidget(pushButton_8, 2, 1); + gridLayout->addWidget(pushButton_9, 2, 2); + gridLayout->addWidget(pushButton_diese, 3, 0); + gridLayout->addWidget(pushButton_0, 3, 1); + gridLayout->addWidget(pushButton_etoile, 3, 2); + + fillButtons(); + + QMetaObject::connectSlotsByName(this); +} + + +void Dialpad::fillButtons() +{ + QHBoxLayout * layout; + QLabel * number; + QLabel * text; + int spacing = 5; + int numberSize = 14; + int textSize = 8; + + QPushButton * buttons[12] = + {pushButton_1, pushButton_2, pushButton_3, + pushButton_4, pushButton_5, pushButton_6, + pushButton_7, pushButton_8, pushButton_9, + pushButton_etoile, pushButton_0, pushButton_diese}; + + QString numbers[12] = + {"1", "2", "3", + "4", "5", "6", + "7", "8", "9", + "*", "0", "#"}; + + QString texts[12] = + { "" , "abc", "def" , + "ghi" , "jkl", "mno" , + "pqrs", "tuv", "wxyz", + "" , "" , "" }; + + for(int i = 0 ; i < 12 ; i++) + { + layout = new QHBoxLayout(); + layout->setSpacing(spacing); + number = new QLabel(numbers[i]); + number->setFont(QFont("", numberSize)); + layout->addWidget(number); + number->setAlignment(Qt::AlignRight | Qt::AlignVCenter); + text = new QLabel(texts[i]); + text->setFont(QFont("", textSize)); + layout->addWidget(text); + buttons[i]->setLayout(layout); + buttons[i]->setMinimumHeight(30); + buttons[i]->setText(""); + } +} + + + +void Dialpad::on_pushButton_1_clicked() { emit typed("1"); } +void Dialpad::on_pushButton_2_clicked() { emit typed("2"); } +void Dialpad::on_pushButton_3_clicked() { emit typed("3"); } +void Dialpad::on_pushButton_4_clicked() { emit typed("4"); } +void Dialpad::on_pushButton_5_clicked() { emit typed("5"); } +void Dialpad::on_pushButton_6_clicked() { emit typed("6"); } +void Dialpad::on_pushButton_7_clicked() { emit typed("7"); } +void Dialpad::on_pushButton_8_clicked() { emit typed("8"); } +void Dialpad::on_pushButton_9_clicked() { emit typed("9"); } +void Dialpad::on_pushButton_0_clicked() { emit typed("0"); } +void Dialpad::on_pushButton_diese_clicked() { emit typed("#"); } +void Dialpad::on_pushButton_etoile_clicked() { emit typed("*"); } diff --git a/sflphone-client-kde/src/Dialpad.h b/sflphone-client-kde/src/Dialpad.h new file mode 100644 index 0000000000000000000000000000000000000000..3d7cc25714690c48b1e5dbcf4d61abeda9d2d0de --- /dev/null +++ b/sflphone-client-kde/src/Dialpad.h @@ -0,0 +1,82 @@ +/*************************************************************************** + * Copyright (C) 2009 by Savoir-Faire Linux * + * Author : Jérémy Quentin * + * jeremy.quentin@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 * + * the Free Software Foundation; either version 3 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef DIALPAD_H +#define DIALPAD_H + +#include <QWidget> +#include <QPushButton> +#include <QGridLayout> + +/** +A widget that represents a phone dialpad, with numbers and letters associated. + + @author Jérémy Quentin <jeremy.quentin@gmail.com> +*/ +class Dialpad : public QWidget +{ +Q_OBJECT + +private: + QGridLayout * gridLayout; + QPushButton * pushButton_0; + QPushButton * pushButton_1; + QPushButton * pushButton_2; + QPushButton * pushButton_3; + QPushButton * pushButton_4; + QPushButton * pushButton_5; + QPushButton * pushButton_6; + QPushButton * pushButton_7; + QPushButton * pushButton_8; + QPushButton * pushButton_9; + QPushButton * pushButton_diese; + QPushButton * pushButton_etoile; + +public: + Dialpad(QWidget *parent = 0); + +// ~Dialpad(); + +private: + void fillButtons(); + +private slots: + void on_pushButton_1_clicked(); + void on_pushButton_2_clicked(); + void on_pushButton_3_clicked(); + void on_pushButton_4_clicked(); + void on_pushButton_5_clicked(); + void on_pushButton_6_clicked(); + void on_pushButton_7_clicked(); + void on_pushButton_8_clicked(); + void on_pushButton_9_clicked(); + void on_pushButton_0_clicked(); + void on_pushButton_diese_clicked(); + void on_pushButton_etoile_clicked(); + +signals: + /** + * This signal is emitted when the user types a button of the dialpad. + * @param text the text of the button typed by the user. + */ + void typed(QString text); +}; + +#endif diff --git a/sflphone-client-kde/src/SFLPhone.cpp b/sflphone-client-kde/src/SFLPhone.cpp index 9e6955837a3abb364887b2e2ae020af96a2c20ae..179023b5c74953fd0762ea37dd06c412a24c10cf 100644 --- a/sflphone-client-kde/src/SFLPhone.cpp +++ b/sflphone-client-kde/src/SFLPhone.cpp @@ -27,18 +27,26 @@ #include <KMenu> #include <KAction> #include <KToolBar> +#include <KStatusBar> #include <QtGui/QStatusBar> +#include <QtGui/QCursor> #include <KActionCollection> #include "sflphone_const.h" #include "instance_interface_singleton.h" +#include "configurationmanager_interface_singleton.h" +/** + * + * @param parent + */ SFLPhone::SFLPhone(QWidget *parent) : KXmlGuiWindow(parent), view(new sflphone_kdeView(this)) { - + + ConfigurationManagerInterface & configurationManager = ConfigurationManagerInterfaceSingleton::getInstance(); // accept dnd setAcceptDrops(true); @@ -51,7 +59,7 @@ SFLPhone::SFLPhone(QWidget *parent) setWindowIcon(QIcon(ICON_SFLPHONE)); - setWindowTitle(tr2i18n("SFLPhone")); + setWindowTitle(i18n("SFLPhone")); setupActions(); @@ -64,19 +72,39 @@ SFLPhone::SFLPhone(QWidget *parent) { QDir dir; dir.cdUp(); + dir.cd("data"); rcFilePath = dir.filePath("sflphone-client-kdeui.rc"); } qDebug() << "rcFilePath = " << rcFilePath ; createGUI(rcFilePath); - + setObjectNames(); QMetaObject::connectSlotsByName(this); - + view->updateStatusMessage(); + + move(QCursor::pos().x() - geometry().width()/2, QCursor::pos().y() - geometry().height()/2); + if( ! configurationManager.isStartHidden()) + { + show(); + } + + if(configurationManager.getAccountList().value().isEmpty()) + { + (new AccountWizard())->show(); + } + } SFLPhone::~SFLPhone() { } +void SFLPhone::setObjectNames() +{ + view->setObjectName("view"); + statusBar()->setObjectName("statusBar"); + trayIcon->setObjectName("trayIcon"); +} + void SFLPhone::setupActions() { qDebug() << "setupActions"; @@ -89,7 +117,9 @@ void SFLPhone::setupActions() actionCollection()->addAction("action_history", view->action_history); actionCollection()->addAction("action_addressBook", view->action_addressBook); actionCollection()->addAction("action_mailBox", view->action_mailBox); - KAction * action_quit = KStandardAction::quit(qApp, SLOT(closeAllWindows()), 0); + KAction * action_close = KStandardAction::close(this, SLOT(close()), 0); + actionCollection()->addAction("action_close", action_close); + KAction * action_quit = KStandardAction::quit(this, SLOT(quitButton()), 0); actionCollection()->addAction("action_quit", action_quit); @@ -100,10 +130,8 @@ void SFLPhone::setupActions() actionCollection()->addAction("action_configureAudio", view->action_configureAudio); actionCollection()->addAction("action_accountCreationWizard", view->action_accountCreationWizard); - - QStatusBar * statusbar = new QStatusBar(this); - statusbar->setObjectName(QString::fromUtf8("statusbar")); - this->setStatusBar(statusbar); + statusBarWidget = new QLabel(); + statusBar()->addWidget(statusBarWidget); QToolBar * toolbar = new QToolBar(this); this->addToolBar(Qt::TopToolBarArea, toolbar); @@ -117,6 +145,7 @@ void SFLPhone::setupActions() toolbar->addAction(view->action_addressBook); toolbar->addSeparator(); toolbar->addAction(view->action_mailBox); + toolbar->setIconSize(QSize(TOOLBAR_SIZE,TOOLBAR_SIZE)); trayIconMenu = new QMenu(this); @@ -125,27 +154,37 @@ void SFLPhone::setupActions() trayIcon = new QSystemTrayIcon(this->windowIcon(), this); trayIcon->setContextMenu(trayIconMenu); trayIcon->show(); - trayIcon->setObjectName("trayIcon"); iconChanged = false; } +sflphone_kdeView * SFLPhone::getView() +{ + return view; +} bool SFLPhone::queryClose() +{ + qDebug() << "queryClose"; + hide(); + return false; +} + +void SFLPhone::quitButton() { InstanceInterface & instance = InstanceInterfaceSingleton::getInstance(); - qDebug() << "queryClose : " << view->listWidget_callList->count() << " calls open."; + qDebug() << "quitButton : " << view->listWidget_callList->count() << " calls open."; if(view->listWidget_callList->count() > 0 && instance.getRegistrationCount() <= 1) { qDebug() << "Attempting to quit when still having some calls open."; - view->getErrorWindow()->showMessage(tr2i18n("You still have some calls open. Please close all calls before quitting.", 0)); - return false; + view->getErrorWindow()->showMessage(i18n("You still have some calls open. Please close all calls before quitting.")); } instance.Unregister(getpid()); - return true; + qApp->quit(); } + void SFLPhone::putForeground() { activateWindow(); @@ -167,8 +206,8 @@ void SFLPhone::trayIconSignal() void SFLPhone::sendNotif(QString caller) { trayIcon->showMessage( - tr2i18n("Incoming call"), - tr2i18n("You have an incoming call from : ") + caller + ".\n" + tr2i18n("Click to accept or refuse it."), + i18n("Incoming call"), + i18n("You have an incoming call from") + " " + caller + ".\n" + i18n("Click to accept or refuse it."), QSystemTrayIcon::Warning, 20000); } @@ -213,4 +252,9 @@ void SFLPhone::on_trayIcon_activated(QSystemTrayIcon::ActivationReason reason) } +void SFLPhone::on_view_statusMessageChanged(const QString & message) +{ + qDebug() << "on_view_statusMessageChanged : " + message; + statusBarWidget->setText(message); +} diff --git a/sflphone-client-kde/src/SFLPhone.h b/sflphone-client-kde/src/SFLPhone.h index 7b8edd3c21d0e3aa5cc9400c07e4454f4d682f24..c85f58c1e6435db64338482a4e310e4b240ec4a0 100644 --- a/sflphone-client-kde/src/SFLPhone.h +++ b/sflphone-client-kde/src/SFLPhone.h @@ -32,14 +32,12 @@ #include <KXmlGuiWindow> #include "ui_sflphone_kdeview_base.h" -#include "ConfigDialog.h" #include "CallList.h" #include "AccountWizard.h" #include "Contact.h" #include "sflphone_kdeview.h" -class ConfigurationDialog; class sflphone_kdeView; class SFLPhone : public KXmlGuiWindow @@ -52,10 +50,15 @@ private: QMenu *trayIconMenu; bool iconChanged; QSystemTrayIcon *trayIcon; + QLabel * statusBarWidget; + +private: + void setObjectNames(); protected: virtual bool queryClose(); virtual void changeEvent(QEvent * event); + public: SFLPhone(QWidget *parent = 0); @@ -64,12 +67,15 @@ public: void sendNotif(QString caller); void putForeground(); void trayIconSignal(); + sflphone_kdeView * getView(); private slots: void on_trayIcon_activated(QSystemTrayIcon::ActivationReason reason); void on_trayIcon_messageClicked(); + void on_view_statusMessageChanged(const QString & message); + void quitButton(); }; diff --git a/sflphone-client-kde/src/conf/ConfigurationDialog.cpp b/sflphone-client-kde/src/conf/ConfigurationDialog.cpp new file mode 100644 index 0000000000000000000000000000000000000000..1aef5e9cd3b1f6603e4bca6477ba1fcb1f799ca9 --- /dev/null +++ b/sflphone-client-kde/src/conf/ConfigurationDialog.cpp @@ -0,0 +1,118 @@ +/*************************************************************************** + * Copyright (C) 2009 by Savoir-Faire Linux * + * Author : Jérémy Quentin * + * jeremy.quentin@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 * + * the Free Software Foundation; either version 3 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#include "ConfigurationDialog.h" + +#include "conf/ConfigurationSkeleton.h" + +#include "dlggeneral.h" +#include "dlgdisplay.h" +#include "dlgaccounts.h" +#include "dlgaudio.h" +#include "dlgaddressbook.h" +#include "dlgrecord.h" +#include "dlghooks.h" + +#include "sflphone_const.h" + +ConfigurationDialogKDE::ConfigurationDialogKDE(sflphone_kdeView *parent) + :KConfigDialog(parent, SETTINGS_NAME, ConfigurationSkeleton::self()) +{ + this->setWindowIcon(QIcon(ICON_SFLPHONE)); + + dlgGeneral = new DlgGeneral(this); + dlgDisplay = new DlgDisplay(this); + dlgAccounts = new DlgAccounts(this); + dlgAudio = new DlgAudio(this); + dlgAddressBook = new DlgAddressBook(this); + dlgRecord = new DlgRecord(this); + dlgHooks = new DlgHooks(this); + + addPage( dlgGeneral , i18n("General") , "sflphone-client-kde" ); + addPage( dlgDisplay , i18n("Display") , "applications-graphics" ); + addPage( dlgAccounts , i18n("Accounts") , "personal" ); + addPage( dlgAudio , i18n("Audio") , "voicecall" ); + addPage( dlgAddressBook , i18n("Address Book") , "x-office-address-book" ); + addPage( dlgRecord , i18n("Record") , "media-record" ); + addPage( dlgHooks , i18n("Hooks") , "insert-link" ); + connect(this, SIGNAL(applyClicked()), dlgAudio, SLOT(updateAlsaSettings())); + connect(this, SIGNAL(okClicked()), dlgAudio, SLOT(updateAlsaSettings())); + connect(this, SIGNAL(applyClicked()), this, SLOT(applyCustomSettings())); + connect(this, SIGNAL(okClicked()), this, SLOT(applyCustomSettings())); + + connect(dlgGeneral, SIGNAL(clearCallHistoryAsked()), this, SIGNAL(clearCallHistoryAsked())); +// connect(this, SIGNAL(settingsChanged(const QString&)), this, SLOT(slot())); +// connect(this, SIGNAL(widgetModified()), this, SLOT(slot())); +} + + +ConfigurationDialogKDE::~ConfigurationDialogKDE() +{ +} + +void ConfigurationDialogKDE::slot() +{ + qDebug() << "slot"; +} + +void ConfigurationDialogKDE::updateWidgets() +{ + qDebug() << "updateWidgets"; + dlgAudio->updateWidgets(); + dlgAccounts->updateWidgets(); +} + +void ConfigurationDialogKDE::updateSettings() +{ + qDebug() << "updateSettings"; + dlgAudio->updateSettings(); + dlgAccounts->updateSettings(); + qDebug() << "yo " << ConfigurationSkeleton::self()->alsaPlugin(); +} + +bool ConfigurationDialogKDE::hasChanged() +{ + qDebug() << "hasChanged"; + return dlgAudio->hasChanged() || dlgAccounts->hasChanged(); +} + +void ConfigurationDialogKDE::updateButtons() +{ + qDebug() << "updateButtons"; + enableButtonApply( hasChanged() ); +} + +void ConfigurationDialogKDE::applyCustomSettings() +{ + qDebug() << "applyCustomSettings"; + dlgAccounts->applyCustomSettings(); +// if(hasChanged()) +// { + ConfigurationSkeleton::self()->writeConfig(); +// } + updateButtons(); +} + +void ConfigurationDialogKDE::reload() +{ + qDebug() << "reload"; + ConfigurationSkeleton::self()->readConfig(); + updateWidgets(); +} diff --git a/sflphone-client-kde/src/conf/ConfigurationDialog.h b/sflphone-client-kde/src/conf/ConfigurationDialog.h new file mode 100644 index 0000000000000000000000000000000000000000..02ac0fe0dc4b1477a9675a0651c708e21b883f6c --- /dev/null +++ b/sflphone-client-kde/src/conf/ConfigurationDialog.h @@ -0,0 +1,109 @@ +/*************************************************************************** + * Copyright (C) 2009 by Savoir-Faire Linux * + * Author : Jérémy Quentin * + * jeremy.quentin@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 * + * the Free Software Foundation; either version 3 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef CONFIGURATIONDIALOG_H +#define CONFIGURATIONDIALOG_H + +#include <kconfigdialog.h> + + +#include "kcfg_settings.h" +#include "sflphone_kdeview.h" + + +#define SETTINGS_NAME "settings" + +class DlgGeneral; +class DlgDisplay; +class DlgAccounts; +class DlgAudio; +class DlgAddressBook; +class DlgRecord; +class DlgHooks; + +class sflphone_kdeView; + +/** + @author Jérémy Quentin <jeremy.quentin@gmail.com> +*/ +class ConfigurationDialogKDE : public KConfigDialog +{ +Q_OBJECT +private: + + + DlgGeneral * dlgGeneral; + DlgDisplay * dlgDisplay; + DlgAccounts * dlgAccounts; + DlgAudio * dlgAudio; + DlgAddressBook * dlgAddressBook; + DlgRecord * dlgRecord; + DlgHooks * dlgHooks; + +public: + ConfigurationDialogKDE(sflphone_kdeView *parent = 0); + + ~ConfigurationDialogKDE(); + + +public slots: + void slot(); + /** + * Reimplements KConfigDialog + */ + void updateWidgets(); + /** + * Reimplements KConfigDialog + */ + void updateSettings(); + /** + * Should be implemented in KConfigDialog but for no reason, is not. + * For the moment it is here but has to be removed if implemented in KConfigDialog + * because causes problems for a few cases (item managed by kconfig switched, item not managed + * switched and then switched back, apply becomes disabled). + * Can't be resolved without a method to know if items managed by kconfig have changed. + * Disable/Enable Apply Button according to hasChanged() result + */ + void updateButtons(); + /** + * Same as updateButtons, should be implemented in KConfigDialog. + * @return whether any custom widget has changed in the dialog. + */ + bool hasChanged(); + + /** + * reloads the informations before showing it. + */ + void reload(); + +private slots: + /** + * Apply settings not managed by kconfig (accounts) + * Should be removed when accounts are managed by kconfig. + */ + void applyCustomSettings(); + + +signals: + void clearCallHistoryAsked(); + +}; + +#endif diff --git a/sflphone-client-kde/src/conf/ConfigurationSkeleton.cpp b/sflphone-client-kde/src/conf/ConfigurationSkeleton.cpp new file mode 100644 index 0000000000000000000000000000000000000000..e6f89cdd33ebc64d95def2231e93725d69c011fe --- /dev/null +++ b/sflphone-client-kde/src/conf/ConfigurationSkeleton.cpp @@ -0,0 +1,288 @@ +/*************************************************************************** + * Copyright (C) 2009 by Savoir-Faire Linux * + * Author : Jérémy Quentin * + * jeremy.quentin@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 * + * the Free Software Foundation; either version 3 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#include "ConfigurationSkeleton.h" + +#include "configurationmanager_interface_singleton.h" +#include "sflphone_const.h" + +ConfigurationSkeleton::ConfigurationSkeleton() + : ConfigurationSkeletonBase() +{ + qDebug() << "Yoooooooouuuuupppppppiiiiii"; + readConfig(); + isImmutable( QString::fromLatin1 ( "alsaPlugin" ) ); +} + +ConfigurationSkeleton * ConfigurationSkeleton::instance = NULL; + +ConfigurationSkeleton * ConfigurationSkeleton::self() +{ + if(instance == NULL) + { instance = new ConfigurationSkeleton(); } + return instance; +} + + +ConfigurationSkeleton::~ConfigurationSkeleton() +{ +} + +void ConfigurationSkeleton::readConfig() +{ + qDebug() << "\nReading config"; + + ConfigurationManagerInterface & configurationManager = ConfigurationManagerInterfaceSingleton::getInstance(); + +// qDebug() << "configurationManager.getAudioManager4() = " << configurationManager.getAudioManager(); + //////////////////////// + ////General settings//// + //////////////////////// + + //Call history settings + setEnableHistory(configurationManager.getHistoryEnabled()); + setHistoryMax(configurationManager.getHistoryLimit()); + + //SIP port settings + setSIPPort(configurationManager.getSipPort()); + + //////////////////////// + ////Display settings//// + //////////////////////// + + //Notification settings + setNotifOnCalls(configurationManager.getNotify()); + setNotifOnMessages(configurationManager.getMailNotify()); + + //Window display settings + setDisplayOnStart(! configurationManager.isStartHidden()); + setDisplayOnCalls(configurationManager.popupMode()); + + ///////////////////////// + ////Accounts settings//// + ///////////////////////// + +// loadAccountList(); + + + //Stun settings + setEnableStun(configurationManager.isStunEnabled()); + setStunServer(configurationManager.getStunServer()); + + + ////////////////////// + ////Audio settings//// + ////////////////////// + + //Audio Interface settings + int audioManager = configurationManager.getAudioManager(); + qDebug() << "audioManager = " << audioManager; + setInterface(audioManager); + + //ringtones settings + setEnableRingtones(configurationManager.isRingtoneEnabled()); + QString ringtone = configurationManager.getRingtoneChoice(); + if(ringtone.isEmpty()) + { + setRingtone(QString(SHARE_INSTALL_PREFIX) + "sflphone/ringtones/konga.ul"); + } + else + { + setRingtone(ringtone); + } + + //codecs settings + setActiveCodecList(configurationManager.getActiveCodecList()); + + qDebug() << "configurationManager.getCurrentAudioOutputPlugin() = " << configurationManager.getCurrentAudioOutputPlugin(); + setAlsaPlugin(configurationManager.getCurrentAudioOutputPlugin()); + bool ok; + QStringList devices = configurationManager.getCurrentAudioDevicesIndex(); + qDebug() << "inputDevice = " << devices[1]; + int inputDevice = devices[1].toInt(& ok); + if(!ok) qDebug() << "inputDevice is not a number"; + setAlsaInputDevice(inputDevice); + + qDebug() << "outputDevice = " << devices[0]; + int outputDevice = devices[0].toInt(& ok); + if(!ok) qDebug() << "outputDevice is not a number"; + setAlsaOutputDevice(outputDevice); + + + //pulseaudio settings + setPulseAudioVolumeAlter(configurationManager.getPulseAppVolumeControl()); + + /////////////////////// + ////Record settings//// + /////////////////////// + + QString recordPath = configurationManager.getRecordPath(); + if(! recordPath.isEmpty()) + { + setDestinationFolder(recordPath); + } + else + { + setDestinationFolder(QDir::home().path()); + } + + + + ///////////////////////////// + ////Address book settings//// + ///////////////////////////// + + MapStringInt addressBookSettings = configurationManager.getAddressbookSettings().value(); + qDebug() << "getAddressbookSettings() : " << addressBookSettings; + setMaxResults(addressBookSettings[ADDRESSBOOK_MAX_RESULTS]); + setDisplayPhoto(addressBookSettings[ADDRESSBOOK_DISPLAY_CONTACT_PHOTO]); + setBusiness(addressBookSettings[ADDRESSBOOK_DISPLAY_BUSINESS]); + setMobile(addressBookSettings[ADDRESSBOOK_DISPLAY_MOBILE]); + setHome(addressBookSettings[ADDRESSBOOK_DISPLAY_HOME]); + + ///////////////////////////// + ///////Hooks settings//////// + ///////////////////////////// + + MapStringString hooksSettings = configurationManager.getHookSettings().value(); + qDebug() << "getHooksSettings() : " << hooksSettings; + setAddPrefix(hooksSettings[HOOKS_ENABLED]=="1"); + setPrepend(hooksSettings[HOOKS_ADD_PREFIX]); + setEnableHooksSIP(hooksSettings[HOOKS_SIP_ENABLED]=="1"); + setEnableHooksIAX(hooksSettings[HOOKS_IAX2_ENABLED]=="1"); + setHooksSIPHeader(hooksSettings[HOOKS_SIP_FIELD]); + setHooksCommand(hooksSettings[HOOKS_COMMAND]); +} + +void ConfigurationSkeleton::writeConfig() +{ + qDebug() << "\nWriting config"; + ConfigurationManagerInterface & configurationManager = ConfigurationManagerInterfaceSingleton::getInstance(); + + + //////////////////////// + ////General settings//// + //////////////////////// + + //Call history settings + if(enableHistory() != configurationManager.getHistoryEnabled()) configurationManager.setHistoryEnabled(); + configurationManager.setHistoryLimit(historyMax()); + //SIP port settings + configurationManager.setSipPort(sIPPort()); + + + //////////////////////// + ////Display settings//// + //////////////////////// + + //Notification settings + if(notifOnCalls() != configurationManager.getNotify()) configurationManager.setNotify(); + if(notifOnMessages() != configurationManager.getMailNotify()) configurationManager.setMailNotify(); + + //Window display settings + //WARNING états inversés + if(displayOnStart() == configurationManager.isStartHidden()) configurationManager.startHidden(); + if(displayOnCalls() != configurationManager.popupMode()) configurationManager.switchPopupMode(); + + ///////////////////////// + ////Accounts settings//// + ///////////////////////// + +// saveAccountList(); + + + //Stun settings + if(enableStun() != configurationManager.isStunEnabled()) configurationManager.enableStun(); + configurationManager.setStunServer(stunServer()); + + ////////////////////// + ////Audio settings//// + ////////////////////// + + //Audio Interface settings + int prevManager = configurationManager.getAudioManager(); + int newManager = interface(); + if(prevManager != newManager) + { + configurationManager.setAudioManager(newManager); + } + + //ringtones settings + if(enableRingtones() != configurationManager.isRingtoneEnabled()) configurationManager.ringtoneEnabled(); + configurationManager.setRingtoneChoice(ringtone()); + + //codecs settings + configurationManager.setActiveCodecList(activeCodecList()); + + + //alsa settings + if(prevManager == CONST_ALSA && newManager == EnumInterface::ALSA) + { + qDebug() << "setting alsa settings"; + configurationManager.setOutputAudioPlugin(alsaPlugin()); + configurationManager.setAudioInputDevice(alsaInputDevice()); + configurationManager.setAudioOutputDevice(alsaOutputDevice()); + } + //pulseaudio settings + if(newManager == EnumInterface::PulseAudio) + { + qDebug() << "setting pulseaudio settings"; + if(pulseAudioVolumeAlter() != configurationManager.getPulseAppVolumeControl()) configurationManager.setPulseAppVolumeControl(); + } + + + /////////////////////// + ////Record settings//// + /////////////////////// + + QString destination = destinationFolder(); + qDebug() << destination ; + configurationManager.setRecordPath(destination); + + + ///////////////////////////// + ////Address Book settings//// + ///////////////////////////// + + MapStringInt addressBookSettings = MapStringInt(); + addressBookSettings[ADDRESSBOOK_MAX_RESULTS] = maxResults(); + addressBookSettings[ADDRESSBOOK_DISPLAY_CONTACT_PHOTO] = displayPhoto(); + addressBookSettings[ADDRESSBOOK_DISPLAY_BUSINESS] = business(); + addressBookSettings[ADDRESSBOOK_DISPLAY_MOBILE] = mobile(); + addressBookSettings[ADDRESSBOOK_DISPLAY_HOME] = home(); + configurationManager.setAddressbookSettings(addressBookSettings); + + ///////////////////////////// + ///////Hooks settings//////// + ///////////////////////////// + + MapStringString hooksSettings = MapStringString(); + hooksSettings[HOOKS_ENABLED] = addPrefix() ? "1" : "0"; + hooksSettings[HOOKS_ADD_PREFIX] = prepend(); + hooksSettings[HOOKS_SIP_ENABLED] = enableHooksSIP() ? "1" : "0"; + hooksSettings[HOOKS_IAX2_ENABLED] = enableHooksIAX() ? "1" : "0"; + hooksSettings[HOOKS_SIP_FIELD] = hooksSIPHeader(); + hooksSettings[HOOKS_COMMAND] = hooksCommand(); + configurationManager.setHookSettings(hooksSettings); + + readConfig(); +} + + diff --git a/sflphone-client-kde/src/conf/ConfigurationSkeleton.h b/sflphone-client-kde/src/conf/ConfigurationSkeleton.h new file mode 100644 index 0000000000000000000000000000000000000000..a7f31d68b405aac9198aba9312aa939291bebc32 --- /dev/null +++ b/sflphone-client-kde/src/conf/ConfigurationSkeleton.h @@ -0,0 +1,59 @@ +/*************************************************************************** + * Copyright (C) 2009 by Savoir-Faire Linux * + * Author : Jérémy Quentin * + * jeremy.quentin@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 * + * the Free Software Foundation; either version 3 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef CONFIGURATIONSKELETON_H +#define CONFIGURATIONSKELETON_H + +#include <QWidget> + +#include "kcfg_settings.h" + +/** + @author Jérémy Quentin <jeremy.quentin@gmail.com> +*/ +class ConfigurationSkeleton : public ConfigurationSkeletonBase +{ +Q_OBJECT + +private: + static ConfigurationSkeleton * instance; + +public: + ConfigurationSkeleton(); + + ~ConfigurationSkeleton(); + + virtual void readConfig(); + + virtual void writeConfig(); + + + static ConfigurationSkeleton * self(); + + +// protected: + +// virtual void usrReadConfig(); + + + +}; + +#endif diff --git a/sflphone-client-kde/src/conf/dlgaccounts.cpp b/sflphone-client-kde/src/conf/dlgaccounts.cpp new file mode 100644 index 0000000000000000000000000000000000000000..09bd4a645069e5ac764e459949c1cf14328e5cbf --- /dev/null +++ b/sflphone-client-kde/src/conf/dlgaccounts.cpp @@ -0,0 +1,371 @@ +/*************************************************************************** + * Copyright (C) 2009 by Savoir-Faire Linux * + * Author : Jérémy Quentin * + * jeremy.quentin@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 * + * the Free Software Foundation; either version 3 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#include "dlgaccounts.h" + +#include <QtGui/QInputDialog> + +#include "configurationmanager_interface_singleton.h" +#include "sflphone_kdeview.h" +#include "sflphone_const.h" +#include "conf/ConfigurationDialog.h" + +DlgAccounts::DlgAccounts(KConfigDialog *parent) + : QWidget(parent) +{ + setupUi(this); + + ConfigurationManagerInterface & configurationManager = ConfigurationManagerInterfaceSingleton::getInstance(); + QStyle * style = QApplication::style(); + button_accountUp->setIcon(KIcon("go-up")); + button_accountDown->setIcon(KIcon("go-down")); + button_accountAdd->setIcon(KIcon("list-add")); + button_accountRemove->setIcon(KIcon("list-remove")); + accountList = new AccountList(false); + loadAccountList(); + accountListHasChanged = false; + toolButton_accountsApply->setEnabled(false); + + connect(edit1_alias, SIGNAL(textEdited(const QString &)), + this, SLOT(changedAccountList())); + connect(edit2_protocol, SIGNAL(currentIndexChanged(int)), + this, SLOT(changedAccountList())); + connect(edit3_server, SIGNAL(textEdited(const QString &)), + this, SLOT(changedAccountList())); + connect(edit4_user, SIGNAL(textEdited(const QString &)), + this, SLOT(changedAccountList())); + connect(edit5_password, SIGNAL(textEdited(const QString &)), + this, SLOT(changedAccountList())); + connect(edit6_mailbox, SIGNAL(textEdited(const QString &)), + this, SLOT(changedAccountList())); + connect(button_accountUp, SIGNAL(clicked()), + this, SLOT(changedAccountList())); + connect(button_accountDown, SIGNAL(clicked()), + this, SLOT(changedAccountList())); + connect(button_accountAdd, SIGNAL(clicked()), + this, SLOT(changedAccountList())); + connect(button_accountRemove, SIGNAL(clicked()), + this, SLOT(changedAccountList())); + + connect(&configurationManager, SIGNAL(accountsChanged()), + this, SLOT(updateAccountStates())); + + + connect(this, SIGNAL(updateButtons()), parent, SLOT(updateButtons())); +} + + +DlgAccounts::~DlgAccounts() +{ +} + +void DlgAccounts::saveAccountList() +{ + ConfigurationManagerInterface & configurationManager = ConfigurationManagerInterfaceSingleton::getInstance(); + disconnectAccountsChangedSignal(); + //save the account being edited + if(listWidget_accountList->currentItem()) + saveAccount(listWidget_accountList->currentItem()); + QStringList accountIds= QStringList(configurationManager.getAccountList().value()); + //create or update each account from accountList + for (int i = 0; i < accountList->size(); i++){ + Account & current = (*accountList)[i]; + QString currentId; + //if the account has no instanciated id, it has just been created in the client + if(current.isNew()) + { + MapStringString details = current.getAccountDetails(); + currentId = configurationManager.addAccount(details); + current.setAccountId(currentId); + } + //if the account has an instanciated id but it's not in configurationManager + else{ + if(! accountIds.contains(current.getAccountId())) + { + qDebug() << "The account with id " << current.getAccountId() << " doesn't exist. It might have been removed by another SFLPhone client."; + currentId = QString(); + } + else + { + configurationManager.setAccountDetails(current.getAccountId(), current.getAccountDetails()); + currentId = QString(current.getAccountId()); + } + } + qDebug() << currentId << " : " << current.isChecked(); + configurationManager.sendRegister(currentId, current.isChecked() ? 1 : 0 ); + } + //remove accounts that are in the configurationManager but not in the client + for (int i = 0; i < accountIds.size(); i++) + { + if(! accountList->getAccountById(accountIds[i])) + { + qDebug() << "remove account " << accountIds[i]; + configurationManager.removeAccount(accountIds[i]); + } + } + configurationManager.setAccountsOrder(accountList->getOrderedList()); + connectAccountsChangedSignal(); +} + +void DlgAccounts::connectAccountsChangedSignal() +{ + ConfigurationManagerInterface & configurationManager = ConfigurationManagerInterfaceSingleton::getInstance(); + connect(&configurationManager, SIGNAL(accountsChanged()), + this, SLOT(on1_accountsChanged())); +} + +void DlgAccounts::disconnectAccountsChangedSignal() +{ + ConfigurationManagerInterface & configurationManager = ConfigurationManagerInterfaceSingleton::getInstance(); + disconnect(&configurationManager, SIGNAL(accountsChanged()), + this, SLOT(on1_accountsChanged())); +} + + +void DlgAccounts::saveAccount(QListWidgetItem * item) +{ + if(! item) { qDebug() << "Attempting to save details of an account from a NULL item"; return; } + + Account * account = accountList->getAccountByItem(item); + if(! account) { qDebug() << "Attempting to save details of an unexisting account : " << item->text(); return; } + + account->setAccountDetail(ACCOUNT_ALIAS, edit1_alias->text()); + QString protocolsTab[] = ACCOUNT_TYPES_TAB; + account->setAccountDetail(ACCOUNT_TYPE, protocolsTab[edit2_protocol->currentIndex()]); + account->setAccountDetail(ACCOUNT_HOSTNAME, edit3_server->text()); + account->setAccountDetail(ACCOUNT_USERNAME, edit4_user->text()); + account->setAccountDetail(ACCOUNT_PASSWORD, edit5_password->text()); + account->setAccountDetail(ACCOUNT_MAILBOX, edit6_mailbox->text()); + account->setAccountDetail(ACCOUNT_ENABLED, account->isChecked() ? ACCOUNT_ENABLED_TRUE : ACCOUNT_ENABLED_FALSE); +} + +void DlgAccounts::loadAccount(QListWidgetItem * item) +{ + if(! item ) { qDebug() << "Attempting to load details of an account from a NULL item"; return; } + + Account * account = accountList->getAccountByItem(item); + if(! account ) { qDebug() << "Attempting to load details of an unexisting account"; return; } + + edit1_alias->setText( account->getAccountDetail(ACCOUNT_ALIAS)); + + QString protocolsTab[] = ACCOUNT_TYPES_TAB; + QList<QString> * protocolsList = new QList<QString>(); + for(int i = 0 ; i < (int) (sizeof(protocolsTab) / sizeof(QString)) ; i++) + { + protocolsList->append(protocolsTab[i]); + } + QString accountName = account->getAccountDetail(ACCOUNT_TYPE); + int protocolIndex = protocolsList->indexOf(accountName); + delete protocolsList; + + edit2_protocol->setCurrentIndex( (protocolIndex < 0) ? 0 : protocolIndex ); + edit3_server->setText( account->getAccountDetail(ACCOUNT_HOSTNAME)); + edit4_user->setText( account->getAccountDetail(ACCOUNT_USERNAME)); + edit5_password->setText( account->getAccountDetail(ACCOUNT_PASSWORD)); + edit6_mailbox->setText( account->getAccountDetail(ACCOUNT_MAILBOX)); + QString status = account->getAccountDetail(ACCOUNT_STATUS); + edit7_state->setText( "<FONT COLOR=\"" + account->getStateColorName() + "\">" + status + "</FONT>" ); + +} + +void DlgAccounts::loadAccountList() +{ + qDebug() << "loadAccountList"; + accountList->updateAccounts(); + //initialize the QListWidget object with the AccountList + listWidget_accountList->clear(); + for (int i = 0; i < accountList->size(); ++i){ + addAccountToAccountList(&(*accountList)[i]); + } + if (listWidget_accountList->count() > 0 && listWidget_accountList->currentItem() == NULL) + listWidget_accountList->setCurrentRow(0); + else + frame2_editAccounts->setEnabled(false); +} + +void DlgAccounts::addAccountToAccountList(Account * account) +{ + qDebug() << "addAccountToAccountList"; + QListWidgetItem * item = account->getItem(); + QWidget * widget = account->getItemWidget(); + connect(widget, SIGNAL(checkStateChanged()), + this, SLOT(changedAccountList())); + qDebug() << "item->isHidden()" << item->isHidden(); + listWidget_accountList->addItem(item); + qDebug() << "addAccountToAccountList2"; + listWidget_accountList->setItemWidget(item, widget); +} + +void DlgAccounts::changedAccountList() +{ + accountListHasChanged = true; +// ((ConfigurationDialogKDE *)parent())->updateButtons(); + emit updateButtons(); + toolButton_accountsApply->setEnabled(hasChanged()); +} + + + +void DlgAccounts::on_listWidget_accountList_currentItemChanged ( QListWidgetItem * current, QListWidgetItem * previous ) +{ + qDebug() << "on_listWidget_accountList_currentItemChanged"; + if(previous) + saveAccount(previous); + if(current) + loadAccount(current); + updateAccountListCommands(); +} + +void DlgAccounts::on_button_accountUp_clicked() +{ + qDebug() << "on_button_accountUp_clicked"; + int currentRow = listWidget_accountList->currentRow(); + QListWidgetItem * prevItem = listWidget_accountList->takeItem(currentRow); + Account * account = accountList->getAccountByItem(prevItem); + //we need to build a new item to set the itemWidget back + account->initAccountItem(); + QListWidgetItem * item = account->getItem(); + AccountItemWidget * widget = account->getItemWidget(); + accountList->upAccount(currentRow); + listWidget_accountList->insertItem(currentRow - 1 , item); + listWidget_accountList->setItemWidget(item, widget); + listWidget_accountList->setCurrentItem(item); +// changedAccountList(); +} + +void DlgAccounts::on_button_accountDown_clicked() +{ + qDebug() << "on_button_accountDown_clicked"; + int currentRow = listWidget_accountList->currentRow(); + QListWidgetItem * prevItem = listWidget_accountList->takeItem(currentRow); + Account * account = accountList->getAccountByItem(prevItem); + //we need to build a new item to set the itemWidget back + account->initAccountItem(); + QListWidgetItem * item = account->getItem(); + AccountItemWidget * widget = account->getItemWidget(); + accountList->downAccount(currentRow); + listWidget_accountList->insertItem(currentRow + 1 , item); + listWidget_accountList->setItemWidget(item, widget); + listWidget_accountList->setCurrentItem(item); +// changedAccountList(); +} + +void DlgAccounts::on_button_accountAdd_clicked() +{ + qDebug() << "on_button_accountAdd_clicked"; + QString itemName = QInputDialog::getText(this, "New account", "Enter new account's alias"); + itemName = itemName.simplified(); + if (!itemName.isEmpty()) { + Account * account = accountList->addAccount(itemName); + addAccountToAccountList(account); + int r = listWidget_accountList->count() - 1; + listWidget_accountList->setCurrentRow(r); + frame2_editAccounts->setEnabled(true); + } +// changedAccountList(); +} + +void DlgAccounts::on_button_accountRemove_clicked() +{ + qDebug() << "on_button_accountRemove_clicked"; + int r = listWidget_accountList->currentRow(); + QListWidgetItem * item = listWidget_accountList->takeItem(r); + accountList->removeAccount(item); + listWidget_accountList->setCurrentRow( (r >= listWidget_accountList->count()) ? r-1 : r ); +// changedAccountList(); +} + +void DlgAccounts::on_toolButton_accountsApply_clicked() +{ + qDebug() << "on_toolButton_accountsApply_clicked"; + applyCustomSettings(); +} + +void DlgAccounts::applyCustomSettings() +{ + qDebug() << "applyCustomSettings"; + if(hasChanged()) + { + toolButton_accountsApply->setEnabled(false); + saveAccountList(); + loadAccountList(); + accountListHasChanged = false; + } +} + +void DlgAccounts::on_edit1_alias_textChanged(const QString & text) +{ + qDebug() << "on_edit1_alias_textChanged"; + AccountItemWidget * widget = (AccountItemWidget *) listWidget_accountList->itemWidget(listWidget_accountList->currentItem()); + widget->setAccountText(text); +} + +void DlgAccounts::updateAccountListCommands() +{ + bool buttonsEnabled[4] = {true,true,true,true}; + if(! listWidget_accountList->currentItem()) + { + buttonsEnabled[0] = false; + buttonsEnabled[1] = false; + buttonsEnabled[3] = false; + } + else if(listWidget_accountList->currentRow() == 0) + { + buttonsEnabled[0] = false; + } + else if(listWidget_accountList->currentRow() == listWidget_accountList->count() - 1) + { + buttonsEnabled[1] = false; + } + button_accountUp->setEnabled(buttonsEnabled[0]); + button_accountDown->setEnabled(buttonsEnabled[1]); + button_accountAdd->setEnabled(buttonsEnabled[2]); + button_accountRemove->setEnabled(buttonsEnabled[3]); +} + +void DlgAccounts::updateAccountStates() +{ + qDebug() << "updateAccountStates"; + qDebug() << accountList->size(); + for (int i = 0; i < accountList->size(); i++) + { + Account & current = accountList->getAccount(i); + current.updateState(); + } + qDebug() << accountList->size(); +} + + +bool DlgAccounts::hasChanged() +{ +// qDebug() << "DlgAudio::hasChanged"; + return accountListHasChanged; +} + + +void DlgAccounts::updateSettings() +{ + +} +void DlgAccounts::updateWidgets() +{ + loadAccountList(); +} + diff --git a/sflphone-client-kde/src/ConfigDialog.h b/sflphone-client-kde/src/conf/dlgaccounts.h similarity index 65% rename from sflphone-client-kde/src/ConfigDialog.h rename to sflphone-client-kde/src/conf/dlgaccounts.h index 241ec75106d286e477cc99abb31e85aee76ed3e2..b2187e11484fc75b4791957234e1a915fbac9523 100644 --- a/sflphone-client-kde/src/ConfigDialog.h +++ b/sflphone-client-kde/src/conf/dlgaccounts.h @@ -18,82 +18,61 @@ * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ - -#ifndef HEADER_CONFIGDIALOG -#define HEADER_CONFIGDIALOG +#ifndef DLGACCOUNTS_H +#define DLGACCOUNTS_H -#include <QtGui/QTableWidgetItem> -#include <QtGui/QListWidgetItem> -#include <QtCore/QString> -#include <QtGui/QAbstractButton> -#include <QErrorMessage> +#include <QWidget> +#include <kconfigdialog.h> -#include "ui_ConfigDialog.h" +#include "ui_dlgaccountsbase.h" +#include "Account.h" #include "AccountList.h" -#include "sflphone_kdeview.h" -class sflphone_kdeView; - -class ConfigurationDialog : public QDialog, private Ui::ConfigurationDialog +/** + @author Jérémy Quentin <jeremy.quentin@gmail.com> +*/ +class DlgAccounts : public QWidget, public Ui_DlgAccountsBase { - Q_OBJECT - -private: - static AccountList * accountList; - QErrorMessage * errorWindow; - MapStringString * codecPayloads; - bool accountsChangedEnableWarning; - - +Q_OBJECT public: + DlgAccounts(KConfigDialog *parent = 0); - //Constructors & Destructors - ConfigurationDialog(sflphone_kdeView *parent = 0); - ~ConfigurationDialog(); - - //Getters - static AccountList * getAccountList(); - - //Setters - void setPage(int page); - void addAccountToAccountList(Account * account); - - void loadAccount(QListWidgetItem * item); + ~DlgAccounts(); void saveAccount(QListWidgetItem * item); + void loadAccount(QListWidgetItem * item); + +private: + AccountList * accountList; + bool accountListHasChanged; - void loadAccountList(); +public slots: void saveAccountList(); + void loadAccountList(); + void applyCustomSettings(); - void loadCodecs(); - void saveCodecs(); - - void loadOptions(); - void saveOptions(); + bool hasChanged(); + void updateSettings(); + void updateWidgets(); - //Updates - void updateCodecListCommands(); - void updateAccountListCommands(); - private slots: void changedAccountList(); - - void on_toolButton_codecUp_clicked(); - void on_toolButton_codecDown_clicked(); + void connectAccountsChangedSignal(); + void disconnectAccountsChangedSignal(); void on_button_accountUp_clicked(); void on_button_accountDown_clicked(); void on_button_accountAdd_clicked(); void on_button_accountRemove_clicked(); void on_edit1_alias_textChanged(const QString & text); void on_listWidget_accountList_currentItemChanged ( QListWidgetItem * current, QListWidgetItem * previous ); - void on_spinBox_SIPPort_valueChanged ( int value ); - void on_buttonBoxDialog_clicked(QAbstractButton * button); - void on_tableWidget_codecs_currentCellChanged(int currentRow); void on_toolButton_accountsApply_clicked(); + void updateAccountStates(); + void addAccountToAccountList(Account * account); + void updateAccountListCommands(); - void on1_accountsChanged(); - void on1_parametersChanged(); - void on1_errorAlert(int code); +signals: + void updateButtons(); + }; -#endif +#endif diff --git a/sflphone-client-kde/src/conf/dlgaccountsbase.ui b/sflphone-client-kde/src/conf/dlgaccountsbase.ui new file mode 100644 index 0000000000000000000000000000000000000000..dea0e59dbb1b77cd6d01b5df963e961765ec8594 --- /dev/null +++ b/sflphone-client-kde/src/conf/dlgaccountsbase.ui @@ -0,0 +1,446 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>DlgAccountsBase</class> + <widget class="QWidget" name="DlgAccountsBase"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>603</width> + <height>314</height> + </rect> + </property> + <property name="windowTitle"> + <string>Form</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout"> + <item> + <widget class="QWidget" name="widget1_configAccounts" native="true"> + <property name="autoFillBackground"> + <bool>false</bool> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_3"> + <property name="sizeConstraint"> + <enum>QLayout::SetDefaultConstraint</enum> + </property> + <property name="margin"> + <number>0</number> + </property> + <item> + <widget class="QFrame" name="frame1_accountList"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> + <horstretch>1</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>0</width> + <height>0</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>16777215</width> + <height>16777215</height> + </size> + </property> + <property name="frameShape"> + <enum>QFrame::StyledPanel</enum> + </property> + <property name="frameShadow"> + <enum>QFrame::Raised</enum> + </property> + <layout class="QVBoxLayout" name="verticalLayout_6"> + <item> + <widget class="QListWidget" name="listWidget_accountList"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>150</width> + <height>0</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>16777215</width> + <height>16777215</height> + </size> + </property> + <property name="dragEnabled"> + <bool>true</bool> + </property> + </widget> + </item> + <item> + <widget class="QGroupBox" name="groupBox_accountListHandle"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="maximumSize"> + <size> + <width>16777215</width> + <height>16777215</height> + </size> + </property> + <property name="layoutDirection"> + <enum>Qt::RightToLeft</enum> + </property> + <property name="title"> + <string/> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_2"> + <property name="spacing"> + <number>0</number> + </property> + <property name="sizeConstraint"> + <enum>QLayout::SetNoConstraint</enum> + </property> + <property name="margin"> + <number>0</number> + </property> + <item> + <widget class="QToolButton" name="button_accountRemove"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="toolTip"> + <string>This button will remove the selected account in the list below. Be sure you really don't need it anymore. If you think you might use it again later, just uncheck it.</string> + </property> + <property name="whatsThis"> + <string>Remove the selected account</string> + </property> + <property name="accessibleDescription"> + <string/> + </property> + <property name="text"> + <string>Remove</string> + </property> + <property name="shortcut"> + <string>Backspace, Return</string> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="button_accountAdd"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="sizeIncrement"> + <size> + <width>0</width> + <height>0</height> + </size> + </property> + <property name="toolTip"> + <string>This button enables you to initialize a new account. You will then be able to edit it using the form on the right.</string> + </property> + <property name="whatsThis"> + <string>Add a new account</string> + </property> + <property name="text"> + <string>Add</string> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="button_accountDown"> + <property name="toolTip"> + <string>Get this account down</string> + </property> + <property name="whatsThis"> + <string>By default, when you place a call, sflphone will use the first account in this list which is "registered". Change the order of the accounts using the "Up" and "Down" arrows.</string> + </property> + <property name="text"> + <string>Down</string> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="button_accountUp"> + <property name="toolTip"> + <string>Get this account up</string> + </property> + <property name="whatsThis"> + <string>By default, when you place a call, sflphone will use the first account in this list which is "registered". Change the order of the accounts using the "Up" and "Down" arrows.</string> + </property> + <property name="text"> + <string>Up</string> + </property> + </widget> + </item> + <item> + <spacer name="horizontalSpacer"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>0</width> + <height>0</height> + </size> + </property> + </spacer> + </item> + <item> + <widget class="QToolButton" name="toolButton_accountsApply"> + <property name="enabled"> + <bool>true</bool> + </property> + <property name="text"> + <string>Apply</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QFrame" name="frame2_editAccounts"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> + <horstretch>1</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="frameShape"> + <enum>QFrame::StyledPanel</enum> + </property> + <property name="frameShadow"> + <enum>QFrame::Raised</enum> + </property> + <layout class="QFormLayout" name="formLayout_2"> + <property name="fieldGrowthPolicy"> + <enum>QFormLayout::ExpandingFieldsGrow</enum> + </property> + <item row="0" column="0"> + <widget class="QLabel" name="label1_alias"> + <property name="text"> + <string>&Alias</string> + </property> + <property name="buddy"> + <cstring>edit1_alias</cstring> + </property> + </widget> + </item> + <item row="0" column="1"> + <widget class="QLineEdit" name="edit1_alias"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>0</width> + <height>0</height> + </size> + </property> + </widget> + </item> + <item row="1" column="0"> + <widget class="QLabel" name="label2_protocol"> + <property name="text"> + <string>&Protocol</string> + </property> + <property name="buddy"> + <cstring>edit2_protocol</cstring> + </property> + </widget> + </item> + <item row="1" column="1"> + <widget class="QComboBox" name="edit2_protocol"> + <item> + <property name="text"> + <string>SIP</string> + </property> + </item> + <item> + <property name="text"> + <string>IAX</string> + </property> + </item> + </widget> + </item> + <item row="2" column="0"> + <widget class="QLabel" name="label3_server"> + <property name="text"> + <string>&Server</string> + </property> + <property name="buddy"> + <cstring>edit3_server</cstring> + </property> + </widget> + </item> + <item row="2" column="1"> + <widget class="QLineEdit" name="edit3_server"> + <property name="minimumSize"> + <size> + <width>0</width> + <height>0</height> + </size> + </property> + </widget> + </item> + <item row="3" column="0"> + <widget class="QLabel" name="label4_user"> + <property name="text"> + <string>&User</string> + </property> + <property name="buddy"> + <cstring>edit4_user</cstring> + </property> + </widget> + </item> + <item row="3" column="1"> + <widget class="QLineEdit" name="edit4_user"/> + </item> + <item row="4" column="0"> + <widget class="QLabel" name="label5_password"> + <property name="text"> + <string>Pass&word</string> + </property> + <property name="buddy"> + <cstring>edit5_password</cstring> + </property> + </widget> + </item> + <item row="4" column="1"> + <widget class="QLineEdit" name="edit5_password"> + <property name="echoMode"> + <enum>QLineEdit::Password</enum> + </property> + </widget> + </item> + <item row="5" column="0"> + <widget class="QLabel" name="label6_mailbox"> + <property name="text"> + <string>&Mailbox</string> + </property> + <property name="buddy"> + <cstring>edit6_mailbox</cstring> + </property> + </widget> + </item> + <item row="5" column="1"> + <widget class="QLineEdit" name="edit6_mailbox"/> + </item> + <item row="6" column="0"> + <widget class="QLabel" name="label7_state"> + <property name="text"> + <string>State</string> + </property> + </widget> + </item> + <item row="6" column="1"> + <widget class="QLabel" name="edit7_state"> + <property name="text"> + <string/> + </property> + </widget> + </item> + </layout> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="groupBox_commonSettings"> + <property name="title"> + <string/> + </property> + <layout class="QVBoxLayout" name="verticalLayout_10"> + <item> + <widget class="QLabel" name="label_commonSettings"> + <property name="text"> + <string>Stun settings will be applied on each account</string> + </property> + </widget> + </item> + <item> + <layout class="QFormLayout" name="formLayout_commonSettings"> + <property name="fieldGrowthPolicy"> + <enum>QFormLayout::ExpandingFieldsGrow</enum> + </property> + <item row="0" column="0"> + <widget class="QCheckBox" name="kcfg_enableStun"> + <property name="text"> + <string>Enable Stun</string> + </property> + </widget> + </item> + <item row="0" column="1"> + <widget class="KLineEdit" name="kcfg_stunServer"> + <property name="enabled"> + <bool>false</bool> + </property> + <property name="squeezedTextEnabled"> + <bool>false</bool> + </property> + <property name="clickMessage"> + <string>choose Stun server (example : stunserver.org)</string> + </property> + <property name="showClearButton" stdset="0"> + <bool>false</bool> + </property> + </widget> + </item> + </layout> + </item> + </layout> + </widget> + </item> + </layout> + </widget> + <customwidgets> + <customwidget> + <class>KLineEdit</class> + <extends>QLineEdit</extends> + <header>klineedit.h</header> + </customwidget> + </customwidgets> + <resources> + <include location="../qrc/resources.qrc"/> + </resources> + <connections> + <connection> + <sender>kcfg_enableStun</sender> + <signal>clicked(bool)</signal> + <receiver>kcfg_stunServer</receiver> + <slot>setEnabled(bool)</slot> + <hints> + <hint type="sourcelabel"> + <x>71</x> + <y>273</y> + </hint> + <hint type="destinationlabel"> + <x>167</x> + <y>278</y> + </hint> + </hints> + </connection> + </connections> +</ui> diff --git a/sflphone-client-kde/src/conf/dlgaddressbook.cpp b/sflphone-client-kde/src/conf/dlgaddressbook.cpp new file mode 100644 index 0000000000000000000000000000000000000000..e9f69d967a9daca2c3a6024d052b89a5cf3e1c29 --- /dev/null +++ b/sflphone-client-kde/src/conf/dlgaddressbook.cpp @@ -0,0 +1,34 @@ +/*************************************************************************** + * Copyright (C) 2009 by Savoir-Faire Linux * + * Author : Jérémy Quentin * + * jeremy.quentin@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 * + * the Free Software Foundation; either version 3 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#include "dlgaddressbook.h" + +DlgAddressBook::DlgAddressBook(QWidget *parent) + : QWidget(parent) +{ + setupUi(this); +} + + +DlgAddressBook::~DlgAddressBook() +{ +} + + diff --git a/sflphone-client-kde/src/conf/dlgaddressbook.h b/sflphone-client-kde/src/conf/dlgaddressbook.h new file mode 100644 index 0000000000000000000000000000000000000000..6a6852f6e64a9fef0a9bbe85b2c29b1d8447e983 --- /dev/null +++ b/sflphone-client-kde/src/conf/dlgaddressbook.h @@ -0,0 +1,41 @@ +/*************************************************************************** + * Copyright (C) 2009 by Savoir-Faire Linux * + * Author : Jérémy Quentin * + * jeremy.quentin@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 * + * the Free Software Foundation; either version 3 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef DLGADDRESSBOOK_H +#define DLGADDRESSBOOK_H + +#include <QWidget> + +#include "ui_dlgaddressbookbase.h" + +/** + @author Jérémy Quentin <jeremy.quentin@gmail.com> +*/ +class DlgAddressBook : public QWidget, public Ui_DlgAddressBookBase +{ +Q_OBJECT +public: + DlgAddressBook(QWidget *parent = 0); + + ~DlgAddressBook(); + +}; + +#endif diff --git a/sflphone-client-kde/src/conf/dlgaddressbookbase.ui b/sflphone-client-kde/src/conf/dlgaddressbookbase.ui new file mode 100644 index 0000000000000000000000000000000000000000..0048b161954c45f5831794baff6ecf528c610c0f --- /dev/null +++ b/sflphone-client-kde/src/conf/dlgaddressbookbase.ui @@ -0,0 +1,161 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>DlgAddressBookBase</class> + <widget class="QWidget" name="DlgAddressBookBase"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>350</width> + <height>250</height> + </rect> + </property> + <property name="windowTitle"> + <string>Form</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout"> + <item> + <widget class="QWidget" name="widget_configAddressBookGeneral" native="true"> + <layout class="QVBoxLayout" name="verticalLayout_2"> + <item> + <widget class="QWidget" name="widget_maxResults" native="true"> + <layout class="QHBoxLayout" name="horizontalLayout_4"> + <property name="spacing"> + <number>-1</number> + </property> + <property name="margin"> + <number>5</number> + </property> + <item> + <widget class="QLabel" name="label_maxResults"> + <property name="text"> + <string>Maximum &results</string> + </property> + <property name="buddy"> + <cstring>horizontalSlider_maxResults</cstring> + </property> + </widget> + </item> + <item> + <widget class="QSlider" name="horizontalSlider_maxResults"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimum"> + <number>25</number> + </property> + <property name="maximum"> + <number>50</number> + </property> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + </widget> + </item> + <item> + <widget class="KIntSpinBox" name="kcfg_maxResults"/> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QCheckBox" name="kcfg_displayPhoto"> + <property name="text"> + <string>Display &photo if available</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="groupBox_displayTypes"> + <property name="title"> + <string>Display phone numbers of these &types :</string> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_7"> + <item> + <widget class="QCheckBox" name="kcfg_business"> + <property name="text"> + <string>&Work</string> + </property> + </widget> + </item> + <item> + <widget class="QCheckBox" name="kcfg_mobile"> + <property name="text"> + <string>&Mobile</string> + </property> + </widget> + </item> + <item> + <widget class="QCheckBox" name="kcfg_home"> + <property name="text"> + <string>&Home</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <spacer name="verticalSpacer_configAddressBook"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>72</height> + </size> + </property> + </spacer> + </item> + </layout> + </widget> + <customwidgets> + <customwidget> + <class>KIntSpinBox</class> + <extends>QSpinBox</extends> + <header>knuminput.h</header> + </customwidget> + </customwidgets> + <resources/> + <connections> + <connection> + <sender>horizontalSlider_maxResults</sender> + <signal>valueChanged(int)</signal> + <receiver>kcfg_maxResults</receiver> + <slot>setValue(int)</slot> + <hints> + <hint type="sourcelabel"> + <x>223</x> + <y>35</y> + </hint> + <hint type="destinationlabel"> + <x>301</x> + <y>33</y> + </hint> + </hints> + </connection> + <connection> + <sender>kcfg_maxResults</sender> + <signal>valueChanged(int)</signal> + <receiver>horizontalSlider_maxResults</receiver> + <slot>setValue(int)</slot> + <hints> + <hint type="sourcelabel"> + <x>294</x> + <y>36</y> + </hint> + <hint type="destinationlabel"> + <x>215</x> + <y>33</y> + </hint> + </hints> + </connection> + </connections> +</ui> diff --git a/sflphone-client-kde/src/conf/dlgaudio.cpp b/sflphone-client-kde/src/conf/dlgaudio.cpp new file mode 100644 index 0000000000000000000000000000000000000000..6d5e85f26169c0edeed16d65166db2a3547b98d6 --- /dev/null +++ b/sflphone-client-kde/src/conf/dlgaudio.cpp @@ -0,0 +1,287 @@ +/*************************************************************************** + * Copyright (C) 2009 by Savoir-Faire Linux * + * Author : Jérémy Quentin * + * jeremy.quentin@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 * + * the Free Software Foundation; either version 3 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#include "dlgaudio.h" + +#include <KLineEdit> +#include "configurationmanager_interface_singleton.h" +#include "conf/ConfigurationSkeleton.h" +#include "conf/ConfigurationDialog.h" + +#include "sflphone_const.h" + +DlgAudio::DlgAudio(KConfigDialog *parent) + : QWidget(parent) +{ + setupUi(this); + + ConfigurationManagerInterface & configurationManager = ConfigurationManagerInterfaceSingleton::getInstance(); + QStyle * style = QApplication::style(); + + KUrl url = KUrl(SHARE_INSTALL_PREFIX); + url.cd("sflphone/ringtones"); + KUrlRequester_ringtone->setUrl(url); + KUrlRequester_ringtone->lineEdit()->setObjectName("kcfg_ringtone"); + + codecTableHasChanged = false; + toolButton_codecUp->setIcon(KIcon("go-up")); + toolButton_codecDown->setIcon(KIcon("go-down")); + tableWidget_codecs->verticalHeader()->hide(); + tableWidget_codecs->setSelectionBehavior(QAbstractItemView::SelectRows); + + updateAlsaSettings(); + connect(box_alsaPlugin, SIGNAL(currentIndexChanged(int)), parent, SLOT(updateButtons())); + connect(tableWidget_codecs, SIGNAL(itemChanged(QTableWidgetItem *)), this, SLOT(codecTableChanged())); + connect(toolButton_codecUp, SIGNAL(clicked()), this, SLOT(codecTableChanged())); + connect(toolButton_codecDown, SIGNAL(clicked()), this, SLOT(codecTableChanged())); + + connect(this, SIGNAL(updateButtons()), parent, SLOT(updateButtons())); +} + + +DlgAudio::~DlgAudio() +{ +} + +void DlgAudio::updateWidgets() +{ +// qDebug() << "DlgAudio::updateWidgets"; + //alsa Plugin + ConfigurationSkeleton * skeleton = ConfigurationSkeleton::self(); + box_alsaPlugin->setCurrentIndex(box_alsaPlugin->findText(skeleton->alsaPlugin())); + + //codecList + qDebug() << "loadCodecs"; + ConfigurationManagerInterface & configurationManager = ConfigurationManagerInterfaceSingleton::getInstance(); + QStringList codecList = configurationManager.getCodecList(); + QStringList activeCodecList = skeleton->activeCodecList(); + #if QT_VERSION >= 0x040500 + activeCodecList.removeDuplicates(); + #else + for (int i = 0 ; i < activeCodecList.size() ; i++) + { + if(activeCodecList.lastIndexOf(activeCodecList[i]) != i) + { + activeCodecList.removeAt(i); + i--; + } + } + #endif + + for (int i=0 ; i<activeCodecList.size() ; i++) + { + if(! codecList.contains(activeCodecList[i])) + { + activeCodecList.removeAt(i); + i--; + } + } + QStringList codecListToDisplay = activeCodecList; + for (int i=0 ; i<codecList.size() ; i++) + { + if(! activeCodecList.contains(codecList[i])) + { + codecListToDisplay << codecList[i]; + } + } + qDebug() << "codecList = " << codecList; + qDebug() << "activeCodecList" << activeCodecList; + qDebug() << "codecListToDisplay" << codecListToDisplay; + tableWidget_codecs->setRowCount(0); + for(int i=0 ; i<codecListToDisplay.size() ; i++) + { + bool ok; + qDebug() << codecListToDisplay[i]; + QString payloadStr = QString(codecListToDisplay[i]); + int payload = payloadStr.toInt(&ok); + if(!ok) + qDebug() << "The codec's payload sent by the configurationManager is not a number : " << codecListToDisplay[i]; + else + { + QStringList details = configurationManager.getCodecDetails(payload); + tableWidget_codecs->insertRow(i); + tableWidget_codecs->setVerticalHeaderItem (i, new QTableWidgetItem()); + tableWidget_codecs->verticalHeaderItem (i)->setText(payloadStr); + tableWidget_codecs->setItem(i,0,new QTableWidgetItem("")); + tableWidget_codecs->setItem(i,1,new QTableWidgetItem(details[CODEC_NAME])); + tableWidget_codecs->setItem(i,2,new QTableWidgetItem(details[CODEC_SAMPLE_RATE])); + tableWidget_codecs->setItem(i,3,new QTableWidgetItem(details[CODEC_BIT_RATE])); + tableWidget_codecs->setItem(i,4,new QTableWidgetItem(details[CODEC_BANDWIDTH])); + tableWidget_codecs->item(i,0)->setFlags(Qt::ItemIsSelectable|Qt::ItemIsUserCheckable|Qt::ItemIsEnabled); + tableWidget_codecs->item(i,0)->setCheckState(activeCodecList.contains(codecListToDisplay[i]) ? Qt::Checked : Qt::Unchecked); + tableWidget_codecs->item(i,1)->setFlags(Qt::ItemIsSelectable|Qt::ItemIsEnabled); + tableWidget_codecs->item(i,2)->setFlags(Qt::ItemIsSelectable|Qt::ItemIsEnabled); + tableWidget_codecs->item(i,3)->setFlags(Qt::ItemIsSelectable|Qt::ItemIsEnabled); + tableWidget_codecs->item(i,4)->setFlags(Qt::ItemIsSelectable|Qt::ItemIsEnabled); + + qDebug() << "Added to codecs : " << payloadStr << " , " << details[CODEC_NAME]; + } + } + tableWidget_codecs->resizeColumnsToContents(); + tableWidget_codecs->resizeRowsToContents(); + codecTableHasChanged = false; +} + + +void DlgAudio::updateSettings() +{ +// qDebug() << "DlgAudio::updateSettings"; + //alsaPlugin + ConfigurationSkeleton * skeleton = ConfigurationSkeleton::self(); + skeleton->setAlsaPlugin(box_alsaPlugin->currentText()); + + //codecList + QStringList activeCodecs; + for(int i = 0 ; i < tableWidget_codecs->rowCount() ; i++) + { + if(tableWidget_codecs->item(i,0)->checkState() == Qt::Checked) + { + activeCodecs << tableWidget_codecs->verticalHeaderItem(i)->text(); + } + } + qDebug() << "Calling setActiveCodecList with list : " << activeCodecs ; + skeleton->setActiveCodecList(activeCodecs); + codecTableHasChanged = false; +} + +bool DlgAudio::hasChanged() +{ +// qDebug() << "DlgAudio::hasChanged"; + ConfigurationSkeleton * skeleton = ConfigurationSkeleton::self(); + qDebug() << "skeleton->alsaPlugin() = " << skeleton->alsaPlugin(); + qDebug() << "box_alsaPlugin->currentText() = " << box_alsaPlugin->currentText(); + bool alsaPluginHasChanged = + skeleton->interface() == ConfigurationSkeleton::EnumInterface::ALSA + && skeleton->alsaPlugin() != box_alsaPlugin->currentText(); + return alsaPluginHasChanged || codecTableHasChanged; +} + +void DlgAudio::updateAlsaSettings() +{ + qDebug() << "DlgAudio::updateAlsaSettings"; + ConfigurationManagerInterface & configurationManager = ConfigurationManagerInterfaceSingleton::getInstance(); + if(configurationManager.getAudioManager() == ConfigurationSkeleton::EnumInterface::ALSA) + { + ConfigurationSkeleton * skeleton = ConfigurationSkeleton::self(); + + QStringList pluginList = configurationManager.getOutputAudioPluginList(); + box_alsaPlugin->clear(); + box_alsaPlugin->addItems(pluginList); + int index = box_alsaPlugin->findText(skeleton->alsaPlugin()); + if(index < 0) index = 0; + box_alsaPlugin->setCurrentIndex(index); + + QStringList inputDeviceList = configurationManager.getAudioInputDeviceList(); + kcfg_alsaInputDevice->clear(); + kcfg_alsaInputDevice->addItems(inputDeviceList); + kcfg_alsaInputDevice->setCurrentIndex(skeleton->alsaInputDevice()); + + QStringList outputDeviceList = configurationManager.getAudioOutputDeviceList(); + kcfg_alsaOutputDevice->clear(); + kcfg_alsaOutputDevice->addItems(outputDeviceList); + kcfg_alsaOutputDevice->setCurrentIndex(skeleton->alsaOutputDevice()); + groupBox_alsa->setEnabled(true); + } + else + { +// box_alsaPlugin->clear(); +// kcfg_alsaInputDevice->clear(); +// kcfg_alsaOutputDevice->clear(); + groupBox_alsa->setEnabled(false); + } +} + +void DlgAudio::updateCodecListCommands() +{ + bool buttonsEnabled[2] = {true,true}; + if(! tableWidget_codecs->currentItem()) + { + buttonsEnabled[0] = false; + buttonsEnabled[1] = false; + } + else if(tableWidget_codecs->currentRow() == 0) + { + buttonsEnabled[0] = false; + } + else if(tableWidget_codecs->currentRow() == tableWidget_codecs->rowCount() - 1) + { + buttonsEnabled[1] = false; + } + toolButton_codecUp->setEnabled(buttonsEnabled[0]); + toolButton_codecDown->setEnabled(buttonsEnabled[1]); +} + +void DlgAudio::on_tableWidget_codecs_currentCellChanged(int currentRow) +{ + qDebug() << "on_tableWidget_codecs_currentCellChanged"; + int nbCol = tableWidget_codecs->columnCount(); + for(int i = 0 ; i < nbCol ; i++) + { + tableWidget_codecs->setRangeSelected(QTableWidgetSelectionRange(currentRow, 0, currentRow, nbCol - 1), true); + } + updateCodecListCommands(); +} + +void DlgAudio::on_toolButton_codecUp_clicked() +{ + qDebug() << "on_toolButton_codecUp_clicked"; + int currentCol = tableWidget_codecs->currentColumn(); + int currentRow = tableWidget_codecs->currentRow(); + int nbCol = tableWidget_codecs->columnCount(); + for(int i = 0 ; i < nbCol ; i++) + { + QTableWidgetItem * item1 = tableWidget_codecs->takeItem(currentRow, i); + QTableWidgetItem * item2 = tableWidget_codecs->takeItem(currentRow - 1, i); + tableWidget_codecs->setItem(currentRow - 1, i , item1); + tableWidget_codecs->setItem(currentRow, i , item2); + } + QTableWidgetItem * item1 = tableWidget_codecs->takeVerticalHeaderItem(currentRow); + QTableWidgetItem * item2 = tableWidget_codecs->takeVerticalHeaderItem(currentRow - 1); + tableWidget_codecs->setVerticalHeaderItem(currentRow - 1, item1); + tableWidget_codecs->setVerticalHeaderItem(currentRow, item2); + tableWidget_codecs->setCurrentCell(currentRow - 1, currentCol); +} + +void DlgAudio::on_toolButton_codecDown_clicked() +{ + qDebug() << "on_toolButton_codecDown_clicked"; + int currentCol = tableWidget_codecs->currentColumn(); + int currentRow = tableWidget_codecs->currentRow(); + int nbCol = tableWidget_codecs->columnCount(); + for(int i = 0 ; i < nbCol ; i++) + { + QTableWidgetItem * item1 = tableWidget_codecs->takeItem(currentRow, i); + QTableWidgetItem * item2 = tableWidget_codecs->takeItem(currentRow + 1, i); + tableWidget_codecs->setItem(currentRow + 1, i , item1); + tableWidget_codecs->setItem(currentRow, i , item2); + } + QTableWidgetItem * item1 = tableWidget_codecs->takeVerticalHeaderItem(currentRow); + QTableWidgetItem * item2 = tableWidget_codecs->takeVerticalHeaderItem(currentRow + 1); + tableWidget_codecs->setVerticalHeaderItem(currentRow + 1, item1); + tableWidget_codecs->setVerticalHeaderItem(currentRow, item2); + tableWidget_codecs->setCurrentCell(currentRow + 1, currentCol); +} + + +void DlgAudio::codecTableChanged() +{ + codecTableHasChanged = true; + emit updateButtons(); +} \ No newline at end of file diff --git a/sflphone-client-kde/src/conf/dlgaudio.h b/sflphone-client-kde/src/conf/dlgaudio.h new file mode 100644 index 0000000000000000000000000000000000000000..15c1f8f70b26d0d6dbaf22772282e9ccd9d651b8 --- /dev/null +++ b/sflphone-client-kde/src/conf/dlgaudio.h @@ -0,0 +1,61 @@ +/*************************************************************************** + * Copyright (C) 2009 by Savoir-Faire Linux * + * Author : Jérémy Quentin * + * jeremy.quentin@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 * + * the Free Software Foundation; either version 3 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef DLGAUDIO_H +#define DLGAUDIO_H + +#include <QWidget> +#include <kconfigdialog.h> + +#include "ui_dlgaudiobase.h" +#include "conf/ConfigurationSkeleton.h" + +/** + @author Jérémy Quentin <jeremy.quentin@gmail.com> +*/ +class DlgAudio : public QWidget, public Ui_DlgAudioBase +{ +Q_OBJECT +public: + DlgAudio(KConfigDialog *parent = 0); + + ~DlgAudio(); + +private: + bool codecTableHasChanged; + +public slots: + void updateWidgets(); + void updateSettings(); + bool hasChanged(); + void updateAlsaSettings(); + +private slots: + void updateCodecListCommands(); + void on_tableWidget_codecs_currentCellChanged(int currentRow); + void on_toolButton_codecUp_clicked(); + void on_toolButton_codecDown_clicked(); + void codecTableChanged(); + +signals: + void updateButtons(); +}; + +#endif diff --git a/sflphone-client-kde/src/conf/dlgaudiobase.ui b/sflphone-client-kde/src/conf/dlgaudiobase.ui new file mode 100644 index 0000000000000000000000000000000000000000..38b5e1f64046d4e4796dda6fa6b61b7df5fc4d34 --- /dev/null +++ b/sflphone-client-kde/src/conf/dlgaudiobase.ui @@ -0,0 +1,318 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>DlgAudioBase</class> + <widget class="QWidget" name="DlgAudioBase"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>467</width> + <height>437</height> + </rect> + </property> + <property name="windowTitle"> + <string>Form</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout"> + <item> + <widget class="QGroupBox" name="groupBox1_audio"> + <property name="mouseTracking"> + <bool>false</bool> + </property> + <property name="title"> + <string/> + </property> + <layout class="QFormLayout" name="formLayout_3"> + <property name="fieldGrowthPolicy"> + <enum>QFormLayout::AllNonFixedFieldsGrow</enum> + </property> + <item row="0" column="0"> + <widget class="QLabel" name="label_interface"> + <property name="text"> + <string>Audio device</string> + </property> + <property name="buddy"> + <cstring>kcfg_interface</cstring> + </property> + </widget> + </item> + <item row="0" column="1"> + <widget class="KComboBox" name="kcfg_interface"> + <item> + <property name="text"> + <string>ALSA</string> + </property> + </item> + <item> + <property name="text"> + <string>PulseAudio</string> + </property> + </item> + </widget> + </item> + <item row="2" column="0"> + <widget class="QCheckBox" name="kcfg_enableRingtones"> + <property name="text"> + <string>Enable ringtones</string> + </property> + </widget> + </item> + <item row="2" column="1"> + <widget class="KUrlRequester" name="KUrlRequester_ringtone"/> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="groupBox2_codecs"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Expanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="title"> + <string>&Codecs</string> + </property> + <layout class="QHBoxLayout" name="horizontalLayout"> + <property name="spacing"> + <number>-1</number> + </property> + <property name="leftMargin"> + <number>5</number> + </property> + <property name="topMargin"> + <number>2</number> + </property> + <property name="rightMargin"> + <number>5</number> + </property> + <property name="bottomMargin"> + <number>2</number> + </property> + <item> + <widget class="QTableWidget" name="tableWidget_codecs"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>0</width> + <height>100</height> + </size> + </property> + <property name="frameShape"> + <enum>QFrame::StyledPanel</enum> + </property> + <property name="frameShadow"> + <enum>QFrame::Sunken</enum> + </property> + <property name="verticalScrollBarPolicy"> + <enum>Qt::ScrollBarAsNeeded</enum> + </property> + <property name="textElideMode"> + <enum>Qt::ElideRight</enum> + </property> + <property name="verticalScrollMode"> + <enum>QAbstractItemView::ScrollPerPixel</enum> + </property> + <property name="horizontalScrollMode"> + <enum>QAbstractItemView::ScrollPerPixel</enum> + </property> + <column> + <property name="text"> + <string>Active</string> + </property> + </column> + <column> + <property name="text"> + <string>Name</string> + </property> + </column> + <column> + <property name="text"> + <string>Frequency</string> + </property> + </column> + <column> + <property name="text"> + <string>Bitrate</string> + </property> + </column> + <column> + <property name="text"> + <string>Bandwidth</string> + </property> + </column> + </widget> + </item> + <item> + <layout class="QVBoxLayout" name="verticalLayout_codecsOrder"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <item> + <widget class="QToolButton" name="toolButton_codecUp"> + <property name="text"> + <string/> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="toolButton_codecDown"> + <property name="text"> + <string/> + </property> + </widget> + </item> + </layout> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QStackedWidget" name="stackedWidget_interfaceSpecificSettings"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="currentIndex"> + <number>0</number> + </property> + <widget class="QWidget" name="page1_alsa"> + <layout class="QVBoxLayout" name="verticalLayout_20"> + <property name="margin"> + <number>0</number> + </property> + <item> + <widget class="QGroupBox" name="groupBox_alsa"> + <property name="title"> + <string>ALSA settings</string> + </property> + <layout class="QFormLayout" name="formLayout_4"> + <property name="verticalSpacing"> + <number>5</number> + </property> + <property name="leftMargin"> + <number>9</number> + </property> + <item row="3" column="0"> + <widget class="QLabel" name="label2_in"> + <property name="text"> + <string>&In</string> + </property> + </widget> + </item> + <item row="5" column="0"> + <widget class="QLabel" name="label3_out"> + <property name="text"> + <string>&Out</string> + </property> + </widget> + </item> + <item row="0" column="0"> + <widget class="QLabel" name="label1_alsaPugin"> + <property name="text"> + <string>ALSA &plugin</string> + </property> + </widget> + </item> + <item row="0" column="1"> + <widget class="KComboBox" name="box_alsaPlugin"> + <property name="sizeAdjustPolicy"> + <enum>QComboBox::AdjustToContents</enum> + </property> + </widget> + </item> + <item row="3" column="1"> + <widget class="KComboBox" name="kcfg_alsaInputDevice"> + <property name="sizeAdjustPolicy"> + <enum>QComboBox::AdjustToContents</enum> + </property> + </widget> + </item> + <item row="5" column="1"> + <widget class="KComboBox" name="kcfg_alsaOutputDevice"> + <property name="sizeAdjustPolicy"> + <enum>QComboBox::AdjustToContents</enum> + </property> + </widget> + </item> + </layout> + </widget> + </item> + </layout> + </widget> + <widget class="QWidget" name="page2_pulseAudio"> + <layout class="QVBoxLayout" name="verticalLayout_7"> + <item> + <widget class="QGroupBox" name="groupBox_pulseAudio"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="title"> + <string>PulseAudio settings</string> + </property> + <layout class="QFormLayout" name="formLayout_11"> + <property name="fieldGrowthPolicy"> + <enum>QFormLayout::ExpandingFieldsGrow</enum> + </property> + <item row="0" column="0"> + <widget class="QCheckBox" name="kcfg_pulseAudioVolumeAlter"> + <property name="text"> + <string>Mute other applications during a call</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + </layout> + </widget> + </widget> + </item> + </layout> + </widget> + <customwidgets> + <customwidget> + <class>KComboBox</class> + <extends>QComboBox</extends> + <header>kcombobox.h</header> + </customwidget> + <customwidget> + <class>KUrlRequester</class> + <extends>QFrame</extends> + <header>kurlrequester.h</header> + </customwidget> + </customwidgets> + <resources/> + <connections> + <connection> + <sender>kcfg_interface</sender> + <signal>currentIndexChanged(int)</signal> + <receiver>stackedWidget_interfaceSpecificSettings</receiver> + <slot>setCurrentIndex(int)</slot> + <hints> + <hint type="sourcelabel"> + <x>215</x> + <y>31</y> + </hint> + <hint type="destinationlabel"> + <x>442</x> + <y>337</y> + </hint> + </hints> + </connection> + </connections> +</ui> diff --git a/sflphone-client-kde/src/conf/dlgdisplay.cpp b/sflphone-client-kde/src/conf/dlgdisplay.cpp new file mode 100644 index 0000000000000000000000000000000000000000..128bb9fc72a138f8e0f1e43087b3c246011af839 --- /dev/null +++ b/sflphone-client-kde/src/conf/dlgdisplay.cpp @@ -0,0 +1,34 @@ +/*************************************************************************** + * Copyright (C) 2009 by Savoir-Faire Linux * + * Author : Jérémy Quentin * + * jeremy.quentin@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 * + * the Free Software Foundation; either version 3 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#include "dlgdisplay.h" + +DlgDisplay::DlgDisplay(QWidget *parent) + : QWidget(parent) +{ + setupUi(this); +} + + +DlgDisplay::~DlgDisplay() +{ +} + + diff --git a/sflphone-client-kde/src/conf/dlgdisplay.h b/sflphone-client-kde/src/conf/dlgdisplay.h new file mode 100644 index 0000000000000000000000000000000000000000..c1e8627f488aaad184a93aad281ce53faa918de4 --- /dev/null +++ b/sflphone-client-kde/src/conf/dlgdisplay.h @@ -0,0 +1,41 @@ +/*************************************************************************** + * Copyright (C) 2009 by Savoir-Faire Linux * + * Author : Jérémy Quentin * + * jeremy.quentin@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 * + * the Free Software Foundation; either version 3 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef DLGDISPLAY_H +#define DLGDISPLAY_H + +#include <QWidget> + +#include "ui_dlgdisplaybase.h" + +/** + @author Jérémy Quentin <jeremy.quentin@gmail.com> +*/ +class DlgDisplay : public QWidget, public Ui_DlgDisplayBase +{ +Q_OBJECT +public: + DlgDisplay(QWidget *parent = 0); + + ~DlgDisplay(); + +}; + +#endif diff --git a/sflphone-client-kde/src/conf/dlgdisplaybase.ui b/sflphone-client-kde/src/conf/dlgdisplaybase.ui new file mode 100644 index 0000000000000000000000000000000000000000..ef8cd7ed9f56816af22f11d42b5a1eee76e85a6c --- /dev/null +++ b/sflphone-client-kde/src/conf/dlgdisplaybase.ui @@ -0,0 +1,112 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>DlgDisplayBase</class> + <widget class="QWidget" name="DlgDisplayBase"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>373</width> + <height>300</height> + </rect> + </property> + <property name="windowTitle"> + <string>Form</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout"> + <item> + <widget class="QLabel" name="label1_notifications"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Enable notifications</string> + </property> + </widget> + </item> + <item> + <widget class="QWidget" name="widget1_notifications" native="true"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_5"> + <item> + <widget class="QCheckBox" name="kcfg_notifOnCalls"> + <property name="text"> + <string>On incoming &calls</string> + </property> + </widget> + </item> + <item> + <widget class="QCheckBox" name="kcfg_notifOnMessages"> + <property name="text"> + <string>On &messages</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QLabel" name="label2_displayMainWindow"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Show main window</string> + </property> + </widget> + </item> + <item> + <widget class="QWidget" name="widget_displayMainWindow" native="true"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_6"> + <item> + <widget class="QCheckBox" name="kcfg_displayOnStart"> + <property name="text"> + <string>On &start</string> + </property> + </widget> + </item> + <item> + <widget class="QCheckBox" name="kcfg_displayOnCalls"> + <property name="text"> + <string>On &incoming calls</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <spacer name="verticalSpacer_configDisplay"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>16777215</height> + </size> + </property> + </spacer> + </item> + </layout> + </widget> + <resources/> + <connections/> +</ui> diff --git a/sflphone-client-kde/src/conf/dlggeneral.cpp b/sflphone-client-kde/src/conf/dlggeneral.cpp new file mode 100644 index 0000000000000000000000000000000000000000..6350bde5af3286f135410f62cfb22c1eda2df962 --- /dev/null +++ b/sflphone-client-kde/src/conf/dlggeneral.cpp @@ -0,0 +1,38 @@ +/*************************************************************************** + * Copyright (C) 2009 by Savoir-Faire Linux * + * Author : Jérémy Quentin * + * jeremy.quentin@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 * + * the Free Software Foundation; either version 3 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#include "dlggeneral.h" +#include <QDebug> +#include <QToolButton> +#include <QAction> + +DlgGeneral::DlgGeneral(QWidget *parent) + : QWidget(parent) +{ + setupUi(this); + + connect(toolButton_historyClear, SIGNAL(clicked()), this, SIGNAL(clearCallHistoryAsked())); +} + + +DlgGeneral::~DlgGeneral() +{ +} + diff --git a/sflphone-client-kde/src/conf/dlggeneral.h b/sflphone-client-kde/src/conf/dlggeneral.h new file mode 100644 index 0000000000000000000000000000000000000000..610a776d36099854645405f63d01a8d9963e4d03 --- /dev/null +++ b/sflphone-client-kde/src/conf/dlggeneral.h @@ -0,0 +1,44 @@ +/*************************************************************************** + * Copyright (C) 2009 by Savoir-Faire Linux * + * Author : Jérémy Quentin * + * jeremy.quentin@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 * + * the Free Software Foundation; either version 3 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef DLGGENERAL_H +#define DLGGENERAL_H + +#include <QWidget> + +#include "ui_dlggeneralbase.h" + +/** + @author Jérémy Quentin <jeremy.quentin@gmail.com> +*/ +class DlgGeneral : public QWidget, public Ui_DlgGeneralBase +{ +Q_OBJECT +public: + DlgGeneral(QWidget *parent = 0); + + ~DlgGeneral(); + +signals: + void clearCallHistoryAsked(); + +}; + +#endif diff --git a/sflphone-client-kde/src/conf/dlggeneralbase.ui b/sflphone-client-kde/src/conf/dlggeneralbase.ui new file mode 100644 index 0000000000000000000000000000000000000000..6e723bf6b0c82427e6892d6f9902267a3dfbcee4 --- /dev/null +++ b/sflphone-client-kde/src/conf/dlggeneralbase.ui @@ -0,0 +1,173 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>DlgGeneralBase</class> + <widget class="QWidget" name="DlgGeneralBase"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>525</width> + <height>404</height> + </rect> + </property> + <property name="windowTitle"> + <string>Form</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout"> + <item> + <widget class="QGroupBox" name="groupBox1_history_2"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="title"> + <string>Call history</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout_21"> + <item> + <widget class="QWidget" name="widget_historyCapacity_2" native="true"> + <layout class="QHBoxLayout" name="horizontalLayout_11"> + <item> + <widget class="QCheckBox" name="kcfg_enableHistory"> + <property name="text"> + <string extracomment="beginning of "..for at least n days."">Keep my history for at least</string> + </property> + </widget> + </item> + <item> + <widget class="KIntSpinBox" name="kcfg_historyMax"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimum"> + <number>-8</number> + </property> + </widget> + </item> + <item> + <widget class="QLabel" name="label"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string extracomment="End of "Keep my history for at least n days"">days</string> + </property> + </widget> + </item> + <item> + <spacer name="horizontalSpacer"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QToolButton" name="toolButton_historyClear"> + <property name="text"> + <string>C&lear history</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="groupBox2_connection_2"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="title"> + <string>Connection</string> + </property> + <layout class="QFormLayout" name="formLayout_13"> + <property name="fieldGrowthPolicy"> + <enum>QFormLayout::ExpandingFieldsGrow</enum> + </property> + <item row="0" column="0"> + <widget class="QLabel" name="label_SIPPort_2"> + <property name="text"> + <string>SIP &Port</string> + </property> + <property name="buddy"> + <cstring>kcfg_SIPPort</cstring> + </property> + </widget> + </item> + <item row="0" column="1"> + <widget class="QWidget" name="widget_SIPPort_2" native="true"> + <property name="minimumSize"> + <size> + <width>50</width> + <height>0</height> + </size> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_9"> + <property name="margin"> + <number>0</number> + </property> + <item> + <widget class="KIntSpinBox" name="kcfg_SIPPort"/> + </item> + <item> + <widget class="QLabel" name="label_WarningSIP_2"> + <property name="enabled"> + <bool>false</bool> + </property> + <property name="text"> + <string>Attention </string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <spacer name="verticalSpacer_configGeneral_2"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>504</width> + <height>171</height> + </size> + </property> + </spacer> + </item> + </layout> + </widget> + <customwidgets> + <customwidget> + <class>KIntSpinBox</class> + <extends>QSpinBox</extends> + <header>knuminput.h</header> + </customwidget> + </customwidgets> + <resources> + <include location="../qrc/resources.qrc"/> + </resources> + <connections/> +</ui> diff --git a/sflphone-client-kde/src/conf/dlghooks.cpp b/sflphone-client-kde/src/conf/dlghooks.cpp new file mode 100644 index 0000000000000000000000000000000000000000..adea033ed25b208d2e79282e58e712000eeb4564 --- /dev/null +++ b/sflphone-client-kde/src/conf/dlghooks.cpp @@ -0,0 +1,34 @@ +/*************************************************************************** + * Copyright (C) 2009 by Savoir-Faire Linux * + * Author : Jérémy Quentin * + * jeremy.quentin@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 * + * the Free Software Foundation; either version 3 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#include "dlghooks.h" + +DlgHooks::DlgHooks(QWidget *parent) + : QWidget(parent) +{ + setupUi(this); +} + + +DlgHooks::~DlgHooks() +{ +} + + diff --git a/sflphone-client-kde/src/conf/dlghooks.h b/sflphone-client-kde/src/conf/dlghooks.h new file mode 100644 index 0000000000000000000000000000000000000000..80800e2b09671eeaed275c1bf6f00b084ddeb604 --- /dev/null +++ b/sflphone-client-kde/src/conf/dlghooks.h @@ -0,0 +1,41 @@ +/*************************************************************************** + * Copyright (C) 2009 by Savoir-Faire Linux * + * Author : Jérémy Quentin * + * jeremy.quentin@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 * + * the Free Software Foundation; either version 3 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef DLGHOOKS_H +#define DLGHOOKS_H + +#include <QWidget> + +#include "ui_dlghooksbase.h" + +/** + @author Jérémy Quentin <jeremy.quentin@gmail.com> +*/ +class DlgHooks : public QWidget, public Ui_DlgHooksBase +{ +Q_OBJECT +public: + DlgHooks(QWidget *parent = 0); + + ~DlgHooks(); + +}; + +#endif diff --git a/sflphone-client-kde/src/conf/dlghooksbase.ui b/sflphone-client-kde/src/conf/dlghooksbase.ui new file mode 100644 index 0000000000000000000000000000000000000000..964153369b7afed02eb8c52e5e91df5abd0d0e8f --- /dev/null +++ b/sflphone-client-kde/src/conf/dlghooksbase.ui @@ -0,0 +1,196 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>DlgHooksBase</class> + <widget class="QWidget" name="DlgHooksBase"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>520</width> + <height>407</height> + </rect> + </property> + <property name="windowTitle"> + <string>Form</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout"> + <item> + <widget class="QGroupBox" name="groupBox_urlArgument"> + <property name="title"> + <string>URL Argument</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout_12"> + <item> + <widget class="QLabel" name="label"> + <property name="text"> + <string>Custom commands with URL %s will be replaced with the passed URL.</string> + </property> + <property name="wordWrap"> + <bool>true</bool> + </property> + </widget> + </item> + <item> + <widget class="QWidget" name="widget_protocols" native="true"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>0</width> + <height>0</height> + </size> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_8"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>4</number> + </property> + <property name="rightMargin"> + <number>4</number> + </property> + <property name="bottomMargin"> + <number>4</number> + </property> + <item> + <widget class="QCheckBox" name="kcfg_enableHooksSIP"> + <property name="text"> + <string>Trigger on specific SIP header</string> + </property> + </widget> + </item> + <item> + <widget class="QLineEdit" name="kcfg_hooksSIPHeader"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QCheckBox" name="kcfg_enableHooksIAX"> + <property name="text"> + <string>Trigger on IAX2 URL</string> + </property> + </widget> + </item> + <item> + <widget class="QWidget" name="widget_urlArgumentForm" native="true"> + <layout class="QHBoxLayout" name="horizontalLayout"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>4</number> + </property> + <property name="rightMargin"> + <number>4</number> + </property> + <property name="bottomMargin"> + <number>4</number> + </property> + <item> + <widget class="QLabel" name="label_command"> + <property name="text"> + <string>Command to run</string> + </property> + <property name="buddy"> + <cstring>kcfg_hooksCommand</cstring> + </property> + </widget> + </item> + <item> + <widget class="KLineEdit" name="kcfg_hooksCommand"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + </widget> + </item> + </layout> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="groupBox_phoneNumberFormatting"> + <property name="title"> + <string>Phone number formatting</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout_13"> + <item> + <widget class="QWidget" name="widget_phoneNumberFormattingForm" native="true"> + <layout class="QHBoxLayout" name="horizontalLayout_2"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>4</number> + </property> + <property name="rightMargin"> + <number>4</number> + </property> + <property name="bottomMargin"> + <number>4</number> + </property> + <item> + <widget class="QCheckBox" name="kcfg_addPrefix"> + <property name="text"> + <string>Add phone number prefix</string> + </property> + </widget> + </item> + <item> + <widget class="KLineEdit" name="kcfg_prepend"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + </widget> + </item> + </layout> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <spacer name="verticalSpacer_configHooks"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>499</width> + <height>96</height> + </size> + </property> + </spacer> + </item> + </layout> + </widget> + <customwidgets> + <customwidget> + <class>KLineEdit</class> + <extends>QLineEdit</extends> + <header>klineedit.h</header> + </customwidget> + </customwidgets> + <resources/> + <connections/> +</ui> diff --git a/sflphone-client-kde/src/conf/dlgrecord.cpp b/sflphone-client-kde/src/conf/dlgrecord.cpp new file mode 100644 index 0000000000000000000000000000000000000000..3c97898f5cd30bd11aca1a278a9a2bd93482cfff --- /dev/null +++ b/sflphone-client-kde/src/conf/dlgrecord.cpp @@ -0,0 +1,39 @@ +/*************************************************************************** + * Copyright (C) 2009 by Savoir-Faire Linux * + * Author : Jérémy Quentin * + * jeremy.quentin@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 * + * the Free Software Foundation; either version 3 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#include "dlgrecord.h" + +#include <KLineEdit> + +DlgRecord::DlgRecord(QWidget *parent) + : QWidget(parent) +{ + setupUi(this); + KUrlRequester_destinationFolder->setMode(KFile::Directory|KFile::ExistingOnly|KFile::LocalOnly); + KUrlRequester_destinationFolder->setUrl(KUrl(QDir::home().path())); + KUrlRequester_destinationFolder->lineEdit()->setObjectName("kcfg_destinationFolder"); +} + + +DlgRecord::~DlgRecord() +{ +} + + diff --git a/sflphone-client-kde/src/conf/dlgrecord.h b/sflphone-client-kde/src/conf/dlgrecord.h new file mode 100644 index 0000000000000000000000000000000000000000..3212034591e03de8f9dacf53a291e4d86017fec1 --- /dev/null +++ b/sflphone-client-kde/src/conf/dlgrecord.h @@ -0,0 +1,41 @@ +/*************************************************************************** + * Copyright (C) 2009 by Savoir-Faire Linux * + * Author : Jérémy Quentin * + * jeremy.quentin@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 * + * the Free Software Foundation; either version 3 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef DLGRECORD_H +#define DLGRECORD_H + +#include <QWidget> + +#include "ui_dlgrecordbase.h" + +/** + @author Jérémy Quentin <jeremy.quentin@gmail.com> +*/ +class DlgRecord : public QWidget, public Ui_DlgRecordBase +{ +Q_OBJECT +public: + DlgRecord(QWidget *parent = 0); + + ~DlgRecord(); + +}; + +#endif diff --git a/sflphone-client-kde/src/conf/dlgrecordbase.ui b/sflphone-client-kde/src/conf/dlgrecordbase.ui new file mode 100644 index 0000000000000000000000000000000000000000..916071e7dfe909492c0ee7a8e47543cc3a08b89e --- /dev/null +++ b/sflphone-client-kde/src/conf/dlgrecordbase.ui @@ -0,0 +1,76 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>DlgRecordBase</class> + <widget class="QWidget" name="DlgRecordBase"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>520</width> + <height>263</height> + </rect> + </property> + <property name="windowTitle"> + <string>Form</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout"> + <item> + <widget class="QGroupBox" name="groupBox1_recordGeneral"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="title"> + <string>General</string> + </property> + <layout class="QHBoxLayout" name="horizontalLayout"> + <item> + <widget class="QLabel" name="label_destinationFolderd"> + <property name="text"> + <string>Destination folder</string> + </property> + <property name="buddy"> + <cstring>KUrlRequester_destinationFolder</cstring> + </property> + </widget> + </item> + <item> + <widget class="KUrlRequester" name="KUrlRequester_destinationFolder"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <spacer name="verticalSpacer_configRecord"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>499</width> + <height>214</height> + </size> + </property> + </spacer> + </item> + </layout> + </widget> + <customwidgets> + <customwidget> + <class>KUrlRequester</class> + <extends>QFrame</extends> + <header>kurlrequester.h</header> + </customwidget> + </customwidgets> + <resources/> + <connections/> +</ui> diff --git a/sflphone-client-kde/src/conf/kcfg_settings.kcfgc b/sflphone-client-kde/src/conf/kcfg_settings.kcfgc new file mode 100644 index 0000000000000000000000000000000000000000..085bc952854e6aa833d5a450ee40b576d3f34cb6 --- /dev/null +++ b/sflphone-client-kde/src/conf/kcfg_settings.kcfgc @@ -0,0 +1,5 @@ + +File=sflphone-client-kde.kcfg +ClassName=ConfigurationSkeletonBase +Singleton=false +Mutators=true diff --git a/sflphone-client-kde/src/conf/sflphone-client-kde.kcfg b/sflphone-client-kde/src/conf/sflphone-client-kde.kcfg new file mode 100644 index 0000000000000000000000000000000000000000..c90d937a82b9467862627d82d0798fc2287ed8e0 --- /dev/null +++ b/sflphone-client-kde/src/conf/sflphone-client-kde.kcfg @@ -0,0 +1,109 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE kcfg SYSTEM "http://www.kde.org/standards/kcfg/1.0/kcfg.dtd"> +<kcfg> + <kcfgfile name="ConfigDialogKDE" /> + <group name="main"> + <entry name="SIPPort" type="Int"> + <label>Defines the port that will be used for SIP communication.</label> + <min> 1025 </min> + <max> 65536 </max> + <default> 1025 </default> + </entry> + <entry name="enableHistory" type="Bool"> + <label>Defines whether sflphone should keep a history of calls.</label> + </entry> + <entry name="historyMax" type="Int"> + <label>Defines the number of days the history has to be kept.</label> + <min> 1 </min> + <max> 99 </max> + <default> 30 </default> + </entry> + <entry name="notifOnCalls" type="Bool"> + <label>Defines whether user should be notified when receiving a call.</label> + </entry> + <entry name="notifOnMessages" type="Bool"> + <label>Defines whether user should be notified when receiving a message.</label> + </entry> + <entry name="displayOnStart" type="Bool"> + <label>Defines whether the main window should be displayed on start.</label> + </entry> + <entry name="displayOnCalls" type="Bool"> + <label>Defines whether the main window should be displayed when receiving a message.</label> + </entry> + <!-- + <entry name="accountList" type="StringList"> + <label>Defines the list of accounts to register, in order of preference (first registered used by default).</label> + </entry> + --> + <entry name="enableStun" type="Bool"> + <label>Defines the SIP accounts must use Stun.</label> + </entry> + <entry name="stunServer" type="String"> + <label>Defines the Stun server to use.</label> + </entry> + <entry name="interface" type="Enum"> + <label>Defines the Stun server to use.</label> + <choices> + <choice name="ALSA" /> + <choice name="PulseAudio" /> + </choices> + </entry> + <entry name="enableRingtones" type="Bool"> + <label>Defines whether ringtones are enabled.</label> + </entry> + <entry name="ringtone" type="Path"> + <label>Defines which ringtone is used.</label> + </entry> + <entry name="activeCodecList" type="StringList"> + <label>Defines which ALSA plugin to use.</label> + </entry> + <entry name="alsaPlugin" type="String"> + <label>Defines which ALSA plugin to use.</label> + </entry> + <entry name="alsaInputDevice" type="Int"> + <label>Defines which ALSA Input device to use.</label> + </entry> + <entry name="alsaOutputDevice" type="Int"> + <label>Defines which ALSA Output device to use.</label> + </entry> + <entry name="pulseAudioVolumeAlter" type="Bool"> + <label>Defines whether pulse audio can mute other applications during a call.</label> + </entry> + <entry name="maxResults" type="Int"> + <label>Defines the max number of contacts to display during a search in address book.</label> + </entry> + <entry name="displayPhoto" type="Bool"> + <label>Defines whether to display contacts photos.</label> + </entry> + <entry name="business" type="Bool"> + <label>Defines whether to display professionnal phone numbers.</label> + </entry> + <entry name="mobile" type="Bool"> + <label>Defines whether to display mobile phone numbers.</label> + </entry> + <entry name="home" type="Bool"> + <label>Defines whether to display personnal phone numbers.</label> + </entry> + <entry name="destinationFolder" type="Path"> + <label>Defines the destination directory for call recordings.</label> + </entry> + <entry name="enableHooksSIP" type="Bool"> + <label>Defines whether to enable hooks for SIP accounts.</label> + </entry> + <entry name="enableHooksIAX" type="Bool"> + <label>Defines whether to enable hooks for IAX accounts.</label> + </entry> + <entry name="hooksSIPHeader" type="String"> + <label>Defines which header to catch for SIP accounts hooks.</label> + </entry> + <entry name="hooksCommand" type="String"> + <label>Defines which command to execute.</label> + </entry> + <entry name="addPrefix" type="Bool"> + <label>Defines whether to add a prefix for outgoing calls.</label> + </entry> + <entry name="prepend" type="String"> + <label>Defines the prefix to add.</label> + </entry> + </group> +</kcfg> diff --git a/sflphone-client-kde/src/dbus/CMakeLists.txt b/sflphone-client-kde/src/dbus/CMakeLists.txt deleted file mode 100644 index 928a6f963043f8275a557c19ad243e68165f5c5d..0000000000000000000000000000000000000000 --- a/sflphone-client-kde/src/dbus/CMakeLists.txt +++ /dev/null @@ -1,48 +0,0 @@ - -MESSAGE("Yeeeeaaaaah : rentre dans dbus!!!!!") -# Build dbus interfaces - -# configuration manager interface - -SET ( configurationmanager_xml ${CMAKE_CURRENT_SOURCE_DIR}/../sflphone-common/src/dbus/configurationmanager-introspec.xml ) - -SET_SOURCE_FILES_PROPERTIES( - ${configurationmanager_xml} - PROPERTIES - CLASSNAME ConfigurationManagerInterface - INCLUDE "metatypes.h") - -QT4_ADD_DBUS_INTERFACE( - sflphone_client_kde_SRCS - ${configurationmanager_xml} - configurationmanager_dbus_interface) - -# call manager interface - -SET ( callmanager_xml ${CMAKE_CURRENT_SOURCE_DIR}/../sflphone-common/src/dbus/callmanager-introspec.xml ) - -SET_SOURCE_FILES_PROPERTIES( - ${callmanager_xml} - PROPERTIES - CLASSNAME CallManagerInterface - INCLUDE "metatypes.h") - -QT4_ADD_DBUS_INTERFACE( - sflphone_client_kde_SRCS - ${callmanager_xml} - callmanager_dbus_interface) - -# instance interface - -SET ( instance_xml ${CMAKE_CURRENT_SOURCE_DIR}/../sflphone-common/src/dbus/instance-introspec.xml ) - -SET_SOURCE_FILES_PROPERTIES( - ${instance_xml} - PROPERTIES - CLASSNAME InstanceInterface - INCLUDE "metatypes.h") - -QT4_ADD_DBUS_INTERFACE( - sflphone_client_kde_SRCS - ${instance_xml} - instance_dbus_interface) diff --git a/sflphone-client-kde/src/dbus/callmanager-introspec.xml b/sflphone-client-kde/src/dbus/callmanager-introspec.xml new file mode 100644 index 0000000000000000000000000000000000000000..e9130e9a91a8d7bf17f3dc43180f33d1e11438e4 --- /dev/null +++ b/sflphone-client-kde/src/dbus/callmanager-introspec.xml @@ -0,0 +1,129 @@ +<?xml version="1.0" ?> +<node name="/org/sflphone/SFLphone"> + <interface name="org.sflphone.SFLphone.CallManager"> + + <method name="placeCall"> + <arg type="s" name="accountID" direction="in"/> + <arg type="s" name="callID" direction="in"/> + <arg type="s" name="to" direction="in"/> + </method> + + <method name="refuse"> + <arg type="s" name="callID" direction="in"/> + </method> + + <method name="accept"> + <arg type="s" name="callID" direction="in"/> + </method> + + <method name="hangUp"> + <arg type="s" name="callID" direction="in"/> + </method> + + <method name="hold"> + <arg type="s" name="callID" direction="in"/> + </method> + + <method name="unhold"> + <arg type="s" name="callID" direction="in"/> + </method> + + <method name="transfert"> + <arg type="s" name="callID" direction="in"/> + <arg type="s" name="to" direction="in"/> + </method> + + <method name="playDTMF"> + <arg type="s" name="key" direction="in"/> + </method> + + <method name="startTone"> + <arg type="i" name="start" direction="in"/> + <arg type="i" name="type" direction="in"/> + </method> + + <method name="setVolume"> + <arg type="s" name="device" direction="in"/> + <arg type="d" name="value" direction="in"/> + </method> + + <method name="getVolume"> + <arg type="s" name="device" direction="in"/> + <arg type="d" name="value" direction="out"/> + </method> + + <method name="setRecording"> + <arg type="s" name="callID" direction="in"/> + </method> + + <method name="getIsRecording"> + <arg type="s" name="callID" direction="in"/> + <arg type="b" name="isRecording" direction="out"/> + </method> + + <method name="getCallDetails"> + <arg type="s" name="callID" direction="in"/> + <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="MapStringString"/> + <arg type="a{ss}" name="infos" direction="out"/> + </method> + + <method name="getCallList"> + <arg type="as" name="list" direction="out"/> + </method> + + <method name="getCurrentCallID"> + <arg type="s" name="callID" direction="out"/> + </method> + + <method name="getCurrentCodecName"> + <arg type="s" name="callID" direction="in"/> + <arg type="s" name="codecName" direction="out"/> + </method> + + <signal name="currentSelectedCodec"> + <arg type="s" name="callID" direction="out" /> + <arg type="s" name="codecName" direction="out"/> + </signal> + + <signal name="incomingCall"> + <arg type="s" name="accountID" /> + <arg type="s" name="callID" /> + <arg type="s" name="from" /> + </signal> + + <signal name="incomingMessage"> + <arg type="s" name="accountID" direction="out" /> + <arg type="s" name="message" direction="out"/> + </signal> + + <signal name="callStateChanged"> + <arg type="s" name="callID" direction="out"/> + <arg type="s" name="state" direction="out"/> + </signal> + + <signal name="voiceMailNotify"> + <arg type="s" name="accountID" direction="out"/> + <arg type="i" name="count" direction="out"/> + </signal> + + <signal name="volumeChanged"> + <arg type="s" name="device" direction="out"/> + <arg type="d" name="value" direction="out"/> + </signal> + + <signal name="transferSucceded"> + </signal> + + <signal name="transferFailed"> + </signal> + + <!-- + <signal name="error"> + <annotation name="com.trolltech.QtDBus.QtTypeName.In0" value="MapStringString"/> + <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="MapStringString"/> + <arg type="a{ss}" name="details" direction="out"/> + </signal> + --> + + </interface> + </node> diff --git a/sflphone-client-kde/src/dbus/configurationmanager-introspec.xml b/sflphone-client-kde/src/dbus/configurationmanager-introspec.xml new file mode 100644 index 0000000000000000000000000000000000000000..cb587f3e3f60c8455834926f2909ecf800b9158b --- /dev/null +++ b/sflphone-client-kde/src/dbus/configurationmanager-introspec.xml @@ -0,0 +1,340 @@ +<?xml version="1.0" ?> +<node name="/org/sflphone/SFLphone"> + <interface name="org.sflphone.SFLphone.ConfigurationManager"> + + <!-- Accounts-related methods --> + <method name="getAccountDetails"> + <arg type="s" name="accountID" direction="in"/> + <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="MapStringString"/> + <arg type="a{ss}" name="details" direction="out"/> + </method> + + <method name="setAccountDetails"> + <annotation name="com.trolltech.QtDBus.QtTypeName.In1" value="MapStringString"/> + <arg type="s" name="accountID" direction="in"/> + <arg type="a{ss}" name="details" direction="in"/> + </method> + + <method name="addAccount"> + <annotation name="com.trolltech.QtDBus.QtTypeName.In0" value="MapStringString"/> + <arg type="a{ss}" name="details" direction="in"/> + <arg type="s" name="createdAccountId" direction="out"/> + </method> + + <method name="setAccountsOrder"> + <arg type="s" name="order" direction="in"/> + </method> + + <method name="removeAccount"> + <arg type="s" name="accoundID" direction="in"/> + </method> + + <method name="getAccountList"> + <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="VectorString"/> + <arg type="as" name="list" direction="out"/> + </method> + + <method name="sendRegister"> + <arg type="s" name="accountID" direction="in"/> + <arg type="i" name="expire" direction="in"/> + </method> + + <!-- /////////////////////// --> + + <!-- Various audio-related methods --> + + <method name="getToneLocaleList"> + <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="VectorString"/> + <arg type="as" name="list" direction="out"/> + </method> + + <method name="getVersion"> + <arg type="s" name="version" direction="out"/> + </method> + + <method name="getRingtoneList"> + <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="VectorString"/> + <arg type="as" name="list" direction="out"/> + </method> + + <method name="getPlaybackDeviceList"> + <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="VectorString"/> + <arg type="as" name="list" direction="out"/> + </method> + + <method name="getRecordDeviceList"> + <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="VectorString"/> + <arg type="as" name="list" direction="out"/> + </method> + + <method name="isRingtoneEnabled"> + <arg type="i" name="bool" direction="out"/> + </method> + + <method name="ringtoneEnabled"> + </method> + + <method name="getRingtoneChoice"> + <arg type="s" name="tone" direction="out"/> + </method> + + <method name="setRingtoneChoice"> + <arg type="s" name="tone" direction="in"/> + </method> + + <method name="getAudioManager"> + <arg type="i" name="api" direction="out"/> + </method> + + <method name="setAudioManager"> + <arg type="i" name="api" direction="in"/> + </method> + + <method name="getRecordPath"> + <arg type="s" name="rec" direction="out"/> + </method> + + <method name="setRecordPath"> + <arg type="s" name="rec" direction="in"/> + </method> + + <!-- /////////////////////// --> + + <!-- Codecs-related methods --> + + <method name="getCodecList"> + <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="VectorString"/> + <arg type="as" name="list" direction="out"/> + </method> + + <method name="getCodecDetails"> + <arg type="i" name="payload" direction="in"/> + <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="VectorString"/> + <arg type="as" name="details" direction="out"/> + </method> + + <method name="getActiveCodecList"> + <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="VectorString"/> + <arg type="as" name="list" direction="out"/> + </method> + + <method name="setActiveCodecList"> + <annotation name="com.trolltech.QtDBus.QtTypeName.In0" value="VectorString"/> + <arg type="as" name="list" direction="in"/> + </method> + + + <!-- Audio devices methods --> + + <method name="getInputAudioPluginList"> + <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="VectorString"/> + <arg type="as" name="list" direction="out"/> + </method> + + <method name="getOutputAudioPluginList"> + <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="VectorString"/> + <arg type="as" name="list" direction="out"/> + </method> + + <method name="setInputAudioPlugin"> + <arg type="s" name="audioPlugin" direction="in"/> + </method> + + <method name="setOutputAudioPlugin"> + <arg type="s" name="audioPlugin" direction="in"/> + </method> + + <method name="getAudioOutputDeviceList"> + <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="VectorString"/> + <arg type="as" name="list" direction="out"/> + </method> + + <method name="setAudioOutputDevice"> + <arg type="i" name="index" direction="in"/> + </method> + + <method name="getAudioInputDeviceList"> + <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="VectorString"/> + <arg type="as" name="list" direction="out"/> + </method> + + <method name="setAudioInputDevice"> + <arg type="i" name="index" direction="in"/> + </method> + + <method name="getCurrentAudioDevicesIndex"> + <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="VectorString"/> + <arg type="as" name="list" direction="out"/> + </method> + + <method name="getAudioDeviceIndex"> + <arg type="s" name="name" direction="in"/> + <arg type="i" name="index" direction="out"/> + </method> + + <method name="getCurrentAudioOutputPlugin"> + <arg type="s" name="plugin" direction="out"/> + </method> + + <!-- General Settings Panel --> + + <method name="isIax2Enabled"> + <arg type="i" name="res" direction="out"/> + </method> + + <method name="setNotify"> + </method> + + <method name="getNotify"> + <arg type="i" name="level" direction="out"/> + </method> + + <method name="setMailNotify"> + </method> + + <method name="getMailNotify"> + <arg type="i" name="level" direction="out"/> + </method> + + <method name="getDialpad"> + <arg type="i" name="state" direction="out"/> + </method> + + <method name="setDialpad"> + </method> + + <method name="getSearchbar"> + <arg type="i" name="state" direction="out"/> + </method> + + <method name="setSearchbar"> + </method> + + <method name="setHistoryEnabled"> + </method> + + <method name="getHistoryEnabled"> + <arg type="i" name="state" direction="out"/> + </method> + + <method name="getVolumeControls"> + <arg type="i" name="state" direction="out"/> + </method> + + <method name="setVolumeControls"> + </method> + + <method name="getHistoryLimit"> + <arg type="i" name="days" direction="out"/> + </method> + + <method name="setHistoryLimit"> + <arg type="i" name="days" direction="in"/> + </method> + + <method name="startHidden"> + </method> + + <method name="isStartHidden"> + <arg type="i" name="state" direction="out"/> + </method> + + <method name="popupMode"> + <arg type="i" name="state" direction="out"/> + </method> + + <method name="switchPopupMode"> + </method> + + <method name="setPulseAppVolumeControl"> + </method> + + <method name="getPulseAppVolumeControl"> + <arg type="i" name="state" direction="out"/> + </method> + + <method name="setSipPort"> + <arg type="i" name="port" direction="in"/> + </method> + + <method name="getSipPort"> + <arg type="i" name="port" direction="out"/> + </method> + + <method name="setStunServer"> + <arg type="s" name="server" direction="in"/> + </method> + + <method name="getStunServer"> + <arg type="s" name="server" direction="out"/> + </method> + + <method name="enableStun"> + </method> + + <method name="isStunEnabled"> + <arg type="i" name="state" direction="out"/> + </method> + + <!-- Addressbook configuration --> + <method name="getAddressbookSettings"> + <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="MapStringInt"/> + <arg type="a{si}" name="settings" direction="out"/> + </method> + + <method name="setAddressbookSettings"> + <annotation name="com.trolltech.QtDBus.QtTypeName.In0" value="MapStringInt"/> + <arg type="a{si}" name="settings" direction="in"/> + </method> + + <!-- Addressbook list --> + <method name="getAddressbookList"> + <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="VectorString"/> + <arg type="as" name="settings" direction="out"/> + </method> + + <method name="setAddressbookList"> + <annotation name="com.trolltech.QtDBus.QtTypeName.In0" value="VectorString"/> + <arg type="as" name="settings" direction="in"/> + </method> + + <!-- Hook configuration --> + <method name="getHookSettings"> + <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="MapStringString"/> + <arg type="a{ss}" name="settings" direction="out"/> + </method> + + <method name="setHookSettings"> + <annotation name="com.trolltech.QtDBus.QtTypeName.In0" value="MapStringString"/> + <arg type="a{ss}" name="settings" direction="in"/> + </method> + + <method name="getHistory"> + <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="MapStringString"/> + <arg type="a{ss}" name="entries" direction="out"/> + </method> + + <method name="setHistory"> + <annotation name="com.trolltech.QtDBus.QtTypeName.In0" value="MapStringString"/> + <arg type="a{ss}" name="entries" direction="in"/> + </method> + + <!-- ///////////////////////////// --> + + <!-- + <signal name="parametersChanged"> + <annotation name="com.trolltech.QtDBus.QtTypeName.In0" value="MapStringString"/> + <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="MapStringString"/> + <arg type="a{ss}" name="details" direction="out"/> + </signal> + --> + + <signal name="accountsChanged"> + </signal> + + <signal name="errorAlert"> + <arg type="i" name="code" direction="out"/> + </signal> + + </interface> + </node> diff --git a/sflphone-client-kde/src/dbus/instance-introspec.xml b/sflphone-client-kde/src/dbus/instance-introspec.xml new file mode 100644 index 0000000000000000000000000000000000000000..d211a0f483588ba8f9dcb620b6f6804963d6d41e --- /dev/null +++ b/sflphone-client-kde/src/dbus/instance-introspec.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" ?> +<node name="/org/sflphone/SFLphone"> + <interface name="org.sflphone.SFLphone.Instance"> + + <method name="Register"> + <arg type="i" name="pid" direction="in"/> + <arg type="s" name="name" direction="in"/> + </method> + + <method name="Unregister"> + <arg type="i" name="pid" direction="in"/> + </method> + + <method name="getRegistrationCount"> + <arg type="i" name="count" direction="out"/> + </method> + </interface> +</node> diff --git a/sflphone-client-kde/src/icons/add.png b/sflphone-client-kde/src/icons/add.png index fe07994c2c79feceb44bb6b69889bf6b09bf4d8b..1e03be9bc896c5f6d8a943ff9d153b42b67e6b16 100644 Binary files a/sflphone-client-kde/src/icons/add.png and b/sflphone-client-kde/src/icons/add.png differ diff --git a/sflphone-client-kde/src/icons/application-exit.png b/sflphone-client-kde/src/icons/application-exit.png deleted file mode 100644 index dd76354c4a49d07e81d9e701164cdc2caa439a47..0000000000000000000000000000000000000000 Binary files a/sflphone-client-kde/src/icons/application-exit.png and /dev/null differ diff --git a/sflphone-client-kde/src/icons/del_off.png b/sflphone-client-kde/src/icons/del_off.png deleted file mode 100644 index 0a08d33e21324eaed65a9c57efbf0e5175b3b0dc..0000000000000000000000000000000000000000 Binary files a/sflphone-client-kde/src/icons/del_off.png and /dev/null differ diff --git a/sflphone-client-kde/src/icons/del_on.png b/sflphone-client-kde/src/icons/del_on.png deleted file mode 100644 index ce34afa82111ee1ed53d2943a7e4d15d92eaba4f..0000000000000000000000000000000000000000 Binary files a/sflphone-client-kde/src/icons/del_on.png and /dev/null differ diff --git a/sflphone-client-kde/src/icons/led-gray.svg b/sflphone-client-kde/src/icons/led-gray.svg index 17de5519b0c9b47e996ab65c3cfe183724bb3cca..28350e96d7aac2a8412562fa120d79a431f41213 100644 --- a/sflphone-client-kde/src/icons/led-gray.svg +++ b/sflphone-client-kde/src/icons/led-gray.svg @@ -9,122 +9,141 @@ 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="744.09448819" - height="1052.3622047" + 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="led-gray.svg" - inkscape:output_extension="org.inkscape.output.svg.inkscape"> + inkscape:output_extension="org.inkscape.output.svg.inkscape" + sodipodi:modified="true"> <defs id="defs4"> <linearGradient - id="linearGradient5185"> + id="linearGradient3198"> <stop - style="stop-color:#969995;stop-opacity:1;" + style="stop-color:#f00000;stop-opacity:1;" offset="0" - id="stop5187" /> + id="stop3200" /> <stop - style="stop-color:#252525;stop-opacity:0.97647059;" + style="stop-color:#6e0000;stop-opacity:0;" offset="1" - id="stop5189" /> + id="stop3202" /> </linearGradient> - <marker - inkscape:stockid="Arrow2Lstart" - orient="auto" - refY="0.0" - refX="0.0" - id="Arrow2Lstart" - style="overflow:visible"> - <path - id="path3376" - style="font-size:12.0;fill-rule:evenodd;stroke-width:0.62500000;stroke-linejoin:round" - d="M 8.7185878,4.0337352 L -2.2072895,0.016013256 L 8.7185884,-4.0017078 C 6.9730900,-1.6296469 6.9831476,1.6157441 8.7185878,4.0337352 z " - transform="scale(1.1) translate(1,0)" /> - </marker> - <marker - inkscape:stockid="Arrow1Sstart" - orient="auto" - refY="0.0" - refX="0.0" - id="Arrow1Sstart" - style="overflow:visible"> - <path - id="path3370" - d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " - style="fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt;marker-start:none" - transform="scale(0.2) translate(6,0)" /> - </marker> <linearGradient inkscape:collect="always" - id="linearGradient3165"> + id="linearGradient2772"> <stop - style="stop-color:#e16300;stop-opacity:1;" + style="stop-color:#008000;stop-opacity:1;" offset="0" - id="stop3167" /> + id="stop2774" /> <stop - style="stop-color:#e16300;stop-opacity:0;" + style="stop-color:#008000;stop-opacity:0;" offset="1" - id="stop3169" /> + id="stop2776" /> </linearGradient> <inkscape:perspective sodipodi:type="inkscape:persp3d" - inkscape:vp_x="0 : 526.18109 : 1" + inkscape:vp_x="0 : 12 : 1" inkscape:vp_y="0 : 1000 : 0" - inkscape:vp_z="744.09448 : 526.18109 : 1" - inkscape:persp3d-origin="372.04724 : 350.78739 : 1" - id="perspective10" /> + inkscape:vp_z="24 : 12 : 1" + inkscape:persp3d-origin="12 : 8 : 1" + id="perspective4177" /> + <linearGradient + id="linearGradient4269"> + <stop + style="stop-color:#bebebe;stop-opacity:1;" + offset="0" + id="stop4271" /> + <stop + style="stop-color:#393939;stop-opacity:1;" + offset="1" + id="stop4273" /> + </linearGradient> + <linearGradient + id="linearGradient4183"> + <stop + id="stop4185" + offset="0" + style="stop-color:#00fe00;stop-opacity:0" /> + <stop + style="stop-color:#0aae00;stop-opacity:0.49803922;" + offset="0.5" + id="stop3252" /> + <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="#linearGradient2772" + id="linearGradient2778" + x1="26.420586" + y1="3.4565225" + x2="20.291727" + y2="-5.2758617" + gradientUnits="userSpaceOnUse" /> <radialGradient inkscape:collect="always" - xlink:href="#linearGradient3165" - id="radialGradient3181" + xlink:href="#linearGradient4269" + id="radialGradient3212" + cx="13.96536" + cy="9.4733086" + fx="13.96536" + fy="9.4733086" + r="11.578874" + gradientTransform="matrix(1,0,0,1.0229008,0,-0.2743328)" gradientUnits="userSpaceOnUse" - gradientTransform="matrix(0.2682705,3.3175707,-3.0169525,0.2439616,1420.6017,-661.5798)" - cx="277.22891" - cy="368.62262" - fx="277.22891" - fy="368.62262" - r="62.857143" /> + spreadMethod="pad" /> <filter inkscape:collect="always" - id="filter3351"> + id="filter4712"> <feGaussianBlur inkscape:collect="always" - stdDeviation="3.7100165" - id="feGaussianBlur3353" /> + stdDeviation="0.23393594" + id="feGaussianBlur4714" /> </filter> - <radialGradient - inkscape:collect="always" - xlink:href="#linearGradient5185" - id="radialGradient5191" - cx="574.9386" - cy="668.12408" - fx="574.9386" - fy="668.12408" - r="235.64999" - gradientTransform="matrix(-0.7572557,-0.504794,0.5925778,-0.8889426,623.74572,1505.0832)" - gradientUnits="userSpaceOnUse" /> </defs> <sodipodi:namedview id="base" pagecolor="#ffffff" bordercolor="#666666" borderopacity="1.0" - gridtolerance="10000" - guidetolerance="10" - objecttolerance="10" inkscape:pageopacity="0.0" inkscape:pageshadow="2" - inkscape:zoom="0.6005537" - inkscape:cx="67.328445" - inkscape:cy="526.18109" + inkscape:zoom="11.313708" + inkscape:cx="-4.3721765" + inkscape:cy="-1.1958053" inkscape:document-units="px" inkscape:current-layer="layer1" - showgrid="false" + width="32px" + height="32px" + showguides="true" + inkscape:guide-bbox="true" inkscape:window-width="1440" inkscape:window-height="840" inkscape:window-x="-5" - inkscape:window-y="-3" /> + inkscape:window-y="-3" + showgrid="false"> + <sodipodi:guide + orientation="vertical" + position="15.982143" + id="guide3146" /> + </sodipodi:namedview> <metadata id="metadata7"> <rdf:RDF> @@ -137,20 +156,18 @@ </rdf:RDF> </metadata> <g - inkscape:label="Layer 1" + inkscape:label="Calque 1" inkscape:groupmode="layer" id="layer1"> - <g - id="g3178" /> <path sodipodi:type="arc" - style="opacity:1;fill:url(#radialGradient5191);fill-opacity:1.0;fill-rule:evenodd;stroke:#000000;stroke-width:11.30000019000000044;stroke-linecap:butt;stroke-linejoin:miter;marker-start:none;stroke-miterlimit:16.79999923999999822;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;filter:url(#filter3351)" - id="path3185" - sodipodi:cx="535.71429" - sodipodi:cy="680.93359" - sodipodi:rx="234.28572" - sodipodi:ry="234.28572" - d="M 770.00002,680.93359 A 234.28572,234.28572 0 1 1 301.42857,680.93359 A 234.28572,234.28572 0 1 1 770.00002,680.93359 z" - transform="translate(-156.52222,-149.8617)" /> + style="opacity:1;fill:url(#radialGradient3212);fill-opacity:1;stroke:#000000;stroke-opacity:1;filter:url(#filter4712)" + id="path2424" + sodipodi:cx="12.197593" + sodipodi:cy="11.979184" + sodipodi:rx="11.578874" + sodipodi:ry="11.844039" + d="M 23.776466,11.979184 A 11.578874,11.844039 0 1 1 0.6187191,11.979184 A 11.578874,11.844039 0 1 1 23.776466,11.979184 z" + transform="matrix(0.5797944,0,0,0.5668139,4.9279038,5.2100323)" /> </g> </svg> diff --git a/sflphone-client-kde/src/icons/led-green.svg b/sflphone-client-kde/src/icons/led-green.svg index 005cf124956dcfc5d124122b144d04a811f9e0ab..8d6ea17f118521fed8b5f9e5010924da623d63e6 100644 --- a/sflphone-client-kde/src/icons/led-green.svg +++ b/sflphone-client-kde/src/icons/led-green.svg @@ -9,122 +9,141 @@ 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="744.09448819" - height="1052.3622047" + 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="led-green.svg" - inkscape:output_extension="org.inkscape.output.svg.inkscape"> + inkscape:output_extension="org.inkscape.output.svg.inkscape" + sodipodi:modified="true"> <defs id="defs4"> <linearGradient - id="linearGradient5185"> + id="linearGradient3198"> <stop - style="stop-color:#39f400;stop-opacity:1;" + style="stop-color:#f00000;stop-opacity:1;" offset="0" - id="stop5187" /> + id="stop3200" /> <stop - style="stop-color:#004b05;stop-opacity:0.97647059;" + style="stop-color:#6e0000;stop-opacity:0;" offset="1" - id="stop5189" /> + id="stop3202" /> </linearGradient> - <marker - inkscape:stockid="Arrow2Lstart" - orient="auto" - refY="0.0" - refX="0.0" - id="Arrow2Lstart" - style="overflow:visible"> - <path - id="path3376" - style="font-size:12.0;fill-rule:evenodd;stroke-width:0.62500000;stroke-linejoin:round" - d="M 8.7185878,4.0337352 L -2.2072895,0.016013256 L 8.7185884,-4.0017078 C 6.9730900,-1.6296469 6.9831476,1.6157441 8.7185878,4.0337352 z " - transform="scale(1.1) translate(1,0)" /> - </marker> - <marker - inkscape:stockid="Arrow1Sstart" - orient="auto" - refY="0.0" - refX="0.0" - id="Arrow1Sstart" - style="overflow:visible"> - <path - id="path3370" - d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " - style="fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt;marker-start:none" - transform="scale(0.2) translate(6,0)" /> - </marker> <linearGradient inkscape:collect="always" - id="linearGradient3165"> + id="linearGradient2772"> <stop - style="stop-color:#e16300;stop-opacity:1;" + style="stop-color:#008000;stop-opacity:1;" offset="0" - id="stop3167" /> + id="stop2774" /> <stop - style="stop-color:#e16300;stop-opacity:0;" + style="stop-color:#008000;stop-opacity:0;" offset="1" - id="stop3169" /> + id="stop2776" /> </linearGradient> <inkscape:perspective sodipodi:type="inkscape:persp3d" - inkscape:vp_x="0 : 526.18109 : 1" + inkscape:vp_x="0 : 12 : 1" inkscape:vp_y="0 : 1000 : 0" - inkscape:vp_z="744.09448 : 526.18109 : 1" - inkscape:persp3d-origin="372.04724 : 350.78739 : 1" - id="perspective10" /> + inkscape:vp_z="24 : 12 : 1" + inkscape:persp3d-origin="12 : 8 : 1" + id="perspective4177" /> + <linearGradient + id="linearGradient4269"> + <stop + style="stop-color:#8bff35;stop-opacity:1;" + offset="0" + id="stop4271" /> + <stop + style="stop-color:#197800;stop-opacity:1;" + offset="1" + id="stop4273" /> + </linearGradient> + <linearGradient + id="linearGradient4183"> + <stop + id="stop4185" + offset="0" + style="stop-color:#00fe00;stop-opacity:0" /> + <stop + style="stop-color:#0aae00;stop-opacity:0.49803922;" + offset="0.5" + id="stop3252" /> + <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="#linearGradient2772" + id="linearGradient2778" + x1="26.420586" + y1="3.4565225" + x2="20.291727" + y2="-5.2758617" + gradientUnits="userSpaceOnUse" /> <radialGradient inkscape:collect="always" - xlink:href="#linearGradient3165" - id="radialGradient3181" + xlink:href="#linearGradient4269" + id="radialGradient3212" + cx="13.96536" + cy="9.4733086" + fx="13.96536" + fy="9.4733086" + r="11.578874" + gradientTransform="matrix(1,0,0,1.0229008,0,-0.2743328)" gradientUnits="userSpaceOnUse" - gradientTransform="matrix(0.2682705,3.3175707,-3.0169525,0.2439616,1420.6017,-661.5798)" - cx="277.22891" - cy="368.62262" - fx="277.22891" - fy="368.62262" - r="62.857143" /> + spreadMethod="pad" /> <filter inkscape:collect="always" - id="filter3351"> + id="filter4712"> <feGaussianBlur inkscape:collect="always" - stdDeviation="3.7100165" - id="feGaussianBlur3353" /> + stdDeviation="0.23393594" + id="feGaussianBlur4714" /> </filter> - <radialGradient - inkscape:collect="always" - xlink:href="#linearGradient5185" - id="radialGradient5191" - cx="574.9386" - cy="668.12408" - fx="574.9386" - fy="668.12408" - r="235.64999" - gradientTransform="matrix(-0.7572557,-0.504794,0.5925778,-0.8889426,623.74572,1505.0832)" - gradientUnits="userSpaceOnUse" /> </defs> <sodipodi:namedview id="base" pagecolor="#ffffff" bordercolor="#666666" borderopacity="1.0" - gridtolerance="10000" - guidetolerance="10" - objecttolerance="10" inkscape:pageopacity="0.0" inkscape:pageshadow="2" - inkscape:zoom="0.6005537" - inkscape:cx="67.328445" - inkscape:cy="526.18109" + inkscape:zoom="11.313708" + inkscape:cx="-1.720526" + inkscape:cy="-1.1958053" inkscape:document-units="px" inkscape:current-layer="layer1" - showgrid="false" + width="32px" + height="32px" + showguides="true" + inkscape:guide-bbox="true" inkscape:window-width="1440" inkscape:window-height="840" inkscape:window-x="-5" - inkscape:window-y="-3" /> + inkscape:window-y="-3" + showgrid="false"> + <sodipodi:guide + orientation="vertical" + position="15.982143" + id="guide3146" /> + </sodipodi:namedview> <metadata id="metadata7"> <rdf:RDF> @@ -137,20 +156,18 @@ </rdf:RDF> </metadata> <g - inkscape:label="Layer 1" + inkscape:label="Calque 1" inkscape:groupmode="layer" id="layer1"> - <g - id="g3178" /> <path sodipodi:type="arc" - style="opacity:1;fill:url(#radialGradient5191);fill-opacity:1.0;fill-rule:evenodd;stroke:#000000;stroke-width:11.30000019000000044;stroke-linecap:butt;stroke-linejoin:miter;marker-start:none;stroke-miterlimit:16.79999923999999822;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;filter:url(#filter3351)" - id="path3185" - sodipodi:cx="535.71429" - sodipodi:cy="680.93359" - sodipodi:rx="234.28572" - sodipodi:ry="234.28572" - d="M 770.00002,680.93359 A 234.28572,234.28572 0 1 1 301.42857,680.93359 A 234.28572,234.28572 0 1 1 770.00002,680.93359 z" - transform="translate(-156.52222,-149.8617)" /> + style="opacity:1;fill:url(#radialGradient3212);fill-opacity:1;stroke:#000000;stroke-opacity:1;filter:url(#filter4712)" + id="path2424" + sodipodi:cx="12.197593" + sodipodi:cy="11.979184" + sodipodi:rx="11.578874" + sodipodi:ry="11.844039" + d="M 23.776466,11.979184 A 11.578874,11.844039 0 1 1 0.6187191,11.979184 A 11.578874,11.844039 0 1 1 23.776466,11.979184 z" + transform="matrix(0.5797944,0,0,0.5668139,4.9279038,5.2100323)" /> </g> </svg> diff --git a/sflphone-client-kde/src/icons/led-red.svg b/sflphone-client-kde/src/icons/led-red.svg index 6aa39f804da88a97b9393ebb068fd3f15270542b..676635068eb171a382fbc4e08ec50ee87cd9cc06 100644 --- a/sflphone-client-kde/src/icons/led-red.svg +++ b/sflphone-client-kde/src/icons/led-red.svg @@ -9,122 +9,173 @@ 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="744.09448819" - height="1052.3622047" + 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="led-red.svg" - inkscape:output_extension="org.inkscape.output.svg.inkscape"> + inkscape:output_extension="org.inkscape.output.svg.inkscape" + sodipodi:modified="true"> <defs id="defs4"> - <linearGradient - id="linearGradient5185"> - <stop - style="stop-color:#f40800;stop-opacity:1;" - offset="0" - id="stop5187" /> - <stop - style="stop-color:#6c0000;stop-opacity:0.97647059;" - offset="1" - id="stop5189" /> - </linearGradient> - <marker - inkscape:stockid="Arrow2Lstart" - orient="auto" - refY="0.0" - refX="0.0" - id="Arrow2Lstart" - style="overflow:visible"> - <path - id="path3376" - style="font-size:12.0;fill-rule:evenodd;stroke-width:0.62500000;stroke-linejoin:round" - d="M 8.7185878,4.0337352 L -2.2072895,0.016013256 L 8.7185884,-4.0017078 C 6.9730900,-1.6296469 6.9831476,1.6157441 8.7185878,4.0337352 z " - transform="scale(1.1) translate(1,0)" /> - </marker> <marker - inkscape:stockid="Arrow1Sstart" + inkscape:stockid="Arrow1Mstart" orient="auto" refY="0.0" refX="0.0" - id="Arrow1Sstart" + id="Arrow1Mstart" style="overflow:visible"> <path - id="path3370" + id="path5147" d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " style="fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt;marker-start:none" - transform="scale(0.2) translate(6,0)" /> + transform="scale(0.4) translate(10,0)" /> </marker> + <linearGradient + id="linearGradient3181"> + <stop + style="stop-color:#000000;stop-opacity:1;" + offset="0" + id="stop3183" /> + <stop + id="stop3189" + offset="0.93000001" + style="stop-color:#000000;stop-opacity:1;" /> + <stop + style="stop-color:#ffffff;stop-opacity:1;" + offset="0.95285714" + id="stop3191" /> + <stop + style="stop-color:#000000;stop-opacity:1;" + offset="1" + id="stop3185" /> + </linearGradient> + <linearGradient + id="linearGradient3198"> + <stop + style="stop-color:#f00000;stop-opacity:1;" + offset="0" + id="stop3200" /> + <stop + style="stop-color:#6e0000;stop-opacity:0;" + offset="1" + id="stop3202" /> + </linearGradient> <linearGradient inkscape:collect="always" - id="linearGradient3165"> + id="linearGradient2772"> <stop - style="stop-color:#e16300;stop-opacity:1;" + style="stop-color:#008000;stop-opacity:1;" offset="0" - id="stop3167" /> + id="stop2774" /> <stop - style="stop-color:#e16300;stop-opacity:0;" + style="stop-color:#008000;stop-opacity:0;" offset="1" - id="stop3169" /> + id="stop2776" /> </linearGradient> <inkscape:perspective sodipodi:type="inkscape:persp3d" - inkscape:vp_x="0 : 526.18109 : 1" + inkscape:vp_x="0 : 12 : 1" inkscape:vp_y="0 : 1000 : 0" - inkscape:vp_z="744.09448 : 526.18109 : 1" - inkscape:persp3d-origin="372.04724 : 350.78739 : 1" - id="perspective10" /> + inkscape:vp_z="24 : 12 : 1" + inkscape:persp3d-origin="12 : 8 : 1" + id="perspective4177" /> + <linearGradient + id="linearGradient4269"> + <stop + style="stop-color:#ff3535;stop-opacity:1;" + offset="0" + id="stop4271" /> + <stop + style="stop-color:#780000;stop-opacity:1;" + offset="1" + id="stop4273" /> + </linearGradient> + <linearGradient + id="linearGradient4183"> + <stop + id="stop4185" + offset="0" + style="stop-color:#00fe00;stop-opacity:0" /> + <stop + style="stop-color:#0aae00;stop-opacity:0.49803922;" + offset="0.5" + id="stop3252" /> + <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="#linearGradient2772" + id="linearGradient2778" + x1="26.420586" + y1="3.4565225" + x2="20.291727" + y2="-5.2758617" + gradientUnits="userSpaceOnUse" /> <radialGradient inkscape:collect="always" - xlink:href="#linearGradient3165" - id="radialGradient3181" + xlink:href="#linearGradient4269" + id="radialGradient3212" + cx="13.96536" + cy="9.4733086" + fx="13.96536" + fy="9.4733086" + r="11.578874" + gradientTransform="matrix(1,0,0,1.0229008,0,-0.2743328)" gradientUnits="userSpaceOnUse" - gradientTransform="matrix(0.2682705,3.3175707,-3.0169525,0.2439616,1420.6017,-661.5798)" - cx="277.22891" - cy="368.62262" - fx="277.22891" - fy="368.62262" - r="62.857143" /> + spreadMethod="pad" /> <filter inkscape:collect="always" - id="filter3351"> + id="filter4712"> <feGaussianBlur inkscape:collect="always" - stdDeviation="3.7100165" - id="feGaussianBlur3353" /> + stdDeviation="0.23393594" + id="feGaussianBlur4714" /> </filter> - <radialGradient - inkscape:collect="always" - xlink:href="#linearGradient5185" - id="radialGradient5191" - cx="574.9386" - cy="668.12408" - fx="574.9386" - fy="668.12408" - r="235.64999" - gradientTransform="matrix(-0.7572557,-0.504794,0.5925778,-0.8889426,623.74572,1505.0832)" - gradientUnits="userSpaceOnUse" /> </defs> <sodipodi:namedview id="base" pagecolor="#ffffff" bordercolor="#666666" borderopacity="1.0" - gridtolerance="10000" - guidetolerance="10" - objecttolerance="10" inkscape:pageopacity="0.0" inkscape:pageshadow="2" - inkscape:zoom="0.6005537" - inkscape:cx="372.04724" - inkscape:cy="526.18109" + inkscape:zoom="11.313708" + inkscape:cx="7.36622" + inkscape:cy="-1.1958053" inkscape:document-units="px" inkscape:current-layer="layer1" - showgrid="false" - inkscape:window-width="1440" - inkscape:window-height="840" - inkscape:window-x="-5" - inkscape:window-y="-3" /> + width="32px" + height="32px" + showguides="true" + inkscape:guide-bbox="true" + inkscape:window-width="950" + inkscape:window-height="774" + inkscape:window-x="393" + inkscape:window-y="27" + showgrid="false"> + <sodipodi:guide + orientation="vertical" + position="15.982143" + id="guide3146" /> + </sodipodi:namedview> <metadata id="metadata7"> <rdf:RDF> @@ -137,20 +188,18 @@ </rdf:RDF> </metadata> <g - inkscape:label="Layer 1" + inkscape:label="Calque 1" inkscape:groupmode="layer" id="layer1"> - <g - id="g3178" /> <path sodipodi:type="arc" - style="opacity:1;fill:url(#radialGradient5191);fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:11.30000019;stroke-linecap:butt;stroke-linejoin:miter;marker-start:none;stroke-miterlimit:16.79999924;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;filter:url(#filter3351)" - id="path3185" - sodipodi:cx="535.71429" - sodipodi:cy="680.93359" - sodipodi:rx="234.28572" - sodipodi:ry="234.28572" - d="M 770.00002,680.93359 A 234.28572,234.28572 0 1 1 301.42857,680.93359 A 234.28572,234.28572 0 1 1 770.00002,680.93359 z" - transform="translate(-156.52222,-149.8617)" /> + style="opacity:1;fill:url(#radialGradient3212);fill-opacity:1;stroke:#000000;stroke-width:1.00005674;stroke-linecap:butt;marker-start:none;stroke-miterlimit:1.29999995;stroke-dasharray:none;stroke-dashoffset:9.00051083;stroke-opacity:1;filter:url(#filter4712)" + id="path2424" + sodipodi:cx="12.197593" + sodipodi:cy="11.979184" + sodipodi:rx="11.578874" + sodipodi:ry="11.844039" + d="M 23.776466,11.979184 A 11.578874,11.844039 0 1 1 0.6187191,11.979184 A 11.578874,11.844039 0 1 1 23.776466,11.979184 z" + transform="matrix(0.5797931,0,0,0.5668126,4.9279203,5.2100476)" /> </g> </svg> diff --git a/sflphone-client-kde/src/icons/office-address-book.png b/sflphone-client-kde/src/icons/office-address-book.png deleted file mode 100644 index 3b00f62c87465a2614920885b1bcee6ae7fea2f9..0000000000000000000000000000000000000000 Binary files a/sflphone-client-kde/src/icons/office-address-book.png and /dev/null differ diff --git a/sflphone-client-kde/src/icons/record_disabled.svg b/sflphone-client-kde/src/icons/record_disabled.svg new file mode 100644 index 0000000000000000000000000000000000000000..3f8afeb87a9aa502eae4b89ff5ef046c3264b8b8 --- /dev/null +++ b/sflphone-client-kde/src/icons/record_disabled.svg @@ -0,0 +1,1070 @@ +<?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="record_disabled.svg" + inkscape:output_extension="org.inkscape.output.svg.inkscape" + sodipodi:modified="true"> + <defs + id="defs4"> + <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="perspective77" /> + <linearGradient + id="linearGradient4045"> + <stop + style="stop-color:#ffffff;stop-opacity:0" + offset="0" + id="stop4047" /> + <stop + style="stop-color:#fefee7;stop-opacity:0.89308178" + offset="1" + id="stop4049" /> + </linearGradient> + <linearGradient + id="linearGradient4269"> + <stop + style="stop-color:#1db000;stop-opacity:1;" + offset="0" + id="stop4271" /> + <stop + style="stop-color:#1db000;stop-opacity:0;" + offset="1" + id="stop4273" /> + </linearGradient> + <linearGradient + id="linearGradient4183"> + <stop + id="stop4185" + offset="0" + style="stop-color:#1db000;stop-opacity:1;" /> + <stop + id="stop4187" + offset="1" + style="stop-color:#0f5f00;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="#linearGradient4183" + id="linearGradient2224" + x1="16.826796" + y1="6.7288713" + x2="27.5625" + y2="22.512505" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(0.875025,0,0,0.875025,0.666703,0.177907)" /> + <linearGradient + y2="13.920053" + x2="6.8378897" + y1="12.625902" + x1="2.0651877" + gradientTransform="matrix(-1,0,0,1,32.04188,-2.86473)" + gradientUnits="userSpaceOnUse" + id="linearGradient1388" + xlink:href="#linearGradient4269" + inkscape:collect="always" /> + <linearGradient + gradientTransform="translate(0.426158,-2.762136)" + gradientUnits="userSpaceOnUse" + y2="13.920053" + x2="6.8378897" + y1="12.625902" + x1="2.0651877" + id="linearGradient1386" + xlink:href="#linearGradient4269" + inkscape:collect="always" /> + <linearGradient + gradientUnits="userSpaceOnUse" + y2="10.576721" + x2="14.013638" + y1="2.7028866" + x1="15.647213" + id="linearGradient1384" + xlink:href="#linearGradient4183" + inkscape:collect="always" /> + <linearGradient + gradientTransform="translate(-0.947018,-0.885198)" + gradientUnits="userSpaceOnUse" + y2="12.535715" + x2="31.31678" + y1="12.535715" + x1="24.397505" + id="linearGradient1382" + xlink:href="#linearGradient4183" + inkscape:collect="always" /> + <linearGradient + gradientTransform="translate(1.262691,-1.100752)" + gradientUnits="userSpaceOnUse" + y2="12.825893" + x2="7.9239235" + y1="12.825893" + x1="1.0046476" + id="linearGradient1380" + xlink:href="#linearGradient4183" + inkscape:collect="always" /> + <linearGradient + id="linearGradient1374"> + <stop + id="stop1376" + offset="0" + style="stop-color:#80000e;stop-opacity:1;" /> + <stop + id="stop1378" + offset="1" + style="stop-color:#b00014;stop-opacity:0;" /> + </linearGradient> + <linearGradient + id="linearGradient1368"> + <stop + style="stop-color:#26b000;stop-opacity:1;" + offset="0" + id="stop1370" /> + <stop + style="stop-color:#145f00;stop-opacity:1;" + offset="1" + id="stop1372" /> + </linearGradient> + <linearGradient + id="linearGradient1362"> + <stop + id="stop1364" + offset="0" + style="stop-color:#26b000;stop-opacity:1;" /> + <stop + id="stop1366" + offset="1" + style="stop-color:#26b000;stop-opacity:0;" /> + </linearGradient> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient4183" + id="linearGradient1406" + gradientUnits="userSpaceOnUse" + x1="15.647213" + y1="2.7028866" + x2="14.013638" + y2="10.576721" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient4183" + id="linearGradient1408" + gradientUnits="userSpaceOnUse" + gradientTransform="translate(1.262691,-1.100752)" + x1="10.57493" + y1="12.115559" + x2="-0.68574232" + y2="12.115559" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient4183" + id="linearGradient1410" + gradientUnits="userSpaceOnUse" + gradientTransform="translate(-0.947018,-0.885198)" + x1="31.692968" + y1="11.264216" + x2="23.888865" + y2="13.35532" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient4269" + id="linearGradient1412" + gradientUnits="userSpaceOnUse" + gradientTransform="translate(0.426158,-2.762136)" + x1="7.8517423" + y1="15.912388" + x2="7.1114841" + y2="11.597325" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient4269" + id="linearGradient1414" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(-1,0,0,1,32.04188,-2.86473)" + x1="2.0651877" + y1="12.625902" + x2="6.8378897" + y2="13.920053" /> + <radialGradient + inkscape:collect="always" + xlink:href="#linearGradient4045" + id="radialGradient4051" + cx="19.285715" + cy="9.8571424" + fx="19.285715" + fy="9.8571424" + r="10.885714" + gradientUnits="userSpaceOnUse" + spreadMethod="reflect" + gradientTransform="matrix(0.418975,0,0,0.418975,11.20548,5.727248)" /> + <linearGradient + gradientTransform="matrix(1.256521,0,0,-1.256521,-7.854319,28.773309)" + gradientUnits="userSpaceOnUse" + y2="8.5305319" + x2="15.630395" + y1="22.874208" + x1="15.630395" + id="linearGradient2444" + xlink:href="#linearGradient4269" + inkscape:collect="always" /> + <linearGradient + y2="13.920053" + x2="6.8378897" + y1="12.625902" + x1="2.0651877" + gradientTransform="matrix(-1,0,0,1,31.179578,-2.86473)" + gradientUnits="userSpaceOnUse" + id="linearGradient2442" + xlink:href="#linearGradient4269" + inkscape:collect="always" /> + <linearGradient + gradientTransform="translate(1.1362892,-2.762136)" + gradientUnits="userSpaceOnUse" + y2="13.920053" + x2="6.8378897" + y1="12.625902" + x1="2.0651877" + id="linearGradient2440" + xlink:href="#linearGradient4269" + inkscape:collect="always" /> + <linearGradient + gradientUnits="userSpaceOnUse" + y2="10.576721" + x2="14.013638" + y1="2.7028866" + x1="15.647213" + id="linearGradient2438" + xlink:href="#linearGradient4183" + inkscape:collect="always" /> + <linearGradient + gradientTransform="translate(-1.9107675,-0.885198)" + gradientUnits="userSpaceOnUse" + y2="12.535715" + x2="31.31678" + y1="12.535715" + x1="24.397505" + id="linearGradient2436" + xlink:href="#linearGradient4183" + inkscape:collect="always" /> + <linearGradient + gradientTransform="translate(1.9220986,-1.100752)" + gradientUnits="userSpaceOnUse" + y2="12.825893" + x2="7.9239235" + y1="12.825893" + x1="1.0046476" + id="linearGradient2434" + xlink:href="#linearGradient4183" + inkscape:collect="always" /> + <linearGradient + id="linearGradient2428"> + <stop + id="stop2430" + offset="0" + style="stop-color:#80000e;stop-opacity:1;" /> + <stop + id="stop2432" + offset="1" + style="stop-color:#b00014;stop-opacity:0;" /> + </linearGradient> + <linearGradient + id="linearGradient2422"> + <stop + style="stop-color:#26b000;stop-opacity:1;" + offset="0" + id="stop2424" /> + <stop + style="stop-color:#145f00;stop-opacity:1;" + offset="1" + id="stop2426" /> + </linearGradient> + <linearGradient + id="linearGradient2416"> + <stop + id="stop2418" + offset="0" + style="stop-color:#26b000;stop-opacity:1;" /> + <stop + id="stop2420" + offset="1" + style="stop-color:#26b000;stop-opacity:0;" /> + </linearGradient> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient4183" + id="linearGradient2483" + gradientUnits="userSpaceOnUse" + x1="15.647213" + y1="2.7028866" + x2="14.013638" + y2="10.576721" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient4183" + id="linearGradient2485" + gradientUnits="userSpaceOnUse" + gradientTransform="translate(1.262691,-1.100752)" + x1="10.57493" + y1="12.115559" + x2="-0.68574232" + y2="12.115559" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient4183" + id="linearGradient2487" + gradientUnits="userSpaceOnUse" + gradientTransform="translate(-0.947018,-0.885198)" + x1="31.692968" + y1="11.264216" + x2="23.888865" + y2="13.35532" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient4269" + id="linearGradient2489" + gradientUnits="userSpaceOnUse" + gradientTransform="translate(0.426158,-2.762136)" + x1="7.8517423" + y1="15.912388" + x2="7.1114841" + y2="11.597325" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient4269" + id="linearGradient2491" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(-1,0,0,1,32.04188,-2.86473)" + x1="2.0651877" + y1="12.625902" + x2="6.8378897" + y2="13.920053" /> + <linearGradient + gradientUnits="userSpaceOnUse" + y2="355.44769" + x2="189.20502" + y1="118.36168" + x1="192.86734" + id="linearGradient2702" + xlink:href="#linearGradient3169" + inkscape:collect="always" /> + <linearGradient + inkscape:collect="always" + id="linearGradient3308"> + <stop + style="stop-color:#ffffff;stop-opacity:1" + offset="0" + id="stop3310" /> + <stop + style="stop-color:#ffffff;stop-opacity:0" + offset="1" + id="stop3312" /> + </linearGradient> + <linearGradient + id="linearGradient3289" + inkscape:collect="always"> + <stop + id="stop3291" + offset="0" + style="stop-color:#999999;stop-opacity:1" /> + <stop + id="stop3293" + offset="1" + style="stop-color:#000000;stop-opacity:1" /> + </linearGradient> + <linearGradient + inkscape:collect="always" + id="linearGradient3193"> + <stop + style="stop-color:#ffffff;stop-opacity:1" + offset="0" + id="stop3195" /> + <stop + style="stop-color:#000000;stop-opacity:1" + offset="1" + id="stop3197" /> + </linearGradient> + <linearGradient + id="linearGradient3181"> + <stop + id="stop3183" + offset="0" + style="stop-color:#ff0000;stop-opacity:1;" /> + <stop + style="stop-color:#ff0000;stop-opacity:0.65271967" + offset="0.11529652" + id="stop3185" /> + <stop + id="stop3187" + offset="1" + style="stop-color:#000000;stop-opacity:0.15481172" /> + </linearGradient> + <linearGradient + id="linearGradient3169"> + <stop + id="stop3171" + offset="0" + style="stop-color:#6b0000;stop-opacity:1;" /> + <stop + id="stop3173" + offset="1" + style="stop-color:#ff0000;stop-opacity:0;" /> + </linearGradient> + <linearGradient + id="linearGradient2385"> + <stop + style="stop-color:#ff0000;stop-opacity:1;" + offset="0" + id="stop2387" /> + <stop + id="stop3175" + offset="0.87037039" + style="stop-color:#ff0000;stop-opacity:0.55172414;" /> + <stop + style="stop-color:#ff0000;stop-opacity:1;" + offset="1" + id="stop2389" /> + </linearGradient> + <inkscape:perspective + sodipodi:type="inkscape:persp3d" + inkscape:vp_x="0 : 526.18109 : 1" + inkscape:vp_y="0 : 1000 : 0" + inkscape:vp_z="744.09448 : 526.18109 : 1" + inkscape:persp3d-origin="372.04724 : 350.78739 : 1" + id="perspective10" /> + <radialGradient + inkscape:collect="always" + xlink:href="#linearGradient2385" + id="radialGradient3163" + cx="184.85791" + cy="163.42795" + fx="184.85791" + fy="163.42795" + r="140.91121" + gradientUnits="userSpaceOnUse" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3181" + id="linearGradient3179" + x1="175.76654" + y1="316.97113" + x2="184.85791" + y2="23.016739" + gradientUnits="userSpaceOnUse" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3193" + id="linearGradient3199" + x1="204.55589" + y1="262.45413" + x2="204.55589" + y2="62.412689" + gradientUnits="userSpaceOnUse" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3193" + id="linearGradient3203" + gradientUnits="userSpaceOnUse" + x1="175.13184" + y1="259.03506" + x2="226.90887" + y2="65.800499" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3193" + id="linearGradient3211" + gradientUnits="userSpaceOnUse" + x1="204.55589" + y1="262.45413" + x2="204.55589" + y2="62.412689" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3193" + id="linearGradient3213" + gradientUnits="userSpaceOnUse" + x1="204.55589" + y1="262.45413" + x2="204.55589" + y2="62.412689" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3289" + id="linearGradient3287" + gradientUnits="userSpaceOnUse" + x1="224.26379" + y1="259.7438" + x2="172.07999" + y2="66.61824" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3289" + id="linearGradient3301" + gradientUnits="userSpaceOnUse" + x1="224.26379" + y1="259.7438" + x2="172.07999" + y2="66.61824" + gradientTransform="matrix(-1.1122783,-0.2980341,0.2980341,-1.1122783,376.2049,402.98248)" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3308" + id="linearGradient3306" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(-1.1122783,-0.2980341,0.2980341,-1.1122783,306.50437,364.59668)" + x1="160.2529" + y1="-5.1353641" + x2="224.82684" + y2="168.2903" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3289" + id="linearGradient3322" + gradientUnits="userSpaceOnUse" + x1="224.26379" + y1="259.7438" + x2="172.07999" + y2="66.61824" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3193" + id="linearGradient3324" + gradientUnits="userSpaceOnUse" + x1="175.13184" + y1="259.03506" + x2="226.90887" + y2="65.800499" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3308" + id="linearGradient3326" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(-1.1122783,-0.2980341,0.2980341,-1.1122783,747.63347,397.26819)" + x1="160.2529" + y1="-5.1353641" + x2="224.82684" + y2="168.2903" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3289" + id="linearGradient3336" + gradientUnits="userSpaceOnUse" + x1="224.26379" + y1="259.7438" + x2="172.07999" + y2="66.61824" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3193" + id="linearGradient3338" + gradientUnits="userSpaceOnUse" + x1="175.13184" + y1="259.03506" + x2="226.90887" + y2="65.800499" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3308" + id="linearGradient3340" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(-1.1122783,-0.2980341,0.2980341,-1.1122783,558.73494,665.96877)" + x1="160.2529" + y1="-5.1353641" + x2="224.82684" + y2="168.2903" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3289" + id="linearGradient3360" + gradientUnits="userSpaceOnUse" + x1="224.26379" + y1="259.7438" + x2="172.07999" + y2="66.61824" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3193" + id="linearGradient2641" + gradientUnits="userSpaceOnUse" + x1="175.13184" + y1="259.03506" + x2="226.90887" + y2="65.800499" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3308" + id="linearGradient3364" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(-1.1122783,-0.2980341,0.2980341,-1.1122783,558.73494,665.96877)" + x1="160.2529" + y1="-5.1353641" + x2="224.82684" + y2="168.2903" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3289" + id="linearGradient3366" + gradientUnits="userSpaceOnUse" + x1="224.26379" + y1="259.7438" + x2="172.07999" + y2="66.61824" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3193" + id="linearGradient3368" + gradientUnits="userSpaceOnUse" + x1="175.13184" + y1="259.03506" + x2="226.90887" + y2="65.800499" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3308" + id="linearGradient2646" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(-1.1122783,-0.2980341,0.2980341,-1.1122783,747.63347,397.26819)" + x1="160.2529" + y1="-5.1353641" + x2="224.82684" + y2="168.2903" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3289" + id="linearGradient3372" + gradientUnits="userSpaceOnUse" + x1="224.26379" + y1="259.7438" + x2="172.07999" + y2="66.61824" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3193" + id="linearGradient3374" + gradientUnits="userSpaceOnUse" + x1="175.13184" + y1="259.03506" + x2="226.90887" + y2="65.800499" /> + <linearGradient + y2="13.920053" + x2="6.8378897" + y1="12.625902" + x1="2.0651877" + gradientTransform="matrix(-1,0,0,1,32.04188,-2.86473)" + gradientUnits="userSpaceOnUse" + id="linearGradient2809" + xlink:href="#linearGradient4269" + inkscape:collect="always" /> + <linearGradient + y2="11.597325" + x2="7.1114841" + y1="15.912388" + x1="7.8517423" + gradientTransform="translate(0.426158,-2.762136)" + gradientUnits="userSpaceOnUse" + id="linearGradient2807" + xlink:href="#linearGradient4269" + inkscape:collect="always" /> + <linearGradient + y2="13.35532" + x2="23.888865" + y1="11.264216" + x1="31.692968" + gradientTransform="translate(-0.947018,-0.885198)" + gradientUnits="userSpaceOnUse" + id="linearGradient2805" + xlink:href="#linearGradient4183" + inkscape:collect="always" /> + <linearGradient + y2="12.115559" + x2="-0.68574232" + y1="12.115559" + x1="10.57493" + gradientTransform="translate(1.262691,-1.100752)" + gradientUnits="userSpaceOnUse" + id="linearGradient2803" + xlink:href="#linearGradient4183" + inkscape:collect="always" /> + <linearGradient + y2="10.576721" + x2="14.013638" + y1="2.7028866" + x1="15.647213" + gradientUnits="userSpaceOnUse" + id="linearGradient2801" + xlink:href="#linearGradient4183" + inkscape:collect="always" /> + <linearGradient + id="linearGradient2795"> + <stop + style="stop-color:#26b000;stop-opacity:1;" + offset="0" + id="stop2797" /> + <stop + style="stop-color:#26b000;stop-opacity:0;" + offset="1" + id="stop2799" /> + </linearGradient> + <linearGradient + id="linearGradient2789"> + <stop + id="stop2791" + offset="0" + style="stop-color:#26b000;stop-opacity:1;" /> + <stop + id="stop2793" + offset="1" + style="stop-color:#145f00;stop-opacity:1;" /> + </linearGradient> + <linearGradient + id="linearGradient2783"> + <stop + style="stop-color:#80000e;stop-opacity:1;" + offset="0" + id="stop2785" /> + <stop + style="stop-color:#b00014;stop-opacity:0;" + offset="1" + id="stop2787" /> + </linearGradient> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient4183" + id="linearGradient2781" + x1="1.0046476" + y1="12.825893" + x2="7.9239235" + y2="12.825893" + gradientUnits="userSpaceOnUse" + gradientTransform="translate(1.262691,-1.100752)" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient4183" + id="linearGradient2779" + x1="24.397505" + y1="12.535715" + x2="31.31678" + y2="12.535715" + gradientUnits="userSpaceOnUse" + gradientTransform="translate(-0.947018,-0.885198)" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient4183" + id="linearGradient2777" + x1="15.647213" + y1="2.7028866" + x2="14.013638" + y2="10.576721" + gradientUnits="userSpaceOnUse" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient4269" + id="linearGradient2775" + x1="2.0651877" + y1="12.625902" + x2="6.8378897" + y2="13.920053" + gradientUnits="userSpaceOnUse" + gradientTransform="translate(0.426158,-2.762136)" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient4269" + id="linearGradient2773" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(-1,0,0,1,32.04188,-2.86473)" + x1="2.0651877" + y1="12.625902" + x2="6.8378897" + y2="13.920053" /> + <linearGradient + gradientTransform="matrix(0.875025,0,0,0.875025,0.666703,0.177907)" + gradientUnits="userSpaceOnUse" + y2="22.512505" + x2="27.5625" + y1="6.7288713" + x1="16.826796" + id="linearGradient2771" + xlink:href="#linearGradient4183" + inkscape:collect="always" /> + <linearGradient + id="linearGradient2765"> + <stop + id="stop2767" + offset="0" + style="stop-color:#80000e;stop-opacity:1;" /> + <stop + id="stop2769" + offset="1" + style="stop-color:#b00014;stop-opacity:0;" /> + </linearGradient> + <linearGradient + id="linearGradient2759"> + <stop + style="stop-color:#1db000;stop-opacity:1;" + offset="0" + id="stop2761" /> + <stop + style="stop-color:#0f5f00;stop-opacity:1;" + offset="1" + id="stop2763" /> + </linearGradient> + <linearGradient + id="linearGradient2753"> + <stop + id="stop2755" + offset="0" + style="stop-color:#1db000;stop-opacity:1;" /> + <stop + id="stop2757" + offset="1" + style="stop-color:#1db000;stop-opacity:0;" /> + </linearGradient> + <linearGradient + id="linearGradient2747"> + <stop + id="stop2749" + offset="0" + style="stop-color:#ffffff;stop-opacity:0" /> + <stop + id="stop2751" + offset="1" + style="stop-color:#fcfbcb;stop-opacity:1" /> + </linearGradient> + <linearGradient + id="linearGradient3362"> + <stop + id="stop3364" + offset="0" + style="stop-color:#000000;stop-opacity:1;" /> + <stop + id="stop3366" + offset="1" + style="stop-color:#ffffff;stop-opacity:1;" /> + </linearGradient> + <linearGradient + id="linearGradient3370"> + <stop + id="stop3372" + offset="0" + style="stop-color:#d7d7d7;stop-opacity:1;" /> + <stop + id="stop3374" + offset="1" + style="stop-color:#7c7c7c;stop-opacity:1;" /> + </linearGradient> + <inkscape:perspective + id="perspective4283" + inkscape:persp3d-origin="8 : 5.3333333 : 1" + inkscape:vp_z="16 : 8 : 1" + inkscape:vp_y="0 : 1000 : 0" + inkscape:vp_x="0 : 8 : 1" + sodipodi:type="inkscape:persp3d" /> + <linearGradient + gradientUnits="userSpaceOnUse" + y2="16.739393" + x2="32.578228" + y1="-0.80084854" + x1="2.965755" + id="linearGradient2439" + xlink:href="#linearGradient2433" + inkscape:collect="always" /> + <linearGradient + id="linearGradient2433" + inkscape:collect="always"> + <stop + id="stop2435" + offset="0" + style="stop-color:#008000;stop-opacity:1;" /> + <stop + id="stop2437" + offset="1" + style="stop-color:#008000;stop-opacity:0;" /> + </linearGradient> + <linearGradient + y2="10.576721" + x2="14.013638" + y1="2.7028866" + x1="15.647213" + gradientUnits="userSpaceOnUse" + id="linearGradient2734" + xlink:href="#linearGradient4183" + inkscape:collect="always" /> + <linearGradient + y2="12.115559" + x2="-0.68574232" + y1="12.115559" + x1="10.57493" + gradientTransform="translate(1.262691,-1.100752)" + gradientUnits="userSpaceOnUse" + id="linearGradient2732" + xlink:href="#linearGradient4183" + inkscape:collect="always" /> + <linearGradient + y2="13.35532" + x2="23.888865" + y1="11.264216" + x1="31.692968" + gradientTransform="translate(-0.947018,-0.885198)" + gradientUnits="userSpaceOnUse" + id="linearGradient2730" + xlink:href="#linearGradient4183" + inkscape:collect="always" /> + <linearGradient + y2="11.597325" + x2="7.1114841" + y1="15.912388" + x1="7.8517423" + gradientTransform="translate(0.426158,-2.762136)" + gradientUnits="userSpaceOnUse" + id="linearGradient2728" + xlink:href="#linearGradient4269" + inkscape:collect="always" /> + <linearGradient + y2="13.920053" + x2="6.8378897" + y1="12.625902" + x1="2.0651877" + gradientTransform="matrix(-1,0,0,1,32.04188,-2.86473)" + gradientUnits="userSpaceOnUse" + id="linearGradient2726" + xlink:href="#linearGradient4269" + inkscape:collect="always" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3289" + id="linearGradient2538" + gradientUnits="userSpaceOnUse" + x1="224.26379" + y1="259.7438" + x2="172.07999" + y2="66.61824" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3193" + id="linearGradient2540" + gradientUnits="userSpaceOnUse" + x1="175.13184" + y1="259.03506" + x2="226.90887" + y2="65.800499" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3169" + id="linearGradient2542" + gradientUnits="userSpaceOnUse" + x1="192.86734" + y1="118.36168" + x2="189.20502" + y2="355.44769" /> + </defs> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="8" + inkscape:cx="-0.008255" + inkscape:cy="-5.4508769" + inkscape:document-units="px" + inkscape:current-layer="layer1" + width="32px" + height="32px" + showguides="true" + inkscape:guide-bbox="true" + inkscape:window-width="1014" + inkscape:window-height="774" + inkscape:window-x="415" + inkscape:window-y="57" + 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 + sodipodi:type="arc" + style="fill:url(#radialGradient4051);fill-opacity:1;stroke:none;stroke-width:5.69999981;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="path3162" + sodipodi:cx="19.285715" + sodipodi:cy="9.8571424" + sodipodi:rx="8.0357141" + sodipodi:ry="8.0357141" + d="M 27.321429,9.8571424 A 8.0357141,8.0357141 0 1 1 11.250001,9.8571424 A 8.0357141,8.0357141 0 1 1 27.321429,9.8571424 z" + transform="matrix(0.723409,0,0,0.723409,6.772732,3.51761)" /> + <path + sodipodi:type="arc" + style="fill:url(#linearGradient2538);fill-opacity:1;stroke:none" + id="path3209" + sodipodi:cx="201.02036" + sodipodi:cy="162.41779" + sodipodi:rx="100.0051" + sodipodi:ry="100.0051" + d="M 301.02545,162.41779 A 100.0051,100.0051 0 1 1 101.01526,162.41779 A 100.0051,100.0051 0 1 1 301.02545,162.41779 z" + transform="matrix(-6.9153073e-2,6.9214053e-2,-6.7315028e-2,-6.5348954e-2,37.191581,8.4593329)" /> + <path + sodipodi:type="arc" + style="opacity:0.24886876;fill:url(#linearGradient2540);fill-opacity:1;stroke:none" + id="path3201" + sodipodi:cx="201.02036" + sodipodi:cy="162.41779" + sodipodi:rx="100.0051" + sodipodi:ry="100.0051" + d="M 301.02545,162.41779 A 100.0051,100.0051 0 1 1 101.01526,162.41779 A 100.0051,100.0051 0 1 1 301.02545,162.41779 z" + transform="matrix(2.151327e-2,-7.5958959e-2,7.6170112e-2,1.8032561e-2,-4.3387374,24.099422)" /> + <path + sodipodi:type="arc" + style="opacity:0.59728507;fill:url(#linearGradient2542);fill-opacity:1;stroke:none" + id="path3295" + sodipodi:cx="201.02036" + sodipodi:cy="162.41779" + sodipodi:rx="78.284782" + sodipodi:ry="79.05574" + d="M 279.30514,162.41779 A 78.284782,79.05574 0 1 1 122.73557,162.41779 A 78.284782,79.05574 0 1 1 279.30514,162.41779 z" + transform="matrix(-6.9153073e-2,6.9214053e-2,-6.7315028e-2,-6.5348954e-2,37.191581,8.4593329)" /> + </g> +</svg> diff --git a/sflphone-client-kde/src/icons/remove.png b/sflphone-client-kde/src/icons/remove.png index b2cc9be41452c0b0690ec99fb3159ea031645b23..5a4d15b7baaf3a4d255430be6d2c0423379f0f9c 100644 Binary files a/sflphone-client-kde/src/icons/remove.png and b/sflphone-client-kde/src/icons/remove.png differ diff --git a/sflphone-client-kde/src/icons/sflphone-kde3.svg b/sflphone-client-kde/src/icons/sflphone-kde3.svg new file mode 100644 index 0000000000000000000000000000000000000000..0ed1dac97cf3574547fe8d6c634dd94bde1e9b2c --- /dev/null +++ b/sflphone-client-kde/src/icons/sflphone-kde3.svg @@ -0,0 +1,398 @@ +<?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="120" + height="120" + id="svg5875" + sodipodi:version="0.32" + inkscape:version="0.46" + version="1.0" + sodipodi:docname="sflphone-kde3.svg" + inkscape:output_extension="org.inkscape.output.svg.inkscape"> + <defs + id="defs5877"> + <linearGradient + id="grad2" + gradientUnits="userSpaceOnUse" + x1="10" + y1="10" + x2="300" + y2="400"> + <stop + stop-color="#fffff2" + offset="0" + id="stop24" + style="stop-color:#255a5f;stop-opacity:1;" /> + <stop + stop-color="#b1b3b2" + offset="1" + id="stop26" + style="stop-color:#152d32;stop-opacity:1;" /> + </linearGradient> + <linearGradient + inkscape:collect="always" + id="linearGradient3803"> + <stop + style="stop-color:#ffffff;stop-opacity:1;" + offset="0" + id="stop3805" /> + <stop + style="stop-color:#ffffff;stop-opacity:0;" + offset="1" + id="stop3807" /> + </linearGradient> + <linearGradient + id="linearGradient4684"> + <stop + style="stop-color:#ffffff;stop-opacity:1;" + offset="0" + id="stop4686" /> + <stop + style="stop-color:#ffffff;stop-opacity:0;" + offset="1" + id="stop4688" /> + </linearGradient> + <linearGradient + inkscape:collect="always" + id="linearGradient4669"> + <stop + style="stop-color:#ffffff;stop-opacity:1;" + offset="0" + id="stop4671" /> + <stop + style="stop-color:#ffffff;stop-opacity:0;" + offset="1" + id="stop4673" /> + </linearGradient> + <linearGradient + inkscape:collect="always" + id="linearGradient3859"> + <stop + style="stop-color:#ffffff;stop-opacity:1;" + offset="0" + id="stop3861" /> + <stop + style="stop-color:#ffffff;stop-opacity:0;" + offset="1" + id="stop3863" /> + </linearGradient> + <linearGradient + id="linearGradient5850"> + <stop + style="stop-color:#b6bfc0;stop-opacity:1;" + offset="0" + id="stop5852" /> + <stop + style="stop-color:#324549;stop-opacity:1;" + offset="1" + id="stop5854" /> + </linearGradient> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient5850" + id="linearGradient5856" + x1="476.3125" + y1="439.0293" + x2="477.3125" + y2="514.42188" + gradientUnits="userSpaceOnUse" /> + <linearGradient + inkscape:collect="always" + id="linearGradient4999"> + <stop + style="stop-color:#ffffff;stop-opacity:1;" + offset="0" + id="stop5001" /> + <stop + style="stop-color:#ffffff;stop-opacity:0;" + offset="1" + id="stop5003" /> + </linearGradient> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient4999" + id="linearGradient5862" + gradientUnits="userSpaceOnUse" + x1="698.38525" + y1="245.5472" + x2="702.81964" + y2="977.78302" /> + <linearGradient + inkscape:collect="always" + id="linearGradient4991"> + <stop + style="stop-color:#ffffff;stop-opacity:1;" + offset="0" + id="stop4993" /> + <stop + style="stop-color:#ffffff;stop-opacity:0;" + offset="1" + id="stop4995" /> + </linearGradient> + <radialGradient + inkscape:collect="always" + xlink:href="#linearGradient4991" + id="radialGradient4997" + cx="736.5" + cy="640.93073" + fx="736.5" + fy="640.93073" + r="91.964203" + gradientTransform="matrix(1,0,0,0.8097086,0,99.14184)" + gradientUnits="userSpaceOnUse" /> + <inkscape:perspective + sodipodi:type="inkscape:persp3d" + inkscape:vp_x="0 : 526.18109 : 1" + inkscape:vp_y="0 : 1000 : 0" + inkscape:vp_z="744.09448 : 526.18109 : 1" + inkscape:persp3d-origin="372.04724 : 350.78739 : 1" + id="perspective5883" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3859" + id="linearGradient3873" + x1="352.19498" + y1="451.55289" + x2="106.34038" + y2="658.39594" + gradientUnits="userSpaceOnUse" + gradientTransform="translate(-3.8268196,-1.7394634)" /> + <inkscape:perspective + id="perspective2422" + inkscape:persp3d-origin="372.04724 : 350.78739 : 1" + inkscape:vp_z="744.09448 : 526.18109 : 1" + inkscape:vp_y="0 : 1000 : 0" + inkscape:vp_x="0 : 526.18109 : 1" + sodipodi:type="inkscape:persp3d" /> + <inkscape:perspective + id="perspective2437" + inkscape:persp3d-origin="168.5 : 109.33333 : 1" + inkscape:vp_z="337 : 164 : 1" + inkscape:vp_y="0 : 1000 : 0" + inkscape:vp_x="0 : 164 : 1" + sodipodi:type="inkscape:persp3d" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient4669" + id="linearGradient4675" + x1="-20.657925" + y1="-244.41351" + x2="184.57913" + y2="789.61469" + gradientUnits="userSpaceOnUse" + spreadMethod="pad" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient4684" + id="linearGradient4690" + x1="52.987782" + y1="-84.148399" + x2="127.02813" + y2="99.500687" + gradientUnits="userSpaceOnUse" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient4669" + id="linearGradient5149" + gradientUnits="userSpaceOnUse" + spreadMethod="pad" + x1="-20.657925" + y1="-244.41351" + x2="184.57913" + y2="789.61469" /> + <radialGradient + inkscape:collect="always" + xlink:href="#linearGradient4991" + id="radialGradient5297" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(1,0,0,0.8097086,0,99.14184)" + cx="736.5" + cy="640.93073" + fx="736.5" + fy="640.93073" + r="91.964203" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient4684" + id="linearGradient5301" + gradientUnits="userSpaceOnUse" + x1="52.987782" + y1="-84.148399" + x2="127.02813" + y2="99.500687" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient4684" + id="linearGradient5308" + gradientUnits="userSpaceOnUse" + x1="52.987782" + y1="-84.148399" + x2="127.02813" + y2="99.500687" + gradientTransform="matrix(0.6453907,0,0,0.6453907,0.8651337,0.4352828)" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3803" + id="linearGradient2467" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(0.7300001,0,0,0.7313046,16.60542,9.8704199)" + x1="12.663443" + y1="8.5301828" + x2="41.858654" + y2="57.533279" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient5850" + id="linearGradient3306" + x1="-0.0042728526" + y1="60.004089" + x2="119.99559" + y2="60.004089" + gradientUnits="userSpaceOnUse" /> + </defs> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + gridtolerance="10000" + guidetolerance="10" + objecttolerance="10" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="5.2666667" + inkscape:cx="25.253165" + inkscape:cy="60" + inkscape:document-units="px" + inkscape:current-layer="layer4" + showgrid="false" + inkscape:window-width="1440" + inkscape:window-height="840" + inkscape:window-x="-5" + inkscape:window-y="-3" + showguides="true" + inkscape:guide-bbox="true" /> + <metadata + id="metadata5880"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title>Icône SFL</dc:title> + <dc:date>2009-04-29</dc:date> + <dc:creator> + <cc:Agent> + <dc:title>Jérôme Oufella</dc:title> + </cc:Agent> + </dc:creator> + <dc:rights> + <cc:Agent> + <dc:title>(c) 2009 Savoir-faire Linux inc.</dc:title> + </cc:Agent> + </dc:rights> + <dc:subject> + <rdf:Bag> + <rdf:li>sfl icon</rdf:li> + </rdf:Bag> + </dc:subject> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:groupmode="layer" + id="layer4" + inkscape:label="KDE"> + <path + style="fill:url(#linearGradient3306);fill-opacity:1.0;stroke:#000000;stroke-width:0.43601421000000001;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline" + id="path3759" + d="M 49.399731,23.834947 L 23.236962,5.2261919 L 14.079999,14.399521 L 31.085795,39.298567 L 0.21373425,45.850948 L 0.21373425,58.95571 L 31.609054,64.721807 L 12.771859,91.19343 L 22.19046,101.15304 L 48.353221,82.020086 L 53.585773,114.78199 L 67.190417,114.78199 L 72.422967,81.758 L 98.847362,101.15304 L 108.00433,90.931334 L 96.492714,75.205614 L 96.492714,62.625038 L 119.77758,58.95571 L 119.77758,45.326754 L 93.614807,40.871142 L 49.399731,23.834947 z" /> + </g> + <g + inkscape:label="Circle" + inkscape:groupmode="layer" + id="layer1" + transform="translate(-182.15973,-428.80763)" + style="display:inline"> + <g + style="stroke:#000000;stroke-width:1.46422935;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline" + id="g5868" + transform="matrix(0.4685806,0,0,0.469418,3.9985585,234.76273)"> + <path + transform="matrix(0.9959566,0,0,1.2202117,1.6861043,-136.53125)" + d="M 602,544.5 A 92.5,75.5 0 1 1 417,544.5 A 92.5,75.5 0 1 1 602,544.5 z" + sodipodi:ry="75.5" + sodipodi:rx="92.5" + sodipodi:cy="544.5" + sodipodi:cx="509.5" + id="path4987" + style="fill:#00252b;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.32822394;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + sodipodi:type="arc" /> + <path + transform="matrix(0.9200853,0,0,1.1406537,-168.51683,-66.406557)" + d="M 827,521 A 90.5,73 0 1 1 646,521 A 90.5,73 0 1 1 827,521 z" + sodipodi:ry="73" + sodipodi:rx="90.5" + sodipodi:cy="521" + sodipodi:cx="736.5" + id="path4989" + style="opacity:0.83064515;fill:url(#radialGradient5297);fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.42928278;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + sodipodi:type="arc" /> + </g> + </g> + <g + inkscape:groupmode="layer" + id="layer3" + inkscape:label="Bg logo" + style="display:inline"> + <path + style="opacity:1;fill:#006f82;fill-opacity:0;fill-rule:evenodd;stroke:#006f82;stroke-width:0.75987804;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline" + d="M 24.269414,55.306043 L 24.265589,53.559066 L 24.834649,56.397027 L 24.828429,53.558193 L 25.772552,56.322784 L 25.765382,53.047203 L 26.524922,57.195103 L 26.698662,50.862029 L 27.278888,58.795333 L 28.195752,49.112719 L 28.408703,60.686148 L 29.139077,51.513355 L 29.715946,57.918056 L 30.078259,52.021434 L 30.656242,58.93567 L 31.008828,48.598823 L 32.164163,62.136134 L 31.751471,45.030914 L 33.860016,65.481879 L 33.252701,45.174166 L 34.986485,65.844081 L 34.189166,44.444803 L 35.351036,60.966532 L 35.703147,50.411306 L 36.288782,60.819496 L 37.011017,47.934387 L 37.034932,58.852976 L 37.942713,45.021306 L 37.790963,61.399495 L 38.69699,46.767115 L 39.113183,65.473724 L 40.190405,43.343625 L 40.430465,67.291457 L 41.310663,40.866995 L 41.747099,68.818013 L 42.432358,39.045481 L 42.875179,69.908111 L 43.368356,38.097749 L 44.380064,71.725561 L 44.314076,41.590243 L 45.124301,68.885567 L 45.447248,45.009656 L 46.05536,65.68132 L 46.39296,48.502152 L 47.36482,63.932305 L 47.520235,49.228308 L 48.114794,63.712772 L 48.647671,50.027259 L 49.424104,61.890976 L 49.024012,50.536212 L 50.548509,61.306898 L 50.153039,52.063068 L 51.289239,56.865501 L 51.573112,34.595747 L 52.602212,56.717884 L 52.72002,31.320937 L 53.352985,56.8623 L 54.4154,34.452156 L 54.535786,69.977754 L 55.538048,33.065679 L 56.010847,71.138412 L 56.32646,30.949249 L 57.680835,75.6416 L 57.436827,30.437989 L 58.796273,77.447269 L 58.891788,28.904134 L 59.780757,79.190159 L 59.669515,28.391256 L 60.895763,80.79707 L 60.795197,28.389508 L 62.602145,82.470317 L 62.707511,44.910071 L 63.389596,79.915877 L 63.275931,47.456871 L 65.025017,81.596924 L 64.216069,48.401694 L 64.936934,81.666009 L 63.797008,28.384851 L 66.752922,80.129457 L 64.549374,29.257172 L 67.702951,79.106344 L 66.296441,30.056015 L 69.375835,78.447356 L 69.054005,30.123669 C 69.054005,30.123669 70.292683,81.730492 70.667118,81.365947 C 71.041541,81.001411 71.494088,30.629418 71.494088,30.629418 L 71.599115,78.590338 L 72.434871,31.865403 L 72.550094,78.005256 L 73.373888,32.300691 L 73.486098,77.062228 L 74.692441,34.700745 L 74.969531,75.564596 L 76.196373,36.081435 L 76.288393,71.620749 L 77.16746,38.193425 L 77.955163,61.689577 L 78.672518,40.086214 L 79.266706,60.884704 L 80.727648,42.632841 L 81.518077,67.368131 L 81.873148,45.191123 L 82.856563,65.904697 L 83.160251,46.200942 L 84.164288,63.35541 L 84.504322,47.289864 L 85.992736,61.027533 L 85.837244,49.763541 L 87.162905,61.896214 L 87.340704,50.926716 L 89.338495,59.715091 L 89.405696,51.501569 L 90.908146,60.080876 L 90.9658,52.590582 L 92.228772,56.939847 L 92.51786,50.028538 L 93.053091,58.253079 L 93.549747,53.964902 C 93.549747,53.964902 94.348509,56.570899 94.347711,56.206945 C 94.346905,55.842996 95.441521,54.614524 95.252446,53.959695 C 95.063406,53.304876 96.049154,55.627097 96.049154,55.627097" + id="path4922" + sodipodi:nodetypes="ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccscccccccccccccccccccccccccccccccccccc" /> + </g> + <g + inkscape:groupmode="layer" + id="layer2" + inkscape:label="Handset" + style="display:inline"> + <path + style="opacity:0.07000002;fill:url(#linearGradient5308);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:12.29699993;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline" + d="M 59.151985,7.5345809 C 30.967536,8.249433 8.3274641,31.354675 8.3274641,59.710388 C 8.3274641,68.222065 10.375495,76.246983 13.994802,83.347823 C 13.107834,79.536662 12.643515,75.568677 12.643515,71.488769 C 12.643515,42.682964 36.013519,19.292793 64.819322,19.292793 C 85.110516,19.292792 102.69706,30.904841 111.32779,47.831165 C 105.9454,24.743656 85.222311,7.5345809 60.503272,7.5345809 C 60.05318,7.5345809 59.599356,7.5232342 59.151985,7.5345809 z" + id="path4679" /> + <path + id="path3760" + d="M 81.158953,78.602474 C 80.907062,79.267411 78.297731,81.739228 77.080298,82.466192 L 75.734467,83.269821 L 70.19711,76.040674 L 64.659747,68.81154 L 65.612885,67.821768 C 66.545671,66.853122 69.344541,64.971511 70.254384,64.7014 C 70.649405,64.584124 71.445432,65.521281 75.986723,71.450035 C 78.887208,75.236678 81.214717,78.455276 81.158953,78.602474 z M 53.443335,42.536566 C 53.235206,43.085972 49.942427,45.898109 48.869301,46.442933 L 47.894331,46.937913 L 42.436726,39.684409 L 36.979115,32.430901 L 38.858215,30.878136 C 39.891724,30.024114 41.247019,29.114601 41.869981,28.856992 L 43.002641,28.388615 L 48.288561,35.289494 C 51.832682,39.916418 53.531268,42.304447 53.443335,42.536566 z M 74.755009,83.94288 C 74.719994,84.035155 74.109865,84.406419 73.399171,84.767912 C 67.814112,87.608738 58.837701,84.264656 50.38701,76.194977 C 47.395895,73.338706 41.225707,65.687258 38.788201,61.811658 C 34.084316,54.33255 31.872218,48.053421 31.937419,42.365446 C 31.978111,38.815674 33.141074,35.82051 35.226501,33.894514 L 35.94157,33.234109 L 41.426871,40.288347 L 46.912177,47.342587 L 46.468528,48.112402 C 45.855734,49.175698 45.966579,50.570272 46.83254,52.692135 C 47.919362,55.355161 56.541955,66.606458 58.855254,68.380119 C 60.673127,69.773925 61.791471,70.180827 63.135585,69.937494 L 64.087387,69.765183 L 69.45303,76.77015 C 72.404134,80.622878 74.790029,83.850605 74.755009,83.94288 z" + style="opacity:0.32000002;fill:#000000;fill-opacity:1" /> + <path + style="fill:#dfdfdf;fill-opacity:1" + d="M 83.78083,75.975916 C 83.528937,76.640844 80.919608,79.112669 79.702175,79.839633 L 78.356344,80.643263 L 72.818986,73.414115 L 67.281622,66.184978 L 68.234762,65.195207 C 69.167547,64.226562 71.966417,62.344949 72.876259,62.074839 C 73.27128,61.957563 74.067308,62.89472 78.608599,68.823473 C 81.509083,72.610116 83.836592,75.828717 83.78083,75.975916 z M 56.065211,39.910005 C 55.857081,40.459411 52.564302,43.271547 51.491178,43.816372 L 50.516207,44.311351 L 45.058601,37.057848 L 39.600992,29.804341 L 41.48009,28.251574 C 42.513599,27.397552 43.868894,26.488039 44.491857,26.230431 L 45.624516,25.762054 L 50.910436,32.662932 C 54.454557,37.289857 56.153144,39.677886 56.065211,39.910005 z M 77.376885,81.316321 C 77.34187,81.408597 76.731742,81.779852 76.021048,82.141345 C 70.435989,84.98217 61.459576,81.638098 53.008885,73.568413 C 50.017771,70.712145 43.847583,63.060697 41.410079,59.185096 C 36.706192,51.705989 34.494094,45.42686 34.559295,39.738884 C 34.599987,36.189113 35.762951,33.19395 37.848377,31.267953 L 38.563446,30.607547 L 44.048748,37.661787 L 49.534052,44.716027 L 49.090405,45.485841 C 48.477611,46.549138 48.588456,47.94371 49.454417,50.065574 C 50.541236,52.7286 59.163831,63.979897 61.477129,65.753557 C 63.295004,67.147364 64.413348,67.554266 65.75746,67.310933 L 66.709263,67.13862 L 72.074905,74.143586 C 75.026011,77.996319 77.411904,81.224046 77.376885,81.316321 z" + id="path3218" /> + <g + transform="matrix(0.6018652,0,0,0.6018652,-106.46243,-252.67476)" + id="g3787" + style="fill:#ffffff;fill-opacity:0"> + <path + id="path3789" + d="M 324.6064,576.10592 C 324.02996,577.62486 318.05867,583.27138 315.27265,584.93202 L 312.1928,586.7678 L 299.5209,570.25386 L 286.84899,553.73994 L 289.03019,551.47895 C 291.16481,549.26622 297.56985,544.96795 299.65197,544.35092 C 300.55595,544.08302 302.37761,546.22382 312.77007,559.7672 C 319.40765,568.41724 324.73401,575.76967 324.6064,576.10592 z M 261.18093,493.71856 C 260.70464,494.9736 253.16932,501.39752 250.71354,502.64209 L 248.48238,503.7728 L 235.99299,487.20322 L 223.50359,470.63363 L 227.80379,467.08656 C 230.16891,465.13567 233.27042,463.05802 234.69603,462.46955 L 237.28805,461.39961 L 249.38455,477.16367 C 257.49505,487.73321 261.38216,493.18832 261.18093,493.71856 z M 309.95137,588.3053 C 309.87124,588.51609 308.475,589.36418 306.84862,590.18996 C 294.06756,596.67941 273.5256,589.04036 254.18672,570.60633 C 247.34174,564.0816 233.22165,546.60297 227.64357,537.74972 C 216.87902,520.66478 211.81677,506.32102 211.96598,493.32766 C 212.0591,485.21872 214.72047,478.3767 219.49284,473.97704 L 221.12923,472.46844 L 233.682,488.58283 L 246.23478,504.69722 L 245.21952,506.45575 C 243.81718,508.8847 244.07084,512.0704 246.05254,516.91749 C 248.53966,523.00079 268.27193,548.70275 273.56577,552.75442 C 277.72586,555.93837 280.28512,556.86788 283.36104,556.31202 L 285.53918,555.9184 L 297.81812,571.92023 C 304.57154,580.72124 310.03151,588.09451 309.95137,588.3053 z" + style="opacity:0.32000002;fill:#ffffff;fill-opacity:0" /> + <path + style="fill:#ffffff;fill-opacity:0" + d="M 330.6064,570.10592 C 330.02996,571.62486 324.05867,577.27138 321.27265,578.93202 L 318.1928,580.7678 L 305.5209,564.25386 L 292.84899,547.73994 L 295.03019,545.47895 C 297.16481,543.26622 303.56985,538.96795 305.65197,538.35092 C 306.55595,538.08302 308.37761,540.22382 318.77007,553.7672 C 325.40765,562.41724 330.73401,569.76967 330.6064,570.10592 z M 267.18093,487.71856 C 266.70464,488.9736 259.16932,495.39752 256.71354,496.64209 L 254.48238,497.7728 L 241.99299,481.20322 L 229.50359,464.63363 L 233.80379,461.08656 C 236.16891,459.13567 239.27042,457.05802 240.69603,456.46955 L 243.28805,455.39961 L 255.38455,471.16367 C 263.49505,481.73321 267.38216,487.18832 267.18093,487.71856 z M 315.95137,582.3053 C 315.87124,582.51609 314.475,583.36418 312.84862,584.18996 C 300.06756,590.67941 279.5256,583.04036 260.18672,564.60633 C 253.34174,558.0816 239.22165,540.60297 233.64357,531.74972 C 222.87902,514.66478 217.81677,500.32102 217.96598,487.32766 C 218.0591,479.21872 220.72047,472.3767 225.49284,467.97704 L 227.12923,466.46844 L 239.682,482.58283 L 252.23478,498.69722 L 251.21952,500.45575 C 249.81718,502.8847 250.07084,506.0704 252.05254,510.91749 C 254.53966,517.00079 274.27193,542.70275 279.56577,546.75442 C 283.72586,549.93837 286.28512,550.86788 289.36104,550.31202 L 291.53918,549.9184 L 303.81812,565.92023 C 310.57154,574.72124 316.03151,582.09451 315.95137,582.3053 z" + id="path3791" /> + </g> + <path + style="fill:url(#linearGradient2467);fill-opacity:1;stroke:none" + d="M 45.622921,25.753442 L 44.482296,26.23336 C 43.859333,26.490968 42.504554,27.390425 41.471046,28.244448 L 39.600421,29.79847 L 45.052609,37.065809 L 47.949796,40.905158 C 49.159836,38.558294 50.620138,36.398296 52.261359,34.437684 C 51.823129,33.858308 51.431835,33.329317 50.915422,32.655129 L 45.622921,25.753442 z M 38.573858,30.598335 L 37.843858,31.261079 C 35.75843,33.187075 34.599549,36.189871 34.558859,39.739642 C 34.493656,45.427618 36.698723,51.708667 41.402609,59.187772 C 42.046814,60.212049 42.965177,61.496473 44.003234,62.890002 C 43.849172,61.472837 43.752296,60.03475 43.752296,58.570734 C 43.752296,52.584766 45.064211,46.936314 47.402296,42.002115 L 44.048859,37.659994 L 38.573858,30.598335 z" + id="path3798" /> + </g> +</svg> diff --git a/sflphone-client-kde/src/icons/sflphone.png b/sflphone-client-kde/src/icons/sflphone.png deleted file mode 100644 index 50c1483ac152972fa6d993b6823b5d247dd258bc..0000000000000000000000000000000000000000 Binary files a/sflphone-client-kde/src/icons/sflphone.png and /dev/null differ diff --git a/sflphone-client-kde/src/instance_interface_singleton.h b/sflphone-client-kde/src/instance_interface_singleton.h index 25b25f2ec29a1c78ef02733c4c91e3e65ff6103c..8868b4ff30d0927d872346ccf96c81b5aa1af8e3 100644 --- a/sflphone-client-kde/src/instance_interface_singleton.h +++ b/sflphone-client-kde/src/instance_interface_singleton.h @@ -26,7 +26,7 @@ #include "instance_dbus_interface.h" /** - @author Jérémy Quentin <jeremy.quentin@gmail.com> + @author Jérémy Quentin <jeremy.quentin@savoirfairelinux.com> */ class InstanceInterfaceSingleton { diff --git a/sflphone-client-kde/src/main.cpp b/sflphone-client-kde/src/main.cpp index e968c54774fbcc5a4f63c229c5466fe3b16afe09..7e7ca8a42c091acc6e1a5ba21f8c524b6985a086 100644 --- a/sflphone-client-kde/src/main.cpp +++ b/sflphone-client-kde/src/main.cpp @@ -1,6 +1,5 @@ #include <QApplication> #include <QtCore/QString> -#include <QtGui/QCursor> #include <QtGui/QMenu> #include <QtGui/QMenuBar> #include <QtGui/QAction> @@ -10,39 +9,40 @@ #include <kaboutdata.h> #include <klocale.h> -#include "ConfigDialog.h" #include "SFLPhone.h" #include "AccountWizard.h" #include "instance_interface_singleton.h" #include "sflphone_const.h" +#include "conf/ConfigurationDialog.h" -static const char description[] = I18N_NOOP("A KDE 4 Client for SFLPhone"); +static const char description[] = "A KDE 4 Client for SFLphone"; static const char version[] = "0.9.5"; int main(int argc, char **argv) { + try { KLocale::setMainCatalog("sflphone-client-kde"); - qDebug() << KLocale::defaultLanguage(); - qDebug() << KLocale::defaultCountry(); KAboutData about( "sflphone-client-kde", 0, - ki18n("SFLPhone KDE Client"), + ki18n("SFLphone KDE Client"), version, ki18n(description), - KAboutData::License_GPL, - ki18n("(C) 2009 Jérémy Quentin"), + KAboutData::License_GPL_V3, + ki18n("(C) 2009 Savoir-faire Linux"), KLocalizedString(), - 0, - "jeremy.quentin@savoirfairelinux.com"); + "http://www.sflphone.org.", + "sflphone@lists.savoirfairelinux.net"); - about.addAuthor( ki18n("Jérémy Quentin"), KLocalizedString(), "jeremy.quentin@gmail.com" ); + about.addAuthor( ki18n("Jérémy Quentin"), KLocalizedString(), "jeremy.quentin@savoirfairelinux.com" ); + about.setProgramIconName(ICON_SFLPHONE); + about.setTranslator( ki18nc("NAME OF TRANSLATORS","Your names"), ki18nc("EMAIL OF TRANSLATORS","Your emails") ); KCmdLineArgs::init(argc, argv, &about); KCmdLineOptions options; //options.add("+[URL]", ki18n( "Document to open" )); @@ -50,34 +50,13 @@ int main(int argc, char **argv) KApplication app; - qDebug() << KGlobal::locale()->language(); - qDebug() << KGlobal::locale()->country(); //configuration dbus registerCommTypes(); - - if(!QFile(QDir::homePath() + CONFIG_FILE_PATH).exists()) - { - (new AccountWizard())->show(); - } - - InstanceInterface & instance = InstanceInterfaceSingleton::getInstance(); - instance.Register(getpid(), APP_NAME); - SFLPhone * fenetre = new SFLPhone(); - -// QString locale = QLocale::system().name(); -// -// QTranslator qtTranslator; -// qtTranslator.load("qt_" + locale); -// app.installTranslator(&qtTranslator); -// -// QTranslator translator; -// translator.load("sflphone-client-kde_" + locale, QString(), QString(), ".po" ); -// app.installTranslator(&translator); - fenetre->move(QCursor::pos().x() - fenetre->geometry().width()/2, QCursor::pos().y() - fenetre->geometry().height()/2); - fenetre->show(); + InstanceInterface & instance = InstanceInterfaceSingleton::getInstance(); + instance.Register(getpid(), APP_NAME); return app.exec(); } diff --git a/sflphone-client-kde/src/qrc/resources.qrc b/sflphone-client-kde/src/qrc/resources.qrc index 73424bd026acebd196e9286adf706eb2c68f6644..f0410dc28014b0658f684e46dd28af1adac1f05a 100644 --- a/sflphone-client-kde/src/qrc/resources.qrc +++ b/sflphone-client-kde/src/qrc/resources.qrc @@ -1,14 +1,11 @@ <RCC> <qresource prefix="images" > <file>../icons/sflphone.svg</file> + <file>../icons/sflphone-kde3.svg</file> <file>../icons/sflphone_notif.svg</file> - <file>../icons/application-exit.png</file> - <file>../icons/office-address-book.png</file> <file>../icons/x-office-address-book.png</file> <file>../icons/add.png</file> <file>../icons/remove.png</file> - <file>../icons/del_off.png</file> - <file>../icons/del_on.png</file> <file>../icons/accept.svg</file> <file>../icons/busy.svg</file> <file>../icons/call.svg</file> @@ -19,7 +16,6 @@ <file>../icons/history2.svg</file> <file>../icons/history.svg</file> <file>../icons/hold.svg</file> - <file>../icons/application-exit.png</file> <file>../icons/icon_accept.svg</file> <file>../icons/icon_call.svg</file> <file>../icons/icon_dialpad_off.svg</file> @@ -41,46 +37,6 @@ <file>../icons/rec_call.svg</file> <file>../icons/refuse.svg</file> <file>../icons/ring.svg</file> - <file>../icons/sflphone.png</file> - <file>../icons/speaker_25.svg</file> - <file>../icons/speaker_50.svg</file> - <file>../icons/speaker_75.svg</file> - <file>../icons/speaker.svg</file> - <file>../icons/stock_person.svg</file> - <file>../icons/transfert.svg</file> - <file>../icons/unhold.svg</file> - <file>../icons/accept.svg</file> - <file>../icons/busy.svg</file> - <file>../icons/call.svg</file> - <file>../icons/current.svg</file> - <file>../icons/dial.svg</file> - <file>../icons/fail.svg</file> - <file>../icons/hang_up.svg</file> - <file>../icons/history2.svg</file> - <file>../icons/history.svg</file> - <file>../icons/hold.svg</file> - <file>../icons/icon_accept.svg</file> - <file>../icons/icon_call.svg</file> - <file>../icons/icon_dialpad_off.svg</file> - <file>../icons/icon_dialpad.svg</file> - <file>../icons/icon_hangup.svg</file> - <file>../icons/icon_hold.svg</file> - <file>../icons/icon_rec.svg</file> - <file>../icons/icon_unhold.svg</file> - <file>../icons/icon_volume_off.svg</file> - <file>../icons/icon_volume.svg</file> - <file>../icons/incoming.svg</file> - <file>../icons/mailbox.svg</file> - <file>../icons/mic_25.svg</file> - <file>../icons/mic_50.svg</file> - <file>../icons/mic_75.svg</file> - <file>../icons/mic.svg</file> - <file>../icons/missed.svg</file> - <file>../icons/outgoing.svg</file> - <file>../icons/rec_call.svg</file> - <file>../icons/refuse.svg</file> - <file>../icons/ring.svg</file> - <file>../icons/sflphone.png</file> <file>../icons/speaker_25.svg</file> <file>../icons/speaker_50.svg</file> <file>../icons/speaker_75.svg</file> @@ -88,5 +44,10 @@ <file>../icons/stock_person.svg</file> <file>../icons/transfert.svg</file> <file>../icons/unhold.svg</file> + <file>../icons/led-red.svg</file> + <file>../icons/led-green.svg</file> + <file>../icons/led-gray.svg</file> + <file>../icons/record.svg</file> + <file>../icons/record_disabled.svg</file> </qresource> </RCC> diff --git a/sflphone-client-kde/src/sflphone_const.h b/sflphone-client-kde/src/sflphone_const.h index 3f17b89d1dede5dccce9b7a699a3fa1fd730cb71..339613bea710f93b9dfe095464a067fa7660ffa8 100644 --- a/sflphone-client-kde/src/sflphone_const.h +++ b/sflphone-client-kde/src/sflphone_const.h @@ -47,21 +47,23 @@ #define PAGE_ACCOUNTS 2 #define PAGE_AUDIO 3 +#define TOOLBAR_SIZE 22 + #define CONTACT_ITEM_HEIGHT 40 #define CONFIG_FILE_PATH "/.sflphone/sflphonedrc" -#define ACTION_LABEL_CALL tr2i18n("Call") -#define ACTION_LABEL_HANG_UP tr2i18n("Hang up") -#define ACTION_LABEL_HOLD tr2i18n("Hold") -#define ACTION_LABEL_TRANSFER tr2i18n("Transfer") -#define ACTION_LABEL_RECORD tr2i18n("Record") -#define ACTION_LABEL_ACCEPT tr2i18n("Accept") -#define ACTION_LABEL_REFUSE tr2i18n("Refuse") -#define ACTION_LABEL_UNHOLD tr2i18n("Unhold") -#define ACTION_LABEL_GIVE_UP_TRANSF tr2i18n("Give up transfer") -#define ACTION_LABEL_CALL_BACK tr2i18n("Call back") -#define ACTION_LABEL_GIVE_UP_SEARCH tr2i18n("Give up search") +#define ACTION_LABEL_CALL i18n("Call") +#define ACTION_LABEL_HANG_UP i18n("Hang up") +#define ACTION_LABEL_HOLD i18n("Hold") +#define ACTION_LABEL_TRANSFER i18n("Transfer") +#define ACTION_LABEL_RECORD i18n("Record") +#define ACTION_LABEL_ACCEPT i18n("Accept") +#define ACTION_LABEL_REFUSE i18n("Refuse") +#define ACTION_LABEL_UNHOLD i18n("Unhold") +#define ACTION_LABEL_GIVE_UP_TRANSF i18n("Give up transfer") +#define ACTION_LABEL_CALL_BACK i18n("Call back") +#define ACTION_LABEL_GIVE_UP_SEARCH i18n("Give up search") #define ICON_INCOMING ":/images/icons/ring.svg" @@ -81,8 +83,8 @@ #define ICON_ACCEPT ":/images/icons/accept.svg" #define ICON_REFUSE ":/images/icons/refuse.svg" #define ICON_EXEC_TRANSF ":/images/icons/call.svg" -#define ICON_REC_DEL_OFF ":/images/icons/del_off.png" -#define ICON_REC_DEL_ON ":/images/icons/del_on.png" +#define ICON_REC_DEL_OFF ":/images/icons/record_disabled.svg" +#define ICON_REC_DEL_ON ":/images/icons/record.svg" #define ICON_REC_VOL_0 ":/images/icons/mic.svg" #define ICON_REC_VOL_1 ":/images/icons/mic_25.svg" @@ -98,6 +100,10 @@ #define ICON_HISTORY_OUTGOING ":/images/icons/outgoing.svg" #define ICON_HISTORY_MISSED ":/images/icons/missed.svg" +#define ICON_ACCOUNT_LED_RED ":/images/icons/led-red.svg" +#define ICON_ACCOUNT_LED_GREEN ":/images/icons/led-green.svg" +#define ICON_ACCOUNT_LED_GRAY ":/images/icons/led-gray.svg" + #define ICON_QUIT ":/images/icons/application-exit.png" #define ICON_SFLPHONE ":/images/icons/sflphone.svg" @@ -144,6 +150,8 @@ #define CALL_PEER_NAME "PEER_NAME" #define CALL_PEER_NUMBER "PEER_NUMBER" #define CALL_ACCOUNTID "ACCOUNTID" +#define CALL_STATE "CALL_STATE" +#define CALL_TYPE "CALL_TYPE" /** Call States */ #define CALL_STATE_CHANGE_HUNG_UP "HUNGUP" @@ -154,6 +162,19 @@ #define CALL_STATE_CHANGE_FAILURE "FAILURE" #define CALL_STATE_CHANGE_UNHOLD_CURRENT "UNHOLD_CURRENT" #define CALL_STATE_CHANGE_UNHOLD_RECORD "UNHOLD_RECORD" +#define CALL_STATE_CHANGE_UNKNOWN "UNKNOWN" + +#define DAEMON_CALL_STATE_INIT_CURRENT "CURRENT" +#define DAEMON_CALL_STATE_INIT_HOLD "HOLD" +#define DAEMON_CALL_STATE_INIT_BUSY "BUSY" +#define DAEMON_CALL_STATE_INIT_INACTIVE "INACTIVE" + +#define DAEMON_CALL_TYPE_INCOMING "0" +#define DAEMON_CALL_TYPE_OUTGOING "1" + +#define DAEMON_HISTORY_TYPE_MISSED "0" +#define DAEMON_HISTORY_TYPE_OUTGOING "1" +#define DAEMON_HISTORY_TYPE_INCOMING "2" /** Address Book Settings */ #define ADDRESSBOOK_MAX_RESULTS "ADDRESSBOOK_MAX_RESULTS" @@ -180,8 +201,8 @@ #define CODEC_BANDWIDTH 3 /** Audio Managers */ -#define ALSA 0 -#define PULSEAUDIO 1 +#define CONST_ALSA 0 +#define CONST_PULSEAUDIO 1 diff --git a/sflphone-client-kde/src/sflphone_kdeview.cpp b/sflphone-client-kde/src/sflphone_kdeview.cpp index 46ce96c459a4550d0ef1123d170dabe8001e105d..c0366da604435618090f9ec2f19663a57ee543d3 100644 --- a/sflphone-client-kde/src/sflphone_kdeview.cpp +++ b/sflphone-client-kde/src/sflphone_kdeview.cpp @@ -45,27 +45,49 @@ #include "ContactItemWidget.h" #include "SFLPhone.h" #include "typedefs.h" +#include "Dialpad.h" using namespace KABC; -ConfigurationDialog * sflphone_kdeView::configDialog; +ConfigurationDialogKDE * sflphone_kdeView::configDialog; +AccountList * sflphone_kdeView::accountList; +QString sflphone_kdeView::priorAccountId; sflphone_kdeView::sflphone_kdeView(QWidget *parent) : QWidget(parent) { setupUi(this); + action_configureSflPhone->setIcon(KIcon("preferences-other")); + + ConfigurationManagerInterface & configurationManager = ConfigurationManagerInterfaceSingleton::getInstance(); + CallManagerInterface & callManager = CallManagerInterfaceSingleton::getInstance(); + errorWindow = new QErrorMessage(this); callList = new CallList(); + for(int i = 0 ; i < callList->size() ; i++) + { + Call * call = (*callList)[i]; + if(call->getState() == CALL_STATE_OVER) + { + addCallToCallHistory(call); + } + else + { + addCallToCallList(call); + } + } + + accountList = new AccountList(false); - configDialog = new ConfigurationDialog(this); + configDialog = new ConfigurationDialogKDE(this); + configDialog->setObjectName("configDialog"); configDialog->setModal(true); wizard = new AccountWizard(this); wizard->setModal(false); - CallManagerInterface & callManager = CallManagerInterfaceSingleton::getInstance(); connect(&callManager, SIGNAL(callStateChanged(const QString &, const QString &)), this, SLOT(on1_callStateChanged(const QString &, const QString &))); connect(&callManager, SIGNAL(incomingCall(const QString &, const QString &, const QString &)), @@ -76,6 +98,17 @@ sflphone_kdeView::sflphone_kdeView(QWidget *parent) this, SLOT(on1_voiceMailNotify(const QString &, int))); connect(&callManager, SIGNAL(volumeChanged(const QString &, double)), this, SLOT(on1_volumeChanged(const QString &, double))); + + connect(&configurationManager, SIGNAL(accountsChanged()), + accountList, SLOT(updateAccounts())); + + connect(configDialog, SIGNAL(clearCallHistoryAsked()), + callList, SLOT(clearHistory())); + + connect(accountList, SIGNAL(accountListUpdated()), + this, SLOT(updateStatusMessage())); + + accountList->updateAccounts(); QPalette pal = QPalette(palette()); pal.setColor(QPalette::AlternateBase, Qt::lightGray); @@ -85,9 +118,12 @@ sflphone_kdeView::sflphone_kdeView(QWidget *parent) loadWindow(); + emit statusMessageChanged("youhou"); } + + sflphone_kdeView::~sflphone_kdeView() { delete configDialog; @@ -96,9 +132,6 @@ sflphone_kdeView::~sflphone_kdeView() delete errorWindow; } - - - void sflphone_kdeView::loadWindow() { qDebug() << "loadWindow"; @@ -113,32 +146,26 @@ void sflphone_kdeView::loadWindow() updateVolumeControls(); updateDialpad(); updateSearchHistory(); - updateSearchAddressBook(); } -QString sflphone_kdeView::firstAccountId() -{ - Account * firstAccount = getAccountList()->firstRegisteredAccount(); - if(firstAccount == NULL) - { - return QString(); - } - return firstAccount->getAccountId(); -} -QVector<Account *> sflphone_kdeView::registeredAccounts() -{ - return getAccountList()->registeredAccounts(); -} Account * sflphone_kdeView::firstRegisteredAccount() { - return getAccountList()->firstRegisteredAccount(); + Account * priorAccount = accountList->getAccountById(priorAccountId); + if(priorAccount && priorAccount->getAccountDetail(ACCOUNT_STATUS) == ACCOUNT_STATE_REGISTERED ) + { + return priorAccount; + } + else + { + return accountList->firstRegisteredAccount(); + } } AccountList * sflphone_kdeView::getAccountList() { - return configDialog->getAccountList(); + return accountList; } QErrorMessage * sflphone_kdeView::getErrorWindow() @@ -159,23 +186,13 @@ void sflphone_kdeView::addCallToCallList(Call * call) void sflphone_kdeView::addCallToCallHistory(Call * call) { - qDebug() << "addCallToCallHistory1"; QListWidgetItem * item = call->getHistoryItem(); - qDebug() << "addCallToCallHistory2"; QWidget * widget = call->getHistoryItemWidget(); - qDebug() << "addCallToCallHistory3"; if(item && widget) { - qDebug() << "addCallToCallHistory4"; listWidget_callHistory->addItem(item); - qDebug() << "addCallToCallHistory5"; - qDebug() << "item = " << item; - qDebug() << "widget = " << widget; - qDebug() << "itemWidget(item) = " << listWidget_callHistory->itemWidget(item); listWidget_callHistory->setItemWidget(item, widget); - qDebug() << "addCallToCallHistory6"; } - qDebug() << "addCallToCallHistory7"; } void sflphone_kdeView::addContactToContactList(Contact * contact) @@ -289,11 +306,11 @@ void sflphone_kdeView::escape() int state = call->getState(); if(state == CALL_STATE_TRANSFER || state == CALL_STATE_TRANSF_HOLD) { - actionb(call, CALL_ACTION_TRANSFER); + action(call, CALL_ACTION_TRANSFER); } else { - actionb(call, CALL_ACTION_REFUSE); + action(call, CALL_ACTION_REFUSE); } } } @@ -333,7 +350,7 @@ void sflphone_kdeView::enter() int state = call->getState(); if(state == CALL_STATE_INCOMING || state == CALL_STATE_DIALING || state == CALL_STATE_TRANSFER || state == CALL_STATE_TRANSF_HOLD) { - actionb(call, CALL_ACTION_ACCEPT); + action(call, CALL_ACTION_ACCEPT); } else { @@ -345,48 +362,71 @@ void sflphone_kdeView::enter() if(stackedWidget_screen->currentWidget() == page_callHistory) { qDebug() << "In call history."; - action_history->setChecked(false); - stackedWidget_screen->setCurrentWidget(page_callList); - - Call * pastCall = callList->findCallByHistoryItem(listWidget_callHistory->currentItem()); - Call * call = callList->addDialingCall(pastCall->getPeerName()); - call->appendItemText(pastCall->getPeerPhoneNumber()); - addCallToCallList(call); - listWidget_callList->setCurrentRow(listWidget_callList->count() - 1); - actionb(call, CALL_ACTION_ACCEPT); + QListWidgetItem * item = listWidget_callHistory->currentItem(); + if(!item) + { + qDebug() << "Enter when no item is selected. Doing nothing."; + } + else + { + action_history->setChecked(false); + stackedWidget_screen->setCurrentWidget(page_callList); + + Call * pastCall = callList->findCallByHistoryItem(item); + if (!pastCall) + { + qDebug() << "pastCall null"; + } + Call * call = callList->addDialingCall(pastCall->getPeerName(), pastCall->getAccountId()); + call->appendItemText(pastCall->getPeerPhoneNumber()); + addCallToCallList(call); + listWidget_callList->setCurrentRow(listWidget_callList->count() - 1); + action(call, CALL_ACTION_ACCEPT); + } } if(stackedWidget_screen->currentWidget() == page_addressBook) { qDebug() << "In address book."; - action_addressBook->setChecked(false); - stackedWidget_screen->setCurrentWidget(page_callList); - ContactItemWidget * w = (ContactItemWidget *) (listWidget_addressBook->itemWidget(listWidget_addressBook->currentItem())); - Call * call = callList->addDialingCall(w->getContactName()); - call->appendItemText(w->getContactNumber()); - addCallToCallList(call); - listWidget_callList->setCurrentRow(listWidget_callList->count() - 1); - actionb(call, CALL_ACTION_ACCEPT); + QListWidgetItem * item = listWidget_addressBook->currentItem(); + if(!item) + { + qDebug() << "Enter when no item is selected. Doing nothing."; + } + else + { + action_addressBook->setChecked(false); + stackedWidget_screen->setCurrentWidget(page_callList); + ContactItemWidget * w = (ContactItemWidget *) (listWidget_addressBook->itemWidget(item)); + Call * call = callList->addDialingCall(w->getContactName()); + call->appendItemText(w->getContactNumber()); + addCallToCallList(call); + listWidget_callList->setCurrentRow(listWidget_callList->count() - 1); + action(call, CALL_ACTION_ACCEPT); + } } } -void sflphone_kdeView::actionb(Call * call, call_action action) +void sflphone_kdeView::action(Call * call, call_action action) { - try + if(! call) { - call->actionPerformed(action); + qDebug() << "Error : action " << action << "applied on null object call. Should not happen."; } - catch(const char * msg) + else { - errorWindow->showMessage(QString(msg)); + try + { + call->actionPerformed(action); + } + catch(const char * msg) + { + errorWindow->showMessage(QString(msg)); + } + updateCallItem(call); + updateWindowCallState(); } - updateCallItem(call); - updateWindowCallState(); } -void sflphone_kdeView::action(QListWidgetItem * item, call_action action) -{ - actionb(callList->findCallByItem(item), action); -} /******************************************* ******** Update Display Functions ********** @@ -417,7 +457,7 @@ void sflphone_kdeView::updateWindowCallState() bool recordActivated = false; //tells whether the call can be recorded in the state it is right now bool recordEnabled = false; - + enabledActions[5] = firstRegisteredAccount() && ! firstRegisteredAccount()->getAccountDetail(ACCOUNT_MAILBOX).isEmpty(); if(stackedWidget_screen->currentWidget() == page_callList) { item = listWidget_callList->currentItem(); @@ -561,6 +601,7 @@ void sflphone_kdeView::updateWindowCallState() enabledActions[1] = true; } } + action_accept->setEnabled(enabledActions[0]); action_refuse->setEnabled(enabledActions[1]); action_hold->setEnabled(enabledActions[2]); @@ -589,11 +630,6 @@ void sflphone_kdeView::updateSearchHistory() lineEdit_searchHistory->setVisible(!lineEdit_searchHistory->text().isEmpty()); } -void sflphone_kdeView::updateSearchAddressBook() -{ - qDebug() << "updateAddressBookSearch"; - lineEdit_addressBook->setVisible(!lineEdit_addressBook->text().isEmpty()); -} void sflphone_kdeView::updateCallHistory() { @@ -604,7 +640,7 @@ void sflphone_kdeView::updateCallHistory() qDebug() << "take item " << item->text() << " ; widget = " << callList->findCallByHistoryItem(item); } QString textSearched = lineEdit_searchHistory->text(); - for(int i = 0 ; i < callList->size() ; i++) + for(int i = callList->size() - 1 ; i >= 0 ; i--) { Call * call = (*callList)[i]; qDebug() << "" << call->getCallId(); @@ -694,11 +730,7 @@ QVector<Contact *> sflphone_kdeView::findContactsInKAddressBook(QString textSear return results; } -/** - * - * @return the integer resulting to the flags of the types chosen to be displayed in SFLPhone configuration. - * useful to sort contacts according to their types. - */ + int sflphone_kdeView::phoneNumberTypesDisplayed() { ConfigurationManagerInterface & configurationManager = ConfigurationManagerInterfaceSingleton::getInstance(); @@ -823,6 +855,21 @@ void sflphone_kdeView::updateDialpad() } +void sflphone_kdeView::updateStatusMessage() +{ + qDebug() << "updateStatusMessage"; + Account * account = firstRegisteredAccount(); + if(account == NULL) + { + emit statusMessageChanged(i18n("No account registered")); + } + else + { + emit statusMessageChanged(i18n("Using account") + " \'" + account->getAlias() + "\' (" + account->getAccountDetail(ACCOUNT_TYPE) + ")") ; + } +} + + /************************************************************ ************ Autoconnect ************* @@ -843,18 +890,9 @@ void sflphone_kdeView::on_action_displayDialpad_triggered() updateVolumeControls(); } -void sflphone_kdeView::on_pushButton_1_clicked() { typeString("1"); } -void sflphone_kdeView::on_pushButton_2_clicked() { typeString("2"); } -void sflphone_kdeView::on_pushButton_3_clicked() { typeString("3"); } -void sflphone_kdeView::on_pushButton_4_clicked() { typeString("4"); } -void sflphone_kdeView::on_pushButton_5_clicked() { typeString("5"); } -void sflphone_kdeView::on_pushButton_6_clicked() { typeString("6"); } -void sflphone_kdeView::on_pushButton_7_clicked() { typeString("7"); } -void sflphone_kdeView::on_pushButton_8_clicked() { typeString("8"); } -void sflphone_kdeView::on_pushButton_9_clicked() { typeString("9"); } -void sflphone_kdeView::on_pushButton_0_clicked() { typeString("0"); } -void sflphone_kdeView::on_pushButton_diese_clicked() { typeString("#"); } -void sflphone_kdeView::on_pushButton_etoile_clicked() { typeString("*"); } + +void sflphone_kdeView::on_widget_dialpad_typed(QString text) { typeString(text); } + void sflphone_kdeView::on_lineEdit_searchHistory_textChanged() { @@ -867,7 +905,6 @@ void sflphone_kdeView::on_lineEdit_searchHistory_textChanged() void sflphone_kdeView::on_lineEdit_addressBook_textChanged() { qDebug() << "on_lineEdit_addressBook_textEdited"; - updateSearchAddressBook(); updateAddressBook(); updateWindowCallState(); } @@ -962,10 +999,10 @@ void sflphone_kdeView::on_listWidget_callList_itemDoubleClicked(QListWidgetItem switch(state) { case CALL_STATE_HOLD: - actionb(call, CALL_ACTION_HOLD); + action(call, CALL_ACTION_HOLD); break; case CALL_STATE_DIALING: - actionb(call, CALL_ACTION_ACCEPT); + action(call, CALL_ACTION_ACCEPT); break; default: qDebug() << "Double clicked an item with no action on double click."; @@ -978,11 +1015,11 @@ void sflphone_kdeView::on_listWidget_callHistory_itemDoubleClicked(QListWidgetIt action_history->setChecked(false); stackedWidget_screen->setCurrentWidget(page_callList); Call * pastCall = callList->findCallByHistoryItem(item); - Call * call = callList->addDialingCall(pastCall->getPeerName()); + Call * call = callList->addDialingCall(pastCall->getPeerName(), pastCall->getAccountId()); call->appendItemText(pastCall->getPeerPhoneNumber()); addCallToCallList(call); listWidget_callList->setCurrentRow(listWidget_callList->count() - 1); - actionb(call, CALL_ACTION_ACCEPT); + action(call, CALL_ACTION_ACCEPT); } @@ -996,7 +1033,7 @@ void sflphone_kdeView::on_listWidget_addressBook_itemDoubleClicked(QListWidgetIt call->appendItemText(w->getContactNumber()); addCallToCallList(call); listWidget_callList->setCurrentRow(listWidget_callList->count() - 1); - actionb(call, CALL_ACTION_ACCEPT); + action(call, CALL_ACTION_ACCEPT); } void sflphone_kdeView::on_stackedWidget_screen_currentChanged(int index) @@ -1007,17 +1044,17 @@ void sflphone_kdeView::on_stackedWidget_screen_currentChanged(int index) { case 0: qDebug() << "Switched to call list screen."; - window->setWindowTitle("SFLPhone - Main screen"); + window->setWindowTitle(i18n("SFLPhone") + " - " + i18n("Main screen")); break; case 1: qDebug() << "Switched to call history screen."; updateCallHistory(); - window->setWindowTitle("SFLPhone - Call history"); + window->setWindowTitle(i18n("SFLPhone") + " - " + i18n("Call history")); break; case 2: qDebug() << "Switched to address book screen."; updateAddressBook(); - window->setWindowTitle("SFLPhone - Address book"); + window->setWindowTitle(i18n("SFLPhone") + " - " + i18n("Address book")); break; default: qDebug() << "Error : reached an unknown index \"" << index << "\" with stackedWidget_screen."; @@ -1031,7 +1068,7 @@ void sflphone_kdeView::contextMenuEvent(QContextMenuEvent *event) if(stackedWidget_screen->currentWidget() == page_callHistory || stackedWidget_screen->currentWidget() == page_addressBook) { QAction * action_edit = new QAction(&menu); - action_edit->setText(tr2i18n("Edit before call", 0)); + action_edit->setText(i18n("Edit before call")); connect(action_edit, SIGNAL(triggered()), this , SLOT(editBeforeCall())); menu.addAction(action_edit); @@ -1043,17 +1080,20 @@ void sflphone_kdeView::contextMenuEvent(QContextMenuEvent *event) menu.addAction(action_transfer); menu.addAction(action_record); menu.addSeparator(); - QVector<Account *> accounts = registeredAccounts(); + + QAction * action = new ActionSetAccountFirst(NULL, &menu); + action->setChecked(priorAccountId.isEmpty()); + connect(action, SIGNAL(setFirst(Account *)), + this , SLOT(setAccountFirst(Account *))); + menu.addAction(action); + + QVector<Account *> accounts = accountList->registeredAccounts(); for (int i = 0 ; i < accounts.size() ; i++) { + qDebug() << i; Account * account = accounts.at(i); QAction * action = new ActionSetAccountFirst(account, &menu); - action->setCheckable(true); - action->setChecked(false); - if(account == firstRegisteredAccount()) - { - action->setChecked(true); - } + action->setChecked(account->getAccountId() == priorAccountId); connect(action, SIGNAL(setFirst(Account *)), this , SLOT(setAccountFirst(Account *))); menu.addAction(action); @@ -1087,7 +1127,9 @@ void sflphone_kdeView::editBeforeCall() number = w->getContactNumber(); } } - QString newNumber = QInputDialog::getText(this, tr2i18n("Edit before call", 0), QString(), QLineEdit::Normal, number); + else + { return; } + QString newNumber = QInputDialog::getText(this, i18n("Edit before call"), QString(), QLineEdit::Normal, number); action_history->setChecked(false); action_addressBook->setChecked(false); @@ -1096,13 +1138,22 @@ void sflphone_kdeView::editBeforeCall() call->appendItemText(newNumber); addCallToCallList(call); listWidget_callList->setCurrentRow(listWidget_callList->count() - 1); - actionb(call, CALL_ACTION_ACCEPT); + action(call, CALL_ACTION_ACCEPT); } void sflphone_kdeView::setAccountFirst(Account * account) { - qDebug() << "setAccountFirst : " << account->getAlias(); - getAccountList()->setAccountFirst(account); + qDebug() << "setAccountFirst : " << (account ? account->getAlias() : QString()); +// getAccountList()->setAccountFirst(account); + if(account) + { + priorAccountId = account->getAccountId(); + } + else + { + priorAccountId = QString(); + } + updateStatusMessage(); } void sflphone_kdeView::on_listWidget_callHistory_currentItemChanged() @@ -1117,24 +1168,10 @@ void sflphone_kdeView::on_listWidget_addressBook_currentItemChanged() updateWindowCallState(); } -void sflphone_kdeView::on_action_configureAccounts_triggered() -{ - configDialog->loadOptions(); - configDialog->setPage(PAGE_ACCOUNTS); - configDialog->show(); -} - -void sflphone_kdeView::on_action_configureAudio_triggered() -{ - configDialog->loadOptions(); - configDialog->setPage(PAGE_AUDIO); - configDialog->show(); -} void sflphone_kdeView::on_action_configureSflPhone_triggered() { - sflphone_kdeView::configDialog->loadOptions(); - configDialog->setPage(PAGE_GENERAL); + configDialog->reload(); configDialog->show(); } @@ -1175,7 +1212,7 @@ void sflphone_kdeView::on_action_accept_triggered() } else { - actionb(call, CALL_ACTION_ACCEPT); + action(call, CALL_ACTION_ACCEPT); } } } @@ -1190,7 +1227,7 @@ void sflphone_kdeView::on_action_accept_triggered() call->appendItemText(pastCall->getPeerPhoneNumber()); addCallToCallList(call); listWidget_callList->setCurrentRow(listWidget_callList->count() - 1); - actionb(call, CALL_ACTION_ACCEPT); + action(call, CALL_ACTION_ACCEPT); } if(stackedWidget_screen->currentWidget() == page_addressBook) { @@ -1201,7 +1238,7 @@ void sflphone_kdeView::on_action_accept_triggered() call->appendItemText(w->getContactNumber()); addCallToCallList(call); listWidget_callList->setCurrentRow(listWidget_callList->count() - 1); - actionb(call, CALL_ACTION_ACCEPT); + action(call, CALL_ACTION_ACCEPT); } } @@ -1216,7 +1253,7 @@ void sflphone_kdeView::on_action_refuse_triggered() } else { - action(item, CALL_ACTION_REFUSE); + action(callList->findCallByItem(item), CALL_ACTION_REFUSE); } } if(stackedWidget_screen->currentWidget() == page_callHistory) @@ -1238,7 +1275,7 @@ void sflphone_kdeView::on_action_hold_triggered() } else { - action(item, CALL_ACTION_HOLD); + action(callList->findCallByItem(item), CALL_ACTION_HOLD); } } @@ -1251,7 +1288,7 @@ void sflphone_kdeView::on_action_transfer_triggered() } else { - action(item, CALL_ACTION_TRANSFER); + action(callList->findCallByItem(item), CALL_ACTION_TRANSFER); } } @@ -1264,7 +1301,7 @@ void sflphone_kdeView::on_action_record_triggered() } else { - action(item, CALL_ACTION_RECORD); + action(callList->findCallByItem(item), CALL_ACTION_RECORD); } } @@ -1286,9 +1323,10 @@ void sflphone_kdeView::on_action_addressBook_triggered(bool checked) { if(checked == true) { - action_history->setChecked(false); stackedWidget_screen->setCurrentWidget(page_addressBook); + if(lineEdit_addressBook->text().isEmpty()) + { lineEdit_addressBook->setFocus(Qt::OtherFocusReason); } } else { @@ -1300,13 +1338,13 @@ void sflphone_kdeView::on_action_addressBook_triggered(bool checked) void sflphone_kdeView::on_action_mailBox_triggered() { ConfigurationManagerInterface & configurationManager = ConfigurationManagerInterfaceSingleton::getInstance(); - QString account = firstAccountId(); - QString mailBoxNumber = configurationManager.getAccountDetails(account).value()[ACCOUNT_MAILBOX]; - Call * call = callList->addDialingCall(); - call->appendItemText(mailBoxNumber); - addCallToCallList(call); - listWidget_callList->setCurrentRow(listWidget_callList->count() - 1); - actionb(call, CALL_ACTION_ACCEPT); + Account * account = firstRegisteredAccount(); + QString mailBoxNumber = account->getAccountDetail(ACCOUNT_MAILBOX); + Call * call = callList->addDialingCall(); + call->appendItemText(mailBoxNumber); + addCallToCallList(call); + listWidget_callList->setCurrentRow(listWidget_callList->count() - 1); + action(call, CALL_ACTION_ACCEPT); } void sflphone_kdeView::on1_callStateChanged(const QString &callID, const QString &state) @@ -1360,7 +1398,7 @@ void sflphone_kdeView::on1_incomingCall(const QString &accountID, const QString void sflphone_kdeView::on1_incomingMessage(const QString &accountID, const QString &message) { - qDebug() << "Signal : Incoming Message ! "; + qDebug() << "Signal : Incoming Message ! \nMessage : " << message; } void sflphone_kdeView::on1_voiceMailNotify(const QString &accountID, int count) @@ -1379,5 +1417,4 @@ void sflphone_kdeView::on1_volumeChanged(const QString &device, double value) - #include "sflphone_kdeview.moc" diff --git a/sflphone-client-kde/src/sflphone_kdeview.h b/sflphone-client-kde/src/sflphone_kdeview.h index 20017b53fe277761ad7f46d94d4f9fbb3e0a2e16..8accc3dc82f81890c91b8932a8aafc26a957f230 100644 --- a/sflphone-client-kde/src/sflphone_kdeview.h +++ b/sflphone-client-kde/src/sflphone_kdeview.h @@ -32,36 +32,42 @@ #include <KXmlGuiWindow> #include "ui_sflphone_kdeview_base.h" -#include "ConfigDialog.h" +#include "conf/ConfigurationDialog.h" #include "CallList.h" #include "AccountWizard.h" #include "Contact.h" #include "sflphone_kdeview.h" +#include "AccountList.h" #include "ui_sflphone_kdeview_base.h" -class ConfigurationDialog; +class ConfigurationDialogKDE; + + /** * This is the main view class for sflphone-client-kde. Most of the non-menu, * non-toolbar, and non-statusbar (e.g., non frame) GUI code should go * here. * * @short Main view - * @author Jérémy Quentin <jeremy.quentin@gmail.com> + * @author Jérémy Quentin <jeremy.quentin@savoirfairelinux.com> * @version 0.1 */ - - class sflphone_kdeView : public QWidget, public Ui::SFLPhone_view { - Q_OBJECT + Q_OBJECT private: - static ConfigurationDialog * configDialog; + static ConfigurationDialogKDE * configDialog; + static AccountList * accountList; AccountWizard * wizard; + //List of calls in the window, and past ones. + //Handles both current calls (dialing, ringing...) and history. CallList * callList; QErrorMessage * errorWindow; + //Account used prioritary if defined and registered. If not, the first registered account in accountList is used. + static QString priorAccountId; protected: @@ -72,51 +78,136 @@ protected: void contextMenuEvent(QContextMenuEvent *event); public: - //Constructors & Destructors sflphone_kdeView(QWidget *parent); virtual ~sflphone_kdeView(); /** - * + * Called at construction. Updates all the display + * according to the settings. */ void loadWindow(); //Getters - static QString firstAccountId(); + /** + * Seeks the account to use. + * If priorAccountId is defined and the corresponding + * account exists and is registered, uses this one, else, + * asks the first registered of accountList. + * If there is no account registered, returns NULL. + * @return the account to use if an outgoing call is placed. + */ static Account * firstRegisteredAccount(); - static QVector<Account *> registeredAccounts(); + static AccountList * getAccountList(); QErrorMessage * getErrorWindow(); //Daemon getters + /** + * Used to sort contacts according to their types with Kabc. + * @return the integer resulting to the flags of the types + * chosen to be displayed in SFLPhone configuration. + */ int phoneNumberTypesDisplayed(); //Updates QVector<Contact *> findContactsInKAddressBook(QString textSearched, bool & full); private slots: - void actionb(Call * call, call_action action); - void action(QListWidgetItem * item, call_action action); + /** + * Performs the action action on the call call, then updates window. + * The call object will handle the action with its "actionPerformed" method. + * See the documentation for more details. + * @param call the call on which to perform the action + * @param action the code of the action to perform + */ + void action(Call * call, call_action action); + /** + * Sets the account account to be the prior account. + * That means it's gonna be used when the user places a call + * if it's defined and registered, else the first registered of + * accountList will be used. + * @param account the account to use prior + */ void setAccountFirst(Account * account); - //void typeChar(QChar c); + /** + * Handles the behaviour when the user types something with + * the dialpad widget or his keyboard (normally it's a one char + * string but we use a string just in case). + * Adds str to the selected item if in the main window + * and creates a new item if no item is selected. + * Send DTMF if appropriate according to current item's state. + * Adds str to the search bar if in history or address book. + * @param str the string sent by the user + */ void typeString(QString str); + /** + * Handles the behaviour when the user types a backspace + * according to the current state (window, item selected...) + */ void backspace(); + /** + * Handles the behaviour when the user types escape + * according to the current state (window, item selected...) + */ void escape(); + /** + * Handles the behaviour when the user types enter + * according to the current state (window, item selected...) + */ void enter(); + /** + * Displays a message window with editable text of the selected + * phone number in history or address book. + * Once the user accepts, place a call with the chosen phone number. + * Keeps the peer name of the contact or past call. + */ void editBeforeCall(); + /** + * Alternates colors of the list widget with the application's palettes's + * base and alternateBase colors. + * @param listWidget the list widget to which we alternate colors + */ void alternateColors(QListWidget * listWidget); + /** + * Adds the call's item to the call-list's listwidget. + * This function doesn't add anything to the callList object. + * @param call the call to add to the call-list's listwidget + */ void addCallToCallList(Call * call); + /** + * Adds the call's history-item to the call-history's listwidget. + * This function doesn't add anything to the callList object. + * @param call the past call to add to the call-history's listwidget + */ void addCallToCallHistory(Call * call); + /** + * Adds the contact's item to the addressbook's listwidget. + * @param contact the contact to add to the addressbook's listwidget + */ void addContactToContactList(Contact * contact); + /** + * Updates call's item according to its state. + * (Actually it only deletes the item from the main window's + * list widget once the call is OVER.) + * @param call the call to which update the item + */ void updateCallItem(Call * call); + /** + * Updates the toolbar's actions' display according to the selected + * item's state. + */ void updateWindowCallState(); + /** + * Updates the history's search bar's display according to the current + * text searched. + * If empty, hide the search bar. + */ void updateSearchHistory(); - void updateSearchAddressBook(); void updateCallHistory(); void updateAddressBook(); void updateRecordButton(); @@ -126,6 +217,9 @@ private slots: void updateVolumeControls(); void updateDialpad(); +public slots: + void updateStatusMessage(); + virtual void keyPressEvent(QKeyEvent *event) { @@ -148,8 +242,8 @@ private slots: void on_action_displayVolumeControls_triggered(); void on_action_displayDialpad_triggered(); - void on_action_configureAccounts_triggered(); - void on_action_configureAudio_triggered(); +// void on_action_configureAccounts_triggered(); +// void on_action_configureAudio_triggered(); void on_action_configureSflPhone_triggered(); void on_action_accountCreationWizard_triggered(); void on_action_accept_triggered(); @@ -161,18 +255,7 @@ private slots: void on_action_addressBook_triggered(bool checked); void on_action_mailBox_triggered(); - void on_pushButton_1_clicked(); - void on_pushButton_2_clicked(); - void on_pushButton_3_clicked(); - void on_pushButton_4_clicked(); - void on_pushButton_5_clicked(); - void on_pushButton_6_clicked(); - void on_pushButton_7_clicked(); - void on_pushButton_8_clicked(); - void on_pushButton_9_clicked(); - void on_pushButton_0_clicked(); - void on_pushButton_diese_clicked(); - void on_pushButton_etoile_clicked(); + void on_widget_dialpad_typed(QString text); void on_lineEdit_searchHistory_textChanged(); void on_lineEdit_addressBook_textChanged(); @@ -200,6 +283,8 @@ private slots: void on1_voiceMailNotify(const QString &accountID, int count); void on1_volumeChanged(const QString &device, double value); +signals: + void statusMessageChanged(const QString & message); }; diff --git a/sflphone-client-kde/src/ui/ConfigDialog.ui b/sflphone-client-kde/src/ui/ConfigDialog.ui deleted file mode 100644 index 98e4732e948e42ecc5d6aa8be45c29c4798771b1..0000000000000000000000000000000000000000 --- a/sflphone-client-kde/src/ui/ConfigDialog.ui +++ /dev/null @@ -1,1676 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<ui version="4.0"> - <author>Jérémy Quentin</author> - <class>ConfigurationDialog</class> - <widget class="QDialog" name="ConfigurationDialog"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>708</width> - <height>476</height> - </rect> - </property> - <property name="minimumSize"> - <size> - <width>0</width> - <height>0</height> - </size> - </property> - <property name="windowTitle"> - <string>Configuration Dialog</string> - </property> - <property name="windowIcon"> - <iconset resource="resources.qrc"> - <normaloff>:/images/icons/sflphone.svg</normaloff>:/images/icons/sflphone.svg</iconset> - </property> - <layout class="QVBoxLayout" name="verticalLayout"> - <property name="margin"> - <number>1</number> - </property> - <item> - <layout class="QHBoxLayout" name="horizontalLayoutDialog"> - <property name="sizeConstraint"> - <enum>QLayout::SetDefaultConstraint</enum> - </property> - <item> - <widget class="QListWidget" name="list_options"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Expanding"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>100</width> - <height>300</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>100</width> - <height>16777215</height> - </size> - </property> - <property name="sizeIncrement"> - <size> - <width>0</width> - <height>0</height> - </size> - </property> - <property name="mouseTracking"> - <bool>false</bool> - </property> - <property name="contextMenuPolicy"> - <enum>Qt::DefaultContextMenu</enum> - </property> - <property name="acceptDrops"> - <bool>false</bool> - </property> - <property name="layoutDirection"> - <enum>Qt::LeftToRight</enum> - </property> - <property name="autoFillBackground"> - <bool>true</bool> - </property> - <property name="autoScrollMargin"> - <number>16</number> - </property> - <property name="editTriggers"> - <set>QAbstractItemView::AllEditTriggers</set> - </property> - <property name="dragEnabled"> - <bool>true</bool> - </property> - <property name="iconSize"> - <size> - <width>200</width> - <height>200</height> - </size> - </property> - <property name="textElideMode"> - <enum>Qt::ElideMiddle</enum> - </property> - <property name="verticalScrollMode"> - <enum>QAbstractItemView::ScrollPerItem</enum> - </property> - <property name="horizontalScrollMode"> - <enum>QAbstractItemView::ScrollPerItem</enum> - </property> - <property name="movement"> - <enum>QListView::Static</enum> - </property> - <property name="flow"> - <enum>QListView::TopToBottom</enum> - </property> - <property name="resizeMode"> - <enum>QListView::Adjust</enum> - </property> - <property name="layoutMode"> - <enum>QListView::SinglePass</enum> - </property> - <property name="viewMode"> - <enum>QListView::IconMode</enum> - </property> - <property name="modelColumn"> - <number>0</number> - </property> - <property name="uniformItemSizes"> - <bool>false</bool> - </property> - <property name="wordWrap"> - <bool>false</bool> - </property> - <property name="sortingEnabled"> - <bool>false</bool> - </property> - <item> - <property name="text"> - <string>General</string> - </property> - </item> - <item> - <property name="text"> - <string>Display</string> - </property> - </item> - <item> - <property name="text"> - <string>Accounts</string> - </property> - </item> - <item> - <property name="text"> - <string>Audio</string> - </property> - </item> - <item> - <property name="text"> - <string>Record</string> - </property> - </item> - <item> - <property name="text"> - <string>Address Book</string> - </property> - </item> - <item> - <property name="text"> - <string>Hooks</string> - </property> - </item> - </widget> - </item> - <item> - <widget class="Line" name="line_ConfigGeneral_2"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - </widget> - </item> - <item> - <widget class="Line" name="line_options"> - <property name="orientation"> - <enum>Qt::Vertical</enum> - </property> - </widget> - </item> - <item> - <widget class="QStackedWidget" name="stackedWidget_options"> - <property name="currentIndex"> - <number>0</number> - </property> - <widget class="QWidget" name="page_general"> - <layout class="QVBoxLayout" name="verticalLayout_18"> - <property name="leftMargin"> - <number>4</number> - </property> - <item> - <widget class="QLabel" name="label_configGeneral"> - <property name="text"> - <string>Configure general settings</string> - </property> - </widget> - </item> - <item> - <widget class="Line" name="line_configGeneral"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - </widget> - </item> - <item> - <widget class="QGroupBox" name="groupBox1_history"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="title"> - <string>Call history</string> - </property> - <layout class="QVBoxLayout" name="verticalLayout_19"> - <item> - <widget class="QWidget" name="widget_historyCapacity" native="true"> - <layout class="QHBoxLayout" name="horizontalLayout_10"> - <item> - <widget class="QLabel" name="label_historyCapacity"> - <property name="text"> - <string>&Capacity</string> - </property> - <property name="buddy"> - <cstring>horizontalSlider_historyCapacity</cstring> - </property> - </widget> - </item> - <item> - <widget class="QSlider" name="horizontalSlider_historyCapacity"> - <property name="maximum"> - <number>100</number> - </property> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - </widget> - </item> - <item> - <widget class="QSpinBox" name="spinBox_historyCapacity"/> - </item> - </layout> - </widget> - </item> - <item> - <widget class="QToolButton" name="toolButton_historyClear"> - <property name="text"> - <string>C&lear history</string> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item> - <widget class="QGroupBox" name="groupBox2_connection"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="title"> - <string>Connection</string> - </property> - <layout class="QFormLayout" name="formLayout_12"> - <property name="fieldGrowthPolicy"> - <enum>QFormLayout::ExpandingFieldsGrow</enum> - </property> - <item row="0" column="0"> - <widget class="QLabel" name="label_SIPPort"> - <property name="text"> - <string>SIP &Port</string> - </property> - <property name="buddy"> - <cstring>spinBox_SIPPort</cstring> - </property> - </widget> - </item> - <item row="0" column="1"> - <widget class="QWidget" name="widget_SIPPort" native="true"> - <property name="minimumSize"> - <size> - <width>50</width> - <height>0</height> - </size> - </property> - <layout class="QHBoxLayout" name="horizontalLayout"> - <property name="margin"> - <number>0</number> - </property> - <item> - <widget class="QSpinBox" name="spinBox_SIPPort"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimum"> - <number>1025</number> - </property> - <property name="maximum"> - <number>65536</number> - </property> - </widget> - </item> - <item> - <widget class="QLabel" name="label_WarningSIP"> - <property name="enabled"> - <bool>false</bool> - </property> - <property name="text"> - <string>Attention </string> - </property> - </widget> - </item> - </layout> - </widget> - </item> - </layout> - </widget> - </item> - <item> - <spacer name="verticalSpacer_configGeneral"> - <property name="orientation"> - <enum>Qt::Vertical</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>16777215</height> - </size> - </property> - </spacer> - </item> - </layout> - </widget> - <widget class="QWidget" name="page_display"> - <layout class="QVBoxLayout" name="verticalLayout_9"> - <item> - <widget class="QLabel" name="label_configDisplay"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Configure display</string> - </property> - </widget> - </item> - <item> - <widget class="Line" name="line_configDisplay"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - </widget> - </item> - <item> - <widget class="QFrame" name="frame_display"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="frameShape"> - <enum>QFrame::StyledPanel</enum> - </property> - <property name="frameShadow"> - <enum>QFrame::Raised</enum> - </property> - <layout class="QVBoxLayout" name="verticalLayout_8"> - <item> - <widget class="QLabel" name="label1_notifications"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Enable notifications</string> - </property> - </widget> - </item> - <item> - <widget class="QWidget" name="widget1_notifications" native="true"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <layout class="QHBoxLayout" name="horizontalLayout_5"> - <item> - <widget class="QCheckBox" name="checkBox1_notifOnCalls"> - <property name="text"> - <string>On incoming &calls</string> - </property> - </widget> - </item> - <item> - <widget class="QCheckBox" name="checkBox2_notifOnMessages"> - <property name="text"> - <string>On &messages</string> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item> - <widget class="QLabel" name="label2_displayMainWindow"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Show main window</string> - </property> - </widget> - </item> - <item> - <widget class="QWidget" name="widget_displayMainWindow" native="true"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <layout class="QHBoxLayout" name="horizontalLayout_6"> - <item> - <widget class="QCheckBox" name="checkBox1_displayOnStart"> - <property name="text"> - <string>On &start</string> - </property> - </widget> - </item> - <item> - <widget class="QCheckBox" name="checkBox2_displayOnCalls"> - <property name="text"> - <string>On &incoming calls</string> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item> - <spacer name="verticalSpacer_configDisplay"> - <property name="orientation"> - <enum>Qt::Vertical</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>16777215</height> - </size> - </property> - </spacer> - </item> - </layout> - </widget> - </item> - </layout> - </widget> - <widget class="QWidget" name="page_accounts"> - <layout class="QVBoxLayout" name="verticalLayout_2"> - <item> - <widget class="QLabel" name="label_configAccounts"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Configure user accounts</string> - </property> - </widget> - </item> - <item> - <widget class="Line" name="line_configAccounts"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - </widget> - </item> - <item> - <widget class="QWidget" name="widget1_configAccounts" native="true"> - <property name="autoFillBackground"> - <bool>false</bool> - </property> - <layout class="QHBoxLayout" name="horizontalLayout_3"> - <property name="sizeConstraint"> - <enum>QLayout::SetDefaultConstraint</enum> - </property> - <property name="leftMargin"> - <number>0</number> - </property> - <property name="topMargin"> - <number>0</number> - </property> - <property name="bottomMargin"> - <number>0</number> - </property> - <item> - <widget class="QFrame" name="frame1_accountList"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> - <horstretch>1</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>0</width> - <height>0</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>16777215</width> - <height>16777215</height> - </size> - </property> - <property name="frameShape"> - <enum>QFrame::StyledPanel</enum> - </property> - <property name="frameShadow"> - <enum>QFrame::Raised</enum> - </property> - <layout class="QVBoxLayout" name="verticalLayout_6"> - <item> - <widget class="QListWidget" name="listWidget_accountList"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>150</width> - <height>0</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>16777215</width> - <height>16777215</height> - </size> - </property> - <property name="dragEnabled"> - <bool>true</bool> - </property> - </widget> - </item> - <item> - <widget class="QGroupBox" name="groupBox_accountListHandle"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="maximumSize"> - <size> - <width>16777215</width> - <height>16777215</height> - </size> - </property> - <property name="layoutDirection"> - <enum>Qt::RightToLeft</enum> - </property> - <property name="title"> - <string/> - </property> - <property name="alignment"> - <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> - </property> - <layout class="QHBoxLayout" name="horizontalLayout_2"> - <property name="spacing"> - <number>0</number> - </property> - <property name="sizeConstraint"> - <enum>QLayout::SetNoConstraint</enum> - </property> - <property name="margin"> - <number>0</number> - </property> - <item> - <widget class="QToolButton" name="button_accountRemove"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Remove this account</string> - </property> - <property name="icon"> - <iconset resource="resources.qrc"> - <normaloff>:/images/icons/remove.png</normaloff>:/images/icons/remove.png</iconset> - </property> - <property name="shortcut"> - <string>+</string> - </property> - </widget> - </item> - <item> - <widget class="QToolButton" name="button_accountAdd"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="sizeIncrement"> - <size> - <width>0</width> - <height>0</height> - </size> - </property> - <property name="text"> - <string>Add a new account</string> - </property> - <property name="icon"> - <iconset resource="resources.qrc"> - <normaloff>:/images/icons/add.png</normaloff>:/images/icons/add.png</iconset> - </property> - </widget> - </item> - <item> - <widget class="QToolButton" name="button_accountDown"> - <property name="text"> - <string>Down</string> - </property> - </widget> - </item> - <item> - <widget class="QToolButton" name="button_accountUp"> - <property name="text"> - <string>Up</string> - </property> - </widget> - </item> - <item> - <spacer name="horizontalSpacer"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>0</width> - <height>0</height> - </size> - </property> - </spacer> - </item> - <item> - <widget class="QToolButton" name="toolButton_accountsApply"> - <property name="enabled"> - <bool>true</bool> - </property> - <property name="text"> - <string>Apply</string> - </property> - </widget> - </item> - </layout> - </widget> - </item> - </layout> - </widget> - </item> - <item> - <widget class="QFrame" name="frame2_editAccounts"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> - <horstretch>1</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="frameShape"> - <enum>QFrame::StyledPanel</enum> - </property> - <property name="frameShadow"> - <enum>QFrame::Raised</enum> - </property> - <layout class="QFormLayout" name="formLayout_2"> - <property name="fieldGrowthPolicy"> - <enum>QFormLayout::ExpandingFieldsGrow</enum> - </property> - <item row="0" column="0"> - <widget class="QLabel" name="label1_alias"> - <property name="text"> - <string>&Alias</string> - </property> - <property name="buddy"> - <cstring>edit1_alias</cstring> - </property> - </widget> - </item> - <item row="0" column="1"> - <widget class="QLineEdit" name="edit1_alias"> - <property name="minimumSize"> - <size> - <width>0</width> - <height>0</height> - </size> - </property> - </widget> - </item> - <item row="1" column="0"> - <widget class="QLabel" name="label2_protocol"> - <property name="text"> - <string>&Protocol</string> - </property> - <property name="buddy"> - <cstring>edit2_protocol</cstring> - </property> - </widget> - </item> - <item row="1" column="1"> - <widget class="QComboBox" name="edit2_protocol"> - <item> - <property name="text"> - <string>SIP</string> - </property> - </item> - <item> - <property name="text"> - <string>IAX</string> - </property> - </item> - </widget> - </item> - <item row="2" column="0"> - <widget class="QLabel" name="label3_server"> - <property name="text"> - <string>&Server</string> - </property> - <property name="buddy"> - <cstring>edit3_server</cstring> - </property> - </widget> - </item> - <item row="2" column="1"> - <widget class="QLineEdit" name="edit3_server"> - <property name="minimumSize"> - <size> - <width>0</width> - <height>0</height> - </size> - </property> - </widget> - </item> - <item row="3" column="0"> - <widget class="QLabel" name="label4_user"> - <property name="text"> - <string>&User</string> - </property> - <property name="buddy"> - <cstring>edit4_user</cstring> - </property> - </widget> - </item> - <item row="3" column="1"> - <widget class="QLineEdit" name="edit4_user"/> - </item> - <item row="4" column="0"> - <widget class="QLabel" name="label5_password"> - <property name="text"> - <string>Pass&word</string> - </property> - <property name="buddy"> - <cstring>edit5_password</cstring> - </property> - </widget> - </item> - <item row="4" column="1"> - <widget class="QLineEdit" name="edit5_password"> - <property name="echoMode"> - <enum>QLineEdit::PasswordEchoOnEdit</enum> - </property> - </widget> - </item> - <item row="5" column="0"> - <widget class="QLabel" name="label6_mailbox"> - <property name="text"> - <string>&Mailbox</string> - </property> - <property name="buddy"> - <cstring>edit6_mailbox</cstring> - </property> - </widget> - </item> - <item row="5" column="1"> - <widget class="QLineEdit" name="edit6_mailbox"/> - </item> - <item row="6" column="0"> - <widget class="QLabel" name="label7_state"> - <property name="text"> - <string>State</string> - </property> - </widget> - </item> - <item row="6" column="1"> - <widget class="QLabel" name="edit7_state"> - <property name="text"> - <string/> - </property> - </widget> - </item> - </layout> - </widget> - </item> - </layout> - </widget> - </item> - <item> - <widget class="QGroupBox" name="groupBox_commonSettings"> - <property name="title"> - <string/> - </property> - <layout class="QVBoxLayout" name="verticalLayout_10"> - <item> - <widget class="QLabel" name="label_commonSettings"> - <property name="text"> - <string>Stun settings will be applied on each account</string> - </property> - </widget> - </item> - <item> - <layout class="QFormLayout" name="formLayout_commonSettings"> - <property name="fieldGrowthPolicy"> - <enum>QFormLayout::ExpandingFieldsGrow</enum> - </property> - <item row="0" column="0"> - <widget class="QCheckBox" name="checkBox_stun"> - <property name="text"> - <string>&Enable Stun</string> - </property> - </widget> - </item> - <item row="0" column="1"> - <widget class="QLineEdit" name="lineEdit_stun"> - <property name="enabled"> - <bool>false</bool> - </property> - </widget> - </item> - </layout> - </item> - </layout> - </widget> - </item> - </layout> - </widget> - <widget class="QWidget" name="page_audio"> - <layout class="QVBoxLayout" name="verticalLayout_5"> - <item> - <widget class="QLabel" name="label_configAudio"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Configure audio settings</string> - </property> - </widget> - </item> - <item> - <widget class="Line" name="line_configAudio"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - </widget> - </item> - <item> - <widget class="QGroupBox" name="groupBox1_audio"> - <property name="mouseTracking"> - <bool>false</bool> - </property> - <property name="title"> - <string/> - </property> - <layout class="QFormLayout" name="formLayout_3"> - <property name="fieldGrowthPolicy"> - <enum>QFormLayout::AllNonFixedFieldsGrow</enum> - </property> - <item row="0" column="0"> - <widget class="QLabel" name="label_interface"> - <property name="text"> - <string>Audio &device</string> - </property> - <property name="buddy"> - <cstring>comboBox_interface</cstring> - </property> - </widget> - </item> - <item row="0" column="1"> - <widget class="QComboBox" name="comboBox_interface"> - <property name="minimumSize"> - <size> - <width>100</width> - <height>0</height> - </size> - </property> - <item> - <property name="text"> - <string>ALSA</string> - </property> - </item> - <item> - <property name="text"> - <string>PulseAudio</string> - </property> - </item> - </widget> - </item> - <item row="1" column="0"> - <widget class="QCheckBox" name="checkBox_ringtones"> - <property name="text"> - <string>&Enable ringtones</string> - </property> - </widget> - </item> - <item row="1" column="1"> - <widget class="KUrlComboRequester" name="urlComboRequester_ringtone"/> - </item> - </layout> - </widget> - </item> - <item> - <widget class="QGroupBox" name="groupBox2_codecs"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="title"> - <string>&Codecs</string> - </property> - <layout class="QGridLayout" name="gridLayout"> - <item row="0" column="2"> - <layout class="QVBoxLayout" name="verticalLayout_codecsOrder"> - <property name="leftMargin"> - <number>0</number> - </property> - <property name="rightMargin"> - <number>0</number> - </property> - <item> - <widget class="QToolButton" name="toolButton_codecUp"> - <property name="text"> - <string/> - </property> - </widget> - </item> - <item> - <widget class="QToolButton" name="toolButton_codecDown"> - <property name="text"> - <string/> - </property> - </widget> - </item> - </layout> - </item> - <item row="0" column="0"> - <widget class="QTableWidget" name="tableWidget_codecs"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>0</width> - <height>100</height> - </size> - </property> - <property name="frameShape"> - <enum>QFrame::StyledPanel</enum> - </property> - <property name="frameShadow"> - <enum>QFrame::Sunken</enum> - </property> - <property name="verticalScrollBarPolicy"> - <enum>Qt::ScrollBarAsNeeded</enum> - </property> - <property name="textElideMode"> - <enum>Qt::ElideRight</enum> - </property> - <property name="verticalScrollMode"> - <enum>QAbstractItemView::ScrollPerPixel</enum> - </property> - <property name="horizontalScrollMode"> - <enum>QAbstractItemView::ScrollPerPixel</enum> - </property> - <column> - <property name="text"> - <string>Active</string> - </property> - </column> - <column> - <property name="text"> - <string>Name</string> - </property> - </column> - <column> - <property name="text"> - <string>Frequency</string> - </property> - </column> - <column> - <property name="text"> - <string>Bitrate</string> - </property> - </column> - <column> - <property name="text"> - <string>Bandwidth</string> - </property> - </column> - </widget> - </item> - </layout> - </widget> - </item> - <item> - <widget class="QStackedWidget" name="stackedWidget_interfaceSpecificSettings"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="currentIndex"> - <number>0</number> - </property> - <widget class="QWidget" name="page1_alsa"> - <layout class="QVBoxLayout" name="verticalLayout_20"> - <property name="margin"> - <number>0</number> - </property> - <item> - <widget class="QGroupBox" name="groupBox_alsa"> - <property name="title"> - <string>ALSA settings</string> - </property> - <layout class="QFormLayout" name="formLayout_4"> - <item row="2" column="1"> - <widget class="QComboBox" name="comboBox2_in"> - <property name="minimumSize"> - <size> - <width>100</width> - <height>0</height> - </size> - </property> - </widget> - </item> - <item row="2" column="0"> - <widget class="QLabel" name="label2_in"> - <property name="text"> - <string>&In</string> - </property> - <property name="buddy"> - <cstring>comboBox2_in</cstring> - </property> - </widget> - </item> - <item row="3" column="0"> - <widget class="QLabel" name="label3_out"> - <property name="text"> - <string>&Out</string> - </property> - <property name="buddy"> - <cstring>comboBox3_out</cstring> - </property> - </widget> - </item> - <item row="3" column="1"> - <widget class="QComboBox" name="comboBox3_out"> - <property name="minimumSize"> - <size> - <width>100</width> - <height>0</height> - </size> - </property> - </widget> - </item> - <item row="0" column="0"> - <widget class="QLabel" name="label1_alsaPugin"> - <property name="text"> - <string>ALSA &plugin</string> - </property> - <property name="buddy"> - <cstring>comboBox1_alsaPlugin</cstring> - </property> - </widget> - </item> - <item row="0" column="1"> - <widget class="QComboBox" name="comboBox1_alsaPlugin"> - <property name="minimumSize"> - <size> - <width>100</width> - <height>0</height> - </size> - </property> - </widget> - </item> - </layout> - </widget> - </item> - </layout> - </widget> - <widget class="QWidget" name="page2_pulseAudio"> - <layout class="QVBoxLayout" name="verticalLayout_7"> - <item> - <widget class="QGroupBox" name="groupBox_pulseAudio"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="title"> - <string>Paramètres PulseAudio</string> - </property> - <layout class="QFormLayout" name="formLayout_11"> - <property name="fieldGrowthPolicy"> - <enum>QFormLayout::ExpandingFieldsGrow</enum> - </property> - <item row="0" column="0"> - <widget class="QCheckBox" name="checkBox_pulseAudioVolumeAlter"> - <property name="text"> - <string>Autoriser à &modifier le volume des autres applications</string> - </property> - </widget> - </item> - </layout> - </widget> - </item> - </layout> - </widget> - </widget> - </item> - </layout> - </widget> - <widget class="QWidget" name="page_record"> - <layout class="QVBoxLayout" name="verticalLayout_3"> - <item> - <widget class="QLabel" name="label_configRecord"> - <property name="text"> - <string>Configure record settings</string> - </property> - </widget> - </item> - <item> - <widget class="Line" name="line_configRecord"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - </widget> - </item> - <item> - <widget class="QGroupBox" name="groupBox1_recordGeneral"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="title"> - <string>General</string> - </property> - <layout class="QFormLayout" name="formLayout"> - <item row="0" column="0"> - <widget class="QLabel" name="label_destinationFolder"> - <property name="text"> - <string>Destination folder</string> - </property> - </widget> - </item> - <item row="0" column="1"> - <widget class="KUrlComboRequester" name="urlcomborequester_destinationFolder"/> - </item> - </layout> - </widget> - </item> - <item> - <spacer name="verticalSpacer_configRecord"> - <property name="orientation"> - <enum>Qt::Vertical</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>16777215</height> - </size> - </property> - </spacer> - </item> - </layout> - </widget> - <widget class="QWidget" name="page_addressBook"> - <layout class="QVBoxLayout" name="verticalLayout_4"> - <item> - <widget class="QLabel" name="label_configAddressBook"> - <property name="text"> - <string>Configure address book settings</string> - </property> - </widget> - </item> - <item> - <widget class="Line" name="line_configAddressBook"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - </widget> - </item> - <item> - <widget class="QWidget" name="widget_configAddressBookGeneral" native="true"> - <layout class="QFormLayout" name="formLayout_5"> - <property name="fieldGrowthPolicy"> - <enum>QFormLayout::AllNonFixedFieldsGrow</enum> - </property> - <item row="1" column="0"> - <widget class="QLabel" name="label_maxResults"> - <property name="text"> - <string>Maximum &results</string> - </property> - <property name="buddy"> - <cstring>horizontalSlider_maxResults</cstring> - </property> - </widget> - </item> - <item row="1" column="1"> - <widget class="QWidget" name="widget_maxResults" native="true"> - <layout class="QHBoxLayout" name="horizontalLayout_4"> - <property name="spacing"> - <number>0</number> - </property> - <property name="margin"> - <number>0</number> - </property> - <item> - <widget class="QSlider" name="horizontalSlider_maxResults"> - <property name="minimum"> - <number>25</number> - </property> - <property name="maximum"> - <number>50</number> - </property> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - </widget> - </item> - <item> - <widget class="QSpinBox" name="spinBox_maxResults"> - <property name="minimum"> - <number>25</number> - </property> - <property name="maximum"> - <number>50</number> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item row="2" column="0"> - <widget class="QCheckBox" name="checkBox_displayPhoto"> - <property name="text"> - <string>Display &photo if available</string> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item> - <widget class="QGroupBox" name="groupBox_displayTypes"> - <property name="title"> - <string>Display phone numbers of these &types :</string> - </property> - <layout class="QHBoxLayout" name="horizontalLayout_7"> - <item> - <widget class="QCheckBox" name="checkBox_business"> - <property name="text"> - <string>&Work</string> - </property> - </widget> - </item> - <item> - <widget class="QCheckBox" name="checkBox_mobile"> - <property name="text"> - <string>&Mobile</string> - </property> - </widget> - </item> - <item> - <widget class="QCheckBox" name="checkBox_home"> - <property name="text"> - <string>&Home</string> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item> - <spacer name="verticalSpacer_configAddressBook"> - <property name="orientation"> - <enum>Qt::Vertical</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>229</height> - </size> - </property> - </spacer> - </item> - </layout> - </widget> - <widget class="QWidget" name="page_hooks"> - <layout class="QVBoxLayout" name="verticalLayout_11"> - <item> - <widget class="QLabel" name="label_configHooks"> - <property name="text"> - <string>Configure hooks settings</string> - </property> - </widget> - </item> - <item> - <widget class="Line" name="line_configHooks"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - </widget> - </item> - <item> - <widget class="QGroupBox" name="groupBox_urlArgument"> - <property name="title"> - <string>URL Argument</string> - </property> - <layout class="QVBoxLayout" name="verticalLayout_12"> - <item> - <widget class="QWidget" name="widget_protocols" native="true"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>10</width> - <height>10</height> - </size> - </property> - <layout class="QHBoxLayout" name="horizontalLayout_8"> - <property name="margin"> - <number>0</number> - </property> - <item> - <widget class="QCheckBox" name="checkBox_hooksSIP"> - <property name="text"> - <string>SIP Protocol</string> - </property> - </widget> - </item> - <item> - <widget class="QCheckBox" name="checkBox_hooksIAX"> - <property name="text"> - <string>IAX2 Protocol</string> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item> - <widget class="QWidget" name="widget_urlArgumentForm" native="true"> - <layout class="QFormLayout" name="formLayout_6"> - <item row="1" column="0"> - <widget class="QLabel" name="label_SIPHeader"> - <property name="text"> - <string>SIP Header</string> - </property> - <property name="buddy"> - <cstring>lineEdit_SIPHeader</cstring> - </property> - </widget> - </item> - <item row="3" column="0"> - <widget class="QLabel" name="label_command"> - <property name="text"> - <string>Command</string> - </property> - <property name="buddy"> - <cstring>lineEdit_command</cstring> - </property> - </widget> - </item> - <item row="1" column="1"> - <widget class="QLineEdit" name="lineEdit_SIPHeader"/> - </item> - <item row="3" column="1"> - <widget class="QLineEdit" name="lineEdit_command"/> - </item> - </layout> - </widget> - </item> - </layout> - </widget> - </item> - <item> - <widget class="QGroupBox" name="groupBox_phoneNumberFormatting"> - <property name="title"> - <string>Phone number formatting</string> - </property> - <layout class="QVBoxLayout" name="verticalLayout_13"> - <item> - <widget class="QCheckBox" name="checkBox_addPrefix"> - <property name="text"> - <string>Add phone number prefix</string> - </property> - </widget> - </item> - <item> - <widget class="QWidget" name="widget_phoneNumberFormattingForm" native="true"> - <layout class="QFormLayout" name="formLayout_7"> - <item row="1" column="0"> - <widget class="QLabel" name="label_prepend"> - <property name="text"> - <string>Prepend</string> - </property> - <property name="buddy"> - <cstring>lineEdit_prepend</cstring> - </property> - </widget> - </item> - <item row="1" column="1"> - <widget class="QLineEdit" name="lineEdit_prepend"> - <property name="enabled"> - <bool>false</bool> - </property> - </widget> - </item> - </layout> - </widget> - </item> - </layout> - </widget> - </item> - <item> - <spacer name="verticalSpacer_configHooks"> - <property name="orientation"> - <enum>Qt::Vertical</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>40</height> - </size> - </property> - </spacer> - </item> - </layout> - </widget> - </widget> - </item> - </layout> - </item> - <item> - <widget class="Line" name="lineDialog"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - </widget> - </item> - <item> - <widget class="QDialogButtonBox" name="buttonBoxDialog"> - <property name="layoutDirection"> - <enum>Qt::LeftToRight</enum> - </property> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="standardButtons"> - <set>QDialogButtonBox::Apply|QDialogButtonBox::Cancel|QDialogButtonBox::Ok|QDialogButtonBox::RestoreDefaults</set> - </property> - <property name="centerButtons"> - <bool>false</bool> - </property> - </widget> - </item> - </layout> - <action name="actionAbout"> - <property name="text"> - <string>about</string> - </property> - </action> - </widget> - <layoutdefault spacing="4" margin="4"/> - <customwidgets> - <customwidget> - <class>KUrlComboRequester</class> - <extends>KUrlRequester</extends> - <header>kurlrequester.h</header> - </customwidget> - </customwidgets> - <resources> - <include location="resources.qrc"/> - </resources> - <connections> - <connection> - <sender>buttonBoxDialog</sender> - <signal>rejected()</signal> - <receiver>ConfigurationDialog</receiver> - <slot>reject()</slot> - <hints> - <hint type="sourcelabel"> - <x>301</x> - <y>474</y> - </hint> - <hint type="destinationlabel"> - <x>286</x> - <y>274</y> - </hint> - </hints> - </connection> - <connection> - <sender>list_options</sender> - <signal>currentRowChanged(int)</signal> - <receiver>stackedWidget_options</receiver> - <slot>setCurrentIndex(int)</slot> - <hints> - <hint type="sourcelabel"> - <x>73</x> - <y>92</y> - </hint> - <hint type="destinationlabel"> - <x>191</x> - <y>82</y> - </hint> - </hints> - </connection> - <connection> - <sender>checkBox_stun</sender> - <signal>toggled(bool)</signal> - <receiver>lineEdit_stun</receiver> - <slot>setEnabled(bool)</slot> - <hints> - <hint type="sourcelabel"> - <x>130</x> - <y>29</y> - </hint> - <hint type="destinationlabel"> - <x>202</x> - <y>31</y> - </hint> - </hints> - </connection> - <connection> - <sender>comboBox_interface</sender> - <signal>currentIndexChanged(int)</signal> - <receiver>stackedWidget_interfaceSpecificSettings</receiver> - <slot>setCurrentIndex(int)</slot> - <hints> - <hint type="sourcelabel"> - <x>488</x> - <y>64</y> - </hint> - <hint type="destinationlabel"> - <x>446</x> - <y>433</y> - </hint> - </hints> - </connection> - <connection> - <sender>horizontalSlider_historyCapacity</sender> - <signal>valueChanged(int)</signal> - <receiver>spinBox_historyCapacity</receiver> - <slot>setValue(int)</slot> - <hints> - <hint type="sourcelabel"> - <x>352</x> - <y>89</y> - </hint> - <hint type="destinationlabel"> - <x>688</x> - <y>95</y> - </hint> - </hints> - </connection> - <connection> - <sender>spinBox_historyCapacity</sender> - <signal>valueChanged(int)</signal> - <receiver>horizontalSlider_historyCapacity</receiver> - <slot>setValue(int)</slot> - <hints> - <hint type="sourcelabel"> - <x>688</x> - <y>95</y> - </hint> - <hint type="destinationlabel"> - <x>352</x> - <y>89</y> - </hint> - </hints> - </connection> - <connection> - <sender>horizontalSlider_maxResults</sender> - <signal>valueChanged(int)</signal> - <receiver>spinBox_maxResults</receiver> - <slot>setValue(int)</slot> - <hints> - <hint type="sourcelabel"> - <x>599</x> - <y>52</y> - </hint> - <hint type="destinationlabel"> - <x>661</x> - <y>55</y> - </hint> - </hints> - </connection> - <connection> - <sender>spinBox_maxResults</sender> - <signal>valueChanged(int)</signal> - <receiver>horizontalSlider_maxResults</receiver> - <slot>setValue(int)</slot> - <hints> - <hint type="sourcelabel"> - <x>650</x> - <y>59</y> - </hint> - <hint type="destinationlabel"> - <x>585</x> - <y>56</y> - </hint> - </hints> - </connection> - <connection> - <sender>checkBox_addPrefix</sender> - <signal>toggled(bool)</signal> - <receiver>lineEdit_prepend</receiver> - <slot>setEnabled(bool)</slot> - <hints> - <hint type="sourcelabel"> - <x>167</x> - <y>224</y> - </hint> - <hint type="destinationlabel"> - <x>231</x> - <y>259</y> - </hint> - </hints> - </connection> - </connections> -</ui> diff --git a/sflphone-client-kde/src/ui/sflphone_kdeview_base.ui b/sflphone-client-kde/src/ui/sflphone_kdeview_base.ui index 492893ebb3ad32d48ecca706c67045c04bef0f72..02ef5f252555b89cb6bd43fd0ba81c2725a39cc0 100644 --- a/sflphone-client-kde/src/ui/sflphone_kdeview_base.ui +++ b/sflphone-client-kde/src/ui/sflphone_kdeview_base.ui @@ -6,8 +6,8 @@ <rect> <x>0</x> <y>0</y> - <width>655</width> - <height>487</height> + <width>337</width> + <height>420</height> </rect> </property> <property name="windowTitle"> @@ -51,7 +51,11 @@ <widget class="QListWidget" name="listWidget_callHistory"/> </item> <item> - <widget class="QLineEdit" name="lineEdit_searchHistory"/> + <widget class="KLineEdit" name="lineEdit_searchHistory"> + <property name="showClearButton" stdset="0"> + <bool>true</bool> + </property> + </widget> </item> </layout> </widget> @@ -61,13 +65,20 @@ <widget class="QListWidget" name="listWidget_addressBook"/> </item> <item> - <widget class="QLineEdit" name="lineEdit_addressBook"/> + <widget class="KLineEdit" name="lineEdit_addressBook"> + <property name="showClearButton" stdset="0"> + <bool>true</bool> + </property> + </widget> </item> <item> <widget class="QLabel" name="label_addressBookFull"> <property name="text"> <string>Attention:number of results exceeds max displayed.</string> </property> + <property name="wordWrap"> + <bool>true</bool> + </property> </widget> </item> </layout> @@ -88,9 +99,9 @@ <height>160</height> </size> </property> - <layout class="QHBoxLayout" name="horizontalLayout_2"> + <layout class="QHBoxLayout" name="horizontalLayout_dialpadAndControls"> <property name="spacing"> - <number>0</number> + <number>1</number> </property> <property name="margin"> <number>0</number> @@ -147,7 +158,7 @@ <item> <widget class="QToolButton" name="toolButton_recVol"> <property name="text"> - <string>...</string> + <string/> </property> <property name="icon"> <iconset> @@ -159,173 +170,16 @@ </widget> </item> </layout> - <zorder>toolButton_recVol</zorder> - <zorder>slider_recVol</zorder> </widget> </item> <item> - <widget class="QWidget" name="widget_dialpad" native="true"> - <layout class="QGridLayout" name="gridLayout"> - <item row="0" column="1"> - <widget class="QPushButton" name="pushButton_1"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>1</string> - </property> - </widget> - </item> - <item row="0" column="2"> - <widget class="QPushButton" name="pushButton_2"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>2</string> - </property> - <property name="shortcut"> - <string>2</string> - </property> - </widget> - </item> - <item row="0" column="3"> - <widget class="QPushButton" name="pushButton_3"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>3</string> - </property> - </widget> - </item> - <item row="1" column="1"> - <widget class="QPushButton" name="pushButton_4"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>4</string> - </property> - </widget> - </item> - <item row="1" column="2"> - <widget class="QPushButton" name="pushButton_5"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>5</string> - </property> - </widget> - </item> - <item row="1" column="3"> - <widget class="QPushButton" name="pushButton_6"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>6</string> - </property> - </widget> - </item> - <item row="2" column="1"> - <widget class="QPushButton" name="pushButton_7"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>7</string> - </property> - </widget> - </item> - <item row="2" column="2"> - <widget class="QPushButton" name="pushButton_8"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>8</string> - </property> - </widget> - </item> - <item row="2" column="3"> - <widget class="QPushButton" name="pushButton_9"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>9</string> - </property> - </widget> - </item> - <item row="3" column="1"> - <widget class="QPushButton" name="pushButton_etoile"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>*</string> - </property> - </widget> - </item> - <item row="3" column="2"> - <widget class="QPushButton" name="pushButton_0"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>0</string> - </property> - </widget> - </item> - <item row="3" column="3"> - <widget class="QPushButton" name="pushButton_diese"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>#</string> - </property> - </widget> - </item> - </layout> + <widget class="Dialpad" name="widget_dialpad" native="true"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> </widget> </item> <item> @@ -371,7 +225,7 @@ <item> <widget class="QToolButton" name="toolButton_sndVol"> <property name="text"> - <string>...</string> + <string/> </property> <property name="icon"> <iconset> @@ -409,7 +263,7 @@ <item> <widget class="QToolButton" name="toolButton_recVolAlone"> <property name="text"> - <string>...</string> + <string/> </property> <property name="icon"> <iconset> @@ -436,7 +290,7 @@ <item> <widget class="QToolButton" name="toolButton_sndVolAlone"> <property name="text"> - <string>...</string> + <string/> </property> <property name="icon"> <iconset> @@ -463,7 +317,7 @@ </layout> <action name="action_accept"> <property name="icon"> - <iconset resource="resources.qrc"> + <iconset resource="../qrc/resources.qrc"> <normaloff>:/images/icons/call.svg</normaloff>:/images/icons/call.svg</iconset> </property> <property name="text"> @@ -472,7 +326,7 @@ </action> <action name="action_refuse"> <property name="icon"> - <iconset resource="resources.qrc"> + <iconset resource="../qrc/resources.qrc"> <normaloff>:/images/icons/hang_up.svg</normaloff>:/images/icons/hang_up.svg</iconset> </property> <property name="text"> @@ -481,7 +335,7 @@ </action> <action name="action_hold"> <property name="icon"> - <iconset resource="resources.qrc"> + <iconset resource="../qrc/resources.qrc"> <normaloff>:/images/icons/hold.svg</normaloff>:/images/icons/hold.svg</iconset> </property> <property name="text"> @@ -493,7 +347,7 @@ <bool>true</bool> </property> <property name="icon"> - <iconset resource="resources.qrc"> + <iconset resource="../qrc/resources.qrc"> <normaloff>:/images/icons/transfert.svg</normaloff>:/images/icons/transfert.svg</iconset> </property> <property name="text"> @@ -505,7 +359,7 @@ <bool>true</bool> </property> <property name="icon"> - <iconset resource="resources.qrc"> + <iconset resource="../qrc/resources.qrc"> <normaloff>:/images/icons/history2.svg</normaloff>:/images/icons/history2.svg</iconset> </property> <property name="text"> @@ -514,7 +368,7 @@ </action> <action name="action_mailBox"> <property name="icon"> - <iconset resource="resources.qrc"> + <iconset resource="../qrc/resources.qrc"> <normaloff>:/images/icons/mailbox.svg</normaloff>:/images/icons/mailbox.svg</iconset> </property> <property name="text"> @@ -523,7 +377,7 @@ </action> <action name="action_configureAccounts"> <property name="icon"> - <iconset resource="resources.qrc"> + <iconset resource="../qrc/resources.qrc"> <normaloff>:/images/icons/stock_person.svg</normaloff>:/images/icons/stock_person.svg</iconset> </property> <property name="text"> @@ -532,7 +386,7 @@ </action> <action name="action_configureAudio"> <property name="icon"> - <iconset resource="resources.qrc"> + <iconset resource="../qrc/resources.qrc"> <normaloff>:/images/icons/icon_volume.svg</normaloff>:/images/icons/icon_volume.svg</iconset> </property> <property name="text"> @@ -540,10 +394,6 @@ </property> </action> <action name="action_configureSflPhone"> - <property name="icon"> - <iconset resource="resources.qrc"> - <normaloff>:/images/icons/sflphone.svg</normaloff>:/images/icons/sflphone.svg</iconset> - </property> <property name="text"> <string>&Configure SFLPhone</string> </property> @@ -556,7 +406,7 @@ <bool>true</bool> </property> <property name="icon"> - <iconset resource="resources.qrc"> + <iconset resource="../qrc/resources.qrc"> <normaloff>:/images/icons/icon_volume_off.svg</normaloff>:/images/icons/icon_volume_off.svg</iconset> </property> <property name="text"> @@ -576,7 +426,7 @@ <bool>true</bool> </property> <property name="icon"> - <iconset resource="resources.qrc"> + <iconset resource="../qrc/resources.qrc"> <normaloff>:/images/icons/icon_dialpad.svg</normaloff>:/images/icons/icon_dialpad.svg</iconset> </property> <property name="text"> @@ -588,7 +438,7 @@ <bool>true</bool> </property> <property name="icon"> - <iconset resource="resources.qrc"> + <iconset> <normaloff>:/images/icons/del_off.png</normaloff>:/images/icons/del_off.png</iconset> </property> <property name="text"> @@ -605,7 +455,7 @@ <bool>true</bool> </property> <property name="icon"> - <iconset resource="resources.qrc"> + <iconset resource="../qrc/resources.qrc"> <normaloff>:/images/icons/x-office-address-book.png</normaloff>:/images/icons/x-office-address-book.png</iconset> </property> <property name="text"> @@ -613,8 +463,21 @@ </property> </action> </widget> + <customwidgets> + <customwidget> + <class>KLineEdit</class> + <extends>QLineEdit</extends> + <header>klineedit.h</header> + </customwidget> + <customwidget> + <class>Dialpad</class> + <extends>QWidget</extends> + <header>Dialpad.h</header> + <container>1</container> + </customwidget> + </customwidgets> <resources> - <include location="resources.qrc"/> + <include location="../qrc/resources.qrc"/> </resources> <connections> <connection> diff --git a/sflphone-common/Makefile.am b/sflphone-common/Makefile.am index ffd473d7d1fb1878fcc9cc46d7505db095930206..64ee4c390b9880aeb7b94b418517466407f6ad30 100644 --- a/sflphone-common/Makefile.am +++ b/sflphone-common/Makefile.am @@ -1,5 +1,9 @@ +include globals.mak + # Makefile.am +SOURCES= + if BUILD_TEST TESTS_DIR=test unittest: @@ -14,8 +18,14 @@ unittest: @echo " -- You need the cppunit devel package to compile the unitary tests." endif -ACLOCAL_AMFLAGS = -I m4 +indent: + @echo "Indenting code:" + if [ -f $(ASTYLERC) ] ; then \ + $(indent) --options=$(ASTYLERC) --recursive *.cpp *.h; \ + fi + +ACLOCAL_AMFLAGS = -I m4 SUBDIRS = libs src ringtones po man $(TESTS_DIR) EXTRA_DIST = m4/*.m4 tools/*.sh platform/* images/* README.gentoo diff --git a/sflphone-common/configure.ac b/sflphone-common/configure.ac index c2c254719cb06d53f067a5a5eb7cab6390efc216..103fb42273dd4687dee9341089e4ed8c0752aacd 100644 --- a/sflphone-common/configure.ac +++ b/sflphone-common/configure.ac @@ -2,7 +2,7 @@ dnl SFLPhone - configure.ac for automake 1.9 and autoconf 2.59 dnl dnl Process this file with autoconf to produce a configure script. AC_PREREQ(2.59) -AC_INIT([SFLphone],[0.9.5~beta],[sflphoneteam@savoirfairelinux.com],[sflphone]) +AC_INIT([SFLphone],[0.9.6~beta],[sflphoneteam@savoirfairelinux.com],[sflphone]) AC_COPYRIGHT([[Copyright (c) Savoir-Faire Linux 2004-2009]]) AC_REVISION([$Revision$]) @@ -46,14 +46,14 @@ AC_CONFIG_FILES([libs/Makefile \ AC_CONFIG_FILES([src/Makefile \ src/audio/Makefile \ - src/audio/codecs/Makefile - src/audio/codecs/ilbc/Makefile \ + src/audio/codecs/Makefile \ src/config/Makefile \ src/dbus/Makefile \ src/plug-in/audiorecorder/Makefile \ src/plug-in/Makefile \ src/plug-in/test/Makefile \ - src/hooks/Makefile]) + src/hooks/Makefile \ + src/history/Makefile]) dnl Unitary test section AC_CONFIG_FILES([test/Makefile]) @@ -193,7 +193,7 @@ dnl DBus-C++ detection (used to be in library own build system) DBUS_REQUIRED_VERSION=0.60 PKG_CHECK_MODULES(dbus, [dbus-1 >= $DBUS_REQUIRED_VERSION],, AC_MSG_ERROR([You need the DBus libraries (version 0.6 or better)] - [http://www.freedesktop.org/wiki/Software_2fdbus]) + [http://gitorious.org/dbus-cplusplus]) ) AC_SUBST(dbus_CFLAGS) AC_SUBST(dbus_LIBS) @@ -213,6 +213,21 @@ PKG_CHECK_EXISTS([dbus-1 >= $DBUS_RECURSIVE_MUTEX_VERSION], [AC_DEFINE(DBUS_HAS_RECURSIVE_MUTEX, , [DBus supports recursive mutexes (needs DBus >= 0.95)])] ) +#AC_ARG_ENABLE(dbus-debug, +# AS_HELP_STRING([--enable-dbus-debug], +# [enable debugging support]), +# [enable_debug=$enableval], +# [enable_debug=no] +#) + +#if test "$enable_debug" = "yes" ; then +# CXXFLAGS="$CXXFLAGS -Wall -ggdb -O0" +# AC_DEFINE(DEBUG, 1, [Define to enable debug build]) +#else +# CXXFLAGS="$CXXFLAGS -Wall -O3" +#fi + + if test "$enable_glib" = "yes" ; then PKG_CHECK_MODULES([glib], glib-2.0) AC_SUBST(glib_CFLAGS) @@ -391,6 +406,6 @@ AC_DEFINE_UNQUOTED(DBUS_SERVICES_DIR, "$DBUS_SERVICES_DIR", [Where services dir AC_SUBST(SFLPHONE_CFLAGS) AC_SUBST(SFLPHONE_LIBS) AC_OUTPUT -AC_MSG_NOTICE([[Configuration done! Please make sure that pjsip library (libs/pjproject-1.0.1) has already been compiled. Run `make' to build the software.]]) +AC_MSG_NOTICE([[Configuration done! Please make sure that pjsip library (libs/pjproject-1.0.2) has already been compiled. Run `make' to build the software.]]) diff --git a/sflphone-common/globals.mak b/sflphone-common/globals.mak index 37607028c3de133e8583ce0be41701d44309058f..e6f165a1ac990f1dd0872e18d732a3e84afa8448 100644 --- a/sflphone-common/globals.mak +++ b/sflphone-common/globals.mak @@ -3,13 +3,18 @@ src=$(top_srcdir) sflcodecdir=$(DESTDIR)$(libdir)/sflphone/codecs sflplugindir=$(DESTDIR)$(libdir)/sflphone/plugins +ASTYLERC="../astylerc" +indent="/usr/bin/astyle" + +PJSIP_VERSION="1.0.2" + # for pjsip PJSIP_LIBS= \ - -L$(src)/libs/pjproject-1.0.1/pjnath/lib/ \ - -L$(src)/libs/pjproject-1.0.1/pjsip/lib/ \ - -L$(src)/libs/pjproject-1.0.1/pjlib/lib/ \ - -L$(src)/libs/pjproject-1.0.1/pjlib-util/lib/ \ - -L$(src)/libs/pjproject-1.0.1/pjmedia/lib/ \ + -L$(src)/libs/pjproject-$(PJSIP_VERSION)/pjnath/lib/ \ + -L$(src)/libs/pjproject-$(PJSIP_VERSION)/pjsip/lib/ \ + -L$(src)/libs/pjproject-$(PJSIP_VERSION)/pjlib/lib/ \ + -L$(src)/libs/pjproject-$(PJSIP_VERSION)/pjlib-util/lib/ \ + -L$(src)/libs/pjproject-$(PJSIP_VERSION)/pjmedia/lib/ \ -lpjnath-sfl-$(target) \ -lpjsua-sfl-$(target) \ -lpjsip-sfl-$(target) \ @@ -20,11 +25,11 @@ PJSIP_LIBS= \ -lpjlib-util-sfl-$(target) \ -lpj-sfl-$(target) -SIP_CFLAGS=-I$(src)/libs/pjproject-1.0.1/pjsip/include \ - -I$(src)/libs/pjproject-1.0.1/pjlib/include \ - -I$(src)/libs/pjproject-1.0.1/pjlib-util/include \ - -I$(src)/libs/pjproject-1.0.1/pjmedia/include \ - -I$(src)/libs/pjproject-1.0.1/pjnath/include +SIP_CFLAGS=-I$(src)/libs/pjproject-$(PJSIP_VERSION)/pjsip/include \ + -I$(src)/libs/pjproject-$(PJSIP_VERSION)/pjlib/include \ + -I$(src)/libs/pjproject-$(PJSIP_VERSION)/pjlib-util/include \ + -I$(src)/libs/pjproject-$(PJSIP_VERSION)/pjmedia/include \ + -I$(src)/libs/pjproject-$(PJSIP_VERSION)/pjnath/include DBUSCPP_CFLAGS=$(top_srcdir)/libs/dbus-c++/include/dbus-c++ @@ -45,8 +50,9 @@ AM_CPPFLAGS = \ -I$(src)/libs \ -I$(src)/libs/dbus-c++/include \ -I$(src)/libs/iax2 \ - -I$(src)/libs/pjproject-1.0.1 \ + -I$(src)/libs/pjproject-$(PJSIP_VERSION) \ -I$(src)/src \ + -I$(src)/src/config \ -I$(src)/test \ -DPREFIX=\"$(prefix)\" \ -DPROGSHAREDIR=\"${datadir}/sflphone\" \ diff --git a/sflphone-common/libs/dbus-c++/AUTHORS b/sflphone-common/libs/dbus-c++/AUTHORS index d9c8833559ba2c6f650242249c6b4bb98138c7bd..87435a48c67d9c6b72e6659f086193b35d155117 100644 --- a/sflphone-common/libs/dbus-c++/AUTHORS +++ b/sflphone-common/libs/dbus-c++/AUTHORS @@ -1 +1,2 @@ Paolo Durante <shackan@gmail.com> +Andreas Volz <andreas.volz@tux-style.com> diff --git a/sflphone-common/libs/dbus-c++/Makefile.am b/sflphone-common/libs/dbus-c++/Makefile.am index 6b7789bc86de855bd27f6311be7b0c11caf24efa..6e4fa0f13870b5483124153db7c73172f423bad2 100644 --- a/sflphone-common/libs/dbus-c++/Makefile.am +++ b/sflphone-common/libs/dbus-c++/Makefile.am @@ -3,3 +3,4 @@ SUBDIRS = src tools data MAINTAINERCLEANFILES = \ Makefile.in + diff --git a/sflphone-common/libs/dbus-c++/README b/sflphone-common/libs/dbus-c++/README index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..6977af1436a484e5a265b2e4daec5c11b17f42bf 100644 --- a/sflphone-common/libs/dbus-c++/README +++ b/sflphone-common/libs/dbus-c++/README @@ -0,0 +1,7 @@ +Debugging +--------- +To compile debugging code configure the project with the --enable-debug option. Then at runtime you may set the environment variable "DBUSXX_VERBOSE=1" to activate debugging and to '0' to deactivate debugging. + + +BUGS: +----- diff --git a/sflphone-common/libs/dbus-c++/include/dbus-c++/api.h b/sflphone-common/libs/dbus-c++/include/dbus-c++/api.h index 1e63a8e3dc8d9809e4754a8464e0ee9b84776459..48904e81b09f1677947fc9989ec1a52b246f5e17 100644 --- a/sflphone-common/libs/dbus-c++/include/dbus-c++/api.h +++ b/sflphone-common/libs/dbus-c++/include/dbus-c++/api.h @@ -25,10 +25,6 @@ #ifndef __DBUSXX_API_H #define __DBUSXX_API_H -#ifdef DBUS_HAVE_CONFIG_H -#include <dbus-c++/config.h> -#endif - #ifdef GCC_HASCLASSVISIBILITY # define DXXAPILOCAL __attribute__ ((visibility("hidden"))) # define DXXAPIPUBLIC __attribute__ ((visibility("default"))) diff --git a/sflphone-common/libs/dbus-c++/include/dbus-c++/config.h.in b/sflphone-common/libs/dbus-c++/include/dbus-c++/config.h.in deleted file mode 100644 index 1a0f11c74ce7a993a40a76c25ed1dd11e981f6c6..0000000000000000000000000000000000000000 --- a/sflphone-common/libs/dbus-c++/include/dbus-c++/config.h.in +++ /dev/null @@ -1,77 +0,0 @@ -/* include/dbus-c++/config.h.in. Generated from configure.ac by autoheader. */ - -/* unstable DBus */ -#undef DBUS_API_SUBJECT_TO_CHANGE - -/* DBus supports recursive mutexes (needs DBus >= 0.95) */ -#undef DBUS_HAS_RECURSIVE_MUTEX - -/* dbus_threads_init_default (needs DBus >= 0.93) */ -#undef DBUS_HAS_THREADS_INIT_DEFAULT - -/* to enable hidden symbols */ -#undef GCC_HASCLASSVISIBILITY - -/* Define to 1 if you have the <dlfcn.h> header file. */ -#undef HAVE_DLFCN_H - -/* Define to 1 if you have the <expat.h> header file. */ -#undef HAVE_EXPAT_H - -/* Define to 1 if you have the <inttypes.h> header file. */ -#undef HAVE_INTTYPES_H - -/* Define to 1 if you have the <memory.h> header file. */ -#undef HAVE_MEMORY_H - -/* Define to 1 if you have the <pthread.h> header file. */ -#undef HAVE_PTHREAD_H - -/* Define to 1 if you have the <stdint.h> header file. */ -#undef HAVE_STDINT_H - -/* Define to 1 if you have the <stdlib.h> header file. */ -#undef HAVE_STDLIB_H - -/* Define to 1 if you have the <strings.h> header file. */ -#undef HAVE_STRINGS_H - -/* Define to 1 if you have the <string.h> header file. */ -#undef HAVE_STRING_H - -/* Define to 1 if you have the <sys/stat.h> header file. */ -#undef HAVE_SYS_STAT_H - -/* Define to 1 if you have the <sys/types.h> header file. */ -#undef HAVE_SYS_TYPES_H - -/* Define to 1 if you have the <unistd.h> header file. */ -#undef HAVE_UNISTD_H - -/* Define to the sub-directory in which libtool stores uninstalled libraries. - */ -#undef LT_OBJDIR - -/* Name of package */ -#undef PACKAGE - -/* Define to the address where bug reports for this package should be sent. */ -#undef PACKAGE_BUGREPORT - -/* Define to the full name of this package. */ -#undef PACKAGE_NAME - -/* Define to the full name and version of this package. */ -#undef PACKAGE_STRING - -/* Define to the one symbol short name of this package. */ -#undef PACKAGE_TARNAME - -/* Define to the version of this package. */ -#undef PACKAGE_VERSION - -/* Define to 1 if you have the ANSI C header files. */ -#undef STDC_HEADERS - -/* Version number of package */ -#undef VERSION diff --git a/sflphone-common/libs/dbus-c++/include/dbus-c++/connection.h b/sflphone-common/libs/dbus-c++/include/dbus-c++/connection.h index 4251cdddf3d3db8837d4af5253c3907df0d12c79..410ce556a212348d1fb54cb6d925c56e25f6bba9 100644 --- a/sflphone-common/libs/dbus-c++/include/dbus-c++/connection.h +++ b/sflphone-common/libs/dbus-c++/include/dbus-c++/connection.h @@ -25,10 +25,6 @@ #ifndef __DBUSXX_CONNECTION_H #define __DBUSXX_CONNECTION_H -#ifdef DBUS_HAVE_CONFIG_H -#include <dbus-c++/config.h> -#endif - #include <list> #include "api.h" @@ -41,7 +37,7 @@ namespace DBus { class Connection; -typedef Slot<bool, const Message &> MessageSlot; +typedef Slot<bool, const Message&> MessageSlot; typedef std::list<Connection> ConnectionList; @@ -60,53 +56,394 @@ public: struct Private; - typedef std::list<Private *> PrivatePList; + typedef std::list<Private*> PrivatePList; - Connection(Private *); + Connection( Private* ); - Connection(const char *address, bool priv = true); + Connection( const char* address, bool priv = true ); - Connection(const Connection &c); + Connection( const Connection& c ); virtual ~Connection(); - Dispatcher *setup(Dispatcher *); - - bool operator == (const Connection &) const; - - void add_match(const char *rule); - - void remove_match(const char *rule); - - bool add_filter(MessageSlot &); - - void remove_filter(MessageSlot &); - - bool unique_name(const char *n); - - const char *unique_name() const; - + Dispatcher* setup( Dispatcher* ); + + bool operator == ( const Connection& ) const; + + /*! + * \brief Adds a match rule to match messages going through the message bus. + * + * The "rule" argument is the string form of a match rule. + * + * If you pass NULL for the error, this function will not block; the match + * thus won't be added until you flush the connection, and if there's an error + * adding the match (only possible error is lack of resources in the bus), you + * won't find out about it. + * + * Normal API conventions would have the function return a boolean value + * indicating whether the error was set, but that would require blocking always + * to determine the return value. + * + * The AddMatch method is fully documented in the D-Bus specification. For + * quick reference, the format of the match rules is discussed here, but the + * specification is the canonical version of this information. + * + * Rules are specified as a string of comma separated key/value pairs. An + * example is "type='signal',sender='org.freedesktop.DBus', + * interface='org.freedesktop.DBus',member='Foo', path='/bar/foo',destination=':452345.34'" + * + * Possible keys you can match on are type, sender, interface, member, path, + * destination and numbered keys to match message args (keys are 'arg0', 'arg1', etc.). + * Omitting a key from the rule indicates a wildcard match. For instance omitting + * the member from a match rule but adding a sender would let all messages from + * that sender through regardless of the member. + * + * Matches are inclusive not exclusive so as long as one rule matches the + * message will get through. It is important to note this because every time a + * essage is received the application will be paged into memory to process it. + * This can cause performance problems such as draining batteries on embedded platforms. + * + * If you match message args ('arg0', 'arg1', and so forth) only string arguments + * will match. That is, arg0='5' means match the string "5" not the integer 5. + * + * Currently there is no way to match against non-string arguments. + * + * Matching on interface is tricky because method call messages only optionally + * specify the interface. If a message omits the interface, then it will NOT + * match if the rule specifies an interface name. This means match rules on + * method calls should not usually give an interface. + * + * However, signal messages are required to include the interface so when + * matching signals usually you should specify the interface in the match rule. + * + * For security reasons, you can match arguments only up to DBUS_MAXIMUM_MATCH_RULE_ARG_NUMBER. + * + * Match rules have a maximum length of DBUS_MAXIMUM_MATCH_RULE_LENGTH bytes. + * + * Both of these maximums are much higher than you're likely to need, they only + * exist because the D-Bus bus daemon has fixed limits on all resource usage. + * + * \param rule Textual form of match rule. + * \throw Error + */ + void add_match( const char* rule ); + + /*! + * \brief Removes a previously-added match rule "by value" (the most + * recently-added identical rule gets removed). + * + * The "rule" argument is the string form of a match rule. + * + * The bus compares match rules semantically, not textually, so whitespace and + * ordering don't have to be identical to the rule you passed to add_match(). + * + * \param rule Textual form of match rule. + * \throw Error + */ + void remove_match( const char* rule ); + + /*! + * \brief Adds a message filter. + * + * Filters are handlers that are run on all incoming messages, prior to the + * objects registered with ObjectAdaptor::register_obj(). Filters are + * run in the order that they were added. The same handler can be added as a + * filter more than once, in which case it will be run more than once. Filters + * added during a filter callback won't be run on the message being processed. + * + * \param s The MessageSlot to add. + */ + bool add_filter( MessageSlot& s); + + /*! + * \brief Removes a previously-added message filter. + * + * It is a programming error to call this function for a handler that has not + * been added as a filter. If the given handler was added more than once, only + * one instance of it will be removed (the most recently-added instance). + * + * \param s The MessageSlot to remove. + */ + void remove_filter( MessageSlot& s); + + /*! + * \brief Sets the unique name of the connection, as assigned by the message bus. + * + * Can only be used if you registered with the bus manually (i.e. if you did + * not call register_bus()). Can only be called once per connection. After + * the unique name is set, you can get it with unique_name(void). + * + * The only reason to use this function is to re-implement the equivalent of + * register_bus() yourself. One (probably unusual) reason to do that might + * be to do the bus registration call asynchronously instead of synchronously. + * + * \note Just use dbus_bus_get() or dbus_bus_get_private(), or worst case + * register_bus(), instead of messing with this function. There's + * really no point creating pain for yourself by doing things manually. + * (Not sure if this is yet wrapped.) + * + * It's hard to use this function safely on shared connections (created by + * Connection()) in a multithreaded application, because only one + * registration attempt can be sent to the bus. If two threads are both + * sending the registration message, there is no mechanism in libdbus itself + * to avoid sending it twice. + * + * Thus, you need a way to coordinate which thread sends the registration + * attempt; which also means you know which thread will call + * unique_name(const char*). If you don't know about all threads in the app + * (for example, if some libraries you're using might start libdbus-using + * threads), then you need to avoid using this function on shared connections. + * + * \param n The unique name. + */ + bool unique_name( const char* n ); + + /*! + * \brief Gets the unique name of the connection as assigned by the message bus. + * + * Only possible after the connection has been registered with the message bus. + * All connections returned by dbus_bus_get() or dbus_bus_get_private() have + * been successfully registered. (Not sure if this is yet wrapped.) + * + * The name remains valid until the connection is freed, and should not be + * freed by the caller. + * + * Other than dbus_bus_get(), there are two ways to set the unique name; one + * is register_bus(), the other is unique_name(const char*). You are + * responsible for calling unique_name(const char*) if you register by hand + * instead of using register_bus(). + */ + const char* unique_name() const; + + /*! + * \brief Registers a connection with the bus. + * + * This must be the first thing an application does when connecting to the + * message bus. If registration succeeds, the unique name will be set, and + * can be obtained using unique_name(void). + * + * This function will block until registration is complete. + * + * If the connection has already registered with the bus (determined by + * checking whether unique_name(void) returns a non-NULL value), + * then this function does nothing. + * + * If you use dbus_bus_get() or dbus_bus_get_private() this function will be + * called for you. (Not sure if this is yet wrapped.) + * + * \note Just use dbus_bus_get() or dbus_bus_get_private() instead of + * register_bus() and save yourself some pain. Using register_bus() + * manually is only useful if you have your own custom message bus not found + * in DBusBusType. + * + * If you open a bus connection by the contructor of Connection() you will have to register_bus() + * yourself, or make the appropriate registration method calls yourself. If + * you send the method calls yourself, call unique_name(const char*) with + * the unique bus name you get from the bus. + * + * For shared connections (created with dbus_connection_open()) in a + * multithreaded application, you can't really make the registration calls + * yourself, because you don't know whether some other thread is also + * registering, and the bus will kick you off if you send two registration + * messages. (TODO: how is this done in the wrapper?) + * + * If you use register_bus() however, there is a lock that keeps both + * apps from registering at the same time. + * + * The rule in a multithreaded app, then, is that register_bus() must be + * used to register, or you need to have your own locks that all threads in + * the app will respect. + * + * In a single-threaded application you can register by hand instead of using + * register_bus(), as long as you check unique_name(void) to + * see if a unique name has already been stored by another thread before you + * send the registration messages. + */ bool register_bus(); + /*! + * \brief Gets whether the connection is currently open. + * + * A connection may become disconnected when the remote application closes its + * end, or exits; a connection may also be disconnected with disconnect(). + * + * There are not separate states for "closed" and "disconnected," the two + * terms are synonymous. + * + * \return true If the connection is still alive. + */ bool connected() const; + /*! + * \brief Closes a private connection, so no further data can be sent or received. + * + * This disconnects the transport (such as a socket) underlying the connection. + * + * Attempts to send messages after closing a connection are safe, but will + * result in error replies generated locally in libdbus. + * + * This function does not affect the connection's reference count. It's safe + * to close a connection more than once; all calls after the first do nothing. + * It's impossible to "reopen" a connection, a new connection must be created. + * This function may result in a call to the DBusDispatchStatusFunction set + * with Private::init(), as the disconnect + * message it generates needs to be dispatched. + * + * If a connection is dropped by the remote application, it will close itself. + * + * You must close a connection prior to releasing the last reference to the + * connection. + * + * You may not close a shared connection. Connections created with + * dbus_connection_open() or dbus_bus_get() are shared. These connections are + * owned by libdbus, and applications should only unref them, never close them. + * Applications can know it is safe to unref these connections because libdbus + * will be holding a reference as long as the connection is open. Thus, either + * the connection is closed and it is OK to drop the last reference, or the + * connection is open and the app knows it does not have the last reference. + * + * Connections created with dbus_connection_open_private() or + * dbus_bus_get_private() are not kept track of or referenced by libdbus. + * The creator of these connections is responsible for calling + * dbus_connection_close() prior to releasing the last reference, if the + * connection is not already disconnected. + * + * \todo dbus_connection_disconnect() was removed in dbus 0.9x. Maybe this + * function should be renamed to close(). + */ void disconnect(); - void exit_on_disconnect(bool exit); - + /*! + * \brief Set whether _exit() should be called when the connection receives a + * disconnect signal. + * + * The call to _exit() comes after any handlers for the disconnect signal run; + * handlers can cancel the exit by calling this function. + * + * By default, exit_on_disconnect is false; but for message bus connections + * returned from dbus_bus_get() it will be toggled on by default. + * + * \param exit true If _exit() should be called after a disconnect signal. + */ + void exit_on_disconnect( bool exit ); + + /*! + * \brief Blocks until the outgoing message queue is empty. + */ void flush(); - bool send(const Message &, unsigned int *serial = NULL); - - Message send_blocking(Message &msg, int timeout = -1); - - PendingCall send_async(Message &msg, int timeout); - - void request_name(const char *name, int flags = 0); - - bool has_name(const char *name); - - bool start_service(const char *name, unsigned long flags); + /*! + * \brief Adds a message to the outgoing message queue. + * + * Does not block to write the message to the network; that happens + * asynchronously. To force the message to be written, call + * dbus_connection_flush(). Because this only queues the message, the only + * reason it can fail is lack of memory. Even if the connection is disconnected, + * no error will be returned. + * + * If the function fails due to lack of memory, it returns FALSE. The function + * will never fail for other reasons; even if the connection is disconnected, + * you can queue an outgoing message, though obviously it won't be sent. + * + * The message serial is used by the remote application to send a reply; see + * Message::serial() or the D-Bus specification. + * + * \param msg The Message to write. + * \param serial Return location for message serial, or NULL if you don't care. + * \return true On success. + */ + bool send( const Message& msg, unsigned int* serial = NULL ); + + /*! + * \brief Sends a message and blocks a certain time period while waiting for a reply. + * + * This function does not reenter the main loop, i.e. messages other than the + * reply are queued up but not processed. This function is used to invoke + * method calls on a remote object. + * + * If a normal reply is received, it is returned, and removed from the + * incoming message queue. If it is not received, NULL is returned and the + * error is set to DBUS_ERROR_NO_REPLY. If an error reply is received, it is + * converted to a DBusError and returned as an error, then the reply message + * is deleted and NULL is returned. If something else goes wrong, result is + * set to whatever is appropriate, such as DBUS_ERROR_NO_MEMORY or DBUS_ERROR_DISCONNECTED. + * + * \warning While this function blocks the calling thread will not be + * processing the incoming message queue. This means you can end up + * deadlocked if the application you're talking to needs you to reply + * to a method. To solve this, either avoid the situation, block in a + * separate thread from the main connection-dispatching thread, or + * use PendingCall to avoid blocking. + * + * \param msg The Message to write. + * \param timeout Timeout in milliseconds (omit for default). + * \throw Error + */ + Message send_blocking( Message& msg, int timeout = -1); + + /*! + * \brief Queues a message to send, as with send(), but also + * returns a DBusPendingCall used to receive a reply to the message. + * + * If no reply is received in the given timeout_milliseconds, this function + * expires the pending reply and generates a synthetic error reply (generated + * in-process, not by the remote application) indicating that a timeout occurred. + * + * A PendingCall will see a reply message before any filters or registered + * object path handlers. See Connection::Private::do_dispatch() in dbus documentation + * for details on when handlers are run. (here: Connection::Private::do_dispatch()) + * + * A PendingCall will always see exactly one reply message, unless it's + * cancelled with PendingCall::cancel(). + * + * If -1 is passed for the timeout, a sane default timeout is used. -1 is + * typically the best value for the timeout for this reason, unless you want + * a very short or very long timeout. There is no way to avoid a timeout + * entirely, other than passing INT_MAX for the timeout to mean "very long + * timeout." libdbus clamps an INT_MAX timeout down to a few hours timeout though. + * + * \param msg The Message to write. + * \param timeout Timeout in milliseconds (omit for default). + * \throw ErrorNoMemory + */ + PendingCall send_async( Message& msg, int timeout = -1); + + void request_name( const char* name, int flags = 0 ); + + unsigned long sender_unix_uid(const char *sender); + + /*! + * \brief Asks the bus whether a certain name has an owner. + * + * Using this can easily result in a race condition, since an owner can appear + * or disappear after you call this. + * + * If you want to request a name, just request it; if you want to avoid + * replacing a current owner, don't specify DBUS_NAME_FLAG_REPLACE_EXISTING + * and you will get an error if there's already an owner. + * + * \param name The name. + * \throw Error + */ + bool has_name( const char* name ); + + /*! + * \brief Starts a service that will request ownership of the given name. + * + * The returned result will be one of be one of DBUS_START_REPLY_SUCCESS or + * DBUS_START_REPLY_ALREADY_RUNNING if successful. Pass NULL if you don't + * care about the result. + * + * The flags parameter is for future expansion, currently you should specify 0. + * + * It's often easier to avoid explicitly starting services, and just send a + * method call to the service's bus name instead. Method calls start a service + * to handle them by default unless you call dbus_message_set_auto_start() to + * disable this behavior. + * + * \todo dbus_message_set_auto_start() not yet wrapped! + */ + bool start_service( const char* name, unsigned long flags ); const std::vector<std::string>& names(); diff --git a/sflphone-common/libs/dbus-c++/include/dbus-c++/debug.h b/sflphone-common/libs/dbus-c++/include/dbus-c++/debug.h index 6ebd03d4ccd1e363453863dd9304733b2b5ce726..e66c79b3cfe54dea6af9e6fd1e99a2ac2cebac2c 100644 --- a/sflphone-common/libs/dbus-c++/include/dbus-c++/debug.h +++ b/sflphone-common/libs/dbus-c++/include/dbus-c++/debug.h @@ -25,10 +25,6 @@ #ifndef __DBUSXX_DEBUG_H #define __DBUSXX_DEBUG_H -#ifdef DBUS_HAVE_CONFIG_H -#include <dbus-c++/config.h> -#endif - #include "api.h" namespace DBus { diff --git a/sflphone-common/libs/dbus-c++/include/dbus-c++/dispatcher.h b/sflphone-common/libs/dbus-c++/include/dbus-c++/dispatcher.h index 7b7858b84c00eac6efd4fa20d8a137fcab2912c9..10179ffb31ed98057e3b473e4e2f6b0382b7f531 100644 --- a/sflphone-common/libs/dbus-c++/include/dbus-c++/dispatcher.h +++ b/sflphone-common/libs/dbus-c++/include/dbus-c++/dispatcher.h @@ -25,10 +25,6 @@ #ifndef __DBUSXX_DISPATCHER_H #define __DBUSXX_DISPATCHER_H -#ifdef DBUS_HAVE_CONFIG_H -#include <dbus-c++/config.h> -#endif - #include "api.h" #include "connection.h" #include "eventloop.h" @@ -45,10 +41,34 @@ public: virtual ~Timeout(){} + /*! + * \brief Gets the timeout interval. + * + * The dbus_timeout_handle() should be called each time this interval elapses, + * starting after it elapses once. + * + * The interval may change during the life of the timeout; if so, the timeout + * will be disabled and re-enabled (calling the "timeout toggled function") to + * notify you of the change. + * + * return The interval in miliseconds. + */ int interval() const; bool enabled() const; + /*! + * \brief Calls the timeout handler for this timeout. + * + * This function should be called when the timeout occurs. + * + * If this function returns FALSE, then there wasn't enough memory to handle + * the timeout. Typically just letting the timeout fire again next time it + * naturally times out is an adequate response to that problem, but you could + * try to do more if you wanted. + * + * return false If there wasn't enough memory. + */ bool handle(); virtual void toggle() = 0; @@ -72,12 +92,48 @@ public: virtual ~Watch(){} + /*! + * \brief A main loop could poll this descriptor to integrate dbus-c++. + * + * This function calls dbus_watch_get_socket() on win32 and + * dbus_watch_get_unix_fd() on all other systems. (see dbus documentation) + * + * @return The file descriptor. + */ int descriptor() const; + /*! + * \brief Gets flags from DBusWatchFlags indicating what conditions should be + * monitored on the file descriptor. + * + * The flags returned will only contain DBUS_WATCH_READABLE and DBUS_WATCH_WRITABLE, + * never DBUS_WATCH_HANGUP or DBUS_WATCH_ERROR; all watches implicitly include + * a watch for hangups, errors, and other exceptional conditions. + * + * @return The conditions to watch. + */ int flags() const; bool enabled() const; + /*! + * \brief Called to notify the D-Bus library when a previously-added watch + * is ready for reading or writing, or has an exception such as a hangup. + * + * If this function returns FALSE, then the file descriptor may still be + * ready for reading or writing, but more memory is needed in order to do the + * reading or writing. If you ignore the FALSE return, your application may + * spin in a busy loop on the file descriptor until memory becomes available, + * but nothing more catastrophic should happen. + * + * dbus_watch_handle() cannot be called during the DBusAddWatchFunction, as the + * connection will not be ready to handle that watch yet. + * + * It is not allowed to reference a DBusWatch after it has been passed to remove_function. + * + * @param flags The poll condition using DBusWatchFlags values. + * @return false If there wasn't enough memory. + */ bool handle(int flags); virtual void toggle() = 0; @@ -101,6 +157,7 @@ public: void queue_connection(Connection::Private *); void dispatch_pending(); + bool has_something_to_dispatch(); virtual void enter() = 0; @@ -165,16 +222,15 @@ protected: Internal *_int; }; -#ifndef DBUS_HAS_RECURSIVE_MUTEX typedef Mutex *(*MutexNewFn)(); +typedef void (*MutexUnlockFn)(Mutex *mx); + +#ifndef DBUS_HAS_RECURSIVE_MUTEX typedef bool (*MutexFreeFn)(Mutex *mx); typedef bool (*MutexLockFn)(Mutex *mx); -typedef void (*MutexUnlockFn)(Mutex *mx); #else -typedef Mutex *(*MutexNewFn)(); typedef void (*MutexFreeFn)(Mutex *mx); typedef void (*MutexLockFn)(Mutex *mx); -typedef void (*MutexUnlockFn)(Mutex *mx); #endif//DBUS_HAS_RECURSIVE_MUTEX typedef CondVar *(*CondVarNewFn)(); @@ -184,9 +240,7 @@ typedef bool (*CondVarWaitTimeoutFn)(CondVar *cv, Mutex *mx, int timeout); typedef void (*CondVarWakeOneFn)(CondVar *cv); typedef void (*CondVarWakeAllFn)(CondVar *cv); -#ifdef DBUS_HAS_THREADS_INIT_DEFAULT void DXXAPI _init_threading(); -#endif//DBUS_HAS_THREADS_INIT_DEFAULT void DXXAPI _init_threading( MutexNewFn, MutexFreeFn, MutexLockFn, MutexUnlockFn, diff --git a/sflphone-common/libs/dbus-c++/include/dbus-c++/ecore-integration.h b/sflphone-common/libs/dbus-c++/include/dbus-c++/ecore-integration.h new file mode 100644 index 0000000000000000000000000000000000000000..b475533a16dda9f52a7fd182d03d78b98d6dbe42 --- /dev/null +++ b/sflphone-common/libs/dbus-c++/include/dbus-c++/ecore-integration.h @@ -0,0 +1,114 @@ +/* + * + * D-Bus++ - C++ bindings for D-Bus + * + * Copyright (C) 2005-2007 Paolo Durante <shackan@gmail.com> + * + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + + +#ifndef __DBUSXX_ECORE_INTEGRATION_H +#define __DBUSXX_ECORE_INTEGRATION_H + +#include <Ecore.h> + +#include "api.h" +#include "dispatcher.h" +#include "Ecore.h" + +namespace DBus { + +namespace Ecore { + +class BusDispatcher; + +class DXXAPI BusTimeout : public Timeout +{ +private: + + BusTimeout( Timeout::Internal*); + + ~BusTimeout(); + + void toggle(); + + static int timeout_handler( void* ); + + void _enable(); + + void _disable(); + +private: + Ecore_Timer *_etimer; + +friend class BusDispatcher; +}; + +class DXXAPI BusWatch : public Watch +{ +private: + + BusWatch( Watch::Internal*); + + ~BusWatch(); + + void toggle(); + + static int watch_handler_read ( void*, Ecore_Fd_Handler *fdh); + + static int watch_handler_error ( void*, Ecore_Fd_Handler *fdh); + + void _enable(); + + void _disable(); + +private: + Ecore_Fd_Handler *fd_handler_read; + Ecore_Fd_Handler *fd_handler_error; + +friend class BusDispatcher; +}; + +class DXXAPI BusDispatcher : public Dispatcher +{ +public: + BusDispatcher() {} + + void attach(); + + void enter() {} + + void leave() {} + + Timeout* add_timeout( Timeout::Internal* ); + + void rem_timeout( Timeout* ); + + Watch* add_watch( Watch::Internal* ); + + void rem_watch( Watch* ); + +private: + +}; + +} /* namespace Ecore */ + +} /* namespace DBus */ + +#endif//__DBUSXX_ECORE_INTEGRATION_H diff --git a/sflphone-common/libs/dbus-c++/include/dbus-c++/error.h b/sflphone-common/libs/dbus-c++/include/dbus-c++/error.h index 152eb83000de770f4cd47c7217135cbbfe77dab0..7dec7bfe72e8318f1340a8fcd7a9c094c29379f1 100644 --- a/sflphone-common/libs/dbus-c++/include/dbus-c++/error.h +++ b/sflphone-common/libs/dbus-c++/include/dbus-c++/error.h @@ -25,10 +25,6 @@ #ifndef __DBUSXX_ERROR_H #define __DBUSXX_ERROR_H -#ifdef DBUS_HAVE_CONFIG_H -#include <dbus-c++/config.h> -#endif - #include "api.h" #include "util.h" diff --git a/sflphone-common/libs/dbus-c++/include/dbus-c++/eventloop-integration.h b/sflphone-common/libs/dbus-c++/include/dbus-c++/eventloop-integration.h index 1395129e1a044ef3cdeee57dc92cdf6cd699aa93..1bae382c36198e49aa55ab46e6f4cb4baab854fa 100644 --- a/sflphone-common/libs/dbus-c++/include/dbus-c++/eventloop-integration.h +++ b/sflphone-common/libs/dbus-c++/include/dbus-c++/eventloop-integration.h @@ -25,10 +25,6 @@ #ifndef __DBUSXX_EVENTLOOP_INTEGRATION_H #define __DBUSXX_EVENTLOOP_INTEGRATION_H -#ifdef DBUS_HAVE_CONFIG_H -#include <dbus-c++/config.h> -#endif - #include "api.h" #include "dispatcher.h" #include "util.h" diff --git a/sflphone-common/libs/dbus-c++/include/dbus-c++/eventloop.h b/sflphone-common/libs/dbus-c++/include/dbus-c++/eventloop.h index 6760ebd940725b02869ae55c2ce757b05f47b18a..f7d0f6d8c654033ababf55bdddc57e9a45b2d8e5 100644 --- a/sflphone-common/libs/dbus-c++/include/dbus-c++/eventloop.h +++ b/sflphone-common/libs/dbus-c++/include/dbus-c++/eventloop.h @@ -25,10 +25,6 @@ #ifndef __DBUSXX_EVENTLOOP_H #define __DBUSXX_EVENTLOOP_H -#ifdef DBUS_HAVE_CONFIG_H -#include <dbus-c++/config.h> -#endif - #include <pthread.h> #include <list> diff --git a/sflphone-common/libs/dbus-c++/include/dbus-c++/glib-integration.h b/sflphone-common/libs/dbus-c++/include/dbus-c++/glib-integration.h index 0bbd3472bfb2470b0f6bfd67bb917e12a1064c5e..76eae5ecf7c687e333d2816a50b3fbd210166322 100644 --- a/sflphone-common/libs/dbus-c++/include/dbus-c++/glib-integration.h +++ b/sflphone-common/libs/dbus-c++/include/dbus-c++/glib-integration.h @@ -25,10 +25,6 @@ #ifndef __DBUSXX_GLIB_INTEGRATION_H #define __DBUSXX_GLIB_INTEGRATION_H -#ifdef DBUS_HAVE_CONFIG_H -#include "config.h" -#endif - #include <glib.h> #include "api.h" @@ -94,7 +90,8 @@ class DXXAPI BusDispatcher : public Dispatcher { public: - BusDispatcher() : _ctx(NULL), _priority(G_PRIORITY_DEFAULT) {} + BusDispatcher(); + ~BusDispatcher(); void attach(GMainContext *); @@ -116,6 +113,7 @@ private: GMainContext *_ctx; int _priority; + GSource *_source; }; } /* namespace Glib */ diff --git a/sflphone-common/libs/dbus-c++/include/dbus-c++/interface.h b/sflphone-common/libs/dbus-c++/include/dbus-c++/interface.h index ea39fb752f209ad65f6dca8d364178af7de03134..86c8d18d1bf4089c0817b639905328e8fa36c299 100644 --- a/sflphone-common/libs/dbus-c++/include/dbus-c++/interface.h +++ b/sflphone-common/libs/dbus-c++/include/dbus-c++/interface.h @@ -25,10 +25,6 @@ #ifndef __DBUSXX_INTERFACE_H #define __DBUSXX_INTERFACE_H -#ifdef DBUS_HAVE_CONFIG_H -#include <dbus-c++/config.h> -#endif - #include <string> #include <map> #include "api.h" @@ -99,6 +95,8 @@ protected: {} virtual Message _invoke_method(CallMessage &) = 0; + + virtual bool _invoke_method_noreply(CallMessage &call) = 0; InterfaceProxyTable _interfaces; }; @@ -169,6 +167,8 @@ public: Message invoke_method(const CallMessage &); + bool invoke_method_noreply(const CallMessage &call); + bool dispatch_signal(const SignalMessage &); protected: diff --git a/sflphone-common/libs/dbus-c++/include/dbus-c++/introspection.h b/sflphone-common/libs/dbus-c++/include/dbus-c++/introspection.h index f909f0b165140a23a095c75f4523e85c12229246..5f0d1e4dfff5670d47be0ba0d238f7130fb5451d 100644 --- a/sflphone-common/libs/dbus-c++/include/dbus-c++/introspection.h +++ b/sflphone-common/libs/dbus-c++/include/dbus-c++/introspection.h @@ -25,10 +25,6 @@ #ifndef __DBUSXX_INTROSPECTION_H #define __DBUSXX_INTROSPECTION_H -#ifdef DBUS_HAVE_CONFIG_H -#include <dbus-c++/config.h> -#endif - #include "api.h" #include "interface.h" diff --git a/sflphone-common/libs/dbus-c++/include/dbus-c++/message.h b/sflphone-common/libs/dbus-c++/include/dbus-c++/message.h index 2be55298b3f9faa9e5bd68d6888864673d283929..ba326b7db89ad1c47171732d99950185f590f234 100644 --- a/sflphone-common/libs/dbus-c++/include/dbus-c++/message.h +++ b/sflphone-common/libs/dbus-c++/include/dbus-c++/message.h @@ -25,10 +25,6 @@ #ifndef __DBUSXX_MESSAGE_H #define __DBUSXX_MESSAGE_H -#ifdef DBUS_HAVE_CONFIG_H -#include <dbus-c++/config.h> -#endif - #include <string> #include <map> diff --git a/sflphone-common/libs/dbus-c++/include/dbus-c++/object.h b/sflphone-common/libs/dbus-c++/include/dbus-c++/object.h index 389f95fc605c1177c8e0fa71866041be304764bd..962bf77d38f847b838dc4e791c11454b98232f89 100644 --- a/sflphone-common/libs/dbus-c++/include/dbus-c++/object.h +++ b/sflphone-common/libs/dbus-c++/include/dbus-c++/object.h @@ -25,10 +25,6 @@ #ifndef __DBUSXX_OBJECT_H #define __DBUSXX_OBJECT_H -#ifdef DUS_HAVE_CONFIG_H -#include <dbus-c++/config.h> -#endif - #include <string> #include <list> @@ -205,6 +201,8 @@ public: private: Message _invoke_method(CallMessage &); + + bool _invoke_method_noreply(CallMessage &call); bool handle_message(const Message &); diff --git a/sflphone-common/libs/dbus-c++/include/dbus-c++/pendingcall.h b/sflphone-common/libs/dbus-c++/include/dbus-c++/pendingcall.h index c8946d43d098d78c454ca1df03db5a958fad0033..bfe5545adb4f0b5dfca141b6ba24fd050bba6aab 100644 --- a/sflphone-common/libs/dbus-c++/include/dbus-c++/pendingcall.h +++ b/sflphone-common/libs/dbus-c++/include/dbus-c++/pendingcall.h @@ -25,10 +25,6 @@ #ifndef __DBUSXX_PENDING_CALL_H #define __DBUSXX_PENDING_CALL_H -#ifdef DBUS_HAVE_CONFIG_H -#include <dbus-c++/config.h> -#endif - #include "api.h" #include "util.h" #include "message.h" @@ -51,18 +47,76 @@ public: PendingCall &operator = (const PendingCall &); + /*! + * \brief Checks whether the pending call has received a reply yet, or not. + * + * \return true If a reply has been received. + */ bool completed(); + /*! + * \brief Cancels the pending call, such that any reply or error received will + * just be ignored. + * + * Drops the dbus library's internal reference to the DBusPendingCall so will + * free the call if nobody else is holding a reference. However you usually + * get a reference from Connection::send_async() so probably your app + * owns a ref also. + * + * Note that canceling a pending call will not simulate a timed-out call; if a + * call times out, then a timeout error reply is received. If you cancel the + * call, no reply is received unless the the reply was already received before + * you canceled. + */ void cancel(); + /*! + * \brief Block until the pending call is completed. + * + * The blocking is as with Connection::send_blocking(); it + * does not enter the main loop or process other messages, it simply waits for + * the reply in question. + * + * If the pending call is already completed, this function returns immediately. + */ void block(); - void data(void *); - + /*! + * \brief Stores a pointer on a PendingCall, along with an optional function to + * be used for freeing the data when the data is set again, or when the + * pending call is finalized. + * + * The slot is allocated automatic. + * + * \param data The data to store. + * \throw ErrorNoMemory + */ + void data( void* data ); + + /*! + * \brief Retrieves data previously set with dbus_pending_call_set_data(). + * + * The slot must still be allocated (must not have been freed). + * + * \return The data, or NULL if not found. + */ void *data(); + /*! + * \return The data slot. + */ Slot<void, PendingCall &>& slot(); + /*! + * \brief Gets the reply + * + * Ownership of the reply message passes to the caller. This function can only + * be called once per pending call, since the reply message is tranferred to + * the caller. + * + * \return The reply Message. + * \throw ErrorNoReply + */ Message steal_reply(); private: diff --git a/sflphone-common/libs/dbus-c++/include/dbus-c++/property.h b/sflphone-common/libs/dbus-c++/include/dbus-c++/property.h index 20313b06600e8353e5114026e903fbe48fb81413..2e909cb58fd917ff6e895aab1f9d472457827a04 100644 --- a/sflphone-common/libs/dbus-c++/include/dbus-c++/property.h +++ b/sflphone-common/libs/dbus-c++/include/dbus-c++/property.h @@ -25,10 +25,6 @@ #ifndef __DBUSXX_PROPERTY_H #define __DBUSXX_PROPERTY_H -#ifdef DBUS_HAVE_CONFIG_H -#include <dbus-c++/config.h> -#endif - #include "api.h" #include "types.h" #include "interface.h" diff --git a/sflphone-common/libs/dbus-c++/include/dbus-c++/refptr_impl.h b/sflphone-common/libs/dbus-c++/include/dbus-c++/refptr_impl.h index d557c7b2dd47b20270f4e851dae03437ee2ac4ec..fc10cef825518e471f9a083c892b04b2e58a0ae7 100644 --- a/sflphone-common/libs/dbus-c++/include/dbus-c++/refptr_impl.h +++ b/sflphone-common/libs/dbus-c++/include/dbus-c++/refptr_impl.h @@ -25,10 +25,6 @@ #ifndef __DBUSXX_REFPTR_IMPL_H #define __DBUSXX_REFPTR_IMPL_H -#ifdef DBUS_HAVE_CONFIG_H -#include <dbus-c++/config.h> -#endif - #include "api.h" #include "util.h" diff --git a/sflphone-common/libs/dbus-c++/include/dbus-c++/server.h b/sflphone-common/libs/dbus-c++/include/dbus-c++/server.h index c380ca71f6791b0ee6a24804afcb7a3ccd37650e..30879bf3790e977b04abc8fddd08000fea03ba77 100644 --- a/sflphone-common/libs/dbus-c++/include/dbus-c++/server.h +++ b/sflphone-common/libs/dbus-c++/include/dbus-c++/server.h @@ -25,10 +25,6 @@ #ifndef __DBUSXX_SERVER_H #define __DBUSXX_SERVER_H -#ifdef DBUS_HAVE_CONFIG_H -#include <dbus-c++/config.h> -#endif - #include <list> #include "api.h" @@ -63,7 +59,7 @@ public: protected: - Server(const Server & /* s */) + Server(const Server &s) {} virtual void on_new_connection(Connection &c) = 0; diff --git a/sflphone-common/libs/dbus-c++/include/dbus-c++/types.h b/sflphone-common/libs/dbus-c++/include/dbus-c++/types.h index c5c60fd006e332d5ef950518782f27bd6d4c0747..c795891f14146af773b0da86af122567a9987d06 100644 --- a/sflphone-common/libs/dbus-c++/include/dbus-c++/types.h +++ b/sflphone-common/libs/dbus-c++/include/dbus-c++/types.h @@ -25,10 +25,6 @@ #ifndef __DBUSXX_TYPES_H #define __DBUSXX_TYPES_H -#ifdef _DBUS_HAVE_CONFIG_H -#include <dbus-c++/config.h> -#endif - #include <stdint.h> #include <string> #include <vector> diff --git a/sflphone-common/libs/dbus-c++/include/dbus-c++/util.h b/sflphone-common/libs/dbus-c++/include/dbus-c++/util.h index c0a8a488753f7ffbe2256dbbe0f95a129a572ac8..225e1cae65c95bb68ec6faa7481750d960427a8e 100644 --- a/sflphone-common/libs/dbus-c++/include/dbus-c++/util.h +++ b/sflphone-common/libs/dbus-c++/include/dbus-c++/util.h @@ -25,10 +25,6 @@ #ifndef __DBUSXX_UTIL_H #define __DBUSXX_UTIL_H -#ifdef DBUS_HAVE_CONFIG_H -#include <dbus-c++/config.h> -#endif - #include "api.h" #include "debug.h" diff --git a/sflphone-common/libs/dbus-c++/src/Makefile.am b/sflphone-common/libs/dbus-c++/src/Makefile.am index abb5abe4c82617725ad2b94194a0b0c97e050a35..2f96f4738336a813db1216767634a0c681f6b70d 100644 --- a/sflphone-common/libs/dbus-c++/src/Makefile.am +++ b/sflphone-common/libs/dbus-c++/src/Makefile.am @@ -1,6 +1,7 @@ AM_CPPFLAGS = \ $(dbus_CFLAGS) \ $(glib_CFLAGS) \ + $(PRIVATE_CFLAGS) \ -I$(top_srcdir)/libs/dbus-c++/include \ -I$(top_builddir)/libs/dbus-c++/include @@ -13,8 +14,7 @@ CONFIG_H = $(top_builddir)/libs/dbus-c++/include/dbus-c++/config.h HEADER_DIR = $(top_builddir)/libs/dbus-c++/include/dbus-c++ HEADER_FILES = \ - $(CONFIG_H) \ - $(HEADER_DIR)/dbus.h \ + $(HEADER_DIR)/dbus.h \ $(HEADER_DIR)/types.h \ $(HEADER_DIR)/connection.h \ $(HEADER_DIR)/property.h \ @@ -36,10 +36,10 @@ HEADER_FILES = \ $(GLIB_H) lib_includedir=$(includedir)/dbus-c++-1/dbus-c++/ -#lib_include_HEADERS = $(HEADER_FILES) +lib_include_HEADERS = $(HEADER_FILES) -noinst_LTLIBRARIES = libdbus-c++-1.la -libdbus_c___1_la_SOURCES = $(HEADER_FILES) interface.cpp object.cpp introspection.cpp debug.cpp types.cpp connection.cpp connection_p.h property.cpp dispatcher.cpp dispatcher_p.h pendingcall.cpp pendingcall_p.h error.cpp internalerror.h message.cpp message_p.h server.cpp server_p.h eventloop.cpp eventloop-integration.cpp $(GLIB_CPP) +lib_LTLIBRARIES = libdbus-c++-1.la +libdbus_c___1_la_SOURCES = $(HEADER_FILES) interface.cpp object.cpp introspection.cpp debug.cpp types.cpp connection.cpp connection_p.h property.cpp dispatcher.cpp dispatcher_p.h pendingcall.cpp pendingcall_p.h error.cpp internalerror.h message.cpp message_p.h server.cpp server_p.h eventloop.cpp eventloop-integration.cpp $(GLIB_CPP) $(ECORE_CPP) libdbus_c___1_la_LIBADD = $(dbus_LIBS) $(glib_LIBS) $(pthread_LIBS) MAINTAINERCLEANFILES = \ diff --git a/sflphone-common/libs/dbus-c++/src/connection.cpp b/sflphone-common/libs/dbus-c++/src/connection.cpp index 9b86f3a8493975ceedd8713d92b32bbb3cd54d04..b7b6729726731f238347799ca5846b371b722fbb 100644 --- a/sflphone-common/libs/dbus-c++/src/connection.cpp +++ b/sflphone-common/libs/dbus-c++/src/connection.cpp @@ -21,6 +21,9 @@ * */ +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif #include <dbus-c++/debug.h> #include <dbus-c++/connection.h> @@ -38,381 +41,396 @@ using namespace DBus; -Connection::Private::Private(DBusConnection *c, Server::Private *s) -: conn(c) , dispatcher(0), server(s) +Connection::Private::Private (DBusConnection *c, Server::Private *s) + : conn (c) , dispatcher (0), server (s) { - init(); + init(); } -Connection::Private::Private(DBusBusType type) +Connection::Private::Private (DBusBusType type) { - InternalError e; + InternalError e; - conn = dbus_bus_get(type, e); - // conn = dbus_bus_get_private(type, e); + conn = dbus_bus_get_private (type, e); - if (e) throw Error(e); + if (e) throw Error (e); - init(); + init(); } Connection::Private::~Private() { - debug_log("terminating connection 0x%08x", conn); + debug_log ("terminating connection 0x%08x", conn); - detach_server(); + detach_server(); - if (dbus_connection_get_is_connected(conn)) - { - std::vector<std::string>::iterator i = names.begin(); + if (dbus_connection_get_is_connected (conn)) { + std::vector<std::string>::iterator i = names.begin(); - while (i != names.end()) - { - debug_log("%s: releasing bus name %s", dbus_bus_get_unique_name(conn), i->c_str()); - dbus_bus_release_name(conn, i->c_str(), NULL); - ++i; - } - dbus_connection_close(conn); - } - dbus_connection_unref(conn); + while (i != names.end()) { + debug_log ("%s: releasing bus name %s", dbus_bus_get_unique_name (conn), i->c_str()); + dbus_bus_release_name (conn, i->c_str(), NULL); + ++i; + } + + dbus_connection_close (conn); + } + + dbus_connection_unref (conn); } void Connection::Private::init() { - dbus_connection_ref(conn); - dbus_connection_ref(conn); //todo: the library has to own another reference + dbus_connection_ref (conn); + dbus_connection_ref (conn); //todo: the library has to own another reference - disconn_filter = new Callback<Connection::Private, bool, const Message &>( - this, &Connection::Private::disconn_filter_function - ); + disconn_filter = new Callback<Connection::Private, bool, const Message &> ( + this, &Connection::Private::disconn_filter_function + ); - dbus_connection_add_filter(conn, message_filter_stub, &disconn_filter, NULL); + dbus_connection_add_filter (conn, message_filter_stub, &disconn_filter, NULL); // TODO: some assert at least - dbus_connection_set_dispatch_status_function(conn, dispatch_status_stub, this, 0); - dbus_connection_set_exit_on_disconnect(conn, false); //why was this set to true?? + dbus_connection_set_dispatch_status_function (conn, dispatch_status_stub, this, 0); + dbus_connection_set_exit_on_disconnect (conn, false); //why was this set to true?? } void Connection::Private::detach_server() { -/* Server::Private *tmp = server; + /* Server::Private *tmp = server; - server = NULL; + server = NULL; - if (tmp) - { - ConnectionList::iterator i; + if (tmp) + { + ConnectionList::iterator i; - for (i = tmp->connections.begin(); i != tmp->connections.end(); ++i) - { - if (i->_pvt.get() == this) - { - tmp->connections.erase(i); - break; - } - } - }*/ + for (i = tmp->connections.begin(); i != tmp->connections.end(); ++i) + { + if (i->_pvt.get() == this) + { + tmp->connections.erase(i); + break; + } + } + }*/ } bool Connection::Private::do_dispatch() { - debug_log("dispatching on %p", conn); + debug_log ("dispatching on %p", conn); - if (!dbus_connection_get_is_connected(conn)) - { - debug_log("connection terminated"); + if (!dbus_connection_get_is_connected (conn)) { + debug_log ("connection terminated"); - detach_server(); + detach_server(); - return true; - } + return true; + } - return dbus_connection_dispatch(conn) != DBUS_DISPATCH_DATA_REMAINS; + return dbus_connection_dispatch (conn) != DBUS_DISPATCH_DATA_REMAINS; } -void Connection::Private::dispatch_status_stub(DBusConnection *dc, DBusDispatchStatus status, void *data) +void Connection::Private::dispatch_status_stub (DBusConnection *dc, DBusDispatchStatus status, void *data) { - Private *p = static_cast<Private *>(data); + Private *p = static_cast<Private *> (data); + + switch (status) { + + case DBUS_DISPATCH_DATA_REMAINS: + debug_log ("some dispatching to do on %p", dc); + p->dispatcher->queue_connection (p); + break; + + case DBUS_DISPATCH_COMPLETE: + debug_log ("all dispatching done on %p", dc); + break; + + case DBUS_DISPATCH_NEED_MEMORY: //uh oh... + debug_log ("connection %p needs memory", dc); + break; + } +} - switch (status) - { - case DBUS_DISPATCH_DATA_REMAINS: - debug_log("some dispatching to do on %p", dc); - p->dispatcher->queue_connection(p); - break; +DBusHandlerResult Connection::Private::message_filter_stub (DBusConnection *conn, DBusMessage *dmsg, void *data) +{ + MessageSlot *slot = static_cast<MessageSlot *> (data); - case DBUS_DISPATCH_COMPLETE: - debug_log("all dispatching done on %p", dc); - break; + Message msg = Message (new Message::Private (dmsg)); - case DBUS_DISPATCH_NEED_MEMORY: //uh oh... - debug_log("connection %p needs memory", dc); - break; - } + return slot && !slot->empty() && slot->call (msg) + ? DBUS_HANDLER_RESULT_HANDLED + : DBUS_HANDLER_RESULT_NOT_YET_HANDLED; } -DBusHandlerResult Connection::Private::message_filter_stub(DBusConnection *conn, DBusMessage *dmsg, void *data) +bool Connection::Private::disconn_filter_function (const Message &msg) { - MessageSlot *slot = static_cast<MessageSlot *>(data); + if (msg.is_signal (DBUS_INTERFACE_LOCAL,"Disconnected")) { + debug_log ("%p disconnected by local bus", conn); + dbus_connection_close (conn); - Message msg = Message(new Message::Private(dmsg)); + return true; + } - return slot && !slot->empty() && slot->call(msg) - ? DBUS_HANDLER_RESULT_HANDLED - : DBUS_HANDLER_RESULT_NOT_YET_HANDLED; + return false; } -bool Connection::Private::disconn_filter_function(const Message &msg) +DBusDispatchStatus Connection::Private::dispatch_status() { - if (msg.is_signal(DBUS_INTERFACE_LOCAL,"Disconnected")) - { - debug_log("%p disconnected by local bus", conn); - dbus_connection_close(conn); + return dbus_connection_get_dispatch_status (conn); +} - return true; - } - return false; +bool Connection::Private::has_something_to_dispatch() +{ + return dispatch_status() == DBUS_DISPATCH_DATA_REMAINS; } + Connection Connection::SystemBus() { - return Connection(new Private(DBUS_BUS_SYSTEM)); + return Connection (new Private (DBUS_BUS_SYSTEM)); } Connection Connection::SessionBus() { - return Connection(new Private(DBUS_BUS_SESSION)); + return Connection (new Private (DBUS_BUS_SESSION)); } Connection Connection::ActivationBus() { - return Connection(new Private(DBUS_BUS_STARTER)); + return Connection (new Private (DBUS_BUS_STARTER)); } -Connection::Connection(const char *address, bool priv) +Connection::Connection (const char *address, bool priv) { - InternalError e; + InternalError e; + DBusConnection *conn = priv + ? dbus_connection_open_private (address, e) + : dbus_connection_open (address, e); - /* - DBusConnection *conn = priv - ? dbus_connection_open_private(address, e) - : dbus_connection_open(address, e); - */ - DBusConnection *conn = dbus_connection_open(address, e); - - if (e) throw Error(e); + if (e) throw Error (e); - _pvt = new Private(conn); + _pvt = new Private (conn); - setup(default_dispatcher); + setup (default_dispatcher); - debug_log("connected to %s", address); + debug_log ("connected to %s", address); } -Connection::Connection(Connection::Private *p) -: _pvt(p) +Connection::Connection (Connection::Private *p) + : _pvt (p) { - setup(default_dispatcher); + setup (default_dispatcher); } -Connection::Connection(const Connection &c) -: _pvt(c._pvt) +Connection::Connection (const Connection &c) + : _pvt (c._pvt) { - dbus_connection_ref(_pvt->conn); + dbus_connection_ref (_pvt->conn); } Connection::~Connection() { - dbus_connection_unref(_pvt->conn); + dbus_connection_unref (_pvt->conn); } -Dispatcher *Connection::setup(Dispatcher *dispatcher) +Dispatcher *Connection::setup (Dispatcher *dispatcher) { - debug_log("registering stubs for connection %p", _pvt->conn); + debug_log ("registering stubs for connection %p", _pvt->conn); - if (!dispatcher) dispatcher = default_dispatcher; + if (!dispatcher) dispatcher = default_dispatcher; - if (!dispatcher) throw ErrorFailed("no default dispatcher set for new connection"); + if (!dispatcher) throw ErrorFailed ("no default dispatcher set for new connection"); - Dispatcher *prev = _pvt->dispatcher; + Dispatcher *prev = _pvt->dispatcher; - _pvt->dispatcher = dispatcher; + _pvt->dispatcher = dispatcher; - dispatcher->queue_connection(_pvt.get()); + dispatcher->queue_connection (_pvt.get()); - dbus_connection_set_watch_functions( - _pvt->conn, - Dispatcher::Private::on_add_watch, - Dispatcher::Private::on_rem_watch, - Dispatcher::Private::on_toggle_watch, - dispatcher, - 0 - ); + dbus_connection_set_watch_functions ( + _pvt->conn, + Dispatcher::Private::on_add_watch, + Dispatcher::Private::on_rem_watch, + Dispatcher::Private::on_toggle_watch, + dispatcher, + 0 + ); - dbus_connection_set_timeout_functions( - _pvt->conn, - Dispatcher::Private::on_add_timeout, - Dispatcher::Private::on_rem_timeout, - Dispatcher::Private::on_toggle_timeout, - dispatcher, - 0 - ); + dbus_connection_set_timeout_functions ( + _pvt->conn, + Dispatcher::Private::on_add_timeout, + Dispatcher::Private::on_rem_timeout, + Dispatcher::Private::on_toggle_timeout, + dispatcher, + 0 + ); - return prev; + return prev; } bool Connection::operator == (const Connection &c) const { - return _pvt->conn == c._pvt->conn; + return _pvt->conn == c._pvt->conn; } bool Connection::register_bus() { - InternalError e; + InternalError e; + + bool r = dbus_bus_register (_pvt->conn, e); - bool r = dbus_bus_register(_pvt->conn, e); - - if (e) throw (e); + if (e) throw (e); - return r; + return r; } bool Connection::connected() const { - return dbus_connection_get_is_connected(_pvt->conn); + return dbus_connection_get_is_connected (_pvt->conn); } void Connection::disconnect() { // dbus_connection_disconnect(_pvt->conn); // disappeared in 0.9x - dbus_connection_close(_pvt->conn); + dbus_connection_close (_pvt->conn); } -void Connection::exit_on_disconnect(bool exit) +void Connection::exit_on_disconnect (bool exit) { - dbus_connection_set_exit_on_disconnect(_pvt->conn, exit); + dbus_connection_set_exit_on_disconnect (_pvt->conn, exit); } -bool Connection::unique_name(const char *n) +bool Connection::unique_name (const char *n) { - return dbus_bus_set_unique_name(_pvt->conn, n); + return dbus_bus_set_unique_name (_pvt->conn, n); } const char *Connection::unique_name() const { - return dbus_bus_get_unique_name(_pvt->conn); + return dbus_bus_get_unique_name (_pvt->conn); } void Connection::flush() { - dbus_connection_flush(_pvt->conn); + dbus_connection_flush (_pvt->conn); } -void Connection::add_match(const char *rule) +void Connection::add_match (const char *rule) { - InternalError e; + InternalError e; - dbus_bus_add_match(_pvt->conn, rule, e); + dbus_bus_add_match (_pvt->conn, rule, e); - debug_log("%s: added match rule %s", unique_name(), rule); + debug_log ("%s: added match rule %s", unique_name(), rule); - if (e) throw Error(e); + if (e) throw Error (e); } -void Connection::remove_match(const char *rule) +void Connection::remove_match (const char *rule) { - InternalError e; - - dbus_bus_remove_match(_pvt->conn, rule, e); + InternalError e; - debug_log("%s: removed match rule %s", unique_name(), rule); + dbus_bus_remove_match (_pvt->conn, rule, e); - if (e) throw Error(e); + debug_log ("%s: removed match rule %s", unique_name(), rule); + + if (e) throw Error (e); } -bool Connection::add_filter(MessageSlot &s) +bool Connection::add_filter (MessageSlot &s) { - debug_log("%s: adding filter", unique_name()); - return dbus_connection_add_filter(_pvt->conn, Private::message_filter_stub, &s, NULL); + debug_log ("%s: adding filter", unique_name()); + return dbus_connection_add_filter (_pvt->conn, Private::message_filter_stub, &s, NULL); } -void Connection::remove_filter(MessageSlot &s) +void Connection::remove_filter (MessageSlot &s) { - debug_log("%s: removing filter", unique_name()); - dbus_connection_remove_filter(_pvt->conn, Private::message_filter_stub, &s); + debug_log ("%s: removing filter", unique_name()); + dbus_connection_remove_filter (_pvt->conn, Private::message_filter_stub, &s); } -bool Connection::send(const Message &msg, unsigned int *serial) +bool Connection::send (const Message &msg, unsigned int *serial) { - return dbus_connection_send(_pvt->conn, msg._pvt->msg, serial); + return dbus_connection_send (_pvt->conn, msg._pvt->msg, serial); } -Message Connection::send_blocking(Message &msg, int timeout) +Message Connection::send_blocking (Message &msg, int timeout) { - DBusMessage *reply; - InternalError e; - - reply = dbus_connection_send_with_reply_and_block(_pvt->conn, msg._pvt->msg, timeout, e); + DBusMessage *reply; + InternalError e; + + reply = dbus_connection_send_with_reply_and_block (_pvt->conn, msg._pvt->msg, timeout, e); - if (e) throw Error(e); + if (e) throw Error (e); - return Message(new Message::Private(reply), false); + return Message (new Message::Private (reply), false); } -PendingCall Connection::send_async(Message &msg, int timeout) +PendingCall Connection::send_async (Message &msg, int timeout) { - DBusPendingCall *pending; + DBusPendingCall *pending; + + if (!dbus_connection_send_with_reply (_pvt->conn, msg._pvt->msg, &pending, timeout)) { + throw ErrorNoMemory ("Unable to start asynchronous call"); + } - if (!dbus_connection_send_with_reply(_pvt->conn, msg._pvt->msg, &pending, timeout)) - { - throw ErrorNoMemory("Unable to start asynchronous call"); - } - return PendingCall(new PendingCall::Private(pending)); + return PendingCall (new PendingCall::Private (pending)); } -void Connection::request_name(const char *name, int flags) +void Connection::request_name (const char *name, int flags) { - InternalError e; + InternalError e; - debug_log("%s: registering bus name %s", unique_name(), name); + debug_log ("%s: registering bus name %s", unique_name(), name); - dbus_bus_request_name(_pvt->conn, name, flags, e); //we deliberately don't check return value + dbus_bus_request_name (_pvt->conn, name, flags, e); //we deliberately don't check return value - if (e) throw Error(e); + if (e) throw Error (e); // this->remove_match("destination"); - if (name) - { - _pvt->names.push_back(name); - std::string match = "destination='" + _pvt->names.back() + "'"; - add_match(match.c_str()); - } + if (name) { + _pvt->names.push_back (name); + std::string match = "destination='" + _pvt->names.back() + "'"; + add_match (match.c_str()); + } } -bool Connection::has_name(const char *name) -{ - InternalError e; +unsigned long Connection::sender_unix_uid (const char *sender) +{ + InternalError e; - bool b = dbus_bus_name_has_owner(_pvt->conn, name, e); + unsigned long ul = dbus_bus_get_unix_user (_pvt->conn, sender, e); - if (e) throw Error(e); + if (e) throw Error (e); - return b; + return ul; +} + +bool Connection::has_name (const char *name) +{ + InternalError e; + + bool b = dbus_bus_name_has_owner (_pvt->conn, name, e); + + if (e) throw Error (e); + + return b; } const std::vector<std::string>& Connection::names() { - return _pvt->names; + return _pvt->names; } -bool Connection::start_service(const char *name, unsigned long flags) +bool Connection::start_service (const char *name, unsigned long flags) { - InternalError e; + InternalError e; + + bool b = dbus_bus_start_service_by_name (_pvt->conn, name, flags, NULL, e); - bool b = dbus_bus_start_service_by_name(_pvt->conn, name, flags, NULL, e); + if (e) throw Error (e); - if (e) throw Error(e); - - return b; + return b; } diff --git a/sflphone-common/libs/dbus-c++/src/connection_p.h b/sflphone-common/libs/dbus-c++/src/connection_p.h index 21643829b808faf4b891733eeb08e921b74b4e48..a6ea96cdd071d9db4f59824b7809449f77e2f3d4 100644 --- a/sflphone-common/libs/dbus-c++/src/connection_p.h +++ b/sflphone-common/libs/dbus-c++/src/connection_p.h @@ -26,7 +26,7 @@ #define __DBUSXX_CONNECTION_P_H #ifdef HAVE_CONFIG_H -#include "config.h" +#include <config.h> #endif #include <dbus-c++/connection.h> @@ -63,6 +63,9 @@ struct DXXAPILOCAL Connection::Private void init(); + DBusDispatchStatus dispatch_status(); + bool has_something_to_dispatch(); + static void dispatch_status_stub(DBusConnection *, DBusDispatchStatus, void *); static DBusHandlerResult message_filter_stub(DBusConnection *, DBusMessage *, void *); diff --git a/sflphone-common/libs/dbus-c++/src/debug.cpp b/sflphone-common/libs/dbus-c++/src/debug.cpp index 4ca2c782ce57e4b6cebd888c58938c3c17c577b0..213a784d05a4a7672a86fc0825e8e0c83a4bdaf4 100644 --- a/sflphone-common/libs/dbus-c++/src/debug.cpp +++ b/sflphone-common/libs/dbus-c++/src/debug.cpp @@ -21,6 +21,9 @@ * */ +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif #include <dbus-c++/debug.h> @@ -28,23 +31,22 @@ #include <cstdio> #include <stdlib.h> -static void _debug_log_default(const char *format, ...) +static void _debug_log_default (const char *format, ...) { #ifdef DEBUG - static int debug_env = getenv("DBUSXX_VERBOSE") ? 1 : 0; + static int debug_env = getenv ("DBUSXX_VERBOSE") ? 1 : 0; - if (debug_env) - { - va_list args; - va_start(args, format); + if (debug_env) { + va_list args; + va_start (args, format); - fprintf(stderr, "dbus-c++: "); - vfprintf(stderr, format, args); - fprintf(stderr, "\n"); + fprintf (stderr, "dbus-c++: "); + vfprintf (stderr, format, args); + fprintf (stderr, "\n"); - va_end(args); - } + va_end (args); + } #endif//DEBUG } diff --git a/sflphone-common/libs/dbus-c++/src/dispatcher.cpp b/sflphone-common/libs/dbus-c++/src/dispatcher.cpp index 9752afe4030dd45eb90f48be60f8254ce7b3b0b4..e71bae99fd48a0309d9f6f1c30e57bd3da8ee90e 100644 --- a/sflphone-common/libs/dbus-c++/src/dispatcher.cpp +++ b/sflphone-common/libs/dbus-c++/src/dispatcher.cpp @@ -21,6 +21,9 @@ * */ +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif #include <dbus-c++/dispatcher.h> @@ -34,213 +37,237 @@ DBus::Dispatcher *DBus::default_dispatcher = NULL; using namespace DBus; -Timeout::Timeout(Timeout::Internal *i) -: _int(i) +Timeout::Timeout (Timeout::Internal *i) + : _int (i) { - dbus_timeout_set_data((DBusTimeout *)i, this, NULL); + dbus_timeout_set_data ( (DBusTimeout *) i, this, NULL); } int Timeout::interval() const { - return dbus_timeout_get_interval((DBusTimeout *)_int); + return dbus_timeout_get_interval ( (DBusTimeout *) _int); } bool Timeout::enabled() const { - return dbus_timeout_get_enabled((DBusTimeout *)_int); + return dbus_timeout_get_enabled ( (DBusTimeout *) _int); } bool Timeout::handle() { - return dbus_timeout_handle((DBusTimeout *)_int); + return dbus_timeout_handle ( (DBusTimeout *) _int); } /* */ -Watch::Watch(Watch::Internal *i) -: _int(i) +Watch::Watch (Watch::Internal *i) + : _int (i) { - dbus_watch_set_data((DBusWatch *)i, this, NULL); + dbus_watch_set_data ( (DBusWatch *) i, this, NULL); } int Watch::descriptor() const { - return dbus_watch_get_fd((DBusWatch *)_int); +#if HAVE_WIN32 + return dbus_watch_get_socket ( (DBusWatch*) _int); +#else + return dbus_watch_get_unix_fd ( (DBusWatch*) _int); +#endif } int Watch::flags() const { - return dbus_watch_get_flags((DBusWatch *)_int); + return dbus_watch_get_flags ( (DBusWatch *) _int); } bool Watch::enabled() const { - return dbus_watch_get_enabled((DBusWatch *)_int); + return dbus_watch_get_enabled ( (DBusWatch *) _int); } -bool Watch::handle(int flags) +bool Watch::handle (int flags) { - return dbus_watch_handle((DBusWatch *)_int, flags); + return dbus_watch_handle ( (DBusWatch *) _int, flags); } /* */ -dbus_bool_t Dispatcher::Private::on_add_watch(DBusWatch *watch, void *data) +dbus_bool_t Dispatcher::Private::on_add_watch (DBusWatch *watch, void *data) { - Dispatcher *d = static_cast<Dispatcher *>(data); + Dispatcher *d = static_cast<Dispatcher *> (data); - Watch::Internal *w = reinterpret_cast<Watch::Internal *>(watch); + Watch::Internal *w = reinterpret_cast<Watch::Internal *> (watch); - d->add_watch(w); + d->add_watch (w); - return true; + return true; } -void Dispatcher::Private::on_rem_watch(DBusWatch *watch, void *data) +void Dispatcher::Private::on_rem_watch (DBusWatch *watch, void *data) { - Dispatcher *d = static_cast<Dispatcher *>(data); + Dispatcher *d = static_cast<Dispatcher *> (data); - Watch *w = static_cast<Watch *>(dbus_watch_get_data(watch)); + Watch *w = static_cast<Watch *> (dbus_watch_get_data (watch)); - d->rem_watch(w); + d->rem_watch (w); } -void Dispatcher::Private::on_toggle_watch(DBusWatch *watch, void *data) +void Dispatcher::Private::on_toggle_watch (DBusWatch *watch, void *data) { - Watch *w = static_cast<Watch *>(dbus_watch_get_data(watch)); + Watch *w = static_cast<Watch *> (dbus_watch_get_data (watch)); - w->toggle(); + w->toggle(); } -dbus_bool_t Dispatcher::Private::on_add_timeout(DBusTimeout *timeout, void *data) +dbus_bool_t Dispatcher::Private::on_add_timeout (DBusTimeout *timeout, void *data) { - Dispatcher *d = static_cast<Dispatcher *>(data); + Dispatcher *d = static_cast<Dispatcher *> (data); - Timeout::Internal *t = reinterpret_cast<Timeout::Internal *>(timeout); + Timeout::Internal *t = reinterpret_cast<Timeout::Internal *> (timeout); - d->add_timeout(t); + d->add_timeout (t); - return true; + return true; } -void Dispatcher::Private::on_rem_timeout(DBusTimeout *timeout, void *data) +void Dispatcher::Private::on_rem_timeout (DBusTimeout *timeout, void *data) { - Dispatcher *d = static_cast<Dispatcher *>(data); + Dispatcher *d = static_cast<Dispatcher *> (data); - Timeout *t = static_cast<Timeout *>(dbus_timeout_get_data(timeout)); + Timeout *t = static_cast<Timeout *> (dbus_timeout_get_data (timeout)); - d->rem_timeout(t); + d->rem_timeout (t); } -void Dispatcher::Private::on_toggle_timeout(DBusTimeout *timeout, void *data) +void Dispatcher::Private::on_toggle_timeout (DBusTimeout *timeout, void *data) { - Timeout *t = static_cast<Timeout *>(dbus_timeout_get_data(timeout)); + Timeout *t = static_cast<Timeout *> (dbus_timeout_get_data (timeout)); - t->toggle(); + t->toggle(); } -void Dispatcher::queue_connection(Connection::Private *cp) +void Dispatcher::queue_connection (Connection::Private *cp) { - _mutex_p.lock(); - _pending_queue.push_back(cp); - _mutex_p.unlock(); + _mutex_p.lock(); + _pending_queue.push_back (cp); + _mutex_p.unlock(); } + +bool Dispatcher::has_something_to_dispatch() +{ + _mutex_p.lock(); + bool has_something = false; + + for (Connection::PrivatePList::iterator it = _pending_queue.begin(); + it != _pending_queue.end() && !has_something; + ++it) { + has_something = (*it)->has_something_to_dispatch(); + } + + _mutex_p.unlock(); + + return has_something; +} + + void Dispatcher::dispatch_pending() { - _mutex_p.lock(); + _mutex_p.lock(); - while (_pending_queue.size() > 0) - { - Connection::PrivatePList::iterator i, j; - - i = _pending_queue.begin(); + // SEEME: dbus-glib is dispatching only one message at a time to not starve the loop/other things... - while (i != _pending_queue.end()) - { - j = i; - - ++j; + while (_pending_queue.size() > 0) { + Connection::PrivatePList::iterator i, j; - if ((*i)->do_dispatch()) - _pending_queue.erase(i); + i = _pending_queue.begin(); - i = j; - } - } - _mutex_p.unlock(); + while (i != _pending_queue.end()) { + j = i; + + ++j; + + if ( (*i)->do_dispatch()) + _pending_queue.erase (i); + + i = j; + } + } + + _mutex_p.unlock(); } -#undef DBUS_HAS_THREADS_INIT_DEFAULT -#ifdef DBUS_HAS_THREADS_INIT_DEFAULT void DBus::_init_threading() { - dbus_threads_init_default(); -} +#ifdef DBUS_HAS_THREADS_INIT_DEFAULT + dbus_threads_init_default(); +#else + debug_log ("Thread support is not enabled! Your D-Bus version is too old!"); #endif//DBUS_HAS_THREADS_INIT_DEFAULT +} -void DBus::_init_threading( - MutexNewFn m1, - MutexFreeFn m2, - MutexLockFn m3, - MutexUnlockFn m4, - CondVarNewFn c1, - CondVarFreeFn c2, - CondVarWaitFn c3, - CondVarWaitTimeoutFn c4, - CondVarWakeOneFn c5, - CondVarWakeAllFn c6 +void DBus::_init_threading ( + MutexNewFn m1, + MutexFreeFn m2, + MutexLockFn m3, + MutexUnlockFn m4, + CondVarNewFn c1, + CondVarFreeFn c2, + CondVarWaitFn c3, + CondVarWaitTimeoutFn c4, + CondVarWakeOneFn c5, + CondVarWakeAllFn c6 ) { #ifndef DBUS_HAS_RECURSIVE_MUTEX - DBusThreadFunctions functions = { - DBUS_THREAD_FUNCTIONS_MUTEX_NEW_MASK | - DBUS_THREAD_FUNCTIONS_MUTEX_FREE_MASK | - DBUS_THREAD_FUNCTIONS_MUTEX_LOCK_MASK | - DBUS_THREAD_FUNCTIONS_MUTEX_UNLOCK_MASK | - DBUS_THREAD_FUNCTIONS_CONDVAR_NEW_MASK | - DBUS_THREAD_FUNCTIONS_CONDVAR_FREE_MASK | - DBUS_THREAD_FUNCTIONS_CONDVAR_WAIT_MASK | - DBUS_THREAD_FUNCTIONS_CONDVAR_WAIT_TIMEOUT_MASK | - DBUS_THREAD_FUNCTIONS_CONDVAR_WAKE_ONE_MASK| - DBUS_THREAD_FUNCTIONS_CONDVAR_WAKE_ALL_MASK, - (DBusMutexNewFunction) m1, - (DBusMutexFreeFunction) m2, - (DBusMutexLockFunction) m3, - (DBusMutexUnlockFunction) m4, - (DBusCondVarNewFunction) c1, - (DBusCondVarFreeFunction) c2, - (DBusCondVarWaitFunction) c3, - (DBusCondVarWaitTimeoutFunction) c4, - (DBusCondVarWakeOneFunction) c5, - (DBusCondVarWakeAllFunction) c6 - }; + DBusThreadFunctions functions = { + DBUS_THREAD_FUNCTIONS_MUTEX_NEW_MASK | + DBUS_THREAD_FUNCTIONS_MUTEX_FREE_MASK | + DBUS_THREAD_FUNCTIONS_MUTEX_LOCK_MASK | + DBUS_THREAD_FUNCTIONS_MUTEX_UNLOCK_MASK | + DBUS_THREAD_FUNCTIONS_CONDVAR_NEW_MASK | + DBUS_THREAD_FUNCTIONS_CONDVAR_FREE_MASK | + DBUS_THREAD_FUNCTIONS_CONDVAR_WAIT_MASK | + DBUS_THREAD_FUNCTIONS_CONDVAR_WAIT_TIMEOUT_MASK | + DBUS_THREAD_FUNCTIONS_CONDVAR_WAKE_ONE_MASK| + DBUS_THREAD_FUNCTIONS_CONDVAR_WAKE_ALL_MASK, + (DBusMutexNewFunction) m1, + (DBusMutexFreeFunction) m2, + (DBusMutexLockFunction) m3, + (DBusMutexUnlockFunction) m4, + (DBusCondVarNewFunction) c1, + (DBusCondVarFreeFunction) c2, + (DBusCondVarWaitFunction) c3, + (DBusCondVarWaitTimeoutFunction) c4, + (DBusCondVarWakeOneFunction) c5, + (DBusCondVarWakeAllFunction) c6 + }; #else - DBusThreadFunctions functions = { - DBUS_THREAD_FUNCTIONS_RECURSIVE_MUTEX_NEW_MASK | - DBUS_THREAD_FUNCTIONS_RECURSIVE_MUTEX_FREE_MASK | - DBUS_THREAD_FUNCTIONS_RECURSIVE_MUTEX_LOCK_MASK | - DBUS_THREAD_FUNCTIONS_RECURSIVE_MUTEX_UNLOCK_MASK | - DBUS_THREAD_FUNCTIONS_CONDVAR_NEW_MASK | - DBUS_THREAD_FUNCTIONS_CONDVAR_FREE_MASK | - DBUS_THREAD_FUNCTIONS_CONDVAR_WAIT_MASK | - DBUS_THREAD_FUNCTIONS_CONDVAR_WAIT_TIMEOUT_MASK | - DBUS_THREAD_FUNCTIONS_CONDVAR_WAKE_ONE_MASK| - DBUS_THREAD_FUNCTIONS_CONDVAR_WAKE_ALL_MASK, - 0, 0, 0, 0, - (DBusCondVarNewFunction) c1, - (DBusCondVarFreeFunction) c2, - (DBusCondVarWaitFunction) c3, - (DBusCondVarWaitTimeoutFunction) c4, - (DBusCondVarWakeOneFunction) c5, - (DBusCondVarWakeAllFunction) c6, - (DBusRecursiveMutexNewFunction) m1, - (DBusRecursiveMutexFreeFunction) m2, - (DBusRecursiveMutexLockFunction) m3, - (DBusRecursiveMutexUnlockFunction) m4 - }; + DBusThreadFunctions functions = { + DBUS_THREAD_FUNCTIONS_RECURSIVE_MUTEX_NEW_MASK | + DBUS_THREAD_FUNCTIONS_RECURSIVE_MUTEX_FREE_MASK | + DBUS_THREAD_FUNCTIONS_RECURSIVE_MUTEX_LOCK_MASK | + DBUS_THREAD_FUNCTIONS_RECURSIVE_MUTEX_UNLOCK_MASK | + DBUS_THREAD_FUNCTIONS_CONDVAR_NEW_MASK | + DBUS_THREAD_FUNCTIONS_CONDVAR_FREE_MASK | + DBUS_THREAD_FUNCTIONS_CONDVAR_WAIT_MASK | + DBUS_THREAD_FUNCTIONS_CONDVAR_WAIT_TIMEOUT_MASK | + DBUS_THREAD_FUNCTIONS_CONDVAR_WAKE_ONE_MASK| + DBUS_THREAD_FUNCTIONS_CONDVAR_WAKE_ALL_MASK, + 0, 0, 0, 0, + (DBusCondVarNewFunction) c1, + (DBusCondVarFreeFunction) c2, + (DBusCondVarWaitFunction) c3, + (DBusCondVarWaitTimeoutFunction) c4, + (DBusCondVarWakeOneFunction) c5, + (DBusCondVarWakeAllFunction) c6, + (DBusRecursiveMutexNewFunction) m1, + (DBusRecursiveMutexFreeFunction) m2, + (DBusRecursiveMutexLockFunction) m3, + (DBusRecursiveMutexUnlockFunction) m4 + }; #endif//DBUS_HAS_RECURSIVE_MUTEX - dbus_threads_init(&functions); + dbus_threads_init (&functions); } diff --git a/sflphone-common/libs/dbus-c++/src/dispatcher_p.h b/sflphone-common/libs/dbus-c++/src/dispatcher_p.h index ece33b7be80d8ef2cda3cf9a500674fc44d2b0a8..33c0cac3906fe639188ecdba5bb145c18d22a113 100644 --- a/sflphone-common/libs/dbus-c++/src/dispatcher_p.h +++ b/sflphone-common/libs/dbus-c++/src/dispatcher_p.h @@ -26,7 +26,7 @@ #define __DBUSXX_DISPATCHER_P_H #ifdef HAVE_CONFIG_H -#include "config.h" +#include <config.h> #endif #include <dbus-c++/dispatcher.h> diff --git a/sflphone-common/libs/dbus-c++/src/ecore-integration.cpp b/sflphone-common/libs/dbus-c++/src/ecore-integration.cpp new file mode 100644 index 0000000000000000000000000000000000000000..d18d4b1136cc2b43de1f4eaa22841cb4fb4c8f80 --- /dev/null +++ b/sflphone-common/libs/dbus-c++/src/ecore-integration.cpp @@ -0,0 +1,213 @@ +/* + * + * D-Bus++ - C++ bindings for D-Bus + * + * Copyright (C) 2005-2007 Paolo Durante <shackan@gmail.com> + * + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + +#include <dbus-c++/ecore-integration.h> + +#include <dbus/dbus.h> // for DBUS_WATCH_* + +using namespace DBus; + +Ecore::BusTimeout::BusTimeout (Timeout::Internal* ti) + : Timeout (ti) +{ + _enable(); +} + +Ecore::BusTimeout::~BusTimeout() +{ + _disable(); +} + +void Ecore::BusTimeout::toggle() +{ + debug_log ("ecore: timeout %p toggled (%s)", this, Timeout::enabled() ? "on":"off"); + + if (Timeout::enabled()) _enable(); + else _disable(); +} + +int Ecore::BusTimeout::timeout_handler (void *data) +{ + Ecore::BusTimeout* t = reinterpret_cast<Ecore::BusTimeout*> (data); + + debug_log ("Ecore::BusTimeout::timeout_handler( void *data )"); + + t->handle(); + + return 1; // 1 -> reshedule in ecore for next timer interval +} + +void Ecore::BusTimeout::_enable() +{ + debug_log ("Ecore::BusTimeout::_enable()"); + + _etimer = ecore_timer_add ( ( (double) Timeout::interval()) /1000, timeout_handler, this); +} + +void Ecore::BusTimeout::_disable() +{ + debug_log ("Ecore::BusTimeout::_disable()"); + + ecore_timer_del (_etimer); +} + +static bool watch_prepare (int *timeout) +{ + debug_log ("ecore: watch_prepare"); + + *timeout = -1; + return false; +} + +static bool watch_check() +{ + debug_log ("ecore: watch_check"); + + return true; +} + +static bool watch_dispatch (void *data) +{ + debug_log ("ecore: watch_dispatch"); + + bool cb = true; + DBus::default_dispatcher->dispatch_pending(); //TODO: won't work in case of multiple dispatchers + return cb; +} + +Ecore::BusWatch::BusWatch (Watch::Internal* wi) + : Watch (wi) +{ + _enable(); +} + +Ecore::BusWatch::~BusWatch() +{ + _disable(); +} + +void Ecore::BusWatch::toggle() +{ + debug_log ("ecore: watch %p toggled (%s)", this, Watch::enabled() ? "on":"off"); + + if (Watch::enabled()) _enable(); + else _disable(); +} + +int Ecore::BusWatch::watch_handler_read (void *data, Ecore_Fd_Handler *fdh) +{ + Ecore::BusWatch* w = reinterpret_cast<Ecore::BusWatch*> (data); + + debug_log ("ecore: watch_handler_read"); + + int flags = DBUS_WATCH_READABLE; + + watch_dispatch (NULL); + + w->handle (flags); + + return 1; +} + +int Ecore::BusWatch::watch_handler_error (void *data, Ecore_Fd_Handler *fdh) +{ + Ecore::BusWatch* w = reinterpret_cast<Ecore::BusWatch*> (data); + + debug_log ("ecore: watch_handler_error"); + + int flags = DBUS_WATCH_ERROR; + + watch_dispatch (NULL); + + return 1; +} + +void Ecore::BusWatch::_enable() +{ + debug_log ("Ecore::BusWatch::_enable()"); + + int flags = Watch::flags(); + + fd_handler_read = ecore_main_fd_handler_add (Watch::descriptor(), + ECORE_FD_READ, + watch_handler_read, + this, + NULL, NULL); + + ecore_main_fd_handler_active_set (fd_handler_read, ECORE_FD_READ); + + fd_handler_error = ecore_main_fd_handler_add (Watch::descriptor(), + ECORE_FD_ERROR, + watch_handler_error, + this, + NULL, NULL); + + ecore_main_fd_handler_active_set (fd_handler_error, ECORE_FD_ERROR); +} + +void Ecore::BusWatch::_disable() +{ + ecore_main_fd_handler_del (fd_handler_read); + ecore_main_fd_handler_del (fd_handler_error); +} + +void Ecore::BusDispatcher::attach() +{ +} + +Timeout* Ecore::BusDispatcher::add_timeout (Timeout::Internal* wi) +{ + Timeout* t = new Ecore::BusTimeout (wi); + + debug_log ("ecore: added timeout %p (%s)", t, t->enabled() ? "on":"off"); + + return t; +} + +void Ecore::BusDispatcher::rem_timeout (Timeout* t) +{ + debug_log ("ecore: removed timeout %p", t); + + delete t; +} + +Watch* Ecore::BusDispatcher::add_watch (Watch::Internal* wi) +{ + Watch* w = new Ecore::BusWatch (wi); + + debug_log ("ecore: added watch %p (%s) fd=%d flags=%d", + w, w->enabled() ? "on":"off", w->descriptor(), w->flags() + ); + return w; +} + +void Ecore::BusDispatcher::rem_watch (Watch* w) +{ + debug_log ("ecore: removed watch %p", w); + + delete w; +} diff --git a/sflphone-common/libs/dbus-c++/src/error.cpp b/sflphone-common/libs/dbus-c++/src/error.cpp index 23f7bec71b1e7d2b67176876a740b1215f910299..89d91d1f39d2d604f6de6313788530b2e5176ca7 100644 --- a/sflphone-common/libs/dbus-c++/src/error.cpp +++ b/sflphone-common/libs/dbus-c++/src/error.cpp @@ -21,6 +21,9 @@ * */ +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif #include <dbus-c++/message.h> #include <dbus-c++/error.h> @@ -36,23 +39,23 @@ using namespace DBus; */ Error::Error() -: _int(new InternalError) + : _int (new InternalError) {} -Error::Error(InternalError &i) -: _int(new InternalError(i)) +Error::Error (InternalError &i) + : _int (new InternalError (i)) {} -Error::Error(const char *name, const char *message) -: _int(new InternalError) +Error::Error (const char *name, const char *message) + : _int (new InternalError) { - set(name, message); + set (name, message); } -Error::Error(Message &m) -: _int(new InternalError) +Error::Error (Message &m) + : _int (new InternalError) { - dbus_set_error_from_message(&(_int->error), m._pvt->msg); + dbus_set_error_from_message (& (_int->error), m._pvt->msg); } Error::~Error() throw() @@ -61,26 +64,26 @@ Error::~Error() throw() const char *Error::name() const { - return _int->error.name; + return _int->error.name; } const char *Error::message() const { - return _int->error.message; + return _int->error.message; } bool Error::is_set() const { - return *(_int); + return * (_int); } -void Error::set(const char *name, const char *message) +void Error::set (const char *name, const char *message) { - dbus_set_error_const(&(_int->error), name, message); + dbus_set_error_const (& (_int->error), name, message); } const char *Error::what() const throw() { - return _int->error.message; + return _int->error.message; } diff --git a/sflphone-common/libs/dbus-c++/src/eventloop-integration.cpp b/sflphone-common/libs/dbus-c++/src/eventloop-integration.cpp index b1075672e0cf8482ea6c2c230dd63880a1751e45..ec82dd22bd2ea97e34cfe55c0c2f25f083c5bb73 100644 --- a/sflphone-common/libs/dbus-c++/src/eventloop-integration.cpp +++ b/sflphone-common/libs/dbus-c++/src/eventloop-integration.cpp @@ -21,6 +21,9 @@ * */ +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif #include <dbus-c++/eventloop-integration.h> #include <dbus-c++/debug.h> @@ -31,133 +34,137 @@ using namespace DBus; -BusTimeout::BusTimeout(Timeout::Internal *ti, BusDispatcher *bd) -: Timeout(ti), DefaultTimeout(Timeout::interval(), true, bd) +BusTimeout::BusTimeout (Timeout::Internal *ti, BusDispatcher *bd) + : Timeout (ti), DefaultTimeout (Timeout::interval(), true, bd) { - DefaultTimeout::enabled(Timeout::enabled()); + DefaultTimeout::enabled (Timeout::enabled()); } void BusTimeout::toggle() { - debug_log("timeout %p toggled (%s)", this, Timeout::enabled() ? "on":"off"); + debug_log ("timeout %p toggled (%s)", this, Timeout::enabled() ? "on":"off"); - DefaultTimeout::enabled(Timeout::enabled()); + DefaultTimeout::enabled (Timeout::enabled()); } -BusWatch::BusWatch(Watch::Internal *wi, BusDispatcher *bd) -: Watch(wi), DefaultWatch(Watch::descriptor(), 0, bd) +BusWatch::BusWatch (Watch::Internal *wi, BusDispatcher *bd) + : Watch (wi), DefaultWatch (Watch::descriptor(), 0, bd) { - int flags = POLLHUP | POLLERR; + int flags = POLLHUP | POLLERR; - if (Watch::flags() & DBUS_WATCH_READABLE) - flags |= POLLIN; - if (Watch::flags() & DBUS_WATCH_WRITABLE) - flags |= POLLOUT; + if (Watch::flags() & DBUS_WATCH_READABLE) + flags |= POLLIN; - DefaultWatch::flags(flags); - DefaultWatch::enabled(Watch::enabled()); + if (Watch::flags() & DBUS_WATCH_WRITABLE) + flags |= POLLOUT; + + DefaultWatch::flags (flags); + + DefaultWatch::enabled (Watch::enabled()); } void BusWatch::toggle() { - debug_log("watch %p toggled (%s)", this, Watch::enabled() ? "on":"off"); + debug_log ("watch %p toggled (%s)", this, Watch::enabled() ? "on":"off"); - DefaultWatch::enabled(Watch::enabled()); + DefaultWatch::enabled (Watch::enabled()); } void BusDispatcher::enter() { - debug_log("entering dispatcher %p", this); + debug_log ("entering dispatcher %p", this); - _running = true; + _running = true; - while (_running) - { - do_iteration(); - } + while (_running) { + do_iteration(); + } - debug_log("leaving dispatcher %p", this); + debug_log ("leaving dispatcher %p", this); } void BusDispatcher::leave() { - _running = false; + _running = false; } void BusDispatcher::do_iteration() { - dispatch_pending(); - dispatch(); + dispatch_pending(); + dispatch(); } -Timeout *BusDispatcher::add_timeout(Timeout::Internal *ti) +Timeout *BusDispatcher::add_timeout (Timeout::Internal *ti) { - BusTimeout *bt = new BusTimeout(ti, this); + BusTimeout *bt = new BusTimeout (ti, this); - bt->expired = new Callback<BusDispatcher, void, DefaultTimeout &>(this, &BusDispatcher::timeout_expired); - bt->data(bt); + bt->expired = new Callback<BusDispatcher, void, DefaultTimeout &> (this, &BusDispatcher::timeout_expired); + bt->data (bt); - debug_log("added timeout %p (%s) interval=%d", - bt, ((Timeout *)bt)->enabled() ? "on":"off", ((Timeout *)bt)->interval()); + debug_log ("added timeout %p (%s) interval=%d", + bt, ( (Timeout *) bt)->enabled() ? "on":"off", ( (Timeout *) bt)->interval()); - return bt; + return bt; } -void BusDispatcher::rem_timeout(Timeout *t) +void BusDispatcher::rem_timeout (Timeout *t) { - debug_log("removed timeout %p", t); + debug_log ("removed timeout %p", t); - delete t; + delete t; } -Watch *BusDispatcher::add_watch(Watch::Internal *wi) +Watch *BusDispatcher::add_watch (Watch::Internal *wi) { - BusWatch *bw = new BusWatch(wi, this); + BusWatch *bw = new BusWatch (wi, this); - bw->ready = new Callback<BusDispatcher, void, DefaultWatch &>(this, &BusDispatcher::watch_ready); - bw->data(bw); + bw->ready = new Callback<BusDispatcher, void, DefaultWatch &> (this, &BusDispatcher::watch_ready); + bw->data (bw); - debug_log("added watch %p (%s) fd=%d flags=%d", - bw, ((Watch *)bw)->enabled() ? "on":"off", ((Watch *)bw)->descriptor(), ((Watch *)bw)->flags()); + debug_log ("added watch %p (%s) fd=%d flags=%d", + bw, ( (Watch *) bw)->enabled() ? "on":"off", ( (Watch *) bw)->descriptor(), ( (Watch *) bw)->flags()); - return bw; + return bw; } -void BusDispatcher::rem_watch(Watch *w) +void BusDispatcher::rem_watch (Watch *w) { - debug_log("removed watch %p", w); + debug_log ("removed watch %p", w); - delete w; + delete w; } -void BusDispatcher::timeout_expired(DefaultTimeout &et) +void BusDispatcher::timeout_expired (DefaultTimeout &et) { - debug_log("timeout %p expired", &et); + debug_log ("timeout %p expired", &et); - BusTimeout *timeout = reinterpret_cast<BusTimeout *>(et.data()); + BusTimeout *timeout = reinterpret_cast<BusTimeout *> (et.data()); - timeout->handle(); + timeout->handle(); } -void BusDispatcher::watch_ready(DefaultWatch &ew) +void BusDispatcher::watch_ready (DefaultWatch &ew) { - BusWatch *watch = reinterpret_cast<BusWatch *>(ew.data()); + BusWatch *watch = reinterpret_cast<BusWatch *> (ew.data()); + + debug_log ("watch %p ready, flags=%d state=%d", + watch, ( (Watch *) watch)->flags(), watch->state() + ); + + int flags = 0; + + if (watch->state() & POLLIN) + flags |= DBUS_WATCH_READABLE; - debug_log("watch %p ready, flags=%d state=%d", - watch, ((Watch *)watch)->flags(), watch->state() - ); + if (watch->state() & POLLOUT) + flags |= DBUS_WATCH_WRITABLE; - int flags = 0; + if (watch->state() & POLLHUP) + flags |= DBUS_WATCH_HANGUP; - if (watch->state() & POLLIN) - flags |= DBUS_WATCH_READABLE; - if (watch->state() & POLLOUT) - flags |= DBUS_WATCH_WRITABLE; - if (watch->state() & POLLHUP) - flags |= DBUS_WATCH_HANGUP; - if (watch->state() & POLLERR) - flags |= DBUS_WATCH_ERROR; + if (watch->state() & POLLERR) + flags |= DBUS_WATCH_ERROR; - watch->handle(flags); + watch->handle (flags); } diff --git a/sflphone-common/libs/dbus-c++/src/eventloop.cpp b/sflphone-common/libs/dbus-c++/src/eventloop.cpp index a9b875701c31119a87c323c5c2b5aabfe878e6e1..656885aa1059595043af199bcf1adb103b6623d2 100644 --- a/sflphone-common/libs/dbus-c++/src/eventloop.cpp +++ b/sflphone-common/libs/dbus-c++/src/eventloop.cpp @@ -21,6 +21,9 @@ * */ +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif #include <dbus-c++/eventloop.h> #include <dbus-c++/debug.h> @@ -32,64 +35,64 @@ using namespace DBus; -static double millis(timeval tv) +static double millis (timeval tv) { - return (tv.tv_sec *1000.0 + tv.tv_usec/1000.0); + return (tv.tv_sec *1000.0 + tv.tv_usec/1000.0); } - -DefaultTimeout::DefaultTimeout(int interval, bool repeat, DefaultMainLoop *ed) -: _enabled(true), _interval(interval), _repeat(repeat), _expiration(0), _data(0), _disp(ed) + +DefaultTimeout::DefaultTimeout (int interval, bool repeat, DefaultMainLoop *ed) + : _enabled (true), _interval (interval), _repeat (repeat), _expiration (0), _data (0), _disp (ed) { - timeval now; - gettimeofday(&now, NULL); + timeval now; + gettimeofday (&now, NULL); - _expiration = millis(now) + interval; + _expiration = millis (now) + interval; - _disp->_mutex_t.lock(); - _disp->_timeouts.push_back(this); - _disp->_mutex_t.unlock(); + _disp->_mutex_t.lock(); + _disp->_timeouts.push_back (this); + _disp->_mutex_t.unlock(); } DefaultTimeout::~DefaultTimeout() { - _disp->_mutex_t.lock(); - _disp->_timeouts.remove(this); - _disp->_mutex_t.unlock(); + _disp->_mutex_t.lock(); + _disp->_timeouts.remove (this); + _disp->_mutex_t.unlock(); } -DefaultWatch::DefaultWatch(int fd, int flags, DefaultMainLoop *ed) -: _enabled(true), _fd(fd), _flags(flags), _state(0), _data(0), _disp(ed) +DefaultWatch::DefaultWatch (int fd, int flags, DefaultMainLoop *ed) + : _enabled (true), _fd (fd), _flags (flags), _state (0), _data (0), _disp (ed) { - _disp->_mutex_w.lock(); - _disp->_watches.push_back(this); - _disp->_mutex_w.unlock(); + _disp->_mutex_w.lock(); + _disp->_watches.push_back (this); + _disp->_mutex_w.unlock(); } DefaultWatch::~DefaultWatch() { - _disp->_mutex_w.lock(); - _disp->_watches.remove(this); - _disp->_mutex_w.unlock(); + _disp->_mutex_w.lock(); + _disp->_watches.remove (this); + _disp->_mutex_w.unlock(); } DefaultMutex::DefaultMutex() { - pthread_mutex_init(&_mutex, NULL); + pthread_mutex_init (&_mutex, NULL); } DefaultMutex::~DefaultMutex() { - pthread_mutex_destroy(&_mutex); + pthread_mutex_destroy (&_mutex); } void DefaultMutex::lock() { - pthread_mutex_lock(&_mutex); + pthread_mutex_lock (&_mutex); } void DefaultMutex::unlock() { - pthread_mutex_unlock(&_mutex); + pthread_mutex_unlock (&_mutex); } DefaultMainLoop::DefaultMainLoop() @@ -98,131 +101,124 @@ DefaultMainLoop::DefaultMainLoop() DefaultMainLoop::~DefaultMainLoop() { - _mutex_w.lock(); - - DefaultWatches::iterator wi = _watches.begin(); - while (wi != _watches.end()) - { - DefaultWatches::iterator wmp = wi; - ++wmp; - _mutex_w.unlock(); - delete (*wi); - _mutex_w.lock(); - wi = wmp; - } - _mutex_w.unlock(); - - _mutex_t.lock(); - - DefaultTimeouts::iterator ti = _timeouts.begin(); - while (ti != _timeouts.end()) - { - DefaultTimeouts::iterator tmp = ti; - ++tmp; - _mutex_t.unlock(); - delete (*ti); - _mutex_t.lock(); - ti = tmp; - } - _mutex_t.unlock(); + _mutex_w.lock(); + + DefaultWatches::iterator wi = _watches.begin(); + + while (wi != _watches.end()) { + DefaultWatches::iterator wmp = wi; + ++wmp; + _mutex_w.unlock(); + delete (*wi); + _mutex_w.lock(); + wi = wmp; + } + + _mutex_w.unlock(); + + _mutex_t.lock(); + + DefaultTimeouts::iterator ti = _timeouts.begin(); + + while (ti != _timeouts.end()) { + DefaultTimeouts::iterator tmp = ti; + ++tmp; + _mutex_t.unlock(); + delete (*ti); + _mutex_t.lock(); + ti = tmp; + } + + _mutex_t.unlock(); } void DefaultMainLoop::dispatch() { - _mutex_w.lock(); + _mutex_w.lock(); + + int nfd = _watches.size(); + + pollfd fds[nfd]; - int nfd = _watches.size(); + DefaultWatches::iterator wi = _watches.begin(); - pollfd fds[nfd]; + for (nfd = 0; wi != _watches.end(); ++wi) { + if ( (*wi)->enabled()) { + fds[nfd].fd = (*wi)->descriptor(); + fds[nfd].events = (*wi)->flags(); + fds[nfd].revents = 0; - DefaultWatches::iterator wi = _watches.begin(); + ++nfd; + } + } - for (nfd = 0; wi != _watches.end(); ++wi) - { - if ((*wi)->enabled()) - { - fds[nfd].fd = (*wi)->descriptor(); - fds[nfd].events = (*wi)->flags(); - fds[nfd].revents = 0; + _mutex_w.unlock(); - ++nfd; - } - } - _mutex_w.unlock(); + int wait_min = 10000; - // int wait_min = 10000; - int wait_min = 500; + DefaultTimeouts::iterator ti; - DefaultTimeouts::iterator ti; + _mutex_t.lock(); - _mutex_t.lock(); + for (ti = _timeouts.begin(); ti != _timeouts.end(); ++ti) { + if ( (*ti)->enabled() && (*ti)->interval() < wait_min) + wait_min = (*ti)->interval(); + } - for (ti = _timeouts.begin(); ti != _timeouts.end(); ++ti) - { - if ((*ti)->enabled() && (*ti)->interval() < wait_min) - wait_min = (*ti)->interval(); - } + _mutex_t.unlock(); - _mutex_t.unlock(); + poll (fds, nfd, wait_min); - poll(fds, nfd, wait_min); + timeval now; + gettimeofday (&now, NULL); - timeval now; - gettimeofday(&now, NULL); + double now_millis = millis (now); - double now_millis = millis(now); + _mutex_t.lock(); - _mutex_t.lock(); + ti = _timeouts.begin(); - ti = _timeouts.begin(); + while (ti != _timeouts.end()) { + DefaultTimeouts::iterator tmp = ti; + ++tmp; - while (ti != _timeouts.end()) - { - DefaultTimeouts::iterator tmp = ti; - ++tmp; + if ( (*ti)->enabled() && now_millis >= (*ti)->_expiration) { + (*ti)->expired (* (*ti)); - if ((*ti)->enabled() && now_millis >= (*ti)->_expiration) - { - (*ti)->expired(*(*ti)); + if ( (*ti)->_repeat) { + (*ti)->_expiration = now_millis + (*ti)->_interval; + } - if ((*ti)->_repeat) - { - (*ti)->_expiration = now_millis + (*ti)->_interval; - } + } - } + ti = tmp; + } - ti = tmp; - } + _mutex_t.unlock(); - _mutex_t.unlock(); + _mutex_w.lock(); - _mutex_w.lock(); + for (int j = 0; j < nfd; ++j) { + DefaultWatches::iterator wi; - for (int j = 0; j < nfd; ++j) - { - DefaultWatches::iterator wi; + for (wi = _watches.begin(); wi != _watches.end();) { + DefaultWatches::iterator tmp = wi; + ++tmp; - for (wi = _watches.begin(); wi != _watches.end();) - { - DefaultWatches::iterator tmp = wi; - ++tmp; + if ( (*wi)->enabled() && (*wi)->_fd == fds[j].fd) { + if (fds[j].revents) { + (*wi)->_state = fds[j].revents; - if ((*wi)->enabled() && (*wi)->_fd == fds[j].fd) - { - if (fds[j].revents) - { - (*wi)->_state = fds[j].revents; + (*wi)->ready (* (*wi)); - (*wi)->ready(*(*wi)); + fds[j].revents = 0; + } + } - fds[j].revents = 0; - } - } + wi = tmp; + } + } - wi = tmp; - } - } - _mutex_w.unlock(); + _mutex_w.unlock(); } diff --git a/sflphone-common/libs/dbus-c++/src/glib-integration.cpp b/sflphone-common/libs/dbus-c++/src/glib-integration.cpp index bde3c7afe0937c43fe9407024e274f6c4120be5a..1739670bfc49bb7eaa79ed55b8113caf5a161d39 100644 --- a/sflphone-common/libs/dbus-c++/src/glib-integration.cpp +++ b/sflphone-common/libs/dbus-c++/src/glib-integration.cpp @@ -21,205 +21,313 @@ * */ - +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif #include <dbus-c++/glib-integration.h> #include <dbus/dbus.h> // for DBUS_WATCH_* using namespace DBus; -Glib::BusTimeout::BusTimeout(Timeout::Internal *ti, GMainContext *ctx, int priority) -: Timeout(ti), _ctx(ctx), _priority(priority) +Glib::BusTimeout::BusTimeout (Timeout::Internal *ti, GMainContext *ctx, int priority) + : Timeout (ti), _ctx (ctx), _priority (priority), _source (NULL) { - _enable(); + if (Timeout::enabled()) + _enable(); } Glib::BusTimeout::~BusTimeout() { - _disable(); + _disable(); } void Glib::BusTimeout::toggle() { - debug_log("glib: timeout %p toggled (%s)", this, Timeout::enabled() ? "on":"off"); + debug_log ("glib: timeout %p toggled (%s)", this, Timeout::enabled() ? "on":"off"); - if (Timeout::enabled()) _enable(); - else _disable(); + if (Timeout::enabled()) _enable(); + else _disable(); } -gboolean Glib::BusTimeout::timeout_handler(gpointer data) +gboolean Glib::BusTimeout::timeout_handler (gpointer data) { - Glib::BusTimeout *t = reinterpret_cast<Glib::BusTimeout *>(data); + Glib::BusTimeout *t = reinterpret_cast<Glib::BusTimeout *> (data); - t->handle(); + t->handle(); - return TRUE; + return TRUE; } void Glib::BusTimeout::_enable() { - _source = g_timeout_source_new(Timeout::interval()); - g_source_set_priority(_source, _priority); - g_source_set_callback(_source, timeout_handler, this, NULL); - g_source_attach(_source, _ctx); + if (_source) + _disable(); // be sane + + _source = g_timeout_source_new (Timeout::interval()); + + g_source_set_priority (_source, _priority); + + g_source_set_callback (_source, timeout_handler, this, NULL); + + g_source_attach (_source, _ctx); } void Glib::BusTimeout::_disable() { - g_source_destroy(_source); + if (_source) { + g_source_destroy (_source); + _source = NULL; + } } -struct BusSource -{ - GSource source; - GPollFD poll; +struct BusSource { + GSource source; + GPollFD poll; }; -static gboolean watch_prepare(GSource *source, gint *timeout) +static gboolean watch_prepare (GSource *source, gint *timeout) { -// debug_log("glib: watch_prepare"); + //debug_log("glib: watch_prepare"); - *timeout = -1; - return FALSE; + *timeout = -1; + return FALSE; } -static gboolean watch_check(GSource *source) +static gboolean watch_check (GSource *source) { -// debug_log("glib: watch_check"); + //debug_log("glib: watch_check"); - BusSource *io = (BusSource *)source; - return io->poll.revents ? TRUE : FALSE; + BusSource *io = (BusSource *) source; + return io->poll.revents ? TRUE : FALSE; } -static gboolean watch_dispatch(GSource *source, GSourceFunc callback, gpointer data) +static gboolean watch_dispatch (GSource *source, GSourceFunc callback, gpointer data) { - debug_log("glib: watch_dispatch"); + debug_log ("glib: watch_dispatch"); - gboolean cb = callback(data); - DBus::default_dispatcher->dispatch_pending(); //TODO: won't work in case of multiple dispatchers - return cb; + gboolean cb = callback (data); + return cb; } static GSourceFuncs watch_funcs = { - watch_prepare, - watch_check, - watch_dispatch, - NULL + watch_prepare, + watch_check, + watch_dispatch, + NULL }; -Glib::BusWatch::BusWatch(Watch::Internal *wi, GMainContext *ctx, int priority) -: Watch(wi), _ctx(ctx), _priority(priority) +Glib::BusWatch::BusWatch (Watch::Internal *wi, GMainContext *ctx, int priority) + : Watch (wi), _ctx (ctx), _priority (priority), _source (NULL) { - _enable(); + if (Watch::enabled()) + _enable(); } Glib::BusWatch::~BusWatch() { - _disable(); + _disable(); } void Glib::BusWatch::toggle() { - debug_log("glib: watch %p toggled (%s)", this, Watch::enabled() ? "on":"off"); + debug_log ("glib: watch %p toggled (%s)", this, Watch::enabled() ? "on":"off"); - if (Watch::enabled()) _enable(); - else _disable(); + if (Watch::enabled()) _enable(); + else _disable(); } -gboolean Glib::BusWatch::watch_handler(gpointer data) +gboolean Glib::BusWatch::watch_handler (gpointer data) { - Glib::BusWatch *w = reinterpret_cast<Glib::BusWatch *>(data); + Glib::BusWatch *w = reinterpret_cast<Glib::BusWatch *> (data); + + BusSource *io = (BusSource *) (w->_source); - BusSource *io = (BusSource *)(w->_source); + int flags = 0; - int flags = 0; - if (io->poll.revents &G_IO_IN) - flags |= DBUS_WATCH_READABLE; - if (io->poll.revents &G_IO_OUT) - flags |= DBUS_WATCH_WRITABLE; - if (io->poll.revents &G_IO_ERR) - flags |= DBUS_WATCH_ERROR; - if (io->poll.revents &G_IO_HUP) - flags |= DBUS_WATCH_HANGUP; + if (io->poll.revents &G_IO_IN) + flags |= DBUS_WATCH_READABLE; - w->handle(flags); + if (io->poll.revents &G_IO_OUT) + flags |= DBUS_WATCH_WRITABLE; - return TRUE; + if (io->poll.revents &G_IO_ERR) + flags |= DBUS_WATCH_ERROR; + + if (io->poll.revents &G_IO_HUP) + flags |= DBUS_WATCH_HANGUP; + + w->handle (flags); + + return TRUE; } void Glib::BusWatch::_enable() { - _source = g_source_new(&watch_funcs, sizeof(BusSource)); - g_source_set_priority(_source, _priority); - g_source_set_callback(_source, watch_handler, this, NULL); + if (_source) + _disable(); // be sane + + _source = g_source_new (&watch_funcs, sizeof (BusSource)); + + g_source_set_priority (_source, _priority); + + g_source_set_callback (_source, watch_handler, this, NULL); + + int flags = Watch::flags(); - int flags = Watch::flags(); - int condition = 0; + int condition = 0; - if (flags &DBUS_WATCH_READABLE) - condition |= G_IO_IN; -// if (flags &DBUS_WATCH_WRITABLE) -// condition |= G_IO_OUT; - if (flags &DBUS_WATCH_ERROR) - condition |= G_IO_ERR; - if (flags &DBUS_WATCH_HANGUP) - condition |= G_IO_HUP; + if (flags &DBUS_WATCH_READABLE) + condition |= G_IO_IN; - GPollFD *poll = &(((BusSource *)_source)->poll); - poll->fd = Watch::descriptor(); - poll->events = condition; - poll->revents = 0; + if (flags &DBUS_WATCH_WRITABLE) + condition |= G_IO_OUT; - g_source_add_poll(_source, poll); - g_source_attach(_source, _ctx); + if (flags &DBUS_WATCH_ERROR) + condition |= G_IO_ERR; + + if (flags &DBUS_WATCH_HANGUP) + condition |= G_IO_HUP; + + GPollFD *poll = & ( ( (BusSource *) _source)->poll); + + poll->fd = Watch::descriptor(); + + poll->events = condition; + + poll->revents = 0; + + g_source_add_poll (_source, poll); + + g_source_attach (_source, _ctx); } void Glib::BusWatch::_disable() { - GPollFD *poll = &(((BusSource *)_source)->poll); - g_source_remove_poll(_source, poll); - g_source_destroy(_source); + if (!_source) + return; + + GPollFD *poll = & ( ( (BusSource *) _source)->poll); + + g_source_remove_poll (_source, poll); + + g_source_destroy (_source); + + _source = NULL; +} + +/* + * We need this on top of the IO handlers, because sometimes + * there are messages to dispatch queued up but no IO pending. + * (fixes also a previous problem of code not working in case of multiple dispatchers) +*/ + +struct DispatcherSource { + GSource source; + Dispatcher *dispatcher; +}; + + +static gboolean dispatcher_prepare (GSource *source, gint *timeout) +{ + Dispatcher *dispatcher = ( (DispatcherSource*) source)->dispatcher; + + *timeout = -1; + + return dispatcher->has_something_to_dispatch() ? TRUE:FALSE; +} + +static gboolean dispatcher_check (GSource *source) +{ + return FALSE; } -void Glib::BusDispatcher::attach(GMainContext *ctx) +static gboolean +dispatcher_dispatch (GSource *source, + GSourceFunc callback, + gpointer user_data) { - _ctx = ctx ? ctx : g_main_context_default(); + Dispatcher *dispatcher = ( (DispatcherSource*) source)->dispatcher; + + dispatcher->dispatch_pending(); + return TRUE; +} + +static const GSourceFuncs dispatcher_funcs = { + dispatcher_prepare, + dispatcher_check, + dispatcher_dispatch, + NULL +}; + +Glib::BusDispatcher::BusDispatcher() + : _ctx (NULL), _priority (G_PRIORITY_DEFAULT), _source (NULL) +{ +} + +Glib::BusDispatcher::~BusDispatcher() +{ + if (_source) { + GSource *temp = _source; + _source = NULL; + + g_source_destroy (temp); + g_source_unref (temp); + } + + if (_ctx) + g_main_context_unref (_ctx); +} + +void Glib::BusDispatcher::attach (GMainContext *ctx) +{ + g_assert (_ctx == NULL); // just to be sane + + _ctx = ctx ? ctx : g_main_context_default(); + g_main_context_ref (_ctx); + + // create the source for dispatching messages + _source = g_source_new ( (GSourceFuncs *) &dispatcher_funcs, + sizeof (DispatcherSource)); + + ( (DispatcherSource*) _source)->dispatcher = this; + g_source_attach (_source, _ctx); } -Timeout *Glib::BusDispatcher::add_timeout(Timeout::Internal *wi) +Timeout *Glib::BusDispatcher::add_timeout (Timeout::Internal *wi) { - Timeout *t = new Glib::BusTimeout(wi, _ctx, _priority); + Timeout *t = new Glib::BusTimeout (wi, _ctx, _priority); - debug_log("glib: added timeout %p (%s)", t, t->enabled() ? "on":"off"); + debug_log ("glib: added timeout %p (%s)", t, t->enabled() ? "on":"off"); - return t; + return t; } -void Glib::BusDispatcher::rem_timeout(Timeout *t) +void Glib::BusDispatcher::rem_timeout (Timeout *t) { - debug_log("glib: removed timeout %p", t); + debug_log ("glib: removed timeout %p", t); - delete t; + delete t; } -Watch *Glib::BusDispatcher::add_watch(Watch::Internal *wi) +Watch *Glib::BusDispatcher::add_watch (Watch::Internal *wi) { - Watch *w = new Glib::BusWatch(wi, _ctx, _priority); + Watch *w = new Glib::BusWatch (wi, _ctx, _priority); - debug_log("glib: added watch %p (%s) fd=%d flags=%d", - w, w->enabled() ? "on":"off", w->descriptor(), w->flags() - ); - return w; + debug_log ("glib: added watch %p (%s) fd=%d flags=%d", + w, w->enabled() ? "on":"off", w->descriptor(), w->flags() + ); + return w; } -void Glib::BusDispatcher::rem_watch(Watch *w) +void Glib::BusDispatcher::rem_watch (Watch *w) { - debug_log("glib: removed watch %p", w); + debug_log ("glib: removed watch %p", w); - delete w; + delete w; } -void Glib::BusDispatcher::set_priority(int priority) +void Glib::BusDispatcher::set_priority (int priority) { - _priority = priority; + _priority = priority; } diff --git a/sflphone-common/libs/dbus-c++/src/interface.cpp b/sflphone-common/libs/dbus-c++/src/interface.cpp index 6a47cf631c022cb6d81a248ba5de8c88a47f5457..aefcd1dea91bde9fe54765990b219d4e1cde01cd 100644 --- a/sflphone-common/libs/dbus-c++/src/interface.cpp +++ b/sflphone-common/libs/dbus-c++/src/interface.cpp @@ -21,6 +21,9 @@ * */ +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif #include <dbus-c++/debug.h> #include <dbus-c++/interface.h> @@ -29,128 +32,135 @@ using namespace DBus; -Interface::Interface(const std::string &name) -: _name(name) +Interface::Interface (const std::string &name) + : _name (name) {} Interface::~Interface() {} -InterfaceAdaptor *AdaptorBase::find_interface(const std::string &name) +InterfaceAdaptor *AdaptorBase::find_interface (const std::string &name) { - InterfaceAdaptorTable::const_iterator ii = _interfaces.find(name); + InterfaceAdaptorTable::const_iterator ii = _interfaces.find (name); - return ii != _interfaces.end() ? ii->second : NULL; + return ii != _interfaces.end() ? ii->second : NULL; } -InterfaceAdaptor::InterfaceAdaptor(const std::string &name) -: Interface(name) +InterfaceAdaptor::InterfaceAdaptor (const std::string &name) + : Interface (name) { - debug_log("adding interface %s", name.c_str()); + debug_log ("adding interface %s", name.c_str()); - _interfaces[name] = this; + _interfaces[name] = this; } -Message InterfaceAdaptor::dispatch_method(const CallMessage &msg) +Message InterfaceAdaptor::dispatch_method (const CallMessage &msg) { - const char *name = msg.member(); - - MethodTable::iterator mi = _methods.find(name); - if (mi != _methods.end()) - { - return mi->second.call(msg); - } - else - { - return ErrorMessage(msg, DBUS_ERROR_UNKNOWN_METHOD, name); - } + const char *name = msg.member(); + + MethodTable::iterator mi = _methods.find (name); + + if (mi != _methods.end()) { + return mi->second.call (msg); + } else { + return ErrorMessage (msg, DBUS_ERROR_UNKNOWN_METHOD, name); + } } -void InterfaceAdaptor::emit_signal(const SignalMessage &sig) +void InterfaceAdaptor::emit_signal (const SignalMessage &sig) { - SignalMessage &sig2 = const_cast<SignalMessage &>(sig); + SignalMessage &sig2 = const_cast<SignalMessage &> (sig); - if (sig2.interface() == NULL) - sig2.interface(name().c_str()); + if (sig2.interface() == NULL) + sig2.interface (name().c_str()); - _emit_signal(sig2); + _emit_signal (sig2); } -Variant *InterfaceAdaptor::get_property(const std::string &name) +Variant *InterfaceAdaptor::get_property (const std::string &name) { - PropertyTable::iterator pti = _properties.find(name); + PropertyTable::iterator pti = _properties.find (name); + + if (pti != _properties.end()) { + if (!pti->second.read) + throw ErrorAccessDenied ("property is not readable"); - if (pti != _properties.end()) - { - if (!pti->second.read) - throw ErrorAccessDenied("property is not readable"); + return & (pti->second.value); + } - return &(pti->second.value); - } - return NULL; + return NULL; } -void InterfaceAdaptor::set_property(const std::string &name, Variant &value) +void InterfaceAdaptor::set_property (const std::string &name, Variant &value) { - PropertyTable::iterator pti = _properties.find(name); + PropertyTable::iterator pti = _properties.find (name); + + if (pti != _properties.end()) { + if (!pti->second.write) + throw ErrorAccessDenied ("property is not writeable"); + + Signature sig = value.signature(); - if (pti != _properties.end()) - { - if (!pti->second.write) - throw ErrorAccessDenied("property is not writeable"); + if (pti->second.sig != sig) + throw ErrorInvalidSignature ("property expects a different type"); - Signature sig = value.signature(); + pti->second.value = value; - if (pti->second.sig != sig) - throw ErrorInvalidSignature("property expects a different type"); + return; + } - pti->second.value = value; - return; - } - throw ErrorFailed("requested property not found"); + throw ErrorFailed ("requested property not found"); } -InterfaceProxy *ProxyBase::find_interface(const std::string &name) +InterfaceProxy *ProxyBase::find_interface (const std::string &name) { - InterfaceProxyTable::const_iterator ii = _interfaces.find(name); + InterfaceProxyTable::const_iterator ii = _interfaces.find (name); - return ii != _interfaces.end() ? ii->second : NULL; + return ii != _interfaces.end() ? ii->second : NULL; } -InterfaceProxy::InterfaceProxy(const std::string &name) -: Interface(name) +InterfaceProxy::InterfaceProxy (const std::string &name) + : Interface (name) { - debug_log("adding interface %s", name.c_str()); + debug_log ("adding interface %s", name.c_str()); - _interfaces[name] = this; + _interfaces[name] = this; } -bool InterfaceProxy::dispatch_signal(const SignalMessage &msg) +bool InterfaceProxy::dispatch_signal (const SignalMessage &msg) { - const char *name = msg.member(); - - SignalTable::iterator si = _signals.find(name); - if (si != _signals.end()) - { - si->second.call(msg); - // Here we always return false because there might be - // another InterfaceProxy listening for the same signal. - // This way we instruct libdbus-1 to go on dispatching - // the signal. - return false; - } - else - { - return false; - } + const char *name = msg.member(); + + SignalTable::iterator si = _signals.find (name); + + if (si != _signals.end()) { + si->second.call (msg); + // Here we always return false because there might be + // another InterfaceProxy listening for the same signal. + // This way we instruct libdbus-1 to go on dispatching + // the signal. + return false; + } else { + return false; + } +} + +Message InterfaceProxy::invoke_method (const CallMessage &call) +{ + CallMessage &call2 = const_cast<CallMessage &> (call); + + if (call.interface() == NULL) + call2.interface (name().c_str()); + + return _invoke_method (call2); } -Message InterfaceProxy::invoke_method(const CallMessage &call) +bool InterfaceProxy::invoke_method_noreply (const CallMessage &call) { - CallMessage &call2 = const_cast<CallMessage &>(call); + CallMessage &call2 = const_cast<CallMessage &> (call); - if (call.interface() == NULL) - call2.interface(name().c_str()); + if (call.interface() == NULL) + call2.interface (name().c_str()); - return _invoke_method(call2); + return _invoke_method_noreply (call2); } diff --git a/sflphone-common/libs/dbus-c++/src/internalerror.h b/sflphone-common/libs/dbus-c++/src/internalerror.h index 1cc1fcaec14712a63e4ea06efb5ed1dd4406c386..36fe20c6d290d717e18b9642f5376a88bdecd2bb 100644 --- a/sflphone-common/libs/dbus-c++/src/internalerror.h +++ b/sflphone-common/libs/dbus-c++/src/internalerror.h @@ -26,7 +26,7 @@ #define __DBUSXX_INTERNALERROR_H #ifdef HAVE_CONFIG_H -#include "config.h" +#include <config.h> #endif #include <dbus-c++/error.h> diff --git a/sflphone-common/libs/dbus-c++/src/introspection.cpp b/sflphone-common/libs/dbus-c++/src/introspection.cpp index 88b61a14b245f284685a6a626a74755cea673247..41f6439f4aad8eae013e776a3909c96ad95b1c37 100644 --- a/sflphone-common/libs/dbus-c++/src/introspection.cpp +++ b/sflphone-common/libs/dbus-c++/src/introspection.cpp @@ -21,6 +21,9 @@ * */ +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif #include <dbus-c++/introspection.h> #include <dbus-c++/object.h> @@ -35,156 +38,150 @@ using namespace DBus; static const char *introspectable_name = "org.freedesktop.DBus.Introspectable"; IntrospectableAdaptor::IntrospectableAdaptor() -: InterfaceAdaptor(introspectable_name) + : InterfaceAdaptor (introspectable_name) { - register_method(IntrospectableAdaptor, Introspect, Introspect); + register_method (IntrospectableAdaptor, Introspect, Introspect); } -Message IntrospectableAdaptor::Introspect(const CallMessage &call) +Message IntrospectableAdaptor::Introspect (const CallMessage &call) { - debug_log("requested introspection data"); + debug_log ("requested introspection data"); - std::ostringstream xml; + std::ostringstream xml; - xml << DBUS_INTROSPECT_1_0_XML_DOCTYPE_DECL_NODE; + xml << DBUS_INTROSPECT_1_0_XML_DOCTYPE_DECL_NODE; - const std::string path = object()->path(); + const std::string path = object()->path(); - xml << "<node name=\"" << path << "\">"; + xml << "<node name=\"" << path << "\">"; - InterfaceAdaptorTable::const_iterator iti; + InterfaceAdaptorTable::const_iterator iti; - for (iti = _interfaces.begin(); iti != _interfaces.end(); ++iti) - { - debug_log("introspecting interface %s", iti->first.c_str()); + for (iti = _interfaces.begin(); iti != _interfaces.end(); ++iti) { + debug_log ("introspecting interface %s", iti->first.c_str()); - IntrospectedInterface *const intro = iti->second->introspect(); - if (intro) - { - xml << "\n\t<interface name=\"" << intro->name << "\">"; + IntrospectedInterface *const intro = iti->second->introspect(); - for (const IntrospectedProperty *p = intro->properties; p->name; ++p) - { - std::string access; + if (intro) { + xml << "\n\t<interface name=\"" << intro->name << "\">"; - if (p->read) access += "read"; - if (p->write) access += "write"; + for (const IntrospectedProperty *p = intro->properties; p->name; ++p) { + std::string access; - xml << "\n\t\t<property name=\"" << p->name << "\"" - << " type=\"" << p->type << "\"" - << " access=\"" << access << "\"/>"; - } + if (p->read) access += "read"; - for (const IntrospectedMethod *m = intro->methods; m->args; ++m) - { - xml << "\n\t\t<method name=\"" << m->name << "\">"; + if (p->write) access += "write"; - for (const IntrospectedArgument *a = m->args; a->type; ++a) - { - xml << "\n\t\t\t<arg direction=\"" << (a->in ? "in" : "out") << "\"" - << " type=\"" << a->type << "\""; + xml << "\n\t\t<property name=\"" << p->name << "\"" + << " type=\"" << p->type << "\"" + << " access=\"" << access << "\"/>"; + } - if (a->name) xml << " name=\"" << a->name << "\""; + for (const IntrospectedMethod *m = intro->methods; m->args; ++m) { + xml << "\n\t\t<method name=\"" << m->name << "\">"; - xml << "/>"; - } + for (const IntrospectedArgument *a = m->args; a->type; ++a) { + xml << "\n\t\t\t<arg direction=\"" << (a->in ? "in" : "out") << "\"" + << " type=\"" << a->type << "\""; - xml << "\n\t\t</method>"; - } + if (a->name) xml << " name=\"" << a->name << "\""; - for (const IntrospectedMethod *m = intro->signals; m->args; ++m) - { - xml << "\n\t\t<signal name=\"" << m->name << "\">"; + xml << "/>"; + } - for (const IntrospectedArgument *a = m->args; a->type; ++a) - { - xml << "<arg type=\"" << a->type << "\""; + xml << "\n\t\t</method>"; + } - if (a->name) xml << " name=\"" << a->name << "\""; + for (const IntrospectedMethod *m = intro->signals; m->args; ++m) { + xml << "\n\t\t<signal name=\"" << m->name << "\">"; - xml << "/>"; - } - xml << "\n\t\t</signal>"; - } + for (const IntrospectedArgument *a = m->args; a->type; ++a) { + xml << "<arg type=\"" << a->type << "\""; - xml << "\n\t</interface>"; - } - } + if (a->name) xml << " name=\"" << a->name << "\""; - const ObjectPathList nodes = ObjectAdaptor::child_nodes_from_prefix(path + '/'); - ObjectPathList::const_iterator oni; + xml << "/>"; + } - for (oni = nodes.begin(); oni != nodes.end(); ++oni) - { - xml << "\n\t<node name=\"" << (*oni) << "\"/>"; - } + xml << "\n\t\t</signal>"; + } - /* broken - const ObjectAdaptorPList children = ObjectAdaptor::from_path_prefix(path + '/'); + xml << "\n\t</interface>"; + } + } - ObjectAdaptorPList::const_iterator oci; + const ObjectPathList nodes = ObjectAdaptor::child_nodes_from_prefix (path + '/'); - for (oci = children.begin(); oci != children.end(); ++oci) - { - std::string name = (*oci)->path().substr(path.length()+1); - name.substr(name.find('/')); + ObjectPathList::const_iterator oni; - xml << "<node name=\"" << name << "\"/>"; - } - */ + for (oni = nodes.begin(); oni != nodes.end(); ++oni) { + xml << "\n\t<node name=\"" << (*oni) << "\"/>"; + } - xml << "\n</node>"; + /* broken + const ObjectAdaptorPList children = ObjectAdaptor::from_path_prefix(path + '/'); - ReturnMessage reply(call); - MessageIter wi = reply.writer(); - wi.append_string(xml.str().c_str()); - return reply; + ObjectAdaptorPList::const_iterator oci; + + for (oci = children.begin(); oci != children.end(); ++oci) + { + std::string name = (*oci)->path().substr(path.length()+1); + name.substr(name.find('/')); + + xml << "<node name=\"" << name << "\"/>"; + } + */ + + xml << "\n</node>"; + + ReturnMessage reply (call); + + MessageIter wi = reply.writer(); + + wi.append_string (xml.str().c_str()); + + return reply; } IntrospectedInterface *const IntrospectableAdaptor::introspect() const { - static IntrospectedArgument Introspect_args[] = - { - { "data", "s", false }, - { 0, 0, 0 } - }; - static IntrospectedMethod Introspectable_methods[] = - { - { "Introspect", Introspect_args }, - { 0, 0 } - }; - static IntrospectedMethod Introspectable_signals[] = - { - { 0, 0 } - }; - static IntrospectedProperty Introspectable_properties[] = - { - { 0, 0, 0, 0 } - }; - static IntrospectedInterface Introspectable_interface = - { - introspectable_name, - Introspectable_methods, - Introspectable_signals, - Introspectable_properties - }; - return &Introspectable_interface; + static IntrospectedArgument Introspect_args[] = { + { "data", "s", false }, + { 0, 0, 0 } + }; + static IntrospectedMethod Introspectable_methods[] = { + { "Introspect", Introspect_args }, + { 0, 0 } + }; + static IntrospectedMethod Introspectable_signals[] = { + { 0, 0 } + }; + static IntrospectedProperty Introspectable_properties[] = { + { 0, 0, 0, 0 } + }; + static IntrospectedInterface Introspectable_interface = { + introspectable_name, + Introspectable_methods, + Introspectable_signals, + Introspectable_properties + }; + return &Introspectable_interface; } IntrospectableProxy::IntrospectableProxy() -: InterfaceProxy(introspectable_name) + : InterfaceProxy (introspectable_name) {} std::string IntrospectableProxy::Introspect() { - DBus::CallMessage call; + DBus::CallMessage call; - call.member("Introspect"); + call.member ("Introspect"); - DBus::Message ret = invoke_method(call); + DBus::Message ret = invoke_method (call); - DBus::MessageIter ri = ret.reader(); - const char *str = ri.get_string(); + DBus::MessageIter ri = ret.reader(); + const char *str = ri.get_string(); - return str; + return str; } diff --git a/sflphone-common/libs/dbus-c++/src/message.cpp b/sflphone-common/libs/dbus-c++/src/message.cpp index 119bff8e312b8325864ff8dfa98c1d1e0543cb43..4f3425e08dc23c67edac9d849f717d5a2d29ef11 100644 --- a/sflphone-common/libs/dbus-c++/src/message.cpp +++ b/sflphone-common/libs/dbus-c++/src/message.cpp @@ -21,6 +21,9 @@ * */ +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif #include <dbus-c++/message.h> @@ -37,531 +40,537 @@ using namespace DBus; int MessageIter::type() { - return dbus_message_iter_get_arg_type((DBusMessageIter *)&_iter); + return dbus_message_iter_get_arg_type ( (DBusMessageIter *) &_iter); } bool MessageIter::at_end() { - return type() == DBUS_TYPE_INVALID; + return type() == DBUS_TYPE_INVALID; } bool MessageIter::has_next() { - return dbus_message_iter_has_next((DBusMessageIter *)&_iter); + return dbus_message_iter_has_next ( (DBusMessageIter *) &_iter); } MessageIter &MessageIter::operator ++() { - dbus_message_iter_next((DBusMessageIter *)&_iter); - return (*this); + dbus_message_iter_next ( (DBusMessageIter *) &_iter); + return (*this); } -MessageIter MessageIter::operator ++(int) +MessageIter MessageIter::operator ++ (int) { - MessageIter copy(*this); - ++(*this); - return copy; + MessageIter copy (*this); + ++ (*this); + return copy; } -bool MessageIter::append_basic(int type_id, void *value) +bool MessageIter::append_basic (int type_id, void *value) { - return dbus_message_iter_append_basic((DBusMessageIter *)&_iter, type_id, value); + return dbus_message_iter_append_basic ( (DBusMessageIter *) &_iter, type_id, value); } -void MessageIter::get_basic(int type_id, void *ptr) +void MessageIter::get_basic (int type_id, void *ptr) { - if (type() != type_id) - throw ErrorInvalidArgs("type mismatch"); + if (type() != type_id) + throw ErrorInvalidArgs ("type mismatch"); - dbus_message_iter_get_basic((DBusMessageIter *)_iter, ptr); + dbus_message_iter_get_basic ( (DBusMessageIter *) _iter, ptr); } -bool MessageIter::append_byte(unsigned char b) +bool MessageIter::append_byte (unsigned char b) { - return append_basic(DBUS_TYPE_BYTE, &b); + return append_basic (DBUS_TYPE_BYTE, &b); } unsigned char MessageIter::get_byte() -{ - unsigned char b; - get_basic(DBUS_TYPE_BYTE, &b); - return b; +{ + unsigned char b; + get_basic (DBUS_TYPE_BYTE, &b); + return b; } -bool MessageIter::append_bool(bool b) +bool MessageIter::append_bool (bool b) { - dbus_bool_t db = b; - return append_basic(DBUS_TYPE_BOOLEAN, &db); + dbus_bool_t db = b; + return append_basic (DBUS_TYPE_BOOLEAN, &db); } -bool MessageIter::get_bool() +bool MessageIter::get_bool() { - dbus_bool_t db; - get_basic(DBUS_TYPE_BOOLEAN, &db); - return (bool)db; + dbus_bool_t db; + get_basic (DBUS_TYPE_BOOLEAN, &db); + return (bool) db; } -bool MessageIter::append_int16(signed short i) +bool MessageIter::append_int16 (signed short i) { - return append_basic(DBUS_TYPE_INT16, &i); + return append_basic (DBUS_TYPE_INT16, &i); } signed short MessageIter::get_int16() -{ - signed short i; - get_basic(DBUS_TYPE_INT16, &i); - return i; +{ + signed short i; + get_basic (DBUS_TYPE_INT16, &i); + return i; } -bool MessageIter::append_uint16(unsigned short u) +bool MessageIter::append_uint16 (unsigned short u) { - return append_basic(DBUS_TYPE_UINT16, &u); + return append_basic (DBUS_TYPE_UINT16, &u); } unsigned short MessageIter::get_uint16() -{ - unsigned short u; - get_basic(DBUS_TYPE_UINT16, &u); - return u; +{ + unsigned short u; + get_basic (DBUS_TYPE_UINT16, &u); + return u; } -bool MessageIter::append_int32(signed int i) +bool MessageIter::append_int32 (signed int i) { - return append_basic(DBUS_TYPE_INT32, &i); + return append_basic (DBUS_TYPE_INT32, &i); } signed int MessageIter::get_int32() -{ - signed int i; - get_basic(DBUS_TYPE_INT32, &i); - return i; +{ + signed int i; + get_basic (DBUS_TYPE_INT32, &i); + return i; } -bool MessageIter::append_uint32(unsigned int u) +bool MessageIter::append_uint32 (unsigned int u) { - return append_basic(DBUS_TYPE_UINT32, &u); + return append_basic (DBUS_TYPE_UINT32, &u); } unsigned int MessageIter::get_uint32() -{ - unsigned int u; - get_basic(DBUS_TYPE_UINT32, &u); - return u; +{ + unsigned int u; + get_basic (DBUS_TYPE_UINT32, &u); + return u; } signed long long MessageIter::get_int64() { - signed long long i; - get_basic(DBUS_TYPE_INT64, &i); - return i; + signed long long i; + get_basic (DBUS_TYPE_INT64, &i); + return i; } -bool MessageIter::append_int64(signed long long i) +bool MessageIter::append_int64 (signed long long i) { - return append_basic(DBUS_TYPE_INT64, &i); + return append_basic (DBUS_TYPE_INT64, &i); } unsigned long long MessageIter::get_uint64() { - unsigned long long u; - get_basic(DBUS_TYPE_UINT64, &u); - return u; + unsigned long long u; + get_basic (DBUS_TYPE_UINT64, &u); + return u; } -bool MessageIter::append_uint64(unsigned long long u) +bool MessageIter::append_uint64 (unsigned long long u) { - return append_basic(DBUS_TYPE_UINT64, &u); + return append_basic (DBUS_TYPE_UINT64, &u); } double MessageIter::get_double() { - double d; - get_basic(DBUS_TYPE_DOUBLE, &d); - return d; + double d; + get_basic (DBUS_TYPE_DOUBLE, &d); + return d; } -bool MessageIter::append_double(double d) +bool MessageIter::append_double (double d) { - return append_basic(DBUS_TYPE_DOUBLE, &d); + return append_basic (DBUS_TYPE_DOUBLE, &d); } -bool MessageIter::append_string(const char *chars) +bool MessageIter::append_string (const char *chars) { - return append_basic(DBUS_TYPE_STRING, &chars); + return append_basic (DBUS_TYPE_STRING, &chars); } const char *MessageIter::get_string() { - char *chars; - get_basic(DBUS_TYPE_STRING, &chars); - return chars; + char *chars; + get_basic (DBUS_TYPE_STRING, &chars); + return chars; } -bool MessageIter::append_path(const char *chars) +bool MessageIter::append_path (const char *chars) { - return append_basic(DBUS_TYPE_OBJECT_PATH, &chars); + return append_basic (DBUS_TYPE_OBJECT_PATH, &chars); } const char *MessageIter::get_path() { - char *chars; - get_basic(DBUS_TYPE_OBJECT_PATH, &chars); - return chars; + char *chars; + get_basic (DBUS_TYPE_OBJECT_PATH, &chars); + return chars; } -bool MessageIter::append_signature(const char *chars) +bool MessageIter::append_signature (const char *chars) { - return append_basic(DBUS_TYPE_SIGNATURE, &chars); + return append_basic (DBUS_TYPE_SIGNATURE, &chars); } const char *MessageIter::get_signature() { - char *chars; - get_basic(DBUS_TYPE_SIGNATURE, &chars); - return chars; + char *chars; + get_basic (DBUS_TYPE_SIGNATURE, &chars); + return chars; } -MessageIter MessageIter::recurse() +MessageIter MessageIter::recurse() { - MessageIter iter(msg()); - dbus_message_iter_recurse((DBusMessageIter *)&_iter, (DBusMessageIter *)&(iter._iter)); - return iter; + MessageIter iter (msg()); + dbus_message_iter_recurse ( (DBusMessageIter *) &_iter, (DBusMessageIter *) & (iter._iter)); + return iter; } char *MessageIter::signature() const { - return dbus_message_iter_get_signature((DBusMessageIter *)&_iter); + return dbus_message_iter_get_signature ( (DBusMessageIter *) &_iter); } -bool MessageIter::append_array(char type, const void *ptr, size_t length) +bool MessageIter::append_array (char type, const void *ptr, size_t length) { - return dbus_message_iter_append_fixed_array((DBusMessageIter *)&_iter, type, &ptr, length); + return dbus_message_iter_append_fixed_array ( (DBusMessageIter *) &_iter, type, &ptr, length); } int MessageIter::array_type() { - return dbus_message_iter_get_element_type((DBusMessageIter *)&_iter); + return dbus_message_iter_get_element_type ( (DBusMessageIter *) &_iter); } -int MessageIter::get_array(void *ptr) +int MessageIter::get_array (void *ptr) { - int length; - dbus_message_iter_get_fixed_array((DBusMessageIter *)&_iter, ptr, &length); - return length; + int length; + dbus_message_iter_get_fixed_array ( (DBusMessageIter *) &_iter, ptr, &length); + return length; } bool MessageIter::is_array() { - return dbus_message_iter_get_arg_type((DBusMessageIter *)&_iter) == DBUS_TYPE_ARRAY; + return dbus_message_iter_get_arg_type ( (DBusMessageIter *) &_iter) == DBUS_TYPE_ARRAY; } bool MessageIter::is_dict() { - return is_array() && dbus_message_iter_get_element_type((DBusMessageIter *)_iter) == DBUS_TYPE_DICT_ENTRY; + return is_array() && dbus_message_iter_get_element_type ( (DBusMessageIter *) _iter) == DBUS_TYPE_DICT_ENTRY; } -MessageIter MessageIter::new_array(const char *sig) +MessageIter MessageIter::new_array (const char *sig) { - MessageIter arr(msg()); - dbus_message_iter_open_container( - (DBusMessageIter *)&_iter, DBUS_TYPE_ARRAY, sig, (DBusMessageIter *)&(arr._iter) - ); - return arr; + MessageIter arr (msg()); + dbus_message_iter_open_container ( + (DBusMessageIter *) &_iter, DBUS_TYPE_ARRAY, sig, (DBusMessageIter *) & (arr._iter) + ); + return arr; } -MessageIter MessageIter::new_variant(const char *sig) +MessageIter MessageIter::new_variant (const char *sig) { - MessageIter var(msg()); - dbus_message_iter_open_container( - (DBusMessageIter *)_iter, DBUS_TYPE_VARIANT, sig, (DBusMessageIter *)&(var._iter) - ); - return var; + MessageIter var (msg()); + dbus_message_iter_open_container ( + (DBusMessageIter *) _iter, DBUS_TYPE_VARIANT, sig, (DBusMessageIter *) & (var._iter) + ); + return var; } MessageIter MessageIter::new_struct() { - MessageIter stu(msg()); - dbus_message_iter_open_container( - (DBusMessageIter *)_iter, DBUS_TYPE_STRUCT, NULL, (DBusMessageIter *)&(stu._iter) - ); - return stu; + MessageIter stu (msg()); + dbus_message_iter_open_container ( + (DBusMessageIter *) _iter, DBUS_TYPE_STRUCT, NULL, (DBusMessageIter *) & (stu._iter) + ); + return stu; } MessageIter MessageIter::new_dict_entry() { - MessageIter ent(msg()); - dbus_message_iter_open_container( - (DBusMessageIter *)_iter, DBUS_TYPE_DICT_ENTRY, NULL, (DBusMessageIter *)&(ent._iter) - ); - return ent; -} - -void MessageIter::close_container(MessageIter &container) -{ - dbus_message_iter_close_container((DBusMessageIter *)&_iter, (DBusMessageIter *)&(container._iter)); -} - -static bool is_basic_type(int typecode) -{ - switch (typecode) - { - case 'y': - case 'b': - case 'n': - case 'q': - case 'i': - case 'u': - case 'x': - case 't': - case 'd': - case 's': - case 'o': - case 'g': - return true; - default: - return false; - } -} - -void MessageIter::copy_data(MessageIter &to) -{ - for (MessageIter &from = *this; !from.at_end(); ++from) - { - if (is_basic_type(from.type())) - { - debug_log("copying basic type: %c", from.type()); - - unsigned char value[8]; - from.get_basic(from.type(), &value); - to.append_basic(from.type(), &value); - } - else - { - MessageIter from_container = from.recurse(); - char *sig = from_container.signature(); - - debug_log("copying compound type: %c[%s]", from.type(), sig); - - MessageIter to_container (to.msg()); - dbus_message_iter_open_container - ( - (DBusMessageIter *)&(to._iter), - from.type(), - from.type() == DBUS_TYPE_VARIANT ? NULL : sig, - (DBusMessageIter *)&(to_container._iter) - ); - - from_container.copy_data(to_container); - to.close_container(to_container); - free(sig); - } - } + MessageIter ent (msg()); + dbus_message_iter_open_container ( + (DBusMessageIter *) _iter, DBUS_TYPE_DICT_ENTRY, NULL, (DBusMessageIter *) & (ent._iter) + ); + return ent; +} + +void MessageIter::close_container (MessageIter &container) +{ + dbus_message_iter_close_container ( (DBusMessageIter *) &_iter, (DBusMessageIter *) & (container._iter)); +} + +static bool is_basic_type (int typecode) +{ + switch (typecode) { + + case 'y': + + case 'b': + + case 'n': + + case 'q': + + case 'i': + + case 'u': + + case 'x': + + case 't': + + case 'd': + + case 's': + + case 'o': + + case 'g': + return true; + + default: + return false; + } +} + +void MessageIter::copy_data (MessageIter &to) +{ + for (MessageIter &from = *this; !from.at_end(); ++from) { + if (is_basic_type (from.type())) { + debug_log ("copying basic type: %c", from.type()); + + unsigned char value[8]; + from.get_basic (from.type(), &value); + to.append_basic (from.type(), &value); + } else { + MessageIter from_container = from.recurse(); + char *sig = from_container.signature(); + + debug_log ("copying compound type: %c[%s]", from.type(), sig); + + MessageIter to_container (to.msg()); + dbus_message_iter_open_container + ( + (DBusMessageIter *) & (to._iter), + from.type(), + from.type() == DBUS_TYPE_VARIANT ? NULL : sig, + (DBusMessageIter *) & (to_container._iter) + ); + + from_container.copy_data (to_container); + to.close_container (to_container); + free (sig); + } + } } /* */ Message::Message() -: _pvt(new Private) + : _pvt (new Private) { } -Message::Message(Message::Private *p, bool incref) -: _pvt(p) +Message::Message (Message::Private *p, bool incref) + : _pvt (p) { - if (_pvt->msg && incref) dbus_message_ref(_pvt->msg); + if (_pvt->msg && incref) dbus_message_ref (_pvt->msg); } -Message::Message(const Message &m) -: _pvt(m._pvt) +Message::Message (const Message &m) + : _pvt (m._pvt) { - dbus_message_ref(_pvt->msg); + dbus_message_ref (_pvt->msg); } Message::~Message() { - dbus_message_unref(_pvt->msg); + dbus_message_unref (_pvt->msg); } Message &Message::operator = (const Message &m) { - if (&m != this) - { - dbus_message_unref(_pvt->msg); - _pvt = m._pvt; - dbus_message_ref(_pvt->msg); - } - return *this; + if (&m != this) { + dbus_message_unref (_pvt->msg); + _pvt = m._pvt; + dbus_message_ref (_pvt->msg); + } + + return *this; } Message Message::copy() { - Private *pvt = new Private(dbus_message_copy(_pvt->msg)); - return Message(pvt); + Private *pvt = new Private (dbus_message_copy (_pvt->msg)); + return Message (pvt); } -bool Message::append(int first_type, ...) +bool Message::append (int first_type, ...) { - va_list vl; - va_start(vl, first_type); + va_list vl; + va_start (vl, first_type); - bool b = dbus_message_append_args_valist(_pvt->msg, first_type, vl); + bool b = dbus_message_append_args_valist (_pvt->msg, first_type, vl); - va_end(vl); - return b; + va_end (vl); + return b; } void Message::terminate() { - dbus_message_append_args(_pvt->msg, DBUS_TYPE_INVALID); + dbus_message_append_args (_pvt->msg, DBUS_TYPE_INVALID); } int Message::type() const { - return dbus_message_get_type(_pvt->msg); + return dbus_message_get_type (_pvt->msg); } int Message::serial() const { - return dbus_message_get_serial(_pvt->msg); + return dbus_message_get_serial (_pvt->msg); } int Message::reply_serial() const { - return dbus_message_get_reply_serial(_pvt->msg); + return dbus_message_get_reply_serial (_pvt->msg); } -bool Message::reply_serial(int s) +bool Message::reply_serial (int s) { - return dbus_message_set_reply_serial(_pvt->msg, s); + return dbus_message_set_reply_serial (_pvt->msg, s); } const char *Message::sender() const { - return dbus_message_get_sender(_pvt->msg); + return dbus_message_get_sender (_pvt->msg); } -bool Message::sender(const char *s) +bool Message::sender (const char *s) { - return dbus_message_set_sender(_pvt->msg, s); + return dbus_message_set_sender (_pvt->msg, s); } const char *Message::destination() const { - return dbus_message_get_destination(_pvt->msg); + return dbus_message_get_destination (_pvt->msg); } -bool Message::destination(const char *s) +bool Message::destination (const char *s) { - return dbus_message_set_destination(_pvt->msg, s); + return dbus_message_set_destination (_pvt->msg, s); } bool Message::is_error() const { - return type() == DBUS_MESSAGE_TYPE_ERROR; + return type() == DBUS_MESSAGE_TYPE_ERROR; } -bool Message::is_signal(const char *interface, const char *member) const +bool Message::is_signal (const char *interface, const char *member) const { - return dbus_message_is_signal(_pvt->msg, interface, member); + return dbus_message_is_signal (_pvt->msg, interface, member); } MessageIter Message::writer() { - MessageIter iter(*this); - dbus_message_iter_init_append(_pvt->msg, (DBusMessageIter *)&(iter._iter)); - return iter; + MessageIter iter (*this); + dbus_message_iter_init_append (_pvt->msg, (DBusMessageIter *) & (iter._iter)); + return iter; } MessageIter Message::reader() const { - MessageIter iter(const_cast<Message &>(*this)); - dbus_message_iter_init(_pvt->msg, (DBusMessageIter *)&(iter._iter)); - return iter; + MessageIter iter (const_cast<Message &> (*this)); + dbus_message_iter_init (_pvt->msg, (DBusMessageIter *) & (iter._iter)); + return iter; } -/* +/* */ ErrorMessage::ErrorMessage() { - _pvt->msg = dbus_message_new(DBUS_MESSAGE_TYPE_ERROR); + _pvt->msg = dbus_message_new (DBUS_MESSAGE_TYPE_ERROR); } -ErrorMessage::ErrorMessage(const Message &to_reply, const char *name, const char *message) +ErrorMessage::ErrorMessage (const Message &to_reply, const char *name, const char *message) { - _pvt->msg = dbus_message_new_error(to_reply._pvt->msg, name, message); + _pvt->msg = dbus_message_new_error (to_reply._pvt->msg, name, message); } bool ErrorMessage::operator == (const ErrorMessage &m) const { - return dbus_message_is_error(_pvt->msg, m.name()); + return dbus_message_is_error (_pvt->msg, m.name()); } const char *ErrorMessage::name() const { - return dbus_message_get_error_name(_pvt->msg); + return dbus_message_get_error_name (_pvt->msg); } -bool ErrorMessage::name(const char *n) +bool ErrorMessage::name (const char *n) { - return dbus_message_set_error_name(_pvt->msg, n); + return dbus_message_set_error_name (_pvt->msg, n); } /* */ -SignalMessage::SignalMessage(const char *name) +SignalMessage::SignalMessage (const char *name) { - _pvt->msg = dbus_message_new(DBUS_MESSAGE_TYPE_SIGNAL); - member(name); + _pvt->msg = dbus_message_new (DBUS_MESSAGE_TYPE_SIGNAL); + member (name); } -SignalMessage::SignalMessage(const char *path, const char *interface, const char *name) +SignalMessage::SignalMessage (const char *path, const char *interface, const char *name) { - _pvt->msg = dbus_message_new_signal(path, interface, name); + _pvt->msg = dbus_message_new_signal (path, interface, name); } bool SignalMessage::operator == (const SignalMessage &m) const { - return dbus_message_is_signal(_pvt->msg, m.interface(), m.member()); + return dbus_message_is_signal (_pvt->msg, m.interface(), m.member()); } -const char *SignalMessage::interface() const -{ - return dbus_message_get_interface(_pvt->msg); -} +const char *SignalMessage::interface() const { + return dbus_message_get_interface (_pvt->msg); + } -bool SignalMessage::interface(const char *i) -{ - return dbus_message_set_interface(_pvt->msg, i); +bool SignalMessage::interface (const char *i) { + return dbus_message_set_interface (_pvt->msg, i); } const char *SignalMessage::member() const { - return dbus_message_get_member(_pvt->msg); + return dbus_message_get_member (_pvt->msg); } -bool SignalMessage::member(const char *m) +bool SignalMessage::member (const char *m) { - return dbus_message_set_member(_pvt->msg, m); + return dbus_message_set_member (_pvt->msg, m); } const char *SignalMessage::path() const { - return dbus_message_get_path(_pvt->msg); + return dbus_message_get_path (_pvt->msg); } char ** SignalMessage::path_split() const { - char ** p; - dbus_message_get_path_decomposed(_pvt->msg, &p); //todo: return as a std::vector ? - return p; + char ** p; + dbus_message_get_path_decomposed (_pvt->msg, &p); //todo: return as a std::vector ? + return p; } -bool SignalMessage::path(const char *p) +bool SignalMessage::path (const char *p) { - return dbus_message_set_path(_pvt->msg, p); + return dbus_message_set_path (_pvt->msg, p); } /* @@ -569,71 +578,69 @@ bool SignalMessage::path(const char *p) CallMessage::CallMessage() { - _pvt->msg = dbus_message_new(DBUS_MESSAGE_TYPE_METHOD_CALL); + _pvt->msg = dbus_message_new (DBUS_MESSAGE_TYPE_METHOD_CALL); } -CallMessage::CallMessage(const char *dest, const char *path, const char *iface, const char *method) +CallMessage::CallMessage (const char *dest, const char *path, const char *iface, const char *method) { - _pvt->msg = dbus_message_new_method_call(dest, path, iface, method); + _pvt->msg = dbus_message_new_method_call (dest, path, iface, method); } bool CallMessage::operator == (const CallMessage &m) const { - return dbus_message_is_method_call(_pvt->msg, m.interface(), m.member()); + return dbus_message_is_method_call (_pvt->msg, m.interface(), m.member()); } -const char *CallMessage::interface() const -{ - return dbus_message_get_interface(_pvt->msg); -} +const char *CallMessage::interface() const { + return dbus_message_get_interface (_pvt->msg); + } -bool CallMessage::interface(const char *i) -{ - return dbus_message_set_interface(_pvt->msg, i); +bool CallMessage::interface (const char *i) { + return dbus_message_set_interface (_pvt->msg, i); } const char *CallMessage::member() const { - return dbus_message_get_member(_pvt->msg); + return dbus_message_get_member (_pvt->msg); } -bool CallMessage::member(const char *m) +bool CallMessage::member (const char *m) { - return dbus_message_set_member(_pvt->msg, m); + return dbus_message_set_member (_pvt->msg, m); } const char *CallMessage::path() const { - return dbus_message_get_path(_pvt->msg); + return dbus_message_get_path (_pvt->msg); } char ** CallMessage::path_split() const { - char ** p; - dbus_message_get_path_decomposed(_pvt->msg, &p); - return p; + char ** p; + dbus_message_get_path_decomposed (_pvt->msg, &p); + return p; } -bool CallMessage::path(const char *p) +bool CallMessage::path (const char *p) { - return dbus_message_set_path(_pvt->msg, p); + return dbus_message_set_path (_pvt->msg, p); } const char *CallMessage::signature() const { - return dbus_message_get_signature(_pvt->msg); + return dbus_message_get_signature (_pvt->msg); } /* */ -ReturnMessage::ReturnMessage(const CallMessage &callee) +ReturnMessage::ReturnMessage (const CallMessage &callee) { - _pvt = new Private(dbus_message_new_method_return(callee._pvt->msg)); + _pvt = new Private (dbus_message_new_method_return (callee._pvt->msg)); } const char *ReturnMessage::signature() const { - return dbus_message_get_signature(_pvt->msg); + return dbus_message_get_signature (_pvt->msg); } diff --git a/sflphone-common/libs/dbus-c++/src/message_p.h b/sflphone-common/libs/dbus-c++/src/message_p.h index af421bc10ed81493f4b814d0a996737891ec602c..18fdb8e3ae6c27a1109c46789810824a9e4f7400 100644 --- a/sflphone-common/libs/dbus-c++/src/message_p.h +++ b/sflphone-common/libs/dbus-c++/src/message_p.h @@ -26,7 +26,7 @@ #define __DBUSXX_MESSAGE_P_H #ifdef HAVE_CONFIG_H -#include "config.h" +#include <config.h> #endif #include <dbus-c++/message.h> diff --git a/sflphone-common/libs/dbus-c++/src/object.cpp b/sflphone-common/libs/dbus-c++/src/object.cpp index 970fcf7b28269fccb6498463bb0ee1865eb6566a..4fa8cd15d11a099afae8a3ccbf52cbe2d0f1da90 100644 --- a/sflphone-common/libs/dbus-c++/src/object.cpp +++ b/sflphone-common/libs/dbus-c++/src/object.cpp @@ -21,6 +21,9 @@ * */ +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif #include <dbus-c++/debug.h> #include <dbus-c++/object.h> @@ -36,8 +39,8 @@ using namespace DBus; -Object::Object(Connection &conn, const Path &path, const char *service) -: _conn(conn), _path(path), _service(service ? service : "") +Object::Object (Connection &conn, const Path &path, const char *service) + : _conn (conn), _path (path), _service (service ? service : "") { } @@ -45,319 +48,315 @@ Object::~Object() { } -struct ObjectAdaptor::Private -{ - static void unregister_function_stub(DBusConnection *, void *); - static DBusHandlerResult message_function_stub(DBusConnection *, DBusMessage *, void *); +struct ObjectAdaptor::Private { + static void unregister_function_stub (DBusConnection *, void *); + static DBusHandlerResult message_function_stub (DBusConnection *, DBusMessage *, void *); }; -static DBusObjectPathVTable _vtable = -{ - ObjectAdaptor::Private::unregister_function_stub, - ObjectAdaptor::Private::message_function_stub, - NULL, NULL, NULL, NULL +static DBusObjectPathVTable _vtable = { + ObjectAdaptor::Private::unregister_function_stub, + ObjectAdaptor::Private::message_function_stub, + NULL, NULL, NULL, NULL }; -void ObjectAdaptor::Private::unregister_function_stub(DBusConnection *conn, void *data) +void ObjectAdaptor::Private::unregister_function_stub (DBusConnection *conn, void *data) { - //TODO: what do we have to do here ? + //TODO: what do we have to do here ? } -DBusHandlerResult ObjectAdaptor::Private::message_function_stub(DBusConnection *, DBusMessage *dmsg, void *data) +DBusHandlerResult ObjectAdaptor::Private::message_function_stub (DBusConnection *, DBusMessage *dmsg, void *data) { - ObjectAdaptor *o = static_cast<ObjectAdaptor *>(data); - - if (o) - { - Message msg(new Message::Private(dmsg)); - - debug_log("in object %s", o->path().c_str()); - debug_log(" got message #%d from %s to %s", - msg.serial(), - msg.sender(), - msg.destination() - ); - - return o->handle_message(msg) - ? DBUS_HANDLER_RESULT_HANDLED - : DBUS_HANDLER_RESULT_NOT_YET_HANDLED; - } - else - { - return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; - } + ObjectAdaptor *o = static_cast<ObjectAdaptor *> (data); + + if (o) { + Message msg (new Message::Private (dmsg)); + + debug_log ("in object %s", o->path().c_str()); + debug_log (" got message #%d from %s to %s", + msg.serial(), + msg.sender(), + msg.destination() + ); + + return o->handle_message (msg) + ? DBUS_HANDLER_RESULT_HANDLED + : DBUS_HANDLER_RESULT_NOT_YET_HANDLED; + } else { + return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; + } } typedef std::map<Path, ObjectAdaptor *> ObjectAdaptorTable; static ObjectAdaptorTable _adaptor_table; -ObjectAdaptor *ObjectAdaptor::from_path(const Path &path) +ObjectAdaptor *ObjectAdaptor::from_path (const Path &path) { - ObjectAdaptorTable::iterator ati = _adaptor_table.find(path); + ObjectAdaptorTable::iterator ati = _adaptor_table.find (path); - if (ati != _adaptor_table.end()) - return ati->second; + if (ati != _adaptor_table.end()) + return ati->second; - return NULL; + return NULL; } -ObjectAdaptorPList ObjectAdaptor::from_path_prefix(const std::string &prefix) +ObjectAdaptorPList ObjectAdaptor::from_path_prefix (const std::string &prefix) { - ObjectAdaptorPList ali; + ObjectAdaptorPList ali; - ObjectAdaptorTable::iterator ati = _adaptor_table.begin(); + ObjectAdaptorTable::iterator ati = _adaptor_table.begin(); - size_t plen = prefix.length(); + size_t plen = prefix.length(); - while (ati != _adaptor_table.end()) - { - if (!strncmp(ati->second->path().c_str(), prefix.c_str(), plen)) - ali.push_back(ati->second); + while (ati != _adaptor_table.end()) { + if (!strncmp (ati->second->path().c_str(), prefix.c_str(), plen)) + ali.push_back (ati->second); - ++ati; - } + ++ati; + } - return ali; + return ali; } -ObjectPathList ObjectAdaptor::child_nodes_from_prefix(const std::string &prefix) +ObjectPathList ObjectAdaptor::child_nodes_from_prefix (const std::string &prefix) { - ObjectPathList ali; + ObjectPathList ali; + + ObjectAdaptorTable::iterator ati = _adaptor_table.begin(); + + size_t plen = prefix.length(); - ObjectAdaptorTable::iterator ati = _adaptor_table.begin(); + while (ati != _adaptor_table.end()) { + if (!strncmp (ati->second->path().c_str(), prefix.c_str(), plen)) { + std::string p = ati->second->path().substr (plen); + p = p.substr (0,p.find ('/')); + ali.push_back (p); + } - size_t plen = prefix.length(); + ++ati; + } - while (ati != _adaptor_table.end()) - { - if (!strncmp(ati->second->path().c_str(), prefix.c_str(), plen)) - { - std::string p = ati->second->path().substr(plen); - p = p.substr(0,p.find('/')); - ali.push_back(p); - } - ++ati; - } + ali.sort(); - ali.sort(); - ali.unique(); + ali.unique(); - return ali; + return ali; } -ObjectAdaptor::ObjectAdaptor(Connection &conn, const Path &path) -: Object(conn, path, conn.unique_name()) +ObjectAdaptor::ObjectAdaptor (Connection &conn, const Path &path) + : Object (conn, path, conn.unique_name()) { - register_obj(); + register_obj(); } ObjectAdaptor::~ObjectAdaptor() { - unregister_obj(); + unregister_obj(); } void ObjectAdaptor::register_obj() { - debug_log("registering local object %s", path().c_str()); + debug_log ("registering local object %s", path().c_str()); - if (!dbus_connection_register_object_path(conn()._pvt->conn, path().c_str(), &_vtable, this)) - { - throw ErrorNoMemory("unable to register object path"); - } + if (!dbus_connection_register_object_path (conn()._pvt->conn, path().c_str(), &_vtable, this)) { + throw ErrorNoMemory ("unable to register object path"); + } - _adaptor_table[path()] = this; + _adaptor_table[path() ] = this; } void ObjectAdaptor::unregister_obj() { - _adaptor_table.erase(path()); + _adaptor_table.erase (path()); - debug_log("unregistering local object %s", path().c_str()); + debug_log ("unregistering local object %s", path().c_str()); - dbus_connection_unregister_object_path(conn()._pvt->conn, path().c_str()); + dbus_connection_unregister_object_path (conn()._pvt->conn, path().c_str()); } -void ObjectAdaptor::_emit_signal(SignalMessage &sig) +void ObjectAdaptor::_emit_signal (SignalMessage &sig) { - sig.path(path().c_str()); + sig.path (path().c_str()); - conn().send(sig); + conn().send (sig); } -struct ReturnLaterError -{ - const Tag *tag; +struct ReturnLaterError { + const Tag *tag; }; -bool ObjectAdaptor::handle_message(const Message &msg) +bool ObjectAdaptor::handle_message (const Message &msg) { - switch (msg.type()) - { - case DBUS_MESSAGE_TYPE_METHOD_CALL: - { - const CallMessage &cmsg = reinterpret_cast<const CallMessage &>(msg); - const char *member = cmsg.member(); - const char *interface = cmsg.interface(); - - debug_log(" invoking method %s.%s", interface, member); - - InterfaceAdaptor *ii = find_interface(interface); - if (ii) - { - try - { - Message ret = ii->dispatch_method(cmsg); - conn().send(ret); - } - catch(Error &e) - { - ErrorMessage em(cmsg, e.name(), e.message()); - conn().send(em); - } - catch(ReturnLaterError &rle) - { - _continuations[rle.tag] = new Continuation(conn(), cmsg, rle.tag); - } - return true; - } - else - { - return false; - } - } - default: - { - return false; - } - } + switch (msg.type()) { + + case DBUS_MESSAGE_TYPE_METHOD_CALL: { + const CallMessage &cmsg = reinterpret_cast<const CallMessage &> (msg); + const char *member = cmsg.member(); + + const char *interface = cmsg.interface(); + + debug_log (" invoking method %s.%s", interface, member); + + InterfaceAdaptor *ii = find_interface (interface); + + if (ii) { + try { + Message ret = ii->dispatch_method (cmsg); + conn().send (ret); + } catch (Error &e) { + ErrorMessage em (cmsg, e.name(), e.message()); + conn().send (em); + } catch (ReturnLaterError &rle) { + _continuations[rle.tag] = new Continuation (conn(), cmsg, rle.tag); + } + + return true; + } else { + return false; + } + } + + default: { + return false; + } + } } -void ObjectAdaptor::return_later(const Tag *tag) +void ObjectAdaptor::return_later (const Tag *tag) { - ReturnLaterError rle = { tag }; - throw rle; + ReturnLaterError rle = { tag }; + throw rle; } -void ObjectAdaptor::return_now(Continuation *ret) +void ObjectAdaptor::return_now (Continuation *ret) { - ret->_conn.send(ret->_return); + ret->_conn.send (ret->_return); - ContinuationMap::iterator di = _continuations.find(ret->_tag); + ContinuationMap::iterator di = _continuations.find (ret->_tag); - delete di->second; + delete di->second; - _continuations.erase(di); + _continuations.erase (di); } -void ObjectAdaptor::return_error(Continuation *ret, const Error error) +void ObjectAdaptor::return_error (Continuation *ret, const Error error) { - ret->_conn.send(ErrorMessage(ret->_call, error.name(), error.message())); + ret->_conn.send (ErrorMessage (ret->_call, error.name(), error.message())); - ContinuationMap::iterator di = _continuations.find(ret->_tag); + ContinuationMap::iterator di = _continuations.find (ret->_tag); - delete di->second; + delete di->second; - _continuations.erase(di); + _continuations.erase (di); } -ObjectAdaptor::Continuation *ObjectAdaptor::find_continuation(const Tag *tag) +ObjectAdaptor::Continuation *ObjectAdaptor::find_continuation (const Tag *tag) { - ContinuationMap::iterator di = _continuations.find(tag); + ContinuationMap::iterator di = _continuations.find (tag); - return di != _continuations.end() ? di->second : NULL; + return di != _continuations.end() ? di->second : NULL; } -ObjectAdaptor::Continuation::Continuation(Connection &conn, const CallMessage &call, const Tag *tag) -: _conn(conn), _call(call), _return(_call), _tag(tag) +ObjectAdaptor::Continuation::Continuation (Connection &conn, const CallMessage &call, const Tag *tag) + : _conn (conn), _call (call), _return (_call), _tag (tag) { - _writer = _return.writer(); //todo: verify + _writer = _return.writer(); //todo: verify } /* */ -ObjectProxy::ObjectProxy(Connection &conn, const Path &path, const char *service) -: Object(conn, path, service) +ObjectProxy::ObjectProxy (Connection &conn, const Path &path, const char *service) + : Object (conn, path, service) { - register_obj(); + register_obj(); } ObjectProxy::~ObjectProxy() { - unregister_obj(); + unregister_obj(); } void ObjectProxy::register_obj() { - debug_log("registering remote object %s", path().c_str()); - - _filtered = new Callback<ObjectProxy, bool, const Message &>(this, &ObjectProxy::handle_message); - - conn().add_filter(_filtered); - - InterfaceProxyTable::const_iterator ii = _interfaces.begin(); - while (ii != _interfaces.end()) - { - std::string im = "type='signal',interface='"+ii->first+"',path='"+path()+"'"; - conn().add_match(im.c_str()); - ++ii; - } + debug_log ("registering remote object %s", path().c_str()); + + _filtered = new Callback<ObjectProxy, bool, const Message &> (this, &ObjectProxy::handle_message); + + conn().add_filter (_filtered); + + InterfaceProxyTable::const_iterator ii = _interfaces.begin(); + + while (ii != _interfaces.end()) { + std::string im = "type='signal',interface='"+ii->first+"',path='"+path() +"'"; + conn().add_match (im.c_str()); + ++ii; + } } void ObjectProxy::unregister_obj() { - debug_log("unregistering remote object %s", path().c_str()); - - InterfaceProxyTable::const_iterator ii = _interfaces.begin(); - while (ii != _interfaces.end()) - { - std::string im = "type='signal',interface='"+ii->first+"',path='"+path()+"'"; - conn().remove_match(im.c_str()); - ++ii; - } - conn().remove_filter(_filtered); + debug_log ("unregistering remote object %s", path().c_str()); + + InterfaceProxyTable::const_iterator ii = _interfaces.begin(); + + while (ii != _interfaces.end()) { + std::string im = "type='signal',interface='"+ii->first+"',path='"+path() +"'"; + conn().remove_match (im.c_str()); + ++ii; + } + + conn().remove_filter (_filtered); } -Message ObjectProxy::_invoke_method(CallMessage &call) +Message ObjectProxy::_invoke_method (CallMessage &call) { - if (call.path() == NULL) - call.path(path().c_str()); + if (call.path() == NULL) + call.path (path().c_str()); - if (call.destination() == NULL) - call.destination(service().c_str()); + if (call.destination() == NULL) + call.destination (service().c_str()); - return conn().send_blocking(call); + return conn().send_blocking (call); } -bool ObjectProxy::handle_message(const Message &msg) +bool ObjectProxy::_invoke_method_noreply (CallMessage &call) { - switch (msg.type()) - { - case DBUS_MESSAGE_TYPE_SIGNAL: - { - const SignalMessage &smsg = reinterpret_cast<const SignalMessage &>(msg); - const char *interface = smsg.interface(); - const char *member = smsg.member(); - const char *objpath = smsg.path(); - - if (objpath != path()) return false; - - debug_log("filtered signal %s(in %s) from %s to object %s", - member, interface, msg.sender(), objpath); - - InterfaceProxy *ii = find_interface(interface); - if (ii) - { - return ii->dispatch_signal(smsg); - } - else - { - return false; - } - } - default: - { - return false; - } - } + if (call.path() == NULL) + call.path (path().c_str()); + + if (call.destination() == NULL) + call.destination (service().c_str()); + + return conn().send (call); +} + +bool ObjectProxy::handle_message (const Message &msg) +{ + switch (msg.type()) { + + case DBUS_MESSAGE_TYPE_SIGNAL: { + const SignalMessage &smsg = reinterpret_cast<const SignalMessage &> (msg); + + const char *interface = smsg.interface(); + const char *member = smsg.member(); + const char *objpath = smsg.path(); + + if (objpath != path()) return false; + + debug_log ("filtered signal %s(in %s) from %s to object %s", + member, interface, msg.sender(), objpath); + + InterfaceProxy *ii = find_interface (interface); + + if (ii) { + return ii->dispatch_signal (smsg); + } else { + return false; + } + } + + default: { + return false; + } + } } diff --git a/sflphone-common/libs/dbus-c++/src/pendingcall.cpp b/sflphone-common/libs/dbus-c++/src/pendingcall.cpp index e55c174be575db3d632135e1209471b3c1d95a73..775561c21c3a733e99b1f2c0c17c7a7558245936 100644 --- a/sflphone-common/libs/dbus-c++/src/pendingcall.cpp +++ b/sflphone-common/libs/dbus-c++/src/pendingcall.cpp @@ -21,6 +21,9 @@ * */ +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif #include <dbus-c++/pendingcall.h> @@ -32,108 +35,104 @@ using namespace DBus; -PendingCall::Private::Private(DBusPendingCall *dpc) -: call(dpc), dataslot(-1) +PendingCall::Private::Private (DBusPendingCall *dpc) + : call (dpc), dataslot (-1) { - if (!dbus_pending_call_allocate_data_slot(&dataslot)) - { - throw ErrorNoMemory("Unable to allocate data slot"); - } + if (!dbus_pending_call_allocate_data_slot (&dataslot)) { + throw ErrorNoMemory ("Unable to allocate data slot"); + } } PendingCall::Private::~Private() { - if (dataslot != -1) - { - dbus_pending_call_allocate_data_slot(&dataslot); - } + if (dataslot != -1) { + dbus_pending_call_allocate_data_slot (&dataslot); + } } -void PendingCall::Private::notify_stub(DBusPendingCall *dpc, void *data) +void PendingCall::Private::notify_stub (DBusPendingCall *dpc, void *data) { - PendingCall::Private *pvt = static_cast<PendingCall::Private *>(data); + PendingCall::Private *pvt = static_cast<PendingCall::Private *> (data); - PendingCall pc(pvt); - pvt->slot(pc); + PendingCall pc (pvt); + pvt->slot (pc); } -PendingCall::PendingCall(PendingCall::Private *p) -: _pvt(p) +PendingCall::PendingCall (PendingCall::Private *p) + : _pvt (p) { - if (!dbus_pending_call_set_notify(_pvt->call, Private::notify_stub, p, NULL)) - { - throw ErrorNoMemory("Unable to initialize pending call"); - } + if (!dbus_pending_call_set_notify (_pvt->call, Private::notify_stub, p, NULL)) { + throw ErrorNoMemory ("Unable to initialize pending call"); + } } -PendingCall::PendingCall(const PendingCall &c) -: _pvt(c._pvt) +PendingCall::PendingCall (const PendingCall &c) + : _pvt (c._pvt) { - dbus_pending_call_ref(_pvt->call); + dbus_pending_call_ref (_pvt->call); } PendingCall::~PendingCall() { - dbus_pending_call_unref(_pvt->call); + dbus_pending_call_unref (_pvt->call); } PendingCall &PendingCall::operator = (const PendingCall &c) { - if (&c != this) - { - dbus_pending_call_unref(_pvt->call); - _pvt = c._pvt; - dbus_pending_call_ref(_pvt->call); - } - return *this; + if (&c != this) { + dbus_pending_call_unref (_pvt->call); + _pvt = c._pvt; + dbus_pending_call_ref (_pvt->call); + } + + return *this; } bool PendingCall::completed() { - return dbus_pending_call_get_completed(_pvt->call); + return dbus_pending_call_get_completed (_pvt->call); } void PendingCall::cancel() { - dbus_pending_call_cancel(_pvt->call); + dbus_pending_call_cancel (_pvt->call); } void PendingCall::block() { - dbus_pending_call_block(_pvt->call); + dbus_pending_call_block (_pvt->call); } -void PendingCall::data(void *p) +void PendingCall::data (void *p) { - if (!dbus_pending_call_set_data(_pvt->call, _pvt->dataslot, p, NULL)) - { - throw ErrorNoMemory("Unable to initialize data slot"); - } + if (!dbus_pending_call_set_data (_pvt->call, _pvt->dataslot, p, NULL)) { + throw ErrorNoMemory ("Unable to initialize data slot"); + } } void *PendingCall::data() { - return dbus_pending_call_get_data(_pvt->call, _pvt->dataslot); + return dbus_pending_call_get_data (_pvt->call, _pvt->dataslot); } Slot<void, PendingCall &>& PendingCall::slot() { - return _pvt->slot; + return _pvt->slot; } Message PendingCall::steal_reply() { - DBusMessage *dmsg = dbus_pending_call_steal_reply(_pvt->call); - if (!dmsg) - { - dbus_bool_t callComplete = dbus_pending_call_get_completed(_pvt->call); - - if (callComplete) - throw ErrorNoReply("No reply available"); - else - throw ErrorNoReply("Call not complete"); - } - - return Message(new Message::Private(dmsg)); + DBusMessage *dmsg = dbus_pending_call_steal_reply (_pvt->call); + + if (!dmsg) { + dbus_bool_t callComplete = dbus_pending_call_get_completed (_pvt->call); + + if (callComplete) + throw ErrorNoReply ("No reply available"); + else + throw ErrorNoReply ("Call not complete"); + } + + return Message (new Message::Private (dmsg)); } diff --git a/sflphone-common/libs/dbus-c++/src/pendingcall_p.h b/sflphone-common/libs/dbus-c++/src/pendingcall_p.h index 1768b52da544ecd101c848af7b3f5becbc4872bf..0141c364fd33af30ed003b00640fbcd2a3e15026 100644 --- a/sflphone-common/libs/dbus-c++/src/pendingcall_p.h +++ b/sflphone-common/libs/dbus-c++/src/pendingcall_p.h @@ -26,7 +26,7 @@ #define __DBUSXX_PENDING_CALL_P_H #ifdef HAVE_CONFIG_H -#include "config.h" +#include <config.h> #endif #include <dbus-c++/pendingcall.h> diff --git a/sflphone-common/libs/dbus-c++/src/property.cpp b/sflphone-common/libs/dbus-c++/src/property.cpp index 1bf6c6b1f0132e2985b89bccfb3629e35cd5a669..e8b02fdaded719b0b8d9e763e0dc42e7e9f8b42c 100644 --- a/sflphone-common/libs/dbus-c++/src/property.cpp +++ b/sflphone-common/libs/dbus-c++/src/property.cpp @@ -21,6 +21,10 @@ * */ +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + #include <dbus-c++/debug.h> #include <dbus-c++/property.h> @@ -31,120 +35,115 @@ using namespace DBus; static const char *properties_name = "org.freedesktop.DBus.Properties"; PropertiesAdaptor::PropertiesAdaptor() -: InterfaceAdaptor(properties_name) + : InterfaceAdaptor (properties_name) { - register_method(PropertiesAdaptor, Get, Get); - register_method(PropertiesAdaptor, Set, Set); + register_method (PropertiesAdaptor, Get, Get); + register_method (PropertiesAdaptor, Set, Set); } -Message PropertiesAdaptor::Get(const CallMessage &call) +Message PropertiesAdaptor::Get (const CallMessage &call) { - MessageIter ri = call.reader(); + MessageIter ri = call.reader(); + + std::string iface_name; + std::string property_name; - std::string iface_name; - std::string property_name; + ri >> iface_name >> property_name; - ri >> iface_name >> property_name; + debug_log ("requesting property %s on interface %s", property_name.c_str(), iface_name.c_str()); - debug_log("requesting property %s on interface %s", property_name.c_str(), iface_name.c_str()); + InterfaceAdaptor *interface = (InterfaceAdaptor *) find_interface (iface_name); - InterfaceAdaptor *interface = (InterfaceAdaptor *) find_interface(iface_name); + if (!interface) + throw ErrorFailed ("requested interface not found"); - if (!interface) - throw ErrorFailed("requested interface not found"); + Variant *value = interface->get_property (property_name); - Variant *value = interface->get_property(property_name); + if (!value) + throw ErrorFailed ("requested property not found"); - if (!value) - throw ErrorFailed("requested property not found"); + on_get_property (*interface, property_name, *value); - on_get_property(*interface, property_name, *value); + ReturnMessage reply (call); - ReturnMessage reply(call); + MessageIter wi = reply.writer(); - MessageIter wi = reply.writer(); + wi << *value; - wi << *value; - return reply; + return reply; } -Message PropertiesAdaptor::Set(const CallMessage &call) +Message PropertiesAdaptor::Set (const CallMessage &call) { - MessageIter ri = call.reader(); + MessageIter ri = call.reader(); - std::string iface_name; - std::string property_name; - Variant value; + std::string iface_name; + std::string property_name; + Variant value; - ri >> iface_name >> property_name >> value; + ri >> iface_name >> property_name >> value; - InterfaceAdaptor *interface = (InterfaceAdaptor *) find_interface(iface_name); + InterfaceAdaptor *interface = (InterfaceAdaptor *) find_interface (iface_name); - if (!interface) - throw ErrorFailed("requested interface not found"); + if (!interface) + throw ErrorFailed ("requested interface not found"); - on_set_property(*interface, property_name, value); + on_set_property (*interface, property_name, value); - interface->set_property(property_name, value); + interface->set_property (property_name, value); - ReturnMessage reply(call); + ReturnMessage reply (call); - return reply; + return reply; } IntrospectedInterface *const PropertiesAdaptor::introspect() const { - static IntrospectedArgument Get_args[] = - { - { "interface_name", "s", true }, - { "property_name", "s", true }, - { "value", "v", false }, - { 0, 0, 0 } - }; - static IntrospectedArgument Set_args[] = - { - { "interface_name", "s", true }, - { "property_name", "s", true }, - { "value", "v", true }, - { 0, 0, 0 } - }; - static IntrospectedMethod Properties_methods[] = - { - { "Get", Get_args }, - { "Set", Set_args }, - { 0, 0 } - }; - static IntrospectedMethod Properties_signals[] = - { - { 0, 0 } - }; - static IntrospectedProperty Properties_properties[] = - { - { 0, 0, 0, 0 } - }; - static IntrospectedInterface Properties_interface = - { - properties_name, - Properties_methods, - Properties_signals, - Properties_properties - }; - return &Properties_interface; + static IntrospectedArgument Get_args[] = { + { "interface_name", "s", true }, + { "property_name", "s", true }, + { "value", "v", false }, + { 0, 0, 0 } + }; + static IntrospectedArgument Set_args[] = { + { "interface_name", "s", true }, + { "property_name", "s", true }, + { "value", "v", true }, + { 0, 0, 0 } + }; + static IntrospectedMethod Properties_methods[] = { + { "Get", Get_args }, + { "Set", Set_args }, + { 0, 0 } + }; + static IntrospectedMethod Properties_signals[] = { + { 0, 0 } + }; + static IntrospectedProperty Properties_properties[] = { + { 0, 0, 0, 0 } + }; + static IntrospectedInterface Properties_interface = { + properties_name, + Properties_methods, + Properties_signals, + Properties_properties + }; + return &Properties_interface; } PropertiesProxy::PropertiesProxy() -: InterfaceProxy(properties_name) + : InterfaceProxy (properties_name) { } -Variant PropertiesProxy::Get(const std::string &iface, const std::string &property) +Variant PropertiesProxy::Get (const std::string &iface, const std::string &property) { //todo - Variant v; - return v; + Variant v; + return v; } -void PropertiesProxy::Set(const std::string &iface, const std::string &property, const Variant &value) +void PropertiesProxy::Set (const std::string &iface, const std::string &property, const Variant &value) { //todo } diff --git a/sflphone-common/libs/dbus-c++/src/server.cpp b/sflphone-common/libs/dbus-c++/src/server.cpp index eae46d664c7f3be0d6416f15fa5d04a48b4de2bd..b3dbfe267b96254e70a3bc9dee77f48bb66dc97d 100644 --- a/sflphone-common/libs/dbus-c++/src/server.cpp +++ b/sflphone-common/libs/dbus-c++/src/server.cpp @@ -21,6 +21,9 @@ * */ +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif #include <dbus-c++/debug.h> #include <dbus-c++/server.h> @@ -32,8 +35,8 @@ using namespace DBus; -Server::Private::Private(DBusServer *s) -: server(s) +Server::Private::Private (DBusServer *s) + : server (s) { } @@ -41,34 +44,35 @@ Server::Private::~Private() { } -void Server::Private::on_new_conn_cb(DBusServer *server, DBusConnection *conn, void *data) +void Server::Private::on_new_conn_cb (DBusServer *server, DBusConnection *conn, void *data) { - Server *s = static_cast<Server *>(data); + Server *s = static_cast<Server *> (data); - Connection nc (new Connection::Private(conn, s->_pvt.get())); + Connection nc (new Connection::Private (conn, s->_pvt.get())); - s->_pvt->connections.push_back(nc); + s->_pvt->connections.push_back (nc); - s->on_new_connection(nc); + s->on_new_connection (nc); - debug_log("incoming connection 0x%08x", conn); + debug_log ("incoming connection 0x%08x", conn); } -Server::Server(const char *address) +Server::Server (const char *address) { - InternalError e; - DBusServer *server = dbus_server_listen(address, e); + InternalError e; + DBusServer *server = dbus_server_listen (address, e); - if (e) throw Error(e); + if (e) throw Error (e); - debug_log("server 0x%08x listening on %s", server, address); + debug_log ("server 0x%08x listening on %s", server, address); - _pvt = new Private(server); + _pvt = new Private (server); - dbus_server_set_new_connection_function(_pvt->server, Private::on_new_conn_cb, this, NULL); + dbus_server_set_new_connection_function (_pvt->server, Private::on_new_conn_cb, this, NULL); - setup(default_dispatcher); + setup (default_dispatcher); } + /* Server::Server(const Server &s) : _pvt(s._pvt) @@ -78,49 +82,50 @@ Server::Server(const Server &s) */ Server::~Server() { - dbus_server_unref(_pvt->server); + dbus_server_unref (_pvt->server); } -Dispatcher *Server::setup(Dispatcher *dispatcher) +Dispatcher *Server::setup (Dispatcher *dispatcher) { - debug_log("registering stubs for server %p", _pvt->server); - - Dispatcher *prev = _pvt->dispatcher; - - dbus_server_set_watch_functions( - _pvt->server, - Dispatcher::Private::on_add_watch, - Dispatcher::Private::on_rem_watch, - Dispatcher::Private::on_toggle_watch, - dispatcher, - 0 - ); - - dbus_server_set_timeout_functions( - _pvt->server, - Dispatcher::Private::on_add_timeout, - Dispatcher::Private::on_rem_timeout, - Dispatcher::Private::on_toggle_timeout, - dispatcher, - 0 - ); - - _pvt->dispatcher = dispatcher; - - return prev; + debug_log ("registering stubs for server %p", _pvt->server); + + Dispatcher *prev = _pvt->dispatcher; + + dbus_server_set_watch_functions ( + _pvt->server, + Dispatcher::Private::on_add_watch, + Dispatcher::Private::on_rem_watch, + Dispatcher::Private::on_toggle_watch, + dispatcher, + 0 + ); + + dbus_server_set_timeout_functions ( + _pvt->server, + Dispatcher::Private::on_add_timeout, + Dispatcher::Private::on_rem_timeout, + Dispatcher::Private::on_toggle_timeout, + dispatcher, + 0 + ); + + _pvt->dispatcher = dispatcher; + + return prev; } bool Server::operator == (const Server &s) const { - return _pvt->server == s._pvt->server; + return _pvt->server == s._pvt->server; } bool Server::listening() const { - return dbus_server_get_is_connected(_pvt->server); + return dbus_server_get_is_connected (_pvt->server); } + void Server::disconnect() { - dbus_server_disconnect(_pvt->server); + dbus_server_disconnect (_pvt->server); } diff --git a/sflphone-common/libs/dbus-c++/src/server_p.h b/sflphone-common/libs/dbus-c++/src/server_p.h index 6264ebf4d5db282e6d43ad4877b1557e78ed1c4b..826132d2bd61f24f3543139ddb87e0f521666d68 100644 --- a/sflphone-common/libs/dbus-c++/src/server_p.h +++ b/sflphone-common/libs/dbus-c++/src/server_p.h @@ -26,7 +26,7 @@ #define __DBUSXX_SERVER_P_H #ifdef HAVE_CONFIG_H -#include "config.h" +#include <config.h> #endif #include <dbus-c++/server.h> diff --git a/sflphone-common/libs/dbus-c++/src/types.cpp b/sflphone-common/libs/dbus-c++/src/types.cpp index a144f789dbb7d29b323ad03299725a45eb45f5f9..d8100258e69f5251b46f9df4164ff7aaa248f038 100644 --- a/sflphone-common/libs/dbus-c++/src/types.cpp +++ b/sflphone-common/libs/dbus-c++/src/types.cpp @@ -21,6 +21,9 @@ * */ +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif #include <dbus-c++/types.h> #include <dbus-c++/object.h> @@ -34,70 +37,71 @@ using namespace DBus; Variant::Variant() -: _msg(CallMessage()) // dummy message used as temporary storage for variant data + : _msg (CallMessage()) // dummy message used as temporary storage for variant data { } -Variant::Variant(MessageIter &it) -: _msg(CallMessage()) +Variant::Variant (MessageIter &it) + : _msg (CallMessage()) { - MessageIter vi = it.recurse(); - MessageIter mi = _msg.writer(); - vi.copy_data(mi); + MessageIter vi = it.recurse(); + MessageIter mi = _msg.writer(); + vi.copy_data (mi); } Variant &Variant::operator = (const Variant &v) { - if (&v != this) - { - _msg = v._msg; - } - return *this; + if (&v != this) { + _msg = v._msg; + } + + return *this; } void Variant::clear() { - CallMessage empty; - _msg = empty; + CallMessage empty; + _msg = empty; } const Signature Variant::signature() const { - char *sigbuf = reader().signature(); + char *sigbuf = reader().signature(); - Signature signature = sigbuf; + Signature signature = sigbuf; - free(sigbuf); + free (sigbuf); - return signature; + return signature; } MessageIter &operator << (MessageIter &iter, const Variant &val) { - const Signature sig = val.signature(); + const Signature sig = val.signature(); - MessageIter rit = val.reader(); - MessageIter wit = iter.new_variant(sig.c_str()); + MessageIter rit = val.reader(); + MessageIter wit = iter.new_variant (sig.c_str()); - rit.copy_data(wit); + rit.copy_data (wit); - iter.close_container(wit); + iter.close_container (wit); - return iter; + return iter; } MessageIter &operator >> (MessageIter &iter, Variant &val) { - if (iter.type() != DBUS_TYPE_VARIANT) - throw ErrorInvalidArgs("variant type expected"); + if (iter.type() != DBUS_TYPE_VARIANT) + throw ErrorInvalidArgs ("variant type expected"); + + val.clear(); - val.clear(); + MessageIter vit = iter.recurse(); - MessageIter vit = iter.recurse(); - MessageIter mit = val.writer(); + MessageIter mit = val.writer(); - vit.copy_data(mit); + vit.copy_data (mit); - return ++iter; + return ++iter; } diff --git a/sflphone-common/libs/dbus-c++/tools/Makefile.am b/sflphone-common/libs/dbus-c++/tools/Makefile.am index f491376bbfde53804607bbb93cd1acaee0fa1216..a207aa1bd0c08381019bebf773ac6a21ea942a9b 100644 --- a/sflphone-common/libs/dbus-c++/tools/Makefile.am +++ b/sflphone-common/libs/dbus-c++/tools/Makefile.am @@ -1,6 +1,6 @@ # hacky, but ... -#CXX = $(CXX_FOR_BUILD) +# CXX = $(CXX_FOR_BUILD) AM_CPPFLAGS = \ $(dbus_CFLAGS) \ @@ -14,9 +14,11 @@ AM_CPPFLAGS = \ libdbus_cxx_la = $(top_builddir)/libs/dbus-c++/src/libdbus-c++-1.la #endif -bin_PROGRAMS = dbusxx-xml2cpp dbusxx-introspect +noinst_PROGRAMS = dbusxx-xml2cpp dbusxx-introspect -dbusxx_xml2cpp_SOURCES = xml.h xml.cpp xml2cpp.h xml2cpp.cpp +dbusxx_xml2cpp_SOURCES = xml.h xml.cpp xml2cpp.h xml2cpp.cpp \ + generate_adaptor.cpp generate_adaptor.h generate_proxy.cpp\ + generate_proxy.h generator_utils.cpp generator_utils.h dbusxx_xml2cpp_LDADD = $(libdbus_cxx_la) $(xml_LIBS) dbusxx_introspect_SOURCES = introspect.h introspect.cpp diff --git a/sflphone-common/libs/dbus-c++/tools/generate_adaptor.cpp b/sflphone-common/libs/dbus-c++/tools/generate_adaptor.cpp new file mode 100644 index 0000000000000000000000000000000000000000..c8f0cd6abb4d08c3951e6ff8da50c80a005c4e70 --- /dev/null +++ b/sflphone-common/libs/dbus-c++/tools/generate_adaptor.cpp @@ -0,0 +1,692 @@ +/* + * + * D-Bus++ - C++ bindings for D-Bus + * + * Copyright (C) 2005-2007 Paolo Durante <shackan@gmail.com> + * + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +#include <iostream> +#include <fstream> +#include <cstdlib> +#include <algorithm> + +#include "generator_utils.h" +#include "generate_adaptor.h" + +using namespace std; + +using namespace DBus; + +extern const char *tab; +extern const char *header; +extern const char *dbus_includes; + +/*! Generate adaptor code for a XML introspection + */ +void generate_adaptor (Xml::Document &doc, const char *filename) +{ + ostringstream body; + ostringstream head; + vector <string> include_vector; + + head << header; + string filestring = filename; + underscorize (filestring); + + string cond_comp = "__dbusxx__" + filestring + "__ADAPTOR_MARSHAL_H"; + + head << "#ifndef " << cond_comp << endl + << "#define " << cond_comp << endl; + + head << dbus_includes; + + Xml::Node &root = * (doc.root); + Xml::Nodes interfaces = root["interface"]; + + // iterate over all interface definitions + + for (Xml::Nodes::iterator i = interfaces.begin(); i != interfaces.end(); ++i) { + Xml::Node &iface = **i; + Xml::Nodes methods = iface["method"]; + Xml::Nodes signals = iface["signal"]; + Xml::Nodes properties = iface["property"]; + Xml::Nodes ms; + ms.insert (ms.end(), methods.begin(), methods.end()); + ms.insert (ms.end(), signals.begin(), signals.end()); + + // gets the name of a interface: <interface name="XYZ"> + string ifacename = iface.get ("name"); + + // these interface names are skipped. + + if (ifacename == "org.freedesktop.DBus.Introspectable" + ||ifacename == "org.freedesktop.DBus.Properties") { + cerr << "skipping interface " << ifacename << endl; + continue; + } + + istringstream ss (ifacename); + + string nspace; + unsigned int nspaces = 0; + + // prints all the namespaces defined with <interface name="X.Y.Z"> + + while (ss.str().find ('.', ss.tellg()) != string::npos) { + getline (ss, nspace, '.'); + + body << "namespace " << nspace << " {" << endl; + + ++nspaces; + } + + body << endl; + + string ifaceclass; + + getline (ss, ifaceclass); + + // a "_adaptor" is added to class name to distinguish between proxy and adaptor + ifaceclass += "_adaptor"; + + cerr << "generating code for interface " << ifacename << "..." << endl; + + // the code from class definiton up to opening of the constructor is generated... + body << "class " << ifaceclass << endl + << ": public ::DBus::InterfaceAdaptor" << endl + << "{" << endl + << "public:" << endl + << endl + << tab << ifaceclass << "()" << endl + << tab << ": ::DBus::InterfaceAdaptor(\"" << ifacename << "\")" << endl + << tab << "{" << endl; + + // generates code to bind the properties + + for (Xml::Nodes::iterator pi = properties.begin(); pi != properties.end(); ++pi) { + Xml::Node &property = **pi; + + body << tab << tab << "bind_property(" + << property.get ("name") << ", " + << "\"" << property.get ("type") << "\", " + << (property.get ("access").find ("read") != string::npos + ? "true" + : "false") + << ", " + << (property.get ("access").find ("write") != string::npos + ? "true" + : "false") + << ");" << endl; + } + + // generate code to register all methods + for (Xml::Nodes::iterator mi = methods.begin(); mi != methods.end(); ++mi) { + Xml::Node &method = **mi; + + body << tab << tab << "register_method(" + << ifaceclass << ", " << method.get ("name") << ", "<< stub_name (method.get ("name")) + << ");" << endl; + } + + body << tab << "}" << endl + + << endl; + + body << tab << "::DBus::IntrospectedInterface *const introspect() const " << endl + << tab << "{" << endl; + + // generate the introspect arguments + + for (Xml::Nodes::iterator mi = ms.begin(); mi != ms.end(); ++mi) { + Xml::Node &method = **mi; + Xml::Nodes args = method["arg"]; + + body << tab << tab << "static ::DBus::IntrospectedArgument " << method.get ("name") << "_args[] = " << endl + << tab << tab << "{" << endl; + + for (Xml::Nodes::iterator ai = args.begin(); ai != args.end(); ++ai) { + Xml::Node &arg = **ai; + + body << tab << tab << tab << "{ "; + + if (arg.get ("name").length()) { + body << "\"" << arg.get ("name") << "\", "; + } else { + body << "0, "; + } + + body << "\"" << arg.get ("type") << "\", " + + << (arg.get ("direction") == "in" ? "true" : "false") + << " }," << endl; + } + + body << tab << tab << tab << "{ 0, 0, 0 }" << endl + + << tab << tab << "};" << endl; + } + + body << tab << tab << "static ::DBus::IntrospectedMethod " << ifaceclass << "_methods[] = " << endl + + << tab << tab << "{" << endl; + + // generate the introspect methods + + for (Xml::Nodes::iterator mi = methods.begin(); mi != methods.end(); ++mi) { + Xml::Node &method = **mi; + + body << tab << tab << tab << "{ \"" << method.get ("name") << "\", " << method.get ("name") << "_args }," << endl; + } + + body << tab << tab << tab << "{ 0, 0 }" << endl + + << tab << tab << "};" << endl; + + body << tab << tab << "static ::DBus::IntrospectedMethod " << ifaceclass << "_signals[] = " << endl + << tab << tab << "{" << endl; + + for (Xml::Nodes::iterator si = signals.begin(); si != signals.end(); ++si) { + Xml::Node &method = **si; + + body << tab << tab << tab << "{ \"" << method.get ("name") << "\", " << method.get ("name") << "_args }," << endl; + } + + body << tab << tab << tab << "{ 0, 0 }" << endl + + << tab << tab << "};" << endl; + + body << tab << tab << "static ::DBus::IntrospectedProperty " << ifaceclass << "_properties[] = " << endl + << tab << tab << "{" << endl; + + for (Xml::Nodes::iterator pi = properties.begin(); pi != properties.end(); ++pi) { + Xml::Node &property = **pi; + + body << tab << tab << tab << "{ " + << "\"" << property.get ("name") << "\", " + << "\"" << property.get ("type") << "\", " + << (property.get ("access").find ("read") != string::npos + ? "true" + : "false") + << ", " + << (property.get ("access").find ("write") != string::npos + ? "true" + : "false") + << " }," << endl; + } + + + body << tab << tab << tab << "{ 0, 0, 0, 0 }" << endl + + << tab << tab << "};" << endl; + + // generate the Introspected interface + body << tab << tab << "static ::DBus::IntrospectedInterface " << ifaceclass << "_interface = " << endl + << tab << tab << "{" << endl + << tab << tab << tab << "\"" << ifacename << "\"," << endl + << tab << tab << tab << ifaceclass << "_methods," << endl + << tab << tab << tab << ifaceclass << "_signals," << endl + << tab << tab << tab << ifaceclass << "_properties" << endl + << tab << tab << "};" << endl + << tab << tab << "return &" << ifaceclass << "_interface;" << endl + << tab << "}" << endl + << endl; + + body << "public:" << endl + << endl + << tab << "/* properties exposed by this interface, use" << endl + << tab << " * property() and property(value) to get and set a particular property" << endl + << tab << " */" << endl; + + // generate the properties code + + for (Xml::Nodes::iterator pi = properties.begin(); pi != properties.end(); ++pi) { + Xml::Node &property = **pi; + string name = property.get ("name"); + string type = property.get ("type"); + string type_name = signature_to_type (type); + + body << tab << "::DBus::PropertyAdaptor< " << type_name << " > " << name << ";" << endl; + } + + body << endl; + + body << "public:" << endl + << endl + << tab << "/* methods exported by this interface," << endl + << tab << " * you will have to implement them in your ObjectAdaptor" << endl + << tab << " */" << endl; + + // generate the methods code + + for (Xml::Nodes::iterator mi = methods.begin(); mi != methods.end(); ++mi) { + Xml::Node &method = **mi; + Xml::Nodes args = method["arg"]; + Xml::Nodes args_in = args.select ("direction","in"); + Xml::Nodes args_out = args.select ("direction","out"); + Xml::Nodes annotations = args["annotation"]; + Xml::Nodes annotations_object = annotations.select ("name","org.freedesktop.DBus.Object"); + string arg_object; + + if (annotations_object.size() > 0) { + arg_object = annotations_object.front()->get ("value"); + } + + body << tab << "virtual "; + + // return type is 'void' if none or multible return values + + if (args_out.size() == 0 || args_out.size() > 1) { + body << "void "; + } else if (args_out.size() == 1) { + // generate basic or object return type + if (arg_object.length()) { + body << arg_object << " "; + } else { + body << signature_to_type (args_out.front()->get ("type")) << " "; + } + } + + // generate the method name + body << method.get ("name") << "("; + + // generate the methods 'in' variables + unsigned int i = 0; + + for (Xml::Nodes::iterator ai = args_in.begin(); ai != args_in.end(); ++ai, ++i) { + Xml::Node &arg = **ai; + Xml::Nodes annotations = arg["annotation"]; + Xml::Nodes annotations_object = annotations.select ("name","org.freedesktop.DBus.Object"); + string arg_name = arg.get ("name"); + string arg_object; + + if (annotations_object.size() > 0) { + arg_object = annotations_object.front()->get ("value"); + } + + // generate basic signature only if no object name available... + if (!arg_object.length()) { + body << "const " << signature_to_type (arg.get ("type")) << "& "; + } + + // ...or generate object style if available + else { + body << "const " << arg_object << "& "; + + // store a object name to later generate header includes + include_vector.push_back (arg_object); + } + + if (arg_name.length()) + body << arg_name; + + if ( (i+1 != args_in.size() || args_out.size() > 1)) + body << ", "; + } + + // generate the method 'out' variables if multibe 'out' values exist + if (args_out.size() > 1) { + unsigned int i = 0; + + for (Xml::Nodes::iterator ao = args_out.begin(); ao != args_out.end(); ++ao, ++i) { + Xml::Node &arg = **ao; + Xml::Nodes annotations = arg["annotation"]; + Xml::Nodes annotations_object = annotations.select ("name","org.freedesktop.DBus.Object"); + string arg_name = arg.get ("name"); + string arg_object; + + if (annotations_object.size() > 0) { + arg_object = annotations_object.front()->get ("value"); + } + + // generate basic signature only if no object name available... + if (!arg_object.length()) { + body << "const " << signature_to_type (arg.get ("type")) << "& "; + } + + // ...or generate object style if available + else { + body << "const " << arg_object << "& "; + + // store a object name to later generate header includes + include_vector.push_back (arg_object); + } + + if (arg_name.length()) + body << " " << arg_name; + + if (i+1 != args_out.size()) + body << ", "; + } + } + + body << ") = 0;" << endl; + } + + body << endl + + << "public:" << endl + << endl + << tab << "/* signal emitters for this interface" << endl + << tab << " */" << endl; + + // generate the signals code + + for (Xml::Nodes::iterator si = signals.begin(); si != signals.end(); ++si) { + Xml::Node &signal = **si; + Xml::Nodes args = signal["arg"]; + + body << tab << "void " << signal.get ("name") << "("; + + // generate the signal arguments + unsigned int i = 0; + + for (Xml::Nodes::iterator a = args.begin(); a != args.end(); ++a, ++i) { + Xml::Node &arg = **a; + Xml::Nodes annotations = arg["annotation"]; + Xml::Nodes annotations_object = annotations.select ("name","org.freedesktop.DBus.Object"); + string arg_object; + + if (annotations_object.size() > 0) { + arg_object = annotations_object.front()->get ("value"); + } + + // generate basic signature only if no object name available... + if (!arg_object.length()) { + body << "const " << signature_to_type (arg.get ("type")) << "& arg" << i+1; + } + + // ...or generate object style if available + else { + body << "const " << arg_object << "& arg" << i+1; + + // store a object name to later generate header includes + include_vector.push_back (arg_object); + } + + if (i+1 != args.size()) + body << ", "; + } + + body << ")" << endl + + << tab << "{" << endl + << tab << tab << "::DBus::SignalMessage sig(\"" << signal.get ("name") <<"\");" << endl; + + // generate the signal body + + if (args.size() > 0) { + body << tab << tab << "::DBus::MessageIter wi = sig.writer();" << endl; + + unsigned int i = 0; + + for (Xml::Nodes::iterator a = args.begin(); a != args.end(); ++a, ++i) { + Xml::Node &arg = **a; + Xml::Nodes annotations = arg["annotation"]; + Xml::Nodes annotations_object = annotations.select ("name","org.freedesktop.DBus.Object"); + string arg_object; + + if (annotations_object.size() > 0) { + arg_object = annotations_object.front()->get ("value"); + } + + if (arg_object.length()) { + body << tab << tab << signature_to_type (arg.get ("type")) << " _arg" << i+1 << ";" << endl; + body << tab << tab << "_arg" << i+1 << " << " << "arg" << i+1 << ";" << endl; + + body << tab << tab << "wi << _arg" << i+1 << ";" << endl; + } else { + body << tab << tab << "wi << arg" << i+1 << ";" << endl; + } + } + } + + // emit the signal in method body + body << tab << tab << "emit_signal(sig);" << endl + << tab << "}" << endl; + } + + body << endl + + << "private:" << endl + << endl + << tab << "/* unmarshalers (to unpack the DBus message before calling the actual interface method)" << endl + << tab << " */" << endl; + + // generate the unmarshalers + + for (Xml::Nodes::iterator mi = methods.begin(); mi != methods.end(); ++mi) { + Xml::Node &method = **mi; + Xml::Nodes args = method["arg"]; + Xml::Nodes args_in = args.select ("direction","in"); + Xml::Nodes args_out = args.select ("direction","out"); + + body << tab << "::DBus::Message " << stub_name (method.get ("name")) << "(const ::DBus::CallMessage &call)" << endl + << tab << "{" << endl + << tab << tab << "::DBus::MessageIter ri = call.reader();" << endl + << endl; + + // generate the 'in' variables + unsigned int i = 1; + + for (Xml::Nodes::iterator ai = args_in.begin(); ai != args_in.end(); ++ai, ++i) { + Xml::Node &arg = **ai; + + body << tab << tab << signature_to_type (arg.get ("type")) << " argin" << i << ";" << " "; + body << "ri >> argin" << i << ";" << endl; + } + + // generate the 'in' object variables + i = 1; + + for (Xml::Nodes::iterator ai = args_in.begin(); ai != args_in.end(); ++ai, ++i) { + Xml::Node &arg = **ai; + Xml::Nodes annotations = arg["annotation"]; + Xml::Nodes annotations_object = annotations.select ("name","org.freedesktop.DBus.Object"); + string arg_object; + + if (annotations_object.size() > 0) { + arg_object = annotations_object.front()->get ("value"); + } + + if (arg_object.length()) { + body << tab << tab << arg_object << " _argin" << i << ";"; + body << " " << "_argin" << i << " << " << "argin" << i << ";" << endl; + } + } + + // generate 'out' variables + if (args_out.size() > 0) { + unsigned int i = 1; + + for (Xml::Nodes::iterator ao = args_out.begin(); ao != args_out.end(); ++ao, ++i) { + Xml::Node &arg = **ao; + + body << tab << tab << signature_to_type (arg.get ("type")) << " argout" << i; + + if (args_out.size() == 1) { // a single 'out' parameter will be assigned + body << " = "; + } else { // multible 'out' parameters will be handled as parameters below + body << ";" << endl; + } + } + } + + // generate 'out' object variables + if (args_out.size() > 0) { + unsigned int i = 1; + + for (Xml::Nodes::iterator ao = args_out.begin(); ao != args_out.end(); ++ao, ++i) { + Xml::Node &arg = **ao; + Xml::Nodes annotations = arg["annotation"]; + Xml::Nodes annotations_object = annotations.select ("name","org.freedesktop.DBus.Object"); + string arg_object; + + if (annotations_object.size() > 0) { + arg_object = annotations_object.front()->get ("value"); + } + + // generate object types + if (arg_object.length()) { + body << tab << tab << arg_object << " _argout" << i << ";" << endl; + } + } + } + + // generate in '<<' operation + i = 0; + + for (Xml::Nodes::iterator ai = args_in.begin(); ai != args_in.end(); ++ai, ++i) { + Xml::Node &arg = **ai; + Xml::Nodes annotations = arg["annotation"]; + Xml::Nodes annotations_object = annotations.select ("name","org.freedesktop.DBus.Object"); + string arg_object; + + if (annotations_object.size() > 0) { + arg_object = annotations_object.front()->get ("value"); + } + } + + // do correct indent + if (args_out.size() != 1) { + body << tab << tab; + } + + body << method.get ("name") << "("; + + // generate call stub parameters + i = 0; + + for (Xml::Nodes::iterator ai = args_in.begin(); ai != args_in.end(); ++ai, ++i) { + Xml::Node &arg = **ai; + Xml::Nodes annotations = arg["annotation"]; + Xml::Nodes annotations_object = annotations.select ("name","org.freedesktop.DBus.Object"); + string arg_object; + + if (annotations_object.size() > 0) { + arg_object = annotations_object.front()->get ("value"); + } + + if (arg_object.length()) { + body << "_argin" << i+1; + } else { + body << "argin" << i+1; + } + + if ( (i+1 != args_in.size() || args_out.size() > 1)) + body << ", "; + } + + if (args_out.size() > 1) { + i = 0; + + for (Xml::Nodes::iterator ao = args_out.begin(); ao != args_out.end(); ++ao, ++i) { + Xml::Node &arg = **ao; + Xml::Nodes annotations = arg["annotation"]; + Xml::Nodes annotations_object = annotations.select ("name","org.freedesktop.DBus.Object"); + string arg_object; + + if (annotations_object.size() > 0) { + arg_object = annotations_object.front()->get ("value"); + } + + if (arg_object.length()) { + body << "_argout" << i+1; + } else { + body << "argout" << i+1; + } + + if (i+1 != args_out.size()) + body << ", "; + } + } + + body << ");" << endl; + + body << tab << tab << "::DBus::ReturnMessage reply(call);" << endl; + + if (args_out.size() > 0) { + body << tab << tab << "::DBus::MessageIter wi = reply.writer();" << endl; + + // generate out '<<' operation + i = 0; + + for (Xml::Nodes::iterator ao = args_out.begin(); ao != args_out.end(); ++ao, ++i) { + Xml::Node &arg = **ao; + Xml::Nodes annotations = arg["annotation"]; + Xml::Nodes annotations_object = annotations.select ("name","org.freedesktop.DBus.Object"); + string arg_object; + + if (annotations_object.size() > 0) { + arg_object = annotations_object.front()->get ("value"); + } + + if (arg_object.length()) { + body << tab << tab << "argout" << i+1 << " << " << "_argout" << i+1 << ";" << endl; + } + } + + for (unsigned int i = 0; i < args_out.size(); ++i) { + body << tab << tab << "wi << argout" << i+1 << ";" << endl; + } + } + + body << tab << tab << "return reply;" << endl; + + body << tab << "}" << endl; + } + + body << "};" << endl + + << endl; + + for (unsigned int i = 0; i < nspaces; ++i) { + body << "} "; + } + + body << endl; + } + + body << "#endif //" << cond_comp << endl; + + // remove all duplicates in the header include vector + vector<string>::const_iterator vec_end_it = unique (include_vector.begin (), include_vector.end ()); + + for (vector<string>::const_iterator vec_it = include_vector.begin (); + vec_it != vec_end_it; + ++vec_it) { + const string &include = *vec_it; + + head << "#include " << "\"" << include << ".h" << "\"" << endl; + } + + head << endl; + + ofstream file (filename); + + if (file.bad()) { + cerr << "unable to write file " << filename << endl; + exit (-1); + } + + file << head.str (); + + file << body.str (); + + file.close(); +} diff --git a/sflphone-common/libs/dbus-c++/tools/generate_adaptor.h b/sflphone-common/libs/dbus-c++/tools/generate_adaptor.h new file mode 100644 index 0000000000000000000000000000000000000000..fd888f020651b9542bb5d1e3ffe044ab4a9f0cfa --- /dev/null +++ b/sflphone-common/libs/dbus-c++/tools/generate_adaptor.h @@ -0,0 +1,32 @@ +/* + * + * D-Bus++ - C++ bindings for D-Bus + * + * Copyright (C) 2005-2007 Paolo Durante <shackan@gmail.com> + * + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +#ifndef __DBUSXX_TOOLS_GENERATE_ADAPTOR_H +#define __DBUSXX_TOOLS_GENERATE_ADAPTOR_H + +#include <string> +#include "xml.h" + +void generate_adaptor(DBus::Xml::Document &doc, const char *filename); + +#endif//__DBUSXX_TOOLS_GENERATE_ADAPTOR_H diff --git a/sflphone-common/libs/dbus-c++/tools/generate_proxy.cpp b/sflphone-common/libs/dbus-c++/tools/generate_proxy.cpp new file mode 100644 index 0000000000000000000000000000000000000000..288dfa4845ec403439fced710c63a3a56747dbca --- /dev/null +++ b/sflphone-common/libs/dbus-c++/tools/generate_proxy.cpp @@ -0,0 +1,624 @@ +/* + * + * D-Bus++ - C++ bindings for D-Bus + * + * Copyright (C) 2005-2007 Paolo Durante <shackan@gmail.com> + * + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +#include <iostream> +#include <fstream> +#include <cstdlib> +#include <algorithm> + +#include "generator_utils.h" +#include "generate_proxy.h" + +using namespace std; + +using namespace DBus; + +extern const char *tab; +extern const char *header; +extern const char *dbus_includes; + +/*! Generate proxy code for a XML introspection + */ +void generate_proxy (Xml::Document &doc, const char *filename) +{ + ostringstream body; + ostringstream head; + vector <string> include_vector; + + head << header; + string filestring = filename; + underscorize (filestring); + + string cond_comp = "__dbusxx__" + filestring + "__PROXY_MARSHAL_H"; + + head << "#ifndef " << cond_comp << endl + << "#define " << cond_comp << endl; + + head << dbus_includes; + + Xml::Node &root = * (doc.root); + Xml::Nodes interfaces = root["interface"]; + + // iterate over all interface definitions + + for (Xml::Nodes::iterator i = interfaces.begin(); i != interfaces.end(); ++i) { + Xml::Node &iface = **i; + Xml::Nodes methods = iface["method"]; + Xml::Nodes signals = iface["signal"]; + Xml::Nodes properties = iface["property"]; + Xml::Nodes ms; + ms.insert (ms.end(), methods.begin(), methods.end()); + ms.insert (ms.end(), signals.begin(), signals.end()); + + // gets the name of a interface: <interface name="XYZ"> + string ifacename = iface.get ("name"); + + // these interface names are skipped. + + if (ifacename == "org.freedesktop.DBus.Introspectable" + ||ifacename == "org.freedesktop.DBus.Properties") { + cerr << "skipping interface " << ifacename << endl; + continue; + } + + istringstream ss (ifacename); + + string nspace; + unsigned int nspaces = 0; + + // prints all the namespaces defined with <interface name="X.Y.Z"> + + while (ss.str().find ('.', ss.tellg()) != string::npos) { + getline (ss, nspace, '.'); + + body << "namespace " << nspace << " {" << endl; + + ++nspaces; + } + + body << endl; + + string ifaceclass; + + getline (ss, ifaceclass); + + // a "_proxy" is added to class name to distinguish between proxy and adaptor + ifaceclass += "_proxy"; + + cerr << "generating code for interface " << ifacename << "..." << endl; + + // the code from class definiton up to opening of the constructor is generated... + body << "class " << ifaceclass << endl + << ": public ::DBus::InterfaceProxy" << endl + << "{" << endl + << "public:" << endl + << endl + << tab << ifaceclass << "()" << endl + << tab << ": ::DBus::InterfaceProxy(\"" << ifacename << "\")" << endl + << tab << "{" << endl; + + // generates code to connect all the signal stubs; this is still inside the constructor + + for (Xml::Nodes::iterator si = signals.begin(); si != signals.end(); ++si) { + Xml::Node &signal = **si; + + string marshname = "_" + signal.get ("name") + "_stub"; + + body << tab << tab << "connect_signal(" + << ifaceclass << ", " << signal.get ("name") << ", " << stub_name (signal.get ("name")) + << ");" << endl; + } + + // the constructor ends here + body << tab << "}" << endl + << endl; + + // write public block header for properties + body << "public:" << endl << endl + << tab << "/* properties exported by this interface */" << endl; + + // this loop generates all properties + for (Xml::Nodes::iterator pi = properties.begin (); + pi != properties.end (); ++pi) { + Xml::Node & property = **pi; + string prop_name = property.get ("name"); + string property_access = property.get ("access"); + + if (property_access == "read" || property_access == "readwrite") { + body << tab << tab << "const " << signature_to_type (property.get ("type")) + << " " << prop_name << "() {" << endl; + body << tab << tab << tab << "::DBus::CallMessage call ;\n "; + body << tab << tab << tab + << "call.member(\"Get\"); call.interface(\"org.freedesktop.DBus.Properties\");" + << endl; + body << tab << tab << tab + << "::DBus::MessageIter wi = call.writer(); " << endl; + body << tab << tab << tab + << "const std::string interface_name = \"" << ifacename << "\";" + << endl; + body << tab << tab << tab + << "const std::string property_name = \"" << prop_name << "\";" + << endl; + body << tab << tab << tab << "wi << interface_name;" << endl; + body << tab << tab << tab << "wi << property_name;" << endl; + body << tab << tab << tab + << "::DBus::Message ret = this->invoke_method (call);" << endl; + // TODO: support invoke_method_NoReply for properties + body << tab << tab << tab + << "::DBus::MessageIter ri = ret.reader ();" << endl; + body << tab << tab << tab << "::DBus::Variant argout; " << endl; + body << tab << tab << tab << "ri >> argout;" << endl; + body << tab << tab << tab << "return argout;" << endl; + body << tab << tab << "};" << endl; + } + + if (property_access == "write" || property_access == "readwrite") { + body << tab << tab << "void " << prop_name << "( const "<< signature_to_type (property.get ("type")) << " & input" << ") {" << endl; + body << tab << tab << tab << "::DBus::CallMessage call ;\n "; + body << tab << tab << tab <<"call.member(\"Set\"); call.interface( \"org.freedesktop.DBus.Properties\");"<< endl; + body << tab << tab << tab <<"::DBus::MessageIter wi = call.writer(); " << endl; + body << tab << tab << tab <<"::DBus::Variant value;" << endl; + body << tab << tab << tab <<"::DBus::MessageIter vi = value.writer ();" << endl; + body << tab << tab << tab <<"vi << input;" << endl; + body << tab << tab << tab <<"const std::string interface_name = \"" << ifacename << "\";" << endl; + body << tab << tab << tab <<"const std::string property_name = \"" << prop_name << "\";"<< endl; + body << tab << tab << tab <<"wi << interface_name;" << endl; + body << tab << tab << tab <<"wi << property_name;" << endl; + body << tab << tab << tab <<"wi << value;" << endl; + body << tab << tab << tab <<"::DBus::Message ret = this->invoke_method (call);" << endl; + // TODO: support invoke_method_noreply for properties + body << tab << tab << "};" << endl; + } + } + + // write public block header for methods + body << "public:" << endl + << endl + << tab << "/* methods exported by this interface," << endl + << tab << " * this functions will invoke the corresponding methods on the remote objects" << endl + << tab << " */" << endl; + + // this loop generates all methods + for (Xml::Nodes::iterator mi = methods.begin(); mi != methods.end(); ++mi) { + Xml::Node &method = **mi; + Xml::Nodes args = method["arg"]; + Xml::Nodes args_in = args.select ("direction","in"); + Xml::Nodes args_out = args.select ("direction","out"); + Xml::Nodes annotations = args["annotation"]; + Xml::Nodes method_annotations = method["annotation"]; + Xml::Nodes annotations_noreply = method_annotations.select ("name","org.freedesktop.DBus.Method.NoReply"); + Xml::Nodes annotations_object = annotations.select ("name","org.freedesktop.DBus.Object"); + string arg_object; + bool annotation_noreply_value = false; + + // parse method level noreply annotations + + if (annotations_noreply.size() > 0) { + string annotation_noreply_value_str = annotations_noreply.front()->get ("value"); + + if (annotation_noreply_value_str == "true") { + annotation_noreply_value = true; + } + } + + if (annotations_object.size() > 0) { + arg_object = annotations_object.front()->get ("value"); + } + + if (args_out.size() == 0 || args_out.size() > 1) { + body << tab << "void "; + } else if (args_out.size() == 1) { + if (arg_object.length()) { + body << tab << arg_object << " "; + } else { + body << tab << signature_to_type (args_out.front()->get ("type")) << " "; + } + } + + body << method.get ("name") << "("; + + // generate all 'in' arguments for a method signature + unsigned int i = 0; + + for (Xml::Nodes::iterator ai = args_in.begin(); ai != args_in.end(); ++ai, ++i) { + Xml::Node &arg = **ai; + Xml::Nodes annotations = arg["annotation"]; + Xml::Nodes annotations_object = annotations.select ("name","org.freedesktop.DBus.Object"); + string arg_object; + + if (annotations_object.size() > 0) { + arg_object = annotations_object.front()->get ("value"); + } + + // generate basic signature only if no object name available... + if (!arg_object.length()) { + body << "const " << signature_to_type (arg.get ("type")) << "& "; + } + + // ...or generate object style if available + else { + body << "const " << arg_object << "& "; + + // store a object name to later generate header includes + include_vector.push_back (arg_object); + } + + string arg_name = arg.get ("name"); + + if (arg_name.length()) + body << arg_name; + else + body << "argin" << i; + + if ( (i+1 != args_in.size() || args_out.size() > 1)) + body << ", "; + } + + if (args_out.size() > 1) { + // generate all 'out' arguments for a method signature + unsigned int j = 0; + + for (Xml::Nodes::iterator ao = args_out.begin(); ao != args_out.end(); ++ao, ++j) { + Xml::Node &arg = **ao; + Xml::Nodes annotations = arg["annotation"]; + Xml::Nodes annotations_object = annotations.select ("name","org.freedesktop.DBus.Object"); + string arg_object; + + if (annotations_object.size() > 0) { + arg_object = annotations_object.front()->get ("value"); + } + + // generate basic signature only if no object name available... + if (!arg_object.length()) { + body << signature_to_type (arg.get ("type")) << "&"; + } + + // ...or generate object style if available + else { + body << arg_object << "& "; + + // store a object name to later generate header includes + include_vector.push_back (arg_object); + } + + string arg_name = arg.get ("name"); + + if (arg_name.length()) + body << " " << arg_name; + else + body << " argout" << j; + + if (j+1 != args_out.size()) + body << ", "; + } + } + + body << ")" << endl; + + body << tab << "{" << endl + << tab << tab << "::DBus::CallMessage call;" << endl; + + if (args_in.size() > 0) { + body << tab << tab << "::DBus::MessageIter wi = call.writer();" << endl + << endl; + } + + // generate all 'in' arguments for a method body + i = 0; + + for (Xml::Nodes::iterator ai = args_in.begin(); ai != args_in.end(); ++ai, ++i) { + Xml::Node &arg = **ai; + string arg_name = arg.get ("name"); + Xml::Nodes annotations = arg["annotation"]; + Xml::Nodes annotations_object = annotations.select ("name","org.freedesktop.DBus.Object"); + string arg_object; + + if (annotations_object.size() > 0) { + arg_object = annotations_object.front()->get ("value"); + } + + if (!arg_name.length()) { + arg_name = "argin"; + arg_name += toString <uint> (i); + } + + // generate extra code to wrap object + if (arg_object.length()) { + body << tab << tab << signature_to_type (arg.get ("type")) << "_" << arg_name << ";" << endl; + body << tab << tab << "_" << arg_name << " << " << arg_name << ";" << endl; + + arg_name = string ("_") + arg_name; + } + + body << tab << tab << "wi << " << arg_name << ";" << endl; + } + + body << tab << tab << "call.member(\"" << method.get ("name") << "\");" << endl; + + // generate noreply/reply method calls + + if (annotation_noreply_value) { + if (args_out.size ()) { + cerr << "Function: " << method.get ("name") << ":" << endl; + cerr << "Option 'org.freedesktop.DBus.Method.NoReply' not allowed for methods with 'out' variables!" << endl << "-> Option ignored!" << endl; + + body << tab << tab << "::DBus::Message ret = invoke_method (call);" << endl; + } else { + body << tab << tab << "assert (invoke_method_noreply (call));" << endl; // will only assert in case of no memory + } + } else { + body << tab << tab << "::DBus::Message ret = invoke_method (call);" << endl; + } + + if (args_out.size() > 0) { + body << tab << tab << "::DBus::MessageIter ri = ret.reader();" << endl + << endl; + } + + // generate 'out' values as return if only one existing + if (args_out.size() == 1) { + Xml::Nodes annotations = args_out["annotation"]; + Xml::Nodes annotations_object = annotations.select ("name","org.freedesktop.DBus.Object"); + string arg_object; + + if (annotations_object.size() > 0) { + arg_object = annotations_object.front()->get ("value"); + } + + if (arg_object.length()) { + body << tab << tab << arg_object << " _argout;" << endl; + } + + body << tab << tab << signature_to_type (args_out.front()->get ("type")) << " argout;" << endl; + + body << tab << tab << "ri >> argout;" << endl; + + if (arg_object.length()) { + body << tab << tab << "_argout << argout;" << endl; + body << tab << tab << "return _argout;" << endl; + } else { + body << tab << tab << "return argout;" << endl; + } + } else if (args_out.size() > 1) { + // generate multible 'out' value + unsigned int i = 0; + + for (Xml::Nodes::iterator ao = args_out.begin(); ao != args_out.end(); ++ao, ++i) { + Xml::Node &arg = **ao; + string arg_name = arg.get ("name"); + Xml::Nodes annotations = arg["annotation"]; + Xml::Nodes annotations_object = annotations.select ("name","org.freedesktop.DBus.Object"); + string arg_object; + + if (annotations_object.size() > 0) { + arg_object = annotations_object.front()->get ("value"); + } + + if (!arg_name.length()) { + arg_name = "argout" + toString <uint> (i); + } + + if (arg_object.length()) { + body << tab << tab << signature_to_type (arg.get ("type")) << "_" << arg_name << ";" << endl; + } + + if (arg_object.length()) { + body << tab << tab << "ri >> " << "_" << arg_name << ";" << endl; + } else { + body << tab << tab << "ri >> " << arg_name << ";" << endl; + } + + if (arg_object.length()) { + body << tab << tab << arg_name << " << " << "_" << arg_name << ";" << endl; + } + } + } + + body << tab << "}" << endl + + << endl; + } + + // write public block header for signals + body << endl + << "public:" << endl + << endl + << tab << "/* signal handlers for this interface" << endl + << tab << " */" << endl; + + // this loop generates all signals + for (Xml::Nodes::iterator si = signals.begin(); si != signals.end(); ++si) { + Xml::Node &signal = **si; + Xml::Nodes args = signal["arg"]; + + body << tab << "virtual void " << signal.get ("name") << "("; + + // this loop generates all argument for a signal + unsigned int i = 0; + + for (Xml::Nodes::iterator ai = args.begin(); ai != args.end(); ++ai, ++i) { + Xml::Node &arg = **ai; + string arg_name = arg.get ("name"); + Xml::Nodes annotations = arg["annotation"]; + Xml::Nodes annotations_object = annotations.select ("name","org.freedesktop.DBus.Object"); + string arg_object; + + if (annotations_object.size() > 0) { + arg_object = annotations_object.front()->get ("value"); + } + + // generate basic signature only if no object name available... + if (!arg_object.length()) { + body << "const " << signature_to_type (arg.get ("type")) << "& "; + } + + // ...or generate object style if available + else { + body << "const " << arg_object << "& "; + + // store a object name to later generate header includes + include_vector.push_back (arg_object); + } + + if (arg_name.length()) + body << arg_name; + else + body << "argin" << i; + + if ( (ai+1 != args.end())) + body << ", "; + } + + body << ") = 0;" << endl; + } + + // write private block header for unmarshalers + body << endl + << "private:" << endl + << endl + << tab << "/* unmarshalers (to unpack the DBus message before calling the actual signal handler)" << endl + << tab << " */" << endl; + + // generate all the unmarshalers + for (Xml::Nodes::iterator si = signals.begin(); si != signals.end(); ++si) { + Xml::Node &signal = **si; + Xml::Nodes args = signal["arg"]; + + body << tab << "void " << stub_name (signal.get ("name")) << "(const ::DBus::SignalMessage &sig)" << endl + << tab << "{" << endl; + + if (args.size() > 0) { + body << tab << tab << "::DBus::MessageIter ri = sig.reader();" << endl + << endl; + } + + unsigned int i = 0; + + for (Xml::Nodes::iterator ai = args.begin(); ai != args.end(); ++ai, ++i) { + Xml::Node &arg = **ai; + string arg_name = arg.get ("name"); + Xml::Nodes annotations = arg["annotation"]; + Xml::Nodes annotations_object = annotations.select ("name","org.freedesktop.DBus.Object"); + string arg_object; + + if (annotations_object.size() > 0) { + arg_object = annotations_object.front()->get ("value"); + } + + body << tab << tab << signature_to_type (arg.get ("type")) << " " ; + + // use a default if no arg name given + + if (!arg_name.length()) { + arg_name = "arg" + toString <uint> (i); + } + + body << arg_name << ";" << endl; + + body << tab << tab << "ri >> " << arg_name << ";" << endl; + + // if a object type is used create a local variable and insert values with '<<' operation + + if (arg_object.length()) { + body << tab << tab << arg_object << " _" << arg_name << ";" << endl; + body << tab << tab << "_" << arg_name << " << " << arg_name << ";" << endl; + + // store a object name to later generate header includes + include_vector.push_back (arg_object); + } + } + + body << tab << tab << signal.get ("name") << "("; + + // generate all arguments for the call to the virtual function + unsigned int j = 0; + + for (Xml::Nodes::iterator ai = args.begin(); ai != args.end(); ++ai, ++j) { + Xml::Node &arg = **ai; + string arg_name = arg.get ("name"); + Xml::Nodes annotations = arg["annotation"]; + Xml::Nodes annotations_object = annotations.select ("name","org.freedesktop.DBus.Object"); + string arg_object; + + if (annotations_object.size() > 0) { + arg_object = annotations_object.front()->get ("value"); + } + + if (!arg_name.length()) { + arg_name = "arg" + toString <uint> (j); + } + + if (arg_object.length()) { + body << "_" << arg_name; + } else { + body << arg_name; + } + + if (ai+1 != args.end()) + body << ", "; + } + + body << ");" << endl; + + body << tab << "}" << endl; + } + + body << "};" << endl + + << endl; + + for (unsigned int i = 0; i < nspaces; ++i) { + body << "} "; + } + + body << endl; + } + + body << "#endif //" << cond_comp << endl; + + // remove all duplicates in the header include vector + vector<string>::const_iterator vec_end_it = unique (include_vector.begin (), include_vector.end ()); + + for (vector<string>::const_iterator vec_it = include_vector.begin (); + vec_it != vec_end_it; + ++vec_it) { + const string &include = *vec_it; + + head << "#include " << "\"" << include << ".h" << "\"" << endl; + } + + head << endl; + + ofstream file (filename); + + if (file.bad()) { + cerr << "unable to write file " << filename << endl; + exit (-1); + } + + file << head.str (); + + file << body.str (); + + file.close(); +} diff --git a/sflphone-common/libs/dbus-c++/tools/generate_proxy.h b/sflphone-common/libs/dbus-c++/tools/generate_proxy.h new file mode 100644 index 0000000000000000000000000000000000000000..0224f4df17278b520b268af56c4f87fe827ee652 --- /dev/null +++ b/sflphone-common/libs/dbus-c++/tools/generate_proxy.h @@ -0,0 +1,31 @@ +/* + * + * D-Bus++ - C++ bindings for D-Bus + * + * Copyright (C) 2005-2007 Paolo Durante <shackan@gmail.com> + * + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +#ifndef __DBUSXX_TOOLS_GENERATE_PROXY_H +#define __DBUSXX_TOOLS_GENERATE_PROXY_H + +#include "xml.h" + +void generate_proxy(DBus::Xml::Document &doc, const char *filename); + +#endif//__DBUSXX_TOOLS_GENERATE_PROXY_H diff --git a/sflphone-common/libs/dbus-c++/tools/generator_utils.cpp b/sflphone-common/libs/dbus-c++/tools/generator_utils.cpp new file mode 100644 index 0000000000000000000000000000000000000000..9b5a364966a7631eeea48a7c2b421bd7737082e9 --- /dev/null +++ b/sflphone-common/libs/dbus-c++/tools/generator_utils.cpp @@ -0,0 +1,173 @@ +/* + * + * D-Bus++ - C++ bindings for D-Bus + * + * Copyright (C) 2005-2007 Paolo Durante <shackan@gmail.com> + * + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +#include <iostream> +#include <cstdlib> + +#include "generator_utils.h" + +using namespace std; + +const char *tab = " "; + +const char *header = "\n\ +/*\n\ + * This file was automatically generated by dbusxx-xml2cpp; DO NOT EDIT!\n\ + */\n\ +\n\ +"; + +const char *dbus_includes = "\n\ +#include <dbus-c++/dbus.h>\n\ +#include <cassert>\n\ +"; + + void underscorize (string &str) + { + for (unsigned int i = 0; i < str.length(); ++i) { + if (!isalpha (str[i]) && !isdigit (str[i])) str[i] = '_'; + } + } + + string stub_name (string name) + { + underscorize (name); + + return "_" + name + "_stub"; + } + + const char *atomic_type_to_string (char t) + { + + static struct { + char type; + const char *name; + } atos[] = { + + { 'y', "uint8_t" }, + { 'b', "bool" }, + { 'n', "int16_t" }, + { 'q', "uint16_t" }, + { 'i', "int32_t" }, + { 'u', "uint32_t" }, + { 'x', "int64_t" }, + { 't', "uint64_t" }, + { 'd', "double" }, + { 's', "std::string" }, + { 'o', "::DBus::Path" }, + { 'g', "::DBus::Signature" }, + { 'v', "::DBus::Variant" }, + { '\0', "" } + }; + int i; + + for (i = 0; atos[i].type; ++i) { + if (atos[i].type == t) break; + } + + return atos[i].name; + } + + void _parse_signature (const string &signature, string &type, unsigned int &i) + { + for (; i < signature.length(); ++i) { + switch (signature[i]) { + + case 'a': { + switch (signature[++i]) { + + case '{': { + type += "std::map< "; + + const char *atom = atomic_type_to_string (signature[++i]); + + if (!atom) { + cerr << "invalid signature" << endl; + exit (-1); + } + + type += atom; + + type += ", "; + ++i; + break; + } + + default: { + type += "std::vector< "; + break; + } + } + + _parse_signature (signature, type, i); + + type += " >"; + continue; + } + + case '(': { + type += "::DBus::Struct< "; + ++i; + _parse_signature (signature, type, i); + type += " >"; + + if (signature[i+1]) { + type += ", "; + } + + continue; + } + + case ')': + + case '}': { + return; + } + + default: { + const char *atom = atomic_type_to_string (signature[i]); + + if (!atom) { + cerr << "invalid signature" << endl; + exit (-1); + } + + type += atom; + + if (signature[i+1] != ')' && signature[i+1] != '}' && i+1 < signature.length()) { + type += ", "; + } + + break; + } + } + } + } + + string signature_to_type (const string &signature) + { + string type; + unsigned int i = 0; + _parse_signature (signature, type, i); + return type; + } diff --git a/sflphone-common/libs/dbus-c++/tools/generator_utils.h b/sflphone-common/libs/dbus-c++/tools/generator_utils.h new file mode 100644 index 0000000000000000000000000000000000000000..b232b56dd9fe9f3afd29b728e85e098bb5580273 --- /dev/null +++ b/sflphone-common/libs/dbus-c++/tools/generator_utils.h @@ -0,0 +1,46 @@ +/* + * + * D-Bus++ - C++ bindings for D-Bus + * + * Copyright (C) 2005-2007 Paolo Durante <shackan@gmail.com> + * + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +#ifndef __DBUSXX_TOOLS_GENERATOR_UTILS_H +#define __DBUSXX_TOOLS_GENERATOR_UTILS_H + +#include <string> +#include <sstream> +#include <iomanip> + +const char *atomic_type_to_string(char t); +std::string stub_name(std::string name); +std::string signature_to_type(const std::string &signature); +void _parse_signature(const std::string &signature, std::string &type, unsigned int &i); +void underscorize(std::string &str); + +/// create std::string from any number +template <typename T> +std::string toString (const T &thing, int w = 0, int p = 0) +{ + std::ostringstream os; + os << std::setw(w) << std::setprecision(p) << thing; + return os.str(); +} + +#endif//__DBUSXX_TOOLS_GENERATOR_UTILS_H diff --git a/sflphone-common/libs/dbus-c++/tools/introspect.cpp b/sflphone-common/libs/dbus-c++/tools/introspect.cpp index 8ce9f3a74c6c6faa4183164df49983789df8e0c1..88a767396139d976588c1d26464cceaa9153c6bb 100644 --- a/sflphone-common/libs/dbus-c++/tools/introspect.cpp +++ b/sflphone-common/libs/dbus-c++/tools/introspect.cpp @@ -32,48 +32,42 @@ static bool systembus; static char *path; static char *service; -void niam(int sig) +void niam (int sig) { - DBus::Connection conn = systembus ? DBus::Connection::SystemBus() : DBus::Connection::SessionBus(); + DBus::Connection conn = systembus ? DBus::Connection::SystemBus() : DBus::Connection::SessionBus(); - IntrospectedObject io(conn, path, service); + IntrospectedObject io (conn, path, service); - std::cout << io.Introspect(); + std::cout << io.Introspect(); - dispatcher.leave(); + dispatcher.leave(); } -int main(int argc, char ** argv) +int main (int argc, char ** argv) { - signal(SIGTERM, niam); - signal(SIGINT, niam); - signal(SIGALRM, niam); + signal (SIGTERM, niam); + signal (SIGINT, niam); + signal (SIGALRM, niam); - if (argc == 1) - { - std::cerr << std::endl << "Usage: " << argv[0] << " [--system] <object_path> [<destination>]" << std::endl << std::endl; - } - else - { - if (strcmp(argv[1], "--system")) - { - systembus = false; - path = argv[1]; - service = argc > 2 ? argv[2] : 0; - } - else - { - systembus = true; - path = argv[2]; - service = argc > 3 ? argv[3] : 0; - } + if (argc == 1) { + std::cerr << std::endl << "Usage: " << argv[0] << " [--system] <object_path> [<destination>]" << std::endl << std::endl; + } else { + if (strcmp (argv[1], "--system")) { + systembus = false; + path = argv[1]; + service = argc > 2 ? argv[2] : 0; + } else { + systembus = true; + path = argv[2]; + service = argc > 3 ? argv[3] : 0; + } - DBus::default_dispatcher = &dispatcher; + DBus::default_dispatcher = &dispatcher; - alarm(1); + alarm (1); - dispatcher.enter(); - } + dispatcher.enter(); + } - return 0; + return 0; } diff --git a/sflphone-common/libs/dbus-c++/tools/xml.cpp b/sflphone-common/libs/dbus-c++/tools/xml.cpp index 68ae5a64da68080330b5985673243a02a5dcf400..2ba8635a3c9508d2f73e5cdeda87f84d7ed0b76c 100644 --- a/sflphone-common/libs/dbus-c++/tools/xml.cpp +++ b/sflphone-common/libs/dbus-c++/tools/xml.cpp @@ -30,286 +30,276 @@ std::istream &operator >> (std::istream &in, DBus::Xml::Document &doc) { - std::stringbuf xmlbuf; - in.get(xmlbuf, '\0'); - doc.from_xml(xmlbuf.str()); + std::stringbuf xmlbuf; + in.get (xmlbuf, '\0'); + doc.from_xml (xmlbuf.str()); - return in; + return in; } std::ostream &operator << (std::ostream &out, const DBus::Xml::Document &doc) { - return out << doc.to_xml(); + return out << doc.to_xml(); } using namespace DBus; + using namespace DBus::Xml; -Error::Error(const char *error, int line, int column) +Error::Error (const char *error, int line, int column) { - std::ostringstream estream; + std::ostringstream estream; - estream << "line " << line << ", column " << column << ": " << error; + estream << "line " << line << ", column " << column << ": " << error; - _error = estream.str(); + _error = estream.str(); } -Node::Node(const char *n, const char ** a) -: name(n) +Node::Node (const char *n, const char ** a) + : name (n) { - if (a) - for (int i = 0; a[i]; i += 2) - { - _attrs[a[i]] = a[i+1]; + if (a) + for (int i = 0; a[i]; i += 2) { + _attrs[a[i]] = a[i+1]; - //debug_log("xml:\t%s = %s", a[i], a[i+1]); - } + //debug_log("xml:\t%s = %s", a[i], a[i+1]); + } } -Nodes Nodes::operator[](const std::string &key) +Nodes Nodes::operator[] (const std::string &key) { - Nodes result; + Nodes result; + + for (iterator i = begin(); i != end(); ++i) { + Nodes part = (**i) [key]; - for (iterator i = begin(); i != end(); ++i) - { - Nodes part = (**i)[key]; + result.insert (result.end(), part.begin(), part.end()); + } - result.insert(result.end(), part.begin(), part.end()); - } - return result; + return result; } -Nodes Nodes::select(const std::string &attr, const std::string &value) +Nodes Nodes::select (const std::string &attr, const std::string &value) { - Nodes result; - - for (iterator i = begin(); i != end(); ++i) - { - if ((*i)->get(attr) == value) - result.insert(result.end(), *i); - } - return result; + Nodes result; + + for (iterator i = begin(); i != end(); ++i) { + if ( (*i)->get (attr) == value) + result.insert (result.end(), *i); + } + + return result; } -Nodes Node::operator[](const std::string &key) +Nodes Node::operator[] (const std::string &key) { - Nodes result; + Nodes result; - if (key.length() == 0) return result; + if (key.length() == 0) return result; - for (Children::iterator i = children.begin(); i != children.end(); ++i) - { - if (i->name == key) - result.push_back(&(*i)); - } - return result; + for (Children::iterator i = children.begin(); i != children.end(); ++i) { + if (i->name == key) + result.push_back (& (*i)); + } + + return result; } -std::string Node::get(const std::string &attribute) +std::string Node::get (const std::string &attribute) { - if (_attrs.find(attribute) != _attrs.end()) - return _attrs[attribute]; - else - return ""; + if (_attrs.find (attribute) != _attrs.end()) + return _attrs[attribute]; + else + return ""; } -void Node::set(const std::string &attribute, std::string value) +void Node::set (const std::string &attribute, std::string value) { - if (value.length()) - _attrs[attribute] = value; - else - _attrs.erase(value); + if (value.length()) + _attrs[attribute] = value; + else + _attrs.erase (value); } std::string Node::to_xml() const { - std::string xml; - int depth = 0; + std::string xml; + int depth = 0; - _raw_xml(xml, depth); + _raw_xml (xml, depth); - return xml; + return xml; } -void Node::_raw_xml(std::string &xml, int &depth) const +void Node::_raw_xml (std::string &xml, int &depth) const { - xml.append(depth *2, ' '); - xml.append("<"+name); - - for (Attributes::const_iterator i = _attrs.begin(); i != _attrs.end(); ++i) - { - xml.append(" "+i->first+"=\""+i->second+"\""); - } - - if (cdata.length() == 0 && children.size() == 0) - { - xml.append("/>\n"); - } - else - { - xml.append(">"); - - if (cdata.length()) - { - xml.append(cdata); - } - - if (children.size()) - { - xml.append("\n"); - depth++; - - for (Children::const_iterator i = children.begin(); i != children.end(); ++i) - { - i->_raw_xml(xml, depth); - } - - depth--; - xml.append(depth *2, ' '); - } - xml.append("</"+name+">\n"); - } + xml.append (depth *2, ' '); + xml.append ("<"+name); + + for (Attributes::const_iterator i = _attrs.begin(); i != _attrs.end(); ++i) { + xml.append (" "+i->first+"=\""+i->second+"\""); + } + + if (cdata.length() == 0 && children.size() == 0) { + xml.append ("/>\n"); + } else { + xml.append (">"); + + if (cdata.length()) { + xml.append (cdata); + } + + if (children.size()) { + xml.append ("\n"); + depth++; + + for (Children::const_iterator i = children.begin(); i != children.end(); ++i) { + i->_raw_xml (xml, depth); + } + + depth--; + + xml.append (depth *2, ' '); + } + + xml.append ("</"+name+">\n"); + } } Document::Document() -: root(0), _depth(0) + : root (0), _depth (0) { } - -Document::Document(const std::string &xml) -: root(0), _depth(0) + +Document::Document (const std::string &xml) + : root (0), _depth (0) { - from_xml(xml); + from_xml (xml); } Document::~Document() { - delete root; + delete root; } -struct Document::Expat -{ - static void start_doctype_decl_handler( - void *data, const XML_Char *name, const XML_Char *sysid, const XML_Char *pubid, int has_internal_subset - ); - static void end_doctype_decl_handler(void *data); - static void start_element_handler(void *data, const XML_Char *name, const XML_Char **atts); - static void character_data_handler(void *data, const XML_Char *chars, int len); - static void end_element_handler(void *data, const XML_Char *name); +struct Document::Expat { + static void start_doctype_decl_handler ( + void *data, const XML_Char *name, const XML_Char *sysid, const XML_Char *pubid, int has_internal_subset + ); + static void end_doctype_decl_handler (void *data); + static void start_element_handler (void *data, const XML_Char *name, const XML_Char **atts); + static void character_data_handler (void *data, const XML_Char *chars, int len); + static void end_element_handler (void *data, const XML_Char *name); }; -void Document::from_xml(const std::string &xml) +void Document::from_xml (const std::string &xml) { - _depth = 0; - delete root; - root = 0; - - XML_Parser parser = XML_ParserCreate("UTF-8"); - - XML_SetUserData(parser, this); - - XML_SetDoctypeDeclHandler( - parser, - Document::Expat::start_doctype_decl_handler, - Document::Expat::end_doctype_decl_handler - ); - - XML_SetElementHandler( - parser, - Document::Expat::start_element_handler, - Document::Expat::end_element_handler - ); - - XML_SetCharacterDataHandler( - parser, - Document::Expat::character_data_handler - ); - - XML_Status status = XML_Parse(parser, xml.c_str(), xml.length(), true); - - if (status == XML_STATUS_ERROR) - { - const char *error = XML_ErrorString(XML_GetErrorCode(parser)); - int line = XML_GetCurrentLineNumber(parser); - int column = XML_GetCurrentColumnNumber(parser); - - XML_ParserFree(parser); - - throw Error(error, line, column); - } - else - { - XML_ParserFree(parser); - } + _depth = 0; + delete root; + root = 0; + + XML_Parser parser = XML_ParserCreate ("UTF-8"); + + XML_SetUserData (parser, this); + + XML_SetDoctypeDeclHandler ( + parser, + Document::Expat::start_doctype_decl_handler, + Document::Expat::end_doctype_decl_handler + ); + + XML_SetElementHandler ( + parser, + Document::Expat::start_element_handler, + Document::Expat::end_element_handler + ); + + XML_SetCharacterDataHandler ( + parser, + Document::Expat::character_data_handler + ); + + XML_Status status = XML_Parse (parser, xml.c_str(), xml.length(), true); + + if (status == XML_STATUS_ERROR) { + const char *error = XML_ErrorString (XML_GetErrorCode (parser)); + int line = XML_GetCurrentLineNumber (parser); + int column = XML_GetCurrentColumnNumber (parser); + + XML_ParserFree (parser); + + throw Error (error, line, column); + } else { + XML_ParserFree (parser); + } } std::string Document::to_xml() const { - return root->to_xml(); + return root->to_xml(); } -void Document::Expat::start_doctype_decl_handler( - void *data, const XML_Char *name, const XML_Char *sysid, const XML_Char *pubid, int has_internal_subset +void Document::Expat::start_doctype_decl_handler ( + void *data, const XML_Char *name, const XML_Char *sysid, const XML_Char *pubid, int has_internal_subset ) { } -void Document::Expat::end_doctype_decl_handler(void *data) +void Document::Expat::end_doctype_decl_handler (void *data) { } -void Document::Expat::start_element_handler(void *data, const XML_Char *name, const XML_Char **atts) +void Document::Expat::start_element_handler (void *data, const XML_Char *name, const XML_Char **atts) { - Document *doc = (Document *)data; - - //debug_log("xml:%d -> %s", doc->_depth, name); - - if (!doc->root) - { - doc->root = new Node(name, atts); - } - else - { - Node::Children *cld = &(doc->root->children); - - for (int i = 1; i < doc->_depth; ++i) - { - cld = &(cld->back().children); - } - cld->push_back(Node(name, atts)); - - //std::cerr << doc->to_xml() << std::endl; - } - doc->_depth++; + Document *doc = (Document *) data; + + //debug_log("xml:%d -> %s", doc->_depth, name); + + if (!doc->root) { + doc->root = new Node (name, atts); + } else { + Node::Children *cld = & (doc->root->children); + + for (int i = 1; i < doc->_depth; ++i) { + cld = & (cld->back().children); + } + + cld->push_back (Node (name, atts)); + + //std::cerr << doc->to_xml() << std::endl; + } + + doc->_depth++; } -void Document::Expat::character_data_handler(void *data, const XML_Char *chars, int len) +void Document::Expat::character_data_handler (void *data, const XML_Char *chars, int len) { - Document *doc = (Document *)data; + Document *doc = (Document *) data; + + Node *nod = doc->root; + + for (int i = 1; i < doc->_depth; ++i) { + nod = & (nod->children.back()); + } - Node *nod = doc->root; + int x, y; - for (int i = 1; i < doc->_depth; ++i) - { - nod = &(nod->children.back()); - } - int x, y; + x = 0; + y = len-1; - x = 0; - y = len-1; + while (isspace (chars[y]) && y > 0) --y; - while (isspace(chars[y]) && y > 0) --y; - while (isspace(chars[x]) && x < y) ++x; + while (isspace (chars[x]) && x < y) ++x; - nod->cdata = std::string(chars, x, y+1); + nod->cdata = std::string (chars, x, y+1); } -void Document::Expat::end_element_handler(void *data, const XML_Char *name) +void Document::Expat::end_element_handler (void *data, const XML_Char *name) { - Document *doc = (Document *)data; + Document *doc = (Document *) data; - //debug_log("xml:%d <- %s", doc->_depth, name); + //debug_log("xml:%d <- %s", doc->_depth, name); - doc->_depth--; + doc->_depth--; } diff --git a/sflphone-common/libs/dbus-c++/tools/xml2cpp.cpp b/sflphone-common/libs/dbus-c++/tools/xml2cpp.cpp index 45c8dde1c3fcc9a0fee2b9df3bb89e7e63639cb3..3284d766753fdeb3baa39de951c56df43a88cea4 100644 --- a/sflphone-common/libs/dbus-c++/tools/xml2cpp.cpp +++ b/sflphone-common/libs/dbus-c++/tools/xml2cpp.cpp @@ -1,6 +1,6 @@ /* * - * D-Bus++ - C++ bindings for D-Bus + * D-->Bus++ - C++ bindings for D-Bus * * Copyright (C) 2005-2007 Paolo Durante <shackan@gmail.com> * @@ -21,9 +21,6 @@ * */ - -#include "xml2cpp.h" - #include <dbus/dbus.h> #include <cstdlib> @@ -33,49 +30,26 @@ #include <iostream> #include <fstream> #include <sstream> +#include <algorithm> -using namespace std; -using namespace DBus; - -static const char *tab = " "; - -static const char *header = "\n\ -/*\n\ - * This file was automatically generated by dbusxx-xml2cpp; DO NOT EDIT!\n\ - */\n\ -\n\ -"; - -static const char *dbus_includes = "\n\ -#include <dbus-c++/dbus.h>\n\ -\n\ -"; +#include "xml2cpp.h" +#include "generate_adaptor.h" +#include "generate_proxy.h" -typedef map<string,string> TypeCache; +using namespace std; -void usage(const char *argv0) -{ - cerr << endl << "Usage: " << argv0 << " <xmlfile> [ --proxy=<outfile.h> ] [ --adaptor=<outfile.h> ]" - << endl << endl; - exit(-1); -} +using namespace DBus; -void underscorize(string &str) -{ - for (unsigned int i = 0; i < str.length(); ++i) - { - if (!isalpha(str[i]) && !isdigit(str[i])) str[i] = '_'; - } -} +//typedef map<string,string> TypeCache; -string stub_name(string name) +void usage (const char *argv0) { - underscorize(name); - - return "_" + name + "_stub"; + cerr << endl << "Usage: " << argv0 << " <xmlfile> [ --proxy=<outfile.h> ] [ --adaptor=<outfile.h> ]" + << endl << endl; + exit (-1); } -int char_to_atomic_type(char t) +/*int char_to_atomic_type(char t) { if (strchr("ybnqiuxtdsgavre", t)) return t; @@ -83,957 +57,65 @@ int char_to_atomic_type(char t) return DBUS_TYPE_INVALID; } -const char *atomic_type_to_string(char t) -{ - static struct { char type; const char *name; } atos[] = - { - { 'y', "uint8_t" }, - { 'b', "bool" }, - { 'n', "int16_t" }, - { 'q', "uint16_t" }, - { 'i', "int32_t" }, - { 'u', "uint32_t" }, - { 'x', "int64_t" }, - { 't', "uint64_t" }, - { 'd', "double" }, - { 's', "std::string" }, - { 'o', "::DBus::Path" }, - { 'g', "::DBus::Signature" }, - { 'v', "::DBus::Variant" }, - { '\0', "" } - }; - int i; - - for (i = 0; atos[i].type; ++i) - { - if (atos[i].type == t) break; - } - return atos[i].name; -} - bool is_atomic_type(const string &type) { return type.length() == 1 && char_to_atomic_type(type[0]) != DBUS_TYPE_INVALID; -} - -void _parse_signature(const string &signature, string &type, unsigned int &i) -{ - for (; i < signature.length(); ++i) - { - switch (signature[i]) - { - case 'a': - { - switch (signature[++i]) - { - case '{': - { - type += "std::map< "; +}*/ - const char *atom = atomic_type_to_string(signature[++i]); - if (!atom) - { - cerr << "invalid signature" << endl; - exit(-1); - } - type += atom; - type += ", "; - ++i; - break; - } - default: - { - type += "std::vector< "; - break; - } - } - _parse_signature(signature, type, i); - type += " >"; - continue; - } - case '(': - { - type += "::DBus::Struct< "; - ++i; - _parse_signature(signature, type, i); - type += " >"; - if (signature[i+1]) - { - type += ", "; - } - continue; - } - case ')': - case '}': - { - return; - } - default: - { - const char *atom = atomic_type_to_string(signature[i]); - if (!atom) - { - cerr << "invalid signature" << endl; - exit(-1); - } - type += atom; - - if (signature[i+1] != ')' && signature[i+1] != '}' && i+1 < signature.length()) - { - type += ", "; - } - break; - } - } - } -} - -string signature_to_type(const string &signature) -{ - string type; - unsigned int i = 0; - _parse_signature(signature, type, i); - return type; -} - -void generate_proxy(Xml::Document &doc, const char *filename) +int main (int argc, char ** argv) { - cerr << "writing " << filename << endl; - - ofstream file(filename); - if (file.bad()) - { - cerr << "unable to write file " << filename << endl; - exit(-1); - } - - file << header; - string filestring = filename; - underscorize(filestring); - - string cond_comp = "__dbusxx__" + filestring + "__PROXY_MARSHAL_H"; - - file << "#ifndef " << cond_comp << endl; - file << "#define " << cond_comp << endl; - - file << dbus_includes; - - Xml::Node &root = *(doc.root); - Xml::Nodes interfaces = root["interface"]; - - for (Xml::Nodes::iterator i = interfaces.begin(); i != interfaces.end(); ++i) - { - Xml::Node &iface = **i; - Xml::Nodes methods = iface["method"]; - Xml::Nodes signals = iface["signal"]; - Xml::Nodes properties = iface["property"]; - Xml::Nodes ms; - ms.insert(ms.end(), methods.begin(), methods.end()); - ms.insert(ms.end(), signals.begin(), signals.end()); - - string ifacename = iface.get("name"); - if (ifacename == "org.freedesktop.DBus.Introspectable" - ||ifacename == "org.freedesktop.DBus.Properties") - { - cerr << "skipping interface " << ifacename << endl; - continue; - } - - istringstream ss(ifacename); - string nspace; - unsigned int nspaces = 0; - - while (ss.str().find('.', ss.tellg()) != string::npos) - { - getline(ss, nspace, '.'); - - file << "namespace " << nspace << " {" << endl; - - ++nspaces; - } - file << endl; - - string ifaceclass; - - getline(ss, ifaceclass); - - ifaceclass += "_proxy"; - - cerr << "generating code for interface " << ifacename << "..." << endl; - - file << "class " << ifaceclass << endl - << " : public ::DBus::InterfaceProxy" << endl - << "{" << endl - << "public:" << endl - << endl - << tab << ifaceclass << "()" << endl - << tab << ": ::DBus::InterfaceProxy(\"" << ifacename << "\")" << endl - << tab << "{" << endl; + if (argc < 2) { + usage (argv[0]); + } - for (Xml::Nodes::iterator si = signals.begin(); si != signals.end(); ++si) - { - Xml::Node &signal = **si; + bool proxy_mode, adaptor_mode; - string marshname = "_" + signal.get("name") + "_stub"; + char *proxy, *adaptor; - file << tab << tab << "connect_signal(" - << ifaceclass << ", " << signal.get("name") << ", " << stub_name(signal.get("name")) - << ");" << endl; - } + proxy_mode = false; + proxy = 0; - file << tab << "}" << endl - << endl; -/// write properties - file << "public:" << endl << endl - << tab << "/* properties exported by this interface */" << endl; + adaptor_mode = false; + adaptor = 0; - for (Xml::Nodes::iterator pi = properties.begin (); - pi != properties.end (); ++pi) - { - Xml::Node & property = **pi; - string prop_name = property.get ("name"); - string property_access = property.get ("access"); - if (property_access == "read" || property_access == "readwrite") - { - file << tab << tab << "const " << signature_to_type (property.get("type")) - << " " << prop_name << "() {" << endl; - file << tab << tab << tab << "::DBus::CallMessage call ;\n "; - file << tab << tab << tab - << "call.member(\"Get\"); call.interface(\"org.freedesktop.DBus.Properties\");" - << endl; - file << tab << tab << tab - << "::DBus::MessageIter wi = call.writer(); " << endl; - file << tab << tab << tab - << "const std::string interface_name = \"" << ifacename << "\";" - << endl; - file << tab << tab << tab - << "const std::string property_name = \"" << prop_name << "\";" - << endl; - file << tab << tab << tab << "wi << interface_name;" << endl; - file << tab << tab << tab << "wi << property_name;" << endl; - file << tab << tab << tab - << "::DBus::Message ret = this->invoke_method (call);" << endl; - file << tab << tab << tab - << "::DBus::MessageIter ri = ret.reader ();" << endl; - file << tab << tab << tab << "::DBus::Variant argout; " << endl; - file << tab << tab << tab << "ri >> argout;" << endl; - file << tab << tab << tab << "return argout;" << endl; - file << tab << tab << "};" << endl; - } - - if (property_access == "write" || property_access == "readwrite") - { - file << tab << tab << "void " << prop_name << "( const "<< signature_to_type (property.get("type")) << " & input" << ") {" << endl; - file << tab << tab << tab << "::DBus::CallMessage call ;\n "; - file << tab << tab << tab <<"call.member(\"Set\"); call.interface( \"org.freedesktop.DBus.Properties\");"<< endl; - file << tab << tab << tab <<"::DBus::MessageIter wi = call.writer(); " << endl; - file << tab << tab << tab <<"::DBus::Variant value;" << endl; - file << tab << tab << tab <<"::DBus::MessageIter vi = value.writer ();" << endl; - file << tab << tab << tab <<"vi << input;" << endl; - file << tab << tab << tab <<"const std::string interface_name = \"" << ifacename << "\";" << endl; - file << tab << tab << tab <<"const std::string property_name = \"" << prop_name << "\";"<< endl; - file << tab << tab << tab <<"wi << interface_name;" << endl; - file << tab << tab << tab <<"wi << property_name;" << endl; - file << tab << tab << tab <<"wi << value;" << endl; - file << tab << tab << tab <<"::DBus::Message ret = this->invoke_method (call);" << endl; - file << tab << tab << "};" << endl; + for (int a = 1; a < argc; ++a) { + if (!strncmp (argv[a], "--proxy=", 8)) { + proxy_mode = true; + proxy = argv[a] +8; + } else + if (!strncmp (argv[a], "--adaptor=", 10)) { + adaptor_mode = true; + adaptor = argv[a] +10; } - } - - file << "public:" << endl - << endl - << tab << "/* methods exported by this interface," << endl - << tab << " * this functions will invoke the corresponding methods on the remote objects" << endl - << tab << " */" << endl; - - for (Xml::Nodes::iterator mi = methods.begin(); mi != methods.end(); ++mi) - { - Xml::Node &method = **mi; - Xml::Nodes args = method["arg"]; - Xml::Nodes args_in = args.select("direction","in"); - Xml::Nodes args_out = args.select("direction","out"); - - if (args_out.size() == 0 || args_out.size() > 1) - { - file << tab << "void "; - } - else if (args_out.size() == 1) - { - file << tab << signature_to_type(args_out.front()->get("type")) << " "; - } - - file << method.get("name") << "("; - - unsigned int i = 0; - for (Xml::Nodes::iterator ai = args_in.begin(); ai != args_in.end(); ++ai, ++i) - { - Xml::Node &arg = **ai; - file << "const " << signature_to_type(arg.get("type")) << "& "; - - string arg_name = arg.get("name"); - if (arg_name.length()) - file << arg_name; - else - file << "argin" << i; - - if ((i+1 != args_in.size() || args_out.size() > 1)) - file << ", "; - } - - if (args_out.size() > 1) - { - unsigned int i = 0; - for (Xml::Nodes::iterator ao = args_out.begin(); ao != args_out.end(); ++ao, ++i) - { - Xml::Node &arg = **ao; - file << signature_to_type(arg.get("type")) << "&"; - - string arg_name = arg.get("name"); - if (arg_name.length()) - file << " " << arg_name; - else - file << " argout" << i; - - if (i+1 != args_out.size()) - file << ", "; - } - } - file << ")" << endl; - - file << tab << "{" << endl - << tab << tab << "::DBus::CallMessage call;" << endl; - - if (args_in.size() > 0) - { - file << tab << tab << "::DBus::MessageIter wi = call.writer();" << endl - << endl; - } - - unsigned int j = 0; - for (Xml::Nodes::iterator ai = args_in.begin(); ai != args_in.end(); ++ai, ++j) - { - Xml::Node &arg = **ai; - string arg_name = arg.get("name"); - if (arg_name.length()) - file << tab << tab << "wi << " << arg_name << ";" << endl; - else - file << tab << tab << "wi << argin" << j << ";" << endl; - } - - file << tab << tab << "call.member(\"" << method.get("name") << "\");" << endl - << tab << tab << "::DBus::Message ret = invoke_method(call);" << endl; - - - if (args_out.size() > 0) - { - file << tab << tab << "::DBus::MessageIter ri = ret.reader();" << endl - << endl; - } - - if (args_out.size() == 1) - { - file << tab << tab << signature_to_type(args_out.front()->get("type")) << " argout;" << endl; - file << tab << tab << "ri >> argout;" << endl; - file << tab << tab << "return argout;" << endl; - } - else if (args_out.size() > 1) - { - unsigned int i = 0; - for (Xml::Nodes::iterator ao = args_out.begin(); ao != args_out.end(); ++ao, ++i) - { - Xml::Node &arg = **ao; - - string arg_name = arg.get("name"); - if (arg_name.length()) - file << tab << tab << "ri >> " << arg.get("name") << ";" << endl; - else - file << tab << tab << "ri >> argout" << i << ";" << endl; - } - } - - file << tab << "}" << endl - << endl; - } - - file << endl - << "public:" << endl - << endl - << tab << "/* signal handlers for this interface" << endl - << tab << " */" << endl; - - for (Xml::Nodes::iterator si = signals.begin(); si != signals.end(); ++si) - { - Xml::Node &signal = **si; - Xml::Nodes args = signal["arg"]; - - file << tab << "virtual void " << signal.get("name") << "("; - - unsigned int i = 0; - for (Xml::Nodes::iterator ai = args.begin(); ai != args.end(); ++ai, ++i) - { - Xml::Node &arg = **ai; - file << "const " << signature_to_type(arg.get("type")) << "& "; - - string arg_name = arg.get("name"); - if (arg_name.length()) - file << arg_name; - else - file << "argin" << i; - - if ((ai+1 != args.end())) - file << ", "; - } - file << ") = 0;" << endl; - } - - file << endl - << "private:" << endl - << endl - << tab << "/* unmarshalers (to unpack the DBus message before calling the actual signal handler)" << endl - << tab << " */" << endl; - - for (Xml::Nodes::iterator si = signals.begin(); si != signals.end(); ++si) - { - Xml::Node &signal = **si; - Xml::Nodes args = signal["arg"]; - - file << tab << "void " << stub_name(signal.get("name")) << "(const ::DBus::SignalMessage &sig)" << endl - << tab << "{" << endl; - - if (args.size() > 0) - { - file << tab << tab << "::DBus::MessageIter ri = sig.reader();" << endl - << endl; - } - - unsigned int i = 0; - for (Xml::Nodes::iterator ai = args.begin(); ai != args.end(); ++ai, ++i) - { - Xml::Node &arg = **ai; - file << tab << tab << signature_to_type(arg.get("type")) << " " ; - - string arg_name = arg.get("name"); - if (arg_name.length()) - file << arg_name << ";" << " ri >> " << arg_name << ";" << endl; - else - file << "arg" << i << ";" << " ri >> " << "arg" << i << ";" << endl; - } - - file << tab << tab << signal.get("name") << "("; - - unsigned int j = 0; - for (Xml::Nodes::iterator ai = args.begin(); ai != args.end(); ++ai, ++j) - { - Xml::Node &arg = **ai; - - string arg_name = arg.get("name"); - if (arg_name.length()) - file << arg_name; - else - file << "arg" << j; - - if (ai+1 != args.end()) - file << ", "; - } - - file << ");" << endl; - - file << tab << "}" << endl; - } - - - file << "};" << endl - << endl; - - for (unsigned int i = 0; i < nspaces; ++i) - { - file << "} "; - } - file << endl; - } - - file << "#endif//" << cond_comp << endl; - - file.close(); -} - -void generate_adaptor(Xml::Document &doc, const char *filename) -{ - cerr << "writing " << filename << endl; - - ofstream file(filename); - if (file.bad()) - { - cerr << "unable to write file " << filename << endl; - exit(-1); - } - - file << header; - string filestring = filename; - underscorize(filestring); - - string cond_comp = "__dbusxx__" + filestring + "__ADAPTOR_MARSHAL_H"; - - file << "#ifndef " << cond_comp << endl - << "#define " << cond_comp << endl; - - file << dbus_includes; - - Xml::Node &root = *(doc.root); - Xml::Nodes interfaces = root["interface"]; - - for (Xml::Nodes::iterator i = interfaces.begin(); i != interfaces.end(); ++i) - { - Xml::Node &iface = **i; - Xml::Nodes methods = iface["method"]; - Xml::Nodes signals = iface["signal"]; - Xml::Nodes properties = iface["property"]; - Xml::Nodes ms; - ms.insert(ms.end(), methods.begin(), methods.end()); - ms.insert(ms.end(), signals.begin(), signals.end()); - - string ifacename = iface.get("name"); - if (ifacename == "org.freedesktop.DBus.Introspectable" - ||ifacename == "org.freedesktop.DBus.Properties") - { - cerr << "skipping interface " << ifacename << endl; - continue; - } - - istringstream ss(ifacename); - string nspace; - unsigned int nspaces = 0; - - while (ss.str().find('.', ss.tellg()) != string::npos) - { - getline(ss, nspace, '.'); - - file << "namespace " << nspace << " {" << endl; - - ++nspaces; - } - file << endl; - - string ifaceclass; - - getline(ss, ifaceclass); - - ifaceclass += "_adaptor"; - - cerr << "generating code for interface " << ifacename << "..." << endl; - - file << "class " << ifaceclass << endl - << ": public ::DBus::InterfaceAdaptor" << endl - << "{" << endl - << "public:" << endl - << endl - << tab << ifaceclass << "()" << endl - << tab << ": ::DBus::InterfaceAdaptor(\"" << ifacename << "\")" << endl - << tab << "{" << endl; - - for (Xml::Nodes::iterator pi = properties.begin(); pi != properties.end(); ++pi) - { - Xml::Node &property = **pi; - - file << tab << tab << "bind_property(" - << property.get("name") << ", " - << "\"" << property.get("type") << "\", " - << (property.get("access").find("read") != string::npos - ? "true" - : "false") - << ", " - << (property.get("access").find("write") != string::npos - ? "true" - : "false") - << ");" << endl; - } - - for (Xml::Nodes::iterator mi = methods.begin(); mi != methods.end(); ++mi) - { - Xml::Node &method = **mi; - - file << tab << tab << "register_method(" - << ifaceclass << ", " << method.get("name") << ", "<< stub_name(method.get("name")) - << ");" << endl; - } - - file << tab << "}" << endl - << endl; - - file << tab << "::DBus::IntrospectedInterface *const introspect() const " << endl - << tab << "{" << endl; - - for (Xml::Nodes::iterator mi = ms.begin(); mi != ms.end(); ++mi) - { - Xml::Node &method = **mi; - Xml::Nodes args = method["arg"]; - - file << tab << tab << "static ::DBus::IntrospectedArgument " << method.get("name") << "_args[] = " << endl - << tab << tab << "{" << endl; - - for (Xml::Nodes::iterator ai = args.begin(); ai != args.end(); ++ai) - { - Xml::Node &arg = **ai; - - file << tab << tab << tab << "{ "; - - if (arg.get("name").length()) - { - file << "\"" << arg.get("name") << "\", "; - } - else - { - file << "0, "; - } - file << "\"" << arg.get("type") << "\", " - << (arg.get("direction") == "in" ? "true" : "false") - << " }," << endl; - } - file << tab << tab << tab << "{ 0, 0, 0 }" << endl - << tab << tab << "};" << endl; - } - - file << tab << tab << "static ::DBus::IntrospectedMethod " << ifaceclass << "_methods[] = " << endl - << tab << tab << "{" << endl; - - for (Xml::Nodes::iterator mi = methods.begin(); mi != methods.end(); ++mi) - { - Xml::Node &method = **mi; - - file << tab << tab << tab << "{ \"" << method.get("name") << "\", " << method.get("name") << "_args }," << endl; - } - - file << tab << tab << tab << "{ 0, 0 }" << endl - << tab << tab << "};" << endl; - - file << tab << tab << "static ::DBus::IntrospectedMethod " << ifaceclass << "_signals[] = " << endl - << tab << tab << "{" << endl; - - for (Xml::Nodes::iterator si = signals.begin(); si != signals.end(); ++si) - { - Xml::Node &method = **si; - - file << tab << tab << tab << "{ \"" << method.get("name") << "\", " << method.get("name") << "_args }," << endl; - } - - file << tab << tab << tab << "{ 0, 0 }" << endl - << tab << tab << "};" << endl; - - file << tab << tab << "static ::DBus::IntrospectedProperty " << ifaceclass << "_properties[] = " << endl - << tab << tab << "{" << endl; - - for (Xml::Nodes::iterator pi = properties.begin(); pi != properties.end(); ++pi) - { - Xml::Node &property = **pi; - - file << tab << tab << tab << "{ " - << "\"" << property.get("name") << "\", " - << "\"" << property.get("type") << "\", " - << (property.get("access").find("read") != string::npos - ? "true" - : "false") - << ", " - << (property.get("access").find("write") != string::npos - ? "true" - : "false") - << " }," << endl; - } - - - file << tab << tab << tab << "{ 0, 0, 0, 0 }" << endl - << tab << tab << "};" << endl; - - file << tab << tab << "static ::DBus::IntrospectedInterface " << ifaceclass << "_interface = " << endl - << tab << tab << "{" << endl - << tab << tab << tab << "\"" << ifacename << "\"," << endl - << tab << tab << tab << ifaceclass << "_methods," << endl - << tab << tab << tab << ifaceclass << "_signals," << endl - << tab << tab << tab << ifaceclass << "_properties" << endl - << tab << tab << "};" << endl - << tab << tab << "return &" << ifaceclass << "_interface;" << endl - << tab << "}" << endl - << endl; - - file << "public:" << endl - << endl - << tab << "/* properties exposed by this interface, use" << endl - << tab << " * property() and property(value) to get and set a particular property" << endl - << tab << " */" << endl; - - for (Xml::Nodes::iterator pi = properties.begin(); pi != properties.end(); ++pi) - { - Xml::Node &property = **pi; - string name = property.get("name"); - string type = property.get("type"); - string type_name = signature_to_type(type); - - file << tab << "::DBus::PropertyAdaptor< " << type_name << " > " << name << ";" << endl; - } - - file << endl; - - file << "public:" << endl - << endl - << tab << "/* methods exported by this interface," << endl - << tab << " * you will have to implement them in your ObjectAdaptor" << endl - << tab << " */" << endl; - - for (Xml::Nodes::iterator mi = methods.begin(); mi != methods.end(); ++mi) - { - Xml::Node &method = **mi; - Xml::Nodes args = method["arg"]; - Xml::Nodes args_in = args.select("direction","in"); - Xml::Nodes args_out = args.select("direction","out"); - - file << tab << "virtual "; - - if (args_out.size() == 0 || args_out.size() > 1) - { - file << "void "; - } - else if (args_out.size() == 1) - { - file << signature_to_type(args_out.front()->get("type")) << " "; - } - - file << method.get("name") << "("; - - unsigned int i = 0; - for (Xml::Nodes::iterator ai = args_in.begin(); ai != args_in.end(); ++ai, ++i) - { - Xml::Node &arg = **ai; - file << "const " << signature_to_type(arg.get("type")) << "& "; - - string arg_name = arg.get("name"); - if (arg_name.length()) - file << arg_name; - - if ((i+1 != args_in.size() || args_out.size() > 1)) - file << ", "; - } - - if (args_out.size() > 1) - { - unsigned int i = 0; - for (Xml::Nodes::iterator ao = args_out.begin(); ao != args_out.end(); ++ao, ++i) - { - Xml::Node &arg = **ao; - file << signature_to_type(arg.get("type")) << "&"; - - string arg_name = arg.get("name"); - if (arg_name.length()) - file << " " << arg_name; - - if (i+1 != args_out.size()) - file << ", "; - } - } - file << ") = 0;" << endl; - } - - file << endl - << "public:" << endl - << endl - << tab << "/* signal emitters for this interface" << endl - << tab << " */" << endl; - - for (Xml::Nodes::iterator si = signals.begin(); si != signals.end(); ++si) - { - Xml::Node &signal = **si; - Xml::Nodes args = signal["arg"]; - - file << tab << "void " << signal.get("name") << "("; - - unsigned int i = 0; - for (Xml::Nodes::iterator a = args.begin(); a != args.end(); ++a, ++i) - { - Xml::Node &arg = **a; - - file << "const " << signature_to_type(arg.get("type")) << "& arg" << i+1; - - if (i+1 != args.size()) - file << ", "; - } - - file << ")" << endl - << tab << "{" << endl - << tab << tab << "::DBus::SignalMessage sig(\"" << signal.get("name") <<"\");" << endl;; - - - if (args.size() > 0) - { - file << tab << tab << "::DBus::MessageIter wi = sig.writer();" << endl; - - for (unsigned int i = 0; i < args.size(); ++i) - { - file << tab << tab << "wi << arg" << i+1 << ";" << endl; - } - } - - file << tab << tab << "emit_signal(sig);" << endl - << tab << "}" << endl; - } - - file << endl - << "private:" << endl - << endl - << tab << "/* unmarshalers (to unpack the DBus message before calling the actual interface method)" << endl - << tab << " */" << endl; - - for (Xml::Nodes::iterator mi = methods.begin(); mi != methods.end(); ++mi) - { - Xml::Node &method = **mi; - Xml::Nodes args = method["arg"]; - Xml::Nodes args_in = args.select("direction","in"); - Xml::Nodes args_out = args.select("direction","out"); - - file << tab << "::DBus::Message " << stub_name(method.get("name")) << "(const ::DBus::CallMessage &call)" << endl - << tab << "{" << endl - << tab << tab << "::DBus::MessageIter ri = call.reader();" << endl - << endl; - - unsigned int i = 1; - for (Xml::Nodes::iterator ai = args_in.begin(); ai != args_in.end(); ++ai, ++i) - { - Xml::Node &arg = **ai; - file << tab << tab << signature_to_type(arg.get("type")) << " argin" << i << ";" - << " ri >> argin" << i << ";" << endl; - } - - if (args_out.size() == 0) - { - file << tab << tab; - } - else if (args_out.size() == 1) - { - file << tab << tab << signature_to_type(args_out.front()->get("type")) << " argout1 = "; - } - else - { - unsigned int i = 1; - for (Xml::Nodes::iterator ao = args_out.begin(); ao != args_out.end(); ++ao, ++i) - { - Xml::Node &arg = **ao; - file << tab << tab << signature_to_type(arg.get("type")) << " argout" << i << ";" << endl; - } - file << tab << tab; - } - - file << method.get("name") << "("; - - for (unsigned int i = 0; i < args_in.size(); ++i) - { - file << "argin" << i+1; - - if ((i+1 != args_in.size() || args_out.size() > 1)) - file << ", "; - } - - if (args_out.size() > 1) - for (unsigned int i = 0; i < args_out.size(); ++i) - { - file << "argout" << i+1; - - if (i+1 != args_out.size()) - file << ", "; - } - - file << ");" << endl; - - file << tab << tab << "::DBus::ReturnMessage reply(call);" << endl; - - if (args_out.size() > 0) - { - file << tab << tab << "::DBus::MessageIter wi = reply.writer();" << endl; - - for (unsigned int i = 0; i < args_out.size(); ++i) - { - file << tab << tab << "wi << argout" << i+1 << ";" << endl; - } - } - - file << tab << tab << "return reply;" << endl; - - file << tab << "}" << endl; - } - - file << "};" << endl - << endl; - - for (unsigned int i = 0; i < nspaces; ++i) - { - file << "} "; - } - file << endl; - } - - file << "#endif//" << cond_comp << endl; - - file.close(); -} - -int main(int argc, char ** argv) -{ - if (argc < 2) - { - usage(argv[0]); - } - - bool proxy_mode, adaptor_mode; - char *proxy, *adaptor; - - proxy_mode = false; - proxy = 0; + } - adaptor_mode = false; - adaptor = 0; - - for (int a = 1; a < argc; ++a) - { - if (!strncmp(argv[a], "--proxy=", 8)) - { - proxy_mode = true; - proxy = argv[a] +8; - } - else - if (!strncmp(argv[a], "--adaptor=", 10)) - { - adaptor_mode = true; - adaptor = argv[a] +10; - } - } + if (!proxy_mode && !adaptor_mode) usage (argv[0]); - if (!proxy_mode && !adaptor_mode) usage(argv[0]); + ifstream xmlfile (argv[1]); - ifstream xmlfile(argv[1]); + if (xmlfile.bad()) { + cerr << "unable to open file " << argv[1] << endl; + return -1; + } - if (xmlfile.bad()) - { - cerr << "unable to open file " << argv[1] << endl; - return -1; - } + Xml::Document doc; - Xml::Document doc; + try { + xmlfile >> doc; + //cout << doc.to_xml(); + } catch (Xml::Error &e) { + cerr << "error parsing " << argv[1] << ": " << e.what() << endl; + return -1; + } - try - { - xmlfile >> doc; - //cout << doc.to_xml(); - } - catch(Xml::Error &e) - { - cerr << "error parsing " << argv[1] << ": " << e.what() << endl; - return -1; - } + if (!doc.root) { + cerr << "empty document" << endl; + return -1; + } - if (!doc.root) - { - cerr << "empty document" << endl; - return -1; - } + if (proxy_mode) generate_proxy (doc, proxy); - if (proxy_mode) generate_proxy(doc, proxy); - if (adaptor_mode) generate_adaptor(doc, adaptor); + if (adaptor_mode) generate_adaptor (doc, adaptor); - return 0; + return 0; } diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/addr_resolv_symbian.cpp b/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/addr_resolv_symbian.cpp deleted file mode 100644 index e2b10ee541e7d03213e2925d9f368136099fa6ce..0000000000000000000000000000000000000000 --- a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/addr_resolv_symbian.cpp +++ /dev/null @@ -1,193 +0,0 @@ -/* $Id: addr_resolv_symbian.cpp 2394 2008-12-23 17:27:53Z bennylp $ */ -/* - * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) - * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> - * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#include <pj/addr_resolv.h> -#include <pj/assert.h> -#include <pj/errno.h> -#include <pj/ip_helper.h> -#include <pj/log.h> -#include <pj/sock.h> -#include <pj/string.h> -#include <pj/unicode.h> - -#include "os_symbian.h" - -#define THIS_FILE "addr_resolv_symbian.cpp" -#define TRACE_ME 0 - - -// PJLIB API: resolve hostname -PJ_DEF(pj_status_t) pj_gethostbyname(const pj_str_t *name, pj_hostent *he) -{ - static pj_addrinfo ai; - static char *aliases[2]; - static char *addrlist[2]; - unsigned count = 1; - pj_status_t status; - - status = pj_getaddrinfo(PJ_AF_INET, name, &count, &ai); - if (status != PJ_SUCCESS) - return status; - - aliases[0] = ai.ai_canonname; - aliases[1] = NULL; - - addrlist[0] = (char*) &ai.ai_addr.ipv4.sin_addr; - addrlist[1] = NULL; - - pj_bzero(he, sizeof(*he)); - he->h_name = aliases[0]; - he->h_aliases = aliases; - he->h_addrtype = PJ_AF_INET; - he->h_length = 4; - he->h_addr_list = addrlist; - - return PJ_SUCCESS; -} - - -// Resolve for specific address family -static pj_status_t getaddrinfo_by_af(int af, const pj_str_t *name, - unsigned *count, pj_addrinfo ai[]) -{ - unsigned i; - pj_status_t status; - - PJ_ASSERT_RETURN(name && count && ai, PJ_EINVAL); - - // Get resolver for the specified address family - RHostResolver &resv = PjSymbianOS::Instance()->GetResolver(af); - - // Convert name to Unicode - wchar_t name16[PJ_MAX_HOSTNAME]; - pj_ansi_to_unicode(name->ptr, name->slen, name16, PJ_ARRAY_SIZE(name16)); - TPtrC16 data((const TUint16*)name16); - - // Resolve! - TNameEntry nameEntry; - TRequestStatus reqStatus; - - resv.GetByName(data, nameEntry, reqStatus); - User::WaitForRequest(reqStatus); - - // Iterate each result - i = 0; - while (reqStatus == KErrNone && i < *count) { - - // Get the resolved TInetAddr - TInetAddr inetAddr(nameEntry().iAddr); - int addrlen; - -#if TRACE_ME - if (1) { - pj_sockaddr a; - char ipaddr[PJ_INET6_ADDRSTRLEN+2]; - int namelen; - - namelen = sizeof(pj_sockaddr); - if (PjSymbianOS::Addr2pj(inetAddr, a, &namelen, - PJ_FALSE) == PJ_SUCCESS) - { - PJ_LOG(5,(THIS_FILE, "resolve %.*s: %s", - (int)name->slen, name->ptr, - pj_sockaddr_print(&a, ipaddr, sizeof(ipaddr), 2))); - } - } -#endif - - // Ignore if this is not the same address family - // Not a good idea, as Symbian mapps IPv4 to IPv6. - //fam = inetAddr.Family(); - //if (fam != af) { - // resv.Next(nameEntry, reqStatus); - // User::WaitForRequest(reqStatus); - // continue; - //} - - // Convert IP address first to get IPv4 mapped address - addrlen = sizeof(ai[i].ai_addr); - status = PjSymbianOS::Addr2pj(inetAddr, ai[i].ai_addr, - &addrlen, PJ_TRUE); - if (status != PJ_SUCCESS) - return status; - - // Ignore if address family doesn't match - if (ai[i].ai_addr.addr.sa_family != af) { - resv.Next(nameEntry, reqStatus); - User::WaitForRequest(reqStatus); - continue; - } - - // Convert the official address to ANSI. - pj_unicode_to_ansi((const wchar_t*)nameEntry().iName.Ptr(), - nameEntry().iName.Length(), - ai[i].ai_canonname, sizeof(ai[i].ai_canonname)); - - // Next - ++i; - resv.Next(nameEntry, reqStatus); - User::WaitForRequest(reqStatus); - } - - *count = i; - return PJ_SUCCESS; -} - -/* Resolve IPv4/IPv6 address */ -PJ_DEF(pj_status_t) pj_getaddrinfo(int af, const pj_str_t *nodename, - unsigned *count, pj_addrinfo ai[]) -{ - unsigned start; - pj_status_t status; - - PJ_ASSERT_RETURN(af==PJ_AF_INET || af==PJ_AF_INET6 || af==PJ_AF_UNSPEC, - PJ_EAFNOTSUP); - PJ_ASSERT_RETURN(nodename && count && *count && ai, PJ_EINVAL); - - start = 0; - - if (af==PJ_AF_INET6 || af==PJ_AF_UNSPEC) { - unsigned max = *count; - status = getaddrinfo_by_af(PJ_AF_INET6, nodename, - &max, &ai[start]); - if (status == PJ_SUCCESS) { - (*count) -= max; - start += max; - } - } - - if (af==PJ_AF_INET || af==PJ_AF_UNSPEC) { - unsigned max = *count; - status = getaddrinfo_by_af(PJ_AF_INET, nodename, - &max, &ai[start]); - if (status == PJ_SUCCESS) { - (*count) -= max; - start += max; - } - } - - *count = start; - - if (*count) { - return PJ_SUCCESS; - } else { - return status!=PJ_SUCCESS ? status : PJ_ENOTFOUND; - } -} - diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/ioqueue_symbian.cpp b/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/ioqueue_symbian.cpp deleted file mode 100644 index ec8c1fc5bc47794578acea5ffbf2b9d00b8e4f62..0000000000000000000000000000000000000000 --- a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/ioqueue_symbian.cpp +++ /dev/null @@ -1,833 +0,0 @@ -/* $Id: ioqueue_symbian.cpp 2394 2008-12-23 17:27:53Z bennylp $ */ -/* - * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) - * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> - * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#include <pj/ioqueue.h> -#include <pj/assert.h> -#include <pj/errno.h> -#include <pj/list.h> -#include <pj/lock.h> -#include <pj/pool.h> -#include <pj/string.h> - -#include "os_symbian.h" - -class CIoqueueCallback; - -/* - * IO Queue structure. - */ -struct pj_ioqueue_t -{ - int eventCount; -}; - - -///////////////////////////////////////////////////////////////////////////// -// Class to encapsulate asynchronous socket operation. -// -class CIoqueueCallback : public CActive -{ -public: - static CIoqueueCallback* NewL(pj_ioqueue_t *ioqueue, - pj_ioqueue_key_t *key, - pj_sock_t sock, - const pj_ioqueue_callback *cb, - void *user_data); - - // - // Start asynchronous recv() operation - // - pj_status_t StartRead(pj_ioqueue_op_key_t *op_key, - void *buf, pj_ssize_t *size, unsigned flags, - pj_sockaddr_t *addr, int *addrlen); - - // - // Start asynchronous accept() operation. - // - pj_status_t StartAccept(pj_ioqueue_op_key_t *op_key, - pj_sock_t *new_sock, - pj_sockaddr_t *local, - pj_sockaddr_t *remote, - int *addrlen ); - - // - // Completion callback. - // - void RunL(); - - // - // CActive's DoCancel() - // - void DoCancel(); - - // - // Cancel operation and call callback. - // - void CancelOperation(pj_ioqueue_op_key_t *op_key, - pj_ssize_t bytes_status); - - // - // Accessors - // - void* get_user_data() const - { - return user_data_; - } - void set_user_data(void *user_data) - { - user_data_ = user_data; - } - pj_ioqueue_op_key_t *get_op_key() const - { - return pending_data_.common_.op_key_; - } - CPjSocket* get_pj_socket() - { - return sock_; - } - -private: - // Type of pending operation. - enum Type { - TYPE_NONE, - TYPE_READ, - TYPE_ACCEPT, - }; - - // Static data. - pj_ioqueue_t *ioqueue_; - pj_ioqueue_key_t *key_; - CPjSocket *sock_; - pj_ioqueue_callback cb_; - void *user_data_; - - // Symbian data. - TPtr8 aBufferPtr_; - TInetAddr aAddress_; - - // Application data. - Type type_; - - union Pending_Data - { - struct Common - { - pj_ioqueue_op_key_t *op_key_; - } common_; - - struct Pending_Read - { - pj_ioqueue_op_key_t *op_key_; - pj_sockaddr_t *addr_; - int *addrlen_; - } read_; - - struct Pending_Accept - { - pj_ioqueue_op_key_t *op_key_; - pj_sock_t *new_sock_; - pj_sockaddr_t *local_; - pj_sockaddr_t *remote_; - int *addrlen_; - } accept_; - }; - - union Pending_Data pending_data_; - RSocket blank_sock_; - - CIoqueueCallback(pj_ioqueue_t *ioqueue, - pj_ioqueue_key_t *key, pj_sock_t sock, - const pj_ioqueue_callback *cb, void *user_data) - : CActive(CActive::EPriorityStandard), - ioqueue_(ioqueue), key_(key), sock_((CPjSocket*)sock), - user_data_(user_data), aBufferPtr_(NULL, 0), type_(TYPE_NONE) - { - pj_memcpy(&cb_, cb, sizeof(*cb)); - } - - - void ConstructL() - { - CActiveScheduler::Add(this); - } - - void HandleReadCompletion(); - CPjSocket *HandleAcceptCompletion(); -}; - - -CIoqueueCallback* CIoqueueCallback::NewL(pj_ioqueue_t *ioqueue, - pj_ioqueue_key_t *key, - pj_sock_t sock, - const pj_ioqueue_callback *cb, - void *user_data) -{ - CIoqueueCallback *self = new CIoqueueCallback(ioqueue, key, sock, - cb, user_data); - CleanupStack::PushL(self); - self->ConstructL(); - CleanupStack::Pop(self); - - return self; -} - - -// -// Start asynchronous recv() operation -// -pj_status_t CIoqueueCallback::StartRead(pj_ioqueue_op_key_t *op_key, - void *buf, pj_ssize_t *size, - unsigned flags, - pj_sockaddr_t *addr, int *addrlen) -{ - PJ_ASSERT_RETURN(IsActive()==false, PJ_EBUSY); - PJ_ASSERT_RETURN(pending_data_.common_.op_key_==NULL, PJ_EBUSY); - - flags &= ~PJ_IOQUEUE_ALWAYS_ASYNC; - - pending_data_.read_.op_key_ = op_key; - pending_data_.read_.addr_ = addr; - pending_data_.read_.addrlen_ = addrlen; - - aBufferPtr_.Set((TUint8*)buf, 0, (TInt)*size); - - type_ = TYPE_READ; - if (addr && addrlen) { - sock_->Socket().RecvFrom(aBufferPtr_, aAddress_, flags, iStatus); - } else { - aAddress_.SetAddress(0); - aAddress_.SetPort(0); - sock_->Socket().Recv(aBufferPtr_, flags, iStatus); - } - - SetActive(); - return PJ_EPENDING; -} - - -// -// Start asynchronous accept() operation. -// -pj_status_t CIoqueueCallback::StartAccept(pj_ioqueue_op_key_t *op_key, - pj_sock_t *new_sock, - pj_sockaddr_t *local, - pj_sockaddr_t *remote, - int *addrlen ) -{ - PJ_ASSERT_RETURN(IsActive()==false, PJ_EBUSY); - PJ_ASSERT_RETURN(pending_data_.common_.op_key_==NULL, PJ_EBUSY); - - // addrlen must be specified if local or remote is specified - PJ_ASSERT_RETURN((!local && !remote) || - (addrlen && *addrlen), PJ_EINVAL); - - pending_data_.accept_.op_key_ = op_key; - pending_data_.accept_.new_sock_ = new_sock; - pending_data_.accept_.local_ = local; - pending_data_.accept_.remote_ = remote; - pending_data_.accept_.addrlen_ = addrlen; - - // Create blank socket - blank_sock_.Open(PjSymbianOS::Instance()->SocketServ()); - - type_ = TYPE_ACCEPT; - sock_->Socket().Accept(blank_sock_, iStatus); - - SetActive(); - return PJ_EPENDING; -} - - -// -// Handle asynchronous RecvFrom() completion -// -void CIoqueueCallback::HandleReadCompletion() -{ - if (pending_data_.read_.addr_ && pending_data_.read_.addrlen_) { - PjSymbianOS::Addr2pj(aAddress_, - *(pj_sockaddr*)pending_data_.read_.addr_, - pending_data_.read_.addrlen_); - pending_data_.read_.addr_ = NULL; - pending_data_.read_.addrlen_ = NULL; - } - - pending_data_.read_.op_key_ = NULL; -} - - -// -// Handle asynchronous Accept() completion. -// -CPjSocket *CIoqueueCallback::HandleAcceptCompletion() -{ - CPjSocket *pjNewSock = new CPjSocket(get_pj_socket()->GetAf(), - blank_sock_); - int addrlen = 0; - - if (pending_data_.accept_.new_sock_) { - *pending_data_.accept_.new_sock_ = (pj_sock_t)pjNewSock; - pending_data_.accept_.new_sock_ = NULL; - } - - if (pending_data_.accept_.local_) { - TInetAddr aAddr; - pj_sockaddr *ptr_sockaddr; - - blank_sock_.LocalName(aAddr); - ptr_sockaddr = (pj_sockaddr*)pending_data_.accept_.local_; - addrlen = *pending_data_.accept_.addrlen_; - PjSymbianOS::Addr2pj(aAddr, *ptr_sockaddr, &addrlen); - pending_data_.accept_.local_ = NULL; - } - - if (pending_data_.accept_.remote_) { - TInetAddr aAddr; - pj_sockaddr *ptr_sockaddr; - - blank_sock_.RemoteName(aAddr); - ptr_sockaddr = (pj_sockaddr*)pending_data_.accept_.remote_; - addrlen = *pending_data_.accept_.addrlen_; - PjSymbianOS::Addr2pj(aAddr, *ptr_sockaddr, &addrlen); - pending_data_.accept_.remote_ = NULL; - } - - if (pending_data_.accept_.addrlen_) { - if (addrlen == 0) { - if (pjNewSock->GetAf() == PJ_AF_INET) - addrlen = sizeof(pj_sockaddr_in); - else if (pjNewSock->GetAf() == PJ_AF_INET6) - addrlen = sizeof(pj_sockaddr_in6); - else { - pj_assert(!"Unsupported address family"); - } - } - *pending_data_.accept_.addrlen_ = addrlen; - pending_data_.accept_.addrlen_ = NULL; - } - - return pjNewSock; -} - - -// -// Completion callback. -// -void CIoqueueCallback::RunL() -{ - Type cur_type = type_; - - type_ = TYPE_NONE; - - if (cur_type == TYPE_READ) { - // - // Completion of asynchronous RecvFrom() - // - - /* Clear op_key (save it to temp variable first!) */ - pj_ioqueue_op_key_t *op_key = pending_data_.read_.op_key_; - pending_data_.read_.op_key_ = NULL; - - // Handle failure condition - if (iStatus != KErrNone) { - if (cb_.on_read_complete) { - cb_.on_read_complete( key_, op_key, - -PJ_RETURN_OS_ERROR(iStatus.Int())); - } - return; - } - - HandleReadCompletion(); - - /* Call callback */ - if (cb_.on_read_complete) { - cb_.on_read_complete(key_, op_key, aBufferPtr_.Length()); - } - - } else if (cur_type == TYPE_ACCEPT) { - // - // Completion of asynchronous Accept() - // - - /* Clear op_key (save it to temp variable first!) */ - pj_ioqueue_op_key_t *op_key = pending_data_.read_.op_key_; - pending_data_.read_.op_key_ = NULL; - - // Handle failure condition - if (iStatus != KErrNone) { - if (pending_data_.accept_.new_sock_) - *pending_data_.accept_.new_sock_ = PJ_INVALID_SOCKET; - - if (cb_.on_accept_complete) { - cb_.on_accept_complete( key_, op_key, PJ_INVALID_SOCKET, - -PJ_RETURN_OS_ERROR(iStatus.Int())); - } - return; - } - - CPjSocket *pjNewSock = HandleAcceptCompletion(); - - // Call callback. - if (cb_.on_accept_complete) { - cb_.on_accept_complete( key_, op_key, (pj_sock_t)pjNewSock, - PJ_SUCCESS); - } - } - - ioqueue_->eventCount++; -} - -// -// CActive's DoCancel() -// -void CIoqueueCallback::DoCancel() -{ - if (type_ == TYPE_READ) - sock_->Socket().CancelRecv(); - else if (type_ == TYPE_ACCEPT) - sock_->Socket().CancelAccept(); - - type_ = TYPE_NONE; - pending_data_.common_.op_key_ = NULL; -} - -// -// Cancel operation and call callback. -// -void CIoqueueCallback::CancelOperation(pj_ioqueue_op_key_t *op_key, - pj_ssize_t bytes_status) -{ - Type cur_type = type_; - - pj_assert(op_key == pending_data_.common_.op_key_); - - Cancel(); - - if (cur_type == TYPE_READ) { - if (cb_.on_read_complete) - cb_.on_read_complete(key_, op_key, bytes_status); - } else if (cur_type == TYPE_ACCEPT) - ; -} - - -///////////////////////////////////////////////////////////////////////////// -/* - * IO Queue key structure. - */ -struct pj_ioqueue_key_t -{ - CIoqueueCallback *cbObj; -}; - - -/* - * Return the name of the ioqueue implementation. - */ -PJ_DEF(const char*) pj_ioqueue_name(void) -{ - return "ioqueue-symbian"; -} - - -/* - * Create a new I/O Queue framework. - */ -PJ_DEF(pj_status_t) pj_ioqueue_create( pj_pool_t *pool, - pj_size_t max_fd, - pj_ioqueue_t **p_ioqueue) -{ - pj_ioqueue_t *ioq; - - PJ_UNUSED_ARG(max_fd); - - ioq = PJ_POOL_ZALLOC_T(pool, pj_ioqueue_t); - *p_ioqueue = ioq; - return PJ_SUCCESS; -} - - -/* - * Destroy the I/O queue. - */ -PJ_DEF(pj_status_t) pj_ioqueue_destroy( pj_ioqueue_t *ioq ) -{ - PJ_UNUSED_ARG(ioq); - return PJ_SUCCESS; -} - - -/* - * Set the lock object to be used by the I/O Queue. - */ -PJ_DEF(pj_status_t) pj_ioqueue_set_lock( pj_ioqueue_t *ioq, - pj_lock_t *lock, - pj_bool_t auto_delete ) -{ - /* Don't really need lock for now */ - PJ_UNUSED_ARG(ioq); - - if (auto_delete) { - pj_lock_destroy(lock); - } - - return PJ_SUCCESS; -} - -PJ_DEF(pj_status_t) pj_ioqueue_set_default_concurrency(pj_ioqueue_t *ioqueue, - pj_bool_t allow) -{ - /* Not supported, just return PJ_SUCCESS silently */ - PJ_UNUSED_ARG(ioqueue); - PJ_UNUSED_ARG(allow); - return PJ_SUCCESS; -} - -/* - * Register a socket to the I/O queue framework. - */ -PJ_DEF(pj_status_t) pj_ioqueue_register_sock( pj_pool_t *pool, - pj_ioqueue_t *ioq, - pj_sock_t sock, - void *user_data, - const pj_ioqueue_callback *cb, - pj_ioqueue_key_t **p_key ) -{ - pj_ioqueue_key_t *key; - - key = PJ_POOL_ZALLOC_T(pool, pj_ioqueue_key_t); - key->cbObj = CIoqueueCallback::NewL(ioq, key, sock, cb, user_data); - - *p_key = key; - return PJ_SUCCESS; -} - -/* - * Unregister from the I/O Queue framework. - */ -PJ_DEF(pj_status_t) pj_ioqueue_unregister( pj_ioqueue_key_t *key ) -{ - if (key == NULL || key->cbObj == NULL) - return PJ_SUCCESS; - - // Cancel pending async object - if (key->cbObj) { - key->cbObj->Cancel(); - } - - // Close socket. - key->cbObj->get_pj_socket()->Socket().Close(); - delete key->cbObj->get_pj_socket(); - - // Delete async object. - if (key->cbObj) { - delete key->cbObj; - key->cbObj = NULL; - } - - return PJ_SUCCESS; -} - - -/* - * Get user data associated with an ioqueue key. - */ -PJ_DEF(void*) pj_ioqueue_get_user_data( pj_ioqueue_key_t *key ) -{ - return key->cbObj->get_user_data(); -} - - -/* - * Set or change the user data to be associated with the file descriptor or - * handle or socket descriptor. - */ -PJ_DEF(pj_status_t) pj_ioqueue_set_user_data( pj_ioqueue_key_t *key, - void *user_data, - void **old_data) -{ - if (old_data) - *old_data = key->cbObj->get_user_data(); - key->cbObj->set_user_data(user_data); - - return PJ_SUCCESS; -} - - -/* - * Initialize operation key. - */ -PJ_DEF(void) pj_ioqueue_op_key_init( pj_ioqueue_op_key_t *op_key, - pj_size_t size ) -{ - pj_bzero(op_key, size); -} - - -/* - * Check if operation is pending on the specified operation key. - */ -PJ_DEF(pj_bool_t) pj_ioqueue_is_pending( pj_ioqueue_key_t *key, - pj_ioqueue_op_key_t *op_key ) -{ - return key->cbObj->get_op_key()==op_key && - key->cbObj->IsActive(); -} - - -/* - * Post completion status to the specified operation key and call the - * appropriate callback. - */ -PJ_DEF(pj_status_t) pj_ioqueue_post_completion( pj_ioqueue_key_t *key, - pj_ioqueue_op_key_t *op_key, - pj_ssize_t bytes_status ) -{ - if (pj_ioqueue_is_pending(key, op_key)) { - key->cbObj->CancelOperation(op_key, bytes_status); - } - return PJ_SUCCESS; -} - - -#if defined(PJ_HAS_TCP) && PJ_HAS_TCP != 0 -/** - * Instruct I/O Queue to accept incoming connection on the specified - * listening socket. - */ -PJ_DEF(pj_status_t) pj_ioqueue_accept( pj_ioqueue_key_t *key, - pj_ioqueue_op_key_t *op_key, - pj_sock_t *new_sock, - pj_sockaddr_t *local, - pj_sockaddr_t *remote, - int *addrlen ) -{ - - return key->cbObj->StartAccept(op_key, new_sock, local, remote, addrlen); -} - - -/* - * Initiate non-blocking socket connect. - */ -PJ_DEF(pj_status_t) pj_ioqueue_connect( pj_ioqueue_key_t *key, - const pj_sockaddr_t *addr, - int addrlen ) -{ - pj_status_t status; - - RSocket &rSock = key->cbObj->get_pj_socket()->Socket(); - TInetAddr inetAddr; - TRequestStatus reqStatus; - - // Convert address - status = PjSymbianOS::pj2Addr(*(const pj_sockaddr*)addr, addrlen, - inetAddr); - if (status != PJ_SUCCESS) - return status; - - // We don't support async connect for now. - PJ_TODO(IOQUEUE_SUPPORT_ASYNC_CONNECT); - - rSock.Connect(inetAddr, reqStatus); - User::WaitForRequest(reqStatus); - - if (reqStatus == KErrNone) - return PJ_SUCCESS; - - return PJ_RETURN_OS_ERROR(reqStatus.Int()); -} - - -#endif /* PJ_HAS_TCP */ - -/* - * Poll the I/O Queue for completed events. - */ -PJ_DEF(int) pj_ioqueue_poll( pj_ioqueue_t *ioq, - const pj_time_val *timeout) -{ - /* Polling is not necessary on Symbian, since all async activities - * are registered to active scheduler. - */ - PJ_UNUSED_ARG(ioq); - PJ_UNUSED_ARG(timeout); - return 0; -} - - -/* - * Instruct the I/O Queue to read from the specified handle. - */ -PJ_DEF(pj_status_t) pj_ioqueue_recv( pj_ioqueue_key_t *key, - pj_ioqueue_op_key_t *op_key, - void *buffer, - pj_ssize_t *length, - pj_uint32_t flags ) -{ - // If socket has reader, delete it. - if (key->cbObj->get_pj_socket()->Reader()) - key->cbObj->get_pj_socket()->DestroyReader(); - - // Clear flag - flags &= ~PJ_IOQUEUE_ALWAYS_ASYNC; - return key->cbObj->StartRead(op_key, buffer, length, flags, NULL, NULL); -} - - -/* - * This function behaves similarly as #pj_ioqueue_recv(), except that it is - * normally called for socket, and the remote address will also be returned - * along with the data. - */ -PJ_DEF(pj_status_t) pj_ioqueue_recvfrom( pj_ioqueue_key_t *key, - pj_ioqueue_op_key_t *op_key, - void *buffer, - pj_ssize_t *length, - pj_uint32_t flags, - pj_sockaddr_t *addr, - int *addrlen) -{ - CPjSocket *sock = key->cbObj->get_pj_socket(); - - // If address is specified, check that the length match the - // address family - if (addr || addrlen) { - PJ_ASSERT_RETURN(addr && addrlen && *addrlen, PJ_EINVAL); - if (sock->GetAf() == PJ_AF_INET) { - PJ_ASSERT_RETURN(*addrlen>=(int)sizeof(pj_sockaddr_in), PJ_EINVAL); - } else if (sock->GetAf() == PJ_AF_INET6) { - PJ_ASSERT_RETURN(*addrlen>=(int)sizeof(pj_sockaddr_in6), PJ_EINVAL); - } - } - - // If socket has reader, delete it. - if (sock->Reader()) - sock->DestroyReader(); - - if (key->cbObj->IsActive()) - return PJ_EBUSY; - - // Clear flag - flags &= ~PJ_IOQUEUE_ALWAYS_ASYNC; - return key->cbObj->StartRead(op_key, buffer, length, flags, addr, addrlen); -} - - -/* - * Instruct the I/O Queue to write to the handle. - */ -PJ_DEF(pj_status_t) pj_ioqueue_send( pj_ioqueue_key_t *key, - pj_ioqueue_op_key_t *op_key, - const void *data, - pj_ssize_t *length, - pj_uint32_t flags ) -{ - TRequestStatus reqStatus; - TPtrC8 aBuffer((const TUint8*)data, (TInt)*length); - TSockXfrLength aLen; - - PJ_UNUSED_ARG(op_key); - - // Forcing pending operation is not supported. - PJ_ASSERT_RETURN((flags & PJ_IOQUEUE_ALWAYS_ASYNC)==0, PJ_EINVAL); - - // Clear flag - flags &= ~PJ_IOQUEUE_ALWAYS_ASYNC; - - key->cbObj->get_pj_socket()->Socket().Send(aBuffer, flags, reqStatus, aLen); - User::WaitForRequest(reqStatus); - - if (reqStatus.Int() != KErrNone) - return PJ_RETURN_OS_ERROR(reqStatus.Int()); - - //At least in UIQ Emulator, aLen.Length() reports incorrect length - //for UDP (some newlc.com users seem to have reported this too). - //*length = aLen.Length(); - return PJ_SUCCESS; -} - - -/* - * Instruct the I/O Queue to write to the handle. - */ -PJ_DEF(pj_status_t) pj_ioqueue_sendto( pj_ioqueue_key_t *key, - pj_ioqueue_op_key_t *op_key, - const void *data, - pj_ssize_t *length, - pj_uint32_t flags, - const pj_sockaddr_t *addr, - int addrlen) -{ - TRequestStatus reqStatus; - TPtrC8 aBuffer; - TInetAddr inetAddr; - TSockXfrLength aLen; - pj_status_t status; - - PJ_UNUSED_ARG(op_key); - - // Forcing pending operation is not supported. - PJ_ASSERT_RETURN((flags & PJ_IOQUEUE_ALWAYS_ASYNC)==0, PJ_EINVAL); - - // Convert address - status = PjSymbianOS::pj2Addr(*(const pj_sockaddr*)addr, addrlen, - inetAddr); - if (status != PJ_SUCCESS) - return status; - - // Clear flag - flags &= ~PJ_IOQUEUE_ALWAYS_ASYNC; - - aBuffer.Set((const TUint8*)data, (TInt)*length); - CPjSocket *pjSock = key->cbObj->get_pj_socket(); - - pjSock->Socket().SendTo(aBuffer, inetAddr, flags, reqStatus, aLen); - User::WaitForRequest(reqStatus); - - if (reqStatus.Int() != KErrNone) - return PJ_RETURN_OS_ERROR(reqStatus.Int()); - - //At least in UIQ Emulator, aLen.Length() reports incorrect length - //for UDP (some newlc.com users seem to have reported this too). - //*length = aLen.Length(); - return PJ_SUCCESS; -} - -PJ_DEF(pj_status_t) pj_ioqueue_set_concurrency(pj_ioqueue_key_t *key, - pj_bool_t allow) -{ - /* Not supported, just return PJ_SUCCESS silently */ - PJ_UNUSED_ARG(key); - PJ_UNUSED_ARG(allow); - return PJ_SUCCESS; -} - -PJ_DEF(pj_status_t) pj_ioqueue_lock_key(pj_ioqueue_key_t *key) -{ - /* Not supported, just return PJ_SUCCESS silently */ - PJ_UNUSED_ARG(key); - return PJ_SUCCESS; -} - -PJ_DEF(pj_status_t) pj_ioqueue_unlock_key(pj_ioqueue_key_t *key) -{ - /* Not supported, just return PJ_SUCCESS silently */ - PJ_UNUSED_ARG(key); - return PJ_SUCCESS; -} diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/ip_helper_symbian.cpp b/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/ip_helper_symbian.cpp deleted file mode 100644 index 9f634a0b8b152df42b2736a63ca1a612d8028edb..0000000000000000000000000000000000000000 --- a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/ip_helper_symbian.cpp +++ /dev/null @@ -1,150 +0,0 @@ -/* $Id: ip_helper_symbian.cpp 2394 2008-12-23 17:27:53Z bennylp $ */ -/* - * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) - * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> - * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#include <pj/ip_helper.h> -#include <pj/addr_resolv.h> -#include <pj/assert.h> -#include <pj/errno.h> -#include <pj/log.h> -#include <pj/string.h> -#include <pj/compat/socket.h> - - -#include "os_symbian.h" - -#define THIS_FILE "ip_helper_symbian.cpp" -#define TRACE_ME 0 - -static pj_status_t rsock_enum_interface(int af, - unsigned *p_cnt, - pj_sockaddr ifs[]) -{ - TInt rc; - RSocket rSock; - TPckgBuf<TSoInetInterfaceInfo> info; - unsigned i; - - if (PjSymbianOS::Instance()->Connection()) { - - rc = rSock.Open(PjSymbianOS::Instance()->SocketServ(), - af, PJ_SOCK_DGRAM, KProtocolInetUdp, - *PjSymbianOS::Instance()->Connection()); - } else { - - rc = rSock.Open(PjSymbianOS::Instance()->SocketServ(), - af, PJ_SOCK_DGRAM, KProtocolInetUdp); - - } - - if (rc != KErrNone) - return PJ_RETURN_OS_ERROR(rc); - - rSock.SetOpt(KSoInetEnumInterfaces, KSolInetIfCtrl); - - for (i=0; i<*p_cnt && - rSock.GetOpt(KSoInetNextInterface, KSolInetIfCtrl, - info) == KErrNone; ) - { - TInetAddr &iAddress = info().iAddress; - int namelen; - -#if TRACE_ME - if (1) { - pj_sockaddr a; - char ipaddr[PJ_INET6_ADDRSTRLEN+2]; - - namelen = sizeof(pj_sockaddr); - if (PjSymbianOS::Addr2pj(iAddress, a, &namelen, - PJ_FALSE) == PJ_SUCCESS) - { - PJ_LOG(5,(THIS_FILE, "Enum: found address %s", - pj_sockaddr_print(&a, ipaddr, sizeof(ipaddr), 2))); - } - } -#endif - - namelen = sizeof(ifs[i]); - if (PjSymbianOS::Addr2pj(iAddress, ifs[i], &namelen, - PJ_TRUE) != PJ_SUCCESS) - { - continue; - } - - if (ifs[i].addr.sa_family != af) - continue; - - ++i; - } - - rSock.Close(); - - // Done - *p_cnt = i; - - return PJ_SUCCESS; -} - -/* - * Enumerate the local IP interface currently active in the host. - */ -PJ_DEF(pj_status_t) pj_enum_ip_interface(int af, - unsigned *p_cnt, - pj_sockaddr ifs[]) -{ - unsigned start; - pj_status_t status = PJ_SUCCESS; - - start = 0; - - /* Get IPv6 interface first. */ - if (af==PJ_AF_INET6 || af==PJ_AF_UNSPEC) { - unsigned max = *p_cnt; - status = rsock_enum_interface(PJ_AF_INET6, &max, &ifs[start]); - if (status == PJ_SUCCESS) { - (*p_cnt) -= max; - start += max; - } - } - - /* Get IPv4 interface. */ - if (af==PJ_AF_INET || af==PJ_AF_UNSPEC) { - unsigned max = *p_cnt; - status = rsock_enum_interface(PJ_AF_INET, &max, &ifs[start]); - if (status == PJ_SUCCESS) { - (*p_cnt) -= max; - start += max; - } - } - - *p_cnt = start; - - return start ? PJ_SUCCESS : PJ_ENOTFOUND; -} - -/* - * Enumerate the IP routing table for this host. - */ -PJ_DEF(pj_status_t) pj_enum_ip_route(unsigned *p_cnt, - pj_ip_route_entry routes[]) -{ - PJ_ASSERT_RETURN(p_cnt && *p_cnt > 0 && routes, PJ_EINVAL); - *p_cnt = 0; - return PJ_ENOTSUP; -} - diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/os_core_symbian.cpp b/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/os_core_symbian.cpp deleted file mode 100644 index f9037498965c761ba4f6e0c564357e55d56c552b..0000000000000000000000000000000000000000 --- a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/os_core_symbian.cpp +++ /dev/null @@ -1,1015 +0,0 @@ -/* $Id: os_core_symbian.cpp 2394 2008-12-23 17:27:53Z bennylp $ */ -/* - * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) - * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> - * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include <pj/os.h> -#include <pj/assert.h> -#include <pj/pool.h> -#include <pj/log.h> -#include <pj/rand.h> -#include <pj/string.h> -#include <pj/guid.h> -#include <pj/except.h> -#include <pj/errno.h> - -#include "os_symbian.h" - - -#define PJ_MAX_TLS 32 -#define DUMMY_MUTEX ((pj_mutex_t*)101) -#define DUMMY_SEMAPHORE ((pj_sem_t*)102) -#define THIS_FILE "os_core_symbian.c" - -/* - * Note: - * - * The Symbian implementation does not support threading! - */ - -struct pj_thread_t -{ - char obj_name[PJ_MAX_OBJ_NAME]; - void *tls_values[PJ_MAX_TLS]; - -#if defined(PJ_OS_HAS_CHECK_STACK) && PJ_OS_HAS_CHECK_STACK!=0 - pj_uint32_t stk_size; - pj_uint32_t stk_max_usage; - char *stk_start; - const char *caller_file; - int caller_line; -#endif - -} main_thread; - -struct pj_atomic_t -{ - pj_atomic_value_t value; -}; - -struct pj_sem_t -{ - int value; - int max; -}; - -/* Flags to indicate which TLS variables have been used */ -static int tls_vars[PJ_MAX_TLS]; - -/* atexit handlers */ -static unsigned atexit_count; -static void (*atexit_func[32])(void); - - - - -///////////////////////////////////////////////////////////////////////////// -// -// CPjTimeoutTimer implementation -// - -CPjTimeoutTimer::CPjTimeoutTimer() -: CActive(PJ_SYMBIAN_TIMER_PRIORITY), hasTimedOut_(PJ_FALSE) -{ -} - -CPjTimeoutTimer::~CPjTimeoutTimer() -{ - Cancel(); - timer_.Close(); -} - -void CPjTimeoutTimer::ConstructL() -{ - hasTimedOut_ = PJ_FALSE; - timer_.CreateLocal(); - CActiveScheduler::Add(this); -} - -CPjTimeoutTimer *CPjTimeoutTimer::NewL() -{ - CPjTimeoutTimer *self = new CPjTimeoutTimer; - CleanupStack::PushL(self); - - self->ConstructL(); - - CleanupStack::Pop(self); - return self; - -} - -void CPjTimeoutTimer::StartTimer(TUint miliSeconds) -{ - Cancel(); - - hasTimedOut_ = PJ_FALSE; - timer_.After(iStatus, miliSeconds * 1000); - SetActive(); -} - -bool CPjTimeoutTimer::HasTimedOut() const -{ - return hasTimedOut_ != 0; -} - -void CPjTimeoutTimer::RunL() -{ - hasTimedOut_ = PJ_TRUE; -} - -void CPjTimeoutTimer::DoCancel() -{ - timer_.Cancel(); -} - -TInt CPjTimeoutTimer::RunError(TInt aError) -{ - PJ_UNUSED_ARG(aError); - return KErrNone; -} - - - -///////////////////////////////////////////////////////////////////////////// -// -// PjSymbianOS implementation -// - -PjSymbianOS::PjSymbianOS() -: isSocketServInitialized_(false), isResolverInitialized_(false), - console_(NULL), selectTimeoutTimer_(NULL), - appSocketServ_(NULL), appConnection_(NULL), appHostResolver_(NULL), - appHostResolver6_(NULL) -{ -} - -// Set parameters -void PjSymbianOS::SetParameters(pj_symbianos_params *params) -{ - appSocketServ_ = (RSocketServ*) params->rsocketserv; - appConnection_ = (RConnection*) params->rconnection; - appHostResolver_ = (RHostResolver*) params->rhostresolver; - appHostResolver6_ = (RHostResolver*) params->rhostresolver6; -} - -// Get PjSymbianOS instance -PjSymbianOS *PjSymbianOS::Instance() -{ - static PjSymbianOS instance_; - return &instance_; -} - - -// Initialize -TInt PjSymbianOS::Initialize() -{ - TInt err; - - selectTimeoutTimer_ = CPjTimeoutTimer::NewL(); - -#if 0 - pj_assert(console_ == NULL); - TRAPD(err, console_ = Console::NewL(_L("PJLIB"), - TSize(KConsFullScreen,KConsFullScreen))); - return err; -#endif - - /* Only create RSocketServ if application doesn't specify it - * in the parameters - */ - if (!isSocketServInitialized_ && appSocketServ_ == NULL) { - err = socketServ_.Connect(); - if (err != KErrNone) - goto on_error; - - isSocketServInitialized_ = true; - } - - if (!isResolverInitialized_) { - if (appHostResolver_ == NULL) { - if (Connection()) - err = hostResolver_.Open(SocketServ(), KAfInet, KSockStream, - *Connection()); - else - err = hostResolver_.Open(SocketServ(), KAfInet, KSockStream); - - if (err != KErrNone) - goto on_error; - } - -#if defined(PJ_HAS_IPV6) && PJ_HAS_IPV6!=0 - if (appHostResolver6_ == NULL) { - if (Connection()) - err = hostResolver6_.Open(SocketServ(), KAfInet6, KSockStream, - *Connection()); - else - err = hostResolver6_.Open(SocketServ(), KAfInet6, KSockStream); - - if (err != KErrNone) - goto on_error; - } -#endif - - - isResolverInitialized_ = true; - } - - return KErrNone; - -on_error: - Shutdown(); - return err; -} - -// Shutdown -void PjSymbianOS::Shutdown() -{ - if (isResolverInitialized_) { - hostResolver_.Close(); -#if defined(PJ_HAS_IPV6) && PJ_HAS_IPV6!=0 - hostResolver6_.Close(); -#endif - isResolverInitialized_ = false; - } - - if (isSocketServInitialized_) { - socketServ_.Close(); - isSocketServInitialized_ = false; - } - - if (console_) { - delete console_; - console_ = NULL; - } - - if (selectTimeoutTimer_) { - delete selectTimeoutTimer_; - selectTimeoutTimer_ = NULL; - } -} - -// Convert to Unicode -TInt PjSymbianOS::ConvertToUnicode(TDes16 &aUnicode, const TDesC8 &aForeign) -{ -#if 0 - pj_assert(conv_ != NULL); - return conv_->ConvertToUnicode(aUnicode, aForeign, convToUnicodeState_); -#else - return CnvUtfConverter::ConvertToUnicodeFromUtf8(aUnicode, aForeign); -#endif -} - -// Convert from Unicode -TInt PjSymbianOS::ConvertFromUnicode(TDes8 &aForeign, const TDesC16 &aUnicode) -{ -#if 0 - pj_assert(conv_ != NULL); - return conv_->ConvertFromUnicode(aForeign, aUnicode, convToAnsiState_); -#else - return CnvUtfConverter::ConvertFromUnicodeToUtf8(aForeign, aUnicode); -#endif -} - - -///////////////////////////////////////////////////////////////////////////// -// -// PJLIB os.h implementation -// - -PJ_DEF(pj_uint32_t) pj_getpid(void) -{ - return 0; -} - - -/* Set Symbian specific parameters */ -PJ_DEF(pj_status_t) pj_symbianos_set_params(pj_symbianos_params *prm) -{ - PJ_ASSERT_RETURN(prm != NULL, PJ_EINVAL); - PjSymbianOS::Instance()->SetParameters(prm); - return PJ_SUCCESS; -} - - -/* - * pj_init(void). - * Init PJLIB! - */ -PJ_DEF(pj_status_t) pj_init(void) -{ - char stack_ptr; - pj_status_t status; - - pj_ansi_strcpy(main_thread.obj_name, "pjthread"); - - // Init main thread - pj_memset(&main_thread, 0, sizeof(main_thread)); - - // Initialize PjSymbianOS instance - PjSymbianOS *os = PjSymbianOS::Instance(); - - PJ_LOG(4,(THIS_FILE, "Initializing PJLIB for Symbian OS..")); - - TInt err; - err = os->Initialize(); - if (err != KErrNone) - return PJ_RETURN_OS_ERROR(err); - - /* Initialize exception ID for the pool. - * Must do so after critical section is configured. - */ - status = pj_exception_id_alloc("PJLIB/No memory", &PJ_NO_MEMORY_EXCEPTION); - if (status != PJ_SUCCESS) - goto on_error; - -#if defined(PJ_OS_HAS_CHECK_STACK) && PJ_OS_HAS_CHECK_STACK!=0 - main_thread.stk_start = &stack_ptr; - main_thread.stk_size = 0xFFFFFFFFUL; - main_thread.stk_max_usage = 0; -#else - stack_ptr = '\0'; -#endif - - PJ_LOG(5,(THIS_FILE, "PJLIB initialized.")); - return PJ_SUCCESS; - -on_error: - pj_shutdown(); - return PJ_RETURN_OS_ERROR(err); -} - - -PJ_DEF(pj_status_t) pj_atexit(pj_exit_callback func) -{ - if (atexit_count >= PJ_ARRAY_SIZE(atexit_func)) - return PJ_ETOOMANY; - - atexit_func[atexit_count++] = func; - return PJ_SUCCESS; -} - - - -PJ_DEF(void) pj_shutdown(void) -{ - /* Call atexit() functions */ - while (atexit_count > 0) { - (*atexit_func[atexit_count-1])(); - --atexit_count; - } - - /* Free exception ID */ - if (PJ_NO_MEMORY_EXCEPTION != -1) { - pj_exception_id_free(PJ_NO_MEMORY_EXCEPTION); - PJ_NO_MEMORY_EXCEPTION = -1; - } - - /* Clear static variables */ - pj_errno_clear_handlers(); - - PjSymbianOS *os = PjSymbianOS::Instance(); - os->Shutdown(); -} - -///////////////////////////////////////////////////////////////////////////// - -class CPollTimeoutTimer : public CActive -{ -public: - static CPollTimeoutTimer* NewL(int msec, TInt prio); - ~CPollTimeoutTimer(); - - virtual void RunL(); - virtual void DoCancel(); - -private: - RTimer rtimer_; - - explicit CPollTimeoutTimer(TInt prio); - void ConstructL(int msec); -}; - -CPollTimeoutTimer::CPollTimeoutTimer(TInt prio) -: CActive(prio) -{ -} - - -CPollTimeoutTimer::~CPollTimeoutTimer() -{ - rtimer_.Close(); -} - -void CPollTimeoutTimer::ConstructL(int msec) -{ - rtimer_.CreateLocal(); - CActiveScheduler::Add(this); - rtimer_.After(iStatus, msec*1000); - SetActive(); -} - -CPollTimeoutTimer* CPollTimeoutTimer::NewL(int msec, TInt prio) -{ - CPollTimeoutTimer *self = new CPollTimeoutTimer(prio); - CleanupStack::PushL(self); - self->ConstructL(msec); - CleanupStack::Pop(self); - - return self; -} - -void CPollTimeoutTimer::RunL() -{ -} - -void CPollTimeoutTimer::DoCancel() -{ - rtimer_.Cancel(); -} - - -/* - * Wait the completion of any Symbian active objects. - */ -PJ_DEF(pj_bool_t) pj_symbianos_poll(int priority, int ms_timeout) -{ - CPollTimeoutTimer *timer = NULL; - - if (priority==-1) - priority = EPriorityNull; - - if (ms_timeout >= 0) { - timer = CPollTimeoutTimer::NewL(ms_timeout, priority); - } - - PjSymbianOS::Instance()->WaitForActiveObjects(priority); - - if (timer) { - bool timer_is_active = timer->IsActive(); - - timer->Cancel(); - - delete timer; - - return timer_is_active ? PJ_TRUE : PJ_FALSE; - - } else { - return PJ_TRUE; - } -} - - -/* - * pj_thread_is_registered() - */ -PJ_DEF(pj_bool_t) pj_thread_is_registered(void) -{ - return PJ_FALSE; -} - - -/* - * Get thread priority value for the thread. - */ -PJ_DEF(int) pj_thread_get_prio(pj_thread_t *thread) -{ - PJ_UNUSED_ARG(thread); - return 1; -} - - -/* - * Set the thread priority. - */ -PJ_DEF(pj_status_t) pj_thread_set_prio(pj_thread_t *thread, int prio) -{ - PJ_UNUSED_ARG(thread); - PJ_UNUSED_ARG(prio); - return PJ_SUCCESS; -} - - -/* - * Get the lowest priority value available on this system. - */ -PJ_DEF(int) pj_thread_get_prio_min(pj_thread_t *thread) -{ - PJ_UNUSED_ARG(thread); - return 1; -} - - -/* - * Get the highest priority value available on this system. - */ -PJ_DEF(int) pj_thread_get_prio_max(pj_thread_t *thread) -{ - PJ_UNUSED_ARG(thread); - return 1; -} - - -/* - * pj_thread_get_os_handle() - */ -PJ_DEF(void*) pj_thread_get_os_handle(pj_thread_t *thread) -{ - PJ_UNUSED_ARG(thread); - return NULL; -} - -/* - * pj_thread_register(..) - */ -PJ_DEF(pj_status_t) pj_thread_register ( const char *cstr_thread_name, - pj_thread_desc desc, - pj_thread_t **thread_ptr) -{ - PJ_UNUSED_ARG(cstr_thread_name); - PJ_UNUSED_ARG(desc); - PJ_UNUSED_ARG(thread_ptr); - return PJ_EINVALIDOP; -} - - -/* - * pj_thread_create(...) - */ -PJ_DEF(pj_status_t) pj_thread_create( pj_pool_t *pool, - const char *thread_name, - pj_thread_proc *proc, - void *arg, - pj_size_t stack_size, - unsigned flags, - pj_thread_t **ptr_thread) -{ - PJ_UNUSED_ARG(pool); - PJ_UNUSED_ARG(thread_name); - PJ_UNUSED_ARG(proc); - PJ_UNUSED_ARG(arg); - PJ_UNUSED_ARG(stack_size); - PJ_UNUSED_ARG(flags); - PJ_UNUSED_ARG(ptr_thread); - - /* Sorry mate, we don't support threading */ - return PJ_ENOTSUP; -} - -/* - * pj_thread-get_name() - */ -PJ_DEF(const char*) pj_thread_get_name(pj_thread_t *p) -{ - pj_assert(p == &main_thread); - return p->obj_name; -} - -/* - * pj_thread_resume() - */ -PJ_DEF(pj_status_t) pj_thread_resume(pj_thread_t *p) -{ - PJ_UNUSED_ARG(p); - return PJ_EINVALIDOP; -} - -/* - * pj_thread_this() - */ -PJ_DEF(pj_thread_t*) pj_thread_this(void) -{ - return &main_thread; -} - -/* - * pj_thread_join() - */ -PJ_DEF(pj_status_t) pj_thread_join(pj_thread_t *rec) -{ - PJ_UNUSED_ARG(rec); - return PJ_EINVALIDOP; -} - -/* - * pj_thread_destroy() - */ -PJ_DEF(pj_status_t) pj_thread_destroy(pj_thread_t *rec) -{ - PJ_UNUSED_ARG(rec); - return PJ_EINVALIDOP; -} - -/* - * pj_thread_sleep() - */ -PJ_DEF(pj_status_t) pj_thread_sleep(unsigned msec) -{ - User::After(msec*1000); - - return PJ_SUCCESS; -} - - -/////////////////////////////////////////////////////////////////////////////// -/* - * pj_thread_local_alloc() - */ - -PJ_DEF(pj_status_t) pj_thread_local_alloc(long *index) -{ - unsigned i; - - /* Find unused TLS variable */ - for (i=0; i<PJ_ARRAY_SIZE(tls_vars); ++i) { - if (tls_vars[i] == 0) - break; - } - - if (i == PJ_ARRAY_SIZE(tls_vars)) - return PJ_ETOOMANY; - - tls_vars[i] = 1; - *index = i; - - return PJ_SUCCESS; -} - -/* - * pj_thread_local_free() - */ -PJ_DEF(void) pj_thread_local_free(long index) -{ - PJ_ASSERT_ON_FAIL(index >= 0 && index < (int)PJ_ARRAY_SIZE(tls_vars) && - tls_vars[index] != 0, return); - - tls_vars[index] = 0; -} - - -/* - * pj_thread_local_set() - */ -PJ_DEF(pj_status_t) pj_thread_local_set(long index, void *value) -{ - pj_thread_t *rec = pj_thread_this(); - - PJ_ASSERT_RETURN(index >= 0 && index < (int)PJ_ARRAY_SIZE(tls_vars) && - tls_vars[index] != 0, PJ_EINVAL); - - rec->tls_values[index] = value; - return PJ_SUCCESS; -} - -/* - * pj_thread_local_get() - */ -PJ_DEF(void*) pj_thread_local_get(long index) -{ - pj_thread_t *rec = pj_thread_this(); - - PJ_ASSERT_RETURN(index >= 0 && index < (int)PJ_ARRAY_SIZE(tls_vars) && - tls_vars[index] != 0, NULL); - - return rec->tls_values[index]; -} - - -/////////////////////////////////////////////////////////////////////////////// -/* - * Create atomic variable. - */ -PJ_DEF(pj_status_t) pj_atomic_create( pj_pool_t *pool, - pj_atomic_value_t initial, - pj_atomic_t **atomic ) -{ - *atomic = (pj_atomic_t*)pj_pool_alloc(pool, sizeof(struct pj_atomic_t)); - (*atomic)->value = initial; - return PJ_SUCCESS; -} - - -/* - * Destroy atomic variable. - */ -PJ_DEF(pj_status_t) pj_atomic_destroy( pj_atomic_t *atomic_var ) -{ - PJ_UNUSED_ARG(atomic_var); - return PJ_SUCCESS; -} - - -/* - * Set the value of an atomic type, and return the previous value. - */ -PJ_DEF(void) pj_atomic_set( pj_atomic_t *atomic_var, - pj_atomic_value_t value) -{ - atomic_var->value = value; -} - - -/* - * Get the value of an atomic type. - */ -PJ_DEF(pj_atomic_value_t) pj_atomic_get(pj_atomic_t *atomic_var) -{ - return atomic_var->value; -} - - -/* - * Increment the value of an atomic type. - */ -PJ_DEF(void) pj_atomic_inc(pj_atomic_t *atomic_var) -{ - ++atomic_var->value; -} - - -/* - * Increment the value of an atomic type and get the result. - */ -PJ_DEF(pj_atomic_value_t) pj_atomic_inc_and_get(pj_atomic_t *atomic_var) -{ - return ++atomic_var->value; -} - - -/* - * Decrement the value of an atomic type. - */ -PJ_DEF(void) pj_atomic_dec(pj_atomic_t *atomic_var) -{ - --atomic_var->value; -} - - -/* - * Decrement the value of an atomic type and get the result. - */ -PJ_DEF(pj_atomic_value_t) pj_atomic_dec_and_get(pj_atomic_t *atomic_var) -{ - return --atomic_var->value; -} - - -/* - * Add a value to an atomic type. - */ -PJ_DEF(void) pj_atomic_add( pj_atomic_t *atomic_var, - pj_atomic_value_t value) -{ - atomic_var->value += value; -} - - -/* - * Add a value to an atomic type and get the result. - */ -PJ_DEF(pj_atomic_value_t) pj_atomic_add_and_get( pj_atomic_t *atomic_var, - pj_atomic_value_t value) -{ - atomic_var->value += value; - return atomic_var->value; -} - - - -///////////////////////////////////////////////////////////////////////////// - -PJ_DEF(pj_status_t) pj_mutex_create( pj_pool_t *pool, - const char *name, - int type, - pj_mutex_t **mutex) -{ - PJ_UNUSED_ARG(pool); - PJ_UNUSED_ARG(name); - PJ_UNUSED_ARG(type); - - *mutex = DUMMY_MUTEX; - return PJ_SUCCESS; -} - -/* - * pj_mutex_create_simple() - */ -PJ_DEF(pj_status_t) pj_mutex_create_simple( pj_pool_t *pool, - const char *name, - pj_mutex_t **mutex ) -{ - return pj_mutex_create(pool, name, PJ_MUTEX_SIMPLE, mutex); -} - - -PJ_DEF(pj_status_t) pj_mutex_create_recursive( pj_pool_t *pool, - const char *name, - pj_mutex_t **mutex ) -{ - return pj_mutex_create(pool, name, PJ_MUTEX_RECURSE, mutex); -} - - -/* - * pj_mutex_lock() - */ -PJ_DEF(pj_status_t) pj_mutex_lock(pj_mutex_t *mutex) -{ - pj_assert(mutex == DUMMY_MUTEX); - return PJ_SUCCESS; -} - -/* - * pj_mutex_trylock() - */ -PJ_DEF(pj_status_t) pj_mutex_trylock(pj_mutex_t *mutex) -{ - pj_assert(mutex == DUMMY_MUTEX); - return PJ_SUCCESS; -} - -/* - * pj_mutex_unlock() - */ -PJ_DEF(pj_status_t) pj_mutex_unlock(pj_mutex_t *mutex) -{ - pj_assert(mutex == DUMMY_MUTEX); - return PJ_SUCCESS; -} - -/* - * pj_mutex_destroy() - */ -PJ_DEF(pj_status_t) pj_mutex_destroy(pj_mutex_t *mutex) -{ - pj_assert(mutex == DUMMY_MUTEX); - return PJ_SUCCESS; -} - - -///////////////////////////////////////////////////////////////////////////// -/* - * RW Mutex - */ -#include "os_rwmutex.c" - - -///////////////////////////////////////////////////////////////////////////// - -/* - * Enter critical section. - */ -PJ_DEF(void) pj_enter_critical_section(void) -{ - /* Nothing to do */ -} - - -/* - * Leave critical section. - */ -PJ_DEF(void) pj_leave_critical_section(void) -{ - /* Nothing to do */ -} - - -///////////////////////////////////////////////////////////////////////////// - -/* - * Create semaphore. - */ -PJ_DEF(pj_status_t) pj_sem_create( pj_pool_t *pool, - const char *name, - unsigned initial, - unsigned max, - pj_sem_t **p_sem) -{ - pj_sem_t *sem; - - PJ_UNUSED_ARG(name); - - sem = (pj_sem_t*) pj_pool_zalloc(pool, sizeof(pj_sem_t)); - sem->value = initial; - sem->max = max; - - *p_sem = sem; - - return PJ_SUCCESS; -} - - -/* - * Wait for semaphore. - */ -PJ_DEF(pj_status_t) pj_sem_wait(pj_sem_t *sem) -{ - if (sem->value > 0) { - sem->value--; - return PJ_SUCCESS; - } else { - pj_assert(!"Unexpected!"); - return PJ_EINVALIDOP; - } -} - - -/* - * Try wait for semaphore. - */ -PJ_DEF(pj_status_t) pj_sem_trywait(pj_sem_t *sem) -{ - if (sem->value > 0) { - sem->value--; - return PJ_SUCCESS; - } else { - pj_assert(!"Unexpected!"); - return PJ_EINVALIDOP; - } -} - - -/* - * Release semaphore. - */ -PJ_DEF(pj_status_t) pj_sem_post(pj_sem_t *sem) -{ - sem->value++; - return PJ_SUCCESS; -} - - -/* - * Destroy semaphore. - */ -PJ_DEF(pj_status_t) pj_sem_destroy(pj_sem_t *sem) -{ - PJ_UNUSED_ARG(sem); - return PJ_SUCCESS; -} - - -#if defined(PJ_OS_HAS_CHECK_STACK) && PJ_OS_HAS_CHECK_STACK != 0 -/* - * The implementation of stack checking. - */ -PJ_DEF(void) pj_thread_check_stack(const char *file, int line) -{ - char stk_ptr; - pj_uint32_t usage; - pj_thread_t *thread = pj_thread_this(); - - pj_assert(thread); - - /* Calculate current usage. */ - usage = (&stk_ptr > thread->stk_start) ? &stk_ptr - thread->stk_start : - thread->stk_start - &stk_ptr; - - /* Assert if stack usage is dangerously high. */ - pj_assert("STACK OVERFLOW!! " && (usage <= thread->stk_size - 128)); - - /* Keep statistic. */ - if (usage > thread->stk_max_usage) { - thread->stk_max_usage = usage; - thread->caller_file = file; - thread->caller_line = line; - } -} - -/* - * Get maximum stack usage statistic. - */ -PJ_DEF(pj_uint32_t) pj_thread_get_stack_max_usage(pj_thread_t *thread) -{ - return thread->stk_max_usage; -} - -/* - * Dump thread stack status. - */ -PJ_DEF(pj_status_t) pj_thread_get_stack_info(pj_thread_t *thread, - const char **file, - int *line) -{ - pj_assert(thread); - - *file = thread->caller_file; - *line = thread->caller_line; - return 0; -} - -#endif /* PJ_OS_HAS_CHECK_STACK */ diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/os_error_symbian.cpp b/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/os_error_symbian.cpp deleted file mode 100644 index 31707b97c377903df1c5561cdbcda4101e5b935c..0000000000000000000000000000000000000000 --- a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/os_error_symbian.cpp +++ /dev/null @@ -1,172 +0,0 @@ -/* $Id: os_error_symbian.cpp 2394 2008-12-23 17:27:53Z bennylp $ */ -/* - * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) - * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> - * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#include <pj/errno.h> -#include <pj/assert.h> -#include <pj/compat/stdarg.h> -#include <pj/unicode.h> -#include <pj/string.h> - -#include <e32err.h> -#include <in_sock.h> - - -#if defined(PJ_HAS_ERROR_STRING) && (PJ_HAS_ERROR_STRING!=0) -static const struct { - pj_os_err_type code; - const char *msg; -} gaErrorList[] = { - /* - * Generic error -1 to -46 - */ - PJ_BUILD_ERR( KErrNotFound, "Unable to find the specified object"), - PJ_BUILD_ERR( KErrGeneral, "General (unspecified) error"), - PJ_BUILD_ERR( KErrCancel, "The operation was cancelled"), - PJ_BUILD_ERR( KErrNoMemory, "Not enough memory"), - PJ_BUILD_ERR( KErrNotSupported, "The operation requested is not supported"), - PJ_BUILD_ERR( KErrArgument, "Bad request"), - PJ_BUILD_ERR( KErrTotalLossOfPrecision, "Total loss of precision"), - PJ_BUILD_ERR( KErrBadHandle, "Bad object"), - PJ_BUILD_ERR( KErrOverflow, "Overflow"), - PJ_BUILD_ERR( KErrUnderflow, "Underflow"), - PJ_BUILD_ERR( KErrAlreadyExists,"Already exists"), - PJ_BUILD_ERR( KErrPathNotFound, "Unable to find the specified folder"), - PJ_BUILD_ERR( KErrDied, "Closed"), - PJ_BUILD_ERR( KErrInUse, "The specified object is currently in use by another program"), - PJ_BUILD_ERR( KErrServerTerminated, "Server has closed"), - PJ_BUILD_ERR( KErrServerBusy, "Server busy"), - PJ_BUILD_ERR( KErrCompletion, "Completion error"), - PJ_BUILD_ERR( KErrNotReady, "Not ready"), - PJ_BUILD_ERR( KErrUnknown, "Unknown error"), - PJ_BUILD_ERR( KErrCorrupt, "Corrupt"), - PJ_BUILD_ERR( KErrAccessDenied, "Access denied"), - PJ_BUILD_ERR( KErrLocked, "Locked"), - PJ_BUILD_ERR( KErrWrite, "Failed to write"), - PJ_BUILD_ERR( KErrDisMounted, "Wrong disk present"), - PJ_BUILD_ERR( KErrEof, "Unexpected end of file"), - PJ_BUILD_ERR( KErrDiskFull, "Disk full"), - PJ_BUILD_ERR( KErrBadDriver, "Bad device driver"), - PJ_BUILD_ERR( KErrBadName, "Bad name"), - PJ_BUILD_ERR( KErrCommsLineFail,"Comms line failed"), - PJ_BUILD_ERR( KErrCommsFrame, "Comms frame error"), - PJ_BUILD_ERR( KErrCommsOverrun, "Comms overrun error"), - PJ_BUILD_ERR( KErrCommsParity, "Comms parity error"), - PJ_BUILD_ERR( KErrTimedOut, "Timed out"), - PJ_BUILD_ERR( KErrCouldNotConnect, "Failed to connect"), - PJ_BUILD_ERR( KErrCouldNotDisconnect, "Failed to disconnect"), - PJ_BUILD_ERR( KErrDisconnected, "Disconnected"), - PJ_BUILD_ERR( KErrBadLibraryEntryPoint, "Bad library entry point"), - PJ_BUILD_ERR( KErrBadDescriptor,"Bad descriptor"), - PJ_BUILD_ERR( KErrAbort, "Interrupted"), - PJ_BUILD_ERR( KErrTooBig, "Too big"), - PJ_BUILD_ERR( KErrDivideByZero, "Divide by zero"), - PJ_BUILD_ERR( KErrBadPower, "Batteries too low"), - PJ_BUILD_ERR( KErrDirFull, "Folder full"), - PJ_BUILD_ERR( KErrHardwareNotAvailable, ""), - PJ_BUILD_ERR( KErrSessionClosed, ""), - PJ_BUILD_ERR( KErrPermissionDenied, ""), - - /* - * Socket errors (-190 - -1000) - */ - PJ_BUILD_ERR( KErrNetUnreach, "Could not connect to the network. Currently unreachable"), - PJ_BUILD_ERR( KErrHostUnreach, "Could not connect to the specified server"), - PJ_BUILD_ERR( KErrNoProtocolOpt,"The specified server refuses the selected protocol"), - PJ_BUILD_ERR( KErrUrgentData, ""), - PJ_BUILD_ERR( KErrWouldBlock, "Conflicts with KErrExtended, but cannot occur in practice"), - - {0, NULL} -}; - -#endif /* PJ_HAS_ERROR_STRING */ - - -PJ_DEF(pj_status_t) pj_get_os_error(void) -{ - return -1; -} - -PJ_DEF(void) pj_set_os_error(pj_status_t code) -{ - PJ_UNUSED_ARG(code); -} - -PJ_DEF(pj_status_t) pj_get_netos_error(void) -{ - return -1; -} - -PJ_DEF(void) pj_set_netos_error(pj_status_t code) -{ - PJ_UNUSED_ARG(code); -} - -PJ_BEGIN_DECL - - PJ_DECL(int) platform_strerror( pj_os_err_type os_errcode, - char *buf, pj_size_t bufsize); -PJ_END_DECL - -/* - * platform_strerror() - * - * Platform specific error message. This file is called by pj_strerror() - * in errno.c - */ -PJ_DEF(int) platform_strerror( pj_os_err_type os_errcode, - char *buf, pj_size_t bufsize) -{ - int len = 0; - - pj_assert(buf != NULL); - pj_assert(bufsize >= 0); - - /* - * MUST NOT check stack here. - * This function might be called from PJ_CHECK_STACK() itself! - //PJ_CHECK_STACK(); - */ - - if (!len) { -#if defined(PJ_HAS_ERROR_STRING) && (PJ_HAS_ERROR_STRING!=0) - int i; - for (i = 0; gaErrorList[i].msg; ++i) { - if (gaErrorList[i].code == os_errcode) { - len = strlen(gaErrorList[i].msg); - if ((pj_size_t)len >= bufsize) { - len = bufsize-1; - } - pj_memcpy(buf, gaErrorList[i].msg, len); - buf[len] = '\0'; - break; - } - } -#endif /* PJ_HAS_ERROR_STRING */ - - } - - if (!len) { - len = pj_ansi_snprintf( buf, bufsize, "Symbian native error %d", - os_errcode); - buf[len] = '\0'; - } - - return len; -} - diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/sock_select_symbian.cpp b/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/sock_select_symbian.cpp deleted file mode 100644 index 727bcfdf8b3783a3e984f2804c642d3ab86a37cb..0000000000000000000000000000000000000000 --- a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/sock_select_symbian.cpp +++ /dev/null @@ -1,163 +0,0 @@ -/* $Id: sock_select_symbian.cpp 2394 2008-12-23 17:27:53Z bennylp $ */ -/* - * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) - * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> - * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#include <pj/sock_select.h> -#include <pj/array.h> -#include <pj/assert.h> -#include <pj/os.h> -#include "os_symbian.h" - - -struct symbian_fd_set -{ - unsigned count; - CPjSocket *sock[PJ_IOQUEUE_MAX_HANDLES]; -}; - - -PJ_DEF(void) PJ_FD_ZERO(pj_fd_set_t *fdsetp) -{ - symbian_fd_set *fds = (symbian_fd_set *)fdsetp; - fds->count = 0; -} - - -PJ_DEF(void) PJ_FD_SET(pj_sock_t fd, pj_fd_set_t *fdsetp) -{ - symbian_fd_set *fds = (symbian_fd_set *)fdsetp; - - PJ_ASSERT_ON_FAIL(fds->count < PJ_IOQUEUE_MAX_HANDLES, return); - fds->sock[fds->count++] = (CPjSocket*)fd; -} - - -PJ_DEF(void) PJ_FD_CLR(pj_sock_t fd, pj_fd_set_t *fdsetp) -{ - symbian_fd_set *fds = (symbian_fd_set *)fdsetp; - unsigned i; - - for (i=0; i<fds->count; ++i) { - if (fds->sock[i] == (CPjSocket*)fd) { - pj_array_erase(fds->sock, sizeof(fds->sock[0]), fds->count, i); - --fds->count; - return; - } - } -} - - -PJ_DEF(pj_bool_t) PJ_FD_ISSET(pj_sock_t fd, const pj_fd_set_t *fdsetp) -{ - symbian_fd_set *fds = (symbian_fd_set *)fdsetp; - unsigned i; - - for (i=0; i<fds->count; ++i) { - if (fds->sock[i] == (CPjSocket*)fd) { - return PJ_TRUE; - } - } - - return PJ_FALSE; -} - -PJ_DEF(pj_size_t) PJ_FD_COUNT(const pj_fd_set_t *fdsetp) -{ - symbian_fd_set *fds = (symbian_fd_set *)fdsetp; - return fds->count; -} - - -PJ_DEF(int) pj_sock_select( int n, - pj_fd_set_t *readfds, - pj_fd_set_t *writefds, - pj_fd_set_t *exceptfds, - const pj_time_val *timeout) -{ - CPjTimeoutTimer *pjTimer; - unsigned i; - - PJ_UNUSED_ARG(n); - PJ_UNUSED_ARG(writefds); - PJ_UNUSED_ARG(exceptfds); - - if (timeout) { - pjTimer = PjSymbianOS::Instance()->SelectTimeoutTimer(); - pjTimer->StartTimer(timeout->sec*1000 + timeout->msec); - - } else { - pjTimer = NULL; - } - - /* Scan for readable sockets */ - - if (readfds) { - symbian_fd_set *fds = (symbian_fd_set *)readfds; - - do { - /* Scan sockets for readily available data */ - for (i=0; i<fds->count; ++i) { - CPjSocket *pjsock = fds->sock[i]; - - if (pjsock->Reader()) { - if (pjsock->Reader()->HasData() && !pjsock->Reader()->IsActive()) { - - /* Found socket with data ready */ - PJ_FD_ZERO(readfds); - PJ_FD_SET((pj_sock_t)pjsock, readfds); - - /* Cancel timer, if any */ - if (pjTimer) { - pjTimer->Cancel(); - } - - /* Clear writable and exception fd_set */ - if (writefds) - PJ_FD_ZERO(writefds); - if (exceptfds) - PJ_FD_ZERO(exceptfds); - - return 1; - - } else if (!pjsock->Reader()->IsActive()) - pjsock->Reader()->StartRecvFrom(); - - } else { - pjsock->CreateReader(); - pjsock->Reader()->StartRecvFrom(); - } - } - - PjSymbianOS::Instance()->WaitForActiveObjects(); - - } while (pjTimer==NULL || !pjTimer->HasTimedOut()); - } - - - /* Timeout */ - - if (readfds) - PJ_FD_ZERO(readfds); - if (writefds) - PJ_FD_ZERO(writefds); - if (exceptfds) - PJ_FD_ZERO(exceptfds); - - return 0; -} - diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/sock_symbian.cpp b/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/sock_symbian.cpp deleted file mode 100644 index 8b4765f896ef8441b8b41becdc6109cf1dc75c47..0000000000000000000000000000000000000000 --- a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/sock_symbian.cpp +++ /dev/null @@ -1,992 +0,0 @@ -/* $Id: sock_symbian.cpp 2394 2008-12-23 17:27:53Z bennylp $ */ -/* - * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) - * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> - * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#include <pj/sock.h> -#include <pj/addr_resolv.h> -#include <pj/assert.h> -#include <pj/errno.h> -#include <pj/os.h> -#include <pj/string.h> -#include <pj/unicode.h> - -#include "os_symbian.h" - - -/* - * Address families. - */ -const pj_uint16_t PJ_AF_UNSPEC = KAFUnspec; -const pj_uint16_t PJ_AF_UNIX = 0xFFFF; -const pj_uint16_t PJ_AF_INET = KAfInet; -const pj_uint16_t PJ_AF_INET6 = KAfInet6; -const pj_uint16_t PJ_AF_PACKET = 0xFFFF; -const pj_uint16_t PJ_AF_IRDA = 0xFFFF; - -/* - * Socket types conversion. - * The values here are indexed based on pj_sock_type - */ -const pj_uint16_t PJ_SOCK_STREAM= KSockStream; -const pj_uint16_t PJ_SOCK_DGRAM = KSockDatagram; -const pj_uint16_t PJ_SOCK_RAW = 0xFFFF; -const pj_uint16_t PJ_SOCK_RDM = 0xFFFF; - -/* setsockop() is not really supported. */ -const pj_uint16_t PJ_SOL_SOCKET = 0xFFFF; -const pj_uint16_t PJ_SOL_IP = 0xFFFF; -const pj_uint16_t PJ_SOL_TCP = 0xFFFF; -const pj_uint16_t PJ_SOL_UDP = 0xFFFF; -const pj_uint16_t PJ_SOL_IPV6 = 0xFFFF; - -/* TOS */ -const pj_uint16_t PJ_IP_TOS = 0; -const pj_uint16_t PJ_IPTOS_LOWDELAY = 0; -const pj_uint16_t PJ_IPTOS_THROUGHPUT = 0; -const pj_uint16_t PJ_IPTOS_RELIABILITY = 0; -const pj_uint16_t PJ_IPTOS_MINCOST = 0; - -/* ioctl() is also not supported. */ -const pj_uint16_t PJ_SO_TYPE = 0xFFFF; -const pj_uint16_t PJ_SO_RCVBUF = 0xFFFF; -const pj_uint16_t PJ_SO_SNDBUF = 0xFFFF; - -/* IP multicast is also not supported. */ -const pj_uint16_t PJ_IP_MULTICAST_IF = 0xFFFF; -const pj_uint16_t PJ_IP_MULTICAST_TTL = 0xFFFF; -const pj_uint16_t PJ_IP_MULTICAST_LOOP = 0xFFFF; -const pj_uint16_t PJ_IP_ADD_MEMBERSHIP = 0xFFFF; -const pj_uint16_t PJ_IP_DROP_MEMBERSHIP = 0xFFFF; - -/* Flags */ -const int PJ_MSG_OOB = 0; -const int PJ_MSG_PEEK = KSockReadPeek; -const int PJ_MSG_DONTROUTE = 0; - -///////////////////////////////////////////////////////////////////////////// -// -// CPjSocket implementation. -// (declaration is in os_symbian.h) -// - -CPjSocket::~CPjSocket() -{ - DestroyReader(); - sock_.Close(); -} - - -// Create socket reader. -CPjSocketReader *CPjSocket::CreateReader(unsigned max_len) -{ - pj_assert(sockReader_ == NULL); - return sockReader_ = CPjSocketReader::NewL(*this, max_len); -} - -// Delete socket reader when it's not wanted. -void CPjSocket::DestroyReader() -{ - if (sockReader_) { - sockReader_->Cancel(); - delete sockReader_; - sockReader_ = NULL; - } -} - - -///////////////////////////////////////////////////////////////////////////// -// -// CPjSocketReader implementation -// (declaration in os_symbian.h) -// - - -CPjSocketReader::CPjSocketReader(CPjSocket &sock) -: CActive(EPriorityStandard), - sock_(sock), buffer_(NULL, 0), readCb_(NULL), key_(NULL) -{ -} - - -void CPjSocketReader::ConstructL(unsigned max_len) -{ - TProtocolDesc aProtocol; - TInt err; - - err = sock_.Socket().Info(aProtocol); - User::LeaveIfError(err); - - isDatagram_ = (aProtocol.iSockType == KSockDatagram); - - TUint8 *ptr = new TUint8[max_len]; - buffer_.Set(ptr, 0, (TInt)max_len); - CActiveScheduler::Add(this); -} - -CPjSocketReader *CPjSocketReader::NewL(CPjSocket &sock, unsigned max_len) -{ - CPjSocketReader *self = new (ELeave) CPjSocketReader(sock); - CleanupStack::PushL(self); - self->ConstructL(max_len); - CleanupStack::Pop(self); - - return self; -} - - -CPjSocketReader::~CPjSocketReader() -{ - const TUint8 *data = buffer_.Ptr(); - delete [] data; -} - -void CPjSocketReader::StartRecv(void (*cb)(void *key), - void *key, - TDes8 *aDesc, - TUint flags) -{ - StartRecvFrom(cb, key, aDesc, flags, NULL); -} - -void CPjSocketReader::StartRecvFrom(void (*cb)(void *key), - void *key, - TDes8 *aDesc, - TUint flags, - TSockAddr *fromAddr) -{ - readCb_ = cb; - key_ = key; - - if (aDesc == NULL) aDesc = &buffer_; - if (fromAddr == NULL) fromAddr = &recvAddr_; - - sock_.Socket().RecvFrom(*aDesc, *fromAddr, flags, iStatus); - SetActive(); -} - -void CPjSocketReader::DoCancel() -{ - sock_.Socket().CancelRecv(); -} - -void CPjSocketReader::RunL() -{ - void (*old_cb)(void *key) = readCb_; - void *old_key = key_; - - readCb_ = NULL; - key_ = NULL; - - if (old_cb) { - (*old_cb)(old_key); - } -} - -// Append data to aDesc, up to aDesc's maximum size. -// If socket is datagram based, buffer_ will be clared. -void CPjSocketReader::ReadData(TDes8 &aDesc, TInetAddr *addr) -{ - if (isDatagram_) - aDesc.Zero(); - - if (buffer_.Length() == 0) - return; - - TInt size_to_copy = aDesc.MaxLength() - aDesc.Length(); - if (size_to_copy > buffer_.Length()) - size_to_copy = buffer_.Length(); - - aDesc.Append(buffer_.Ptr(), size_to_copy); - - if (isDatagram_) - buffer_.Zero(); - else - buffer_.Delete(0, size_to_copy); - - if (addr) - *addr = recvAddr_; -} - - - -///////////////////////////////////////////////////////////////////////////// -// -// PJLIB's sock.h implementation -// - -/* - * Convert 16-bit value from network byte order to host byte order. - */ -PJ_DEF(pj_uint16_t) pj_ntohs(pj_uint16_t netshort) -{ -#if PJ_IS_LITTLE_ENDIAN - return pj_swap16(netshort); -#else - return netshort; -#endif -} - -/* - * Convert 16-bit value from host byte order to network byte order. - */ -PJ_DEF(pj_uint16_t) pj_htons(pj_uint16_t hostshort) -{ -#if PJ_IS_LITTLE_ENDIAN - return pj_swap16(hostshort); -#else - return hostshort; -#endif -} - -/* - * Convert 32-bit value from network byte order to host byte order. - */ -PJ_DEF(pj_uint32_t) pj_ntohl(pj_uint32_t netlong) -{ -#if PJ_IS_LITTLE_ENDIAN - return pj_swap32(netlong); -#else - return netlong; -#endif -} - -/* - * Convert 32-bit value from host byte order to network byte order. - */ -PJ_DEF(pj_uint32_t) pj_htonl(pj_uint32_t hostlong) -{ -#if PJ_IS_LITTLE_ENDIAN - return pj_swap32(hostlong); -#else - return netlong; -#endif -} - -/* - * Convert an Internet host address given in network byte order - * to string in standard numbers and dots notation. - */ -PJ_DEF(char*) pj_inet_ntoa(pj_in_addr inaddr) -{ - static char str8[PJ_INET_ADDRSTRLEN]; - TBuf<PJ_INET_ADDRSTRLEN> str16(0); - - /* (Symbian IP address is in host byte order) */ - TInetAddr temp_addr((TUint32)pj_ntohl(inaddr.s_addr), (TUint)0); - temp_addr.Output(str16); - - return pj_unicode_to_ansi((const wchar_t*)str16.PtrZ(), str16.Length(), - str8, sizeof(str8)); -} - -/* - * This function converts the Internet host address cp from the standard - * numbers-and-dots notation into binary data and stores it in the structure - * that inp points to. - */ -PJ_DEF(int) pj_inet_aton(const pj_str_t *cp, struct pj_in_addr *inp) -{ - enum { MAXIPLEN = PJ_INET_ADDRSTRLEN }; - - /* Initialize output with PJ_INADDR_NONE. - * Some apps relies on this instead of the return value - * (and anyway the return value is quite confusing!) - */ - inp->s_addr = PJ_INADDR_NONE; - - /* Caution: - * this function might be called with cp->slen >= 16 - * (i.e. when called with hostname to check if it's an IP addr). - */ - PJ_ASSERT_RETURN(cp && cp->slen && inp, 0); - if (cp->slen >= 16) { - return 0; - } - - char tempaddr8[MAXIPLEN]; - pj_memcpy(tempaddr8, cp->ptr, cp->slen); - tempaddr8[cp->slen] = '\0'; - - wchar_t tempaddr16[MAXIPLEN]; - pj_ansi_to_unicode(tempaddr8, pj_ansi_strlen(tempaddr8), - tempaddr16, sizeof(tempaddr16)); - - TBuf<MAXIPLEN> ip_addr((const TText*)tempaddr16); - - TInetAddr addr; - addr.Init(KAfInet); - if (addr.Input(ip_addr) == KErrNone) { - /* Success (Symbian IP address is in host byte order) */ - inp->s_addr = pj_htonl(addr.Address()); - return 1; - } else { - /* Error */ - return 0; - } -} - -/* - * Convert text to IPv4/IPv6 address. - */ -PJ_DEF(pj_status_t) pj_inet_pton(int af, const pj_str_t *src, void *dst) -{ - char tempaddr[PJ_INET6_ADDRSTRLEN]; - - PJ_ASSERT_RETURN(af==PJ_AF_INET || af==PJ_AF_INET6, PJ_EINVAL); - PJ_ASSERT_RETURN(src && src->slen && dst, PJ_EINVAL); - - /* Initialize output with PJ_IN_ADDR_NONE for IPv4 (to be - * compatible with pj_inet_aton() - */ - if (af==PJ_AF_INET) { - ((pj_in_addr*)dst)->s_addr = PJ_INADDR_NONE; - } - - /* Caution: - * this function might be called with cp->slen >= 46 - * (i.e. when called with hostname to check if it's an IP addr). - */ - if (src->slen >= PJ_INET6_ADDRSTRLEN) { - return PJ_ENAMETOOLONG; - } - - pj_memcpy(tempaddr, src->ptr, src->slen); - tempaddr[src->slen] = '\0'; - - - wchar_t tempaddr16[PJ_INET6_ADDRSTRLEN]; - pj_ansi_to_unicode(tempaddr, pj_ansi_strlen(tempaddr), - tempaddr16, sizeof(tempaddr16)); - - TBuf<PJ_INET6_ADDRSTRLEN> ip_addr((const TText*)tempaddr16); - - TInetAddr addr; - addr.Init(KAfInet6); - if (addr.Input(ip_addr) == KErrNone) { - if (af==PJ_AF_INET) { - /* Success (Symbian IP address is in host byte order) */ - pj_uint32_t ip = pj_htonl(addr.Address()); - pj_memcpy(dst, &ip, 4); - } else if (af==PJ_AF_INET6) { - const TIp6Addr & ip6 = addr.Ip6Address(); - pj_memcpy(dst, ip6.u.iAddr8, 16); - } else { - pj_assert(!"Unexpected!"); - return PJ_EBUG; - } - return PJ_SUCCESS; - } else { - /* Error */ - return PJ_EINVAL; - } -} - -/* - * Convert IPv4/IPv6 address to text. - */ -PJ_DEF(pj_status_t) pj_inet_ntop(int af, const void *src, - char *dst, int size) - -{ - PJ_ASSERT_RETURN(src && dst && size, PJ_EINVAL); - - *dst = '\0'; - - if (af==PJ_AF_INET) { - - TBuf<PJ_INET_ADDRSTRLEN> str16; - pj_in_addr inaddr; - - if (size < PJ_INET_ADDRSTRLEN) - return PJ_ETOOSMALL; - - pj_memcpy(&inaddr, src, 4); - - /* Symbian IP address is in host byte order */ - TInetAddr temp_addr((TUint32)pj_ntohl(inaddr.s_addr), (TUint)0); - temp_addr.Output(str16); - - pj_unicode_to_ansi((const wchar_t*)str16.PtrZ(), str16.Length(), - dst, size); - return PJ_SUCCESS; - - } else if (af==PJ_AF_INET6) { - TBuf<PJ_INET6_ADDRSTRLEN> str16; - - if (size < PJ_INET6_ADDRSTRLEN) - return PJ_ETOOSMALL; - - TIp6Addr ip6; - pj_memcpy(ip6.u.iAddr8, src, 16); - - TInetAddr temp_addr(ip6, (TUint)0); - temp_addr.Output(str16); - - pj_unicode_to_ansi((const wchar_t*)str16.PtrZ(), str16.Length(), - dst, size); - return PJ_SUCCESS; - - } else { - pj_assert(!"Unsupport address family"); - return PJ_EINVAL; - } - -} - -/* - * Get hostname. - */ -PJ_DEF(const pj_str_t*) pj_gethostname(void) -{ - static char buf[PJ_MAX_HOSTNAME]; - static pj_str_t hostname; - - PJ_CHECK_STACK(); - - if (hostname.ptr == NULL) { - RHostResolver &resv = PjSymbianOS::Instance()->GetResolver(PJ_AF_INET); - TRequestStatus reqStatus; - THostName tmpName; - - resv.GetHostName(tmpName, reqStatus); - User::WaitForRequest(reqStatus); - - hostname.ptr = pj_unicode_to_ansi((const wchar_t*)tmpName.Ptr(), tmpName.Length(), - buf, sizeof(buf)); - hostname.slen = tmpName.Length(); - } - return &hostname; -} - -/* - * Create new socket/endpoint for communication and returns a descriptor. - */ -PJ_DEF(pj_status_t) pj_sock_socket(int af, - int type, - int proto, - pj_sock_t *p_sock) -{ - TInt rc; - - PJ_CHECK_STACK(); - - /* Sanity checks. */ - PJ_ASSERT_RETURN(p_sock!=NULL, PJ_EINVAL); - - /* Set proto if none is specified. */ - if (proto == 0) { - if (type == pj_SOCK_STREAM()) - proto = KProtocolInetTcp; - else if (type == pj_SOCK_DGRAM()) - proto = KProtocolInetUdp; - } - - /* Create Symbian RSocket */ - RSocket rSock; - if (PjSymbianOS::Instance()->Connection()) - rc = rSock.Open(PjSymbianOS::Instance()->SocketServ(), - af, type, proto, - *PjSymbianOS::Instance()->Connection()); - else - rc = rSock.Open(PjSymbianOS::Instance()->SocketServ(), - af, type, proto); - - if (rc != KErrNone) - return PJ_RETURN_OS_ERROR(rc); - - - /* Wrap Symbian RSocket into PJLIB's CPjSocket, and return to caller */ - CPjSocket *pjSock = new CPjSocket(af, rSock); - *p_sock = (pj_sock_t)pjSock; - - return PJ_SUCCESS; -} - - -/* - * Bind socket. - */ -PJ_DEF(pj_status_t) pj_sock_bind( pj_sock_t sock, - const pj_sockaddr_t *addr, - int len) -{ - pj_status_t status; - TInt rc; - - PJ_CHECK_STACK(); - - PJ_ASSERT_RETURN(sock != 0, PJ_EINVAL); - PJ_ASSERT_RETURN(addr && len>=(int)sizeof(pj_sockaddr_in), PJ_EINVAL); - - // Convert PJLIB's pj_sockaddr into Symbian's TInetAddr - TInetAddr inetAddr; - status = PjSymbianOS::pj2Addr(*(pj_sockaddr*)addr, len, inetAddr); - if (status != PJ_SUCCESS) - return status; - - // Get the RSocket instance - RSocket &rSock = ((CPjSocket*)sock)->Socket(); - - // Bind - rc = rSock.Bind(inetAddr); - - return (rc==KErrNone) ? PJ_SUCCESS : PJ_RETURN_OS_ERROR(rc); -} - - -/* - * Bind socket. - */ -PJ_DEF(pj_status_t) pj_sock_bind_in( pj_sock_t sock, - pj_uint32_t addr32, - pj_uint16_t port) -{ - pj_sockaddr_in addr; - - PJ_CHECK_STACK(); - - pj_bzero(&addr, sizeof(addr)); - addr.sin_family = PJ_AF_INET; - addr.sin_addr.s_addr = pj_htonl(addr32); - addr.sin_port = pj_htons(port); - - return pj_sock_bind(sock, &addr, sizeof(pj_sockaddr_in)); -} - - -/* - * Close socket. - */ -PJ_DEF(pj_status_t) pj_sock_close(pj_sock_t sock) -{ - PJ_CHECK_STACK(); - - PJ_ASSERT_RETURN(sock != 0, PJ_EINVAL); - - CPjSocket *pjSock = (CPjSocket*)sock; - - // This will close the socket. - delete pjSock; - - return PJ_SUCCESS; -} - -/* - * Get remote's name. - */ -PJ_DEF(pj_status_t) pj_sock_getpeername( pj_sock_t sock, - pj_sockaddr_t *addr, - int *namelen) -{ - PJ_CHECK_STACK(); - - PJ_ASSERT_RETURN(sock && addr && namelen && - *namelen>=(int)sizeof(pj_sockaddr_in), PJ_EINVAL); - - CPjSocket *pjSock = (CPjSocket*)sock; - RSocket &rSock = pjSock->Socket(); - - // Socket must be connected. - PJ_ASSERT_RETURN(pjSock->IsConnected(), PJ_EINVALIDOP); - - TInetAddr inetAddr; - rSock.RemoteName(inetAddr); - - return PjSymbianOS::Addr2pj(inetAddr, *(pj_sockaddr*)addr, namelen); -} - -/* - * Get socket name. - */ -PJ_DEF(pj_status_t) pj_sock_getsockname( pj_sock_t sock, - pj_sockaddr_t *addr, - int *namelen) -{ - PJ_CHECK_STACK(); - - PJ_ASSERT_RETURN(sock && addr && namelen && - *namelen>=(int)sizeof(pj_sockaddr_in), PJ_EINVAL); - - CPjSocket *pjSock = (CPjSocket*)sock; - RSocket &rSock = pjSock->Socket(); - - TInetAddr inetAddr; - rSock.LocalName(inetAddr); - - return PjSymbianOS::Addr2pj(inetAddr, *(pj_sockaddr*)addr, namelen); -} - -/* - * Send data - */ -PJ_DEF(pj_status_t) pj_sock_send(pj_sock_t sock, - const void *buf, - pj_ssize_t *len, - unsigned flags) -{ - PJ_CHECK_STACK(); - PJ_ASSERT_RETURN(sock && buf && len, PJ_EINVAL); - - CPjSocket *pjSock = (CPjSocket*)sock; - RSocket &rSock = pjSock->Socket(); - - // send() should only be called to connected socket - PJ_ASSERT_RETURN(pjSock->IsConnected(), PJ_EINVALIDOP); - - TPtrC8 data((const TUint8*)buf, (TInt)*len); - TRequestStatus reqStatus; - TSockXfrLength sentLen; - - rSock.Send(data, flags, reqStatus, sentLen); - User::WaitForRequest(reqStatus); - - if (reqStatus.Int()==KErrNone) { - //*len = (TInt) sentLen.Length(); - return PJ_SUCCESS; - } else - return PJ_RETURN_OS_ERROR(reqStatus.Int()); -} - - -/* - * Send data. - */ -PJ_DEF(pj_status_t) pj_sock_sendto(pj_sock_t sock, - const void *buf, - pj_ssize_t *len, - unsigned flags, - const pj_sockaddr_t *to, - int tolen) -{ - pj_status_t status; - - PJ_CHECK_STACK(); - PJ_ASSERT_RETURN(sock && buf && len, PJ_EINVAL); - - CPjSocket *pjSock = (CPjSocket*)sock; - RSocket &rSock = pjSock->Socket(); - - // Only supports AF_INET for now - PJ_ASSERT_RETURN(tolen>=(int)sizeof(pj_sockaddr_in), PJ_EINVAL); - - TInetAddr inetAddr; - status = PjSymbianOS::pj2Addr(*(pj_sockaddr*)to, tolen, inetAddr); - if (status != PJ_SUCCESS) - return status; - - TPtrC8 data((const TUint8*)buf, (TInt)*len); - TRequestStatus reqStatus; - TSockXfrLength sentLen; - - rSock.SendTo(data, inetAddr, flags, reqStatus, sentLen); - User::WaitForRequest(reqStatus); - - if (reqStatus.Int()==KErrNone) { - //For some reason TSockXfrLength is not returning correctly! - //*len = (TInt) sentLen.Length(); - return PJ_SUCCESS; - } else - return PJ_RETURN_OS_ERROR(reqStatus.Int()); -} - -/* - * Receive data. - */ -PJ_DEF(pj_status_t) pj_sock_recv(pj_sock_t sock, - void *buf, - pj_ssize_t *len, - unsigned flags) -{ - PJ_CHECK_STACK(); - - PJ_ASSERT_RETURN(sock && buf && len, PJ_EINVAL); - PJ_ASSERT_RETURN(*len > 0, PJ_EINVAL); - - CPjSocket *pjSock = (CPjSocket*)sock; - RSocket &rSock = pjSock->Socket(); - - if (pjSock->Reader()) { - CPjSocketReader *reader = pjSock->Reader(); - - while (reader->IsActive() && !reader->HasData()) { - User::WaitForAnyRequest(); - } - - if (reader->HasData()) { - TPtr8 data((TUint8*)buf, (TInt)*len); - TInetAddr inetAddr; - - reader->ReadData(data, &inetAddr); - - *len = data.Length(); - return PJ_SUCCESS; - } - } - - TRequestStatus reqStatus; - TSockXfrLength recvLen; - TPtr8 data((TUint8*)buf, (TInt)*len, (TInt)*len); - - rSock.Recv(data, flags, reqStatus, recvLen); - User::WaitForRequest(reqStatus); - - if (reqStatus == KErrNone) { - //*len = (TInt)recvLen.Length(); - *len = data.Length(); - return PJ_SUCCESS; - } else { - *len = -1; - return PJ_RETURN_OS_ERROR(reqStatus.Int()); - } -} - -/* - * Receive data. - */ -PJ_DEF(pj_status_t) pj_sock_recvfrom(pj_sock_t sock, - void *buf, - pj_ssize_t *len, - unsigned flags, - pj_sockaddr_t *from, - int *fromlen) -{ - PJ_CHECK_STACK(); - - PJ_ASSERT_RETURN(sock && buf && len && from && fromlen, PJ_EINVAL); - PJ_ASSERT_RETURN(*len > 0, PJ_EINVAL); - PJ_ASSERT_RETURN(*fromlen >= (int)sizeof(pj_sockaddr_in), PJ_EINVAL); - - CPjSocket *pjSock = (CPjSocket*)sock; - RSocket &rSock = pjSock->Socket(); - - if (pjSock->Reader()) { - CPjSocketReader *reader = pjSock->Reader(); - - while (reader->IsActive() && !reader->HasData()) { - User::WaitForAnyRequest(); - } - - if (reader->HasData()) { - TPtr8 data((TUint8*)buf, (TInt)*len); - TInetAddr inetAddr; - - reader->ReadData(data, &inetAddr); - - *len = data.Length(); - - if (from && fromlen) { - return PjSymbianOS::Addr2pj(inetAddr, *(pj_sockaddr*)from, - fromlen); - } else { - return PJ_SUCCESS; - } - } - } - - TInetAddr inetAddr; - TRequestStatus reqStatus; - TSockXfrLength recvLen; - TPtr8 data((TUint8*)buf, (TInt)*len, (TInt)*len); - - rSock.RecvFrom(data, inetAddr, flags, reqStatus, recvLen); - User::WaitForRequest(reqStatus); - - if (reqStatus == KErrNone) { - //*len = (TInt)recvLen.Length(); - *len = data.Length(); - return PjSymbianOS::Addr2pj(inetAddr, *(pj_sockaddr*)from, fromlen); - } else { - *len = -1; - *fromlen = -1; - return PJ_RETURN_OS_ERROR(reqStatus.Int()); - } -} - -/* - * Get socket option. - */ -PJ_DEF(pj_status_t) pj_sock_getsockopt( pj_sock_t sock, - pj_uint16_t level, - pj_uint16_t optname, - void *optval, - int *optlen) -{ - // Not supported for now. - PJ_UNUSED_ARG(sock); - PJ_UNUSED_ARG(level); - PJ_UNUSED_ARG(optname); - PJ_UNUSED_ARG(optval); - PJ_UNUSED_ARG(optlen); - return PJ_EINVALIDOP; -} - -/* - * Set socket option. - */ -PJ_DEF(pj_status_t) pj_sock_setsockopt( pj_sock_t sock, - pj_uint16_t level, - pj_uint16_t optname, - const void *optval, - int optlen) -{ - // Not supported for now. - PJ_UNUSED_ARG(sock); - PJ_UNUSED_ARG(level); - PJ_UNUSED_ARG(optname); - PJ_UNUSED_ARG(optval); - PJ_UNUSED_ARG(optlen); - return PJ_EINVALIDOP; -} - -/* - * Connect socket. - */ -PJ_DEF(pj_status_t) pj_sock_connect( pj_sock_t sock, - const pj_sockaddr_t *addr, - int namelen) -{ - pj_status_t status; - - PJ_CHECK_STACK(); - - PJ_ASSERT_RETURN(sock && addr && namelen, PJ_EINVAL); - PJ_ASSERT_RETURN(((pj_sockaddr*)addr)->addr.sa_family == PJ_AF_INET, - PJ_EINVAL); - - CPjSocket *pjSock = (CPjSocket*)sock; - RSocket &rSock = pjSock->Socket(); - - TInetAddr inetAddr; - TRequestStatus reqStatus; - - status = PjSymbianOS::pj2Addr(*(pj_sockaddr*)addr, namelen, inetAddr); - if (status != PJ_SUCCESS) - return status; - - rSock.Connect(inetAddr, reqStatus); - User::WaitForRequest(reqStatus); - - if (reqStatus == KErrNone) { - pjSock->SetConnected(true); - return PJ_SUCCESS; - } else { - return PJ_RETURN_OS_ERROR(reqStatus.Int()); - } -} - - -/* - * Shutdown socket. - */ -#if PJ_HAS_TCP -PJ_DEF(pj_status_t) pj_sock_shutdown( pj_sock_t sock, - int how) -{ - PJ_CHECK_STACK(); - - PJ_ASSERT_RETURN(sock, PJ_EINVAL); - - CPjSocket *pjSock = (CPjSocket*)sock; - RSocket &rSock = pjSock->Socket(); - - RSocket::TShutdown aHow; - if (how == PJ_SD_RECEIVE) - aHow = RSocket::EStopInput; - else if (how == PJ_SHUT_WR) - aHow = RSocket::EStopOutput; - else - aHow = RSocket::ENormal; - - TRequestStatus reqStatus; - - rSock.Shutdown(aHow, reqStatus); - User::WaitForRequest(reqStatus); - - if (reqStatus == KErrNone) { - return PJ_SUCCESS; - } else { - return PJ_RETURN_OS_ERROR(reqStatus.Int()); - } -} - -/* - * Start listening to incoming connections. - */ -PJ_DEF(pj_status_t) pj_sock_listen( pj_sock_t sock, - int backlog) -{ - PJ_CHECK_STACK(); - - PJ_ASSERT_RETURN(sock && backlog, PJ_EINVAL); - - CPjSocket *pjSock = (CPjSocket*)sock; - RSocket &rSock = pjSock->Socket(); - - TInt rc = rSock.Listen((TUint)backlog); - - if (rc == KErrNone) { - return PJ_SUCCESS; - } else { - return PJ_RETURN_OS_ERROR(rc); - } -} - -/* - * Accept incoming connections - */ -PJ_DEF(pj_status_t) pj_sock_accept( pj_sock_t serverfd, - pj_sock_t *newsock, - pj_sockaddr_t *addr, - int *addrlen) -{ - PJ_CHECK_STACK(); - - PJ_ASSERT_RETURN(serverfd && newsock, PJ_EINVAL); - - CPjSocket *pjSock = (CPjSocket*)serverfd; - RSocket &rSock = pjSock->Socket(); - - // Create a 'blank' socket - RSocket newSock; - newSock.Open(PjSymbianOS::Instance()->SocketServ()); - - // Call Accept() - TRequestStatus reqStatus; - - rSock.Accept(newSock, reqStatus); - User::WaitForRequest(reqStatus); - - if (reqStatus != KErrNone) { - return PJ_RETURN_OS_ERROR(reqStatus.Int()); - } - - // Create PJ socket - CPjSocket *newPjSock = new CPjSocket(pjSock->GetAf(), newSock); - newPjSock->SetConnected(true); - - *newsock = (pj_sock_t) newPjSock; - - if (addr && addrlen) { - return pj_sock_getpeername(*newsock, addr, addrlen); - } - - return PJ_SUCCESS; -} -#endif /* PJ_HAS_TCP */ - - diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/timer_symbian.cpp b/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/timer_symbian.cpp deleted file mode 100644 index 0a9dd8a9377941880e097e731889eacf6b2f416f..0000000000000000000000000000000000000000 --- a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/timer_symbian.cpp +++ /dev/null @@ -1,276 +0,0 @@ -/* $Id: timer_symbian.cpp 2394 2008-12-23 17:27:53Z bennylp $ */ -/* - * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) - * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> - * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#include <pj/timer.h> -#include <pj/pool.h> -#include <pj/assert.h> -#include <pj/errno.h> -#include <pj/lock.h> - -#include "os_symbian.h" - - -#define DEFAULT_MAX_TIMED_OUT_PER_POLL (64) - - -/** - * The implementation of timer heap. - */ -struct pj_timer_heap_t -{ - /** Maximum size of the heap. */ - pj_size_t max_size; - - /** Current size of the heap. */ - pj_size_t cur_size; - - /** Max timed out entries to process per poll. */ - unsigned max_entries_per_poll; -}; - - -////////////////////////////////////////////////////////////////////////////// -/** - * Active object for each timer entry. - */ -class CPjTimerEntry : public CActive -{ -public: - static CPjTimerEntry* NewL( pj_timer_heap_t *timer_heap, - pj_timer_entry *entry, - const pj_time_val *delay); - - ~CPjTimerEntry(); - - virtual void RunL(); - virtual void DoCancel(); - -private: - pj_timer_heap_t *timer_heap_; - pj_timer_entry *entry_; - RTimer rtimer_; - - CPjTimerEntry(pj_timer_heap_t *timer_heap, pj_timer_entry *entry); - void ConstructL(const pj_time_val *delay); -}; - - -CPjTimerEntry::CPjTimerEntry(pj_timer_heap_t *timer_heap, - pj_timer_entry *entry) -: CActive(PJ_SYMBIAN_TIMER_PRIORITY), timer_heap_(timer_heap), entry_(entry) -{ -} - -CPjTimerEntry::~CPjTimerEntry() -{ - Cancel(); - rtimer_.Close(); -} - -void CPjTimerEntry::ConstructL(const pj_time_val *delay) -{ - rtimer_.CreateLocal(); - CActiveScheduler::Add(this); - - pj_int32_t interval = PJ_TIME_VAL_MSEC(*delay) * 1000; - if (interval < 0) { - interval = 0; - } - rtimer_.After(iStatus, interval); - SetActive(); -} - -CPjTimerEntry* CPjTimerEntry::NewL(pj_timer_heap_t *timer_heap, - pj_timer_entry *entry, - const pj_time_val *delay) -{ - CPjTimerEntry *self = new CPjTimerEntry(timer_heap, entry); - CleanupStack::PushL(self); - self->ConstructL(delay); - CleanupStack::Pop(self); - - return self; -} - -void CPjTimerEntry::RunL() -{ - --timer_heap_->cur_size; - entry_->_timer_id = NULL; - entry_->cb(timer_heap_, entry_); - - // Finger's crossed! - delete this; -} - -void CPjTimerEntry::DoCancel() -{ - rtimer_.Cancel(); -} - - -////////////////////////////////////////////////////////////////////////////// - - -/* - * Calculate memory size required to create a timer heap. - */ -PJ_DEF(pj_size_t) pj_timer_heap_mem_size(pj_size_t count) -{ - return /* size of the timer heap itself: */ - sizeof(pj_timer_heap_t) + - /* size of each entry: */ - (count+2) * (sizeof(pj_timer_entry*)+sizeof(pj_timer_id_t)) + - /* lock, pool etc: */ - 132; -} - -/* - * Create a new timer heap. - */ -PJ_DEF(pj_status_t) pj_timer_heap_create( pj_pool_t *pool, - pj_size_t size, - pj_timer_heap_t **p_heap) -{ - pj_timer_heap_t *ht; - - PJ_ASSERT_RETURN(pool && p_heap, PJ_EINVAL); - - *p_heap = NULL; - - /* Allocate timer heap data structure from the pool */ - ht = PJ_POOL_ALLOC_T(pool, pj_timer_heap_t); - if (!ht) - return PJ_ENOMEM; - - /* Initialize timer heap sizes */ - ht->max_size = size; - ht->cur_size = 0; - ht->max_entries_per_poll = DEFAULT_MAX_TIMED_OUT_PER_POLL; - - *p_heap = ht; - return PJ_SUCCESS; -} - -PJ_DEF(void) pj_timer_heap_destroy( pj_timer_heap_t *ht ) -{ - PJ_UNUSED_ARG(ht); -} - -PJ_DEF(void) pj_timer_heap_set_lock( pj_timer_heap_t *ht, - pj_lock_t *lock, - pj_bool_t auto_del ) -{ - PJ_UNUSED_ARG(ht); - if (auto_del) - pj_lock_destroy(lock); -} - - -PJ_DEF(unsigned) pj_timer_heap_set_max_timed_out_per_poll(pj_timer_heap_t *ht, - unsigned count ) -{ - unsigned old_count = ht->max_entries_per_poll; - ht->max_entries_per_poll = count; - return old_count; -} - -PJ_DEF(pj_timer_entry*) pj_timer_entry_init( pj_timer_entry *entry, - int id, - void *user_data, - pj_timer_heap_callback *cb ) -{ - pj_assert(entry && cb); - - entry->_timer_id = NULL; - entry->id = id; - entry->user_data = user_data; - entry->cb = cb; - - return entry; -} - -PJ_DEF(pj_status_t) pj_timer_heap_schedule( pj_timer_heap_t *ht, - pj_timer_entry *entry, - const pj_time_val *delay) -{ - CPjTimerEntry *timerObj; - - PJ_ASSERT_RETURN(ht && entry && delay, PJ_EINVAL); - PJ_ASSERT_RETURN(entry->cb != NULL, PJ_EINVAL); - - /* Prevent same entry from being scheduled more than once */ - PJ_ASSERT_RETURN(entry->_timer_id == NULL, PJ_EINVALIDOP); - - timerObj = CPjTimerEntry::NewL(ht, entry, delay); - entry->_timer_id = (void*) timerObj; - - ++ht->cur_size; - return PJ_SUCCESS; -} - -PJ_DEF(int) pj_timer_heap_cancel( pj_timer_heap_t *ht, - pj_timer_entry *entry) -{ - PJ_ASSERT_RETURN(ht && entry, PJ_EINVAL); - - if (entry->_timer_id != NULL) { - CPjTimerEntry *timerObj = (CPjTimerEntry*) entry->_timer_id; - timerObj->Cancel(); - delete timerObj; - entry->_timer_id = NULL; - --ht->cur_size; - return 1; - } else { - return 0; - } -} - -PJ_DEF(unsigned) pj_timer_heap_poll( pj_timer_heap_t *ht, - pj_time_val *next_delay ) -{ - /* Polling is not necessary on Symbian, since all async activities - * are registered to active scheduler. - */ - PJ_UNUSED_ARG(ht); - if (next_delay) { - next_delay->sec = 1; - next_delay->msec = 0; - } - return 0; -} - -PJ_DEF(pj_size_t) pj_timer_heap_count( pj_timer_heap_t *ht ) -{ - PJ_ASSERT_RETURN(ht, 0); - - return ht->cur_size; -} - -PJ_DEF(pj_status_t) pj_timer_heap_earliest_time( pj_timer_heap_t * ht, - pj_time_val *timeval) -{ - /* We don't support this! */ - PJ_UNUSED_ARG(ht); - - timeval->sec = 1; - timeval->msec = 0; - - return PJ_SUCCESS; -} - diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/symbian_sound.cpp b/sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/symbian_sound.cpp deleted file mode 100644 index 9aa762fa408205ffe6e5d175a484e058e82bade9..0000000000000000000000000000000000000000 --- a/sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/symbian_sound.cpp +++ /dev/null @@ -1,944 +0,0 @@ -/* $Id: symbian_sound.cpp 2394 2008-12-23 17:27:53Z bennylp $ */ -/* - * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) - * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> - * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#include <pjmedia/sound.h> -#include <pjmedia/errno.h> -#include <pj/assert.h> -#include <pj/log.h> -#include <pj/os.h> - - -/* - * This file provides sound implementation for Symbian Audio Streaming - * device. Application using this sound abstraction must link with: - * - mediaclientaudiostream.lib, and - * - mediaclientaudioinputstream.lib - */ -#include <mda/common/audio.h> -#include <mdaaudiooutputstream.h> -#include <mdaaudioinputstream.h> - - - -////////////////////////////////////////////////////////////////////////////// -// - -#define THIS_FILE "symbian_sound.cpp" -#define BYTES_PER_SAMPLE 2 -#define POOL_NAME "SymbianSound" -#define POOL_SIZE 512 -#define POOL_INC 512 - -static pjmedia_snd_dev_info symbian_snd_dev_info = -{ - "Symbian Sound Device", - 1, - 1, - 8000 -}; - -class CPjAudioInputEngine; -class CPjAudioOutputEngine; - -/* - * PJMEDIA Sound Stream instance - */ -struct pjmedia_snd_stream -{ - // Pool - pj_pool_t *pool; - - // Common settings. - pjmedia_dir dir; - unsigned clock_rate; - unsigned channel_count; - unsigned samples_per_frame; - - // Input stream - CPjAudioInputEngine *inEngine; - - // Output stream - CPjAudioOutputEngine *outEngine; -}; - -static pj_pool_factory *snd_pool_factory; - - -/* - * Convert clock rate to Symbian's TMdaAudioDataSettings capability. - */ -static TInt get_clock_rate_cap(unsigned clock_rate) -{ - switch (clock_rate) { - case 8000: return TMdaAudioDataSettings::ESampleRate8000Hz; - case 11025: return TMdaAudioDataSettings::ESampleRate11025Hz; - case 12000: return TMdaAudioDataSettings::ESampleRate12000Hz; - case 16000: return TMdaAudioDataSettings::ESampleRate16000Hz; - case 22050: return TMdaAudioDataSettings::ESampleRate22050Hz; - case 24000: return TMdaAudioDataSettings::ESampleRate24000Hz; - case 32000: return TMdaAudioDataSettings::ESampleRate32000Hz; - case 44100: return TMdaAudioDataSettings::ESampleRate44100Hz; - case 48000: return TMdaAudioDataSettings::ESampleRate48000Hz; - case 64000: return TMdaAudioDataSettings::ESampleRate64000Hz; - case 96000: return TMdaAudioDataSettings::ESampleRate96000Hz; - default: - return 0; - } -} - - -/* - * Convert number of channels into Symbian's TMdaAudioDataSettings capability. - */ -static TInt get_channel_cap(unsigned channel_count) -{ - switch (channel_count) { - case 1: return TMdaAudioDataSettings::EChannelsMono; - case 2: return TMdaAudioDataSettings::EChannelsStereo; - default: - return 0; - } -} - - -/* - * Utility: print sound device error - */ -static void snd_perror(const char *title, TInt rc) -{ - PJ_LOG(1,(THIS_FILE, "%s: error code %d", title, rc)); -} - -////////////////////////////////////////////////////////////////////////////// -// - -/* - * Implementation: Symbian Input Stream. - */ -class CPjAudioInputEngine : public CBase, MMdaAudioInputStreamCallback -{ -public: - enum State - { - STATE_INACTIVE, - STATE_ACTIVE, - }; - - ~CPjAudioInputEngine(); - - static CPjAudioInputEngine *NewL(pjmedia_snd_stream *parent_strm, - pjmedia_snd_rec_cb rec_cb, - void *user_data); - - static CPjAudioInputEngine *NewLC(pjmedia_snd_stream *parent_strm, - pjmedia_snd_rec_cb rec_cb, - void *user_data); - - pj_status_t StartRecord(); - void Stop(); - -private: - State state_; - pjmedia_snd_stream *parentStrm_; - pjmedia_snd_rec_cb recCb_; - void *userData_; - CMdaAudioInputStream *iInputStream_; - HBufC8 *iStreamBuffer_; - TPtr8 iFramePtr_; - TInt lastError_; - pj_uint32_t timeStamp_; - - // cache variable - // to avoid calculating frame length repeatedly - TInt frameLen_; - - // in some SymbianOS (e.g: OSv9.1), sometimes recorded size != requested framesize - // so let's provide a buffer to make sure the rec callback returns framesize as requested. - TUint8 *frameRecBuf_; - TInt frameRecBufLen_; - - CPjAudioInputEngine(pjmedia_snd_stream *parent_strm, - pjmedia_snd_rec_cb rec_cb, - void *user_data); - void ConstructL(); - TPtr8 & GetFrame(); - -public: - virtual void MaiscOpenComplete(TInt aError); - virtual void MaiscBufferCopied(TInt aError, const TDesC8 &aBuffer); - virtual void MaiscRecordComplete(TInt aError); - -}; - - -CPjAudioInputEngine::CPjAudioInputEngine(pjmedia_snd_stream *parent_strm, - pjmedia_snd_rec_cb rec_cb, - void *user_data) - : state_(STATE_INACTIVE), parentStrm_(parent_strm), - recCb_(rec_cb), userData_(user_data), - iInputStream_(NULL), iStreamBuffer_(NULL), iFramePtr_(0, 0), - lastError_(KErrNone), timeStamp_(0), - frameLen_(parent_strm->samples_per_frame * parent_strm->channel_count * BYTES_PER_SAMPLE), - frameRecBuf_(NULL), frameRecBufLen_(0) -{ -} - -CPjAudioInputEngine::~CPjAudioInputEngine() -{ - Stop(); - - delete iStreamBuffer_; - iStreamBuffer_ = NULL; - - delete [] frameRecBuf_; - frameRecBuf_ = NULL; - frameRecBufLen_ = 0; -} - -void CPjAudioInputEngine::ConstructL() -{ - iStreamBuffer_ = HBufC8::NewL(frameLen_); - CleanupStack::PushL(iStreamBuffer_); - - frameRecBuf_ = new TUint8[frameLen_*2]; - CleanupStack::PushL(frameRecBuf_); -} - -CPjAudioInputEngine *CPjAudioInputEngine::NewLC(pjmedia_snd_stream *parent, - pjmedia_snd_rec_cb rec_cb, - void *user_data) -{ - CPjAudioInputEngine* self = new (ELeave) CPjAudioInputEngine(parent, - rec_cb, - user_data); - CleanupStack::PushL(self); - self->ConstructL(); - return self; -} - -CPjAudioInputEngine *CPjAudioInputEngine::NewL(pjmedia_snd_stream *parent, - pjmedia_snd_rec_cb rec_cb, - void *user_data) -{ - CPjAudioInputEngine *self = NewLC(parent, rec_cb, user_data); - CleanupStack::Pop(self->frameRecBuf_); - CleanupStack::Pop(self->iStreamBuffer_); - CleanupStack::Pop(self); - return self; -} - - -pj_status_t CPjAudioInputEngine::StartRecord() -{ - - // Ignore command if recording is in progress. - if (state_ == STATE_ACTIVE) - return PJ_SUCCESS; - - // According to Nokia's AudioStream example, some 2nd Edition, FP2 devices - // (such as Nokia 6630) require the stream to be reconstructed each time - // before calling Open() - otherwise the callback never gets called. - // For uniform behavior, lets just delete/re-create the stream for all - // devices. - - // Destroy existing stream. - if (iInputStream_) delete iInputStream_; - iInputStream_ = NULL; - - // Create the stream. - TRAPD(err, iInputStream_ = CMdaAudioInputStream::NewL(*this)); - if (err != KErrNone) - return PJ_RETURN_OS_ERROR(err); - - // Initialize settings. - TMdaAudioDataSettings iStreamSettings; - iStreamSettings.iChannels = get_channel_cap(parentStrm_->channel_count); - iStreamSettings.iSampleRate = get_clock_rate_cap(parentStrm_->clock_rate); - - pj_assert(iStreamSettings.iChannels != 0 && - iStreamSettings.iSampleRate != 0); - - PJ_LOG(4,(THIS_FILE, "Opening sound device for capture, " - "clock rate=%d, channel count=%d..", - parentStrm_->clock_rate, - parentStrm_->channel_count)); - - // Open stream. - lastError_ = KRequestPending; - iInputStream_->Open(&iStreamSettings); - - // Success - PJ_LOG(4,(THIS_FILE, "Sound capture started.")); - return PJ_SUCCESS; -} - - -void CPjAudioInputEngine::Stop() -{ - // If capture is in progress, stop it. - if (iInputStream_ && state_ == STATE_ACTIVE) { - lastError_ = KRequestPending; - iInputStream_->Stop(); - - // Wait until it's actually stopped - while (lastError_ == KRequestPending) - pj_symbianos_poll(-1, 100); - } - - if (iInputStream_) { - delete iInputStream_; - iInputStream_ = NULL; - } - - state_ = STATE_INACTIVE; -} - - -TPtr8 & CPjAudioInputEngine::GetFrame() -{ - //iStreamBuffer_->Des().FillZ(frameLen_); - iFramePtr_.Set((TUint8*)(iStreamBuffer_->Ptr()), frameLen_, frameLen_); - return iFramePtr_; -} - -void CPjAudioInputEngine::MaiscOpenComplete(TInt aError) -{ - lastError_ = aError; - if (aError != KErrNone) { - snd_perror("Error in MaiscOpenComplete()", aError); - return; - } - - // set stream priority to normal and time sensitive - iInputStream_->SetPriority(EPriorityNormal, - EMdaPriorityPreferenceTime); - - // Read the first frame. - TPtr8 & frm = GetFrame(); - TRAPD(err2, iInputStream_->ReadL(frm)); - if (err2) { - PJ_LOG(4,(THIS_FILE, "Exception in iInputStream_->ReadL()")); - } -} - -void CPjAudioInputEngine::MaiscBufferCopied(TInt aError, - const TDesC8 &aBuffer) -{ - lastError_ = aError; - if (aError != KErrNone) { - snd_perror("Error in MaiscBufferCopied()", aError); - return; - } - - if (frameRecBufLen_ || aBuffer.Size() < frameLen_) { - pj_memcpy(frameRecBuf_ + frameRecBufLen_, (void*) aBuffer.Ptr(), aBuffer.Size()); - frameRecBufLen_ += aBuffer.Size(); - } - - if (frameRecBufLen_) { - while (frameRecBufLen_ >= frameLen_) { - // Call the callback. - recCb_(userData_, timeStamp_, frameRecBuf_, frameLen_); - // Increment timestamp. - timeStamp_ += parentStrm_->samples_per_frame; - - frameRecBufLen_ -= frameLen_; - pj_memmove(frameRecBuf_, frameRecBuf_+frameLen_, frameRecBufLen_); - } - } else { - // Call the callback. - recCb_(userData_, timeStamp_, (void*) aBuffer.Ptr(), aBuffer.Size()); - // Increment timestamp. - timeStamp_ += parentStrm_->samples_per_frame; - } - - // Record next frame - TPtr8 & frm = GetFrame(); - TRAPD(err2, iInputStream_->ReadL(frm)); - if (err2) { - PJ_LOG(4,(THIS_FILE, "Exception in iInputStream_->ReadL()")); - } -} - - -void CPjAudioInputEngine::MaiscRecordComplete(TInt aError) -{ - lastError_ = aError; - state_ = STATE_INACTIVE; - if (aError != KErrNone) { - snd_perror("Error in MaiscRecordComplete()", aError); - } -} - - - -////////////////////////////////////////////////////////////////////////////// -// - -/* - * Implementation: Symbian Output Stream. - */ - -class CPjAudioOutputEngine : public CBase, MMdaAudioOutputStreamCallback -{ -public: - enum State - { - STATE_INACTIVE, - STATE_ACTIVE, - }; - - ~CPjAudioOutputEngine(); - - static CPjAudioOutputEngine *NewL(pjmedia_snd_stream *parent_strm, - pjmedia_snd_play_cb play_cb, - void *user_data); - - static CPjAudioOutputEngine *NewLC(pjmedia_snd_stream *parent_strm, - pjmedia_snd_play_cb rec_cb, - void *user_data); - - pj_status_t StartPlay(); - void Stop(); - -private: - State state_; - pjmedia_snd_stream *parentStrm_; - pjmedia_snd_play_cb playCb_; - void *userData_; - CMdaAudioOutputStream *iOutputStream_; - TUint8 *frameBuf_; - unsigned frameBufSize_; - TPtrC8 frame_; - TInt lastError_; - unsigned timestamp_; - - CPjAudioOutputEngine(pjmedia_snd_stream *parent_strm, - pjmedia_snd_play_cb play_cb, - void *user_data); - void ConstructL(); - - virtual void MaoscOpenComplete(TInt aError); - virtual void MaoscBufferCopied(TInt aError, const TDesC8& aBuffer); - virtual void MaoscPlayComplete(TInt aError); -}; - - -CPjAudioOutputEngine::CPjAudioOutputEngine(pjmedia_snd_stream *parent_strm, - pjmedia_snd_play_cb play_cb, - void *user_data) -: state_(STATE_INACTIVE), parentStrm_(parent_strm), playCb_(play_cb), - userData_(user_data), iOutputStream_(NULL), frameBuf_(NULL), - lastError_(KErrNone), timestamp_(0) -{ -} - - -void CPjAudioOutputEngine::ConstructL() -{ - frameBufSize_ = parentStrm_->samples_per_frame * - parentStrm_->channel_count * - BYTES_PER_SAMPLE; - frameBuf_ = new TUint8[frameBufSize_]; -} - -CPjAudioOutputEngine::~CPjAudioOutputEngine() -{ - Stop(); - delete [] frameBuf_; -} - -CPjAudioOutputEngine * -CPjAudioOutputEngine::NewLC(pjmedia_snd_stream *parent_strm, - pjmedia_snd_play_cb rec_cb, - void *user_data) -{ - CPjAudioOutputEngine* self = new (ELeave) CPjAudioOutputEngine(parent_strm, - rec_cb, - user_data); - CleanupStack::PushL(self); - self->ConstructL(); - return self; -} - -CPjAudioOutputEngine * -CPjAudioOutputEngine::NewL(pjmedia_snd_stream *parent_strm, - pjmedia_snd_play_cb play_cb, - void *user_data) -{ - CPjAudioOutputEngine *self = NewLC(parent_strm, play_cb, user_data); - CleanupStack::Pop(self); - return self; -} - -pj_status_t CPjAudioOutputEngine::StartPlay() -{ - // Ignore command if playing is in progress. - if (state_ == STATE_ACTIVE) - return PJ_SUCCESS; - - // Destroy existing stream. - if (iOutputStream_) delete iOutputStream_; - iOutputStream_ = NULL; - - // Create the stream - TRAPD(err, iOutputStream_ = CMdaAudioOutputStream::NewL(*this)); - if (err != KErrNone) - return PJ_RETURN_OS_ERROR(err); - - // Initialize settings. - TMdaAudioDataSettings iStreamSettings; - iStreamSettings.iChannels = get_channel_cap(parentStrm_->channel_count); - iStreamSettings.iSampleRate = get_clock_rate_cap(parentStrm_->clock_rate); - - pj_assert(iStreamSettings.iChannels != 0 && - iStreamSettings.iSampleRate != 0); - - PJ_LOG(4,(THIS_FILE, "Opening sound device for playback, " - "clock rate=%d, channel count=%d..", - parentStrm_->clock_rate, - parentStrm_->channel_count)); - - // Open stream. - lastError_ = KRequestPending; - iOutputStream_->Open(&iStreamSettings); - - // Success - PJ_LOG(4,(THIS_FILE, "Sound playback started")); - return PJ_SUCCESS; - -} - -void CPjAudioOutputEngine::Stop() -{ - // Stop stream if it's playing - if (iOutputStream_ && state_ != STATE_INACTIVE) { - lastError_ = KRequestPending; - iOutputStream_->Stop(); - - // Wait until it's actually stopped - while (lastError_ == KRequestPending) - pj_symbianos_poll(-1, 100); - } - - if (iOutputStream_) { - delete iOutputStream_; - iOutputStream_ = NULL; - } - - state_ = STATE_INACTIVE; -} - -void CPjAudioOutputEngine::MaoscOpenComplete(TInt aError) -{ - lastError_ = aError; - - if (aError==KErrNone) { - // output stream opened succesfully, set status to Active - state_ = STATE_ACTIVE; - - // set stream properties, 16bit 8KHz mono - TMdaAudioDataSettings iSettings; - iSettings.iChannels = get_channel_cap(parentStrm_->channel_count); - iSettings.iSampleRate = get_clock_rate_cap(parentStrm_->clock_rate); - - iOutputStream_->SetAudioPropertiesL(iSettings.iSampleRate, - iSettings.iChannels); - - // set volume to 1/2th of stream max volume - iOutputStream_->SetVolume(iOutputStream_->MaxVolume()/2); - - // set stream priority to normal and time sensitive - iOutputStream_->SetPriority(EPriorityNormal, - EMdaPriorityPreferenceTime); - - // Call callback to retrieve frame from upstream. - pj_status_t status; - status = playCb_(this->userData_, timestamp_, frameBuf_, - frameBufSize_); - if (status != PJ_SUCCESS) { - this->Stop(); - return; - } - - // Increment timestamp. - timestamp_ += (frameBufSize_ / BYTES_PER_SAMPLE); - - // issue WriteL() to write the first audio data block, - // subsequent calls to WriteL() will be issued in - // MMdaAudioOutputStreamCallback::MaoscBufferCopied() - // until whole data buffer is written. - frame_.Set(frameBuf_, frameBufSize_); - iOutputStream_->WriteL(frame_); - } else { - snd_perror("Error in MaoscOpenComplete()", aError); - } -} - -void CPjAudioOutputEngine::MaoscBufferCopied(TInt aError, - const TDesC8& aBuffer) -{ - PJ_UNUSED_ARG(aBuffer); - - if (aError==KErrNone) { - // Buffer successfully written, feed another one. - - // Call callback to retrieve frame from upstream. - pj_status_t status; - status = playCb_(this->userData_, timestamp_, frameBuf_, - frameBufSize_); - if (status != PJ_SUCCESS) { - this->Stop(); - return; - } - - // Increment timestamp. - timestamp_ += (frameBufSize_ / BYTES_PER_SAMPLE); - - // Write to playback stream. - frame_.Set(frameBuf_, frameBufSize_); - iOutputStream_->WriteL(frame_); - - } else if (aError==KErrAbort) { - // playing was aborted, due to call to CMdaAudioOutputStream::Stop() - state_ = STATE_INACTIVE; - } else { - // error writing data to output - lastError_ = aError; - state_ = STATE_INACTIVE; - snd_perror("Error in MaoscBufferCopied()", aError); - } -} - -void CPjAudioOutputEngine::MaoscPlayComplete(TInt aError) -{ - lastError_ = aError; - state_ = STATE_INACTIVE; - if (aError != KErrNone) { - snd_perror("Error in MaoscPlayComplete()", aError); - } -} - - -////////////////////////////////////////////////////////////////////////////// -// - - -/* - * Initialize sound subsystem. - */ -PJ_DEF(pj_status_t) pjmedia_snd_init(pj_pool_factory *factory) -{ - snd_pool_factory = factory; - return PJ_SUCCESS; -} - -/* - * Get device count. - */ -PJ_DEF(int) pjmedia_snd_get_dev_count(void) -{ - /* Always return 1 */ - return 1; -} - -/* - * Get device info. - */ -PJ_DEF(const pjmedia_snd_dev_info*) pjmedia_snd_get_dev_info(unsigned index) -{ - /* Always return the default sound device */ - if (index == (unsigned)-1) - index = 0; - - PJ_ASSERT_RETURN(index==0, NULL); - return &symbian_snd_dev_info; -} - - - -/* - * Open sound recorder stream. - */ -PJ_DEF(pj_status_t) pjmedia_snd_open_rec( int index, - unsigned clock_rate, - unsigned channel_count, - unsigned samples_per_frame, - unsigned bits_per_sample, - pjmedia_snd_rec_cb rec_cb, - void *user_data, - pjmedia_snd_stream **p_snd_strm) -{ - pj_pool_t *pool; - pjmedia_snd_stream *strm; - - if (index==-1) index = 0; - - PJ_ASSERT_RETURN(index == 0, PJ_EINVAL); - PJ_ASSERT_RETURN(clock_rate && channel_count && samples_per_frame && - bits_per_sample && rec_cb && p_snd_strm, PJ_EINVAL); - - pool = pj_pool_create(snd_pool_factory, POOL_NAME, POOL_SIZE, POOL_INC, - NULL); - if (!pool) - return PJ_ENOMEM; - - strm = (pjmedia_snd_stream*) pj_pool_zalloc(pool, - sizeof(pjmedia_snd_stream)); - strm->dir = PJMEDIA_DIR_CAPTURE; - strm->pool = pool; - strm->clock_rate = clock_rate; - strm->channel_count = channel_count; - strm->samples_per_frame = samples_per_frame; - - PJ_ASSERT_RETURN(bits_per_sample == 16, PJ_EINVAL); - PJ_ASSERT_RETURN(get_clock_rate_cap(clock_rate) != 0, PJ_EINVAL); - PJ_ASSERT_RETURN(get_channel_cap(channel_count) != 0, PJ_EINVAL); - - // Create the input stream. - TRAPD(err, strm->inEngine = CPjAudioInputEngine::NewL(strm, rec_cb, - user_data)); - if (err != KErrNone) { - pj_pool_release(pool); - return PJ_RETURN_OS_ERROR(err); - } - - // Done. - *p_snd_strm = strm; - return PJ_SUCCESS; -} - -PJ_DEF(pj_status_t) pjmedia_snd_open_player( int index, - unsigned clock_rate, - unsigned channel_count, - unsigned samples_per_frame, - unsigned bits_per_sample, - pjmedia_snd_play_cb play_cb, - void *user_data, - pjmedia_snd_stream **p_snd_strm ) -{ - pj_pool_t *pool; - pjmedia_snd_stream *strm; - - if (index == -1) index = 0; - - PJ_ASSERT_RETURN(index == 0, PJ_EINVAL); - PJ_ASSERT_RETURN(clock_rate && channel_count && samples_per_frame && - bits_per_sample && play_cb && p_snd_strm, PJ_EINVAL); - - pool = pj_pool_create(snd_pool_factory, POOL_NAME, POOL_SIZE, POOL_INC, - NULL); - if (!pool) - return PJ_ENOMEM; - - strm = (pjmedia_snd_stream*) pj_pool_zalloc(pool, - sizeof(pjmedia_snd_stream)); - strm->dir = PJMEDIA_DIR_PLAYBACK; - strm->pool = pool; - strm->clock_rate = clock_rate; - strm->channel_count = channel_count; - strm->samples_per_frame = samples_per_frame; - - PJ_ASSERT_RETURN(bits_per_sample == 16, PJ_EINVAL); - PJ_ASSERT_RETURN(get_clock_rate_cap(clock_rate) != 0, PJ_EINVAL); - PJ_ASSERT_RETURN(get_channel_cap(channel_count) != 0, PJ_EINVAL); - - // Create the output stream. - TRAPD(err, strm->outEngine = CPjAudioOutputEngine::NewL(strm, play_cb, - user_data)); - if (err != KErrNone) { - pj_pool_release(pool); - return PJ_RETURN_OS_ERROR(err); - } - - // Done. - *p_snd_strm = strm; - return PJ_SUCCESS; -} - -PJ_DEF(pj_status_t) pjmedia_snd_open( int rec_id, - int play_id, - unsigned clock_rate, - unsigned channel_count, - unsigned samples_per_frame, - unsigned bits_per_sample, - pjmedia_snd_rec_cb rec_cb, - pjmedia_snd_play_cb play_cb, - void *user_data, - pjmedia_snd_stream **p_snd_strm) -{ - pj_pool_t *pool; - pjmedia_snd_stream *strm; - - if (rec_id == -1) rec_id = 0; - if (play_id == -1) play_id = 0; - - PJ_ASSERT_RETURN(rec_id == 0 && play_id == 0, PJ_EINVAL); - PJ_ASSERT_RETURN(clock_rate && channel_count && samples_per_frame && - bits_per_sample && rec_cb && play_cb && p_snd_strm, - PJ_EINVAL); - - pool = pj_pool_create(snd_pool_factory, POOL_NAME, POOL_SIZE, POOL_INC, - NULL); - if (!pool) - return PJ_ENOMEM; - - strm = (pjmedia_snd_stream*) pj_pool_zalloc(pool, - sizeof(pjmedia_snd_stream)); - strm->dir = PJMEDIA_DIR_CAPTURE_PLAYBACK; - strm->pool = pool; - strm->clock_rate = clock_rate; - strm->channel_count = channel_count; - strm->samples_per_frame = samples_per_frame; - - PJ_ASSERT_RETURN(bits_per_sample == 16, PJ_EINVAL); - PJ_ASSERT_RETURN(get_clock_rate_cap(clock_rate) != 0, PJ_EINVAL); - PJ_ASSERT_RETURN(get_channel_cap(channel_count) != 0, PJ_EINVAL); - - // Create the output stream. - TRAPD(err, strm->outEngine = CPjAudioOutputEngine::NewL(strm, play_cb, - user_data)); - if (err != KErrNone) { - pj_pool_release(pool); - return PJ_RETURN_OS_ERROR(err); - } - - // Create the input stream. - TRAPD(err1, strm->inEngine = CPjAudioInputEngine::NewL(strm, rec_cb, - user_data)); - if (err1 != KErrNone) { - strm->inEngine = NULL; - delete strm->outEngine; - strm->outEngine = NULL; - pj_pool_release(pool); - return PJ_RETURN_OS_ERROR(err1); - } - - // Done. - *p_snd_strm = strm; - return PJ_SUCCESS; -} - -/* - * Get stream info. - */ -PJ_DEF(pj_status_t) pjmedia_snd_stream_get_info(pjmedia_snd_stream *strm, - pjmedia_snd_stream_info *pi) -{ - PJ_ASSERT_RETURN(strm && pi, PJ_EINVAL); - - pj_bzero(pi, sizeof(*pi)); - pi->dir = strm->dir; - pi->play_id = 0; - pi->rec_id = 0; - pi->clock_rate = strm->clock_rate; - pi->channel_count = strm->channel_count; - pi->samples_per_frame = strm->samples_per_frame; - pi->bits_per_sample = BYTES_PER_SAMPLE * 8; - // Symbian uses 4096 bytes buffer (~2048 samples/256 ms) for PCM rec & play. - // The latencies below are rounded up to be a multiplication of 80. - pi->rec_latency = 2080; - pi->play_latency = 2080; - - return PJ_SUCCESS; -} - - -PJ_DEF(pj_status_t) pjmedia_snd_stream_start(pjmedia_snd_stream *stream) -{ - pj_status_t status; - - PJ_ASSERT_RETURN(stream != NULL, PJ_EINVAL); - - if (stream->outEngine) { - status = stream->outEngine->StartPlay(); - if (status != PJ_SUCCESS) - return status; - } - - if (stream->inEngine) { - status = stream->inEngine->StartRecord(); - if (status != PJ_SUCCESS) - return status; - } - - return PJ_SUCCESS; -} - - -PJ_DEF(pj_status_t) pjmedia_snd_stream_stop(pjmedia_snd_stream *stream) -{ - PJ_ASSERT_RETURN(stream != NULL, PJ_EINVAL); - - if (stream->inEngine) { - stream->inEngine->Stop(); - } - - if (stream->outEngine) { - stream->outEngine->Stop(); - } - - return PJ_SUCCESS; -} - - -PJ_DEF(pj_status_t) pjmedia_snd_stream_close(pjmedia_snd_stream *stream) -{ - pj_pool_t *pool; - - PJ_ASSERT_RETURN(stream != NULL, PJ_EINVAL); - - if (stream->inEngine) { - delete stream->inEngine; - stream->inEngine = NULL; - } - - if (stream->outEngine) { - delete stream->outEngine; - stream->outEngine = NULL; - } - - pool = stream->pool; - if (pool) { - stream->pool = NULL; - pj_pool_release(pool); - } - - return PJ_SUCCESS; -} - - -PJ_DEF(pj_status_t) pjmedia_snd_deinit(void) -{ - /* Nothing to do */ - return PJ_SUCCESS; -} - - -/* - * Set sound latency. - */ -PJ_DEF(pj_status_t) pjmedia_snd_set_latency(unsigned input_latency, - unsigned output_latency) -{ - /* Nothing to do */ - PJ_UNUSED_ARG(input_latency); - PJ_UNUSED_ARG(output_latency); - return PJ_SUCCESS; -} diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/symbian_sound_aps.cpp b/sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/symbian_sound_aps.cpp deleted file mode 100644 index 4240769c34151829b82e72c936da3ae79ebc2523..0000000000000000000000000000000000000000 --- a/sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/symbian_sound_aps.cpp +++ /dev/null @@ -1,826 +0,0 @@ -/* $Id: symbian_sound_aps.cpp 2394 2008-12-23 17:27:53Z bennylp $ */ -/* - * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) - * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> - * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#include <pjmedia/sound.h> -#include <pjmedia/alaw_ulaw.h> -#include <pjmedia/errno.h> -#include <pj/assert.h> -#include <pj/log.h> -#include <pj/os.h> - -#include <e32msgqueue.h> -#include <sounddevice.h> -#include <APSClientSession.h> - -////////////////////////////////////////////////////////////////////////////// -// - -#define THIS_FILE "symbian_sound_aps.cpp" - -#define BYTES_PER_SAMPLE 2 -#define POOL_NAME "SymbianSoundAps" -#define POOL_SIZE 512 -#define POOL_INC 512 - -#if 1 -# define TRACE_(st) PJ_LOG(3, st) -#else -# define TRACE_(st) -#endif - -static pjmedia_snd_dev_info symbian_snd_dev_info = -{ - "Symbian Sound Device (APS)", - 1, - 1, - 8000 -}; - -/* App UID to open global APS queues to communicate with the APS server. */ -extern TPtrC APP_UID; - -/* Default setting for loudspeaker */ -static pj_bool_t act_loudspeaker = PJ_FALSE; - -/* Forward declaration of CPjAudioEngine */ -class CPjAudioEngine; - -/* - * PJMEDIA Sound Stream instance - */ -struct pjmedia_snd_stream -{ - // Pool - pj_pool_t *pool; - - // Common settings. - pjmedia_dir dir; - unsigned clock_rate; - unsigned channel_count; - unsigned samples_per_frame; - - // Audio engine - CPjAudioEngine *engine; -}; - -static pj_pool_factory *snd_pool_factory; - - -/* - * Utility: print sound device error - */ -static void snd_perror(const char *title, TInt rc) -{ - PJ_LOG(1,(THIS_FILE, "%s (error code=%d)", title, rc)); -} - -////////////////////////////////////////////////////////////////////////////// -// - -/** - * Abstract class for handler of callbacks from APS client. - */ -class MQueueHandlerObserver -{ -public: - virtual void InputStreamInitialized(const TInt aStatus) = 0; - virtual void OutputStreamInitialized(const TInt aStatus) = 0; - virtual void NotifyError(const TInt aError) = 0; - - virtual void RecCb(TAPSCommBuffer &buffer) = 0; - virtual void PlayCb(TAPSCommBuffer &buffer) = 0; -}; - -/** - * Handler for communication and data queue. - */ -class CQueueHandler : public CActive -{ -public: - // Types of queue handler - enum TQueueHandlerType { - ERecordCommQueue, - EPlayCommQueue, - ERecordQueue, - EPlayQueue - }; - - // The order corresponds to the APS Server state, do not change! - enum TState { - EAPSPlayerInitialize = 1, - EAPSRecorderInitialize = 2, - EAPSPlayData = 3, - EAPSRecordData = 4, - EAPSPlayerInitComplete = 5, - EAPSRecorderInitComplete = 6 - }; - - static CQueueHandler* NewL(MQueueHandlerObserver* aObserver, - RMsgQueue<TAPSCommBuffer>* aQ, - TQueueHandlerType aType) - { - CQueueHandler* self = new (ELeave) CQueueHandler(aObserver, aQ, aType); - CleanupStack::PushL(self); - self->ConstructL(); - CleanupStack::Pop(self); - return self; - } - - // Destructor - ~CQueueHandler() { Cancel(); } - - // Start listening queue event - void Start() { - iQ->NotifyDataAvailable(iStatus); - SetActive(); - } - -private: - // Constructor - CQueueHandler(MQueueHandlerObserver* aObserver, - RMsgQueue<TAPSCommBuffer>* aQ, - TQueueHandlerType aType) - : CActive(CActive::EPriorityHigh), - iQ(aQ), iObserver(aObserver), iType(aType) - { - CActiveScheduler::Add(this); - - // use lower priority for comm queues - if ((iType == ERecordCommQueue) || (iType == EPlayCommQueue)) - SetPriority(CActive::EPriorityStandard); - } - - // Second phase constructor - void ConstructL() {} - - // Inherited from CActive - void DoCancel() { iQ->CancelDataAvailable(); } - - void RunL() { - if (iStatus != KErrNone) { - iObserver->NotifyError(iStatus.Int()); - return; - } - - TAPSCommBuffer buffer; - TInt ret = iQ->Receive(buffer); - - if (ret != KErrNone) { - iObserver->NotifyError(ret); - return; - } - - switch (iType) { - case ERecordQueue: - if (buffer.iCommand == EAPSRecordData) { - iObserver->RecCb(buffer); - } - break; - - // Callbacks from the APS main thread - case EPlayCommQueue: - switch (buffer.iCommand) { - case EAPSPlayData: - if (buffer.iStatus == KErrUnderflow) { - iObserver->PlayCb(buffer); - } - break; - case EAPSPlayerInitialize: - iObserver->NotifyError(buffer.iStatus); - break; - case EAPSPlayerInitComplete: - iObserver->OutputStreamInitialized(buffer.iStatus); - break; - case EAPSRecorderInitComplete: - iObserver->InputStreamInitialized(buffer.iStatus); - break; - default: - iObserver->NotifyError(buffer.iStatus); - break; - } - break; - - // Callbacks from the APS recorder thread - case ERecordCommQueue: - switch (buffer.iCommand) { - // The APS recorder thread will only report errors - // through this handler. All other callbacks will be - // sent from the APS main thread through EPlayCommQueue - case EAPSRecorderInitialize: - if (buffer.iStatus == KErrNone) { - iObserver->InputStreamInitialized(buffer.iStatus); - break; - } - case EAPSRecordData: - iObserver->NotifyError(buffer.iStatus); - break; - default: - break; - } - break; - - default: - break; - } - - // issue next request - iQ->NotifyDataAvailable(iStatus); - SetActive(); - } - - // Data - RMsgQueue<TAPSCommBuffer> *iQ; // (not owned) - MQueueHandlerObserver *iObserver; // (not owned) - TQueueHandlerType iType; -}; - - -/* - * Implementation: Symbian Input & Output Stream. - */ -class CPjAudioEngine : public CBase, MQueueHandlerObserver -{ -public: - enum State - { - STATE_NULL, - STATE_READY, - STATE_STREAMING - }; - - ~CPjAudioEngine(); - - static CPjAudioEngine *NewL(pjmedia_snd_stream *parent_strm, - pjmedia_dir dir, - pjmedia_snd_rec_cb rec_cb, - pjmedia_snd_play_cb play_cb, - void *user_data); - - TInt StartL(); - void Stop(); - - TInt ActivateSpeaker(TBool active); - -private: - CPjAudioEngine(pjmedia_snd_stream *parent_strm, - pjmedia_dir dir, - pjmedia_snd_rec_cb rec_cb, - pjmedia_snd_play_cb play_cb, - void *user_data); - void ConstructL(); - - TInt InitPlayL(); - TInt InitRecL(); - TInt StartStreamL(); - - // Inherited from MQueueHandlerObserver - virtual void InputStreamInitialized(const TInt aStatus); - virtual void OutputStreamInitialized(const TInt aStatus); - virtual void NotifyError(const TInt aError); - - virtual void RecCb(TAPSCommBuffer &buffer); - virtual void PlayCb(TAPSCommBuffer &buffer); - - State state_; - pjmedia_snd_stream *parentStrm_; - pjmedia_dir dir_; - pjmedia_snd_rec_cb recCb_; - pjmedia_snd_play_cb playCb_; - void *userData_; - pj_uint32_t TsPlay_; - pj_uint32_t TsRec_; - - RAPSSession iSession; - TAPSInitSettings iSettings; - RMsgQueue<TAPSCommBuffer> iReadQ; - RMsgQueue<TAPSCommBuffer> iReadCommQ; - RMsgQueue<TAPSCommBuffer> iWriteQ; - RMsgQueue<TAPSCommBuffer> iWriteCommQ; - - CQueueHandler *iPlayCommHandler; - CQueueHandler *iRecCommHandler; - CQueueHandler *iRecHandler; -}; - - -CPjAudioEngine* CPjAudioEngine::NewL(pjmedia_snd_stream *parent_strm, - pjmedia_dir dir, - pjmedia_snd_rec_cb rec_cb, - pjmedia_snd_play_cb play_cb, - void *user_data) -{ - CPjAudioEngine* self = new (ELeave) CPjAudioEngine(parent_strm, dir, - rec_cb, play_cb, - user_data); - CleanupStack::PushL(self); - self->ConstructL(); - CleanupStack::Pop(self); - return self; -} - -CPjAudioEngine::CPjAudioEngine(pjmedia_snd_stream *parent_strm, - pjmedia_dir dir, - pjmedia_snd_rec_cb rec_cb, - pjmedia_snd_play_cb play_cb, - void *user_data) - : state_(STATE_NULL), - parentStrm_(parent_strm), - dir_(dir), - recCb_(rec_cb), - playCb_(play_cb), - userData_(user_data), - iPlayCommHandler(0), - iRecCommHandler(0), - iRecHandler(0) -{ -} - -CPjAudioEngine::~CPjAudioEngine() -{ - Stop(); - - delete iPlayCommHandler; - iPlayCommHandler = NULL; - delete iRecCommHandler; - iRecCommHandler = NULL; - - iSession.Close(); - - if (state_ == STATE_READY) { - if (dir_ != PJMEDIA_DIR_PLAYBACK) { - iReadQ.Close(); - iReadCommQ.Close(); - } - iWriteQ.Close(); - iWriteCommQ.Close(); - } -} - -TInt CPjAudioEngine::InitPlayL() -{ - if (state_ == STATE_STREAMING || state_ == STATE_READY) - return 0; - - TInt err = iSession.InitializePlayer(iSettings); - if (err != KErrNone) { - snd_perror("Failed to initialize player", err); - return err; - } - - // Open message queues for the output stream - TBuf<128> buf2 = iSettings.iGlobal; - buf2.Append(_L("PlayQueue")); - TBuf<128> buf3 = iSettings.iGlobal; - buf3.Append(_L("PlayCommQueue")); - - while (iWriteQ.OpenGlobal(buf2)) - User::After(10); - while (iWriteCommQ.OpenGlobal(buf3)) - User::After(10); - - // Construct message queue handler - iPlayCommHandler = CQueueHandler::NewL(this, - &iWriteCommQ, - CQueueHandler::EPlayCommQueue); - - // Start observing APS callbacks on output stream message queue - iPlayCommHandler->Start(); - - return 0; -} - -TInt CPjAudioEngine::InitRecL() -{ - if (state_ == STATE_STREAMING || state_ == STATE_READY) - return 0; - - // Initialize input stream device - TInt err = iSession.InitializeRecorder(iSettings); - if (err != KErrNone) { - snd_perror("Failed to initialize recorder", err); - return err; - } - - TBuf<128> buf1 = iSettings.iGlobal; - buf1.Append(_L("RecordQueue")); - TBuf<128> buf4 = iSettings.iGlobal; - buf4.Append(_L("RecordCommQueue")); - - // Must wait for APS thread to finish creating message queues - // before we can open and use them. - while (iReadQ.OpenGlobal(buf1)) - User::After(10); - while (iReadCommQ.OpenGlobal(buf4)) - User::After(10); - - // Construct message queue handlers - iRecCommHandler = CQueueHandler::NewL(this, - &iReadCommQ, - CQueueHandler::ERecordCommQueue); - - // Start observing APS callbacks from on input stream message queue - iRecCommHandler->Start(); - - return 0; -} - -TInt CPjAudioEngine::StartL() -{ - TInt err = iSession.Connect(); - if (err != KErrNone && err != KErrAlreadyExists) - return err; - - if (state_ == STATE_READY) - return StartStreamL(); - - // Even if only capturer are opened, playback thread of APS Server need - // to be run(?). Since some messages will be delivered via play comm queue. - return InitPlayL(); -} - -void CPjAudioEngine::Stop() -{ - iSession.Stop(); - - delete iRecHandler; - iRecHandler = NULL; - - state_ = STATE_READY; -} - -void CPjAudioEngine::ConstructL() -{ - iSettings.iFourCC = TFourCC(KMCPFourCCIdG711); - iSettings.iGlobal = APP_UID; - iSettings.iPriority = TMdaPriority(100); - iSettings.iPreference = TMdaPriorityPreference(0x05210001); - iSettings.iSettings.iChannels = EMMFMono; - iSettings.iSettings.iSampleRate = EMMFSampleRate8000Hz; - iSettings.iSettings.iVolume = 0; -} - -TInt CPjAudioEngine::StartStreamL() -{ - if (state_ == STATE_STREAMING) - return 0; - - iSession.SetCng(EFalse); - iSession.SetVadMode(EFalse); - iSession.SetPlc(EFalse); - iSession.SetEncoderMode(EALawOr20ms); - iSession.SetDecoderMode(EALawOr20ms); - iSession.ActivateLoudspeaker(act_loudspeaker); - - // Not only playback - if (dir_ != PJMEDIA_DIR_PLAYBACK) { - iRecHandler = CQueueHandler::NewL(this, &iReadQ, - CQueueHandler::ERecordQueue); - iRecHandler->Start(); - iSession.Read(); - } - - // Not only capture - if (dir_ != PJMEDIA_DIR_CAPTURE) { - iSession.Write(); - } - - state_ = STATE_STREAMING; - return 0; -} - -// Inherited from MQueueHandlerObserver -void CPjAudioEngine::InputStreamInitialized(const TInt aStatus) -{ - TRACE_((THIS_FILE, "InputStreamInitialized %d", aStatus)); - - state_ = STATE_READY; - if (aStatus == KErrNone) { - StartStreamL(); - } -} - -void CPjAudioEngine::OutputStreamInitialized(const TInt aStatus) -{ - TRACE_((THIS_FILE, "OutputStreamInitialized %d", aStatus)); - - if (aStatus == KErrNone) { - if (dir_ == PJMEDIA_DIR_PLAYBACK) { - state_ = STATE_READY; - // Only playback, start directly - StartStreamL(); - } else - InitRecL(); - } -} - -void CPjAudioEngine::NotifyError(const TInt aError) -{ - snd_perror("Error from CQueueHandler", aError); -} - -void CPjAudioEngine::RecCb(TAPSCommBuffer &buffer) -{ - pj_int16_t buf[160]; - pj_assert(buffer.iBuffer[0] == 1 && buffer.iBuffer[1] == 0); - - for (int i=0; i<160; ++i) - buf[i] = pjmedia_alaw2linear(buffer.iBuffer[i+2]); - - recCb_(userData_, 0, buf, sizeof(buf)); -} - -void CPjAudioEngine::PlayCb(TAPSCommBuffer &buffer) -{ - pj_int16_t buf[160]; - - playCb_(userData_, 0, buf, sizeof(buf)); - - buffer.iCommand = CQueueHandler::EAPSPlayData; - buffer.iStatus = 0; - buffer.iBuffer.Zero(); - buffer.iBuffer.Append(1); - buffer.iBuffer.Append(0); - for (int i=0; i<160; ++i) - buffer.iBuffer.Append(pjmedia_linear2alaw(buf[i])); - - iWriteQ.Send(buffer); -} - - -TInt CPjAudioEngine::ActivateSpeaker(TBool active) -{ - if (state_ == STATE_READY || state_ == STATE_STREAMING) { - iSession.ActivateLoudspeaker(active); - return KErrNone; - } - return KErrNotReady; -} -////////////////////////////////////////////////////////////////////////////// -// - - -/* - * Initialize sound subsystem. - */ -PJ_DEF(pj_status_t) pjmedia_snd_init(pj_pool_factory *factory) -{ - snd_pool_factory = factory; - return PJ_SUCCESS; -} - -/* - * Get device count. - */ -PJ_DEF(int) pjmedia_snd_get_dev_count(void) -{ - /* Always return 1 */ - return 1; -} - -/* - * Get device info. - */ -PJ_DEF(const pjmedia_snd_dev_info*) pjmedia_snd_get_dev_info(unsigned index) -{ - /* Always return the default sound device */ - if (index == (unsigned)-1) - index = 0; - - PJ_ASSERT_RETURN(index==0, NULL); - return &symbian_snd_dev_info; -} - -static pj_status_t sound_open(pjmedia_dir dir, - unsigned clock_rate, - unsigned channel_count, - unsigned samples_per_frame, - unsigned bits_per_sample, - pjmedia_snd_rec_cb rec_cb, - pjmedia_snd_play_cb play_cb, - void *user_data, - pjmedia_snd_stream **p_snd_strm) -{ - pj_pool_t *pool; - pjmedia_snd_stream *strm; - - PJ_ASSERT_RETURN(p_snd_strm, PJ_EINVAL); - PJ_ASSERT_RETURN(clock_rate == 8000 && channel_count == 1 && - bits_per_sample == 16, PJ_ENOTSUP); - PJ_ASSERT_RETURN((dir == PJMEDIA_DIR_CAPTURE_PLAYBACK && rec_cb && play_cb) - || (dir == PJMEDIA_DIR_CAPTURE && rec_cb && !play_cb) - || (dir == PJMEDIA_DIR_PLAYBACK && !rec_cb && play_cb), - PJ_EINVAL); - - pool = pj_pool_create(snd_pool_factory, POOL_NAME, POOL_SIZE, POOL_INC, - NULL); - if (!pool) - return PJ_ENOMEM; - - strm = (pjmedia_snd_stream*) pj_pool_zalloc(pool, - sizeof(pjmedia_snd_stream)); - strm->dir = dir; - strm->pool = pool; - strm->clock_rate = clock_rate; - strm->channel_count = channel_count; - strm->samples_per_frame = samples_per_frame; - - // Create the audio engine. - TRAPD(err, strm->engine = CPjAudioEngine::NewL(strm, strm->dir, - rec_cb, play_cb, - user_data)); - if (err != KErrNone) { - pj_pool_release(pool); - return PJ_RETURN_OS_ERROR(err); - } - - // Done. - *p_snd_strm = strm; - return PJ_SUCCESS; -} - - - -/* - * Open sound recorder stream. - */ -PJ_DEF(pj_status_t) pjmedia_snd_open_rec( int index, - unsigned clock_rate, - unsigned channel_count, - unsigned samples_per_frame, - unsigned bits_per_sample, - pjmedia_snd_rec_cb rec_cb, - void *user_data, - pjmedia_snd_stream **p_snd_strm) -{ - if (index < 0) index = 0; - PJ_ASSERT_RETURN(index == 0, PJ_EINVAL); - - return sound_open(PJMEDIA_DIR_CAPTURE, clock_rate, channel_count, - samples_per_frame, bits_per_sample, rec_cb, NULL, - user_data, p_snd_strm); -} - -PJ_DEF(pj_status_t) pjmedia_snd_open_player( int index, - unsigned clock_rate, - unsigned channel_count, - unsigned samples_per_frame, - unsigned bits_per_sample, - pjmedia_snd_play_cb play_cb, - void *user_data, - pjmedia_snd_stream **p_snd_strm ) -{ - if (index < 0) index = 0; - PJ_ASSERT_RETURN(index == 0, PJ_EINVAL); - - return sound_open(PJMEDIA_DIR_PLAYBACK, clock_rate, channel_count, - samples_per_frame, bits_per_sample, NULL, play_cb, - user_data, p_snd_strm); -} - -PJ_DEF(pj_status_t) pjmedia_snd_open( int rec_id, - int play_id, - unsigned clock_rate, - unsigned channel_count, - unsigned samples_per_frame, - unsigned bits_per_sample, - pjmedia_snd_rec_cb rec_cb, - pjmedia_snd_play_cb play_cb, - void *user_data, - pjmedia_snd_stream **p_snd_strm) -{ - if (rec_id < 0) rec_id = 0; - if (play_id < 0) play_id = 0; - PJ_ASSERT_RETURN(play_id == 0 && rec_id == 0, PJ_EINVAL); - - return sound_open(PJMEDIA_DIR_CAPTURE_PLAYBACK, clock_rate, channel_count, - samples_per_frame, bits_per_sample, rec_cb, play_cb, - user_data, p_snd_strm); -} - -/* - * Get stream info. - */ -PJ_DEF(pj_status_t) pjmedia_snd_stream_get_info(pjmedia_snd_stream *strm, - pjmedia_snd_stream_info *pi) -{ - PJ_ASSERT_RETURN(strm && pi, PJ_EINVAL); - - pj_bzero(pi, sizeof(*pi)); - pi->dir = strm->dir; - pi->play_id = 0; - pi->rec_id = 0; - pi->clock_rate = strm->clock_rate; - pi->channel_count = strm->channel_count; - pi->samples_per_frame = strm->samples_per_frame; - pi->bits_per_sample = BYTES_PER_SAMPLE * 8; - // latencies approximation (in samples) - pi->rec_latency = strm->samples_per_frame * 2; - pi->play_latency = strm->samples_per_frame * 2; - - return PJ_SUCCESS; -} - - -PJ_DEF(pj_status_t) pjmedia_snd_stream_start(pjmedia_snd_stream *stream) -{ - PJ_ASSERT_RETURN(stream != NULL, PJ_EINVAL); - - if (stream->engine) { - TInt err = stream->engine->StartL(); - if (err != KErrNone) - return PJ_RETURN_OS_ERROR(err); - } - - return PJ_SUCCESS; -} - - -PJ_DEF(pj_status_t) pjmedia_snd_stream_stop(pjmedia_snd_stream *stream) -{ - PJ_ASSERT_RETURN(stream != NULL, PJ_EINVAL); - - if (stream->engine) { - stream->engine->Stop(); - } - - return PJ_SUCCESS; -} - - -PJ_DEF(pj_status_t) pjmedia_snd_stream_close(pjmedia_snd_stream *stream) -{ - pj_pool_t *pool; - - PJ_ASSERT_RETURN(stream != NULL, PJ_EINVAL); - - if (stream->engine) { - delete stream->engine; - stream->engine = NULL; - } - - pool = stream->pool; - if (pool) { - stream->pool = NULL; - pj_pool_release(pool); - } - - return PJ_SUCCESS; -} - - -PJ_DEF(pj_status_t) pjmedia_snd_deinit(void) -{ - /* Nothing to do */ - return PJ_SUCCESS; -} - - -/* - * Set sound latency. - */ -PJ_DEF(pj_status_t) pjmedia_snd_set_latency(unsigned input_latency, - unsigned output_latency) -{ - /* Nothing to do */ - PJ_UNUSED_ARG(input_latency); - PJ_UNUSED_ARG(output_latency); - return PJ_SUCCESS; -} - - -/* - * Activate/deactivate loudspeaker. - */ -PJ_DEF(pj_status_t) pjmedia_snd_aps_activate_loudspeaker( - pjmedia_snd_stream *stream, - pj_bool_t active) -{ - if (stream == NULL) { - act_loudspeaker = active; - } else { - if (stream->engine == NULL) - return PJ_EINVAL; - - TInt err = stream->engine->ActivateSpeaker(active); - if (err != KErrNone) - return PJ_RETURN_OS_ERROR(err); - } - - return PJ_SUCCESS; -} diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/pjsua_wince/pjsua_wince.cpp b/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/pjsua_wince/pjsua_wince.cpp deleted file mode 100644 index 1e9bbb169268ecc9e278ce73d9fad8d708a9e649..0000000000000000000000000000000000000000 --- a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/pjsua_wince/pjsua_wince.cpp +++ /dev/null @@ -1,761 +0,0 @@ -// pjsua_wince.cpp : Defines the entry point for the application. -// - -#include "stdafx.h" -#include "pjsua_wince.h" -#include <commctrl.h> -#include <pjsua-lib/pjsua.h> - -#define MAX_LOADSTRING 100 - -// Global Variables: -static HINSTANCE hInst; -static HWND hMainWnd; -static HWND hwndCB; -static HWND hwndGlobalStatus, hwndURI, hwndCallStatus; -static HWND hwndActionButton, hwndExitButton; - - - -// -// Basic config. -// -#define SIP_PORT 5060 - - -// -// Destination URI (to make call, or to subscribe presence) -// -#define SIP_DST_URI "sip:192.168.0.7:5061" - -// -// Account -// -#define HAS_SIP_ACCOUNT 0 // 0 to disable registration -#define SIP_DOMAIN "server" -#define SIP_REALM "server" -#define SIP_USER "user" -#define SIP_PASSWD "secret" - -// -// Outbound proxy for all accounts -// -#define SIP_PROXY NULL -//#define SIP_PROXY "sip:192.168.0.2;lr" - - -// -// Configure nameserver if DNS SRV is to be used with both SIP -// or STUN (for STUN see other settings below) -// -#define NAMESERVER NULL -//#define NAMESERVER "62.241.163.201" - -// -// STUN server -#if 1 - // Use this to have the STUN server resolved normally -# define STUN_DOMAIN NULL -# define STUN_SERVER "stun.fwdnet.net" -#elif 0 - // Use this to have the STUN server resolved with DNS SRV -# define STUN_DOMAIN "iptel.org" -# define STUN_SERVER NULL -#else - // Use this to disable STUN -# define STUN_DOMAIN NULL -# define STUN_SERVER NULL -#endif - -// -// Use ICE? -// -#define USE_ICE 1 - - -// -// Globals -// -static pj_pool_t *g_pool; -static pj_str_t g_local_uri; -static int g_current_acc; -static int g_current_call = PJSUA_INVALID_ID; -static int g_current_action; - -enum -{ - ID_GLOBAL_STATUS = 21, - ID_URI, - ID_CALL_STATUS, - ID_POLL_TIMER, -}; - -enum -{ - ID_MENU_NONE = 64, - ID_MENU_CALL, - ID_MENU_ANSWER, - ID_MENU_DISCONNECT, - ID_BTN_ACTION, -}; - - -// Forward declarations of functions included in this code module: -static ATOM MyRegisterClass (HINSTANCE, LPTSTR); -BOOL InitInstance (HINSTANCE, int); -static void OnCreate (HWND hWnd); -static LRESULT CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM); - - - -///////////////////////////////////////////////////////////////////////////// - -static void OnError(const wchar_t *title, pj_status_t status) -{ - char errmsg[PJ_ERR_MSG_SIZE]; - PJ_DECL_UNICODE_TEMP_BUF(werrmsg, PJ_ERR_MSG_SIZE); - - pj_strerror(status, errmsg, sizeof(errmsg)); - - MessageBox(NULL, PJ_STRING_TO_NATIVE(errmsg, werrmsg, PJ_ERR_MSG_SIZE), - title, MB_OK); -} - - -static void SetLocalURI(const char *uri, int len, bool enabled=true) -{ - wchar_t tmp[128]; - if (len==-1) len=pj_ansi_strlen(uri); - pj_ansi_to_unicode(uri, len, tmp, PJ_ARRAY_SIZE(tmp)); - SetDlgItemText(hMainWnd, ID_GLOBAL_STATUS, tmp); - EnableWindow(hwndGlobalStatus, enabled?TRUE:FALSE); -} - - - -static void SetURI(const char *uri, int len, bool enabled=true) -{ - wchar_t tmp[128]; - if (len==-1) len=pj_ansi_strlen(uri); - pj_ansi_to_unicode(uri, len, tmp, PJ_ARRAY_SIZE(tmp)); - SetDlgItemText(hMainWnd, ID_URI, tmp); - EnableWindow(hwndURI, enabled?TRUE:FALSE); -} - - -static void SetCallStatus(const char *state, int len) -{ - wchar_t tmp[128]; - if (len==-1) len=pj_ansi_strlen(state); - pj_ansi_to_unicode(state, len, tmp, PJ_ARRAY_SIZE(tmp)); - SetDlgItemText(hMainWnd, ID_CALL_STATUS, tmp); -} - -static void SetAction(int action, bool enable=true) -{ - HMENU hMenu; - - hMenu = CommandBar_GetMenu(hwndCB, 0); - - RemoveMenu(hMenu, ID_MENU_NONE, MF_BYCOMMAND); - RemoveMenu(hMenu, ID_MENU_CALL, MF_BYCOMMAND); - RemoveMenu(hMenu, ID_MENU_ANSWER, MF_BYCOMMAND); - RemoveMenu(hMenu, ID_MENU_DISCONNECT, MF_BYCOMMAND); - - switch (action) { - case ID_MENU_NONE: - InsertMenu(hMenu, ID_EXIT, MF_BYCOMMAND, action, TEXT("None")); - SetWindowText(hwndActionButton, TEXT("-")); - break; - case ID_MENU_CALL: - InsertMenu(hMenu, ID_EXIT, MF_BYCOMMAND, action, TEXT("Call")); - SetWindowText(hwndActionButton, TEXT("&Call")); - break; - case ID_MENU_ANSWER: - InsertMenu(hMenu, ID_EXIT, MF_BYCOMMAND, action, TEXT("Answer")); - SetWindowText(hwndActionButton, TEXT("&Answer")); - break; - case ID_MENU_DISCONNECT: - InsertMenu(hMenu, ID_EXIT, MF_BYCOMMAND, action, TEXT("Hangup")); - SetWindowText(hwndActionButton, TEXT("&Hangup")); - break; - } - - EnableMenuItem(hMenu, action, MF_BYCOMMAND | (enable?MF_ENABLED:MF_GRAYED)); - DrawMenuBar(hMainWnd); - - g_current_action = action; -} - - -/* - * Handler when invite state has changed. - */ -static void on_call_state(pjsua_call_id call_id, pjsip_event *e) -{ - pjsua_call_info call_info; - - PJ_UNUSED_ARG(e); - - pjsua_call_get_info(call_id, &call_info); - - if (call_info.state == PJSIP_INV_STATE_DISCONNECTED) { - - g_current_call = PJSUA_INVALID_ID; - SetURI(SIP_DST_URI, -1); - SetAction(ID_MENU_CALL); - //SetCallStatus(call_info.state_text.ptr, call_info.state_text.slen); - SetCallStatus(call_info.last_status_text.ptr, call_info.last_status_text.slen); - - } else { - //if (g_current_call == PJSUA_INVALID_ID) - // g_current_call = call_id; - - if (call_info.remote_contact.slen) - SetURI(call_info.remote_contact.ptr, call_info.remote_contact.slen, false); - else - SetURI(call_info.remote_info.ptr, call_info.remote_info.slen, false); - - if (call_info.state == PJSIP_INV_STATE_CONFIRMED) - SetAction(ID_MENU_DISCONNECT); - - SetCallStatus(call_info.state_text.ptr, call_info.state_text.slen); - } -} - - -/* - * Callback on media state changed event. - * The action may connect the call to sound device, to file, or - * to loop the call. - */ -static void on_call_media_state(pjsua_call_id call_id) -{ - pjsua_call_info call_info; - - pjsua_call_get_info(call_id, &call_info); - - if (call_info.media_status == PJSUA_CALL_MEDIA_ACTIVE) { - pjsua_conf_connect(call_info.conf_slot, 0); - pjsua_conf_connect(0, call_info.conf_slot); - } -} - - -/** - * Handler when there is incoming call. - */ -static void on_incoming_call(pjsua_acc_id acc_id, pjsua_call_id call_id, - pjsip_rx_data *rdata) -{ - pjsua_call_info call_info; - - PJ_UNUSED_ARG(acc_id); - PJ_UNUSED_ARG(rdata); - - if (g_current_call != PJSUA_INVALID_ID) { - pj_str_t reason; - reason = pj_str("Another call is in progress"); - pjsua_call_answer(call_id, PJSIP_SC_BUSY_HERE, &reason, NULL); - return; - } - - g_current_call = call_id; - - pjsua_call_get_info(call_id, &call_info); - - SetAction(ID_MENU_ANSWER); - SetURI(call_info.remote_info.ptr, call_info.remote_info.slen, false); - pjsua_call_answer(call_id, 200, NULL, NULL); -} - - -/* - * Handler registration status has changed. - */ -static void on_reg_state(pjsua_acc_id acc_id) -{ - PJ_UNUSED_ARG(acc_id); - - // Log already written. -} - - -/* - * Handler on buddy state changed. - */ -static void on_buddy_state(pjsua_buddy_id buddy_id) -{ -} - - -/** - * Incoming IM message (i.e. MESSAGE request)! - */ -static void on_pager(pjsua_call_id call_id, const pj_str_t *from, - const pj_str_t *to, const pj_str_t *contact, - const pj_str_t *mime_type, const pj_str_t *text) -{ -} - - -/** - * Received typing indication - */ -static void on_typing(pjsua_call_id call_id, const pj_str_t *from, - const pj_str_t *to, const pj_str_t *contact, - pj_bool_t is_typing) -{ -} - - -static BOOL OnInitStack(void) -{ - pjsua_config cfg; - pjsua_logging_config log_cfg; - pjsua_media_config media_cfg; - pjsua_transport_config udp_cfg; - pjsua_transport_config rtp_cfg; - pjsua_transport_id transport_id; - pjsua_transport_info transport_info; - pj_str_t tmp; - pj_status_t status; - - /* Create pjsua */ - status = pjsua_create(); - if (status != PJ_SUCCESS) { - OnError(TEXT("Error creating pjsua"), status); - return FALSE; - } - - /* Create global pool for application */ - g_pool = pjsua_pool_create("pjsua", 4000, 4000); - - /* Init configs */ - pjsua_config_default(&cfg); - pjsua_media_config_default(&media_cfg); - pjsua_transport_config_default(&udp_cfg); - udp_cfg.port = SIP_PORT; - - pjsua_transport_config_default(&rtp_cfg); - rtp_cfg.port = 40000; - - pjsua_logging_config_default(&log_cfg); - log_cfg.level = 5; - log_cfg.log_filename = pj_str("\\pjsua.txt"); - log_cfg.msg_logging = 1; - log_cfg.decor = pj_log_get_decor() | PJ_LOG_HAS_CR; - - /* Setup media */ - media_cfg.clock_rate = 8000; - media_cfg.ec_options = PJMEDIA_ECHO_SIMPLE; - media_cfg.ec_tail_len = 256; - media_cfg.quality = 1; - media_cfg.ptime = 20; - media_cfg.enable_ice = USE_ICE; - - /* Initialize application callbacks */ - cfg.cb.on_call_state = &on_call_state; - cfg.cb.on_call_media_state = &on_call_media_state; - cfg.cb.on_incoming_call = &on_incoming_call; - cfg.cb.on_reg_state = &on_reg_state; - cfg.cb.on_buddy_state = &on_buddy_state; - cfg.cb.on_pager = &on_pager; - cfg.cb.on_typing = &on_typing; - - if (SIP_PROXY) { - cfg.outbound_proxy_cnt = 1; - cfg.outbound_proxy[0] = pj_str(SIP_PROXY); - } - - if (NAMESERVER) { - cfg.nameserver_count = 1; - cfg.nameserver[0] = pj_str(NAMESERVER); - } - - if (NAMESERVER && STUN_DOMAIN) { - cfg.stun_domain = pj_str(STUN_DOMAIN); - } else if (STUN_SERVER) { - cfg.stun_host = pj_str(STUN_SERVER); - } - - - /* Initialize pjsua */ - status = pjsua_init(&cfg, &log_cfg, &media_cfg); - if (status != PJ_SUCCESS) { - OnError(TEXT("Initialization error"), status); - return FALSE; - } - - /* Set codec priority */ - pjsua_codec_set_priority(pj_cstr(&tmp, "pcmu"), 240); - pjsua_codec_set_priority(pj_cstr(&tmp, "pcma"), 230); - pjsua_codec_set_priority(pj_cstr(&tmp, "speex/8000"), 190); - pjsua_codec_set_priority(pj_cstr(&tmp, "ilbc"), 189); - pjsua_codec_set_priority(pj_cstr(&tmp, "speex/16000"), 180); - pjsua_codec_set_priority(pj_cstr(&tmp, "speex/32000"), 0); - pjsua_codec_set_priority(pj_cstr(&tmp, "gsm"), 100); - - - /* Add UDP transport and the corresponding PJSUA account */ - status = pjsua_transport_create(PJSIP_TRANSPORT_UDP, - &udp_cfg, &transport_id); - if (status != PJ_SUCCESS) { - OnError(TEXT("Error starting SIP transport"), status); - return FALSE; - } - - pjsua_transport_get_info(transport_id, &transport_info); - - g_local_uri.ptr = (char*)pj_pool_alloc(g_pool, 128); - g_local_uri.slen = pj_ansi_sprintf(g_local_uri.ptr, - "<sip:%.*s:%d>", - (int)transport_info.local_name.host.slen, - transport_info.local_name.host.ptr, - transport_info.local_name.port); - - - /* Add local account */ - pjsua_acc_add_local(transport_id, PJ_TRUE, &g_current_acc); - pjsua_acc_set_online_status(g_current_acc, PJ_TRUE); - - /* Add account */ - if (HAS_SIP_ACCOUNT) { - pjsua_acc_config cfg; - - pjsua_acc_config_default(&cfg); - cfg.id = pj_str("sip:" SIP_USER "@" SIP_DOMAIN); - cfg.reg_uri = pj_str("sip:" SIP_DOMAIN); - cfg.cred_count = 1; - cfg.cred_info[0].realm = pj_str(SIP_REALM); - cfg.cred_info[0].scheme = pj_str("digest"); - cfg.cred_info[0].username = pj_str(SIP_USER); - cfg.cred_info[0].data_type = PJSIP_CRED_DATA_PLAIN_PASSWD; - cfg.cred_info[0].data = pj_str(SIP_PASSWD); - - status = pjsua_acc_add(&cfg, PJ_TRUE, &g_current_acc); - if (status != PJ_SUCCESS) { - pjsua_destroy(); - return PJ_FALSE; - } - } - - /* Add buddy */ - if (SIP_DST_URI) { - pjsua_buddy_config bcfg; - - pjsua_buddy_config_default(&bcfg); - bcfg.uri = pj_str(SIP_DST_URI); - bcfg.subscribe = PJ_FALSE; - - pjsua_buddy_add(&bcfg, NULL); - } - - /* Start pjsua */ - status = pjsua_start(); - if (status != PJ_SUCCESS) { - OnError(TEXT("Error starting pjsua"), status); - return FALSE; - } - - return TRUE; -} - - -////////////////////////////////////////////////////////////////////////////// - -int WINAPI WinMain(HINSTANCE hInstance, - HINSTANCE hPrevInstance, - LPTSTR lpCmdLine, - int nCmdShow) -{ - MSG msg; - HACCEL hAccelTable; - - - - // Perform application initialization: - if (!InitInstance (hInstance, nCmdShow)) - { - return FALSE; - } - - hAccelTable = LoadAccelerators(hInstance, (LPCTSTR)IDC_PJSUA_WINCE); - - - // Main message loop: - while (GetMessage(&msg, NULL, 0, 0)) - { - if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg)) - { - TranslateMessage(&msg); - DispatchMessage(&msg); - } - } - - return msg.wParam; -} - -static ATOM MyRegisterClass(HINSTANCE hInstance, LPTSTR szWindowClass) -{ - WNDCLASS wc; - - wc.style = CS_HREDRAW | CS_VREDRAW; - wc.lpfnWndProc = (WNDPROC) WndProc; - wc.cbClsExtra = 0; - wc.cbWndExtra = 0; - wc.hInstance = hInstance; - wc.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_PJSUA_WINCE)); - wc.hCursor = 0; - wc.hbrBackground = (HBRUSH) GetStockObject(WHITE_BRUSH); - wc.lpszMenuName = 0; - wc.lpszClassName = szWindowClass; - - return RegisterClass(&wc); -} - - -/* Callback upon NAT detection completion */ -static void nat_detect_cb(const pj_stun_nat_detect_result *res) -{ - if (res->status != PJ_SUCCESS) { - char msg[250]; - pj_ansi_snprintf(msg, sizeof(msg), "NAT detection failed: %s", - res->status_text); - SetCallStatus(msg, pj_ansi_strlen(msg)); - } else { - char msg[250]; - pj_ansi_snprintf(msg, sizeof(msg), "NAT type is %s", - res->nat_type_name); - SetCallStatus(msg, pj_ansi_strlen(msg)); - } -} - - -BOOL InitInstance(HINSTANCE hInstance, int nCmdShow) -{ - HWND hWnd; - TCHAR szTitle[MAX_LOADSTRING]; - TCHAR szWindowClass[MAX_LOADSTRING]; - - hInst = hInstance; - - /* Init stack */ - if (OnInitStack() == FALSE) - return FALSE; - - LoadString(hInstance, IDC_PJSUA_WINCE, szWindowClass, MAX_LOADSTRING); - MyRegisterClass(hInstance, szWindowClass); - - LoadString(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING); - hWnd = CreateWindow(szWindowClass, szTitle, WS_VISIBLE, - CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, 200, - NULL, NULL, hInstance, NULL); - - if (!hWnd) - { - return FALSE; - } - - hMainWnd = hWnd; - ShowWindow(hWnd, nCmdShow); - UpdateWindow(hWnd); - if (hwndCB) - CommandBar_Show(hwndCB, TRUE); - - SetTimer(hMainWnd, ID_POLL_TIMER, 50, NULL); - - pjsua_detect_nat_type(); - return TRUE; -} - - -static void OnCreate(HWND hWnd) -{ - enum - { - X = 10, - Y = 40, - W = 220, - H = 30, - }; - - DWORD dwStyle; - - hMainWnd = hWnd; - - hwndCB = CommandBar_Create(hInst, hWnd, 1); - CommandBar_InsertMenubar(hwndCB, hInst, IDM_MENU, 0); - CommandBar_AddAdornments(hwndCB, 0, 0); - - // Create global status text - dwStyle = WS_CHILD | WS_VISIBLE | WS_DISABLED | ES_LEFT; - hwndGlobalStatus = CreateWindow( - TEXT("EDIT"), // Class name - NULL, // Window text - dwStyle, // Window style - X, // x-coordinate of the upper-left corner - Y+0, // y-coordinate of the upper-left corner - W, // Width of the window for the edit - // control - H-5, // Height of the window for the edit - // control - hWnd, // Window handle to the parent window - (HMENU) ID_GLOBAL_STATUS, // Control identifier - hInst, // Instance handle - NULL); // Specify NULL for this parameter when - // you create a control - SetLocalURI(g_local_uri.ptr, g_local_uri.slen, false); - - - // Create URI edit - dwStyle = WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_BORDER; - hwndURI = CreateWindow ( - TEXT("EDIT"), // Class name - NULL, // Window text - dwStyle, // Window style - X, // x-coordinate of the upper-left corner - Y+H, // y-coordinate of the upper-left corner - W, // Width of the window for the edit - // control - H-5, // Height of the window for the edit - // control - hWnd, // Window handle to the parent window - (HMENU) ID_URI, // Control identifier - hInst, // Instance handle - NULL); // Specify NULL for this parameter when - // you create a control - - // Create action Button - hwndActionButton = CreateWindow( L"button", L"Action", - WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON, - X, Y+2*H, - 60, H-5, hWnd, - (HMENU) ID_BTN_ACTION, - hInst, NULL ); - - // Create exit button - hwndExitButton = CreateWindow( L"button", L"E&xit", - WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON, - X+70, Y+2*H, - 60, H-5, hWnd, - (HMENU) ID_EXIT, - hInst, NULL ); - - - // Create call status edit - dwStyle = WS_CHILD | WS_VISIBLE | WS_DISABLED; - hwndCallStatus = CreateWindow ( - TEXT("EDIT"), // Class name - NULL, // Window text - dwStyle, // Window style - X, // x-coordinate of the upper-left corner - Y+3*H, // y-coordinate of the upper-left corner - W, // Width of the window for the edit - // control - H-5, // Height of the window for the edit - // control - hWnd, // Window handle to the parent window - (HMENU) ID_CALL_STATUS, // Control identifier - hInst, // Instance handle - NULL); // Specify NULL for this parameter when - // you create a control - SetCallStatus("Ready", 5); - SetAction(ID_MENU_CALL); - SetURI(SIP_DST_URI, -1); - SetFocus(hWnd); - -} - - -static void OnDestroy(void) -{ - pjsua_destroy(); -} - -static LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) -{ - int wmId, wmEvent; - - switch (message) { - case WM_KEYUP: - if (wParam==114) { - wParam = ID_MENU_CALL; - } else if (wParam==115) { - if (g_current_call == PJSUA_INVALID_ID) - wParam = ID_EXIT; - else - wParam = ID_MENU_DISCONNECT; - } else - break; - - case WM_COMMAND: - wmId = LOWORD(wParam); - wmEvent = HIWORD(wParam); - if (wmId == ID_BTN_ACTION) - wmId = g_current_action; - switch (wmId) - { - case ID_MENU_CALL: - if (g_current_call != PJSUA_INVALID_ID) { - MessageBox(NULL, TEXT("Can not make call"), - TEXT("You already have one call active"), MB_OK); - } - pj_str_t dst_uri; - wchar_t text[256]; - char tmp[256]; - pj_status_t status; - - GetWindowText(hwndURI, text, PJ_ARRAY_SIZE(text)); - pj_unicode_to_ansi(text, pj_unicode_strlen(text), - tmp, sizeof(tmp)); - dst_uri.ptr = tmp; - dst_uri.slen = pj_ansi_strlen(tmp); - status = pjsua_call_make_call(g_current_acc, - &dst_uri, 0, NULL, - NULL, &g_current_call); - if (status != PJ_SUCCESS) - OnError(TEXT("Unable to make call"), status); - break; - case ID_MENU_ANSWER: - if (g_current_call == PJSUA_INVALID_ID) - MessageBox(NULL, TEXT("Can not answer"), - TEXT("There is no call!"), MB_OK); - else - pjsua_call_answer(g_current_call, 200, NULL, NULL); - break; - case ID_MENU_DISCONNECT: - if (g_current_call == PJSUA_INVALID_ID) - MessageBox(NULL, TEXT("Can not disconnect"), - TEXT("There is no call!"), MB_OK); - else - pjsua_call_hangup(g_current_call, PJSIP_SC_DECLINE, NULL, NULL); - break; - case ID_EXIT: - DestroyWindow(hWnd); - break; - default: - return DefWindowProc(hWnd, message, wParam, lParam); - } - break; - - case WM_CREATE: - OnCreate(hWnd); - break; - - case WM_DESTROY: - OnDestroy(); - CommandBar_Destroy(hwndCB); - PostQuitMessage(0); - break; - - case WM_TIMER: - pjsua_handle_events(1); - break; - - default: - return DefWindowProc(hWnd, message, wParam, lParam); - } - return 0; -} - diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/pocketpj/PocketPJ.cpp b/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/pocketpj/PocketPJ.cpp deleted file mode 100644 index 2d42d96e2ea3f8e259bbfb5dc4ab2966ea01d874..0000000000000000000000000000000000000000 --- a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/pocketpj/PocketPJ.cpp +++ /dev/null @@ -1,66 +0,0 @@ -// PocketPJ.cpp : Defines the class behaviors for the application. -// - -#include "stdafx.h" -#include "PocketPJ.h" -#include "PocketPJDlg.h" - -#ifdef _DEBUG -#define new DEBUG_NEW -#undef THIS_FILE -static char THIS_FILE[] = __FILE__; -#endif - -///////////////////////////////////////////////////////////////////////////// -// CPocketPJApp - -BEGIN_MESSAGE_MAP(CPocketPJApp, CWinApp) - //{{AFX_MSG_MAP(CPocketPJApp) - // NOTE - the ClassWizard will add and remove mapping macros here. - // DO NOT EDIT what you see in these blocks of generated code! - //}}AFX_MSG_MAP -END_MESSAGE_MAP() - -///////////////////////////////////////////////////////////////////////////// -// CPocketPJApp construction - -CPocketPJApp::CPocketPJApp() - : CWinApp() -{ - // TODO: add construction code here, - // Place all significant initialization in InitInstance -} - -///////////////////////////////////////////////////////////////////////////// -// The one and only CPocketPJApp object - -CPocketPJApp theApp; - -///////////////////////////////////////////////////////////////////////////// -// CPocketPJApp initialization - -BOOL CPocketPJApp::InitInstance() -{ - // Standard initialization - // If you are not using these features and wish to reduce the size - // of your final executable, you should remove from the following - // the specific initialization routines you do not need. - - CPocketPJDlg dlg; - m_pMainWnd = &dlg; - int nResponse = dlg.DoModal(); - if (nResponse == IDOK) - { - // TODO: Place code here to handle when the dialog is - // dismissed with OK - } - else if (nResponse == IDCANCEL) - { - // TODO: Place code here to handle when the dialog is - // dismissed with Cancel - } - - // Since the dialog has been closed, return FALSE so that we exit the - // application, rather than start the application's message pump. - return FALSE; -} diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/pocketpj/PocketPJDlg.cpp b/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/pocketpj/PocketPJDlg.cpp deleted file mode 100644 index 6178f6c67177c9fba037d23533b92ea9d4b64b60..0000000000000000000000000000000000000000 --- a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/pocketpj/PocketPJDlg.cpp +++ /dev/null @@ -1,749 +0,0 @@ -// PocketPJDlg.cpp : implementation file -// - -#include "stdafx.h" -#include "PocketPJ.h" -#include "PocketPJDlg.h" -#include <iphlpapi.h> - -#ifdef _DEBUG -#define new DEBUG_NEW -#undef THIS_FILE -static char THIS_FILE[] = __FILE__; -#endif - -#define TIMER_ID 101 -static CPocketPJDlg *theDlg; - -///////////////////////////////////////////////////////////////////////////// -// CPocketPJDlg dialog - -CPocketPJDlg::CPocketPJDlg(CWnd* pParent /*=NULL*/) - : CDialog(CPocketPJDlg::IDD, pParent), m_PopUp(NULL) -{ - //{{AFX_DATA_INIT(CPocketPJDlg) - // NOTE: the ClassWizard will add member initialization here - //}}AFX_DATA_INIT - // Note that LoadIcon does not require a subsequent DestroyIcon in Win32 - m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME); - - theDlg = this; - - m_PopUp = new CPopUpWnd(this); - m_PopUp->Hide(); - - unsigned i; - m_PopUpCount = 0; - for (i=0; i<POPUP_MAX_TYPE; ++i) { - m_PopUpState[i] = FALSE; - } -} - -void CPocketPJDlg::DoDataExchange(CDataExchange* pDX) -{ - CDialog::DoDataExchange(pDX); - //{{AFX_DATA_MAP(CPocketPJDlg) - DDX_Control(pDX, IDC_URL, m_Url); - DDX_Control(pDX, IDC_BUDDY_LIST, m_BuddyList); - DDX_Control(pDX, IDC_BTN_ACTION, m_BtnUrlAction); - DDX_Control(pDX, IDC_BTN_ACC, m_BtnAcc); - DDX_Control(pDX, IDC_ACC_ID, m_AccId); - //}}AFX_DATA_MAP -} - -BEGIN_MESSAGE_MAP(CPocketPJDlg, CDialog) - //{{AFX_MSG_MAP(CPocketPJDlg) - ON_BN_CLICKED(IDC_BTN_ACC, OnBtnAcc) - ON_BN_CLICKED(IDC_BTN_ACTION, OnBtnAction) - ON_COMMAND(IDC_ACC_SETTINGS, OnSettings) - ON_COMMAND(IDC_URI_CALL, OnUriCall) - ON_WM_TIMER() - ON_COMMAND(IDC_URI_ADD_BUDDY, OnUriAddBuddy) - ON_COMMAND(IDC_URI_DEL_BUDDY, OnUriDelBuddy) - ON_COMMAND(IDC_ACC_ONLINE, OnAccOnline) - ON_COMMAND(IDC_ACC_INVISIBLE, OnAccInvisible) - ON_NOTIFY(NM_CLICK, IDC_BUDDY_LIST, OnClickBuddyList) - //}}AFX_MSG_MAP -END_MESSAGE_MAP() - - -void CPocketPJDlg::Error(const CString &title, pj_status_t rc) -{ - char errmsg[PJ_ERR_MSG_SIZE]; - wchar_t werrmsg[PJ_ERR_MSG_SIZE]; - - pj_strerror(rc, errmsg, sizeof(errmsg)); - pj_ansi_to_unicode(errmsg, strlen(errmsg), werrmsg, PJ_ARRAY_SIZE(werrmsg)); - - AfxMessageBox(title + _T(": ") + werrmsg); -} - -BOOL CPocketPJDlg::Restart() -{ - unsigned i; - pj_status_t status; - - char ver[80]; - sprintf(ver, "PocketPJ/%s", pj_get_version()); - - ShowWindow(SW_SHOW); - PopUp_Show(POPUP_REGISTRATION, ver, - "Starting up....", "", "", "", 0); - - KillTimer(TIMER_ID); - - // Destroy first. - PopUp_Modify(POPUP_REGISTRATION, POPUP_EL_TITLE3, "Cleaning up.."); - pjsua_destroy(); - - m_BtnAcc.SetBitmap(::LoadBitmap(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDB_OFFLINE)) ); - UpdateWindow(); - - - // Create - PopUp_Show(POPUP_REGISTRATION, ver, - "Starting up....", "Creating stack..", "", "", 0); - - status = pjsua_create(); - if (status != PJ_SUCCESS) { - Error(_T("Error in creating library"), status); - PopUp_Hide(POPUP_REGISTRATION); - return FALSE; - } - - pjsua_config cfg; - pjsua_logging_config log_cfg; - pjsua_media_config media_cfg; - - pjsua_config_default(&cfg); - cfg.max_calls = 1; - cfg.thread_cnt = 0; - cfg.user_agent = pj_str(ver); - - cfg.cb.on_call_state = &on_call_state; - cfg.cb.on_call_media_state = &on_call_media_state; - cfg.cb.on_incoming_call = &on_incoming_call; - cfg.cb.on_reg_state = &on_reg_state; - cfg.cb.on_buddy_state = &on_buddy_state; - cfg.cb.on_pager = &on_pager; - - /* Configure nameserver */ - char nameserver[60]; - { - FIXED_INFO fi; - ULONG len = sizeof(fi); - CString err; - - PopUp_Modify(POPUP_REGISTRATION, POPUP_EL_TITLE3, "Retrieving network parameters.."); - if (GetNetworkParams(&fi, &len) != ERROR_SUCCESS) { - err = _T("Info: Error querying network parameters. You must configure DNS server."); - } else if (fi.CurrentDnsServer == NULL) { - err = _T("Info: DNS server not configured. You must configure DNS server."); - } - - if (err.GetLength()) { - if (m_Cfg.m_DNS.GetLength()) { - pj_unicode_to_ansi((LPCTSTR)m_Cfg.m_DNS, m_Cfg.m_DNS.GetLength(), - nameserver, sizeof(nameserver)); - cfg.nameserver_count = 1; - cfg.nameserver[0] = pj_str(nameserver); - } else { - AfxMessageBox(err); - pjsua_destroy(); - PopUp_Hide(POPUP_REGISTRATION); - return FALSE; - } - } else { - strcpy(nameserver, fi.CurrentDnsServer->IpAddress.String); - cfg.nameserver_count = 1; - cfg.nameserver[0] = pj_str(nameserver); - } - } - - char tmp_stun[80]; - if (m_Cfg.m_UseStun) { - pj_unicode_to_ansi((LPCTSTR)m_Cfg.m_StunSrv, m_Cfg.m_StunSrv.GetLength(), - tmp_stun, sizeof(tmp_stun)); - cfg.stun_host = pj_str(tmp_stun); - } - - pjsua_logging_config_default(&log_cfg); - log_cfg.log_filename = pj_str("\\PocketPJ.TXT"); - - pjsua_media_config_default(&media_cfg); - media_cfg.clock_rate = 8000; - media_cfg.audio_frame_ptime = 40; - media_cfg.ec_tail_len = 0; - media_cfg.ilbc_mode = 30; - media_cfg.max_media_ports = 8; - media_cfg.quality = 5; - media_cfg.thread_cnt = 1; - media_cfg.enable_ice = m_Cfg.m_UseIce; - media_cfg.no_vad = !m_Cfg.m_VAD; - - if (m_Cfg.m_EchoSuppress) { - media_cfg.ec_options = PJMEDIA_ECHO_SIMPLE; - media_cfg.ec_tail_len = m_Cfg.m_EcTail; - } - - // Init - PopUp_Modify(POPUP_REGISTRATION, POPUP_EL_TITLE3, "Initializing.."); - status = pjsua_init(&cfg, &log_cfg, &media_cfg); - if (status != PJ_SUCCESS) { - Error(_T("Error initializing library"), status); - pjsua_destroy(); - PopUp_Hide(POPUP_REGISTRATION); - return FALSE; - } - - // Create one UDP transport - PopUp_Modify(POPUP_REGISTRATION, POPUP_EL_TITLE3, "Adding UDP transport.."); - pjsua_transport_id transport_id; - pjsua_transport_config udp_cfg; - - pjsua_transport_config_default(&udp_cfg); - udp_cfg.port = 0; - status = pjsua_transport_create(PJSIP_TRANSPORT_UDP, - &udp_cfg, &transport_id); - if (status != PJ_SUCCESS) { - Error(_T("Error creating UDP transport"), status); - pjsua_destroy(); - PopUp_Hide(POPUP_REGISTRATION); - return FALSE; - } - - if (m_Cfg.m_TCP) { - // Create one TCP transport - PopUp_Modify(POPUP_REGISTRATION, POPUP_EL_TITLE3, "Adding TCP transport.."); - pjsua_transport_id transport_id; - pjsua_transport_config tcp_cfg; - - pjsua_transport_config_default(&tcp_cfg); - tcp_cfg.port = 0; - status = pjsua_transport_create(PJSIP_TRANSPORT_TCP, - &tcp_cfg, &transport_id); - if (status != PJ_SUCCESS) { - Error(_T("Error creating TCP transport"), status); - pjsua_destroy(); - PopUp_Hide(POPUP_REGISTRATION); - return FALSE; - } - } - - // Adjust codecs priority - pj_str_t tmp; - pjsua_codec_set_priority(pj_cstr(&tmp, "*"), 0); - for (i=0; i<(unsigned)m_Cfg.m_Codecs.GetSize(); ++i) { - CString codec = m_Cfg.m_Codecs.GetAt(i); - char tmp_nam[80]; - - pj_unicode_to_ansi((LPCTSTR)codec, codec.GetLength(), - tmp_nam, sizeof(tmp_nam)); - pjsua_codec_set_priority(pj_cstr(&tmp, tmp_nam), 200-i); - } - - // Start! - PopUp_Modify(POPUP_REGISTRATION, POPUP_EL_TITLE3, "Starting.."); - status = pjsua_start(); - if (status != PJ_SUCCESS) { - Error(_T("Error starting library"), status); - pjsua_destroy(); - PopUp_Hide(POPUP_REGISTRATION); - return FALSE; - } - - // Add account - PopUp_Modify(POPUP_REGISTRATION, POPUP_EL_TITLE3, "Adding account.."); - char domain[80], username[80], passwd[80]; - char id[80], reg_uri[80]; - pjsua_acc_config acc_cfg; - - pj_unicode_to_ansi((LPCTSTR)m_Cfg.m_Domain, m_Cfg.m_Domain.GetLength(), - domain, sizeof(domain)); - pj_unicode_to_ansi((LPCTSTR)m_Cfg.m_User, m_Cfg.m_User.GetLength(), - username, sizeof(username)); - pj_unicode_to_ansi((LPCTSTR)m_Cfg.m_Password, m_Cfg.m_Password.GetLength(), - passwd, sizeof(passwd)); - - snprintf(id, sizeof(id), "<sip:%s@%s>", username, domain); - snprintf(reg_uri, sizeof(reg_uri), "sip:%s", domain); - - pjsua_acc_config_default(&acc_cfg); - acc_cfg.id = pj_str(id); - acc_cfg.reg_uri = pj_str(reg_uri); - acc_cfg.cred_count = 1; - acc_cfg.cred_info[0].scheme = pj_str("Digest"); - acc_cfg.cred_info[0].realm = pj_str("*"); - acc_cfg.cred_info[0].username = pj_str(username); - acc_cfg.cred_info[0].data_type = 0; - acc_cfg.cred_info[0].data = pj_str(passwd); - -#if defined(PJMEDIA_HAS_SRTP) && (PJMEDIA_HAS_SRTP != 0) - acc_cfg.use_srtp = (m_Cfg.m_UseSrtp ? PJMEDIA_SRTP_OPTIONAL : PJMEDIA_SRTP_DISABLED); - acc_cfg.srtp_secure_signaling = 0; -#endif - - acc_cfg.publish_enabled = m_Cfg.m_UsePublish; - - char route[80]; - if (m_Cfg.m_TCP) { - snprintf(route, sizeof(route), "<sip:%s;lr;transport=tcp>", domain); - acc_cfg.proxy[acc_cfg.proxy_cnt++] = pj_str(route); - } else { - snprintf(route, sizeof(route), "<sip:%s;lr>", domain); - acc_cfg.proxy[acc_cfg.proxy_cnt++] = pj_str(route); - } - - status = pjsua_acc_add(&acc_cfg, PJ_TRUE, &m_PjsuaAccId); - if (status != PJ_SUCCESS) { - Error(_T("Invalid account settings"), status); - pjsua_destroy(); - PopUp_Hide(POPUP_REGISTRATION); - return FALSE; - } - - CString acc_text = m_Cfg.m_User + _T("@") + m_Cfg.m_Domain; - m_AccId.SetWindowText(acc_text); - - PopUp_Modify(POPUP_REGISTRATION, POPUP_EL_TITLE1, acc_text); - PopUp_Modify(POPUP_REGISTRATION, POPUP_EL_TITLE2, "Registering.."); - PopUp_Modify(POPUP_REGISTRATION, POPUP_EL_TITLE3, ""); - - SetTimer(TIMER_ID, 100, NULL); - return TRUE; -} - - -void CPocketPJDlg::PopUp_Show( PopUpType type, - const CString& title1, - const CString& title2, - const CString& title3, - const CString& btn1, - const CString& btn2, - unsigned userData) -{ - if (!m_PopUpState[type]) - ++m_PopUpCount; - - m_PopUpState[type] = TRUE; - - m_PopUpContent[type].m_Title1 = title1; - m_PopUpContent[type].m_Title2 = title2; - m_PopUpContent[type].m_Title3 = title3; - m_PopUpContent[type].m_Btn1 = btn1; - m_PopUpContent[type].m_Btn2 = btn2; - - m_PopUp->SetContent(m_PopUpContent[type]); - m_PopUp->Show(); -} - -void CPocketPJDlg::PopUp_Modify(PopUpType type, - PopUpElement el, - const CString& text) -{ - switch (el) { - case POPUP_EL_TITLE1: - m_PopUpContent[type].m_Title1 = text; - break; - case POPUP_EL_TITLE2: - m_PopUpContent[type].m_Title2 = text; - break; - case POPUP_EL_TITLE3: - m_PopUpContent[type].m_Title3 = text; - break; - case POPUP_EL_BUTTON1: - m_PopUpContent[type].m_Btn1 = text; - break; - case POPUP_EL_BUTTON2: - m_PopUpContent[type].m_Btn1 = text; - break; - } - - m_PopUp->SetContent(m_PopUpContent[type]); -} - -void CPocketPJDlg::PopUp_Hide(PopUpType type) -{ - if (m_PopUpState[type]) - --m_PopUpCount; - - m_PopUpState[type] = FALSE; - - if (m_PopUpCount == 0) { - m_PopUp->Hide(); - UpdateWindow(); - } else { - for (int i=POPUP_MAX_TYPE-1; i>=0; --i) { - if (m_PopUpState[i]) { - m_PopUp->SetContent(m_PopUpContent[i]); - break; - } - } - } -} - -void CPocketPJDlg::OnCallState() -{ - pjsua_call_info ci; - - pjsua_call_get_info(0, &ci); - - switch (ci.state) { - case PJSIP_INV_STATE_NULL: /**< Before INVITE is sent or received */ - break; - case PJSIP_INV_STATE_CALLING: /**< After INVITE is sent */ - PopUp_Show(POPUP_CALL, "Calling..", ci.remote_info.ptr, "", - "", "Hangup", 0); - break; - case PJSIP_INV_STATE_INCOMING: /**< After INVITE is received. */ - PopUp_Show(POPUP_CALL, "Incoming call..", ci.remote_info.ptr, "", - "Answer", "Hangup", 0); - pjsua_call_answer(0, 180, NULL, NULL); - if (m_Cfg.m_AutoAnswer) - OnPopUpButton(1); - break; - case PJSIP_INV_STATE_EARLY: /**< After response with To tag. */ - case PJSIP_INV_STATE_CONNECTING:/**< After 2xx is sent/received. */ - case PJSIP_INV_STATE_CONFIRMED: /**< After ACK is sent/received. */ - { - CString stateText = ci.state_text.ptr; - PopUp_Modify(POPUP_CALL, POPUP_EL_TITLE3, stateText); - } - break; - case PJSIP_INV_STATE_DISCONNECTED:/**< Session is terminated. */ - PopUp_Modify(POPUP_CALL, POPUP_EL_TITLE3, "Disconnected"); - PopUp_Hide(POPUP_CALL); - break; - } -} - -void CPocketPJDlg::on_call_state(pjsua_call_id call_id, pjsip_event *e) -{ - theDlg->OnCallState(); -} - -void CPocketPJDlg::on_call_media_state(pjsua_call_id call_id) -{ - pjsua_call_info call_info; - - pjsua_call_get_info(call_id, &call_info); - if (call_info.media_status == PJSUA_CALL_MEDIA_ACTIVE) { - pjsua_conf_connect(call_info.conf_slot, 0); - pjsua_conf_connect(0, call_info.conf_slot); - } -} - -void CPocketPJDlg::on_incoming_call(pjsua_acc_id acc_id, pjsua_call_id call_id, - pjsip_rx_data *rdata) -{ -} - -void CPocketPJDlg::OnRegState() -{ - pjsua_acc_info ai; - pjsua_acc_get_info(m_PjsuaAccId, &ai); - - CString acc_text = m_Cfg.m_User + _T("@") + m_Cfg.m_Domain; - - if (ai.expires>0 && ai.status/100==2) { - /* Registration success */ - HBITMAP old = m_BtnAcc.SetBitmap(::LoadBitmap(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDB_ONLINE)) ); - acc_text += " (OK)"; - m_AccId.SetWindowText(acc_text); - } else if (ai.status/100 != 2) { - acc_text += " (err)"; - Error(_T("SIP registration error"), PJSIP_ERRNO_FROM_SIP_STATUS(ai.status)); - m_AccId.SetWindowText(acc_text); - } - PopUp_Hide(POPUP_REGISTRATION); -} - -void CPocketPJDlg::on_reg_state(pjsua_acc_id acc_id) -{ - theDlg->OnRegState(); -} - -void CPocketPJDlg::on_buddy_state(pjsua_buddy_id buddy_id) -{ - theDlg->RedrawBuddyList(); -} - -void CPocketPJDlg::on_pager(pjsua_call_id call_id, const pj_str_t *from, - const pj_str_t *to, const pj_str_t *contact, - const pj_str_t *mime_type, const pj_str_t *text) -{ -} - -///////////////////////////////////////////////////////////////////////////// -// CPocketPJDlg message handlers - -BOOL CPocketPJDlg::OnInitDialog() -{ - CDialog::OnInitDialog(); - - // Set the icon for this dialog. The framework does this automatically - // when the application's main window is not a dialog - SetIcon(m_hIcon, TRUE); // Set big icon - SetIcon(m_hIcon, FALSE); // Set small icon - - CenterWindow(GetDesktopWindow()); // center to the hpc screen - - // TODO: Add extra initialization here - - m_Cfg.LoadRegistry(); - //ShowWindow(SW_SHOW); - m_AccId.SetWindowText(m_Cfg.m_User); - - CImageList *il = new CImageList; - VERIFY(il->Create(16, 16, ILC_COLOR|ILC_MASK, 2, 4)); - - CBitmap *bmp = new CBitmap; - bmp->LoadBitmap(MAKEINTRESOURCE(IDB_BLANK)); - il->Add(bmp, RGB(255,255,255)); - bmp = new CBitmap; - bmp->LoadBitmap(MAKEINTRESOURCE(IDB_ONLINE)); - il->Add(bmp, RGB(255,255,255)); - - m_BuddyList.SetImageList(il, LVSIL_SMALL); - - if (m_Cfg.m_Domain.GetLength()==0 || Restart() == FALSE) { - for (;;) { - CSettingsDlg dlg(m_Cfg); - if (dlg.DoModal() != IDOK) { - EndDialog(IDOK); - return TRUE; - } - - m_Cfg.SaveRegistry(); - - if (Restart()) - break; - } - } - - RedrawBuddyList(); - return TRUE; // return TRUE unless you set the focus to a control -} - - - -void CPocketPJDlg::OnBtnAcc() -{ - CMenu menu; - VERIFY(menu.LoadMenu(IDR_ACC_MENU)); - CMenu* pPopup = menu.GetSubMenu(0); - ASSERT(pPopup != NULL); - - RECT r; - m_BtnAcc.GetWindowRect(&r); - pPopup->TrackPopupMenu(TPM_LEFTALIGN, r.left+4, r.top+4, this); -} - -void CPocketPJDlg::OnBtnAction() -{ - CMenu menu; - VERIFY(menu.LoadMenu(IDR_URI_MENU)); - CMenu* pPopup = menu.GetSubMenu(0); - ASSERT(pPopup != NULL); - - RECT r; - this->m_BtnUrlAction.GetWindowRect(&r); - pPopup->TrackPopupMenu(TPM_LEFTALIGN, r.left+4, r.top+4, this); -} - -void CPocketPJDlg::OnSettings() -{ - for (;;) { - CSettingsDlg dlg(m_Cfg); - if (dlg.DoModal() != IDOK) { - return; - } - - m_Cfg.SaveRegistry(); - - if (Restart()) - break; - } -} - -void CPocketPJDlg::OnOK() -{ - if (AfxMessageBox(_T("Quit PocketPJ?"), MB_YESNO)==IDYES) { - KillTimer(TIMER_ID); - PopUp_Show(POPUP_REGISTRATION, "", "Shutting down..", "", "", "", 0); - pjsua_destroy(); - CDialog::OnOK(); - PopUp_Hide(POPUP_REGISTRATION); - m_Cfg.SaveRegistry(); - return; - } -} - -void CPocketPJDlg::OnTimer(UINT nIDEvent) -{ - pjsua_handle_events(10); - CDialog::OnTimer(nIDEvent); -} - -int CPocketPJDlg::FindBuddyInPjsua(const CString &Uri) -{ - char uri[80]; - pjsua_buddy_id id[128]; - unsigned i, count = PJ_ARRAY_SIZE(id); - - if (pjsua_enum_buddies(id, &count) != PJ_SUCCESS) - return PJSUA_INVALID_ID; - if (count==0) - return PJSUA_INVALID_ID; - - pj_unicode_to_ansi((LPCTSTR)Uri, Uri.GetLength(), uri, sizeof(uri)); - - for (i=0; i<count; ++i) { - pjsua_buddy_info bi; - pjsua_buddy_get_info(id[i], &bi); - if (pj_strcmp2(&bi.uri, uri)==0) - return i; - } - - return PJSUA_INVALID_ID; -} - -int CPocketPJDlg::FindBuddyInCfg(const CString &uri) -{ - int i; - for (i=0; i<m_Cfg.m_BuddyList.GetSize(); ++i) { - if (m_Cfg.m_BuddyList.GetAt(0) == uri) { - return i; - } - } - return -1; -} - -void CPocketPJDlg::RedrawBuddyList() -{ - int i; - - m_BuddyList.DeleteAllItems(); - - for (i=0; i<m_Cfg.m_BuddyList.GetSize(); ++i) { - int isOnline; - int id; - - id = FindBuddyInPjsua(m_Cfg.m_BuddyList.GetAt(i)); - if (id != PJSUA_INVALID_ID) { - pjsua_buddy_info bi; - pjsua_buddy_get_info(id, &bi); - isOnline = (bi.status == PJSUA_BUDDY_STATUS_ONLINE); - } else { - isOnline = 0; - } - - LVITEM lvi; - memset(&lvi, 0, sizeof(lvi)); - lvi.mask = LVIF_TEXT | LVIF_IMAGE; - lvi.iItem = i; - lvi.iImage = isOnline; - lvi.pszText = (LPTSTR)(LPCTSTR)m_Cfg.m_BuddyList.GetAt(i); - - m_BuddyList.InsertItem(&lvi); - } -} - -void CPocketPJDlg::OnUriCall() -{ - char tmp[120]; - CString uri; - pj_status_t status; - - m_Url.GetWindowText(uri); - pj_unicode_to_ansi((LPCTSTR)uri, uri.GetLength(), tmp, sizeof(tmp)); - if ((status=pjsua_verify_sip_url(tmp)) != PJ_SUCCESS) { - Error("The URL is not valid SIP URL", status); - return; - } - - pj_str_t dest_uri = pj_str(tmp); - pjsua_call_id call_id; - - status = pjsua_call_make_call(m_PjsuaAccId, &dest_uri, 0, NULL, NULL, &call_id); - - if (status != PJ_SUCCESS) - Error("Unable to make call", status); -} - -void CPocketPJDlg::OnUriAddBuddy() -{ - int i; - char tmp[120]; - CString uri; - pj_status_t status; - - m_Url.GetWindowText(uri); - pj_unicode_to_ansi((LPCTSTR)uri, uri.GetLength(), tmp, sizeof(tmp)); - if ((status=pjsua_verify_sip_url(tmp)) != PJ_SUCCESS) { - Error("The URL is not valid SIP URL", status); - return; - } - - for (i=0; i<m_Cfg.m_BuddyList.GetSize(); ++i) { - if (m_Cfg.m_BuddyList.GetAt(0) == uri) { - AfxMessageBox(_T("The URI is already in the buddy list")); - return; - } - } - - m_Cfg.m_BuddyList.Add(uri); - RedrawBuddyList(); -} - -void CPocketPJDlg::OnUriDelBuddy() -{ - CString uri; - - m_Url.GetWindowText(uri); - int i = FindBuddyInCfg(uri); - if (i<0) { - /* Buddy not found */ - return; - } - - m_Cfg.m_BuddyList.RemoveAt(i); - RedrawBuddyList(); - AfxMessageBox(_T("Buddy " + uri + " deleted")); -} - -void CPocketPJDlg::OnAccOnline() -{ - pjsua_acc_set_online_status(m_PjsuaAccId, PJ_TRUE); - m_BtnAcc.SetBitmap(::LoadBitmap(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDB_ONLINE)) ); -} - -void CPocketPJDlg::OnAccInvisible() -{ - pjsua_acc_set_online_status(m_PjsuaAccId, PJ_FALSE); - m_BtnAcc.SetBitmap(::LoadBitmap(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDB_INVISIBLE)) ); -} - -void CPocketPJDlg::OnPopUpButton(int btnNo) -{ - if (btnNo == 1) { - pjsua_call_answer(0, 200, NULL, 0); - PopUp_Modify(POPUP_CALL, POPUP_EL_BUTTON1, ""); - } else if (btnNo == 2) { - // Hangup button - PopUp_Modify(POPUP_CALL, POPUP_EL_TITLE2, "Hang up.."); - PopUp_Modify(POPUP_CALL, POPUP_EL_TITLE3, ""); - pjsua_call_hangup(0, PJSIP_SC_DECLINE, 0, 0); - } -} - -void CPocketPJDlg::OnClickBuddyList(NMHDR* pNMHDR, LRESULT* pResult) -{ - POSITION pos = m_BuddyList.GetFirstSelectedItemPosition(); - if (pos != NULL) { - int iItem = m_BuddyList.GetNextSelectedItem(pos); - CString uri = m_BuddyList.GetItemText(iItem, 0); - m_Url.SetWindowText(uri); - } - *pResult = 0; -} diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/pocketpj/PopUpWnd.cpp b/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/pocketpj/PopUpWnd.cpp deleted file mode 100644 index 1f1654f0621eca2dd67e4686be3002f1a647eff5..0000000000000000000000000000000000000000 --- a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/pocketpj/PopUpWnd.cpp +++ /dev/null @@ -1,235 +0,0 @@ -#include "stdafx.h" -#include "PopUpWnd.h" -#include "resource.h" -#include "PocketPJDlg.h" - -#ifdef _DEBUG -#define new DEBUG_NEW -#undef THIS_FILE -static char THIS_FILE[] = __FILE__; -#endif - -#define IDC_BTN1 10 -#define IDC_BTN2 11 - - -///////////////////////////////////////////////////////////////////////////// -// CPopUpWnd - -CPopUpWnd::CPopUpWnd(CPocketPJDlg* pParent) -{ - Create(pParent); -} - -CPopUpWnd::~CPopUpWnd() -{ - DestroyWindow(); -} - -BOOL CPopUpWnd::Create(CPocketPJDlg* pParent) -{ - BOOL bSuccess; - - m_ParentWnd = pParent; - - // Register window class - CString csClassName = AfxRegisterWndClass(CS_HREDRAW|CS_VREDRAW, - 0, - CBrush(::GetSysColor(COLOR_BTNFACE))); - - // Create popup window - bSuccess = CreateEx(WS_EX_DLGMODALFRAME|WS_EX_TOPMOST, // Extended style - csClassName, // Classname - _T("PocketPJ"), // Title - WS_POPUP|WS_BORDER|WS_CAPTION, // style - 0,0, // position - updated soon. - 1,1, // Size - updated soon - pParent->GetSafeHwnd(), // handle to parent - 0, // No menu - NULL); - if (!bSuccess) - return FALSE; - - ShowWindow(SW_HIDE); - - // Now create the controls - CRect TempRect(0,0,10,10); - - /* |SS_LEFTNOWORDWRAP */ - bSuccess = m_Title1.Create(_T("Title1"), WS_CHILD|WS_VISIBLE|SS_NOPREFIX, - TempRect, this, IDC_TITLE1); - if (!bSuccess) - return FALSE; - - bSuccess = m_Title2.Create(_T("Title2"), WS_CHILD|WS_VISIBLE|SS_NOPREFIX, - TempRect, this, IDC_TITLE2); - if (!bSuccess) - return FALSE; - - bSuccess = m_Title3.Create(_T("Title3"), WS_CHILD|WS_VISIBLE|SS_NOPREFIX, - TempRect, this, IDC_TITLE3); - if (!bSuccess) - return FALSE; - - bSuccess = m_Btn1.Create(_T("Button1"), - WS_CHILD|WS_VISIBLE|WS_TABSTOP| BS_PUSHBUTTON, - TempRect, this, IDC_BTN1); - if (!bSuccess) - return FALSE; - - bSuccess = m_Btn2.Create(_T("Button2"), - WS_CHILD|WS_VISIBLE|WS_TABSTOP| BS_PUSHBUTTON, - TempRect, this, IDC_BTN2); - if (!bSuccess) - return FALSE; - - CFont *ft1 = new CFont, - *ft2 = new CFont, - *ft3 = new CFont; - - - LOGFONT lf; - memset(&lf, 0, sizeof(LOGFONT)); - lf.lfHeight = 12; - lstrcpy(lf.lfFaceName, _T("Arial")); - VERIFY(ft1->CreateFontIndirect(&lf)); - VERIFY(ft3->CreateFontIndirect(&lf)); - - lf.lfHeight = 20; - VERIFY(ft2->CreateFontIndirect(&lf)); - - m_Title1.SetFont(ft1, TRUE); - m_Title2.SetFont(ft2, TRUE); - m_Title3.SetFont(ft3, TRUE); - - - SetWindowSize(); - - // Center and show window - CenterWindow(); - - Show(); - - return TRUE; -} - -void CPopUpWnd::SetContent(const CPopUpContent &content) -{ - m_Title1.SetWindowText(content.m_Title1); - m_Title2.SetWindowText(content.m_Title2); - m_Title3.SetWindowText(content.m_Title3); - - if (content.m_Btn1 != "") { - m_Btn1.SetWindowText(content.m_Btn1); - m_Btn1.ShowWindow(SW_SHOW); - } else { - m_Btn1.ShowWindow(SW_HIDE); - } - - if (content.m_Btn2 != "") { - m_Btn2.SetWindowText(content.m_Btn2); - m_Btn2.ShowWindow(SW_SHOW); - } else { - m_Btn2.ShowWindow(SW_HIDE); - } - - UpdateWindow(); - ShowWindow(SW_SHOW); -} - -void CPopUpWnd::SetWindowSize(int width, int height) -{ - enum { H1 = 16, H2 = 40, H3 = 16, S = 5, G = 10, BW=60, BH=20, BG=40}; - - CRect rootRect(0, 0, 320, 240); - int Y; - - MoveWindow((rootRect.Width() - width)/2, (rootRect.Height() - height)/2, - width, height); - - m_Title1.MoveWindow(10, Y=S, width-20, H1); - m_Title2.MoveWindow(10, Y+=H1+G, width-20, H2); - m_Title3.MoveWindow(10, Y+=H2+G, width-20, H3); - - m_Btn1.MoveWindow((width-2*BW-BG)/2, Y+=H3+G, BW, BH); - m_Btn2.MoveWindow((width-2*BW-BG)/2+BW+BG, Y, BW, BH); -} - -void CPopUpWnd::Hide() -{ - if (!::IsWindow(GetSafeHwnd())) - return; - - if (IsWindowVisible()) - { - ShowWindow(SW_HIDE); - ModifyStyle(WS_VISIBLE, 0); - } -} - -void CPopUpWnd::Show() -{ - if (!::IsWindow(GetSafeHwnd())) - return; - - ModifyStyle(0, WS_VISIBLE); - ShowWindow(SW_SHOWNA); - RedrawWindow(NULL,NULL,RDW_ERASE|RDW_INVALIDATE|RDW_UPDATENOW); -} - -BEGIN_MESSAGE_MAP(CPopUpWnd, CWnd) - //{{AFX_MSG_MAP(CPopUpWnd) - ON_WM_ERASEBKGND() - //}}AFX_MSG_MAP - ON_BN_CLICKED(IDC_BTN1, OnCancel1) - ON_BN_CLICKED(IDC_BTN2, OnCancel2) -END_MESSAGE_MAP() - - -///////////////////////////////////////////////////////////////////////////// -// CPopUpWnd message handlers - -BOOL CPopUpWnd::OnEraseBkgnd(CDC* pDC) -{ - CBrush backBrush; - backBrush.CreateSolidBrush(RGB(255,255,255)); - CBrush* pOldBrush = pDC->SelectObject(&backBrush); - - CRect rect; - pDC->GetClipBox(&rect); // Erase the area needed - pDC->PatBlt(rect.left, rect.top, rect.Width(), rect.Height(), PATCOPY); - pDC->SelectObject(pOldBrush); - - return TRUE; -} - -void CPopUpWnd::OnCancel1() -{ - m_ParentWnd->OnPopUpButton(1); -} - - -void CPopUpWnd::OnCancel2() -{ - m_ParentWnd->OnPopUpButton(2); -} - - -BOOL CPopUpWnd::DestroyWindow() -{ - return CWnd::DestroyWindow(); -} - -void CPopUpWnd::PeekAndPump() -{ - MSG msg; - while (::PeekMessage(&msg, NULL,0,0,PM_NOREMOVE)) - { - if (!AfxGetApp()->PumpMessage()) - { - ::PostQuitMessage(0); - return; - } - } -} - diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/pocketpj/SettingsDlg.cpp b/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/pocketpj/SettingsDlg.cpp deleted file mode 100644 index 1357044ae2c4675b973a6de003ba6a4a8476b784..0000000000000000000000000000000000000000 --- a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/pocketpj/SettingsDlg.cpp +++ /dev/null @@ -1,376 +0,0 @@ -// SettingsDlg.cpp : implementation file -// - -#include "stdafx.h" -#include "PocketPJ.h" -#include "SettingsDlg.h" -#include <pjsua-lib/pjsua.h> -#include <atlbase.h> - -#ifdef _DEBUG -#define new DEBUG_NEW -#undef THIS_FILE -static char THIS_FILE[] = __FILE__; -#endif - -#define REG_PATH _T("pjsip.org\\PocketPC") -#define REG_DOMAIN _T("Domain") -#define REG_USER _T("User") -#define REG_PASSWD _T("Data") -#define REG_USE_STUN _T("UseSTUN") -#define REG_STUN_SRV _T("STUNSrv") -#define REG_DNS _T("DNS") -#define REG_USE_ICE _T("UseICE") -#define REG_USE_SRTP _T("UseSRTP") -#define REG_USE_PUBLISH _T("UsePUBLISH") -#define REG_BUDDY_CNT _T("BuddyCnt") -#define REG_BUDDY_X _T("Buddy%u") -#define REG_ENABLE_EC _T("EnableEC") -#define REG_EC_TAIL _T("ECTail") -#define REG_ENABLE_VAD _T("EnableVAD") -#define REG_ENABLE_TCP _T("EnableTCP") -#define REG_CODEC_CNT _T("CodecCnt") -#define REG_CODEC_X _T("Codec%u") -#define REG_AUTO_ANSWER _T("AutoAnswer") - - -///////////////////////////////////////////////////////////////////////////// -// Settings -CPocketPJSettings::CPocketPJSettings() -: m_UseStun(FALSE), m_UseIce(FALSE), m_UseSrtp(FALSE), m_UsePublish(FALSE), - m_EchoSuppress(TRUE), m_EcTail(200), m_TCP(FALSE), m_VAD(FALSE), - m_AutoAnswer(FALSE) -{ - /* Init codec list */ -#if defined(PJMEDIA_HAS_GSM_CODEC) && PJMEDIA_HAS_GSM_CODEC - m_Codecs.Add(_T("GSM")); -#endif -#if defined(PJMEDIA_HAS_G711_CODEC) && PJMEDIA_HAS_G711_CODEC - m_Codecs.Add(_T("PCMU")); - m_Codecs.Add(_T("PCMA")); -#endif -#if defined(PJMEDIA_HAS_SPEEX_CODEC) && PJMEDIA_HAS_SPEEX_CODEC - m_Codecs.Add(_T("Speex")); -#endif -} - -// Load from registry -void CPocketPJSettings::LoadRegistry() -{ - CRegKey key; - wchar_t textVal[256]; - DWORD dwordVal; - DWORD cbData; - - - if (key.Open(HKEY_CURRENT_USER, REG_PATH) != ERROR_SUCCESS) - return; - - cbData = sizeof(textVal); - if (key.QueryValue(textVal, REG_DOMAIN, &cbData) == ERROR_SUCCESS) { - m_Domain = textVal; - } - - cbData = sizeof(textVal); - if (key.QueryValue(textVal, REG_USER, &cbData) == ERROR_SUCCESS) { - m_User = textVal; - } - - cbData = sizeof(textVal); - if (key.QueryValue(textVal, REG_PASSWD, &cbData) == ERROR_SUCCESS) { - m_Password = textVal; - } - - cbData = sizeof(textVal); - if (key.QueryValue(textVal, REG_STUN_SRV, &cbData) == ERROR_SUCCESS) { - m_StunSrv = textVal; - } - - cbData = sizeof(textVal); - if (key.QueryValue(textVal, REG_DNS, &cbData) == ERROR_SUCCESS) { - m_DNS = textVal; - } - - dwordVal = 0; - if (key.QueryValue(dwordVal, REG_USE_STUN) == ERROR_SUCCESS) { - m_UseStun = dwordVal != 0; - } - - if (key.QueryValue(dwordVal, REG_USE_ICE) == ERROR_SUCCESS) { - m_UseIce = dwordVal != 0; - } - - - if (key.QueryValue(dwordVal, REG_USE_SRTP) == ERROR_SUCCESS) { - m_UseSrtp = dwordVal != 0; - } - - - cbData = sizeof(dwordVal); - if (key.QueryValue(dwordVal, REG_USE_PUBLISH) == ERROR_SUCCESS) { - m_UsePublish = dwordVal != 0; - } - - cbData = sizeof(dwordVal); - if (key.QueryValue(dwordVal, REG_ENABLE_EC) == ERROR_SUCCESS) { - m_EchoSuppress = dwordVal != 0; - } - - cbData = sizeof(dwordVal); - if (key.QueryValue(dwordVal, REG_EC_TAIL) == ERROR_SUCCESS) { - m_EcTail = dwordVal; - } - - cbData = sizeof(dwordVal); - if (key.QueryValue(dwordVal, REG_ENABLE_TCP) == ERROR_SUCCESS) { - m_TCP = dwordVal != 0; - } - - cbData = sizeof(dwordVal); - if (key.QueryValue(dwordVal, REG_ENABLE_VAD) == ERROR_SUCCESS) { - m_VAD = dwordVal != 0; - } - - cbData = sizeof(dwordVal); - if (key.QueryValue(dwordVal, REG_AUTO_ANSWER) == ERROR_SUCCESS) { - m_AutoAnswer = dwordVal != 0; - } - - m_BuddyList.RemoveAll(); - - DWORD buddyCount = 0; - cbData = sizeof(dwordVal); - if (key.QueryValue(dwordVal, REG_BUDDY_CNT) == ERROR_SUCCESS) { - buddyCount = dwordVal; - } - - unsigned i; - for (i=0; i<buddyCount; ++i) { - CString entry; - entry.Format(REG_BUDDY_X, i); - - cbData = sizeof(textVal); - if (key.QueryValue(textVal, entry, &cbData) == ERROR_SUCCESS) { - m_BuddyList.Add(textVal); - } - } - - DWORD codecCount = 0; - cbData = sizeof(dwordVal); - if (key.QueryValue(codecCount, REG_CODEC_CNT) == ERROR_SUCCESS) { - - m_Codecs.RemoveAll(); - - for (i=0; i<codecCount; ++i) { - CString entry; - entry.Format(REG_CODEC_X, i); - - cbData = sizeof(textVal); - if (key.QueryValue(textVal, entry, &cbData) == ERROR_SUCCESS) { - m_Codecs.Add(textVal); - } - } - } - - key.Close(); -} - -// Save to registry -void CPocketPJSettings::SaveRegistry() -{ - CRegKey key; - - if (key.Create(HKEY_CURRENT_USER, REG_PATH) != ERROR_SUCCESS) - return; - - key.SetValue(m_Domain, REG_DOMAIN); - key.SetValue(m_User, REG_USER); - key.SetValue(m_Password, REG_PASSWD); - key.SetValue(m_StunSrv, REG_STUN_SRV); - key.SetValue(m_DNS, REG_DNS); - - key.SetValue(m_UseStun, REG_USE_STUN); - key.SetValue(m_UseIce, REG_USE_ICE); - key.SetValue(m_UseSrtp, REG_USE_SRTP); - key.SetValue(m_UsePublish, REG_USE_PUBLISH); - - key.SetValue(m_EchoSuppress, REG_ENABLE_EC); - key.SetValue(m_EcTail, REG_EC_TAIL); - - key.SetValue(m_TCP, REG_ENABLE_TCP); - key.SetValue(m_VAD, REG_ENABLE_VAD); - key.SetValue(m_AutoAnswer, REG_AUTO_ANSWER); - - key.SetValue(m_BuddyList.GetSize(), REG_BUDDY_CNT); - - int i; - for (i=0; i<m_BuddyList.GetSize(); ++i) { - CString entry; - entry.Format(REG_BUDDY_X, i); - key.SetValue(m_BuddyList.GetAt(i), entry); - } - - DWORD N = m_Codecs.GetSize(); - key.SetValue(N, REG_CODEC_CNT); - for (i=0; i<m_Codecs.GetSize(); ++i) { - CString entry; - entry.Format(REG_CODEC_X, i); - key.SetValue(m_Codecs.GetAt(i), entry); - } - - key.Close(); -} - - -///////////////////////////////////////////////////////////////////////////// -// CSettingsDlg dialog - - -CSettingsDlg::CSettingsDlg(CPocketPJSettings &cfg, CWnd* pParent) - : CDialog(CSettingsDlg::IDD, pParent), m_Cfg(cfg) -{ - //{{AFX_DATA_INIT(CSettingsDlg) - m_Domain = _T(""); - m_ICE = FALSE; - m_Passwd = _T(""); - m_PUBLISH = FALSE; - m_SRTP = FALSE; - m_STUN = FALSE; - m_StunSrv = _T(""); - m_User = _T(""); - m_Dns = _T(""); - m_EchoSuppress = FALSE; - m_EcTail = _T(""); - m_TCP = FALSE; - m_VAD = FALSE; - m_AutoAnswer = FALSE; - //}}AFX_DATA_INIT - - m_Domain = m_Cfg.m_Domain; - m_ICE = m_Cfg.m_UseIce; - m_Passwd = m_Cfg.m_Password; - m_PUBLISH = m_Cfg.m_UsePublish; - m_SRTP = m_Cfg.m_UseSrtp; - m_STUN = m_Cfg.m_UseStun; - m_StunSrv = m_Cfg.m_StunSrv; - m_User = m_Cfg.m_User; - m_Dns = m_Cfg.m_DNS; - m_EchoSuppress = m_Cfg.m_EchoSuppress; - m_TCP = m_Cfg.m_TCP; - m_VAD = m_Cfg.m_VAD; - m_AutoAnswer= m_Cfg.m_AutoAnswer; - - CString s; - s.Format(_T("%d"), m_Cfg.m_EcTail); - m_EcTail = s; - -} - - -void CSettingsDlg::DoDataExchange(CDataExchange* pDX) -{ - CDialog::DoDataExchange(pDX); - //{{AFX_DATA_MAP(CSettingsDlg) - DDX_Control(pDX, IDC_CODECS, m_Codecs); - DDX_Text(pDX, IDC_DOMAIN, m_Domain); - DDX_Check(pDX, IDC_ICE, m_ICE); - DDX_Text(pDX, IDC_PASSWD, m_Passwd); - DDX_Check(pDX, IDC_PUBLISH, m_PUBLISH); - DDX_Check(pDX, IDC_SRTP, m_SRTP); - DDX_Check(pDX, IDC_STUN, m_STUN); - DDX_Text(pDX, IDC_STUN_SRV, m_StunSrv); - DDX_Text(pDX, IDC_USER, m_User); - DDX_Text(pDX, IDC_DNS, m_Dns); - DDX_Check(pDX, IDC_ECHO_SUPPRESS, m_EchoSuppress); - DDX_Text(pDX, IDC_EC_TAIL, m_EcTail); - DDX_Check(pDX, IDC_TCP, m_TCP); - DDX_Check(pDX, IDC_VAD, m_VAD); - DDX_Check(pDX, IDC_AA, m_AutoAnswer); - //}}AFX_DATA_MAP - - - if (m_Codecs.GetCount() == 0) { - int i; - for (i=0; i<m_Cfg.m_Codecs.GetSize(); ++i) { - m_Codecs.AddString(m_Cfg.m_Codecs.GetAt(i)); - } - m_Codecs.SetCurSel(0); - } -} - - -BEGIN_MESSAGE_MAP(CSettingsDlg, CDialog) - //{{AFX_MSG_MAP(CSettingsDlg) - ON_BN_CLICKED(IDC_STUN, OnStun) - ON_BN_CLICKED(IDC_ECHO_SUPPRESS, OnEchoSuppress) - ON_CBN_SELCHANGE(IDC_CODECS, OnSelchangeCodecs) - //}}AFX_MSG_MAP -END_MESSAGE_MAP() - -///////////////////////////////////////////////////////////////////////////// -// CSettingsDlg message handlers - -int CSettingsDlg::DoModal() -{ - int rc = CDialog::DoModal(); - - return rc; -} - -void CSettingsDlg::OnStun() -{ -} - -void CSettingsDlg::OnEchoSuppress() -{ -} - -void CSettingsDlg::OnSelchangeCodecs() -{ - int cur = m_Codecs.GetCurSel(); - if (cur < 1) - return; - - CString codec; - DWORD N; - - m_Codecs.GetLBText(cur, codec); - N = m_Codecs.GetCount(); - m_Codecs.DeleteString(cur); - N = m_Codecs.GetCount(); - m_Codecs.InsertString(0, codec); - N = m_Codecs.GetCount(); - m_Codecs.SetCurSel(0); -} - - -void CSettingsDlg::OnOK() -{ - UpdateData(TRUE); - - m_Cfg.m_Domain = m_Domain; - m_Cfg.m_UseIce = m_ICE != 0; - m_Cfg.m_Password = m_Passwd; - m_Cfg.m_UsePublish = m_PUBLISH != 0; - m_Cfg.m_UseSrtp = m_SRTP != 0; - m_Cfg.m_UseStun = m_STUN != 0; - m_Cfg.m_StunSrv = m_StunSrv; - m_Cfg.m_User = m_User; - m_Cfg.m_DNS = m_Dns; - m_Cfg.m_EchoSuppress= m_EchoSuppress != 0; - m_Cfg.m_EcTail = _ttoi(m_EcTail); - m_Cfg.m_TCP = m_TCP != 0; - m_Cfg.m_VAD = m_VAD != 0; - m_Cfg.m_AutoAnswer = m_AutoAnswer != 0; - - unsigned i; - m_Cfg.m_Codecs.RemoveAll(); - DWORD N = m_Codecs.GetCount(); - for (i=0; i<N; ++i) { - CString codec; - m_Codecs.GetLBText(i, codec); - m_Cfg.m_Codecs.Add(codec); - } - - CDialog::OnOK(); -} diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua/ua.cpp b/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua/ua.cpp deleted file mode 100644 index d9292681afc3a98f165822db2907ec9c584bfdfe..0000000000000000000000000000000000000000 --- a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua/ua.cpp +++ /dev/null @@ -1,814 +0,0 @@ -/* $Id: ua.cpp 2394 2008-12-23 17:27:53Z bennylp $ */ -/* - * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) - * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> - * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#include <pjsua-lib/pjsua.h> -#include <pjsua-lib/pjsua_internal.h> -#include "ua.h" - -#define THIS_FILE "symbian_ua.cpp" -#define LOG_LEVEL 3 - -// -// Basic config. -// -#define SIP_PORT 5060 - - -// -// Destination URI (to make call, or to subscribe presence) -// -#define SIP_DST_URI "sip:100@pjsip.lab" - -// -// Account -// -#define HAS_SIP_ACCOUNT 0 // 1 to enable registration -#define SIP_DOMAIN "pjsip.lab" -#define SIP_USER "400" -#define SIP_PASSWD "400" - -// -// Outbound proxy for all accounts -// -#define SIP_PROXY NULL -//#define SIP_PROXY "<sip:192.168.0.8;lr>" - - -// -// Configure nameserver if DNS SRV is to be used with both SIP -// or STUN (for STUN see other settings below) -// -#define NAMESERVER NULL -//#define NAMESERVER "192.168.0.2" - -// -// STUN server -#if 0 - // Use this to have the STUN server resolved normally -# define STUN_DOMAIN NULL -# define STUN_SERVER "stun.pjsip.org" -#elif 0 - // Use this to have the STUN server resolved with DNS SRV -# define STUN_DOMAIN "pjsip.org" -# define STUN_SERVER NULL -#else - // Use this to disable STUN -# define STUN_DOMAIN NULL -# define STUN_SERVER NULL -#endif - -// -// Use ICE? -// -#define USE_ICE 1 - -// -// Use SRTP? -// -#define USE_SRTP PJSUA_DEFAULT_USE_SRTP - -// -// Globals -// -static pjsua_acc_id g_acc_id = PJSUA_INVALID_ID; -static pjsua_call_id g_call_id = PJSUA_INVALID_ID; -static pjsua_buddy_id g_buddy_id = PJSUA_INVALID_ID; - - -/* Callback called by the library upon receiving incoming call */ -static void on_incoming_call(pjsua_acc_id acc_id, pjsua_call_id call_id, - pjsip_rx_data *rdata) -{ - pjsua_call_info ci; - - PJ_UNUSED_ARG(acc_id); - PJ_UNUSED_ARG(rdata); - - if (g_call_id != PJSUA_INVALID_ID) { - pjsua_call_answer(call_id, PJSIP_SC_BUSY_HERE, NULL, NULL); - return; - } - - pjsua_call_get_info(call_id, &ci); - - PJ_LOG(3,(THIS_FILE, "Incoming call from %.*s!!", - (int)ci.remote_info.slen, - ci.remote_info.ptr)); - - g_call_id = call_id; - - /* Automatically answer incoming calls with 180/Ringing */ - pjsua_call_answer(call_id, 180, NULL, NULL); -} - -/* Callback called by the library when call's state has changed */ -static void on_call_state(pjsua_call_id call_id, pjsip_event *e) -{ - pjsua_call_info ci; - - PJ_UNUSED_ARG(e); - - pjsua_call_get_info(call_id, &ci); - - if (ci.state == PJSIP_INV_STATE_DISCONNECTED) { - if (call_id == g_call_id) - g_call_id = PJSUA_INVALID_ID; - } else if (ci.state != PJSIP_INV_STATE_INCOMING) { - if (g_call_id == PJSUA_INVALID_ID) - g_call_id = call_id; - } - - PJ_LOG(3,(THIS_FILE, "Call %d state=%.*s", call_id, - (int)ci.state_text.slen, - ci.state_text.ptr)); -} - -/* Callback called by the library when call's media state has changed */ -static void on_call_media_state(pjsua_call_id call_id) -{ - pjsua_call_info ci; - - pjsua_call_get_info(call_id, &ci); - - if (ci.media_status == PJSUA_CALL_MEDIA_ACTIVE) { - // When media is active, connect call to sound device. - pjsua_conf_connect(ci.conf_slot, 0); - pjsua_conf_connect(0, ci.conf_slot); - } -} - - -/* Handler on buddy state changed. */ -static void on_buddy_state(pjsua_buddy_id buddy_id) -{ - pjsua_buddy_info info; - pjsua_buddy_get_info(buddy_id, &info); - - PJ_LOG(3,(THIS_FILE, "%.*s status is %.*s", - (int)info.uri.slen, - info.uri.ptr, - (int)info.status_text.slen, - info.status_text.ptr)); -} - - -/* Incoming IM message (i.e. MESSAGE request)! */ -static void on_pager(pjsua_call_id call_id, const pj_str_t *from, - const pj_str_t *to, const pj_str_t *contact, - const pj_str_t *mime_type, const pj_str_t *text) -{ - /* Note: call index may be -1 */ - PJ_UNUSED_ARG(call_id); - PJ_UNUSED_ARG(to); - PJ_UNUSED_ARG(contact); - PJ_UNUSED_ARG(mime_type); - - PJ_LOG(3,(THIS_FILE,"MESSAGE from %.*s: %.*s", - (int)from->slen, from->ptr, - (int)text->slen, text->ptr)); -} - - -/* Received typing indication */ -static void on_typing(pjsua_call_id call_id, const pj_str_t *from, - const pj_str_t *to, const pj_str_t *contact, - pj_bool_t is_typing) -{ - PJ_UNUSED_ARG(call_id); - PJ_UNUSED_ARG(to); - PJ_UNUSED_ARG(contact); - - PJ_LOG(3,(THIS_FILE, "IM indication: %.*s %s", - (int)from->slen, from->ptr, - (is_typing?"is typing..":"has stopped typing"))); -} - - -/* Call transfer request status. */ -static void on_call_transfer_status(pjsua_call_id call_id, - int status_code, - const pj_str_t *status_text, - pj_bool_t final, - pj_bool_t *p_cont) -{ - PJ_LOG(3,(THIS_FILE, "Call %d: transfer status=%d (%.*s) %s", - call_id, status_code, - (int)status_text->slen, status_text->ptr, - (final ? "[final]" : ""))); - - if (status_code/100 == 2) { - PJ_LOG(3,(THIS_FILE, - "Call %d: call transfered successfully, disconnecting call", - call_id)); - pjsua_call_hangup(call_id, PJSIP_SC_GONE, NULL, NULL); - *p_cont = PJ_FALSE; - } -} - - -/* NAT detection result */ -static void on_nat_detect(const pj_stun_nat_detect_result *res) -{ - if (res->status != PJ_SUCCESS) { - pjsua_perror(THIS_FILE, "NAT detection failed", res->status); - } else { - PJ_LOG(3, (THIS_FILE, "NAT detected as %s", res->nat_type_name)); - } -} - -/* Notification that call is being replaced. */ -static void on_call_replaced(pjsua_call_id old_call_id, - pjsua_call_id new_call_id) -{ - pjsua_call_info old_ci, new_ci; - - pjsua_call_get_info(old_call_id, &old_ci); - pjsua_call_get_info(new_call_id, &new_ci); - - PJ_LOG(3,(THIS_FILE, "Call %d with %.*s is being replaced by " - "call %d with %.*s", - old_call_id, - (int)old_ci.remote_info.slen, old_ci.remote_info.ptr, - new_call_id, - (int)new_ci.remote_info.slen, new_ci.remote_info.ptr)); -} - - -//#include<e32debug.h> - -/* Logging callback */ -static void log_writer(int level, const char *buf, int len) -{ - static wchar_t buf16[PJ_LOG_MAX_SIZE]; - - PJ_UNUSED_ARG(level); - - pj_ansi_to_unicode(buf, len, buf16, PJ_ARRAY_SIZE(buf16)); - - TPtrC16 aBuf((const TUint16*)buf16, (TInt)len); - //RDebug::Print(aBuf); - console->Write(aBuf); - -} - -/* - * app_startup() - * - * url may contain URL to call. - */ -static pj_status_t app_startup() -{ - pj_status_t status; - - /* Redirect log before pjsua_init() */ - pj_log_set_log_func(&log_writer); - - /* Set log level */ - pj_log_set_level(LOG_LEVEL); - - /* Create pjsua first! */ - status = pjsua_create(); - if (status != PJ_SUCCESS) { - pjsua_perror(THIS_FILE, "pjsua_create() error", status); - return status; - } - - /* Init pjsua */ - pjsua_config cfg; - pjsua_logging_config log_cfg; - pjsua_media_config med_cfg; - - pjsua_config_default(&cfg); - cfg.max_calls = 2; - cfg.thread_cnt = 0; // Disable threading on Symbian - cfg.use_srtp = USE_SRTP; - cfg.srtp_secure_signaling = 0; - - cfg.cb.on_incoming_call = &on_incoming_call; - cfg.cb.on_call_media_state = &on_call_media_state; - cfg.cb.on_call_state = &on_call_state; - cfg.cb.on_buddy_state = &on_buddy_state; - cfg.cb.on_pager = &on_pager; - cfg.cb.on_typing = &on_typing; - cfg.cb.on_call_transfer_status = &on_call_transfer_status; - cfg.cb.on_call_replaced = &on_call_replaced; - cfg.cb.on_nat_detect = &on_nat_detect; - - if (SIP_PROXY) { - cfg.outbound_proxy_cnt = 1; - cfg.outbound_proxy[0] = pj_str(SIP_PROXY); - } - - if (NAMESERVER) { - cfg.nameserver_count = 1; - cfg.nameserver[0] = pj_str(NAMESERVER); - } - - if (NAMESERVER && STUN_DOMAIN) { - cfg.stun_domain = pj_str(STUN_DOMAIN); - } else if (STUN_SERVER) { - cfg.stun_host = pj_str(STUN_SERVER); - } - - - pjsua_logging_config_default(&log_cfg); - log_cfg.level = LOG_LEVEL; - log_cfg.console_level = LOG_LEVEL; - log_cfg.cb = &log_writer; - //log_cfg.log_filename = pj_str("C:\\data\\symbian_ua.log"); - - pjsua_media_config_default(&med_cfg); - med_cfg.thread_cnt = 0; // Disable threading on Symbian - med_cfg.has_ioqueue = PJ_FALSE; - med_cfg.clock_rate = 8000; -#if defined(PJMEDIA_SYM_SND_USE_APS) && (PJMEDIA_SYM_SND_USE_APS==1) - med_cfg.audio_frame_ptime = 20; -#else - med_cfg.audio_frame_ptime = 40; -#endif - med_cfg.ec_tail_len = 0; - med_cfg.enable_ice = USE_ICE; - med_cfg.snd_auto_close_time = 5; // wait for 5 seconds idle before sound dev get auto-closed - - status = pjsua_init(&cfg, &log_cfg, &med_cfg); - if (status != PJ_SUCCESS) { - pjsua_perror(THIS_FILE, "pjsua_init() error", status); - pjsua_destroy(); - return status; - } - - /* Adjust Speex priority and enable only the narrowband */ - { - pj_str_t codec_id = pj_str("speex/8000"); - pjmedia_codec_mgr_set_codec_priority( - pjmedia_endpt_get_codec_mgr(pjsua_var.med_endpt), - &codec_id, PJMEDIA_CODEC_PRIO_NORMAL+1); - - codec_id = pj_str("speex/16000"); - pjmedia_codec_mgr_set_codec_priority( - pjmedia_endpt_get_codec_mgr(pjsua_var.med_endpt), - &codec_id, PJMEDIA_CODEC_PRIO_DISABLED); - - codec_id = pj_str("speex/32000"); - pjmedia_codec_mgr_set_codec_priority( - pjmedia_endpt_get_codec_mgr(pjsua_var.med_endpt), - &codec_id, PJMEDIA_CODEC_PRIO_DISABLED); - } - - /* Add UDP transport. */ - pjsua_transport_config tcfg; - pjsua_transport_id tid; - - pjsua_transport_config_default(&tcfg); - tcfg.port = SIP_PORT; - status = pjsua_transport_create(PJSIP_TRANSPORT_UDP, &tcfg, &tid); - if (status != PJ_SUCCESS) { - pjsua_perror(THIS_FILE, "Error creating transport", status); - pjsua_destroy(); - return status; - } - - /* Add account for the transport */ - pjsua_acc_add_local(tid, PJ_TRUE, &g_acc_id); - - - /* Initialization is done, now start pjsua */ - status = pjsua_start(); - if (status != PJ_SUCCESS) { - pjsua_perror(THIS_FILE, "Error starting pjsua", status); - pjsua_destroy(); - return status; - } - - /* Register to SIP server by creating SIP account. */ - if (HAS_SIP_ACCOUNT) { - pjsua_acc_config cfg; - - pjsua_acc_config_default(&cfg); - cfg.id = pj_str("sip:" SIP_USER "@" SIP_DOMAIN); - cfg.reg_uri = pj_str("sip:" SIP_DOMAIN); - cfg.cred_count = 1; - cfg.cred_info[0].realm = pj_str("*"); - cfg.cred_info[0].scheme = pj_str("digest"); - cfg.cred_info[0].username = pj_str(SIP_USER); - cfg.cred_info[0].data_type = PJSIP_CRED_DATA_PLAIN_PASSWD; - cfg.cred_info[0].data = pj_str(SIP_PASSWD); - - status = pjsua_acc_add(&cfg, PJ_TRUE, &g_acc_id); - if (status != PJ_SUCCESS) { - pjsua_perror(THIS_FILE, "Error adding account", status); - pjsua_destroy(); - return status; - } - } - - if (SIP_DST_URI) { - pjsua_buddy_config bcfg; - - pjsua_buddy_config_default(&bcfg); - bcfg.uri = pj_str(SIP_DST_URI); - bcfg.subscribe = PJ_FALSE; - - pjsua_buddy_add(&bcfg, &g_buddy_id); - } - return PJ_SUCCESS; -} - - -//////////////////////////////////////////////////////////////////////////// -/* - * The interractive console UI - */ -#include <e32base.h> - -class ConsoleUI : public CActive -{ -public: - ConsoleUI(CConsoleBase *con); - - // Run console UI - void Run(); - - // Stop - void Stop(); - -protected: - // Cancel asynchronous read. - void DoCancel(); - - // Implementation: called when read has completed. - void RunL(); - -private: - CConsoleBase *con_; -}; - - -ConsoleUI::ConsoleUI(CConsoleBase *con) -: CActive(EPriorityStandard), con_(con) -{ - CActiveScheduler::Add(this); -} - -// Run console UI -void ConsoleUI::Run() -{ - con_->Read(iStatus); - SetActive(); -} - -// Stop console UI -void ConsoleUI::Stop() -{ - DoCancel(); -} - -// Cancel asynchronous read. -void ConsoleUI::DoCancel() -{ - con_->ReadCancel(); -} - -static void PrintMenu() -{ - PJ_LOG(3, (THIS_FILE, "\n\n" - "Menu:\n" - " d Dump states\n" - " D Dump states detail\n" - " P Dump pool factory\n" - " l Start loopback audio device\n" - " L Stop loopback audio device\n" - " m Call " SIP_DST_URI "\n" - " a Answer call\n" - " g Hangup all calls\n" - " s Subscribe " SIP_DST_URI "\n" - " S Unsubscribe presence\n" - " o Set account online\n" - " O Set account offline\n" - " w Quit\n")); -} - -// Implementation: called when read has completed. -void ConsoleUI::RunL() -{ - TKeyCode kc = con_->KeyCode(); - pj_bool_t reschedule = PJ_TRUE; - - switch (kc) { - case 'w': - CActiveScheduler::Stop(); - reschedule = PJ_FALSE; - break; - case 'D': - case 'd': - pjsua_dump(kc == 'D'); - break; - case 'p': - case 'P': - pj_pool_factory_dump(pjsua_get_pool_factory(), PJ_TRUE); - break; - case 'l': - pjsua_conf_connect(0, 0); - break; - case 'L': - pjsua_conf_disconnect(0, 0); - break; - case 'm': - if (g_call_id != PJSUA_INVALID_ID) { - PJ_LOG(3,(THIS_FILE, "Another call is active")); - break; - } - - if (pjsua_verify_sip_url(SIP_DST_URI) == PJ_SUCCESS) { - pj_str_t dst = pj_str(SIP_DST_URI); - pjsua_call_make_call(g_acc_id, &dst, 0, NULL, - NULL, &g_call_id); - } else { - PJ_LOG(3,(THIS_FILE, "Invalid SIP URI")); - } - break; - case 'a': - if (g_call_id != PJSUA_INVALID_ID) - pjsua_call_answer(g_call_id, 200, NULL, NULL); - break; - case 'g': - pjsua_call_hangup_all(); - break; - case 's': - case 'S': - if (g_buddy_id != PJSUA_INVALID_ID) - pjsua_buddy_subscribe_pres(g_buddy_id, kc=='s'); - break; - case 'o': - case 'O': - pjsua_acc_set_online_status(g_acc_id, kc=='o'); - break; - default: - PJ_LOG(3,(THIS_FILE, "Keycode '%c' (%d) is pressed", - kc, kc)); - break; - } - - PrintMenu(); - - if (reschedule) - Run(); -} - -#if 0 -// IP networking related testing -static pj_status_t test_addr(void) -{ - int af; - unsigned i, count; - pj_addrinfo ai[8]; - pj_sockaddr ifs[8]; - const pj_str_t *hostname; - pj_hostent he; - pj_status_t status; - - pj_log_set_log_func(&log_writer); - - status = pj_init(); - if (status != PJ_SUCCESS) { - pjsua_perror(THIS_FILE, "pj_init() error", status); - return status; - } - - af = pj_AF_INET(); - -#if 0 - pj_in_addr in_addr; - pj_str_t aa = pj_str("1.1.1.1"); - in_addr = pj_inet_addr(&aa); - char *the_addr = pj_inet_ntoa(in_addr); - PJ_LOG(3,(THIS_FILE, "IP addr=%s", the_addr)); - - aa = pj_str("192.168.0.15"); - in_addr = pj_inet_addr(&aa); - the_addr = pj_inet_ntoa(in_addr); - PJ_LOG(3,(THIS_FILE, "IP addr=%s", the_addr)); - - aa = pj_str("2.2.2.2"); - in_addr = pj_inet_addr(&aa); - the_addr = pj_inet_ntoa(in_addr); - PJ_LOG(3,(THIS_FILE, "IP addr=%s", the_addr)); - - return -1; -#endif - - // Hostname - hostname = pj_gethostname(); - if (hostname == NULL) { - status = PJ_ERESOLVE; - pjsua_perror(THIS_FILE, "pj_gethostname() error", status); - goto on_return; - } - - PJ_LOG(3,(THIS_FILE, "Hostname: %.*s", hostname->slen, hostname->ptr)); - - // Gethostbyname - status = pj_gethostbyname(hostname, &he); - if (status != PJ_SUCCESS) { - pjsua_perror(THIS_FILE, "pj_gethostbyname() error", status); - } else { - PJ_LOG(3,(THIS_FILE, "gethostbyname: %s", - pj_inet_ntoa(*(pj_in_addr*)he.h_addr))); - } - - // Getaddrinfo - count = PJ_ARRAY_SIZE(ai); - status = pj_getaddrinfo(af, hostname, &count, ai); - if (status != PJ_SUCCESS) { - pjsua_perror(THIS_FILE, "pj_getaddrinfo() error", status); - } else { - for (i=0; i<count; ++i) { - char ipaddr[PJ_INET6_ADDRSTRLEN+2]; - PJ_LOG(3,(THIS_FILE, "Addrinfo: %s", - pj_sockaddr_print(&ai[i].ai_addr, ipaddr, sizeof(ipaddr), 2))); - } - } - - // Enum interface - count = PJ_ARRAY_SIZE(ifs); - status = pj_enum_ip_interface(af, &count, ifs); - if (status != PJ_SUCCESS) { - pjsua_perror(THIS_FILE, "pj_enum_ip_interface() error", status); - } else { - for (i=0; i<count; ++i) { - char ipaddr[PJ_INET6_ADDRSTRLEN+2]; - PJ_LOG(3,(THIS_FILE, "Interface: %s", - pj_sockaddr_print(&ifs[i], ipaddr, sizeof(ipaddr), 2))); - } - } - - // Get default iinterface - status = pj_getdefaultipinterface(af, &ifs[0]); - if (status != PJ_SUCCESS) { - pjsua_perror(THIS_FILE, "pj_getdefaultipinterface() error", status); - } else { - char ipaddr[PJ_INET6_ADDRSTRLEN+2]; - PJ_LOG(3,(THIS_FILE, "Default IP: %s", - pj_sockaddr_print(&ifs[0], ipaddr, sizeof(ipaddr), 2))); - } - - // Get default IP address - status = pj_gethostip(af, &ifs[0]); - if (status != PJ_SUCCESS) { - pjsua_perror(THIS_FILE, "pj_gethostip() error", status); - } else { - char ipaddr[PJ_INET6_ADDRSTRLEN+2]; - PJ_LOG(3,(THIS_FILE, "Host IP: %s", - pj_sockaddr_print(&ifs[0], ipaddr, sizeof(ipaddr), 2))); - } - - status = -1; - -on_return: - pj_shutdown(); - return status; -} -#endif - - -#include <es_sock.h> - -#if 0 -// Force network connection to use the first IAP, -// this is useful for debugging on emulator without GUI. -// Include commdb.lib & apengine.lib in symbian_ua.mmp file -// if this is enabled. - -#include <apdatahandler.h> - -inline void ForceUseFirstIAP() -{ - TUint32 rank = 1; - TUint32 bearers; - TUint32 prompt; - TUint32 iap; - - CCommsDatabase* commDb = CCommsDatabase::NewL(EDatabaseTypeIAP); - CleanupStack::PushL(commDb); - - CApDataHandler* apDataHandler = CApDataHandler::NewLC(*commDb); - - TCommDbConnectionDirection direction = ECommDbConnectionDirectionOutgoing; - apDataHandler->GetPreferredIfDbIapTypeL(rank, direction, bearers, prompt, iap); - prompt = ECommDbDialogPrefDoNotPrompt; - apDataHandler->SetPreferredIfDbIapTypeL(rank, direction, bearers, (TCommDbDialogPref)prompt, iap, ETrue); - CleanupStack::PopAndDestroy(2); // apDataHandler, commDb -} - -static void SelectIAP() -{ - ForceUseFirstIAP(); -} - -#else - -static void SelectIAP() -{ -} - -#endif - - -//////////////////////////////////////////////////////////////////////////// -int ua_main() -{ - RSocketServ aSocketServer; - RConnection aConn; - TInt err; - pj_symbianos_params sym_params; - pj_status_t status; - - SelectIAP(); - - // Initialize RSocketServ - if ((err=aSocketServer.Connect()) != KErrNone) - return PJ_STATUS_FROM_OS(err); - - // Open up a connection - if ((err=aConn.Open(aSocketServer)) != KErrNone) { - aSocketServer.Close(); - return PJ_STATUS_FROM_OS(err); - } - - if ((err=aConn.Start()) != KErrNone) { - aSocketServer.Close(); - return PJ_STATUS_FROM_OS(err); - } - - // Set Symbian OS parameters in pjlib. - // This must be done before pj_init() is called. - pj_bzero(&sym_params, sizeof(sym_params)); - sym_params.rsocketserv = &aSocketServer; - sym_params.rconnection = &aConn; - pj_symbianos_set_params(&sym_params); - - // Initialize pjsua - status = app_startup(); - //status = test_addr(); - if (status != PJ_SUCCESS) { - aConn.Close(); - aSocketServer.Close(); - return status; - } - - // Run the UI - ConsoleUI *con = new ConsoleUI(console); - - con->Run(); - PrintMenu(); - - CActiveScheduler::Start(); - - delete con; - - // Dump memory statistics - PJ_LOG(3,(THIS_FILE, "Max heap usage: %u.%03uMB", - pjsua_var.cp.peak_used_size / 1000000, - (pjsua_var.cp.peak_used_size % 1000000)/1000)); - - // check max stack usage -#if defined(PJ_OS_HAS_CHECK_STACK) && PJ_OS_HAS_CHECK_STACK!=0 - pj_thread_t* this_thread = pj_thread_this(); - if (!this_thread) - return status; - - const char* max_stack_file; - int max_stack_line; - status = pj_thread_get_stack_info(this_thread, &max_stack_file, &max_stack_line); - - PJ_LOG(3,(THIS_FILE, "Max stack usage: %u at %s:%d", - pj_thread_get_stack_max_usage(this_thread), - max_stack_file, max_stack_line)); -#endif - - // Shutdown pjsua - pjsua_destroy(); - - // Close connection and socket server - aConn.Close(); - aSocketServer.Close(); - - return status; -} - diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua_gui/src/Symbian_ua_guiSettingItemListSets.cpp b/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua_gui/src/Symbian_ua_guiSettingItemListSets.cpp deleted file mode 100644 index 6d7522938b924bc781abb0d7ae49544c8af38811..0000000000000000000000000000000000000000 --- a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua_gui/src/Symbian_ua_guiSettingItemListSets.cpp +++ /dev/null @@ -1,144 +0,0 @@ -/* -======================================================================== - Name : Symbian_ua_guiSettingItemListSettings.cpp - Author : nanang - Copyright : (c) 2008-2009 Teluu Inc. - Description : -======================================================================== -*/ -/** - * Generated helper class which manages the settings contained - * in 'symbian_ua_guiSettingItemList'. Each CAknSettingItem maintains - * a reference to data in this class so that changes in the setting - * item list can be synchronized with this storage. - */ - -// [[[ begin generated region: do not modify [Generated Includes] -#include <e32base.h> -#include <stringloader.h> -#include <barsread.h> -#include <symbian_ua_gui.rsg> -#include "Symbian_ua_guiSettingItemListSettings.h" -// ]]] end generated region [Generated Includes] - -/** - * C/C++ constructor for settings data, cannot throw - */ -TSymbian_ua_guiSettingItemListSettings::TSymbian_ua_guiSettingItemListSettings() - { - } - -/** - * Two-phase constructor for settings data - */ -TSymbian_ua_guiSettingItemListSettings* TSymbian_ua_guiSettingItemListSettings::NewL() - { - TSymbian_ua_guiSettingItemListSettings* data = new( ELeave ) TSymbian_ua_guiSettingItemListSettings; - CleanupStack::PushL( data ); - data->ConstructL(); - CleanupStack::Pop( data ); - return data; - } - -/** - * Second phase for initializing settings data - */ -void TSymbian_ua_guiSettingItemListSettings::ConstructL() - { - // [[[ begin generated region: do not modify [Generated Initializers] - { - HBufC* text = StringLoader::LoadLC( R_SYMBIAN_UA_GUI_SETTING_ITEM_LIST_ED_REGISTRAR ); - SetEd_registrar( text->Des() ); - CleanupStack::PopAndDestroy( text ); - } - { - HBufC* text = StringLoader::LoadLC( R_SYMBIAN_UA_GUI_SETTING_ITEM_LIST_ED_USER ); - SetEd_user( text->Des() ); - CleanupStack::PopAndDestroy( text ); - } - SetB_srtp( 0 ); - SetB_ice( 0 ); - { - HBufC* text = StringLoader::LoadLC( R_SYMBIAN_UA_GUI_SETTING_ITEM_LIST_ED_STUN_SERVER ); - SetEd_stun_server( text->Des() ); - CleanupStack::PopAndDestroy( text ); - } - // ]]] end generated region [Generated Initializers] - - } - -// [[[ begin generated region: do not modify [Generated Contents] -TDes& TSymbian_ua_guiSettingItemListSettings::Ed_registrar() - { - return iEd_registrar; - } - -void TSymbian_ua_guiSettingItemListSettings::SetEd_registrar(const TDesC& aValue) - { - if ( aValue.Length() < KEd_registrarMaxLength) - iEd_registrar.Copy( aValue ); - else - iEd_registrar.Copy( aValue.Ptr(), KEd_registrarMaxLength); - } - -TDes& TSymbian_ua_guiSettingItemListSettings::Ed_user() - { - return iEd_user; - } - -void TSymbian_ua_guiSettingItemListSettings::SetEd_user(const TDesC& aValue) - { - if ( aValue.Length() < KEd_userMaxLength) - iEd_user.Copy( aValue ); - else - iEd_user.Copy( aValue.Ptr(), KEd_userMaxLength); - } - -TDes& TSymbian_ua_guiSettingItemListSettings::Ed_password() - { - return iEd_password; - } - -void TSymbian_ua_guiSettingItemListSettings::SetEd_password(const TDesC& aValue) - { - if ( aValue.Length() < KEd_passwordMaxLength) - iEd_password.Copy( aValue ); - else - iEd_password.Copy( aValue.Ptr(), KEd_passwordMaxLength); - } - -TBool& TSymbian_ua_guiSettingItemListSettings::B_srtp() - { - return iB_srtp; - } - -void TSymbian_ua_guiSettingItemListSettings::SetB_srtp(const TBool& aValue) - { - iB_srtp = aValue; - } - -TBool& TSymbian_ua_guiSettingItemListSettings::B_ice() - { - return iB_ice; - } - -void TSymbian_ua_guiSettingItemListSettings::SetB_ice(const TBool& aValue) - { - iB_ice = aValue; - } - -TDes& TSymbian_ua_guiSettingItemListSettings::Ed_stun_server() - { - return iEd_stun_server; - } - -void TSymbian_ua_guiSettingItemListSettings::SetEd_stun_server(const TDesC& aValue) - { - if ( aValue.Length() < KEd_stun_serverMaxLength) - iEd_stun_server.Copy( aValue ); - else - iEd_stun_server.Copy( aValue.Ptr(), KEd_stun_serverMaxLength); - } - -// ]]] end generated region [Generated Contents] - diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua_gui/src/symbian_ua.cpp b/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua_gui/src/symbian_ua.cpp deleted file mode 100644 index f722336a1b900a640f9aecab638b82c5b60f10cc..0000000000000000000000000000000000000000 --- a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua_gui/src/symbian_ua.cpp +++ /dev/null @@ -1,514 +0,0 @@ -/* $Id: ua.cpp 1793 2008-02-14 13:39:24Z bennylp $ */ -/* - * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) - * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> - * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#include <pjsua-lib/pjsua.h> -#include <pjsua-lib/pjsua_internal.h> -#include <es_sock.h> -#include "symbian_ua.h" - -#define THIS_FILE "symbian_ua.cpp" -#define LOG_LEVEL 3 - -#define SIP_PORT 5060 -#define USE_ICE 0 -#define USE_SRTP PJSUA_DEFAULT_USE_SRTP - -static RSocketServ aSocketServer; -static RConnection aConn; - -static pjsua_acc_id g_acc_id = PJSUA_INVALID_ID; -static pjsua_call_id g_call_id = PJSUA_INVALID_ID; -static pjsua_buddy_id g_buddy_id = PJSUA_INVALID_ID; - -static symbian_ua_info_cb_t g_cb = {NULL, NULL, NULL, NULL, NULL}; - -static void log_writer(int level, const char *buf, int len) -{ - static wchar_t buf16[PJ_LOG_MAX_SIZE]; - - PJ_UNUSED_ARG(level); - - if (!g_cb.on_info) - return; - - pj_ansi_to_unicode(buf, len, buf16, PJ_ARRAY_SIZE(buf16)); - g_cb.on_info(buf16); -} - -static void on_reg_state(pjsua_acc_id acc_id) -{ - pjsua_acc_info acc_info; - pj_status_t status; - - status = pjsua_acc_get_info(acc_id, &acc_info); - if (status != PJ_SUCCESS) - return; - - if (acc_info.status == 200) { - if (acc_info.expires) { - PJ_LOG(3,(THIS_FILE, "Registration success!")); - if (g_cb.on_reg_state) g_cb.on_reg_state(true); - } else { - PJ_LOG(3,(THIS_FILE, "Unregistration success!")); - if (g_cb.on_unreg_state) g_cb.on_unreg_state(true); - } - } else { - if (acc_info.expires) { - PJ_LOG(3,(THIS_FILE, "Registration failed!")); - if (g_cb.on_reg_state) g_cb.on_reg_state(false); - } else { - PJ_LOG(3,(THIS_FILE, "Unregistration failed!")); - if (g_cb.on_unreg_state) g_cb.on_unreg_state(false); - } - } -} - -/* Callback called by the library upon receiving incoming call */ -static void on_incoming_call(pjsua_acc_id acc_id, pjsua_call_id call_id, - pjsip_rx_data *rdata) -{ - pjsua_call_info ci; - - PJ_UNUSED_ARG(acc_id); - PJ_UNUSED_ARG(rdata); - - if (g_call_id != PJSUA_INVALID_ID) { - pjsua_call_answer(call_id, PJSIP_SC_BUSY_HERE, NULL, NULL); - return; - } - - pjsua_call_get_info(call_id, &ci); - - PJ_LOG(3,(THIS_FILE, "Incoming call from %.*s!!", - (int)ci.remote_info.slen, - ci.remote_info.ptr)); - - g_call_id = call_id; - - /* Automatically answer incoming calls with 180/Ringing */ - pjsua_call_answer(call_id, 180, NULL, NULL); - - if (g_cb.on_incoming_call) { - static wchar_t disp[256]; - static wchar_t uri[PJSIP_MAX_URL_SIZE]; - - pj_ansi_to_unicode(ci.remote_info.ptr, ci.remote_info.slen, - disp, PJ_ARRAY_SIZE(disp)); - pj_ansi_to_unicode(ci.remote_contact.ptr, ci.remote_contact.slen, - uri, PJ_ARRAY_SIZE(uri)); - - g_cb.on_incoming_call(disp, uri); - } -} - -/* Callback called by the library when call's state has changed */ -static void on_call_state(pjsua_call_id call_id, pjsip_event *e) -{ - pjsua_call_info ci; - - PJ_UNUSED_ARG(e); - - pjsua_call_get_info(call_id, &ci); - - if (ci.state == PJSIP_INV_STATE_DISCONNECTED) { - if (call_id == g_call_id) - g_call_id = PJSUA_INVALID_ID; - if (g_cb.on_call_end) { - static wchar_t reason[256]; - pj_ansi_to_unicode(ci.last_status_text.ptr, ci.last_status_text.slen, - reason, PJ_ARRAY_SIZE(reason)); - g_cb.on_call_end(reason); - } - - } else if (ci.state != PJSIP_INV_STATE_INCOMING) { - if (g_call_id == PJSUA_INVALID_ID) - g_call_id = call_id; - } - - PJ_LOG(3,(THIS_FILE, "Call %d state=%.*s", call_id, - (int)ci.state_text.slen, - ci.state_text.ptr)); -} - -/* Callback called by the library when call's media state has changed */ -static void on_call_media_state(pjsua_call_id call_id) -{ - pjsua_call_info ci; - - pjsua_call_get_info(call_id, &ci); - - if (ci.media_status == PJSUA_CALL_MEDIA_ACTIVE) { - // When media is active, connect call to sound device. - pjsua_conf_connect(ci.conf_slot, 0); - pjsua_conf_connect(0, ci.conf_slot); - } -} - - -/* Handler on buddy state changed. */ -static void on_buddy_state(pjsua_buddy_id buddy_id) -{ - pjsua_buddy_info info; - pjsua_buddy_get_info(buddy_id, &info); - - PJ_LOG(3,(THIS_FILE, "%.*s status is %.*s", - (int)info.uri.slen, - info.uri.ptr, - (int)info.status_text.slen, - info.status_text.ptr)); -} - - -/* Incoming IM message (i.e. MESSAGE request)! */ -static void on_pager(pjsua_call_id call_id, const pj_str_t *from, - const pj_str_t *to, const pj_str_t *contact, - const pj_str_t *mime_type, const pj_str_t *text) -{ - /* Note: call index may be -1 */ - PJ_UNUSED_ARG(call_id); - PJ_UNUSED_ARG(to); - PJ_UNUSED_ARG(contact); - PJ_UNUSED_ARG(mime_type); - - PJ_LOG(3,(THIS_FILE,"MESSAGE from %.*s: %.*s", - (int)from->slen, from->ptr, - (int)text->slen, text->ptr)); -} - - -/* Received typing indication */ -static void on_typing(pjsua_call_id call_id, const pj_str_t *from, - const pj_str_t *to, const pj_str_t *contact, - pj_bool_t is_typing) -{ - PJ_UNUSED_ARG(call_id); - PJ_UNUSED_ARG(to); - PJ_UNUSED_ARG(contact); - - PJ_LOG(3,(THIS_FILE, "IM indication: %.*s %s", - (int)from->slen, from->ptr, - (is_typing?"is typing..":"has stopped typing"))); -} - - -/* Call transfer request status. */ -static void on_call_transfer_status(pjsua_call_id call_id, - int status_code, - const pj_str_t *status_text, - pj_bool_t final, - pj_bool_t *p_cont) -{ - PJ_LOG(3,(THIS_FILE, "Call %d: transfer status=%d (%.*s) %s", - call_id, status_code, - (int)status_text->slen, status_text->ptr, - (final ? "[final]" : ""))); - - if (status_code/100 == 2) { - PJ_LOG(3,(THIS_FILE, - "Call %d: call transfered successfully, disconnecting call", - call_id)); - pjsua_call_hangup(call_id, PJSIP_SC_GONE, NULL, NULL); - *p_cont = PJ_FALSE; - } -} - - -/* NAT detection result */ -static void on_nat_detect(const pj_stun_nat_detect_result *res) -{ - if (res->status != PJ_SUCCESS) { - pjsua_perror(THIS_FILE, "NAT detection failed", res->status); - } else { - PJ_LOG(3, (THIS_FILE, "NAT detected as %s", res->nat_type_name)); - } -} - -/* Notification that call is being replaced. */ -static void on_call_replaced(pjsua_call_id old_call_id, - pjsua_call_id new_call_id) -{ - pjsua_call_info old_ci, new_ci; - - pjsua_call_get_info(old_call_id, &old_ci); - pjsua_call_get_info(new_call_id, &new_ci); - - PJ_LOG(3,(THIS_FILE, "Call %d with %.*s is being replaced by " - "call %d with %.*s", - old_call_id, - (int)old_ci.remote_info.slen, old_ci.remote_info.ptr, - new_call_id, - (int)new_ci.remote_info.slen, new_ci.remote_info.ptr)); -} - -int symbian_ua_init() -{ - TInt err; - pj_symbianos_params sym_params; - pj_status_t status; - - // Initialize RSocketServ - if ((err=aSocketServer.Connect()) != KErrNone) - return PJ_STATUS_FROM_OS(err); - - // Open up a connection - if ((err=aConn.Open(aSocketServer)) != KErrNone) { - aSocketServer.Close(); - return PJ_STATUS_FROM_OS(err); - } - - if ((err=aConn.Start()) != KErrNone) { - aConn.Close(); - aSocketServer.Close(); - return PJ_STATUS_FROM_OS(err); - } - - // Set Symbian OS parameters in pjlib. - // This must be done before pj_init() is called. - pj_bzero(&sym_params, sizeof(sym_params)); - sym_params.rsocketserv = &aSocketServer; - sym_params.rconnection = &aConn; - pj_symbianos_set_params(&sym_params); - - /* Redirect log before pjsua_init() */ - pj_log_set_log_func(&log_writer); - - /* Set log level */ - pj_log_set_level(LOG_LEVEL); - - /* Create pjsua first! */ - status = pjsua_create(); - if (status != PJ_SUCCESS) { - pjsua_perror(THIS_FILE, "pjsua_create() error", status); - return status; - } - - /* Init pjsua */ - pjsua_config cfg; - - pjsua_config_default(&cfg); - cfg.max_calls = 2; - cfg.thread_cnt = 0; // Disable threading on Symbian - cfg.use_srtp = USE_SRTP; - cfg.srtp_secure_signaling = 0; - - cfg.cb.on_incoming_call = &on_incoming_call; - cfg.cb.on_call_media_state = &on_call_media_state; - cfg.cb.on_call_state = &on_call_state; - cfg.cb.on_buddy_state = &on_buddy_state; - cfg.cb.on_pager = &on_pager; - cfg.cb.on_typing = &on_typing; - cfg.cb.on_call_transfer_status = &on_call_transfer_status; - cfg.cb.on_call_replaced = &on_call_replaced; - cfg.cb.on_nat_detect = &on_nat_detect; - cfg.cb.on_reg_state = &on_reg_state; - - pjsua_media_config med_cfg; - - pjsua_media_config_default(&med_cfg); - med_cfg.thread_cnt = 0; // Disable threading on Symbian - med_cfg.has_ioqueue = PJ_FALSE; - med_cfg.clock_rate = 8000; -#if defined(PJMEDIA_SYM_SND_USE_APS) && (PJMEDIA_SYM_SND_USE_APS==1) - med_cfg.audio_frame_ptime = 20; -#else - med_cfg.audio_frame_ptime = 40; -#endif - med_cfg.ec_tail_len = 0; - med_cfg.enable_ice = USE_ICE; - med_cfg.snd_auto_close_time = 5; // wait for 5 seconds idle before sound dev get auto-closed - - pjsua_logging_config log_cfg; - - pjsua_logging_config_default(&log_cfg); - log_cfg.console_level = LOG_LEVEL; - log_cfg.cb = &log_writer; - log_cfg.decor = 0; - - status = pjsua_init(&cfg, &log_cfg, &med_cfg); - if (status != PJ_SUCCESS) { - pjsua_perror(THIS_FILE, "pjsua_init() error", status); - pjsua_destroy(); - return status; - } - - /* Add UDP transport. */ - pjsua_transport_config tcfg; - pjsua_transport_id tid; - - pjsua_transport_config_default(&tcfg); - tcfg.port = SIP_PORT; - status = pjsua_transport_create(PJSIP_TRANSPORT_UDP, &tcfg, &tid); - if (status != PJ_SUCCESS) { - pjsua_perror(THIS_FILE, "Error creating transport", status); - pjsua_destroy(); - return status; - } - - /* Add account for the transport */ - pjsua_acc_add_local(tid, PJ_TRUE, &g_acc_id); - - /* Initialization is done, now start pjsua */ - status = pjsua_start(); - if (status != PJ_SUCCESS) { - pjsua_perror(THIS_FILE, "Error starting pjsua", status); - pjsua_destroy(); - return status; - } - - /* Adjust Speex priority and enable only the narrowband */ - { - pj_str_t codec_id = pj_str("speex/8000"); - pjmedia_codec_mgr_set_codec_priority( - pjmedia_endpt_get_codec_mgr(pjsua_var.med_endpt), - &codec_id, PJMEDIA_CODEC_PRIO_NORMAL+1); - - codec_id = pj_str("speex/16000"); - pjmedia_codec_mgr_set_codec_priority( - pjmedia_endpt_get_codec_mgr(pjsua_var.med_endpt), - &codec_id, PJMEDIA_CODEC_PRIO_DISABLED); - - codec_id = pj_str("speex/32000"); - pjmedia_codec_mgr_set_codec_priority( - pjmedia_endpt_get_codec_mgr(pjsua_var.med_endpt), - &codec_id, PJMEDIA_CODEC_PRIO_DISABLED); - } - - return PJ_SUCCESS; -} - - -int symbian_ua_destroy() -{ - // Shutdown pjsua - pjsua_destroy(); - - // Close connection and socket server - aConn.Close(); - aSocketServer.Close(); - - CloseSTDLIB(); - - return PJ_SUCCESS; -} - -void symbian_ua_set_info_callback(const symbian_ua_info_cb_t *cb) -{ - if (cb) - g_cb = *cb; - else - pj_bzero(&g_cb, sizeof(g_cb)); -} - -int symbian_ua_set_account(const char *domain, const char *username, - const char *password, - bool use_srtp, bool use_ice) -{ - pj_status_t status; - - PJ_ASSERT_RETURN(username && password && domain, PJ_EINVAL); - PJ_UNUSED_ARG(use_srtp); - PJ_UNUSED_ARG(use_ice); - - if (domain[0] == 0) { - pjsua_acc_info acc_info; - pj_status_t status; - - status = pjsua_acc_get_info(g_acc_id, &acc_info); - if (status != PJ_SUCCESS) - return status; - - if (acc_info.status == 200) { - PJ_LOG(3,(THIS_FILE, "Unregistering..")); - pjsua_acc_set_registration(g_acc_id, PJ_FALSE); - g_acc_id = 0; - } - return PJ_SUCCESS; - } - - if (pjsua_acc_get_count() > 1) { - status = pjsua_acc_del(g_acc_id); - if (status != PJ_SUCCESS) { - pjsua_perror(THIS_FILE, "Error removing account", status); - return status; - } - g_acc_id = 0; - } - - pjsua_acc_config cfg; - char tmp_id[PJSIP_MAX_URL_SIZE]; - char tmp_reg_uri[PJSIP_MAX_URL_SIZE]; - - if (!pj_ansi_strnicmp(domain, "sip:", 4)) { - domain += 4; - } - - pjsua_acc_config_default(&cfg); - pj_ansi_sprintf(tmp_id, "sip:%s@%s", username, domain); - cfg.id = pj_str(tmp_id); - pj_ansi_sprintf(tmp_reg_uri, "sip:%s", domain); - cfg.reg_uri = pj_str(tmp_reg_uri); - cfg.cred_count = 1; - cfg.cred_info[0].realm = pj_str("*"); - cfg.cred_info[0].scheme = pj_str("digest"); - cfg.cred_info[0].username = pj_str((char*)username); - cfg.cred_info[0].data_type = PJSIP_CRED_DATA_PLAIN_PASSWD; - cfg.cred_info[0].data = pj_str((char*)password); - - status = pjsua_acc_add(&cfg, PJ_TRUE, &g_acc_id); - if (status != PJ_SUCCESS) { - pjsua_perror(THIS_FILE, "Error setting account", status); - pjsua_destroy(); - return status; - } - - return PJ_SUCCESS; -} - -int symbian_ua_makecall(const char* dest_url) -{ - if (pjsua_verify_sip_url(dest_url) == PJ_SUCCESS) { - pj_str_t dst = pj_str((char*)dest_url); - pjsua_call_make_call(g_acc_id, &dst, 0, NULL, - NULL, &g_call_id); - - return PJ_SUCCESS; - } - - return PJ_EINVAL; -} - -int symbian_ua_endcall() -{ - pjsua_call_hangup_all(); - - return PJ_SUCCESS; -} - -bool symbian_ua_anycall() -{ - return (pjsua_call_get_count()>0); -} - -int symbian_ua_answercall() -{ - PJ_ASSERT_RETURN (g_call_id != PJSUA_INVALID_ID, PJ_EINVAL); - - return pjsua_call_answer(g_call_id, 200, NULL, NULL); -} - diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiAppUi.cpp b/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiAppUi.cpp deleted file mode 100644 index ac399510b2bb98b03fe0b34dbf21a021b4be41ec..0000000000000000000000000000000000000000 --- a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiAppUi.cpp +++ /dev/null @@ -1,247 +0,0 @@ -/* -======================================================================== - Name : symbian_ua_guiAppUi.cpp - Author : nanang - Copyright : (c) 2008-2009 Teluu Inc. - Description : -======================================================================== -*/ -// [[[ begin generated region: do not modify [Generated System Includes] -#include <eikmenub.h> -#include <akncontext.h> -#include <akntitle.h> -#include <symbian_ua_gui.rsg> -// ]]] end generated region [Generated System Includes] - -// [[[ begin generated region: do not modify [Generated User Includes] -#include "symbian_ua_guiAppUi.h" -#include "symbian_ua_gui.hrh" -#include "symbian_ua_guiContainer.hrh" -#include "symbian_ua_guiSettingItemList.hrh" -#include "symbian_ua_guiContainerView.h" -#include "symbian_ua_guiSettingItemListView.h" -// ]]] end generated region [Generated User Includes] - -// [[[ begin generated region: do not modify [Generated Constants] -// ]]] end generated region [Generated Constants] - -#include "symbian_ua.h" - -/** - * Construct the Csymbian_ua_guiAppUi instance - */ -Csymbian_ua_guiAppUi::Csymbian_ua_guiAppUi() : CTimer(0) - { - // [[[ begin generated region: do not modify [Generated Contents] - // ]]] end generated region [Generated Contents] - - } - -/** - * The appui's destructor removes the container from the control - * stack and destroys it. - */ -Csymbian_ua_guiAppUi::~Csymbian_ua_guiAppUi() - { - // [[[ begin generated region: do not modify [Generated Contents] - TRAPD( err_Dlg_wait_init, RemoveDlg_wait_initL() ); - // ]]] end generated region [Generated Contents] - } - -// [[[ begin generated function: do not modify -void Csymbian_ua_guiAppUi::InitializeContainersL() - { - iSymbian_ua_guiContainerView = Csymbian_ua_guiContainerView::NewL(); - AddViewL( iSymbian_ua_guiContainerView ); - iSymbian_ua_guiSettingItemListView = Csymbian_ua_guiSettingItemListView::NewL(); - AddViewL( iSymbian_ua_guiSettingItemListView ); - SetDefaultViewL( *iSymbian_ua_guiSettingItemListView ); - } -// ]]] end generated function - -/** - * Handle a command for this appui (override) - * @param aCommand command id to be handled - */ -void Csymbian_ua_guiAppUi::HandleCommandL( TInt aCommand ) - { - // [[[ begin generated region: do not modify [Generated Code] - TBool commandHandled = EFalse; - switch ( aCommand ) - { // code to dispatch to the AppUi's menu and CBA commands is generated here - default: - break; - } - - - if ( !commandHandled ) - { - if ( aCommand == EAknSoftkeyExit || aCommand == EEikCmdExit ) - { - symbian_ua_destroy(); - Exit(); - } - } - // ]]] end generated region [Generated Code] - - } - -/** - * Override of the HandleResourceChangeL virtual function - */ -void Csymbian_ua_guiAppUi::HandleResourceChangeL( TInt aType ) - { - CAknViewAppUi::HandleResourceChangeL( aType ); - // [[[ begin generated region: do not modify [Generated Code] - // ]]] end generated region [Generated Code] - - } - -/** - * Override of the HandleKeyEventL virtual function - * @return EKeyWasConsumed if event was handled, EKeyWasNotConsumed if not - * @param aKeyEvent - * @param aType - */ -TKeyResponse Csymbian_ua_guiAppUi::HandleKeyEventL( - const TKeyEvent& aKeyEvent, - TEventCode aType ) - { - // The inherited HandleKeyEventL is private and cannot be called - // [[[ begin generated region: do not modify [Generated Contents] - // ]]] end generated region [Generated Contents] - - return EKeyWasNotConsumed; - } - -/** - * Override of the HandleViewDeactivation virtual function - * - * @param aViewIdToBeDeactivated - * @param aNewlyActivatedViewId - */ -void Csymbian_ua_guiAppUi::HandleViewDeactivation( - const TVwsViewId& aViewIdToBeDeactivated, - const TVwsViewId& aNewlyActivatedViewId ) - { - CAknViewAppUi::HandleViewDeactivation( - aViewIdToBeDeactivated, - aNewlyActivatedViewId ); - // [[[ begin generated region: do not modify [Generated Contents] - // ]]] end generated region [Generated Contents] - - } - -/** - * @brief Completes the second phase of Symbian object construction. - * Put initialization code that could leave here. - */ -void Csymbian_ua_guiAppUi::ConstructL() - { - // [[[ begin generated region: do not modify [Generated Contents] - BaseConstructL( EAknEnableSkin ); - InitializeContainersL(); - // ]]] end generated region [Generated Contents] - - // Create private folder - RProcess process; - TFileName path; - - path.Copy( process.FileName().Left(2) ); - - if(path.Compare(_L("c")) || path.Compare(_L("C"))) - CEikonEnv::Static()->FsSession().CreatePrivatePath(EDriveC); - else if(path.Compare(_L("e")) || path.Compare(_L("E"))) - CEikonEnv::Static()->FsSession().CreatePrivatePath(EDriveE); - - // Init PJSUA - if (symbian_ua_init() != 0) { - symbian_ua_destroy(); - Exit(); - } - - ExecuteDlg_wait_initLD(); - - CTimer::ConstructL(); - CActiveScheduler::Add( this ); - After(4000000); - } - -/** - * Override of the HandleApplicationSpecificEventL virtual function - */ -void Csymbian_ua_guiAppUi::HandleApplicationSpecificEventL( - TInt aType, - const TWsEvent& anEvent ) - { - CAknViewAppUi::HandleApplicationSpecificEventL( aType, anEvent ); - // [[[ begin generated region: do not modify [Generated Code] - // ]]] end generated region [Generated Code] - - } - -/** - * Handle the applicationSpecificEvent event. - */ -void Csymbian_ua_guiAppUi::HandleSymbian_ua_guiAppUiApplicationSpecificEventL( - TInt /* aType */, - const TWsEvent& /* anEvent */ ) - { - // TODO: implement applicationSpecificEvent event handler - } - -// [[[ begin generated function: do not modify -/** - * Execute the wait dialog for dlg_wait_init. This routine returns - * while the dialog is showing. It will be closed and destroyed when - * RemoveDlg_wait_initL() or the user selects the Cancel soft key. - * @param aOverrideText optional override text. When null the text configured - * in the UI Designer is used. - */ -void Csymbian_ua_guiAppUi::ExecuteDlg_wait_initLD( const TDesC* aOverrideText ) - { - iDlg_wait_init = new ( ELeave ) CAknWaitDialog( - reinterpret_cast< CEikDialog** >( &iDlg_wait_init ), EFalse ); - if ( aOverrideText != NULL ) - { - iDlg_wait_init->SetTextL( *aOverrideText ); - } - iDlg_wait_init->ExecuteLD( R_APPLICATION_DLG_WAIT_INIT ); - iDlg_wait_initCallback = new ( ELeave ) CProgressDialogCallback( - this, iDlg_wait_init, &Csymbian_ua_guiAppUi::HandleDlg_wait_initCanceledL ); - iDlg_wait_init->SetCallback( iDlg_wait_initCallback ); - } -// ]]] end generated function - -// [[[ begin generated function: do not modify -/** - * Close and dispose of the wait dialog for dlg_wait_init - */ -void Csymbian_ua_guiAppUi::RemoveDlg_wait_initL() - { - if ( iDlg_wait_init != NULL ) - { - iDlg_wait_init->SetCallback( NULL ); - iDlg_wait_init->ProcessFinishedL(); // deletes the dialog - iDlg_wait_init = NULL; - } - delete iDlg_wait_initCallback; - iDlg_wait_initCallback = NULL; - - } -// ]]] end generated function - -/** - * Handle the canceled event. - */ -void Csymbian_ua_guiAppUi::HandleDlg_wait_initCanceledL( CAknProgressDialog* /* aDialog */ ) - { - // TODO: implement canceled event handler - - } - -void Csymbian_ua_guiAppUi::RunL() - { - RemoveDlg_wait_initL(); - iSymbian_ua_guiSettingItemListView->HandleCommandL(EAknSoftkeySave); - } diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiContainer.cpp b/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiContainer.cpp deleted file mode 100644 index 777217c7de802bbeee708c77d062236f1961d719..0000000000000000000000000000000000000000 --- a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiContainer.cpp +++ /dev/null @@ -1,285 +0,0 @@ -/* -======================================================================== - Name : symbian_ua_guiContainer.cpp - Author : nanang - Copyright : (c) 2008-2009 Teluu Inc. - Description : -======================================================================== -*/ -// [[[ begin generated region: do not modify [Generated System Includes] -#include <barsread.h> -#include <stringloader.h> -#include <eiklabel.h> -#include <eikenv.h> -#include <gdi.h> -#include <eikedwin.h> -#include <aknviewappui.h> -#include <eikappui.h> -#include <symbian_ua_gui.rsg> -// ]]] end generated region [Generated System Includes] - -// [[[ begin generated region: do not modify [Generated User Includes] -#include "symbian_ua_guiContainer.h" -#include "symbian_ua_guiContainerView.h" -#include "symbian_ua_gui.hrh" -#include "symbian_ua_guiContainer.hrh" -#include "symbian_ua_guiSettingItemList.hrh" -// ]]] end generated region [Generated User Includes] - -// [[[ begin generated region: do not modify [Generated Constants] -// ]]] end generated region [Generated Constants] - -/** - * First phase of Symbian two-phase construction. Should not - * contain any code that could leave. - */ -CSymbian_ua_guiContainer::CSymbian_ua_guiContainer() - { - // [[[ begin generated region: do not modify [Generated Contents] - iLabel1 = NULL; - iEd_url = NULL; - iEd_info = NULL; - // ]]] end generated region [Generated Contents] - - } -/** - * Destroy child controls. - */ -CSymbian_ua_guiContainer::~CSymbian_ua_guiContainer() - { - // [[[ begin generated region: do not modify [Generated Contents] - delete iLabel1; - iLabel1 = NULL; - delete iEd_url; - iEd_url = NULL; - delete iEd_info; - iEd_info = NULL; - // ]]] end generated region [Generated Contents] - - } - -/** - * Construct the control (first phase). - * Creates an instance and initializes it. - * Instance is not left on cleanup stack. - * @param aRect bounding rectangle - * @param aParent owning parent, or NULL - * @param aCommandObserver command observer - * @return initialized instance of CSymbian_ua_guiContainer - */ -CSymbian_ua_guiContainer* CSymbian_ua_guiContainer::NewL( - const TRect& aRect, - const CCoeControl* aParent, - MEikCommandObserver* aCommandObserver ) - { - CSymbian_ua_guiContainer* self = CSymbian_ua_guiContainer::NewLC( - aRect, - aParent, - aCommandObserver ); - CleanupStack::Pop( self ); - return self; - } - -/** - * Construct the control (first phase). - * Creates an instance and initializes it. - * Instance is left on cleanup stack. - * @param aRect The rectangle for this window - * @param aParent owning parent, or NULL - * @param aCommandObserver command observer - * @return new instance of CSymbian_ua_guiContainer - */ -CSymbian_ua_guiContainer* CSymbian_ua_guiContainer::NewLC( - const TRect& aRect, - const CCoeControl* aParent, - MEikCommandObserver* aCommandObserver ) - { - CSymbian_ua_guiContainer* self = new ( ELeave ) CSymbian_ua_guiContainer(); - CleanupStack::PushL( self ); - self->ConstructL( aRect, aParent, aCommandObserver ); - return self; - } - -/** - * Construct the control (second phase). - * Creates a window to contain the controls and activates it. - * @param aRect bounding rectangle - * @param aCommandObserver command observer - * @param aParent owning parent, or NULL - */ -void CSymbian_ua_guiContainer::ConstructL( - const TRect& aRect, - const CCoeControl* aParent, - MEikCommandObserver* aCommandObserver ) - { - if ( aParent == NULL ) - { - CreateWindowL(); - } - else - { - SetContainerWindowL( *aParent ); - } - iFocusControl = NULL; - iCommandObserver = aCommandObserver; - InitializeControlsL(); - SetRect( aRect ); - ActivateL(); - // [[[ begin generated region: do not modify [Post-ActivateL initializations] - // ]]] end generated region [Post-ActivateL initializations] - - } - -/** -* Return the number of controls in the container (override) -* @return count -*/ -TInt CSymbian_ua_guiContainer::CountComponentControls() const - { - return ( int ) ELastControl; - } - -/** -* Get the control with the given index (override) -* @param aIndex Control index [0...n) (limited by #CountComponentControls) -* @return Pointer to control -*/ -CCoeControl* CSymbian_ua_guiContainer::ComponentControl( TInt aIndex ) const - { - // [[[ begin generated region: do not modify [Generated Contents] - switch ( aIndex ) - { - case ELabel1: - return iLabel1; - case EEd_url: - return iEd_url; - case EEd_info: - return iEd_info; - } - // ]]] end generated region [Generated Contents] - - // handle any user controls here... - - return NULL; - } - -/** - * Handle resizing of the container. This implementation will lay out - * full-sized controls like list boxes for any screen size, and will layout - * labels, editors, etc. to the size they were given in the UI designer. - * This code will need to be modified to adjust arbitrary controls to - * any screen size. - */ -void CSymbian_ua_guiContainer::SizeChanged() - { - CCoeControl::SizeChanged(); - LayoutControls(); - // [[[ begin generated region: do not modify [Generated Contents] - - // ]]] end generated region [Generated Contents] - - } - -// [[[ begin generated function: do not modify -/** - * Layout components as specified in the UI Designer - */ -void CSymbian_ua_guiContainer::LayoutControls() - { - iLabel1->SetExtent( TPoint( 2, 23 ), TSize( 32, 28 ) ); - iEd_url->SetExtent( TPoint( 49, 25 ), TSize( 197, 28 ) ); - iEd_info->SetExtent( TPoint( 3, 78 ), TSize( 235, 143 ) ); - } -// ]]] end generated function - -/** - * Handle key events. - */ -TKeyResponse CSymbian_ua_guiContainer::OfferKeyEventL( - const TKeyEvent& aKeyEvent, - TEventCode aType ) - { - // [[[ begin generated region: do not modify [Generated Contents] - - // ]]] end generated region [Generated Contents] - - if ( iFocusControl != NULL - && iFocusControl->OfferKeyEventL( aKeyEvent, aType ) == EKeyWasConsumed ) - { - return EKeyWasConsumed; - } - return CCoeControl::OfferKeyEventL( aKeyEvent, aType ); - } - -// [[[ begin generated function: do not modify -/** - * Initialize each control upon creation. - */ -void CSymbian_ua_guiContainer::InitializeControlsL() - { - iLabel1 = new ( ELeave ) CEikLabel; - iLabel1->SetContainerWindowL( *this ); - { - TResourceReader reader; - iEikonEnv->CreateResourceReaderLC( reader, R_SYMBIAN_UA_GUI_CONTAINER_LABEL1 ); - iLabel1->ConstructFromResourceL( reader ); - CleanupStack::PopAndDestroy(); // reader internal state - } - iEd_url = new ( ELeave ) CEikEdwin; - iEd_url->SetContainerWindowL( *this ); - { - TResourceReader reader; - iEikonEnv->CreateResourceReaderLC( reader, R_SYMBIAN_UA_GUI_CONTAINER_ED_URL ); - iEd_url->ConstructFromResourceL( reader ); - CleanupStack::PopAndDestroy(); // reader internal state - } - { - HBufC* text = StringLoader::LoadLC( R_SYMBIAN_UA_GUI_CONTAINER_ED_URL_2 ); - iEd_url->SetTextL( text ); - CleanupStack::PopAndDestroy( text ); - } - iEd_info = new ( ELeave ) CEikEdwin; - iEd_info->SetContainerWindowL( *this ); - { - TResourceReader reader; - iEikonEnv->CreateResourceReaderLC( reader, R_SYMBIAN_UA_GUI_CONTAINER_ED_INFO ); - iEd_info->ConstructFromResourceL( reader ); - CleanupStack::PopAndDestroy(); // reader internal state - } - { - HBufC* text = StringLoader::LoadLC( R_SYMBIAN_UA_GUI_CONTAINER_ED_INFO_2 ); - iEd_info->SetTextL( text ); - CleanupStack::PopAndDestroy( text ); - } - - iEd_url->SetFocus( ETrue ); - iFocusControl = iEd_url; - - } -// ]]] end generated function - -/** - * Handle global resource changes, such as scalable UI or skin events (override) - */ -void CSymbian_ua_guiContainer::HandleResourceChange( TInt aType ) - { - CCoeControl::HandleResourceChange( aType ); - SetRect( iAvkonViewAppUi->View( TUid::Uid( ESymbian_ua_guiContainerViewId ) )->ClientRect() ); - // [[[ begin generated region: do not modify [Generated Contents] - // ]]] end generated region [Generated Contents] - - } - -/** - * Draw container contents. - */ -void CSymbian_ua_guiContainer::Draw( const TRect& aRect ) const - { - // [[[ begin generated region: do not modify [Generated Contents] - CWindowGc& gc = SystemGc(); - gc.Clear( aRect ); - - // ]]] end generated region [Generated Contents] - - } - diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiContainerView.cpp b/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiContainerView.cpp deleted file mode 100644 index 661c210eac8ada40713cc3b7bbe0defd198b57e5..0000000000000000000000000000000000000000 --- a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiContainerView.cpp +++ /dev/null @@ -1,478 +0,0 @@ -/* -======================================================================== - Name : symbian_ua_guiContainerView.cpp - Author : nanang - Copyright : (c) 2008-2009 Teluu Inc. - Description : -======================================================================== -*/ -// [[[ begin generated region: do not modify [Generated System Includes] -#include <aknviewappui.h> -#include <eikmenub.h> -#include <avkon.hrh> -#include <barsread.h> -#include <stringloader.h> -#include <eiklabel.h> -#include <eikenv.h> -#include <gdi.h> -#include <eikedwin.h> -#include <akncontext.h> -#include <akntitle.h> -#include <eikbtgpc.h> -#include <aknnotewrappers.h> -#include <aknquerydialog.h> -#include <symbian_ua_gui.rsg> -// ]]] end generated region [Generated System Includes] - -// [[[ begin generated region: do not modify [Generated User Includes] -#include "symbian_ua_gui.hrh" -#include "symbian_ua_guiContainerView.h" -#include "symbian_ua_guiContainer.hrh" -#include "symbian_ua_guiSettingItemList.hrh" -#include "symbian_ua_guiContainer.h" -// ]]] end generated region [Generated User Includes] - -#include <utf.h> -#include "symbian_ua.h" - -// [[[ begin generated region: do not modify [Generated Constants] -// ]]] end generated region [Generated Constants] - -Csymbian_ua_guiContainerView *myinstance = NULL; -_LIT(KStCall, "Call"); -_LIT(KStHangUp, "Hang Up"); - -void on_info(const wchar_t* buf) -{ - TPtrC aBuf((const TUint16*)buf); - - if (myinstance) - myinstance->PutMessage(aBuf); -} - -void on_incoming_call(const wchar_t* caller_disp, const wchar_t* caller_uri) -{ - TBuf<512> buf; - TPtrC aDisp((const TUint16*)caller_disp); - TPtrC aUri((const TUint16*)caller_uri); - _LIT(KFormat, "Incoming call from %S, accept?"); - - buf.Format(KFormat, &aDisp); - if (Csymbian_ua_guiContainerView::RunQry_accept_callL(&buf) == EAknSoftkeyYes) - { - CEikButtonGroupContainer* cba = CEikButtonGroupContainer::Current(); - if (cba != NULL) { - TRAPD(result, cba->SetCommandL(ESymbian_ua_guiContainerViewControlPaneRightId, KStHangUp)); - cba->DrawDeferred(); - } - symbian_ua_answercall(); - } else { - symbian_ua_endcall(); - } -} - -void on_call_end(const wchar_t* reason) -{ - TPtrC aReason((const TUint16*)reason); - - CEikButtonGroupContainer* cba = CEikButtonGroupContainer::Current(); - if (cba != NULL) { - TRAPD(result, cba->SetCommandL(ESymbian_ua_guiContainerViewControlPaneRightId, KStCall)); - cba->DrawDeferred(); - } - - Csymbian_ua_guiContainerView::RunNote_infoL(&aReason); -} - -void on_reg_state(bool success) -{ - if (success) - Csymbian_ua_guiContainerView::RunNote_infoL(); - else - Csymbian_ua_guiContainerView::RunNote_warningL(); -} - -void on_unreg_state(bool success) -{ - TPtrC st_success(_L("Unregistration Success!")); - TPtrC st_failed(_L("Unregistration Failed!")); - - if (success) - Csymbian_ua_guiContainerView::RunNote_infoL(&st_success); - else - Csymbian_ua_guiContainerView::RunNote_warningL(&st_failed); -} - -void Csymbian_ua_guiContainerView::PutMessage(const TDesC &msg) - { - if (!iSymbian_ua_guiContainer) - return; - - CEikEdwin *obj_info = (CEikEdwin*) iSymbian_ua_guiContainer->ComponentControl(iSymbian_ua_guiContainer->EEd_info); - - obj_info->SetTextL(&msg); - obj_info->DrawDeferred(); - } - -/** - * First phase of Symbian two-phase construction. Should not contain any - * code that could leave. - */ -Csymbian_ua_guiContainerView::Csymbian_ua_guiContainerView() - { - // [[[ begin generated region: do not modify [Generated Contents] - iSymbian_ua_guiContainer = NULL; - // ]]] end generated region [Generated Contents] - - } -/** - * The view's destructor removes the container from the control - * stack and destroys it. - */ -Csymbian_ua_guiContainerView::~Csymbian_ua_guiContainerView() - { - // [[[ begin generated region: do not modify [Generated Contents] - delete iSymbian_ua_guiContainer; - iSymbian_ua_guiContainer = NULL; - // ]]] end generated region [Generated Contents] - - symbian_ua_set_info_callback(NULL); - myinstance = NULL; - } - -/** - * Symbian two-phase constructor. - * This creates an instance then calls the second-phase constructor - * without leaving the instance on the cleanup stack. - * @return new instance of Csymbian_ua_guiContainerView - */ -Csymbian_ua_guiContainerView* Csymbian_ua_guiContainerView::NewL() - { - Csymbian_ua_guiContainerView* self = Csymbian_ua_guiContainerView::NewLC(); - CleanupStack::Pop( self ); - return self; - } - -/** - * Symbian two-phase constructor. - * This creates an instance, pushes it on the cleanup stack, - * then calls the second-phase constructor. - * @return new instance of Csymbian_ua_guiContainerView - */ -Csymbian_ua_guiContainerView* Csymbian_ua_guiContainerView::NewLC() - { - Csymbian_ua_guiContainerView* self = new ( ELeave ) Csymbian_ua_guiContainerView(); - CleanupStack::PushL( self ); - self->ConstructL(); - return self; - } - - -/** - * Second-phase constructor for view. - * Initialize contents from resource. - */ -void Csymbian_ua_guiContainerView::ConstructL() - { - // [[[ begin generated region: do not modify [Generated Code] - BaseConstructL( R_SYMBIAN_UA_GUI_CONTAINER_SYMBIAN_UA_GUI_CONTAINER_VIEW ); - // ]]] end generated region [Generated Code] - - // add your own initialization code here - symbian_ua_info_cb_t cb; - Mem::FillZ(&cb, sizeof(cb)); - - cb.on_info = &on_info; - cb.on_incoming_call = &on_incoming_call; - cb.on_reg_state = &on_reg_state; - cb.on_unreg_state = &on_unreg_state; - cb.on_call_end = &on_call_end; - - symbian_ua_set_info_callback(&cb); - myinstance = this; - } - -/** - * @return The UID for this view - */ -TUid Csymbian_ua_guiContainerView::Id() const - { - return TUid::Uid( ESymbian_ua_guiContainerViewId ); - } - -/** - * Handle a command for this view (override) - * @param aCommand command id to be handled - */ -void Csymbian_ua_guiContainerView::HandleCommandL( TInt aCommand ) - { - // [[[ begin generated region: do not modify [Generated Code] - TBool commandHandled = EFalse; - switch ( aCommand ) - { // code to dispatch to the AknView's menu and CBA commands is generated here - - case ESymbian_ua_guiContainerViewControlPaneRightId: - commandHandled = CallSoftKeyPressedL( aCommand ); - break; - case ESymbian_ua_guiContainerViewSettingMenuItemCommand: - commandHandled = HandleSettingMenuItemSelectedL( aCommand ); - break; - default: - break; - } - - - if ( !commandHandled ) - { - - if ( aCommand == ESymbian_ua_guiContainerViewControlPaneRightId ) - { - AppUi()->HandleCommandL( EEikCmdExit ); - } - - } - // ]]] end generated region [Generated Code] - - } - -/** - * Handles user actions during activation of the view, - * such as initializing the content. - */ -void Csymbian_ua_guiContainerView::DoActivateL( - const TVwsViewId& /*aPrevViewId*/, - TUid /*aCustomMessageId*/, - const TDesC8& /*aCustomMessage*/ ) - { - // [[[ begin generated region: do not modify [Generated Contents] - SetupStatusPaneL(); - - CEikButtonGroupContainer* cba = AppUi()->Cba(); - if ( cba != NULL ) - { - cba->MakeVisible( EFalse ); - } - - if ( iSymbian_ua_guiContainer == NULL ) - { - iSymbian_ua_guiContainer = CSymbian_ua_guiContainer::NewL( ClientRect(), NULL, this ); - iSymbian_ua_guiContainer->SetMopParent( this ); - AppUi()->AddToStackL( *this, iSymbian_ua_guiContainer ); - } - // ]]] end generated region [Generated Contents] - - cba = CEikButtonGroupContainer::Current(); - if (cba != NULL) { - if (symbian_ua_anycall()) - cba->SetCommandL(ESymbian_ua_guiContainerViewControlPaneRightId, KStHangUp); - else - cba->SetCommandL(ESymbian_ua_guiContainerViewControlPaneRightId, KStCall); - } - - } - -/** - */ -void Csymbian_ua_guiContainerView::DoDeactivate() - { - // [[[ begin generated region: do not modify [Generated Contents] - CleanupStatusPane(); - - CEikButtonGroupContainer* cba = AppUi()->Cba(); - if ( cba != NULL ) - { - cba->MakeVisible( ETrue ); - cba->DrawDeferred(); - } - - if ( iSymbian_ua_guiContainer != NULL ) - { - AppUi()->RemoveFromViewStack( *this, iSymbian_ua_guiContainer ); - delete iSymbian_ua_guiContainer; - iSymbian_ua_guiContainer = NULL; - } - // ]]] end generated region [Generated Contents] - - } - -// [[[ begin generated function: do not modify -void Csymbian_ua_guiContainerView::SetupStatusPaneL() - { - // reset the context pane - TUid contextPaneUid = TUid::Uid( EEikStatusPaneUidContext ); - CEikStatusPaneBase::TPaneCapabilities subPaneContext = - StatusPane()->PaneCapabilities( contextPaneUid ); - if ( subPaneContext.IsPresent() && subPaneContext.IsAppOwned() ) - { - CAknContextPane* context = static_cast< CAknContextPane* > ( - StatusPane()->ControlL( contextPaneUid ) ); - context->SetPictureToDefaultL(); - } - - // setup the title pane - TUid titlePaneUid = TUid::Uid( EEikStatusPaneUidTitle ); - CEikStatusPaneBase::TPaneCapabilities subPaneTitle = - StatusPane()->PaneCapabilities( titlePaneUid ); - if ( subPaneTitle.IsPresent() && subPaneTitle.IsAppOwned() ) - { - CAknTitlePane* title = static_cast< CAknTitlePane* >( - StatusPane()->ControlL( titlePaneUid ) ); - TResourceReader reader; - iEikonEnv->CreateResourceReaderLC( reader, R_SYMBIAN_UA_GUI_CONTAINER_TITLE_RESOURCE ); - title->SetFromResourceL( reader ); - CleanupStack::PopAndDestroy(); // reader internal state - } - - } -// ]]] end generated function - -// [[[ begin generated function: do not modify -void Csymbian_ua_guiContainerView::CleanupStatusPane() - { - } -// ]]] end generated function - -/** - * Handle status pane size change for this view (override) - */ -void Csymbian_ua_guiContainerView::HandleStatusPaneSizeChange() - { - CAknView::HandleStatusPaneSizeChange(); - - // this may fail, but we're not able to propagate exceptions here - TInt result; - TRAP( result, SetupStatusPaneL() ); - } - -/** - * Handle the rightSoftKeyPressed event. - * @return ETrue if the command was handled, EFalse if not - */ -TBool Csymbian_ua_guiContainerView::CallSoftKeyPressedL( TInt aCommand ) - { - CEikEdwin *obj_url = (CEikEdwin*) iSymbian_ua_guiContainer->ComponentControl(iSymbian_ua_guiContainer->EEd_url); - CEikButtonGroupContainer* cba = CEikButtonGroupContainer::Current(); - - if (symbian_ua_anycall()) { - symbian_ua_endcall(); - return ETrue; - } - - PutMessage(_L("Making call...")); - if ( cba != NULL ) { - cba->SetCommandL(aCommand, KStHangUp); - cba->DrawDeferred(); - } - - - TUint8 url[256]; - TPtr8 aUrl(url, 256); - - HBufC *buf = obj_url->GetTextInHBufL(); - CnvUtfConverter::ConvertFromUnicodeToUtf8(aUrl, *buf); - delete buf; - - if (symbian_ua_makecall((char *)aUrl.PtrZ()) != 0) { - PutMessage(_L("Making call failed!")); - if ( cba != NULL ) { - cba->SetCommandL(aCommand, KStCall); - cba->DrawDeferred(); - } - } - - return ETrue; - } - -/** - * Handle the selected event. - * @param aCommand the command id invoked - * @return ETrue if the command was handled, EFalse if not - */ -TBool Csymbian_ua_guiContainerView::HandleSettingMenuItemSelectedL( TInt aCommand ) - { - AppUi()->ActivateLocalViewL(TUid::Uid(ESymbian_ua_guiSettingItemListViewId)); - return ETrue; - } - -// [[[ begin generated function: do not modify -/** - * Show the popup note for note_error - * @param aOverrideText optional override text - */ -void Csymbian_ua_guiContainerView::RunNote_errorL( const TDesC* aOverrideText ) - { - CAknErrorNote* note = new ( ELeave ) CAknErrorNote(); - if ( aOverrideText == NULL ) - { - HBufC* noteText = StringLoader::LoadLC( R_SYMBIAN_UA_GUI_CONTAINER_NOTE_ERROR ); - note->ExecuteLD( *noteText ); - CleanupStack::PopAndDestroy( noteText ); - } - else - { - note->ExecuteLD( *aOverrideText ); - } - } -// ]]] end generated function - -// [[[ begin generated function: do not modify -/** - * Show the popup note for note_info - * @param aOverrideText optional override text - */ -void Csymbian_ua_guiContainerView::RunNote_infoL( const TDesC* aOverrideText ) - { - CAknInformationNote* note = new ( ELeave ) CAknInformationNote(); - if ( aOverrideText == NULL ) - { - HBufC* noteText = StringLoader::LoadLC( R_SYMBIAN_UA_GUI_CONTAINER_NOTE_INFO ); - note->ExecuteLD( *noteText ); - CleanupStack::PopAndDestroy( noteText ); - } - else - { - note->ExecuteLD( *aOverrideText ); - } - } -// ]]] end generated function - -// [[[ begin generated function: do not modify -/** - * Show the popup note for note_warning - * @param aOverrideText optional override text - */ -void Csymbian_ua_guiContainerView::RunNote_warningL( const TDesC* aOverrideText ) - { - CAknWarningNote* note = new ( ELeave ) CAknWarningNote(); - if ( aOverrideText == NULL ) - { - HBufC* noteText = StringLoader::LoadLC( R_SYMBIAN_UA_GUI_CONTAINER_NOTE_WARNING ); - note->ExecuteLD( *noteText ); - CleanupStack::PopAndDestroy( noteText ); - } - else - { - note->ExecuteLD( *aOverrideText ); - } - } -// ]]] end generated function - -// [[[ begin generated function: do not modify -/** - * Show the popup dialog for qry_accept_call - * @param aOverrideText optional override text - * @return EAknSoftkeyYes (left soft key id) or 0 - */ -TInt Csymbian_ua_guiContainerView::RunQry_accept_callL( const TDesC* aOverrideText ) - { - - CAknQueryDialog* queryDialog = CAknQueryDialog::NewL(); - - if ( aOverrideText != NULL ) - { - queryDialog->SetPromptL( *aOverrideText ); - } - return queryDialog->ExecuteLD( R_SYMBIAN_UA_GUI_CONTAINER_QRY_ACCEPT_CALL ); - } -// ]]] end generated function - diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiSettingItemList.cpp b/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiSettingItemList.cpp deleted file mode 100644 index 27f3d6e5ce3c2793c376ae827d531342cea8e787..0000000000000000000000000000000000000000 --- a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiSettingItemList.cpp +++ /dev/null @@ -1,423 +0,0 @@ -/* -======================================================================== - Name : symbian_ua_guiSettingItemList.cpp - Author : nanang - Copyright : (c) 2008-2009 Teluu Inc. - Description : -======================================================================== -*/ - -// [[[ begin generated region: do not modify [Generated System Includes] -#include <avkon.hrh> -#include <avkon.rsg> -#include <eikmenup.h> -#include <aknappui.h> -#include <eikcmobs.h> -#include <barsread.h> -#include <stringloader.h> -#include <gdi.h> -#include <eikedwin.h> -#include <eikenv.h> -#include <eikseced.h> -#include <aknpopupfieldtext.h> -#include <eikappui.h> -#include <aknviewappui.h> -#include <akntextsettingpage.h> -#include <symbian_ua_gui.rsg> -// ]]] end generated region [Generated System Includes] - -// [[[ begin generated region: do not modify [Generated User Includes] -#include "symbian_ua_guiSettingItemList.h" -#include "Symbian_ua_guiSettingItemListSettings.h" -#include "symbian_ua_guiSettingItemList.hrh" -#include "symbian_ua_gui.hrh" -#include "symbian_ua_guiSettingItemListView.h" -// ]]] end generated region [Generated User Includes] - - -#include <s32stor.h> -#include <s32file.h> - - -// [[[ begin generated region: do not modify [Generated Constants] -// ]]] end generated region [Generated Constants] - - -_LIT(KtxDicFileName ,"settings.ini" ); - -const TInt KRegistrar = 2; -const TInt KUsername = 3; -const TInt KPassword = 4; -const TInt KStunServer = 5; -const TInt KSrtp = 6; -const TInt KIce = 7; - -/** - * Construct the CSymbian_ua_guiSettingItemList instance - * @param aCommandObserver command observer - */ -CSymbian_ua_guiSettingItemList::CSymbian_ua_guiSettingItemList( - TSymbian_ua_guiSettingItemListSettings& aSettings, - MEikCommandObserver* aCommandObserver ) - : iSettings( aSettings ), iCommandObserver( aCommandObserver ) - { - // [[[ begin generated region: do not modify [Generated Contents] - // ]]] end generated region [Generated Contents] - - } -/** - * Destroy any instance variables - */ -CSymbian_ua_guiSettingItemList::~CSymbian_ua_guiSettingItemList() - { - // [[[ begin generated region: do not modify [Generated Contents] - // ]]] end generated region [Generated Contents] - - } - -/** - * Handle system notification that the container's size has changed. - */ -void CSymbian_ua_guiSettingItemList::SizeChanged() - { - if ( ListBox() ) - { - ListBox()->SetRect( Rect() ); - } - } - -/** - * Create one setting item at a time, identified by id. - * CAknSettingItemList calls this method and takes ownership - * of the returned value. The CAknSettingItem object owns - * a reference to the underlying data, which EditItemL() uses - * to edit and store the value. - */ -CAknSettingItem* CSymbian_ua_guiSettingItemList::CreateSettingItemL( TInt aId ) - { - switch ( aId ) - { - // [[[ begin generated region: do not modify [Initializers] - case ESymbian_ua_guiSettingItemListViewEd_registrar: - { - CAknTextSettingItem* item = new ( ELeave ) - CAknTextSettingItem( - aId, - iSettings.Ed_registrar() ); - item->SetSettingPageFlags(CAknTextSettingPage::EZeroLengthAllowed); - return item; - } - case ESymbian_ua_guiSettingItemListViewEd_user: - { - CAknTextSettingItem* item = new ( ELeave ) - CAknTextSettingItem( - aId, - iSettings.Ed_user() ); - item->SetSettingPageFlags(CAknTextSettingPage::EZeroLengthAllowed); - return item; - } - case ESymbian_ua_guiSettingItemListViewEd_password: - { - CAknPasswordSettingItem* item = new ( ELeave ) - CAknPasswordSettingItem( - aId, - CAknPasswordSettingItem::EAlpha, - iSettings.Ed_password() ); - item->SetSettingPageFlags(CAknTextSettingPage::EZeroLengthAllowed); - return item; - } - case ESymbian_ua_guiSettingItemListViewB_srtp: - { - CAknBinaryPopupSettingItem* item = new ( ELeave ) - CAknBinaryPopupSettingItem( - aId, - iSettings.B_srtp() ); - item->SetHidden( ETrue ); - return item; - } - case ESymbian_ua_guiSettingItemListViewB_ice: - { - CAknBinaryPopupSettingItem* item = new ( ELeave ) - CAknBinaryPopupSettingItem( - aId, - iSettings.B_ice() ); - item->SetHidden( ETrue ); - return item; - } - case ESymbian_ua_guiSettingItemListViewEd_stun_server: - { - CAknTextSettingItem* item = new ( ELeave ) - CAknTextSettingItem( - aId, - iSettings.Ed_stun_server() ); - item->SetHidden( ETrue ); - return item; - } - // ]]] end generated region [Initializers] - - } - - return NULL; - } - -/** - * Edit the setting item identified by the given id and store - * the changes into the store. - * @param aIndex the index of the setting item in SettingItemArray() - * @param aCalledFromMenu true: a menu item invoked editing, thus - * always show the edit page and interactively edit the item; - * false: change the item in place if possible, else show the edit page - */ -void CSymbian_ua_guiSettingItemList::EditItemL ( TInt aIndex, TBool aCalledFromMenu ) - { - CAknSettingItem* item = ( *SettingItemArray() )[aIndex]; - switch ( item->Identifier() ) - { - // [[[ begin generated region: do not modify [Editing Started Invoker] - // ]]] end generated region [Editing Started Invoker] - - } - - CAknSettingItemList::EditItemL( aIndex, aCalledFromMenu ); - - TBool storeValue = ETrue; - switch ( item->Identifier() ) - { - // [[[ begin generated region: do not modify [Editing Stopped Invoker] - // ]]] end generated region [Editing Stopped Invoker] - - } - - if ( storeValue ) - { - item->StoreL(); - SaveSettingValuesL(); - } - } -/** - * Handle the "Change" option on the Options menu. This is an - * alternative to the Selection key that forces the settings page - * to come up rather than changing the value in place (if possible). - */ -void CSymbian_ua_guiSettingItemList::ChangeSelectedItemL() - { - if ( ListBox()->CurrentItemIndex() >= 0 ) - { - EditItemL( ListBox()->CurrentItemIndex(), ETrue ); - } - } - -/** - * Load the initial contents of the setting items. By default, - * the setting items are populated with the default values from - * the design. You can override those values here. - * <p> - * Note: this call alone does not update the UI. - * LoadSettingsL() must be called afterwards. - */ -void CSymbian_ua_guiSettingItemList::LoadSettingValuesL() - { - // load values into iSettings - - TFileName path; - TFileName pathWithoutDrive; - CEikonEnv::Static()->FsSession().PrivatePath( pathWithoutDrive ); - - // Extract drive letter into appDrive: -#ifdef __WINS__ - path.Copy( _L("c:") ); -#else - RProcess process; - path.Copy( process.FileName().Left(2) ); -#endif - - path.Append( pathWithoutDrive ); - path.Append( KtxDicFileName ); - - TFindFile AufFolder(CCoeEnv::Static()->FsSession()); - if(KErrNone == AufFolder.FindByDir(path, KNullDesC)) - { - CDictionaryFileStore* MyDStore = CDictionaryFileStore::OpenLC(CCoeEnv::Static()->FsSession(),AufFolder.File(), TUid::Uid(1)); - TUid FileUid; - - FileUid.iUid = KRegistrar; - if(MyDStore->IsPresentL(FileUid)) - { - RDictionaryReadStream in; - in.OpenLC(*MyDStore,FileUid); - in >> iSettings.Ed_registrar(); - CleanupStack::PopAndDestroy(1);// in - } - - FileUid.iUid = KUsername; - if(MyDStore->IsPresentL(FileUid)) - { - RDictionaryReadStream in; - in.OpenLC(*MyDStore,FileUid); - in >> iSettings.Ed_user(); - CleanupStack::PopAndDestroy(1);// in - } - - FileUid.iUid = KPassword; - if(MyDStore->IsPresentL(FileUid)) - { - RDictionaryReadStream in; - in.OpenLC(*MyDStore,FileUid); - in >> iSettings.Ed_password(); - CleanupStack::PopAndDestroy(1);// in - } - - FileUid.iUid = KStunServer; - if(MyDStore->IsPresentL(FileUid)) - { - RDictionaryReadStream in; - in.OpenLC(*MyDStore,FileUid); - in >> iSettings.Ed_stun_server(); - CleanupStack::PopAndDestroy(1);// in - } - - FileUid.iUid = KSrtp; - if(MyDStore->IsPresentL(FileUid)) - { - RDictionaryReadStream in; - in.OpenLC(*MyDStore,FileUid); - iSettings.SetB_srtp((TBool)in.ReadInt32L()); - CleanupStack::PopAndDestroy(1);// in - } - - FileUid.iUid = KIce; - if(MyDStore->IsPresentL(FileUid)) - { - RDictionaryReadStream in; - in.OpenLC(*MyDStore,FileUid); - iSettings.SetB_ice((TBool)in.ReadInt32L()); - CleanupStack::PopAndDestroy(1);// in - } - - CleanupStack::PopAndDestroy(1);// Store - } - - } - -/** - * Save the contents of the setting items. Note, this is called - * whenever an item is changed and stored to the model, so it - * may be called multiple times or not at all. - */ -void CSymbian_ua_guiSettingItemList::SaveSettingValuesL() - { - // store values from iSettings - - TFileName path; - TFileName pathWithoutDrive; - CEikonEnv::Static()->FsSession().PrivatePath( pathWithoutDrive ); - - // Extract drive letter into appDrive: -#ifdef __WINS__ - path.Copy( _L("c:") ); -#else - RProcess process; - path.Copy( process.FileName().Left(2) ); - - if(path.Compare(_L("c")) || path.Compare(_L("C"))) - CEikonEnv::Static()->FsSession().CreatePrivatePath(EDriveC); - else if(path.Compare(_L("e")) || path.Compare(_L("E"))) - CEikonEnv::Static()->FsSession().CreatePrivatePath(EDriveE); -#endif - - path.Append( pathWithoutDrive ); - path.Append( KtxDicFileName ); - - TFindFile AufFolder(CCoeEnv::Static()->FsSession()); - if(KErrNone == AufFolder.FindByDir(path, KNullDesC)) - { - User::LeaveIfError(CCoeEnv::Static()->FsSession().Delete(AufFolder.File())); - } - - CDictionaryFileStore* MyDStore = CDictionaryFileStore::OpenLC(CCoeEnv::Static()->FsSession(),path, TUid::Uid(1)); - - TUid FileUid = {0x0}; - - FileUid.iUid = KRegistrar; - RDictionaryWriteStream out1; - out1.AssignLC(*MyDStore,FileUid); - out1 << iSettings.Ed_registrar(); - out1.CommitL(); - CleanupStack::PopAndDestroy(1);// out2 - - FileUid.iUid = KUsername; - RDictionaryWriteStream out2; - out2.AssignLC(*MyDStore,FileUid); - out2 << iSettings.Ed_user(); - out2.CommitL(); - CleanupStack::PopAndDestroy(1);// out2 - - FileUid.iUid = KPassword; - RDictionaryWriteStream out3; - out3.AssignLC(*MyDStore,FileUid); - out3 << iSettings.Ed_password(); - out3.CommitL(); - CleanupStack::PopAndDestroy(1);// out2 - - FileUid.iUid = KStunServer; - RDictionaryWriteStream out4; - out4.AssignLC(*MyDStore,FileUid); - out4 << iSettings.Ed_stun_server(); - out4.CommitL(); - CleanupStack::PopAndDestroy(1);// out2 - - FileUid.iUid = KSrtp; - RDictionaryWriteStream out5; - out5.AssignLC(*MyDStore,FileUid); - out5.WriteInt32L(iSettings.B_srtp()); - out5.CommitL(); - CleanupStack::PopAndDestroy(1);// out1 - - FileUid.iUid = KIce; - RDictionaryWriteStream out6; - out6.AssignLC(*MyDStore,FileUid); - out6.WriteInt32L(iSettings.B_ice()); - out6.CommitL(); - CleanupStack::PopAndDestroy(1);// out1 - - MyDStore->CommitL(); - CleanupStack::PopAndDestroy(1);// Store - - } - - -/** - * Handle global resource changes, such as scalable UI or skin events (override) - */ -void CSymbian_ua_guiSettingItemList::HandleResourceChange( TInt aType ) - { - CAknSettingItemList::HandleResourceChange( aType ); - SetRect( iAvkonViewAppUi->View( TUid::Uid( ESymbian_ua_guiSettingItemListViewId ) )->ClientRect() ); - // [[[ begin generated region: do not modify [Generated Contents] - // ]]] end generated region [Generated Contents] - - } - -/** - * Handle key event (override) - * @param aKeyEvent key event - * @param aType event code - * @return EKeyWasConsumed if the event was handled, else EKeyWasNotConsumed - */ -TKeyResponse CSymbian_ua_guiSettingItemList::OfferKeyEventL( - const TKeyEvent& aKeyEvent, - TEventCode aType ) - { - // [[[ begin generated region: do not modify [Generated Contents] - // ]]] end generated region [Generated Contents] - - if ( aKeyEvent.iCode == EKeyLeftArrow - || aKeyEvent.iCode == EKeyRightArrow ) - { - // allow the tab control to get the arrow keys - return EKeyWasNotConsumed; - } - - return CAknSettingItemList::OfferKeyEventL( aKeyEvent, aType ); - } - diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiSettingItemListView.cpp b/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiSettingItemListView.cpp deleted file mode 100644 index 243ff994c57092b657a7f86bcee643b8393be22e..0000000000000000000000000000000000000000 --- a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiSettingItemListView.cpp +++ /dev/null @@ -1,285 +0,0 @@ -/* -======================================================================== - Name : symbian_ua_guiSettingItemListView.cpp - Author : nanang - Copyright : (c) 2008-2009 Teluu Inc. - Description : -======================================================================== -*/ -// [[[ begin generated region: do not modify [Generated System Includes] -#include <aknviewappui.h> -#include <eikmenub.h> -#include <avkon.hrh> -#include <akncontext.h> -#include <akntitle.h> -#include <stringloader.h> -#include <barsread.h> -#include <eikbtgpc.h> -#include <symbian_ua_gui.rsg> -// ]]] end generated region [Generated System Includes] - -// [[[ begin generated region: do not modify [Generated User Includes] -#include "symbian_ua_gui.hrh" -#include "symbian_ua_guiSettingItemListView.h" -#include "symbian_ua_guiContainer.hrh" -#include "symbian_ua_guiSettingItemList.hrh" -#include "symbian_ua_guiSettingItemList.h" -// ]]] end generated region [Generated User Includes] - -#include "symbian_ua.h" - -// [[[ begin generated region: do not modify [Generated Constants] -// ]]] end generated region [Generated Constants] - -/** - * First phase of Symbian two-phase construction. Should not contain any - * code that could leave. - */ -Csymbian_ua_guiSettingItemListView::Csymbian_ua_guiSettingItemListView() - { - // [[[ begin generated region: do not modify [Generated Contents] - // ]]] end generated region [Generated Contents] - - } -/** - * The view's destructor removes the container from the control - * stack and destroys it. - */ -Csymbian_ua_guiSettingItemListView::~Csymbian_ua_guiSettingItemListView() - { - // [[[ begin generated region: do not modify [Generated Contents] - // ]]] end generated region [Generated Contents] - - } - -/** - * Symbian two-phase constructor. - * This creates an instance then calls the second-phase constructor - * without leaving the instance on the cleanup stack. - * @return new instance of Csymbian_ua_guiSettingItemListView - */ -Csymbian_ua_guiSettingItemListView* Csymbian_ua_guiSettingItemListView::NewL() - { - Csymbian_ua_guiSettingItemListView* self = Csymbian_ua_guiSettingItemListView::NewLC(); - CleanupStack::Pop( self ); - return self; - } - -/** - * Symbian two-phase constructor. - * This creates an instance, pushes it on the cleanup stack, - * then calls the second-phase constructor. - * @return new instance of Csymbian_ua_guiSettingItemListView - */ -Csymbian_ua_guiSettingItemListView* Csymbian_ua_guiSettingItemListView::NewLC() - { - Csymbian_ua_guiSettingItemListView* self = new ( ELeave ) Csymbian_ua_guiSettingItemListView(); - CleanupStack::PushL( self ); - self->ConstructL(); - return self; - } - - -/** - * Second-phase constructor for view. - * Initialize contents from resource. - */ -void Csymbian_ua_guiSettingItemListView::ConstructL() - { - // [[[ begin generated region: do not modify [Generated Code] - BaseConstructL( R_SYMBIAN_UA_GUI_SETTING_ITEM_LIST_SYMBIAN_UA_GUI_SETTING_ITEM_LIST_VIEW ); - // ]]] end generated region [Generated Code] - - // add your own initialization code here - } - -/** - * @return The UID for this view - */ -TUid Csymbian_ua_guiSettingItemListView::Id() const - { - return TUid::Uid( ESymbian_ua_guiSettingItemListViewId ); - } - -/** - * Handle a command for this view (override) - * @param aCommand command id to be handled - */ -void Csymbian_ua_guiSettingItemListView::HandleCommandL( TInt aCommand ) - { - // [[[ begin generated region: do not modify [Generated Code] - TBool commandHandled = EFalse; - switch ( aCommand ) - { // code to dispatch to the AknView's menu and CBA commands is generated here - - case EAknSoftkeySave: - commandHandled = HandleControlPaneRightSoftKeyPressedL( aCommand ); - break; - case ESymbian_ua_guiSettingItemListViewMenuItem1Command: - commandHandled = HandleChangeSelectedSettingItemL( aCommand ); - break; - default: - break; - } - - - if ( !commandHandled ) - { - - } - // ]]] end generated region [Generated Code] - - } - -/** - * Handles user actions during activation of the view, - * such as initializing the content. - */ -void Csymbian_ua_guiSettingItemListView::DoActivateL( - const TVwsViewId& /*aPrevViewId*/, - TUid /*aCustomMessageId*/, - const TDesC8& /*aCustomMessage*/ ) - { - // [[[ begin generated region: do not modify [Generated Contents] - SetupStatusPaneL(); - - CEikButtonGroupContainer* cba = AppUi()->Cba(); - if ( cba != NULL ) - { - cba->MakeVisible( EFalse ); - } - - if ( iSymbian_ua_guiSettingItemList == NULL ) - { - iSettings = TSymbian_ua_guiSettingItemListSettings::NewL(); - iSymbian_ua_guiSettingItemList = new ( ELeave ) CSymbian_ua_guiSettingItemList( *iSettings, this ); - iSymbian_ua_guiSettingItemList->SetMopParent( this ); - iSymbian_ua_guiSettingItemList->ConstructFromResourceL( R_SYMBIAN_UA_GUI_SETTING_ITEM_LIST_SYMBIAN_UA_GUI_SETTING_ITEM_LIST ); - iSymbian_ua_guiSettingItemList->ActivateL(); - iSymbian_ua_guiSettingItemList->LoadSettingValuesL(); - iSymbian_ua_guiSettingItemList->LoadSettingsL(); - AppUi()->AddToStackL( *this, iSymbian_ua_guiSettingItemList ); - } - // ]]] end generated region [Generated Contents] - - } - -/** - */ -void Csymbian_ua_guiSettingItemListView::DoDeactivate() - { - // [[[ begin generated region: do not modify [Generated Contents] - CleanupStatusPane(); - - CEikButtonGroupContainer* cba = AppUi()->Cba(); - if ( cba != NULL ) - { - cba->MakeVisible( ETrue ); - cba->DrawDeferred(); - } - - if ( iSymbian_ua_guiSettingItemList != NULL ) - { - AppUi()->RemoveFromStack( iSymbian_ua_guiSettingItemList ); - delete iSymbian_ua_guiSettingItemList; - iSymbian_ua_guiSettingItemList = NULL; - delete iSettings; - iSettings = NULL; - } - // ]]] end generated region [Generated Contents] - - } - -// [[[ begin generated function: do not modify -void Csymbian_ua_guiSettingItemListView::SetupStatusPaneL() - { - // reset the context pane - TUid contextPaneUid = TUid::Uid( EEikStatusPaneUidContext ); - CEikStatusPaneBase::TPaneCapabilities subPaneContext = - StatusPane()->PaneCapabilities( contextPaneUid ); - if ( subPaneContext.IsPresent() && subPaneContext.IsAppOwned() ) - { - CAknContextPane* context = static_cast< CAknContextPane* > ( - StatusPane()->ControlL( contextPaneUid ) ); - context->SetPictureToDefaultL(); - } - - // setup the title pane - TUid titlePaneUid = TUid::Uid( EEikStatusPaneUidTitle ); - CEikStatusPaneBase::TPaneCapabilities subPaneTitle = - StatusPane()->PaneCapabilities( titlePaneUid ); - if ( subPaneTitle.IsPresent() && subPaneTitle.IsAppOwned() ) - { - CAknTitlePane* title = static_cast< CAknTitlePane* >( - StatusPane()->ControlL( titlePaneUid ) ); - TResourceReader reader; - iEikonEnv->CreateResourceReaderLC( reader, R_SYMBIAN_UA_GUI_SETTING_ITEM_LIST_TITLE_RESOURCE ); - title->SetFromResourceL( reader ); - CleanupStack::PopAndDestroy(); // reader internal state - } - - } -// ]]] end generated function - -// [[[ begin generated function: do not modify -void Csymbian_ua_guiSettingItemListView::CleanupStatusPane() - { - } -// ]]] end generated function - -/** - * Handle status pane size change for this view (override) - */ -void Csymbian_ua_guiSettingItemListView::HandleStatusPaneSizeChange() - { - CAknView::HandleStatusPaneSizeChange(); - - // this may fail, but we're not able to propagate exceptions here - TInt result; - TRAP( result, SetupStatusPaneL() ); - } - -/** - * Handle the selected event. - * @param aCommand the command id invoked - * @return ETrue if the command was handled, EFalse if not - */ -TBool Csymbian_ua_guiSettingItemListView::HandleChangeSelectedSettingItemL( TInt aCommand ) - { - iSymbian_ua_guiSettingItemList->ChangeSelectedItemL(); - return ETrue; - } - -/** - * Handle the rightSoftKeyPressed event. - * @return ETrue if the command was handled, EFalse if not - */ -TBool Csymbian_ua_guiSettingItemListView::HandleControlPaneRightSoftKeyPressedL( TInt aCommand ) - { - TUint8 domain[256] = {0}; - TPtr8 cDomain(domain, sizeof(domain)); - TUint8 user[64] = {0}; - TPtr8 cUser(user, sizeof(user)); - TUint8 pass[64] = {0}; - TPtr8 cPass(pass, sizeof(pass)); - - cDomain.Copy(iSettings->Ed_registrar()); - cUser.Copy(iSettings->Ed_user()); - cPass.Copy(iSettings->Ed_password()); - symbian_ua_set_account((char*)domain, (char*)user, (char*)pass, false, false); - - AppUi()->ActivateLocalViewL(TUid::Uid(ESymbian_ua_guiContainerViewId)); - return ETrue; - } - -/** - * Handle the selected event. - * @param aCommand the command id invoked - * @return ETrue if the command was handled, EFalse if not - */ -TBool Csymbian_ua_guiSettingItemListView::HandleCancelMenuItemSelectedL( TInt aCommand ) - { - AppUi()->ActivateLocalViewL(TUid::Uid(ESymbian_ua_guiContainerViewId)); - return ETrue; - } - diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symsndtest/app_main.cpp b/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symsndtest/app_main.cpp deleted file mode 100644 index 22b74bb757749db853ae51fe69a07ecff2bea270..0000000000000000000000000000000000000000 --- a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symsndtest/app_main.cpp +++ /dev/null @@ -1,373 +0,0 @@ -/* $Id: app_main.cpp 2394 2008-12-23 17:27:53Z bennylp $ */ -/* - * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) - * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> - * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#include <pjmedia/delaybuf.h> -#include <pjmedia/sound.h> -#include <pj/errno.h> -#include <pj/os.h> -#include <pj/log.h> -#include <pj/string.h> -#include <pj/unicode.h> -#include <e32cons.h> - -#define THIS_FILE "app_main.cpp" -#define CLOCK_RATE 8000 -#define CHANNEL_COUNT 1 -#define PTIME 20 -#define SAMPLES_PER_FRAME (CLOCK_RATE*PTIME/1000) -#define BITS_PER_SAMPLE 16 - -extern CConsoleBase* console; - -static pj_caching_pool cp; -static pjmedia_snd_stream *strm; -static unsigned rec_cnt, play_cnt; -static pj_time_val t_start; - -pj_pool_t *pool; -pjmedia_delay_buf *delaybuf; - -/* Logging callback */ -static void log_writer(int level, const char *buf, unsigned len) -{ - static wchar_t buf16[PJ_LOG_MAX_SIZE]; - - PJ_UNUSED_ARG(level); - - pj_ansi_to_unicode(buf, len, buf16, PJ_ARRAY_SIZE(buf16)); - - TPtrC16 aBuf((const TUint16*)buf16, (TInt)len); - console->Write(aBuf); -} - -/* perror util */ -static void app_perror(const char *title, pj_status_t status) -{ - char errmsg[PJ_ERR_MSG_SIZE]; - pj_strerror(status, errmsg, sizeof(errmsg)); - PJ_LOG(1,(THIS_FILE, "Error: %s: %s", title, errmsg)); -} - -/* Application init */ -static pj_status_t app_init() -{ - unsigned i, count; - pj_status_t status; - - /* Redirect log */ - pj_log_set_log_func((void (*)(int,const char*,int)) &log_writer); - pj_log_set_decor(PJ_LOG_HAS_NEWLINE); - pj_log_set_level(3); - - /* Init pjlib */ - status = pj_init(); - if (status != PJ_SUCCESS) { - app_perror("pj_init()", status); - return status; - } - - pj_caching_pool_init(&cp, NULL, 0); - - /* Init sound subsystem */ - status = pjmedia_snd_init(&cp.factory); - if (status != PJ_SUCCESS) { - app_perror("pjmedia_snd_init()", status); - pj_caching_pool_destroy(&cp); - pj_shutdown(); - return status; - } - - count = pjmedia_snd_get_dev_count(); - PJ_LOG(3,(THIS_FILE, "Device count: %d", count)); - for (i=0; i<count; ++i) { - const pjmedia_snd_dev_info *info; - - info = pjmedia_snd_get_dev_info(i); - PJ_LOG(3, (THIS_FILE, "%d: %s %d/%d %dHz", - i, info->name, info->input_count, info->output_count, - info->default_samples_per_sec)); - } - - /* Create pool */ - pool = pj_pool_create(&cp.factory, THIS_FILE, 512, 512, NULL); - if (pool == NULL) { - app_perror("pj_pool_create()", status); - pj_caching_pool_destroy(&cp); - pj_shutdown(); - return status; - } - - /* Init delay buffer */ - status = pjmedia_delay_buf_create(pool, THIS_FILE, CLOCK_RATE, - SAMPLES_PER_FRAME, CHANNEL_COUNT, - 0, 0, &delaybuf); - if (status != PJ_SUCCESS) { - app_perror("pjmedia_delay_buf_create()", status); - //pj_caching_pool_destroy(&cp); - //pj_shutdown(); - //return status; - } - - return PJ_SUCCESS; -} - - -/* Sound capture callback */ -static pj_status_t rec_cb(void *user_data, - pj_uint32_t timestamp, - void *input, - unsigned size) -{ - PJ_UNUSED_ARG(user_data); - PJ_UNUSED_ARG(timestamp); - PJ_UNUSED_ARG(size); - - pjmedia_delay_buf_put(delaybuf, (pj_int16_t*)input); - - if (size != SAMPLES_PER_FRAME*2) { - PJ_LOG(3, (THIS_FILE, "Size captured = %u", - size)); - } - - ++rec_cnt; - return PJ_SUCCESS; -} - -/* Play cb */ -static pj_status_t play_cb(void *user_data, - pj_uint32_t timestamp, - void *output, - unsigned size) -{ - PJ_UNUSED_ARG(user_data); - PJ_UNUSED_ARG(timestamp); - PJ_UNUSED_ARG(size); - - pjmedia_delay_buf_get(delaybuf, (pj_int16_t*)output); - - ++play_cnt; - return PJ_SUCCESS; -} - -/* Start sound */ -static pj_status_t snd_start(unsigned flag) -{ - pj_status_t status; - - if (strm != NULL) { - app_perror("snd already open", PJ_EINVALIDOP); - return PJ_EINVALIDOP; - } - - if (flag==PJMEDIA_DIR_CAPTURE_PLAYBACK) - status = pjmedia_snd_open(-1, -1, CLOCK_RATE, CHANNEL_COUNT, - SAMPLES_PER_FRAME, BITS_PER_SAMPLE, - &rec_cb, &play_cb, NULL, &strm); - else if (flag==PJMEDIA_DIR_CAPTURE) - status = pjmedia_snd_open_rec(-1, CLOCK_RATE, CHANNEL_COUNT, - SAMPLES_PER_FRAME, BITS_PER_SAMPLE, - &rec_cb, NULL, &strm); - else - status = pjmedia_snd_open_player(-1, CLOCK_RATE, CHANNEL_COUNT, - SAMPLES_PER_FRAME, BITS_PER_SAMPLE, - &play_cb, NULL, &strm); - - if (status != PJ_SUCCESS) { - app_perror("snd open", status); - return status; - } - - rec_cnt = play_cnt = 0; - pj_gettimeofday(&t_start); - - pjmedia_delay_buf_reset(delaybuf); - - status = pjmedia_snd_stream_start(strm); - if (status != PJ_SUCCESS) { - app_perror("snd start", status); - pjmedia_snd_stream_close(strm); - strm = NULL; - return status; - } - - return PJ_SUCCESS; -} - -/* Stop sound */ -static pj_status_t snd_stop() -{ - pj_time_val now; - pj_status_t status; - - if (strm == NULL) { - app_perror("snd not open", PJ_EINVALIDOP); - return PJ_EINVALIDOP; - } - - status = pjmedia_snd_stream_close(strm); - strm = NULL; - - pj_gettimeofday(&now); - PJ_TIME_VAL_SUB(now, t_start); - - PJ_LOG(3,(THIS_FILE, "Duration: %d.%03d", now.sec, now.msec)); - PJ_LOG(3,(THIS_FILE, "Captured: %d", rec_cnt)); - PJ_LOG(3,(THIS_FILE, "Played: %d", play_cnt)); - - return status; -} - -/* Shutdown application */ -static void app_fini() -{ - if (strm) - snd_stop(); - - pjmedia_snd_deinit(); - pjmedia_delay_buf_destroy(delaybuf); - pj_pool_release(pool); - pj_caching_pool_destroy(&cp); - pj_shutdown(); -} - - -//////////////////////////////////////////////////////////////////////////// -/* - * The interractive console UI - */ -#include <e32base.h> - -class ConsoleUI : public CActive -{ -public: - ConsoleUI(CActiveSchedulerWait *asw, CConsoleBase *con); - - // Run console UI - void Run(); - - // Stop - void Stop(); - -protected: - // Cancel asynchronous read. - void DoCancel(); - - // Implementation: called when read has completed. - void RunL(); - -private: - CActiveSchedulerWait *asw_; - CConsoleBase *con_; -}; - - -ConsoleUI::ConsoleUI(CActiveSchedulerWait *asw, CConsoleBase *con) -: CActive(EPriorityHigh), asw_(asw), con_(con) -{ - CActiveScheduler::Add(this); -} - -// Run console UI -void ConsoleUI::Run() -{ - con_->Read(iStatus); - SetActive(); -} - -// Stop console UI -void ConsoleUI::Stop() -{ - DoCancel(); -} - -// Cancel asynchronous read. -void ConsoleUI::DoCancel() -{ - con_->ReadCancel(); -} - -static void PrintMenu() -{ - PJ_LOG(3, (THIS_FILE, "\n\n" - "Menu:\n" - " a Start bidir sound\n" - " t Start recorder\n" - " p Start player\n" - " d Stop & close sound\n" - " w Quit\n")); -} - -// Implementation: called when read has completed. -void ConsoleUI::RunL() -{ - TKeyCode kc = con_->KeyCode(); - pj_bool_t reschedule = PJ_TRUE; - - switch (kc) { - case 'w': - asw_->AsyncStop(); - reschedule = PJ_FALSE; - break; - case 'a': - snd_start(PJMEDIA_DIR_CAPTURE_PLAYBACK); - break; - case 't': - snd_start(PJMEDIA_DIR_CAPTURE); - break; - case 'p': - snd_start(PJMEDIA_DIR_PLAYBACK); - break; - case 'd': - snd_stop(); - break; - default: - PJ_LOG(3,(THIS_FILE, "Keycode '%c' (%d) is pressed", - kc, kc)); - break; - } - - PrintMenu(); - - if (reschedule) - Run(); -} - - -//////////////////////////////////////////////////////////////////////////// -int app_main() -{ - if (app_init() != PJ_SUCCESS) - return -1; - - // Run the UI - CActiveSchedulerWait *asw = new CActiveSchedulerWait; - ConsoleUI *con = new ConsoleUI(asw, console); - - con->Run(); - - PrintMenu(); - asw->Start(); - - delete con; - delete asw; - - app_fini(); - return 0; -} - diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/tools/cmp_wav.exe b/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/tools/cmp_wav.exe deleted file mode 100644 index 6220771b2824920d1f5f1a6a85be31a44d975a8b..0000000000000000000000000000000000000000 Binary files a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/tools/cmp_wav.exe and /dev/null differ diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/wavs/input.11.wav b/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/wavs/input.11.wav deleted file mode 100644 index 712aea72b6e2b2acb9f755f594f2d8f7ff733a69..0000000000000000000000000000000000000000 Binary files a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/wavs/input.11.wav and /dev/null differ diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/wavs/input.16.wav b/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/wavs/input.16.wav deleted file mode 100644 index da25cfcd85ea465b2e52f7ef8f2a7baa445a89c8..0000000000000000000000000000000000000000 Binary files a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/wavs/input.16.wav and /dev/null differ diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/wavs/input.2.16.wav b/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/wavs/input.2.16.wav deleted file mode 100644 index a885fe98ef3e44a3b0e13511c4eb514795fea0cb..0000000000000000000000000000000000000000 Binary files a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/wavs/input.2.16.wav and /dev/null differ diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/wavs/input.2.8.wav b/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/wavs/input.2.8.wav deleted file mode 100644 index 95b2310d7d5ca75a0fe1fcb5911793c8d9233d96..0000000000000000000000000000000000000000 Binary files a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/wavs/input.2.8.wav and /dev/null differ diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/wavs/input.22.wav b/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/wavs/input.22.wav deleted file mode 100644 index bc309dd88e0147bea54618825d8acd41fd5f5142..0000000000000000000000000000000000000000 Binary files a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/wavs/input.22.wav and /dev/null differ diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/wavs/input.32.wav b/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/wavs/input.32.wav deleted file mode 100644 index 4fc356ad074d85b566144abd08fd04489380e083..0000000000000000000000000000000000000000 Binary files a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/wavs/input.32.wav and /dev/null differ diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/wavs/input.44.wav b/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/wavs/input.44.wav deleted file mode 100644 index 6262d9145ad2e984c2311c8c8d11a9f71be52daf..0000000000000000000000000000000000000000 Binary files a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/wavs/input.44.wav and /dev/null differ diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/wavs/input.48.wav b/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/wavs/input.48.wav deleted file mode 100644 index 5f32bb326768d9ef15ca0e78e8b8ae94cdce5516..0000000000000000000000000000000000000000 Binary files a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/wavs/input.48.wav and /dev/null differ diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/wavs/input.8.wav b/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/wavs/input.8.wav deleted file mode 100644 index 4fa44d46e284e11c95ec37d6ad29dd07e87e9f74..0000000000000000000000000000000000000000 Binary files a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/wavs/input.8.wav and /dev/null differ diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/build/milenage/Makefile b/sflphone-common/libs/pjproject-1.0.1/third_party/build/milenage/Makefile deleted file mode 100644 index 094ddeaa7e42e8763816d5e3ae84f8fa21c18cef..0000000000000000000000000000000000000000 --- a/sflphone-common/libs/pjproject-1.0.1/third_party/build/milenage/Makefile +++ /dev/null @@ -1,58 +0,0 @@ -include ../../../build.mak -include ../../../build/common.mak - -export LIBDIR := ../../lib - -RULES_MAK := $(PJDIR)/build/rules.mak - -export MILENAGE_LIB := ../../lib/libmilenage-$(TARGET_NAME)$(LIBEXT) - -############################################################################### -# Gather all flags. -# -export _CFLAGS := $(CC_CFLAGS) $(OS_CFLAGS) $(HOST_CFLAGS) $(M_CFLAGS) \ - $(CFLAGS) $(CC_INC). $(CC_INC)../../milenage/include \ - $(CC_INC)../../../pjlib/include -export _CXXFLAGS:= $(_CFLAGS) $(CC_CXXFLAGS) $(OS_CXXFLAGS) $(M_CXXFLAGS) \ - $(HOST_CXXFLAGS) $(CXXFLAGS) -export _LDFLAGS := $(CC_LDFLAGS) $(OS_LDFLAGS) $(M_LDFLAGS) $(HOST_LDFLAGS) \ - $(LDFLAGS) - -export MILENAGE_SRCDIR = ../../milenage -export MILENAGE_OBJS = milenage.o rijndael.o -export MILENAGE_CFLAGS = $(_CFLAGS) - - -export CC_OUT CC AR RANLIB HOST_MV HOST_RM HOST_RMDIR HOST_MKDIR OBJEXT LD LDOUT -############################################################################### -# Main entry -# -# $(TARGET) is defined in os-$(OS_NAME).mak file in current directory. -# -TARGETS := libmilenage - -all: $(TARGETS) - -doc: - cd .. && doxygen docs/doxygen.cfg - -dep: depend -distclean: realclean - -.PHONY: dep depend libmilenage clean realclean distclean - -libmilenage: - $(MAKE) -f $(RULES_MAK) APP=MILENAGE app=libmilenage $(MILENAGE_LIB) - -clean print_lib: - $(MAKE) -f $(RULES_MAK) APP=MILENAGE app=libmilenage $@ - -realclean: - $(subst @@,$(subst /,$(HOST_PSEP),.ilbc-$(TARGET_NAME).depend),$(HOST_RMR)) - - $(MAKE) -f $(RULES_MAK) APP=MILENAGE app=libmilenage $@ - -depend: - $(MAKE) -f $(RULES_MAK) APP=MILENAGE app=libmilenage $@ - - diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/build/milenage/libmilenage.dsp b/sflphone-common/libs/pjproject-1.0.1/third_party/build/milenage/libmilenage.dsp deleted file mode 100644 index cf89612e9c3f6c83c0a7c3f0ebfe95d35de406c2..0000000000000000000000000000000000000000 --- a/sflphone-common/libs/pjproject-1.0.1/third_party/build/milenage/libmilenage.dsp +++ /dev/null @@ -1,110 +0,0 @@ -# Microsoft Developer Studio Project File - Name="libmilenage" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Static Library" 0x0104 - -CFG=libmilenage - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "libmilenage.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "libmilenage.mak" CFG="libmilenage - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "libmilenage - Win32 Release" (based on "Win32 (x86) Static Library") -!MESSAGE "libmilenage - Win32 Debug" (based on "Win32 (x86) Static Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "libmilenage - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "../../lib" -# PROP BASE Intermediate_Dir "output/libmilenage-i386-win32-vc6-release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "../../lib" -# PROP Intermediate_Dir "output/libmilenage-i386-win32-vc6-release" -# PROP Target_Dir "" -F90=df.exe -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "../../../pjlib/include" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /out:"../../lib/libmilenage-i386-win32-vc6-release.lib" - -!ELSEIF "$(CFG)" == "libmilenage - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "output/libmilenage-i386-win32-vc6-debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "../../lib" -# PROP Intermediate_Dir "output/libmilenage-i386-win32-vc6-debug" -# PROP Target_Dir "" -F90=df.exe -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c -# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "../../../pjlib/include" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /out:"../../lib/libmilenage-i386-win32-vc6-debug.lib" - -!ENDIF - -# Begin Target - -# Name "libmilenage - Win32 Release" -# Name "libmilenage - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=..\..\milenage\milenage.c -# End Source File -# Begin Source File - -SOURCE=..\..\milenage\rijndael.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=..\..\milenage\milenage.h -# End Source File -# Begin Source File - -SOURCE=..\..\milenage\rijndael.h -# End Source File -# End Group -# End Target -# End Project diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/build/milenage/libmilenage.vcp b/sflphone-common/libs/pjproject-1.0.1/third_party/build/milenage/libmilenage.vcp deleted file mode 100644 index 34f4d037397414d746c23ed2f9497ae1dd608e1c..0000000000000000000000000000000000000000 --- a/sflphone-common/libs/pjproject-1.0.1/third_party/build/milenage/libmilenage.vcp +++ /dev/null @@ -1,1562 +0,0 @@ -# Microsoft eMbedded Visual Tools Project File - Name="libmilenage" - Package Owner=<4> -# Microsoft eMbedded Visual Tools Generated Build File, Format Version 6.02 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (WCE x86) Static Library" 0x8304 -# TARGTYPE "Win32 (WCE MIPS16) Static Library" 0x8904 -# TARGTYPE "Win32 (WCE SH4) Static Library" 0x8604 -# TARGTYPE "Win32 (WCE MIPSII) Static Library" 0xa104 -# TARGTYPE "Win32 (WCE MIPSIV_FP) Static Library" 0x9204 -# TARGTYPE "Win32 (WCE SH3) Static Library" 0x8104 -# TARGTYPE "Win32 (WCE ARMV4) Static Library" 0xa304 -# TARGTYPE "Win32 (WCE ARMV4I) Static Library" 0xa504 -# TARGTYPE "Win32 (WCE emulator) Static Library" 0xa604 -# TARGTYPE "Win32 (WCE MIPSII_FP) Static Library" 0xa204 -# TARGTYPE "Win32 (WCE ARMV4T) Static Library" 0xa404 -# TARGTYPE "Win32 (WCE MIPSIV) Static Library" 0x9604 - -CFG=libmilenage - Win32 (WCE MIPSII_FP) Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "libmilenage.vcn". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "libmilenage.vcn" CFG="libmilenage - Win32 (WCE MIPSII_FP) Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "libmilenage - Win32 (WCE MIPSII_FP) Release" (based on "Win32 (WCE MIPSII_FP) Static Library") -!MESSAGE "libmilenage - Win32 (WCE MIPSII_FP) Debug" (based on "Win32 (WCE MIPSII_FP) Static Library") -!MESSAGE "libmilenage - Win32 (WCE MIPSII) Release" (based on "Win32 (WCE MIPSII) Static Library") -!MESSAGE "libmilenage - Win32 (WCE MIPSII) Debug" (based on "Win32 (WCE MIPSII) Static Library") -!MESSAGE "libmilenage - Win32 (WCE SH4) Release" (based on "Win32 (WCE SH4) Static Library") -!MESSAGE "libmilenage - Win32 (WCE SH4) Debug" (based on "Win32 (WCE SH4) Static Library") -!MESSAGE "libmilenage - Win32 (WCE SH3) Release" (based on "Win32 (WCE SH3) Static Library") -!MESSAGE "libmilenage - Win32 (WCE SH3) Debug" (based on "Win32 (WCE SH3) Static Library") -!MESSAGE "libmilenage - Win32 (WCE MIPSIV) Release" (based on "Win32 (WCE MIPSIV) Static Library") -!MESSAGE "libmilenage - Win32 (WCE MIPSIV) Debug" (based on "Win32 (WCE MIPSIV) Static Library") -!MESSAGE "libmilenage - Win32 (WCE emulator) Release" (based on "Win32 (WCE emulator) Static Library") -!MESSAGE "libmilenage - Win32 (WCE emulator) Debug" (based on "Win32 (WCE emulator) Static Library") -!MESSAGE "libmilenage - Win32 (WCE ARMV4I) Release" (based on "Win32 (WCE ARMV4I) Static Library") -!MESSAGE "libmilenage - Win32 (WCE ARMV4I) Debug" (based on "Win32 (WCE ARMV4I) Static Library") -!MESSAGE "libmilenage - Win32 (WCE MIPSIV_FP) Release" (based on "Win32 (WCE MIPSIV_FP) Static Library") -!MESSAGE "libmilenage - Win32 (WCE MIPSIV_FP) Debug" (based on "Win32 (WCE MIPSIV_FP) Static Library") -!MESSAGE "libmilenage - Win32 (WCE ARMV4) Release" (based on "Win32 (WCE ARMV4) Static Library") -!MESSAGE "libmilenage - Win32 (WCE ARMV4) Debug" (based on "Win32 (WCE ARMV4) Static Library") -!MESSAGE "libmilenage - Win32 (WCE MIPS16) Release" (based on "Win32 (WCE MIPS16) Static Library") -!MESSAGE "libmilenage - Win32 (WCE MIPS16) Debug" (based on "Win32 (WCE MIPS16) Static Library") -!MESSAGE "libmilenage - Win32 (WCE ARMV4T) Release" (based on "Win32 (WCE ARMV4T) Static Library") -!MESSAGE "libmilenage - Win32 (WCE ARMV4T) Debug" (based on "Win32 (WCE ARMV4T) Static Library") -!MESSAGE "libmilenage - Win32 (WCE x86) Release" (based on "Win32 (WCE x86) Static Library") -!MESSAGE "libmilenage - Win32 (WCE x86) Debug" (based on "Win32 (WCE x86) Static Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -# PROP ATL_Project 2 - -!IF "$(CFG)" == "libmilenage - Win32 (WCE MIPSII_FP) Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "output\MIPSII_FPRel" -# PROP BASE Intermediate_Dir "output\MIPSII_FPRel" -# PROP BASE CPU_ID "{D8AC856C-B213-4895-9E83-9EC51A55201E}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "output\" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "output\MIPSII_FPRel" -# PROP Intermediate_Dir "output\MIPSII_FPRel" -# PROP CPU_ID "{D8AC856C-B213-4895-9E83-9EC51A55201E}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "output\" -CPP=clmips.exe -# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D "R4000" /D "MIPSII" /D "MIPSII_FP" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /D "_LIB" /YX /QMmips2 /QMFPE- /O2 /M$(CECrtMT) /c -# ADD CPP /nologo /W3 /I "../../../pjlib/include" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D "R4000" /D "MIPSII" /D "MIPSII_FP" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /D "_LIB" /YX /QMmips2 /QMFPE- /O2 /M$(CECrtMT) /c -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE MIPSII_FP) Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "output\MIPSII_FPDbg" -# PROP BASE Intermediate_Dir "output\MIPSII_FPDbg" -# PROP BASE CPU_ID "{D8AC856C-B213-4895-9E83-9EC51A55201E}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "output\" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "output\MIPSII_FPDbg" -# PROP Intermediate_Dir "output\MIPSII_FPDbg" -# PROP CPU_ID "{D8AC856C-B213-4895-9E83-9EC51A55201E}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "output\" -CPP=clmips.exe -# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D "R4000" /D "MIPSII" /D "MIPSII_FP" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_LIB" /YX /QMmips2 /QMFPE- /M$(CECrtMTDebug) /c -# ADD CPP /nologo /W3 /Zi /Od /I "../../../pjlib/include" /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D "R4000" /D "MIPSII" /D "MIPSII_FP" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_LIB" /YX /QMmips2 /QMFPE- /M$(CECrtMTDebug) /c -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE MIPSII) Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "output\MIPSIIRel" -# PROP BASE Intermediate_Dir "output\MIPSIIRel" -# PROP BASE CPU_ID "{689DDC64-9D9D-11D5-96F8-00207802C01C}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "output\" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "output\MIPSIIRel" -# PROP Intermediate_Dir "output\MIPSIIRel" -# PROP CPU_ID "{689DDC64-9D9D-11D5-96F8-00207802C01C}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "output\" -CPP=clmips.exe -# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D "R4000" /D "MIPSII" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /D "_LIB" /YX /QMmips2 /QMFPE /O2 /M$(CECrtMT) /c -# ADD CPP /nologo /W3 /I "../../../pjlib/include" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D "R4000" /D "MIPSII" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /D "_LIB" /YX /QMmips2 /QMFPE /O2 /M$(CECrtMT) /c -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE MIPSII) Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "output\MIPSIIDbg" -# PROP BASE Intermediate_Dir "output\MIPSIIDbg" -# PROP BASE CPU_ID "{689DDC64-9D9D-11D5-96F8-00207802C01C}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "output\" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "output\MIPSIIDbg" -# PROP Intermediate_Dir "output\MIPSIIDbg" -# PROP CPU_ID "{689DDC64-9D9D-11D5-96F8-00207802C01C}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "output\" -CPP=clmips.exe -# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D "R4000" /D "MIPSII" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_LIB" /YX /QMmips2 /QMFPE /M$(CECrtMTDebug) /c -# ADD CPP /nologo /W3 /Zi /Od /I "../../../pjlib/include" /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D "R4000" /D "MIPSII" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_LIB" /YX /QMmips2 /QMFPE /M$(CECrtMTDebug) /c -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE SH4) Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "output\SH4Rel" -# PROP BASE Intermediate_Dir "output\SH4Rel" -# PROP BASE CPU_ID "{D6519021-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "output\" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "output\SH4Rel" -# PROP Intermediate_Dir "output\SH4Rel" -# PROP CPU_ID "{D6519021-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "output\" -CPP=shcl.exe -# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "SHx" /D "SH4" /D "_SH4_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /D "_LIB" /YX /Qsh4 /O2 /M$(CECrtMT) /c -# ADD CPP /nologo /W3 /I "../../../pjlib/include" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "SHx" /D "SH4" /D "_SH4_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /D "_LIB" /YX /Qsh4 /O2 /M$(CECrtMT) /c -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE SH4) Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "output\SH4Dbg" -# PROP BASE Intermediate_Dir "output\SH4Dbg" -# PROP BASE CPU_ID "{D6519021-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "output\" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "output\SH4Dbg" -# PROP Intermediate_Dir "output\SH4Dbg" -# PROP CPU_ID "{D6519021-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "output\" -CPP=shcl.exe -# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "SHx" /D "SH4" /D "_SH4_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_LIB" /YX /Qsh4 /M$(CECrtMTDebug) /c -# ADD CPP /nologo /W3 /Zi /Od /I "../../../pjlib/include" /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "SHx" /D "SH4" /D "_SH4_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_LIB" /YX /Qsh4 /M$(CECrtMTDebug) /c -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE SH3) Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "output\SH3Rel" -# PROP BASE Intermediate_Dir "output\SH3Rel" -# PROP BASE CPU_ID "{D6519020-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "output\" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "output\SH3Rel" -# PROP Intermediate_Dir "output\SH3Rel" -# PROP CPU_ID "{D6519020-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "output\" -CPP=shcl.exe -# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "SHx" /D "SH3" /D "_SH3_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /D "_LIB" /YX /O2 /M$(CECrtMT) /c -# ADD CPP /nologo /W3 /I "../../../pjlib/include" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "SHx" /D "SH3" /D "_SH3_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /D "_LIB" /YX /O2 /M$(CECrtMT) /c -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE SH3) Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "output\SH3Dbg" -# PROP BASE Intermediate_Dir "output\SH3Dbg" -# PROP BASE CPU_ID "{D6519020-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "output\" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "output\SH3Dbg" -# PROP Intermediate_Dir "output\SH3Dbg" -# PROP CPU_ID "{D6519020-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "output\" -CPP=shcl.exe -# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "SHx" /D "SH3" /D "_SH3_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_LIB" /YX /M$(CECrtMTDebug) /c -# ADD CPP /nologo /W3 /Zi /Od /I "../../../pjlib/include" /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "SHx" /D "SH3" /D "_SH3_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_LIB" /YX /M$(CECrtMTDebug) /c -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE MIPSIV) Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "output\MIPSIVRel" -# PROP BASE Intermediate_Dir "output\MIPSIVRel" -# PROP BASE CPU_ID "{0B2FE524-26C5-4194-8CEF-B1582DEB5A98}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "output\" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "output\MIPSIVRel" -# PROP Intermediate_Dir "output\MIPSIVRel" -# PROP CPU_ID "{0B2FE524-26C5-4194-8CEF-B1582DEB5A98}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "output\" -CPP=clmips.exe -# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D "_MIPS64" /D "R4000" /D "MIPSIV" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /D "_LIB" /YX /QMmips4 /QMn32 /QMFPE /O2 /M$(CECrtMT) /c -# ADD CPP /nologo /W3 /I "../../../pjlib/include" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D "_MIPS64" /D "R4000" /D "MIPSIV" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /D "_LIB" /YX /QMmips4 /QMn32 /QMFPE /O2 /M$(CECrtMT) /c -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE MIPSIV) Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "output\MIPSIVDbg" -# PROP BASE Intermediate_Dir "output\MIPSIVDbg" -# PROP BASE CPU_ID "{0B2FE524-26C5-4194-8CEF-B1582DEB5A98}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "output\" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "output\MIPSIVDbg" -# PROP Intermediate_Dir "output\MIPSIVDbg" -# PROP CPU_ID "{0B2FE524-26C5-4194-8CEF-B1582DEB5A98}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "output\" -CPP=clmips.exe -# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D "_MIPS64" /D "R4000" /D "MIPSIV" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_LIB" /YX /QMmips4 /QMn32 /QMFPE /M$(CECrtMTDebug) /c -# ADD CPP /nologo /W3 /Zi /Od /I "../../../pjlib/include" /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D "_MIPS64" /D "R4000" /D "MIPSIV" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_LIB" /YX /QMmips4 /QMn32 /QMFPE /M$(CECrtMTDebug) /c -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE emulator) Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "output\emulatorRel" -# PROP BASE Intermediate_Dir "output\emulatorRel" -# PROP BASE CPU_ID "{32E52003-403E-442D-BE48-DE10F8C6131D}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "output\" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "output\emulatorRel" -# PROP Intermediate_Dir "output\emulatorRel" -# PROP CPU_ID "{32E52003-403E-442D-BE48-DE10F8C6131D}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "output\" -CPP=cl.exe -# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "_i386_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "NDEBUG" /D "_LIB" /YX /Gs8192 /GF /O2 /c -# ADD CPP /nologo /W3 /I "../../../pjlib/include" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "_i386_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "NDEBUG" /D "_LIB" /YX /Gs8192 /GF /O2 /c -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE emulator) Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "output\emulatorDbg" -# PROP BASE Intermediate_Dir "output\emulatorDbg" -# PROP BASE CPU_ID "{32E52003-403E-442D-BE48-DE10F8C6131D}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "output\" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "output\emulatorDbg" -# PROP Intermediate_Dir "output\emulatorDbg" -# PROP CPU_ID "{32E52003-403E-442D-BE48-DE10F8C6131D}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "output\" -CPP=cl.exe -# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "_i386_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "_LIB" /YX /Gs8192 /GF /c -# ADD CPP /nologo /W3 /Zi /Od /I "../../../pjlib/include" /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "_i386_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "_LIB" /YX /Gs8192 /GF /c -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE ARMV4I) Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "output\ARMV4IRel" -# PROP BASE Intermediate_Dir "output\ARMV4IRel" -# PROP BASE CPU_ID "{DC70F430-E78B-494F-A9D5-62ADC56443B8}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "output\" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "output\ARMV4IRel" -# PROP Intermediate_Dir "output\ARMV4IRel" -# PROP CPU_ID "{DC70F430-E78B-494F-A9D5-62ADC56443B8}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "output\" -CPP=clarm.exe -# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "ARM" /D "_ARM_" /D "$(CePlatform)" /D "ARMV4I" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /D "_LIB" /YX /QRarch4T /QRinterwork-return /O2 /M$(CECrtMT) /c -# ADD CPP /nologo /W3 /I "../../../pjlib/include" /D _WIN32_WCE=$(CEVersion) /D "ARM" /D "_ARM_" /D "$(CePlatform)" /D "ARMV4I" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /D "_LIB" /YX /QRarch4T /QRinterwork-return /O2 /M$(CECrtMT) /c -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE ARMV4I) Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "output\ARMV4IDbg" -# PROP BASE Intermediate_Dir "output\ARMV4IDbg" -# PROP BASE CPU_ID "{DC70F430-E78B-494F-A9D5-62ADC56443B8}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "output\" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "output\ARMV4IDbg" -# PROP Intermediate_Dir "output\ARMV4IDbg" -# PROP CPU_ID "{DC70F430-E78B-494F-A9D5-62ADC56443B8}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "output\" -CPP=clarm.exe -# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "ARM" /D "_ARM_" /D "$(CePlatform)" /D "ARMV4I" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_LIB" /YX /QRarch4T /QRinterwork-return /M$(CECrtMTDebug) /c -# ADD CPP /nologo /W3 /Zi /Od /I "../../../pjlib/include" /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "ARM" /D "_ARM_" /D "$(CePlatform)" /D "ARMV4I" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_LIB" /YX /QRarch4T /QRinterwork-return /M$(CECrtMTDebug) /c -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE MIPSIV_FP) Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "output\MIPSIV_FPRel" -# PROP BASE Intermediate_Dir "output\MIPSIV_FPRel" -# PROP BASE CPU_ID "{046A430D-7770-48AB-89B5-24C2D300B03F}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "output\" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "output\MIPSIV_FPRel" -# PROP Intermediate_Dir "output\MIPSIV_FPRel" -# PROP CPU_ID "{046A430D-7770-48AB-89B5-24C2D300B03F}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "output\" -CPP=clmips.exe -# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D "_MIPS64" /D "R4000" /D "MIPSIV" /D "MIPSIV_FP" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /D "_LIB" /YX /QMmips4 /QMn32 /QMFPE- /O2 /M$(CECrtMT) /c -# ADD CPP /nologo /W3 /I "../../../pjlib/include" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D "_MIPS64" /D "R4000" /D "MIPSIV" /D "MIPSIV_FP" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /D "_LIB" /YX /QMmips4 /QMn32 /QMFPE- /O2 /M$(CECrtMT) /c -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE MIPSIV_FP) Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "output\MIPSIV_FPDbg" -# PROP BASE Intermediate_Dir "output\MIPSIV_FPDbg" -# PROP BASE CPU_ID "{046A430D-7770-48AB-89B5-24C2D300B03F}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "output\" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "output\MIPSIV_FPDbg" -# PROP Intermediate_Dir "output\MIPSIV_FPDbg" -# PROP CPU_ID "{046A430D-7770-48AB-89B5-24C2D300B03F}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "output\" -CPP=clmips.exe -# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D "_MIPS64" /D "R4000" /D "MIPSIV" /D "MIPSIV_FP" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_LIB" /YX /QMmips4 /QMn32 /QMFPE- /M$(CECrtMTDebug) /c -# ADD CPP /nologo /W3 /Zi /Od /I "../../../pjlib/include" /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D "_MIPS64" /D "R4000" /D "MIPSIV" /D "MIPSIV_FP" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_LIB" /YX /QMmips4 /QMn32 /QMFPE- /M$(CECrtMTDebug) /c -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE ARMV4) Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "output\ARMV4Rel" -# PROP BASE Intermediate_Dir "output\ARMV4Rel" -# PROP BASE CPU_ID "{ECBEA43D-CD7B-4852-AD55-D4227B5D624B}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "output\" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "output\ARMV4Rel" -# PROP Intermediate_Dir "output\ARMV4Rel" -# PROP CPU_ID "{ECBEA43D-CD7B-4852-AD55-D4227B5D624B}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "output\" -CPP=clarm.exe -# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "NDEBUG" /D "ARM" /D "_ARM_" /D "ARMV4" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_LIB" /YX /O2 /M$(CECrtMT) /c -# ADD CPP /nologo /W3 /I "../../../pjlib/include" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "NDEBUG" /D "ARM" /D "_ARM_" /D "ARMV4" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_LIB" /YX /O2 /M$(CECrtMT) /c -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE ARMV4) Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "output\ARMV4Dbg" -# PROP BASE Intermediate_Dir "output\ARMV4Dbg" -# PROP BASE CPU_ID "{ECBEA43D-CD7B-4852-AD55-D4227B5D624B}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "output\" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "output\ARMV4Dbg" -# PROP Intermediate_Dir "output\ARMV4Dbg" -# PROP CPU_ID "{ECBEA43D-CD7B-4852-AD55-D4227B5D624B}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "output\" -CPP=clarm.exe -# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "ARM" /D "_ARM_" /D "ARMV4" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_LIB" /YX /M$(CECrtMTDebug) /c -# ADD CPP /nologo /W3 /Zi /Od /I "../../../pjlib/include" /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "ARM" /D "_ARM_" /D "ARMV4" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_LIB" /YX /M$(CECrtMTDebug) /c -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE MIPS16) Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "output\MIPS16Rel" -# PROP BASE Intermediate_Dir "output\MIPS16Rel" -# PROP BASE CPU_ID "{D6519013-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "output\" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "output\MIPS16Rel" -# PROP Intermediate_Dir "output\MIPS16Rel" -# PROP CPU_ID "{D6519013-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "output\" -CPP=clmips.exe -# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D "R4000" /D "MIPSII" /D "MIPS16" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /D "_MIPS16_" /D "MIPS16SUPPORT" /D "_LIB" /YX /QMmips16 /O2 /M$(CECrtMT) /c -# ADD CPP /nologo /W3 /I "../../../pjlib/include" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D "R4000" /D "MIPSII" /D "MIPS16" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /D "_MIPS16_" /D "MIPS16SUPPORT" /D "_LIB" /YX /QMmips16 /O2 /M$(CECrtMT) /c -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE MIPS16) Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "output\MIPS16Dbg" -# PROP BASE Intermediate_Dir "output\MIPS16Dbg" -# PROP BASE CPU_ID "{D6519013-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "output\" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "output\MIPS16Dbg" -# PROP Intermediate_Dir "output\MIPS16Dbg" -# PROP CPU_ID "{D6519013-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "output\" -CPP=clmips.exe -# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D "R4000" /D "MIPSII" /D "MIPS16" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_MIPS16_" /D "MIPS16SUPPORT" /D "_LIB" /YX /QMmips16 /M$(CECrtMTDebug) /c -# ADD CPP /nologo /W3 /Zi /Od /I "../../../pjlib/include" /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D "R4000" /D "MIPSII" /D "MIPS16" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_MIPS16_" /D "MIPS16SUPPORT" /D "_LIB" /YX /QMmips16 /M$(CECrtMTDebug) /c -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE ARMV4T) Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "output\ARMV4TRel" -# PROP BASE Intermediate_Dir "output\ARMV4TRel" -# PROP BASE CPU_ID "{F52316A9-3B7C-4FE7-A67F-68350B41240D}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "output\" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "output\ARMV4TRel" -# PROP Intermediate_Dir "output\ARMV4TRel" -# PROP CPU_ID "{F52316A9-3B7C-4FE7-A67F-68350B41240D}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "output\" -CPP=clthumb.exe -# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "ARM" /D "_ARM_" /D "$(CePlatform)" /D "THUMB" /D "_THUMB_" /D "ARMV4T" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /D "_LIB" /YX /QRarch4T /QRinterwork-return /O2 /M$(CECrtMT) /c -# ADD CPP /nologo /W3 /I "../../../pjlib/include" /D _WIN32_WCE=$(CEVersion) /D "ARM" /D "_ARM_" /D "$(CePlatform)" /D "THUMB" /D "_THUMB_" /D "ARMV4T" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /D "_LIB" /YX /QRarch4T /QRinterwork-return /O2 /M$(CECrtMT) /c -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE ARMV4T) Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "output\ARMV4TDbg" -# PROP BASE Intermediate_Dir "output\ARMV4TDbg" -# PROP BASE CPU_ID "{F52316A9-3B7C-4FE7-A67F-68350B41240D}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "output\" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "output\ARMV4TDbg" -# PROP Intermediate_Dir "output\ARMV4TDbg" -# PROP CPU_ID "{F52316A9-3B7C-4FE7-A67F-68350B41240D}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "output\" -CPP=clthumb.exe -# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "ARM" /D "_ARM_" /D "$(CePlatform)" /D "THUMB" /D "_THUMB_" /D "ARMV4T" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_LIB" /YX /QRarch4T /QRinterwork-return /M$(CECrtMTDebug) /c -# ADD CPP /nologo /W3 /Zi /Od /I "../../../pjlib/include" /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "ARM" /D "_ARM_" /D "$(CePlatform)" /D "THUMB" /D "_THUMB_" /D "ARMV4T" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_LIB" /YX /QRarch4T /QRinterwork-return /M$(CECrtMTDebug) /c -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE x86) Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "output\X86Rel" -# PROP BASE Intermediate_Dir "output\X86Rel" -# PROP BASE CPU_ID "{D6518FF3-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "output\" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "output\X86Rel" -# PROP Intermediate_Dir "output\X86Rel" -# PROP CPU_ID "{D6518FF3-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "output\" -CPP=cl.exe -# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "_i386_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "NDEBUG" /D "_LIB" /YX /Gs8192 /GF /O2 /c -# ADD CPP /nologo /W3 /I "../../../pjlib/include" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "_i386_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "NDEBUG" /D "_LIB" /YX /Gs8192 /GF /O2 /c -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE x86) Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "output\X86Dbg" -# PROP BASE Intermediate_Dir "output\X86Dbg" -# PROP BASE CPU_ID "{D6518FF3-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "output\" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "output\X86Dbg" -# PROP Intermediate_Dir "output\X86Dbg" -# PROP CPU_ID "{D6518FF3-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "output\" -CPP=cl.exe -# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "_i386_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "_LIB" /YX /Gs8192 /GF /c -# ADD CPP /nologo /W3 /Zi /Od /I "../../../pjlib/include" /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "_i386_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "_LIB" /YX /Gs8192 /GF /c -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ENDIF - -# Begin Target - -# Name "libmilenage - Win32 (WCE MIPSII_FP) Release" -# Name "libmilenage - Win32 (WCE MIPSII_FP) Debug" -# Name "libmilenage - Win32 (WCE MIPSII) Release" -# Name "libmilenage - Win32 (WCE MIPSII) Debug" -# Name "libmilenage - Win32 (WCE SH4) Release" -# Name "libmilenage - Win32 (WCE SH4) Debug" -# Name "libmilenage - Win32 (WCE SH3) Release" -# Name "libmilenage - Win32 (WCE SH3) Debug" -# Name "libmilenage - Win32 (WCE MIPSIV) Release" -# Name "libmilenage - Win32 (WCE MIPSIV) Debug" -# Name "libmilenage - Win32 (WCE emulator) Release" -# Name "libmilenage - Win32 (WCE emulator) Debug" -# Name "libmilenage - Win32 (WCE ARMV4I) Release" -# Name "libmilenage - Win32 (WCE ARMV4I) Debug" -# Name "libmilenage - Win32 (WCE MIPSIV_FP) Release" -# Name "libmilenage - Win32 (WCE MIPSIV_FP) Debug" -# Name "libmilenage - Win32 (WCE ARMV4) Release" -# Name "libmilenage - Win32 (WCE ARMV4) Debug" -# Name "libmilenage - Win32 (WCE MIPS16) Release" -# Name "libmilenage - Win32 (WCE MIPS16) Debug" -# Name "libmilenage - Win32 (WCE ARMV4T) Release" -# Name "libmilenage - Win32 (WCE ARMV4T) Debug" -# Name "libmilenage - Win32 (WCE x86) Release" -# Name "libmilenage - Win32 (WCE x86) Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=..\..\milenage\milenage.c - -!IF "$(CFG)" == "libmilenage - Win32 (WCE MIPSII_FP) Release" - -DEP_CPP_MILEN=\ - "..\..\milenage\milenage.h"\ - "..\..\milenage\rijndael.h"\ - - -!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE MIPSII_FP) Debug" - -DEP_CPP_MILEN=\ - "..\..\milenage\milenage.h"\ - "..\..\milenage\rijndael.h"\ - - -!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE MIPSII) Release" - -DEP_CPP_MILEN=\ - "..\..\milenage\milenage.h"\ - "..\..\milenage\rijndael.h"\ - - -!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE MIPSII) Debug" - -DEP_CPP_MILEN=\ - "..\..\milenage\milenage.h"\ - "..\..\milenage\rijndael.h"\ - - -!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE SH4) Release" - -DEP_CPP_MILEN=\ - "..\..\milenage\milenage.h"\ - "..\..\milenage\rijndael.h"\ - - -!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE SH4) Debug" - -DEP_CPP_MILEN=\ - "..\..\milenage\milenage.h"\ - "..\..\milenage\rijndael.h"\ - - -!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE SH3) Release" - -DEP_CPP_MILEN=\ - "..\..\milenage\milenage.h"\ - "..\..\milenage\rijndael.h"\ - - -!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE SH3) Debug" - -DEP_CPP_MILEN=\ - "..\..\milenage\milenage.h"\ - "..\..\milenage\rijndael.h"\ - - -!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE MIPSIV) Release" - -DEP_CPP_MILEN=\ - "..\..\milenage\milenage.h"\ - "..\..\milenage\rijndael.h"\ - - -!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE MIPSIV) Debug" - -DEP_CPP_MILEN=\ - "..\..\milenage\milenage.h"\ - "..\..\milenage\rijndael.h"\ - - -!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE emulator) Release" - -DEP_CPP_MILEN=\ - "..\..\milenage\milenage.h"\ - "..\..\milenage\rijndael.h"\ - - -!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE emulator) Debug" - -DEP_CPP_MILEN=\ - "..\..\milenage\milenage.h"\ - "..\..\milenage\rijndael.h"\ - - -!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE ARMV4I) Release" - -DEP_CPP_MILEN=\ - "..\..\milenage\milenage.h"\ - "..\..\milenage\rijndael.h"\ - - -!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE ARMV4I) Debug" - -DEP_CPP_MILEN=\ - "..\..\milenage\milenage.h"\ - "..\..\milenage\rijndael.h"\ - - -!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE MIPSIV_FP) Release" - -DEP_CPP_MILEN=\ - "..\..\milenage\milenage.h"\ - "..\..\milenage\rijndael.h"\ - - -!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE MIPSIV_FP) Debug" - -DEP_CPP_MILEN=\ - "..\..\milenage\milenage.h"\ - "..\..\milenage\rijndael.h"\ - - -!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE ARMV4) Release" - -DEP_CPP_MILEN=\ - "..\..\milenage\milenage.h"\ - "..\..\milenage\rijndael.h"\ - - -!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE ARMV4) Debug" - -DEP_CPP_MILEN=\ - "..\..\milenage\milenage.h"\ - "..\..\milenage\rijndael.h"\ - - -!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE MIPS16) Release" - -DEP_CPP_MILEN=\ - "..\..\milenage\milenage.h"\ - "..\..\milenage\rijndael.h"\ - - -!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE MIPS16) Debug" - -DEP_CPP_MILEN=\ - "..\..\milenage\milenage.h"\ - "..\..\milenage\rijndael.h"\ - - -!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE ARMV4T) Release" - -DEP_CPP_MILEN=\ - "..\..\milenage\milenage.h"\ - "..\..\milenage\rijndael.h"\ - - -!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE ARMV4T) Debug" - -DEP_CPP_MILEN=\ - "..\..\milenage\milenage.h"\ - "..\..\milenage\rijndael.h"\ - - -!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE x86) Release" - -DEP_CPP_MILEN=\ - "..\..\milenage\milenage.h"\ - "..\..\milenage\rijndael.h"\ - - -!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE x86) Debug" - -DEP_CPP_MILEN=\ - "..\..\milenage\milenage.h"\ - "..\..\milenage\rijndael.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\..\milenage\rijndael.c - -!IF "$(CFG)" == "libmilenage - Win32 (WCE MIPSII_FP) Release" - -DEP_CPP_RIJND=\ - "..\..\..\pjlib\include\pj\compat\cc_armcc.h"\ - "..\..\..\pjlib\include\pj\compat\cc_codew.h"\ - "..\..\..\pjlib\include\pj\compat\cc_gcc.h"\ - "..\..\..\pjlib\include\pj\compat\cc_gcce.h"\ - "..\..\..\pjlib\include\pj\compat\cc_msvc.h"\ - "..\..\..\pjlib\include\pj\compat\cc_mwcc.h"\ - "..\..\..\pjlib\include\pj\compat\m_auto.h"\ - "..\..\..\pjlib\include\pj\compat\os_auto.h"\ - "..\..\..\pjlib\include\pj\compat\os_darwinos.h"\ - "..\..\..\pjlib\include\pj\compat\os_linux.h"\ - "..\..\..\pjlib\include\pj\compat\os_linux_kernel.h"\ - "..\..\..\pjlib\include\pj\compat\os_palmos.h"\ - "..\..\..\pjlib\include\pj\compat\os_rtems.h"\ - "..\..\..\pjlib\include\pj\compat\os_sunos.h"\ - "..\..\..\pjlib\include\pj\compat\os_symbian.h"\ - "..\..\..\pjlib\include\pj\compat\os_win32.h"\ - "..\..\..\pjlib\include\pj\compat\os_win32_wince.h"\ - "..\..\..\pjlib\include\pj\compat\size_t.h"\ - "..\..\..\pjlib\include\pj\config.h"\ - "..\..\..\pjlib\include\pj\config_site.h"\ - "..\..\..\pjlib\include\pj\config_site_sample.h"\ - "..\..\..\pjlib\include\pj\types.h"\ - - -!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE MIPSII_FP) Debug" - -DEP_CPP_RIJND=\ - "..\..\..\pjlib\include\pj\compat\cc_armcc.h"\ - "..\..\..\pjlib\include\pj\compat\cc_codew.h"\ - "..\..\..\pjlib\include\pj\compat\cc_gcc.h"\ - "..\..\..\pjlib\include\pj\compat\cc_gcce.h"\ - "..\..\..\pjlib\include\pj\compat\cc_msvc.h"\ - "..\..\..\pjlib\include\pj\compat\cc_mwcc.h"\ - "..\..\..\pjlib\include\pj\compat\m_auto.h"\ - "..\..\..\pjlib\include\pj\compat\os_auto.h"\ - "..\..\..\pjlib\include\pj\compat\os_darwinos.h"\ - "..\..\..\pjlib\include\pj\compat\os_linux.h"\ - "..\..\..\pjlib\include\pj\compat\os_linux_kernel.h"\ - "..\..\..\pjlib\include\pj\compat\os_palmos.h"\ - "..\..\..\pjlib\include\pj\compat\os_rtems.h"\ - "..\..\..\pjlib\include\pj\compat\os_sunos.h"\ - "..\..\..\pjlib\include\pj\compat\os_symbian.h"\ - "..\..\..\pjlib\include\pj\compat\os_win32.h"\ - "..\..\..\pjlib\include\pj\compat\os_win32_wince.h"\ - "..\..\..\pjlib\include\pj\compat\size_t.h"\ - "..\..\..\pjlib\include\pj\config.h"\ - "..\..\..\pjlib\include\pj\config_site.h"\ - "..\..\..\pjlib\include\pj\config_site_sample.h"\ - "..\..\..\pjlib\include\pj\types.h"\ - - -!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE MIPSII) Release" - -DEP_CPP_RIJND=\ - "..\..\..\pjlib\include\pj\compat\cc_armcc.h"\ - "..\..\..\pjlib\include\pj\compat\cc_codew.h"\ - "..\..\..\pjlib\include\pj\compat\cc_gcc.h"\ - "..\..\..\pjlib\include\pj\compat\cc_gcce.h"\ - "..\..\..\pjlib\include\pj\compat\cc_msvc.h"\ - "..\..\..\pjlib\include\pj\compat\cc_mwcc.h"\ - "..\..\..\pjlib\include\pj\compat\m_auto.h"\ - "..\..\..\pjlib\include\pj\compat\os_auto.h"\ - "..\..\..\pjlib\include\pj\compat\os_darwinos.h"\ - "..\..\..\pjlib\include\pj\compat\os_linux.h"\ - "..\..\..\pjlib\include\pj\compat\os_linux_kernel.h"\ - "..\..\..\pjlib\include\pj\compat\os_palmos.h"\ - "..\..\..\pjlib\include\pj\compat\os_rtems.h"\ - "..\..\..\pjlib\include\pj\compat\os_sunos.h"\ - "..\..\..\pjlib\include\pj\compat\os_symbian.h"\ - "..\..\..\pjlib\include\pj\compat\os_win32.h"\ - "..\..\..\pjlib\include\pj\compat\os_win32_wince.h"\ - "..\..\..\pjlib\include\pj\compat\size_t.h"\ - "..\..\..\pjlib\include\pj\config.h"\ - "..\..\..\pjlib\include\pj\config_site.h"\ - "..\..\..\pjlib\include\pj\config_site_sample.h"\ - "..\..\..\pjlib\include\pj\types.h"\ - - -!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE MIPSII) Debug" - -DEP_CPP_RIJND=\ - "..\..\..\pjlib\include\pj\compat\cc_armcc.h"\ - "..\..\..\pjlib\include\pj\compat\cc_codew.h"\ - "..\..\..\pjlib\include\pj\compat\cc_gcc.h"\ - "..\..\..\pjlib\include\pj\compat\cc_gcce.h"\ - "..\..\..\pjlib\include\pj\compat\cc_msvc.h"\ - "..\..\..\pjlib\include\pj\compat\cc_mwcc.h"\ - "..\..\..\pjlib\include\pj\compat\m_auto.h"\ - "..\..\..\pjlib\include\pj\compat\os_auto.h"\ - "..\..\..\pjlib\include\pj\compat\os_darwinos.h"\ - "..\..\..\pjlib\include\pj\compat\os_linux.h"\ - "..\..\..\pjlib\include\pj\compat\os_linux_kernel.h"\ - "..\..\..\pjlib\include\pj\compat\os_palmos.h"\ - "..\..\..\pjlib\include\pj\compat\os_rtems.h"\ - "..\..\..\pjlib\include\pj\compat\os_sunos.h"\ - "..\..\..\pjlib\include\pj\compat\os_symbian.h"\ - "..\..\..\pjlib\include\pj\compat\os_win32.h"\ - "..\..\..\pjlib\include\pj\compat\os_win32_wince.h"\ - "..\..\..\pjlib\include\pj\compat\size_t.h"\ - "..\..\..\pjlib\include\pj\config.h"\ - "..\..\..\pjlib\include\pj\config_site.h"\ - "..\..\..\pjlib\include\pj\config_site_sample.h"\ - "..\..\..\pjlib\include\pj\types.h"\ - - -!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE SH4) Release" - -DEP_CPP_RIJND=\ - "..\..\..\pjlib\include\pj\compat\cc_armcc.h"\ - "..\..\..\pjlib\include\pj\compat\cc_codew.h"\ - "..\..\..\pjlib\include\pj\compat\cc_gcc.h"\ - "..\..\..\pjlib\include\pj\compat\cc_gcce.h"\ - "..\..\..\pjlib\include\pj\compat\cc_msvc.h"\ - "..\..\..\pjlib\include\pj\compat\cc_mwcc.h"\ - "..\..\..\pjlib\include\pj\compat\m_auto.h"\ - "..\..\..\pjlib\include\pj\compat\os_auto.h"\ - "..\..\..\pjlib\include\pj\compat\os_darwinos.h"\ - "..\..\..\pjlib\include\pj\compat\os_linux.h"\ - "..\..\..\pjlib\include\pj\compat\os_linux_kernel.h"\ - "..\..\..\pjlib\include\pj\compat\os_palmos.h"\ - "..\..\..\pjlib\include\pj\compat\os_rtems.h"\ - "..\..\..\pjlib\include\pj\compat\os_sunos.h"\ - "..\..\..\pjlib\include\pj\compat\os_symbian.h"\ - "..\..\..\pjlib\include\pj\compat\os_win32.h"\ - "..\..\..\pjlib\include\pj\compat\os_win32_wince.h"\ - "..\..\..\pjlib\include\pj\compat\size_t.h"\ - "..\..\..\pjlib\include\pj\config.h"\ - "..\..\..\pjlib\include\pj\config_site.h"\ - "..\..\..\pjlib\include\pj\config_site_sample.h"\ - "..\..\..\pjlib\include\pj\types.h"\ - - -!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE SH4) Debug" - -DEP_CPP_RIJND=\ - "..\..\..\pjlib\include\pj\compat\cc_armcc.h"\ - "..\..\..\pjlib\include\pj\compat\cc_codew.h"\ - "..\..\..\pjlib\include\pj\compat\cc_gcc.h"\ - "..\..\..\pjlib\include\pj\compat\cc_gcce.h"\ - "..\..\..\pjlib\include\pj\compat\cc_msvc.h"\ - "..\..\..\pjlib\include\pj\compat\cc_mwcc.h"\ - "..\..\..\pjlib\include\pj\compat\m_auto.h"\ - "..\..\..\pjlib\include\pj\compat\os_auto.h"\ - "..\..\..\pjlib\include\pj\compat\os_darwinos.h"\ - "..\..\..\pjlib\include\pj\compat\os_linux.h"\ - "..\..\..\pjlib\include\pj\compat\os_linux_kernel.h"\ - "..\..\..\pjlib\include\pj\compat\os_palmos.h"\ - "..\..\..\pjlib\include\pj\compat\os_rtems.h"\ - "..\..\..\pjlib\include\pj\compat\os_sunos.h"\ - "..\..\..\pjlib\include\pj\compat\os_symbian.h"\ - "..\..\..\pjlib\include\pj\compat\os_win32.h"\ - "..\..\..\pjlib\include\pj\compat\os_win32_wince.h"\ - "..\..\..\pjlib\include\pj\compat\size_t.h"\ - "..\..\..\pjlib\include\pj\config.h"\ - "..\..\..\pjlib\include\pj\config_site.h"\ - "..\..\..\pjlib\include\pj\config_site_sample.h"\ - "..\..\..\pjlib\include\pj\types.h"\ - - -!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE SH3) Release" - -DEP_CPP_RIJND=\ - "..\..\..\pjlib\include\pj\compat\cc_armcc.h"\ - "..\..\..\pjlib\include\pj\compat\cc_codew.h"\ - "..\..\..\pjlib\include\pj\compat\cc_gcc.h"\ - "..\..\..\pjlib\include\pj\compat\cc_gcce.h"\ - "..\..\..\pjlib\include\pj\compat\cc_msvc.h"\ - "..\..\..\pjlib\include\pj\compat\cc_mwcc.h"\ - "..\..\..\pjlib\include\pj\compat\m_auto.h"\ - "..\..\..\pjlib\include\pj\compat\os_auto.h"\ - "..\..\..\pjlib\include\pj\compat\os_darwinos.h"\ - "..\..\..\pjlib\include\pj\compat\os_linux.h"\ - "..\..\..\pjlib\include\pj\compat\os_linux_kernel.h"\ - "..\..\..\pjlib\include\pj\compat\os_palmos.h"\ - "..\..\..\pjlib\include\pj\compat\os_rtems.h"\ - "..\..\..\pjlib\include\pj\compat\os_sunos.h"\ - "..\..\..\pjlib\include\pj\compat\os_symbian.h"\ - "..\..\..\pjlib\include\pj\compat\os_win32.h"\ - "..\..\..\pjlib\include\pj\compat\os_win32_wince.h"\ - "..\..\..\pjlib\include\pj\compat\size_t.h"\ - "..\..\..\pjlib\include\pj\config.h"\ - "..\..\..\pjlib\include\pj\config_site.h"\ - "..\..\..\pjlib\include\pj\config_site_sample.h"\ - "..\..\..\pjlib\include\pj\types.h"\ - - -!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE SH3) Debug" - -DEP_CPP_RIJND=\ - "..\..\..\pjlib\include\pj\compat\cc_armcc.h"\ - "..\..\..\pjlib\include\pj\compat\cc_codew.h"\ - "..\..\..\pjlib\include\pj\compat\cc_gcc.h"\ - "..\..\..\pjlib\include\pj\compat\cc_gcce.h"\ - "..\..\..\pjlib\include\pj\compat\cc_msvc.h"\ - "..\..\..\pjlib\include\pj\compat\cc_mwcc.h"\ - "..\..\..\pjlib\include\pj\compat\m_auto.h"\ - "..\..\..\pjlib\include\pj\compat\os_auto.h"\ - "..\..\..\pjlib\include\pj\compat\os_darwinos.h"\ - "..\..\..\pjlib\include\pj\compat\os_linux.h"\ - "..\..\..\pjlib\include\pj\compat\os_linux_kernel.h"\ - "..\..\..\pjlib\include\pj\compat\os_palmos.h"\ - "..\..\..\pjlib\include\pj\compat\os_rtems.h"\ - "..\..\..\pjlib\include\pj\compat\os_sunos.h"\ - "..\..\..\pjlib\include\pj\compat\os_symbian.h"\ - "..\..\..\pjlib\include\pj\compat\os_win32.h"\ - "..\..\..\pjlib\include\pj\compat\os_win32_wince.h"\ - "..\..\..\pjlib\include\pj\compat\size_t.h"\ - "..\..\..\pjlib\include\pj\config.h"\ - "..\..\..\pjlib\include\pj\config_site.h"\ - "..\..\..\pjlib\include\pj\config_site_sample.h"\ - "..\..\..\pjlib\include\pj\types.h"\ - - -!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE MIPSIV) Release" - -DEP_CPP_RIJND=\ - "..\..\..\pjlib\include\pj\compat\cc_armcc.h"\ - "..\..\..\pjlib\include\pj\compat\cc_codew.h"\ - "..\..\..\pjlib\include\pj\compat\cc_gcc.h"\ - "..\..\..\pjlib\include\pj\compat\cc_gcce.h"\ - "..\..\..\pjlib\include\pj\compat\cc_msvc.h"\ - "..\..\..\pjlib\include\pj\compat\cc_mwcc.h"\ - "..\..\..\pjlib\include\pj\compat\m_auto.h"\ - "..\..\..\pjlib\include\pj\compat\os_auto.h"\ - "..\..\..\pjlib\include\pj\compat\os_darwinos.h"\ - "..\..\..\pjlib\include\pj\compat\os_linux.h"\ - "..\..\..\pjlib\include\pj\compat\os_linux_kernel.h"\ - "..\..\..\pjlib\include\pj\compat\os_palmos.h"\ - "..\..\..\pjlib\include\pj\compat\os_rtems.h"\ - "..\..\..\pjlib\include\pj\compat\os_sunos.h"\ - "..\..\..\pjlib\include\pj\compat\os_symbian.h"\ - "..\..\..\pjlib\include\pj\compat\os_win32.h"\ - "..\..\..\pjlib\include\pj\compat\os_win32_wince.h"\ - "..\..\..\pjlib\include\pj\compat\size_t.h"\ - "..\..\..\pjlib\include\pj\config.h"\ - "..\..\..\pjlib\include\pj\config_site.h"\ - "..\..\..\pjlib\include\pj\config_site_sample.h"\ - "..\..\..\pjlib\include\pj\types.h"\ - - -!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE MIPSIV) Debug" - -DEP_CPP_RIJND=\ - "..\..\..\pjlib\include\pj\compat\cc_armcc.h"\ - "..\..\..\pjlib\include\pj\compat\cc_codew.h"\ - "..\..\..\pjlib\include\pj\compat\cc_gcc.h"\ - "..\..\..\pjlib\include\pj\compat\cc_gcce.h"\ - "..\..\..\pjlib\include\pj\compat\cc_msvc.h"\ - "..\..\..\pjlib\include\pj\compat\cc_mwcc.h"\ - "..\..\..\pjlib\include\pj\compat\m_auto.h"\ - "..\..\..\pjlib\include\pj\compat\os_auto.h"\ - "..\..\..\pjlib\include\pj\compat\os_darwinos.h"\ - "..\..\..\pjlib\include\pj\compat\os_linux.h"\ - "..\..\..\pjlib\include\pj\compat\os_linux_kernel.h"\ - "..\..\..\pjlib\include\pj\compat\os_palmos.h"\ - "..\..\..\pjlib\include\pj\compat\os_rtems.h"\ - "..\..\..\pjlib\include\pj\compat\os_sunos.h"\ - "..\..\..\pjlib\include\pj\compat\os_symbian.h"\ - "..\..\..\pjlib\include\pj\compat\os_win32.h"\ - "..\..\..\pjlib\include\pj\compat\os_win32_wince.h"\ - "..\..\..\pjlib\include\pj\compat\size_t.h"\ - "..\..\..\pjlib\include\pj\config.h"\ - "..\..\..\pjlib\include\pj\config_site.h"\ - "..\..\..\pjlib\include\pj\config_site_sample.h"\ - "..\..\..\pjlib\include\pj\types.h"\ - - -!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE emulator) Release" - -DEP_CPP_RIJND=\ - "..\..\..\pjlib\include\pj\compat\cc_armcc.h"\ - "..\..\..\pjlib\include\pj\compat\cc_codew.h"\ - "..\..\..\pjlib\include\pj\compat\cc_gcc.h"\ - "..\..\..\pjlib\include\pj\compat\cc_gcce.h"\ - "..\..\..\pjlib\include\pj\compat\cc_msvc.h"\ - "..\..\..\pjlib\include\pj\compat\cc_mwcc.h"\ - "..\..\..\pjlib\include\pj\compat\m_auto.h"\ - "..\..\..\pjlib\include\pj\compat\os_auto.h"\ - "..\..\..\pjlib\include\pj\compat\os_darwinos.h"\ - "..\..\..\pjlib\include\pj\compat\os_linux.h"\ - "..\..\..\pjlib\include\pj\compat\os_linux_kernel.h"\ - "..\..\..\pjlib\include\pj\compat\os_palmos.h"\ - "..\..\..\pjlib\include\pj\compat\os_rtems.h"\ - "..\..\..\pjlib\include\pj\compat\os_sunos.h"\ - "..\..\..\pjlib\include\pj\compat\os_symbian.h"\ - "..\..\..\pjlib\include\pj\compat\os_win32.h"\ - "..\..\..\pjlib\include\pj\compat\os_win32_wince.h"\ - "..\..\..\pjlib\include\pj\compat\size_t.h"\ - "..\..\..\pjlib\include\pj\config.h"\ - "..\..\..\pjlib\include\pj\config_site.h"\ - "..\..\..\pjlib\include\pj\config_site_sample.h"\ - "..\..\..\pjlib\include\pj\types.h"\ - - -!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE emulator) Debug" - -DEP_CPP_RIJND=\ - "..\..\..\pjlib\include\pj\compat\cc_armcc.h"\ - "..\..\..\pjlib\include\pj\compat\cc_codew.h"\ - "..\..\..\pjlib\include\pj\compat\cc_gcc.h"\ - "..\..\..\pjlib\include\pj\compat\cc_gcce.h"\ - "..\..\..\pjlib\include\pj\compat\cc_msvc.h"\ - "..\..\..\pjlib\include\pj\compat\cc_mwcc.h"\ - "..\..\..\pjlib\include\pj\compat\m_auto.h"\ - "..\..\..\pjlib\include\pj\compat\os_auto.h"\ - "..\..\..\pjlib\include\pj\compat\os_darwinos.h"\ - "..\..\..\pjlib\include\pj\compat\os_linux.h"\ - "..\..\..\pjlib\include\pj\compat\os_linux_kernel.h"\ - "..\..\..\pjlib\include\pj\compat\os_palmos.h"\ - "..\..\..\pjlib\include\pj\compat\os_rtems.h"\ - "..\..\..\pjlib\include\pj\compat\os_sunos.h"\ - "..\..\..\pjlib\include\pj\compat\os_symbian.h"\ - "..\..\..\pjlib\include\pj\compat\os_win32.h"\ - "..\..\..\pjlib\include\pj\compat\os_win32_wince.h"\ - "..\..\..\pjlib\include\pj\compat\size_t.h"\ - "..\..\..\pjlib\include\pj\config.h"\ - "..\..\..\pjlib\include\pj\config_site.h"\ - "..\..\..\pjlib\include\pj\config_site_sample.h"\ - "..\..\..\pjlib\include\pj\types.h"\ - - -!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE ARMV4I) Release" - -DEP_CPP_RIJND=\ - "..\..\..\pjlib\include\pj\compat\cc_armcc.h"\ - "..\..\..\pjlib\include\pj\compat\cc_codew.h"\ - "..\..\..\pjlib\include\pj\compat\cc_gcc.h"\ - "..\..\..\pjlib\include\pj\compat\cc_gcce.h"\ - "..\..\..\pjlib\include\pj\compat\cc_msvc.h"\ - "..\..\..\pjlib\include\pj\compat\cc_mwcc.h"\ - "..\..\..\pjlib\include\pj\compat\m_auto.h"\ - "..\..\..\pjlib\include\pj\compat\os_auto.h"\ - "..\..\..\pjlib\include\pj\compat\os_darwinos.h"\ - "..\..\..\pjlib\include\pj\compat\os_linux.h"\ - "..\..\..\pjlib\include\pj\compat\os_linux_kernel.h"\ - "..\..\..\pjlib\include\pj\compat\os_palmos.h"\ - "..\..\..\pjlib\include\pj\compat\os_rtems.h"\ - "..\..\..\pjlib\include\pj\compat\os_sunos.h"\ - "..\..\..\pjlib\include\pj\compat\os_symbian.h"\ - "..\..\..\pjlib\include\pj\compat\os_win32.h"\ - "..\..\..\pjlib\include\pj\compat\os_win32_wince.h"\ - "..\..\..\pjlib\include\pj\compat\size_t.h"\ - "..\..\..\pjlib\include\pj\config.h"\ - "..\..\..\pjlib\include\pj\config_site.h"\ - "..\..\..\pjlib\include\pj\config_site_sample.h"\ - "..\..\..\pjlib\include\pj\types.h"\ - - -!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE ARMV4I) Debug" - -DEP_CPP_RIJND=\ - "..\..\..\pjlib\include\pj\compat\cc_armcc.h"\ - "..\..\..\pjlib\include\pj\compat\cc_codew.h"\ - "..\..\..\pjlib\include\pj\compat\cc_gcc.h"\ - "..\..\..\pjlib\include\pj\compat\cc_gcce.h"\ - "..\..\..\pjlib\include\pj\compat\cc_msvc.h"\ - "..\..\..\pjlib\include\pj\compat\cc_mwcc.h"\ - "..\..\..\pjlib\include\pj\compat\m_auto.h"\ - "..\..\..\pjlib\include\pj\compat\os_auto.h"\ - "..\..\..\pjlib\include\pj\compat\os_darwinos.h"\ - "..\..\..\pjlib\include\pj\compat\os_linux.h"\ - "..\..\..\pjlib\include\pj\compat\os_linux_kernel.h"\ - "..\..\..\pjlib\include\pj\compat\os_palmos.h"\ - "..\..\..\pjlib\include\pj\compat\os_rtems.h"\ - "..\..\..\pjlib\include\pj\compat\os_sunos.h"\ - "..\..\..\pjlib\include\pj\compat\os_symbian.h"\ - "..\..\..\pjlib\include\pj\compat\os_win32.h"\ - "..\..\..\pjlib\include\pj\compat\os_win32_wince.h"\ - "..\..\..\pjlib\include\pj\compat\size_t.h"\ - "..\..\..\pjlib\include\pj\config.h"\ - "..\..\..\pjlib\include\pj\config_site.h"\ - "..\..\..\pjlib\include\pj\config_site_sample.h"\ - "..\..\..\pjlib\include\pj\types.h"\ - - -!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE MIPSIV_FP) Release" - -DEP_CPP_RIJND=\ - "..\..\..\pjlib\include\pj\compat\cc_armcc.h"\ - "..\..\..\pjlib\include\pj\compat\cc_codew.h"\ - "..\..\..\pjlib\include\pj\compat\cc_gcc.h"\ - "..\..\..\pjlib\include\pj\compat\cc_gcce.h"\ - "..\..\..\pjlib\include\pj\compat\cc_msvc.h"\ - "..\..\..\pjlib\include\pj\compat\cc_mwcc.h"\ - "..\..\..\pjlib\include\pj\compat\m_auto.h"\ - "..\..\..\pjlib\include\pj\compat\os_auto.h"\ - "..\..\..\pjlib\include\pj\compat\os_darwinos.h"\ - "..\..\..\pjlib\include\pj\compat\os_linux.h"\ - "..\..\..\pjlib\include\pj\compat\os_linux_kernel.h"\ - "..\..\..\pjlib\include\pj\compat\os_palmos.h"\ - "..\..\..\pjlib\include\pj\compat\os_rtems.h"\ - "..\..\..\pjlib\include\pj\compat\os_sunos.h"\ - "..\..\..\pjlib\include\pj\compat\os_symbian.h"\ - "..\..\..\pjlib\include\pj\compat\os_win32.h"\ - "..\..\..\pjlib\include\pj\compat\os_win32_wince.h"\ - "..\..\..\pjlib\include\pj\compat\size_t.h"\ - "..\..\..\pjlib\include\pj\config.h"\ - "..\..\..\pjlib\include\pj\config_site.h"\ - "..\..\..\pjlib\include\pj\config_site_sample.h"\ - "..\..\..\pjlib\include\pj\types.h"\ - - -!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE MIPSIV_FP) Debug" - -DEP_CPP_RIJND=\ - "..\..\..\pjlib\include\pj\compat\cc_armcc.h"\ - "..\..\..\pjlib\include\pj\compat\cc_codew.h"\ - "..\..\..\pjlib\include\pj\compat\cc_gcc.h"\ - "..\..\..\pjlib\include\pj\compat\cc_gcce.h"\ - "..\..\..\pjlib\include\pj\compat\cc_msvc.h"\ - "..\..\..\pjlib\include\pj\compat\cc_mwcc.h"\ - "..\..\..\pjlib\include\pj\compat\m_auto.h"\ - "..\..\..\pjlib\include\pj\compat\os_auto.h"\ - "..\..\..\pjlib\include\pj\compat\os_darwinos.h"\ - "..\..\..\pjlib\include\pj\compat\os_linux.h"\ - "..\..\..\pjlib\include\pj\compat\os_linux_kernel.h"\ - "..\..\..\pjlib\include\pj\compat\os_palmos.h"\ - "..\..\..\pjlib\include\pj\compat\os_rtems.h"\ - "..\..\..\pjlib\include\pj\compat\os_sunos.h"\ - "..\..\..\pjlib\include\pj\compat\os_symbian.h"\ - "..\..\..\pjlib\include\pj\compat\os_win32.h"\ - "..\..\..\pjlib\include\pj\compat\os_win32_wince.h"\ - "..\..\..\pjlib\include\pj\compat\size_t.h"\ - "..\..\..\pjlib\include\pj\config.h"\ - "..\..\..\pjlib\include\pj\config_site.h"\ - "..\..\..\pjlib\include\pj\config_site_sample.h"\ - "..\..\..\pjlib\include\pj\types.h"\ - - -!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE ARMV4) Release" - -DEP_CPP_RIJND=\ - "..\..\..\pjlib\include\pj\compat\cc_armcc.h"\ - "..\..\..\pjlib\include\pj\compat\cc_codew.h"\ - "..\..\..\pjlib\include\pj\compat\cc_gcc.h"\ - "..\..\..\pjlib\include\pj\compat\cc_gcce.h"\ - "..\..\..\pjlib\include\pj\compat\cc_msvc.h"\ - "..\..\..\pjlib\include\pj\compat\cc_mwcc.h"\ - "..\..\..\pjlib\include\pj\compat\m_auto.h"\ - "..\..\..\pjlib\include\pj\compat\os_auto.h"\ - "..\..\..\pjlib\include\pj\compat\os_darwinos.h"\ - "..\..\..\pjlib\include\pj\compat\os_linux.h"\ - "..\..\..\pjlib\include\pj\compat\os_linux_kernel.h"\ - "..\..\..\pjlib\include\pj\compat\os_palmos.h"\ - "..\..\..\pjlib\include\pj\compat\os_rtems.h"\ - "..\..\..\pjlib\include\pj\compat\os_sunos.h"\ - "..\..\..\pjlib\include\pj\compat\os_symbian.h"\ - "..\..\..\pjlib\include\pj\compat\os_win32.h"\ - "..\..\..\pjlib\include\pj\compat\os_win32_wince.h"\ - "..\..\..\pjlib\include\pj\compat\size_t.h"\ - "..\..\..\pjlib\include\pj\config.h"\ - "..\..\..\pjlib\include\pj\config_site.h"\ - "..\..\..\pjlib\include\pj\config_site_sample.h"\ - "..\..\..\pjlib\include\pj\types.h"\ - - -!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE ARMV4) Debug" - -DEP_CPP_RIJND=\ - "..\..\..\pjlib\include\pj\compat\cc_armcc.h"\ - "..\..\..\pjlib\include\pj\compat\cc_codew.h"\ - "..\..\..\pjlib\include\pj\compat\cc_gcc.h"\ - "..\..\..\pjlib\include\pj\compat\cc_gcce.h"\ - "..\..\..\pjlib\include\pj\compat\cc_msvc.h"\ - "..\..\..\pjlib\include\pj\compat\cc_mwcc.h"\ - "..\..\..\pjlib\include\pj\compat\m_auto.h"\ - "..\..\..\pjlib\include\pj\compat\os_auto.h"\ - "..\..\..\pjlib\include\pj\compat\os_darwinos.h"\ - "..\..\..\pjlib\include\pj\compat\os_linux.h"\ - "..\..\..\pjlib\include\pj\compat\os_linux_kernel.h"\ - "..\..\..\pjlib\include\pj\compat\os_palmos.h"\ - "..\..\..\pjlib\include\pj\compat\os_rtems.h"\ - "..\..\..\pjlib\include\pj\compat\os_sunos.h"\ - "..\..\..\pjlib\include\pj\compat\os_symbian.h"\ - "..\..\..\pjlib\include\pj\compat\os_win32.h"\ - "..\..\..\pjlib\include\pj\compat\os_win32_wince.h"\ - "..\..\..\pjlib\include\pj\compat\size_t.h"\ - "..\..\..\pjlib\include\pj\config.h"\ - "..\..\..\pjlib\include\pj\config_site.h"\ - "..\..\..\pjlib\include\pj\config_site_sample.h"\ - "..\..\..\pjlib\include\pj\types.h"\ - - -!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE MIPS16) Release" - -DEP_CPP_RIJND=\ - "..\..\..\pjlib\include\pj\compat\cc_armcc.h"\ - "..\..\..\pjlib\include\pj\compat\cc_codew.h"\ - "..\..\..\pjlib\include\pj\compat\cc_gcc.h"\ - "..\..\..\pjlib\include\pj\compat\cc_gcce.h"\ - "..\..\..\pjlib\include\pj\compat\cc_msvc.h"\ - "..\..\..\pjlib\include\pj\compat\cc_mwcc.h"\ - "..\..\..\pjlib\include\pj\compat\m_auto.h"\ - "..\..\..\pjlib\include\pj\compat\os_auto.h"\ - "..\..\..\pjlib\include\pj\compat\os_darwinos.h"\ - "..\..\..\pjlib\include\pj\compat\os_linux.h"\ - "..\..\..\pjlib\include\pj\compat\os_linux_kernel.h"\ - "..\..\..\pjlib\include\pj\compat\os_palmos.h"\ - "..\..\..\pjlib\include\pj\compat\os_rtems.h"\ - "..\..\..\pjlib\include\pj\compat\os_sunos.h"\ - "..\..\..\pjlib\include\pj\compat\os_symbian.h"\ - "..\..\..\pjlib\include\pj\compat\os_win32.h"\ - "..\..\..\pjlib\include\pj\compat\os_win32_wince.h"\ - "..\..\..\pjlib\include\pj\compat\size_t.h"\ - "..\..\..\pjlib\include\pj\config.h"\ - "..\..\..\pjlib\include\pj\config_site.h"\ - "..\..\..\pjlib\include\pj\config_site_sample.h"\ - "..\..\..\pjlib\include\pj\types.h"\ - - -!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE MIPS16) Debug" - -DEP_CPP_RIJND=\ - "..\..\..\pjlib\include\pj\compat\cc_armcc.h"\ - "..\..\..\pjlib\include\pj\compat\cc_codew.h"\ - "..\..\..\pjlib\include\pj\compat\cc_gcc.h"\ - "..\..\..\pjlib\include\pj\compat\cc_gcce.h"\ - "..\..\..\pjlib\include\pj\compat\cc_msvc.h"\ - "..\..\..\pjlib\include\pj\compat\cc_mwcc.h"\ - "..\..\..\pjlib\include\pj\compat\m_auto.h"\ - "..\..\..\pjlib\include\pj\compat\os_auto.h"\ - "..\..\..\pjlib\include\pj\compat\os_darwinos.h"\ - "..\..\..\pjlib\include\pj\compat\os_linux.h"\ - "..\..\..\pjlib\include\pj\compat\os_linux_kernel.h"\ - "..\..\..\pjlib\include\pj\compat\os_palmos.h"\ - "..\..\..\pjlib\include\pj\compat\os_rtems.h"\ - "..\..\..\pjlib\include\pj\compat\os_sunos.h"\ - "..\..\..\pjlib\include\pj\compat\os_symbian.h"\ - "..\..\..\pjlib\include\pj\compat\os_win32.h"\ - "..\..\..\pjlib\include\pj\compat\os_win32_wince.h"\ - "..\..\..\pjlib\include\pj\compat\size_t.h"\ - "..\..\..\pjlib\include\pj\config.h"\ - "..\..\..\pjlib\include\pj\config_site.h"\ - "..\..\..\pjlib\include\pj\config_site_sample.h"\ - "..\..\..\pjlib\include\pj\types.h"\ - - -!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE ARMV4T) Release" - -DEP_CPP_RIJND=\ - "..\..\..\pjlib\include\pj\compat\cc_armcc.h"\ - "..\..\..\pjlib\include\pj\compat\cc_codew.h"\ - "..\..\..\pjlib\include\pj\compat\cc_gcc.h"\ - "..\..\..\pjlib\include\pj\compat\cc_gcce.h"\ - "..\..\..\pjlib\include\pj\compat\cc_msvc.h"\ - "..\..\..\pjlib\include\pj\compat\cc_mwcc.h"\ - "..\..\..\pjlib\include\pj\compat\m_auto.h"\ - "..\..\..\pjlib\include\pj\compat\os_auto.h"\ - "..\..\..\pjlib\include\pj\compat\os_darwinos.h"\ - "..\..\..\pjlib\include\pj\compat\os_linux.h"\ - "..\..\..\pjlib\include\pj\compat\os_linux_kernel.h"\ - "..\..\..\pjlib\include\pj\compat\os_palmos.h"\ - "..\..\..\pjlib\include\pj\compat\os_rtems.h"\ - "..\..\..\pjlib\include\pj\compat\os_sunos.h"\ - "..\..\..\pjlib\include\pj\compat\os_symbian.h"\ - "..\..\..\pjlib\include\pj\compat\os_win32.h"\ - "..\..\..\pjlib\include\pj\compat\os_win32_wince.h"\ - "..\..\..\pjlib\include\pj\compat\size_t.h"\ - "..\..\..\pjlib\include\pj\config.h"\ - "..\..\..\pjlib\include\pj\config_site.h"\ - "..\..\..\pjlib\include\pj\config_site_sample.h"\ - "..\..\..\pjlib\include\pj\types.h"\ - - -!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE ARMV4T) Debug" - -DEP_CPP_RIJND=\ - "..\..\..\pjlib\include\pj\compat\cc_armcc.h"\ - "..\..\..\pjlib\include\pj\compat\cc_codew.h"\ - "..\..\..\pjlib\include\pj\compat\cc_gcc.h"\ - "..\..\..\pjlib\include\pj\compat\cc_gcce.h"\ - "..\..\..\pjlib\include\pj\compat\cc_msvc.h"\ - "..\..\..\pjlib\include\pj\compat\cc_mwcc.h"\ - "..\..\..\pjlib\include\pj\compat\m_auto.h"\ - "..\..\..\pjlib\include\pj\compat\os_auto.h"\ - "..\..\..\pjlib\include\pj\compat\os_darwinos.h"\ - "..\..\..\pjlib\include\pj\compat\os_linux.h"\ - "..\..\..\pjlib\include\pj\compat\os_linux_kernel.h"\ - "..\..\..\pjlib\include\pj\compat\os_palmos.h"\ - "..\..\..\pjlib\include\pj\compat\os_rtems.h"\ - "..\..\..\pjlib\include\pj\compat\os_sunos.h"\ - "..\..\..\pjlib\include\pj\compat\os_symbian.h"\ - "..\..\..\pjlib\include\pj\compat\os_win32.h"\ - "..\..\..\pjlib\include\pj\compat\os_win32_wince.h"\ - "..\..\..\pjlib\include\pj\compat\size_t.h"\ - "..\..\..\pjlib\include\pj\config.h"\ - "..\..\..\pjlib\include\pj\config_site.h"\ - "..\..\..\pjlib\include\pj\config_site_sample.h"\ - "..\..\..\pjlib\include\pj\types.h"\ - - -!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE x86) Release" - -DEP_CPP_RIJND=\ - "..\..\..\pjlib\include\pj\compat\cc_armcc.h"\ - "..\..\..\pjlib\include\pj\compat\cc_codew.h"\ - "..\..\..\pjlib\include\pj\compat\cc_gcc.h"\ - "..\..\..\pjlib\include\pj\compat\cc_gcce.h"\ - "..\..\..\pjlib\include\pj\compat\cc_msvc.h"\ - "..\..\..\pjlib\include\pj\compat\cc_mwcc.h"\ - "..\..\..\pjlib\include\pj\compat\m_auto.h"\ - "..\..\..\pjlib\include\pj\compat\os_auto.h"\ - "..\..\..\pjlib\include\pj\compat\os_darwinos.h"\ - "..\..\..\pjlib\include\pj\compat\os_linux.h"\ - "..\..\..\pjlib\include\pj\compat\os_linux_kernel.h"\ - "..\..\..\pjlib\include\pj\compat\os_palmos.h"\ - "..\..\..\pjlib\include\pj\compat\os_rtems.h"\ - "..\..\..\pjlib\include\pj\compat\os_sunos.h"\ - "..\..\..\pjlib\include\pj\compat\os_symbian.h"\ - "..\..\..\pjlib\include\pj\compat\os_win32.h"\ - "..\..\..\pjlib\include\pj\compat\os_win32_wince.h"\ - "..\..\..\pjlib\include\pj\compat\size_t.h"\ - "..\..\..\pjlib\include\pj\config.h"\ - "..\..\..\pjlib\include\pj\config_site.h"\ - "..\..\..\pjlib\include\pj\config_site_sample.h"\ - "..\..\..\pjlib\include\pj\types.h"\ - - -!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE x86) Debug" - -DEP_CPP_RIJND=\ - "..\..\..\pjlib\include\pj\compat\cc_armcc.h"\ - "..\..\..\pjlib\include\pj\compat\cc_codew.h"\ - "..\..\..\pjlib\include\pj\compat\cc_gcc.h"\ - "..\..\..\pjlib\include\pj\compat\cc_gcce.h"\ - "..\..\..\pjlib\include\pj\compat\cc_msvc.h"\ - "..\..\..\pjlib\include\pj\compat\cc_mwcc.h"\ - "..\..\..\pjlib\include\pj\compat\m_auto.h"\ - "..\..\..\pjlib\include\pj\compat\os_auto.h"\ - "..\..\..\pjlib\include\pj\compat\os_darwinos.h"\ - "..\..\..\pjlib\include\pj\compat\os_linux.h"\ - "..\..\..\pjlib\include\pj\compat\os_linux_kernel.h"\ - "..\..\..\pjlib\include\pj\compat\os_palmos.h"\ - "..\..\..\pjlib\include\pj\compat\os_rtems.h"\ - "..\..\..\pjlib\include\pj\compat\os_sunos.h"\ - "..\..\..\pjlib\include\pj\compat\os_symbian.h"\ - "..\..\..\pjlib\include\pj\compat\os_win32.h"\ - "..\..\..\pjlib\include\pj\compat\os_win32_wince.h"\ - "..\..\..\pjlib\include\pj\compat\size_t.h"\ - "..\..\..\pjlib\include\pj\config.h"\ - "..\..\..\pjlib\include\pj\config_site.h"\ - "..\..\..\pjlib\include\pj\config_site_sample.h"\ - "..\..\..\pjlib\include\pj\types.h"\ - - -!ENDIF - -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=..\..\milenage\milenage.h -# End Source File -# Begin Source File - -SOURCE=..\..\milenage\rijndael.h -# End Source File -# End Group -# End Target -# End Project diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/build/milenage/libmilenage.vcproj b/sflphone-common/libs/pjproject-1.0.1/third_party/build/milenage/libmilenage.vcproj deleted file mode 100644 index cdf6404118e439fd6e0e00595de44a96163e08df..0000000000000000000000000000000000000000 --- a/sflphone-common/libs/pjproject-1.0.1/third_party/build/milenage/libmilenage.vcproj +++ /dev/null @@ -1,231 +0,0 @@ -<?xml version="1.0" encoding="Windows-1252"?> -<VisualStudioProject - ProjectType="Visual C++" - Version="8.00" - Name="libmilenage" - ProjectGUID="{4BF51C21-5A30-423B-82FE-1ED410E5769D}" - > - <Platforms> - <Platform - Name="Win32" - /> - </Platforms> - <ToolFiles> - </ToolFiles> - <Configurations> - <Configuration - Name="Debug|Win32" - OutputDirectory=".\../../lib" - IntermediateDirectory=".\output/libmilenage-i386-win32-vc8-debug" - ConfigurationType="4" - InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops" - UseOfMFC="0" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="0" - AdditionalIncludeDirectories="../../../pjlib/include" - PreprocessorDefinitions="WIN32;_DEBUG;_LIB" - MinimalRebuild="true" - BasicRuntimeChecks="3" - RuntimeLibrary="1" - PrecompiledHeaderFile=".\output/libmilenage-i386-win32-vc8-debug/libmilenage.pch" - AssemblerListingLocation=".\output/libmilenage-i386-win32-vc8-debug/" - ObjectFile=".\output/libmilenage-i386-win32-vc8-debug/" - ProgramDataBaseFileName=".\output/libmilenage-i386-win32-vc8-debug/" - WarningLevel="3" - SuppressStartupBanner="true" - DebugInformationFormat="4" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - PreprocessorDefinitions="_DEBUG" - Culture="1033" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLibrarianTool" - OutputFile="../../lib/libmilenage-i386-win32-vc8-debug.lib" - SuppressStartupBanner="true" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - SuppressStartupBanner="true" - OutputFile=".\../../lib/libmilenage.bsc" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - <Configuration - Name="Release|Win32" - OutputDirectory=".\../../lib" - IntermediateDirectory=".\output/libmilenage-i386-win32-vc8-release" - ConfigurationType="4" - InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops" - UseOfMFC="0" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="2" - InlineFunctionExpansion="1" - AdditionalIncludeDirectories="../../../pjlib/include" - PreprocessorDefinitions="WIN32;NDEBUG;_LIB" - StringPooling="true" - RuntimeLibrary="2" - EnableFunctionLevelLinking="true" - PrecompiledHeaderFile=".\output/libmilenage-i386-win32-vc8-release/libmilenage.pch" - AssemblerListingLocation=".\output/libmilenage-i386-win32-vc8-release/" - ObjectFile=".\output/libmilenage-i386-win32-vc8-release/" - ProgramDataBaseFileName=".\output/libmilenage-i386-win32-vc8-release/" - WarningLevel="3" - SuppressStartupBanner="true" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - PreprocessorDefinitions="NDEBUG" - Culture="1033" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLibrarianTool" - OutputFile="../../lib/libmilenage-i386-win32-vc8-release.lib" - SuppressStartupBanner="true" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - SuppressStartupBanner="true" - OutputFile=".\../../lib/libmilenage.bsc" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - </Configurations> - <References> - </References> - <Files> - <Filter - Name="Source Files" - Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" - > - <File - RelativePath="..\..\milenage\milenage.c" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="" - /> - </FileConfiguration> - </File> - <File - RelativePath="..\..\milenage\rijndael.c" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="" - /> - </FileConfiguration> - </File> - </Filter> - <Filter - Name="Header Files" - Filter="h;hpp;hxx;hm;inl" - > - <File - RelativePath="..\..\milenage\milenage.h" - > - </File> - <File - RelativePath="..\..\milenage\rijndael.h" - > - </File> - </Filter> - </Files> - <Globals> - </Globals> -</VisualStudioProject> diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/milenage/milenage.c b/sflphone-common/libs/pjproject-1.0.1/third_party/milenage/milenage.c deleted file mode 100644 index 66dae9bb10947bc3b5352a6f499c1c0954eab83d..0000000000000000000000000000000000000000 --- a/sflphone-common/libs/pjproject-1.0.1/third_party/milenage/milenage.c +++ /dev/null @@ -1,284 +0,0 @@ -/*------------------------------------------------------------------- - * Example algorithms f1, f1*, f2, f3, f4, f5, f5* - *------------------------------------------------------------------- - * - * A sample implementation of the example 3GPP authentication and - * key agreement functions f1, f1*, f2, f3, f4, f5 and f5*. This is - * a byte-oriented implementation of the functions, and of the block - * cipher kernel function Rijndael. - * - * This has been coded for clarity, not necessarily for efficiency. - * - * The functions f2, f3, f4 and f5 share the same inputs and have - * been coded together as a single function. f1, f1* and f5* are - * all coded separately. - * - *-----------------------------------------------------------------*/ - -#include "milenage.h" -#include "rijndael.h" - -/*--------------------------- prototypes --------------------------*/ - - - -/*------------------------------------------------------------------- - * Algorithm f1 - *------------------------------------------------------------------- - * - * Computes network authentication code MAC-A from key K, random - * challenge RAND, sequence number SQN and authentication management - * field AMF. - * - *-----------------------------------------------------------------*/ - -void f1 ( u8 k[16], u8 rand[16], u8 sqn[6], u8 amf[2], - u8 mac_a[8], u8 op[16] ) -{ - u8 op_c[16]; - u8 temp[16]; - u8 in1[16]; - u8 out1[16]; - u8 rijndaelInput[16]; - u8 i; - - RijndaelKeySchedule( k ); - - ComputeOPc( op_c, op ); - - for (i=0; i<16; i++) - rijndaelInput[i] = rand[i] ^ op_c[i]; - RijndaelEncrypt( rijndaelInput, temp ); - - for (i=0; i<6; i++) - { - in1[i] = sqn[i]; - in1[i+8] = sqn[i]; - } - for (i=0; i<2; i++) - { - in1[i+6] = amf[i]; - in1[i+14] = amf[i]; - } - - /* XOR op_c and in1, rotate by r1=64, and XOR * - * on the constant c1 (which is all zeroes) */ - - for (i=0; i<16; i++) - rijndaelInput[(i+8) % 16] = in1[i] ^ op_c[i]; - - /* XOR on the value temp computed before */ - - for (i=0; i<16; i++) - rijndaelInput[i] ^= temp[i]; - - RijndaelEncrypt( rijndaelInput, out1 ); - for (i=0; i<16; i++) - out1[i] ^= op_c[i]; - - for (i=0; i<8; i++) - mac_a[i] = out1[i]; - - return; -} /* end of function f1 */ - - - -/*------------------------------------------------------------------- - * Algorithms f2-f5 - *------------------------------------------------------------------- - * - * Takes key K and random challenge RAND, and returns response RES, - * confidentiality key CK, integrity key IK and anonymity key AK. - * - *-----------------------------------------------------------------*/ - -void f2345 ( u8 k[16], u8 rand[16], - u8 res[8], u8 ck[16], u8 ik[16], u8 ak[6], u8 op[16] ) -{ - u8 op_c[16]; - u8 temp[16]; - u8 out[16]; - u8 rijndaelInput[16]; - u8 i; - - RijndaelKeySchedule( k ); - - ComputeOPc( op_c, op ); - - for (i=0; i<16; i++) - rijndaelInput[i] = rand[i] ^ op_c[i]; - RijndaelEncrypt( rijndaelInput, temp ); - - /* To obtain output block OUT2: XOR OPc and TEMP, * - * rotate by r2=0, and XOR on the constant c2 (which * - * is all zeroes except that the last bit is 1). */ - - for (i=0; i<16; i++) - rijndaelInput[i] = temp[i] ^ op_c[i]; - rijndaelInput[15] ^= 1; - - RijndaelEncrypt( rijndaelInput, out ); - for (i=0; i<16; i++) - out[i] ^= op_c[i]; - - for (i=0; i<8; i++) - res[i] = out[i+8]; - for (i=0; i<6; i++) - ak[i] = out[i]; - - /* To obtain output block OUT3: XOR OPc and TEMP, * - * rotate by r3=32, and XOR on the constant c3 (which * - * is all zeroes except that the next to last bit is 1). */ - - for (i=0; i<16; i++) - rijndaelInput[(i+12) % 16] = temp[i] ^ op_c[i]; - rijndaelInput[15] ^= 2; - - RijndaelEncrypt( rijndaelInput, out ); - for (i=0; i<16; i++) - out[i] ^= op_c[i]; - - for (i=0; i<16; i++) - ck[i] = out[i]; - - /* To obtain output block OUT4: XOR OPc and TEMP, * - * rotate by r4=64, and XOR on the constant c4 (which * - * is all zeroes except that the 2nd from last bit is 1). */ - - for (i=0; i<16; i++) - rijndaelInput[(i+8) % 16] = temp[i] ^ op_c[i]; - rijndaelInput[15] ^= 4; - - RijndaelEncrypt( rijndaelInput, out ); - for (i=0; i<16; i++) - out[i] ^= op_c[i]; - - for (i=0; i<16; i++) - ik[i] = out[i]; - - return; -} /* end of function f2345 */ - - -/*------------------------------------------------------------------- - * Algorithm f1* - *------------------------------------------------------------------- - * - * Computes resynch authentication code MAC-S from key K, random - * challenge RAND, sequence number SQN and authentication management - * field AMF. - * - *-----------------------------------------------------------------*/ - -void f1star( u8 k[16], u8 rand[16], u8 sqn[6], u8 amf[2], - u8 mac_s[8], u8 op[16] ) -{ - u8 op_c[16]; - u8 temp[16]; - u8 in1[16]; - u8 out1[16]; - u8 rijndaelInput[16]; - u8 i; - - RijndaelKeySchedule( k ); - - ComputeOPc( op_c, op ); - - for (i=0; i<16; i++) - rijndaelInput[i] = rand[i] ^ op_c[i]; - RijndaelEncrypt( rijndaelInput, temp ); - - for (i=0; i<6; i++) - { - in1[i] = sqn[i]; - in1[i+8] = sqn[i]; - } - for (i=0; i<2; i++) - { - in1[i+6] = amf[i]; - in1[i+14] = amf[i]; - } - - /* XOR op_c and in1, rotate by r1=64, and XOR * - * on the constant c1 (which is all zeroes) */ - - for (i=0; i<16; i++) - rijndaelInput[(i+8) % 16] = in1[i] ^ op_c[i]; - - /* XOR on the value temp computed before */ - - for (i=0; i<16; i++) - rijndaelInput[i] ^= temp[i]; - - RijndaelEncrypt( rijndaelInput, out1 ); - for (i=0; i<16; i++) - out1[i] ^= op_c[i]; - - for (i=0; i<8; i++) - mac_s[i] = out1[i+8]; - - return; -} /* end of function f1star */ - - -/*------------------------------------------------------------------- - * Algorithm f5* - *------------------------------------------------------------------- - * - * Takes key K and random challenge RAND, and returns resynch - * anonymity key AK. - * - *-----------------------------------------------------------------*/ - -void f5star( u8 k[16], u8 rand[16], - u8 ak[6], u8 op[16] ) -{ - u8 op_c[16]; - u8 temp[16]; - u8 out[16]; - u8 rijndaelInput[16]; - u8 i; - - RijndaelKeySchedule( k ); - - ComputeOPc( op_c, op ); - - for (i=0; i<16; i++) - rijndaelInput[i] = rand[i] ^ op_c[i]; - RijndaelEncrypt( rijndaelInput, temp ); - - /* To obtain output block OUT5: XOR OPc and TEMP, * - * rotate by r5=96, and XOR on the constant c5 (which * - * is all zeroes except that the 3rd from last bit is 1). */ - - for (i=0; i<16; i++) - rijndaelInput[(i+4) % 16] = temp[i] ^ op_c[i]; - rijndaelInput[15] ^= 8; - - RijndaelEncrypt( rijndaelInput, out ); - for (i=0; i<16; i++) - out[i] ^= op_c[i]; - - for (i=0; i<6; i++) - ak[i] = out[i]; - - return; -} /* end of function f5star */ - - -/*------------------------------------------------------------------- - * Function to compute OPc from OP and K. Assumes key schedule has - already been performed. - *-----------------------------------------------------------------*/ - -void ComputeOPc( u8 op_c[16], u8 op[16] ) -{ - u8 i; - - RijndaelEncrypt( op, op_c ); - for (i=0; i<16; i++) - op_c[i] ^= op[i]; - - return; -} /* end of function ComputeOPc */ diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/milenage/milenage.h b/sflphone-common/libs/pjproject-1.0.1/third_party/milenage/milenage.h deleted file mode 100644 index a5f407f3787266cb0d90c08bc2b8c15e31704950..0000000000000000000000000000000000000000 --- a/sflphone-common/libs/pjproject-1.0.1/third_party/milenage/milenage.h +++ /dev/null @@ -1,35 +0,0 @@ -/*------------------------------------------------------------------- - * Example algorithms f1, f1*, f2, f3, f4, f5, f5* - *------------------------------------------------------------------- - * - * A sample implementation of the example 3GPP authentication and - * key agreement functions f1, f1*, f2, f3, f4, f5 and f5*. This is - * a byte-oriented implementation of the functions, and of the block - * cipher kernel function Rijndael. - * - * This has been coded for clarity, not necessarily for efficiency. - * - * The functions f2, f3, f4 and f5 share the same inputs and have - * been coded together as a single function. f1, f1* and f5* are - * all coded separately. - * - *-----------------------------------------------------------------*/ - -#ifndef MILENAGE_H -#define MILENAGE_H - -typedef unsigned char u8; - - -void f1 ( u8 k[16], u8 rand[16], u8 sqn[6], u8 amf[2], - u8 mac_a[8], u8 op[16] ); -void f2345 ( u8 k[16], u8 rand[16], - u8 res[8], u8 ck[16], u8 ik[16], u8 ak[6], u8 op[16] ); -void f1star( u8 k[16], u8 rand[16], u8 sqn[6], u8 amf[2], - u8 mac_s[8], u8 op[16] ); -void f5star( u8 k[16], u8 rand[16], - u8 ak[6], u8 op[16] ); -void ComputeOPc( u8 op_c[16], u8 op[16] ); - - -#endif diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/milenage/rijndael.c b/sflphone-common/libs/pjproject-1.0.1/third_party/milenage/rijndael.c deleted file mode 100644 index 86557b92e4e57f1f706f82a4943a8183b6e40f70..0000000000000000000000000000000000000000 --- a/sflphone-common/libs/pjproject-1.0.1/third_party/milenage/rijndael.c +++ /dev/null @@ -1,444 +0,0 @@ -/*------------------------------------------------------------------- - * Rijndael Implementation - *------------------------------------------------------------------- - * - * A sample 32-bit orientated implementation of Rijndael, the - * suggested kernel for the example 3GPP authentication and key - * agreement functions. - * - * This implementation draws on the description in section 5.2 of - * the AES proposal and also on the implementation by - * Dr B. R. Gladman <brg@gladman.uk.net> 9th October 2000. - * It uses a number of large (4k) lookup tables to implement the - * algorithm in an efficient manner. - * - * Note: in this implementation the State is stored in four 32-bit - * words, one per column of the State, with the top byte of the - * column being the _least_ significant byte of the word. - * -*-----------------------------------------------------------------*/ - -#include <pj/types.h> - -#if defined(PJ_IS_LITTLE_ENDIAN) && PJ_IS_LITTLE_ENDIAN != 0 -# define LITTLE_ENDIAN /* For INTEL architecture */ -#endif - -typedef unsigned char u8; -typedef unsigned int u32; - -/* Circular byte rotates of 32 bit values */ - -#define rot1(x) ((x << 8) | (x >> 24)) -#define rot2(x) ((x << 16) | (x >> 16)) -#define rot3(x) ((x << 24) | (x >> 8)) - -/* Extract a byte from a 32-bit u32 */ - -#define byte0(x) ((u8)(x)) -#define byte1(x) ((u8)(x >> 8)) -#define byte2(x) ((u8)(x >> 16)) -#define byte3(x) ((u8)(x >> 24)) - - -/* Put or get a 32 bit u32 (v) in machine order from a byte * - * address in (x) */ - -#ifdef LITTLE_ENDIAN - -#define u32_in(x) (*(u32*)(x)) -#define u32_out(x,y) (*(u32*)(x) = y) - -#else - -/* Invert byte order in a 32 bit variable */ - -__inline u32 byte_swap(const u32 x) -{ - return rot1(x) & 0x00ff00ff | rot3(x) & 0xff00ff00; -} -__inline u32 u32_in(const u8 x[]) -{ - return byte_swap(*(u32*)x); -}; -__inline void u32_out(u8 x[], const u32 v) -{ - *(u32*)x = byte_swap(v); -}; - -#endif - -/*--------------- The lookup tables ----------------------------*/ - -static u32 rnd_con[10] = -{ - 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1B, 0x36 -}; - -static u32 ft_tab[4][256] = -{ - { - 0xA56363C6,0x847C7CF8,0x997777EE,0x8D7B7BF6,0x0DF2F2FF,0xBD6B6BD6,0xB16F6FDE,0x54C5C591, - 0x50303060,0x03010102,0xA96767CE,0x7D2B2B56,0x19FEFEE7,0x62D7D7B5,0xE6ABAB4D,0x9A7676EC, - 0x45CACA8F,0x9D82821F,0x40C9C989,0x877D7DFA,0x15FAFAEF,0xEB5959B2,0xC947478E,0x0BF0F0FB, - 0xECADAD41,0x67D4D4B3,0xFDA2A25F,0xEAAFAF45,0xBF9C9C23,0xF7A4A453,0x967272E4,0x5BC0C09B, - 0xC2B7B775,0x1CFDFDE1,0xAE93933D,0x6A26264C,0x5A36366C,0x413F3F7E,0x02F7F7F5,0x4FCCCC83, - 0x5C343468,0xF4A5A551,0x34E5E5D1,0x08F1F1F9,0x937171E2,0x73D8D8AB,0x53313162,0x3F15152A, - 0x0C040408,0x52C7C795,0x65232346,0x5EC3C39D,0x28181830,0xA1969637,0x0F05050A,0xB59A9A2F, - 0x0907070E,0x36121224,0x9B80801B,0x3DE2E2DF,0x26EBEBCD,0x6927274E,0xCDB2B27F,0x9F7575EA, - 0x1B090912,0x9E83831D,0x742C2C58,0x2E1A1A34,0x2D1B1B36,0xB26E6EDC,0xEE5A5AB4,0xFBA0A05B, - 0xF65252A4,0x4D3B3B76,0x61D6D6B7,0xCEB3B37D,0x7B292952,0x3EE3E3DD,0x712F2F5E,0x97848413, - 0xF55353A6,0x68D1D1B9,0000000000,0x2CEDEDC1,0x60202040,0x1FFCFCE3,0xC8B1B179,0xED5B5BB6, - 0xBE6A6AD4,0x46CBCB8D,0xD9BEBE67,0x4B393972,0xDE4A4A94,0xD44C4C98,0xE85858B0,0x4ACFCF85, - 0x6BD0D0BB,0x2AEFEFC5,0xE5AAAA4F,0x16FBFBED,0xC5434386,0xD74D4D9A,0x55333366,0x94858511, - 0xCF45458A,0x10F9F9E9,0x06020204,0x817F7FFE,0xF05050A0,0x443C3C78,0xBA9F9F25,0xE3A8A84B, - 0xF35151A2,0xFEA3A35D,0xC0404080,0x8A8F8F05,0xAD92923F,0xBC9D9D21,0x48383870,0x04F5F5F1, - 0xDFBCBC63,0xC1B6B677,0x75DADAAF,0x63212142,0x30101020,0x1AFFFFE5,0x0EF3F3FD,0x6DD2D2BF, - 0x4CCDCD81,0x140C0C18,0x35131326,0x2FECECC3,0xE15F5FBE,0xA2979735,0xCC444488,0x3917172E, - 0x57C4C493,0xF2A7A755,0x827E7EFC,0x473D3D7A,0xAC6464C8,0xE75D5DBA,0x2B191932,0x957373E6, - 0xA06060C0,0x98818119,0xD14F4F9E,0x7FDCDCA3,0x66222244,0x7E2A2A54,0xAB90903B,0x8388880B, - 0xCA46468C,0x29EEEEC7,0xD3B8B86B,0x3C141428,0x79DEDEA7,0xE25E5EBC,0x1D0B0B16,0x76DBDBAD, - 0x3BE0E0DB,0x56323264,0x4E3A3A74,0x1E0A0A14,0xDB494992,0x0A06060C,0x6C242448,0xE45C5CB8, - 0x5DC2C29F,0x6ED3D3BD,0xEFACAC43,0xA66262C4,0xA8919139,0xA4959531,0x37E4E4D3,0x8B7979F2, - 0x32E7E7D5,0x43C8C88B,0x5937376E,0xB76D6DDA,0x8C8D8D01,0x64D5D5B1,0xD24E4E9C,0xE0A9A949, - 0xB46C6CD8,0xFA5656AC,0x07F4F4F3,0x25EAEACF,0xAF6565CA,0x8E7A7AF4,0xE9AEAE47,0x18080810, - 0xD5BABA6F,0x887878F0,0x6F25254A,0x722E2E5C,0x241C1C38,0xF1A6A657,0xC7B4B473,0x51C6C697, - 0x23E8E8CB,0x7CDDDDA1,0x9C7474E8,0x211F1F3E,0xDD4B4B96,0xDCBDBD61,0x868B8B0D,0x858A8A0F, - 0x907070E0,0x423E3E7C,0xC4B5B571,0xAA6666CC,0xD8484890,0x05030306,0x01F6F6F7,0x120E0E1C, - 0xA36161C2,0x5F35356A,0xF95757AE,0xD0B9B969,0x91868617,0x58C1C199,0x271D1D3A,0xB99E9E27, - 0x38E1E1D9,0x13F8F8EB,0xB398982B,0x33111122,0xBB6969D2,0x70D9D9A9,0x898E8E07,0xA7949433, - 0xB69B9B2D,0x221E1E3C,0x92878715,0x20E9E9C9,0x49CECE87,0xFF5555AA,0x78282850,0x7ADFDFA5, - 0x8F8C8C03,0xF8A1A159,0x80898909,0x170D0D1A,0xDABFBF65,0x31E6E6D7,0xC6424284,0xB86868D0, - 0xC3414182,0xB0999929,0x772D2D5A,0x110F0F1E,0xCBB0B07B,0xFC5454A8,0xD6BBBB6D,0x3A16162C - }, - { - 0x6363C6A5,0x7C7CF884,0x7777EE99,0x7B7BF68D,0xF2F2FF0D,0x6B6BD6BD,0x6F6FDEB1,0xC5C59154, - 0x30306050,0x01010203,0x6767CEA9,0x2B2B567D,0xFEFEE719,0xD7D7B562,0xABAB4DE6,0x7676EC9A, - 0xCACA8F45,0x82821F9D,0xC9C98940,0x7D7DFA87,0xFAFAEF15,0x5959B2EB,0x47478EC9,0xF0F0FB0B, - 0xADAD41EC,0xD4D4B367,0xA2A25FFD,0xAFAF45EA,0x9C9C23BF,0xA4A453F7,0x7272E496,0xC0C09B5B, - 0xB7B775C2,0xFDFDE11C,0x93933DAE,0x26264C6A,0x36366C5A,0x3F3F7E41,0xF7F7F502,0xCCCC834F, - 0x3434685C,0xA5A551F4,0xE5E5D134,0xF1F1F908,0x7171E293,0xD8D8AB73,0x31316253,0x15152A3F, - 0x0404080C,0xC7C79552,0x23234665,0xC3C39D5E,0x18183028,0x969637A1,0x05050A0F,0x9A9A2FB5, - 0x07070E09,0x12122436,0x80801B9B,0xE2E2DF3D,0xEBEBCD26,0x27274E69,0xB2B27FCD,0x7575EA9F, - 0x0909121B,0x83831D9E,0x2C2C5874,0x1A1A342E,0x1B1B362D,0x6E6EDCB2,0x5A5AB4EE,0xA0A05BFB, - 0x5252A4F6,0x3B3B764D,0xD6D6B761,0xB3B37DCE,0x2929527B,0xE3E3DD3E,0x2F2F5E71,0x84841397, - 0x5353A6F5,0xD1D1B968,0000000000,0xEDEDC12C,0x20204060,0xFCFCE31F,0xB1B179C8,0x5B5BB6ED, - 0x6A6AD4BE,0xCBCB8D46,0xBEBE67D9,0x3939724B,0x4A4A94DE,0x4C4C98D4,0x5858B0E8,0xCFCF854A, - 0xD0D0BB6B,0xEFEFC52A,0xAAAA4FE5,0xFBFBED16,0x434386C5,0x4D4D9AD7,0x33336655,0x85851194, - 0x45458ACF,0xF9F9E910,0x02020406,0x7F7FFE81,0x5050A0F0,0x3C3C7844,0x9F9F25BA,0xA8A84BE3, - 0x5151A2F3,0xA3A35DFE,0x404080C0,0x8F8F058A,0x92923FAD,0x9D9D21BC,0x38387048,0xF5F5F104, - 0xBCBC63DF,0xB6B677C1,0xDADAAF75,0x21214263,0x10102030,0xFFFFE51A,0xF3F3FD0E,0xD2D2BF6D, - 0xCDCD814C,0x0C0C1814,0x13132635,0xECECC32F,0x5F5FBEE1,0x979735A2,0x444488CC,0x17172E39, - 0xC4C49357,0xA7A755F2,0x7E7EFC82,0x3D3D7A47,0x6464C8AC,0x5D5DBAE7,0x1919322B,0x7373E695, - 0x6060C0A0,0x81811998,0x4F4F9ED1,0xDCDCA37F,0x22224466,0x2A2A547E,0x90903BAB,0x88880B83, - 0x46468CCA,0xEEEEC729,0xB8B86BD3,0x1414283C,0xDEDEA779,0x5E5EBCE2,0x0B0B161D,0xDBDBAD76, - 0xE0E0DB3B,0x32326456,0x3A3A744E,0x0A0A141E,0x494992DB,0x06060C0A,0x2424486C,0x5C5CB8E4, - 0xC2C29F5D,0xD3D3BD6E,0xACAC43EF,0x6262C4A6,0x919139A8,0x959531A4,0xE4E4D337,0x7979F28B, - 0xE7E7D532,0xC8C88B43,0x37376E59,0x6D6DDAB7,0x8D8D018C,0xD5D5B164,0x4E4E9CD2,0xA9A949E0, - 0x6C6CD8B4,0x5656ACFA,0xF4F4F307,0xEAEACF25,0x6565CAAF,0x7A7AF48E,0xAEAE47E9,0x08081018, - 0xBABA6FD5,0x7878F088,0x25254A6F,0x2E2E5C72,0x1C1C3824,0xA6A657F1,0xB4B473C7,0xC6C69751, - 0xE8E8CB23,0xDDDDA17C,0x7474E89C,0x1F1F3E21,0x4B4B96DD,0xBDBD61DC,0x8B8B0D86,0x8A8A0F85, - 0x7070E090,0x3E3E7C42,0xB5B571C4,0x6666CCAA,0x484890D8,0x03030605,0xF6F6F701,0x0E0E1C12, - 0x6161C2A3,0x35356A5F,0x5757AEF9,0xB9B969D0,0x86861791,0xC1C19958,0x1D1D3A27,0x9E9E27B9, - 0xE1E1D938,0xF8F8EB13,0x98982BB3,0x11112233,0x6969D2BB,0xD9D9A970,0x8E8E0789,0x949433A7, - 0x9B9B2DB6,0x1E1E3C22,0x87871592,0xE9E9C920,0xCECE8749,0x5555AAFF,0x28285078,0xDFDFA57A, - 0x8C8C038F,0xA1A159F8,0x89890980,0x0D0D1A17,0xBFBF65DA,0xE6E6D731,0x424284C6,0x6868D0B8, - 0x414182C3,0x999929B0,0x2D2D5A77,0x0F0F1E11,0xB0B07BCB,0x5454A8FC,0xBBBB6DD6,0x16162C3A - }, - { - 0x63C6A563,0x7CF8847C,0x77EE9977,0x7BF68D7B,0xF2FF0DF2,0x6BD6BD6B,0x6FDEB16F,0xC59154C5, - 0x30605030,0x01020301,0x67CEA967,0x2B567D2B,0xFEE719FE,0xD7B562D7,0xAB4DE6AB,0x76EC9A76, - 0xCA8F45CA,0x821F9D82,0xC98940C9,0x7DFA877D,0xFAEF15FA,0x59B2EB59,0x478EC947,0xF0FB0BF0, - 0xAD41ECAD,0xD4B367D4,0xA25FFDA2,0xAF45EAAF,0x9C23BF9C,0xA453F7A4,0x72E49672,0xC09B5BC0, - 0xB775C2B7,0xFDE11CFD,0x933DAE93,0x264C6A26,0x366C5A36,0x3F7E413F,0xF7F502F7,0xCC834FCC, - 0x34685C34,0xA551F4A5,0xE5D134E5,0xF1F908F1,0x71E29371,0xD8AB73D8,0x31625331,0x152A3F15, - 0x04080C04,0xC79552C7,0x23466523,0xC39D5EC3,0x18302818,0x9637A196,0x050A0F05,0x9A2FB59A, - 0x070E0907,0x12243612,0x801B9B80,0xE2DF3DE2,0xEBCD26EB,0x274E6927,0xB27FCDB2,0x75EA9F75, - 0x09121B09,0x831D9E83,0x2C58742C,0x1A342E1A,0x1B362D1B,0x6EDCB26E,0x5AB4EE5A,0xA05BFBA0, - 0x52A4F652,0x3B764D3B,0xD6B761D6,0xB37DCEB3,0x29527B29,0xE3DD3EE3,0x2F5E712F,0x84139784, - 0x53A6F553,0xD1B968D1,0000000000,0xEDC12CED,0x20406020,0xFCE31FFC,0xB179C8B1,0x5BB6ED5B, - 0x6AD4BE6A,0xCB8D46CB,0xBE67D9BE,0x39724B39,0x4A94DE4A,0x4C98D44C,0x58B0E858,0xCF854ACF, - 0xD0BB6BD0,0xEFC52AEF,0xAA4FE5AA,0xFBED16FB,0x4386C543,0x4D9AD74D,0x33665533,0x85119485, - 0x458ACF45,0xF9E910F9,0x02040602,0x7FFE817F,0x50A0F050,0x3C78443C,0x9F25BA9F,0xA84BE3A8, - 0x51A2F351,0xA35DFEA3,0x4080C040,0x8F058A8F,0x923FAD92,0x9D21BC9D,0x38704838,0xF5F104F5, - 0xBC63DFBC,0xB677C1B6,0xDAAF75DA,0x21426321,0x10203010,0xFFE51AFF,0xF3FD0EF3,0xD2BF6DD2, - 0xCD814CCD,0x0C18140C,0x13263513,0xECC32FEC,0x5FBEE15F,0x9735A297,0x4488CC44,0x172E3917, - 0xC49357C4,0xA755F2A7,0x7EFC827E,0x3D7A473D,0x64C8AC64,0x5DBAE75D,0x19322B19,0x73E69573, - 0x60C0A060,0x81199881,0x4F9ED14F,0xDCA37FDC,0x22446622,0x2A547E2A,0x903BAB90,0x880B8388, - 0x468CCA46,0xEEC729EE,0xB86BD3B8,0x14283C14,0xDEA779DE,0x5EBCE25E,0x0B161D0B,0xDBAD76DB, - 0xE0DB3BE0,0x32645632,0x3A744E3A,0x0A141E0A,0x4992DB49,0x060C0A06,0x24486C24,0x5CB8E45C, - 0xC29F5DC2,0xD3BD6ED3,0xAC43EFAC,0x62C4A662,0x9139A891,0x9531A495,0xE4D337E4,0x79F28B79, - 0xE7D532E7,0xC88B43C8,0x376E5937,0x6DDAB76D,0x8D018C8D,0xD5B164D5,0x4E9CD24E,0xA949E0A9, - 0x6CD8B46C,0x56ACFA56,0xF4F307F4,0xEACF25EA,0x65CAAF65,0x7AF48E7A,0xAE47E9AE,0x08101808, - 0xBA6FD5BA,0x78F08878,0x254A6F25,0x2E5C722E,0x1C38241C,0xA657F1A6,0xB473C7B4,0xC69751C6, - 0xE8CB23E8,0xDDA17CDD,0x74E89C74,0x1F3E211F,0x4B96DD4B,0xBD61DCBD,0x8B0D868B,0x8A0F858A, - 0x70E09070,0x3E7C423E,0xB571C4B5,0x66CCAA66,0x4890D848,0x03060503,0xF6F701F6,0x0E1C120E, - 0x61C2A361,0x356A5F35,0x57AEF957,0xB969D0B9,0x86179186,0xC19958C1,0x1D3A271D,0x9E27B99E, - 0xE1D938E1,0xF8EB13F8,0x982BB398,0x11223311,0x69D2BB69,0xD9A970D9,0x8E07898E,0x9433A794, - 0x9B2DB69B,0x1E3C221E,0x87159287,0xE9C920E9,0xCE8749CE,0x55AAFF55,0x28507828,0xDFA57ADF, - 0x8C038F8C,0xA159F8A1,0x89098089,0x0D1A170D,0xBF65DABF,0xE6D731E6,0x4284C642,0x68D0B868, - 0x4182C341,0x9929B099,0x2D5A772D,0x0F1E110F,0xB07BCBB0,0x54A8FC54,0xBB6DD6BB,0x162C3A16 - }, - { - 0xC6A56363,0xF8847C7C,0xEE997777,0xF68D7B7B,0xFF0DF2F2,0xD6BD6B6B,0xDEB16F6F,0x9154C5C5, - 0x60503030,0x02030101,0xCEA96767,0x567D2B2B,0xE719FEFE,0xB562D7D7,0x4DE6ABAB,0xEC9A7676, - 0x8F45CACA,0x1F9D8282,0x8940C9C9,0xFA877D7D,0xEF15FAFA,0xB2EB5959,0x8EC94747,0xFB0BF0F0, - 0x41ECADAD,0xB367D4D4,0x5FFDA2A2,0x45EAAFAF,0x23BF9C9C,0x53F7A4A4,0xE4967272,0x9B5BC0C0, - 0x75C2B7B7,0xE11CFDFD,0x3DAE9393,0x4C6A2626,0x6C5A3636,0x7E413F3F,0xF502F7F7,0x834FCCCC, - 0x685C3434,0x51F4A5A5,0xD134E5E5,0xF908F1F1,0xE2937171,0xAB73D8D8,0x62533131,0x2A3F1515, - 0x080C0404,0x9552C7C7,0x46652323,0x9D5EC3C3,0x30281818,0x37A19696,0x0A0F0505,0x2FB59A9A, - 0x0E090707,0x24361212,0x1B9B8080,0xDF3DE2E2,0xCD26EBEB,0x4E692727,0x7FCDB2B2,0xEA9F7575, - 0x121B0909,0x1D9E8383,0x58742C2C,0x342E1A1A,0x362D1B1B,0xDCB26E6E,0xB4EE5A5A,0x5BFBA0A0, - 0xA4F65252,0x764D3B3B,0xB761D6D6,0x7DCEB3B3,0x527B2929,0xDD3EE3E3,0x5E712F2F,0x13978484, - 0xA6F55353,0xB968D1D1,0000000000,0xC12CEDED,0x40602020,0xE31FFCFC,0x79C8B1B1,0xB6ED5B5B, - 0xD4BE6A6A,0x8D46CBCB,0x67D9BEBE,0x724B3939,0x94DE4A4A,0x98D44C4C,0xB0E85858,0x854ACFCF, - 0xBB6BD0D0,0xC52AEFEF,0x4FE5AAAA,0xED16FBFB,0x86C54343,0x9AD74D4D,0x66553333,0x11948585, - 0x8ACF4545,0xE910F9F9,0x04060202,0xFE817F7F,0xA0F05050,0x78443C3C,0x25BA9F9F,0x4BE3A8A8, - 0xA2F35151,0x5DFEA3A3,0x80C04040,0x058A8F8F,0x3FAD9292,0x21BC9D9D,0x70483838,0xF104F5F5, - 0x63DFBCBC,0x77C1B6B6,0xAF75DADA,0x42632121,0x20301010,0xE51AFFFF,0xFD0EF3F3,0xBF6DD2D2, - 0x814CCDCD,0x18140C0C,0x26351313,0xC32FECEC,0xBEE15F5F,0x35A29797,0x88CC4444,0x2E391717, - 0x9357C4C4,0x55F2A7A7,0xFC827E7E,0x7A473D3D,0xC8AC6464,0xBAE75D5D,0x322B1919,0xE6957373, - 0xC0A06060,0x19988181,0x9ED14F4F,0xA37FDCDC,0x44662222,0x547E2A2A,0x3BAB9090,0x0B838888, - 0x8CCA4646,0xC729EEEE,0x6BD3B8B8,0x283C1414,0xA779DEDE,0xBCE25E5E,0x161D0B0B,0xAD76DBDB, - 0xDB3BE0E0,0x64563232,0x744E3A3A,0x141E0A0A,0x92DB4949,0x0C0A0606,0x486C2424,0xB8E45C5C, - 0x9F5DC2C2,0xBD6ED3D3,0x43EFACAC,0xC4A66262,0x39A89191,0x31A49595,0xD337E4E4,0xF28B7979, - 0xD532E7E7,0x8B43C8C8,0x6E593737,0xDAB76D6D,0x018C8D8D,0xB164D5D5,0x9CD24E4E,0x49E0A9A9, - 0xD8B46C6C,0xACFA5656,0xF307F4F4,0xCF25EAEA,0xCAAF6565,0xF48E7A7A,0x47E9AEAE,0x10180808, - 0x6FD5BABA,0xF0887878,0x4A6F2525,0x5C722E2E,0x38241C1C,0x57F1A6A6,0x73C7B4B4,0x9751C6C6, - 0xCB23E8E8,0xA17CDDDD,0xE89C7474,0x3E211F1F,0x96DD4B4B,0x61DCBDBD,0x0D868B8B,0x0F858A8A, - 0xE0907070,0x7C423E3E,0x71C4B5B5,0xCCAA6666,0x90D84848,0x06050303,0xF701F6F6,0x1C120E0E, - 0xC2A36161,0x6A5F3535,0xAEF95757,0x69D0B9B9,0x17918686,0x9958C1C1,0x3A271D1D,0x27B99E9E, - 0xD938E1E1,0xEB13F8F8,0x2BB39898,0x22331111,0xD2BB6969,0xA970D9D9,0x07898E8E,0x33A79494, - 0x2DB69B9B,0x3C221E1E,0x15928787,0xC920E9E9,0x8749CECE,0xAAFF5555,0x50782828,0xA57ADFDF, - 0x038F8C8C,0x59F8A1A1,0x09808989,0x1A170D0D,0x65DABFBF,0xD731E6E6,0x84C64242,0xD0B86868, - 0x82C34141,0x29B09999,0x5A772D2D,0x1E110F0F,0x7BCBB0B0,0xA8FC5454,0x6DD6BBBB,0x2C3A1616 - } -}; - -static u32 fl_tab[4][256] = -{ - { - 0x00000063,0x0000007C,0x00000077,0x0000007B,0x000000F2,0x0000006B,0x0000006F,0x000000C5, - 0x00000030,0x00000001,0x00000067,0x0000002B,0x000000FE,0x000000D7,0x000000AB,0x00000076, - 0x000000CA,0x00000082,0x000000C9,0x0000007D,0x000000FA,0x00000059,0x00000047,0x000000F0, - 0x000000AD,0x000000D4,0x000000A2,0x000000AF,0x0000009C,0x000000A4,0x00000072,0x000000C0, - 0x000000B7,0x000000FD,0x00000093,0x00000026,0x00000036,0x0000003F,0x000000F7,0x000000CC, - 0x00000034,0x000000A5,0x000000E5,0x000000F1,0x00000071,0x000000D8,0x00000031,0x00000015, - 0x00000004,0x000000C7,0x00000023,0x000000C3,0x00000018,0x00000096,0x00000005,0x0000009A, - 0x00000007,0x00000012,0x00000080,0x000000E2,0x000000EB,0x00000027,0x000000B2,0x00000075, - 0x00000009,0x00000083,0x0000002C,0x0000001A,0x0000001B,0x0000006E,0x0000005A,0x000000A0, - 0x00000052,0x0000003B,0x000000D6,0x000000B3,0x00000029,0x000000E3,0x0000002F,0x00000084, - 0x00000053,0x000000D1,0x00000000,0x000000ED,0x00000020,0x000000FC,0x000000B1,0x0000005B, - 0x0000006A,0x000000CB,0x000000BE,0x00000039,0x0000004A,0x0000004C,0x00000058,0x000000CF, - 0x000000D0,0x000000EF,0x000000AA,0x000000FB,0x00000043,0x0000004D,0x00000033,0x00000085, - 0x00000045,0x000000F9,0x00000002,0x0000007F,0x00000050,0x0000003C,0x0000009F,0x000000A8, - 0x00000051,0x000000A3,0x00000040,0x0000008F,0x00000092,0x0000009D,0x00000038,0x000000F5, - 0x000000BC,0x000000B6,0x000000DA,0x00000021,0x00000010,0x000000FF,0x000000F3,0x000000D2, - 0x000000CD,0x0000000C,0x00000013,0x000000EC,0x0000005F,0x00000097,0x00000044,0x00000017, - 0x000000C4,0x000000A7,0x0000007E,0x0000003D,0x00000064,0x0000005D,0x00000019,0x00000073, - 0x00000060,0x00000081,0x0000004F,0x000000DC,0x00000022,0x0000002A,0x00000090,0x00000088, - 0x00000046,0x000000EE,0x000000B8,0x00000014,0x000000DE,0x0000005E,0x0000000B,0x000000DB, - 0x000000E0,0x00000032,0x0000003A,0x0000000A,0x00000049,0x00000006,0x00000024,0x0000005C, - 0x000000C2,0x000000D3,0x000000AC,0x00000062,0x00000091,0x00000095,0x000000E4,0x00000079, - 0x000000E7,0x000000C8,0x00000037,0x0000006D,0x0000008D,0x000000D5,0x0000004E,0x000000A9, - 0x0000006C,0x00000056,0x000000F4,0x000000EA,0x00000065,0x0000007A,0x000000AE,0x00000008, - 0x000000BA,0x00000078,0x00000025,0x0000002E,0x0000001C,0x000000A6,0x000000B4,0x000000C6, - 0x000000E8,0x000000DD,0x00000074,0x0000001F,0x0000004B,0x000000BD,0x0000008B,0x0000008A, - 0x00000070,0x0000003E,0x000000B5,0x00000066,0x00000048,0x00000003,0x000000F6,0x0000000E, - 0x00000061,0x00000035,0x00000057,0x000000B9,0x00000086,0x000000C1,0x0000001D,0x0000009E, - 0x000000E1,0x000000F8,0x00000098,0x00000011,0x00000069,0x000000D9,0x0000008E,0x00000094, - 0x0000009B,0x0000001E,0x00000087,0x000000E9,0x000000CE,0x00000055,0x00000028,0x000000DF, - 0x0000008C,0x000000A1,0x00000089,0x0000000D,0x000000BF,0x000000E6,0x00000042,0x00000068, - 0x00000041,0x00000099,0x0000002D,0x0000000F,0x000000B0,0x00000054,0x000000BB,0x00000016 - }, - { - 0x00006300,0x00007C00,0x00007700,0x00007B00,0x0000F200,0x00006B00,0x00006F00,0x0000C500, - 0x00003000,0x00000100,0x00006700,0x00002B00,0x0000FE00,0x0000D700,0x0000AB00,0x00007600, - 0x0000CA00,0x00008200,0x0000C900,0x00007D00,0x0000FA00,0x00005900,0x00004700,0x0000F000, - 0x0000AD00,0x0000D400,0x0000A200,0x0000AF00,0x00009C00,0x0000A400,0x00007200,0x0000C000, - 0x0000B700,0x0000FD00,0x00009300,0x00002600,0x00003600,0x00003F00,0x0000F700,0x0000CC00, - 0x00003400,0x0000A500,0x0000E500,0x0000F100,0x00007100,0x0000D800,0x00003100,0x00001500, - 0x00000400,0x0000C700,0x00002300,0x0000C300,0x00001800,0x00009600,0x00000500,0x00009A00, - 0x00000700,0x00001200,0x00008000,0x0000E200,0x0000EB00,0x00002700,0x0000B200,0x00007500, - 0x00000900,0x00008300,0x00002C00,0x00001A00,0x00001B00,0x00006E00,0x00005A00,0x0000A000, - 0x00005200,0x00003B00,0x0000D600,0x0000B300,0x00002900,0x0000E300,0x00002F00,0x00008400, - 0x00005300,0x0000D100,0000000000,0x0000ED00,0x00002000,0x0000FC00,0x0000B100,0x00005B00, - 0x00006A00,0x0000CB00,0x0000BE00,0x00003900,0x00004A00,0x00004C00,0x00005800,0x0000CF00, - 0x0000D000,0x0000EF00,0x0000AA00,0x0000FB00,0x00004300,0x00004D00,0x00003300,0x00008500, - 0x00004500,0x0000F900,0x00000200,0x00007F00,0x00005000,0x00003C00,0x00009F00,0x0000A800, - 0x00005100,0x0000A300,0x00004000,0x00008F00,0x00009200,0x00009D00,0x00003800,0x0000F500, - 0x0000BC00,0x0000B600,0x0000DA00,0x00002100,0x00001000,0x0000FF00,0x0000F300,0x0000D200, - 0x0000CD00,0x00000C00,0x00001300,0x0000EC00,0x00005F00,0x00009700,0x00004400,0x00001700, - 0x0000C400,0x0000A700,0x00007E00,0x00003D00,0x00006400,0x00005D00,0x00001900,0x00007300, - 0x00006000,0x00008100,0x00004F00,0x0000DC00,0x00002200,0x00002A00,0x00009000,0x00008800, - 0x00004600,0x0000EE00,0x0000B800,0x00001400,0x0000DE00,0x00005E00,0x00000B00,0x0000DB00, - 0x0000E000,0x00003200,0x00003A00,0x00000A00,0x00004900,0x00000600,0x00002400,0x00005C00, - 0x0000C200,0x0000D300,0x0000AC00,0x00006200,0x00009100,0x00009500,0x0000E400,0x00007900, - 0x0000E700,0x0000C800,0x00003700,0x00006D00,0x00008D00,0x0000D500,0x00004E00,0x0000A900, - 0x00006C00,0x00005600,0x0000F400,0x0000EA00,0x00006500,0x00007A00,0x0000AE00,0x00000800, - 0x0000BA00,0x00007800,0x00002500,0x00002E00,0x00001C00,0x0000A600,0x0000B400,0x0000C600, - 0x0000E800,0x0000DD00,0x00007400,0x00001F00,0x00004B00,0x0000BD00,0x00008B00,0x00008A00, - 0x00007000,0x00003E00,0x0000B500,0x00006600,0x00004800,0x00000300,0x0000F600,0x00000E00, - 0x00006100,0x00003500,0x00005700,0x0000B900,0x00008600,0x0000C100,0x00001D00,0x00009E00, - 0x0000E100,0x0000F800,0x00009800,0x00001100,0x00006900,0x0000D900,0x00008E00,0x00009400, - 0x00009B00,0x00001E00,0x00008700,0x0000E900,0x0000CE00,0x00005500,0x00002800,0x0000DF00, - 0x00008C00,0x0000A100,0x00008900,0x00000D00,0x0000BF00,0x0000E600,0x00004200,0x00006800, - 0x00004100,0x00009900,0x00002D00,0x00000F00,0x0000B000,0x00005400,0x0000BB00,0x00001600 - }, - { - 0x00630000,0x007C0000,0x00770000,0x007B0000,0x00F20000,0x006B0000,0x006F0000,0x00C50000, - 0x00300000,0x00010000,0x00670000,0x002B0000,0x00FE0000,0x00D70000,0x00AB0000,0x00760000, - 0x00CA0000,0x00820000,0x00C90000,0x007D0000,0x00FA0000,0x00590000,0x00470000,0x00F00000, - 0x00AD0000,0x00D40000,0x00A20000,0x00AF0000,0x009C0000,0x00A40000,0x00720000,0x00C00000, - 0x00B70000,0x00FD0000,0x00930000,0x00260000,0x00360000,0x003F0000,0x00F70000,0x00CC0000, - 0x00340000,0x00A50000,0x00E50000,0x00F10000,0x00710000,0x00D80000,0x00310000,0x00150000, - 0x00040000,0x00C70000,0x00230000,0x00C30000,0x00180000,0x00960000,0x00050000,0x009A0000, - 0x00070000,0x00120000,0x00800000,0x00E20000,0x00EB0000,0x00270000,0x00B20000,0x00750000, - 0x00090000,0x00830000,0x002C0000,0x001A0000,0x001B0000,0x006E0000,0x005A0000,0x00A00000, - 0x00520000,0x003B0000,0x00D60000,0x00B30000,0x00290000,0x00E30000,0x002F0000,0x00840000, - 0x00530000,0x00D10000,0000000000,0x00ED0000,0x00200000,0x00FC0000,0x00B10000,0x005B0000, - 0x006A0000,0x00CB0000,0x00BE0000,0x00390000,0x004A0000,0x004C0000,0x00580000,0x00CF0000, - 0x00D00000,0x00EF0000,0x00AA0000,0x00FB0000,0x00430000,0x004D0000,0x00330000,0x00850000, - 0x00450000,0x00F90000,0x00020000,0x007F0000,0x00500000,0x003C0000,0x009F0000,0x00A80000, - 0x00510000,0x00A30000,0x00400000,0x008F0000,0x00920000,0x009D0000,0x00380000,0x00F50000, - 0x00BC0000,0x00B60000,0x00DA0000,0x00210000,0x00100000,0x00FF0000,0x00F30000,0x00D20000, - 0x00CD0000,0x000C0000,0x00130000,0x00EC0000,0x005F0000,0x00970000,0x00440000,0x00170000, - 0x00C40000,0x00A70000,0x007E0000,0x003D0000,0x00640000,0x005D0000,0x00190000,0x00730000, - 0x00600000,0x00810000,0x004F0000,0x00DC0000,0x00220000,0x002A0000,0x00900000,0x00880000, - 0x00460000,0x00EE0000,0x00B80000,0x00140000,0x00DE0000,0x005E0000,0x000B0000,0x00DB0000, - 0x00E00000,0x00320000,0x003A0000,0x000A0000,0x00490000,0x00060000,0x00240000,0x005C0000, - 0x00C20000,0x00D30000,0x00AC0000,0x00620000,0x00910000,0x00950000,0x00E40000,0x00790000, - 0x00E70000,0x00C80000,0x00370000,0x006D0000,0x008D0000,0x00D50000,0x004E0000,0x00A90000, - 0x006C0000,0x00560000,0x00F40000,0x00EA0000,0x00650000,0x007A0000,0x00AE0000,0x00080000, - 0x00BA0000,0x00780000,0x00250000,0x002E0000,0x001C0000,0x00A60000,0x00B40000,0x00C60000, - 0x00E80000,0x00DD0000,0x00740000,0x001F0000,0x004B0000,0x00BD0000,0x008B0000,0x008A0000, - 0x00700000,0x003E0000,0x00B50000,0x00660000,0x00480000,0x00030000,0x00F60000,0x000E0000, - 0x00610000,0x00350000,0x00570000,0x00B90000,0x00860000,0x00C10000,0x001D0000,0x009E0000, - 0x00E10000,0x00F80000,0x00980000,0x00110000,0x00690000,0x00D90000,0x008E0000,0x00940000, - 0x009B0000,0x001E0000,0x00870000,0x00E90000,0x00CE0000,0x00550000,0x00280000,0x00DF0000, - 0x008C0000,0x00A10000,0x00890000,0x000D0000,0x00BF0000,0x00E60000,0x00420000,0x00680000, - 0x00410000,0x00990000,0x002D0000,0x000F0000,0x00B00000,0x00540000,0x00BB0000,0x00160000 - }, - { - 0x63000000,0x7C000000,0x77000000,0x7B000000,0xF2000000,0x6B000000,0x6F000000,0xC5000000, - 0x30000000,0x01000000,0x67000000,0x2B000000,0xFE000000,0xD7000000,0xAB000000,0x76000000, - 0xCA000000,0x82000000,0xC9000000,0x7D000000,0xFA000000,0x59000000,0x47000000,0xF0000000, - 0xAD000000,0xD4000000,0xA2000000,0xAF000000,0x9C000000,0xA4000000,0x72000000,0xC0000000, - 0xB7000000,0xFD000000,0x93000000,0x26000000,0x36000000,0x3F000000,0xF7000000,0xCC000000, - 0x34000000,0xA5000000,0xE5000000,0xF1000000,0x71000000,0xD8000000,0x31000000,0x15000000, - 0x04000000,0xC7000000,0x23000000,0xC3000000,0x18000000,0x96000000,0x05000000,0x9A000000, - 0x07000000,0x12000000,0x80000000,0xE2000000,0xEB000000,0x27000000,0xB2000000,0x75000000, - 0x09000000,0x83000000,0x2C000000,0x1A000000,0x1B000000,0x6E000000,0x5A000000,0xA0000000, - 0x52000000,0x3B000000,0xD6000000,0xB3000000,0x29000000,0xE3000000,0x2F000000,0x84000000, - 0x53000000,0xD1000000,0000000000,0xED000000,0x20000000,0xFC000000,0xB1000000,0x5B000000, - 0x6A000000,0xCB000000,0xBE000000,0x39000000,0x4A000000,0x4C000000,0x58000000,0xCF000000, - 0xD0000000,0xEF000000,0xAA000000,0xFB000000,0x43000000,0x4D000000,0x33000000,0x85000000, - 0x45000000,0xF9000000,0x02000000,0x7F000000,0x50000000,0x3C000000,0x9F000000,0xA8000000, - 0x51000000,0xA3000000,0x40000000,0x8F000000,0x92000000,0x9D000000,0x38000000,0xF5000000, - 0xBC000000,0xB6000000,0xDA000000,0x21000000,0x10000000,0xFF000000,0xF3000000,0xD2000000, - 0xCD000000,0x0C000000,0x13000000,0xEC000000,0x5F000000,0x97000000,0x44000000,0x17000000, - 0xC4000000,0xA7000000,0x7E000000,0x3D000000,0x64000000,0x5D000000,0x19000000,0x73000000, - 0x60000000,0x81000000,0x4F000000,0xDC000000,0x22000000,0x2A000000,0x90000000,0x88000000, - 0x46000000,0xEE000000,0xB8000000,0x14000000,0xDE000000,0x5E000000,0x0B000000,0xDB000000, - 0xE0000000,0x32000000,0x3A000000,0x0A000000,0x49000000,0x06000000,0x24000000,0x5C000000, - 0xC2000000,0xD3000000,0xAC000000,0x62000000,0x91000000,0x95000000,0xE4000000,0x79000000, - 0xE7000000,0xC8000000,0x37000000,0x6D000000,0x8D000000,0xD5000000,0x4E000000,0xA9000000, - 0x6C000000,0x56000000,0xF4000000,0xEA000000,0x65000000,0x7A000000,0xAE000000,0x08000000, - 0xBA000000,0x78000000,0x25000000,0x2E000000,0x1C000000,0xA6000000,0xB4000000,0xC6000000, - 0xE8000000,0xDD000000,0x74000000,0x1F000000,0x4B000000,0xBD000000,0x8B000000,0x8A000000, - 0x70000000,0x3E000000,0xB5000000,0x66000000,0x48000000,0x03000000,0xF6000000,0x0E000000, - 0x61000000,0x35000000,0x57000000,0xB9000000,0x86000000,0xC1000000,0x1D000000,0x9E000000, - 0xE1000000,0xF8000000,0x98000000,0x11000000,0x69000000,0xD9000000,0x8E000000,0x94000000, - 0x9B000000,0x1E000000,0x87000000,0xE9000000,0xCE000000,0x55000000,0x28000000,0xDF000000, - 0x8C000000,0xA1000000,0x89000000,0x0D000000,0xBF000000,0xE6000000,0x42000000,0x68000000, - 0x41000000,0x99000000,0x2D000000,0x0F000000,0xB0000000,0x54000000,0xBB000000,0x16000000 - } -}; - -/*----------------- The workspace ------------------------------*/ - -static u32 Ekey[44]; /* The expanded key */ - -/*------ The round Function. 4 table lookups and 4 Exors ------*/ -#define f_rnd(x, n) \ - ( ft_tab[0][byte0(x[n])] \ - ^ ft_tab[1][byte1(x[(n + 1) & 3])] \ - ^ ft_tab[2][byte2(x[(n + 2) & 3])] \ - ^ ft_tab[3][byte3(x[(n + 3) & 3])] ) - -#define f_round(bo, bi, k) \ - bo[0] = f_rnd(bi, 0) ^ k[0]; \ - bo[1] = f_rnd(bi, 1) ^ k[1]; \ - bo[2] = f_rnd(bi, 2) ^ k[2]; \ - bo[3] = f_rnd(bi, 3) ^ k[3]; \ - k += 4 - -/*--- The S Box lookup used in constructing the Key schedule ---*/ -#define ls_box(x) \ - ( fl_tab[0][byte0(x)] \ - ^ fl_tab[1][byte1(x)] \ - ^ fl_tab[2][byte2(x)] \ - ^ fl_tab[3][byte3(x)] ) - -/*------------ The last round function (no MixColumn) ----------*/ -#define lf_rnd(x, n) \ - ( fl_tab[0][byte0(x[n])] \ - ^ fl_tab[1][byte1(x[(n + 1) & 3])] \ - ^ fl_tab[2][byte2(x[(n + 2) & 3])] \ - ^ fl_tab[3][byte3(x[(n + 3) & 3])] ) - - -/*----------------------------------------------------------- - * RijndaelKeySchedule - * Initialise the key schedule from a supplied key - */ -void RijndaelKeySchedule(u8 key[16]) -{ - u32 t; - u32 *ek=Ekey, /* pointer to the expanded key */ - *rc=rnd_con; /* pointer to the round constant */ - - Ekey[0] = u32_in(key ); - Ekey[1] = u32_in(key + 4); - Ekey[2] = u32_in(key + 8); - Ekey[3] = u32_in(key + 12); - - while(ek < Ekey + 40) - { - t = rot3(ek[3]); - ek[4] = ek[0] ^ ls_box(t) ^ *rc++; - ek[5] = ek[1] ^ ek[4]; - ek[6] = ek[2] ^ ek[5]; - ek[7] = ek[3] ^ ek[6]; - ek += 4; - } -} - -/*----------------------------------------------------------- - * RijndaelEncrypt - * Encrypt an input block - */ -void RijndaelEncrypt(u8 in[16], u8 out[16]) -{ - u32 b0[4], b1[4], *kp = Ekey; - - b0[0] = u32_in(in ) ^ *kp++; - b0[1] = u32_in(in + 4) ^ *kp++; - b0[2] = u32_in(in + 8) ^ *kp++; - b0[3] = u32_in(in + 12) ^ *kp++; - - f_round(b1, b0, kp); - f_round(b0, b1, kp); - f_round(b1, b0, kp); - f_round(b0, b1, kp); - f_round(b1, b0, kp); - f_round(b0, b1, kp); - f_round(b1, b0, kp); - f_round(b0, b1, kp); - f_round(b1, b0, kp); - - u32_out(out, lf_rnd(b1, 0) ^ kp[0]); - u32_out(out + 4, lf_rnd(b1, 1) ^ kp[1]); - u32_out(out + 8, lf_rnd(b1, 2) ^ kp[2]); - u32_out(out + 12, lf_rnd(b1, 3) ^ kp[3]); -} diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/milenage/rijndael.h b/sflphone-common/libs/pjproject-1.0.1/third_party/milenage/rijndael.h deleted file mode 100644 index 4e728a5b3e7c77d4e492e2c90e551ffbccd15dd2..0000000000000000000000000000000000000000 --- a/sflphone-common/libs/pjproject-1.0.1/third_party/milenage/rijndael.h +++ /dev/null @@ -1,26 +0,0 @@ -/*------------------------------------------------------------------- - * Example algorithms f1, f1*, f2, f3, f4, f5, f5* - *------------------------------------------------------------------- - * - * A sample implementation of the example 3GPP authentication and - * key agreement functions f1, f1*, f2, f3, f4, f5 and f5*. This is - * a byte-oriented implementation of the functions, and of the block - * cipher kernel function Rijndael. - * - * This has been coded for clarity, not necessarily for efficiency. - * - * The functions f2, f3, f4 and f5 share the same inputs and have - * been coded together as a single function. f1, f1* and f5* are - * all coded separately. - * - *-----------------------------------------------------------------*/ - -#ifndef RIJNDAEL_H -#define RIJNDAEL_H - - -void RijndaelKeySchedule( u8 key[16] ); -void RijndaelEncrypt( u8 input[16], u8 output[16] ); - - -#endif diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/hostapi/wasapi/pa_win_wasapi.cpp b/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/hostapi/wasapi/pa_win_wasapi.cpp deleted file mode 100644 index f13a7f230296c87f606ec1f7505bde967afc1543..0000000000000000000000000000000000000000 --- a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/hostapi/wasapi/pa_win_wasapi.cpp +++ /dev/null @@ -1,1911 +0,0 @@ -/* - * Portable Audio I/O Library WASAPI implementation - * Copyright (c) 2006-2007 David Viens - * - * Based on the Open Source API proposed by Ross Bencina - * Copyright (c) 1999-2002 Ross Bencina, Phil Burk - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files - * (the "Software"), to deal in the Software without restriction, - * including without limitation the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, - * and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR - * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/* - * The text above constitutes the entire PortAudio license; however, - * the PortAudio community also makes the following non-binding requests: - * - * Any person wishing to distribute modifications to the Software is - * requested to send the modifications to the original developer so that - * they can be incorporated into the canonical version. It is also - * requested that these non-binding requests be included along with the - * license above. - */ - -/** @file - @ingroup hostapi_src - @brief WASAPI implementation of support for a host API. - - @note pa_wasapi currently requires VC 2005, and the latest Vista SDK -*/ - -#if _MSC_VER >= 1400 -#include <windows.h> -#include <MMReg.h> //must be before other Wasapi headers -#include <strsafe.h> -#include <mmdeviceapi.h> -#include <Avrt.h> -#include <audioclient.h> -#include <Endpointvolume.h> - -#include <KsMedia.h> -#include <functiondiscoverykeys.h> // PKEY_Device_FriendlyName -#endif - -#include "pa_util.h" -#include "pa_allocation.h" -#include "pa_hostapi.h" -#include "pa_stream.h" -#include "pa_cpuload.h" -#include "pa_process.h" -#include "pa_debugprint.h" - - -/* - davidv : work in progress. try using with 48000 , then 44100 - and shared mode FIRST. - */ - -#define PORTAUDIO_SHAREMODE AUDCLNT_SHAREMODE_SHARED -//#define PORTAUDIO_SHAREMODE AUDCLNT_SHAREMODE_EXCLUSIVE - - - -/* prototypes for functions declared in this file */ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -PaError PaWinWasapi_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex index ); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - - - - -static void Terminate( struct PaUtilHostApiRepresentation *hostApi ); -static PaError IsFormatSupported( struct PaUtilHostApiRepresentation *hostApi, - const PaStreamParameters *inputParameters, - const PaStreamParameters *outputParameters, - double sampleRate ); -static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi, - PaStream** s, - const PaStreamParameters *inputParameters, - const PaStreamParameters *outputParameters, - double sampleRate, - unsigned long framesPerBuffer, - PaStreamFlags streamFlags, - PaStreamCallback *streamCallback, - void *userData ); -static PaError CloseStream( PaStream* stream ); -static PaError StartStream( PaStream *stream ); -static PaError StopStream( PaStream *stream ); -static PaError AbortStream( PaStream *stream ); -static PaError IsStreamStopped( PaStream *s ); -static PaError IsStreamActive( PaStream *stream ); -static PaTime GetStreamTime( PaStream *stream ); -static double GetStreamCpuLoad( PaStream* stream ); -static PaError ReadStream( PaStream* stream, void *buffer, unsigned long frames ); -static PaError WriteStream( PaStream* stream, const void *buffer, unsigned long frames ); -static signed long GetStreamReadAvailable( PaStream* stream ); -static signed long GetStreamWriteAvailable( PaStream* stream ); - - -/* IMPLEMENT ME: a macro like the following one should be used for reporting - host errors */ -#define PA_SKELETON_SET_LAST_HOST_ERROR( errorCode, errorText ) \ - PaUtil_SetLastHostErrorInfo( paInDevelopment, errorCode, errorText ) - -/* PaWinWasapiHostApiRepresentation - host api datastructure specific to this implementation */ - - - -//dummy entry point for other compilers and sdks -//currently built using RC1 SDK (5600) -#if _MSC_VER < 1400 - -PaError PaWinWasapi_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex hostApiIndex ){ - return paNoError; -} - -#else - - - - -#define MAX_STR_LEN 512 - -/* - These are fields that can be gathered from IDevice - and IAudioDevice PRIOR to Initialize, and done in first pass - i assume that neither of these will cause the Driver to "load", - but again, who knows how they implement their stuff - */ -typedef struct PaWinWasapiDeviceInfo -{ - //hmm is it wise to keep a reference until Terminate? - //TODO Check if that interface requires the driver to be loaded! - IMMDevice * device; - - //Fields filled from IDevice - //from GetId - WCHAR szDeviceID[MAX_STR_LEN]; - //from GetState - DWORD state; - - //Fields filled from IMMEndpoint'sGetDataFlow - EDataFlow flow; - - //Fields filled from IAudioDevice (_prior_ to Initialize) - //from GetDevicePeriod( - REFERENCE_TIME DefaultDevicePeriod; - REFERENCE_TIME MinimumDevicePeriod; - //from GetMixFormat - WAVEFORMATEX *MixFormat;//needs to be CoTaskMemFree'd after use! - -} PaWinWasapiDeviceInfo; - - -typedef struct -{ - PaUtilHostApiRepresentation inheritedHostApiRep; - PaUtilStreamInterface callbackStreamInterface; - PaUtilStreamInterface blockingStreamInterface; - - PaUtilAllocationGroup *allocations; - - /* implementation specific data goes here */ - - //in case we later need the synch - IMMDeviceEnumerator * enumerator; - - //this is the REAL number of devices, whether they are usefull to PA or not! - UINT deviceCount; - - WCHAR defaultRenderer [MAX_STR_LEN]; - WCHAR defaultCapturer [MAX_STR_LEN]; - - PaWinWasapiDeviceInfo *devInfo; -}PaWinWasapiHostApiRepresentation; - - -/* PaWinWasapiStream - a stream data structure specifically for this implementation */ - -typedef struct PaWinWasapiSubStream{ - IAudioClient *client; - WAVEFORMATEXTENSIBLE wavex; - UINT32 bufferSize; - REFERENCE_TIME latency; - REFERENCE_TIME period; - unsigned long framesPerHostCallback; /* just an example */ -}PaWinWasapiSubStream; - -typedef struct PaWinWasapiStream -{ /* IMPLEMENT ME: rename this */ - PaUtilStreamRepresentation streamRepresentation; - PaUtilCpuLoadMeasurer cpuLoadMeasurer; - PaUtilBufferProcessor bufferProcessor; - - /* IMPLEMENT ME: - - implementation specific data goes here - */ - - - //input - PaWinWasapiSubStream in; - IAudioCaptureClient *cclient; - IAudioEndpointVolume *inVol; - //output - PaWinWasapiSubStream out; - IAudioRenderClient *rclient; - IAudioEndpointVolume *outVol; - - bool running; - bool closeRequest; - - DWORD dwThreadId; - HANDLE hThread; - HANDLE hNotificationEvent; - - GUID session; - -}PaWinWasapiStream; - -#define PRINT(x) PA_DEBUG(x); - -void -logAUDCLNT_E(HRESULT res){ - - char *text = 0; - switch(res){ - case S_OK: return; break; - case E_POINTER :text ="E_POINTER"; break; - case E_INVALIDARG :text ="E_INVALIDARG"; break; - - case AUDCLNT_E_NOT_INITIALIZED :text ="AUDCLNT_E_NOT_INITIALIZED"; break; - case AUDCLNT_E_ALREADY_INITIALIZED :text ="AUDCLNT_E_ALREADY_INITIALIZED"; break; - case AUDCLNT_E_WRONG_ENDPOINT_TYPE :text ="AUDCLNT_E_WRONG_ENDPOINT_TYPE"; break; - case AUDCLNT_E_DEVICE_INVALIDATED :text ="AUDCLNT_E_DEVICE_INVALIDATED"; break; - case AUDCLNT_E_NOT_STOPPED :text ="AUDCLNT_E_NOT_STOPPED"; break; - case AUDCLNT_E_BUFFER_TOO_LARGE :text ="AUDCLNT_E_BUFFER_TOO_LARGE"; break; - case AUDCLNT_E_OUT_OF_ORDER :text ="AUDCLNT_E_OUT_OF_ORDER"; break; - case AUDCLNT_E_UNSUPPORTED_FORMAT :text ="AUDCLNT_E_UNSUPPORTED_FORMAT"; break; - case AUDCLNT_E_INVALID_SIZE :text ="AUDCLNT_E_INVALID_SIZE"; break; - case AUDCLNT_E_DEVICE_IN_USE :text ="AUDCLNT_E_DEVICE_IN_USE"; break; - case AUDCLNT_E_BUFFER_OPERATION_PENDING :text ="AUDCLNT_E_BUFFER_OPERATION_PENDING"; break; - case AUDCLNT_E_THREAD_NOT_REGISTERED :text ="AUDCLNT_E_THREAD_NOT_REGISTERED"; break; - case AUDCLNT_E_EXCLUSIVE_MODE_NOT_ALLOWED :text ="AUDCLNT_E_EXCLUSIVE_MODE_NOT_ALLOWED"; break; - case AUDCLNT_E_ENDPOINT_CREATE_FAILED :text ="AUDCLNT_E_ENDPOINT_CREATE_FAILED"; break; - case AUDCLNT_E_SERVICE_NOT_RUNNING :text ="AUDCLNT_E_SERVICE_NOT_RUNNING"; break; - // case AUDCLNT_E_CPUUSAGE_EXCEEDED :text ="AUDCLNT_E_CPUUSAGE_EXCEEDED"; break; - //Header error? - case AUDCLNT_E_EVENTHANDLE_NOT_EXPECTED :text ="AUDCLNT_E_EVENTHANDLE_NOT_EXPECTED"; break; - case AUDCLNT_E_EXCLUSIVE_MODE_ONLY :text ="AUDCLNT_E_EXCLUSIVE_MODE_ONLY"; break; - case AUDCLNT_E_BUFDURATION_PERIOD_NOT_EQUAL :text ="AUDCLNT_E_BUFDURATION_PERIOD_NOT_EQUAL"; break; - case AUDCLNT_E_EVENTHANDLE_NOT_SET :text ="AUDCLNT_E_EVENTHANDLE_NOT_SET"; break; - case AUDCLNT_E_INCORRECT_BUFFER_SIZE :text ="AUDCLNT_E_INCORRECT_BUFFER_SIZE"; break; - case AUDCLNT_E_BUFFER_SIZE_ERROR :text ="AUDCLNT_E_BUFFER_SIZE_ERROR"; break; - case AUDCLNT_S_BUFFER_EMPTY :text ="AUDCLNT_S_BUFFER_EMPTY"; break; - case AUDCLNT_S_THREAD_ALREADY_REGISTERED :text ="AUDCLNT_S_THREAD_ALREADY_REGISTERED"; break; - default: - text =" dunno!"; - return ; - break; - - } - PRINT(("WASAPI ERROR HRESULT: 0x%X : %s\n",res,text)); -} - -inline double -nano100ToMillis(const REFERENCE_TIME &ref){ - // 1 nano = 0.000000001 seconds - //100 nano = 0.0000001 seconds - //100 nano = 0.0001 milliseconds - return ((double)ref)*0.0001; -} - -inline double -nano100ToSeconds(const REFERENCE_TIME &ref){ - // 1 nano = 0.000000001 seconds - //100 nano = 0.0000001 seconds - //100 nano = 0.0001 milliseconds - return ((double)ref)*0.0000001; -} - -#ifndef IF_FAILED_JUMP -#define IF_FAILED_JUMP(hr, label) if(FAILED(hr)) goto label; -#endif - - - -//AVRT is the new "multimedia schedulling stuff" - -typedef BOOL (WINAPI *FAvRtCreateThreadOrderingGroup) (PHANDLE,PLARGE_INTEGER,GUID*,PLARGE_INTEGER); -typedef BOOL (WINAPI *FAvRtDeleteThreadOrderingGroup) (HANDLE); -typedef BOOL (WINAPI *FAvRtWaitOnThreadOrderingGroup) (HANDLE); -typedef HANDLE (WINAPI *FAvSetMmThreadCharacteristics) (LPCTSTR,LPDWORD); -typedef BOOL (WINAPI *FAvSetMmThreadPriority) (HANDLE,AVRT_PRIORITY); - -HMODULE hDInputDLL = 0; -FAvRtCreateThreadOrderingGroup pAvRtCreateThreadOrderingGroup=0; -FAvRtDeleteThreadOrderingGroup pAvRtDeleteThreadOrderingGroup=0; -FAvRtWaitOnThreadOrderingGroup pAvRtWaitOnThreadOrderingGroup=0; -FAvSetMmThreadCharacteristics pAvSetMmThreadCharacteristics=0; -FAvSetMmThreadPriority pAvSetMmThreadPriority=0; - - - -#define setupPTR(fun, type, name) { \ - fun = (type) GetProcAddress(hDInputDLL,name); \ - if(fun == NULL) { \ - PRINT(("GetProcAddr failed for %s" ,name)); \ - return false; \ - } \ - } \ - -bool -setupAVRT(){ - - hDInputDLL = LoadLibraryA("avrt.dll"); - if(hDInputDLL == NULL) - return false; - - setupPTR(pAvRtCreateThreadOrderingGroup, FAvRtCreateThreadOrderingGroup, "AvRtCreateThreadOrderingGroup"); - setupPTR(pAvRtDeleteThreadOrderingGroup, FAvRtDeleteThreadOrderingGroup, "AvRtDeleteThreadOrderingGroup"); - setupPTR(pAvRtWaitOnThreadOrderingGroup, FAvRtWaitOnThreadOrderingGroup, "AvRtWaitOnThreadOrderingGroup"); - setupPTR(pAvSetMmThreadCharacteristics, FAvSetMmThreadCharacteristics, "AvSetMmThreadCharacteristicsA"); - setupPTR(pAvSetMmThreadPriority, FAvSetMmThreadPriority, "AvSetMmThreadPriority"); - - return true; -} - - - -PaError PaWinWasapi_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex hostApiIndex ) -{ - if (!setupAVRT()){ - PRINT(("Windows WASAPI : No AVRT! (not VISTA?)")); - return paNoError; - } - - CoInitialize(NULL); - - PaError result = paNoError; - PaWinWasapiHostApiRepresentation *paWasapi; - PaDeviceInfo *deviceInfoArray; - - paWasapi = (PaWinWasapiHostApiRepresentation*)PaUtil_AllocateMemory( sizeof(PaWinWasapiHostApiRepresentation) ); - if( !paWasapi ){ - result = paInsufficientMemory; - goto error; - } - - paWasapi->allocations = PaUtil_CreateAllocationGroup(); - if( !paWasapi->allocations ){ - result = paInsufficientMemory; - goto error; - } - - *hostApi = &paWasapi->inheritedHostApiRep; - (*hostApi)->info.structVersion = 1; - (*hostApi)->info.type = paWASAPI; - (*hostApi)->info.name = "Windows WASAPI"; - (*hostApi)->info.deviceCount = 0; //so far, we must investigate each - (*hostApi)->info.defaultInputDevice = paNoDevice; /* IMPLEMENT ME */ - (*hostApi)->info.defaultOutputDevice = paNoDevice; /* IMPLEMENT ME */ - - - HRESULT hResult = S_OK; - IMMDeviceCollection* spEndpoints=0; - paWasapi->enumerator = 0; - - hResult = CoCreateInstance( - __uuidof(MMDeviceEnumerator), NULL,CLSCTX_INPROC_SERVER, - __uuidof(IMMDeviceEnumerator), - (void**)&paWasapi->enumerator); - - IF_FAILED_JUMP(hResult, error); - - //getting default device ids in the eMultimedia "role" - { - { - IMMDevice* defaultRenderer=0; - hResult = paWasapi->enumerator->GetDefaultAudioEndpoint(eRender, eMultimedia, &defaultRenderer); - IF_FAILED_JUMP(hResult, error); - WCHAR* pszDeviceId = NULL; - hResult = defaultRenderer->GetId(&pszDeviceId); - IF_FAILED_JUMP(hResult, error); - StringCchCopyW(paWasapi->defaultRenderer, MAX_STR_LEN-1, pszDeviceId); - CoTaskMemFree(pszDeviceId); - defaultRenderer->Release(); - } - - { - IMMDevice* defaultCapturer=0; - hResult = paWasapi->enumerator->GetDefaultAudioEndpoint(eCapture, eMultimedia, &defaultCapturer); - IF_FAILED_JUMP(hResult, error); - WCHAR* pszDeviceId = NULL; - hResult = defaultCapturer->GetId(&pszDeviceId); - IF_FAILED_JUMP(hResult, error); - StringCchCopyW(paWasapi->defaultCapturer, MAX_STR_LEN-1, pszDeviceId); - CoTaskMemFree(pszDeviceId); - defaultCapturer->Release(); - } - } - - - hResult = paWasapi->enumerator->EnumAudioEndpoints(eAll, DEVICE_STATE_ACTIVE, &spEndpoints); - IF_FAILED_JUMP(hResult, error); - - hResult = spEndpoints->GetCount(&paWasapi->deviceCount); - IF_FAILED_JUMP(hResult, error); - - paWasapi->devInfo = new PaWinWasapiDeviceInfo[paWasapi->deviceCount]; - { - for (size_t step=0;step<paWasapi->deviceCount;++step) - memset(&paWasapi->devInfo[step],0,sizeof(PaWinWasapiDeviceInfo)); - } - - - - if( paWasapi->deviceCount > 0 ) - { - (*hostApi)->deviceInfos = (PaDeviceInfo**)PaUtil_GroupAllocateMemory( - paWasapi->allocations, sizeof(PaDeviceInfo*) * paWasapi->deviceCount ); - if( !(*hostApi)->deviceInfos ){ - result = paInsufficientMemory; - goto error; - } - - /* allocate all device info structs in a contiguous block */ - deviceInfoArray = (PaDeviceInfo*)PaUtil_GroupAllocateMemory( - paWasapi->allocations, sizeof(PaDeviceInfo) * paWasapi->deviceCount ); - if( !deviceInfoArray ){ - result = paInsufficientMemory; - goto error; - } - - for( UINT i=0; i < paWasapi->deviceCount; ++i ){ - - PA_DEBUG(("i:%d\n",i)); - PaDeviceInfo *deviceInfo = &deviceInfoArray[i]; - deviceInfo->structVersion = 2; - deviceInfo->hostApi = hostApiIndex; - - hResult = spEndpoints->Item(i, &paWasapi->devInfo[i].device); - IF_FAILED_JUMP(hResult, error); - - //getting ID - { - WCHAR* pszDeviceId = NULL; - hResult = paWasapi->devInfo[i].device->GetId(&pszDeviceId); - IF_FAILED_JUMP(hResult, error); - StringCchCopyW(paWasapi->devInfo[i].szDeviceID, MAX_STR_LEN-1, pszDeviceId); - CoTaskMemFree(pszDeviceId); - - if (lstrcmpW(paWasapi->devInfo[i].szDeviceID, paWasapi->defaultCapturer)==0){ - //we found the default input! - (*hostApi)->info.defaultInputDevice = (*hostApi)->info.deviceCount; - } - if (lstrcmpW(paWasapi->devInfo[i].szDeviceID, paWasapi->defaultRenderer)==0){ - //we found the default output! - (*hostApi)->info.defaultOutputDevice = (*hostApi)->info.deviceCount; - } - } - - DWORD state=0; - hResult = paWasapi->devInfo[i].device->GetState(&paWasapi->devInfo[i].state); - IF_FAILED_JUMP(hResult, error); - - if (paWasapi->devInfo[i].state != DEVICE_STATE_ACTIVE){ - PRINT(("WASAPI device:%d is not currently available (state:%d)\n",i,state)); - //spDevice->Release(); - //continue; - } - - { - IPropertyStore* spProperties; - hResult = paWasapi->devInfo[i].device->OpenPropertyStore(STGM_READ, &spProperties); - IF_FAILED_JUMP(hResult, error); - - //getting "Friendly" Name - { - PROPVARIANT value; - PropVariantInit(&value); - hResult = spProperties->GetValue(PKEY_Device_FriendlyName, &value); - IF_FAILED_JUMP(hResult, error); - deviceInfo->name = 0; - char* deviceName = (char*)PaUtil_GroupAllocateMemory( paWasapi->allocations, MAX_STR_LEN + 1 ); - if( !deviceName ){ - result = paInsufficientMemory; - goto error; - } - if (value.pwszVal) - wcstombs(deviceName, value.pwszVal,MAX_STR_LEN-1); //todo proper size - else{ - sprintf(deviceName,"baddev%d",i); - } - - deviceInfo->name = deviceName; - PropVariantClear(&value); - } - -#if 0 - DWORD numProps = 0; - hResult = spProperties->GetCount(&numProps); - IF_FAILED_JUMP(hResult, error); - { - for (DWORD i=0;i<numProps;++i){ - PROPERTYKEY pkey; - hResult = spProperties->GetAt(i,&pkey); - - PROPVARIANT value; - PropVariantInit(&value); - hResult = spProperties->GetValue(pkey, &value); - - switch(value.vt){ - case 11: - PRINT(("property*%u*\n",value.ulVal)); - break; - case 19: - PRINT(("property*%d*\n",value.boolVal)); - break; - case 31: - { - char temp[512]; - wcstombs(temp, value.pwszVal,MAX_STR_LEN-1); - PRINT(("property*%s*\n",temp)); - } - break; - default:break; - } - - PropVariantClear(&value); - } - } -#endif - - /* These look interresting... but they are undocumented - PKEY_AudioEndpoint_FormFactor - PKEY_AudioEndpoint_ControlPanelPageProvider - PKEY_AudioEndpoint_Association - PKEY_AudioEndpoint_PhysicalSpeakerConfig - PKEY_AudioEngine_DeviceFormat - */ - spProperties->Release(); - } - - - //getting the Endpoint data - { - IMMEndpoint *endpoint=0; - hResult = paWasapi->devInfo[i].device->QueryInterface(__uuidof(IMMEndpoint),(void **)&endpoint); - if (SUCCEEDED(hResult)){ - hResult = endpoint->GetDataFlow(&paWasapi->devInfo[i].flow); - endpoint->Release(); - } - } - - //Getting a temporary IAudioDevice for more fields - //we make sure NOT to call Initialize yet! - { - IAudioClient *myClient=0; - - hResult = paWasapi->devInfo[i].device->Activate(__uuidof(IAudioClient), CLSCTX_INPROC_SERVER, NULL, (void**)&myClient); - IF_FAILED_JUMP(hResult, error); - - hResult = myClient->GetDevicePeriod( - &paWasapi->devInfo[i].DefaultDevicePeriod, - &paWasapi->devInfo[i].MinimumDevicePeriod); - IF_FAILED_JUMP(hResult, error); - - hResult = myClient->GetMixFormat(&paWasapi->devInfo[i].MixFormat); - - if (hResult != S_OK){ - /*davidv: this happened with my hardware, previously for that same device in DirectSound: - Digital Output (Realtek AC'97 Audio)'s GUID: {0x38f2cf50,0x7b4c,0x4740,0x86,0xeb,0xd4,0x38,0x66,0xd8,0xc8, 0x9f} - so something must be _really_ wrong with this device, TODO handle this better. We kind of need GetMixFormat*/ - logAUDCLNT_E(hResult); - goto error; - } - - myClient->Release(); - } - - //we can now fill in portaudio device data - deviceInfo->maxInputChannels = 0; //for now - deviceInfo->maxOutputChannels = 0; //for now - - switch(paWasapi->devInfo[i].flow){ - case eRender: - //hum not exaclty maximum, more like "default" - deviceInfo->maxOutputChannels = paWasapi->devInfo[i].MixFormat->nChannels; - - deviceInfo->defaultHighOutputLatency = nano100ToSeconds(paWasapi->devInfo[i].DefaultDevicePeriod); - deviceInfo->defaultLowOutputLatency = nano100ToSeconds(paWasapi->devInfo[i].MinimumDevicePeriod); - break; - case eCapture: - //hum not exaclty maximum, more like "default" - deviceInfo->maxInputChannels = paWasapi->devInfo[i].MixFormat->nChannels; - - deviceInfo->defaultHighInputLatency = nano100ToSeconds(paWasapi->devInfo[i].DefaultDevicePeriod); - deviceInfo->defaultLowInputLatency = nano100ToSeconds(paWasapi->devInfo[i].MinimumDevicePeriod); - break; - default: - PRINT(("WASAPI device:%d bad Data FLow! \n",i)); - goto error; - break; - } - - deviceInfo->defaultSampleRate = (double)paWasapi->devInfo[i].MixFormat->nSamplesPerSec; - - (*hostApi)->deviceInfos[i] = deviceInfo; - ++(*hostApi)->info.deviceCount; - } - } - - spEndpoints->Release(); - - (*hostApi)->Terminate = Terminate; - (*hostApi)->OpenStream = OpenStream; - (*hostApi)->IsFormatSupported = IsFormatSupported; - - PaUtil_InitializeStreamInterface( &paWasapi->callbackStreamInterface, CloseStream, StartStream, - StopStream, AbortStream, IsStreamStopped, IsStreamActive, - GetStreamTime, GetStreamCpuLoad, - PaUtil_DummyRead, PaUtil_DummyWrite, - PaUtil_DummyGetReadAvailable, PaUtil_DummyGetWriteAvailable ); - - PaUtil_InitializeStreamInterface( &paWasapi->blockingStreamInterface, CloseStream, StartStream, - StopStream, AbortStream, IsStreamStopped, IsStreamActive, - GetStreamTime, PaUtil_DummyGetCpuLoad, - ReadStream, WriteStream, GetStreamReadAvailable, GetStreamWriteAvailable ); - - return result; - -error: - - if (spEndpoints) - spEndpoints->Release(); - - if (paWasapi->enumerator) - paWasapi->enumerator->Release(); - - if( paWasapi ) - { - if( paWasapi->allocations ) - { - PaUtil_FreeAllAllocations( paWasapi->allocations ); - PaUtil_DestroyAllocationGroup( paWasapi->allocations ); - } - - PaUtil_FreeMemory( paWasapi ); - } - return result; -} - - -static void Terminate( struct PaUtilHostApiRepresentation *hostApi ) -{ - PaWinWasapiHostApiRepresentation *paWasapi = (PaWinWasapiHostApiRepresentation*)hostApi; - - paWasapi->enumerator->Release(); - - for (UINT i=0;i<paWasapi->deviceCount;++i){ - PaWinWasapiDeviceInfo *info = &paWasapi->devInfo[i]; - - if (info->device) - info->device->Release(); - - if (info->MixFormat) - CoTaskMemFree(info->MixFormat); - } - delete [] paWasapi->devInfo; - - CoUninitialize(); - - if( paWasapi->allocations ){ - PaUtil_FreeAllAllocations( paWasapi->allocations ); - PaUtil_DestroyAllocationGroup( paWasapi->allocations ); - } - - PaUtil_FreeMemory( paWasapi ); -} - -static void -LogWAVEFORMATEXTENSIBLE(const WAVEFORMATEXTENSIBLE *in){ - - const WAVEFORMATEX *old = (WAVEFORMATEX *)in; - - switch (old->wFormatTag){ - case WAVE_FORMAT_EXTENSIBLE:{ - - PRINT(("wFormatTag=WAVE_FORMAT_EXTENSIBLE\n")); - - if (in->SubFormat == KSDATAFORMAT_SUBTYPE_IEEE_FLOAT){ - PRINT(("SubFormat=KSDATAFORMAT_SUBTYPE_IEEE_FLOAT\n")); - } - else if (in->SubFormat == KSDATAFORMAT_SUBTYPE_PCM){ - PRINT(("SubFormat=KSDATAFORMAT_SUBTYPE_PCM\n")); - } - else{ - PRINT(("SubFormat=CUSTOM GUID{%d:%d:%d:%d%d%d%d%d%d%d%d}\n", - in->SubFormat.Data1, - in->SubFormat.Data2, - in->SubFormat.Data3, - (int)in->SubFormat.Data4[0], - (int)in->SubFormat.Data4[1], - (int)in->SubFormat.Data4[2], - (int)in->SubFormat.Data4[3], - (int)in->SubFormat.Data4[4], - (int)in->SubFormat.Data4[5], - (int)in->SubFormat.Data4[6], - (int)in->SubFormat.Data4[7])); - } - PRINT(("Samples.wValidBitsPerSample=%d\n", in->Samples.wValidBitsPerSample)); - PRINT(("dwChannelMask=0x%X\n",in->dwChannelMask)); - }break; - - case WAVE_FORMAT_PCM: PRINT(("wFormatTag=WAVE_FORMAT_PCM\n")); break; - case WAVE_FORMAT_IEEE_FLOAT: PRINT(("wFormatTag=WAVE_FORMAT_IEEE_FLOAT\n")); break; - default : PRINT(("wFormatTag=UNKNOWN(%d)\n",old->wFormatTag)); break; - } - - PRINT(("nChannels =%d\n",old->nChannels)); - PRINT(("nSamplesPerSec =%d\n",old->nSamplesPerSec)); - PRINT(("nAvgBytesPerSec=%d\n",old->nAvgBytesPerSec)); - PRINT(("nBlockAlign =%d\n",old->nBlockAlign)); - PRINT(("wBitsPerSample =%d\n",old->wBitsPerSample)); - PRINT(("cbSize =%d\n",old->cbSize)); -} - - - -/* - WAVEFORMATXXX is always interleaved - */ -static PaSampleFormat -waveformatToPaFormat(const WAVEFORMATEXTENSIBLE *in){ - - const WAVEFORMATEX *old = (WAVEFORMATEX*)in; - - switch (old->wFormatTag){ - - case WAVE_FORMAT_EXTENSIBLE: - { - if (in->SubFormat == KSDATAFORMAT_SUBTYPE_IEEE_FLOAT){ - if (in->Samples.wValidBitsPerSample == 32) - return paFloat32; - else - return paCustomFormat; - } - else if (in->SubFormat == KSDATAFORMAT_SUBTYPE_PCM){ - switch (old->wBitsPerSample){ - case 32: return paInt32; break; - case 24: return paInt24;break; - case 8: return paUInt8;break; - case 16: return paInt16;break; - default: return paCustomFormat;break; - } - } - else - return paCustomFormat; - } - break; - - case WAVE_FORMAT_IEEE_FLOAT: - return paFloat32; - break; - - case WAVE_FORMAT_PCM: - { - switch (old->wBitsPerSample){ - case 32: return paInt32; break; - case 24: return paInt24;break; - case 8: return paUInt8;break; - case 16: return paInt16;break; - default: return paCustomFormat;break; - } - } - break; - - default: - return paCustomFormat; - break; - } - - return paCustomFormat; -} - - - -static PaError -waveformatFromParams(WAVEFORMATEXTENSIBLE*wavex, - const PaStreamParameters * params, - double sampleRate){ - - size_t bytesPerSample = 0; - switch( params->sampleFormat & ~paNonInterleaved ){ - case paFloat32: - case paInt32: bytesPerSample=4;break; - case paInt16: bytesPerSample=2;break; - case paInt24: bytesPerSample=3;break; - case paInt8: - case paUInt8: bytesPerSample=1;break; - case paCustomFormat: - default: return paSampleFormatNotSupported;break; - } - - memset(wavex,0,sizeof(WAVEFORMATEXTENSIBLE)); - - WAVEFORMATEX *old = (WAVEFORMATEX *)wavex; - old->nChannels = (WORD)params->channelCount; - old->nSamplesPerSec = (DWORD)sampleRate; - old->wBitsPerSample = (WORD)(bytesPerSample*8); - old->nAvgBytesPerSec = (DWORD)(old->nSamplesPerSec * old->nChannels * bytesPerSample); - old->nBlockAlign = (WORD)(old->nChannels * bytesPerSample); - - //WAVEFORMATEX - if (params->channelCount <=2 && (bytesPerSample == 2 || bytesPerSample == 1)){ - old->cbSize = 0; - old->wFormatTag = WAVE_FORMAT_PCM; - } - //WAVEFORMATEXTENSIBLE - else{ - old->wFormatTag = WAVE_FORMAT_EXTENSIBLE; - - old->cbSize = sizeof (WAVEFORMATEXTENSIBLE) - sizeof (WAVEFORMATEX); - - if ((params->sampleFormat & ~paNonInterleaved) == paFloat32) - wavex->SubFormat = KSDATAFORMAT_SUBTYPE_IEEE_FLOAT; - else - wavex->SubFormat = KSDATAFORMAT_SUBTYPE_PCM; - - wavex->Samples.wValidBitsPerSample = old->wBitsPerSample; //no extra padding! - - switch(params->channelCount){ - case 1: wavex->dwChannelMask = SPEAKER_FRONT_CENTER; break; - case 2: wavex->dwChannelMask = 0x1 | 0x2; break; - case 4: wavex->dwChannelMask = 0x1 | 0x2 | 0x10 | 0x20; break; - case 6: wavex->dwChannelMask = 0x1 | 0x2 | 0x4 | 0x8 | 0x10 | 0x20; break; - case 8: wavex->dwChannelMask = 0x1 | 0x2 | 0x4 | 0x8 | 0x10 | 0x20 | 0x40 | 0x80; break; - default: wavex->dwChannelMask = 0; break; - } - } - - return paNoError; -} - - - - - - -/* -#define paFloat32 ((PaSampleFormat) 0x00000001) -#define paInt32 ((PaSampleFormat) 0x00000002) -#define paInt24 ((PaSampleFormat) 0x00000004) -#define paInt16 ((PaSampleFormat) 0x00000008) -*/ -//lifted from pa_wdmks -static void wasapiFillWFEXT( WAVEFORMATEXTENSIBLE* pwfext, PaSampleFormat sampleFormat, double sampleRate, int channelCount) -{ - PA_DEBUG(( "sampleFormat = %lx\n" , sampleFormat )); - PA_DEBUG(( "sampleRate = %f\n" , sampleRate )); - PA_DEBUG(( "chanelCount = %d\n", channelCount )); - - pwfext->Format.wFormatTag = WAVE_FORMAT_EXTENSIBLE; - pwfext->Format.nChannels = channelCount; - pwfext->Format.nSamplesPerSec = (int)sampleRate; - if(channelCount == 1) - pwfext->dwChannelMask = KSAUDIO_SPEAKER_DIRECTOUT; - else - pwfext->dwChannelMask = KSAUDIO_SPEAKER_STEREO; - if(sampleFormat == paFloat32) - { - pwfext->Format.nBlockAlign = channelCount * 4; - pwfext->Format.wBitsPerSample = 32; - pwfext->Format.cbSize = sizeof(WAVEFORMATEXTENSIBLE)-sizeof(WAVEFORMATEX); - pwfext->Samples.wValidBitsPerSample = 32; - pwfext->SubFormat = KSDATAFORMAT_SUBTYPE_IEEE_FLOAT; - } - else if(sampleFormat == paInt32) - { - pwfext->Format.nBlockAlign = channelCount * 4; - pwfext->Format.wBitsPerSample = 32; - pwfext->Format.cbSize = sizeof(WAVEFORMATEXTENSIBLE)-sizeof(WAVEFORMATEX); - pwfext->Samples.wValidBitsPerSample = 32; - pwfext->SubFormat = KSDATAFORMAT_SUBTYPE_PCM; - } - else if(sampleFormat == paInt24) - { - pwfext->Format.nBlockAlign = channelCount * 3; - pwfext->Format.wBitsPerSample = 24; - pwfext->Format.cbSize = sizeof(WAVEFORMATEXTENSIBLE)-sizeof(WAVEFORMATEX); - pwfext->Samples.wValidBitsPerSample = 24; - pwfext->SubFormat = KSDATAFORMAT_SUBTYPE_PCM; - } - else if(sampleFormat == paInt16) - { - pwfext->Format.nBlockAlign = channelCount * 2; - pwfext->Format.wBitsPerSample = 16; - pwfext->Format.cbSize = sizeof(WAVEFORMATEXTENSIBLE)-sizeof(WAVEFORMATEX); - pwfext->Samples.wValidBitsPerSample = 16; - pwfext->SubFormat = KSDATAFORMAT_SUBTYPE_PCM; - } - pwfext->Format.nAvgBytesPerSec = pwfext->Format.nSamplesPerSec * pwfext->Format.nBlockAlign; -} - - - -/* -#define FORMATTESTS 4 -const int BestToWorst[FORMATTESTS]={paFloat32,paInt32,paInt24,paInt16}; -*/ - -#define FORMATTESTS 3 -const int BestToWorst[FORMATTESTS]={paFloat32,paInt24,paInt16}; - - -static PaError -GetClosestFormat(IAudioClient * myClient, double sampleRate,const PaStreamParameters * params, - AUDCLNT_SHAREMODE *shareMode, WAVEFORMATEXTENSIBLE *outWavex) -{ - //TODO we should try exclusive first and shared after - *shareMode = PORTAUDIO_SHAREMODE; - - PaError answer = paInvalidSampleRate; - - waveformatFromParams(outWavex,params,sampleRate); - WAVEFORMATEX *sharedClosestMatch=0; - HRESULT hResult=!S_OK; - - if (*shareMode == AUDCLNT_SHAREMODE_EXCLUSIVE) - hResult = myClient->IsFormatSupported(AUDCLNT_SHAREMODE_EXCLUSIVE,(WAVEFORMATEX*)outWavex,NULL); - else - hResult = myClient->IsFormatSupported(AUDCLNT_SHAREMODE_SHARED, (WAVEFORMATEX*)&outWavex,&sharedClosestMatch); - - if (hResult == S_OK) - answer = paFormatIsSupported; - else if (sharedClosestMatch){ - WAVEFORMATEXTENSIBLE* ext = (WAVEFORMATEXTENSIBLE*)sharedClosestMatch; - - int closestMatchSR = (int)sharedClosestMatch->nSamplesPerSec; - - if (sharedClosestMatch->wFormatTag == WAVE_FORMAT_EXTENSIBLE) - memcpy(outWavex,sharedClosestMatch,sizeof(WAVEFORMATEXTENSIBLE)); - else - memcpy(outWavex,sharedClosestMatch,sizeof(WAVEFORMATEX)); - - CoTaskMemFree(sharedClosestMatch); - - if ((int)sampleRate == closestMatchSR) - answer = paFormatIsSupported; - else - answer = paInvalidSampleRate; - - }else { - - //it doesnt suggest anything?? ok lets show it the MENU! - - //ok fun time as with pa_win_mme, we know only a refusal of the user-requested - //sampleRate+num Channel is disastrous, as the portaudio buffer processor converts between anything - //so lets only use the number - for (int i=0;i<FORMATTESTS;++i){ - WAVEFORMATEXTENSIBLE ext; - wasapiFillWFEXT(&ext,BestToWorst[i],sampleRate,params->channelCount); - if (*shareMode == AUDCLNT_SHAREMODE_EXCLUSIVE) - hResult = myClient->IsFormatSupported(AUDCLNT_SHAREMODE_EXCLUSIVE,(WAVEFORMATEX*)&ext,NULL); - else - hResult = myClient->IsFormatSupported(AUDCLNT_SHAREMODE_SHARED, (WAVEFORMATEX*)&ext,&sharedClosestMatch); - - if (hResult == S_OK){ - memcpy(outWavex,&ext,sizeof(WAVEFORMATEXTENSIBLE)); - answer = paFormatIsSupported; - break; - } - } - - if (answer!=paFormatIsSupported) { - //try MIX format? - //why did it HAVE to come to this .... - WAVEFORMATEX pcm16WaveFormat; - memset(&pcm16WaveFormat,0,sizeof(WAVEFORMATEX)); - pcm16WaveFormat.wFormatTag = WAVE_FORMAT_PCM; - pcm16WaveFormat.nChannels = 2; - pcm16WaveFormat.nSamplesPerSec = (DWORD)sampleRate; - pcm16WaveFormat.nBlockAlign = 4; - pcm16WaveFormat.nAvgBytesPerSec = pcm16WaveFormat.nSamplesPerSec*pcm16WaveFormat.nBlockAlign; - pcm16WaveFormat.wBitsPerSample = 16; - pcm16WaveFormat.cbSize = 0; - - if (*shareMode == AUDCLNT_SHAREMODE_EXCLUSIVE) - hResult = myClient->IsFormatSupported(AUDCLNT_SHAREMODE_EXCLUSIVE,(WAVEFORMATEX*)&pcm16WaveFormat,NULL); - else - hResult = myClient->IsFormatSupported(AUDCLNT_SHAREMODE_SHARED, (WAVEFORMATEX*)&pcm16WaveFormat,&sharedClosestMatch); - - if (hResult == S_OK){ - memcpy(outWavex,&pcm16WaveFormat,sizeof(WAVEFORMATEX)); - answer = paFormatIsSupported; - } - } - - logAUDCLNT_E(hResult); - } - - return answer; -} - - -static PaError IsFormatSupported( struct PaUtilHostApiRepresentation *hostApi, - const PaStreamParameters *inputParameters, - const PaStreamParameters *outputParameters, - double sampleRate ) -{ - - int inputChannelCount, outputChannelCount; - PaSampleFormat inputSampleFormat, outputSampleFormat; - - if( inputParameters ) - { - inputChannelCount = inputParameters->channelCount; - inputSampleFormat = inputParameters->sampleFormat; - - /* all standard sample formats are supported by the buffer adapter, - this implementation doesn't support any custom sample formats */ - if( inputSampleFormat & paCustomFormat ) - return paSampleFormatNotSupported; - - /* unless alternate device specification is supported, reject the use of - paUseHostApiSpecificDeviceSpecification */ - - if( inputParameters->device == paUseHostApiSpecificDeviceSpecification ) - return paInvalidDevice; - - /* check that input device can support inputChannelCount */ - if( inputChannelCount > hostApi->deviceInfos[ inputParameters->device ]->maxInputChannels ) - return paInvalidChannelCount; - - /* validate inputStreamInfo */ - if( inputParameters->hostApiSpecificStreamInfo ) - return paIncompatibleHostApiSpecificStreamInfo; /* this implementation doesn't use custom stream info */ - - - PaWinWasapiHostApiRepresentation *paWasapi = (PaWinWasapiHostApiRepresentation*)hostApi; - - - IAudioClient *myClient=0; - HRESULT hResult = paWasapi->devInfo[inputParameters->device].device->Activate( - __uuidof(IAudioClient), CLSCTX_INPROC_SERVER, NULL, (void**)&myClient); - if (hResult != S_OK){ - logAUDCLNT_E(hResult); - return paInvalidDevice; - } - - WAVEFORMATEXTENSIBLE wavex; - AUDCLNT_SHAREMODE shareMode; - PaError answer = GetClosestFormat(myClient,sampleRate,inputParameters,&shareMode,&wavex); - myClient->Release(); - - if (answer !=paFormatIsSupported) - return answer; - } - else - { - inputChannelCount = 0; - } - - if( outputParameters ) - { - outputChannelCount = outputParameters->channelCount; - outputSampleFormat = outputParameters->sampleFormat; - - /* all standard sample formats are supported by the buffer adapter, - this implementation doesn't support any custom sample formats */ - if( outputSampleFormat & paCustomFormat ) - return paSampleFormatNotSupported; - - /* unless alternate device specification is supported, reject the use of - paUseHostApiSpecificDeviceSpecification */ - - if( outputParameters->device == paUseHostApiSpecificDeviceSpecification ) - return paInvalidDevice; - - /* check that output device can support outputChannelCount */ - if( outputChannelCount > hostApi->deviceInfos[ outputParameters->device ]->maxOutputChannels ) - return paInvalidChannelCount; - - /* validate outputStreamInfo */ - if( outputParameters->hostApiSpecificStreamInfo ) - return paIncompatibleHostApiSpecificStreamInfo; /* this implementation doesn't use custom stream info */ - - - PaWinWasapiHostApiRepresentation *paWasapi = (PaWinWasapiHostApiRepresentation*)hostApi; - - IAudioClient *myClient=0; - HRESULT hResult = paWasapi->devInfo[outputParameters->device].device->Activate( - __uuidof(IAudioClient), CLSCTX_INPROC_SERVER, NULL, (void**)&myClient); - if (hResult != S_OK){ - logAUDCLNT_E(hResult); - return paInvalidDevice; - } - - WAVEFORMATEXTENSIBLE wavex; - AUDCLNT_SHAREMODE shareMode; - PaError answer = GetClosestFormat(myClient,sampleRate,outputParameters,&shareMode,&wavex); - myClient->Release(); - - if (answer !=paFormatIsSupported) - return answer; - } - else - { - outputChannelCount = 0; - } - - - return paFormatIsSupported; -} - - - -/* see pa_hostapi.h for a list of validity guarantees made about OpenStream parameters */ - -static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi, - PaStream** s, - const PaStreamParameters *inputParameters, - const PaStreamParameters *outputParameters, - double sampleRate, - unsigned long framesPerBuffer, - PaStreamFlags streamFlags, - PaStreamCallback *streamCallback, - void *userData ) -{ - PaError result = paNoError; - PaWinWasapiHostApiRepresentation *paWasapi = (PaWinWasapiHostApiRepresentation*)hostApi; - PaWinWasapiStream *stream = 0; - int inputChannelCount, outputChannelCount; - PaSampleFormat inputSampleFormat, outputSampleFormat; - PaSampleFormat hostInputSampleFormat, hostOutputSampleFormat; - - - stream = (PaWinWasapiStream*)PaUtil_AllocateMemory( sizeof(PaWinWasapiStream) ); - if( !stream ){ - result = paInsufficientMemory; - goto error; - } - - if( inputParameters ) - { - inputChannelCount = inputParameters->channelCount; - inputSampleFormat = inputParameters->sampleFormat; - - /* unless alternate device specification is supported, reject the use of - paUseHostApiSpecificDeviceSpecification */ - - if( inputParameters->device == paUseHostApiSpecificDeviceSpecification ) - return paInvalidDevice; - - /* check that input device can support inputChannelCount */ - if( inputChannelCount > hostApi->deviceInfos[ inputParameters->device ]->maxInputChannels ) - return paInvalidChannelCount; - - /* validate inputStreamInfo */ - if( inputParameters->hostApiSpecificStreamInfo ) - return paIncompatibleHostApiSpecificStreamInfo; /* this implementation doesn't use custom stream info */ - - - PaWinWasapiDeviceInfo &info = paWasapi->devInfo[inputParameters->device]; - - HRESULT hResult = info.device->Activate( - __uuidof(IAudioClient), CLSCTX_INPROC_SERVER, NULL, - (void**)&stream->in.client); - - if (hResult != S_OK) - return paInvalidDevice; - - hResult = info.device->Activate( - __uuidof(IAudioEndpointVolume), CLSCTX_INPROC_SERVER, NULL, - (void**)&stream->inVol); - - if (hResult != S_OK) - return paInvalidDevice; - - AUDCLNT_SHAREMODE shareMode; - PaError answer = GetClosestFormat(stream->in.client,sampleRate,inputParameters,&shareMode,&stream->in.wavex); - - if (answer !=paFormatIsSupported) - return answer; - - //stream->out.period = info.DefaultDevicePeriod; - stream->in.period = info.MinimumDevicePeriod; - - hResult = stream->in.client->Initialize( - shareMode, - 0, //no flags - stream->in.period, - 0,//stream->out.period, - (WAVEFORMATEX*)&stream->in.wavex, - &stream->session - ); - - if (hResult != S_OK){ - logAUDCLNT_E(hResult); - return paInvalidDevice; - } - - hResult = stream->in.client->GetBufferSize(&stream->in.bufferSize); - if (hResult != S_OK) - return paInvalidDevice; - - hResult = stream->in.client->GetStreamLatency(&stream->in.latency); - if (hResult != S_OK) - return paInvalidDevice; - - double periodsPerSecond = 1.0/nano100ToSeconds(stream->in.period); - double samplesPerPeriod = (double)(stream->in.wavex.Format.nSamplesPerSec)/periodsPerSecond; - - //this is the number of samples that are required at each period - stream->in.framesPerHostCallback = (unsigned long)samplesPerPeriod;//unrelated to channels - - /* IMPLEMENT ME - establish which host formats are available */ - hostInputSampleFormat = - PaUtil_SelectClosestAvailableFormat( waveformatToPaFormat(&stream->in.wavex), inputSampleFormat ); - } - else - { - inputChannelCount = 0; - inputSampleFormat = hostInputSampleFormat = paInt16; /* Surpress 'uninitialised var' warnings. */ - } - - if( outputParameters ) - { - outputChannelCount = outputParameters->channelCount; - outputSampleFormat = outputParameters->sampleFormat; - - /* unless alternate device specification is supported, reject the use of - paUseHostApiSpecificDeviceSpecification */ - - if( outputParameters->device == paUseHostApiSpecificDeviceSpecification ) - return paInvalidDevice; - - /* check that output device can support inputChannelCount */ - if( outputChannelCount > hostApi->deviceInfos[ outputParameters->device ]->maxOutputChannels ) - return paInvalidChannelCount; - - /* validate outputStreamInfo */ - if( outputParameters->hostApiSpecificStreamInfo ) - return paIncompatibleHostApiSpecificStreamInfo; /* this implementation doesn't use custom stream info */ - - - PaWinWasapiDeviceInfo &info = paWasapi->devInfo[outputParameters->device]; - - HRESULT hResult = info.device->Activate( - __uuidof(IAudioClient), CLSCTX_INPROC_SERVER, NULL, - (void**)&stream->out.client); - - if (hResult != S_OK) - return paInvalidDevice; - - AUDCLNT_SHAREMODE shareMode; - PaError answer = GetClosestFormat(stream->out.client,sampleRate,outputParameters,&shareMode,&stream->out.wavex); - - if (answer !=paFormatIsSupported) - return answer; - LogWAVEFORMATEXTENSIBLE(&stream->out.wavex); - - // stream->out.period = info.DefaultDevicePeriod; - stream->out.period = info.MinimumDevicePeriod; - - /*For an exclusive-mode stream that uses event-driven buffering, - the caller must specify nonzero values for hnsPeriodicity and hnsBufferDuration, - and the values of these two parameters must be equal */ - if (shareMode == AUDCLNT_SHAREMODE_EXCLUSIVE){ - hResult = stream->out.client->Initialize( - shareMode, - AUDCLNT_STREAMFLAGS_EVENTCALLBACK, - stream->out.period, - stream->out.period, - (WAVEFORMATEX*)&stream->out.wavex, - &stream->session - ); - } - else{ - hResult = stream->out.client->Initialize( - shareMode, - AUDCLNT_STREAMFLAGS_EVENTCALLBACK, - 0, - 0, - (WAVEFORMATEX*)&stream->out.wavex, - &stream->session - ); - } - - - if (hResult != S_OK){ - logAUDCLNT_E(hResult); - return paInvalidDevice; - } - - hResult = info.device->Activate( - __uuidof(IAudioEndpointVolume), CLSCTX_INPROC_SERVER, NULL, - (void**)&stream->outVol); - - if (hResult != S_OK) - return paInvalidDevice; - - hResult = stream->out.client->GetBufferSize(&stream->out.bufferSize); - if (hResult != S_OK) - return paInvalidDevice; - - hResult = stream->out.client->GetStreamLatency(&stream->out.latency); - if (hResult != S_OK) - return paInvalidDevice; - - double periodsPerSecond = 1.0/nano100ToSeconds(stream->out.period); - double samplesPerPeriod = (double)(stream->out.wavex.Format.nSamplesPerSec)/periodsPerSecond; - - //this is the number of samples that are required at each period - stream->out.framesPerHostCallback = stream->out.bufferSize; //(unsigned long)samplesPerPeriod;//unrelated to channels - - /* IMPLEMENT ME - establish which host formats are available */ - hostOutputSampleFormat = PaUtil_SelectClosestAvailableFormat( waveformatToPaFormat(&stream->out.wavex), outputSampleFormat ); - } - else - { - outputChannelCount = 0; - outputSampleFormat = hostOutputSampleFormat = paInt16; /* Surpress 'uninitialized var' warnings. */ - } - - - - /* - IMPLEMENT ME: - - ( the following two checks are taken care of by PaUtil_InitializeBufferProcessor() FIXME - checks needed? ) - - - check that input device can support inputSampleFormat, or that - we have the capability to convert from outputSampleFormat to - a native format - - - check that output device can support outputSampleFormat, or that - we have the capability to convert from outputSampleFormat to - a native format - - - if a full duplex stream is requested, check that the combination - of input and output parameters is supported - - - check that the device supports sampleRate - - - alter sampleRate to a close allowable rate if possible / necessary - - - validate suggestedInputLatency and suggestedOutputLatency parameters, - use default values where necessary - */ - - - - /* validate platform specific flags */ - if( (streamFlags & paPlatformSpecificFlags) != 0 ) - return paInvalidFlag; /* unexpected platform specific flag */ - - - - if( streamCallback ) - { - PaUtil_InitializeStreamRepresentation( &stream->streamRepresentation, - &paWasapi->callbackStreamInterface, streamCallback, userData ); - } - else - { - PaUtil_InitializeStreamRepresentation( &stream->streamRepresentation, - &paWasapi->blockingStreamInterface, streamCallback, userData ); - } - - PaUtil_InitializeCpuLoadMeasurer( &stream->cpuLoadMeasurer, sampleRate ); - - - if (outputParameters && inputParameters){ - - //serious problem #1 - if (stream->in.period != stream->out.period){ - PRINT(("OpenStream: period discrepancy\n")); - goto error; - } - - //serious problem #2 - if (stream->out.framesPerHostCallback != stream->in.framesPerHostCallback){ - PRINT(("OpenStream: framesPerHostCallback discrepancy\n")); - goto error; - } - } - - unsigned long framesPerHostCallback = (outputParameters)? - stream->out.framesPerHostCallback: - stream->in.framesPerHostCallback; - - /* we assume a fixed host buffer size in this example, but the buffer processor - can also support bounded and unknown host buffer sizes by passing - paUtilBoundedHostBufferSize or paUtilUnknownHostBufferSize instead of - paUtilFixedHostBufferSize below. */ - - result = PaUtil_InitializeBufferProcessor( &stream->bufferProcessor, - inputChannelCount, inputSampleFormat, hostInputSampleFormat, - outputChannelCount, outputSampleFormat, hostOutputSampleFormat, - sampleRate, streamFlags, framesPerBuffer, - framesPerHostCallback, paUtilFixedHostBufferSize, - streamCallback, userData ); - if( result != paNoError ) - goto error; - - - /* - IMPLEMENT ME: initialise the following fields with estimated or actual - values. - */ - stream->streamRepresentation.streamInfo.inputLatency = - PaUtil_GetBufferProcessorInputLatency(&stream->bufferProcessor) - + ((inputParameters)?nano100ToSeconds(stream->in.latency) :0); - - stream->streamRepresentation.streamInfo.outputLatency = - PaUtil_GetBufferProcessorOutputLatency(&stream->bufferProcessor) - + ((outputParameters)?nano100ToSeconds(stream->out.latency) :0); - - stream->streamRepresentation.streamInfo.sampleRate = sampleRate; - - - *s = (PaStream*)stream; - - - return result; - -error: - if( stream ) - PaUtil_FreeMemory( stream ); - - return result; -} - - - -/* - When CloseStream() is called, the multi-api layer ensures that - the stream has already been stopped or aborted. -*/ - -#define SAFE_RELEASE(punk) \ - if ((punk) != NULL) \ - { (punk)->Release(); (punk) = NULL; } - -static PaError CloseStream( PaStream* s ) -{ - PaError result = paNoError; - PaWinWasapiStream *stream = (PaWinWasapiStream*)s; - - /* - IMPLEMENT ME: - - additional stream closing + cleanup - */ - - SAFE_RELEASE(stream->out.client); - SAFE_RELEASE(stream->in.client); - SAFE_RELEASE(stream->cclient); - SAFE_RELEASE(stream->rclient); - SAFE_RELEASE(stream->inVol); - SAFE_RELEASE(stream->outVol); - CloseHandle(stream->hThread); - CloseHandle(stream->hNotificationEvent); - - PaUtil_TerminateBufferProcessor( &stream->bufferProcessor ); - PaUtil_TerminateStreamRepresentation( &stream->streamRepresentation ); - PaUtil_FreeMemory( stream ); - - return result; -} - -DWORD WINAPI ProcThread(void *client); - -static PaError StartStream( PaStream *s ) -{ - PaError result = paNoError; - PaWinWasapiStream *stream = (PaWinWasapiStream*)s; - - PaUtil_ResetBufferProcessor( &stream->bufferProcessor ); - - HRESULT hResult=S_OK; - - if (stream->out.client){ - hResult = stream->out.client->GetService(__uuidof(IAudioRenderClient),(void**)&stream->rclient); - logAUDCLNT_E(hResult); - if (hResult!=S_OK) - return paUnanticipatedHostError; - } - - if (stream->in.client){ - hResult = stream->in.client->GetService(__uuidof(IAudioCaptureClient),(void**)&stream->cclient); - logAUDCLNT_E(hResult); - if (hResult!=S_OK) - return paUnanticipatedHostError; - } - - // Create a thread for this client. - stream->hThread = CreateThread( - NULL, // no security attribute - 0, // default stack size - ProcThread, - (LPVOID) stream, // thread parameter - 0, // not suspended - &stream->dwThreadId); // returns thread ID - - if (stream->hThread == NULL) - return paUnanticipatedHostError; - - return paNoError; -} - - -static PaError StopStream( PaStream *s ) -{ - PaError result = paNoError; - PaWinWasapiStream *stream = (PaWinWasapiStream*)s; - - /* suppress unused variable warnings */ - stream->closeRequest = true; - //todo something MUCH better than this - while(stream->closeRequest) - Sleep(100); - - /* IMPLEMENT ME, see portaudio.h for required behavior */ - - stream->running = false; - - return result; -} - - -static PaError AbortStream( PaStream *s ) -{ - PaError result = paNoError; - PaWinWasapiStream *stream = (PaWinWasapiStream*)s; - - /* suppress unused variable warnings */ - stream->closeRequest = true; - //todo something MUCH better than this - while(stream->closeRequest) - Sleep(100); - - /* IMPLEMENT ME, see portaudio.h for required behavior */ - - return result; -} - - -static PaError IsStreamStopped( PaStream *s ) -{ - PaWinWasapiStream *stream = (PaWinWasapiStream*)s; - - return !stream->running; -} - - -static PaError IsStreamActive( PaStream *s ) -{ - PaWinWasapiStream *stream = (PaWinWasapiStream*)s; - return stream->running; -} - - -static PaTime GetStreamTime( PaStream *s ) -{ - PaWinWasapiStream *stream = (PaWinWasapiStream*)s; - - /* suppress unused variable warnings */ - (void) stream; - - /* IMPLEMENT ME, see portaudio.h for required behavior*/ - - //this is lame ds and mme does the same thing, quite useless method imho - //why dont we fetch the time in the pa callbacks? - //at least its doing to be clocked to something - return PaUtil_GetTime(); -} - - -static double GetStreamCpuLoad( PaStream* s ) -{ - PaWinWasapiStream *stream = (PaWinWasapiStream*)s; - - return PaUtil_GetCpuLoad( &stream->cpuLoadMeasurer ); -} - - -/* - As separate stream interfaces are used for blocking and callback - streams, the following functions can be guaranteed to only be called - for blocking streams. -*/ - -static PaError ReadStream( PaStream* s, - void *buffer, - unsigned long frames ) -{ - PaWinWasapiStream *stream = (PaWinWasapiStream*)s; - - /* suppress unused variable warnings */ - (void) buffer; - (void) frames; - (void) stream; - - /* IMPLEMENT ME, see portaudio.h for required behavior*/ - - return paNoError; -} - - -static PaError WriteStream( PaStream* s, - const void *buffer, - unsigned long frames ) -{ - PaWinWasapiStream *stream = (PaWinWasapiStream*)s; - - /* suppress unused variable warnings */ - (void) buffer; - (void) frames; - (void) stream; - - /* IMPLEMENT ME, see portaudio.h for required behavior*/ - - return paNoError; -} - - -static signed long GetStreamReadAvailable( PaStream* s ) -{ - PaWinWasapiStream *stream = (PaWinWasapiStream*)s; - - /* suppress unused variable warnings */ - (void) stream; - - /* IMPLEMENT ME, see portaudio.h for required behavior*/ - - return 0; -} - - -static signed long GetStreamWriteAvailable( PaStream* s ) -{ - PaWinWasapiStream *stream = (PaWinWasapiStream*)s; - - /* suppress unused variable warnings */ - (void) stream; - - /* IMPLEMENT ME, see portaudio.h for required behavior*/ - - return 0; -} - - - -/* - ExampleHostProcessingLoop() illustrates the kind of processing which may - occur in a host implementation. - -*/ -static void WaspiHostProcessingLoop( void *inputBuffer, long inputFrames, - void *outputBuffer, long outputFrames, - void *userData ) -{ - PaWinWasapiStream *stream = (PaWinWasapiStream*)userData; - PaStreamCallbackTimeInfo timeInfo = {0,0,0}; /* IMPLEMENT ME */ - int callbackResult; - unsigned long framesProcessed; - - PaUtil_BeginCpuLoadMeasurement( &stream->cpuLoadMeasurer ); - - - /* - IMPLEMENT ME: - - generate timing information - - handle buffer slips - */ - - /* - If you need to byte swap or shift inputBuffer to convert it into a - portaudio format, do it here. - */ - - - - PaUtil_BeginBufferProcessing( &stream->bufferProcessor, &timeInfo, 0 /* IMPLEMENT ME: pass underflow/overflow flags when necessary */ ); - - /* - depending on whether the host buffers are interleaved, non-interleaved - or a mixture, you will want to call PaUtil_SetInterleaved*Channels(), - PaUtil_SetNonInterleaved*Channel() or PaUtil_Set*Channel() here. - */ - - if( stream->bufferProcessor.inputChannelCount > 0 ) - { - PaUtil_SetInputFrameCount( &stream->bufferProcessor, inputFrames ); - PaUtil_SetInterleavedInputChannels( &stream->bufferProcessor, - 0, /* first channel of inputBuffer is channel 0 */ - inputBuffer, - 0 ); /* 0 - use inputChannelCount passed to init buffer processor */ - } - - if( stream->bufferProcessor.outputChannelCount > 0 ) - { - PaUtil_SetOutputFrameCount( &stream->bufferProcessor, outputFrames); - PaUtil_SetInterleavedOutputChannels( &stream->bufferProcessor, - 0, /* first channel of outputBuffer is channel 0 */ - outputBuffer, - 0 ); /* 0 - use outputChannelCount passed to init buffer processor */ - } - - /* you must pass a valid value of callback result to PaUtil_EndBufferProcessing() - in general you would pass paContinue for normal operation, and - paComplete to drain the buffer processor's internal output buffer. - You can check whether the buffer processor's output buffer is empty - using PaUtil_IsBufferProcessorOuputEmpty( bufferProcessor ) - */ - callbackResult = paContinue; - framesProcessed = PaUtil_EndBufferProcessing( &stream->bufferProcessor, &callbackResult ); - - - /* - If you need to byte swap or shift outputBuffer to convert it to - host format, do it here. - */ - - PaUtil_EndCpuLoadMeasurement( &stream->cpuLoadMeasurer, framesProcessed ); - - - if( callbackResult == paContinue ) - { - /* nothing special to do */ - } - else if( callbackResult == paAbort ) - { - /* IMPLEMENT ME - finish playback immediately */ - - /* once finished, call the finished callback */ - if( stream->streamRepresentation.streamFinishedCallback != 0 ) - stream->streamRepresentation.streamFinishedCallback( stream->streamRepresentation.userData ); - } - else - { - /* User callback has asked us to stop with paComplete or other non-zero value */ - - /* IMPLEMENT ME - finish playback once currently queued audio has completed */ - - /* once finished, call the finished callback */ - if( stream->streamRepresentation.streamFinishedCallback != 0 ) - stream->streamRepresentation.streamFinishedCallback( stream->streamRepresentation.userData ); - } -} - - -void -MMCSS_activate(){ - - DWORD stuff=0; - HANDLE thCarac = pAvSetMmThreadCharacteristics("Pro Audio",&stuff); - if (!thCarac){ - PRINT(("AvSetMmThreadCharacteristics failed!\n")); - } - - BOOL prio = pAvSetMmThreadPriority(thCarac,AVRT_PRIORITY_NORMAL); - if (!prio){ - PRINT(("AvSetMmThreadPriority failed!\n")); - } - - //debug - { - HANDLE hh = GetCurrentThread(); - int currprio = GetThreadPriority(hh); - DWORD currclass = GetPriorityClass(GetCurrentProcess()); - PRINT(("currprio 0x%X currclass 0x%X\n",currprio,currclass)); - } -} - - -DWORD WINAPI -ProcThread(void* param){ - HRESULT hResult; - MMCSS_activate(); - - PaWinWasapiStream *stream = (PaWinWasapiStream*)param; - - stream->hNotificationEvent = CreateEvent(NULL, - FALSE, //bManualReset are we sure?? - FALSE, - "PAWASA"); - hResult = stream->out.client->SetEventHandle(stream->hNotificationEvent); - if (hResult != S_OK) - logAUDCLNT_E(hResult); - - if (stream->out.client){ - hResult = stream->out.client->Start(); - if (hResult != S_OK) - logAUDCLNT_E(hResult); - } - - stream->running = true; - bool bOne = false; - - while( !stream->closeRequest ) - { - //lets wait but have a 1 second timeout - DWORD dwResult = WaitForSingleObject(stream->hNotificationEvent, 1000); - switch( dwResult ) { - case WAIT_OBJECT_0: { - - unsigned long usingBS = stream->out.framesPerHostCallback; - - BYTE* indata = 0; - BYTE* outdata = 0; - - hResult = stream->rclient->GetBuffer(usingBS, &outdata); - - if (hResult != S_OK || !outdata) { - //logAUDCLNT_E(hResult); - //most probably shared mode and hResult=AUDCLNT_E_BUFFER_TOO_LARGE - UINT32 padding = 0; - hResult = stream->out.client->GetCurrentPadding(&padding); - if (padding == 0) - break; - usingBS = usingBS-padding; - if (usingBS == 0) - break;//huh? - hResult = stream->rclient->GetBuffer(usingBS, &outdata); - if (hResult != S_OK)//what can we do NOW?? - break; - //logAUDCLNT_E(hResult); - } - - WaspiHostProcessingLoop(indata, usingBS ,outdata, usingBS, stream); - - hResult = stream->rclient->ReleaseBuffer(usingBS, 0); - if (hResult != S_OK) - logAUDCLNT_E(hResult); - - /* This was suggested, but in my tests it doesnt seem to improve the - locking behaviour some drivers have running in exclusive mode. - if(!ResetEvent(stream->hNotificationEvent)){ - logAUDCLNT_E(hResult); - } - */ - - } - break; - - } - } - stream->out.client->Stop(); - stream->closeRequest = false; - - return 0; -} - - - - -#endif //VC 2005 - - - - -#if 0 - if(bFirst) { - float masteur; - hResult = stream->outVol->GetMasterVolumeLevelScalar(&masteur); - if (hResult != S_OK) - logAUDCLNT_E(hResult); - float chan1, chan2; - hResult = stream->outVol->GetChannelVolumeLevelScalar(0, &chan1); - if (hResult != S_OK) - logAUDCLNT_E(hResult); - hResult = stream->outVol->GetChannelVolumeLevelScalar(1, &chan2); - if (hResult != S_OK) - logAUDCLNT_E(hResult); - - BOOL bMute; - hResult = stream->outVol->GetMute(&bMute); - if (hResult != S_OK) - logAUDCLNT_E(hResult); - - stream->outVol->SetMasterVolumeLevelScalar(0.5, NULL); - stream->outVol->SetChannelVolumeLevelScalar(0, 0.5, NULL); - stream->outVol->SetChannelVolumeLevelScalar(1, 0.5, NULL); - stream->outVol->SetMute(FALSE, NULL); - bFirst = false; - } -#endif \ No newline at end of file diff --git a/sflphone-common/libs/pjproject-1.0.1/COPYING b/sflphone-common/libs/pjproject-1.0.2/COPYING similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/COPYING rename to sflphone-common/libs/pjproject-1.0.2/COPYING diff --git a/sflphone-common/libs/pjproject-1.0.1/INSTALL.txt b/sflphone-common/libs/pjproject-1.0.2/INSTALL.txt similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/INSTALL.txt rename to sflphone-common/libs/pjproject-1.0.2/INSTALL.txt diff --git a/sflphone-common/libs/pjproject-1.0.1/Makefile b/sflphone-common/libs/pjproject-1.0.2/Makefile similarity index 77% rename from sflphone-common/libs/pjproject-1.0.1/Makefile rename to sflphone-common/libs/pjproject-1.0.2/Makefile index 469f20c49d060d40d46e4bd6df81084d99432aed..c6e7b62c4f9ade6e95c19c589853890b61a24e4b 100644 --- a/sflphone-common/libs/pjproject-1.0.1/Makefile +++ b/sflphone-common/libs/pjproject-1.0.2/Makefile @@ -29,16 +29,16 @@ doc: fi; \ done -LIBS = pjlib/lib/libpj-sfl-$(TARGET_NAME).a \ - pjlib-util/lib/libpjlib-util-sfl-$(TARGET_NAME).a \ - pjnath/lib/libpjnath-sfl-$(TARGET_NAME).a \ - pjmedia/lib/libpjmedia-sfl-$(TARGET_NAME).a \ - pjmedia/lib/libpjmedia-codec-sfl-$(TARGET_NAME).a \ - pjsip/lib/libpjsip-sfl-$(TARGET_NAME).a \ - pjsip/lib/libpjsip-ua-sfl-$(TARGET_NAME).a \ - pjsip/lib/libpjsip-simple-sfl-$(TARGET_NAME).a \ - pjsip/lib/libpjsua-sfl-$(TARGET_NAME).a -BINS = pjsip-apps/bin/pjsua-sfl-$(TARGET_NAME)$(HOST_EXE) +LIBS = pjlib/lib/libpj-sfl-$(TARGET_NAME).a \ + pjlib-util/lib/libpjlib-util-sfl-$(TARGET_NAME).a \ + pjnath/lib/libpjnath-sfl-$(TARGET_NAME).a \ + pjmedia/lib/libpjmedia-sfl-$(TARGET_NAME).a \ + pjmedia/lib/libpjmedia-codec-sfl-$(TARGET_NAME).a \ + pjsip/lib/libpjsip-sfl-$(TARGET_NAME).a \ + pjsip/lib/libpjsip-ua-sfl-$(TARGET_NAME).a \ + pjsip/lib/libpjsip-simple-sfl-$(TARGET_NAME).a \ + pjsip/lib/libpjsua-sfl-$(TARGET_NAME).a +BINS = pjsip-apps/bin/pjsua-sfl-$(TARGET_NAME)$(HOST_EXE) size: @echo -n 'Date: ' diff --git a/sflphone-common/libs/pjproject-1.0.1/README-RTEMS b/sflphone-common/libs/pjproject-1.0.2/README-RTEMS similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/README-RTEMS rename to sflphone-common/libs/pjproject-1.0.2/README-RTEMS diff --git a/sflphone-common/libs/pjproject-1.0.1/README.txt b/sflphone-common/libs/pjproject-1.0.2/README.txt similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/README.txt rename to sflphone-common/libs/pjproject-1.0.2/README.txt diff --git a/sflphone-common/libs/pjproject-1.0.1/aconfigure b/sflphone-common/libs/pjproject-1.0.2/aconfigure similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/aconfigure rename to sflphone-common/libs/pjproject-1.0.2/aconfigure diff --git a/sflphone-common/libs/pjproject-1.0.1/aconfigure.ac b/sflphone-common/libs/pjproject-1.0.2/aconfigure.ac similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/aconfigure.ac rename to sflphone-common/libs/pjproject-1.0.2/aconfigure.ac diff --git a/sflphone-common/libs/pjproject-1.0.1/autogen.sh b/sflphone-common/libs/pjproject-1.0.2/autogen.sh similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/autogen.sh rename to sflphone-common/libs/pjproject-1.0.2/autogen.sh diff --git a/sflphone-common/libs/pjproject-1.0.1/build.mak.in b/sflphone-common/libs/pjproject-1.0.2/build.mak.in similarity index 92% rename from sflphone-common/libs/pjproject-1.0.1/build.mak.in rename to sflphone-common/libs/pjproject-1.0.2/build.mak.in index 4554f6f3a53b11c4e59c30b80148873f5725cf56..c2d4e0aa1dfc93949667c894f735c724a3a88a28 100644 --- a/sflphone-common/libs/pjproject-1.0.1/build.mak.in +++ b/sflphone-common/libs/pjproject-1.0.2/build.mak.in @@ -10,8 +10,8 @@ export LINUX_POLL := @ac_linux_poll@ LIB_SUFFIX = $(TARGET_NAME).a # Determine which party libraries to use -export APP_THIRD_PARTY_LIBS := -lresample-$(TARGET_NAME) -lmilenage-$(TARGET_NAME) -lsrtp-$(TARGET_NAME) -export APP_THIRD_PARTY_LIB_FILES = $(PJ_DIR)/third_party/lib/libresample-$(LIB_SUFFIX) $(PJ_DIR)/third_party/lib/libmilenage-$(LIB_SUFFIX) $(PJ_DIR)/third_party/lib/libsrtp-$(LIB_SUFFIX) +export APP_THIRD_PARTY_LIBS := -lresample-$(TARGET_NAME) -lsrtp-$(TARGET_NAME) +export APP_THIRD_PARTY_LIB_FILES = $(PJ_DIR)/third_party/lib/libresample-$(LIB_SUFFIX) $(PJ_DIR)/third_party/lib/libsrtp-$(LIB_SUFFIX) ifneq (@ac_no_gsm_codec@,1) APP_THIRD_PARTY_LIBS += -lgsmcodec-$(TARGET_NAME) diff --git a/sflphone-common/libs/pjproject-1.0.1/build.symbian/00.bat b/sflphone-common/libs/pjproject-1.0.2/build.symbian/00.bat similarity index 81% rename from sflphone-common/libs/pjproject-1.0.1/build.symbian/00.bat rename to sflphone-common/libs/pjproject-1.0.2/build.symbian/00.bat index 6a9a63522c3c0397b97113a10cdfaab332a75208..4d41259dfa4e3023026f4b99d85cce0010ebb2a4 100644 --- a/sflphone-common/libs/pjproject-1.0.1/build.symbian/00.bat +++ b/sflphone-common/libs/pjproject-1.0.2/build.symbian/00.bat @@ -3,4 +3,5 @@ @rem set EPOCROOT=\Symbian\9.1\S60_3rd_MR_2\ @rem set EPOCROOT=\Symbian\UIQ3SDK\ @rem set EPOCROOT=\symbian\UIQ3.1\ +@rem set EPOCROOT=\symbian\9.2\S60_3rd_FP1\ bldmake bldfiles diff --git a/sflphone-common/libs/pjproject-1.0.1/build.symbian/01.bat b/sflphone-common/libs/pjproject-1.0.2/build.symbian/01.bat similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/build.symbian/01.bat rename to sflphone-common/libs/pjproject-1.0.2/build.symbian/01.bat diff --git a/sflphone-common/libs/pjproject-1.0.1/build.symbian/bld.inf b/sflphone-common/libs/pjproject-1.0.2/build.symbian/bld.inf similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/build.symbian/bld.inf rename to sflphone-common/libs/pjproject-1.0.2/build.symbian/bld.inf diff --git a/sflphone-common/libs/pjproject-1.0.1/build.symbian/libgsmcodec.mmp b/sflphone-common/libs/pjproject-1.0.2/build.symbian/libgsmcodec.mmp similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/build.symbian/libgsmcodec.mmp rename to sflphone-common/libs/pjproject-1.0.2/build.symbian/libgsmcodec.mmp diff --git a/sflphone-common/libs/pjproject-1.0.1/build.symbian/libspeexcodec.mmp b/sflphone-common/libs/pjproject-1.0.2/build.symbian/libspeexcodec.mmp similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/build.symbian/libspeexcodec.mmp rename to sflphone-common/libs/pjproject-1.0.2/build.symbian/libspeexcodec.mmp diff --git a/sflphone-common/libs/pjproject-1.0.1/build.symbian/libsrtp.mmp b/sflphone-common/libs/pjproject-1.0.2/build.symbian/libsrtp.mmp similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/build.symbian/libsrtp.mmp rename to sflphone-common/libs/pjproject-1.0.2/build.symbian/libsrtp.mmp diff --git a/sflphone-common/libs/pjproject-1.0.1/build.symbian/makedef.sh b/sflphone-common/libs/pjproject-1.0.2/build.symbian/makedef.sh similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/build.symbian/makedef.sh rename to sflphone-common/libs/pjproject-1.0.2/build.symbian/makedef.sh diff --git a/sflphone-common/libs/pjproject-1.0.1/build.symbian/null_audio.mmp b/sflphone-common/libs/pjproject-1.0.2/build.symbian/null_audio.mmp similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/build.symbian/null_audio.mmp rename to sflphone-common/libs/pjproject-1.0.2/build.symbian/null_audio.mmp diff --git a/sflphone-common/libs/pjproject-1.0.1/build.symbian/null_audioU.def b/sflphone-common/libs/pjproject-1.0.2/build.symbian/null_audioU.def similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/build.symbian/null_audioU.def rename to sflphone-common/libs/pjproject-1.0.2/build.symbian/null_audioU.def diff --git a/sflphone-common/libs/pjproject-1.0.1/build.symbian/pjlib.mmp b/sflphone-common/libs/pjproject-1.0.2/build.symbian/pjlib.mmp similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/build.symbian/pjlib.mmp rename to sflphone-common/libs/pjproject-1.0.2/build.symbian/pjlib.mmp diff --git a/sflphone-common/libs/pjproject-1.0.1/build.symbian/pjlibU.def b/sflphone-common/libs/pjproject-1.0.2/build.symbian/pjlibU.def similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/build.symbian/pjlibU.def rename to sflphone-common/libs/pjproject-1.0.2/build.symbian/pjlibU.def diff --git a/sflphone-common/libs/pjproject-1.0.1/build.symbian/pjlib_test.mmp b/sflphone-common/libs/pjproject-1.0.2/build.symbian/pjlib_test.mmp similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/build.symbian/pjlib_test.mmp rename to sflphone-common/libs/pjproject-1.0.2/build.symbian/pjlib_test.mmp diff --git a/sflphone-common/libs/pjproject-1.0.1/build.symbian/pjlib_util.mmp b/sflphone-common/libs/pjproject-1.0.2/build.symbian/pjlib_util.mmp similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/build.symbian/pjlib_util.mmp rename to sflphone-common/libs/pjproject-1.0.2/build.symbian/pjlib_util.mmp diff --git a/sflphone-common/libs/pjproject-1.0.1/build.symbian/pjlib_utilU.def b/sflphone-common/libs/pjproject-1.0.2/build.symbian/pjlib_utilU.def similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/build.symbian/pjlib_utilU.def rename to sflphone-common/libs/pjproject-1.0.2/build.symbian/pjlib_utilU.def diff --git a/sflphone-common/libs/pjproject-1.0.1/build.symbian/pjmedia.mmp b/sflphone-common/libs/pjproject-1.0.2/build.symbian/pjmedia.mmp similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/build.symbian/pjmedia.mmp rename to sflphone-common/libs/pjproject-1.0.2/build.symbian/pjmedia.mmp diff --git a/sflphone-common/libs/pjproject-1.0.1/build.symbian/pjmediaU.def b/sflphone-common/libs/pjproject-1.0.2/build.symbian/pjmediaU.def similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/build.symbian/pjmediaU.def rename to sflphone-common/libs/pjproject-1.0.2/build.symbian/pjmediaU.def diff --git a/sflphone-common/libs/pjproject-1.0.1/build.symbian/pjnath.mmp b/sflphone-common/libs/pjproject-1.0.2/build.symbian/pjnath.mmp similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/build.symbian/pjnath.mmp rename to sflphone-common/libs/pjproject-1.0.2/build.symbian/pjnath.mmp diff --git a/sflphone-common/libs/pjproject-1.0.1/build.symbian/pjnathU.def b/sflphone-common/libs/pjproject-1.0.2/build.symbian/pjnathU.def similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/build.symbian/pjnathU.def rename to sflphone-common/libs/pjproject-1.0.2/build.symbian/pjnathU.def diff --git a/sflphone-common/libs/pjproject-1.0.1/build.symbian/pjproject.cww b/sflphone-common/libs/pjproject-1.0.2/build.symbian/pjproject.cww similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/build.symbian/pjproject.cww rename to sflphone-common/libs/pjproject-1.0.2/build.symbian/pjproject.cww diff --git a/sflphone-common/libs/pjproject-1.0.1/build.symbian/pjsdp.mmp b/sflphone-common/libs/pjproject-1.0.2/build.symbian/pjsdp.mmp similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/build.symbian/pjsdp.mmp rename to sflphone-common/libs/pjproject-1.0.2/build.symbian/pjsdp.mmp diff --git a/sflphone-common/libs/pjproject-1.0.1/build.symbian/pjsdpU.def b/sflphone-common/libs/pjproject-1.0.2/build.symbian/pjsdpU.def similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/build.symbian/pjsdpU.def rename to sflphone-common/libs/pjproject-1.0.2/build.symbian/pjsdpU.def diff --git a/sflphone-common/libs/pjproject-1.0.1/build.symbian/pjsip.mmp b/sflphone-common/libs/pjproject-1.0.2/build.symbian/pjsip.mmp similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/build.symbian/pjsip.mmp rename to sflphone-common/libs/pjproject-1.0.2/build.symbian/pjsip.mmp diff --git a/sflphone-common/libs/pjproject-1.0.1/build.symbian/pjsipU.def b/sflphone-common/libs/pjproject-1.0.2/build.symbian/pjsipU.def similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/build.symbian/pjsipU.def rename to sflphone-common/libs/pjproject-1.0.2/build.symbian/pjsipU.def diff --git a/sflphone-common/libs/pjproject-1.0.1/build.symbian/pjsip_simple.mmp b/sflphone-common/libs/pjproject-1.0.2/build.symbian/pjsip_simple.mmp similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/build.symbian/pjsip_simple.mmp rename to sflphone-common/libs/pjproject-1.0.2/build.symbian/pjsip_simple.mmp diff --git a/sflphone-common/libs/pjproject-1.0.1/build.symbian/pjsip_simpleU.def b/sflphone-common/libs/pjproject-1.0.2/build.symbian/pjsip_simpleU.def similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/build.symbian/pjsip_simpleU.def rename to sflphone-common/libs/pjproject-1.0.2/build.symbian/pjsip_simpleU.def diff --git a/sflphone-common/libs/pjproject-1.0.1/build.symbian/pjsip_ua.mmp b/sflphone-common/libs/pjproject-1.0.2/build.symbian/pjsip_ua.mmp similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/build.symbian/pjsip_ua.mmp rename to sflphone-common/libs/pjproject-1.0.2/build.symbian/pjsip_ua.mmp diff --git a/sflphone-common/libs/pjproject-1.0.1/build.symbian/pjsip_uaU.def b/sflphone-common/libs/pjproject-1.0.2/build.symbian/pjsip_uaU.def similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/build.symbian/pjsip_uaU.def rename to sflphone-common/libs/pjproject-1.0.2/build.symbian/pjsip_uaU.def diff --git a/sflphone-common/libs/pjproject-1.0.1/build.symbian/pjstun_client.mmp b/sflphone-common/libs/pjproject-1.0.2/build.symbian/pjstun_client.mmp similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/build.symbian/pjstun_client.mmp rename to sflphone-common/libs/pjproject-1.0.2/build.symbian/pjstun_client.mmp diff --git a/sflphone-common/libs/pjproject-1.0.1/build.symbian/pjsua_lib.mmp b/sflphone-common/libs/pjproject-1.0.2/build.symbian/pjsua_lib.mmp similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/build.symbian/pjsua_lib.mmp rename to sflphone-common/libs/pjproject-1.0.2/build.symbian/pjsua_lib.mmp diff --git a/sflphone-common/libs/pjproject-1.0.1/build.symbian/pjsua_libU.def b/sflphone-common/libs/pjproject-1.0.2/build.symbian/pjsua_libU.def similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/build.symbian/pjsua_libU.def rename to sflphone-common/libs/pjproject-1.0.2/build.symbian/pjsua_libU.def diff --git a/sflphone-common/libs/pjproject-1.0.1/build.symbian/symbian_audio.mmp b/sflphone-common/libs/pjproject-1.0.2/build.symbian/symbian_audio.mmp similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/build.symbian/symbian_audio.mmp rename to sflphone-common/libs/pjproject-1.0.2/build.symbian/symbian_audio.mmp diff --git a/sflphone-common/libs/pjproject-1.0.1/build.symbian/symbian_audioU.def b/sflphone-common/libs/pjproject-1.0.2/build.symbian/symbian_audioU.def similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/build.symbian/symbian_audioU.def rename to sflphone-common/libs/pjproject-1.0.2/build.symbian/symbian_audioU.def diff --git a/sflphone-common/libs/pjproject-1.0.1/build.symbian/symbian_audio_aps.mmp b/sflphone-common/libs/pjproject-1.0.2/build.symbian/symbian_audio_aps.mmp similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/build.symbian/symbian_audio_aps.mmp rename to sflphone-common/libs/pjproject-1.0.2/build.symbian/symbian_audio_aps.mmp diff --git a/sflphone-common/libs/pjproject-1.0.1/build.symbian/symbian_ua.mmp b/sflphone-common/libs/pjproject-1.0.2/build.symbian/symbian_ua.mmp similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/build.symbian/symbian_ua.mmp rename to sflphone-common/libs/pjproject-1.0.2/build.symbian/symbian_ua.mmp diff --git a/sflphone-common/libs/pjproject-1.0.1/build.symbian/symbian_ua_udeb.pkg b/sflphone-common/libs/pjproject-1.0.2/build.symbian/symbian_ua_udeb.pkg similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/build.symbian/symbian_ua_udeb.pkg rename to sflphone-common/libs/pjproject-1.0.2/build.symbian/symbian_ua_udeb.pkg diff --git a/sflphone-common/libs/pjproject-1.0.1/build.symbian/symbian_ua_urel.pkg b/sflphone-common/libs/pjproject-1.0.2/build.symbian/symbian_ua_urel.pkg similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/build.symbian/symbian_ua_urel.pkg rename to sflphone-common/libs/pjproject-1.0.2/build.symbian/symbian_ua_urel.pkg diff --git a/sflphone-common/libs/pjproject-1.0.1/build.symbian/symsndtest.mmp b/sflphone-common/libs/pjproject-1.0.2/build.symbian/symsndtest.mmp similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/build.symbian/symsndtest.mmp rename to sflphone-common/libs/pjproject-1.0.2/build.symbian/symsndtest.mmp diff --git a/sflphone-common/libs/pjproject-1.0.1/build.symbian/symsndtest.pkg b/sflphone-common/libs/pjproject-1.0.2/build.symbian/symsndtest.pkg similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/build.symbian/symsndtest.pkg rename to sflphone-common/libs/pjproject-1.0.2/build.symbian/symsndtest.pkg diff --git a/sflphone-common/libs/pjproject-1.0.1/build/cc-gcc.mak b/sflphone-common/libs/pjproject-1.0.2/build/cc-gcc.mak similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/build/cc-gcc.mak rename to sflphone-common/libs/pjproject-1.0.2/build/cc-gcc.mak diff --git a/sflphone-common/libs/pjproject-1.0.1/build/cc-vc.mak b/sflphone-common/libs/pjproject-1.0.2/build/cc-vc.mak similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/build/cc-vc.mak rename to sflphone-common/libs/pjproject-1.0.2/build/cc-vc.mak diff --git a/sflphone-common/libs/pjproject-1.0.1/build/common.mak b/sflphone-common/libs/pjproject-1.0.2/build/common.mak similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/build/common.mak rename to sflphone-common/libs/pjproject-1.0.2/build/common.mak diff --git a/sflphone-common/libs/pjproject-1.0.1/build/host-mingw.mak b/sflphone-common/libs/pjproject-1.0.2/build/host-mingw.mak similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/build/host-mingw.mak rename to sflphone-common/libs/pjproject-1.0.2/build/host-mingw.mak diff --git a/sflphone-common/libs/pjproject-1.0.1/build/host-unix.mak b/sflphone-common/libs/pjproject-1.0.2/build/host-unix.mak similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/build/host-unix.mak rename to sflphone-common/libs/pjproject-1.0.2/build/host-unix.mak diff --git a/sflphone-common/libs/pjproject-1.0.1/build/host-win32.mak b/sflphone-common/libs/pjproject-1.0.2/build/host-win32.mak similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/build/host-win32.mak rename to sflphone-common/libs/pjproject-1.0.2/build/host-win32.mak diff --git a/sflphone-common/libs/pjproject-1.0.1/build/m-alpha.mak b/sflphone-common/libs/pjproject-1.0.2/build/m-alpha.mak similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/build/m-alpha.mak rename to sflphone-common/libs/pjproject-1.0.2/build/m-alpha.mak diff --git a/sflphone-common/libs/pjproject-1.0.1/build/m-arm.mak b/sflphone-common/libs/pjproject-1.0.2/build/m-arm.mak similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/build/m-arm.mak rename to sflphone-common/libs/pjproject-1.0.2/build/m-arm.mak diff --git a/sflphone-common/libs/pjproject-1.0.1/build/m-auto.mak b/sflphone-common/libs/pjproject-1.0.2/build/m-auto.mak similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/build/m-auto.mak rename to sflphone-common/libs/pjproject-1.0.2/build/m-auto.mak diff --git a/sflphone-common/libs/pjproject-1.0.1/build/m-i386.mak b/sflphone-common/libs/pjproject-1.0.2/build/m-i386.mak similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/build/m-i386.mak rename to sflphone-common/libs/pjproject-1.0.2/build/m-i386.mak diff --git a/sflphone-common/libs/pjproject-1.0.1/build/m-m68k.mak b/sflphone-common/libs/pjproject-1.0.2/build/m-m68k.mak similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/build/m-m68k.mak rename to sflphone-common/libs/pjproject-1.0.2/build/m-m68k.mak diff --git a/sflphone-common/libs/pjproject-1.0.1/build/m-mpc860.mak b/sflphone-common/libs/pjproject-1.0.2/build/m-mpc860.mak similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/build/m-mpc860.mak rename to sflphone-common/libs/pjproject-1.0.2/build/m-mpc860.mak diff --git a/sflphone-common/libs/pjproject-1.0.1/build/m-powerpc.mak b/sflphone-common/libs/pjproject-1.0.2/build/m-powerpc.mak similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/build/m-powerpc.mak rename to sflphone-common/libs/pjproject-1.0.2/build/m-powerpc.mak diff --git a/sflphone-common/libs/pjproject-1.0.1/build/m-sparc.mak b/sflphone-common/libs/pjproject-1.0.2/build/m-sparc.mak similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/build/m-sparc.mak rename to sflphone-common/libs/pjproject-1.0.2/build/m-sparc.mak diff --git a/sflphone-common/libs/pjproject-1.0.1/build/m-x86_64.mak b/sflphone-common/libs/pjproject-1.0.2/build/m-x86_64.mak similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/build/m-x86_64.mak rename to sflphone-common/libs/pjproject-1.0.2/build/m-x86_64.mak diff --git a/sflphone-common/libs/pjproject-1.0.2/build/os-auto.mak b/sflphone-common/libs/pjproject-1.0.2/build/os-auto.mak new file mode 100644 index 0000000000000000000000000000000000000000..f88de8f7e39bf8bb66fbe8975178b957c9e01ed1 --- /dev/null +++ b/sflphone-common/libs/pjproject-1.0.2/build/os-auto.mak @@ -0,0 +1,11 @@ +# build/os-auto.mak. Generated from os-auto.mak.in by configure. + +export OS_CFLAGS := $(CC_DEF)PJ_AUTOCONF=1 -O2 + +export OS_CXXFLAGS := $(CC_DEF)PJ_AUTOCONF=1 -O2 + +export OS_LDFLAGS := -lm -luuid -lnsl -lrt -lpthread -lasound + +export OS_SOURCES := + + diff --git a/sflphone-common/libs/pjproject-1.0.1/build/os-auto.mak.in b/sflphone-common/libs/pjproject-1.0.2/build/os-auto.mak.in similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/build/os-auto.mak.in rename to sflphone-common/libs/pjproject-1.0.2/build/os-auto.mak.in diff --git a/sflphone-common/libs/pjproject-1.0.1/build/os-darwinos.mak b/sflphone-common/libs/pjproject-1.0.2/build/os-darwinos.mak similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/build/os-darwinos.mak rename to sflphone-common/libs/pjproject-1.0.2/build/os-darwinos.mak diff --git a/sflphone-common/libs/pjproject-1.0.1/build/os-linux-kernel.mak b/sflphone-common/libs/pjproject-1.0.2/build/os-linux-kernel.mak similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/build/os-linux-kernel.mak rename to sflphone-common/libs/pjproject-1.0.2/build/os-linux-kernel.mak diff --git a/sflphone-common/libs/pjproject-1.0.1/build/os-linux.mak b/sflphone-common/libs/pjproject-1.0.2/build/os-linux.mak similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/build/os-linux.mak rename to sflphone-common/libs/pjproject-1.0.2/build/os-linux.mak diff --git a/sflphone-common/libs/pjproject-1.0.1/build/os-palmos.mak b/sflphone-common/libs/pjproject-1.0.2/build/os-palmos.mak similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/build/os-palmos.mak rename to sflphone-common/libs/pjproject-1.0.2/build/os-palmos.mak diff --git a/sflphone-common/libs/pjproject-1.0.1/build/os-rtems.mak b/sflphone-common/libs/pjproject-1.0.2/build/os-rtems.mak similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/build/os-rtems.mak rename to sflphone-common/libs/pjproject-1.0.2/build/os-rtems.mak diff --git a/sflphone-common/libs/pjproject-1.0.1/build/os-sunos.mak b/sflphone-common/libs/pjproject-1.0.2/build/os-sunos.mak similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/build/os-sunos.mak rename to sflphone-common/libs/pjproject-1.0.2/build/os-sunos.mak diff --git a/sflphone-common/libs/pjproject-1.0.1/build/os-win32.mak b/sflphone-common/libs/pjproject-1.0.2/build/os-win32.mak similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/build/os-win32.mak rename to sflphone-common/libs/pjproject-1.0.2/build/os-win32.mak diff --git a/sflphone-common/libs/pjproject-1.0.1/build/rules.mak b/sflphone-common/libs/pjproject-1.0.2/build/rules.mak similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/build/rules.mak rename to sflphone-common/libs/pjproject-1.0.2/build/rules.mak diff --git a/sflphone-common/libs/pjproject-1.0.1/c++-build.mak b/sflphone-common/libs/pjproject-1.0.2/c++-build.mak similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/c++-build.mak rename to sflphone-common/libs/pjproject-1.0.2/c++-build.mak diff --git a/sflphone-common/libs/pjproject-1.0.2/config.log b/sflphone-common/libs/pjproject-1.0.2/config.log new file mode 100644 index 0000000000000000000000000000000000000000..dc4f10f2c3fed3bb85071163efb239158e1b3ec2 --- /dev/null +++ b/sflphone-common/libs/pjproject-1.0.2/config.log @@ -0,0 +1,2905 @@ +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by pjproject aconfigure 1.0, which was +generated by GNU Autoconf 2.59. Invocation command line was + + $ ./aconfigure + +## --------- ## +## Platform. ## +## --------- ## + +hostname = emilou-desktop +uname -m = x86_64 +uname -r = 2.6.28-11-generic +uname -s = Linux +uname -v = #42-Ubuntu SMP Fri Apr 17 01:58:03 UTC 2009 + +/usr/bin/uname -p = unknown +/bin/uname -X = unknown + +/bin/arch = unknown +/usr/bin/arch -k = unknown +/usr/convex/getsysinfo = unknown +hostinfo = unknown +/bin/machine = unknown +/usr/bin/oslevel = unknown +/bin/universe = unknown + +PATH: /usr/local/sbin +PATH: /usr/local/bin +PATH: /usr/sbin +PATH: /usr/bin +PATH: /sbin +PATH: /bin +PATH: /usr/games +PATH: /usr/local/share/OpenSceneGraph/bin + + +## ----------- ## +## Core tests. ## +## ----------- ## + +aconfigure:1377: checking build system type +aconfigure:1395: result: x86_64-unknown-linux-gnu +aconfigure:1403: checking host system type +aconfigure:1417: result: x86_64-unknown-linux-gnu +aconfigure:1425: checking target system type +aconfigure:1439: result: x86_64-unknown-linux-gnu +aconfigure:1513: checking for gcc +aconfigure:1529: found /usr/bin/gcc +aconfigure:1539: result: gcc +aconfigure:1783: checking for C compiler version +aconfigure:1786: gcc --version </dev/null >&5 +gcc (Ubuntu 4.3.3-5ubuntu4) 4.3.3 +Copyright (C) 2008 Free Software Foundation, Inc. +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +aconfigure:1789: $? = 0 +aconfigure:1791: gcc -v </dev/null >&5 +Using built-in specs. +Target: x86_64-linux-gnu +Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.3.3-5ubuntu4' --with-bugurl=file:///usr/share/doc/gcc-4.3/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --with-gxx-include-dir=/usr/include/c++/4.3 --program-suffix=-4.3 --enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --enable-mpfr --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu +Thread model: posix +gcc version 4.3.3 (Ubuntu 4.3.3-5ubuntu4) +aconfigure:1794: $? = 0 +aconfigure:1796: gcc -V </dev/null >&5 +gcc: '-V' option must have argument +aconfigure:1799: $? = 1 +aconfigure:1822: checking for C compiler default output file name +aconfigure:1825: gcc -O2 conftest.c >&5 +aconfigure:1828: $? = 0 +aconfigure:1874: result: a.out +aconfigure:1879: checking whether the C compiler works +aconfigure:1885: ./a.out +aconfigure:1888: $? = 0 +aconfigure:1905: result: yes +aconfigure:1912: checking whether we are cross compiling +aconfigure:1914: result: no +aconfigure:1917: checking for suffix of executables +aconfigure:1919: gcc -o conftest -O2 conftest.c >&5 +aconfigure:1922: $? = 0 +aconfigure:1947: result: +aconfigure:1953: checking for suffix of object files +aconfigure:1974: gcc -c -O2 conftest.c >&5 +aconfigure:1977: $? = 0 +aconfigure:1999: result: o +aconfigure:2003: checking whether we are using the GNU C compiler +aconfigure:2027: gcc -c -O2 conftest.c >&5 +aconfigure:2033: $? = 0 +aconfigure:2037: test -z + || test ! -s conftest.err +aconfigure:2040: $? = 0 +aconfigure:2043: test -s conftest.o +aconfigure:2046: $? = 0 +aconfigure:2059: result: yes +aconfigure:2065: checking whether gcc accepts -g +aconfigure:2086: gcc -c -g conftest.c >&5 +aconfigure:2092: $? = 0 +aconfigure:2096: test -z + || test ! -s conftest.err +aconfigure:2099: $? = 0 +aconfigure:2102: test -s conftest.o +aconfigure:2105: $? = 0 +aconfigure:2116: result: yes +aconfigure:2133: checking for gcc option to accept ANSI C +aconfigure:2203: gcc -c -O2 conftest.c >&5 +aconfigure:2209: $? = 0 +aconfigure:2213: test -z + || test ! -s conftest.err +aconfigure:2216: $? = 0 +aconfigure:2219: test -s conftest.o +aconfigure:2222: $? = 0 +aconfigure:2240: result: none needed +aconfigure:2258: gcc -c -O2 conftest.c >&5 +conftest.c:2: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'me' +aconfigure:2264: $? = 1 +aconfigure: failed program was: +| #ifndef __cplusplus +| choke me +| #endif +aconfigure:2449: checking for g++ +aconfigure:2465: found /usr/bin/g++ +aconfigure:2475: result: g++ +aconfigure:2491: checking for C++ compiler version +aconfigure:2494: g++ --version </dev/null >&5 +g++ (Ubuntu 4.3.3-5ubuntu4) 4.3.3 +Copyright (C) 2008 Free Software Foundation, Inc. +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +aconfigure:2497: $? = 0 +aconfigure:2499: g++ -v </dev/null >&5 +Using built-in specs. +Target: x86_64-linux-gnu +Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.3.3-5ubuntu4' --with-bugurl=file:///usr/share/doc/gcc-4.3/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --with-gxx-include-dir=/usr/include/c++/4.3 --program-suffix=-4.3 --enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --enable-mpfr --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu +Thread model: posix +gcc version 4.3.3 (Ubuntu 4.3.3-5ubuntu4) +aconfigure:2502: $? = 0 +aconfigure:2504: g++ -V </dev/null >&5 +g++: '-V' option must have argument +aconfigure:2507: $? = 1 +aconfigure:2510: checking whether we are using the GNU C++ compiler +aconfigure:2534: g++ -c -O2 conftest.cc >&5 +aconfigure:2540: $? = 0 +aconfigure:2544: test -z + || test ! -s conftest.err +aconfigure:2547: $? = 0 +aconfigure:2550: test -s conftest.o +aconfigure:2553: $? = 0 +aconfigure:2566: result: yes +aconfigure:2572: checking whether g++ accepts -g +aconfigure:2593: g++ -c -g conftest.cc >&5 +aconfigure:2599: $? = 0 +aconfigure:2603: test -z + || test ! -s conftest.err +aconfigure:2606: $? = 0 +aconfigure:2609: test -s conftest.o +aconfigure:2612: $? = 0 +aconfigure:2623: result: yes +aconfigure:2665: g++ -c -O2 conftest.cc >&5 +aconfigure:2671: $? = 0 +aconfigure:2675: test -z + || test ! -s conftest.err +aconfigure:2678: $? = 0 +aconfigure:2681: test -s conftest.o +aconfigure:2684: $? = 0 +aconfigure:2710: g++ -c -O2 conftest.cc >&5 +conftest.cc: In function 'int main()': +conftest.cc:13: error: 'exit' was not declared in this scope +aconfigure:2716: $? = 1 +aconfigure: failed program was: +| /* confdefs.h. */ +| +| #define PACKAGE_NAME "pjproject" +| #define PACKAGE_TARNAME "pjproject" +| #define PACKAGE_VERSION "1.0" +| #define PACKAGE_STRING "pjproject 1.0" +| #define PACKAGE_BUGREPORT "" +| /* end confdefs.h. */ +| +| int +| main () +| { +| exit (42); +| ; +| return 0; +| } +aconfigure:2665: g++ -c -O2 conftest.cc >&5 +conftest.cc:9: error: 'void std::exit(int)' should have been declared inside 'std' +aconfigure:2671: $? = 1 +aconfigure: failed program was: +| /* confdefs.h. */ +| +| #define PACKAGE_NAME "pjproject" +| #define PACKAGE_TARNAME "pjproject" +| #define PACKAGE_VERSION "1.0" +| #define PACKAGE_STRING "pjproject 1.0" +| #define PACKAGE_BUGREPORT "" +| /* end confdefs.h. */ +| extern "C" void std::exit (int) throw (); using std::exit; +| #include <stdlib.h> +| int +| main () +| { +| exit (42); +| ; +| return 0; +| } +aconfigure:2665: g++ -c -O2 conftest.cc >&5 +conftest.cc:9: error: 'void std::exit(int)' should have been declared inside 'std' +In file included from conftest.cc:10: +/usr/include/stdlib.h:531: error: declaration of 'void std::exit(int) throw ()' throws different exceptions +conftest.cc:9: error: from previous declaration 'void std::exit(int)' +aconfigure:2671: $? = 1 +aconfigure: failed program was: +| /* confdefs.h. */ +| +| #define PACKAGE_NAME "pjproject" +| #define PACKAGE_TARNAME "pjproject" +| #define PACKAGE_VERSION "1.0" +| #define PACKAGE_STRING "pjproject 1.0" +| #define PACKAGE_BUGREPORT "" +| /* end confdefs.h. */ +| extern "C" void std::exit (int); using std::exit; +| #include <stdlib.h> +| int +| main () +| { +| exit (42); +| ; +| return 0; +| } +aconfigure:2665: g++ -c -O2 conftest.cc >&5 +aconfigure:2671: $? = 0 +aconfigure:2675: test -z + || test ! -s conftest.err +aconfigure:2678: $? = 0 +aconfigure:2681: test -s conftest.o +aconfigure:2684: $? = 0 +aconfigure:2710: g++ -c -O2 conftest.cc >&5 +aconfigure:2716: $? = 0 +aconfigure:2720: test -z + || test ! -s conftest.err +aconfigure:2723: $? = 0 +aconfigure:2726: test -s conftest.o +aconfigure:2729: $? = 0 +aconfigure:2772: checking for pthread_create in -lpthread +aconfigure:2802: gcc -o conftest -O2 conftest.c -lpthread >&5 +aconfigure:2808: $? = 0 +aconfigure:2812: test -z + || test ! -s conftest.err +aconfigure:2815: $? = 0 +aconfigure:2818: test -s conftest +aconfigure:2821: $? = 0 +aconfigure:2834: result: yes +aconfigure:2846: checking for puts in -lwsock32 +aconfigure:2876: gcc -o conftest -O2 conftest.c -lwsock32 -lpthread >&5 +conftest.c:20: warning: conflicting types for built-in function 'puts' +/usr/bin/ld: cannot find -lwsock32 +collect2: ld returned 1 exit status +aconfigure:2882: $? = 1 +aconfigure: failed program was: +| /* confdefs.h. */ +| +| #define PACKAGE_NAME "pjproject" +| #define PACKAGE_TARNAME "pjproject" +| #define PACKAGE_VERSION "1.0" +| #define PACKAGE_STRING "pjproject 1.0" +| #define PACKAGE_BUGREPORT "" +| #ifdef __cplusplus +| extern "C" void exit (int) throw (); +| #endif +| #define HAVE_LIBPTHREAD 1 +| /* end confdefs.h. */ +| +| /* Override any gcc2 internal prototype to avoid an error. */ +| #ifdef __cplusplus +| extern "C" +| #endif +| /* We use char because int might match the return type of a gcc2 +| builtin and then its argument prototype would still apply. */ +| char puts (); +| int +| main () +| { +| puts (); +| ; +| return 0; +| } +aconfigure:2908: result: no +aconfigure:2920: checking for puts in -lws2_32 +aconfigure:2950: gcc -o conftest -O2 conftest.c -lws2_32 -lpthread >&5 +conftest.c:20: warning: conflicting types for built-in function 'puts' +/usr/bin/ld: cannot find -lws2_32 +collect2: ld returned 1 exit status +aconfigure:2956: $? = 1 +aconfigure: failed program was: +| /* confdefs.h. */ +| +| #define PACKAGE_NAME "pjproject" +| #define PACKAGE_TARNAME "pjproject" +| #define PACKAGE_VERSION "1.0" +| #define PACKAGE_STRING "pjproject 1.0" +| #define PACKAGE_BUGREPORT "" +| #ifdef __cplusplus +| extern "C" void exit (int) throw (); +| #endif +| #define HAVE_LIBPTHREAD 1 +| /* end confdefs.h. */ +| +| /* Override any gcc2 internal prototype to avoid an error. */ +| #ifdef __cplusplus +| extern "C" +| #endif +| /* We use char because int might match the return type of a gcc2 +| builtin and then its argument prototype would still apply. */ +| char puts (); +| int +| main () +| { +| puts (); +| ; +| return 0; +| } +aconfigure:2982: result: no +aconfigure:2994: checking for puts in -lole32 +aconfigure:3024: gcc -o conftest -O2 conftest.c -lole32 -lpthread >&5 +conftest.c:20: warning: conflicting types for built-in function 'puts' +/usr/bin/ld: cannot find -lole32 +collect2: ld returned 1 exit status +aconfigure:3030: $? = 1 +aconfigure: failed program was: +| /* confdefs.h. */ +| +| #define PACKAGE_NAME "pjproject" +| #define PACKAGE_TARNAME "pjproject" +| #define PACKAGE_VERSION "1.0" +| #define PACKAGE_STRING "pjproject 1.0" +| #define PACKAGE_BUGREPORT "" +| #ifdef __cplusplus +| extern "C" void exit (int) throw (); +| #endif +| #define HAVE_LIBPTHREAD 1 +| /* end confdefs.h. */ +| +| /* Override any gcc2 internal prototype to avoid an error. */ +| #ifdef __cplusplus +| extern "C" +| #endif +| /* We use char because int might match the return type of a gcc2 +| builtin and then its argument prototype would still apply. */ +| char puts (); +| int +| main () +| { +| puts (); +| ; +| return 0; +| } +aconfigure:3056: result: no +aconfigure:3068: checking for puts in -lwinmm +aconfigure:3098: gcc -o conftest -O2 conftest.c -lwinmm -lpthread >&5 +conftest.c:20: warning: conflicting types for built-in function 'puts' +/usr/bin/ld: cannot find -lwinmm +collect2: ld returned 1 exit status +aconfigure:3104: $? = 1 +aconfigure: failed program was: +| /* confdefs.h. */ +| +| #define PACKAGE_NAME "pjproject" +| #define PACKAGE_TARNAME "pjproject" +| #define PACKAGE_VERSION "1.0" +| #define PACKAGE_STRING "pjproject 1.0" +| #define PACKAGE_BUGREPORT "" +| #ifdef __cplusplus +| extern "C" void exit (int) throw (); +| #endif +| #define HAVE_LIBPTHREAD 1 +| /* end confdefs.h. */ +| +| /* Override any gcc2 internal prototype to avoid an error. */ +| #ifdef __cplusplus +| extern "C" +| #endif +| /* We use char because int might match the return type of a gcc2 +| builtin and then its argument prototype would still apply. */ +| char puts (); +| int +| main () +| { +| puts (); +| ; +| return 0; +| } +aconfigure:3130: result: no +aconfigure:3142: checking for puts in -lsocket +aconfigure:3172: gcc -o conftest -O2 conftest.c -lsocket -lpthread >&5 +conftest.c:20: warning: conflicting types for built-in function 'puts' +/usr/bin/ld: cannot find -lsocket +collect2: ld returned 1 exit status +aconfigure:3178: $? = 1 +aconfigure: failed program was: +| /* confdefs.h. */ +| +| #define PACKAGE_NAME "pjproject" +| #define PACKAGE_TARNAME "pjproject" +| #define PACKAGE_VERSION "1.0" +| #define PACKAGE_STRING "pjproject 1.0" +| #define PACKAGE_BUGREPORT "" +| #ifdef __cplusplus +| extern "C" void exit (int) throw (); +| #endif +| #define HAVE_LIBPTHREAD 1 +| /* end confdefs.h. */ +| +| /* Override any gcc2 internal prototype to avoid an error. */ +| #ifdef __cplusplus +| extern "C" +| #endif +| /* We use char because int might match the return type of a gcc2 +| builtin and then its argument prototype would still apply. */ +| char puts (); +| int +| main () +| { +| puts (); +| ; +| return 0; +| } +aconfigure:3204: result: no +aconfigure:3216: checking for puts in -lrt +aconfigure:3246: gcc -o conftest -O2 conftest.c -lrt -lpthread >&5 +conftest.c:20: warning: conflicting types for built-in function 'puts' +aconfigure:3252: $? = 0 +aconfigure:3256: test -z + || test ! -s conftest.err +aconfigure:3259: $? = 0 +aconfigure:3262: test -s conftest +aconfigure:3265: $? = 0 +aconfigure:3278: result: yes +aconfigure:3290: checking for puts in -lnsl +aconfigure:3320: gcc -o conftest -O2 conftest.c -lnsl -lrt -lpthread >&5 +conftest.c:21: warning: conflicting types for built-in function 'puts' +aconfigure:3326: $? = 0 +aconfigure:3330: test -z + || test ! -s conftest.err +aconfigure:3333: $? = 0 +aconfigure:3336: test -s conftest +aconfigure:3339: $? = 0 +aconfigure:3352: result: yes +aconfigure:3364: checking for uuid_generate in -luuid +aconfigure:3394: gcc -o conftest -O2 conftest.c -luuid -lnsl -lrt -lpthread >&5 +aconfigure:3400: $? = 0 +aconfigure:3404: test -z + || test ! -s conftest.err +aconfigure:3407: $? = 0 +aconfigure:3410: test -s conftest +aconfigure:3413: $? = 0 +aconfigure:3426: result: yes +aconfigure:3437: checking for uuid_generate in -luuid +aconfigure:3499: result: yes +aconfigure:3506: result: Setting PJ_M_NAME to x86_64 +aconfigure:3513: checking memory alignment +aconfigure:3521: result: 8 bytes +aconfigure:3535: checking whether byte ordering is bigendian +aconfigure:3562: gcc -c -O2 conftest.c >&5 +aconfigure:3568: $? = 0 +aconfigure:3572: test -z + || test ! -s conftest.err +aconfigure:3575: $? = 0 +aconfigure:3578: test -s conftest.o +aconfigure:3581: $? = 0 +aconfigure:3605: gcc -c -O2 conftest.c >&5 +conftest.c: In function 'main': +conftest.c:25: error: 'not' undeclared (first use in this function) +conftest.c:25: error: (Each undeclared identifier is reported only once +conftest.c:25: error: for each function it appears in.) +conftest.c:25: error: expected ';' before 'big' +aconfigure:3611: $? = 1 +aconfigure: failed program was: +| /* confdefs.h. */ +| +| #define PACKAGE_NAME "pjproject" +| #define PACKAGE_TARNAME "pjproject" +| #define PACKAGE_VERSION "1.0" +| #define PACKAGE_STRING "pjproject 1.0" +| #define PACKAGE_BUGREPORT "" +| #ifdef __cplusplus +| extern "C" void exit (int) throw (); +| #endif +| #define HAVE_LIBPTHREAD 1 +| #define HAVE_LIBRT 1 +| #define HAVE_LIBNSL 1 +| #define HAVE_LIBUUID 1 +| #define PJ_M_NAME "x86_64" +| #define PJ_POOL_ALIGNMENT 8 +| /* end confdefs.h. */ +| #include <sys/types.h> +| #include <sys/param.h> +| +| int +| main () +| { +| #if BYTE_ORDER != BIG_ENDIAN +| not big endian +| #endif +| +| ; +| return 0; +| } +aconfigure:3746: result: no +aconfigure:3829: result: Checking if floating point is disabled... no +aconfigure:3832: checking for fmod in -lm +aconfigure:3862: gcc -o conftest -O2 conftest.c -lm -luuid -lnsl -lrt -lpthread >&5 +conftest.c:27: warning: conflicting types for built-in function 'fmod' +aconfigure:3868: $? = 0 +aconfigure:3872: test -z + || test ! -s conftest.err +aconfigure:3875: $? = 0 +aconfigure:3878: test -s conftest +aconfigure:3881: $? = 0 +aconfigure:3894: result: yes +aconfigure:3914: checking how to run the C preprocessor +aconfigure:3949: gcc -E conftest.c +aconfigure:3955: $? = 0 +aconfigure:3987: gcc -E conftest.c +conftest.c:21:28: error: ac_nonexistent.h: No such file or directory +aconfigure:3993: $? = 1 +aconfigure: failed program was: +| /* confdefs.h. */ +| +| #define PACKAGE_NAME "pjproject" +| #define PACKAGE_TARNAME "pjproject" +| #define PACKAGE_VERSION "1.0" +| #define PACKAGE_STRING "pjproject 1.0" +| #define PACKAGE_BUGREPORT "" +| #ifdef __cplusplus +| extern "C" void exit (int) throw (); +| #endif +| #define HAVE_LIBPTHREAD 1 +| #define HAVE_LIBRT 1 +| #define HAVE_LIBNSL 1 +| #define HAVE_LIBUUID 1 +| #define PJ_M_NAME "x86_64" +| #define PJ_POOL_ALIGNMENT 8 +| #define PJ_LINUX 1 +| #define PJ_HAS_FLOATING_POINT 1 +| #define HAVE_LIBM 1 +| /* end confdefs.h. */ +| #include <ac_nonexistent.h> +aconfigure:4032: result: gcc -E +aconfigure:4056: gcc -E conftest.c +aconfigure:4062: $? = 0 +aconfigure:4094: gcc -E conftest.c +conftest.c:21:28: error: ac_nonexistent.h: No such file or directory +aconfigure:4100: $? = 1 +aconfigure: failed program was: +| /* confdefs.h. */ +| +| #define PACKAGE_NAME "pjproject" +| #define PACKAGE_TARNAME "pjproject" +| #define PACKAGE_VERSION "1.0" +| #define PACKAGE_STRING "pjproject 1.0" +| #define PACKAGE_BUGREPORT "" +| #ifdef __cplusplus +| extern "C" void exit (int) throw (); +| #endif +| #define HAVE_LIBPTHREAD 1 +| #define HAVE_LIBRT 1 +| #define HAVE_LIBNSL 1 +| #define HAVE_LIBUUID 1 +| #define PJ_M_NAME "x86_64" +| #define PJ_POOL_ALIGNMENT 8 +| #define PJ_LINUX 1 +| #define PJ_HAS_FLOATING_POINT 1 +| #define HAVE_LIBM 1 +| /* end confdefs.h. */ +| #include <ac_nonexistent.h> +aconfigure:4144: checking for egrep +aconfigure:4154: result: grep -E +aconfigure:4159: checking for ANSI C header files +aconfigure:4184: gcc -c -O2 conftest.c >&5 +aconfigure:4190: $? = 0 +aconfigure:4194: test -z + || test ! -s conftest.err +aconfigure:4197: $? = 0 +aconfigure:4200: test -s conftest.o +aconfigure:4203: $? = 0 +aconfigure:4292: gcc -o conftest -O2 conftest.c -lm -luuid -lnsl -lrt -lpthread >&5 +conftest.c: In function 'main': +conftest.c:38: warning: incompatible implicit declaration of built-in function 'exit' +aconfigure:4295: $? = 0 +aconfigure:4297: ./conftest +aconfigure:4300: $? = 0 +aconfigure:4315: result: yes +aconfigure:4339: checking for sys/types.h +aconfigure:4355: gcc -c -O2 conftest.c >&5 +aconfigure:4361: $? = 0 +aconfigure:4365: test -z + || test ! -s conftest.err +aconfigure:4368: $? = 0 +aconfigure:4371: test -s conftest.o +aconfigure:4374: $? = 0 +aconfigure:4385: result: yes +aconfigure:4339: checking for sys/stat.h +aconfigure:4355: gcc -c -O2 conftest.c >&5 +aconfigure:4361: $? = 0 +aconfigure:4365: test -z + || test ! -s conftest.err +aconfigure:4368: $? = 0 +aconfigure:4371: test -s conftest.o +aconfigure:4374: $? = 0 +aconfigure:4385: result: yes +aconfigure:4339: checking for stdlib.h +aconfigure:4355: gcc -c -O2 conftest.c >&5 +aconfigure:4361: $? = 0 +aconfigure:4365: test -z + || test ! -s conftest.err +aconfigure:4368: $? = 0 +aconfigure:4371: test -s conftest.o +aconfigure:4374: $? = 0 +aconfigure:4385: result: yes +aconfigure:4339: checking for string.h +aconfigure:4355: gcc -c -O2 conftest.c >&5 +aconfigure:4361: $? = 0 +aconfigure:4365: test -z + || test ! -s conftest.err +aconfigure:4368: $? = 0 +aconfigure:4371: test -s conftest.o +aconfigure:4374: $? = 0 +aconfigure:4385: result: yes +aconfigure:4339: checking for memory.h +aconfigure:4355: gcc -c -O2 conftest.c >&5 +aconfigure:4361: $? = 0 +aconfigure:4365: test -z + || test ! -s conftest.err +aconfigure:4368: $? = 0 +aconfigure:4371: test -s conftest.o +aconfigure:4374: $? = 0 +aconfigure:4385: result: yes +aconfigure:4339: checking for strings.h +aconfigure:4355: gcc -c -O2 conftest.c >&5 +aconfigure:4361: $? = 0 +aconfigure:4365: test -z + || test ! -s conftest.err +aconfigure:4368: $? = 0 +aconfigure:4371: test -s conftest.o +aconfigure:4374: $? = 0 +aconfigure:4385: result: yes +aconfigure:4339: checking for inttypes.h +aconfigure:4355: gcc -c -O2 conftest.c >&5 +aconfigure:4361: $? = 0 +aconfigure:4365: test -z + || test ! -s conftest.err +aconfigure:4368: $? = 0 +aconfigure:4371: test -s conftest.o +aconfigure:4374: $? = 0 +aconfigure:4385: result: yes +aconfigure:4339: checking for stdint.h +aconfigure:4355: gcc -c -O2 conftest.c >&5 +aconfigure:4361: $? = 0 +aconfigure:4365: test -z + || test ! -s conftest.err +aconfigure:4368: $? = 0 +aconfigure:4371: test -s conftest.o +aconfigure:4374: $? = 0 +aconfigure:4385: result: yes +aconfigure:4339: checking for unistd.h +aconfigure:4355: gcc -c -O2 conftest.c >&5 +aconfigure:4361: $? = 0 +aconfigure:4365: test -z + || test ! -s conftest.err +aconfigure:4368: $? = 0 +aconfigure:4371: test -s conftest.o +aconfigure:4374: $? = 0 +aconfigure:4385: result: yes +aconfigure:4407: checking arpa/inet.h usability +aconfigure:4419: gcc -c -O2 conftest.c >&5 +aconfigure:4425: $? = 0 +aconfigure:4429: test -z + || test ! -s conftest.err +aconfigure:4432: $? = 0 +aconfigure:4435: test -s conftest.o +aconfigure:4438: $? = 0 +aconfigure:4448: result: yes +aconfigure:4452: checking arpa/inet.h presence +aconfigure:4462: gcc -E conftest.c +aconfigure:4468: $? = 0 +aconfigure:4488: result: yes +aconfigure:4523: checking for arpa/inet.h +aconfigure:4530: result: yes +aconfigure:4552: checking assert.h usability +aconfigure:4564: gcc -c -O2 conftest.c >&5 +aconfigure:4570: $? = 0 +aconfigure:4574: test -z + || test ! -s conftest.err +aconfigure:4577: $? = 0 +aconfigure:4580: test -s conftest.o +aconfigure:4583: $? = 0 +aconfigure:4593: result: yes +aconfigure:4597: checking assert.h presence +aconfigure:4607: gcc -E conftest.c +aconfigure:4613: $? = 0 +aconfigure:4633: result: yes +aconfigure:4668: checking for assert.h +aconfigure:4675: result: yes +aconfigure:4697: checking ctype.h usability +aconfigure:4709: gcc -c -O2 conftest.c >&5 +aconfigure:4715: $? = 0 +aconfigure:4719: test -z + || test ! -s conftest.err +aconfigure:4722: $? = 0 +aconfigure:4725: test -s conftest.o +aconfigure:4728: $? = 0 +aconfigure:4738: result: yes +aconfigure:4742: checking ctype.h presence +aconfigure:4752: gcc -E conftest.c +aconfigure:4758: $? = 0 +aconfigure:4778: result: yes +aconfigure:4813: checking for ctype.h +aconfigure:4820: result: yes +aconfigure:4851: checking errno.h usability +aconfigure:4863: gcc -c -O2 conftest.c >&5 +aconfigure:4869: $? = 0 +aconfigure:4873: test -z + || test ! -s conftest.err +aconfigure:4876: $? = 0 +aconfigure:4879: test -s conftest.o +aconfigure:4882: $? = 0 +aconfigure:4892: result: yes +aconfigure:4896: checking errno.h presence +aconfigure:4906: gcc -E conftest.c +aconfigure:4912: $? = 0 +aconfigure:4932: result: yes +aconfigure:4967: checking for errno.h +aconfigure:4974: result: yes +aconfigure:4999: checking fcntl.h usability +aconfigure:5011: gcc -c -O2 conftest.c >&5 +aconfigure:5017: $? = 0 +aconfigure:5021: test -z + || test ! -s conftest.err +aconfigure:5024: $? = 0 +aconfigure:5027: test -s conftest.o +aconfigure:5030: $? = 0 +aconfigure:5040: result: yes +aconfigure:5044: checking fcntl.h presence +aconfigure:5054: gcc -E conftest.c +aconfigure:5060: $? = 0 +aconfigure:5080: result: yes +aconfigure:5115: checking for fcntl.h +aconfigure:5122: result: yes +aconfigure:5144: checking linux/socket.h usability +aconfigure:5156: gcc -c -O2 conftest.c >&5 +aconfigure:5162: $? = 0 +aconfigure:5166: test -z + || test ! -s conftest.err +aconfigure:5169: $? = 0 +aconfigure:5172: test -s conftest.o +aconfigure:5175: $? = 0 +aconfigure:5185: result: yes +aconfigure:5189: checking linux/socket.h presence +aconfigure:5199: gcc -E conftest.c +aconfigure:5205: $? = 0 +aconfigure:5225: result: yes +aconfigure:5260: checking for linux/socket.h +aconfigure:5267: result: yes +aconfigure:5289: checking malloc.h usability +aconfigure:5301: gcc -c -O2 conftest.c >&5 +aconfigure:5307: $? = 0 +aconfigure:5311: test -z + || test ! -s conftest.err +aconfigure:5314: $? = 0 +aconfigure:5317: test -s conftest.o +aconfigure:5320: $? = 0 +aconfigure:5330: result: yes +aconfigure:5334: checking malloc.h presence +aconfigure:5344: gcc -E conftest.c +aconfigure:5350: $? = 0 +aconfigure:5370: result: yes +aconfigure:5405: checking for malloc.h +aconfigure:5412: result: yes +aconfigure:5434: checking netdb.h usability +aconfigure:5446: gcc -c -O2 conftest.c >&5 +aconfigure:5452: $? = 0 +aconfigure:5456: test -z + || test ! -s conftest.err +aconfigure:5459: $? = 0 +aconfigure:5462: test -s conftest.o +aconfigure:5465: $? = 0 +aconfigure:5475: result: yes +aconfigure:5479: checking netdb.h presence +aconfigure:5489: gcc -E conftest.c +aconfigure:5495: $? = 0 +aconfigure:5515: result: yes +aconfigure:5550: checking for netdb.h +aconfigure:5557: result: yes +aconfigure:5579: checking netinet/in_systm.h usability +aconfigure:5591: gcc -c -O2 conftest.c >&5 +aconfigure:5597: $? = 0 +aconfigure:5601: test -z + || test ! -s conftest.err +aconfigure:5604: $? = 0 +aconfigure:5607: test -s conftest.o +aconfigure:5610: $? = 0 +aconfigure:5620: result: yes +aconfigure:5624: checking netinet/in_systm.h presence +aconfigure:5634: gcc -E conftest.c +aconfigure:5640: $? = 0 +aconfigure:5660: result: yes +aconfigure:5695: checking for netinet/in_systm.h +aconfigure:5702: result: yes +aconfigure:5724: checking netinet/in.h usability +aconfigure:5736: gcc -c -O2 conftest.c >&5 +aconfigure:5742: $? = 0 +aconfigure:5746: test -z + || test ! -s conftest.err +aconfigure:5749: $? = 0 +aconfigure:5752: test -s conftest.o +aconfigure:5755: $? = 0 +aconfigure:5765: result: yes +aconfigure:5769: checking netinet/in.h presence +aconfigure:5779: gcc -E conftest.c +aconfigure:5785: $? = 0 +aconfigure:5805: result: yes +aconfigure:5840: checking for netinet/in.h +aconfigure:5847: result: yes +aconfigure:5859: checking for netinet/ip.h +aconfigure:5878: gcc -c -O2 conftest.c >&5 +aconfigure:5884: $? = 0 +aconfigure:5888: test -z + || test ! -s conftest.err +aconfigure:5891: $? = 0 +aconfigure:5894: test -s conftest.o +aconfigure:5897: $? = 0 +aconfigure:5908: result: yes +aconfigure:5928: checking ifaddrs.h usability +aconfigure:5940: gcc -c -O2 conftest.c >&5 +aconfigure:5946: $? = 0 +aconfigure:5950: test -z + || test ! -s conftest.err +aconfigure:5953: $? = 0 +aconfigure:5956: test -s conftest.o +aconfigure:5959: $? = 0 +aconfigure:5969: result: yes +aconfigure:5973: checking ifaddrs.h presence +aconfigure:5983: gcc -E conftest.c +aconfigure:5989: $? = 0 +aconfigure:6009: result: yes +aconfigure:6044: checking for ifaddrs.h +aconfigure:6051: result: yes +aconfigure:6073: checking semaphore.h usability +aconfigure:6085: gcc -c -O2 conftest.c >&5 +aconfigure:6091: $? = 0 +aconfigure:6095: test -z + || test ! -s conftest.err +aconfigure:6098: $? = 0 +aconfigure:6101: test -s conftest.o +aconfigure:6104: $? = 0 +aconfigure:6114: result: yes +aconfigure:6118: checking semaphore.h presence +aconfigure:6128: gcc -E conftest.c +aconfigure:6134: $? = 0 +aconfigure:6154: result: yes +aconfigure:6189: checking for semaphore.h +aconfigure:6196: result: yes +aconfigure:6218: checking setjmp.h usability +aconfigure:6230: gcc -c -O2 conftest.c >&5 +aconfigure:6236: $? = 0 +aconfigure:6240: test -z + || test ! -s conftest.err +aconfigure:6243: $? = 0 +aconfigure:6246: test -s conftest.o +aconfigure:6249: $? = 0 +aconfigure:6259: result: yes +aconfigure:6263: checking setjmp.h presence +aconfigure:6273: gcc -E conftest.c +aconfigure:6279: $? = 0 +aconfigure:6299: result: yes +aconfigure:6334: checking for setjmp.h +aconfigure:6341: result: yes +aconfigure:6363: checking stdarg.h usability +aconfigure:6375: gcc -c -O2 conftest.c >&5 +aconfigure:6381: $? = 0 +aconfigure:6385: test -z + || test ! -s conftest.err +aconfigure:6388: $? = 0 +aconfigure:6391: test -s conftest.o +aconfigure:6394: $? = 0 +aconfigure:6404: result: yes +aconfigure:6408: checking stdarg.h presence +aconfigure:6418: gcc -E conftest.c +aconfigure:6424: $? = 0 +aconfigure:6444: result: yes +aconfigure:6479: checking for stdarg.h +aconfigure:6486: result: yes +aconfigure:6508: checking stddef.h usability +aconfigure:6520: gcc -c -O2 conftest.c >&5 +aconfigure:6526: $? = 0 +aconfigure:6530: test -z + || test ! -s conftest.err +aconfigure:6533: $? = 0 +aconfigure:6536: test -s conftest.o +aconfigure:6539: $? = 0 +aconfigure:6549: result: yes +aconfigure:6553: checking stddef.h presence +aconfigure:6563: gcc -E conftest.c +aconfigure:6569: $? = 0 +aconfigure:6589: result: yes +aconfigure:6624: checking for stddef.h +aconfigure:6631: result: yes +aconfigure:6653: checking stdio.h usability +aconfigure:6665: gcc -c -O2 conftest.c >&5 +aconfigure:6671: $? = 0 +aconfigure:6675: test -z + || test ! -s conftest.err +aconfigure:6678: $? = 0 +aconfigure:6681: test -s conftest.o +aconfigure:6684: $? = 0 +aconfigure:6694: result: yes +aconfigure:6698: checking stdio.h presence +aconfigure:6708: gcc -E conftest.c +aconfigure:6714: $? = 0 +aconfigure:6734: result: yes +aconfigure:6769: checking for stdio.h +aconfigure:6776: result: yes +aconfigure:6789: checking for stdint.h +aconfigure:6794: result: yes +aconfigure:6934: checking for stdlib.h +aconfigure:6939: result: yes +aconfigure:7079: checking for string.h +aconfigure:7084: result: yes +aconfigure:7233: checking sys/ioctl.h usability +aconfigure:7245: gcc -c -O2 conftest.c >&5 +aconfigure:7251: $? = 0 +aconfigure:7255: test -z + || test ! -s conftest.err +aconfigure:7258: $? = 0 +aconfigure:7261: test -s conftest.o +aconfigure:7264: $? = 0 +aconfigure:7274: result: yes +aconfigure:7278: checking sys/ioctl.h presence +aconfigure:7288: gcc -E conftest.c +aconfigure:7294: $? = 0 +aconfigure:7314: result: yes +aconfigure:7349: checking for sys/ioctl.h +aconfigure:7356: result: yes +aconfigure:7378: checking sys/select.h usability +aconfigure:7390: gcc -c -O2 conftest.c >&5 +aconfigure:7396: $? = 0 +aconfigure:7400: test -z + || test ! -s conftest.err +aconfigure:7403: $? = 0 +aconfigure:7406: test -s conftest.o +aconfigure:7409: $? = 0 +aconfigure:7419: result: yes +aconfigure:7423: checking sys/select.h presence +aconfigure:7433: gcc -E conftest.c +aconfigure:7439: $? = 0 +aconfigure:7459: result: yes +aconfigure:7494: checking for sys/select.h +aconfigure:7501: result: yes +aconfigure:7523: checking sys/socket.h usability +aconfigure:7535: gcc -c -O2 conftest.c >&5 +aconfigure:7541: $? = 0 +aconfigure:7545: test -z + || test ! -s conftest.err +aconfigure:7548: $? = 0 +aconfigure:7551: test -s conftest.o +aconfigure:7554: $? = 0 +aconfigure:7564: result: yes +aconfigure:7568: checking sys/socket.h presence +aconfigure:7578: gcc -E conftest.c +aconfigure:7584: $? = 0 +aconfigure:7604: result: yes +aconfigure:7639: checking for sys/socket.h +aconfigure:7646: result: yes +aconfigure:7668: checking sys/time.h usability +aconfigure:7680: gcc -c -O2 conftest.c >&5 +aconfigure:7686: $? = 0 +aconfigure:7690: test -z + || test ! -s conftest.err +aconfigure:7693: $? = 0 +aconfigure:7696: test -s conftest.o +aconfigure:7699: $? = 0 +aconfigure:7709: result: yes +aconfigure:7713: checking sys/time.h presence +aconfigure:7723: gcc -E conftest.c +aconfigure:7729: $? = 0 +aconfigure:7749: result: yes +aconfigure:7784: checking for sys/time.h +aconfigure:7791: result: yes +aconfigure:7813: checking sys/timeb.h usability +aconfigure:7825: gcc -c -O2 conftest.c >&5 +aconfigure:7831: $? = 0 +aconfigure:7835: test -z + || test ! -s conftest.err +aconfigure:7838: $? = 0 +aconfigure:7841: test -s conftest.o +aconfigure:7844: $? = 0 +aconfigure:7854: result: yes +aconfigure:7858: checking sys/timeb.h presence +aconfigure:7868: gcc -E conftest.c +aconfigure:7874: $? = 0 +aconfigure:7894: result: yes +aconfigure:7929: checking for sys/timeb.h +aconfigure:7936: result: yes +aconfigure:7949: checking for sys/types.h +aconfigure:7954: result: yes +aconfigure:8103: checking time.h usability +aconfigure:8115: gcc -c -O2 conftest.c >&5 +aconfigure:8121: $? = 0 +aconfigure:8125: test -z + || test ! -s conftest.err +aconfigure:8128: $? = 0 +aconfigure:8131: test -s conftest.o +aconfigure:8134: $? = 0 +aconfigure:8144: result: yes +aconfigure:8148: checking time.h presence +aconfigure:8158: gcc -E conftest.c +aconfigure:8164: $? = 0 +aconfigure:8184: result: yes +aconfigure:8219: checking for time.h +aconfigure:8226: result: yes +aconfigure:8239: checking for unistd.h +aconfigure:8244: result: yes +aconfigure:8393: checking winsock.h usability +aconfigure:8405: gcc -c -O2 conftest.c >&5 +conftest.c:93:21: error: winsock.h: No such file or directory +aconfigure:8411: $? = 1 +aconfigure: failed program was: +| /* confdefs.h. */ +| +| #define PACKAGE_NAME "pjproject" +| #define PACKAGE_TARNAME "pjproject" +| #define PACKAGE_VERSION "1.0" +| #define PACKAGE_STRING "pjproject 1.0" +| #define PACKAGE_BUGREPORT "" +| #ifdef __cplusplus +| extern "C" void exit (int) throw (); +| #endif +| #define HAVE_LIBPTHREAD 1 +| #define HAVE_LIBRT 1 +| #define HAVE_LIBNSL 1 +| #define HAVE_LIBUUID 1 +| #define PJ_M_NAME "x86_64" +| #define PJ_POOL_ALIGNMENT 8 +| #define PJ_LINUX 1 +| #define PJ_HAS_FLOATING_POINT 1 +| #define HAVE_LIBM 1 +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define PJ_HAS_ARPA_INET_H 1 +| #define PJ_HAS_ASSERT_H 1 +| #define PJ_HAS_CTYPE_H 1 +| #define PJ_HAS_ERRNO_H 1 +| #define PJ_HAS_FCNTL_H 1 +| #define PJ_HAS_LINUX_SOCKET_H 1 +| #define PJ_HAS_MALLOC_H 1 +| #define PJ_HAS_NETDB_H 1 +| #define PJ_HAS_NETINET_IN_SYSTM_H 1 +| #define PJ_HAS_NETINET_IN_H 1 +| #define PJ_HAS_NETINET_IP_H 1 +| #define PJ_HAS_IFADDRS_H 1 +| #define PJ_HAS_SEMAPHORE_H 1 +| #define PJ_HAS_SETJMP_H 1 +| #define PJ_HAS_STDARG_H 1 +| #define PJ_HAS_STDDEF_H 1 +| #define PJ_HAS_STDIO_H 1 +| #define PJ_HAS_STDINT_H 1 +| #define PJ_HAS_STDLIB_H 1 +| #define PJ_HAS_STRING_H 1 +| #define PJ_HAS_SYS_IOCTL_H 1 +| #define PJ_HAS_SYS_SELECT_H 1 +| #define PJ_HAS_SYS_SOCKET_H 1 +| #define PJ_HAS_SYS_TIME_H 1 +| #define PJ_HAS_SYS_TIMEB_H 1 +| #define PJ_HAS_SYS_TYPES_H 1 +| #define PJ_HAS_TIME_H 1 +| #define PJ_HAS_UNISTD_H 1 +| /* end confdefs.h. */ +| #include <stdio.h> +| #if HAVE_SYS_TYPES_H +| # include <sys/types.h> +| #endif +| #if HAVE_SYS_STAT_H +| # include <sys/stat.h> +| #endif +| #if STDC_HEADERS +| # include <stdlib.h> +| # include <stddef.h> +| #else +| # if HAVE_STDLIB_H +| # include <stdlib.h> +| # endif +| #endif +| #if HAVE_STRING_H +| # if !STDC_HEADERS && HAVE_MEMORY_H +| # include <memory.h> +| # endif +| # include <string.h> +| #endif +| #if HAVE_STRINGS_H +| # include <strings.h> +| #endif +| #if HAVE_INTTYPES_H +| # include <inttypes.h> +| #else +| # if HAVE_STDINT_H +| # include <stdint.h> +| # endif +| #endif +| #if HAVE_UNISTD_H +| # include <unistd.h> +| #endif +| #include <winsock.h> +aconfigure:8434: result: no +aconfigure:8438: checking winsock.h presence +aconfigure:8448: gcc -E conftest.c +conftest.c:59:21: error: winsock.h: No such file or directory +aconfigure:8454: $? = 1 +aconfigure: failed program was: +| /* confdefs.h. */ +| +| #define PACKAGE_NAME "pjproject" +| #define PACKAGE_TARNAME "pjproject" +| #define PACKAGE_VERSION "1.0" +| #define PACKAGE_STRING "pjproject 1.0" +| #define PACKAGE_BUGREPORT "" +| #ifdef __cplusplus +| extern "C" void exit (int) throw (); +| #endif +| #define HAVE_LIBPTHREAD 1 +| #define HAVE_LIBRT 1 +| #define HAVE_LIBNSL 1 +| #define HAVE_LIBUUID 1 +| #define PJ_M_NAME "x86_64" +| #define PJ_POOL_ALIGNMENT 8 +| #define PJ_LINUX 1 +| #define PJ_HAS_FLOATING_POINT 1 +| #define HAVE_LIBM 1 +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define PJ_HAS_ARPA_INET_H 1 +| #define PJ_HAS_ASSERT_H 1 +| #define PJ_HAS_CTYPE_H 1 +| #define PJ_HAS_ERRNO_H 1 +| #define PJ_HAS_FCNTL_H 1 +| #define PJ_HAS_LINUX_SOCKET_H 1 +| #define PJ_HAS_MALLOC_H 1 +| #define PJ_HAS_NETDB_H 1 +| #define PJ_HAS_NETINET_IN_SYSTM_H 1 +| #define PJ_HAS_NETINET_IN_H 1 +| #define PJ_HAS_NETINET_IP_H 1 +| #define PJ_HAS_IFADDRS_H 1 +| #define PJ_HAS_SEMAPHORE_H 1 +| #define PJ_HAS_SETJMP_H 1 +| #define PJ_HAS_STDARG_H 1 +| #define PJ_HAS_STDDEF_H 1 +| #define PJ_HAS_STDIO_H 1 +| #define PJ_HAS_STDINT_H 1 +| #define PJ_HAS_STDLIB_H 1 +| #define PJ_HAS_STRING_H 1 +| #define PJ_HAS_SYS_IOCTL_H 1 +| #define PJ_HAS_SYS_SELECT_H 1 +| #define PJ_HAS_SYS_SOCKET_H 1 +| #define PJ_HAS_SYS_TIME_H 1 +| #define PJ_HAS_SYS_TIMEB_H 1 +| #define PJ_HAS_SYS_TYPES_H 1 +| #define PJ_HAS_TIME_H 1 +| #define PJ_HAS_UNISTD_H 1 +| /* end confdefs.h. */ +| #include <winsock.h> +aconfigure:8474: result: no +aconfigure:8509: checking for winsock.h +aconfigure:8516: result: no +aconfigure:8538: checking winsock2.h usability +aconfigure:8550: gcc -c -O2 conftest.c >&5 +conftest.c:93:22: error: winsock2.h: No such file or directory +aconfigure:8556: $? = 1 +aconfigure: failed program was: +| /* confdefs.h. */ +| +| #define PACKAGE_NAME "pjproject" +| #define PACKAGE_TARNAME "pjproject" +| #define PACKAGE_VERSION "1.0" +| #define PACKAGE_STRING "pjproject 1.0" +| #define PACKAGE_BUGREPORT "" +| #ifdef __cplusplus +| extern "C" void exit (int) throw (); +| #endif +| #define HAVE_LIBPTHREAD 1 +| #define HAVE_LIBRT 1 +| #define HAVE_LIBNSL 1 +| #define HAVE_LIBUUID 1 +| #define PJ_M_NAME "x86_64" +| #define PJ_POOL_ALIGNMENT 8 +| #define PJ_LINUX 1 +| #define PJ_HAS_FLOATING_POINT 1 +| #define HAVE_LIBM 1 +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define PJ_HAS_ARPA_INET_H 1 +| #define PJ_HAS_ASSERT_H 1 +| #define PJ_HAS_CTYPE_H 1 +| #define PJ_HAS_ERRNO_H 1 +| #define PJ_HAS_FCNTL_H 1 +| #define PJ_HAS_LINUX_SOCKET_H 1 +| #define PJ_HAS_MALLOC_H 1 +| #define PJ_HAS_NETDB_H 1 +| #define PJ_HAS_NETINET_IN_SYSTM_H 1 +| #define PJ_HAS_NETINET_IN_H 1 +| #define PJ_HAS_NETINET_IP_H 1 +| #define PJ_HAS_IFADDRS_H 1 +| #define PJ_HAS_SEMAPHORE_H 1 +| #define PJ_HAS_SETJMP_H 1 +| #define PJ_HAS_STDARG_H 1 +| #define PJ_HAS_STDDEF_H 1 +| #define PJ_HAS_STDIO_H 1 +| #define PJ_HAS_STDINT_H 1 +| #define PJ_HAS_STDLIB_H 1 +| #define PJ_HAS_STRING_H 1 +| #define PJ_HAS_SYS_IOCTL_H 1 +| #define PJ_HAS_SYS_SELECT_H 1 +| #define PJ_HAS_SYS_SOCKET_H 1 +| #define PJ_HAS_SYS_TIME_H 1 +| #define PJ_HAS_SYS_TIMEB_H 1 +| #define PJ_HAS_SYS_TYPES_H 1 +| #define PJ_HAS_TIME_H 1 +| #define PJ_HAS_UNISTD_H 1 +| /* end confdefs.h. */ +| #include <stdio.h> +| #if HAVE_SYS_TYPES_H +| # include <sys/types.h> +| #endif +| #if HAVE_SYS_STAT_H +| # include <sys/stat.h> +| #endif +| #if STDC_HEADERS +| # include <stdlib.h> +| # include <stddef.h> +| #else +| # if HAVE_STDLIB_H +| # include <stdlib.h> +| # endif +| #endif +| #if HAVE_STRING_H +| # if !STDC_HEADERS && HAVE_MEMORY_H +| # include <memory.h> +| # endif +| # include <string.h> +| #endif +| #if HAVE_STRINGS_H +| # include <strings.h> +| #endif +| #if HAVE_INTTYPES_H +| # include <inttypes.h> +| #else +| # if HAVE_STDINT_H +| # include <stdint.h> +| # endif +| #endif +| #if HAVE_UNISTD_H +| # include <unistd.h> +| #endif +| #include <winsock2.h> +aconfigure:8579: result: no +aconfigure:8583: checking winsock2.h presence +aconfigure:8593: gcc -E conftest.c +conftest.c:59:22: error: winsock2.h: No such file or directory +aconfigure:8599: $? = 1 +aconfigure: failed program was: +| /* confdefs.h. */ +| +| #define PACKAGE_NAME "pjproject" +| #define PACKAGE_TARNAME "pjproject" +| #define PACKAGE_VERSION "1.0" +| #define PACKAGE_STRING "pjproject 1.0" +| #define PACKAGE_BUGREPORT "" +| #ifdef __cplusplus +| extern "C" void exit (int) throw (); +| #endif +| #define HAVE_LIBPTHREAD 1 +| #define HAVE_LIBRT 1 +| #define HAVE_LIBNSL 1 +| #define HAVE_LIBUUID 1 +| #define PJ_M_NAME "x86_64" +| #define PJ_POOL_ALIGNMENT 8 +| #define PJ_LINUX 1 +| #define PJ_HAS_FLOATING_POINT 1 +| #define HAVE_LIBM 1 +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define PJ_HAS_ARPA_INET_H 1 +| #define PJ_HAS_ASSERT_H 1 +| #define PJ_HAS_CTYPE_H 1 +| #define PJ_HAS_ERRNO_H 1 +| #define PJ_HAS_FCNTL_H 1 +| #define PJ_HAS_LINUX_SOCKET_H 1 +| #define PJ_HAS_MALLOC_H 1 +| #define PJ_HAS_NETDB_H 1 +| #define PJ_HAS_NETINET_IN_SYSTM_H 1 +| #define PJ_HAS_NETINET_IN_H 1 +| #define PJ_HAS_NETINET_IP_H 1 +| #define PJ_HAS_IFADDRS_H 1 +| #define PJ_HAS_SEMAPHORE_H 1 +| #define PJ_HAS_SETJMP_H 1 +| #define PJ_HAS_STDARG_H 1 +| #define PJ_HAS_STDDEF_H 1 +| #define PJ_HAS_STDIO_H 1 +| #define PJ_HAS_STDINT_H 1 +| #define PJ_HAS_STDLIB_H 1 +| #define PJ_HAS_STRING_H 1 +| #define PJ_HAS_SYS_IOCTL_H 1 +| #define PJ_HAS_SYS_SELECT_H 1 +| #define PJ_HAS_SYS_SOCKET_H 1 +| #define PJ_HAS_SYS_TIME_H 1 +| #define PJ_HAS_SYS_TIMEB_H 1 +| #define PJ_HAS_SYS_TYPES_H 1 +| #define PJ_HAS_TIME_H 1 +| #define PJ_HAS_UNISTD_H 1 +| /* end confdefs.h. */ +| #include <winsock2.h> +aconfigure:8619: result: no +aconfigure:8654: checking for winsock2.h +aconfigure:8661: result: no +aconfigure:8673: checking for mswsock.h +aconfigure:8694: gcc -c -O2 conftest.c >&5 +conftest.c:66:21: error: mswsock.h: No such file or directory +aconfigure:8700: $? = 1 +aconfigure: failed program was: +| /* confdefs.h. */ +| +| #define PACKAGE_NAME "pjproject" +| #define PACKAGE_TARNAME "pjproject" +| #define PACKAGE_VERSION "1.0" +| #define PACKAGE_STRING "pjproject 1.0" +| #define PACKAGE_BUGREPORT "" +| #ifdef __cplusplus +| extern "C" void exit (int) throw (); +| #endif +| #define HAVE_LIBPTHREAD 1 +| #define HAVE_LIBRT 1 +| #define HAVE_LIBNSL 1 +| #define HAVE_LIBUUID 1 +| #define PJ_M_NAME "x86_64" +| #define PJ_POOL_ALIGNMENT 8 +| #define PJ_LINUX 1 +| #define PJ_HAS_FLOATING_POINT 1 +| #define HAVE_LIBM 1 +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define PJ_HAS_ARPA_INET_H 1 +| #define PJ_HAS_ASSERT_H 1 +| #define PJ_HAS_CTYPE_H 1 +| #define PJ_HAS_ERRNO_H 1 +| #define PJ_HAS_FCNTL_H 1 +| #define PJ_HAS_LINUX_SOCKET_H 1 +| #define PJ_HAS_MALLOC_H 1 +| #define PJ_HAS_NETDB_H 1 +| #define PJ_HAS_NETINET_IN_SYSTM_H 1 +| #define PJ_HAS_NETINET_IN_H 1 +| #define PJ_HAS_NETINET_IP_H 1 +| #define PJ_HAS_IFADDRS_H 1 +| #define PJ_HAS_SEMAPHORE_H 1 +| #define PJ_HAS_SETJMP_H 1 +| #define PJ_HAS_STDARG_H 1 +| #define PJ_HAS_STDDEF_H 1 +| #define PJ_HAS_STDIO_H 1 +| #define PJ_HAS_STDINT_H 1 +| #define PJ_HAS_STDLIB_H 1 +| #define PJ_HAS_STRING_H 1 +| #define PJ_HAS_SYS_IOCTL_H 1 +| #define PJ_HAS_SYS_SELECT_H 1 +| #define PJ_HAS_SYS_SOCKET_H 1 +| #define PJ_HAS_SYS_TIME_H 1 +| #define PJ_HAS_SYS_TIMEB_H 1 +| #define PJ_HAS_SYS_TYPES_H 1 +| #define PJ_HAS_TIME_H 1 +| #define PJ_HAS_UNISTD_H 1 +| /* end confdefs.h. */ +| #if PJ_HAS_WINSOCK2_H +| # include <winsock2.h> +| #elif PJ_HAS_WINSOCK_H +| # include <winsock.h> +| #endif +| +| +| #include <mswsock.h> +aconfigure:8724: result: no +aconfigure:8744: checking ws2tcpip.h usability +aconfigure:8756: gcc -c -O2 conftest.c >&5 +conftest.c:93:22: error: ws2tcpip.h: No such file or directory +aconfigure:8762: $? = 1 +aconfigure: failed program was: +| /* confdefs.h. */ +| +| #define PACKAGE_NAME "pjproject" +| #define PACKAGE_TARNAME "pjproject" +| #define PACKAGE_VERSION "1.0" +| #define PACKAGE_STRING "pjproject 1.0" +| #define PACKAGE_BUGREPORT "" +| #ifdef __cplusplus +| extern "C" void exit (int) throw (); +| #endif +| #define HAVE_LIBPTHREAD 1 +| #define HAVE_LIBRT 1 +| #define HAVE_LIBNSL 1 +| #define HAVE_LIBUUID 1 +| #define PJ_M_NAME "x86_64" +| #define PJ_POOL_ALIGNMENT 8 +| #define PJ_LINUX 1 +| #define PJ_HAS_FLOATING_POINT 1 +| #define HAVE_LIBM 1 +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define PJ_HAS_ARPA_INET_H 1 +| #define PJ_HAS_ASSERT_H 1 +| #define PJ_HAS_CTYPE_H 1 +| #define PJ_HAS_ERRNO_H 1 +| #define PJ_HAS_FCNTL_H 1 +| #define PJ_HAS_LINUX_SOCKET_H 1 +| #define PJ_HAS_MALLOC_H 1 +| #define PJ_HAS_NETDB_H 1 +| #define PJ_HAS_NETINET_IN_SYSTM_H 1 +| #define PJ_HAS_NETINET_IN_H 1 +| #define PJ_HAS_NETINET_IP_H 1 +| #define PJ_HAS_IFADDRS_H 1 +| #define PJ_HAS_SEMAPHORE_H 1 +| #define PJ_HAS_SETJMP_H 1 +| #define PJ_HAS_STDARG_H 1 +| #define PJ_HAS_STDDEF_H 1 +| #define PJ_HAS_STDIO_H 1 +| #define PJ_HAS_STDINT_H 1 +| #define PJ_HAS_STDLIB_H 1 +| #define PJ_HAS_STRING_H 1 +| #define PJ_HAS_SYS_IOCTL_H 1 +| #define PJ_HAS_SYS_SELECT_H 1 +| #define PJ_HAS_SYS_SOCKET_H 1 +| #define PJ_HAS_SYS_TIME_H 1 +| #define PJ_HAS_SYS_TIMEB_H 1 +| #define PJ_HAS_SYS_TYPES_H 1 +| #define PJ_HAS_TIME_H 1 +| #define PJ_HAS_UNISTD_H 1 +| /* end confdefs.h. */ +| #include <stdio.h> +| #if HAVE_SYS_TYPES_H +| # include <sys/types.h> +| #endif +| #if HAVE_SYS_STAT_H +| # include <sys/stat.h> +| #endif +| #if STDC_HEADERS +| # include <stdlib.h> +| # include <stddef.h> +| #else +| # if HAVE_STDLIB_H +| # include <stdlib.h> +| # endif +| #endif +| #if HAVE_STRING_H +| # if !STDC_HEADERS && HAVE_MEMORY_H +| # include <memory.h> +| # endif +| # include <string.h> +| #endif +| #if HAVE_STRINGS_H +| # include <strings.h> +| #endif +| #if HAVE_INTTYPES_H +| # include <inttypes.h> +| #else +| # if HAVE_STDINT_H +| # include <stdint.h> +| # endif +| #endif +| #if HAVE_UNISTD_H +| # include <unistd.h> +| #endif +| #include <ws2tcpip.h> +aconfigure:8785: result: no +aconfigure:8789: checking ws2tcpip.h presence +aconfigure:8799: gcc -E conftest.c +conftest.c:59:22: error: ws2tcpip.h: No such file or directory +aconfigure:8805: $? = 1 +aconfigure: failed program was: +| /* confdefs.h. */ +| +| #define PACKAGE_NAME "pjproject" +| #define PACKAGE_TARNAME "pjproject" +| #define PACKAGE_VERSION "1.0" +| #define PACKAGE_STRING "pjproject 1.0" +| #define PACKAGE_BUGREPORT "" +| #ifdef __cplusplus +| extern "C" void exit (int) throw (); +| #endif +| #define HAVE_LIBPTHREAD 1 +| #define HAVE_LIBRT 1 +| #define HAVE_LIBNSL 1 +| #define HAVE_LIBUUID 1 +| #define PJ_M_NAME "x86_64" +| #define PJ_POOL_ALIGNMENT 8 +| #define PJ_LINUX 1 +| #define PJ_HAS_FLOATING_POINT 1 +| #define HAVE_LIBM 1 +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define PJ_HAS_ARPA_INET_H 1 +| #define PJ_HAS_ASSERT_H 1 +| #define PJ_HAS_CTYPE_H 1 +| #define PJ_HAS_ERRNO_H 1 +| #define PJ_HAS_FCNTL_H 1 +| #define PJ_HAS_LINUX_SOCKET_H 1 +| #define PJ_HAS_MALLOC_H 1 +| #define PJ_HAS_NETDB_H 1 +| #define PJ_HAS_NETINET_IN_SYSTM_H 1 +| #define PJ_HAS_NETINET_IN_H 1 +| #define PJ_HAS_NETINET_IP_H 1 +| #define PJ_HAS_IFADDRS_H 1 +| #define PJ_HAS_SEMAPHORE_H 1 +| #define PJ_HAS_SETJMP_H 1 +| #define PJ_HAS_STDARG_H 1 +| #define PJ_HAS_STDDEF_H 1 +| #define PJ_HAS_STDIO_H 1 +| #define PJ_HAS_STDINT_H 1 +| #define PJ_HAS_STDLIB_H 1 +| #define PJ_HAS_STRING_H 1 +| #define PJ_HAS_SYS_IOCTL_H 1 +| #define PJ_HAS_SYS_SELECT_H 1 +| #define PJ_HAS_SYS_SOCKET_H 1 +| #define PJ_HAS_SYS_TIME_H 1 +| #define PJ_HAS_SYS_TIMEB_H 1 +| #define PJ_HAS_SYS_TYPES_H 1 +| #define PJ_HAS_TIME_H 1 +| #define PJ_HAS_UNISTD_H 1 +| /* end confdefs.h. */ +| #include <ws2tcpip.h> +aconfigure:8825: result: no +aconfigure:8860: checking for ws2tcpip.h +aconfigure:8867: result: no +aconfigure:8889: checking uuid/uuid.h usability +aconfigure:8901: gcc -c -O2 conftest.c >&5 +aconfigure:8907: $? = 0 +aconfigure:8911: test -z + || test ! -s conftest.err +aconfigure:8914: $? = 0 +aconfigure:8917: test -s conftest.o +aconfigure:8920: $? = 0 +aconfigure:8930: result: yes +aconfigure:8934: checking uuid/uuid.h presence +aconfigure:8944: gcc -E conftest.c +aconfigure:8950: $? = 0 +aconfigure:8970: result: yes +aconfigure:9005: checking for uuid/uuid.h +aconfigure:9012: result: yes +aconfigure:9021: checking for net/if.h +aconfigure:9040: gcc -c -O2 conftest.c >&5 +aconfigure:9046: $? = 0 +aconfigure:9050: test -z + || test ! -s conftest.err +aconfigure:9053: $? = 0 +aconfigure:9056: test -s conftest.o +aconfigure:9059: $? = 0 +aconfigure:9070: result: yes +aconfigure:9081: result: Setting PJ_OS_NAME to x86_64-unknown-linux-gnu +aconfigure:9088: result: Setting PJ_HAS_ERRNO_VAR to 1 +aconfigure:9095: result: Setting PJ_HAS_HIGH_RES_TIMER to 1 +aconfigure:9102: result: Setting PJ_HAS_MALLOC to 1 +aconfigure:9109: result: Setting PJ_NATIVE_STRING_IS_UNICODE to 0 +aconfigure:9116: result: Setting PJ_ATOMIC_VALUE_TYPE to long +aconfigure:9123: checking if inet_aton() is available +aconfigure:9143: gcc -c -O2 conftest.c >&5 +aconfigure:9149: $? = 0 +aconfigure:9153: test -z + || test ! -s conftest.err +aconfigure:9156: $? = 0 +aconfigure:9159: test -s conftest.o +aconfigure:9162: $? = 0 +aconfigure:9168: result: yes +aconfigure:9179: checking if inet_pton() is available +aconfigure:9199: gcc -c -O2 conftest.c >&5 +aconfigure:9205: $? = 0 +aconfigure:9209: test -z + || test ! -s conftest.err +aconfigure:9212: $? = 0 +aconfigure:9215: test -s conftest.o +aconfigure:9218: $? = 0 +aconfigure:9224: result: yes +aconfigure:9235: checking if inet_ntop() is available +aconfigure:9255: gcc -c -O2 conftest.c >&5 +aconfigure:9261: $? = 0 +aconfigure:9265: test -z + || test ! -s conftest.err +aconfigure:9268: $? = 0 +aconfigure:9271: test -s conftest.o +aconfigure:9274: $? = 0 +aconfigure:9280: result: yes +aconfigure:9291: checking if getaddrinfo() is available +aconfigure:9311: gcc -c -O2 conftest.c >&5 +aconfigure:9317: $? = 0 +aconfigure:9321: test -z + || test ! -s conftest.err +aconfigure:9324: $? = 0 +aconfigure:9327: test -s conftest.o +aconfigure:9330: $? = 0 +aconfigure:9336: result: yes +aconfigure:9347: checking if sockaddr_in has sin_len member +aconfigure:9368: gcc -c -O2 conftest.c >&5 +conftest.c: In function 'main': +conftest.c:77: error: 'struct sockaddr_in' has no member named 'sin_len' +aconfigure:9374: $? = 1 +aconfigure: failed program was: +| /* confdefs.h. */ +| +| #define PACKAGE_NAME "pjproject" +| #define PACKAGE_TARNAME "pjproject" +| #define PACKAGE_VERSION "1.0" +| #define PACKAGE_STRING "pjproject 1.0" +| #define PACKAGE_BUGREPORT "" +| #ifdef __cplusplus +| extern "C" void exit (int) throw (); +| #endif +| #define HAVE_LIBPTHREAD 1 +| #define HAVE_LIBRT 1 +| #define HAVE_LIBNSL 1 +| #define HAVE_LIBUUID 1 +| #define PJ_M_NAME "x86_64" +| #define PJ_POOL_ALIGNMENT 8 +| #define PJ_LINUX 1 +| #define PJ_HAS_FLOATING_POINT 1 +| #define HAVE_LIBM 1 +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define PJ_HAS_ARPA_INET_H 1 +| #define PJ_HAS_ASSERT_H 1 +| #define PJ_HAS_CTYPE_H 1 +| #define PJ_HAS_ERRNO_H 1 +| #define PJ_HAS_FCNTL_H 1 +| #define PJ_HAS_LINUX_SOCKET_H 1 +| #define PJ_HAS_MALLOC_H 1 +| #define PJ_HAS_NETDB_H 1 +| #define PJ_HAS_NETINET_IN_SYSTM_H 1 +| #define PJ_HAS_NETINET_IN_H 1 +| #define PJ_HAS_NETINET_IP_H 1 +| #define PJ_HAS_IFADDRS_H 1 +| #define PJ_HAS_SEMAPHORE_H 1 +| #define PJ_HAS_SETJMP_H 1 +| #define PJ_HAS_STDARG_H 1 +| #define PJ_HAS_STDDEF_H 1 +| #define PJ_HAS_STDIO_H 1 +| #define PJ_HAS_STDINT_H 1 +| #define PJ_HAS_STDLIB_H 1 +| #define PJ_HAS_STRING_H 1 +| #define PJ_HAS_SYS_IOCTL_H 1 +| #define PJ_HAS_SYS_SELECT_H 1 +| #define PJ_HAS_SYS_SOCKET_H 1 +| #define PJ_HAS_SYS_TIME_H 1 +| #define PJ_HAS_SYS_TIMEB_H 1 +| #define PJ_HAS_SYS_TYPES_H 1 +| #define PJ_HAS_TIME_H 1 +| #define PJ_HAS_UNISTD_H 1 +| #define PJ_HAS_NET_IF_H 1 +| #define PJ_OS_NAME "x86_64-unknown-linux-gnu" +| #define PJ_HAS_ERRNO_VAR 1 +| #define PJ_HAS_HIGH_RES_TIMER 1 +| #define PJ_HAS_MALLOC 1 +| #define PJ_NATIVE_STRING_IS_UNICODE 0 +| #define PJ_ATOMIC_VALUE_TYPE long +| #define PJ_SOCK_HAS_INET_ATON 1 +| #define PJ_SOCK_HAS_INET_PTON 1 +| #define PJ_SOCK_HAS_INET_NTOP 1 +| #define PJ_SOCK_HAS_GETADDRINFO 1 +| /* end confdefs.h. */ +| #include <sys/types.h> +| #include <sys/socket.h> +| #include <netinet/in.h> +| #include <arpa/inet.h> +| int +| main () +| { +| struct sockaddr_in a; a.sin_len=0; +| ; +| return 0; +| } +aconfigure:9399: result: no +aconfigure:9404: checking if socklen_t is available +aconfigure:9422: gcc -c -O2 conftest.c >&5 +aconfigure:9428: $? = 0 +aconfigure:9432: test -z + || test ! -s conftest.err +aconfigure:9435: $? = 0 +aconfigure:9438: test -s conftest.o +aconfigure:9441: $? = 0 +aconfigure:9447: result: yes +aconfigure:9458: checking if SO_ERROR is available +aconfigure:9489: gcc -c -O2 conftest.c >&5 +aconfigure:9495: $? = 0 +aconfigure:9499: test -z + || test ! -s conftest.err +aconfigure:9502: $? = 0 +aconfigure:9505: test -s conftest.o +aconfigure:9508: $? = 0 +aconfigure:9514: result: yes +aconfigure:9528: checking if pthread_rwlock_t is available +aconfigure:9546: gcc -c -O2 conftest.c >&5 +aconfigure:9552: $? = 0 +aconfigure:9556: test -z + || test ! -s conftest.err +aconfigure:9559: $? = 0 +aconfigure:9562: test -s conftest.o +aconfigure:9565: $? = 0 +aconfigure:9572: result: yes +aconfigure:9650: checking if pthread_mutexattr_settype() is available +aconfigure:9668: gcc -c -O2 conftest.c >&5 +conftest.c: In function 'main': +conftest.c:77: error: 'PTHREAD_MUTEX_FAST_NP' undeclared (first use in this function) +conftest.c:77: error: (Each undeclared identifier is reported only once +conftest.c:77: error: for each function it appears in.) +aconfigure:9674: $? = 1 +aconfigure: failed program was: +| /* confdefs.h. */ +| +| #define PACKAGE_NAME "pjproject" +| #define PACKAGE_TARNAME "pjproject" +| #define PACKAGE_VERSION "1.0" +| #define PACKAGE_STRING "pjproject 1.0" +| #define PACKAGE_BUGREPORT "" +| #ifdef __cplusplus +| extern "C" void exit (int) throw (); +| #endif +| #define HAVE_LIBPTHREAD 1 +| #define HAVE_LIBRT 1 +| #define HAVE_LIBNSL 1 +| #define HAVE_LIBUUID 1 +| #define PJ_M_NAME "x86_64" +| #define PJ_POOL_ALIGNMENT 8 +| #define PJ_LINUX 1 +| #define PJ_HAS_FLOATING_POINT 1 +| #define HAVE_LIBM 1 +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define PJ_HAS_ARPA_INET_H 1 +| #define PJ_HAS_ASSERT_H 1 +| #define PJ_HAS_CTYPE_H 1 +| #define PJ_HAS_ERRNO_H 1 +| #define PJ_HAS_FCNTL_H 1 +| #define PJ_HAS_LINUX_SOCKET_H 1 +| #define PJ_HAS_MALLOC_H 1 +| #define PJ_HAS_NETDB_H 1 +| #define PJ_HAS_NETINET_IN_SYSTM_H 1 +| #define PJ_HAS_NETINET_IN_H 1 +| #define PJ_HAS_NETINET_IP_H 1 +| #define PJ_HAS_IFADDRS_H 1 +| #define PJ_HAS_SEMAPHORE_H 1 +| #define PJ_HAS_SETJMP_H 1 +| #define PJ_HAS_STDARG_H 1 +| #define PJ_HAS_STDDEF_H 1 +| #define PJ_HAS_STDIO_H 1 +| #define PJ_HAS_STDINT_H 1 +| #define PJ_HAS_STDLIB_H 1 +| #define PJ_HAS_STRING_H 1 +| #define PJ_HAS_SYS_IOCTL_H 1 +| #define PJ_HAS_SYS_SELECT_H 1 +| #define PJ_HAS_SYS_SOCKET_H 1 +| #define PJ_HAS_SYS_TIME_H 1 +| #define PJ_HAS_SYS_TIMEB_H 1 +| #define PJ_HAS_SYS_TYPES_H 1 +| #define PJ_HAS_TIME_H 1 +| #define PJ_HAS_UNISTD_H 1 +| #define PJ_HAS_NET_IF_H 1 +| #define PJ_OS_NAME "x86_64-unknown-linux-gnu" +| #define PJ_HAS_ERRNO_VAR 1 +| #define PJ_HAS_HIGH_RES_TIMER 1 +| #define PJ_HAS_MALLOC 1 +| #define PJ_NATIVE_STRING_IS_UNICODE 0 +| #define PJ_ATOMIC_VALUE_TYPE long +| #define PJ_SOCK_HAS_INET_ATON 1 +| #define PJ_SOCK_HAS_INET_PTON 1 +| #define PJ_SOCK_HAS_INET_NTOP 1 +| #define PJ_SOCK_HAS_GETADDRINFO 1 +| #define PJ_HAS_SOCKLEN_T 1 +| #define PJ_HAS_SO_ERROR 1 +| #define PJ_EMULATE_RWMUTEX 0 +| /* end confdefs.h. */ +| #include <pthread.h> +| int +| main () +| { +| pthread_mutexattr_settype(0,PTHREAD_MUTEX_FAST_NP); +| ; +| return 0; +| } +aconfigure:9699: result: no +aconfigure:9704: checking if pthread_mutexattr_t has recursive member +aconfigure:9723: gcc -c -O2 conftest.c >&5 +conftest.c: In function 'main': +conftest.c:78: error: 'pthread_mutexattr_t' has no member named 'recursive' +aconfigure:9729: $? = 1 +aconfigure: failed program was: +| /* confdefs.h. */ +| +| #define PACKAGE_NAME "pjproject" +| #define PACKAGE_TARNAME "pjproject" +| #define PACKAGE_VERSION "1.0" +| #define PACKAGE_STRING "pjproject 1.0" +| #define PACKAGE_BUGREPORT "" +| #ifdef __cplusplus +| extern "C" void exit (int) throw (); +| #endif +| #define HAVE_LIBPTHREAD 1 +| #define HAVE_LIBRT 1 +| #define HAVE_LIBNSL 1 +| #define HAVE_LIBUUID 1 +| #define PJ_M_NAME "x86_64" +| #define PJ_POOL_ALIGNMENT 8 +| #define PJ_LINUX 1 +| #define PJ_HAS_FLOATING_POINT 1 +| #define HAVE_LIBM 1 +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define PJ_HAS_ARPA_INET_H 1 +| #define PJ_HAS_ASSERT_H 1 +| #define PJ_HAS_CTYPE_H 1 +| #define PJ_HAS_ERRNO_H 1 +| #define PJ_HAS_FCNTL_H 1 +| #define PJ_HAS_LINUX_SOCKET_H 1 +| #define PJ_HAS_MALLOC_H 1 +| #define PJ_HAS_NETDB_H 1 +| #define PJ_HAS_NETINET_IN_SYSTM_H 1 +| #define PJ_HAS_NETINET_IN_H 1 +| #define PJ_HAS_NETINET_IP_H 1 +| #define PJ_HAS_IFADDRS_H 1 +| #define PJ_HAS_SEMAPHORE_H 1 +| #define PJ_HAS_SETJMP_H 1 +| #define PJ_HAS_STDARG_H 1 +| #define PJ_HAS_STDDEF_H 1 +| #define PJ_HAS_STDIO_H 1 +| #define PJ_HAS_STDINT_H 1 +| #define PJ_HAS_STDLIB_H 1 +| #define PJ_HAS_STRING_H 1 +| #define PJ_HAS_SYS_IOCTL_H 1 +| #define PJ_HAS_SYS_SELECT_H 1 +| #define PJ_HAS_SYS_SOCKET_H 1 +| #define PJ_HAS_SYS_TIME_H 1 +| #define PJ_HAS_SYS_TIMEB_H 1 +| #define PJ_HAS_SYS_TYPES_H 1 +| #define PJ_HAS_TIME_H 1 +| #define PJ_HAS_UNISTD_H 1 +| #define PJ_HAS_NET_IF_H 1 +| #define PJ_OS_NAME "x86_64-unknown-linux-gnu" +| #define PJ_HAS_ERRNO_VAR 1 +| #define PJ_HAS_HIGH_RES_TIMER 1 +| #define PJ_HAS_MALLOC 1 +| #define PJ_NATIVE_STRING_IS_UNICODE 0 +| #define PJ_ATOMIC_VALUE_TYPE long +| #define PJ_SOCK_HAS_INET_ATON 1 +| #define PJ_SOCK_HAS_INET_PTON 1 +| #define PJ_SOCK_HAS_INET_NTOP 1 +| #define PJ_SOCK_HAS_GETADDRINFO 1 +| #define PJ_HAS_SOCKLEN_T 1 +| #define PJ_HAS_SO_ERROR 1 +| #define PJ_EMULATE_RWMUTEX 0 +| /* end confdefs.h. */ +| #include <pthread.h> +| int +| main () +| { +| pthread_mutexattr_t attr; +| attr.recursive=1; +| ; +| return 0; +| } +aconfigure:9754: result: no +aconfigure:9760: checking ioqueue backend +aconfigure:9773: result: select() +aconfigure:9820: checking sys/soundcard.h usability +aconfigure:9832: gcc -c -O2 conftest.c >&5 +aconfigure:9838: $? = 0 +aconfigure:9842: test -z + || test ! -s conftest.err +aconfigure:9845: $? = 0 +aconfigure:9848: test -s conftest.o +aconfigure:9851: $? = 0 +aconfigure:9861: result: yes +aconfigure:9865: checking sys/soundcard.h presence +aconfigure:9875: gcc -E conftest.c +aconfigure:9881: $? = 0 +aconfigure:9901: result: yes +aconfigure:9936: checking for sys/soundcard.h +aconfigure:9943: result: yes +aconfigure:9962: checking linux/soundcard.h usability +aconfigure:9974: gcc -c -O2 conftest.c >&5 +aconfigure:9980: $? = 0 +aconfigure:9984: test -z + || test ! -s conftest.err +aconfigure:9987: $? = 0 +aconfigure:9990: test -s conftest.o +aconfigure:9993: $? = 0 +aconfigure:10003: result: yes +aconfigure:10007: checking linux/soundcard.h presence +aconfigure:10017: gcc -E conftest.c +aconfigure:10023: $? = 0 +aconfigure:10043: result: yes +aconfigure:10078: checking for linux/soundcard.h +aconfigure:10085: result: yes +aconfigure:10104: checking machine/soundcard.h usability +aconfigure:10116: gcc -c -O2 conftest.c >&5 +conftest.c:107:31: error: machine/soundcard.h: No such file or directory +aconfigure:10122: $? = 1 +aconfigure: failed program was: +| /* confdefs.h. */ +| +| #define PACKAGE_NAME "pjproject" +| #define PACKAGE_TARNAME "pjproject" +| #define PACKAGE_VERSION "1.0" +| #define PACKAGE_STRING "pjproject 1.0" +| #define PACKAGE_BUGREPORT "" +| #ifdef __cplusplus +| extern "C" void exit (int) throw (); +| #endif +| #define HAVE_LIBPTHREAD 1 +| #define HAVE_LIBRT 1 +| #define HAVE_LIBNSL 1 +| #define HAVE_LIBUUID 1 +| #define PJ_M_NAME "x86_64" +| #define PJ_POOL_ALIGNMENT 8 +| #define PJ_LINUX 1 +| #define PJ_HAS_FLOATING_POINT 1 +| #define HAVE_LIBM 1 +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define PJ_HAS_ARPA_INET_H 1 +| #define PJ_HAS_ASSERT_H 1 +| #define PJ_HAS_CTYPE_H 1 +| #define PJ_HAS_ERRNO_H 1 +| #define PJ_HAS_FCNTL_H 1 +| #define PJ_HAS_LINUX_SOCKET_H 1 +| #define PJ_HAS_MALLOC_H 1 +| #define PJ_HAS_NETDB_H 1 +| #define PJ_HAS_NETINET_IN_SYSTM_H 1 +| #define PJ_HAS_NETINET_IN_H 1 +| #define PJ_HAS_NETINET_IP_H 1 +| #define PJ_HAS_IFADDRS_H 1 +| #define PJ_HAS_SEMAPHORE_H 1 +| #define PJ_HAS_SETJMP_H 1 +| #define PJ_HAS_STDARG_H 1 +| #define PJ_HAS_STDDEF_H 1 +| #define PJ_HAS_STDIO_H 1 +| #define PJ_HAS_STDINT_H 1 +| #define PJ_HAS_STDLIB_H 1 +| #define PJ_HAS_STRING_H 1 +| #define PJ_HAS_SYS_IOCTL_H 1 +| #define PJ_HAS_SYS_SELECT_H 1 +| #define PJ_HAS_SYS_SOCKET_H 1 +| #define PJ_HAS_SYS_TIME_H 1 +| #define PJ_HAS_SYS_TIMEB_H 1 +| #define PJ_HAS_SYS_TYPES_H 1 +| #define PJ_HAS_TIME_H 1 +| #define PJ_HAS_UNISTD_H 1 +| #define PJ_HAS_NET_IF_H 1 +| #define PJ_OS_NAME "x86_64-unknown-linux-gnu" +| #define PJ_HAS_ERRNO_VAR 1 +| #define PJ_HAS_HIGH_RES_TIMER 1 +| #define PJ_HAS_MALLOC 1 +| #define PJ_NATIVE_STRING_IS_UNICODE 0 +| #define PJ_ATOMIC_VALUE_TYPE long +| #define PJ_SOCK_HAS_INET_ATON 1 +| #define PJ_SOCK_HAS_INET_PTON 1 +| #define PJ_SOCK_HAS_INET_NTOP 1 +| #define PJ_SOCK_HAS_GETADDRINFO 1 +| #define PJ_HAS_SOCKLEN_T 1 +| #define PJ_HAS_SO_ERROR 1 +| #define PJ_EMULATE_RWMUTEX 0 +| /* end confdefs.h. */ +| #include <stdio.h> +| #if HAVE_SYS_TYPES_H +| # include <sys/types.h> +| #endif +| #if HAVE_SYS_STAT_H +| # include <sys/stat.h> +| #endif +| #if STDC_HEADERS +| # include <stdlib.h> +| # include <stddef.h> +| #else +| # if HAVE_STDLIB_H +| # include <stdlib.h> +| # endif +| #endif +| #if HAVE_STRING_H +| # if !STDC_HEADERS && HAVE_MEMORY_H +| # include <memory.h> +| # endif +| # include <string.h> +| #endif +| #if HAVE_STRINGS_H +| # include <strings.h> +| #endif +| #if HAVE_INTTYPES_H +| # include <inttypes.h> +| #else +| # if HAVE_STDINT_H +| # include <stdint.h> +| # endif +| #endif +| #if HAVE_UNISTD_H +| # include <unistd.h> +| #endif +| #include <machine/soundcard.h> +aconfigure:10145: result: no +aconfigure:10149: checking machine/soundcard.h presence +aconfigure:10159: gcc -E conftest.c +conftest.c:73:31: error: machine/soundcard.h: No such file or directory +aconfigure:10165: $? = 1 +aconfigure: failed program was: +| /* confdefs.h. */ +| +| #define PACKAGE_NAME "pjproject" +| #define PACKAGE_TARNAME "pjproject" +| #define PACKAGE_VERSION "1.0" +| #define PACKAGE_STRING "pjproject 1.0" +| #define PACKAGE_BUGREPORT "" +| #ifdef __cplusplus +| extern "C" void exit (int) throw (); +| #endif +| #define HAVE_LIBPTHREAD 1 +| #define HAVE_LIBRT 1 +| #define HAVE_LIBNSL 1 +| #define HAVE_LIBUUID 1 +| #define PJ_M_NAME "x86_64" +| #define PJ_POOL_ALIGNMENT 8 +| #define PJ_LINUX 1 +| #define PJ_HAS_FLOATING_POINT 1 +| #define HAVE_LIBM 1 +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define PJ_HAS_ARPA_INET_H 1 +| #define PJ_HAS_ASSERT_H 1 +| #define PJ_HAS_CTYPE_H 1 +| #define PJ_HAS_ERRNO_H 1 +| #define PJ_HAS_FCNTL_H 1 +| #define PJ_HAS_LINUX_SOCKET_H 1 +| #define PJ_HAS_MALLOC_H 1 +| #define PJ_HAS_NETDB_H 1 +| #define PJ_HAS_NETINET_IN_SYSTM_H 1 +| #define PJ_HAS_NETINET_IN_H 1 +| #define PJ_HAS_NETINET_IP_H 1 +| #define PJ_HAS_IFADDRS_H 1 +| #define PJ_HAS_SEMAPHORE_H 1 +| #define PJ_HAS_SETJMP_H 1 +| #define PJ_HAS_STDARG_H 1 +| #define PJ_HAS_STDDEF_H 1 +| #define PJ_HAS_STDIO_H 1 +| #define PJ_HAS_STDINT_H 1 +| #define PJ_HAS_STDLIB_H 1 +| #define PJ_HAS_STRING_H 1 +| #define PJ_HAS_SYS_IOCTL_H 1 +| #define PJ_HAS_SYS_SELECT_H 1 +| #define PJ_HAS_SYS_SOCKET_H 1 +| #define PJ_HAS_SYS_TIME_H 1 +| #define PJ_HAS_SYS_TIMEB_H 1 +| #define PJ_HAS_SYS_TYPES_H 1 +| #define PJ_HAS_TIME_H 1 +| #define PJ_HAS_UNISTD_H 1 +| #define PJ_HAS_NET_IF_H 1 +| #define PJ_OS_NAME "x86_64-unknown-linux-gnu" +| #define PJ_HAS_ERRNO_VAR 1 +| #define PJ_HAS_HIGH_RES_TIMER 1 +| #define PJ_HAS_MALLOC 1 +| #define PJ_NATIVE_STRING_IS_UNICODE 0 +| #define PJ_ATOMIC_VALUE_TYPE long +| #define PJ_SOCK_HAS_INET_ATON 1 +| #define PJ_SOCK_HAS_INET_PTON 1 +| #define PJ_SOCK_HAS_INET_NTOP 1 +| #define PJ_SOCK_HAS_GETADDRINFO 1 +| #define PJ_HAS_SOCKLEN_T 1 +| #define PJ_HAS_SO_ERROR 1 +| #define PJ_EMULATE_RWMUTEX 0 +| /* end confdefs.h. */ +| #include <machine/soundcard.h> +aconfigure:10185: result: no +aconfigure:10220: checking for machine/soundcard.h +aconfigure:10227: result: no +aconfigure:10283: checking alsa/version.h usability +aconfigure:10295: gcc -c -O2 conftest.c >&5 +aconfigure:10301: $? = 0 +aconfigure:10305: test -z + || test ! -s conftest.err +aconfigure:10308: $? = 0 +aconfigure:10311: test -s conftest.o +aconfigure:10314: $? = 0 +aconfigure:10324: result: yes +aconfigure:10328: checking alsa/version.h presence +aconfigure:10338: gcc -E conftest.c +aconfigure:10344: $? = 0 +aconfigure:10364: result: yes +aconfigure:10399: checking for alsa/version.h +aconfigure:10406: result: yes +aconfigure:10421: result: Checking sound device backend... unix +aconfigure:10462: result: Checking if small filter is disabled... no +aconfigure:10476: result: Checking if large filter is disabled... no +aconfigure:10490: result: Checking if Speex AEC is disabled...no +aconfigure:10508: result: Checking if G.711 codec is disabled...no +aconfigure:10527: result: Checking if L16 codec is disabled...no +aconfigure:10546: result: Checking if GSM codec is disabled...no +aconfigure:10564: result: Checking if G.722 codec is disabled...no +aconfigure:10582: result: Checking if Speex codec is disabled...no +aconfigure:10600: result: Checking if iLBC codec is disabled...no +aconfigure:10682: result: Skipping libsamplerate detection +aconfigure:10959: result: Skipping Intel IPP settings (not wanted) +aconfigure:10978: result: checking for OpenSSL installations.. +aconfigure:10993: checking openssl/ssl.h usability +aconfigure:11005: gcc -c -O2 conftest.c >&5 +conftest.c:107:25: error: openssl/ssl.h: No such file or directory +aconfigure:11011: $? = 1 +aconfigure: failed program was: +| /* confdefs.h. */ +| +| #define PACKAGE_NAME "pjproject" +| #define PACKAGE_TARNAME "pjproject" +| #define PACKAGE_VERSION "1.0" +| #define PACKAGE_STRING "pjproject 1.0" +| #define PACKAGE_BUGREPORT "" +| #ifdef __cplusplus +| extern "C" void exit (int) throw (); +| #endif +| #define HAVE_LIBPTHREAD 1 +| #define HAVE_LIBRT 1 +| #define HAVE_LIBNSL 1 +| #define HAVE_LIBUUID 1 +| #define PJ_M_NAME "x86_64" +| #define PJ_POOL_ALIGNMENT 8 +| #define PJ_LINUX 1 +| #define PJ_HAS_FLOATING_POINT 1 +| #define HAVE_LIBM 1 +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define PJ_HAS_ARPA_INET_H 1 +| #define PJ_HAS_ASSERT_H 1 +| #define PJ_HAS_CTYPE_H 1 +| #define PJ_HAS_ERRNO_H 1 +| #define PJ_HAS_FCNTL_H 1 +| #define PJ_HAS_LINUX_SOCKET_H 1 +| #define PJ_HAS_MALLOC_H 1 +| #define PJ_HAS_NETDB_H 1 +| #define PJ_HAS_NETINET_IN_SYSTM_H 1 +| #define PJ_HAS_NETINET_IN_H 1 +| #define PJ_HAS_NETINET_IP_H 1 +| #define PJ_HAS_IFADDRS_H 1 +| #define PJ_HAS_SEMAPHORE_H 1 +| #define PJ_HAS_SETJMP_H 1 +| #define PJ_HAS_STDARG_H 1 +| #define PJ_HAS_STDDEF_H 1 +| #define PJ_HAS_STDIO_H 1 +| #define PJ_HAS_STDINT_H 1 +| #define PJ_HAS_STDLIB_H 1 +| #define PJ_HAS_STRING_H 1 +| #define PJ_HAS_SYS_IOCTL_H 1 +| #define PJ_HAS_SYS_SELECT_H 1 +| #define PJ_HAS_SYS_SOCKET_H 1 +| #define PJ_HAS_SYS_TIME_H 1 +| #define PJ_HAS_SYS_TIMEB_H 1 +| #define PJ_HAS_SYS_TYPES_H 1 +| #define PJ_HAS_TIME_H 1 +| #define PJ_HAS_UNISTD_H 1 +| #define PJ_HAS_NET_IF_H 1 +| #define PJ_OS_NAME "x86_64-unknown-linux-gnu" +| #define PJ_HAS_ERRNO_VAR 1 +| #define PJ_HAS_HIGH_RES_TIMER 1 +| #define PJ_HAS_MALLOC 1 +| #define PJ_NATIVE_STRING_IS_UNICODE 0 +| #define PJ_ATOMIC_VALUE_TYPE long +| #define PJ_SOCK_HAS_INET_ATON 1 +| #define PJ_SOCK_HAS_INET_PTON 1 +| #define PJ_SOCK_HAS_INET_NTOP 1 +| #define PJ_SOCK_HAS_GETADDRINFO 1 +| #define PJ_HAS_SOCKLEN_T 1 +| #define PJ_HAS_SO_ERROR 1 +| #define PJ_EMULATE_RWMUTEX 0 +| /* end confdefs.h. */ +| #include <stdio.h> +| #if HAVE_SYS_TYPES_H +| # include <sys/types.h> +| #endif +| #if HAVE_SYS_STAT_H +| # include <sys/stat.h> +| #endif +| #if STDC_HEADERS +| # include <stdlib.h> +| # include <stddef.h> +| #else +| # if HAVE_STDLIB_H +| # include <stdlib.h> +| # endif +| #endif +| #if HAVE_STRING_H +| # if !STDC_HEADERS && HAVE_MEMORY_H +| # include <memory.h> +| # endif +| # include <string.h> +| #endif +| #if HAVE_STRINGS_H +| # include <strings.h> +| #endif +| #if HAVE_INTTYPES_H +| # include <inttypes.h> +| #else +| # if HAVE_STDINT_H +| # include <stdint.h> +| # endif +| #endif +| #if HAVE_UNISTD_H +| # include <unistd.h> +| #endif +| #include <openssl/ssl.h> +aconfigure:11034: result: no +aconfigure:11038: checking openssl/ssl.h presence +aconfigure:11048: gcc -E conftest.c +conftest.c:73:25: error: openssl/ssl.h: No such file or directory +aconfigure:11054: $? = 1 +aconfigure: failed program was: +| /* confdefs.h. */ +| +| #define PACKAGE_NAME "pjproject" +| #define PACKAGE_TARNAME "pjproject" +| #define PACKAGE_VERSION "1.0" +| #define PACKAGE_STRING "pjproject 1.0" +| #define PACKAGE_BUGREPORT "" +| #ifdef __cplusplus +| extern "C" void exit (int) throw (); +| #endif +| #define HAVE_LIBPTHREAD 1 +| #define HAVE_LIBRT 1 +| #define HAVE_LIBNSL 1 +| #define HAVE_LIBUUID 1 +| #define PJ_M_NAME "x86_64" +| #define PJ_POOL_ALIGNMENT 8 +| #define PJ_LINUX 1 +| #define PJ_HAS_FLOATING_POINT 1 +| #define HAVE_LIBM 1 +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define PJ_HAS_ARPA_INET_H 1 +| #define PJ_HAS_ASSERT_H 1 +| #define PJ_HAS_CTYPE_H 1 +| #define PJ_HAS_ERRNO_H 1 +| #define PJ_HAS_FCNTL_H 1 +| #define PJ_HAS_LINUX_SOCKET_H 1 +| #define PJ_HAS_MALLOC_H 1 +| #define PJ_HAS_NETDB_H 1 +| #define PJ_HAS_NETINET_IN_SYSTM_H 1 +| #define PJ_HAS_NETINET_IN_H 1 +| #define PJ_HAS_NETINET_IP_H 1 +| #define PJ_HAS_IFADDRS_H 1 +| #define PJ_HAS_SEMAPHORE_H 1 +| #define PJ_HAS_SETJMP_H 1 +| #define PJ_HAS_STDARG_H 1 +| #define PJ_HAS_STDDEF_H 1 +| #define PJ_HAS_STDIO_H 1 +| #define PJ_HAS_STDINT_H 1 +| #define PJ_HAS_STDLIB_H 1 +| #define PJ_HAS_STRING_H 1 +| #define PJ_HAS_SYS_IOCTL_H 1 +| #define PJ_HAS_SYS_SELECT_H 1 +| #define PJ_HAS_SYS_SOCKET_H 1 +| #define PJ_HAS_SYS_TIME_H 1 +| #define PJ_HAS_SYS_TIMEB_H 1 +| #define PJ_HAS_SYS_TYPES_H 1 +| #define PJ_HAS_TIME_H 1 +| #define PJ_HAS_UNISTD_H 1 +| #define PJ_HAS_NET_IF_H 1 +| #define PJ_OS_NAME "x86_64-unknown-linux-gnu" +| #define PJ_HAS_ERRNO_VAR 1 +| #define PJ_HAS_HIGH_RES_TIMER 1 +| #define PJ_HAS_MALLOC 1 +| #define PJ_NATIVE_STRING_IS_UNICODE 0 +| #define PJ_ATOMIC_VALUE_TYPE long +| #define PJ_SOCK_HAS_INET_ATON 1 +| #define PJ_SOCK_HAS_INET_PTON 1 +| #define PJ_SOCK_HAS_INET_NTOP 1 +| #define PJ_SOCK_HAS_GETADDRINFO 1 +| #define PJ_HAS_SOCKLEN_T 1 +| #define PJ_HAS_SO_ERROR 1 +| #define PJ_EMULATE_RWMUTEX 0 +| /* end confdefs.h. */ +| #include <openssl/ssl.h> +aconfigure:11074: result: no +aconfigure:11109: checking for openssl/ssl.h +aconfigure:11116: result: no +aconfigure:11125: checking for SSL_library_init in -lssl +aconfigure:11155: gcc -o conftest -O2 conftest.c -lssl -lm -luuid -lnsl -lrt -lpthread -lasound >&5 +/usr/bin/ld: cannot find -lssl +collect2: ld returned 1 exit status +aconfigure:11161: $? = 1 +aconfigure: failed program was: +| /* confdefs.h. */ +| +| #define PACKAGE_NAME "pjproject" +| #define PACKAGE_TARNAME "pjproject" +| #define PACKAGE_VERSION "1.0" +| #define PACKAGE_STRING "pjproject 1.0" +| #define PACKAGE_BUGREPORT "" +| #ifdef __cplusplus +| extern "C" void exit (int) throw (); +| #endif +| #define HAVE_LIBPTHREAD 1 +| #define HAVE_LIBRT 1 +| #define HAVE_LIBNSL 1 +| #define HAVE_LIBUUID 1 +| #define PJ_M_NAME "x86_64" +| #define PJ_POOL_ALIGNMENT 8 +| #define PJ_LINUX 1 +| #define PJ_HAS_FLOATING_POINT 1 +| #define HAVE_LIBM 1 +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define PJ_HAS_ARPA_INET_H 1 +| #define PJ_HAS_ASSERT_H 1 +| #define PJ_HAS_CTYPE_H 1 +| #define PJ_HAS_ERRNO_H 1 +| #define PJ_HAS_FCNTL_H 1 +| #define PJ_HAS_LINUX_SOCKET_H 1 +| #define PJ_HAS_MALLOC_H 1 +| #define PJ_HAS_NETDB_H 1 +| #define PJ_HAS_NETINET_IN_SYSTM_H 1 +| #define PJ_HAS_NETINET_IN_H 1 +| #define PJ_HAS_NETINET_IP_H 1 +| #define PJ_HAS_IFADDRS_H 1 +| #define PJ_HAS_SEMAPHORE_H 1 +| #define PJ_HAS_SETJMP_H 1 +| #define PJ_HAS_STDARG_H 1 +| #define PJ_HAS_STDDEF_H 1 +| #define PJ_HAS_STDIO_H 1 +| #define PJ_HAS_STDINT_H 1 +| #define PJ_HAS_STDLIB_H 1 +| #define PJ_HAS_STRING_H 1 +| #define PJ_HAS_SYS_IOCTL_H 1 +| #define PJ_HAS_SYS_SELECT_H 1 +| #define PJ_HAS_SYS_SOCKET_H 1 +| #define PJ_HAS_SYS_TIME_H 1 +| #define PJ_HAS_SYS_TIMEB_H 1 +| #define PJ_HAS_SYS_TYPES_H 1 +| #define PJ_HAS_TIME_H 1 +| #define PJ_HAS_UNISTD_H 1 +| #define PJ_HAS_NET_IF_H 1 +| #define PJ_OS_NAME "x86_64-unknown-linux-gnu" +| #define PJ_HAS_ERRNO_VAR 1 +| #define PJ_HAS_HIGH_RES_TIMER 1 +| #define PJ_HAS_MALLOC 1 +| #define PJ_NATIVE_STRING_IS_UNICODE 0 +| #define PJ_ATOMIC_VALUE_TYPE long +| #define PJ_SOCK_HAS_INET_ATON 1 +| #define PJ_SOCK_HAS_INET_PTON 1 +| #define PJ_SOCK_HAS_INET_NTOP 1 +| #define PJ_SOCK_HAS_GETADDRINFO 1 +| #define PJ_HAS_SOCKLEN_T 1 +| #define PJ_HAS_SO_ERROR 1 +| #define PJ_EMULATE_RWMUTEX 0 +| /* end confdefs.h. */ +| +| /* Override any gcc2 internal prototype to avoid an error. */ +| #ifdef __cplusplus +| extern "C" +| #endif +| /* We use char because int might match the return type of a gcc2 +| builtin and then its argument prototype would still apply. */ +| char SSL_library_init (); +| int +| main () +| { +| SSL_library_init (); +| ; +| return 0; +| } +aconfigure:11187: result: no +aconfigure:11193: checking for ERR_load_BIO_strings in -lcrypto +aconfigure:11223: gcc -o conftest -O2 conftest.c -lcrypto -lm -luuid -lnsl -lrt -lpthread -lasound >&5 +/usr/bin/ld: cannot find -lcrypto +collect2: ld returned 1 exit status +aconfigure:11229: $? = 1 +aconfigure: failed program was: +| /* confdefs.h. */ +| +| #define PACKAGE_NAME "pjproject" +| #define PACKAGE_TARNAME "pjproject" +| #define PACKAGE_VERSION "1.0" +| #define PACKAGE_STRING "pjproject 1.0" +| #define PACKAGE_BUGREPORT "" +| #ifdef __cplusplus +| extern "C" void exit (int) throw (); +| #endif +| #define HAVE_LIBPTHREAD 1 +| #define HAVE_LIBRT 1 +| #define HAVE_LIBNSL 1 +| #define HAVE_LIBUUID 1 +| #define PJ_M_NAME "x86_64" +| #define PJ_POOL_ALIGNMENT 8 +| #define PJ_LINUX 1 +| #define PJ_HAS_FLOATING_POINT 1 +| #define HAVE_LIBM 1 +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define PJ_HAS_ARPA_INET_H 1 +| #define PJ_HAS_ASSERT_H 1 +| #define PJ_HAS_CTYPE_H 1 +| #define PJ_HAS_ERRNO_H 1 +| #define PJ_HAS_FCNTL_H 1 +| #define PJ_HAS_LINUX_SOCKET_H 1 +| #define PJ_HAS_MALLOC_H 1 +| #define PJ_HAS_NETDB_H 1 +| #define PJ_HAS_NETINET_IN_SYSTM_H 1 +| #define PJ_HAS_NETINET_IN_H 1 +| #define PJ_HAS_NETINET_IP_H 1 +| #define PJ_HAS_IFADDRS_H 1 +| #define PJ_HAS_SEMAPHORE_H 1 +| #define PJ_HAS_SETJMP_H 1 +| #define PJ_HAS_STDARG_H 1 +| #define PJ_HAS_STDDEF_H 1 +| #define PJ_HAS_STDIO_H 1 +| #define PJ_HAS_STDINT_H 1 +| #define PJ_HAS_STDLIB_H 1 +| #define PJ_HAS_STRING_H 1 +| #define PJ_HAS_SYS_IOCTL_H 1 +| #define PJ_HAS_SYS_SELECT_H 1 +| #define PJ_HAS_SYS_SOCKET_H 1 +| #define PJ_HAS_SYS_TIME_H 1 +| #define PJ_HAS_SYS_TIMEB_H 1 +| #define PJ_HAS_SYS_TYPES_H 1 +| #define PJ_HAS_TIME_H 1 +| #define PJ_HAS_UNISTD_H 1 +| #define PJ_HAS_NET_IF_H 1 +| #define PJ_OS_NAME "x86_64-unknown-linux-gnu" +| #define PJ_HAS_ERRNO_VAR 1 +| #define PJ_HAS_HIGH_RES_TIMER 1 +| #define PJ_HAS_MALLOC 1 +| #define PJ_NATIVE_STRING_IS_UNICODE 0 +| #define PJ_ATOMIC_VALUE_TYPE long +| #define PJ_SOCK_HAS_INET_ATON 1 +| #define PJ_SOCK_HAS_INET_PTON 1 +| #define PJ_SOCK_HAS_INET_NTOP 1 +| #define PJ_SOCK_HAS_GETADDRINFO 1 +| #define PJ_HAS_SOCKLEN_T 1 +| #define PJ_HAS_SO_ERROR 1 +| #define PJ_EMULATE_RWMUTEX 0 +| /* end confdefs.h. */ +| +| /* Override any gcc2 internal prototype to avoid an error. */ +| #ifdef __cplusplus +| extern "C" +| #endif +| /* We use char because int might match the return type of a gcc2 +| builtin and then its argument prototype would still apply. */ +| char ERR_load_BIO_strings (); +| int +| main () +| { +| ERR_load_BIO_strings (); +| ; +| return 0; +| } +aconfigure:11255: result: no +aconfigure:11269: result: ** OpenSSL libraries not found, disabling SSL support ** +aconfigure:11278: checking if select() needs correct nfds +aconfigure:11292: result: no (default) +aconfigure:11294: result: ** Decided that select() doesn't need correct nfds (please check) +aconfigure:11299: checking if pj_thread_create() should enforce stack size +aconfigure:11313: result: no (default) +aconfigure:11318: checking if pj_thread_create() should allocate stack +aconfigure:11332: result: no (default) +aconfigure:11348: result: ** Setting non-blocking recv() retval to EAGAIN (please check) +aconfigure:11364: result: ** Setting non-blocking connect() retval to EINPROGRESS (please check) +aconfigure:11488: creating ./config.status + +## ---------------------- ## +## Running config.status. ## +## ---------------------- ## + +This file was extended by pjproject config.status 1.0, which was +generated by GNU Autoconf 2.59. Invocation command line was + + CONFIG_FILES = + CONFIG_HEADERS = + CONFIG_LINKS = + CONFIG_COMMANDS = + $ ./config.status + +on emilou-desktop + +config.status:691: creating build.mak +config.status:691: creating build/os-auto.mak +config.status:691: creating pjlib/build/os-auto.mak +config.status:691: creating pjlib-util/build/os-auto.mak +config.status:691: creating pjmedia/build/os-auto.mak +config.status:691: creating pjsip/build/os-auto.mak +config.status:691: creating third_party/build/portaudio/os-auto.mak +config.status:691: creating third_party/build/os-auto.mak +config.status:794: creating pjlib/include/pj/compat/os_auto.h +config.status:794: creating pjlib/include/pj/compat/m_auto.h +config.status:794: creating pjmedia/include/pjmedia/config_auto.h +config.status:794: creating pjmedia/include/pjmedia-codec/config_auto.h +config.status:794: creating pjsip/include/pjsip/sip_autoconf.h +aconfigure:12561: result: + +Configurations for current target have been written to 'build.mak', and 'os-auto.mak' in various build directories, and pjlib/include/pj/compat/os_auto.h. + +Further customizations can be put in: + - 'user.mak' + - 'pjlib/include/pj/config_site.h' + +The next step now is to run 'make dep' and 'make'. + + +## ---------------- ## +## Cache variables. ## +## ---------------- ## + +ac_cv_build=x86_64-unknown-linux-gnu +ac_cv_build_alias=x86_64-unknown-linux-gnu +ac_cv_c_bigendian=no +ac_cv_c_compiler_gnu=yes +ac_cv_cxx_compiler_gnu=yes +ac_cv_env_CC_set= +ac_cv_env_CC_value= +ac_cv_env_CFLAGS_set= +ac_cv_env_CFLAGS_value= +ac_cv_env_CPPFLAGS_set= +ac_cv_env_CPPFLAGS_value= +ac_cv_env_CPP_set= +ac_cv_env_CPP_value= +ac_cv_env_CXXFLAGS_set= +ac_cv_env_CXXFLAGS_value= +ac_cv_env_CXX_set= +ac_cv_env_CXX_value= +ac_cv_env_LDFLAGS_set= +ac_cv_env_LDFLAGS_value= +ac_cv_env_build_alias_set= +ac_cv_env_build_alias_value= +ac_cv_env_host_alias_set= +ac_cv_env_host_alias_value= +ac_cv_env_target_alias_set= +ac_cv_env_target_alias_value= +ac_cv_exeext= +ac_cv_header_alsa_version_h=yes +ac_cv_header_arpa_inet_h=yes +ac_cv_header_assert_h=yes +ac_cv_header_ctype_h=yes +ac_cv_header_errno_h=yes +ac_cv_header_fcntl_h=yes +ac_cv_header_ifaddrs_h=yes +ac_cv_header_inttypes_h=yes +ac_cv_header_linux_socket_h=yes +ac_cv_header_linux_soundcard_h=yes +ac_cv_header_machine_soundcard_h=no +ac_cv_header_malloc_h=yes +ac_cv_header_memory_h=yes +ac_cv_header_mswsock_h=no +ac_cv_header_net_if_h=yes +ac_cv_header_netdb_h=yes +ac_cv_header_netinet_in_h=yes +ac_cv_header_netinet_in_systm_h=yes +ac_cv_header_netinet_ip_h=yes +ac_cv_header_openssl_ssl_h=no +ac_cv_header_semaphore_h=yes +ac_cv_header_setjmp_h=yes +ac_cv_header_stdarg_h=yes +ac_cv_header_stdc=yes +ac_cv_header_stddef_h=yes +ac_cv_header_stdint_h=yes +ac_cv_header_stdio_h=yes +ac_cv_header_stdlib_h=yes +ac_cv_header_string_h=yes +ac_cv_header_strings_h=yes +ac_cv_header_sys_ioctl_h=yes +ac_cv_header_sys_select_h=yes +ac_cv_header_sys_socket_h=yes +ac_cv_header_sys_soundcard_h=yes +ac_cv_header_sys_stat_h=yes +ac_cv_header_sys_time_h=yes +ac_cv_header_sys_timeb_h=yes +ac_cv_header_sys_types_h=yes +ac_cv_header_time_h=yes +ac_cv_header_unistd_h=yes +ac_cv_header_uuid_uuid_h=yes +ac_cv_header_winsock2_h=no +ac_cv_header_winsock_h=no +ac_cv_header_ws2tcpip_h=no +ac_cv_host=x86_64-unknown-linux-gnu +ac_cv_host_alias=x86_64-unknown-linux-gnu +ac_cv_lib_crypto_ERR_load_BIO_strings=no +ac_cv_lib_m_fmod=yes +ac_cv_lib_nsl_puts=yes +ac_cv_lib_ole32_puts=no +ac_cv_lib_pthread_pthread_create=yes +ac_cv_lib_rt_puts=yes +ac_cv_lib_socket_puts=no +ac_cv_lib_ssl_SSL_library_init=no +ac_cv_lib_uuid_uuid_generate=yes +ac_cv_lib_winmm_puts=no +ac_cv_lib_ws2_32_puts=no +ac_cv_lib_wsock32_puts=no +ac_cv_objext=o +ac_cv_prog_CPP='gcc -E' +ac_cv_prog_ac_ct_CC=gcc +ac_cv_prog_ac_ct_CXX=g++ +ac_cv_prog_cc_g=yes +ac_cv_prog_cc_stdc= +ac_cv_prog_cxx_g=yes +ac_cv_prog_egrep='grep -E' +ac_cv_target=x86_64-unknown-linux-gnu +ac_cv_target_alias=x86_64-unknown-linux-gnu + +## ----------------- ## +## Output variables. ## +## ----------------- ## + +CC='gcc' +CFLAGS='-O2' +CPP='gcc -E' +CPPFLAGS='' +CXX='g++' +CXXFLAGS='-O2 ' +DEFS='-DHAVE_CONFIG_H' +ECHO_C='' +ECHO_N='-n' +ECHO_T='' +EGREP='grep -E' +EXEEXT='' +LDFLAGS='' +LIBOBJS='' +LIBS='-lm -luuid -lnsl -lrt -lpthread -lasound' +LTLIBOBJS='' +OBJEXT='o' +PACKAGE_BUGREPORT='' +PACKAGE_NAME='pjproject' +PACKAGE_STRING='pjproject 1.0' +PACKAGE_TARNAME='pjproject' +PACKAGE_VERSION='1.0' +PATH_SEPARATOR=':' +SHELL='/bin/bash' +ac_build_mak_vars='' +ac_cross_compile='' +ac_ct_CC='gcc' +ac_ct_CXX='g++' +ac_host='unix' +ac_linux_poll='select' +ac_main_obj='main.o' +ac_no_g711_codec='' +ac_no_g722_codec='' +ac_no_gsm_codec='' +ac_no_ilbc_codec='' +ac_no_l16_codec='' +ac_no_large_filter='' +ac_no_small_filter='' +ac_no_speex_aec='' +ac_no_speex_codec='' +ac_no_ssl='' +ac_os_objs='ioqueue_select.o file_access_unistd.o file_io_ansi.o os_core_unix.o os_error_unix.o os_time_unix.o os_timestamp_posix.o guid_uuid.o' +ac_pa_cflags=' -DHAVE_SYS_SOUNDCARD_H -DHAVE_LINUX_SOUNDCARD_H -DPA_LITTLE_ENDIAN' +ac_pa_use_alsa='1' +ac_pa_use_oss='1' +ac_pjdir='/home/emilou/git-repos/sflphone/sflphone-common/libs/pjproject-1.0.2' +ac_pjmedia_snd='pa_unix' +bindir='${exec_prefix}/bin' +build='x86_64-unknown-linux-gnu' +build_alias='' +build_cpu='x86_64' +build_os='linux-gnu' +build_vendor='unknown' +datadir='${prefix}/share' +exec_prefix='${prefix}' +host='x86_64-unknown-linux-gnu' +host_alias='' +host_cpu='x86_64' +host_os='linux-gnu' +host_vendor='unknown' +includedir='${prefix}/include' +infodir='${prefix}/info' +libcrypto_present='' +libdir='${exec_prefix}/lib' +libexecdir='${exec_prefix}/libexec' +libssl_present='' +localstatedir='${prefix}/var' +mandir='${prefix}/man' +oldincludedir='/usr/include' +openssl_h_present='' +prefix='/usr/local' +program_transform_name='s,x,x,' +sbindir='${exec_prefix}/sbin' +sharedstatedir='${prefix}/com' +sysconfdir='${prefix}/etc' +target='x86_64-unknown-linux-gnu' +target_alias='' +target_cpu='x86_64' +target_os='linux-gnu' +target_vendor='unknown' + +## ----------- ## +## confdefs.h. ## +## ----------- ## + +#define HAVE_INTTYPES_H 1 +#define HAVE_LIBM 1 +#define HAVE_LIBNSL 1 +#define HAVE_LIBPTHREAD 1 +#define HAVE_LIBRT 1 +#define HAVE_LIBUUID 1 +#define HAVE_MEMORY_H 1 +#define HAVE_STDINT_H 1 +#define HAVE_STDLIB_H 1 +#define HAVE_STRINGS_H 1 +#define HAVE_STRING_H 1 +#define HAVE_SYS_STAT_H 1 +#define HAVE_SYS_TYPES_H 1 +#define HAVE_UNISTD_H 1 +#define PACKAGE_BUGREPORT "" +#define PACKAGE_NAME "pjproject" +#define PACKAGE_STRING "pjproject 1.0" +#define PACKAGE_TARNAME "pjproject" +#define PACKAGE_VERSION "1.0" +#define PJ_ATOMIC_VALUE_TYPE long +#define PJ_BLOCKING_CONNECT_ERROR_VAL EINPROGRESS +#define PJ_BLOCKING_ERROR_VAL EAGAIN +#define PJ_EMULATE_RWMUTEX 0 +#define PJ_HAS_ARPA_INET_H 1 +#define PJ_HAS_ASSERT_H 1 +#define PJ_HAS_CTYPE_H 1 +#define PJ_HAS_ERRNO_H 1 +#define PJ_HAS_ERRNO_VAR 1 +#define PJ_HAS_FCNTL_H 1 +#define PJ_HAS_FLOATING_POINT 1 +#define PJ_HAS_HIGH_RES_TIMER 1 +#define PJ_HAS_IFADDRS_H 1 +#define PJ_HAS_LINUX_SOCKET_H 1 +#define PJ_HAS_MALLOC 1 +#define PJ_HAS_MALLOC_H 1 +#define PJ_HAS_NETDB_H 1 +#define PJ_HAS_NETINET_IN_H 1 +#define PJ_HAS_NETINET_IN_SYSTM_H 1 +#define PJ_HAS_NETINET_IP_H 1 +#define PJ_HAS_NET_IF_H 1 +#define PJ_HAS_SEMAPHORE_H 1 +#define PJ_HAS_SETJMP_H 1 +#define PJ_HAS_SOCKLEN_T 1 +#define PJ_HAS_SO_ERROR 1 +#define PJ_HAS_STDARG_H 1 +#define PJ_HAS_STDDEF_H 1 +#define PJ_HAS_STDINT_H 1 +#define PJ_HAS_STDIO_H 1 +#define PJ_HAS_STDLIB_H 1 +#define PJ_HAS_STRING_H 1 +#define PJ_HAS_SYS_IOCTL_H 1 +#define PJ_HAS_SYS_SELECT_H 1 +#define PJ_HAS_SYS_SOCKET_H 1 +#define PJ_HAS_SYS_TIMEB_H 1 +#define PJ_HAS_SYS_TIME_H 1 +#define PJ_HAS_SYS_TYPES_H 1 +#define PJ_HAS_TIME_H 1 +#define PJ_HAS_UNISTD_H 1 +#define PJ_LINUX 1 +#define PJ_M_NAME "x86_64" +#define PJ_NATIVE_STRING_IS_UNICODE 0 +#define PJ_OS_NAME "x86_64-unknown-linux-gnu" +#define PJ_POOL_ALIGNMENT 8 +#define PJ_SELECT_NEEDS_NFDS 0 +#define PJ_SOCK_HAS_GETADDRINFO 1 +#define PJ_SOCK_HAS_INET_ATON 1 +#define PJ_SOCK_HAS_INET_NTOP 1 +#define PJ_SOCK_HAS_INET_PTON 1 +#define PJ_THREAD_ALLOCATE_STACK 0 +#define PJ_THREAD_SET_STACK_SIZE 0 +#define STDC_HEADERS 1 +#endif +#ifdef __cplusplus +extern "C" void exit (int) throw (); + +aconfigure: exit 0 diff --git a/sflphone-common/libs/pjproject-1.0.2/config.status b/sflphone-common/libs/pjproject-1.0.2/config.status new file mode 100755 index 0000000000000000000000000000000000000000..2c61c60623246bb10326e73dc4512833636b35aa --- /dev/null +++ b/sflphone-common/libs/pjproject-1.0.2/config.status @@ -0,0 +1,1075 @@ +#! /bin/bash +# Generated by aconfigure. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false +SHELL=${CONFIG_SHELL-/bin/bash} +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## + +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix +fi +DUALCASE=1; export DUALCASE # for MKS sh + +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + + +# Work around bugs in pre-3.0 UWIN ksh. +$as_unset ENV MAIL MAILPATH +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + + +# Name of the executable. +as_me=`$as_basename "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)$' \| \ + . : '\(.\)' 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } + /^X\/\(\/\/\)$/{ s//\1/; q; } + /^X\/\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + + +# PATH needs CR, and LINENO needs CR and PATH. +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" || { + # Find who we are. Look in the path if we contain no path at all + # relative or not. + case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done + + ;; + esac + # We did not find ourselves, most probably we were run as `sh COMMAND' + # in which case we are not to be found in the path. + if test "x$as_myself" = x; then + as_myself=$0 + fi + if test ! -f "$as_myself"; then + { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 +echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} + { (exit 1); exit 1; }; } + fi + case $CONFIG_SHELL in + '') + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for as_base in sh bash ksh sh5; do + case $as_dir in + /*) + if ("$as_dir/$as_base" -c ' + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then + $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } + $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } + CONFIG_SHELL=$as_dir/$as_base + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$0" ${1+"$@"} + fi;; + esac + done +done +;; + esac + + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line before each line; the second 'sed' does the real + # work. The second script uses 'N' to pair each line-number line + # with the numbered line, and appends trailing '-' during + # substitution so that $LINENO is not a special case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) + sed '=' <$as_myself | + sed ' + N + s,$,-, + : loop + s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + t loop + s,-$,, + s,^['$as_cr_digits']*\n,, + ' >$as_me.lineno && + chmod +x $as_me.lineno || + { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 +echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} + { (exit 1); exit 1; }; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensible to this). + . ./$as_me.lineno + # Exit status is that of the last command. + exit +} + + +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in + *c*,-n*) ECHO_N= ECHO_C=' +' ECHO_T=' ' ;; + *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; + *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +esac + +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links + as_ln_s='cp -p' + else + as_ln_s='ln -s' + fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.file + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_executable_p="test -f" + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH + +exec 6>&1 + +# Open the log real soon, to keep \$[0] and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. Logging --version etc. is OK. +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX +} >&5 +cat >&5 <<_CSEOF + +This file was extended by pjproject $as_me 1.0, which was +generated by GNU Autoconf 2.59. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +_CSEOF +echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 +echo >&5 +config_files=" build.mak build/os-auto.mak pjlib/build/os-auto.mak pjlib-util/build/os-auto.mak pjmedia/build/os-auto.mak pjsip/build/os-auto.mak third_party/build/portaudio/os-auto.mak third_party/build/os-auto.mak" +config_headers=" pjlib/include/pj/compat/os_auto.h pjlib/include/pj/compat/m_auto.h pjmedia/include/pjmedia/config_auto.h pjmedia/include/pjmedia-codec/config_auto.h pjsip/include/pjsip/sip_autoconf.h" + +ac_cs_usage="\ +\`$as_me' instantiates files from templates according to the +current configuration. + +Usage: $0 [OPTIONS] [FILE]... + + -h, --help print this help, then exit + -V, --version print version number, then exit + -q, --quiet do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Report bugs to <bug-autoconf@gnu.org>." +ac_cs_version="\ +pjproject config.status 1.0 +configured by ./aconfigure, generated by GNU Autoconf 2.59, + with options \"\" + +Copyright (C) 2003 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." +srcdir=. +# If no file are specified by the user, then we need to provide default +# value. By we need to know if files were specified by the user. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=*) + ac_option=`expr "x$1" : 'x\([^=]*\)='` + ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` + ac_shift=: + ;; + -*) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + *) # This is not an option, so the user has probably given explicit + # arguments. + ac_option=$1 + ac_need_defaults=false;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --vers* | -V ) + echo "$ac_cs_version"; exit 0 ;; + --he | --h) + # Conflict between --help and --header + { { echo "$as_me:$LINENO: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&5 +echo "$as_me: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&2;} + { (exit 1); exit 1; }; };; + --help | --hel | -h ) + echo "$ac_cs_usage"; exit 0 ;; + --debug | --d* | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + CONFIG_FILES="$CONFIG_FILES $ac_optarg" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" + ac_need_defaults=false;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&5 +echo "$as_me: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&2;} + { (exit 1); exit 1; }; } ;; + + *) ac_config_targets="$ac_config_targets $1" ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +if $ac_cs_recheck; then + echo "running /bin/bash ./aconfigure " $ac_configure_extra_args " --no-create --no-recursion" >&6 + exec /bin/bash ./aconfigure $ac_configure_extra_args --no-create --no-recursion +fi + +for ac_config_target in $ac_config_targets +do + case "$ac_config_target" in + # Handling of arguments. + "build.mak" ) CONFIG_FILES="$CONFIG_FILES build.mak" ;; + "build/os-auto.mak" ) CONFIG_FILES="$CONFIG_FILES build/os-auto.mak" ;; + "pjlib/build/os-auto.mak" ) CONFIG_FILES="$CONFIG_FILES pjlib/build/os-auto.mak" ;; + "pjlib-util/build/os-auto.mak" ) CONFIG_FILES="$CONFIG_FILES pjlib-util/build/os-auto.mak" ;; + "pjmedia/build/os-auto.mak" ) CONFIG_FILES="$CONFIG_FILES pjmedia/build/os-auto.mak" ;; + "pjsip/build/os-auto.mak" ) CONFIG_FILES="$CONFIG_FILES pjsip/build/os-auto.mak" ;; + "third_party/build/portaudio/os-auto.mak" ) CONFIG_FILES="$CONFIG_FILES third_party/build/portaudio/os-auto.mak" ;; + "third_party/build/os-auto.mak" ) CONFIG_FILES="$CONFIG_FILES third_party/build/os-auto.mak" ;; + "pjlib/include/pj/compat/os_auto.h" ) CONFIG_HEADERS="$CONFIG_HEADERS pjlib/include/pj/compat/os_auto.h" ;; + "pjlib/include/pj/compat/m_auto.h" ) CONFIG_HEADERS="$CONFIG_HEADERS pjlib/include/pj/compat/m_auto.h" ;; + "pjmedia/include/pjmedia/config_auto.h" ) CONFIG_HEADERS="$CONFIG_HEADERS pjmedia/include/pjmedia/config_auto.h" ;; + "pjmedia/include/pjmedia-codec/config_auto.h" ) CONFIG_HEADERS="$CONFIG_HEADERS pjmedia/include/pjmedia-codec/config_auto.h" ;; + "pjsip/include/pjsip/sip_autoconf.h" ) CONFIG_HEADERS="$CONFIG_HEADERS pjsip/include/pjsip/sip_autoconf.h" ;; + *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 +echo "$as_me: error: invalid argument: $ac_config_target" >&2;} + { (exit 1); exit 1; }; };; + esac +done + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason to put it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Create a temporary directory, and hook for its removal unless debugging. +$debug || +{ + trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 + trap '{ (exit 1); exit 1; }' 1 2 13 15 +} + +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && + test -n "$tmp" && test -d "$tmp" +} || +{ + tmp=./confstat$$-$RANDOM + (umask 077 && mkdir $tmp) +} || +{ + echo "$me: cannot create a temporary directory in ." >&2 + { (exit 1); exit 1; } +} + + +# +# CONFIG_FILES section. +# + +# No need to generate the scripts if there are no CONFIG_FILES. +# This happens for instance when ./config.status config.h +if test -n "$CONFIG_FILES"; then + # Protect against being on the right side of a sed subst in config.status. + sed 's/,@/@@/; s/@,/@@/; s/,;t t$/@;t t/; /@;t t$/s/[\\&,]/\\&/g; + s/@@/,@/; s/@@/@,/; s/@;t t$/,;t t/' >$tmp/subs.sed <<\CEOF +s,@SHELL@,/bin/bash,;t t +s,@PATH_SEPARATOR@,:,;t t +s,@PACKAGE_NAME@,pjproject,;t t +s,@PACKAGE_TARNAME@,pjproject,;t t +s,@PACKAGE_VERSION@,1.0,;t t +s,@PACKAGE_STRING@,pjproject 1.0,;t t +s,@PACKAGE_BUGREPORT@,,;t t +s,@exec_prefix@,${prefix},;t t +s,@prefix@,/usr/local,;t t +s,@program_transform_name@,s,x,x,,;t t +s,@bindir@,${exec_prefix}/bin,;t t +s,@sbindir@,${exec_prefix}/sbin,;t t +s,@libexecdir@,${exec_prefix}/libexec,;t t +s,@datadir@,${prefix}/share,;t t +s,@sysconfdir@,${prefix}/etc,;t t +s,@sharedstatedir@,${prefix}/com,;t t +s,@localstatedir@,${prefix}/var,;t t +s,@libdir@,${exec_prefix}/lib,;t t +s,@includedir@,${prefix}/include,;t t +s,@oldincludedir@,/usr/include,;t t +s,@infodir@,${prefix}/info,;t t +s,@mandir@,${prefix}/man,;t t +s,@build_alias@,,;t t +s,@host_alias@,,;t t +s,@target_alias@,,;t t +s,@DEFS@,-DHAVE_CONFIG_H,;t t +s,@ECHO_C@,,;t t +s,@ECHO_N@,-n,;t t +s,@ECHO_T@,,;t t +s,@LIBS@,-lm -luuid -lnsl -lrt -lpthread -lasound,;t t +s,@build@,x86_64-unknown-linux-gnu,;t t +s,@build_cpu@,x86_64,;t t +s,@build_vendor@,unknown,;t t +s,@build_os@,linux-gnu,;t t +s,@host@,x86_64-unknown-linux-gnu,;t t +s,@host_cpu@,x86_64,;t t +s,@host_vendor@,unknown,;t t +s,@host_os@,linux-gnu,;t t +s,@target@,x86_64-unknown-linux-gnu,;t t +s,@target_cpu@,x86_64,;t t +s,@target_vendor@,unknown,;t t +s,@target_os@,linux-gnu,;t t +s,@CC@,gcc,;t t +s,@CFLAGS@,-O2,;t t +s,@LDFLAGS@,,;t t +s,@CPPFLAGS@,,;t t +s,@ac_ct_CC@,gcc,;t t +s,@EXEEXT@,,;t t +s,@OBJEXT@,o,;t t +s,@CXX@,g++,;t t +s,@CXXFLAGS@,-O2 ,;t t +s,@ac_ct_CXX@,g++,;t t +s,@ac_pjdir@,/home/emilou/git-repos/sflphone/sflphone-common/libs/pjproject-1.0.2,;t t +s,@ac_build_mak_vars@,,;t t +s,@CPP@,gcc -E,;t t +s,@EGREP@,grep -E,;t t +s,@ac_os_objs@,ioqueue_select.o file_access_unistd.o file_io_ansi.o os_core_unix.o os_error_unix.o os_time_unix.o os_timestamp_posix.o guid_uuid.o,;t t +s,@ac_pjmedia_snd@,pa_unix,;t t +s,@ac_pa_cflags@, -DHAVE_SYS_SOUNDCARD_H -DHAVE_LINUX_SOUNDCARD_H -DPA_LITTLE_ENDIAN,;t t +s,@ac_pa_use_alsa@,1,;t t +s,@ac_pa_use_oss@,1,;t t +s,@ac_no_small_filter@,,;t t +s,@ac_no_large_filter@,,;t t +s,@ac_no_speex_aec@,,;t t +s,@ac_no_g711_codec@,,;t t +s,@ac_no_l16_codec@,,;t t +s,@ac_no_gsm_codec@,,;t t +s,@ac_no_g722_codec@,,;t t +s,@ac_no_speex_codec@,,;t t +s,@ac_no_ilbc_codec@,,;t t +s,@ac_no_ssl@,,;t t +s,@openssl_h_present@,,;t t +s,@libssl_present@,,;t t +s,@libcrypto_present@,,;t t +s,@ac_cross_compile@,,;t t +s,@ac_linux_poll@,select,;t t +s,@ac_host@,unix,;t t +s,@ac_main_obj@,main.o,;t t +s,@LIBOBJS@,,;t t +s,@LTLIBOBJS@,,;t t +CEOF + + # Split the substitutions into bite-sized pieces for seds with + # small command number limits, like on Digital OSF/1 and HP-UX. + ac_max_sed_lines=48 + ac_sed_frag=1 # Number of current file. + ac_beg=1 # First line for current file. + ac_end=$ac_max_sed_lines # Line after last line for current file. + ac_more_lines=: + ac_sed_cmds= + while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + else + sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + fi + if test ! -s $tmp/subs.frag; then + ac_more_lines=false + else + # The purpose of the label and of the branching condition is to + # speed up the sed processing (if there are no `@' at all, there + # is no need to browse any of the substitutions). + # These are the two extra sed commands mentioned above. + (echo ':t + /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" + else + ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" + fi + ac_sed_frag=`expr $ac_sed_frag + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_lines` + fi + done + if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat + fi +fi # test -n "$CONFIG_FILES" + +for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case $ac_file in + - | *:- | *:-:* ) # input from stdin + cat >$tmp/stdin + ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + * ) ac_file_in=$ac_file.in ;; + esac + + # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. + ac_dir=`(dirname "$ac_file") 2>/dev/null || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p "$ac_dir" + else + as_dir="$ac_dir" + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; }; } + + ac_builddir=. + +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi + +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac + +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; +esac + + + + if test x"$ac_file" != x-; then + { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + rm -f "$ac_file" + fi + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + if test x"$ac_file" = x-; then + configure_input= + else + configure_input="$ac_file. " + fi + configure_input=$configure_input"Generated from `echo $ac_file_in | + sed 's,.*/,,'` by configure." + + # First look for the input files in the build tree, otherwise in the + # src tree. + ac_file_inputs=`IFS=: + for f in $ac_file_in; do + case $f in + -) echo $tmp/stdin ;; + [\\/$]*) + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + echo "$f";; + *) # Relative + if test -f "$f"; then + # Build tree + echo "$f" + elif test -f "$srcdir/$f"; then + # Source tree + echo "$srcdir/$f" + else + # /dev/null tree + { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + fi;; + esac + done` || { (exit 1); exit 1; } + sed "/^[ ]*VPATH[ ]*=/{ +s/:*\$(srcdir):*/:/; +s/:*\${srcdir}:*/:/; +s/:*@srcdir@:*/:/; +s/^\([^=]*=[ ]*\):*/\1/; +s/:*$//; +s/^[^=]*=[ ]*$//; +} + +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s,@configure_input@,$configure_input,;t t +s,@srcdir@,$ac_srcdir,;t t +s,@abs_srcdir@,$ac_abs_srcdir,;t t +s,@top_srcdir@,$ac_top_srcdir,;t t +s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t +s,@builddir@,$ac_builddir,;t t +s,@abs_builddir@,$ac_abs_builddir,;t t +s,@top_builddir@,$ac_top_builddir,;t t +s,@abs_top_builddir@,$ac_abs_top_builddir,;t t +" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out + rm -f $tmp/stdin + if test x"$ac_file" != x-; then + mv $tmp/out $ac_file + else + cat $tmp/out + rm -f $tmp/out + fi + +done + +# +# CONFIG_HEADER section. +# + +# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where +# NAME is the cpp macro being defined and VALUE is the value it is being given. +# +# ac_d sets the value in "#define NAME VALUE" lines. +ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)' +ac_dB='[ ].*$,\1#\2' +ac_dC=' ' +ac_dD=',;t' +# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". +ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' +ac_uB='$,\1#\2define\3' +ac_uC=' ' +ac_uD=',;t' + +for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case $ac_file in + - | *:- | *:-:* ) # input from stdin + cat >$tmp/stdin + ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + * ) ac_file_in=$ac_file.in ;; + esac + + test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + + # First look for the input files in the build tree, otherwise in the + # src tree. + ac_file_inputs=`IFS=: + for f in $ac_file_in; do + case $f in + -) echo $tmp/stdin ;; + [\\/$]*) + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + # Do quote $f, to prevent DOS paths from being IFS'd. + echo "$f";; + *) # Relative + if test -f "$f"; then + # Build tree + echo "$f" + elif test -f "$srcdir/$f"; then + # Source tree + echo "$srcdir/$f" + else + # /dev/null tree + { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + fi;; + esac + done` || { (exit 1); exit 1; } + # Remove the trailing spaces. + sed 's/[ ]*$//' $ac_file_inputs >$tmp/in + + # Handle all the #define templates only if necessary. + if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then + # If there are no defines, we may have an empty if/fi + : + cat >$tmp/defines.sed <<CEOF +/^[ ]*#[ ]*define/!b +t clr +: clr +${ac_dA}PACKAGE_NAME${ac_dB}PACKAGE_NAME${ac_dC}"pjproject"${ac_dD} +${ac_dA}PACKAGE_TARNAME${ac_dB}PACKAGE_TARNAME${ac_dC}"pjproject"${ac_dD} +${ac_dA}PACKAGE_VERSION${ac_dB}PACKAGE_VERSION${ac_dC}"1.0"${ac_dD} +${ac_dA}PACKAGE_STRING${ac_dB}PACKAGE_STRING${ac_dC}"pjproject 1.0"${ac_dD} +${ac_dA}PACKAGE_BUGREPORT${ac_dB}PACKAGE_BUGREPORT${ac_dC}""${ac_dD} +${ac_dA}HAVE_LIBPTHREAD${ac_dB}HAVE_LIBPTHREAD${ac_dC}1${ac_dD} +${ac_dA}HAVE_LIBRT${ac_dB}HAVE_LIBRT${ac_dC}1${ac_dD} +${ac_dA}HAVE_LIBNSL${ac_dB}HAVE_LIBNSL${ac_dC}1${ac_dD} +${ac_dA}HAVE_LIBUUID${ac_dB}HAVE_LIBUUID${ac_dC}1${ac_dD} +${ac_dA}PJ_M_NAME${ac_dB}PJ_M_NAME${ac_dC}"x86_64"${ac_dD} +${ac_dA}PJ_POOL_ALIGNMENT${ac_dB}PJ_POOL_ALIGNMENT${ac_dC}8${ac_dD} +${ac_dA}PJ_LINUX${ac_dB}PJ_LINUX${ac_dC}1${ac_dD} +${ac_dA}PJ_HAS_FLOATING_POINT${ac_dB}PJ_HAS_FLOATING_POINT${ac_dC}1${ac_dD} +${ac_dA}HAVE_LIBM${ac_dB}HAVE_LIBM${ac_dC}1${ac_dD} +${ac_dA}STDC_HEADERS${ac_dB}STDC_HEADERS${ac_dC}1${ac_dD} +${ac_dA}HAVE_SYS_TYPES_H${ac_dB}HAVE_SYS_TYPES_H${ac_dC}1${ac_dD} +${ac_dA}HAVE_SYS_STAT_H${ac_dB}HAVE_SYS_STAT_H${ac_dC}1${ac_dD} +${ac_dA}HAVE_STDLIB_H${ac_dB}HAVE_STDLIB_H${ac_dC}1${ac_dD} +${ac_dA}HAVE_STRING_H${ac_dB}HAVE_STRING_H${ac_dC}1${ac_dD} +${ac_dA}HAVE_MEMORY_H${ac_dB}HAVE_MEMORY_H${ac_dC}1${ac_dD} +${ac_dA}HAVE_STRINGS_H${ac_dB}HAVE_STRINGS_H${ac_dC}1${ac_dD} +${ac_dA}HAVE_INTTYPES_H${ac_dB}HAVE_INTTYPES_H${ac_dC}1${ac_dD} +${ac_dA}HAVE_STDINT_H${ac_dB}HAVE_STDINT_H${ac_dC}1${ac_dD} +${ac_dA}HAVE_UNISTD_H${ac_dB}HAVE_UNISTD_H${ac_dC}1${ac_dD} +${ac_dA}PJ_HAS_ARPA_INET_H${ac_dB}PJ_HAS_ARPA_INET_H${ac_dC}1${ac_dD} +${ac_dA}PJ_HAS_ASSERT_H${ac_dB}PJ_HAS_ASSERT_H${ac_dC}1${ac_dD} +${ac_dA}PJ_HAS_CTYPE_H${ac_dB}PJ_HAS_CTYPE_H${ac_dC}1${ac_dD} +${ac_dA}PJ_HAS_ERRNO_H${ac_dB}PJ_HAS_ERRNO_H${ac_dC}1${ac_dD} +${ac_dA}PJ_HAS_FCNTL_H${ac_dB}PJ_HAS_FCNTL_H${ac_dC}1${ac_dD} +${ac_dA}PJ_HAS_LINUX_SOCKET_H${ac_dB}PJ_HAS_LINUX_SOCKET_H${ac_dC}1${ac_dD} +${ac_dA}PJ_HAS_MALLOC_H${ac_dB}PJ_HAS_MALLOC_H${ac_dC}1${ac_dD} +${ac_dA}PJ_HAS_NETDB_H${ac_dB}PJ_HAS_NETDB_H${ac_dC}1${ac_dD} +${ac_dA}PJ_HAS_NETINET_IN_SYSTM_H${ac_dB}PJ_HAS_NETINET_IN_SYSTM_H${ac_dC}1${ac_dD} +${ac_dA}PJ_HAS_NETINET_IN_H${ac_dB}PJ_HAS_NETINET_IN_H${ac_dC}1${ac_dD} +${ac_dA}PJ_HAS_NETINET_IP_H${ac_dB}PJ_HAS_NETINET_IP_H${ac_dC}1${ac_dD} +${ac_dA}PJ_HAS_IFADDRS_H${ac_dB}PJ_HAS_IFADDRS_H${ac_dC}1${ac_dD} +${ac_dA}PJ_HAS_SEMAPHORE_H${ac_dB}PJ_HAS_SEMAPHORE_H${ac_dC}1${ac_dD} +${ac_dA}PJ_HAS_SETJMP_H${ac_dB}PJ_HAS_SETJMP_H${ac_dC}1${ac_dD} +CEOF + sed -f $tmp/defines.sed $tmp/in >$tmp/out + rm -f $tmp/in + mv $tmp/out $tmp/in + + cat >$tmp/defines.sed <<CEOF +/^[ ]*#[ ]*define/!b +t clr +: clr +${ac_dA}PJ_HAS_STDARG_H${ac_dB}PJ_HAS_STDARG_H${ac_dC}1${ac_dD} +${ac_dA}PJ_HAS_STDDEF_H${ac_dB}PJ_HAS_STDDEF_H${ac_dC}1${ac_dD} +${ac_dA}PJ_HAS_STDIO_H${ac_dB}PJ_HAS_STDIO_H${ac_dC}1${ac_dD} +${ac_dA}PJ_HAS_STDINT_H${ac_dB}PJ_HAS_STDINT_H${ac_dC}1${ac_dD} +${ac_dA}PJ_HAS_STDLIB_H${ac_dB}PJ_HAS_STDLIB_H${ac_dC}1${ac_dD} +${ac_dA}PJ_HAS_STRING_H${ac_dB}PJ_HAS_STRING_H${ac_dC}1${ac_dD} +${ac_dA}PJ_HAS_SYS_IOCTL_H${ac_dB}PJ_HAS_SYS_IOCTL_H${ac_dC}1${ac_dD} +${ac_dA}PJ_HAS_SYS_SELECT_H${ac_dB}PJ_HAS_SYS_SELECT_H${ac_dC}1${ac_dD} +${ac_dA}PJ_HAS_SYS_SOCKET_H${ac_dB}PJ_HAS_SYS_SOCKET_H${ac_dC}1${ac_dD} +${ac_dA}PJ_HAS_SYS_TIME_H${ac_dB}PJ_HAS_SYS_TIME_H${ac_dC}1${ac_dD} +${ac_dA}PJ_HAS_SYS_TIMEB_H${ac_dB}PJ_HAS_SYS_TIMEB_H${ac_dC}1${ac_dD} +${ac_dA}PJ_HAS_SYS_TYPES_H${ac_dB}PJ_HAS_SYS_TYPES_H${ac_dC}1${ac_dD} +${ac_dA}PJ_HAS_TIME_H${ac_dB}PJ_HAS_TIME_H${ac_dC}1${ac_dD} +${ac_dA}PJ_HAS_UNISTD_H${ac_dB}PJ_HAS_UNISTD_H${ac_dC}1${ac_dD} +${ac_dA}PJ_HAS_NET_IF_H${ac_dB}PJ_HAS_NET_IF_H${ac_dC}1${ac_dD} +${ac_dA}PJ_OS_NAME${ac_dB}PJ_OS_NAME${ac_dC}"x86_64-unknown-linux-gnu"${ac_dD} +${ac_dA}PJ_HAS_ERRNO_VAR${ac_dB}PJ_HAS_ERRNO_VAR${ac_dC}1${ac_dD} +${ac_dA}PJ_HAS_HIGH_RES_TIMER${ac_dB}PJ_HAS_HIGH_RES_TIMER${ac_dC}1${ac_dD} +${ac_dA}PJ_HAS_MALLOC${ac_dB}PJ_HAS_MALLOC${ac_dC}1${ac_dD} +${ac_dA}PJ_NATIVE_STRING_IS_UNICODE${ac_dB}PJ_NATIVE_STRING_IS_UNICODE${ac_dC}0${ac_dD} +${ac_dA}PJ_ATOMIC_VALUE_TYPE${ac_dB}PJ_ATOMIC_VALUE_TYPE${ac_dC}long${ac_dD} +${ac_dA}PJ_SOCK_HAS_INET_ATON${ac_dB}PJ_SOCK_HAS_INET_ATON${ac_dC}1${ac_dD} +${ac_dA}PJ_SOCK_HAS_INET_PTON${ac_dB}PJ_SOCK_HAS_INET_PTON${ac_dC}1${ac_dD} +${ac_dA}PJ_SOCK_HAS_INET_NTOP${ac_dB}PJ_SOCK_HAS_INET_NTOP${ac_dC}1${ac_dD} +${ac_dA}PJ_SOCK_HAS_GETADDRINFO${ac_dB}PJ_SOCK_HAS_GETADDRINFO${ac_dC}1${ac_dD} +${ac_dA}PJ_HAS_SOCKLEN_T${ac_dB}PJ_HAS_SOCKLEN_T${ac_dC}1${ac_dD} +${ac_dA}PJ_HAS_SO_ERROR${ac_dB}PJ_HAS_SO_ERROR${ac_dC}1${ac_dD} +${ac_dA}PJ_EMULATE_RWMUTEX${ac_dB}PJ_EMULATE_RWMUTEX${ac_dC}0${ac_dD} +${ac_dA}PJ_SELECT_NEEDS_NFDS${ac_dB}PJ_SELECT_NEEDS_NFDS${ac_dC}0${ac_dD} +${ac_dA}PJ_THREAD_SET_STACK_SIZE${ac_dB}PJ_THREAD_SET_STACK_SIZE${ac_dC}0${ac_dD} +${ac_dA}PJ_THREAD_ALLOCATE_STACK${ac_dB}PJ_THREAD_ALLOCATE_STACK${ac_dC}0${ac_dD} +${ac_dA}PJ_BLOCKING_ERROR_VAL${ac_dB}PJ_BLOCKING_ERROR_VAL${ac_dC}EAGAIN${ac_dD} +${ac_dA}PJ_BLOCKING_CONNECT_ERROR_VAL${ac_dB}PJ_BLOCKING_CONNECT_ERROR_VAL${ac_dC}EINPROGRESS${ac_dD} +CEOF + sed -f $tmp/defines.sed $tmp/in >$tmp/out + rm -f $tmp/in + mv $tmp/out $tmp/in + + fi # grep + + # Handle all the #undef templates + cat >$tmp/undefs.sed <<CEOF +/^[ ]*#[ ]*undef/!b +t clr +: clr +${ac_uA}PACKAGE_NAME${ac_uB}PACKAGE_NAME${ac_uC}"pjproject"${ac_uD} +${ac_uA}PACKAGE_TARNAME${ac_uB}PACKAGE_TARNAME${ac_uC}"pjproject"${ac_uD} +${ac_uA}PACKAGE_VERSION${ac_uB}PACKAGE_VERSION${ac_uC}"1.0"${ac_uD} +${ac_uA}PACKAGE_STRING${ac_uB}PACKAGE_STRING${ac_uC}"pjproject 1.0"${ac_uD} +${ac_uA}PACKAGE_BUGREPORT${ac_uB}PACKAGE_BUGREPORT${ac_uC}""${ac_uD} +${ac_uA}HAVE_LIBPTHREAD${ac_uB}HAVE_LIBPTHREAD${ac_uC}1${ac_uD} +${ac_uA}HAVE_LIBRT${ac_uB}HAVE_LIBRT${ac_uC}1${ac_uD} +${ac_uA}HAVE_LIBNSL${ac_uB}HAVE_LIBNSL${ac_uC}1${ac_uD} +${ac_uA}HAVE_LIBUUID${ac_uB}HAVE_LIBUUID${ac_uC}1${ac_uD} +${ac_uA}PJ_M_NAME${ac_uB}PJ_M_NAME${ac_uC}"x86_64"${ac_uD} +${ac_uA}PJ_POOL_ALIGNMENT${ac_uB}PJ_POOL_ALIGNMENT${ac_uC}8${ac_uD} +${ac_uA}PJ_LINUX${ac_uB}PJ_LINUX${ac_uC}1${ac_uD} +${ac_uA}PJ_HAS_FLOATING_POINT${ac_uB}PJ_HAS_FLOATING_POINT${ac_uC}1${ac_uD} +${ac_uA}HAVE_LIBM${ac_uB}HAVE_LIBM${ac_uC}1${ac_uD} +${ac_uA}STDC_HEADERS${ac_uB}STDC_HEADERS${ac_uC}1${ac_uD} +${ac_uA}HAVE_SYS_TYPES_H${ac_uB}HAVE_SYS_TYPES_H${ac_uC}1${ac_uD} +${ac_uA}HAVE_SYS_STAT_H${ac_uB}HAVE_SYS_STAT_H${ac_uC}1${ac_uD} +${ac_uA}HAVE_STDLIB_H${ac_uB}HAVE_STDLIB_H${ac_uC}1${ac_uD} +${ac_uA}HAVE_STRING_H${ac_uB}HAVE_STRING_H${ac_uC}1${ac_uD} +${ac_uA}HAVE_MEMORY_H${ac_uB}HAVE_MEMORY_H${ac_uC}1${ac_uD} +${ac_uA}HAVE_STRINGS_H${ac_uB}HAVE_STRINGS_H${ac_uC}1${ac_uD} +${ac_uA}HAVE_INTTYPES_H${ac_uB}HAVE_INTTYPES_H${ac_uC}1${ac_uD} +${ac_uA}HAVE_STDINT_H${ac_uB}HAVE_STDINT_H${ac_uC}1${ac_uD} +${ac_uA}HAVE_UNISTD_H${ac_uB}HAVE_UNISTD_H${ac_uC}1${ac_uD} +${ac_uA}PJ_HAS_ARPA_INET_H${ac_uB}PJ_HAS_ARPA_INET_H${ac_uC}1${ac_uD} +${ac_uA}PJ_HAS_ASSERT_H${ac_uB}PJ_HAS_ASSERT_H${ac_uC}1${ac_uD} +${ac_uA}PJ_HAS_CTYPE_H${ac_uB}PJ_HAS_CTYPE_H${ac_uC}1${ac_uD} +${ac_uA}PJ_HAS_ERRNO_H${ac_uB}PJ_HAS_ERRNO_H${ac_uC}1${ac_uD} +${ac_uA}PJ_HAS_FCNTL_H${ac_uB}PJ_HAS_FCNTL_H${ac_uC}1${ac_uD} +${ac_uA}PJ_HAS_LINUX_SOCKET_H${ac_uB}PJ_HAS_LINUX_SOCKET_H${ac_uC}1${ac_uD} +${ac_uA}PJ_HAS_MALLOC_H${ac_uB}PJ_HAS_MALLOC_H${ac_uC}1${ac_uD} +${ac_uA}PJ_HAS_NETDB_H${ac_uB}PJ_HAS_NETDB_H${ac_uC}1${ac_uD} +${ac_uA}PJ_HAS_NETINET_IN_SYSTM_H${ac_uB}PJ_HAS_NETINET_IN_SYSTM_H${ac_uC}1${ac_uD} +${ac_uA}PJ_HAS_NETINET_IN_H${ac_uB}PJ_HAS_NETINET_IN_H${ac_uC}1${ac_uD} +${ac_uA}PJ_HAS_NETINET_IP_H${ac_uB}PJ_HAS_NETINET_IP_H${ac_uC}1${ac_uD} +${ac_uA}PJ_HAS_IFADDRS_H${ac_uB}PJ_HAS_IFADDRS_H${ac_uC}1${ac_uD} +${ac_uA}PJ_HAS_SEMAPHORE_H${ac_uB}PJ_HAS_SEMAPHORE_H${ac_uC}1${ac_uD} +${ac_uA}PJ_HAS_SETJMP_H${ac_uB}PJ_HAS_SETJMP_H${ac_uC}1${ac_uD} +CEOF + sed -f $tmp/undefs.sed $tmp/in >$tmp/out + rm -f $tmp/in + mv $tmp/out $tmp/in + + cat >$tmp/undefs.sed <<CEOF +/^[ ]*#[ ]*undef/!b +t clr +: clr +${ac_uA}PJ_HAS_STDARG_H${ac_uB}PJ_HAS_STDARG_H${ac_uC}1${ac_uD} +${ac_uA}PJ_HAS_STDDEF_H${ac_uB}PJ_HAS_STDDEF_H${ac_uC}1${ac_uD} +${ac_uA}PJ_HAS_STDIO_H${ac_uB}PJ_HAS_STDIO_H${ac_uC}1${ac_uD} +${ac_uA}PJ_HAS_STDINT_H${ac_uB}PJ_HAS_STDINT_H${ac_uC}1${ac_uD} +${ac_uA}PJ_HAS_STDLIB_H${ac_uB}PJ_HAS_STDLIB_H${ac_uC}1${ac_uD} +${ac_uA}PJ_HAS_STRING_H${ac_uB}PJ_HAS_STRING_H${ac_uC}1${ac_uD} +${ac_uA}PJ_HAS_SYS_IOCTL_H${ac_uB}PJ_HAS_SYS_IOCTL_H${ac_uC}1${ac_uD} +${ac_uA}PJ_HAS_SYS_SELECT_H${ac_uB}PJ_HAS_SYS_SELECT_H${ac_uC}1${ac_uD} +${ac_uA}PJ_HAS_SYS_SOCKET_H${ac_uB}PJ_HAS_SYS_SOCKET_H${ac_uC}1${ac_uD} +${ac_uA}PJ_HAS_SYS_TIME_H${ac_uB}PJ_HAS_SYS_TIME_H${ac_uC}1${ac_uD} +${ac_uA}PJ_HAS_SYS_TIMEB_H${ac_uB}PJ_HAS_SYS_TIMEB_H${ac_uC}1${ac_uD} +${ac_uA}PJ_HAS_SYS_TYPES_H${ac_uB}PJ_HAS_SYS_TYPES_H${ac_uC}1${ac_uD} +${ac_uA}PJ_HAS_TIME_H${ac_uB}PJ_HAS_TIME_H${ac_uC}1${ac_uD} +${ac_uA}PJ_HAS_UNISTD_H${ac_uB}PJ_HAS_UNISTD_H${ac_uC}1${ac_uD} +${ac_uA}PJ_HAS_NET_IF_H${ac_uB}PJ_HAS_NET_IF_H${ac_uC}1${ac_uD} +${ac_uA}PJ_OS_NAME${ac_uB}PJ_OS_NAME${ac_uC}"x86_64-unknown-linux-gnu"${ac_uD} +${ac_uA}PJ_HAS_ERRNO_VAR${ac_uB}PJ_HAS_ERRNO_VAR${ac_uC}1${ac_uD} +${ac_uA}PJ_HAS_HIGH_RES_TIMER${ac_uB}PJ_HAS_HIGH_RES_TIMER${ac_uC}1${ac_uD} +${ac_uA}PJ_HAS_MALLOC${ac_uB}PJ_HAS_MALLOC${ac_uC}1${ac_uD} +${ac_uA}PJ_NATIVE_STRING_IS_UNICODE${ac_uB}PJ_NATIVE_STRING_IS_UNICODE${ac_uC}0${ac_uD} +${ac_uA}PJ_ATOMIC_VALUE_TYPE${ac_uB}PJ_ATOMIC_VALUE_TYPE${ac_uC}long${ac_uD} +${ac_uA}PJ_SOCK_HAS_INET_ATON${ac_uB}PJ_SOCK_HAS_INET_ATON${ac_uC}1${ac_uD} +${ac_uA}PJ_SOCK_HAS_INET_PTON${ac_uB}PJ_SOCK_HAS_INET_PTON${ac_uC}1${ac_uD} +${ac_uA}PJ_SOCK_HAS_INET_NTOP${ac_uB}PJ_SOCK_HAS_INET_NTOP${ac_uC}1${ac_uD} +${ac_uA}PJ_SOCK_HAS_GETADDRINFO${ac_uB}PJ_SOCK_HAS_GETADDRINFO${ac_uC}1${ac_uD} +${ac_uA}PJ_HAS_SOCKLEN_T${ac_uB}PJ_HAS_SOCKLEN_T${ac_uC}1${ac_uD} +${ac_uA}PJ_HAS_SO_ERROR${ac_uB}PJ_HAS_SO_ERROR${ac_uC}1${ac_uD} +${ac_uA}PJ_EMULATE_RWMUTEX${ac_uB}PJ_EMULATE_RWMUTEX${ac_uC}0${ac_uD} +${ac_uA}PJ_SELECT_NEEDS_NFDS${ac_uB}PJ_SELECT_NEEDS_NFDS${ac_uC}0${ac_uD} +${ac_uA}PJ_THREAD_SET_STACK_SIZE${ac_uB}PJ_THREAD_SET_STACK_SIZE${ac_uC}0${ac_uD} +${ac_uA}PJ_THREAD_ALLOCATE_STACK${ac_uB}PJ_THREAD_ALLOCATE_STACK${ac_uC}0${ac_uD} +${ac_uA}PJ_BLOCKING_ERROR_VAL${ac_uB}PJ_BLOCKING_ERROR_VAL${ac_uC}EAGAIN${ac_uD} +${ac_uA}PJ_BLOCKING_CONNECT_ERROR_VAL${ac_uB}PJ_BLOCKING_CONNECT_ERROR_VAL${ac_uC}EINPROGRESS${ac_uD} +s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, +CEOF + sed -f $tmp/undefs.sed $tmp/in >$tmp/out + rm -f $tmp/in + mv $tmp/out $tmp/in + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + if test x"$ac_file" = x-; then + echo "/* Generated by configure. */" >$tmp/config.h + else + echo "/* $ac_file. Generated by configure. */" >$tmp/config.h + fi + cat $tmp/in >>$tmp/config.h + rm -f $tmp/in + if test x"$ac_file" != x-; then + if diff $ac_file $tmp/config.h >/dev/null 2>&1; then + { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 +echo "$as_me: $ac_file is unchanged" >&6;} + else + ac_dir=`(dirname "$ac_file") 2>/dev/null || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p "$ac_dir" + else + as_dir="$ac_dir" + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; }; } + + rm -f $ac_file + mv $tmp/config.h $ac_file + fi + else + cat $tmp/config.h + rm -f $tmp/config.h + fi +done + +{ (exit 0); exit 0; } diff --git a/sflphone-common/libs/pjproject-1.0.1/configure b/sflphone-common/libs/pjproject-1.0.2/configure similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/configure rename to sflphone-common/libs/pjproject-1.0.2/configure diff --git a/sflphone-common/libs/pjproject-1.0.1/configure-legacy b/sflphone-common/libs/pjproject-1.0.2/configure-legacy similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/configure-legacy rename to sflphone-common/libs/pjproject-1.0.2/configure-legacy diff --git a/sflphone-common/libs/pjproject-1.0.1/configure.ac b/sflphone-common/libs/pjproject-1.0.2/configure.ac similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/configure.ac rename to sflphone-common/libs/pjproject-1.0.2/configure.ac diff --git a/sflphone-common/libs/pjproject-1.0.1/install-sh b/sflphone-common/libs/pjproject-1.0.2/install-sh similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/install-sh rename to sflphone-common/libs/pjproject-1.0.2/install-sh diff --git a/sflphone-common/libs/pjproject-1.0.1/libpj-sfl.pc.in b/sflphone-common/libs/pjproject-1.0.2/libpj-sfl.pc.in similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/libpj-sfl.pc.in rename to sflphone-common/libs/pjproject-1.0.2/libpj-sfl.pc.in diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib-util/bin/pjlib-util-test-x86_64-unknown-linux-gnu b/sflphone-common/libs/pjproject-1.0.2/pjlib-util/bin/pjlib-util-test-x86_64-unknown-linux-gnu new file mode 100755 index 0000000000000000000000000000000000000000..d29a2047c0c9e32e4549e062089937381641a02b Binary files /dev/null and b/sflphone-common/libs/pjproject-1.0.2/pjlib-util/bin/pjlib-util-test-x86_64-unknown-linux-gnu differ diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib-util/build/Makefile b/sflphone-common/libs/pjproject-1.0.2/pjlib-util/build/Makefile similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib-util/build/Makefile rename to sflphone-common/libs/pjproject-1.0.2/pjlib-util/build/Makefile diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib-util/build/os-auto.mak b/sflphone-common/libs/pjproject-1.0.2/pjlib-util/build/os-auto.mak similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib-util/build/os-auto.mak rename to sflphone-common/libs/pjproject-1.0.2/pjlib-util/build/os-auto.mak diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib-util/build/os-auto.mak.in b/sflphone-common/libs/pjproject-1.0.2/pjlib-util/build/os-auto.mak.in similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib-util/build/os-auto.mak.in rename to sflphone-common/libs/pjproject-1.0.2/pjlib-util/build/os-auto.mak.in diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib-util/build/os-rtems.mak b/sflphone-common/libs/pjproject-1.0.2/pjlib-util/build/os-rtems.mak similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib-util/build/os-rtems.mak rename to sflphone-common/libs/pjproject-1.0.2/pjlib-util/build/os-rtems.mak diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib-util/build/pjlib_util.dsp b/sflphone-common/libs/pjproject-1.0.2/pjlib-util/build/pjlib_util.dsp similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib-util/build/pjlib_util.dsp rename to sflphone-common/libs/pjproject-1.0.2/pjlib-util/build/pjlib_util.dsp diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib-util/build/pjlib_util.dsw b/sflphone-common/libs/pjproject-1.0.2/pjlib-util/build/pjlib_util.dsw similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib-util/build/pjlib_util.dsw rename to sflphone-common/libs/pjproject-1.0.2/pjlib-util/build/pjlib_util.dsw diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib-util/build/pjlib_util.vcproj b/sflphone-common/libs/pjproject-1.0.2/pjlib-util/build/pjlib_util.vcproj similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib-util/build/pjlib_util.vcproj rename to sflphone-common/libs/pjproject-1.0.2/pjlib-util/build/pjlib_util.vcproj diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib-util/build/pjlib_util_test.dsp b/sflphone-common/libs/pjproject-1.0.2/pjlib-util/build/pjlib_util_test.dsp similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib-util/build/pjlib_util_test.dsp rename to sflphone-common/libs/pjproject-1.0.2/pjlib-util/build/pjlib_util_test.dsp diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib-util/build/pjlib_util_test.vcproj b/sflphone-common/libs/pjproject-1.0.2/pjlib-util/build/pjlib_util_test.vcproj similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib-util/build/pjlib_util_test.vcproj rename to sflphone-common/libs/pjproject-1.0.2/pjlib-util/build/pjlib_util_test.vcproj diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib-util/build/wince-evc4/pjlib_util_test_wince.vcp b/sflphone-common/libs/pjproject-1.0.2/pjlib-util/build/wince-evc4/pjlib_util_test_wince.vcp similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib-util/build/wince-evc4/pjlib_util_test_wince.vcp rename to sflphone-common/libs/pjproject-1.0.2/pjlib-util/build/wince-evc4/pjlib_util_test_wince.vcp diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib-util/build/wince-evc4/pjlib_util_wince.vcp b/sflphone-common/libs/pjproject-1.0.2/pjlib-util/build/wince-evc4/pjlib_util_wince.vcp similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib-util/build/wince-evc4/pjlib_util_wince.vcp rename to sflphone-common/libs/pjproject-1.0.2/pjlib-util/build/wince-evc4/pjlib_util_wince.vcp diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib-util/build/wince-evc4/pjlib_util_wince.vcw b/sflphone-common/libs/pjproject-1.0.2/pjlib-util/build/wince-evc4/pjlib_util_wince.vcw similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib-util/build/wince-evc4/pjlib_util_wince.vcw rename to sflphone-common/libs/pjproject-1.0.2/pjlib-util/build/wince-evc4/pjlib_util_wince.vcw diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib-util/docs/doxygen.cfg b/sflphone-common/libs/pjproject-1.0.2/pjlib-util/docs/doxygen.cfg similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib-util/docs/doxygen.cfg rename to sflphone-common/libs/pjproject-1.0.2/pjlib-util/docs/doxygen.cfg diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib-util/docs/doxygen.css b/sflphone-common/libs/pjproject-1.0.2/pjlib-util/docs/doxygen.css similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib-util/docs/doxygen.css rename to sflphone-common/libs/pjproject-1.0.2/pjlib-util/docs/doxygen.css diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib-util/docs/footer.html b/sflphone-common/libs/pjproject-1.0.2/pjlib-util/docs/footer.html similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib-util/docs/footer.html rename to sflphone-common/libs/pjproject-1.0.2/pjlib-util/docs/footer.html diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib-util/docs/header.html b/sflphone-common/libs/pjproject-1.0.2/pjlib-util/docs/header.html similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib-util/docs/header.html rename to sflphone-common/libs/pjproject-1.0.2/pjlib-util/docs/header.html diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib-util/include/pjlib-util.h b/sflphone-common/libs/pjproject-1.0.2/pjlib-util/include/pjlib-util.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib-util/include/pjlib-util.h rename to sflphone-common/libs/pjproject-1.0.2/pjlib-util/include/pjlib-util.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib-util/include/pjlib-util/base64.h b/sflphone-common/libs/pjproject-1.0.2/pjlib-util/include/pjlib-util/base64.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib-util/include/pjlib-util/base64.h rename to sflphone-common/libs/pjproject-1.0.2/pjlib-util/include/pjlib-util/base64.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib-util/include/pjlib-util/config.h b/sflphone-common/libs/pjproject-1.0.2/pjlib-util/include/pjlib-util/config.h similarity index 98% rename from sflphone-common/libs/pjproject-1.0.1/pjlib-util/include/pjlib-util/config.h rename to sflphone-common/libs/pjproject-1.0.2/pjlib-util/include/pjlib-util/config.h index f1e5b1e9937d7317795ef6342d8fed0efea112aa..84259301c0dac413dc4510a52d7398234373866f 100644 --- a/sflphone-common/libs/pjproject-1.0.1/pjlib-util/include/pjlib-util/config.h +++ b/sflphone-common/libs/pjproject-1.0.2/pjlib-util/include/pjlib-util/config.h @@ -1,5 +1,5 @@ /* $Id: config.h 2394 2008-12-23 17:27:53Z bennylp $ */ -/* +/* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> * @@ -15,7 +15,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __PJLIB_UTIL_CONFIG_H__ #define __PJLIB_UTIL_CONFIG_H__ @@ -59,7 +59,7 @@ * (the #pj_dns_packet_dup() function). * * Generally name compression is desired, since it saves some memory (see - * PJ_DNS_RESOLVER_RES_BUF_SIZE setting). However it comes at the expense of + * PJ_DNS_RESOLVER_RES_BUF_SIZE setting). However it comes at the expense of * a little processing overhead to perform name scanning and also a little * bit more stack usage (8 bytes per entry on 32bit platform). * @@ -84,7 +84,7 @@ /** - * Default retransmission delay, in miliseconds. The combination of + * Default retransmission delay, in miliseconds. The combination of * retransmission delay and count determines the query timeout. * * Default: 2000 (2 seconds, according to RFC 1035) @@ -106,8 +106,8 @@ /** - * Maximum life-time of DNS response in the resolver response cache, - * in seconds. If the value is zero, then DNS response caching will be + * Maximum life-time of DNS response in the resolver response cache, + * in seconds. If the value is zero, then DNS response caching will be * disabled. * * Default is 300 seconds (5 minutes). @@ -120,8 +120,8 @@ /** * The life-time of invalid DNS response in the resolver response cache. - * An invalid DNS response is a response which RCODE is non-zero and - * response without any answer section. These responses can be put in + * An invalid DNS response is a response which RCODE is non-zero and + * response without any answer section. These responses can be put in * the cache too to minimize message round-trip. * * Default: 60 (one minute). @@ -133,7 +133,7 @@ #endif /** - * The interval on which nameservers which are known to be good to be + * The interval on which nameservers which are known to be good to be * probed again to determine whether they are still good. Note that * this applies to both active nameserver (the one currently being used) * and idle nameservers (good nameservers that are not currently selected). diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib-util/include/pjlib-util/crc32.h b/sflphone-common/libs/pjproject-1.0.2/pjlib-util/include/pjlib-util/crc32.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib-util/include/pjlib-util/crc32.h rename to sflphone-common/libs/pjproject-1.0.2/pjlib-util/include/pjlib-util/crc32.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib-util/include/pjlib-util/dns.h b/sflphone-common/libs/pjproject-1.0.2/pjlib-util/include/pjlib-util/dns.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib-util/include/pjlib-util/dns.h rename to sflphone-common/libs/pjproject-1.0.2/pjlib-util/include/pjlib-util/dns.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib-util/include/pjlib-util/dns_server.h b/sflphone-common/libs/pjproject-1.0.2/pjlib-util/include/pjlib-util/dns_server.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib-util/include/pjlib-util/dns_server.h rename to sflphone-common/libs/pjproject-1.0.2/pjlib-util/include/pjlib-util/dns_server.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib-util/include/pjlib-util/errno.h b/sflphone-common/libs/pjproject-1.0.2/pjlib-util/include/pjlib-util/errno.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib-util/include/pjlib-util/errno.h rename to sflphone-common/libs/pjproject-1.0.2/pjlib-util/include/pjlib-util/errno.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib-util/include/pjlib-util/getopt.h b/sflphone-common/libs/pjproject-1.0.2/pjlib-util/include/pjlib-util/getopt.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib-util/include/pjlib-util/getopt.h rename to sflphone-common/libs/pjproject-1.0.2/pjlib-util/include/pjlib-util/getopt.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib-util/include/pjlib-util/hmac_md5.h b/sflphone-common/libs/pjproject-1.0.2/pjlib-util/include/pjlib-util/hmac_md5.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib-util/include/pjlib-util/hmac_md5.h rename to sflphone-common/libs/pjproject-1.0.2/pjlib-util/include/pjlib-util/hmac_md5.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib-util/include/pjlib-util/hmac_sha1.h b/sflphone-common/libs/pjproject-1.0.2/pjlib-util/include/pjlib-util/hmac_sha1.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib-util/include/pjlib-util/hmac_sha1.h rename to sflphone-common/libs/pjproject-1.0.2/pjlib-util/include/pjlib-util/hmac_sha1.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib-util/include/pjlib-util/md5.h b/sflphone-common/libs/pjproject-1.0.2/pjlib-util/include/pjlib-util/md5.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib-util/include/pjlib-util/md5.h rename to sflphone-common/libs/pjproject-1.0.2/pjlib-util/include/pjlib-util/md5.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib-util/include/pjlib-util/pcap.h b/sflphone-common/libs/pjproject-1.0.2/pjlib-util/include/pjlib-util/pcap.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib-util/include/pjlib-util/pcap.h rename to sflphone-common/libs/pjproject-1.0.2/pjlib-util/include/pjlib-util/pcap.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib-util/include/pjlib-util/resolver.h b/sflphone-common/libs/pjproject-1.0.2/pjlib-util/include/pjlib-util/resolver.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib-util/include/pjlib-util/resolver.h rename to sflphone-common/libs/pjproject-1.0.2/pjlib-util/include/pjlib-util/resolver.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib-util/include/pjlib-util/scanner.h b/sflphone-common/libs/pjproject-1.0.2/pjlib-util/include/pjlib-util/scanner.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib-util/include/pjlib-util/scanner.h rename to sflphone-common/libs/pjproject-1.0.2/pjlib-util/include/pjlib-util/scanner.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib-util/include/pjlib-util/scanner_cis_bitwise.h b/sflphone-common/libs/pjproject-1.0.2/pjlib-util/include/pjlib-util/scanner_cis_bitwise.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib-util/include/pjlib-util/scanner_cis_bitwise.h rename to sflphone-common/libs/pjproject-1.0.2/pjlib-util/include/pjlib-util/scanner_cis_bitwise.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib-util/include/pjlib-util/scanner_cis_uint.h b/sflphone-common/libs/pjproject-1.0.2/pjlib-util/include/pjlib-util/scanner_cis_uint.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib-util/include/pjlib-util/scanner_cis_uint.h rename to sflphone-common/libs/pjproject-1.0.2/pjlib-util/include/pjlib-util/scanner_cis_uint.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib-util/include/pjlib-util/sha1.h b/sflphone-common/libs/pjproject-1.0.2/pjlib-util/include/pjlib-util/sha1.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib-util/include/pjlib-util/sha1.h rename to sflphone-common/libs/pjproject-1.0.2/pjlib-util/include/pjlib-util/sha1.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib-util/include/pjlib-util/srv_resolver.h b/sflphone-common/libs/pjproject-1.0.2/pjlib-util/include/pjlib-util/srv_resolver.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib-util/include/pjlib-util/srv_resolver.h rename to sflphone-common/libs/pjproject-1.0.2/pjlib-util/include/pjlib-util/srv_resolver.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib-util/include/pjlib-util/string.h b/sflphone-common/libs/pjproject-1.0.2/pjlib-util/include/pjlib-util/string.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib-util/include/pjlib-util/string.h rename to sflphone-common/libs/pjproject-1.0.2/pjlib-util/include/pjlib-util/string.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib-util/include/pjlib-util/stun_simple.h b/sflphone-common/libs/pjproject-1.0.2/pjlib-util/include/pjlib-util/stun_simple.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib-util/include/pjlib-util/stun_simple.h rename to sflphone-common/libs/pjproject-1.0.2/pjlib-util/include/pjlib-util/stun_simple.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib-util/include/pjlib-util/types.h b/sflphone-common/libs/pjproject-1.0.2/pjlib-util/include/pjlib-util/types.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib-util/include/pjlib-util/types.h rename to sflphone-common/libs/pjproject-1.0.2/pjlib-util/include/pjlib-util/types.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib-util/include/pjlib-util/xml.h b/sflphone-common/libs/pjproject-1.0.2/pjlib-util/include/pjlib-util/xml.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib-util/include/pjlib-util/xml.h rename to sflphone-common/libs/pjproject-1.0.2/pjlib-util/include/pjlib-util/xml.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib-util/src/pjlib-util-test/encryption.c b/sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util-test/encryption.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib-util/src/pjlib-util-test/encryption.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util-test/encryption.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib-util/src/pjlib-util-test/main.c b/sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util-test/main.c similarity index 96% rename from sflphone-common/libs/pjproject-1.0.1/pjlib-util/src/pjlib-util-test/main.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util-test/main.c index ee025496d90403f15937b87177314773ca104ce7..51a349b86bd1b7abdd0479383aec0f46bedddd31 100644 --- a/sflphone-common/libs/pjproject-1.0.1/pjlib-util/src/pjlib-util-test/main.c +++ b/sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util-test/main.c @@ -54,7 +54,8 @@ int main(int argc, char *argv[]) char s[10]; puts("Press ENTER to quit"); - fgets(s, sizeof(s), stdin); + if (fgets(s, sizeof(s), stdin) == NULL) + return rc; } return rc; diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib-util/src/pjlib-util-test/main_rtems.c b/sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util-test/main_rtems.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib-util/src/pjlib-util-test/main_rtems.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util-test/main_rtems.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib-util/src/pjlib-util-test/main_win32.c b/sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util-test/main_win32.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib-util/src/pjlib-util-test/main_win32.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util-test/main_win32.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib-util/src/pjlib-util-test/resolver_test.c b/sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util-test/resolver_test.c similarity index 95% rename from sflphone-common/libs/pjproject-1.0.1/pjlib-util/src/pjlib-util-test/resolver_test.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util-test/resolver_test.c index a65878ffa8031864e5c51f42b98057acbc0732f5..1a32863f4c760e9cad9987b8ff023d82bc48b75a 100644 --- a/sflphone-common/libs/pjproject-1.0.1/pjlib-util/src/pjlib-util-test/resolver_test.c +++ b/sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util-test/resolver_test.c @@ -1,4 +1,4 @@ -/* $Id: resolver_test.c 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: resolver_test.c 2407 2009-01-01 20:56:36Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -702,13 +702,14 @@ static void dns_callback(void *user_data, { PJ_UNUSED_ARG(user_data); - pj_assert(status == PJ_SUCCESS); - pj_assert(resp); - pj_assert(resp->hdr.anscount == 1); - pj_assert(resp->ans[0].type == PJ_DNS_TYPE_A); - pj_assert(resp->ans[0].rdata.a.ip_addr.s_addr == IP_ADDR0); - pj_sem_post(sem); + + PJ_ASSERT_ON_FAIL(status == PJ_SUCCESS, return); + PJ_ASSERT_ON_FAIL(resp, return); + PJ_ASSERT_ON_FAIL(resp->hdr.anscount == 1, return); + PJ_ASSERT_ON_FAIL(resp->ans[0].type == PJ_DNS_TYPE_A, return); + PJ_ASSERT_ON_FAIL(resp->ans[0].rdata.a.ip_addr.s_addr == IP_ADDR0, return); + } @@ -778,9 +779,10 @@ static void dns_callback_1b(void *user_data, PJ_UNUSED_ARG(user_data); PJ_UNUSED_ARG(resp); - pj_assert(status == PJ_STATUS_FROM_DNS_RCODE(PJ_DNS_RCODE_NXDOMAIN)); - pj_sem_post(sem); + + PJ_ASSERT_ON_FAIL(status==PJ_STATUS_FROM_DNS_RCODE(PJ_DNS_RCODE_NXDOMAIN), + return); } @@ -1014,16 +1016,20 @@ static void srv_cb_1(void *user_data, { PJ_UNUSED_ARG(user_data); - pj_assert(status == PJ_SUCCESS); - pj_assert(rec->count == 1); - pj_assert(rec->entry[0].priority == 1); - pj_assert(rec->entry[0].weight == 2); - pj_assert(pj_strcmp2(&rec->entry[0].server.name, "sip.somedomain.com")==0); - pj_assert(pj_strcmp2(&rec->entry[0].server.alias, "sipalias.somedomain.com")==0); - pj_assert(rec->entry[0].server.addr[0].s_addr == IP_ADDR1); - pj_assert(rec->entry[0].port == PORT1); - pj_sem_post(sem); + + PJ_ASSERT_ON_FAIL(status == PJ_SUCCESS, return); + PJ_ASSERT_ON_FAIL(rec->count == 1, return); + PJ_ASSERT_ON_FAIL(rec->entry[0].priority == 1, return); + PJ_ASSERT_ON_FAIL(rec->entry[0].weight == 2, return); + PJ_ASSERT_ON_FAIL(pj_strcmp2(&rec->entry[0].server.name, "sip.somedomain.com")==0, + return); + PJ_ASSERT_ON_FAIL(pj_strcmp2(&rec->entry[0].server.alias, "sipalias.somedomain.com")==0, + return); + PJ_ASSERT_ON_FAIL(rec->entry[0].server.addr[0].s_addr == IP_ADDR1, return); + PJ_ASSERT_ON_FAIL(rec->entry[0].port == PORT1, return); + + } static void srv_cb_1b(void *user_data, @@ -1032,10 +1038,11 @@ static void srv_cb_1b(void *user_data, { PJ_UNUSED_ARG(user_data); - pj_assert(status == PJ_STATUS_FROM_DNS_RCODE(PJ_DNS_RCODE_NXDOMAIN)); - pj_assert(rec->count == 0); - pj_sem_post(sem); + + PJ_ASSERT_ON_FAIL(status==PJ_STATUS_FROM_DNS_RCODE(PJ_DNS_RCODE_NXDOMAIN), + return); + PJ_ASSERT_ON_FAIL(rec->count == 0, return); } static int srv_resolver_test(void) @@ -1175,16 +1182,18 @@ static void srv_cb_2(void *user_data, { PJ_UNUSED_ARG(user_data); - pj_assert(status == PJ_SUCCESS); - pj_assert(rec->count == 1); - pj_assert(rec->entry[0].priority == 0); - pj_assert(rec->entry[0].weight == 0); - pj_assert(pj_strcmp2(&rec->entry[0].server.name, TARGET)==0); - pj_assert(pj_strcmp2(&rec->entry[0].server.alias, "sipalias01." TARGET)==0); - pj_assert(rec->entry[0].server.addr[0].s_addr == IP_ADDR2); - pj_assert(rec->entry[0].port == PORT2); - pj_sem_post(sem); + + PJ_ASSERT_ON_FAIL(status == PJ_SUCCESS, return); + PJ_ASSERT_ON_FAIL(rec->count == 1, return); + PJ_ASSERT_ON_FAIL(rec->entry[0].priority == 0, return); + PJ_ASSERT_ON_FAIL(rec->entry[0].weight == 0, return); + PJ_ASSERT_ON_FAIL(pj_strcmp2(&rec->entry[0].server.name, TARGET)==0, + return); + PJ_ASSERT_ON_FAIL(pj_strcmp2(&rec->entry[0].server.alias, "sipalias01." TARGET)==0, + return); + PJ_ASSERT_ON_FAIL(rec->entry[0].server.addr[0].s_addr == IP_ADDR2, return); + PJ_ASSERT_ON_FAIL(rec->entry[0].port == PORT2, return); } static int srv_resolver_fallback_test(void) @@ -1306,9 +1315,12 @@ static void srv_cb_3(void *user_data, unsigned i; PJ_UNUSED_ARG(user_data); + PJ_UNUSED_ARG(status); + PJ_UNUSED_ARG(rec); pj_assert(status == PJ_SUCCESS); pj_assert(rec->count == PJ_DNS_SRV_MAX_ADDR); + for (i=0; i<PJ_DNS_SRV_MAX_ADDR; ++i) { unsigned j; @@ -1362,11 +1374,6 @@ int resolver_test(void) { int rc; -#ifdef NDEBUG - PJ_LOG(3,(THIS_FILE, " error: NDEBUG is declared")); - return -1; -#endif - rc = init(); if (rc != 0) goto on_error; diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib-util/src/pjlib-util-test/stun.c b/sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util-test/stun.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib-util/src/pjlib-util-test/stun.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util-test/stun.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib-util/src/pjlib-util-test/test.c b/sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util-test/test.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib-util/src/pjlib-util-test/test.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util-test/test.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib-util/src/pjlib-util-test/test.h b/sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util-test/test.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib-util/src/pjlib-util-test/test.h rename to sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util-test/test.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib-util/src/pjlib-util-test/xml.c b/sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util-test/xml.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib-util/src/pjlib-util-test/xml.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util-test/xml.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib-util/src/pjlib-util/base64.c b/sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util/base64.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib-util/src/pjlib-util/base64.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util/base64.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib-util/src/pjlib-util/crc32.c b/sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util/crc32.c similarity index 96% rename from sflphone-common/libs/pjproject-1.0.1/pjlib-util/src/pjlib-util/crc32.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util/crc32.c index d05779ba78dbb1953738af3ff38935c7a9d23641..6467072071658e7c69ca938338578d1722c594f1 100644 --- a/sflphone-common/libs/pjproject-1.0.1/pjlib-util/src/pjlib-util/crc32.c +++ b/sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util/crc32.c @@ -1,4 +1,4 @@ -/* $Id: crc32.c 1731 2008-01-23 20:23:12Z bennylp $ */ +/* $Id: crc32.c 2530 2009-03-23 12:55:00Z bennylp $ */ /* * This is an implementation of CRC32. See ISO 3309 and ITU-T V.42 * for a formal specification @@ -22,6 +22,7 @@ #define CRC32_INDEX(c) (c & 0xff) #define CRC32_SHIFTED(c) (c >> 8) +#define CRC32_SWAP(c) (c) static const pj_uint32_t crc_tab[] = { 0x00000000L, 0x77073096L, 0xee0e612cL, 0x990951baL, 0x076dc419L, @@ -82,6 +83,10 @@ static const pj_uint32_t crc_tab[] = { #elif defined(PJ_IS_BIG_ENDIAN) && PJ_IS_BIG_ENDIAN != 0 #define CRC32_INDEX(c) (c >> 24) #define CRC32_SHIFTED(c) (c << 8) +#define CRC32_SWAP(c) ((((c) & 0xff000000) >> 24) | \ + (((c) & 0x00ff0000) >> 8) | \ + (((c) & 0x0000ff00) << 8) | \ + (((c) & 0x000000ff) << 24)) static const pj_uint32_t crc_tab[] = { 0x00000000L, 0x96300777L, 0x2c610eeeL, 0xba510999L, 0x19c46d07L, @@ -179,7 +184,7 @@ PJ_DEF(pj_uint32_t) pj_crc32_update(pj_crc32_context *ctx, PJ_DEF(pj_uint32_t) pj_crc32_final(pj_crc32_context *ctx) { - return ctx->crc_state; + return CRC32_SWAP(ctx->crc_state); } diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib-util/src/pjlib-util/dns.c b/sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util/dns.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib-util/src/pjlib-util/dns.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util/dns.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib-util/src/pjlib-util/dns_dump.c b/sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util/dns_dump.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib-util/src/pjlib-util/dns_dump.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util/dns_dump.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib-util/src/pjlib-util/dns_server.c b/sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util/dns_server.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib-util/src/pjlib-util/dns_server.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util/dns_server.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib-util/src/pjlib-util/errno.c b/sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util/errno.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib-util/src/pjlib-util/errno.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util/errno.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib-util/src/pjlib-util/getopt.c b/sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util/getopt.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib-util/src/pjlib-util/getopt.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util/getopt.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib-util/src/pjlib-util/hmac_md5.c b/sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util/hmac_md5.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib-util/src/pjlib-util/hmac_md5.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util/hmac_md5.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib-util/src/pjlib-util/hmac_sha1.c b/sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util/hmac_sha1.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib-util/src/pjlib-util/hmac_sha1.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util/hmac_sha1.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib-util/src/pjlib-util/md5.c b/sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util/md5.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib-util/src/pjlib-util/md5.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util/md5.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib-util/src/pjlib-util/pcap.c b/sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util/pcap.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib-util/src/pjlib-util/pcap.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util/pcap.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib-util/src/pjlib-util/resolver.c b/sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util/resolver.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib-util/src/pjlib-util/resolver.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util/resolver.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib-util/src/pjlib-util/scanner.c b/sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util/scanner.c similarity index 98% rename from sflphone-common/libs/pjproject-1.0.1/pjlib-util/src/pjlib-util/scanner.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util/scanner.c index d53f6dc35ba4557740ac937f6ad8e0f14b355904..a0aa7305225e8ed78ca9adca9784b12b0d814dd0 100644 --- a/sflphone-common/libs/pjproject-1.0.1/pjlib-util/src/pjlib-util/scanner.c +++ b/sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util/scanner.c @@ -1,4 +1,4 @@ -/* $Id: scanner.c 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: scanner.c 2538 2009-03-23 13:14:26Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -28,7 +28,7 @@ #define PJ_SCAN_IS_SPACE(c) ((c)==' ' || (c)=='\t') #define PJ_SCAN_IS_NEWLINE(c) ((c)=='\r' || (c)=='\n') #define PJ_SCAN_IS_PROBABLY_SPACE(c) ((c) <= 32) -#define PJ_SCAN_CHECK_EOF(s) (*s) +#define PJ_SCAN_CHECK_EOF(s) (s != scanner->end) #if defined(PJ_SCANNER_USE_BITWISE) && PJ_SCANNER_USE_BITWISE != 0 @@ -375,7 +375,7 @@ PJ_DEF(void) pj_scan_get_quotes(pj_scanner *scanner, */ do { /* loop until end_quote is found. */ - while (*s && *s != '\n' && *s != end_quote[qpair]) { + while (PJ_SCAN_CHECK_EOF(s) && *s != '\n' && *s != end_quote[qpair]) { ++s; } diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib-util/src/pjlib-util/scanner_cis_bitwise.c b/sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util/scanner_cis_bitwise.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib-util/src/pjlib-util/scanner_cis_bitwise.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util/scanner_cis_bitwise.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib-util/src/pjlib-util/scanner_cis_uint.c b/sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util/scanner_cis_uint.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib-util/src/pjlib-util/scanner_cis_uint.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util/scanner_cis_uint.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib-util/src/pjlib-util/sha1.c b/sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util/sha1.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib-util/src/pjlib-util/sha1.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util/sha1.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib-util/src/pjlib-util/srv_resolver.c b/sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util/srv_resolver.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib-util/src/pjlib-util/srv_resolver.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util/srv_resolver.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib-util/src/pjlib-util/string.c b/sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util/string.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib-util/src/pjlib-util/string.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util/string.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib-util/src/pjlib-util/stun_simple.c b/sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util/stun_simple.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib-util/src/pjlib-util/stun_simple.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util/stun_simple.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib-util/src/pjlib-util/stun_simple_client.c b/sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util/stun_simple_client.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib-util/src/pjlib-util/stun_simple_client.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util/stun_simple_client.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib-util/src/pjlib-util/symbols.c b/sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util/symbols.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib-util/src/pjlib-util/symbols.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util/symbols.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib-util/src/pjlib-util/xml.c b/sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util/xml.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib-util/src/pjlib-util/xml.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util/xml.c diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/bin/pjlib-test-x86_64-unknown-linux-gnu b/sflphone-common/libs/pjproject-1.0.2/pjlib/bin/pjlib-test-x86_64-unknown-linux-gnu new file mode 100755 index 0000000000000000000000000000000000000000..c6ed11cacf80b33d2f1413c74947812304dcb047 Binary files /dev/null and b/sflphone-common/libs/pjproject-1.0.2/pjlib/bin/pjlib-test-x86_64-unknown-linux-gnu differ diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/build/Makefile b/sflphone-common/libs/pjproject-1.0.2/pjlib/build/Makefile similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/build/Makefile rename to sflphone-common/libs/pjproject-1.0.2/pjlib/build/Makefile diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/build/os-auto.mak b/sflphone-common/libs/pjproject-1.0.2/pjlib/build/os-auto.mak new file mode 100644 index 0000000000000000000000000000000000000000..126fe0993bef586c6b993db41f27a391b0682806 --- /dev/null +++ b/sflphone-common/libs/pjproject-1.0.2/pjlib/build/os-auto.mak @@ -0,0 +1,35 @@ +# pjlib/build/os-auto.mak. Generated from os-auto.mak.in by configure. + +# Determine OS specific files +AC_OS_OBJS=ioqueue_select.o file_access_unistd.o file_io_ansi.o os_core_unix.o os_error_unix.o os_time_unix.o os_timestamp_posix.o guid_uuid.o + +# +# PJLIB_OBJS specified here are object files to be included in PJLIB +# (the library) for this specific operating system. Object files common +# to all operating systems should go in Makefile instead. +# +export PJLIB_OBJS += $(AC_OS_OBJS) \ + addr_resolv_sock.o \ + log_writer_stdout.o \ + os_timestamp_common.o \ + pool_policy_malloc.o sock_bsd.o sock_select.o + +# +# TEST_OBJS are operating system specific object files to be included in +# the test application. +# +export TEST_OBJS += main.o + +# +# Additional LDFLAGS for pjlib-test +# +export TEST_LDFLAGS += -lm -luuid -lnsl -lrt -lpthread -lasound + +# +# TARGETS are make targets in the Makefile, to be executed for this given +# operating system. +# +export TARGETS = pjlib pjlib-test + + + diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/build/os-auto.mak.in b/sflphone-common/libs/pjproject-1.0.2/pjlib/build/os-auto.mak.in similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/build/os-auto.mak.in rename to sflphone-common/libs/pjproject-1.0.2/pjlib/build/os-auto.mak.in diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/build/os-darwinos.mak b/sflphone-common/libs/pjproject-1.0.2/pjlib/build/os-darwinos.mak similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/build/os-darwinos.mak rename to sflphone-common/libs/pjproject-1.0.2/pjlib/build/os-darwinos.mak diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/build/os-linux-kernel.mak b/sflphone-common/libs/pjproject-1.0.2/pjlib/build/os-linux-kernel.mak similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/build/os-linux-kernel.mak rename to sflphone-common/libs/pjproject-1.0.2/pjlib/build/os-linux-kernel.mak diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/build/os-linux.mak b/sflphone-common/libs/pjproject-1.0.2/pjlib/build/os-linux.mak similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/build/os-linux.mak rename to sflphone-common/libs/pjproject-1.0.2/pjlib/build/os-linux.mak diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/build/os-rtems.mak b/sflphone-common/libs/pjproject-1.0.2/pjlib/build/os-rtems.mak similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/build/os-rtems.mak rename to sflphone-common/libs/pjproject-1.0.2/pjlib/build/os-rtems.mak diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/build/os-sunos.mak b/sflphone-common/libs/pjproject-1.0.2/pjlib/build/os-sunos.mak similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/build/os-sunos.mak rename to sflphone-common/libs/pjproject-1.0.2/pjlib/build/os-sunos.mak diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/build/os-win32.mak b/sflphone-common/libs/pjproject-1.0.2/pjlib/build/os-win32.mak similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/build/os-win32.mak rename to sflphone-common/libs/pjproject-1.0.2/pjlib/build/os-win32.mak diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/build/pjlib++-test.dsp b/sflphone-common/libs/pjproject-1.0.2/pjlib/build/pjlib++-test.dsp similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/build/pjlib++-test.dsp rename to sflphone-common/libs/pjproject-1.0.2/pjlib/build/pjlib++-test.dsp diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/build/pjlib++.dsp b/sflphone-common/libs/pjproject-1.0.2/pjlib/build/pjlib++.dsp similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/build/pjlib++.dsp rename to sflphone-common/libs/pjproject-1.0.2/pjlib/build/pjlib++.dsp diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/build/pjlib.dsp b/sflphone-common/libs/pjproject-1.0.2/pjlib/build/pjlib.dsp similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/build/pjlib.dsp rename to sflphone-common/libs/pjproject-1.0.2/pjlib/build/pjlib.dsp diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/build/pjlib.dsw b/sflphone-common/libs/pjproject-1.0.2/pjlib/build/pjlib.dsw similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/build/pjlib.dsw rename to sflphone-common/libs/pjproject-1.0.2/pjlib/build/pjlib.dsw diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/build/pjlib.vcproj b/sflphone-common/libs/pjproject-1.0.2/pjlib/build/pjlib.vcproj similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/build/pjlib.vcproj rename to sflphone-common/libs/pjproject-1.0.2/pjlib/build/pjlib.vcproj diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/build/pjlib_samples.dsp b/sflphone-common/libs/pjproject-1.0.2/pjlib/build/pjlib_samples.dsp similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/build/pjlib_samples.dsp rename to sflphone-common/libs/pjproject-1.0.2/pjlib/build/pjlib_samples.dsp diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/build/pjlib_samples.mak b/sflphone-common/libs/pjproject-1.0.2/pjlib/build/pjlib_samples.mak similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/build/pjlib_samples.mak rename to sflphone-common/libs/pjproject-1.0.2/pjlib/build/pjlib_samples.mak diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/build/pjlib_test.dsp b/sflphone-common/libs/pjproject-1.0.2/pjlib/build/pjlib_test.dsp similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/build/pjlib_test.dsp rename to sflphone-common/libs/pjproject-1.0.2/pjlib/build/pjlib_test.dsp diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/build/pjlib_test.vcproj b/sflphone-common/libs/pjproject-1.0.2/pjlib/build/pjlib_test.vcproj similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/build/pjlib_test.vcproj rename to sflphone-common/libs/pjproject-1.0.2/pjlib/build/pjlib_test.vcproj diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/build/wince-evc4/pjlib_test_wince.vcp b/sflphone-common/libs/pjproject-1.0.2/pjlib/build/wince-evc4/pjlib_test_wince.vcp similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/build/wince-evc4/pjlib_test_wince.vcp rename to sflphone-common/libs/pjproject-1.0.2/pjlib/build/wince-evc4/pjlib_test_wince.vcp diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/build/wince-evc4/pjlib_wince.vcp b/sflphone-common/libs/pjproject-1.0.2/pjlib/build/wince-evc4/pjlib_wince.vcp similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/build/wince-evc4/pjlib_wince.vcp rename to sflphone-common/libs/pjproject-1.0.2/pjlib/build/wince-evc4/pjlib_wince.vcp diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/build/wince-evc4/pjlib_wince.vcw b/sflphone-common/libs/pjproject-1.0.2/pjlib/build/wince-evc4/pjlib_wince.vcw similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/build/wince-evc4/pjlib_wince.vcw rename to sflphone-common/libs/pjproject-1.0.2/pjlib/build/wince-evc4/pjlib_wince.vcw diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/docs/doxygen.cfg b/sflphone-common/libs/pjproject-1.0.2/pjlib/docs/doxygen.cfg similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/docs/doxygen.cfg rename to sflphone-common/libs/pjproject-1.0.2/pjlib/docs/doxygen.cfg diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/docs/doxygen.css b/sflphone-common/libs/pjproject-1.0.2/pjlib/docs/doxygen.css similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/docs/doxygen.css rename to sflphone-common/libs/pjproject-1.0.2/pjlib/docs/doxygen.css diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/docs/footer.html b/sflphone-common/libs/pjproject-1.0.2/pjlib/docs/footer.html similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/docs/footer.html rename to sflphone-common/libs/pjproject-1.0.2/pjlib/docs/footer.html diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/docs/header.html b/sflphone-common/libs/pjproject-1.0.2/pjlib/docs/header.html similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/docs/header.html rename to sflphone-common/libs/pjproject-1.0.2/pjlib/docs/header.html diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj++/file.hpp b/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj++/file.hpp similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj++/file.hpp rename to sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj++/file.hpp diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj++/hash.hpp b/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj++/hash.hpp similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj++/hash.hpp rename to sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj++/hash.hpp diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj++/list.hpp b/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj++/list.hpp similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj++/list.hpp rename to sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj++/list.hpp diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj++/lock.hpp b/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj++/lock.hpp similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj++/lock.hpp rename to sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj++/lock.hpp diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj++/os.hpp b/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj++/os.hpp similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj++/os.hpp rename to sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj++/os.hpp diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj++/pool.hpp b/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj++/pool.hpp similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj++/pool.hpp rename to sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj++/pool.hpp diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj++/proactor.hpp b/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj++/proactor.hpp similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj++/proactor.hpp rename to sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj++/proactor.hpp diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj++/scanner.hpp b/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj++/scanner.hpp similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj++/scanner.hpp rename to sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj++/scanner.hpp diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj++/sock.hpp b/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj++/sock.hpp similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj++/sock.hpp rename to sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj++/sock.hpp diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj++/string.hpp b/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj++/string.hpp similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj++/string.hpp rename to sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj++/string.hpp diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj++/timer.hpp b/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj++/timer.hpp similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj++/timer.hpp rename to sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj++/timer.hpp diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj++/tree.hpp b/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj++/tree.hpp similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj++/tree.hpp rename to sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj++/tree.hpp diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj++/types.hpp b/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj++/types.hpp similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj++/types.hpp rename to sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj++/types.hpp diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/activesock.h b/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/activesock.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/activesock.h rename to sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/activesock.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/addr_resolv.h b/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/addr_resolv.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/addr_resolv.h rename to sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/addr_resolv.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/array.h b/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/array.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/array.h rename to sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/array.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/assert.h b/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/assert.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/assert.h rename to sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/assert.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/compat/assert.h b/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/assert.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/compat/assert.h rename to sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/assert.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/compat/cc_armcc.h b/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/cc_armcc.h similarity index 94% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/compat/cc_armcc.h rename to sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/cc_armcc.h index 45420b5bbac3f6bc1a618fb2458426d3817e7234..7bf1c91bad1be4426dbacfc27983f18394a9f931 100644 --- a/sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/compat/cc_armcc.h +++ b/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/cc_armcc.h @@ -1,4 +1,4 @@ -/* $Id: cc_armcc.h 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: cc_armcc.h 2407 2009-01-01 20:56:36Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -51,5 +51,7 @@ typedef unsigned long long pj_uint64_t; #define PJ_INT64_FMT "L" +#define PJ_UNREACHED(x) + #endif /* __PJ_COMPAT_CC_ARMCC_H__ */ diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/compat/cc_codew.h b/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/cc_codew.h similarity index 94% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/compat/cc_codew.h rename to sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/cc_codew.h index 54ca3260debfd2dc1246828e40f833edb3f753ba..79730cb398409cbbd5bc9c08bd6e91e7e0577529 100644 --- a/sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/compat/cc_codew.h +++ b/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/cc_codew.h @@ -1,4 +1,4 @@ -/* $Id: cc_codew.h 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: cc_codew.h 2407 2009-01-01 20:56:36Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -49,6 +49,7 @@ typedef unsigned long long pj_uint64_t; #define PJ_UINT64(val) val##LLU #define PJ_INT64_FMT "L" +#define PJ_UNREACHED(x) #endif /* __PJ_COMPAT_CC_CODEW_H__ */ diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/compat/cc_gcc.h b/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/cc_gcc.h similarity index 95% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/compat/cc_gcc.h rename to sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/cc_gcc.h index 05909514419f001a2587b7662a6da3127faec5d8..78d7e8c92174562657ecd38f6ff364ed388058c9 100644 --- a/sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/compat/cc_gcc.h +++ b/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/cc_gcc.h @@ -1,4 +1,4 @@ -/* $Id: cc_gcc.h 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: cc_gcc.h 2407 2009-01-01 20:56:36Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -69,6 +69,7 @@ # define PJ_HAS_BZERO 1 #endif +#define PJ_UNREACHED(x) #endif /* __PJ_COMPAT_CC_GCC_H__ */ diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/compat/cc_gcce.h b/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/cc_gcce.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/compat/cc_gcce.h rename to sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/cc_gcce.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/compat/cc_msvc.h b/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/cc_msvc.h similarity index 87% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/compat/cc_msvc.h rename to sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/cc_msvc.h index 13825f2f5cddc8674ba7162448ca6f5688023772..a7c50375d8df3aba0fa0c8269c14133bb155254b 100644 --- a/sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/compat/cc_msvc.h +++ b/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/cc_msvc.h @@ -1,4 +1,4 @@ -/* $Id: cc_msvc.h 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: cc_msvc.h 2407 2009-01-01 20:56:36Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -38,6 +38,13 @@ #if PJ_CC_VER_1 >= 8 && !defined(_CRT_SECURE_NO_DEPRECATE) # define _CRT_SECURE_NO_DEPRECATE #endif +#if PJ_CC_VER_1 >= 8 && !defined(_CRT_SECURE_NO_WARNINGS) +# define _CRT_SECURE_NO_WARNINGS + /* The above doesn't seem to work, at least on VS2005, so lets use + * this construct as well. + */ +# pragma warning(disable: 4996) +#endif #pragma warning(disable: 4127) // conditional expression is constant #pragma warning(disable: 4611) // not wise to mix setjmp with C++ @@ -71,5 +78,7 @@ typedef unsigned __int64 pj_uint64_t; #define PJ_UINT64(val) val##ui64 #define PJ_INT64_FMT "I64" +#define PJ_UNREACHED(x) #endif /* __PJ_COMPAT_CC_MSVC_H__ */ + diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/compat/cc_mwcc.h b/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/cc_mwcc.h similarity index 94% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/compat/cc_mwcc.h rename to sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/cc_mwcc.h index 33319951f78dd864bdb5fb4a1f10616b2dceec5b..a770110d09aaa143ed51b4fab2d6d432525989b7 100644 --- a/sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/compat/cc_mwcc.h +++ b/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/cc_mwcc.h @@ -1,4 +1,4 @@ -/* $Id: cc_mwcc.h 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: cc_mwcc.h 2407 2009-01-01 20:56:36Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -49,6 +49,7 @@ typedef unsigned long long pj_uint64_t; #define PJ_UINT64(val) val##LLU #define PJ_INT64_FMT "L" +#define PJ_UNREACHED(x) #endif /* __PJ_COMPAT_CC_MWCC_H__ */ diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/compat/ctype.h b/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/ctype.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/compat/ctype.h rename to sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/ctype.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/compat/errno.h b/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/errno.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/compat/errno.h rename to sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/errno.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/compat/high_precision.h b/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/high_precision.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/compat/high_precision.h rename to sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/high_precision.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/compat/m_alpha.h b/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/m_alpha.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/compat/m_alpha.h rename to sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/m_alpha.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/compat/m_armv4.h b/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/m_armv4.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/compat/m_armv4.h rename to sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/m_armv4.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/compat/m_auto.h b/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/m_auto.h similarity index 77% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/compat/m_auto.h rename to sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/m_auto.h index 56a9d63a9cd75f59dedf60012f92f91f0ef79b7c..bbdce3ca67bafb8bef5e8186d18d37259be66260 100644 --- a/sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/compat/m_auto.h +++ b/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/m_auto.h @@ -1,5 +1,5 @@ /* pjlib/include/pj/compat/m_auto.h. Generated by configure. */ -/* $Id: m_auto.h.in 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: m_auto.h.in 2528 2009-03-23 12:09:19Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -29,8 +29,18 @@ /* Machine name, filled in by autoconf script */ #define PJ_M_NAME "x86_64" -/* Endianness, as detected by autoconf */ -/* #undef WORDS_BIGENDIAN */ +/* Endianness. It's reported on pjsip list on 09/02/13 that autoconf + * endianness detection failed for universal build, so special case + * for it here. Thanks Ruud Klaver for the fix. + */ +#ifdef PJ_DARWINOS +# ifdef __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else + /* Endianness, as detected by autoconf */ +/* # undef WORDS_BIGENDIAN */ +#endif #ifdef WORDS_BIGENDIAN # define PJ_IS_LITTLE_ENDIAN 0 @@ -48,3 +58,4 @@ #define PJ_HAS_PENTIUM 0 #endif /* __PJ_COMPAT_M_AUTO_H__ */ + diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/compat/m_auto.h.in b/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/m_auto.h.in similarity index 76% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/compat/m_auto.h.in rename to sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/m_auto.h.in index dac97d0ce683c8a401a3f4c08ff753ce447d1489..236769ea5e9841797be0d4c30c65a6a5c10d64d1 100644 --- a/sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/compat/m_auto.h.in +++ b/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/m_auto.h.in @@ -1,4 +1,4 @@ -/* $Id: m_auto.h.in 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: m_auto.h.in 2528 2009-03-23 12:09:19Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -28,8 +28,18 @@ /* Machine name, filled in by autoconf script */ #undef PJ_M_NAME -/* Endianness, as detected by autoconf */ -#undef WORDS_BIGENDIAN +/* Endianness. It's reported on pjsip list on 09/02/13 that autoconf + * endianness detection failed for universal build, so special case + * for it here. Thanks Ruud Klaver for the fix. + */ +#ifdef PJ_DARWINOS +# ifdef __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else + /* Endianness, as detected by autoconf */ +# undef WORDS_BIGENDIAN +#endif #ifdef WORDS_BIGENDIAN # define PJ_IS_LITTLE_ENDIAN 0 @@ -47,3 +57,4 @@ #define PJ_HAS_PENTIUM 0 #endif /* __PJ_COMPAT_M_AUTO_H__ */ + diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/compat/m_i386.h b/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/m_i386.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/compat/m_i386.h rename to sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/m_i386.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/compat/m_m68k.h b/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/m_m68k.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/compat/m_m68k.h rename to sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/m_m68k.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/compat/m_powerpc.h b/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/m_powerpc.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/compat/m_powerpc.h rename to sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/m_powerpc.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/compat/m_sparc.h b/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/m_sparc.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/compat/m_sparc.h rename to sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/m_sparc.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/compat/m_x86_64.h b/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/m_x86_64.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/compat/m_x86_64.h rename to sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/m_x86_64.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/compat/malloc.h b/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/malloc.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/compat/malloc.h rename to sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/malloc.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/compat/os_auto.h b/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/os_auto.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/compat/os_auto.h rename to sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/os_auto.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/compat/os_auto.h.in b/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/os_auto.h.in similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/compat/os_auto.h.in rename to sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/os_auto.h.in diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/compat/os_darwinos.h b/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/os_darwinos.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/compat/os_darwinos.h rename to sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/os_darwinos.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/compat/os_linux.h b/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/os_linux.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/compat/os_linux.h rename to sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/os_linux.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/compat/os_linux_kernel.h b/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/os_linux_kernel.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/compat/os_linux_kernel.h rename to sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/os_linux_kernel.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/compat/os_palmos.h b/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/os_palmos.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/compat/os_palmos.h rename to sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/os_palmos.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/compat/os_rtems.h b/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/os_rtems.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/compat/os_rtems.h rename to sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/os_rtems.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/compat/os_sunos.h b/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/os_sunos.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/compat/os_sunos.h rename to sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/os_sunos.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/compat/os_symbian.h b/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/os_symbian.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/compat/os_symbian.h rename to sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/os_symbian.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/compat/os_win32.h b/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/os_win32.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/compat/os_win32.h rename to sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/os_win32.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/compat/os_win32_wince.h b/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/os_win32_wince.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/compat/os_win32_wince.h rename to sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/os_win32_wince.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/compat/rand.h b/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/rand.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/compat/rand.h rename to sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/rand.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/compat/setjmp.h b/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/setjmp.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/compat/setjmp.h rename to sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/setjmp.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/compat/size_t.h b/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/size_t.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/compat/size_t.h rename to sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/size_t.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/compat/socket.h b/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/socket.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/compat/socket.h rename to sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/socket.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/compat/stdarg.h b/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/stdarg.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/compat/stdarg.h rename to sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/stdarg.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/compat/stdfileio.h b/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/stdfileio.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/compat/stdfileio.h rename to sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/stdfileio.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/compat/string.h b/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/string.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/compat/string.h rename to sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/string.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/compat/time.h b/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/time.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/compat/time.h rename to sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/time.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/config.h b/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/config.h similarity index 92% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/config.h rename to sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/config.h index d28c31e989d085db464ca42b3ff2bb651fb4af9e..70120c9f96f8d5d8aaec4fd505d8ae28b5c1aac5 100644 --- a/sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/config.h +++ b/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/config.h @@ -1,5 +1,5 @@ -/* $Id: config.h 2394 2008-12-23 17:27:53Z bennylp $ */ -/* +/* $Id: config.h 2527 2009-03-23 11:57:55Z bennylp $ */ +/* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> * @@ -15,7 +15,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __PJ_CONFIG_H__ #define __PJ_CONFIG_H__ @@ -49,77 +49,78 @@ * Include target OS specific configuration. */ #if defined(PJ_AUTOCONF) - /* - * Autoconf - */ +/* + * Autoconf + */ # include <pj/compat/os_auto.h> #elif defined(PJ_SYMBIAN) && PJ_SYMBIAN!=0 - /* - * SymbianOS - */ +/* + * SymbianOS + */ # include <pj/compat/os_symbian.h> #elif defined(PJ_WIN32_WINCE) || defined(_WIN32_WCE) || defined(UNDER_CE) - /* - * Windows CE - */ +/* + * Windows CE + */ # undef PJ_WIN32_WINCE # define PJ_WIN32_WINCE 1 # include <pj/compat/os_win32_wince.h> - /* Also define Win32 */ +/* Also define Win32 */ # define PJ_WIN32 1 #elif defined(PJ_WIN32) || defined(_WIN32) || defined(__WIN32__) || \ defined(_WIN64) || defined(WIN32) || defined(__TOS_WIN__) - /* - * Win32 - */ +/* + * Win32 + */ # undef PJ_WIN32 # define PJ_WIN32 1 # include <pj/compat/os_win32.h> #elif defined(PJ_LINUX_KERNEL) && PJ_LINUX_KERNEL!=0 - /* - * Linux kernel - */ +/* + * Linux kernel + */ # include <pj/compat/os_linux_kernel.h> #elif defined(PJ_LINUX) || defined(linux) || defined(__linux) - /* - * Linux - */ +/* + * Linux + */ # undef PJ_LINUX # define PJ_LINUX 1 # include <pj/compat/os_linux.h> #elif defined(PJ_PALMOS) && PJ_PALMOS!=0 - /* - * Palm - */ +/* + * Palm + */ # include <pj/compat/os_palmos.h> #elif defined(PJ_SUNOS) || defined(sun) || defined(__sun) - /* - * SunOS - */ +/* + * SunOS + */ # undef PJ_SUNOS # define PJ_SUNOS 1 # include <pj/compat/os_sunos.h> -#elif defined(PJ_DARWINOS) || defined(__MACOSX__) - /* - * MacOS X - */ +#elif defined(PJ_DARWINOS) || defined(__MACOSX__) || \ + defined (__APPLE__) || defined (__MACH__) +/* + * MacOS X + */ # undef PJ_DARWINOS # define PJ_DARWINOS 1 # include <pj/compat/os_darwinos.h> #elif defined(PJ_RTEMS) && PJ_RTEMS!=0 - /* - * RTEMS - */ +/* + * RTEMS + */ # include <pj/compat/os_rtems.h> #else # error "Please specify target os." @@ -130,17 +131,17 @@ * Target machine specific configuration. */ #if defined(PJ_AUTOCONF) - /* - * Autoconf configured - */ +/* + * Autoconf configured + */ #include <pj/compat/m_auto.h> #elif defined (PJ_M_I386) || defined(_i386_) || defined(i_386_) || \ defined(_X86_) || defined(x86) || defined(__i386__) || \ defined(__i386) || defined(_M_IX86) || defined(__I86__) - /* - * Generic i386 processor family, little-endian - */ +/* + * Generic i386 processor family, little-endian + */ # undef PJ_M_I386 # define PJ_M_I386 1 # define PJ_M_NAME "i386" @@ -151,9 +152,9 @@ #elif defined (PJ_M_X86_64) || defined(__amd64__) || defined(__amd64) || \ defined(__x86_64__) || defined(__x86_64) - /* - * AMD 64bit processor, little endian - */ +/* + * AMD 64bit processor, little endian + */ # undef PJ_M_X86_64 # define PJ_M_X86_64 1 # define PJ_M_NAME "x86_64" @@ -163,9 +164,9 @@ #elif defined(PJ_M_IA64) || defined(__ia64__) || defined(_IA64) || \ defined(__IA64__) || defined( _M_IA64) - /* - * Intel IA64 processor, little endian - */ +/* + * Intel IA64 processor, little endian + */ # undef PJ_M_IA64 # define PJ_M_IA64 1 # define PJ_M_NAME "ia64" @@ -175,9 +176,9 @@ #elif defined (PJ_M_M68K) && PJ_M_M68K != 0 - /* - * Motorola m64k processor, little endian - */ +/* + * Motorola m64k processor, little endian + */ # undef PJ_M_M68K # define PJ_M_M68K 1 # define PJ_M_NAME "m68k" @@ -188,9 +189,9 @@ #elif defined (PJ_M_ALPHA) || defined (__alpha__) || defined (__alpha) || \ defined (_M_ALPHA) - /* - * DEC Alpha processor, little endian - */ +/* + * DEC Alpha processor, little endian + */ # undef PJ_M_ALPHA # define PJ_M_ALPHA 1 # define PJ_M_NAME "alpha" @@ -201,9 +202,9 @@ #elif defined(PJ_M_MIPS) || defined(__mips__) || defined(__mips) || \ defined(__MIPS__) || defined(MIPS) || defined(_MIPS_) - /* - * MIPS, default to little endian - */ +/* + * MIPS, default to little endian + */ # undef PJ_M_MIPS # define PJ_M_MIPS 1 # define PJ_M_NAME "mips" @@ -215,9 +216,9 @@ #elif defined (PJ_M_SPARC) || defined( __sparc__) || defined(__sparc) - /* - * Sun Sparc, big endian - */ +/* + * Sun Sparc, big endian + */ # undef PJ_M_SPARC # define PJ_M_SPARC 1 # define PJ_M_NAME "sparc" @@ -227,9 +228,9 @@ #elif defined (PJ_M_ARMV4) || defined(ARM) || defined(_ARM_) || \ defined(ARMV4) || defined(__arm__) - /* - * ARM, default to little endian - */ +/* + * ARM, default to little endian + */ # undef PJ_M_ARMV4 # define PJ_M_ARMV4 1 # define PJ_M_NAME "armv4" @@ -242,9 +243,9 @@ #elif defined (PJ_M_POWERPC) || defined(__powerpc) || defined(__powerpc__) || \ defined(__POWERPC__) || defined(__ppc__) || defined(_M_PPC) || \ defined(_ARCH_PPC) - /* - * PowerPC, big endian - */ +/* + * PowerPC, big endian + */ # undef PJ_M_POWERPC # define PJ_M_POWERPC 1 # define PJ_M_NAME "powerpc" @@ -254,16 +255,16 @@ #elif defined (PJ_M_NIOS2) || defined(__nios2) || defined(__nios2__) || \ defined(__NIOS2__) || defined(__M_NIOS2) || defined(_ARCH_NIOS2) - /* - * Nios2, little endian - */ +/* + * Nios2, little endian + */ # undef PJ_M_NIOS2 # define PJ_M_NIOS2 1 # define PJ_M_NAME "nios2" # define PJ_HAS_PENTIUM 0 # define PJ_IS_LITTLE_ENDIAN 1 # define PJ_IS_BIG_ENDIAN 0 - + #else # error "Please specify target machine." #endif @@ -407,7 +408,7 @@ * in the application. * * This will slow down pool creation and destruction and will add - * few bytes of overhead, so application would normally want to + * few bytes of overhead, so application would normally want to * disable this feature on release build. * * Default: 0 @@ -436,14 +437,14 @@ * * Default: 8192 */ -#ifndef PJ_THREAD_DEFAULT_STACK_SIZE +#ifndef PJ_THREAD_DEFAULT_STACK_SIZE # define PJ_THREAD_DEFAULT_STACK_SIZE 8192 #endif /** - * Specify if PJ_CHECK_STACK() macro is enabled to check the sanity of - * the stack. The OS implementation may check that no stack overflow + * Specify if PJ_CHECK_STACK() macro is enabled to check the sanity of + * the stack. The OS implementation may check that no stack overflow * occurs, and it also may collect statistic about stack usage. Note * that this will increase the footprint of the libraries since it * tracks the filename and line number of each functions. @@ -473,7 +474,7 @@ #endif /** - * Support IPv6 in the library. If this support is disabled, some IPv6 + * Support IPv6 in the library. If this support is disabled, some IPv6 * related functions will return PJ_EIPV6NOTSUP. * * Default: 0 (disabled, for now) @@ -482,21 +483,21 @@ # define PJ_HAS_IPV6 0 #endif - /** - * Maximum hostname length. - * Libraries sometimes needs to make copy of an address to stack buffer; - * the value here affects the stack usage. - * - * Default: 128 - */ +/** +* Maximum hostname length. +* Libraries sometimes needs to make copy of an address to stack buffer; +* the value here affects the stack usage. +* +* Default: 128 +*/ #ifndef PJ_MAX_HOSTNAME # define PJ_MAX_HOSTNAME (128) #endif /** * Constants for declaring the maximum handles that can be supported by - * a single IOQ framework. This constant might not be relevant to the - * underlying I/O queue impelementation, but still, developers should be + * a single IOQ framework. This constant might not be relevant to the + * underlying I/O queue impelementation, but still, developers should be * aware of this constant, to make sure that the program will not break when * the underlying implementation changes. */ @@ -510,8 +511,8 @@ * things to ensure thread safety of handle unregistration operation by * employing reference counter to each handle. * - * In addition, the ioqueue will preallocate memory for the handles, - * according to the maximum number of handles that is specified during + * In addition, the ioqueue will preallocate memory for the handles, + * according to the maximum number of handles that is specified during * ioqueue creation. * * All applications would normally want this enabled, but you may disable @@ -532,7 +533,7 @@ * concurrently/in parallel. The default is yes, which means that if there * are more than one pending operations complete simultaneously, more * than one threads may call the key's callback at the same time. This - * generally would promote good scalability for application, at the + * generally would promote good scalability for application, at the * expense of more complexity to manage the concurrent accesses. * * Please see the ioqueue documentation for more info. @@ -587,14 +588,14 @@ * set to value lower than FD_SETSIZE. */ #if PJ_FD_SETSIZE_SETABLE - /* Only override FD_SETSIZE if the value has not been set */ +/* Only override FD_SETSIZE if the value has not been set */ # ifndef FD_SETSIZE # define FD_SETSIZE PJ_IOQUEUE_MAX_HANDLES # endif #else - /* When FD_SETSIZE is not changeable, check if PJ_IOQUEUE_MAX_HANDLES - * is lower than FD_SETSIZE value. - */ +/* When FD_SETSIZE is not changeable, check if PJ_IOQUEUE_MAX_HANDLES + * is lower than FD_SETSIZE value. + */ # ifdef FD_SETSIZE # if PJ_IOQUEUE_MAX_HANDLES > FD_SETSIZE # error "PJ_IOQUEUE_MAX_HANDLES is greater than FD_SETSIZE" @@ -711,7 +712,7 @@ #ifndef PJ_NATIVE_ERR_POSITIVE # define PJ_NATIVE_ERR_POSITIVE 1 #endif - + /** * Include error message string in the library (pj_strerror()). * This is very much desirable! @@ -728,7 +729,7 @@ * functions to compare alnum strings. On some systems, they're faster * then stricmp/strcasecmp, but they can be slower on other systems. * When disabled, pjlib will fallback to stricmp/strnicmp. - * + * * Default: 0 */ #ifndef PJ_HAS_STRICMP_ALNUM @@ -748,7 +749,7 @@ * * The libraries support generation of dynamic link libraries for * Symbian ABIv2 target (.dso/Dynamic Shared Object files, in Symbian - * terms). Similar procedures may be applied for Win32 DLL with some + * terms). Similar procedures may be applied for Win32 DLL with some * modification. * * Depending on the platforms, these steps may be necessary in order to @@ -756,7 +757,7 @@ * - Create the (Visual Studio) projects to produce DLL output. PJLIB * does not provide ready to use project files to produce DLL, so * you need to create these projects yourself. For Symbian, the MMP - * files have been setup to produce DSO files for targets that + * files have been setup to produce DSO files for targets that * require them. * - In the (Visual Studio) projects, some macros need to be declared * so that appropriate modifiers are added to symbol declarations @@ -765,49 +766,49 @@ * MMP files. * - Some build systems require .DEF file to be specified when creating * the DLL. For Symbian, .DEF files are included in pjlib distribution, - * in <tt>pjlib/build.symbian</tt> directory. These DEF files are + * in <tt>pjlib/build.symbian</tt> directory. These DEF files are * created by running <tt>./makedef.sh all</tt> from this directory, * inside Mingw. * * Macros related for building DLL/DSO files: * - For platforms that supports dynamic link libraries generation, * it must declare <tt>PJ_EXPORT_SPECIFIER</tt> macro which value contains - * the prefix to be added to symbol definition, to export this + * the prefix to be added to symbol definition, to export this * symbol in the DLL/DSO. For example, on Win32/Visual Studio, the - * value of this macro is \a __declspec(dllexport), and for ARM - * ABIv2/Symbian, the value is \a EXPORT_C. + * value of this macro is \a __declspec(dllexport), and for ARM + * ABIv2/Symbian, the value is \a EXPORT_C. * - For platforms that supports linking with dynamic link libraries, * it must declare <tt>PJ_IMPORT_SPECIFIER</tt> macro which value contains - * the prefix to be added to symbol declaration, to import this + * the prefix to be added to symbol declaration, to import this * symbol from a DLL/DSO. For example, on Win32/Visual Studio, the - * value of this macro is \a __declspec(dllimport), and for ARM - * ABIv2/Symbian, the value is \a IMPORT_C. - * - Both <tt>PJ_EXPORT_SPECIFIER</tt> and <tt>PJ_IMPORT_SPECIFIER</tt> + * value of this macro is \a __declspec(dllimport), and for ARM + * ABIv2/Symbian, the value is \a IMPORT_C. + * - Both <tt>PJ_EXPORT_SPECIFIER</tt> and <tt>PJ_IMPORT_SPECIFIER</tt> * macros above can be declared in your \a config_site.h if they are not * declared by pjlib. - * - When PJLIB is built as DLL/DSO, both <tt>PJ_DLL</tt> and - * <tt>PJ_EXPORTING</tt> macros must be declared, so that + * - When PJLIB is built as DLL/DSO, both <tt>PJ_DLL</tt> and + * <tt>PJ_EXPORTING</tt> macros must be declared, so that * <tt>PJ_EXPORT_SPECIFIER</tt> modifier will be added into function * definition. * - When application wants to link dynamically with PJLIB, then it * must declare <tt>PJ_DLL</tt> macro when using/including PJLIB header, - * so that <tt>PJ_IMPORT_SPECIFIER</tt> modifier is properly added into + * so that <tt>PJ_IMPORT_SPECIFIER</tt> modifier is properly added into * symbol declarations. * * When <b>PJ_DLL</b> macro is not declared, static linking is assumed. * * For example, here are some settings to produce DLLs with Visual Studio * on Windows/Win32: - * - Create Visual Studio projects to produce DLL. Add the appropriate + * - Create Visual Studio projects to produce DLL. Add the appropriate * project dependencies to avoid link errors. - * - In the projects, declare <tt>PJ_DLL</tt> and <tt>PJ_EXPORTING</tt> + * - In the projects, declare <tt>PJ_DLL</tt> and <tt>PJ_EXPORTING</tt> * macros. * - Declare these macros in your <tt>config_site.h</tt>: \verbatim #define PJ_EXPORT_SPECIFIER __declspec(dllexport) #define PJ_IMPORT_SPECIFIER __declspec(dllimport) \endverbatim - * - And in the application (that links with the DLL) project, add + * - And in the application (that links with the DLL) project, add * <tt>PJ_DLL</tt> in the macro declarations. */ @@ -831,7 +832,7 @@ * is built as dynamic library. * * This macro should have been added by platform specific headers, - * if the platform supports building dynamic library target. + * if the platform supports building dynamic library target. */ #ifndef PJ_EXPORT_DECL_SPECIFIER # define PJ_EXPORT_DECL_SPECIFIER @@ -844,7 +845,7 @@ * is built as dynamic library. * * This macro should have been added by platform specific headers, - * if the platform supports building dynamic library target. + * if the platform supports building dynamic library target. */ #ifndef PJ_EXPORT_DEF_SPECIFIER # define PJ_EXPORT_DEF_SPECIFIER @@ -939,7 +940,7 @@ * @def PJ_DECL_DATA(type) * @param type The data type. * Declare a global data. - */ + */ #if defined(PJ_DLL) # if defined(PJ_EXPORTING) # define PJ_DECL_DATA(type) PJ_EXPORT_DECL_SPECIFIER extern type @@ -955,7 +956,7 @@ * @def PJ_DEF_DATA(type) * @param type The data type. * Define a global data. - */ + */ #if defined(PJ_DLL) && defined(PJ_EXPORTING) # define PJ_DEF_DATA(type) PJ_EXPORT_DEF_SPECIFIER type #elif !defined(PJ_DEF_DATA) @@ -1045,19 +1046,19 @@ PJ_BEGIN_DECL /** * PJLIB version string constant. @see pj_get_version() */ -PJ_DECL_DATA(const char*) PJ_VERSION; +PJ_DECL_DATA (const char*) PJ_VERSION; /** * Get PJLIB version string. * * @return #PJ_VERSION constant. */ -PJ_DECL(const char*) pj_get_version(void); +PJ_DECL (const char*) pj_get_version (void); /** * Dump configuration to log with verbosity equal to info(3). */ -PJ_DECL(void) pj_dump_config(void); +PJ_DECL (void) pj_dump_config (void); PJ_END_DECL diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/config_site.h b/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/config_site.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/config_site.h rename to sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/config_site.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/config_site_sample.h b/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/config_site_sample.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/config_site_sample.h rename to sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/config_site_sample.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/ctype.h b/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/ctype.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/ctype.h rename to sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/ctype.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/doxygen.h b/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/doxygen.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/doxygen.h rename to sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/doxygen.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/errno.h b/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/errno.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/errno.h rename to sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/errno.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/except.h b/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/except.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/except.h rename to sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/except.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/fifobuf.h b/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/fifobuf.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/fifobuf.h rename to sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/fifobuf.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/file_access.h b/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/file_access.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/file_access.h rename to sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/file_access.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/file_io.h b/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/file_io.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/file_io.h rename to sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/file_io.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/guid.h b/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/guid.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/guid.h rename to sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/guid.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/hash.h b/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/hash.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/hash.h rename to sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/hash.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/ioqueue.h b/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/ioqueue.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/ioqueue.h rename to sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/ioqueue.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/ip_helper.h b/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/ip_helper.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/ip_helper.h rename to sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/ip_helper.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/list.h b/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/list.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/list.h rename to sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/list.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/list_i.h b/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/list_i.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/list_i.h rename to sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/list_i.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/lock.h b/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/lock.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/lock.h rename to sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/lock.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/log.h b/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/log.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/log.h rename to sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/log.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/math.h b/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/math.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/math.h rename to sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/math.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/os.h b/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/os.h similarity index 98% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/os.h rename to sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/os.h index 19c0ad4ba3f916a6f1155a76522b7c6f8c20bb4a..9e221e8ee0959a1aa16b93a7f14431e706167505 100644 --- a/sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/os.h +++ b/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/os.h @@ -1,4 +1,4 @@ -/* $Id: os.h 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: os.h 2482 2009-03-02 15:50:12Z nanang $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -394,6 +394,18 @@ typedef struct pj_symbianos_params */ PJ_DECL(pj_status_t) pj_symbianos_set_params(pj_symbianos_params *prm); +/** + * Notify PJLIB that the access point connection has been down or unusable + * and PJLIB should not try to access the Symbian socket API (especially ones + * that send packets). Sending packet when RConnection is reconnected to + * different access point may cause the WaitForRequest() for the function to + * block indefinitely. + * + * @param up If set to PJ_FALSE it will cause PJLIB to not try + * to access socket API, and error will be returned + * immediately instead. + */ +PJ_DECL(void) pj_symbianos_set_connection_status(pj_bool_t up); /** * @} diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/pool.h b/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/pool.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/pool.h rename to sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/pool.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/pool_alt.h b/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/pool_alt.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/pool_alt.h rename to sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/pool_alt.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/pool_buf.h b/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/pool_buf.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/pool_buf.h rename to sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/pool_buf.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/pool_i.h b/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/pool_i.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/pool_i.h rename to sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/pool_i.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/rand.h b/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/rand.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/rand.h rename to sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/rand.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/rbtree.h b/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/rbtree.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/rbtree.h rename to sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/rbtree.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/sock.h b/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/sock.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/sock.h rename to sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/sock.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/sock_select.h b/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/sock_select.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/sock_select.h rename to sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/sock_select.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/string.h b/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/string.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/string.h rename to sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/string.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/string_i.h b/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/string_i.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/string_i.h rename to sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/string_i.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/timer.h b/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/timer.h similarity index 98% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/timer.h rename to sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/timer.h index a6f099cf07bf7ca9997e0df765daf444d9c24c11..55e26269d2a81fa6daead964ef1a7a5a522c7d6c 100644 --- a/sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/timer.h +++ b/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/timer.h @@ -1,4 +1,4 @@ -/* $Id: timer.h 1405 2007-07-20 08:08:30Z bennylp $ */ +/* $Id: timer.h 2527 2009-03-23 11:57:55Z bennylp $ */ /* * 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 @@ -258,8 +258,8 @@ PJ_DECL(pj_status_t) pj_timer_heap_earliest_time( pj_timer_heap_t *ht, * * @param ht The timer heap. * @param next_delay If this parameter is not NULL, it will be filled up with - * the time delay until the next timer elapsed, or -1 in - * the sec part if no entry exist. + * the time delay until the next timer elapsed, or + * PJ_MAXINT32 in the sec part if no entry exist. * * @return The number of timers expired. */ diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/types.h b/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/types.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/types.h rename to sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/types.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/unicode.h b/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/unicode.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/include/pj/unicode.h rename to sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/unicode.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/include/pjlib++.hpp b/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pjlib++.hpp similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/include/pjlib++.hpp rename to sflphone-common/libs/pjproject-1.0.2/pjlib/include/pjlib++.hpp diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/include/pjlib.h b/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pjlib.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/include/pjlib.h rename to sflphone-common/libs/pjproject-1.0.2/pjlib/include/pjlib.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/activesock.c b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/activesock.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/activesock.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/activesock.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/addr_resolv_linux_kernel.c b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/addr_resolv_linux_kernel.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/addr_resolv_linux_kernel.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/addr_resolv_linux_kernel.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/addr_resolv_sock.c b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/addr_resolv_sock.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/addr_resolv_sock.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/addr_resolv_sock.c diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/addr_resolv_symbian.cpp b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/addr_resolv_symbian.cpp new file mode 100644 index 0000000000000000000000000000000000000000..05e2312d14e955fe5fd6fb6d9692717b2ac0a9db --- /dev/null +++ b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/addr_resolv_symbian.cpp @@ -0,0 +1,214 @@ +/* $Id: addr_resolv_symbian.cpp 2482 2009-03-02 15:50:12Z nanang $ */ +/* + * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) + * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> + * + * 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 + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#include <pj/addr_resolv.h> +#include <pj/assert.h> +#include <pj/errno.h> +#include <pj/ip_helper.h> +#include <pj/log.h> +#include <pj/sock.h> +#include <pj/string.h> +#include <pj/unicode.h> + +#include "os_symbian.h" + +#define THIS_FILE "addr_resolv_symbian.cpp" +#define TRACE_ME 0 + + +// PJLIB API: resolve hostname +PJ_DEF (pj_status_t) pj_gethostbyname (const pj_str_t *name, pj_hostent *he) +{ + static pj_addrinfo ai; + static char *aliases[2]; + static char *addrlist[2]; + unsigned count = 1; + pj_status_t status; + + status = pj_getaddrinfo (PJ_AF_INET, name, &count, &ai); + + if (status != PJ_SUCCESS) + return status; + + aliases[0] = ai.ai_canonname; + + aliases[1] = NULL; + + addrlist[0] = (char*) &ai.ai_addr.ipv4.sin_addr; + + addrlist[1] = NULL; + + pj_bzero (he, sizeof (*he)); + + he->h_name = aliases[0]; + + he->h_aliases = aliases; + + he->h_addrtype = PJ_AF_INET; + + he->h_length = 4; + + he->h_addr_list = addrlist; + + return PJ_SUCCESS; +} + + +// Resolve for specific address family +static pj_status_t getaddrinfo_by_af (int af, const pj_str_t *name, + unsigned *count, pj_addrinfo ai[]) +{ + unsigned i; + pj_status_t status; + + PJ_ASSERT_RETURN (name && count && ai, PJ_EINVAL); + + // Return failure if access point is marked as down by app. + PJ_SYMBIAN_CHECK_CONNECTION(); + + // Get resolver for the specified address family + RHostResolver &resv = PjSymbianOS::Instance()->GetResolver (af); + + // Convert name to Unicode + wchar_t name16[PJ_MAX_HOSTNAME]; + pj_ansi_to_unicode (name->ptr, name->slen, name16, PJ_ARRAY_SIZE (name16)); + TPtrC16 data ( (const TUint16*) name16); + + // Resolve! + TNameEntry nameEntry; + TRequestStatus reqStatus; + + resv.GetByName (data, nameEntry, reqStatus); + User::WaitForRequest (reqStatus); + + // Iterate each result + i = 0; + + while (reqStatus == KErrNone && i < *count) { + + // Get the resolved TInetAddr + TInetAddr inetAddr (nameEntry().iAddr); + int addrlen; + +#if TRACE_ME + + if (1) { + pj_sockaddr a; + char ipaddr[PJ_INET6_ADDRSTRLEN+2]; + int namelen; + + namelen = sizeof (pj_sockaddr); + + if (PjSymbianOS::Addr2pj (inetAddr, a, &namelen, + PJ_FALSE) == PJ_SUCCESS) { + PJ_LOG (5, (THIS_FILE, "resolve %.*s: %s", + (int) name->slen, name->ptr, + pj_sockaddr_print (&a, ipaddr, sizeof (ipaddr), 2))); + } + } + +#endif + + // Ignore if this is not the same address family + // Not a good idea, as Symbian mapps IPv4 to IPv6. + //fam = inetAddr.Family(); + //if (fam != af) { + // resv.Next(nameEntry, reqStatus); + // User::WaitForRequest(reqStatus); + // continue; + //} + + // Convert IP address first to get IPv4 mapped address + addrlen = sizeof (ai[i].ai_addr); + + status = PjSymbianOS::Addr2pj (inetAddr, ai[i].ai_addr, + &addrlen, PJ_TRUE); + + if (status != PJ_SUCCESS) + return status; + + // Ignore if address family doesn't match + if (ai[i].ai_addr.addr.sa_family != af) { + resv.Next (nameEntry, reqStatus); + User::WaitForRequest (reqStatus); + continue; + } + + // Convert the official address to ANSI. + pj_unicode_to_ansi ( (const wchar_t*) nameEntry().iName.Ptr(), + nameEntry().iName.Length(), + ai[i].ai_canonname, sizeof (ai[i].ai_canonname)); + + // Next + ++i; + + resv.Next (nameEntry, reqStatus); + + User::WaitForRequest (reqStatus); + } + + *count = i; + + return PJ_SUCCESS; +} + +/* Resolve IPv4/IPv6 address */ +PJ_DEF (pj_status_t) pj_getaddrinfo (int af, const pj_str_t *nodename, + unsigned *count, pj_addrinfo ai[]) +{ + unsigned start; + pj_status_t status; + + PJ_ASSERT_RETURN (af==PJ_AF_INET || af==PJ_AF_INET6 || af==PJ_AF_UNSPEC, + PJ_EAFNOTSUP); + PJ_ASSERT_RETURN (nodename && count && *count && ai, PJ_EINVAL); + + start = 0; + + if (af==PJ_AF_INET6 || af==PJ_AF_UNSPEC) { + unsigned max = *count; + status = getaddrinfo_by_af (PJ_AF_INET6, nodename, + &max, &ai[start]); + + if (status == PJ_SUCCESS) { + (*count) -= max; + start += max; + } + } + + if (af==PJ_AF_INET || af==PJ_AF_UNSPEC) { + unsigned max = *count; + status = getaddrinfo_by_af (PJ_AF_INET, nodename, + &max, &ai[start]); + + if (status == PJ_SUCCESS) { + (*count) -= max; + start += max; + } + } + + *count = start; + + if (*count) { + return PJ_SUCCESS; + } else { + return status!=PJ_SUCCESS ? status : PJ_ENOTFOUND; + } +} + diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/array.c b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/array.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/array.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/array.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/compat/longjmp_i386.S b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/compat/longjmp_i386.S similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/compat/longjmp_i386.S rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/compat/longjmp_i386.S diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/compat/setjmp_i386.S b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/compat/setjmp_i386.S similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/compat/setjmp_i386.S rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/compat/setjmp_i386.S diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/compat/sigjmp.c b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/compat/sigjmp.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/compat/sigjmp.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/compat/sigjmp.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/compat/string.c b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/compat/string.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/compat/string.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/compat/string.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/compat/string_compat.c b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/compat/string_compat.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/compat/string_compat.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/compat/string_compat.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/config.c b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/config.c similarity index 97% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/config.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/config.c index 27c1e13253e61bda3d13d7b1bde1289903e835d0..f2beb56635399cfc789ea6a03ca35137c457c5b7 100644 --- a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/config.c +++ b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/config.c @@ -1,4 +1,4 @@ -/* $Id: config.c 2396 2008-12-24 10:04:24Z bennylp $ */ +/* $Id: config.c 2551 2009-03-25 12:13:09Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -22,7 +22,7 @@ #include <pj/ioqueue.h> static const char *id = "config.c"; -PJ_DEF_DATA(const char*) PJ_VERSION = "1.0.1"; +PJ_DEF_DATA(const char*) PJ_VERSION = "1.0.2"; /* * Get PJLIB version string. diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/ctype.c b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/ctype.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/ctype.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/ctype.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/errno.c b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/errno.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/errno.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/errno.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/except.c b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/except.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/except.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/except.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/exception_symbian.cpp b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/exception_symbian.cpp similarity index 70% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/exception_symbian.cpp rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/exception_symbian.cpp index e54cebddf940cd73896ee81e1f59afad48d16d74..14ded02ed9c7f93154068aef65904015728dc4b1 100644 --- a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/exception_symbian.cpp +++ b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/exception_symbian.cpp @@ -1,5 +1,5 @@ /* $Id: exception_symbian.cpp 2394 2008-12-23 17:27:53Z bennylp $ */ -/* +/* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> * @@ -15,7 +15,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include <pj/except.h> #include <pj/os.h> @@ -25,19 +25,19 @@ #if defined(PJ_HAS_EXCEPTION_NAMES) && PJ_HAS_EXCEPTION_NAMES != 0 - static const char *exception_id_names[PJ_MAX_EXCEPTION_ID]; +static const char *exception_id_names[PJ_MAX_EXCEPTION_ID]; #else - /* - * Start from 1 (not 0)!!! - * Exception 0 is reserved for normal path of setjmp()!!! - */ - static int last_exception_id = 1; +/* + * Start from 1 (not 0)!!! + * Exception 0 is reserved for normal path of setjmp()!!! + */ +static int last_exception_id = 1; #endif /* PJ_HAS_EXCEPTION_NAMES */ #if defined(PJ_HAS_EXCEPTION_NAMES) && PJ_HAS_EXCEPTION_NAMES != 0 -PJ_DEF(pj_status_t) pj_exception_id_alloc( const char *name, - pj_exception_id_t *id) +PJ_DEF (pj_status_t) pj_exception_id_alloc (const char *name, + pj_exception_id_t *id) { unsigned i; @@ -47,6 +47,7 @@ PJ_DEF(pj_status_t) pj_exception_id_alloc( const char *name, * Start from 1 (not 0)!!! * Exception 0 is reserved for normal path of setjmp()!!! */ + for (i=1; i<PJ_MAX_EXCEPTION_ID; ++i) { if (exception_id_names[i] == NULL) { exception_id_names[i] = name; @@ -57,17 +58,18 @@ PJ_DEF(pj_status_t) pj_exception_id_alloc( const char *name, } pj_leave_critical_section(); + return PJ_ETOOMANY; } -PJ_DEF(pj_status_t) pj_exception_id_free( pj_exception_id_t id ) +PJ_DEF (pj_status_t) pj_exception_id_free (pj_exception_id_t id) { /* * Start from 1 (not 0)!!! * Exception 0 is reserved for normal path of setjmp()!!! */ - PJ_ASSERT_RETURN(id>0 && id<PJ_MAX_EXCEPTION_ID, PJ_EINVAL); - + PJ_ASSERT_RETURN (id>0 && id<PJ_MAX_EXCEPTION_ID, PJ_EINVAL); + pj_enter_critical_section(); exception_id_names[id] = NULL; pj_leave_critical_section(); @@ -76,13 +78,13 @@ PJ_DEF(pj_status_t) pj_exception_id_free( pj_exception_id_t id ) } -PJ_DEF(const char*) pj_exception_id_name(pj_exception_id_t id) +PJ_DEF (const char*) pj_exception_id_name (pj_exception_id_t id) { /* * Start from 1 (not 0)!!! * Exception 0 is reserved for normal path of setjmp()!!! */ - PJ_ASSERT_RETURN(id>0 && id<PJ_MAX_EXCEPTION_ID, "<Invalid ID>"); + PJ_ASSERT_RETURN (id>0 && id<PJ_MAX_EXCEPTION_ID, "<Invalid ID>"); if (exception_id_names[id] == NULL) return "<Unallocated ID>"; @@ -91,21 +93,21 @@ PJ_DEF(const char*) pj_exception_id_name(pj_exception_id_t id) } #else /* PJ_HAS_EXCEPTION_NAMES */ -PJ_DEF(pj_status_t) pj_exception_id_alloc( const char *name, - pj_exception_id_t *id) +PJ_DEF (pj_status_t) pj_exception_id_alloc (const char *name, + pj_exception_id_t *id) { - PJ_ASSERT_RETURN(last_exception_id < PJ_MAX_EXCEPTION_ID-1, PJ_ETOOMANY); + PJ_ASSERT_RETURN (last_exception_id < PJ_MAX_EXCEPTION_ID-1, PJ_ETOOMANY); *id = last_exception_id++; return PJ_SUCCESS; } -PJ_DEF(pj_status_t) pj_exception_id_free( pj_exception_id_t id ) +PJ_DEF (pj_status_t) pj_exception_id_free (pj_exception_id_t id) { return PJ_SUCCESS; } -PJ_DEF(const char*) pj_exception_id_name(pj_exception_id_t id) +PJ_DEF (const char*) pj_exception_id_name (pj_exception_id_t id) { return ""; } diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/extra-exports.c b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/extra-exports.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/extra-exports.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/extra-exports.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/fifobuf.c b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/fifobuf.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/fifobuf.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/fifobuf.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/file_access_unistd.c b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/file_access_unistd.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/file_access_unistd.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/file_access_unistd.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/file_access_win32.c b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/file_access_win32.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/file_access_win32.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/file_access_win32.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/file_io_ansi.c b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/file_io_ansi.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/file_io_ansi.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/file_io_ansi.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/file_io_win32.c b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/file_io_win32.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/file_io_win32.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/file_io_win32.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/guid.c b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/guid.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/guid.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/guid.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/guid_simple.c b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/guid_simple.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/guid_simple.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/guid_simple.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/guid_uuid.c b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/guid_uuid.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/guid_uuid.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/guid_uuid.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/guid_win32.c b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/guid_win32.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/guid_win32.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/guid_win32.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/hash.c b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/hash.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/hash.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/hash.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/ioqueue_common_abs.c b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/ioqueue_common_abs.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/ioqueue_common_abs.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/ioqueue_common_abs.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/ioqueue_common_abs.h b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/ioqueue_common_abs.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/ioqueue_common_abs.h rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/ioqueue_common_abs.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/ioqueue_dummy.c b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/ioqueue_dummy.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/ioqueue_dummy.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/ioqueue_dummy.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/ioqueue_epoll.c b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/ioqueue_epoll.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/ioqueue_epoll.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/ioqueue_epoll.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/ioqueue_linux_kernel.c b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/ioqueue_linux_kernel.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/ioqueue_linux_kernel.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/ioqueue_linux_kernel.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/ioqueue_select.c b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/ioqueue_select.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/ioqueue_select.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/ioqueue_select.c diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/ioqueue_symbian.cpp b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/ioqueue_symbian.cpp new file mode 100644 index 0000000000000000000000000000000000000000..ceb23e258d9f2dd286ea5fcc918fddedd838c06c --- /dev/null +++ b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/ioqueue_symbian.cpp @@ -0,0 +1,861 @@ +/* $Id: ioqueue_symbian.cpp 2482 2009-03-02 15:50:12Z nanang $ */ +/* + * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) + * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> + * + * 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 + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#include <pj/ioqueue.h> +#include <pj/assert.h> +#include <pj/errno.h> +#include <pj/list.h> +#include <pj/lock.h> +#include <pj/pool.h> +#include <pj/string.h> + +#include "os_symbian.h" + +class CIoqueueCallback; + +/* + * IO Queue structure. + */ + +struct pj_ioqueue_t { + int eventCount; +}; + + +///////////////////////////////////////////////////////////////////////////// +// Class to encapsulate asynchronous socket operation. +// + +class CIoqueueCallback : public CActive +{ + + public: + static CIoqueueCallback* NewL (pj_ioqueue_t *ioqueue, + pj_ioqueue_key_t *key, + pj_sock_t sock, + const pj_ioqueue_callback *cb, + void *user_data); + + // + // Start asynchronous recv() operation + // + pj_status_t StartRead (pj_ioqueue_op_key_t *op_key, + void *buf, pj_ssize_t *size, unsigned flags, + pj_sockaddr_t *addr, int *addrlen); + + // + // Start asynchronous accept() operation. + // + pj_status_t StartAccept (pj_ioqueue_op_key_t *op_key, + pj_sock_t *new_sock, + pj_sockaddr_t *local, + pj_sockaddr_t *remote, + int *addrlen); + + // + // Completion callback. + // + void RunL(); + + // + // CActive's DoCancel() + // + void DoCancel(); + + // + // Cancel operation and call callback. + // + void CancelOperation (pj_ioqueue_op_key_t *op_key, + pj_ssize_t bytes_status); + + // + // Accessors + // + void* get_user_data() const { + return user_data_; + } + + void set_user_data (void *user_data) { + user_data_ = user_data; + } + + pj_ioqueue_op_key_t *get_op_key() const { + return pending_data_.common_.op_key_; + } + + CPjSocket* get_pj_socket() { + return sock_; + } + + private: + // Type of pending operation. + enum Type { + TYPE_NONE, + TYPE_READ, + TYPE_ACCEPT, + }; + + // Static data. + pj_ioqueue_t *ioqueue_; + pj_ioqueue_key_t *key_; + CPjSocket *sock_; + pj_ioqueue_callback cb_; + void *user_data_; + + // Symbian data. + TPtr8 aBufferPtr_; + TInetAddr aAddress_; + + // Application data. + Type type_; + + union Pending_Data { + + struct Common { + pj_ioqueue_op_key_t *op_key_; + } common_; + + struct Pending_Read { + pj_ioqueue_op_key_t *op_key_; + pj_sockaddr_t *addr_; + int *addrlen_; + } read_; + + struct Pending_Accept { + pj_ioqueue_op_key_t *op_key_; + pj_sock_t *new_sock_; + pj_sockaddr_t *local_; + pj_sockaddr_t *remote_; + int *addrlen_; + } accept_; + }; + + union Pending_Data pending_data_; + RSocket blank_sock_; + + CIoqueueCallback (pj_ioqueue_t *ioqueue, + pj_ioqueue_key_t *key, pj_sock_t sock, + const pj_ioqueue_callback *cb, void *user_data) + : CActive (CActive::EPriorityStandard), + ioqueue_ (ioqueue), key_ (key), sock_ ( (CPjSocket*) sock), + user_data_ (user_data), aBufferPtr_ (NULL, 0), type_ (TYPE_NONE) { + pj_memcpy (&cb_, cb, sizeof (*cb)); + } + + + void ConstructL() { + CActiveScheduler::Add (this); + } + + void HandleReadCompletion(); + CPjSocket *HandleAcceptCompletion(); +}; + + +CIoqueueCallback* CIoqueueCallback::NewL (pj_ioqueue_t *ioqueue, + pj_ioqueue_key_t *key, + pj_sock_t sock, + const pj_ioqueue_callback *cb, + void *user_data) +{ + CIoqueueCallback *self = new CIoqueueCallback (ioqueue, key, sock, + cb, user_data); + CleanupStack::PushL (self); + self->ConstructL(); + CleanupStack::Pop (self); + + return self; +} + + +// +// Start asynchronous recv() operation +// +pj_status_t CIoqueueCallback::StartRead (pj_ioqueue_op_key_t *op_key, + void *buf, pj_ssize_t *size, + unsigned flags, + pj_sockaddr_t *addr, int *addrlen) +{ + PJ_ASSERT_RETURN (IsActive() ==false, PJ_EBUSY); + PJ_ASSERT_RETURN (pending_data_.common_.op_key_==NULL, PJ_EBUSY); + + flags &= ~PJ_IOQUEUE_ALWAYS_ASYNC; + + pending_data_.read_.op_key_ = op_key; + pending_data_.read_.addr_ = addr; + pending_data_.read_.addrlen_ = addrlen; + + aBufferPtr_.Set ( (TUint8*) buf, 0, (TInt) *size); + + type_ = TYPE_READ; + + if (addr && addrlen) { + sock_->Socket().RecvFrom (aBufferPtr_, aAddress_, flags, iStatus); + } else { + aAddress_.SetAddress (0); + aAddress_.SetPort (0); + sock_->Socket().Recv (aBufferPtr_, flags, iStatus); + } + + SetActive(); + + return PJ_EPENDING; +} + + +// +// Start asynchronous accept() operation. +// +pj_status_t CIoqueueCallback::StartAccept (pj_ioqueue_op_key_t *op_key, + pj_sock_t *new_sock, + pj_sockaddr_t *local, + pj_sockaddr_t *remote, + int *addrlen) +{ + PJ_ASSERT_RETURN (IsActive() ==false, PJ_EBUSY); + PJ_ASSERT_RETURN (pending_data_.common_.op_key_==NULL, PJ_EBUSY); + + // addrlen must be specified if local or remote is specified + PJ_ASSERT_RETURN ( (!local && !remote) || + (addrlen && *addrlen), PJ_EINVAL); + + pending_data_.accept_.op_key_ = op_key; + pending_data_.accept_.new_sock_ = new_sock; + pending_data_.accept_.local_ = local; + pending_data_.accept_.remote_ = remote; + pending_data_.accept_.addrlen_ = addrlen; + + // Create blank socket + blank_sock_.Open (PjSymbianOS::Instance()->SocketServ()); + + type_ = TYPE_ACCEPT; + sock_->Socket().Accept (blank_sock_, iStatus); + + SetActive(); + return PJ_EPENDING; +} + + +// +// Handle asynchronous RecvFrom() completion +// +void CIoqueueCallback::HandleReadCompletion() +{ + if (pending_data_.read_.addr_ && pending_data_.read_.addrlen_) { + PjSymbianOS::Addr2pj (aAddress_, + * (pj_sockaddr*) pending_data_.read_.addr_, + pending_data_.read_.addrlen_); + pending_data_.read_.addr_ = NULL; + pending_data_.read_.addrlen_ = NULL; + } + + pending_data_.read_.op_key_ = NULL; +} + + +// +// Handle asynchronous Accept() completion. +// +CPjSocket *CIoqueueCallback::HandleAcceptCompletion() +{ + CPjSocket *pjNewSock = new CPjSocket (get_pj_socket()->GetAf(), + blank_sock_); + int addrlen = 0; + + if (pending_data_.accept_.new_sock_) { + *pending_data_.accept_.new_sock_ = (pj_sock_t) pjNewSock; + pending_data_.accept_.new_sock_ = NULL; + } + + if (pending_data_.accept_.local_) { + TInetAddr aAddr; + pj_sockaddr *ptr_sockaddr; + + blank_sock_.LocalName (aAddr); + ptr_sockaddr = (pj_sockaddr*) pending_data_.accept_.local_; + addrlen = *pending_data_.accept_.addrlen_; + PjSymbianOS::Addr2pj (aAddr, *ptr_sockaddr, &addrlen); + pending_data_.accept_.local_ = NULL; + } + + if (pending_data_.accept_.remote_) { + TInetAddr aAddr; + pj_sockaddr *ptr_sockaddr; + + blank_sock_.RemoteName (aAddr); + ptr_sockaddr = (pj_sockaddr*) pending_data_.accept_.remote_; + addrlen = *pending_data_.accept_.addrlen_; + PjSymbianOS::Addr2pj (aAddr, *ptr_sockaddr, &addrlen); + pending_data_.accept_.remote_ = NULL; + } + + if (pending_data_.accept_.addrlen_) { + if (addrlen == 0) { + if (pjNewSock->GetAf() == PJ_AF_INET) + addrlen = sizeof (pj_sockaddr_in); + else if (pjNewSock->GetAf() == PJ_AF_INET6) + addrlen = sizeof (pj_sockaddr_in6); + else { + pj_assert (!"Unsupported address family"); + } + } + + *pending_data_.accept_.addrlen_ = addrlen; + + pending_data_.accept_.addrlen_ = NULL; + } + + return pjNewSock; +} + + +// +// Completion callback. +// +void CIoqueueCallback::RunL() +{ + Type cur_type = type_; + + type_ = TYPE_NONE; + + if (cur_type == TYPE_READ) { + // + // Completion of asynchronous RecvFrom() + // + + /* Clear op_key (save it to temp variable first!) */ + pj_ioqueue_op_key_t *op_key = pending_data_.read_.op_key_; + pending_data_.read_.op_key_ = NULL; + + // Handle failure condition + + if (iStatus != KErrNone) { + if (cb_.on_read_complete) { + cb_.on_read_complete (key_, op_key, + -PJ_RETURN_OS_ERROR (iStatus.Int())); + } + + return; + } + + HandleReadCompletion(); + + /* Call callback */ + + if (cb_.on_read_complete) { + cb_.on_read_complete (key_, op_key, aBufferPtr_.Length()); + } + + } else if (cur_type == TYPE_ACCEPT) { + // + // Completion of asynchronous Accept() + // + + /* Clear op_key (save it to temp variable first!) */ + pj_ioqueue_op_key_t *op_key = pending_data_.read_.op_key_; + pending_data_.read_.op_key_ = NULL; + + // Handle failure condition + + if (iStatus != KErrNone) { + if (pending_data_.accept_.new_sock_) + *pending_data_.accept_.new_sock_ = PJ_INVALID_SOCKET; + + if (cb_.on_accept_complete) { + cb_.on_accept_complete (key_, op_key, PJ_INVALID_SOCKET, + -PJ_RETURN_OS_ERROR (iStatus.Int())); + } + + return; + } + + CPjSocket *pjNewSock = HandleAcceptCompletion(); + + // Call callback. + + if (cb_.on_accept_complete) { + cb_.on_accept_complete (key_, op_key, (pj_sock_t) pjNewSock, + PJ_SUCCESS); + } + } + + ioqueue_->eventCount++; +} + +// +// CActive's DoCancel() +// +void CIoqueueCallback::DoCancel() +{ + if (type_ == TYPE_READ) + sock_->Socket().CancelRecv(); + else if (type_ == TYPE_ACCEPT) + sock_->Socket().CancelAccept(); + + type_ = TYPE_NONE; + + pending_data_.common_.op_key_ = NULL; +} + +// +// Cancel operation and call callback. +// +void CIoqueueCallback::CancelOperation (pj_ioqueue_op_key_t *op_key, + pj_ssize_t bytes_status) +{ + Type cur_type = type_; + + pj_assert (op_key == pending_data_.common_.op_key_); + + Cancel(); + + if (cur_type == TYPE_READ) { + if (cb_.on_read_complete) + cb_.on_read_complete (key_, op_key, bytes_status); + } else if (cur_type == TYPE_ACCEPT) + ; +} + + +///////////////////////////////////////////////////////////////////////////// +/* + * IO Queue key structure. + */ + +struct pj_ioqueue_key_t { + CIoqueueCallback *cbObj; +}; + + +/* + * Return the name of the ioqueue implementation. + */ +PJ_DEF (const char*) pj_ioqueue_name (void) +{ + return "ioqueue-symbian"; +} + + +/* + * Create a new I/O Queue framework. + */ +PJ_DEF (pj_status_t) pj_ioqueue_create (pj_pool_t *pool, + pj_size_t max_fd, + pj_ioqueue_t **p_ioqueue) +{ + pj_ioqueue_t *ioq; + + PJ_UNUSED_ARG (max_fd); + + ioq = PJ_POOL_ZALLOC_T (pool, pj_ioqueue_t); + *p_ioqueue = ioq; + return PJ_SUCCESS; +} + + +/* + * Destroy the I/O queue. + */ +PJ_DEF (pj_status_t) pj_ioqueue_destroy (pj_ioqueue_t *ioq) +{ + PJ_UNUSED_ARG (ioq); + return PJ_SUCCESS; +} + + +/* + * Set the lock object to be used by the I/O Queue. + */ +PJ_DEF (pj_status_t) pj_ioqueue_set_lock (pj_ioqueue_t *ioq, + pj_lock_t *lock, + pj_bool_t auto_delete) +{ + /* Don't really need lock for now */ + PJ_UNUSED_ARG (ioq); + + if (auto_delete) { + pj_lock_destroy (lock); + } + + return PJ_SUCCESS; +} + +PJ_DEF (pj_status_t) pj_ioqueue_set_default_concurrency (pj_ioqueue_t *ioqueue, + pj_bool_t allow) +{ + /* Not supported, just return PJ_SUCCESS silently */ + PJ_UNUSED_ARG (ioqueue); + PJ_UNUSED_ARG (allow); + return PJ_SUCCESS; +} + +/* + * Register a socket to the I/O queue framework. + */ +PJ_DEF (pj_status_t) pj_ioqueue_register_sock (pj_pool_t *pool, + pj_ioqueue_t *ioq, + pj_sock_t sock, + void *user_data, + const pj_ioqueue_callback *cb, + pj_ioqueue_key_t **p_key) +{ + pj_ioqueue_key_t *key; + + key = PJ_POOL_ZALLOC_T (pool, pj_ioqueue_key_t); + key->cbObj = CIoqueueCallback::NewL (ioq, key, sock, cb, user_data); + + *p_key = key; + return PJ_SUCCESS; +} + +/* + * Unregister from the I/O Queue framework. + */ +PJ_DEF (pj_status_t) pj_ioqueue_unregister (pj_ioqueue_key_t *key) +{ + if (key == NULL || key->cbObj == NULL) + return PJ_SUCCESS; + + // Cancel pending async object + if (key->cbObj) { + key->cbObj->Cancel(); + } + + // Close socket. + key->cbObj->get_pj_socket()->Socket().Close(); + + delete key->cbObj->get_pj_socket(); + + // Delete async object. + if (key->cbObj) { + delete key->cbObj; + key->cbObj = NULL; + } + + return PJ_SUCCESS; +} + + +/* + * Get user data associated with an ioqueue key. + */ +PJ_DEF (void*) pj_ioqueue_get_user_data (pj_ioqueue_key_t *key) +{ + return key->cbObj->get_user_data(); +} + + +/* + * Set or change the user data to be associated with the file descriptor or + * handle or socket descriptor. + */ +PJ_DEF (pj_status_t) pj_ioqueue_set_user_data (pj_ioqueue_key_t *key, + void *user_data, + void **old_data) +{ + if (old_data) + *old_data = key->cbObj->get_user_data(); + + key->cbObj->set_user_data (user_data); + + return PJ_SUCCESS; +} + + +/* + * Initialize operation key. + */ +PJ_DEF (void) pj_ioqueue_op_key_init (pj_ioqueue_op_key_t *op_key, + pj_size_t size) +{ + pj_bzero (op_key, size); +} + + +/* + * Check if operation is pending on the specified operation key. + */ +PJ_DEF (pj_bool_t) pj_ioqueue_is_pending (pj_ioqueue_key_t *key, + pj_ioqueue_op_key_t *op_key) +{ + return key->cbObj->get_op_key() ==op_key && + key->cbObj->IsActive(); +} + + +/* + * Post completion status to the specified operation key and call the + * appropriate callback. + */ +PJ_DEF (pj_status_t) pj_ioqueue_post_completion (pj_ioqueue_key_t *key, + pj_ioqueue_op_key_t *op_key, + pj_ssize_t bytes_status) +{ + if (pj_ioqueue_is_pending (key, op_key)) { + key->cbObj->CancelOperation (op_key, bytes_status); + } + + return PJ_SUCCESS; +} + + +#if defined(PJ_HAS_TCP) && PJ_HAS_TCP != 0 +/** + * Instruct I/O Queue to accept incoming connection on the specified + * listening socket. + */ +PJ_DEF (pj_status_t) pj_ioqueue_accept (pj_ioqueue_key_t *key, + pj_ioqueue_op_key_t *op_key, + pj_sock_t *new_sock, + pj_sockaddr_t *local, + pj_sockaddr_t *remote, + int *addrlen) +{ + + return key->cbObj->StartAccept (op_key, new_sock, local, remote, addrlen); +} + + +/* + * Initiate non-blocking socket connect. + */ +PJ_DEF (pj_status_t) pj_ioqueue_connect (pj_ioqueue_key_t *key, + const pj_sockaddr_t *addr, + int addrlen) +{ + pj_status_t status; + + RSocket &rSock = key->cbObj->get_pj_socket()->Socket(); + TInetAddr inetAddr; + TRequestStatus reqStatus; + + // Return failure if access point is marked as down by app. + PJ_SYMBIAN_CHECK_CONNECTION(); + + // Convert address + status = PjSymbianOS::pj2Addr (* (const pj_sockaddr*) addr, addrlen, + inetAddr); + + if (status != PJ_SUCCESS) + return status; + + // We don't support async connect for now. + PJ_TODO (IOQUEUE_SUPPORT_ASYNC_CONNECT); + + rSock.Connect (inetAddr, reqStatus); + + User::WaitForRequest (reqStatus); + + if (reqStatus == KErrNone) + return PJ_SUCCESS; + + return PJ_RETURN_OS_ERROR (reqStatus.Int()); +} + + +#endif /* PJ_HAS_TCP */ + +/* + * Poll the I/O Queue for completed events. + */ +PJ_DEF (int) pj_ioqueue_poll (pj_ioqueue_t *ioq, + const pj_time_val *timeout) +{ + /* Polling is not necessary on Symbian, since all async activities + * are registered to active scheduler. + */ + PJ_UNUSED_ARG (ioq); + PJ_UNUSED_ARG (timeout); + return 0; +} + + +/* + * Instruct the I/O Queue to read from the specified handle. + */ +PJ_DEF (pj_status_t) pj_ioqueue_recv (pj_ioqueue_key_t *key, + pj_ioqueue_op_key_t *op_key, + void *buffer, + pj_ssize_t *length, + pj_uint32_t flags) +{ + // If socket has reader, delete it. + if (key->cbObj->get_pj_socket()->Reader()) + key->cbObj->get_pj_socket()->DestroyReader(); + + // Clear flag + flags &= ~PJ_IOQUEUE_ALWAYS_ASYNC; + + return key->cbObj->StartRead (op_key, buffer, length, flags, NULL, NULL); +} + + +/* + * This function behaves similarly as #pj_ioqueue_recv(), except that it is + * normally called for socket, and the remote address will also be returned + * along with the data. + */ +PJ_DEF (pj_status_t) pj_ioqueue_recvfrom (pj_ioqueue_key_t *key, + pj_ioqueue_op_key_t *op_key, + void *buffer, + pj_ssize_t *length, + pj_uint32_t flags, + pj_sockaddr_t *addr, + int *addrlen) +{ + CPjSocket *sock = key->cbObj->get_pj_socket(); + + // If address is specified, check that the length match the + // address family + + if (addr || addrlen) { + PJ_ASSERT_RETURN (addr && addrlen && *addrlen, PJ_EINVAL); + + if (sock->GetAf() == PJ_AF_INET) { + PJ_ASSERT_RETURN (*addrlen>= (int) sizeof (pj_sockaddr_in), PJ_EINVAL); + } else if (sock->GetAf() == PJ_AF_INET6) { + PJ_ASSERT_RETURN (*addrlen>= (int) sizeof (pj_sockaddr_in6), PJ_EINVAL); + } + } + + // If socket has reader, delete it. + if (sock->Reader()) + sock->DestroyReader(); + + if (key->cbObj->IsActive()) + return PJ_EBUSY; + + // Clear flag + flags &= ~PJ_IOQUEUE_ALWAYS_ASYNC; + + return key->cbObj->StartRead (op_key, buffer, length, flags, addr, addrlen); +} + + +/* + * Instruct the I/O Queue to write to the handle. + */ +PJ_DEF (pj_status_t) pj_ioqueue_send (pj_ioqueue_key_t *key, + pj_ioqueue_op_key_t *op_key, + const void *data, + pj_ssize_t *length, + pj_uint32_t flags) +{ + TRequestStatus reqStatus; + TPtrC8 aBuffer ( (const TUint8*) data, (TInt) *length); + TSockXfrLength aLen; + + PJ_UNUSED_ARG (op_key); + + // Forcing pending operation is not supported. + PJ_ASSERT_RETURN ( (flags & PJ_IOQUEUE_ALWAYS_ASYNC) ==0, PJ_EINVAL); + + // Return failure if access point is marked as down by app. + PJ_SYMBIAN_CHECK_CONNECTION(); + + // Clear flag + flags &= ~PJ_IOQUEUE_ALWAYS_ASYNC; + + key->cbObj->get_pj_socket()->Socket().Send (aBuffer, flags, reqStatus, aLen); + User::WaitForRequest (reqStatus); + + if (reqStatus.Int() != KErrNone) + return PJ_RETURN_OS_ERROR (reqStatus.Int()); + + //At least in UIQ Emulator, aLen.Length() reports incorrect length + //for UDP (some newlc.com users seem to have reported this too). + //*length = aLen.Length(); + return PJ_SUCCESS; +} + + +/* + * Instruct the I/O Queue to write to the handle. + */ +PJ_DEF (pj_status_t) pj_ioqueue_sendto (pj_ioqueue_key_t *key, + pj_ioqueue_op_key_t *op_key, + const void *data, + pj_ssize_t *length, + pj_uint32_t flags, + const pj_sockaddr_t *addr, + int addrlen) +{ + TRequestStatus reqStatus; + TPtrC8 aBuffer; + TInetAddr inetAddr; + TSockXfrLength aLen; + pj_status_t status; + + PJ_UNUSED_ARG (op_key); + + // Forcing pending operation is not supported. + PJ_ASSERT_RETURN ( (flags & PJ_IOQUEUE_ALWAYS_ASYNC) ==0, PJ_EINVAL); + + // Return failure if access point is marked as down by app. + PJ_SYMBIAN_CHECK_CONNECTION(); + + // Convert address + status = PjSymbianOS::pj2Addr (* (const pj_sockaddr*) addr, addrlen, + inetAddr); + + if (status != PJ_SUCCESS) + return status; + + // Clear flag + flags &= ~PJ_IOQUEUE_ALWAYS_ASYNC; + + aBuffer.Set ( (const TUint8*) data, (TInt) *length); + + CPjSocket *pjSock = key->cbObj->get_pj_socket(); + + pjSock->Socket().SendTo (aBuffer, inetAddr, flags, reqStatus, aLen); + + User::WaitForRequest (reqStatus); + + if (reqStatus.Int() != KErrNone) + return PJ_RETURN_OS_ERROR (reqStatus.Int()); + + //At least in UIQ Emulator, aLen.Length() reports incorrect length + //for UDP (some newlc.com users seem to have reported this too). + //*length = aLen.Length(); + return PJ_SUCCESS; +} + +PJ_DEF (pj_status_t) pj_ioqueue_set_concurrency (pj_ioqueue_key_t *key, + pj_bool_t allow) +{ + /* Not supported, just return PJ_SUCCESS silently */ + PJ_UNUSED_ARG (key); + PJ_UNUSED_ARG (allow); + return PJ_SUCCESS; +} + +PJ_DEF (pj_status_t) pj_ioqueue_lock_key (pj_ioqueue_key_t *key) +{ + /* Not supported, just return PJ_SUCCESS silently */ + PJ_UNUSED_ARG (key); + return PJ_SUCCESS; +} + +PJ_DEF (pj_status_t) pj_ioqueue_unlock_key (pj_ioqueue_key_t *key) +{ + /* Not supported, just return PJ_SUCCESS silently */ + PJ_UNUSED_ARG (key); + return PJ_SUCCESS; +} diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/ioqueue_winnt.c b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/ioqueue_winnt.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/ioqueue_winnt.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/ioqueue_winnt.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/ip_helper_generic.c b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/ip_helper_generic.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/ip_helper_generic.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/ip_helper_generic.c diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/ip_helper_symbian.cpp b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/ip_helper_symbian.cpp new file mode 100644 index 0000000000000000000000000000000000000000..3cf3845870b18cd5c36fc34521f947dad2721b60 --- /dev/null +++ b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/ip_helper_symbian.cpp @@ -0,0 +1,154 @@ +/* $Id: ip_helper_symbian.cpp 2394 2008-12-23 17:27:53Z bennylp $ */ +/* + * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) + * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> + * + * 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 + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#include <pj/ip_helper.h> +#include <pj/addr_resolv.h> +#include <pj/assert.h> +#include <pj/errno.h> +#include <pj/log.h> +#include <pj/string.h> +#include <pj/compat/socket.h> + + +#include "os_symbian.h" + +#define THIS_FILE "ip_helper_symbian.cpp" +#define TRACE_ME 0 + +static pj_status_t rsock_enum_interface (int af, + unsigned *p_cnt, + pj_sockaddr ifs[]) +{ + TInt rc; + RSocket rSock; + TPckgBuf<TSoInetInterfaceInfo> info; + unsigned i; + + if (PjSymbianOS::Instance()->Connection()) { + + rc = rSock.Open (PjSymbianOS::Instance()->SocketServ(), + af, PJ_SOCK_DGRAM, KProtocolInetUdp, + *PjSymbianOS::Instance()->Connection()); + } else { + + rc = rSock.Open (PjSymbianOS::Instance()->SocketServ(), + af, PJ_SOCK_DGRAM, KProtocolInetUdp); + + } + + if (rc != KErrNone) + return PJ_RETURN_OS_ERROR (rc); + + rSock.SetOpt (KSoInetEnumInterfaces, KSolInetIfCtrl); + + for (i=0; i<*p_cnt && + rSock.GetOpt (KSoInetNextInterface, KSolInetIfCtrl, + info) == KErrNone;) { + TInetAddr &iAddress = info().iAddress; + int namelen; + +#if TRACE_ME + + if (1) { + pj_sockaddr a; + char ipaddr[PJ_INET6_ADDRSTRLEN+2]; + + namelen = sizeof (pj_sockaddr); + + if (PjSymbianOS::Addr2pj (iAddress, a, &namelen, + PJ_FALSE) == PJ_SUCCESS) { + PJ_LOG (5, (THIS_FILE, "Enum: found address %s", + pj_sockaddr_print (&a, ipaddr, sizeof (ipaddr), 2))); + } + } + +#endif + + namelen = sizeof (ifs[i]); + + if (PjSymbianOS::Addr2pj (iAddress, ifs[i], &namelen, + PJ_TRUE) != PJ_SUCCESS) { + continue; + } + + if (ifs[i].addr.sa_family != af) + continue; + + ++i; + } + + rSock.Close(); + + // Done + *p_cnt = i; + + return PJ_SUCCESS; +} + +/* + * Enumerate the local IP interface currently active in the host. + */ +PJ_DEF (pj_status_t) pj_enum_ip_interface (int af, + unsigned *p_cnt, + pj_sockaddr ifs[]) +{ + unsigned start; + pj_status_t status = PJ_SUCCESS; + + start = 0; + + /* Get IPv6 interface first. */ + + if (af==PJ_AF_INET6 || af==PJ_AF_UNSPEC) { + unsigned max = *p_cnt; + status = rsock_enum_interface (PJ_AF_INET6, &max, &ifs[start]); + + if (status == PJ_SUCCESS) { + (*p_cnt) -= max; + start += max; + } + } + + /* Get IPv4 interface. */ + if (af==PJ_AF_INET || af==PJ_AF_UNSPEC) { + unsigned max = *p_cnt; + status = rsock_enum_interface (PJ_AF_INET, &max, &ifs[start]); + + if (status == PJ_SUCCESS) { + (*p_cnt) -= max; + start += max; + } + } + + *p_cnt = start; + + return start ? PJ_SUCCESS : PJ_ENOTFOUND; +} + +/* + * Enumerate the IP routing table for this host. + */ +PJ_DEF (pj_status_t) pj_enum_ip_route (unsigned *p_cnt, + pj_ip_route_entry routes[]) +{ + PJ_ASSERT_RETURN (p_cnt && *p_cnt > 0 && routes, PJ_EINVAL); + *p_cnt = 0; + return PJ_ENOTSUP; +} + diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/ip_helper_win32.c b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/ip_helper_win32.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/ip_helper_win32.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/ip_helper_win32.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/list.c b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/list.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/list.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/list.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/lock.c b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/lock.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/lock.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/lock.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/log.c b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/log.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/log.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/log.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/log_writer_printk.c b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/log_writer_printk.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/log_writer_printk.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/log_writer_printk.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/log_writer_stdout.c b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/log_writer_stdout.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/log_writer_stdout.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/log_writer_stdout.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/log_writer_symbian_console.cpp b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/log_writer_symbian_console.cpp similarity index 78% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/log_writer_symbian_console.cpp rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/log_writer_symbian_console.cpp index 8f627cf149067127f7bf0402c0268f77f748361d..34d4a40254363c3c1b25142accf7622a4040f1da 100644 --- a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/log_writer_symbian_console.cpp +++ b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/log_writer_symbian_console.cpp @@ -1,5 +1,5 @@ /* $Id: log_writer_symbian_console.cpp 2394 2008-12-23 17:27:53Z bennylp $ */ -/* +/* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> * @@ -15,7 +15,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include <pj/log.h> #include <pj/os.h> @@ -24,21 +24,21 @@ #include "os_symbian.h" #include <e32cons.h> -PJ_DEF(void) pj_log_write(int level, const char *buffer, int len) +PJ_DEF (void) pj_log_write (int level, const char *buffer, int len) { #if 0 wchar_t wbuffer[PJ_LOG_MAX_SIZE]; CConsoleBase *cons = PjSymbianOS::Instance->Console(); - pj_ansi_to_unicode(buffer, len, wbuffer, PJ_ARRAY_SIZE(wbuffer)); + pj_ansi_to_unicode (buffer, len, wbuffer, PJ_ARRAY_SIZE (wbuffer)); - - TPtrC16 aPtr((TUint16*)wbuffer, len); - console->Write(aPtr); + + TPtrC16 aPtr ( (TUint16*) wbuffer, len); + console->Write (aPtr); #else - PJ_UNUSED_ARG(level); - PJ_UNUSED_ARG(buffer); - PJ_UNUSED_ARG(len); + PJ_UNUSED_ARG (level); + PJ_UNUSED_ARG (buffer); + PJ_UNUSED_ARG (len); #endif } diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/os_core_linux_kernel.c b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/os_core_linux_kernel.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/os_core_linux_kernel.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/os_core_linux_kernel.c diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/os_core_symbian.cpp b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/os_core_symbian.cpp new file mode 100644 index 0000000000000000000000000000000000000000..b7f44b7903047ac293c6149e595c274093b7315a --- /dev/null +++ b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/os_core_symbian.cpp @@ -0,0 +1,1043 @@ +/* $Id: os_core_symbian.cpp 2482 2009-03-02 15:50:12Z nanang $ */ +/* + * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) + * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> + * + * 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 + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include <pj/os.h> +#include <pj/assert.h> +#include <pj/pool.h> +#include <pj/log.h> +#include <pj/rand.h> +#include <pj/string.h> +#include <pj/guid.h> +#include <pj/except.h> +#include <pj/errno.h> + +#include "os_symbian.h" + + +#define PJ_MAX_TLS 32 +#define DUMMY_MUTEX ((pj_mutex_t*)101) +#define DUMMY_SEMAPHORE ((pj_sem_t*)102) +#define THIS_FILE "os_core_symbian.c" + +/* + * Note: + * + * The Symbian implementation does not support threading! + */ + +struct pj_thread_t { + char obj_name[PJ_MAX_OBJ_NAME]; + void *tls_values[PJ_MAX_TLS]; + +#if defined(PJ_OS_HAS_CHECK_STACK) && PJ_OS_HAS_CHECK_STACK!=0 + pj_uint32_t stk_size; + pj_uint32_t stk_max_usage; + char *stk_start; + const char *caller_file; + int caller_line; +#endif + +} main_thread; + +struct pj_atomic_t { + pj_atomic_value_t value; +}; + +struct pj_sem_t { + int value; + int max; +}; + +/* Flags to indicate which TLS variables have been used */ +static int tls_vars[PJ_MAX_TLS]; + +/* atexit handlers */ +static unsigned atexit_count; +static void (*atexit_func[32]) (void); + + + + +///////////////////////////////////////////////////////////////////////////// +// +// CPjTimeoutTimer implementation +// + +CPjTimeoutTimer::CPjTimeoutTimer() + : CActive (PJ_SYMBIAN_TIMER_PRIORITY), hasTimedOut_ (PJ_FALSE) +{ +} + +CPjTimeoutTimer::~CPjTimeoutTimer() +{ + Cancel(); + timer_.Close(); +} + +void CPjTimeoutTimer::ConstructL() +{ + hasTimedOut_ = PJ_FALSE; + timer_.CreateLocal(); + CActiveScheduler::Add (this); +} + +CPjTimeoutTimer *CPjTimeoutTimer::NewL() +{ + CPjTimeoutTimer *self = new CPjTimeoutTimer; + CleanupStack::PushL (self); + + self->ConstructL(); + + CleanupStack::Pop (self); + return self; + +} + +void CPjTimeoutTimer::StartTimer (TUint miliSeconds) +{ + Cancel(); + + hasTimedOut_ = PJ_FALSE; + timer_.After (iStatus, miliSeconds * 1000); + SetActive(); +} + +bool CPjTimeoutTimer::HasTimedOut() const +{ + return hasTimedOut_ != 0; +} + +void CPjTimeoutTimer::RunL() +{ + hasTimedOut_ = PJ_TRUE; +} + +void CPjTimeoutTimer::DoCancel() +{ + timer_.Cancel(); +} + +TInt CPjTimeoutTimer::RunError (TInt aError) +{ + PJ_UNUSED_ARG (aError); + return KErrNone; +} + + + +///////////////////////////////////////////////////////////////////////////// +// +// PjSymbianOS implementation +// + +PjSymbianOS::PjSymbianOS() + : isConnectionUp_ (false), + isSocketServInitialized_ (false), isResolverInitialized_ (false), + console_ (NULL), selectTimeoutTimer_ (NULL), + appSocketServ_ (NULL), appConnection_ (NULL), appHostResolver_ (NULL), + appHostResolver6_ (NULL) +{ +} + +// Set parameters +void PjSymbianOS::SetParameters (pj_symbianos_params *params) +{ + appSocketServ_ = (RSocketServ*) params->rsocketserv; + appConnection_ = (RConnection*) params->rconnection; + appHostResolver_ = (RHostResolver*) params->rhostresolver; + appHostResolver6_ = (RHostResolver*) params->rhostresolver6; +} + +// Get PjSymbianOS instance +PjSymbianOS *PjSymbianOS::Instance() +{ + static PjSymbianOS instance_; + return &instance_; +} + + +// Initialize +TInt PjSymbianOS::Initialize() +{ + TInt err; + + selectTimeoutTimer_ = CPjTimeoutTimer::NewL(); + +#if 0 + pj_assert (console_ == NULL); + TRAPD (err, console_ = Console::NewL (_L ("PJLIB"), + TSize (KConsFullScreen,KConsFullScreen))); + return err; +#endif + + /* Only create RSocketServ if application doesn't specify it + * in the parameters + */ + + if (!isSocketServInitialized_ && appSocketServ_ == NULL) { + err = socketServ_.Connect(); + + if (err != KErrNone) + goto on_error; + + isSocketServInitialized_ = true; + } + + if (!isResolverInitialized_) { + if (appHostResolver_ == NULL) { + if (Connection()) + err = hostResolver_.Open (SocketServ(), KAfInet, KSockStream, + *Connection()); + else + err = hostResolver_.Open (SocketServ(), KAfInet, KSockStream); + + if (err != KErrNone) + goto on_error; + } + +#if defined(PJ_HAS_IPV6) && PJ_HAS_IPV6!=0 + if (appHostResolver6_ == NULL) { + if (Connection()) + err = hostResolver6_.Open (SocketServ(), KAfInet6, KSockStream, + *Connection()); + else + err = hostResolver6_.Open (SocketServ(), KAfInet6, KSockStream); + + if (err != KErrNone) + goto on_error; + } + +#endif + + + isResolverInitialized_ = true; + } + + isConnectionUp_ = true; + + return KErrNone; + +on_error: + Shutdown(); + return err; +} + +// Shutdown +void PjSymbianOS::Shutdown() +{ + isConnectionUp_ = false; + + if (isResolverInitialized_) { + hostResolver_.Close(); +#if defined(PJ_HAS_IPV6) && PJ_HAS_IPV6!=0 + hostResolver6_.Close(); +#endif + isResolverInitialized_ = false; + } + + if (isSocketServInitialized_) { + socketServ_.Close(); + isSocketServInitialized_ = false; + } + + delete console_; + + console_ = NULL; + + delete selectTimeoutTimer_; + selectTimeoutTimer_ = NULL; + + appSocketServ_ = NULL; + appConnection_ = NULL; + appHostResolver_ = NULL; + appHostResolver6_ = NULL; +} + +// Convert to Unicode +TInt PjSymbianOS::ConvertToUnicode (TDes16 &aUnicode, const TDesC8 &aForeign) +{ +#if 0 + pj_assert (conv_ != NULL); + return conv_->ConvertToUnicode (aUnicode, aForeign, convToUnicodeState_); +#else + return CnvUtfConverter::ConvertToUnicodeFromUtf8 (aUnicode, aForeign); +#endif +} + +// Convert from Unicode +TInt PjSymbianOS::ConvertFromUnicode (TDes8 &aForeign, const TDesC16 &aUnicode) +{ +#if 0 + pj_assert (conv_ != NULL); + return conv_->ConvertFromUnicode (aForeign, aUnicode, convToAnsiState_); +#else + return CnvUtfConverter::ConvertFromUnicodeToUtf8 (aForeign, aUnicode); +#endif +} + + +///////////////////////////////////////////////////////////////////////////// +// +// PJLIB os.h implementation +// + +PJ_DEF (pj_uint32_t) pj_getpid (void) +{ + return 0; +} + + +/* Set Symbian specific parameters */ +PJ_DEF (pj_status_t) pj_symbianos_set_params (pj_symbianos_params *prm) +{ + PJ_ASSERT_RETURN (prm != NULL, PJ_EINVAL); + PjSymbianOS::Instance()->SetParameters (prm); + return PJ_SUCCESS; +} + + +/* Set connection status */ +PJ_DEF (void) pj_symbianos_set_connection_status (pj_bool_t up) +{ + PjSymbianOS::Instance()->SetConnectionStatus (up != 0); +} + + +/* + * pj_init(void). + * Init PJLIB! + */ +PJ_DEF (pj_status_t) pj_init (void) +{ + char stack_ptr; + pj_status_t status; + + pj_ansi_strcpy (main_thread.obj_name, "pjthread"); + + // Init main thread + pj_memset (&main_thread, 0, sizeof (main_thread)); + + // Initialize PjSymbianOS instance + PjSymbianOS *os = PjSymbianOS::Instance(); + + PJ_LOG (4, (THIS_FILE, "Initializing PJLIB for Symbian OS..")); + + TInt err; + err = os->Initialize(); + + if (err != KErrNone) + return PJ_RETURN_OS_ERROR (err); + + /* Initialize exception ID for the pool. + * Must do so after critical section is configured. + */ + status = pj_exception_id_alloc ("PJLIB/No memory", &PJ_NO_MEMORY_EXCEPTION); + + if (status != PJ_SUCCESS) + goto on_error; + +#if defined(PJ_OS_HAS_CHECK_STACK) && PJ_OS_HAS_CHECK_STACK!=0 + main_thread.stk_start = &stack_ptr; + + main_thread.stk_size = 0xFFFFFFFFUL; + + main_thread.stk_max_usage = 0; + +#else + stack_ptr = '\0'; + +#endif + + PJ_LOG (5, (THIS_FILE, "PJLIB initialized.")); + + return PJ_SUCCESS; + +on_error: + pj_shutdown(); + + return PJ_RETURN_OS_ERROR (err); +} + + +PJ_DEF (pj_status_t) pj_atexit (pj_exit_callback func) +{ + if (atexit_count >= PJ_ARRAY_SIZE (atexit_func)) + return PJ_ETOOMANY; + + atexit_func[atexit_count++] = func; + + return PJ_SUCCESS; +} + + + +PJ_DEF (void) pj_shutdown (void) +{ + /* Call atexit() functions */ + while (atexit_count > 0) { + (*atexit_func[atexit_count-1]) (); + --atexit_count; + } + + /* Free exception ID */ + if (PJ_NO_MEMORY_EXCEPTION != -1) { + pj_exception_id_free (PJ_NO_MEMORY_EXCEPTION); + PJ_NO_MEMORY_EXCEPTION = -1; + } + + /* Clear static variables */ + pj_errno_clear_handlers(); + + PjSymbianOS *os = PjSymbianOS::Instance(); + + os->Shutdown(); +} + +///////////////////////////////////////////////////////////////////////////// + +class CPollTimeoutTimer : public CActive +{ + + public: + static CPollTimeoutTimer* NewL (int msec, TInt prio); + ~CPollTimeoutTimer(); + + virtual void RunL(); + virtual void DoCancel(); + + private: + RTimer rtimer_; + + explicit CPollTimeoutTimer (TInt prio); + void ConstructL (int msec); +}; + +CPollTimeoutTimer::CPollTimeoutTimer (TInt prio) + : CActive (prio) +{ +} + + +CPollTimeoutTimer::~CPollTimeoutTimer() +{ + rtimer_.Close(); +} + +void CPollTimeoutTimer::ConstructL (int msec) +{ + rtimer_.CreateLocal(); + CActiveScheduler::Add (this); + rtimer_.After (iStatus, msec*1000); + SetActive(); +} + +CPollTimeoutTimer* CPollTimeoutTimer::NewL (int msec, TInt prio) +{ + CPollTimeoutTimer *self = new CPollTimeoutTimer (prio); + CleanupStack::PushL (self); + self->ConstructL (msec); + CleanupStack::Pop (self); + + return self; +} + +void CPollTimeoutTimer::RunL() +{ +} + +void CPollTimeoutTimer::DoCancel() +{ + rtimer_.Cancel(); +} + + +/* + * Wait the completion of any Symbian active objects. + */ +PJ_DEF (pj_bool_t) pj_symbianos_poll (int priority, int ms_timeout) +{ + CPollTimeoutTimer *timer = NULL; + + if (priority==-1) + priority = EPriorityNull; + + if (ms_timeout >= 0) { + timer = CPollTimeoutTimer::NewL (ms_timeout, priority); + } + + PjSymbianOS::Instance()->WaitForActiveObjects (priority); + + if (timer) { + bool timer_is_active = timer->IsActive(); + + timer->Cancel(); + + delete timer; + + return timer_is_active ? PJ_TRUE : PJ_FALSE; + + } else { + return PJ_TRUE; + } +} + + +/* + * pj_thread_is_registered() + */ +PJ_DEF (pj_bool_t) pj_thread_is_registered (void) +{ + return PJ_FALSE; +} + + +/* + * Get thread priority value for the thread. + */ +PJ_DEF (int) pj_thread_get_prio (pj_thread_t *thread) +{ + PJ_UNUSED_ARG (thread); + return 1; +} + + +/* + * Set the thread priority. + */ +PJ_DEF (pj_status_t) pj_thread_set_prio (pj_thread_t *thread, int prio) +{ + PJ_UNUSED_ARG (thread); + PJ_UNUSED_ARG (prio); + return PJ_SUCCESS; +} + + +/* + * Get the lowest priority value available on this system. + */ +PJ_DEF (int) pj_thread_get_prio_min (pj_thread_t *thread) +{ + PJ_UNUSED_ARG (thread); + return 1; +} + + +/* + * Get the highest priority value available on this system. + */ +PJ_DEF (int) pj_thread_get_prio_max (pj_thread_t *thread) +{ + PJ_UNUSED_ARG (thread); + return 1; +} + + +/* + * pj_thread_get_os_handle() + */ +PJ_DEF (void*) pj_thread_get_os_handle (pj_thread_t *thread) +{ + PJ_UNUSED_ARG (thread); + return NULL; +} + +/* + * pj_thread_register(..) + */ +PJ_DEF (pj_status_t) pj_thread_register (const char *cstr_thread_name, + pj_thread_desc desc, + pj_thread_t **thread_ptr) +{ + PJ_UNUSED_ARG (cstr_thread_name); + PJ_UNUSED_ARG (desc); + PJ_UNUSED_ARG (thread_ptr); + return PJ_EINVALIDOP; +} + + +/* + * pj_thread_create(...) + */ +PJ_DEF (pj_status_t) pj_thread_create (pj_pool_t *pool, + const char *thread_name, + pj_thread_proc *proc, + void *arg, + pj_size_t stack_size, + unsigned flags, + pj_thread_t **ptr_thread) +{ + PJ_UNUSED_ARG (pool); + PJ_UNUSED_ARG (thread_name); + PJ_UNUSED_ARG (proc); + PJ_UNUSED_ARG (arg); + PJ_UNUSED_ARG (stack_size); + PJ_UNUSED_ARG (flags); + PJ_UNUSED_ARG (ptr_thread); + + /* Sorry mate, we don't support threading */ + return PJ_ENOTSUP; +} + +/* + * pj_thread-get_name() + */ +PJ_DEF (const char*) pj_thread_get_name (pj_thread_t *p) +{ + pj_assert (p == &main_thread); + return p->obj_name; +} + +/* + * pj_thread_resume() + */ +PJ_DEF (pj_status_t) pj_thread_resume (pj_thread_t *p) +{ + PJ_UNUSED_ARG (p); + return PJ_EINVALIDOP; +} + +/* + * pj_thread_this() + */ +PJ_DEF (pj_thread_t*) pj_thread_this (void) +{ + return &main_thread; +} + +/* + * pj_thread_join() + */ +PJ_DEF (pj_status_t) pj_thread_join (pj_thread_t *rec) +{ + PJ_UNUSED_ARG (rec); + return PJ_EINVALIDOP; +} + +/* + * pj_thread_destroy() + */ +PJ_DEF (pj_status_t) pj_thread_destroy (pj_thread_t *rec) +{ + PJ_UNUSED_ARG (rec); + return PJ_EINVALIDOP; +} + +/* + * pj_thread_sleep() + */ +PJ_DEF (pj_status_t) pj_thread_sleep (unsigned msec) +{ + User::After (msec*1000); + + return PJ_SUCCESS; +} + + +/////////////////////////////////////////////////////////////////////////////// +/* + * pj_thread_local_alloc() + */ + +PJ_DEF (pj_status_t) pj_thread_local_alloc (long *index) +{ + unsigned i; + + /* Find unused TLS variable */ + + for (i=0; i<PJ_ARRAY_SIZE (tls_vars); ++i) { + if (tls_vars[i] == 0) + break; + } + + if (i == PJ_ARRAY_SIZE (tls_vars)) + return PJ_ETOOMANY; + + tls_vars[i] = 1; + + *index = i; + + return PJ_SUCCESS; +} + +/* + * pj_thread_local_free() + */ +PJ_DEF (void) pj_thread_local_free (long index) +{ + PJ_ASSERT_ON_FAIL (index >= 0 && index < (int) PJ_ARRAY_SIZE (tls_vars) && + tls_vars[index] != 0, return); + + tls_vars[index] = 0; +} + + +/* + * pj_thread_local_set() + */ +PJ_DEF (pj_status_t) pj_thread_local_set (long index, void *value) +{ + pj_thread_t *rec = pj_thread_this(); + + PJ_ASSERT_RETURN (index >= 0 && index < (int) PJ_ARRAY_SIZE (tls_vars) && + tls_vars[index] != 0, PJ_EINVAL); + + rec->tls_values[index] = value; + return PJ_SUCCESS; +} + +/* + * pj_thread_local_get() + */ +PJ_DEF (void*) pj_thread_local_get (long index) +{ + pj_thread_t *rec = pj_thread_this(); + + PJ_ASSERT_RETURN (index >= 0 && index < (int) PJ_ARRAY_SIZE (tls_vars) && + tls_vars[index] != 0, NULL); + + return rec->tls_values[index]; +} + + +/////////////////////////////////////////////////////////////////////////////// +/* + * Create atomic variable. + */ +PJ_DEF (pj_status_t) pj_atomic_create (pj_pool_t *pool, + pj_atomic_value_t initial, + pj_atomic_t **atomic) +{ + *atomic = (pj_atomic_t*) pj_pool_alloc (pool, sizeof (struct pj_atomic_t)); + (*atomic)->value = initial; + return PJ_SUCCESS; +} + + +/* + * Destroy atomic variable. + */ +PJ_DEF (pj_status_t) pj_atomic_destroy (pj_atomic_t *atomic_var) +{ + PJ_UNUSED_ARG (atomic_var); + return PJ_SUCCESS; +} + + +/* + * Set the value of an atomic type, and return the previous value. + */ +PJ_DEF (void) pj_atomic_set (pj_atomic_t *atomic_var, + pj_atomic_value_t value) +{ + atomic_var->value = value; +} + + +/* + * Get the value of an atomic type. + */ +PJ_DEF (pj_atomic_value_t) pj_atomic_get (pj_atomic_t *atomic_var) +{ + return atomic_var->value; +} + + +/* + * Increment the value of an atomic type. + */ +PJ_DEF (void) pj_atomic_inc (pj_atomic_t *atomic_var) +{ + ++atomic_var->value; +} + + +/* + * Increment the value of an atomic type and get the result. + */ +PJ_DEF (pj_atomic_value_t) pj_atomic_inc_and_get (pj_atomic_t *atomic_var) +{ + return ++atomic_var->value; +} + + +/* + * Decrement the value of an atomic type. + */ +PJ_DEF (void) pj_atomic_dec (pj_atomic_t *atomic_var) +{ + --atomic_var->value; +} + + +/* + * Decrement the value of an atomic type and get the result. + */ +PJ_DEF (pj_atomic_value_t) pj_atomic_dec_and_get (pj_atomic_t *atomic_var) +{ + return --atomic_var->value; +} + + +/* + * Add a value to an atomic type. + */ +PJ_DEF (void) pj_atomic_add (pj_atomic_t *atomic_var, + pj_atomic_value_t value) +{ + atomic_var->value += value; +} + + +/* + * Add a value to an atomic type and get the result. + */ +PJ_DEF (pj_atomic_value_t) pj_atomic_add_and_get (pj_atomic_t *atomic_var, + pj_atomic_value_t value) +{ + atomic_var->value += value; + return atomic_var->value; +} + + + +///////////////////////////////////////////////////////////////////////////// + +PJ_DEF (pj_status_t) pj_mutex_create (pj_pool_t *pool, + const char *name, + int type, + pj_mutex_t **mutex) +{ + PJ_UNUSED_ARG (pool); + PJ_UNUSED_ARG (name); + PJ_UNUSED_ARG (type); + + *mutex = DUMMY_MUTEX; + return PJ_SUCCESS; +} + +/* + * pj_mutex_create_simple() + */ +PJ_DEF (pj_status_t) pj_mutex_create_simple (pj_pool_t *pool, + const char *name, + pj_mutex_t **mutex) +{ + return pj_mutex_create (pool, name, PJ_MUTEX_SIMPLE, mutex); +} + + +PJ_DEF (pj_status_t) pj_mutex_create_recursive (pj_pool_t *pool, + const char *name, + pj_mutex_t **mutex) +{ + return pj_mutex_create (pool, name, PJ_MUTEX_RECURSE, mutex); +} + + +/* + * pj_mutex_lock() + */ +PJ_DEF (pj_status_t) pj_mutex_lock (pj_mutex_t *mutex) +{ + pj_assert (mutex == DUMMY_MUTEX); + return PJ_SUCCESS; +} + +/* + * pj_mutex_trylock() + */ +PJ_DEF (pj_status_t) pj_mutex_trylock (pj_mutex_t *mutex) +{ + pj_assert (mutex == DUMMY_MUTEX); + return PJ_SUCCESS; +} + +/* + * pj_mutex_unlock() + */ +PJ_DEF (pj_status_t) pj_mutex_unlock (pj_mutex_t *mutex) +{ + pj_assert (mutex == DUMMY_MUTEX); + return PJ_SUCCESS; +} + +/* + * pj_mutex_destroy() + */ +PJ_DEF (pj_status_t) pj_mutex_destroy (pj_mutex_t *mutex) +{ + pj_assert (mutex == DUMMY_MUTEX); + return PJ_SUCCESS; +} + + +///////////////////////////////////////////////////////////////////////////// +/* + * RW Mutex + */ +#include "os_rwmutex.c" + + +///////////////////////////////////////////////////////////////////////////// + +/* + * Enter critical section. + */ +PJ_DEF (void) pj_enter_critical_section (void) +{ + /* Nothing to do */ +} + + +/* + * Leave critical section. + */ +PJ_DEF (void) pj_leave_critical_section (void) +{ + /* Nothing to do */ +} + + +///////////////////////////////////////////////////////////////////////////// + +/* + * Create semaphore. + */ +PJ_DEF (pj_status_t) pj_sem_create (pj_pool_t *pool, + const char *name, + unsigned initial, + unsigned max, + pj_sem_t **p_sem) +{ + pj_sem_t *sem; + + PJ_UNUSED_ARG (name); + + sem = (pj_sem_t*) pj_pool_zalloc (pool, sizeof (pj_sem_t)); + sem->value = initial; + sem->max = max; + + *p_sem = sem; + + return PJ_SUCCESS; +} + + +/* + * Wait for semaphore. + */ +PJ_DEF (pj_status_t) pj_sem_wait (pj_sem_t *sem) +{ + if (sem->value > 0) { + sem->value--; + return PJ_SUCCESS; + } else { + pj_assert (!"Unexpected!"); + return PJ_EINVALIDOP; + } +} + + +/* + * Try wait for semaphore. + */ +PJ_DEF (pj_status_t) pj_sem_trywait (pj_sem_t *sem) +{ + if (sem->value > 0) { + sem->value--; + return PJ_SUCCESS; + } else { + pj_assert (!"Unexpected!"); + return PJ_EINVALIDOP; + } +} + + +/* + * Release semaphore. + */ +PJ_DEF (pj_status_t) pj_sem_post (pj_sem_t *sem) +{ + sem->value++; + return PJ_SUCCESS; +} + + +/* + * Destroy semaphore. + */ +PJ_DEF (pj_status_t) pj_sem_destroy (pj_sem_t *sem) +{ + PJ_UNUSED_ARG (sem); + return PJ_SUCCESS; +} + + +#if defined(PJ_OS_HAS_CHECK_STACK) && PJ_OS_HAS_CHECK_STACK != 0 +/* + * The implementation of stack checking. + */ +PJ_DEF (void) pj_thread_check_stack (const char *file, int line) +{ + char stk_ptr; + pj_uint32_t usage; + pj_thread_t *thread = pj_thread_this(); + + pj_assert (thread); + + /* Calculate current usage. */ + usage = (&stk_ptr > thread->stk_start) ? &stk_ptr - thread->stk_start : + thread->stk_start - &stk_ptr; + + /* Assert if stack usage is dangerously high. */ + pj_assert ("STACK OVERFLOW!! " && (usage <= thread->stk_size - 128)); + + /* Keep statistic. */ + + if (usage > thread->stk_max_usage) { + thread->stk_max_usage = usage; + thread->caller_file = file; + thread->caller_line = line; + } +} + +/* + * Get maximum stack usage statistic. + */ +PJ_DEF (pj_uint32_t) pj_thread_get_stack_max_usage (pj_thread_t *thread) +{ + return thread->stk_max_usage; +} + +/* + * Dump thread stack status. + */ +PJ_DEF (pj_status_t) pj_thread_get_stack_info (pj_thread_t *thread, + const char **file, + int *line) +{ + pj_assert (thread); + + *file = thread->caller_file; + *line = thread->caller_line; + return 0; +} + +#endif /* PJ_OS_HAS_CHECK_STACK */ diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/os_core_unix.c b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/os_core_unix.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/os_core_unix.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/os_core_unix.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/os_core_win32.c b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/os_core_win32.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/os_core_win32.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/os_core_win32.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/os_error_linux_kernel.c b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/os_error_linux_kernel.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/os_error_linux_kernel.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/os_error_linux_kernel.c diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/os_error_symbian.cpp b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/os_error_symbian.cpp new file mode 100644 index 0000000000000000000000000000000000000000..bb57cd9663c507be0d5feb5c3368a99843db3bae --- /dev/null +++ b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/os_error_symbian.cpp @@ -0,0 +1,179 @@ +/* $Id: os_error_symbian.cpp 2394 2008-12-23 17:27:53Z bennylp $ */ +/* + * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) + * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> + * + * 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 + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#include <pj/errno.h> +#include <pj/assert.h> +#include <pj/compat/stdarg.h> +#include <pj/unicode.h> +#include <pj/string.h> + +#include <e32err.h> +#include <in_sock.h> + + +#if defined(PJ_HAS_ERROR_STRING) && (PJ_HAS_ERROR_STRING!=0) + +static const struct { + pj_os_err_type code; + const char *msg; +} gaErrorList[] = { + + /* + * Generic error -1 to -46 + */ + PJ_BUILD_ERR (KErrNotFound, "Unable to find the specified object"), + PJ_BUILD_ERR (KErrGeneral, "General (unspecified) error"), + PJ_BUILD_ERR (KErrCancel, "The operation was cancelled"), + PJ_BUILD_ERR (KErrNoMemory, "Not enough memory"), + PJ_BUILD_ERR (KErrNotSupported, "The operation requested is not supported"), + PJ_BUILD_ERR (KErrArgument, "Bad request"), + PJ_BUILD_ERR (KErrTotalLossOfPrecision, "Total loss of precision"), + PJ_BUILD_ERR (KErrBadHandle, "Bad object"), + PJ_BUILD_ERR (KErrOverflow, "Overflow"), + PJ_BUILD_ERR (KErrUnderflow, "Underflow"), + PJ_BUILD_ERR (KErrAlreadyExists,"Already exists"), + PJ_BUILD_ERR (KErrPathNotFound, "Unable to find the specified folder"), + PJ_BUILD_ERR (KErrDied, "Closed"), + PJ_BUILD_ERR (KErrInUse, "The specified object is currently in use by another program"), + PJ_BUILD_ERR (KErrServerTerminated, "Server has closed"), + PJ_BUILD_ERR (KErrServerBusy, "Server busy"), + PJ_BUILD_ERR (KErrCompletion, "Completion error"), + PJ_BUILD_ERR (KErrNotReady, "Not ready"), + PJ_BUILD_ERR (KErrUnknown, "Unknown error"), + PJ_BUILD_ERR (KErrCorrupt, "Corrupt"), + PJ_BUILD_ERR (KErrAccessDenied, "Access denied"), + PJ_BUILD_ERR (KErrLocked, "Locked"), + PJ_BUILD_ERR (KErrWrite, "Failed to write"), + PJ_BUILD_ERR (KErrDisMounted, "Wrong disk present"), + PJ_BUILD_ERR (KErrEof, "Unexpected end of file"), + PJ_BUILD_ERR (KErrDiskFull, "Disk full"), + PJ_BUILD_ERR (KErrBadDriver, "Bad device driver"), + PJ_BUILD_ERR (KErrBadName, "Bad name"), + PJ_BUILD_ERR (KErrCommsLineFail,"Comms line failed"), + PJ_BUILD_ERR (KErrCommsFrame, "Comms frame error"), + PJ_BUILD_ERR (KErrCommsOverrun, "Comms overrun error"), + PJ_BUILD_ERR (KErrCommsParity, "Comms parity error"), + PJ_BUILD_ERR (KErrTimedOut, "Timed out"), + PJ_BUILD_ERR (KErrCouldNotConnect, "Failed to connect"), + PJ_BUILD_ERR (KErrCouldNotDisconnect, "Failed to disconnect"), + PJ_BUILD_ERR (KErrDisconnected, "Disconnected"), + PJ_BUILD_ERR (KErrBadLibraryEntryPoint, "Bad library entry point"), + PJ_BUILD_ERR (KErrBadDescriptor,"Bad descriptor"), + PJ_BUILD_ERR (KErrAbort, "Interrupted"), + PJ_BUILD_ERR (KErrTooBig, "Too big"), + PJ_BUILD_ERR (KErrDivideByZero, "Divide by zero"), + PJ_BUILD_ERR (KErrBadPower, "Batteries too low"), + PJ_BUILD_ERR (KErrDirFull, "Folder full"), + PJ_BUILD_ERR (KErrHardwareNotAvailable, ""), + PJ_BUILD_ERR (KErrSessionClosed, ""), + PJ_BUILD_ERR (KErrPermissionDenied, ""), + + /* + * Socket errors (-190 - -1000) + */ + PJ_BUILD_ERR (KErrNetUnreach, "Could not connect to the network. Currently unreachable"), + PJ_BUILD_ERR (KErrHostUnreach, "Could not connect to the specified server"), + PJ_BUILD_ERR (KErrNoProtocolOpt,"The specified server refuses the selected protocol"), + PJ_BUILD_ERR (KErrUrgentData, ""), + PJ_BUILD_ERR (KErrWouldBlock, "Conflicts with KErrExtended, but cannot occur in practice"), + + {0, NULL} +}; + +#endif /* PJ_HAS_ERROR_STRING */ + + +PJ_DEF (pj_status_t) pj_get_os_error (void) +{ + return -1; +} + +PJ_DEF (void) pj_set_os_error (pj_status_t code) +{ + PJ_UNUSED_ARG (code); +} + +PJ_DEF (pj_status_t) pj_get_netos_error (void) +{ + return -1; +} + +PJ_DEF (void) pj_set_netos_error (pj_status_t code) +{ + PJ_UNUSED_ARG (code); +} + +PJ_BEGIN_DECL + +PJ_DECL (int) platform_strerror (pj_os_err_type os_errcode, + char *buf, pj_size_t bufsize); +PJ_END_DECL + +/* + * platform_strerror() + * + * Platform specific error message. This file is called by pj_strerror() + * in errno.c + */ +PJ_DEF (int) platform_strerror (pj_os_err_type os_errcode, + char *buf, pj_size_t bufsize) +{ + int len = 0; + + pj_assert (buf != NULL); + pj_assert (bufsize >= 0); + + /* + * MUST NOT check stack here. + * This function might be called from PJ_CHECK_STACK() itself! + //PJ_CHECK_STACK(); + */ + + if (!len) { +#if defined(PJ_HAS_ERROR_STRING) && (PJ_HAS_ERROR_STRING!=0) + int i; + + for (i = 0; gaErrorList[i].msg; ++i) { + if (gaErrorList[i].code == os_errcode) { + len = strlen (gaErrorList[i].msg); + + if ( (pj_size_t) len >= bufsize) { + len = bufsize-1; + } + + pj_memcpy (buf, gaErrorList[i].msg, len); + + buf[len] = '\0'; + break; + } + } + +#endif /* PJ_HAS_ERROR_STRING */ + + } + + if (!len) { + len = pj_ansi_snprintf (buf, bufsize, "Symbian native error %d", + os_errcode); + buf[len] = '\0'; + } + + return len; +} + diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/os_error_unix.c b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/os_error_unix.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/os_error_unix.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/os_error_unix.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/os_error_win32.c b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/os_error_win32.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/os_error_win32.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/os_error_win32.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/os_rwmutex.c b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/os_rwmutex.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/os_rwmutex.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/os_rwmutex.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/os_symbian.h b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/os_symbian.h similarity index 91% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/os_symbian.h rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/os_symbian.h index f7f722bbb9b55cbc45e0e3fb82ebf552f8d423e7..9c01516fa7cf9ef09b80e34513e7ab6df90841d3 100644 --- a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/os_symbian.h +++ b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/os_symbian.h @@ -1,4 +1,4 @@ -/* $Id: os_symbian.h 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: os_symbian.h 2482 2009-03-02 15:50:12Z nanang $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -313,6 +313,21 @@ public: } } + // + // Return true if the access point connection is up + // + bool IsConnectionUp() const + { + return isConnectionUp_; + } + + // + // Set access point connection status + // + void SetConnectionStatus(bool up) + { + isConnectionUp_ = up; + } // // Unicode Converter @@ -353,6 +368,8 @@ public: } private: + bool isConnectionUp_; + bool isSocketServInitialized_; RSocketServ socketServ_; @@ -374,6 +391,17 @@ private: PjSymbianOS(); }; +// This macro is used to check the access point connection status and return +// failure if the AP connection is down or unusable. See the documentation +// of pj_symbianos_set_connection_status() for more info +#define PJ_SYMBIAN_CHECK_CONNECTION() \ + PJ_SYMBIAN_CHECK_CONNECTION2(PJ_ECANCELLED) + +#define PJ_SYMBIAN_CHECK_CONNECTION2(retval) \ + do { \ + if (!PjSymbianOS::Instance()->IsConnectionUp()) \ + return retval; \ + } while (0); #endif /* __OS_SYMBIAN_H__ */ diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/os_time_bsd.c b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/os_time_bsd.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/os_time_bsd.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/os_time_bsd.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/os_time_common.c b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/os_time_common.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/os_time_common.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/os_time_common.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/os_time_linux_kernel.c b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/os_time_linux_kernel.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/os_time_linux_kernel.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/os_time_linux_kernel.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/os_time_unix.c b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/os_time_unix.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/os_time_unix.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/os_time_unix.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/os_time_win32.c b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/os_time_win32.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/os_time_win32.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/os_time_win32.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/os_timestamp_common.c b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/os_timestamp_common.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/os_timestamp_common.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/os_timestamp_common.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/os_timestamp_linux_kernel.c b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/os_timestamp_linux_kernel.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/os_timestamp_linux_kernel.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/os_timestamp_linux_kernel.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/os_timestamp_posix.c b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/os_timestamp_posix.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/os_timestamp_posix.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/os_timestamp_posix.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/os_timestamp_win32.c b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/os_timestamp_win32.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/os_timestamp_win32.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/os_timestamp_win32.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/pool.c b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/pool.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/pool.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/pool.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/pool_buf.c b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/pool_buf.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/pool_buf.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/pool_buf.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/pool_caching.c b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/pool_caching.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/pool_caching.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/pool_caching.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/pool_dbg.c b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/pool_dbg.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/pool_dbg.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/pool_dbg.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/pool_policy_kmalloc.c b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/pool_policy_kmalloc.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/pool_policy_kmalloc.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/pool_policy_kmalloc.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/pool_policy_malloc.c b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/pool_policy_malloc.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/pool_policy_malloc.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/pool_policy_malloc.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/pool_policy_new.cpp b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/pool_policy_new.cpp similarity index 65% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/pool_policy_new.cpp rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/pool_policy_new.cpp index e22040a2f42be5a2f401f2a8a9b3dffd6c305919..6f99c068c3beede2da7c6348c89476cf1e20851b 100644 --- a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/pool_policy_new.cpp +++ b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/pool_policy_new.cpp @@ -1,5 +1,5 @@ /* $Id: pool_policy_new.cpp 2394 2008-12-23 17:27:53Z bennylp $ */ -/* +/* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> * @@ -15,7 +15,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include <pj/pool.h> #include <pj/except.h> @@ -27,76 +27,78 @@ * This file contains pool default policy definition and implementation. */ #include "pool_signature.h" - -static void *operator_new(pj_pool_factory *factory, pj_size_t size) + +static void *operator_new (pj_pool_factory *factory, pj_size_t size) { void *mem; PJ_CHECK_STACK(); if (factory->on_block_alloc) { - int rc; - rc = factory->on_block_alloc(factory, size); - if (!rc) - return NULL; + int rc; + rc = factory->on_block_alloc (factory, size); + + if (!rc) + return NULL; } - - mem = (void*) new char[size+(SIG_SIZE << 1)]; - + + mem = (void*) new char[size+ (SIG_SIZE << 1) ]; + /* Exception for new operator may be disabled, so.. */ + if (mem) { - /* Apply signature when PJ_SAFE_POOL is set. It will move - * "mem" pointer forward. - */ - APPLY_SIG(mem, size); + /* Apply signature when PJ_SAFE_POOL is set. It will move + * "mem" pointer forward. + */ + APPLY_SIG (mem, size); } return mem; } -static void operator_delete(pj_pool_factory *factory, void *mem, pj_size_t size) +static void operator_delete (pj_pool_factory *factory, void *mem, pj_size_t size) { PJ_CHECK_STACK(); - if (factory->on_block_free) - factory->on_block_free(factory, size); - + if (factory->on_block_free) + factory->on_block_free (factory, size); + /* Check and remove signature when PJ_SAFE_POOL is set. It will * move "mem" pointer backward. */ - REMOVE_SIG(mem, size); + REMOVE_SIG (mem, size); /* Note that when PJ_SAFE_POOL is set, the actual size of the block * is size + SIG_SIZE*2. */ - char *p = (char*)mem; + char *p = (char*) mem; + delete [] p; } -static void default_pool_callback(pj_pool_t *pool, pj_size_t size) +static void default_pool_callback (pj_pool_t *pool, pj_size_t size) { PJ_CHECK_STACK(); - PJ_UNUSED_ARG(pool); - PJ_UNUSED_ARG(size); + PJ_UNUSED_ARG (pool); + PJ_UNUSED_ARG (size); - PJ_THROW(PJ_NO_MEMORY_EXCEPTION); + PJ_THROW (PJ_NO_MEMORY_EXCEPTION); } -PJ_DEF_DATA(pj_pool_factory_policy) pj_pool_factory_default_policy = -{ +PJ_DEF_DATA (pj_pool_factory_policy) pj_pool_factory_default_policy = { &operator_new, &operator_delete, &default_pool_callback, 0 }; -PJ_DEF(const pj_pool_factory_policy*) pj_pool_factory_get_default_policy(void) +PJ_DEF (const pj_pool_factory_policy*) pj_pool_factory_get_default_policy (void) { return &pj_pool_factory_default_policy; } - + #endif /* PJ_HAS_POOL_ALT_API */ diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/pool_signature.h b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/pool_signature.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/pool_signature.h rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/pool_signature.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/rand.c b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/rand.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/rand.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/rand.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/rbtree.c b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/rbtree.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/rbtree.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/rbtree.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/sock_bsd.c b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/sock_bsd.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/sock_bsd.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/sock_bsd.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/sock_common.c b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/sock_common.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/sock_common.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/sock_common.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/sock_linux_kernel.c b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/sock_linux_kernel.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/sock_linux_kernel.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/sock_linux_kernel.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/sock_select.c b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/sock_select.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/sock_select.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/sock_select.c diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/sock_select_symbian.cpp b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/sock_select_symbian.cpp new file mode 100644 index 0000000000000000000000000000000000000000..48170ff6d014141c1914aa352a001d1e17eaf021 --- /dev/null +++ b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/sock_select_symbian.cpp @@ -0,0 +1,166 @@ +/* $Id: sock_select_symbian.cpp 2394 2008-12-23 17:27:53Z bennylp $ */ +/* + * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) + * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> + * + * 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 + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#include <pj/sock_select.h> +#include <pj/array.h> +#include <pj/assert.h> +#include <pj/os.h> +#include "os_symbian.h" + + +struct symbian_fd_set { + unsigned count; + CPjSocket *sock[PJ_IOQUEUE_MAX_HANDLES]; +}; + + +PJ_DEF (void) PJ_FD_ZERO (pj_fd_set_t *fdsetp) +{ + symbian_fd_set *fds = (symbian_fd_set *) fdsetp; + fds->count = 0; +} + + +PJ_DEF (void) PJ_FD_SET (pj_sock_t fd, pj_fd_set_t *fdsetp) +{ + symbian_fd_set *fds = (symbian_fd_set *) fdsetp; + + PJ_ASSERT_ON_FAIL (fds->count < PJ_IOQUEUE_MAX_HANDLES, return); + fds->sock[fds->count++] = (CPjSocket*) fd; +} + + +PJ_DEF (void) PJ_FD_CLR (pj_sock_t fd, pj_fd_set_t *fdsetp) +{ + symbian_fd_set *fds = (symbian_fd_set *) fdsetp; + unsigned i; + + for (i=0; i<fds->count; ++i) { + if (fds->sock[i] == (CPjSocket*) fd) { + pj_array_erase (fds->sock, sizeof (fds->sock[0]), fds->count, i); + --fds->count; + return; + } + } +} + + +PJ_DEF (pj_bool_t) PJ_FD_ISSET (pj_sock_t fd, const pj_fd_set_t *fdsetp) +{ + symbian_fd_set *fds = (symbian_fd_set *) fdsetp; + unsigned i; + + for (i=0; i<fds->count; ++i) { + if (fds->sock[i] == (CPjSocket*) fd) { + return PJ_TRUE; + } + } + + return PJ_FALSE; +} + +PJ_DEF (pj_size_t) PJ_FD_COUNT (const pj_fd_set_t *fdsetp) +{ + symbian_fd_set *fds = (symbian_fd_set *) fdsetp; + return fds->count; +} + + +PJ_DEF (int) pj_sock_select (int n, + pj_fd_set_t *readfds, + pj_fd_set_t *writefds, + pj_fd_set_t *exceptfds, + const pj_time_val *timeout) +{ + CPjTimeoutTimer *pjTimer; + unsigned i; + + PJ_UNUSED_ARG (n); + PJ_UNUSED_ARG (writefds); + PJ_UNUSED_ARG (exceptfds); + + if (timeout) { + pjTimer = PjSymbianOS::Instance()->SelectTimeoutTimer(); + pjTimer->StartTimer (timeout->sec*1000 + timeout->msec); + + } else { + pjTimer = NULL; + } + + /* Scan for readable sockets */ + + if (readfds) { + symbian_fd_set *fds = (symbian_fd_set *) readfds; + + do { + /* Scan sockets for readily available data */ + for (i=0; i<fds->count; ++i) { + CPjSocket *pjsock = fds->sock[i]; + + if (pjsock->Reader()) { + if (pjsock->Reader()->HasData() && !pjsock->Reader()->IsActive()) { + + /* Found socket with data ready */ + PJ_FD_ZERO (readfds); + PJ_FD_SET ( (pj_sock_t) pjsock, readfds); + + /* Cancel timer, if any */ + + if (pjTimer) { + pjTimer->Cancel(); + } + + /* Clear writable and exception fd_set */ + if (writefds) + PJ_FD_ZERO (writefds); + + if (exceptfds) + PJ_FD_ZERO (exceptfds); + + return 1; + + } else if (!pjsock->Reader()->IsActive()) + pjsock->Reader()->StartRecvFrom(); + + } else { + pjsock->CreateReader(); + pjsock->Reader()->StartRecvFrom(); + } + } + + PjSymbianOS::Instance()->WaitForActiveObjects(); + + } while (pjTimer==NULL || !pjTimer->HasTimedOut()); + } + + + /* Timeout */ + + if (readfds) + PJ_FD_ZERO (readfds); + + if (writefds) + PJ_FD_ZERO (writefds); + + if (exceptfds) + PJ_FD_ZERO (exceptfds); + + return 0; +} + diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/sock_symbian.cpp b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/sock_symbian.cpp new file mode 100644 index 0000000000000000000000000000000000000000..29858afab1d4485e6f476eb7c5d506f7ca57bfe1 --- /dev/null +++ b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/sock_symbian.cpp @@ -0,0 +1,1045 @@ +/* $Id: sock_symbian.cpp 2482 2009-03-02 15:50:12Z nanang $ */ +/* + * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) + * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> + * + * 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 + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#include <pj/sock.h> +#include <pj/addr_resolv.h> +#include <pj/assert.h> +#include <pj/errno.h> +#include <pj/os.h> +#include <pj/string.h> +#include <pj/unicode.h> + +#include "os_symbian.h" + + +/* + * Address families. + */ +const pj_uint16_t PJ_AF_UNSPEC = KAFUnspec; +const pj_uint16_t PJ_AF_UNIX = 0xFFFF; +const pj_uint16_t PJ_AF_INET = KAfInet; +const pj_uint16_t PJ_AF_INET6 = KAfInet6; +const pj_uint16_t PJ_AF_PACKET = 0xFFFF; +const pj_uint16_t PJ_AF_IRDA = 0xFFFF; + +/* + * Socket types conversion. + * The values here are indexed based on pj_sock_type + */ +const pj_uint16_t PJ_SOCK_STREAM= KSockStream; +const pj_uint16_t PJ_SOCK_DGRAM = KSockDatagram; +const pj_uint16_t PJ_SOCK_RAW = 0xFFFF; +const pj_uint16_t PJ_SOCK_RDM = 0xFFFF; + +/* setsockop() is not really supported. */ +const pj_uint16_t PJ_SOL_SOCKET = 0xFFFF; +const pj_uint16_t PJ_SOL_IP = 0xFFFF; +const pj_uint16_t PJ_SOL_TCP = 0xFFFF; +const pj_uint16_t PJ_SOL_UDP = 0xFFFF; +const pj_uint16_t PJ_SOL_IPV6 = 0xFFFF; + +/* TOS */ +const pj_uint16_t PJ_IP_TOS = 0; +const pj_uint16_t PJ_IPTOS_LOWDELAY = 0; +const pj_uint16_t PJ_IPTOS_THROUGHPUT = 0; +const pj_uint16_t PJ_IPTOS_RELIABILITY = 0; +const pj_uint16_t PJ_IPTOS_MINCOST = 0; + +/* ioctl() is also not supported. */ +const pj_uint16_t PJ_SO_TYPE = 0xFFFF; +const pj_uint16_t PJ_SO_RCVBUF = 0xFFFF; +const pj_uint16_t PJ_SO_SNDBUF = 0xFFFF; + +/* IP multicast is also not supported. */ +const pj_uint16_t PJ_IP_MULTICAST_IF = 0xFFFF; +const pj_uint16_t PJ_IP_MULTICAST_TTL = 0xFFFF; +const pj_uint16_t PJ_IP_MULTICAST_LOOP = 0xFFFF; +const pj_uint16_t PJ_IP_ADD_MEMBERSHIP = 0xFFFF; +const pj_uint16_t PJ_IP_DROP_MEMBERSHIP = 0xFFFF; + +/* Flags */ +const int PJ_MSG_OOB = 0; +const int PJ_MSG_PEEK = KSockReadPeek; +const int PJ_MSG_DONTROUTE = 0; + +///////////////////////////////////////////////////////////////////////////// +// +// CPjSocket implementation. +// (declaration is in os_symbian.h) +// + +CPjSocket::~CPjSocket() +{ + DestroyReader(); + sock_.Close(); +} + + +// Create socket reader. +CPjSocketReader *CPjSocket::CreateReader (unsigned max_len) +{ + pj_assert (sockReader_ == NULL); + return sockReader_ = CPjSocketReader::NewL (*this, max_len); +} + +// Delete socket reader when it's not wanted. +void CPjSocket::DestroyReader() +{ + if (sockReader_) { + sockReader_->Cancel(); + delete sockReader_; + sockReader_ = NULL; + } +} + + +///////////////////////////////////////////////////////////////////////////// +// +// CPjSocketReader implementation +// (declaration in os_symbian.h) +// + + +CPjSocketReader::CPjSocketReader (CPjSocket &sock) + : CActive (EPriorityStandard), + sock_ (sock), buffer_ (NULL, 0), readCb_ (NULL), key_ (NULL) +{ +} + + +void CPjSocketReader::ConstructL (unsigned max_len) +{ + TProtocolDesc aProtocol; + TInt err; + + err = sock_.Socket().Info (aProtocol); + User::LeaveIfError (err); + + isDatagram_ = (aProtocol.iSockType == KSockDatagram); + + TUint8 *ptr = new TUint8[max_len]; + buffer_.Set (ptr, 0, (TInt) max_len); + CActiveScheduler::Add (this); +} + +CPjSocketReader *CPjSocketReader::NewL (CPjSocket &sock, unsigned max_len) +{ + CPjSocketReader *self = new (ELeave) CPjSocketReader (sock); + CleanupStack::PushL (self); + self->ConstructL (max_len); + CleanupStack::Pop (self); + + return self; +} + + +CPjSocketReader::~CPjSocketReader() +{ + const TUint8 *data = buffer_.Ptr(); + delete [] data; +} + +void CPjSocketReader::StartRecv (void (*cb) (void *key), + void *key, + TDes8 *aDesc, + TUint flags) +{ + StartRecvFrom (cb, key, aDesc, flags, NULL); +} + +void CPjSocketReader::StartRecvFrom (void (*cb) (void *key), + void *key, + TDes8 *aDesc, + TUint flags, + TSockAddr *fromAddr) +{ + readCb_ = cb; + key_ = key; + + if (aDesc == NULL) aDesc = &buffer_; + + if (fromAddr == NULL) fromAddr = &recvAddr_; + + sock_.Socket().RecvFrom (*aDesc, *fromAddr, flags, iStatus); + + SetActive(); +} + +void CPjSocketReader::DoCancel() +{ + sock_.Socket().CancelRecv(); +} + +void CPjSocketReader::RunL() +{ + void (*old_cb) (void *key) = readCb_; + void *old_key = key_; + + readCb_ = NULL; + key_ = NULL; + + if (old_cb) { + (*old_cb) (old_key); + } +} + +// Append data to aDesc, up to aDesc's maximum size. +// If socket is datagram based, buffer_ will be clared. +void CPjSocketReader::ReadData (TDes8 &aDesc, TInetAddr *addr) +{ + if (isDatagram_) + aDesc.Zero(); + + if (buffer_.Length() == 0) + return; + + TInt size_to_copy = aDesc.MaxLength() - aDesc.Length(); + + if (size_to_copy > buffer_.Length()) + size_to_copy = buffer_.Length(); + + aDesc.Append (buffer_.Ptr(), size_to_copy); + + if (isDatagram_) + buffer_.Zero(); + else + buffer_.Delete (0, size_to_copy); + + if (addr) + *addr = recvAddr_; +} + + + +///////////////////////////////////////////////////////////////////////////// +// +// PJLIB's sock.h implementation +// + +/* + * Convert 16-bit value from network byte order to host byte order. + */ +PJ_DEF (pj_uint16_t) pj_ntohs (pj_uint16_t netshort) +{ +#if PJ_IS_LITTLE_ENDIAN + return pj_swap16 (netshort); +#else + return netshort; +#endif +} + +/* + * Convert 16-bit value from host byte order to network byte order. + */ +PJ_DEF (pj_uint16_t) pj_htons (pj_uint16_t hostshort) +{ +#if PJ_IS_LITTLE_ENDIAN + return pj_swap16 (hostshort); +#else + return hostshort; +#endif +} + +/* + * Convert 32-bit value from network byte order to host byte order. + */ +PJ_DEF (pj_uint32_t) pj_ntohl (pj_uint32_t netlong) +{ +#if PJ_IS_LITTLE_ENDIAN + return pj_swap32 (netlong); +#else + return netlong; +#endif +} + +/* + * Convert 32-bit value from host byte order to network byte order. + */ +PJ_DEF (pj_uint32_t) pj_htonl (pj_uint32_t hostlong) +{ +#if PJ_IS_LITTLE_ENDIAN + return pj_swap32 (hostlong); +#else + return netlong; +#endif +} + +/* + * Convert an Internet host address given in network byte order + * to string in standard numbers and dots notation. + */ +PJ_DEF (char*) pj_inet_ntoa (pj_in_addr inaddr) +{ + static char str8[PJ_INET_ADDRSTRLEN]; + TBuf<PJ_INET_ADDRSTRLEN> str16 (0); + + /* (Symbian IP address is in host byte order) */ + TInetAddr temp_addr ( (TUint32) pj_ntohl (inaddr.s_addr), (TUint) 0); + temp_addr.Output (str16); + + return pj_unicode_to_ansi ( (const wchar_t*) str16.PtrZ(), str16.Length(), + str8, sizeof (str8)); +} + +/* + * This function converts the Internet host address cp from the standard + * numbers-and-dots notation into binary data and stores it in the structure + * that inp points to. + */ +PJ_DEF (int) pj_inet_aton (const pj_str_t *cp, struct pj_in_addr *inp) +{ + enum { MAXIPLEN = PJ_INET_ADDRSTRLEN }; + + /* Initialize output with PJ_INADDR_NONE. + * Some apps relies on this instead of the return value + * (and anyway the return value is quite confusing!) + */ + inp->s_addr = PJ_INADDR_NONE; + + /* Caution: + * this function might be called with cp->slen >= 16 + * (i.e. when called with hostname to check if it's an IP addr). + */ + PJ_ASSERT_RETURN (cp && cp->slen && inp, 0); + + if (cp->slen >= 16) { + return 0; + } + + char tempaddr8[MAXIPLEN]; + + pj_memcpy (tempaddr8, cp->ptr, cp->slen); + tempaddr8[cp->slen] = '\0'; + + wchar_t tempaddr16[MAXIPLEN]; + pj_ansi_to_unicode (tempaddr8, pj_ansi_strlen (tempaddr8), + tempaddr16, sizeof (tempaddr16)); + + TBuf<MAXIPLEN> ip_addr ( (const TText*) tempaddr16); + + TInetAddr addr; + addr.Init (KAfInet); + + if (addr.Input (ip_addr) == KErrNone) { + /* Success (Symbian IP address is in host byte order) */ + inp->s_addr = pj_htonl (addr.Address()); + return 1; + } else { + /* Error */ + return 0; + } +} + +/* + * Convert text to IPv4/IPv6 address. + */ +PJ_DEF (pj_status_t) pj_inet_pton (int af, const pj_str_t *src, void *dst) +{ + char tempaddr[PJ_INET6_ADDRSTRLEN]; + + PJ_ASSERT_RETURN (af==PJ_AF_INET || af==PJ_AF_INET6, PJ_EINVAL); + PJ_ASSERT_RETURN (src && src->slen && dst, PJ_EINVAL); + + /* Initialize output with PJ_IN_ADDR_NONE for IPv4 (to be + * compatible with pj_inet_aton() + */ + + if (af==PJ_AF_INET) { + ( (pj_in_addr*) dst)->s_addr = PJ_INADDR_NONE; + } + + /* Caution: + * this function might be called with cp->slen >= 46 + * (i.e. when called with hostname to check if it's an IP addr). + */ + if (src->slen >= PJ_INET6_ADDRSTRLEN) { + return PJ_ENAMETOOLONG; + } + + pj_memcpy (tempaddr, src->ptr, src->slen); + + tempaddr[src->slen] = '\0'; + + + wchar_t tempaddr16[PJ_INET6_ADDRSTRLEN]; + pj_ansi_to_unicode (tempaddr, pj_ansi_strlen (tempaddr), + tempaddr16, sizeof (tempaddr16)); + + TBuf<PJ_INET6_ADDRSTRLEN> ip_addr ( (const TText*) tempaddr16); + + TInetAddr addr; + addr.Init (KAfInet6); + + if (addr.Input (ip_addr) == KErrNone) { + if (af==PJ_AF_INET) { + /* Success (Symbian IP address is in host byte order) */ + pj_uint32_t ip = pj_htonl (addr.Address()); + pj_memcpy (dst, &ip, 4); + } else if (af==PJ_AF_INET6) { + const TIp6Addr & ip6 = addr.Ip6Address(); + pj_memcpy (dst, ip6.u.iAddr8, 16); + } else { + pj_assert (!"Unexpected!"); + return PJ_EBUG; + } + + return PJ_SUCCESS; + } else { + /* Error */ + return PJ_EINVAL; + } +} + +/* + * Convert IPv4/IPv6 address to text. + */ +PJ_DEF (pj_status_t) pj_inet_ntop (int af, const void *src, + char *dst, int size) + +{ + PJ_ASSERT_RETURN (src && dst && size, PJ_EINVAL); + + *dst = '\0'; + + if (af==PJ_AF_INET) { + + TBuf<PJ_INET_ADDRSTRLEN> str16; + pj_in_addr inaddr; + + if (size < PJ_INET_ADDRSTRLEN) + return PJ_ETOOSMALL; + + pj_memcpy (&inaddr, src, 4); + + /* Symbian IP address is in host byte order */ + TInetAddr temp_addr ( (TUint32) pj_ntohl (inaddr.s_addr), (TUint) 0); + + temp_addr.Output (str16); + + pj_unicode_to_ansi ( (const wchar_t*) str16.PtrZ(), str16.Length(), + dst, size); + + return PJ_SUCCESS; + + } else if (af==PJ_AF_INET6) { + TBuf<PJ_INET6_ADDRSTRLEN> str16; + + if (size < PJ_INET6_ADDRSTRLEN) + return PJ_ETOOSMALL; + + TIp6Addr ip6; + + pj_memcpy (ip6.u.iAddr8, src, 16); + + TInetAddr temp_addr (ip6, (TUint) 0); + + temp_addr.Output (str16); + + pj_unicode_to_ansi ( (const wchar_t*) str16.PtrZ(), str16.Length(), + dst, size); + + return PJ_SUCCESS; + + } else { + pj_assert (!"Unsupport address family"); + return PJ_EINVAL; + } + +} + +/* + * Get hostname. + */ +PJ_DEF (const pj_str_t*) pj_gethostname (void) +{ + static char buf[PJ_MAX_HOSTNAME]; + static pj_str_t hostname; + + PJ_CHECK_STACK(); + + if (hostname.ptr == NULL) { + RHostResolver &resv = PjSymbianOS::Instance()->GetResolver (PJ_AF_INET); + TRequestStatus reqStatus; + THostName tmpName; + + // Return empty hostname if access point is marked as down by app. + PJ_SYMBIAN_CHECK_CONNECTION2 (&hostname); + + resv.GetHostName (tmpName, reqStatus); + User::WaitForRequest (reqStatus); + + hostname.ptr = pj_unicode_to_ansi ( (const wchar_t*) tmpName.Ptr(), tmpName.Length(), + buf, sizeof (buf)); + hostname.slen = tmpName.Length(); + } + + return &hostname; +} + +/* + * Create new socket/endpoint for communication and returns a descriptor. + */ +PJ_DEF (pj_status_t) pj_sock_socket (int af, + int type, + int proto, + pj_sock_t *p_sock) +{ + TInt rc; + + PJ_CHECK_STACK(); + + /* Sanity checks. */ + PJ_ASSERT_RETURN (p_sock!=NULL, PJ_EINVAL); + + // Return failure if access point is marked as down by app. + PJ_SYMBIAN_CHECK_CONNECTION(); + + /* Set proto if none is specified. */ + + if (proto == 0) { + if (type == pj_SOCK_STREAM()) + proto = KProtocolInetTcp; + else if (type == pj_SOCK_DGRAM()) + proto = KProtocolInetUdp; + } + + /* Create Symbian RSocket */ + RSocket rSock; + + if (PjSymbianOS::Instance()->Connection()) + rc = rSock.Open (PjSymbianOS::Instance()->SocketServ(), + af, type, proto, + *PjSymbianOS::Instance()->Connection()); + else + rc = rSock.Open (PjSymbianOS::Instance()->SocketServ(), + af, type, proto); + + if (rc != KErrNone) + return PJ_RETURN_OS_ERROR (rc); + + + /* Wrap Symbian RSocket into PJLIB's CPjSocket, and return to caller */ + CPjSocket *pjSock = new CPjSocket (af, rSock); + + *p_sock = (pj_sock_t) pjSock; + + return PJ_SUCCESS; +} + + +/* + * Bind socket. + */ +PJ_DEF (pj_status_t) pj_sock_bind (pj_sock_t sock, + const pj_sockaddr_t *addr, + int len) +{ + pj_status_t status; + TInt rc; + + PJ_CHECK_STACK(); + + PJ_ASSERT_RETURN (sock != 0, PJ_EINVAL); + PJ_ASSERT_RETURN (addr && len>= (int) sizeof (pj_sockaddr_in), PJ_EINVAL); + + // Convert PJLIB's pj_sockaddr into Symbian's TInetAddr + TInetAddr inetAddr; + status = PjSymbianOS::pj2Addr (* (pj_sockaddr*) addr, len, inetAddr); + + if (status != PJ_SUCCESS) + return status; + + // Get the RSocket instance + RSocket &rSock = ( (CPjSocket*) sock)->Socket(); + + // Bind + rc = rSock.Bind (inetAddr); + + return (rc==KErrNone) ? PJ_SUCCESS : PJ_RETURN_OS_ERROR (rc); +} + + +/* + * Bind socket. + */ +PJ_DEF (pj_status_t) pj_sock_bind_in (pj_sock_t sock, + pj_uint32_t addr32, + pj_uint16_t port) +{ + pj_sockaddr_in addr; + + PJ_CHECK_STACK(); + + pj_bzero (&addr, sizeof (addr)); + addr.sin_family = PJ_AF_INET; + addr.sin_addr.s_addr = pj_htonl (addr32); + addr.sin_port = pj_htons (port); + + return pj_sock_bind (sock, &addr, sizeof (pj_sockaddr_in)); +} + + +/* + * Close socket. + */ +PJ_DEF (pj_status_t) pj_sock_close (pj_sock_t sock) +{ + PJ_CHECK_STACK(); + + PJ_ASSERT_RETURN (sock != 0, PJ_EINVAL); + + CPjSocket *pjSock = (CPjSocket*) sock; + + // This will close the socket. + delete pjSock; + + return PJ_SUCCESS; +} + +/* + * Get remote's name. + */ +PJ_DEF (pj_status_t) pj_sock_getpeername (pj_sock_t sock, + pj_sockaddr_t *addr, + int *namelen) +{ + PJ_CHECK_STACK(); + + PJ_ASSERT_RETURN (sock && addr && namelen && + *namelen>= (int) sizeof (pj_sockaddr_in), PJ_EINVAL); + + CPjSocket *pjSock = (CPjSocket*) sock; + RSocket &rSock = pjSock->Socket(); + + // Socket must be connected. + PJ_ASSERT_RETURN (pjSock->IsConnected(), PJ_EINVALIDOP); + + TInetAddr inetAddr; + rSock.RemoteName (inetAddr); + + return PjSymbianOS::Addr2pj (inetAddr, * (pj_sockaddr*) addr, namelen); +} + +/* + * Get socket name. + */ +PJ_DEF (pj_status_t) pj_sock_getsockname (pj_sock_t sock, + pj_sockaddr_t *addr, + int *namelen) +{ + PJ_CHECK_STACK(); + + PJ_ASSERT_RETURN (sock && addr && namelen && + *namelen>= (int) sizeof (pj_sockaddr_in), PJ_EINVAL); + + CPjSocket *pjSock = (CPjSocket*) sock; + RSocket &rSock = pjSock->Socket(); + + TInetAddr inetAddr; + rSock.LocalName (inetAddr); + + return PjSymbianOS::Addr2pj (inetAddr, * (pj_sockaddr*) addr, namelen); +} + +/* + * Send data + */ +PJ_DEF (pj_status_t) pj_sock_send (pj_sock_t sock, + const void *buf, + pj_ssize_t *len, + unsigned flags) +{ + PJ_CHECK_STACK(); + PJ_ASSERT_RETURN (sock && buf && len, PJ_EINVAL); + + // Return failure if access point is marked as down by app. + PJ_SYMBIAN_CHECK_CONNECTION(); + + CPjSocket *pjSock = (CPjSocket*) sock; + RSocket &rSock = pjSock->Socket(); + + // send() should only be called to connected socket + PJ_ASSERT_RETURN (pjSock->IsConnected(), PJ_EINVALIDOP); + + TPtrC8 data ( (const TUint8*) buf, (TInt) *len); + TRequestStatus reqStatus; + TSockXfrLength sentLen; + + rSock.Send (data, flags, reqStatus, sentLen); + User::WaitForRequest (reqStatus); + + if (reqStatus.Int() ==KErrNone) { + //*len = (TInt) sentLen.Length(); + return PJ_SUCCESS; + } else + return PJ_RETURN_OS_ERROR (reqStatus.Int()); +} + + +/* + * Send data. + */ +PJ_DEF (pj_status_t) pj_sock_sendto (pj_sock_t sock, + const void *buf, + pj_ssize_t *len, + unsigned flags, + const pj_sockaddr_t *to, + int tolen) +{ + pj_status_t status; + + PJ_CHECK_STACK(); + PJ_ASSERT_RETURN (sock && buf && len, PJ_EINVAL); + + // Return failure if access point is marked as down by app. + PJ_SYMBIAN_CHECK_CONNECTION(); + + CPjSocket *pjSock = (CPjSocket*) sock; + RSocket &rSock = pjSock->Socket(); + + // Only supports AF_INET for now + PJ_ASSERT_RETURN (tolen>= (int) sizeof (pj_sockaddr_in), PJ_EINVAL); + + TInetAddr inetAddr; + status = PjSymbianOS::pj2Addr (* (pj_sockaddr*) to, tolen, inetAddr); + + if (status != PJ_SUCCESS) + return status; + + TPtrC8 data ( (const TUint8*) buf, (TInt) *len); + + TRequestStatus reqStatus; + + TSockXfrLength sentLen; + + rSock.SendTo (data, inetAddr, flags, reqStatus, sentLen); + + User::WaitForRequest (reqStatus); + + if (reqStatus.Int() ==KErrNone) { + //For some reason TSockXfrLength is not returning correctly! + //*len = (TInt) sentLen.Length(); + return PJ_SUCCESS; + } else + return PJ_RETURN_OS_ERROR (reqStatus.Int()); +} + +/* + * Receive data. + */ +PJ_DEF (pj_status_t) pj_sock_recv (pj_sock_t sock, + void *buf, + pj_ssize_t *len, + unsigned flags) +{ + PJ_CHECK_STACK(); + + PJ_ASSERT_RETURN (sock && buf && len, PJ_EINVAL); + PJ_ASSERT_RETURN (*len > 0, PJ_EINVAL); + + // Return failure if access point is marked as down by app. + PJ_SYMBIAN_CHECK_CONNECTION(); + + CPjSocket *pjSock = (CPjSocket*) sock; + RSocket &rSock = pjSock->Socket(); + + if (pjSock->Reader()) { + CPjSocketReader *reader = pjSock->Reader(); + + while (reader->IsActive() && !reader->HasData()) { + User::WaitForAnyRequest(); + } + + if (reader->HasData()) { + TPtr8 data ( (TUint8*) buf, (TInt) *len); + TInetAddr inetAddr; + + reader->ReadData (data, &inetAddr); + + *len = data.Length(); + return PJ_SUCCESS; + } + } + + TRequestStatus reqStatus; + + TSockXfrLength recvLen; + TPtr8 data ( (TUint8*) buf, (TInt) *len, (TInt) *len); + + rSock.Recv (data, flags, reqStatus, recvLen); + User::WaitForRequest (reqStatus); + + if (reqStatus == KErrNone) { + //*len = (TInt)recvLen.Length(); + *len = data.Length(); + return PJ_SUCCESS; + } else { + *len = -1; + return PJ_RETURN_OS_ERROR (reqStatus.Int()); + } +} + +/* + * Receive data. + */ +PJ_DEF (pj_status_t) pj_sock_recvfrom (pj_sock_t sock, + void *buf, + pj_ssize_t *len, + unsigned flags, + pj_sockaddr_t *from, + int *fromlen) +{ + PJ_CHECK_STACK(); + + PJ_ASSERT_RETURN (sock && buf && len && from && fromlen, PJ_EINVAL); + PJ_ASSERT_RETURN (*len > 0, PJ_EINVAL); + PJ_ASSERT_RETURN (*fromlen >= (int) sizeof (pj_sockaddr_in), PJ_EINVAL); + + // Return failure if access point is marked as down by app. + PJ_SYMBIAN_CHECK_CONNECTION(); + + CPjSocket *pjSock = (CPjSocket*) sock; + RSocket &rSock = pjSock->Socket(); + + if (pjSock->Reader()) { + CPjSocketReader *reader = pjSock->Reader(); + + while (reader->IsActive() && !reader->HasData()) { + User::WaitForAnyRequest(); + } + + if (reader->HasData()) { + TPtr8 data ( (TUint8*) buf, (TInt) *len); + TInetAddr inetAddr; + + reader->ReadData (data, &inetAddr); + + *len = data.Length(); + + if (from && fromlen) { + return PjSymbianOS::Addr2pj (inetAddr, * (pj_sockaddr*) from, + fromlen); + } else { + return PJ_SUCCESS; + } + } + } + + TInetAddr inetAddr; + + TRequestStatus reqStatus; + TSockXfrLength recvLen; + TPtr8 data ( (TUint8*) buf, (TInt) *len, (TInt) *len); + + rSock.RecvFrom (data, inetAddr, flags, reqStatus, recvLen); + User::WaitForRequest (reqStatus); + + if (reqStatus == KErrNone) { + //*len = (TInt)recvLen.Length(); + *len = data.Length(); + return PjSymbianOS::Addr2pj (inetAddr, * (pj_sockaddr*) from, fromlen); + } else { + *len = -1; + *fromlen = -1; + return PJ_RETURN_OS_ERROR (reqStatus.Int()); + } +} + +/* + * Get socket option. + */ +PJ_DEF (pj_status_t) pj_sock_getsockopt (pj_sock_t sock, + pj_uint16_t level, + pj_uint16_t optname, + void *optval, + int *optlen) +{ + // Not supported for now. + PJ_UNUSED_ARG (sock); + PJ_UNUSED_ARG (level); + PJ_UNUSED_ARG (optname); + PJ_UNUSED_ARG (optval); + PJ_UNUSED_ARG (optlen); + return PJ_EINVALIDOP; +} + +/* + * Set socket option. + */ +PJ_DEF (pj_status_t) pj_sock_setsockopt (pj_sock_t sock, + pj_uint16_t level, + pj_uint16_t optname, + const void *optval, + int optlen) +{ + // Not supported for now. + PJ_UNUSED_ARG (sock); + PJ_UNUSED_ARG (level); + PJ_UNUSED_ARG (optname); + PJ_UNUSED_ARG (optval); + PJ_UNUSED_ARG (optlen); + return PJ_EINVALIDOP; +} + +/* + * Connect socket. + */ +PJ_DEF (pj_status_t) pj_sock_connect (pj_sock_t sock, + const pj_sockaddr_t *addr, + int namelen) +{ + pj_status_t status; + + PJ_CHECK_STACK(); + + PJ_ASSERT_RETURN (sock && addr && namelen, PJ_EINVAL); + PJ_ASSERT_RETURN ( ( (pj_sockaddr*) addr)->addr.sa_family == PJ_AF_INET, + PJ_EINVAL); + + // Return failure if access point is marked as down by app. + PJ_SYMBIAN_CHECK_CONNECTION(); + + CPjSocket *pjSock = (CPjSocket*) sock; + RSocket &rSock = pjSock->Socket(); + + TInetAddr inetAddr; + TRequestStatus reqStatus; + + status = PjSymbianOS::pj2Addr (* (pj_sockaddr*) addr, namelen, inetAddr); + + if (status != PJ_SUCCESS) + return status; + + rSock.Connect (inetAddr, reqStatus); + + User::WaitForRequest (reqStatus); + + if (reqStatus == KErrNone) { + pjSock->SetConnected (true); + return PJ_SUCCESS; + } else { + return PJ_RETURN_OS_ERROR (reqStatus.Int()); + } +} + + +/* + * Shutdown socket. + */ +#if PJ_HAS_TCP +PJ_DEF (pj_status_t) pj_sock_shutdown (pj_sock_t sock, + int how) +{ + PJ_CHECK_STACK(); + + PJ_ASSERT_RETURN (sock, PJ_EINVAL); + + CPjSocket *pjSock = (CPjSocket*) sock; + RSocket &rSock = pjSock->Socket(); + + RSocket::TShutdown aHow; + + if (how == PJ_SD_RECEIVE) + aHow = RSocket::EStopInput; + else if (how == PJ_SHUT_WR) + aHow = RSocket::EStopOutput; + else + aHow = RSocket::ENormal; + + TRequestStatus reqStatus; + + rSock.Shutdown (aHow, reqStatus); + + User::WaitForRequest (reqStatus); + + if (reqStatus == KErrNone) { + return PJ_SUCCESS; + } else { + return PJ_RETURN_OS_ERROR (reqStatus.Int()); + } +} + +/* + * Start listening to incoming connections. + */ +PJ_DEF (pj_status_t) pj_sock_listen (pj_sock_t sock, + int backlog) +{ + PJ_CHECK_STACK(); + + PJ_ASSERT_RETURN (sock && backlog, PJ_EINVAL); + + CPjSocket *pjSock = (CPjSocket*) sock; + RSocket &rSock = pjSock->Socket(); + + TInt rc = rSock.Listen ( (TUint) backlog); + + if (rc == KErrNone) { + return PJ_SUCCESS; + } else { + return PJ_RETURN_OS_ERROR (rc); + } +} + +/* + * Accept incoming connections + */ +PJ_DEF (pj_status_t) pj_sock_accept (pj_sock_t serverfd, + pj_sock_t *newsock, + pj_sockaddr_t *addr, + int *addrlen) +{ + PJ_CHECK_STACK(); + + PJ_ASSERT_RETURN (serverfd && newsock, PJ_EINVAL); + + CPjSocket *pjSock = (CPjSocket*) serverfd; + RSocket &rSock = pjSock->Socket(); + + // Create a 'blank' socket + RSocket newSock; + newSock.Open (PjSymbianOS::Instance()->SocketServ()); + + // Call Accept() + TRequestStatus reqStatus; + + rSock.Accept (newSock, reqStatus); + User::WaitForRequest (reqStatus); + + if (reqStatus != KErrNone) { + return PJ_RETURN_OS_ERROR (reqStatus.Int()); + } + + // Create PJ socket + CPjSocket *newPjSock = new CPjSocket (pjSock->GetAf(), newSock); + + newPjSock->SetConnected (true); + + *newsock = (pj_sock_t) newPjSock; + + if (addr && addrlen) { + return pj_sock_getpeername (*newsock, addr, addrlen); + } + + return PJ_SUCCESS; +} + +#endif /* PJ_HAS_TCP */ + + diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/string.c b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/string.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/string.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/string.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/symbols.c b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/symbols.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/symbols.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/symbols.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/timer.c b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/timer.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/timer.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/timer.c diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/timer_symbian.cpp b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/timer_symbian.cpp new file mode 100644 index 0000000000000000000000000000000000000000..4aff5f9564eed554d9d068ea04594cd4c5a7526d --- /dev/null +++ b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/timer_symbian.cpp @@ -0,0 +1,288 @@ +/* $Id: timer_symbian.cpp 2394 2008-12-23 17:27:53Z bennylp $ */ +/* + * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) + * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> + * + * 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 + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#include <pj/timer.h> +#include <pj/pool.h> +#include <pj/assert.h> +#include <pj/errno.h> +#include <pj/lock.h> + +#include "os_symbian.h" + + +#define DEFAULT_MAX_TIMED_OUT_PER_POLL (64) + + +/** + * The implementation of timer heap. + */ + +struct pj_timer_heap_t { + /** Maximum size of the heap. */ + pj_size_t max_size; + + /** Current size of the heap. */ + pj_size_t cur_size; + + /** Max timed out entries to process per poll. */ + unsigned max_entries_per_poll; +}; + + +////////////////////////////////////////////////////////////////////////////// +/** + * Active object for each timer entry. + */ + +class CPjTimerEntry : public CActive +{ + + public: + static CPjTimerEntry* NewL (pj_timer_heap_t *timer_heap, + pj_timer_entry *entry, + const pj_time_val *delay); + + ~CPjTimerEntry(); + + virtual void RunL(); + virtual void DoCancel(); + + private: + pj_timer_heap_t *timer_heap_; + pj_timer_entry *entry_; + RTimer rtimer_; + + CPjTimerEntry (pj_timer_heap_t *timer_heap, pj_timer_entry *entry); + void ConstructL (const pj_time_val *delay); +}; + + +CPjTimerEntry::CPjTimerEntry (pj_timer_heap_t *timer_heap, + pj_timer_entry *entry) + : CActive (PJ_SYMBIAN_TIMER_PRIORITY), timer_heap_ (timer_heap), entry_ (entry) +{ +} + +CPjTimerEntry::~CPjTimerEntry() +{ + Cancel(); + rtimer_.Close(); +} + +void CPjTimerEntry::ConstructL (const pj_time_val *delay) +{ + rtimer_.CreateLocal(); + CActiveScheduler::Add (this); + + pj_int32_t interval = PJ_TIME_VAL_MSEC (*delay) * 1000; + + if (interval < 0) { + interval = 0; + } + + rtimer_.After (iStatus, interval); + + SetActive(); +} + +CPjTimerEntry* CPjTimerEntry::NewL (pj_timer_heap_t *timer_heap, + pj_timer_entry *entry, + const pj_time_val *delay) +{ + CPjTimerEntry *self = new CPjTimerEntry (timer_heap, entry); + CleanupStack::PushL (self); + self->ConstructL (delay); + CleanupStack::Pop (self); + + return self; +} + +void CPjTimerEntry::RunL() +{ + --timer_heap_->cur_size; + entry_->_timer_id = NULL; + entry_->cb (timer_heap_, entry_); + + // Finger's crossed! + delete this; +} + +void CPjTimerEntry::DoCancel() +{ + rtimer_.Cancel(); +} + + +////////////////////////////////////////////////////////////////////////////// + + +/* + * Calculate memory size required to create a timer heap. + */ +PJ_DEF (pj_size_t) pj_timer_heap_mem_size (pj_size_t count) +{ + return /* size of the timer heap itself: */ + sizeof (pj_timer_heap_t) + + /* size of each entry: */ + (count+2) * (sizeof (pj_timer_entry*) +sizeof (pj_timer_id_t)) + + /* lock, pool etc: */ + 132; +} + +/* + * Create a new timer heap. + */ +PJ_DEF (pj_status_t) pj_timer_heap_create (pj_pool_t *pool, + pj_size_t size, + pj_timer_heap_t **p_heap) +{ + pj_timer_heap_t *ht; + + PJ_ASSERT_RETURN (pool && p_heap, PJ_EINVAL); + + *p_heap = NULL; + + /* Allocate timer heap data structure from the pool */ + ht = PJ_POOL_ALLOC_T (pool, pj_timer_heap_t); + + if (!ht) + return PJ_ENOMEM; + + /* Initialize timer heap sizes */ + ht->max_size = size; + + ht->cur_size = 0; + + ht->max_entries_per_poll = DEFAULT_MAX_TIMED_OUT_PER_POLL; + + *p_heap = ht; + + return PJ_SUCCESS; +} + +PJ_DEF (void) pj_timer_heap_destroy (pj_timer_heap_t *ht) +{ + PJ_UNUSED_ARG (ht); +} + +PJ_DEF (void) pj_timer_heap_set_lock (pj_timer_heap_t *ht, + pj_lock_t *lock, + pj_bool_t auto_del) +{ + PJ_UNUSED_ARG (ht); + + if (auto_del) + pj_lock_destroy (lock); +} + + +PJ_DEF (unsigned) pj_timer_heap_set_max_timed_out_per_poll (pj_timer_heap_t *ht, + unsigned count) +{ + unsigned old_count = ht->max_entries_per_poll; + ht->max_entries_per_poll = count; + return old_count; +} + +PJ_DEF (pj_timer_entry*) pj_timer_entry_init (pj_timer_entry *entry, + int id, + void *user_data, + pj_timer_heap_callback *cb) +{ + pj_assert (entry && cb); + + entry->_timer_id = NULL; + entry->id = id; + entry->user_data = user_data; + entry->cb = cb; + + return entry; +} + +PJ_DEF (pj_status_t) pj_timer_heap_schedule (pj_timer_heap_t *ht, + pj_timer_entry *entry, + const pj_time_val *delay) +{ + CPjTimerEntry *timerObj; + + PJ_ASSERT_RETURN (ht && entry && delay, PJ_EINVAL); + PJ_ASSERT_RETURN (entry->cb != NULL, PJ_EINVAL); + + /* Prevent same entry from being scheduled more than once */ + PJ_ASSERT_RETURN (entry->_timer_id == NULL, PJ_EINVALIDOP); + + timerObj = CPjTimerEntry::NewL (ht, entry, delay); + entry->_timer_id = (void*) timerObj; + + ++ht->cur_size; + return PJ_SUCCESS; +} + +PJ_DEF (int) pj_timer_heap_cancel (pj_timer_heap_t *ht, + pj_timer_entry *entry) +{ + PJ_ASSERT_RETURN (ht && entry, PJ_EINVAL); + + if (entry->_timer_id != NULL) { + CPjTimerEntry *timerObj = (CPjTimerEntry*) entry->_timer_id; + timerObj->Cancel(); + delete timerObj; + entry->_timer_id = NULL; + --ht->cur_size; + return 1; + } else { + return 0; + } +} + +PJ_DEF (unsigned) pj_timer_heap_poll (pj_timer_heap_t *ht, + pj_time_val *next_delay) +{ + /* Polling is not necessary on Symbian, since all async activities + * are registered to active scheduler. + */ + PJ_UNUSED_ARG (ht); + + if (next_delay) { + next_delay->sec = 1; + next_delay->msec = 0; + } + + return 0; +} + +PJ_DEF (pj_size_t) pj_timer_heap_count (pj_timer_heap_t *ht) +{ + PJ_ASSERT_RETURN (ht, 0); + + return ht->cur_size; +} + +PJ_DEF (pj_status_t) pj_timer_heap_earliest_time (pj_timer_heap_t * ht, + pj_time_val *timeval) +{ + /* We don't support this! */ + PJ_UNUSED_ARG (ht); + + timeval->sec = 1; + timeval->msec = 0; + + return PJ_SUCCESS; +} + diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/types.c b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/types.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/types.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/types.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/unicode_symbian.cpp b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/unicode_symbian.cpp similarity index 57% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/unicode_symbian.cpp rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/unicode_symbian.cpp index e9eb957f957693b1c4dd8b6e54de19feb87495fd..c1ce1e52e5a0f93886aa1ba60f22116695b8ce9b 100644 --- a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/unicode_symbian.cpp +++ b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/unicode_symbian.cpp @@ -1,5 +1,5 @@ /* $Id: unicode_symbian.cpp 2394 2008-12-23 17:27:53Z bennylp $ */ -/* +/* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> * @@ -15,7 +15,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include <pj/unicode.h> @@ -25,20 +25,20 @@ /* * Convert ANSI strings to Unicode strings. */ -PJ_DEF(wchar_t*) pj_ansi_to_unicode( const char *str, pj_size_t len, - wchar_t *wbuf, pj_size_t wbuf_count) +PJ_DEF (wchar_t*) pj_ansi_to_unicode (const char *str, pj_size_t len, + wchar_t *wbuf, pj_size_t wbuf_count) { - TPtrC8 aForeign((const TUint8*)str, (TInt)len); - TPtr16 aUnicode((TUint16*)wbuf, (TInt)(wbuf_count-1)); + TPtrC8 aForeign ( (const TUint8*) str, (TInt) len); + TPtr16 aUnicode ( (TUint16*) wbuf, (TInt) (wbuf_count-1)); TInt left; - left = PjSymbianOS::Instance()->ConvertToUnicode(aUnicode, aForeign); + left = PjSymbianOS::Instance()->ConvertToUnicode (aUnicode, aForeign); if (left != 0) { - // Error, or there are unconvertable characters - *wbuf = 0; + // Error, or there are unconvertable characters + *wbuf = 0; } else { - wbuf[len] = 0; + wbuf[len] = 0; } return wbuf; @@ -48,20 +48,20 @@ PJ_DEF(wchar_t*) pj_ansi_to_unicode( const char *str, pj_size_t len, /* * Convert Unicode string to ANSI string. */ -PJ_DEF(char*) pj_unicode_to_ansi( const wchar_t *wstr, pj_size_t len, - char *buf, pj_size_t buf_size) +PJ_DEF (char*) pj_unicode_to_ansi (const wchar_t *wstr, pj_size_t len, + char *buf, pj_size_t buf_size) { - TPtrC16 aUnicode((const TUint16*)wstr, (TInt)len); - TPtr8 aForeign((TUint8*)buf, (TInt)(buf_size-1)); + TPtrC16 aUnicode ( (const TUint16*) wstr, (TInt) len); + TPtr8 aForeign ( (TUint8*) buf, (TInt) (buf_size-1)); TInt left; - left = PjSymbianOS::Instance()->ConvertFromUnicode(aForeign, aUnicode); + left = PjSymbianOS::Instance()->ConvertFromUnicode (aForeign, aUnicode); if (left != 0) { - // Error, or there are unconvertable characters - buf[0] = '\0'; + // Error, or there are unconvertable characters + buf[0] = '\0'; } else { - buf[len] = '\0'; + buf[len] = '\0'; } return buf; diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/unicode_win32.c b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/unicode_win32.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pj/unicode_win32.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/unicode_win32.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pjlib++-test/main.cpp b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib++-test/main.cpp similarity index 78% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pjlib++-test/main.cpp rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib++-test/main.cpp index 6b749ad62dfba137f30cd89cc30c0d60113ab5e4..f69f4cc75a4bf3bcc3c7d2b753200a1e0d199257 100644 --- a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pjlib++-test/main.cpp +++ b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib++-test/main.cpp @@ -1,5 +1,5 @@ /* $Id */ -/* +/* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> * @@ -15,7 +15,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include <pj++/file.hpp> #include <pj++/list.hpp> @@ -42,20 +42,20 @@ int main() Pj_Caching_Pool mem; Pj_Pool the_pool; Pj_Pool *pool = &the_pool; - - the_pool.attach(mem.create_pool(4000,4000)); - Pj_Semaphore_Lock lsem(pool); + the_pool.attach (mem.create_pool (4000,4000)); + + Pj_Semaphore_Lock lsem (pool); Pj_Semaphore_Lock *plsem; - plsem = new(pool) Pj_Semaphore_Lock(pool); + plsem = new (pool) Pj_Semaphore_Lock (pool); delete plsem; - Pj_Proactor proactor(pool, 100, 100); + Pj_Proactor proactor (pool, 100, 100); - My_Event_Handler *event_handler = new(the_pool) My_Event_Handler; - proactor.register_socket_handler(pool, event_handler); - proactor.unregister_handler(event_handler); + My_Event_Handler *event_handler = new (the_pool) My_Event_Handler; + proactor.register_socket_handler (pool, event_handler); + proactor.unregister_handler (event_handler); return 0; } diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pjlib-samples/except.c b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-samples/except.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pjlib-samples/except.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-samples/except.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pjlib-samples/list.c b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-samples/list.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pjlib-samples/list.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-samples/list.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pjlib-samples/log.c b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-samples/log.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pjlib-samples/log.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-samples/log.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pjlib-test/activesock.c b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/activesock.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pjlib-test/activesock.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/activesock.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pjlib-test/atomic.c b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/atomic.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pjlib-test/atomic.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/atomic.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pjlib-test/echo_clt.c b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/echo_clt.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pjlib-test/echo_clt.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/echo_clt.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pjlib-test/errno.c b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/errno.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pjlib-test/errno.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/errno.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pjlib-test/exception.c b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/exception.c similarity index 96% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pjlib-test/exception.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/exception.c index dfbc638cfc363bd4b4aa88b83289e7dd69255911..1bcd95549b4e8ee1112357fbe493fcc4b0fdbab8 100644 --- a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pjlib-test/exception.c +++ b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/exception.c @@ -1,4 +1,4 @@ -/* $Id: exception.c 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: exception.c 2407 2009-01-01 20:56:36Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -54,13 +54,13 @@ static int throw_id_1(void) { PJ_THROW( ID_1 ); - return -1; + PJ_UNREACHED(return -1;) } static int throw_id_2(void) { PJ_THROW( ID_2 ); - return -1; + PJ_UNREACHED(return -1;) } diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pjlib-test/fifobuf.c b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/fifobuf.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pjlib-test/fifobuf.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/fifobuf.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pjlib-test/file.c b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/file.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pjlib-test/file.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/file.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pjlib-test/hash_test.c b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/hash_test.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pjlib-test/hash_test.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/hash_test.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pjlib-test/ioq_perf.c b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/ioq_perf.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pjlib-test/ioq_perf.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/ioq_perf.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pjlib-test/ioq_tcp.c b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/ioq_tcp.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pjlib-test/ioq_tcp.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/ioq_tcp.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pjlib-test/ioq_udp.c b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/ioq_udp.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pjlib-test/ioq_udp.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/ioq_udp.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pjlib-test/ioq_unreg.c b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/ioq_unreg.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pjlib-test/ioq_unreg.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/ioq_unreg.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pjlib-test/list.c b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/list.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pjlib-test/list.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/list.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pjlib-test/main.c b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/main.c similarity index 96% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pjlib-test/main.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/main.c index ae175407c70ae9646bf17212ce2567167866a4af..d7adce484af17a9c523b2ed6591a14dc0656e8ae 100644 --- a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pjlib-test/main.c +++ b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/main.c @@ -1,4 +1,4 @@ -/* $Id: main.c 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: main.c 2408 2009-01-01 22:08:21Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -98,7 +98,8 @@ int main(int argc, char *argv[]) char s[10]; puts(""); puts("Press <ENTER> to exit"); - fgets(s, sizeof(s), stdin); + if (!fgets(s, sizeof(s), stdin)) + return rc; } return rc; diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pjlib-test/main_mod.c b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/main_mod.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pjlib-test/main_mod.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/main_mod.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pjlib-test/main_rtems.c b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/main_rtems.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pjlib-test/main_rtems.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/main_rtems.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pjlib-test/main_symbian.cpp b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/main_symbian.cpp similarity index 61% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pjlib-test/main_symbian.cpp rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/main_symbian.cpp index e57b080d50a01cb2b5bab7bb61b72613ceabdc64..d1fd7828f332007e67d7ffcec79694bda0dd220a 100644 --- a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pjlib-test/main_symbian.cpp +++ b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/main_symbian.cpp @@ -25,8 +25,10 @@ int main() //err = test_main(); if (err) - return err; + return err; + return exp; + //return 0; } @@ -53,7 +55,7 @@ LOCAL_C void MainL() // test_main(); - console->Printf(_L(" [press any key]\n")); + console->Printf (_L (" [press any key]\n")); console->Getch(); CActiveScheduler::Stop(); @@ -61,60 +63,61 @@ LOCAL_C void MainL() class MyScheduler : public CActiveScheduler { -public: - MyScheduler() - {} - void Error(TInt aError) const; + public: + MyScheduler() {} + + void Error (TInt aError) const; }; -void MyScheduler::Error(TInt aError) const +void MyScheduler::Error (TInt aError) const { - PJ_UNUSED_ARG(aError); + PJ_UNUSED_ARG (aError); } class ProgramStarter : public CActive { -public: - static ProgramStarter *NewL(); - void Start(); - -protected: - ProgramStarter(); - void ConstructL(); - virtual void RunL(); - virtual void DoCancel(); - TInt RunError(TInt aError); - -private: - RTimer timer_; + + public: + static ProgramStarter *NewL(); + void Start(); + + protected: + ProgramStarter(); + void ConstructL(); + virtual void RunL(); + virtual void DoCancel(); + TInt RunError (TInt aError); + + private: + RTimer timer_; }; ProgramStarter::ProgramStarter() -: CActive(EPriorityNormal) + : CActive (EPriorityNormal) { } void ProgramStarter::ConstructL() { timer_.CreateLocal(); - CActiveScheduler::Add(this); + CActiveScheduler::Add (this); } ProgramStarter *ProgramStarter::NewL() { ProgramStarter *self = new (ELeave) ProgramStarter; - CleanupStack::PushL(self); + CleanupStack::PushL (self); self->ConstructL(); - CleanupStack::Pop(self); + CleanupStack::Pop (self); return self; } void ProgramStarter::Start() { - timer_.After(iStatus, 0); + timer_.After (iStatus, 0); SetActive(); } @@ -127,67 +130,74 @@ void ProgramStarter::DoCancel() { } -TInt ProgramStarter::RunError(TInt aError) +TInt ProgramStarter::RunError (TInt aError) { - PJ_UNUSED_ARG(aError); + PJ_UNUSED_ARG (aError); return KErrNone; } LOCAL_C void DoStartL() - { +{ // Create active scheduler (to run active objects) CActiveScheduler* scheduler = new (ELeave) MyScheduler; - CleanupStack::PushL(scheduler); - CActiveScheduler::Install(scheduler); + CleanupStack::PushL (scheduler); + CActiveScheduler::Install (scheduler); ProgramStarter *starter = ProgramStarter::NewL(); starter->Start(); CActiveScheduler::Start(); - } +} // Global Functions -static void log_writer(int level, const char *buf, int len) +static void log_writer (int level, const char *buf, int len) { wchar_t buf16[PJ_LOG_MAX_SIZE]; - PJ_UNUSED_ARG(level); - - pj_ansi_to_unicode(buf, len, buf16, PJ_ARRAY_SIZE(buf16)); + PJ_UNUSED_ARG (level); - TPtrC16 aBuf((const TUint16*)buf16, (TInt)len); - console->Write(aBuf); + pj_ansi_to_unicode (buf, len, buf16, PJ_ARRAY_SIZE (buf16)); + + TPtrC16 aBuf ( (const TUint16*) buf16, (TInt) len); + console->Write (aBuf); } GLDEF_C TInt E32Main() - { +{ // Create cleanup stack __UHEAP_MARK; CTrapCleanup* cleanup = CTrapCleanup::New(); // Create output console - TRAPD(createError, console = Console::NewL(_L("Console"), TSize(KConsFullScreen,KConsFullScreen))); + TRAPD (createError, console = Console::NewL (_L ("Console"), TSize (KConsFullScreen,KConsFullScreen))); + if (createError) return createError; - pj_log_set_log_func(&log_writer); + pj_log_set_log_func (&log_writer); // Run application code inside TRAP harness, wait keypress when terminated - TRAPD(mainError, DoStartL()); + TRAPD (mainError, DoStartL()); + if (mainError) - console->Printf(_L(" failed, leave code = %d"), mainError); - console->Printf(_L(" [press any key]\n")); + console->Printf (_L (" failed, leave code = %d"), mainError); + + console->Printf (_L (" [press any key]\n")); + console->Getch(); - + delete console; + delete cleanup; + __UHEAP_MARKEND; + return KErrNone; - } +} #endif /* if 0 */ diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pjlib-test/main_win32.c b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/main_win32.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pjlib-test/main_win32.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/main_win32.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pjlib-test/mutex.c b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/mutex.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pjlib-test/mutex.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/mutex.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pjlib-test/os.c b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/os.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pjlib-test/os.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/os.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pjlib-test/pool.c b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/pool.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pjlib-test/pool.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/pool.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pjlib-test/pool_perf.c b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/pool_perf.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pjlib-test/pool_perf.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/pool_perf.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pjlib-test/rand.c b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/rand.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pjlib-test/rand.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/rand.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pjlib-test/rbtree.c b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/rbtree.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pjlib-test/rbtree.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/rbtree.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pjlib-test/rtems_network_config.h b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/rtems_network_config.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pjlib-test/rtems_network_config.h rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/rtems_network_config.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pjlib-test/select.c b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/select.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pjlib-test/select.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/select.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pjlib-test/sleep.c b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/sleep.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pjlib-test/sleep.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/sleep.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pjlib-test/sock.c b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/sock.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pjlib-test/sock.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/sock.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pjlib-test/sock_perf.c b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/sock_perf.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pjlib-test/sock_perf.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/sock_perf.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pjlib-test/string.c b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/string.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pjlib-test/string.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/string.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pjlib-test/test.c b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/test.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pjlib-test/test.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/test.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pjlib-test/test.h b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/test.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pjlib-test/test.h rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/test.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pjlib-test/thread.c b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/thread.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pjlib-test/thread.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/thread.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pjlib-test/timer.c b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/timer.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pjlib-test/timer.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/timer.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pjlib-test/timestamp.c b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/timestamp.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pjlib-test/timestamp.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/timestamp.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pjlib-test/udp_echo_srv_ioqueue.c b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/udp_echo_srv_ioqueue.c similarity index 99% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pjlib-test/udp_echo_srv_ioqueue.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/udp_echo_srv_ioqueue.c index f23350e3a24cb525215b98e6dcf25d77dc6887e9..8646985413bf754b69211e28308adc516b3d07a9 100644 --- a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pjlib-test/udp_echo_srv_ioqueue.c +++ b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/udp_echo_srv_ioqueue.c @@ -150,7 +150,7 @@ static int worker_thread(void *arg) timeout.sec = 0; timeout.msec = 10; rc = pj_ioqueue_poll(ioqueue, &timeout); } - return 0; + PJ_UNREACHED(return 0;) } int udp_echo_srv_ioqueue(void) diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pjlib-test/udp_echo_srv_sync.c b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/udp_echo_srv_sync.c similarity index 97% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pjlib-test/udp_echo_srv_sync.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/udp_echo_srv_sync.c index 5930c9faa1d38e8f6e42c65304afc83ed0ee2668..29f8d90ea40bd7a73592daf0932ae8fd374024a9 100644 --- a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pjlib-test/udp_echo_srv_sync.c +++ b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/udp_echo_srv_sync.c @@ -1,4 +1,4 @@ -/* $Id: udp_echo_srv_sync.c 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: udp_echo_srv_sync.c 2407 2009-01-01 20:56:36Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -56,7 +56,7 @@ static int worker_thread(void *arg) continue; } } - return 0; + PJ_UNREACHED(return 0;) } @@ -160,7 +160,7 @@ int echo_srv_common_loop(pj_atomic_t *bytes_counter) (unsigned)(highest_bw/1000))); } } - return 0; + PJ_UNREACHED(return 0;) } diff --git a/sflphone-common/libs/pjproject-1.0.1/pjlib/src/pjlib-test/util.c b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/util.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjlib/src/pjlib-test/util.c rename to sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/util.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/README.txt b/sflphone-common/libs/pjproject-1.0.2/pjmedia/README.txt similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/README.txt rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/README.txt diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/bin/pjmedia-test-x86_64-unknown-linux-gnu b/sflphone-common/libs/pjproject-1.0.2/pjmedia/bin/pjmedia-test-x86_64-unknown-linux-gnu new file mode 100755 index 0000000000000000000000000000000000000000..e79b87acc0657fe03f984fa890304b3d4ef82de7 Binary files /dev/null and b/sflphone-common/libs/pjproject-1.0.2/pjmedia/bin/pjmedia-test-x86_64-unknown-linux-gnu differ diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/build/Jbtest.dat b/sflphone-common/libs/pjproject-1.0.2/pjmedia/build/Jbtest.dat similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/build/Jbtest.dat rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/build/Jbtest.dat diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/build/Makefile b/sflphone-common/libs/pjproject-1.0.2/pjmedia/build/Makefile similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/build/Makefile rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/build/Makefile diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/build/m-i386.mak b/sflphone-common/libs/pjproject-1.0.2/pjmedia/build/m-i386.mak similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/build/m-i386.mak rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/build/m-i386.mak diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/build/m-x86_64.mak b/sflphone-common/libs/pjproject-1.0.2/pjmedia/build/m-x86_64.mak similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/build/m-x86_64.mak rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/build/m-x86_64.mak diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/build/os-auto.mak b/sflphone-common/libs/pjproject-1.0.2/pjmedia/build/os-auto.mak similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/build/os-auto.mak rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/build/os-auto.mak diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/build/os-auto.mak.in b/sflphone-common/libs/pjproject-1.0.2/pjmedia/build/os-auto.mak.in similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/build/os-auto.mak.in rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/build/os-auto.mak.in diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/build/os-darwinos.mak b/sflphone-common/libs/pjproject-1.0.2/pjmedia/build/os-darwinos.mak similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/build/os-darwinos.mak rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/build/os-darwinos.mak diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/build/os-linux.mak b/sflphone-common/libs/pjproject-1.0.2/pjmedia/build/os-linux.mak similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/build/os-linux.mak rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/build/os-linux.mak diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/build/os-rtems.mak b/sflphone-common/libs/pjproject-1.0.2/pjmedia/build/os-rtems.mak similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/build/os-rtems.mak rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/build/os-rtems.mak diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/build/os-win32.mak b/sflphone-common/libs/pjproject-1.0.2/pjmedia/build/os-win32.mak similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/build/os-win32.mak rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/build/os-win32.mak diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/build/pjaut.dsp b/sflphone-common/libs/pjproject-1.0.2/pjmedia/build/pjaut.dsp similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/build/pjaut.dsp rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/build/pjaut.dsp diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/build/pjmedia.dsp b/sflphone-common/libs/pjproject-1.0.2/pjmedia/build/pjmedia.dsp similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/build/pjmedia.dsp rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/build/pjmedia.dsp diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/build/pjmedia.dsw b/sflphone-common/libs/pjproject-1.0.2/pjmedia/build/pjmedia.dsw similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/build/pjmedia.dsw rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/build/pjmedia.dsw diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/build/pjmedia.vcproj b/sflphone-common/libs/pjproject-1.0.2/pjmedia/build/pjmedia.vcproj similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/build/pjmedia.vcproj rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/build/pjmedia.vcproj diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/build/pjmedia_codec.dsp b/sflphone-common/libs/pjproject-1.0.2/pjmedia/build/pjmedia_codec.dsp similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/build/pjmedia_codec.dsp rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/build/pjmedia_codec.dsp diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/build/pjmedia_codec.vcproj b/sflphone-common/libs/pjproject-1.0.2/pjmedia/build/pjmedia_codec.vcproj similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/build/pjmedia_codec.vcproj rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/build/pjmedia_codec.vcproj diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/build/pjmedia_test.dsp b/sflphone-common/libs/pjproject-1.0.2/pjmedia/build/pjmedia_test.dsp similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/build/pjmedia_test.dsp rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/build/pjmedia_test.dsp diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/build/pjmedia_test.vcproj b/sflphone-common/libs/pjproject-1.0.2/pjmedia/build/pjmedia_test.vcproj similarity index 94% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/build/pjmedia_test.vcproj rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/build/pjmedia_test.vcproj index 786bb466c76f4fb5a1b75fe111d25d3d768c122c..939b4cc6f132078511a31281141b887f6762c5ea 100644 --- a/sflphone-common/libs/pjproject-1.0.1/pjmedia/build/pjmedia_test.vcproj +++ b/sflphone-common/libs/pjproject-1.0.2/pjmedia/build/pjmedia_test.vcproj @@ -71,7 +71,7 @@ <Tool Name="VCLinkerTool" AdditionalDependencies="dsound.lib dxguid.lib netapi32.lib mswsock.lib ws2_32.lib odbc32.lib odbccp32.lib ole32.lib user32.lib" - OutputFile="../bin/pjmedia_test_vc8d.exe" + OutputFile="../bin/pjmedia-test-i386-win32-vc8-debug.exe" LinkIncremental="2" SuppressStartupBanner="true" GenerateDebugInformation="true" @@ -164,7 +164,7 @@ <Tool Name="VCLinkerTool" AdditionalDependencies="dsound.lib dxguid.lib netapi32.lib mswsock.lib ws2_32.lib odbc32.lib odbccp32.lib ole32.lib user32.lib" - OutputFile="../bin/pjmedia_test_vc8.exe" + OutputFile="../bin/pjmedia-test-i386-win32-vc8-release.exe" LinkIncremental="1" SuppressStartupBanner="true" ProgramDatabaseFile=".\output\pjmedia_test_vc6_Release/pjmedia_test_vc6.pdb" diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/build/wince-evc4/pjmedia_codec_wince.vcp b/sflphone-common/libs/pjproject-1.0.2/pjmedia/build/wince-evc4/pjmedia_codec_wince.vcp similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/build/wince-evc4/pjmedia_codec_wince.vcp rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/build/wince-evc4/pjmedia_codec_wince.vcp diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/build/wince-evc4/pjmedia_test.vcp b/sflphone-common/libs/pjproject-1.0.2/pjmedia/build/wince-evc4/pjmedia_test.vcp similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/build/wince-evc4/pjmedia_test.vcp rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/build/wince-evc4/pjmedia_test.vcp diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/build/wince-evc4/pjmedia_wince.vcp b/sflphone-common/libs/pjproject-1.0.2/pjmedia/build/wince-evc4/pjmedia_wince.vcp similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/build/wince-evc4/pjmedia_wince.vcp rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/build/wince-evc4/pjmedia_wince.vcp diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/build/wince-evc4/pjmedia_wince.vcw b/sflphone-common/libs/pjproject-1.0.2/pjmedia/build/wince-evc4/pjmedia_wince.vcw similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/build/wince-evc4/pjmedia_wince.vcw rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/build/wince-evc4/pjmedia_wince.vcw diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/docs/doxygen.cfg b/sflphone-common/libs/pjproject-1.0.2/pjmedia/docs/doxygen.cfg similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/docs/doxygen.cfg rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/docs/doxygen.cfg diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/docs/footer.html b/sflphone-common/libs/pjproject-1.0.2/pjmedia/docs/footer.html similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/docs/footer.html rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/docs/footer.html diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/docs/header.html b/sflphone-common/libs/pjproject-1.0.2/pjmedia/docs/header.html similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/docs/header.html rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/docs/header.html diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/docs/master-port.jpg b/sflphone-common/libs/pjproject-1.0.2/pjmedia/docs/master-port.jpg similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/docs/master-port.jpg rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/docs/master-port.jpg diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/docs/media-flow.jpg b/sflphone-common/libs/pjproject-1.0.2/pjmedia/docs/media-flow.jpg similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/docs/media-flow.jpg rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/docs/media-flow.jpg diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/docs/media-flow.vsd b/sflphone-common/libs/pjproject-1.0.2/pjmedia/docs/media-flow.vsd similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/docs/media-flow.vsd rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/docs/media-flow.vsd diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/docs/media-srtp-transport.PNG b/sflphone-common/libs/pjproject-1.0.2/pjmedia/docs/media-srtp-transport.PNG similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/docs/media-srtp-transport.PNG rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/docs/media-srtp-transport.PNG diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/docs/media-transport.PNG b/sflphone-common/libs/pjproject-1.0.2/pjmedia/docs/media-transport.PNG similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/docs/media-transport.PNG rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/docs/media-transport.PNG diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/docs/sample-manual-resampling.jpg b/sflphone-common/libs/pjproject-1.0.2/pjmedia/docs/sample-manual-resampling.jpg similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/docs/sample-manual-resampling.jpg rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/docs/sample-manual-resampling.jpg diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/docs/siprtp.jpg b/sflphone-common/libs/pjproject-1.0.2/pjmedia/docs/siprtp.jpg similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/docs/siprtp.jpg rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/docs/siprtp.jpg diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/docs/sndtest.jpg b/sflphone-common/libs/pjproject-1.0.2/pjmedia/docs/sndtest.jpg similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/docs/sndtest.jpg rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/docs/sndtest.jpg diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia-codec.h b/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia-codec.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia-codec.h rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia-codec.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia-codec/amr_helper.h b/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia-codec/amr_helper.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia-codec/amr_helper.h rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia-codec/amr_helper.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia-codec/config.h b/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia-codec/config.h similarity index 99% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia-codec/config.h rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia-codec/config.h index 88847b9c4e01e6071aa94266e680ecf7570bc0f4..3b1af93cb6866bc36b5d51e068d727530fa62140 100644 --- a/sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia-codec/config.h +++ b/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia-codec/config.h @@ -1,5 +1,5 @@ /* $Id: config.h 2394 2008-12-23 17:27:53Z bennylp $ */ -/* +/* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> * @@ -15,7 +15,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __PJMEDIA_CODEC_CONFIG_H__ #define __PJMEDIA_CODEC_CONFIG_H__ @@ -118,7 +118,7 @@ /** * Enable Intel IPP AMR codec. This also needs to be enabled when AMR WB - * codec is enabled. This option is only used when PJMEDIA_HAS_INTEL_IPP + * codec is enabled. This option is only used when PJMEDIA_HAS_INTEL_IPP * is enabled. * * Default: 1 @@ -130,7 +130,7 @@ /** * Enable Intel IPP AMR wideband codec. The PJMEDIA_HAS_INTEL_IPP_CODEC_AMR - * option must also be enabled to use this codec. This option is only used + * option must also be enabled to use this codec. This option is only used * when PJMEDIA_HAS_INTEL_IPP is enabled. * * Default: 1 diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia-codec/config_auto.h b/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia-codec/config_auto.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia-codec/config_auto.h rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia-codec/config_auto.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia-codec/config_auto.h.in b/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia-codec/config_auto.h.in similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia-codec/config_auto.h.in rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia-codec/config_auto.h.in diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia-codec/g722.h b/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia-codec/g722.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia-codec/g722.h rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia-codec/g722.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia-codec/gsm.h b/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia-codec/gsm.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia-codec/gsm.h rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia-codec/gsm.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia-codec/ilbc.h b/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia-codec/ilbc.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia-codec/ilbc.h rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia-codec/ilbc.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia-codec/ipp_codecs.h b/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia-codec/ipp_codecs.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia-codec/ipp_codecs.h rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia-codec/ipp_codecs.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia-codec/l16.h b/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia-codec/l16.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia-codec/l16.h rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia-codec/l16.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia-codec/speex.h b/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia-codec/speex.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia-codec/speex.h rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia-codec/speex.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia-codec/types.h b/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia-codec/types.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia-codec/types.h rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia-codec/types.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia.h b/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia.h rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia/alaw_ulaw.h b/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/alaw_ulaw.h similarity index 68% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia/alaw_ulaw.h rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/alaw_ulaw.h index 94483c9ee28e78ebb324bf2fd8d633cab4188e58..530882e31b12026d15964b930b87888b1fb62092 100644 --- a/sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia/alaw_ulaw.h +++ b/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/alaw_ulaw.h @@ -1,4 +1,4 @@ -/* $Id: alaw_ulaw.h 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: alaw_ulaw.h 2416 2009-01-05 15:27:02Z nanang $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -139,6 +139,74 @@ PJ_DECL(unsigned char) pjmedia_ulaw2alaw(unsigned char uval); #endif +/** + * Encode 16-bit linear PCM data to 8-bit U-Law data. + * + * @param dst Destination buffer for 8-bit U-Law data. + * @param src Source, 16-bit linear PCM data. + * @param len Number of samples. + */ +PJ_INLINE(void) pjmedia_ulaw_encode(pj_uint8_t *dst, const pj_int16_t *src, + pj_size_t len) +{ + const pj_int16_t *end = src + len; + + while (src < end) { + *dst++ = pjmedia_linear2ulaw(*src++); + } +} + +/** + * Encode 16-bit linear PCM data to 8-bit A-Law data. + * + * @param dst Destination buffer for 8-bit A-Law data. + * @param src Source, 16-bit linear PCM data. + * @param len Number of samples. + */ +PJ_INLINE(void) pjmedia_alaw_encode(pj_uint8_t *dst, const pj_int16_t *src, + pj_size_t len) +{ + const pj_int16_t *end = src + len; + + while (src < end) { + *dst++ = pjmedia_linear2alaw(*src++); + } +} + +/** + * Decode 8-bit U-Law data to 16-bit linear PCM data. + * + * @param dst Destination buffer for 16-bit PCM data. + * @param src Source, 8-bit U-Law data. + * @param len Number of samples. + */ +PJ_INLINE(void) pjmedia_ulaw_decode(pj_int16_t *dst, const pj_uint8_t *src, + pj_size_t len) +{ + const pj_uint8_t *end = src + len; + + while (src < end) { + *dst++ = pjmedia_ulaw2linear(*src++); + } +} + +/** + * Decode 8-bit A-Law data to 16-bit linear PCM data. + * + * @param dst Destination buffer for 16-bit PCM data. + * @param src Source, 8-bit A-Law data. + * @param len Number of samples. + */ +PJ_INLINE(void) pjmedia_alaw_decode(pj_int16_t *dst, const pj_uint8_t *src, + pj_size_t len) +{ + const pj_uint8_t *end = src + len; + + while (src < end) { + *dst++ = pjmedia_alaw2linear(*src++); + } +} + PJ_END_DECL #endif /* __PJMEDIA_ALAW_ULAW_H__ */ diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia/bidirectional.h b/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/bidirectional.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia/bidirectional.h rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/bidirectional.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia/circbuf.h b/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/circbuf.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia/circbuf.h rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/circbuf.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia/clock.h b/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/clock.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia/clock.h rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/clock.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia/codec.h b/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/codec.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia/codec.h rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/codec.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia/conference.h b/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/conference.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia/conference.h rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/conference.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia/config.h b/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/config.h similarity index 96% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia/config.h rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/config.h index 866359e4c1a64489a0e49b6366d90a88725e35ac..d52d0996ae7cc5cfe829e18ab94dfb14adcebf56 100644 --- a/sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia/config.h +++ b/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/config.h @@ -1,5 +1,5 @@ /* $Id: config.h 2394 2008-12-23 17:27:53Z bennylp $ */ -/* +/* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> * @@ -15,7 +15,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __PJMEDIA_CONFIG_H__ #define __PJMEDIA_CONFIG_H__ @@ -60,7 +60,7 @@ /** Constant for Win32 MME sound backend. */ #define PJMEDIA_SOUND_WIN32_MME_SOUND 3 -/** When this is set, pjmedia will not provide any sound device backend. +/** When this is set, pjmedia will not provide any sound device backend. * Application will have to provide its own sound device backend * and link the application with it. */ @@ -106,7 +106,7 @@ /** * Specify whether delay buffer is used for sound device. - * When delay buffer is enabled, the sound device callback + * When delay buffer is enabled, the sound device callback * will be called one after another evenly. * The delay buffer also performs the best delay calculation * for the sound device, and will try to limit the delay caused @@ -137,21 +137,21 @@ /** * This denotes implementation of WSOLA using fixed or floating point WSOLA * algorithm. This implementation provides the best quality of the result, - * at the expense of one frame delay and intensive processing power + * at the expense of one frame delay and intensive processing power * requirement. */ #define PJMEDIA_WSOLA_IMP_WSOLA 1 /** - * This denotes implementation of WSOLA algorithm with faster waveform - * similarity calculation. This implementation provides fair quality of + * This denotes implementation of WSOLA algorithm with faster waveform + * similarity calculation. This implementation provides fair quality of * the result with the main advantage of low processing power requirement. */ #define PJMEDIA_WSOLA_IMP_WSOLA_LITE 2 /** * Specify type of Waveform based Similarity Overlap and Add (WSOLA) backend - * implementation to be used. WSOLA is an algorithm to expand and/or compress + * implementation to be used. WSOLA is an algorithm to expand and/or compress * audio frames without changing the pitch, and used by the delaybuf and as PLC * backend algorithm. * @@ -165,7 +165,7 @@ /** * Specify number of sound buffers. Larger number is better for sound * stability and to accommodate sound devices that are unable to send frames - * in timely manner, however it would probably cause more audio delay (and + * in timely manner, however it would probably cause more audio delay (and * definitely will take more memory). One individual buffer is normally 10ms * or 20 ms long, depending on ptime settings (samples_per_frame value). * @@ -248,13 +248,13 @@ */ #define PJMEDIA_RESAMPLE_NONE 1 /**< No resampling. */ #define PJMEDIA_RESAMPLE_LIBRESAMPLE 2 /**< Sample rate conversion - using libresample. */ +using libresample. */ #define PJMEDIA_RESAMPLE_SPEEX 3 /**< Sample rate conversion - using Speex. */ +using Speex. */ #define PJMEDIA_RESAMPLE_LIBSAMPLERATE 4 /**< Sample rate conversion - using libsamplerate - (a.k.a Secret Rabbit Code) - */ +using libsamplerate +(a.k.a Secret Rabbit Code) +*/ /** * Select which resample implementation to use. Currently pjmedia supports: @@ -294,7 +294,7 @@ * This (among other thing) will affect the size of buffers to be allocated * for outgoing packets. */ -#ifndef PJMEDIA_MAX_FRAME_DURATION_MS +#ifndef PJMEDIA_MAX_FRAME_DURATION_MS # define PJMEDIA_MAX_FRAME_DURATION_MS 200 #endif @@ -302,7 +302,7 @@ /** * Max packet size to support. */ -#ifndef PJMEDIA_MAX_MTU +#ifndef PJMEDIA_MAX_MTU # define PJMEDIA_MAX_MTU 1500 #endif @@ -310,7 +310,7 @@ /** * DTMF/telephone-event duration, in timestamp. */ -#ifndef PJMEDIA_DTMF_DURATION +#ifndef PJMEDIA_DTMF_DURATION # define PJMEDIA_DTMF_DURATION 1600 /* in timestamp */ #endif @@ -320,7 +320,7 @@ * remote address required to make the stream switch transmission * to the source address. */ -#ifndef PJMEDIA_RTP_NAT_PROBATION_CNT +#ifndef PJMEDIA_RTP_NAT_PROBATION_CNT # define PJMEDIA_RTP_NAT_PROBATION_CNT 10 #endif @@ -361,9 +361,9 @@ /** * Specify whether RTCP XR support should be built into PJMEDIA. Disabling - * this feature will reduce footprint slightly. Note that even when this - * setting is enabled, RTCP XR processing will only be performed in stream - * if it is enabled on run-time on per stream basis. See + * this feature will reduce footprint slightly. Note that even when this + * setting is enabled, RTCP XR processing will only be performed in stream + * if it is enabled on run-time on per stream basis. See * PJMEDIA_STREAM_ENABLE_XR setting for more info. * * Default: 1 (yes). @@ -375,7 +375,7 @@ /** * The RTCP XR feature is activated and used by stream if \a enable_rtcp_xr - * field of \a pjmedia_stream_info structure is non-zero. This setting + * field of \a pjmedia_stream_info structure is non-zero. This setting * controls the default value of this field. * * Default: 0 (disabled) @@ -394,7 +394,7 @@ * * Specify zero to disable this feature. * - * Default: 600 msec (which gives good probability that some RTP + * Default: 600 msec (which gives good probability that some RTP * packets will reach the destination, but without * filling up the jitter buffer on the remote end). */ @@ -404,13 +404,13 @@ /** - * Specify the maximum duration of silence period in the codec, in msec. + * Specify the maximum duration of silence period in the codec, in msec. * This is useful for example to keep NAT binding open in the firewall - * and to prevent server from disconnecting the call because no + * and to prevent server from disconnecting the call because no * RTP packet is received. * * This only applies to codecs that use PJMEDIA's VAD (pretty much - * everything including iLBC, except Speex, which has its own DTX + * everything including iLBC, except Speex, which has its own DTX * mechanism). * * Use (-1) to disable this feature. @@ -462,7 +462,7 @@ * remote, or should it rather use the codec preference as specified by * local endpoint. * - * For example, suppose incoming call has codec order "8 0 3", while + * For example, suppose incoming call has codec order "8 0 3", while * local codec order is "3 0 8". If remote codec order is preferable, * the selected codec will be 8, while if local codec order is preferable, * the selected codec will be 3. @@ -490,7 +490,7 @@ /** - * This macro controls whether pjmedia should include SDP rtpmap + * This macro controls whether pjmedia should include SDP rtpmap * attribute for static payload types. SDP rtpmap for static * payload types are optional, although they are normally included * for interoperability reason. @@ -544,12 +544,12 @@ #endif -/* +/* * Below specifies the various tone generator backend algorithm. */ -/** - * The math's sine(), floating point. This has very good precision +/** + * The math's sine(), floating point. This has very good precision * but it's the slowest and requires floating point support and * linking with the math library. */ @@ -565,7 +565,7 @@ /** * Fixed point using sine signal generated by Cordic algorithm. This * algorithm can be tuned to provide balance between precision and - * performance by tuning the PJMEDIA_TONEGEN_FIXED_POINT_CORDIC_LOOP + * performance by tuning the PJMEDIA_TONEGEN_FIXED_POINT_CORDIC_LOOP * setting, and may be suitable for platforms that lack floating-point * support. */ @@ -580,7 +580,7 @@ /** - * Specify the tone generator algorithm to be used. Please see + * Specify the tone generator algorithm to be used. Please see * http://trac.pjsip.org/repos/wiki/Tone_Generator for the performance * analysis results of the various tone generator algorithms. * @@ -600,7 +600,7 @@ /** * Specify the number of calculation loops to generate the tone, when * PJMEDIA_TONEGEN_FIXED_POINT_CORDIC algorithm is used. With more calculation - * loops, the tone signal gets more precise, but this will add more + * loops, the tone signal gets more precise, but this will add more * processing. * * Valid values are 1 to 28. @@ -688,8 +688,8 @@ /** * Transport info (pjmedia_transport_info) contains a socket info and list - * of transport specific info, since transports can be chained together - * (for example, SRTP transport uses UDP transport as the underlying + * of transport specific info, since transports can be chained together + * (for example, SRTP transport uses UDP transport as the underlying * transport). This constant specifies maximum number of transport specific * infos that can be held in a transport info. */ diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia/config_auto.h b/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/config_auto.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia/config_auto.h rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/config_auto.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia/config_auto.h.in b/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/config_auto.h.in similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia/config_auto.h.in rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/config_auto.h.in diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia/delaybuf.h b/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/delaybuf.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia/delaybuf.h rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/delaybuf.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia/doxygen.h b/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/doxygen.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia/doxygen.h rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/doxygen.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia/echo.h b/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/echo.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia/echo.h rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/echo.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia/echo_port.h b/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/echo_port.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia/echo_port.h rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/echo_port.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia/endpoint.h b/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/endpoint.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia/endpoint.h rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/endpoint.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia/errno.h b/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/errno.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia/errno.h rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/errno.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia/g711.h b/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/g711.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia/g711.h rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/g711.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia/jbuf.h b/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/jbuf.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia/jbuf.h rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/jbuf.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia/master_port.h b/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/master_port.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia/master_port.h rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/master_port.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia/mem_port.h b/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/mem_port.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia/mem_port.h rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/mem_port.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia/null_port.h b/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/null_port.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia/null_port.h rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/null_port.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia/plc.h b/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/plc.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia/plc.h rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/plc.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia/port.h b/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/port.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia/port.h rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/port.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia/resample.h b/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/resample.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia/resample.h rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/resample.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia/rtcp.h b/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/rtcp.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia/rtcp.h rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/rtcp.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia/rtcp_xr.h b/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/rtcp_xr.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia/rtcp_xr.h rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/rtcp_xr.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia/rtp.h b/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/rtp.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia/rtp.h rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/rtp.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia/sdp.h b/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/sdp.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia/sdp.h rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/sdp.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia/sdp_neg.h b/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/sdp_neg.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia/sdp_neg.h rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/sdp_neg.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia/session.h b/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/session.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia/session.h rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/session.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia/silencedet.h b/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/silencedet.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia/silencedet.h rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/silencedet.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia/sound.h b/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/sound.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia/sound.h rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/sound.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia/sound_port.h b/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/sound_port.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia/sound_port.h rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/sound_port.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia/splitcomb.h b/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/splitcomb.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia/splitcomb.h rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/splitcomb.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia/stereo.h b/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/stereo.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia/stereo.h rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/stereo.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia/stream.h b/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/stream.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia/stream.h rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/stream.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia/symbian_sound_aps.h b/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/symbian_sound_aps.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia/symbian_sound_aps.h rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/symbian_sound_aps.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia/tonegen.h b/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/tonegen.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia/tonegen.h rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/tonegen.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia/transport.h b/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/transport.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia/transport.h rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/transport.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia/transport_adapter_sample.h b/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/transport_adapter_sample.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia/transport_adapter_sample.h rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/transport_adapter_sample.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia/transport_ice.h b/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/transport_ice.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia/transport_ice.h rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/transport_ice.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia/transport_loop.h b/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/transport_loop.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia/transport_loop.h rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/transport_loop.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia/transport_srtp.h b/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/transport_srtp.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia/transport_srtp.h rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/transport_srtp.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia/transport_udp.h b/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/transport_udp.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia/transport_udp.h rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/transport_udp.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia/types.h b/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/types.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia/types.h rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/types.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia/wav_playlist.h b/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/wav_playlist.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia/wav_playlist.h rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/wav_playlist.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia/wav_port.h b/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/wav_port.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia/wav_port.h rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/wav_port.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia/wave.h b/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/wave.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia/wave.h rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/wave.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia/wsola.h b/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/wsola.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/include/pjmedia/wsola.h rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/wsola.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia-codec/g722.c b/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia-codec/g722.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia-codec/g722.c rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia-codec/g722.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia-codec/g722/g722_dec.c b/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia-codec/g722/g722_dec.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia-codec/g722/g722_dec.c rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia-codec/g722/g722_dec.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia-codec/g722/g722_dec.h b/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia-codec/g722/g722_dec.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia-codec/g722/g722_dec.h rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia-codec/g722/g722_dec.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia-codec/g722/g722_enc.c b/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia-codec/g722/g722_enc.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia-codec/g722/g722_enc.c rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia-codec/g722/g722_enc.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia-codec/g722/g722_enc.h b/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia-codec/g722/g722_enc.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia-codec/g722/g722_enc.h rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia-codec/g722/g722_enc.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia-codec/gsm.c b/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia-codec/gsm.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia-codec/gsm.c rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia-codec/gsm.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia-codec/ilbc.c b/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia-codec/ilbc.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia-codec/ilbc.c rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia-codec/ilbc.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia-codec/ipp_codecs.c b/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia-codec/ipp_codecs.c similarity index 98% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia-codec/ipp_codecs.c rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia-codec/ipp_codecs.c index a897158aeaedcd81541b9c2d8c2b3051357b67b0..2ae0654012e2ddde699b89fd0ff1553055fd062b 100644 --- a/sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia-codec/ipp_codecs.c +++ b/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia-codec/ipp_codecs.c @@ -1,4 +1,4 @@ -/* $Id: ipp_codecs.c 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: ipp_codecs.c 2543 2009-03-23 13:22:45Z nanang $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -37,6 +37,7 @@ #if defined(PJMEDIA_HAS_INTEL_IPP) && PJMEDIA_HAS_INTEL_IPP != 0 #include <usc.h> +#include <ippversion.h> #define THIS_FILE "ipp_codecs.c" @@ -1046,12 +1047,12 @@ static pj_status_t ipp_codec_open( pjmedia_codec *codec, if (s->enc_mode < 0) goto on_error; - s->enc_setting.amr_nb = ippc->pt == PJMEDIA_RTP_PT_AMR; + s->enc_setting.amr_nb = (pj_uint8_t)(ippc->pt == PJMEDIA_RTP_PT_AMR); s->enc_setting.octet_aligned = octet_align; s->enc_setting.reorder = PJ_TRUE; s->enc_setting.cmr = 15; - s->dec_setting.amr_nb = ippc->pt == PJMEDIA_RTP_PT_AMR; + s->dec_setting.amr_nb = (pj_uint8_t)(ippc->pt == PJMEDIA_RTP_PT_AMR); s->dec_setting.octet_aligned = octet_align; s->dec_setting.reorder = PJ_TRUE; } @@ -1412,7 +1413,18 @@ static pj_status_t ipp_codec_recover(pjmedia_codec *codec, # pragma comment( lib, "ipps.lib") # pragma comment( lib, "ippsc.lib") # pragma comment( lib, "ippsr.lib") -# pragma comment( lib, "usc.lib") +//# pragma comment( lib, "ippcorel.lib") +//# pragma comment( lib, "ippsemerged.lib") +//# pragma comment( lib, "ippsmerged.lib") +//# pragma comment( lib, "ippscemerged.lib") +//# pragma comment( lib, "ippscmerged.lib") +//# pragma comment( lib, "ippsremerged.lib") +//# pragma comment( lib, "ippsrmerged.lib") +# if defined(IPP_VERSION_MAJOR) && IPP_VERSION_MAJOR>=6 +# pragma comment( lib, "speech.lib") +# else +# pragma comment( lib, "usc.lib") +# endif #endif diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia-codec/l16.c b/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia-codec/l16.c similarity index 97% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia-codec/l16.c rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia-codec/l16.c index 2f69f3e3f45054b7020cda2e86ccaf5be8914c78..c4aee2ab9d436298f05751156da0579ab1199a6d 100644 --- a/sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia-codec/l16.c +++ b/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia-codec/l16.c @@ -1,4 +1,4 @@ -/* $Id: l16.c 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: l16.c 2547 2009-03-23 13:27:54Z nanang $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -98,7 +98,11 @@ static pjmedia_codec_op l16_op = &l16_parse, &l16_encode, &l16_decode, +#if !PLC_DISABLED &l16_recover +#else + NULL +#endif }; /* Definition for L16 codec factory operations. */ @@ -128,8 +132,8 @@ struct l16_data unsigned frame_size; /* Frame size, in bytes */ unsigned clock_rate; /* Clock rate */ - pj_bool_t plc_enabled; #if !PLC_DISABLED + pj_bool_t plc_enabled; pjmedia_plc *plc; #endif pj_bool_t vad_enabled; @@ -421,7 +425,7 @@ static pj_status_t l16_enum_codecs( pjmedia_codec_factory *factory, if (count < *max_count) { /* 48KHz stereo */ codecs[count].type = PJMEDIA_TYPE_AUDIO; - codecs[count].pt = PJMEDIA_RTP_PT_L16_48KHZ_MONO; + codecs[count].pt = PJMEDIA_RTP_PT_L16_48KHZ_STEREO; codecs[count].encoding_name = STR_L16; codecs[count].clock_rate = 48000; codecs[count].channel_cnt = 2; @@ -526,9 +530,17 @@ static pj_status_t l16_init( pjmedia_codec *codec, pj_pool_t *pool ) static pj_status_t l16_open(pjmedia_codec *codec, pjmedia_codec_param *attr ) { - /* Nothing to do.. */ - PJ_UNUSED_ARG(codec); - PJ_UNUSED_ARG(attr); + struct l16_data *data = NULL; + + PJ_ASSERT_RETURN(codec && codec->codec_data && attr, PJ_EINVAL); + + data = (struct l16_data*) codec->codec_data; + + data->vad_enabled = (attr->setting.vad != 0); +#if !PLC_DISABLED + data->plc_enabled = (attr->setting.plc != 0); +#endif + return PJ_SUCCESS; } @@ -547,7 +559,9 @@ static pj_status_t l16_modify(pjmedia_codec *codec, pj_assert(data != NULL); data->vad_enabled = (attr->setting.vad != 0); +#if !PLC_DISABLED data->plc_enabled = (attr->setting.plc != 0); +#endif return PJ_SUCCESS; } diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia-codec/speex_codec.c b/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia-codec/speex_codec.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia-codec/speex_codec.c rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia-codec/speex_codec.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/alaw_ulaw.c b/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/alaw_ulaw.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/alaw_ulaw.c rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/alaw_ulaw.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/alaw_ulaw_table.c b/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/alaw_ulaw_table.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/alaw_ulaw_table.c rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/alaw_ulaw_table.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/bidirectional.c b/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/bidirectional.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/bidirectional.c rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/bidirectional.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/clock_thread.c b/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/clock_thread.c similarity index 96% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/clock_thread.c rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/clock_thread.c index 94c24274bfcffd2f61697fe9cc6aa7df9ef86c17..f1cd1518673b720b89a53b741cc84ffd1fdde0e7 100644 --- a/sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/clock_thread.c +++ b/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/clock_thread.c @@ -1,4 +1,4 @@ -/* $Id: clock_thread.c 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: clock_thread.c 2550 2009-03-23 13:32:39Z nanang $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -35,7 +35,7 @@ struct pjmedia_clock pj_timestamp interval; pj_timestamp next_tick; pj_timestamp timestamp; - unsigned samples_per_frame; + unsigned timestamp_inc; unsigned options; pj_uint64_t max_jump; pjmedia_clock_callback *cb; @@ -81,7 +81,7 @@ PJ_DEF(pj_status_t) pjmedia_clock_create( pj_pool_t *pool, clock->next_tick.u64 = 0; clock->timestamp.u64 = 0; clock->max_jump = MAX_JUMP_MSEC * clock->freq.u64 / 1000; - clock->samples_per_frame = samples_per_frame; + clock->timestamp_inc = samples_per_frame / channel_count; clock->options = options; clock->cb = cb; clock->user_data = user_data; @@ -200,7 +200,7 @@ PJ_DEF(pj_bool_t) pjmedia_clock_wait( pjmedia_clock *clock, ts->u64 = clock->timestamp.u64; /* Increment timestamp */ - clock->timestamp.u64 += clock->samples_per_frame; + clock->timestamp.u64 += clock->timestamp_inc; /* Calculate next tick */ clock_calc_next_tick(clock, &now); @@ -255,7 +255,7 @@ static int clock_thread(void *arg) (*clock->cb)(&clock->timestamp, clock->user_data); /* Increment timestamp */ - clock->timestamp.u64 += clock->samples_per_frame; + clock->timestamp.u64 += clock->timestamp_inc; /* Calculate next tick */ clock_calc_next_tick(clock, &now); diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/codec.c b/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/codec.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/codec.c rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/codec.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/conference.c b/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/conference.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/conference.c rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/conference.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/delaybuf.c b/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/delaybuf.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/delaybuf.c rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/delaybuf.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/dsound.c b/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/dsound.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/dsound.c rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/dsound.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/echo_common.c b/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/echo_common.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/echo_common.c rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/echo_common.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/echo_internal.h b/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/echo_internal.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/echo_internal.h rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/echo_internal.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/echo_port.c b/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/echo_port.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/echo_port.c rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/echo_port.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/echo_speex.c b/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/echo_speex.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/echo_speex.c rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/echo_speex.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/echo_suppress.c b/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/echo_suppress.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/echo_suppress.c rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/echo_suppress.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/endpoint.c b/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/endpoint.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/endpoint.c rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/endpoint.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/errno.c b/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/errno.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/errno.c rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/errno.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/g711.c b/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/g711.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/g711.c rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/g711.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/jbuf.c b/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/jbuf.c similarity index 98% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/jbuf.c rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/jbuf.c index ba8c4e6238b152fb958cf63cb24d66ef79656573..75c3e11e7dbc5fbed8168be1bb25488dea727ffd 100644 --- a/sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/jbuf.c +++ b/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/jbuf.c @@ -1,4 +1,4 @@ -/* $Id: jbuf.c 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: jbuf.c 2549 2009-03-23 13:30:26Z nanang $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -267,6 +267,13 @@ static pj_bool_t jb_framelist_put_at(jb_framelist_t *framelist, framelist->flist_max_count; } } else { + // check if frame is not too late, but watch out for sequence restart. + if (index < framelist->flist_origin && + framelist->flist_origin - index < 0x7FFF) + { + return PJ_FALSE; + } + where = framelist->flist_tail; framelist->flist_origin = index; framelist->flist_tail = (framelist->flist_tail + 1) % diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/master_port.c b/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/master_port.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/master_port.c rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/master_port.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/mem_capture.c b/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/mem_capture.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/mem_capture.c rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/mem_capture.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/mem_player.c b/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/mem_player.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/mem_player.c rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/mem_player.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/null_port.c b/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/null_port.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/null_port.c rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/null_port.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/nullsound.c b/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/nullsound.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/nullsound.c rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/nullsound.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/pasound.c b/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/pasound.c similarity index 95% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/pasound.c rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/pasound.c index 000862424bcffadd7085feb204d2dfb477faf618..368be5058c96ba2e4813f7a0158ac4ff2ede515b 100644 --- a/sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/pasound.c +++ b/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/pasound.c @@ -1,4 +1,4 @@ -/* $Id: pasound.c 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: pasound.c 2535 2009-03-23 13:10:44Z nanang $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -72,12 +72,12 @@ struct pjmedia_snd_stream pj_bool_t quit_flag; pj_bool_t rec_thread_exited; - //pj_bool_t rec_thread_initialized; + pj_bool_t rec_thread_initialized; pj_thread_desc rec_thread_desc; pj_thread_t *rec_thread; pj_bool_t play_thread_exited; - //pj_bool_t play_thread_initialized; + pj_bool_t play_thread_initialized; pj_thread_desc play_thread_desc; pj_thread_t *play_thread; @@ -118,13 +118,18 @@ static int PaRecorderCallback(const void *input, if (input == NULL) return paContinue; - // Sometime the thread, where this callback called from, is changed - // (e.g: in MacOS this happens when plugging/unplugging headphone) - // if (stream->rec_thread_initialized == 0) { - if (!pj_thread_is_registered()) { + /* Known cases of callback's thread: + * - The thread may be changed in the middle of a session, e.g: in MacOS + * it happens when plugging/unplugging headphone. + * - The same thread may be reused in consecutive sessions. The first + * session will leave TLS set, but release the TLS data address, + * so the second session must re-register the callback's thread. + */ + if (stream->rec_thread_initialized == 0 || !pj_thread_is_registered()) + { status = pj_thread_register("pa_rec", stream->rec_thread_desc, &stream->rec_thread); - //stream->rec_thread_initialized = 1; + stream->rec_thread_initialized = 1; PJ_LOG(5,(THIS_FILE, "Recorder thread started")); } @@ -214,13 +219,18 @@ static int PaPlayerCallback( const void *input, if (output == NULL) return paContinue; - // Sometime the thread, where this callback called from, is changed - // (e.g: in MacOS this happens when plugging/unplugging headphone) - // if (stream->play_thread_initialized == 0) { - if (!pj_thread_is_registered()) { + /* Known cases of callback's thread: + * - The thread may be changed in the middle of a session, e.g: in MacOS + * it happens when plugging/unplugging headphone. + * - The same thread may be reused in consecutive sessions. The first + * session will leave TLS set, but release the TLS data address, + * so the second session must re-register the callback's thread. + */ + if (stream->play_thread_initialized == 0 || !pj_thread_is_registered()) + { status = pj_thread_register("portaudio", stream->play_thread_desc, &stream->play_thread); - //stream->play_thread_initialized = 1; + stream->play_thread_initialized = 1; PJ_LOG(5,(THIS_FILE, "Player thread started")); } @@ -953,6 +963,9 @@ PJ_DEF(pj_status_t) pjmedia_snd_stream_stop(pjmedia_snd_stream *stream) if (stream->rec_strm && stream->rec_strm != stream->play_strm) err = Pa_StopStream(stream->rec_strm); + stream->play_thread_initialized = 0; + stream->rec_thread_initialized = 0; + PJ_LOG(5,(THIS_FILE, "Done, status=%d", err)); return err ? PJMEDIA_ERRNO_FROM_PORTAUDIO(err) : PJ_SUCCESS; diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/plc_common.c b/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/plc_common.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/plc_common.c rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/plc_common.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/port.c b/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/port.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/port.c rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/port.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/resample_libsamplerate.c b/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/resample_libsamplerate.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/resample_libsamplerate.c rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/resample_libsamplerate.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/resample_port.c b/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/resample_port.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/resample_port.c rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/resample_port.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/resample_resample.c b/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/resample_resample.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/resample_resample.c rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/resample_resample.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/resample_speex.c b/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/resample_speex.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/resample_speex.c rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/resample_speex.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/rtcp.c b/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/rtcp.c similarity index 99% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/rtcp.c rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/rtcp.c index 9fded1e5ef580f38348a50efd7dafa609242ceef..76ca4d647f11efdf9882788a0fc4706e0394e2e9 100644 --- a/sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/rtcp.c +++ b/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/rtcp.c @@ -1,4 +1,4 @@ -/* $Id: rtcp.c 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: rtcp.c 2529 2009-03-23 12:53:56Z nanang $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -62,7 +62,7 @@ PJ_DEF(pj_status_t) pjmedia_rtcp_get_ntp_time(const pjmedia_rtcp_session *sess, + sess->tv_base.sec + JAN_1970; /* Calculate seconds fractions */ - ts.u64 %= sess->ts_freq.u64; + ts.u64 = (ts.u64 - sess->ts_base.u64) % sess->ts_freq.u64; pj_assert(ts.u64 < sess->ts_freq.u64); ts.u64 = (ts.u64 << 32) / sess->ts_freq.u64; diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/rtcp_xr.c b/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/rtcp_xr.c similarity index 93% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/rtcp_xr.c rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/rtcp_xr.c index 6abd0f6b2632db452f672b5bc3d8e6e7d5dc13e6..e72de376e8186a1a06d9ccb65106315cf72189fb 100644 --- a/sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/rtcp_xr.c +++ b/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/rtcp_xr.c @@ -1,4 +1,4 @@ -/* $Id: rtcp_xr.c 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: rtcp_xr.c 2545 2009-03-23 13:25:26Z nanang $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -27,7 +27,7 @@ #include <pj/sock.h> #include <pj/string.h> -#if 1 //defined(PJMEDIA_HAS_RTCP_XR) && (PJMEDIA_HAS_RTCP_XR != 0) +#if defined(PJMEDIA_HAS_RTCP_XR) && (PJMEDIA_HAS_RTCP_XR != 0) #define THIS_FILE "rtcp_xr.c" @@ -246,7 +246,7 @@ PJ_DEF(void) pjmedia_rtcp_build_rtcp_xr( pjmedia_rtcp_xr_session *sess, pj_uint32_t c31; pj_uint32_t c32; pj_uint32_t c33; - pj_uint32_t ctotal, p32, p23, m; + pj_uint32_t ctotal, m; unsigned est_extra_delay; r = (pjmedia_rtcp_xr_rb_voip_mtc*) &sess->pkt.buf[size]; @@ -257,59 +257,79 @@ PJ_DEF(void) pjmedia_rtcp_build_rtcp_xr( pjmedia_rtcp_xr_session *sess, r->header.specific = 0; r->header.length = pj_htons(8); - /* Calculate additional transition counts. */ + /* Use temp vars for easiness. */ c11 = sess->voip_mtc_stat.c11; c13 = sess->voip_mtc_stat.c13; c14 = sess->voip_mtc_stat.c14; c22 = sess->voip_mtc_stat.c22; c23 = sess->voip_mtc_stat.c23; c33 = sess->voip_mtc_stat.c33; + m = sess->ptime * sess->frames_per_packet; + + /* Calculate additional transition counts. */ c31 = c13; c32 = c23; ctotal = c11 + c14 + c13 + c22 + c23 + c31 + c32 + c33; - m = sess->ptime * sess->frames_per_packet; - /* Calculate burst and densities. */ - if (c11 && (c23 || c33)) { - p32 = c32 / (c31 + c32 + c33); - if((c22 + c23) < 1) { - p23 = 1; + if (ctotal) { + pj_uint32_t p32, p23; + + //original version: + //p32 = c32 / (c31 + c32 + c33); + if (c31 + c32 + c33 == 0) + p32 = 0; + else + p32 = (c32 << 16) / (c31 + c32 + c33); + + //original version: + //if ((c22 + c23) < 1) { + // p23 = 1; + //} else { + // p23 = 1 - c22 / (c22 + c23); + //} + if (c23 == 0) { + p23 = 0; } else { - p23 = 1 - c22/(c22 + c23); + p23 = (c23 << 16) / (c22 + c23); } - sess->stat.rx.voip_mtc.burst_den = (pj_uint8_t)(256*p23/(p23 + p32)); - sess->stat.rx.voip_mtc.gap_den = (pj_uint8_t)(256*c14/(c11 + c14)); - /* Calculate burst and gap durations in ms */ - sess->stat.rx.voip_mtc.gap_dur = (pj_uint16_t)((c11+c14+c13)*m/c13); - sess->stat.rx.voip_mtc.burst_dur = (pj_uint16_t)(ctotal*m/c13 - - sess->stat.rx.voip_mtc.gap_dur); + /* Calculate loss/discard densities, scaled of 0-256 */ + if (c11 == 0) + sess->stat.rx.voip_mtc.gap_den = 0; + else + sess->stat.rx.voip_mtc.gap_den = (pj_uint8_t) + ((c14 << 8) / (c11 + c14)); + if (p23 == 0) + sess->stat.rx.voip_mtc.burst_den = 0; + else + sess->stat.rx.voip_mtc.burst_den = (pj_uint8_t) + ((p23 << 8) / (p23 + p32)); + + /* Calculate (average) durations, in ms */ + if (c13 == 0) { + c13 = 1; + ctotal += 1; + } + sess->stat.rx.voip_mtc.gap_dur = (pj_uint16_t) + ((c11+c14+c13) * m / c13); + sess->stat.rx.voip_mtc.burst_dur = (pj_uint16_t) + ((ctotal - (c11+c14+c13)) * m / c13); + + /* Callculate loss/discard rates, scaled 0-256 */ + sess->stat.rx.voip_mtc.loss_rate = (pj_uint8_t) + ((sess->voip_mtc_stat.loss_count << 8) / ctotal); + sess->stat.rx.voip_mtc.discard_rate = (pj_uint8_t) + ((sess->voip_mtc_stat.discard_count << 8) / ctotal); } else { - /* No burst occurred yet until this time? - * Just report full gap. - */ - ctotal = sess->rtcp_session->stat.rx.pkt + - sess->voip_mtc_stat.loss_count + - sess->voip_mtc_stat.discard_count; - + /* No lost/discarded packet yet. */ + sess->stat.rx.voip_mtc.gap_den = 0; sess->stat.rx.voip_mtc.burst_den = 0; - sess->stat.rx.voip_mtc.gap_den = (pj_uint8_t)(256 * - (sess->voip_mtc_stat.loss_count + - sess->voip_mtc_stat.discard_count) / - ctotal); - - /* Calculate burst and gap durations in ms */ - sess->stat.rx.voip_mtc.gap_dur = (pj_uint16_t)((m*ctotal) < 0xFFFF? - (m*ctotal) : 0xFFFF); + sess->stat.rx.voip_mtc.gap_dur = 0; sess->stat.rx.voip_mtc.burst_dur = 0; + sess->stat.rx.voip_mtc.loss_rate = 0; + sess->stat.rx.voip_mtc.discard_rate = 0; } - /* Calculate loss and discard rates */ - sess->stat.rx.voip_mtc.loss_rate = (pj_uint8_t) - (256 * sess->voip_mtc_stat.loss_count / ctotal); - sess->stat.rx.voip_mtc.discard_rate = (pj_uint8_t) - (256 * sess->voip_mtc_stat.discard_count / ctotal); - /* Set round trip delay (in ms) to RTT calculated after receiving * DLRR or DLSR. */ @@ -404,7 +424,8 @@ void pjmedia_rtcp_xr_rx_rtcp_xr( pjmedia_rtcp_xr_session *sess, pkt_len = pj_ntohs((pj_uint16_t)rtcp_xr->common.length); - pj_assert((pkt_len + 1) <= (size / 4)); + if ((pkt_len + 1) > (size / 4)) + return; /* Parse report rpt_types */ while ((pj_int32_t*)rb_hdr < (pj_int32_t*)pkt + pkt_len) diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/rtp.c b/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/rtp.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/rtp.c rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/rtp.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/sdp.c b/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/sdp.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/sdp.c rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/sdp.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/sdp_cmp.c b/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/sdp_cmp.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/sdp_cmp.c rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/sdp_cmp.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/sdp_neg.c b/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/sdp_neg.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/sdp_neg.c rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/sdp_neg.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/session.c b/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/session.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/session.c rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/session.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/silencedet.c b/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/silencedet.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/silencedet.c rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/silencedet.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/sound_port.c b/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/sound_port.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/sound_port.c rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/sound_port.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/splitcomb.c b/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/splitcomb.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/splitcomb.c rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/splitcomb.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/stereo_port.c b/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/stereo_port.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/stereo_port.c rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/stereo_port.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/stream.c b/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/stream.c similarity index 98% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/stream.c rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/stream.c index 2493f065fde1d2679fae4ca4c4824f54077ebefc..ca518d73ccbdc48ffa679ec9038005e0227ffa10 100644 --- a/sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/stream.c +++ b/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/stream.c @@ -1,4 +1,4 @@ -/* $Id: stream.c 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: stream.c 2543 2009-03-23 13:22:45Z nanang $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -52,8 +52,6 @@ struct pjmedia_channel pjmedia_dir dir; /**< Channel direction. */ unsigned pt; /**< Payload type. */ pj_bool_t paused; /**< Paused?. */ - unsigned in_pkt_size; /**< Size of input buffer. */ - void *in_pkt; /**< Input buffer. */ unsigned out_pkt_size; /**< Size of output buffer. */ void *out_pkt; /**< Output buffer. */ pjmedia_rtp_session rtp; /**< RTP session. */ @@ -1394,12 +1392,6 @@ static pj_status_t create_channel( pj_pool_t *pool, channel->paused = 1; channel->pt = pt; - /* Allocate buffer for incoming packet. */ - - channel->in_pkt_size = PJMEDIA_MAX_MTU; - channel->in_pkt = pj_pool_alloc( pool, channel->in_pkt_size ); - PJ_ASSERT_RETURN(channel->in_pkt != NULL, PJ_ENOMEM); - /* Allocate buffer for outgoing packet. */ @@ -1667,25 +1659,26 @@ PJ_DEF(pj_status_t) pjmedia_stream_create( pjmedia_endpt *endpt, #endif /* Init jitter buffer parameters: */ - if (info->jb_max > 0) - jb_max = info->jb_max; + if (info->jb_max >= stream->codec_param.info.frm_ptime) + jb_max = (info->jb_max + stream->codec_param.info.frm_ptime - 1) / + stream->codec_param.info.frm_ptime; else jb_max = 500 / stream->codec_param.info.frm_ptime; - if (info->jb_min_pre > 0) - jb_min_pre = info->jb_min_pre; + if (info->jb_min_pre >= stream->codec_param.info.frm_ptime) + jb_min_pre = info->jb_min_pre / stream->codec_param.info.frm_ptime; else //jb_min_pre = 60 / stream->codec_param.info.frm_ptime; jb_min_pre = 1; - if (info->jb_max_pre > 0) - jb_max_pre = info->jb_max_pre; + if (info->jb_max_pre >= stream->codec_param.info.frm_ptime) + jb_max_pre = info->jb_max_pre / stream->codec_param.info.frm_ptime; else //jb_max_pre = 240 / stream->codec_param.info.frm_ptime; jb_max_pre = jb_max * 4 / 5; - if (info->jb_init > 0) - jb_init = info->jb_init; + if (info->jb_init >= stream->codec_param.info.frm_ptime) + jb_init = info->jb_init / stream->codec_param.info.frm_ptime; else //jb_init = (jb_min_pre + jb_max_pre) / 2; jb_init = 0; diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/symbian_sound.cpp b/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/symbian_sound.cpp new file mode 100644 index 0000000000000000000000000000000000000000..57e8ddbd6eb0078f1112d4c4e519a3282d0ca445 --- /dev/null +++ b/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/symbian_sound.cpp @@ -0,0 +1,1038 @@ +/* $Id: symbian_sound.cpp 2394 2008-12-23 17:27:53Z bennylp $ */ +/* + * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) + * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> + * + * 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 + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#include <pjmedia/sound.h> +#include <pjmedia/errno.h> +#include <pj/assert.h> +#include <pj/log.h> +#include <pj/os.h> + + +/* + * This file provides sound implementation for Symbian Audio Streaming + * device. Application using this sound abstraction must link with: + * - mediaclientaudiostream.lib, and + * - mediaclientaudioinputstream.lib + */ +#include <mda/common/audio.h> +#include <mdaaudiooutputstream.h> +#include <mdaaudioinputstream.h> + + + +////////////////////////////////////////////////////////////////////////////// +// + +#define THIS_FILE "symbian_sound.cpp" +#define BYTES_PER_SAMPLE 2 +#define POOL_NAME "SymbianSound" +#define POOL_SIZE 512 +#define POOL_INC 512 + +static pjmedia_snd_dev_info symbian_snd_dev_info = { + "Symbian Sound Device", + 1, + 1, + 8000 +}; + +class CPjAudioInputEngine; + +class CPjAudioOutputEngine; + +/* + * PJMEDIA Sound Stream instance + */ + +struct pjmedia_snd_stream { + // Pool + pj_pool_t *pool; + + // Common settings. + pjmedia_dir dir; + unsigned clock_rate; + unsigned channel_count; + unsigned samples_per_frame; + + // Input stream + CPjAudioInputEngine *inEngine; + + // Output stream + CPjAudioOutputEngine *outEngine; +}; + +static pj_pool_factory *snd_pool_factory; + + +/* + * Convert clock rate to Symbian's TMdaAudioDataSettings capability. + */ +static TInt get_clock_rate_cap (unsigned clock_rate) +{ + switch (clock_rate) { + + case 8000: + return TMdaAudioDataSettings::ESampleRate8000Hz; + + case 11025: + return TMdaAudioDataSettings::ESampleRate11025Hz; + + case 12000: + return TMdaAudioDataSettings::ESampleRate12000Hz; + + case 16000: + return TMdaAudioDataSettings::ESampleRate16000Hz; + + case 22050: + return TMdaAudioDataSettings::ESampleRate22050Hz; + + case 24000: + return TMdaAudioDataSettings::ESampleRate24000Hz; + + case 32000: + return TMdaAudioDataSettings::ESampleRate32000Hz; + + case 44100: + return TMdaAudioDataSettings::ESampleRate44100Hz; + + case 48000: + return TMdaAudioDataSettings::ESampleRate48000Hz; + + case 64000: + return TMdaAudioDataSettings::ESampleRate64000Hz; + + case 96000: + return TMdaAudioDataSettings::ESampleRate96000Hz; + + default: + return 0; + } +} + + +/* + * Convert number of channels into Symbian's TMdaAudioDataSettings capability. + */ +static TInt get_channel_cap (unsigned channel_count) +{ + switch (channel_count) { + + case 1: + return TMdaAudioDataSettings::EChannelsMono; + + case 2: + return TMdaAudioDataSettings::EChannelsStereo; + + default: + return 0; + } +} + + +/* + * Utility: print sound device error + */ +static void snd_perror (const char *title, TInt rc) +{ + PJ_LOG (1, (THIS_FILE, "%s: error code %d", title, rc)); +} + +////////////////////////////////////////////////////////////////////////////// +// + +/* + * Implementation: Symbian Input Stream. + */ + +class CPjAudioInputEngine : public CBase, MMdaAudioInputStreamCallback +{ + + public: + enum State { + STATE_INACTIVE, + STATE_ACTIVE, + }; + + ~CPjAudioInputEngine(); + + static CPjAudioInputEngine *NewL (pjmedia_snd_stream *parent_strm, + pjmedia_snd_rec_cb rec_cb, + void *user_data); + + static CPjAudioInputEngine *NewLC (pjmedia_snd_stream *parent_strm, + pjmedia_snd_rec_cb rec_cb, + void *user_data); + + pj_status_t StartRecord(); + void Stop(); + + private: + State state_; + pjmedia_snd_stream *parentStrm_; + pjmedia_snd_rec_cb recCb_; + void *userData_; + CMdaAudioInputStream *iInputStream_; + HBufC8 *iStreamBuffer_; + TPtr8 iFramePtr_; + TInt lastError_; + pj_uint32_t timeStamp_; + + // cache variable + // to avoid calculating frame length repeatedly + TInt frameLen_; + + // in some SymbianOS (e.g: OSv9.1), sometimes recorded size != requested framesize + // so let's provide a buffer to make sure the rec callback returns framesize as requested. + TUint8 *frameRecBuf_; + TInt frameRecBufLen_; + + CPjAudioInputEngine (pjmedia_snd_stream *parent_strm, + pjmedia_snd_rec_cb rec_cb, + void *user_data); + void ConstructL(); + TPtr8 & GetFrame(); + + public: + virtual void MaiscOpenComplete (TInt aError); + virtual void MaiscBufferCopied (TInt aError, const TDesC8 &aBuffer); + virtual void MaiscRecordComplete (TInt aError); + +}; + + +CPjAudioInputEngine::CPjAudioInputEngine (pjmedia_snd_stream *parent_strm, + pjmedia_snd_rec_cb rec_cb, + void *user_data) + : state_ (STATE_INACTIVE), parentStrm_ (parent_strm), + recCb_ (rec_cb), userData_ (user_data), + iInputStream_ (NULL), iStreamBuffer_ (NULL), iFramePtr_ (0, 0), + lastError_ (KErrNone), timeStamp_ (0), + frameLen_ (parent_strm->samples_per_frame * parent_strm->channel_count * BYTES_PER_SAMPLE), + frameRecBuf_ (NULL), frameRecBufLen_ (0) +{ +} + +CPjAudioInputEngine::~CPjAudioInputEngine() +{ + Stop(); + + delete iStreamBuffer_; + iStreamBuffer_ = NULL; + + delete [] frameRecBuf_; + frameRecBuf_ = NULL; + frameRecBufLen_ = 0; +} + +void CPjAudioInputEngine::ConstructL() +{ + iStreamBuffer_ = HBufC8::NewL (frameLen_); + CleanupStack::PushL (iStreamBuffer_); + + frameRecBuf_ = new TUint8[frameLen_*2]; + CleanupStack::PushL (frameRecBuf_); +} + +CPjAudioInputEngine *CPjAudioInputEngine::NewLC (pjmedia_snd_stream *parent, + pjmedia_snd_rec_cb rec_cb, + void *user_data) +{ + CPjAudioInputEngine* self = new (ELeave) CPjAudioInputEngine (parent, + rec_cb, + user_data); + CleanupStack::PushL (self); + self->ConstructL(); + return self; +} + +CPjAudioInputEngine *CPjAudioInputEngine::NewL (pjmedia_snd_stream *parent, + pjmedia_snd_rec_cb rec_cb, + void *user_data) +{ + CPjAudioInputEngine *self = NewLC (parent, rec_cb, user_data); + CleanupStack::Pop (self->frameRecBuf_); + CleanupStack::Pop (self->iStreamBuffer_); + CleanupStack::Pop (self); + return self; +} + + +pj_status_t CPjAudioInputEngine::StartRecord() +{ + + // Ignore command if recording is in progress. + if (state_ == STATE_ACTIVE) + return PJ_SUCCESS; + + // According to Nokia's AudioStream example, some 2nd Edition, FP2 devices + // (such as Nokia 6630) require the stream to be reconstructed each time + // before calling Open() - otherwise the callback never gets called. + // For uniform behavior, lets just delete/re-create the stream for all + // devices. + + // Destroy existing stream. + if (iInputStream_) delete iInputStream_; + + iInputStream_ = NULL; + + // Create the stream. + TRAPD (err, iInputStream_ = CMdaAudioInputStream::NewL (*this)); + + if (err != KErrNone) + return PJ_RETURN_OS_ERROR (err); + + // Initialize settings. + TMdaAudioDataSettings iStreamSettings; + + iStreamSettings.iChannels = get_channel_cap (parentStrm_->channel_count); + + iStreamSettings.iSampleRate = get_clock_rate_cap (parentStrm_->clock_rate); + + pj_assert (iStreamSettings.iChannels != 0 && + iStreamSettings.iSampleRate != 0); + + PJ_LOG (4, (THIS_FILE, "Opening sound device for capture, " + "clock rate=%d, channel count=%d..", + parentStrm_->clock_rate, + parentStrm_->channel_count)); + + // Open stream. + lastError_ = KRequestPending; + + iInputStream_->Open (&iStreamSettings); + + // Success + PJ_LOG (4, (THIS_FILE, "Sound capture started.")); + + return PJ_SUCCESS; +} + + +void CPjAudioInputEngine::Stop() +{ + // If capture is in progress, stop it. + if (iInputStream_ && state_ == STATE_ACTIVE) { + lastError_ = KRequestPending; + iInputStream_->Stop(); + + // Wait until it's actually stopped + + while (lastError_ == KRequestPending) + pj_symbianos_poll (-1, 100); + } + + if (iInputStream_) { + delete iInputStream_; + iInputStream_ = NULL; + } + + state_ = STATE_INACTIVE; +} + + +TPtr8 & CPjAudioInputEngine::GetFrame() +{ + //iStreamBuffer_->Des().FillZ(frameLen_); + iFramePtr_.Set ( (TUint8*) (iStreamBuffer_->Ptr()), frameLen_, frameLen_); + return iFramePtr_; +} + +void CPjAudioInputEngine::MaiscOpenComplete (TInt aError) +{ + lastError_ = aError; + + if (aError != KErrNone) { + snd_perror ("Error in MaiscOpenComplete()", aError); + return; + } + + // set stream priority to normal and time sensitive + iInputStream_->SetPriority (EPriorityNormal, + EMdaPriorityPreferenceTime); + + // Read the first frame. + TPtr8 & frm = GetFrame(); + + TRAPD (err2, iInputStream_->ReadL (frm)); + + if (err2) { + PJ_LOG (4, (THIS_FILE, "Exception in iInputStream_->ReadL()")); + } +} + +void CPjAudioInputEngine::MaiscBufferCopied (TInt aError, + const TDesC8 &aBuffer) +{ + lastError_ = aError; + + if (aError != KErrNone) { + snd_perror ("Error in MaiscBufferCopied()", aError); + return; + } + + if (frameRecBufLen_ || aBuffer.Size() < frameLen_) { + pj_memcpy (frameRecBuf_ + frameRecBufLen_, (void*) aBuffer.Ptr(), aBuffer.Size()); + frameRecBufLen_ += aBuffer.Size(); + } + + if (frameRecBufLen_) { + while (frameRecBufLen_ >= frameLen_) { + // Call the callback. + recCb_ (userData_, timeStamp_, frameRecBuf_, frameLen_); + // Increment timestamp. + timeStamp_ += parentStrm_->samples_per_frame; + + frameRecBufLen_ -= frameLen_; + pj_memmove (frameRecBuf_, frameRecBuf_+frameLen_, frameRecBufLen_); + } + } else { + // Call the callback. + recCb_ (userData_, timeStamp_, (void*) aBuffer.Ptr(), aBuffer.Size()); + // Increment timestamp. + timeStamp_ += parentStrm_->samples_per_frame; + } + + // Record next frame + TPtr8 & frm = GetFrame(); + + TRAPD (err2, iInputStream_->ReadL (frm)); + + if (err2) { + PJ_LOG (4, (THIS_FILE, "Exception in iInputStream_->ReadL()")); + } +} + + +void CPjAudioInputEngine::MaiscRecordComplete (TInt aError) +{ + lastError_ = aError; + state_ = STATE_INACTIVE; + + if (aError != KErrNone) { + snd_perror ("Error in MaiscRecordComplete()", aError); + } +} + + + +////////////////////////////////////////////////////////////////////////////// +// + +/* + * Implementation: Symbian Output Stream. + */ + +class CPjAudioOutputEngine : public CBase, MMdaAudioOutputStreamCallback +{ + + public: + enum State { + STATE_INACTIVE, + STATE_ACTIVE, + }; + + ~CPjAudioOutputEngine(); + + static CPjAudioOutputEngine *NewL (pjmedia_snd_stream *parent_strm, + pjmedia_snd_play_cb play_cb, + void *user_data); + + static CPjAudioOutputEngine *NewLC (pjmedia_snd_stream *parent_strm, + pjmedia_snd_play_cb rec_cb, + void *user_data); + + pj_status_t StartPlay(); + void Stop(); + + private: + State state_; + pjmedia_snd_stream *parentStrm_; + pjmedia_snd_play_cb playCb_; + void *userData_; + CMdaAudioOutputStream *iOutputStream_; + TUint8 *frameBuf_; + unsigned frameBufSize_; + TPtrC8 frame_; + TInt lastError_; + unsigned timestamp_; + + CPjAudioOutputEngine (pjmedia_snd_stream *parent_strm, + pjmedia_snd_play_cb play_cb, + void *user_data); + void ConstructL(); + + virtual void MaoscOpenComplete (TInt aError); + virtual void MaoscBufferCopied (TInt aError, const TDesC8& aBuffer); + virtual void MaoscPlayComplete (TInt aError); +}; + + +CPjAudioOutputEngine::CPjAudioOutputEngine (pjmedia_snd_stream *parent_strm, + pjmedia_snd_play_cb play_cb, + void *user_data) + : state_ (STATE_INACTIVE), parentStrm_ (parent_strm), playCb_ (play_cb), + userData_ (user_data), iOutputStream_ (NULL), frameBuf_ (NULL), + lastError_ (KErrNone), timestamp_ (0) +{ +} + + +void CPjAudioOutputEngine::ConstructL() +{ + frameBufSize_ = parentStrm_->samples_per_frame * + parentStrm_->channel_count * + BYTES_PER_SAMPLE; + frameBuf_ = new TUint8[frameBufSize_]; +} + +CPjAudioOutputEngine::~CPjAudioOutputEngine() +{ + Stop(); + delete [] frameBuf_; +} + +CPjAudioOutputEngine * +CPjAudioOutputEngine::NewLC (pjmedia_snd_stream *parent_strm, + pjmedia_snd_play_cb rec_cb, + void *user_data) +{ + CPjAudioOutputEngine* self = new (ELeave) CPjAudioOutputEngine (parent_strm, + rec_cb, + user_data); + CleanupStack::PushL (self); + self->ConstructL(); + return self; +} + +CPjAudioOutputEngine * +CPjAudioOutputEngine::NewL (pjmedia_snd_stream *parent_strm, + pjmedia_snd_play_cb play_cb, + void *user_data) +{ + CPjAudioOutputEngine *self = NewLC (parent_strm, play_cb, user_data); + CleanupStack::Pop (self); + return self; +} + +pj_status_t CPjAudioOutputEngine::StartPlay() +{ + // Ignore command if playing is in progress. + if (state_ == STATE_ACTIVE) + return PJ_SUCCESS; + + // Destroy existing stream. + if (iOutputStream_) delete iOutputStream_; + + iOutputStream_ = NULL; + + // Create the stream + TRAPD (err, iOutputStream_ = CMdaAudioOutputStream::NewL (*this)); + + if (err != KErrNone) + return PJ_RETURN_OS_ERROR (err); + + // Initialize settings. + TMdaAudioDataSettings iStreamSettings; + + iStreamSettings.iChannels = get_channel_cap (parentStrm_->channel_count); + + iStreamSettings.iSampleRate = get_clock_rate_cap (parentStrm_->clock_rate); + + pj_assert (iStreamSettings.iChannels != 0 && + iStreamSettings.iSampleRate != 0); + + PJ_LOG (4, (THIS_FILE, "Opening sound device for playback, " + "clock rate=%d, channel count=%d..", + parentStrm_->clock_rate, + parentStrm_->channel_count)); + + // Open stream. + lastError_ = KRequestPending; + + iOutputStream_->Open (&iStreamSettings); + + // Success + PJ_LOG (4, (THIS_FILE, "Sound playback started")); + + return PJ_SUCCESS; + +} + +void CPjAudioOutputEngine::Stop() +{ + // Stop stream if it's playing + if (iOutputStream_ && state_ != STATE_INACTIVE) { + lastError_ = KRequestPending; + iOutputStream_->Stop(); + + // Wait until it's actually stopped + + while (lastError_ == KRequestPending) + pj_symbianos_poll (-1, 100); + } + + if (iOutputStream_) { + delete iOutputStream_; + iOutputStream_ = NULL; + } + + state_ = STATE_INACTIVE; +} + +void CPjAudioOutputEngine::MaoscOpenComplete (TInt aError) +{ + lastError_ = aError; + + if (aError==KErrNone) { + // output stream opened succesfully, set status to Active + state_ = STATE_ACTIVE; + + // set stream properties, 16bit 8KHz mono + TMdaAudioDataSettings iSettings; + iSettings.iChannels = get_channel_cap (parentStrm_->channel_count); + iSettings.iSampleRate = get_clock_rate_cap (parentStrm_->clock_rate); + + iOutputStream_->SetAudioPropertiesL (iSettings.iSampleRate, + iSettings.iChannels); + + // set volume to 1/2th of stream max volume + iOutputStream_->SetVolume (iOutputStream_->MaxVolume() /2); + + // set stream priority to normal and time sensitive + iOutputStream_->SetPriority (EPriorityNormal, + EMdaPriorityPreferenceTime); + + // Call callback to retrieve frame from upstream. + pj_status_t status; + status = playCb_ (this->userData_, timestamp_, frameBuf_, + frameBufSize_); + + if (status != PJ_SUCCESS) { + this->Stop(); + return; + } + + // Increment timestamp. + timestamp_ += (frameBufSize_ / BYTES_PER_SAMPLE); + + // issue WriteL() to write the first audio data block, + // subsequent calls to WriteL() will be issued in + // MMdaAudioOutputStreamCallback::MaoscBufferCopied() + // until whole data buffer is written. + frame_.Set (frameBuf_, frameBufSize_); + + iOutputStream_->WriteL (frame_); + } else { + snd_perror ("Error in MaoscOpenComplete()", aError); + } +} + +void CPjAudioOutputEngine::MaoscBufferCopied (TInt aError, + const TDesC8& aBuffer) +{ + PJ_UNUSED_ARG (aBuffer); + + if (aError==KErrNone) { + // Buffer successfully written, feed another one. + + // Call callback to retrieve frame from upstream. + pj_status_t status; + status = playCb_ (this->userData_, timestamp_, frameBuf_, + frameBufSize_); + + if (status != PJ_SUCCESS) { + this->Stop(); + return; + } + + // Increment timestamp. + timestamp_ += (frameBufSize_ / BYTES_PER_SAMPLE); + + // Write to playback stream. + frame_.Set (frameBuf_, frameBufSize_); + + iOutputStream_->WriteL (frame_); + + } else if (aError==KErrAbort) { + // playing was aborted, due to call to CMdaAudioOutputStream::Stop() + state_ = STATE_INACTIVE; + } else { + // error writing data to output + lastError_ = aError; + state_ = STATE_INACTIVE; + snd_perror ("Error in MaoscBufferCopied()", aError); + } +} + +void CPjAudioOutputEngine::MaoscPlayComplete (TInt aError) +{ + lastError_ = aError; + state_ = STATE_INACTIVE; + + if (aError != KErrNone) { + snd_perror ("Error in MaoscPlayComplete()", aError); + } +} + + +////////////////////////////////////////////////////////////////////////////// +// + + +/* + * Initialize sound subsystem. + */ +PJ_DEF (pj_status_t) pjmedia_snd_init (pj_pool_factory *factory) +{ + snd_pool_factory = factory; + return PJ_SUCCESS; +} + +/* + * Get device count. + */ +PJ_DEF (int) pjmedia_snd_get_dev_count (void) +{ + /* Always return 1 */ + return 1; +} + +/* + * Get device info. + */ +PJ_DEF (const pjmedia_snd_dev_info*) pjmedia_snd_get_dev_info (unsigned index) +{ + /* Always return the default sound device */ + if (index == (unsigned)-1) + index = 0; + + PJ_ASSERT_RETURN (index==0, NULL); + + return &symbian_snd_dev_info; +} + + + +/* + * Open sound recorder stream. + */ +PJ_DEF (pj_status_t) pjmedia_snd_open_rec (int index, + unsigned clock_rate, + unsigned channel_count, + unsigned samples_per_frame, + unsigned bits_per_sample, + pjmedia_snd_rec_cb rec_cb, + void *user_data, + pjmedia_snd_stream **p_snd_strm) +{ + pj_pool_t *pool; + pjmedia_snd_stream *strm; + + if (index==-1) index = 0; + + PJ_ASSERT_RETURN (index == 0, PJ_EINVAL); + + PJ_ASSERT_RETURN (clock_rate && channel_count && samples_per_frame && + bits_per_sample && rec_cb && p_snd_strm, PJ_EINVAL); + + pool = pj_pool_create (snd_pool_factory, POOL_NAME, POOL_SIZE, POOL_INC, + NULL); + + if (!pool) + return PJ_ENOMEM; + + strm = (pjmedia_snd_stream*) pj_pool_zalloc (pool, + sizeof (pjmedia_snd_stream)); + + strm->dir = PJMEDIA_DIR_CAPTURE; + + strm->pool = pool; + + strm->clock_rate = clock_rate; + + strm->channel_count = channel_count; + + strm->samples_per_frame = samples_per_frame; + + PJ_ASSERT_RETURN (bits_per_sample == 16, PJ_EINVAL); + + PJ_ASSERT_RETURN (get_clock_rate_cap (clock_rate) != 0, PJ_EINVAL); + + PJ_ASSERT_RETURN (get_channel_cap (channel_count) != 0, PJ_EINVAL); + + // Create the input stream. + TRAPD (err, strm->inEngine = CPjAudioInputEngine::NewL (strm, rec_cb, + user_data)); + + if (err != KErrNone) { + pj_pool_release (pool); + return PJ_RETURN_OS_ERROR (err); + } + + // Done. + *p_snd_strm = strm; + + return PJ_SUCCESS; +} + +PJ_DEF (pj_status_t) pjmedia_snd_open_player (int index, + unsigned clock_rate, + unsigned channel_count, + unsigned samples_per_frame, + unsigned bits_per_sample, + pjmedia_snd_play_cb play_cb, + void *user_data, + pjmedia_snd_stream **p_snd_strm) +{ + pj_pool_t *pool; + pjmedia_snd_stream *strm; + + if (index == -1) index = 0; + + PJ_ASSERT_RETURN (index == 0, PJ_EINVAL); + + PJ_ASSERT_RETURN (clock_rate && channel_count && samples_per_frame && + bits_per_sample && play_cb && p_snd_strm, PJ_EINVAL); + + pool = pj_pool_create (snd_pool_factory, POOL_NAME, POOL_SIZE, POOL_INC, + NULL); + + if (!pool) + return PJ_ENOMEM; + + strm = (pjmedia_snd_stream*) pj_pool_zalloc (pool, + sizeof (pjmedia_snd_stream)); + + strm->dir = PJMEDIA_DIR_PLAYBACK; + + strm->pool = pool; + + strm->clock_rate = clock_rate; + + strm->channel_count = channel_count; + + strm->samples_per_frame = samples_per_frame; + + PJ_ASSERT_RETURN (bits_per_sample == 16, PJ_EINVAL); + + PJ_ASSERT_RETURN (get_clock_rate_cap (clock_rate) != 0, PJ_EINVAL); + + PJ_ASSERT_RETURN (get_channel_cap (channel_count) != 0, PJ_EINVAL); + + // Create the output stream. + TRAPD (err, strm->outEngine = CPjAudioOutputEngine::NewL (strm, play_cb, + user_data)); + + if (err != KErrNone) { + pj_pool_release (pool); + return PJ_RETURN_OS_ERROR (err); + } + + // Done. + *p_snd_strm = strm; + + return PJ_SUCCESS; +} + +PJ_DEF (pj_status_t) pjmedia_snd_open (int rec_id, + int play_id, + unsigned clock_rate, + unsigned channel_count, + unsigned samples_per_frame, + unsigned bits_per_sample, + pjmedia_snd_rec_cb rec_cb, + pjmedia_snd_play_cb play_cb, + void *user_data, + pjmedia_snd_stream **p_snd_strm) +{ + pj_pool_t *pool; + pjmedia_snd_stream *strm; + + if (rec_id == -1) rec_id = 0; + + if (play_id == -1) play_id = 0; + + PJ_ASSERT_RETURN (rec_id == 0 && play_id == 0, PJ_EINVAL); + + PJ_ASSERT_RETURN (clock_rate && channel_count && samples_per_frame && + bits_per_sample && rec_cb && play_cb && p_snd_strm, + PJ_EINVAL); + + pool = pj_pool_create (snd_pool_factory, POOL_NAME, POOL_SIZE, POOL_INC, + NULL); + + if (!pool) + return PJ_ENOMEM; + + strm = (pjmedia_snd_stream*) pj_pool_zalloc (pool, + sizeof (pjmedia_snd_stream)); + + strm->dir = PJMEDIA_DIR_CAPTURE_PLAYBACK; + + strm->pool = pool; + + strm->clock_rate = clock_rate; + + strm->channel_count = channel_count; + + strm->samples_per_frame = samples_per_frame; + + PJ_ASSERT_RETURN (bits_per_sample == 16, PJ_EINVAL); + + PJ_ASSERT_RETURN (get_clock_rate_cap (clock_rate) != 0, PJ_EINVAL); + + PJ_ASSERT_RETURN (get_channel_cap (channel_count) != 0, PJ_EINVAL); + + // Create the output stream. + TRAPD (err, strm->outEngine = CPjAudioOutputEngine::NewL (strm, play_cb, + user_data)); + + if (err != KErrNone) { + pj_pool_release (pool); + return PJ_RETURN_OS_ERROR (err); + } + + // Create the input stream. + TRAPD (err1, strm->inEngine = CPjAudioInputEngine::NewL (strm, rec_cb, + user_data)); + + if (err1 != KErrNone) { + strm->inEngine = NULL; + delete strm->outEngine; + strm->outEngine = NULL; + pj_pool_release (pool); + return PJ_RETURN_OS_ERROR (err1); + } + + // Done. + *p_snd_strm = strm; + + return PJ_SUCCESS; +} + +/* + * Get stream info. + */ +PJ_DEF (pj_status_t) pjmedia_snd_stream_get_info (pjmedia_snd_stream *strm, + pjmedia_snd_stream_info *pi) +{ + PJ_ASSERT_RETURN (strm && pi, PJ_EINVAL); + + pj_bzero (pi, sizeof (*pi)); + pi->dir = strm->dir; + pi->play_id = 0; + pi->rec_id = 0; + pi->clock_rate = strm->clock_rate; + pi->channel_count = strm->channel_count; + pi->samples_per_frame = strm->samples_per_frame; + pi->bits_per_sample = BYTES_PER_SAMPLE * 8; + // Symbian uses 4096 bytes buffer (~2048 samples/256 ms) for PCM rec & play. + // The latencies below are rounded up to be a multiplication of 80. + pi->rec_latency = 2080; + pi->play_latency = 2080; + + return PJ_SUCCESS; +} + + +PJ_DEF (pj_status_t) pjmedia_snd_stream_start (pjmedia_snd_stream *stream) +{ + pj_status_t status; + + PJ_ASSERT_RETURN (stream != NULL, PJ_EINVAL); + + if (stream->outEngine) { + status = stream->outEngine->StartPlay(); + + if (status != PJ_SUCCESS) + return status; + } + + if (stream->inEngine) { + status = stream->inEngine->StartRecord(); + + if (status != PJ_SUCCESS) + return status; + } + + return PJ_SUCCESS; +} + + +PJ_DEF (pj_status_t) pjmedia_snd_stream_stop (pjmedia_snd_stream *stream) +{ + PJ_ASSERT_RETURN (stream != NULL, PJ_EINVAL); + + if (stream->inEngine) { + stream->inEngine->Stop(); + } + + if (stream->outEngine) { + stream->outEngine->Stop(); + } + + return PJ_SUCCESS; +} + + +PJ_DEF (pj_status_t) pjmedia_snd_stream_close (pjmedia_snd_stream *stream) +{ + pj_pool_t *pool; + + PJ_ASSERT_RETURN (stream != NULL, PJ_EINVAL); + + if (stream->inEngine) { + delete stream->inEngine; + stream->inEngine = NULL; + } + + if (stream->outEngine) { + delete stream->outEngine; + stream->outEngine = NULL; + } + + pool = stream->pool; + + if (pool) { + stream->pool = NULL; + pj_pool_release (pool); + } + + return PJ_SUCCESS; +} + + +PJ_DEF (pj_status_t) pjmedia_snd_deinit (void) +{ + /* Nothing to do */ + return PJ_SUCCESS; +} + + +/* + * Set sound latency. + */ +PJ_DEF (pj_status_t) pjmedia_snd_set_latency (unsigned input_latency, + unsigned output_latency) +{ + /* Nothing to do */ + PJ_UNUSED_ARG (input_latency); + PJ_UNUSED_ARG (output_latency); + return PJ_SUCCESS; +} diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/symbian_sound_aps.cpp b/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/symbian_sound_aps.cpp new file mode 100644 index 0000000000000000000000000000000000000000..9dcaf6103093596dfe6da0b13367ce220a2807e9 --- /dev/null +++ b/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/symbian_sound_aps.cpp @@ -0,0 +1,992 @@ +/* $Id: symbian_sound_aps.cpp 2540 2009-03-23 13:18:19Z nanang $ */ +/* + * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) + * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> + * + * 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 + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#include <pjmedia/sound.h> +#include <pjmedia/alaw_ulaw.h> +#include <pjmedia/errno.h> +#include <pjmedia/symbian_sound_aps.h> +#include <pj/assert.h> +#include <pj/log.h> +#include <pj/math.h> +#include <pj/os.h> + +#include <e32msgqueue.h> +#include <sounddevice.h> +#include <APSClientSession.h> + +////////////////////////////////////////////////////////////////////////////// +// + +#define THIS_FILE "symbian_sound_aps.cpp" + +#define BYTES_PER_SAMPLE 2 +#define POOL_NAME "SymbianSoundAps" +#define POOL_SIZE 512 +#define POOL_INC 512 + +#if 1 +# define TRACE_(st) PJ_LOG(3, st) +#else +# define TRACE_(st) +#endif + +static pjmedia_snd_dev_info symbian_snd_dev_info = { + "Symbian Sound Device (APS)", + 1, + 1, + 8000 +}; + +/* App UID to open global APS queues to communicate with the APS server. */ +extern TPtrC APP_UID; + +/* Default setting for loudspeaker */ +static pj_bool_t act_loudspeaker = PJ_FALSE; + +/* Forward declaration of CPjAudioEngine */ + +class CPjAudioEngine; + +/* + * PJMEDIA Sound Stream instance + */ + +struct pjmedia_snd_stream { + // Pool + pj_pool_t *pool; + + // Common settings. + pjmedia_dir dir; + unsigned clock_rate; + unsigned channel_count; + unsigned samples_per_frame; + + // Audio engine + CPjAudioEngine *engine; +}; + +static pj_pool_factory *snd_pool_factory; + + +/* + * Utility: print sound device error + */ +static void snd_perror (const char *title, TInt rc) +{ + PJ_LOG (1, (THIS_FILE, "%s (error code=%d)", title, rc)); +} + +////////////////////////////////////////////////////////////////////////////// +// + +/** + * Abstract class for handler of callbacks from APS client. + */ + +class MQueueHandlerObserver +{ + + public: + virtual void InputStreamInitialized (const TInt aStatus) = 0; + virtual void OutputStreamInitialized (const TInt aStatus) = 0; + virtual void NotifyError (const TInt aError) = 0; + + virtual void RecCb (TAPSCommBuffer &buffer) = 0; + virtual void PlayCb (TAPSCommBuffer &buffer) = 0; +}; + +/** + * Handler for communication and data queue. + */ + +class CQueueHandler : public CActive +{ + + public: + // Types of queue handler + enum TQueueHandlerType { + ERecordCommQueue, + EPlayCommQueue, + ERecordQueue, + EPlayQueue + }; + + // The order corresponds to the APS Server state, do not change! + enum TState { + EAPSPlayerInitialize = 1, + EAPSRecorderInitialize = 2, + EAPSPlayData = 3, + EAPSRecordData = 4, + EAPSPlayerInitComplete = 5, + EAPSRecorderInitComplete = 6 + }; + + static CQueueHandler* NewL (MQueueHandlerObserver* aObserver, + RMsgQueue<TAPSCommBuffer>* aQ, + TQueueHandlerType aType) { + CQueueHandler* self = new (ELeave) CQueueHandler (aObserver, aQ, aType); + CleanupStack::PushL (self); + self->ConstructL(); + CleanupStack::Pop (self); + return self; + } + + // Destructor + ~CQueueHandler() { + Cancel(); + } + + // Start listening queue event + void Start() { + iQ->NotifyDataAvailable (iStatus); + SetActive(); + } + + private: + // Constructor + CQueueHandler (MQueueHandlerObserver* aObserver, + RMsgQueue<TAPSCommBuffer>* aQ, + TQueueHandlerType aType) + : CActive (CActive::EPriorityHigh), + iQ (aQ), iObserver (aObserver), iType (aType) { + CActiveScheduler::Add (this); + + // use lower priority for comm queues + + if ( (iType == ERecordCommQueue) || (iType == EPlayCommQueue)) + SetPriority (CActive::EPriorityStandard); + } + + // Second phase constructor + void ConstructL() {} + + // Inherited from CActive + void DoCancel() { + iQ->CancelDataAvailable(); + } + + void RunL() { + if (iStatus != KErrNone) { + iObserver->NotifyError (iStatus.Int()); + return; + } + + TAPSCommBuffer buffer; + + TInt ret = iQ->Receive (buffer); + + if (ret != KErrNone) { + iObserver->NotifyError (ret); + return; + } + + switch (iType) { + + case ERecordQueue: + + if (buffer.iCommand == EAPSRecordData) { + iObserver->RecCb (buffer); + } + + break; + + // Callbacks from the APS main thread + + case EPlayCommQueue: + + switch (buffer.iCommand) { + + case EAPSPlayData: + + if (buffer.iStatus == KErrUnderflow) { + iObserver->PlayCb (buffer); + } + + break; + + case EAPSPlayerInitialize: + iObserver->NotifyError (buffer.iStatus); + break; + + case EAPSPlayerInitComplete: + iObserver->OutputStreamInitialized (buffer.iStatus); + break; + + case EAPSRecorderInitComplete: + iObserver->InputStreamInitialized (buffer.iStatus); + break; + + default: + iObserver->NotifyError (buffer.iStatus); + break; + } + + break; + + // Callbacks from the APS recorder thread + + case ERecordCommQueue: + + switch (buffer.iCommand) { + // The APS recorder thread will only report errors + // through this handler. All other callbacks will be + // sent from the APS main thread through EPlayCommQueue + + case EAPSRecorderInitialize: + + if (buffer.iStatus == KErrNone) { + iObserver->InputStreamInitialized (buffer.iStatus); + break; + } + + case EAPSRecordData: + + iObserver->NotifyError (buffer.iStatus); + break; + + default: + break; + } + + break; + + default: + break; + } + + // issue next request + iQ->NotifyDataAvailable (iStatus); + + SetActive(); + } + + // Data + RMsgQueue<TAPSCommBuffer> *iQ; // (not owned) + MQueueHandlerObserver *iObserver; // (not owned) + TQueueHandlerType iType; +}; + + +/* + * Implementation: Symbian Input & Output Stream. + */ + +class CPjAudioEngine : public CBase, MQueueHandlerObserver +{ + + public: + enum State { + STATE_NULL, + STATE_READY, + STATE_STREAMING + }; + + ~CPjAudioEngine(); + + static CPjAudioEngine *NewL (pjmedia_snd_stream *parent_strm, + pjmedia_snd_rec_cb rec_cb, + pjmedia_snd_play_cb play_cb, + void *user_data); + + TInt StartL(); + void Stop(); + + TInt ActivateSpeaker (TBool active); + + private: + CPjAudioEngine (pjmedia_snd_stream *parent_strm, + pjmedia_snd_rec_cb rec_cb, + pjmedia_snd_play_cb play_cb, + void *user_data); + void ConstructL(); + + TInt InitPlayL(); + TInt InitRecL(); + TInt StartStreamL(); + + // Inherited from MQueueHandlerObserver + virtual void InputStreamInitialized (const TInt aStatus); + virtual void OutputStreamInitialized (const TInt aStatus); + virtual void NotifyError (const TInt aError); + + virtual void RecCb (TAPSCommBuffer &buffer); + virtual void PlayCb (TAPSCommBuffer &buffer); + + State state_; + pjmedia_snd_stream *parentStrm_; + pjmedia_snd_rec_cb recCb_; + pjmedia_snd_play_cb playCb_; + void *userData_; + pj_uint32_t TsPlay_; + pj_uint32_t TsRec_; + + RAPSSession iSession; + TAPSInitSettings iSettings; + RMsgQueue<TAPSCommBuffer> iReadQ; + RMsgQueue<TAPSCommBuffer> iReadCommQ; + RMsgQueue<TAPSCommBuffer> iWriteQ; + RMsgQueue<TAPSCommBuffer> iWriteCommQ; + + CQueueHandler *iPlayCommHandler; + CQueueHandler *iRecCommHandler; + CQueueHandler *iRecHandler; + + static pj_uint8_t aps_samples_per_frame; + + pj_int16_t *play_buf; + pj_uint16_t play_buf_len; + pj_uint16_t play_buf_start; + pj_int16_t *rec_buf; + pj_uint16_t rec_buf_len; +}; + + +pj_uint8_t CPjAudioEngine::aps_samples_per_frame = 0; + + +CPjAudioEngine* CPjAudioEngine::NewL (pjmedia_snd_stream *parent_strm, + pjmedia_snd_rec_cb rec_cb, + pjmedia_snd_play_cb play_cb, + void *user_data) +{ + CPjAudioEngine* self = new (ELeave) CPjAudioEngine (parent_strm, + rec_cb, play_cb, + user_data); + CleanupStack::PushL (self); + self->ConstructL(); + CleanupStack::Pop (self); + return self; +} + +CPjAudioEngine::CPjAudioEngine (pjmedia_snd_stream *parent_strm, + pjmedia_snd_rec_cb rec_cb, + pjmedia_snd_play_cb play_cb, + void *user_data) + : state_ (STATE_NULL), + parentStrm_ (parent_strm), + recCb_ (rec_cb), + playCb_ (play_cb), + userData_ (user_data), + iPlayCommHandler (0), + iRecCommHandler (0), + iRecHandler (0) +{ +} + +CPjAudioEngine::~CPjAudioEngine() +{ + Stop(); + + delete iPlayCommHandler; + iPlayCommHandler = NULL; + delete iRecCommHandler; + iRecCommHandler = NULL; + + // On some devices, immediate closing after stopping may cause APS server + // panic KERN-EXEC 0, so let's wait for sometime before really closing + // the client session. + TTime start, now; + enum { APS_CLOSE_WAIT_TIME = 200 }; /* in msecs */ + + start.UniversalTime(); + + do { + pj_symbianos_poll (-1, APS_CLOSE_WAIT_TIME); + now.UniversalTime(); + } while (now.MicroSecondsFrom (start) < APS_CLOSE_WAIT_TIME * 1000); + + iSession.Close(); + + if (state_ == STATE_READY) { + if (parentStrm_->dir != PJMEDIA_DIR_PLAYBACK) { + iReadQ.Close(); + iReadCommQ.Close(); + } + + iWriteQ.Close(); + + iWriteCommQ.Close(); + } +} + +TInt CPjAudioEngine::InitPlayL() +{ + if (state_ == STATE_STREAMING || state_ == STATE_READY) + return 0; + + TInt err = iSession.InitializePlayer (iSettings); + + if (err != KErrNone) { + snd_perror ("Failed to initialize player", err); + return err; + } + + // Open message queues for the output stream + TBuf<128> buf2 = iSettings.iGlobal; + + buf2.Append (_L ("PlayQueue")); + + TBuf<128> buf3 = iSettings.iGlobal; + + buf3.Append (_L ("PlayCommQueue")); + + while (iWriteQ.OpenGlobal (buf2)) + User::After (10); + + while (iWriteCommQ.OpenGlobal (buf3)) + User::After (10); + + // Construct message queue handler + iPlayCommHandler = CQueueHandler::NewL (this, + &iWriteCommQ, + CQueueHandler::EPlayCommQueue); + + // Start observing APS callbacks on output stream message queue + iPlayCommHandler->Start(); + + return 0; +} + +TInt CPjAudioEngine::InitRecL() +{ + if (state_ == STATE_STREAMING || state_ == STATE_READY) + return 0; + + // Initialize input stream device + TInt err = iSession.InitializeRecorder (iSettings); + + if (err != KErrNone) { + snd_perror ("Failed to initialize recorder", err); + return err; + } + + TBuf<128> buf1 = iSettings.iGlobal; + + buf1.Append (_L ("RecordQueue")); + TBuf<128> buf4 = iSettings.iGlobal; + buf4.Append (_L ("RecordCommQueue")); + + // Must wait for APS thread to finish creating message queues + // before we can open and use them. + + while (iReadQ.OpenGlobal (buf1)) + User::After (10); + + while (iReadCommQ.OpenGlobal (buf4)) + User::After (10); + + // Construct message queue handlers + iRecCommHandler = CQueueHandler::NewL (this, + &iReadCommQ, + CQueueHandler::ERecordCommQueue); + + // Start observing APS callbacks from on input stream message queue + iRecCommHandler->Start(); + + return 0; +} + +TInt CPjAudioEngine::StartL() +{ + TInt err = iSession.Connect(); + + if (err != KErrNone && err != KErrAlreadyExists) + return err; + + if (state_ == STATE_READY) + return StartStreamL(); + + // Even if only capturer are opened, playback thread of APS Server need + // to be run(?). Since some messages will be delivered via play comm queue. + return InitPlayL(); +} + +void CPjAudioEngine::Stop() +{ + iSession.Stop(); + + delete iRecHandler; + iRecHandler = NULL; + + state_ = STATE_READY; +} + +void CPjAudioEngine::ConstructL() +{ + iSettings.iFourCC = TFourCC (KMCPFourCCIdG711); + iSettings.iGlobal = APP_UID; + iSettings.iPriority = TMdaPriority (100); + iSettings.iPreference = TMdaPriorityPreference (0x05210001); + iSettings.iSettings.iChannels = EMMFMono; + iSettings.iSettings.iSampleRate = EMMFSampleRate8000Hz; + iSettings.iSettings.iVolume = 0; + + /* play_buf size is samples per frame of parent stream. */ + play_buf = (pj_int16_t*) pj_pool_alloc (parentStrm_->pool, + parentStrm_->samples_per_frame << 1); + play_buf_len = 0; + play_buf_start = 0; + + /* rec_buf size is samples per frame of parent stream. */ + rec_buf = (pj_int16_t*) pj_pool_alloc (parentStrm_->pool, + parentStrm_->samples_per_frame << 1); + rec_buf_len = 0; +} + +TInt CPjAudioEngine::StartStreamL() +{ + if (state_ == STATE_STREAMING) + return 0; + + iSession.SetCng (EFalse); + + iSession.SetVadMode (EFalse); + + iSession.SetPlc (EFalse); + + iSession.SetEncoderMode (EULawOr30ms); + + iSession.SetDecoderMode (EULawOr30ms); + + iSession.ActivateLoudspeaker (act_loudspeaker); + + // Not only playback + if (parentStrm_->dir != PJMEDIA_DIR_PLAYBACK) { + iRecHandler = CQueueHandler::NewL (this, &iReadQ, + CQueueHandler::ERecordQueue); + iRecHandler->Start(); + iSession.Read(); + TRACE_ ( (THIS_FILE, "APS recorder started")); + } + + // Not only capture + if (parentStrm_->dir != PJMEDIA_DIR_CAPTURE) { + iSession.Write(); + TRACE_ ( (THIS_FILE, "APS player started")); + } + + state_ = STATE_STREAMING; + + return 0; +} + +/////////////////////////////////////////////////////////// +// Inherited from MQueueHandlerObserver +// + +void CPjAudioEngine::InputStreamInitialized (const TInt aStatus) +{ + TRACE_ ( (THIS_FILE, "InputStreamInitialized %d", aStatus)); + + state_ = STATE_READY; + + if (aStatus == KErrNone) { + StartStreamL(); + } +} + +void CPjAudioEngine::OutputStreamInitialized (const TInt aStatus) +{ + TRACE_ ( (THIS_FILE, "OutputStreamInitialized %d", aStatus)); + + if (aStatus == KErrNone) { + if (parentStrm_->dir == PJMEDIA_DIR_PLAYBACK) { + state_ = STATE_READY; + // Only playback, start directly + StartStreamL(); + } else + InitRecL(); + } +} + +void CPjAudioEngine::NotifyError (const TInt aError) +{ + snd_perror ("Error from CQueueHandler", aError); +} + +void CPjAudioEngine::RecCb (TAPSCommBuffer &buffer) +{ + pj_assert (buffer.iBuffer[0] == 1 && buffer.iBuffer[1] == 0); + + /* Detect the recorder G.711 frame size, player frame size will follow + * this recorder frame size. + */ + + if (CPjAudioEngine::aps_samples_per_frame == 0) { + CPjAudioEngine::aps_samples_per_frame = buffer.iBuffer.Length() < 160? + 80 : 160; + TRACE_ ( (THIS_FILE, "Detected APS G.711 frame size = %u samples", + CPjAudioEngine::aps_samples_per_frame)); + } + + /* Decode APS buffer (coded in G.711) and put the PCM result into rec_buf. + * Whenever rec_buf is full, call parent stream callback. + */ + unsigned dec_len = 0; + + while (dec_len < CPjAudioEngine::aps_samples_per_frame) { + unsigned tmp; + + tmp = PJ_MIN (parentStrm_->samples_per_frame - rec_buf_len, + CPjAudioEngine::aps_samples_per_frame - dec_len); + pjmedia_ulaw_decode (&rec_buf[rec_buf_len], + buffer.iBuffer.Ptr() + 2 + dec_len, + tmp); + rec_buf_len += tmp; + dec_len += tmp; + + pj_assert (rec_buf_len <= parentStrm_->samples_per_frame); + + if (rec_buf_len == parentStrm_->samples_per_frame) { + recCb_ (userData_, 0, rec_buf, rec_buf_len << 1); + rec_buf_len = 0; + } + } +} + +void CPjAudioEngine::PlayCb (TAPSCommBuffer &buffer) +{ + buffer.iCommand = CQueueHandler::EAPSPlayData; + buffer.iStatus = 0; + buffer.iBuffer.Zero(); + buffer.iBuffer.Append (1); + buffer.iBuffer.Append (0); + + /* Send 10ms silence frame if frame size hasn't been known. */ + + if (CPjAudioEngine::aps_samples_per_frame == 0) { + pjmedia_zero_samples (play_buf, 80); + pjmedia_ulaw_encode ( (pj_uint8_t*) play_buf, play_buf, 80); + buffer.iBuffer.Append ( (TUint8*) play_buf, 80); + iWriteQ.Send (buffer); + return; + } + + unsigned enc_len = 0; + + /* Call parent stream callback to get PCM samples to play, + * encode the PCM samples into G.711 and put it into APS buffer. + */ + + while (enc_len < CPjAudioEngine::aps_samples_per_frame) { + if (play_buf_len == 0) { + playCb_ (userData_, 0, play_buf, parentStrm_->samples_per_frame<<1); + play_buf_len = parentStrm_->samples_per_frame; + play_buf_start = 0; + } + + unsigned tmp; + + tmp = PJ_MIN (play_buf_len, + CPjAudioEngine::aps_samples_per_frame - enc_len); + pjmedia_ulaw_encode ( (pj_uint8_t*) &play_buf[play_buf_start], + &play_buf[play_buf_start], + tmp); + buffer.iBuffer.Append ( (TUint8*) &play_buf[play_buf_start], tmp); + enc_len += tmp; + play_buf_len -= tmp; + play_buf_start += tmp; + } + + iWriteQ.Send (buffer); +} + +// +// End of inherited from MQueueHandlerObserver +///////////////////////////////////////////////////////////// + + +TInt CPjAudioEngine::ActivateSpeaker (TBool active) +{ + if (state_ == STATE_READY || state_ == STATE_STREAMING) { + iSession.ActivateLoudspeaker (active); + return KErrNone; + } + + return KErrNotReady; +} + +////////////////////////////////////////////////////////////////////////////// +// + + +/* + * Initialize sound subsystem. + */ +PJ_DEF (pj_status_t) pjmedia_snd_init (pj_pool_factory *factory) +{ + snd_pool_factory = factory; + return PJ_SUCCESS; +} + +/* + * Get device count. + */ +PJ_DEF (int) pjmedia_snd_get_dev_count (void) +{ + /* Always return 1 */ + return 1; +} + +/* + * Get device info. + */ +PJ_DEF (const pjmedia_snd_dev_info*) pjmedia_snd_get_dev_info (unsigned index) +{ + /* Always return the default sound device */ + if (index == (unsigned)-1) + index = 0; + + PJ_ASSERT_RETURN (index==0, NULL); + + return &symbian_snd_dev_info; +} + +static pj_status_t sound_open (pjmedia_dir dir, + unsigned clock_rate, + unsigned channel_count, + unsigned samples_per_frame, + unsigned bits_per_sample, + pjmedia_snd_rec_cb rec_cb, + pjmedia_snd_play_cb play_cb, + void *user_data, + pjmedia_snd_stream **p_snd_strm) +{ + pj_pool_t *pool; + pjmedia_snd_stream *strm; + + PJ_ASSERT_RETURN (p_snd_strm, PJ_EINVAL); + PJ_ASSERT_RETURN (clock_rate == 8000 && channel_count == 1 && + bits_per_sample == 16, PJ_ENOTSUP); + PJ_ASSERT_RETURN ( (dir == PJMEDIA_DIR_CAPTURE_PLAYBACK && rec_cb && play_cb) + || (dir == PJMEDIA_DIR_CAPTURE && rec_cb && !play_cb) + || (dir == PJMEDIA_DIR_PLAYBACK && !rec_cb && play_cb), + PJ_EINVAL); + + pool = pj_pool_create (snd_pool_factory, POOL_NAME, POOL_SIZE, POOL_INC, + NULL); + + if (!pool) + return PJ_ENOMEM; + + strm = (pjmedia_snd_stream*) pj_pool_zalloc (pool, + sizeof (pjmedia_snd_stream)); + + strm->dir = dir; + + strm->pool = pool; + + strm->clock_rate = clock_rate; + + strm->channel_count = channel_count; + + strm->samples_per_frame = samples_per_frame; + + // Create the audio engine. + TRAPD (err, strm->engine = CPjAudioEngine::NewL (strm, rec_cb, play_cb, + user_data)); + + if (err != KErrNone) { + pj_pool_release (pool); + return PJ_RETURN_OS_ERROR (err); + } + + // Done. + *p_snd_strm = strm; + + return PJ_SUCCESS; +} + + + +/* + * Open sound recorder stream. + */ +PJ_DEF (pj_status_t) pjmedia_snd_open_rec (int index, + unsigned clock_rate, + unsigned channel_count, + unsigned samples_per_frame, + unsigned bits_per_sample, + pjmedia_snd_rec_cb rec_cb, + void *user_data, + pjmedia_snd_stream **p_snd_strm) +{ + if (index < 0) index = 0; + + PJ_ASSERT_RETURN (index == 0, PJ_EINVAL); + + return sound_open (PJMEDIA_DIR_CAPTURE, clock_rate, channel_count, + samples_per_frame, bits_per_sample, rec_cb, NULL, + user_data, p_snd_strm); +} + +PJ_DEF (pj_status_t) pjmedia_snd_open_player (int index, + unsigned clock_rate, + unsigned channel_count, + unsigned samples_per_frame, + unsigned bits_per_sample, + pjmedia_snd_play_cb play_cb, + void *user_data, + pjmedia_snd_stream **p_snd_strm) +{ + if (index < 0) index = 0; + + PJ_ASSERT_RETURN (index == 0, PJ_EINVAL); + + return sound_open (PJMEDIA_DIR_PLAYBACK, clock_rate, channel_count, + samples_per_frame, bits_per_sample, NULL, play_cb, + user_data, p_snd_strm); +} + +PJ_DEF (pj_status_t) pjmedia_snd_open (int rec_id, + int play_id, + unsigned clock_rate, + unsigned channel_count, + unsigned samples_per_frame, + unsigned bits_per_sample, + pjmedia_snd_rec_cb rec_cb, + pjmedia_snd_play_cb play_cb, + void *user_data, + pjmedia_snd_stream **p_snd_strm) +{ + if (rec_id < 0) rec_id = 0; + + if (play_id < 0) play_id = 0; + + PJ_ASSERT_RETURN (play_id == 0 && rec_id == 0, PJ_EINVAL); + + return sound_open (PJMEDIA_DIR_CAPTURE_PLAYBACK, clock_rate, channel_count, + samples_per_frame, bits_per_sample, rec_cb, play_cb, + user_data, p_snd_strm); +} + +/* + * Get stream info. + */ +PJ_DEF (pj_status_t) pjmedia_snd_stream_get_info (pjmedia_snd_stream *strm, + pjmedia_snd_stream_info *pi) +{ + PJ_ASSERT_RETURN (strm && pi, PJ_EINVAL); + + pj_bzero (pi, sizeof (*pi)); + pi->dir = strm->dir; + pi->play_id = 0; + pi->rec_id = 0; + pi->clock_rate = strm->clock_rate; + pi->channel_count = strm->channel_count; + pi->samples_per_frame = strm->samples_per_frame; + pi->bits_per_sample = BYTES_PER_SAMPLE * 8; + // latencies approximation (in samples) + pi->rec_latency = strm->samples_per_frame * 2; + pi->play_latency = strm->samples_per_frame * 2; + + return PJ_SUCCESS; +} + + +PJ_DEF (pj_status_t) pjmedia_snd_stream_start (pjmedia_snd_stream *stream) +{ + PJ_ASSERT_RETURN (stream != NULL, PJ_EINVAL); + + if (stream->engine) { + TInt err = stream->engine->StartL(); + + if (err != KErrNone) + return PJ_RETURN_OS_ERROR (err); + } + + return PJ_SUCCESS; +} + + +PJ_DEF (pj_status_t) pjmedia_snd_stream_stop (pjmedia_snd_stream *stream) +{ + PJ_ASSERT_RETURN (stream != NULL, PJ_EINVAL); + + if (stream->engine) { + stream->engine->Stop(); + } + + return PJ_SUCCESS; +} + + +PJ_DEF (pj_status_t) pjmedia_snd_stream_close (pjmedia_snd_stream *stream) +{ + pj_pool_t *pool; + + PJ_ASSERT_RETURN (stream != NULL, PJ_EINVAL); + + if (stream->engine) { + delete stream->engine; + stream->engine = NULL; + } + + pool = stream->pool; + + if (pool) { + stream->pool = NULL; + pj_pool_release (pool); + } + + return PJ_SUCCESS; +} + + +PJ_DEF (pj_status_t) pjmedia_snd_deinit (void) +{ + /* Nothing to do */ + return PJ_SUCCESS; +} + + +/* + * Set sound latency. + */ +PJ_DEF (pj_status_t) pjmedia_snd_set_latency (unsigned input_latency, + unsigned output_latency) +{ + /* Nothing to do */ + PJ_UNUSED_ARG (input_latency); + PJ_UNUSED_ARG (output_latency); + return PJ_SUCCESS; +} + + +/* + * Activate/deactivate loudspeaker. + */ +PJ_DEF (pj_status_t) pjmedia_snd_aps_activate_loudspeaker ( + pjmedia_snd_stream *stream, + pj_bool_t active) +{ + if (stream == NULL) { + act_loudspeaker = active; + } else { + if (stream->engine == NULL) + return PJ_EINVAL; + + TInt err = stream->engine->ActivateSpeaker (active); + + if (err != KErrNone) + return PJ_RETURN_OS_ERROR (err); + } + + return PJ_SUCCESS; +} diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/tonegen.c b/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/tonegen.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/tonegen.c rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/tonegen.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/transport_adapter_sample.c b/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/transport_adapter_sample.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/transport_adapter_sample.c rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/transport_adapter_sample.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/transport_ice.c b/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/transport_ice.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/transport_ice.c rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/transport_ice.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/transport_loop.c b/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/transport_loop.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/transport_loop.c rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/transport_loop.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/transport_srtp.c b/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/transport_srtp.c similarity index 99% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/transport_srtp.c rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/transport_srtp.c index 2fb6845ee9b697a8e714e3218d5b37eae53132e4..b9650d1b02c14c04a10993bf905dc6a748377aff 100644 --- a/sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/transport_srtp.c +++ b/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/transport_srtp.c @@ -1,4 +1,4 @@ -/* $Id: transport_srtp.c 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: transport_srtp.c 2533 2009-03-23 13:07:05Z nanang $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -384,7 +384,6 @@ PJ_DEF(pj_status_t) pjmedia_transport_srtp_create( srtp->session_inited = PJ_FALSE; srtp->bypass_srtp = PJ_FALSE; srtp->probation_cnt = PROBATION_CNT_INIT; - srtp->peer_use = opt->use; if (opt) { srtp->setting = *opt; @@ -423,6 +422,9 @@ PJ_DEF(pj_status_t) pjmedia_transport_srtp_create( /* Set underlying transport */ srtp->member_tp = tp; + /* Initialize peer's SRTP usage mode. */ + srtp->peer_use = srtp->setting.use; + /* Done */ *p_tp = &srtp->base; diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/transport_udp.c b/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/transport_udp.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/transport_udp.c rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/transport_udp.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/wav_player.c b/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/wav_player.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/wav_player.c rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/wav_player.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/wav_playlist.c b/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/wav_playlist.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/wav_playlist.c rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/wav_playlist.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/wav_writer.c b/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/wav_writer.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/wav_writer.c rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/wav_writer.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/wave.c b/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/wave.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/wave.c rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/wave.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/wmme_sound.c b/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/wmme_sound.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/wmme_sound.c rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/wmme_sound.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/wsola.c b/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/wsola.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/src/pjmedia/wsola.c rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/wsola.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/src/test/audio_tool.c b/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/test/audio_tool.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/src/test/audio_tool.c rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/src/test/audio_tool.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/src/test/jbuf_test.c b/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/test/jbuf_test.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/src/test/jbuf_test.c rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/src/test/jbuf_test.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/src/test/main.c b/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/test/main.c similarity index 92% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/src/test/main.c rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/src/test/main.c index d36c8e4d7292e106cdf1944cb6b8f8a9f223474f..2a4cf8776cbca241d048ae632615ab64401c8517 100644 --- a/sflphone-common/libs/pjproject-1.0.1/pjmedia/src/test/main.c +++ b/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/test/main.c @@ -1,4 +1,4 @@ -/* $Id: main.c 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: main.c 2408 2009-01-01 22:08:21Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -39,7 +39,8 @@ int main(int argc, char *argv[]) if (argc == 2 && argv[1][0]=='-' && argv[1][1]=='i') { puts("\nPress <ENTER> to quit"); - fgets(s, sizeof(s), stdin); + if (fgets(s, sizeof(s), stdin) == NULL) + return rc; } return rc; diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/src/test/mips_test.c b/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/test/mips_test.c similarity index 99% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/src/test/mips_test.c rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/src/test/mips_test.c index 91f49c8b52780260e12c18ca6aa880c2342be78d..b4e738d31c3a210e1862e804ac199a25db58526c 100644 --- a/sflphone-common/libs/pjproject-1.0.1/pjmedia/src/test/mips_test.c +++ b/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/test/mips_test.c @@ -1,4 +1,4 @@ -/* $Id: mips_test.c 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: mips_test.c 2548 2009-03-23 13:28:30Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -881,6 +881,7 @@ static pjmedia_port* g722_encode_decode(pj_pool_t *pool, samples_per_frame, flags, te); } +#if defined(PJMEDIA_HAS_L16_CODEC) && PJMEDIA_HAS_L16_CODEC!=0 static pj_status_t init_l16_default(pjmedia_endpt *endpt) { return pjmedia_codec_l16_init(endpt, 0); @@ -913,6 +914,7 @@ static pjmedia_port* l16_16_encode_decode(pj_pool_t *pool, clock_rate, channel_count, samples_per_frame, flags, te); } +#endif /***************************************************************************/ /* WSOLA PLC mode */ @@ -2279,8 +2281,10 @@ int mips_test(void) { "codec encode/decode - iLBC", OP_PUT, K8, &ilbc_encode_decode}, { "codec encode/decode - Speex 8Khz", OP_PUT, K8, &speex8_encode_decode}, { "codec encode/decode - Speex 16Khz", OP_PUT, K16, &speex16_encode_decode}, +#if defined(PJMEDIA_HAS_L16_CODEC) && PJMEDIA_HAS_L16_CODEC!=0 { "codec encode/decode - L16/8000/1", OP_PUT, K8, &l16_8_encode_decode}, { "codec encode/decode - L16/16000/1", OP_PUT, K16, &l16_16_encode_decode}, +#endif { "stream TX/RX - G.711", OP_PUT_GET, K8, &create_stream_pcmu}, { "stream TX/RX - G.711 SRTP 32bit", OP_PUT_GET, K8, &create_stream_pcmu_srtp32_no_auth}, { "stream TX/RX - G.711 SRTP 32bit +auth", OP_PUT_GET, K8, &create_stream_pcmu_srtp32_with_auth}, diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/src/test/rtp_test.c b/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/test/rtp_test.c similarity index 93% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/src/test/rtp_test.c rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/src/test/rtp_test.c index c4a4e9247ce039083a24ab63252e67436d1365b3..2a62520c4a19deb18736ec0c84aa4af43d3f1f72 100644 --- a/sflphone-common/libs/pjproject-1.0.1/pjmedia/src/test/rtp_test.c +++ b/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/test/rtp_test.c @@ -32,7 +32,10 @@ int rtp_test() pjmedia_rtp_session_init (&rtp, 4, 0x12345678); pjmedia_rtp_encode_rtp (&rtp, 4, 0, 0, 160, &rtphdr, &hdrlen); - fwrite (rtphdr, hdrlen, 1, fhnd); + if (fwrite (rtphdr, hdrlen, 1, fhnd) != 1) { + fclose(fhnd); + return -1; + } fclose(fhnd); return 0; } diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/src/test/sdp_neg_test.c b/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/test/sdp_neg_test.c similarity index 99% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/src/test/sdp_neg_test.c rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/src/test/sdp_neg_test.c index b86c2e34bdd36d2dfbceb90d6a970c9944e190a3..35c414cea67f364614b7ecb8163452b11c7c78bd 100644 --- a/sflphone-common/libs/pjproject-1.0.1/pjmedia/src/test/sdp_neg_test.c +++ b/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/test/sdp_neg_test.c @@ -1,4 +1,4 @@ -/* $Id: sdp_neg_test.c 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: sdp_neg_test.c 2548 2009-03-23 13:28:30Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -1328,7 +1328,7 @@ static int offer_answer_test(pj_pool_t *pool, pjmedia_sdp_neg **p_neg, pjmedia_sdp_neg *neg; pj_status_t status; - status = pjmedia_sdp_parse(pool, oa->sdp1, pj_native_strlen(oa->sdp1), + status = pjmedia_sdp_parse(pool, oa->sdp1, pj_ansi_strlen(oa->sdp1), &sdp1); if (status != PJ_SUCCESS) { app_perror(status, " error: unexpected parse status for sdp1"); @@ -1370,7 +1370,7 @@ static int offer_answer_test(pj_pool_t *pool, pjmedia_sdp_neg **p_neg, } /* Parse and validate remote answer */ - status = pjmedia_sdp_parse(pool, oa->sdp2, pj_native_strlen(oa->sdp2), + status = pjmedia_sdp_parse(pool, oa->sdp2, pj_ansi_strlen(oa->sdp2), &sdp2); if (status != PJ_SUCCESS) { app_perror(status, " error: parsing sdp2"); @@ -1405,7 +1405,7 @@ static int offer_answer_test(pj_pool_t *pool, pjmedia_sdp_neg **p_neg, } /* Parse and validate the correct active media. */ - status = pjmedia_sdp_parse(pool, oa->sdp3, pj_native_strlen(oa->sdp3), + status = pjmedia_sdp_parse(pool, oa->sdp3, pj_ansi_strlen(oa->sdp3), &sdp3); if (status != PJ_SUCCESS) { app_perror(status, " error: parsing sdp3"); @@ -1447,7 +1447,7 @@ static int offer_answer_test(pj_pool_t *pool, pjmedia_sdp_neg **p_neg, if (oa->sdp2) { /* Parse and validate initial local capability */ - status = pjmedia_sdp_parse(pool, oa->sdp2, pj_native_strlen(oa->sdp2), + status = pjmedia_sdp_parse(pool, oa->sdp2, pj_ansi_strlen(oa->sdp2), &sdp2); if (status != PJ_SUCCESS) { app_perror(status, " error: parsing sdp2"); @@ -1507,7 +1507,7 @@ static int offer_answer_test(pj_pool_t *pool, pjmedia_sdp_neg **p_neg, } /* Parse the correct answer. */ - status = pjmedia_sdp_parse(pool, oa->sdp3, pj_native_strlen(oa->sdp3), + status = pjmedia_sdp_parse(pool, oa->sdp3, pj_ansi_strlen(oa->sdp3), &sdp3); if (status != PJ_SUCCESS) { app_perror(status, " error: parsing sdp3"); diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/src/test/sdptest.c b/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/test/sdptest.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/src/test/sdptest.c rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/src/test/sdptest.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/src/test/session_test.c b/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/test/session_test.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/src/test/session_test.c rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/src/test/session_test.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/src/test/test.c b/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/test/test.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/src/test/test.c rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/src/test/test.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/src/test/test.h b/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/test/test.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/src/test/test.h rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/src/test/test.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/src/test/wince_main.c b/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/test/wince_main.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/src/test/wince_main.c rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/src/test/wince_main.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjmedia/src/test/wsola_test.c b/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/test/wsola_test.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjmedia/src/test/wsola_test.c rename to sflphone-common/libs/pjproject-1.0.2/pjmedia/src/test/wsola_test.c diff --git a/sflphone-common/libs/pjproject-1.0.2/pjnath/bin/pjnath-test-x86_64-unknown-linux-gnu b/sflphone-common/libs/pjproject-1.0.2/pjnath/bin/pjnath-test-x86_64-unknown-linux-gnu new file mode 100755 index 0000000000000000000000000000000000000000..04211592492fdd6811a6d506b60633266625aabb Binary files /dev/null and b/sflphone-common/libs/pjproject-1.0.2/pjnath/bin/pjnath-test-x86_64-unknown-linux-gnu differ diff --git a/sflphone-common/libs/pjproject-1.0.2/pjnath/bin/pjturn-client-x86_64-unknown-linux-gnu b/sflphone-common/libs/pjproject-1.0.2/pjnath/bin/pjturn-client-x86_64-unknown-linux-gnu new file mode 100755 index 0000000000000000000000000000000000000000..1069246a783679a577d95a9863aabcb7ccf686af Binary files /dev/null and b/sflphone-common/libs/pjproject-1.0.2/pjnath/bin/pjturn-client-x86_64-unknown-linux-gnu differ diff --git a/sflphone-common/libs/pjproject-1.0.2/pjnath/bin/pjturn-srv-x86_64-unknown-linux-gnu b/sflphone-common/libs/pjproject-1.0.2/pjnath/bin/pjturn-srv-x86_64-unknown-linux-gnu new file mode 100755 index 0000000000000000000000000000000000000000..0d2af4648b03b5043df35934f540320bff1bd532 Binary files /dev/null and b/sflphone-common/libs/pjproject-1.0.2/pjnath/bin/pjturn-srv-x86_64-unknown-linux-gnu differ diff --git a/sflphone-common/libs/pjproject-1.0.1/pjnath/build/Makefile b/sflphone-common/libs/pjproject-1.0.2/pjnath/build/Makefile similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjnath/build/Makefile rename to sflphone-common/libs/pjproject-1.0.2/pjnath/build/Makefile diff --git a/sflphone-common/libs/pjproject-1.0.1/pjnath/build/pjnath.dsp b/sflphone-common/libs/pjproject-1.0.2/pjnath/build/pjnath.dsp similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjnath/build/pjnath.dsp rename to sflphone-common/libs/pjproject-1.0.2/pjnath/build/pjnath.dsp diff --git a/sflphone-common/libs/pjproject-1.0.1/pjnath/build/pjnath.dsw b/sflphone-common/libs/pjproject-1.0.2/pjnath/build/pjnath.dsw similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjnath/build/pjnath.dsw rename to sflphone-common/libs/pjproject-1.0.2/pjnath/build/pjnath.dsw diff --git a/sflphone-common/libs/pjproject-1.0.1/pjnath/build/pjnath.vcproj b/sflphone-common/libs/pjproject-1.0.2/pjnath/build/pjnath.vcproj similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjnath/build/pjnath.vcproj rename to sflphone-common/libs/pjproject-1.0.2/pjnath/build/pjnath.vcproj diff --git a/sflphone-common/libs/pjproject-1.0.1/pjnath/build/pjnath_test.dsp b/sflphone-common/libs/pjproject-1.0.2/pjnath/build/pjnath_test.dsp similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjnath/build/pjnath_test.dsp rename to sflphone-common/libs/pjproject-1.0.2/pjnath/build/pjnath_test.dsp diff --git a/sflphone-common/libs/pjproject-1.0.1/pjnath/build/pjnath_test.vcproj b/sflphone-common/libs/pjproject-1.0.2/pjnath/build/pjnath_test.vcproj similarity index 92% rename from sflphone-common/libs/pjproject-1.0.1/pjnath/build/pjnath_test.vcproj rename to sflphone-common/libs/pjproject-1.0.2/pjnath/build/pjnath_test.vcproj index d3427d74d11f3f7efc9a9d49ee296e0d9585c57b..a636b209cf8925143082d46a77729b3881d937c3 100644 --- a/sflphone-common/libs/pjproject-1.0.1/pjnath/build/pjnath_test.vcproj +++ b/sflphone-common/libs/pjproject-1.0.2/pjnath/build/pjnath_test.vcproj @@ -251,6 +251,14 @@ /> </FileConfiguration> </File> + <File + RelativePath="..\src\pjnath-test\server.c" + > + </File> + <File + RelativePath="..\src\pjnath-test\sess_auth.c" + > + </File> <File RelativePath="..\src\pjnath-test\stun.c" > @@ -273,6 +281,10 @@ /> </FileConfiguration> </File> + <File + RelativePath="..\src\pjnath-test\stun_sock_test.c" + > + </File> <File RelativePath="..\src\pjnath-test\test.c" > @@ -295,6 +307,10 @@ /> </FileConfiguration> </File> + <File + RelativePath="..\src\pjnath-test\turn_sock_test.c" + > + </File> </Filter> <Filter Name="Header Files" diff --git a/sflphone-common/libs/pjproject-1.0.1/pjnath/build/pjstun_srv_test.dsp b/sflphone-common/libs/pjproject-1.0.2/pjnath/build/pjstun_srv_test.dsp similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjnath/build/pjstun_srv_test.dsp rename to sflphone-common/libs/pjproject-1.0.2/pjnath/build/pjstun_srv_test.dsp diff --git a/sflphone-common/libs/pjproject-1.0.1/pjnath/build/pjstun_srv_test.vcproj b/sflphone-common/libs/pjproject-1.0.2/pjnath/build/pjstun_srv_test.vcproj similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjnath/build/pjstun_srv_test.vcproj rename to sflphone-common/libs/pjproject-1.0.2/pjnath/build/pjstun_srv_test.vcproj diff --git a/sflphone-common/libs/pjproject-1.0.1/pjnath/build/pjturn_client.dsp b/sflphone-common/libs/pjproject-1.0.2/pjnath/build/pjturn_client.dsp similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjnath/build/pjturn_client.dsp rename to sflphone-common/libs/pjproject-1.0.2/pjnath/build/pjturn_client.dsp diff --git a/sflphone-common/libs/pjproject-1.0.1/pjnath/build/pjturn_client.vcproj b/sflphone-common/libs/pjproject-1.0.2/pjnath/build/pjturn_client.vcproj similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjnath/build/pjturn_client.vcproj rename to sflphone-common/libs/pjproject-1.0.2/pjnath/build/pjturn_client.vcproj diff --git a/sflphone-common/libs/pjproject-1.0.1/pjnath/build/pjturn_srv.dsp b/sflphone-common/libs/pjproject-1.0.2/pjnath/build/pjturn_srv.dsp similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjnath/build/pjturn_srv.dsp rename to sflphone-common/libs/pjproject-1.0.2/pjnath/build/pjturn_srv.dsp diff --git a/sflphone-common/libs/pjproject-1.0.1/pjnath/build/wince-evc4/pjnath_test_wince.vcp b/sflphone-common/libs/pjproject-1.0.2/pjnath/build/wince-evc4/pjnath_test_wince.vcp similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjnath/build/wince-evc4/pjnath_test_wince.vcp rename to sflphone-common/libs/pjproject-1.0.2/pjnath/build/wince-evc4/pjnath_test_wince.vcp diff --git a/sflphone-common/libs/pjproject-1.0.1/pjnath/build/wince-evc4/pjnath_wince.vcp b/sflphone-common/libs/pjproject-1.0.2/pjnath/build/wince-evc4/pjnath_wince.vcp similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjnath/build/wince-evc4/pjnath_wince.vcp rename to sflphone-common/libs/pjproject-1.0.2/pjnath/build/wince-evc4/pjnath_wince.vcp diff --git a/sflphone-common/libs/pjproject-1.0.1/pjnath/build/wince-evc4/pjnath_wince.vcw b/sflphone-common/libs/pjproject-1.0.2/pjnath/build/wince-evc4/pjnath_wince.vcw similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjnath/build/wince-evc4/pjnath_wince.vcw rename to sflphone-common/libs/pjproject-1.0.2/pjnath/build/wince-evc4/pjnath_wince.vcw diff --git a/sflphone-common/libs/pjproject-1.0.1/pjnath/docs/UML-class-diagram.dia b/sflphone-common/libs/pjproject-1.0.2/pjnath/docs/UML-class-diagram.dia similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjnath/docs/UML-class-diagram.dia rename to sflphone-common/libs/pjproject-1.0.2/pjnath/docs/UML-class-diagram.dia diff --git a/sflphone-common/libs/pjproject-1.0.1/pjnath/docs/UML-class-diagram.png b/sflphone-common/libs/pjproject-1.0.2/pjnath/docs/UML-class-diagram.png similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjnath/docs/UML-class-diagram.png rename to sflphone-common/libs/pjproject-1.0.2/pjnath/docs/UML-class-diagram.png diff --git a/sflphone-common/libs/pjproject-1.0.1/pjnath/docs/doxygen.cfg b/sflphone-common/libs/pjproject-1.0.2/pjnath/docs/doxygen.cfg similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjnath/docs/doxygen.cfg rename to sflphone-common/libs/pjproject-1.0.2/pjnath/docs/doxygen.cfg diff --git a/sflphone-common/libs/pjproject-1.0.1/pjnath/docs/doxygen.css b/sflphone-common/libs/pjproject-1.0.2/pjnath/docs/doxygen.css similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjnath/docs/doxygen.css rename to sflphone-common/libs/pjproject-1.0.2/pjnath/docs/doxygen.css diff --git a/sflphone-common/libs/pjproject-1.0.1/pjnath/docs/footer.html b/sflphone-common/libs/pjproject-1.0.2/pjnath/docs/footer.html similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjnath/docs/footer.html rename to sflphone-common/libs/pjproject-1.0.2/pjnath/docs/footer.html diff --git a/sflphone-common/libs/pjproject-1.0.1/pjnath/docs/header.html b/sflphone-common/libs/pjproject-1.0.2/pjnath/docs/header.html similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjnath/docs/header.html rename to sflphone-common/libs/pjproject-1.0.2/pjnath/docs/header.html diff --git a/sflphone-common/libs/pjproject-1.0.1/pjnath/docs/ice-arch.jpg b/sflphone-common/libs/pjproject-1.0.2/pjnath/docs/ice-arch.jpg similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjnath/docs/ice-arch.jpg rename to sflphone-common/libs/pjproject-1.0.2/pjnath/docs/ice-arch.jpg diff --git a/sflphone-common/libs/pjproject-1.0.1/pjnath/docs/stun-arch.jpg b/sflphone-common/libs/pjproject-1.0.2/pjnath/docs/stun-arch.jpg similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjnath/docs/stun-arch.jpg rename to sflphone-common/libs/pjproject-1.0.2/pjnath/docs/stun-arch.jpg diff --git a/sflphone-common/libs/pjproject-1.0.1/pjnath/include/pjnath.h b/sflphone-common/libs/pjproject-1.0.2/pjnath/include/pjnath.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjnath/include/pjnath.h rename to sflphone-common/libs/pjproject-1.0.2/pjnath/include/pjnath.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjnath/include/pjnath/config.h b/sflphone-common/libs/pjproject-1.0.2/pjnath/include/pjnath/config.h similarity index 97% rename from sflphone-common/libs/pjproject-1.0.1/pjnath/include/pjnath/config.h rename to sflphone-common/libs/pjproject-1.0.2/pjnath/include/pjnath/config.h index b7bf10901054bbc47fb65e4848afd2efb9bd9fe0..d2f79be003b35df45bbd88b606c7ab094de110d1 100644 --- a/sflphone-common/libs/pjproject-1.0.1/pjnath/include/pjnath/config.h +++ b/sflphone-common/libs/pjproject-1.0.2/pjnath/include/pjnath/config.h @@ -1,5 +1,5 @@ /* $Id: config.h 2394 2008-12-23 17:27:53Z bennylp $ */ -/* +/* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> * @@ -15,7 +15,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __PJNATH_CONFIG_H__ #define __PJNATH_CONFIG_H__ @@ -65,9 +65,9 @@ /** * The default initial STUN round-trip time estimation (the RTO value - * in RFC 3489-bis), in miliseconds. - * This value is used to control the STUN request - * retransmit time. The initial value of retransmission interval + * in RFC 3489-bis), in miliseconds. + * This value is used to control the STUN request + * retransmit time. The initial value of retransmission interval * would be set to this value, and will be doubled after each * retransmission. */ @@ -78,7 +78,7 @@ /** * The STUN transaction timeout value, in miliseconds. - * After the last retransmission is sent and if no response is received + * After the last retransmission is sent and if no response is received * after this time, the STUN transaction will be considered to have failed. * * The default value is 16x RTO (as per RFC 3489-bis). @@ -201,8 +201,8 @@ /** - * Number of seconds to refresh the permission/channel binding before the - * permission/channel binding expires. This value should be greater than + * Number of seconds to refresh the permission/channel binding before the + * permission/channel binding expires. This value should be greater than * PJ_TURN_PERM_TIMEOUT setting. */ #ifndef PJ_TURN_REFRESH_SEC_BEFORE @@ -211,7 +211,7 @@ /** - * The TURN session timer heart beat interval. When this timer occurs, the + * The TURN session timer heart beat interval. When this timer occurs, the * TURN session will scan all the permissions/channel bindings to see which * need to be refreshed. */ @@ -270,10 +270,10 @@ /** * The number of bits to represent ICE candidate's local preference. The * local preference is used to specify preference among candidates with - * the same type, and ICE draft suggests 65535 as the default local - * preference, which means we need 16 bits to represent the value. But + * the same type, and ICE draft suggests 65535 as the default local + * preference, which means we need 16 bits to represent the value. But * since we don't have the facility to specify local preference, we'll - * just disable this feature and let the preference sorted by the + * just disable this feature and let the preference sorted by the * type only. * * Default: 0 @@ -304,15 +304,15 @@ /** - * According to ICE Section 8.2. Updating States, if an In-Progress pair in - * the check list is for the same component as a nominated pair, the agent + * According to ICE Section 8.2. Updating States, if an In-Progress pair in + * the check list is for the same component as a nominated pair, the agent * SHOULD cease retransmissions for its check if its pair priority is lower * than the lowest priority nominated pair for that component. * * If a higher priority check is In Progress, this rule would cause that * check to be performed even when it most likely will fail. * - * The macro here controls if ICE session should cancel all In Progress + * The macro here controls if ICE session should cancel all In Progress * checks for the same component regardless of its priority. * * Default: 1 (yes, cancel all) diff --git a/sflphone-common/libs/pjproject-1.0.1/pjnath/include/pjnath/errno.h b/sflphone-common/libs/pjproject-1.0.2/pjnath/include/pjnath/errno.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjnath/include/pjnath/errno.h rename to sflphone-common/libs/pjproject-1.0.2/pjnath/include/pjnath/errno.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjnath/include/pjnath/ice_session.h b/sflphone-common/libs/pjproject-1.0.2/pjnath/include/pjnath/ice_session.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjnath/include/pjnath/ice_session.h rename to sflphone-common/libs/pjproject-1.0.2/pjnath/include/pjnath/ice_session.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjnath/include/pjnath/ice_strans.h b/sflphone-common/libs/pjproject-1.0.2/pjnath/include/pjnath/ice_strans.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjnath/include/pjnath/ice_strans.h rename to sflphone-common/libs/pjproject-1.0.2/pjnath/include/pjnath/ice_strans.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjnath/include/pjnath/nat_detect.h b/sflphone-common/libs/pjproject-1.0.2/pjnath/include/pjnath/nat_detect.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjnath/include/pjnath/nat_detect.h rename to sflphone-common/libs/pjproject-1.0.2/pjnath/include/pjnath/nat_detect.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjnath/include/pjnath/stun_auth.h b/sflphone-common/libs/pjproject-1.0.2/pjnath/include/pjnath/stun_auth.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjnath/include/pjnath/stun_auth.h rename to sflphone-common/libs/pjproject-1.0.2/pjnath/include/pjnath/stun_auth.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjnath/include/pjnath/stun_config.h b/sflphone-common/libs/pjproject-1.0.2/pjnath/include/pjnath/stun_config.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjnath/include/pjnath/stun_config.h rename to sflphone-common/libs/pjproject-1.0.2/pjnath/include/pjnath/stun_config.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjnath/include/pjnath/stun_msg.h b/sflphone-common/libs/pjproject-1.0.2/pjnath/include/pjnath/stun_msg.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjnath/include/pjnath/stun_msg.h rename to sflphone-common/libs/pjproject-1.0.2/pjnath/include/pjnath/stun_msg.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjnath/include/pjnath/stun_session.h b/sflphone-common/libs/pjproject-1.0.2/pjnath/include/pjnath/stun_session.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjnath/include/pjnath/stun_session.h rename to sflphone-common/libs/pjproject-1.0.2/pjnath/include/pjnath/stun_session.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjnath/include/pjnath/stun_sock.h b/sflphone-common/libs/pjproject-1.0.2/pjnath/include/pjnath/stun_sock.h similarity index 98% rename from sflphone-common/libs/pjproject-1.0.1/pjnath/include/pjnath/stun_sock.h rename to sflphone-common/libs/pjproject-1.0.2/pjnath/include/pjnath/stun_sock.h index 97c273be0a2f797b2f4977c6e28c6640afa310f5..a2a322486d6e6f02c85bedb5cdc5211f73239803 100644 --- a/sflphone-common/libs/pjproject-1.0.1/pjnath/include/pjnath/stun_sock.h +++ b/sflphone-common/libs/pjproject-1.0.2/pjnath/include/pjnath/stun_sock.h @@ -1,4 +1,4 @@ -/* $Id: stun_sock.h 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: stun_sock.h 2531 2009-03-23 13:02:53Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -74,6 +74,12 @@ typedef enum pj_stun_sock_op */ PJ_STUN_SOCK_KEEP_ALIVE_OP, + /** + * IP address change notification from the keep-alive operation. + */ + PJ_STUN_SOCK_MAPPED_ADDR_CHANGE + + } pj_stun_sock_op; diff --git a/sflphone-common/libs/pjproject-1.0.1/pjnath/include/pjnath/stun_transaction.h b/sflphone-common/libs/pjproject-1.0.2/pjnath/include/pjnath/stun_transaction.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjnath/include/pjnath/stun_transaction.h rename to sflphone-common/libs/pjproject-1.0.2/pjnath/include/pjnath/stun_transaction.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjnath/include/pjnath/turn_session.h b/sflphone-common/libs/pjproject-1.0.2/pjnath/include/pjnath/turn_session.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjnath/include/pjnath/turn_session.h rename to sflphone-common/libs/pjproject-1.0.2/pjnath/include/pjnath/turn_session.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjnath/include/pjnath/turn_sock.h b/sflphone-common/libs/pjproject-1.0.2/pjnath/include/pjnath/turn_sock.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjnath/include/pjnath/turn_sock.h rename to sflphone-common/libs/pjproject-1.0.2/pjnath/include/pjnath/turn_sock.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjnath/include/pjnath/types.h b/sflphone-common/libs/pjproject-1.0.2/pjnath/include/pjnath/types.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjnath/include/pjnath/types.h rename to sflphone-common/libs/pjproject-1.0.2/pjnath/include/pjnath/types.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjnath/src/pjnath-test/ice_test.c b/sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjnath-test/ice_test.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjnath/src/pjnath-test/ice_test.c rename to sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjnath-test/ice_test.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjnath/src/pjnath-test/main.c b/sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjnath-test/main.c similarity index 92% rename from sflphone-common/libs/pjproject-1.0.1/pjnath/src/pjnath-test/main.c rename to sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjnath-test/main.c index 3d1c2ccb7c7bdc3776fe688f13d12a4ef4882d09..301636dbe7f8509def181ef3ca482da24bdbc05d 100644 --- a/sflphone-common/libs/pjproject-1.0.1/pjnath/src/pjnath-test/main.c +++ b/sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjnath-test/main.c @@ -1,4 +1,4 @@ -/* $Id: main.c 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: main.c 2408 2009-01-01 22:08:21Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -53,7 +53,8 @@ int main(int argc, char *argv[]) char buf[10]; puts("Press <ENTER> to exit"); - fgets(buf, sizeof(buf), stdin); + if (fgets(buf, sizeof(buf), stdin) == NULL) + return rc; } return rc; diff --git a/sflphone-common/libs/pjproject-1.0.1/pjnath/src/pjnath-test/main_win32.c b/sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjnath-test/main_win32.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjnath/src/pjnath-test/main_win32.c rename to sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjnath-test/main_win32.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjnath/src/pjnath-test/server.c b/sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjnath-test/server.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjnath/src/pjnath-test/server.c rename to sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjnath-test/server.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjnath/src/pjnath-test/server.h b/sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjnath-test/server.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjnath/src/pjnath-test/server.h rename to sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjnath-test/server.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjnath/src/pjnath-test/sess_auth.c b/sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjnath-test/sess_auth.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjnath/src/pjnath-test/sess_auth.c rename to sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjnath-test/sess_auth.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjnath/src/pjnath-test/stun.c b/sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjnath-test/stun.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjnath/src/pjnath-test/stun.c rename to sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjnath-test/stun.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjnath/src/pjnath-test/stun_sock_test.c b/sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjnath-test/stun_sock_test.c similarity index 99% rename from sflphone-common/libs/pjproject-1.0.1/pjnath/src/pjnath-test/stun_sock_test.c rename to sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjnath-test/stun_sock_test.c index d80ab320c125f4ed9ba811816b61b03c939bd65d..585355f04fbe1d143b9e5d566027f87e10b152a0 100644 --- a/sflphone-common/libs/pjproject-1.0.1/pjnath/src/pjnath-test/stun_sock_test.c +++ b/sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjnath-test/stun_sock_test.c @@ -1,4 +1,4 @@ -/* $Id: stun_sock_test.c 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: stun_sock_test.c 2531 2009-03-23 13:02:53Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -627,12 +627,16 @@ static int keep_alive_test(pj_stun_config *cfg) /* Check that client status is still okay and on_status() callback is NOT * called */ + /* No longer valid due to this ticket: + * http://trac.pjsip.org/repos/ticket/742 + if (client->on_status_cnt != 0) { PJ_LOG(3, (THIS_FILE, " error: on_status() must not be called on successful" "keep-alive when mapped-address does not change")); ret = -430; goto on_return; } + */ /* Check that client doesn't receive anything */ if (client->on_rx_data_cnt != 0) { PJ_LOG(3,(THIS_FILE, " error: client shouldn't have received anything")); @@ -686,7 +690,7 @@ static int keep_alive_test(pj_stun_config *cfg) goto on_return; } /* Check that callback was called with correct operation */ - if (client->last_op != PJ_STUN_SOCK_KEEP_ALIVE_OP) { + if (client->last_op != PJ_STUN_SOCK_MAPPED_ADDR_CHANGE) { PJ_LOG(3,(THIS_FILE, " error: expecting keep-alive operation status")); ret = -470; goto on_return; diff --git a/sflphone-common/libs/pjproject-1.0.1/pjnath/src/pjnath-test/test.c b/sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjnath-test/test.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjnath/src/pjnath-test/test.c rename to sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjnath-test/test.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjnath/src/pjnath-test/test.h b/sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjnath-test/test.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjnath/src/pjnath-test/test.h rename to sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjnath-test/test.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjnath/src/pjnath-test/turn_sock_test.c b/sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjnath-test/turn_sock_test.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjnath/src/pjnath-test/turn_sock_test.c rename to sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjnath-test/turn_sock_test.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjnath/src/pjnath/errno.c b/sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjnath/errno.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjnath/src/pjnath/errno.c rename to sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjnath/errno.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjnath/src/pjnath/ice_session.c b/sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjnath/ice_session.c similarity index 99% rename from sflphone-common/libs/pjproject-1.0.1/pjnath/src/pjnath/ice_session.c rename to sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjnath/ice_session.c index f0f6d9d851bf71e4859e5e0ba109c01917b9ea21..cb293d377576de675b295bbe236878c2fcb1ced1 100644 --- a/sflphone-common/libs/pjproject-1.0.1/pjnath/src/pjnath/ice_session.c +++ b/sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjnath/ice_session.c @@ -1,4 +1,4 @@ -/* $Id: ice_session.c 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: ice_session.c 2419 2009-01-12 10:06:04Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -2457,7 +2457,6 @@ PJ_DEF(pj_status_t) pj_ice_sess_on_rx_pkt(pj_ice_sess *ice, pj_ice_sess_comp *comp; pj_ice_msg_data *msg_data = NULL; unsigned i; - pj_status_t stun_status; PJ_ASSERT_RETURN(ice, PJ_EINVAL); @@ -2465,8 +2464,8 @@ PJ_DEF(pj_status_t) pj_ice_sess_on_rx_pkt(pj_ice_sess *ice, comp = find_comp(ice, comp_id); if (comp == NULL) { - status = PJNATH_EICEINCOMPID; - goto on_return; + pj_mutex_unlock(ice->mutex); + return PJNATH_EICEINCOMPID; } /* Find transport */ @@ -2478,13 +2477,13 @@ PJ_DEF(pj_status_t) pj_ice_sess_on_rx_pkt(pj_ice_sess *ice, } if (msg_data == NULL) { pj_assert(!"Invalid transport ID"); - status = PJ_EINVAL; - goto on_return; + pj_mutex_unlock(ice->mutex); + return PJ_EINVAL; } - stun_status = pj_stun_msg_check((const pj_uint8_t*)pkt, pkt_size, - PJ_STUN_IS_DATAGRAM); - if (stun_status == PJ_SUCCESS) { + status = pj_stun_msg_check((const pj_uint8_t*)pkt, pkt_size, + PJ_STUN_IS_DATAGRAM); + if (status == PJ_SUCCESS) { status = pj_stun_session_on_rx_pkt(comp->stun_sess, pkt, pkt_size, PJ_STUN_IS_DATAGRAM, msg_data, NULL, src_addr, src_addr_len); @@ -2493,14 +2492,18 @@ PJ_DEF(pj_status_t) pj_ice_sess_on_rx_pkt(pj_ice_sess *ice, LOG4((ice->obj_name, "Error processing incoming message: %s", ice->tmp.errmsg)); } + pj_mutex_unlock(ice->mutex); } else { + /* Not a STUN packet. Call application's callback instead, but release + * the mutex now or otherwise we may get deadlock. + */ + pj_mutex_unlock(ice->mutex); + (*ice->cb.on_rx_data)(ice, comp_id, transport_id, pkt, pkt_size, src_addr, src_addr_len); + status = PJ_SUCCESS; } - -on_return: - pj_mutex_unlock(ice->mutex); return status; } diff --git a/sflphone-common/libs/pjproject-1.0.1/pjnath/src/pjnath/ice_strans.c b/sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjnath/ice_strans.c similarity index 99% rename from sflphone-common/libs/pjproject-1.0.1/pjnath/src/pjnath/ice_strans.c rename to sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjnath/ice_strans.c index f640ab51b102f0ca2aaaead6e8c6533a0a5638b9..b51c26998331f6d81fa40d4ba13a2bbd1daeda59 100644 --- a/sflphone-common/libs/pjproject-1.0.1/pjnath/src/pjnath/ice_strans.c +++ b/sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjnath/ice_strans.c @@ -1,4 +1,4 @@ -/* $Id: ice_strans.c 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: ice_strans.c 2531 2009-03-23 13:02:53Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -1265,12 +1265,16 @@ static pj_bool_t stun_on_status(pj_stun_sock *stun_sock, } break; case PJ_STUN_SOCK_BINDING_OP: + case PJ_STUN_SOCK_MAPPED_ADDR_CHANGE: if (status == PJ_SUCCESS) { pj_stun_sock_info info; status = pj_stun_sock_get_info(stun_sock, &info); if (status == PJ_SUCCESS) { char ipaddr[PJ_INET6_ADDRSTRLEN+10]; + const char *op_name = (op==PJ_STUN_SOCK_BINDING_OP) ? + "Binding discovery complete" : + "srflx address changed"; pj_bool_t dup = PJ_FALSE; /* Eliminate the srflx candidate if the address is @@ -1308,9 +1312,9 @@ static pj_bool_t stun_on_status(pj_stun_sock *stun_sock, } PJ_LOG(4,(comp->ice_st->obj_name, - "Comp %d: Binding discovery complete, " + "Comp %d: %s, " "srflx address is %s", - comp->comp_id, + comp->comp_id, op_name, pj_sockaddr_print(&info.mapped_addr, ipaddr, sizeof(ipaddr), 3))); diff --git a/sflphone-common/libs/pjproject-1.0.1/pjnath/src/pjnath/nat_detect.c b/sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjnath/nat_detect.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjnath/src/pjnath/nat_detect.c rename to sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjnath/nat_detect.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjnath/src/pjnath/stun_auth.c b/sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjnath/stun_auth.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjnath/src/pjnath/stun_auth.c rename to sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjnath/stun_auth.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjnath/src/pjnath/stun_msg.c b/sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjnath/stun_msg.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjnath/src/pjnath/stun_msg.c rename to sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjnath/stun_msg.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjnath/src/pjnath/stun_msg_dump.c b/sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjnath/stun_msg_dump.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjnath/src/pjnath/stun_msg_dump.c rename to sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjnath/stun_msg_dump.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjnath/src/pjnath/stun_session.c b/sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjnath/stun_session.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjnath/src/pjnath/stun_session.c rename to sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjnath/stun_session.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjnath/src/pjnath/stun_sock.c b/sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjnath/stun_sock.c similarity index 99% rename from sflphone-common/libs/pjproject-1.0.1/pjnath/src/pjnath/stun_sock.c rename to sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjnath/stun_sock.c index f87fe46aec7109d185e120d64b9723a81ecc36bf..40ab8ad5891db05fb1f8a91045fb6558b84ee279 100644 --- a/sflphone-common/libs/pjproject-1.0.1/pjnath/src/pjnath/stun_sock.c +++ b/sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjnath/stun_sock.c @@ -1,4 +1,4 @@ -/* $Id: stun_sock.c 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: stun_sock.c 2531 2009-03-23 13:02:53Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -669,11 +669,13 @@ static void sess_on_request_complete(pj_stun_session *sess, pj_sockaddr_cp(&stun_sock->mapped_addr, &mapped_attr->sockaddr); - resched = (*stun_sock->cb.on_status)(stun_sock, op, PJ_SUCCESS); - - goto on_return; + if (op==PJ_STUN_SOCK_KEEP_ALIVE_OP) + op = PJ_STUN_SOCK_MAPPED_ADDR_CHANGE; } + /* Notify user */ + resched = (*stun_sock->cb.on_status)(stun_sock, op, PJ_SUCCESS); + on_return: /* Start/restart keep-alive timer */ if (resched) diff --git a/sflphone-common/libs/pjproject-1.0.1/pjnath/src/pjnath/stun_transaction.c b/sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjnath/stun_transaction.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjnath/src/pjnath/stun_transaction.c rename to sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjnath/stun_transaction.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjnath/src/pjnath/turn_session.c b/sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjnath/turn_session.c similarity index 99% rename from sflphone-common/libs/pjproject-1.0.1/pjnath/src/pjnath/turn_session.c rename to sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjnath/turn_session.c index cc904dc9623f5449f084f9bd2a778e467a6b6099..1edb2f944e7c911123a99b499754fffd77cf2bfd 100644 --- a/sflphone-common/libs/pjproject-1.0.1/pjnath/src/pjnath/turn_session.c +++ b/sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjnath/turn_session.c @@ -1,4 +1,4 @@ -/* $Id: turn_session.c 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: turn_session.c 2407 2009-01-01 20:56:36Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -1076,9 +1076,8 @@ static void on_session_fail( pj_turn_session *sess, PJ_LOG(4,(sess->obj_name, "Trying next server")); set_state(sess, PJ_TURN_STATE_RESOLVED); - break; - } while (status != PJ_SUCCESS); + } while (0); } diff --git a/sflphone-common/libs/pjproject-1.0.1/pjnath/src/pjnath/turn_sock.c b/sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjnath/turn_sock.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjnath/src/pjnath/turn_sock.c rename to sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjnath/turn_sock.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjnath/src/pjturn-client/client_main.c b/sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjturn-client/client_main.c similarity index 99% rename from sflphone-common/libs/pjproject-1.0.1/pjnath/src/pjturn-client/client_main.c rename to sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjturn-client/client_main.c index 94310ce750ef956343f44f84063c1f766d65e379..dc22ac75795a23d359a198e099015704053a907e 100644 --- a/sflphone-common/libs/pjproject-1.0.1/pjnath/src/pjturn-client/client_main.c +++ b/sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjturn-client/client_main.c @@ -1,4 +1,4 @@ -/* $Id: client_main.c 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: client_main.c 2408 2009-01-01 22:08:21Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -445,7 +445,8 @@ static void console_main(void) menu(); - fgets(input, sizeof(input), stdin); + if (fgets(input, sizeof(input), stdin) == NULL) + break; switch (input[0]) { case 'a': diff --git a/sflphone-common/libs/pjproject-1.0.1/pjnath/src/pjturn-srv/allocation.c b/sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjturn-srv/allocation.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjnath/src/pjturn-srv/allocation.c rename to sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjturn-srv/allocation.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjnath/src/pjturn-srv/auth.c b/sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjturn-srv/auth.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjnath/src/pjturn-srv/auth.c rename to sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjturn-srv/auth.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjnath/src/pjturn-srv/auth.h b/sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjturn-srv/auth.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjnath/src/pjturn-srv/auth.h rename to sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjturn-srv/auth.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjnath/src/pjturn-srv/listener_tcp.c b/sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjturn-srv/listener_tcp.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjnath/src/pjturn-srv/listener_tcp.c rename to sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjturn-srv/listener_tcp.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjnath/src/pjturn-srv/listener_udp.c b/sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjturn-srv/listener_udp.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjnath/src/pjturn-srv/listener_udp.c rename to sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjturn-srv/listener_udp.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjnath/src/pjturn-srv/main.c b/sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjturn-srv/main.c similarity index 97% rename from sflphone-common/libs/pjproject-1.0.1/pjnath/src/pjturn-srv/main.c rename to sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjturn-srv/main.c index a302be82e3b449a08c13272acdefb98236f0e44f..095745363198f24ad0b90143d6771c3c5d5b07dd 100644 --- a/sflphone-common/libs/pjproject-1.0.1/pjnath/src/pjturn-srv/main.c +++ b/sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjturn-srv/main.c @@ -1,4 +1,4 @@ -/* $Id: main.c 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: main.c 2408 2009-01-01 22:08:21Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -108,7 +108,8 @@ static void console_main(pj_turn_srv *srv) menu(); - fgets(line, sizeof(line), stdin); + if (fgets(line, sizeof(line), stdin) == NULL) + break; switch (line[0]) { case 'd': diff --git a/sflphone-common/libs/pjproject-1.0.1/pjnath/src/pjturn-srv/server.c b/sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjturn-srv/server.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjnath/src/pjturn-srv/server.c rename to sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjturn-srv/server.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjnath/src/pjturn-srv/turn.h b/sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjturn-srv/turn.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjnath/src/pjturn-srv/turn.h rename to sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjturn-srv/turn.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjproject-vs8.sln b/sflphone-common/libs/pjproject-1.0.2/pjproject-vs8.sln similarity index 86% rename from sflphone-common/libs/pjproject-1.0.1/pjproject-vs8.sln rename to sflphone-common/libs/pjproject-1.0.2/pjproject-vs8.sln index f60d26c2a53bb50b03acc55044bb9fbe9850113a..3bd34e2527a35efbe218c8895f6310fad3f78cb4 100644 --- a/sflphone-common/libs/pjproject-1.0.1/pjproject-vs8.sln +++ b/sflphone-common/libs/pjproject-1.0.2/pjproject-vs8.sln @@ -1,6 +1,6 @@ Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual C++ Express 2005 +# Visual Studio 2005 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pjlib", "pjlib\build\pjlib.vcproj", "{DA0E03ED-53A7-4050-8A85-90541C5509F8}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pjlib_test", "pjlib\build\pjlib_test.vcproj", "{6AC3EF61-5A9E-4F43-A809-5B2FD1A43B16}" @@ -113,10 +113,30 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libspeex", "third_party\bui EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libresample_dll", "third_party\build\resample\libresample_dll.vcproj", "{C48EAAF5-F69E-410B-9CE4-23AB41B00E2A}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libmilenage", "third_party\build\milenage\libmilenage.vcproj", "{4BF51C21-5A30-423B-82FE-1ED410E5769D}" -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libsrtp", "third_party\build\srtp\libsrtp.vcproj", "{F0DBAA03-1BA3-4E3B-A2CA-727E3D3AB858}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pjnath_test", "pjnath\build\pjnath_test.vcproj", "{553C094C-F581-4A80-9540-D5D7B398A2C6}" + ProjectSection(ProjectDependencies) = postProject + {DA0E03ED-53A7-4050-8A85-90541C5509F8} = {DA0E03ED-53A7-4050-8A85-90541C5509F8} + {FE07F272-AE7F-4549-9E9F-EF9B80CB1693} = {FE07F272-AE7F-4549-9E9F-EF9B80CB1693} + {A5D9AA24-08ED-48B9-BD65-F0A25E96BFC4} = {A5D9AA24-08ED-48B9-BD65-F0A25E96BFC4} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pjmedia_test", "pjmedia\build\pjmedia_test.vcproj", "{21C0CECF-69DD-4F70-BC2B-9B4DE7F15277}" + ProjectSection(ProjectDependencies) = postProject + {F0DBAA03-1BA3-4E3B-A2CA-727E3D3AB858} = {F0DBAA03-1BA3-4E3B-A2CA-727E3D3AB858} + {4BF51C21-5A30-423B-82FE-1ED410E5769D} = {4BF51C21-5A30-423B-82FE-1ED410E5769D} + {FE07F272-AE7F-4549-9E9F-EF9B80CB1693} = {FE07F272-AE7F-4549-9E9F-EF9B80CB1693} + {6794B975-4E84-4F49-B2DC-C31F2224E03E} = {6794B975-4E84-4F49-B2DC-C31F2224E03E} + {7FDE3880-A4AB-49E3-B439-EBEF0A0C7A65} = {7FDE3880-A4AB-49E3-B439-EBEF0A0C7A65} + {3CF9FFA9-8387-4635-9D1B-E7944CBEFEAA} = {3CF9FFA9-8387-4635-9D1B-E7944CBEFEAA} + {4B059DBA-CD9C-4D0F-BE8C-FFB4EFD498E9} = {4B059DBA-CD9C-4D0F-BE8C-FFB4EFD498E9} + {855DC8C0-D3E9-4A2E-AE47-116605A7BC9B} = {855DC8C0-D3E9-4A2E-AE47-116605A7BC9B} + {DA0E03ED-53A7-4050-8A85-90541C5509F8} = {DA0E03ED-53A7-4050-8A85-90541C5509F8} + {B5FE16F8-3EDB-4110-BD80-B4238CC01E8D} = {B5FE16F8-3EDB-4110-BD80-B4238CC01E8D} + {E53AA5FF-B737-40AA-BD13-387EFA99023D} = {E53AA5FF-B737-40AA-BD13-387EFA99023D} + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 @@ -215,6 +235,14 @@ Global {F0DBAA03-1BA3-4E3B-A2CA-727E3D3AB858}.Debug|Win32.Build.0 = Debug|Win32 {F0DBAA03-1BA3-4E3B-A2CA-727E3D3AB858}.Release|Win32.ActiveCfg = Release|Win32 {F0DBAA03-1BA3-4E3B-A2CA-727E3D3AB858}.Release|Win32.Build.0 = Release|Win32 + {553C094C-F581-4A80-9540-D5D7B398A2C6}.Debug|Win32.ActiveCfg = Debug|Win32 + {553C094C-F581-4A80-9540-D5D7B398A2C6}.Debug|Win32.Build.0 = Debug|Win32 + {553C094C-F581-4A80-9540-D5D7B398A2C6}.Release|Win32.ActiveCfg = Release|Win32 + {553C094C-F581-4A80-9540-D5D7B398A2C6}.Release|Win32.Build.0 = Release|Win32 + {21C0CECF-69DD-4F70-BC2B-9B4DE7F15277}.Debug|Win32.ActiveCfg = Debug|Win32 + {21C0CECF-69DD-4F70-BC2B-9B4DE7F15277}.Debug|Win32.Build.0 = Debug|Win32 + {21C0CECF-69DD-4F70-BC2B-9B4DE7F15277}.Release|Win32.ActiveCfg = Release|Win32 + {21C0CECF-69DD-4F70-BC2B-9B4DE7F15277}.Release|Win32.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/sflphone-common/libs/pjproject-1.0.1/pjproject.dsw b/sflphone-common/libs/pjproject-1.0.2/pjproject.dsw similarity index 93% rename from sflphone-common/libs/pjproject-1.0.1/pjproject.dsw rename to sflphone-common/libs/pjproject-1.0.2/pjproject.dsw index fe54cff7dabcbc8ce4ddbc68d1fe9f96433fec5c..069bebdd373e455cc825bdf1122851df3176ad5d 100644 --- a/sflphone-common/libs/pjproject-1.0.1/pjproject.dsw +++ b/sflphone-common/libs/pjproject-1.0.2/pjproject.dsw @@ -27,18 +27,6 @@ Package=<4> ############################################################################### -Project: "libmilenage"=.\third_party\build\milenage\libmilenage.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - Project: "libportaudio"=.\THIRD_PARTY\BUILD\PORTAUDIO\libportaudio.dsp - Package Owner=<4> Package=<5> @@ -345,9 +333,6 @@ Package=<4> Project_Dep_Name libresample End Project Dependency Begin Project Dependency - Project_Dep_Name libmilenage - End Project Dependency - Begin Project Dependency Project_Dep_Name libsrtp End Project Dependency }}} diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/bin/pjsua-x86_64-unknown-linux-gnu b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/bin/pjsua-x86_64-unknown-linux-gnu new file mode 100755 index 0000000000000000000000000000000000000000..3f1ed10dc8e3c7e2a38ef4bbd8cab83a25d611aa Binary files /dev/null and b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/bin/pjsua-x86_64-unknown-linux-gnu differ diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/bin/samples/bootstrap.inc b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/bin/samples/hack similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/bin/samples/bootstrap.inc rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/bin/samples/hack diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/build/Footprint.mak b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/build/Footprint.mak similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/build/Footprint.mak rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/build/Footprint.mak diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/build/Makefile b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/build/Makefile similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/build/Makefile rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/build/Makefile diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/build/Samples-vc.mak b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/build/Samples-vc.mak similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/build/Samples-vc.mak rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/build/Samples-vc.mak diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/build/Samples.mak b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/build/Samples.mak similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/build/Samples.mak rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/build/Samples.mak diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/build/get-footprint.py b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/build/get-footprint.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/build/get-footprint.py rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/build/get-footprint.py diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/build/os-win32.mak b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/build/os-win32.mak similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/build/os-win32.mak rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/build/os-win32.mak diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/build/pjsip_apps.dsw b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/build/pjsip_apps.dsw similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/build/pjsip_apps.dsw rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/build/pjsip_apps.dsw diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/build/pjsua.dsp b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/build/pjsua.dsp similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/build/pjsua.dsp rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/build/pjsua.dsp diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/build/pjsua.vcproj b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/build/pjsua.vcproj similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/build/pjsua.vcproj rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/build/pjsua.vcproj diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/build/py_pjsua.dsp b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/build/py_pjsua.dsp similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/build/py_pjsua.dsp rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/build/py_pjsua.dsp diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/build/py_pjsua.vcproj b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/build/py_pjsua.vcproj similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/build/py_pjsua.vcproj rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/build/py_pjsua.vcproj diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/build/python_pjsua.dsp b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/build/python_pjsua.dsp similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/build/python_pjsua.dsp rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/build/python_pjsua.dsp diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/build/sample_debug.dsp b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/build/sample_debug.dsp similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/build/sample_debug.dsp rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/build/sample_debug.dsp diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/build/sample_debug.vcproj b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/build/sample_debug.vcproj similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/build/sample_debug.vcproj rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/build/sample_debug.vcproj diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/build/samples.dsp b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/build/samples.dsp similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/build/samples.dsp rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/build/samples.dsp diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/build/samples.vcproj b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/build/samples.vcproj similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/build/samples.vcproj rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/build/samples.vcproj diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/build/wince-evc4/wince_demos.vcw b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/build/wince-evc4/wince_demos.vcw similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/build/wince-evc4/wince_demos.vcw rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/build/wince-evc4/wince_demos.vcw diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/pjsua/main.c b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pjsua/main.c similarity index 95% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/pjsua/main.c rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pjsua/main.c index da07c034fea63333e4fbc8009fd1b0056bb73873..10d9336524710b04151f9f23f6dd30a562601a89 100644 --- a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/pjsua/main.c +++ b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pjsua/main.c @@ -1,4 +1,4 @@ -/* $Id: main.c 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: main.c 2407 2009-01-01 20:56:36Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -52,7 +52,7 @@ static BOOL WINAPI CtrlHandler(DWORD fdwCtrlType) PJ_LOG(3,(THIS_FILE, "Ctrl-C detected, quitting..")); app_destroy(); ExitProcess(1); - return TRUE; + PJ_UNREACHED(return TRUE;) default: diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/pjsua/main_rtems.c b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pjsua/main_rtems.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/pjsua/main_rtems.c rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pjsua/main_rtems.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/pjsua/pjsua_app.c b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pjsua/pjsua_app.c similarity index 97% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/pjsua/pjsua_app.c rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pjsua/pjsua_app.c index f254d80111dcb7f1a4f39431a538a81b9cdd9ba5..ad3df904b6be652071afa52bbee19643f0af50b0 100644 --- a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/pjsua/pjsua_app.c +++ b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pjsua/pjsua_app.c @@ -1,4 +1,4 @@ -/* $Id: pjsua_app.c 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: pjsua_app.c 2544 2009-03-23 13:23:20Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -244,7 +244,7 @@ static void usage(void) puts (" --ec-tail=MSEC Set echo canceller tail length (default=256)"); puts (" --ec-opt=OPT Select echo canceller algorithm (0=default, "); puts (" 1=speex, 2=suppressor)"); - puts (" --ilbc-mode=MODE Set iLBC codec mode (20 or 30, default is 20)"); + puts (" --ilbc-mode=MODE Set iLBC codec mode (20 or 30, default is 30)"); puts (" --capture-dev=id Audio capture device ID (default=-1)"); puts (" --playback-dev=id Audio playback device ID (default=-1)"); puts (" --capture-lat=N Audio capture latency, in ms (default=100)"); @@ -1488,6 +1488,14 @@ static int write_settings(const struct app_config *config, pj_strcat2(&cfg, "\n#\n# Network settings:\n#\n"); + /* Nameservers */ + for (i=0; i<config->cfg.nameserver_count; ++i) { + pj_ansi_sprintf(line, "--nameserver %.*s\n", + (int)config->cfg.nameserver[i].slen, + config->cfg.nameserver[i].ptr); + pj_strcat2(&cfg, line); + } + /* Outbound proxy */ for (i=0; i<config->cfg.outbound_proxy_cnt; ++i) { pj_ansi_sprintf(line, "--outbound %.*s\n", @@ -2750,7 +2758,8 @@ static pj_bool_t simple_input(const char *title, char *buf, pj_size_t len) char *p; printf("%s (empty to cancel): ", title); fflush(stdout); - fgets(buf, len, stdin); + if (fgets(buf, len, stdin) == NULL) + return PJ_FALSE; /* Remove trailing newlines. */ for (p=buf; ; ++p) { @@ -2794,7 +2803,8 @@ static void ui_input_url(const char *title, char *buf, int len, printf("%s: ", title); fflush(stdout); - fgets(buf, len, stdin); + if (fgets(buf, len, stdin) == NULL) + return; len = strlen(buf); /* Left trim */ @@ -3023,7 +3033,8 @@ static void manage_codec_prio(void) "(e.g. \"speex/16000 200\"), empty to cancel:"); printf("Codec name (\"*\" for all) and priority: "); - fgets(input, sizeof(input), stdin); + if (fgets(input, sizeof(input), stdin) == NULL) + return; if (input[0]=='\r' || input[0]=='\n') { puts("Done"); return; @@ -4012,6 +4023,97 @@ on_exit: ; } +/***************************************************************************** + * A simple module to handle otherwise unhandled request. We will register + * this with the lowest priority. + */ + +/* Notification on incoming request */ +static pj_bool_t default_mod_on_rx_request(pjsip_rx_data *rdata) +{ + pjsip_tx_data *tdata; + pjsip_status_code status_code; + pj_status_t status; + + /* Don't respond to ACK! */ + if (pjsip_method_cmp(&rdata->msg_info.msg->line.req.method, + &pjsip_ack_method) == 0) + return PJ_TRUE; + + /* Create basic response. */ + if (pjsip_method_cmp(&rdata->msg_info.msg->line.req.method, + &pjsip_notify_method) == 0) + { + /* Unsolicited NOTIFY's, send with Bad Request */ + status_code = PJSIP_SC_BAD_REQUEST; + } else { + /* Probably unknown method */ + status_code = PJSIP_SC_METHOD_NOT_ALLOWED; + } + status = pjsip_endpt_create_response(pjsua_get_pjsip_endpt(), + rdata, status_code, + NULL, &tdata); + if (status != PJ_SUCCESS) { + pjsua_perror(THIS_FILE, "Unable to create response", status); + return PJ_TRUE; + } + + /* Add Allow if we're responding with 405 */ + if (status_code == PJSIP_SC_METHOD_NOT_ALLOWED) { + const pjsip_hdr *cap_hdr; + cap_hdr = pjsip_endpt_get_capability(pjsua_get_pjsip_endpt(), + PJSIP_H_ALLOW, NULL); + if (cap_hdr) { + pjsip_msg_add_hdr(tdata->msg, pjsip_hdr_clone(tdata->pool, + cap_hdr)); + } + } + + /* Add User-Agent header */ + { + pj_str_t user_agent; + char tmp[80]; + const pj_str_t USER_AGENT = { "User-Agent", 10}; + pjsip_hdr *h; + + pj_ansi_snprintf(tmp, sizeof(tmp), "PJSUA v%s/%s", + pj_get_version(), PJ_OS_NAME); + pj_strdup2_with_null(tdata->pool, &user_agent, tmp); + + h = (pjsip_hdr*) pjsip_generic_string_hdr_create(tdata->pool, + &USER_AGENT, + &user_agent); + pjsip_msg_add_hdr(tdata->msg, h); + } + + pjsip_endpt_send_response2(pjsua_get_pjsip_endpt(), rdata, tdata, + NULL, NULL); + + return PJ_TRUE; +} + + +/* The module instance. */ +static pjsip_module mod_default_handler = +{ + NULL, NULL, /* prev, next. */ + { "mod-default-handler", 19 }, /* Name. */ + -1, /* Id */ + PJSIP_MOD_PRIORITY_APPLICATION+99, /* Priority */ + NULL, /* load() */ + NULL, /* start() */ + NULL, /* stop() */ + NULL, /* unload() */ + &default_mod_on_rx_request, /* on_rx_request() */ + NULL, /* on_rx_response() */ + NULL, /* on_tx_request. */ + NULL, /* on_tx_response() */ + NULL, /* on_tsx_state() */ + +}; + + + /***************************************************************************** * Public API @@ -4062,6 +4164,12 @@ pj_status_t app_init(int argc, char *argv[]) if (status != PJ_SUCCESS) return status; + /* Initialize our module to handle otherwise unhandled request */ + status = pjsip_endpt_register_module(pjsua_get_pjsip_endpt(), + &mod_default_handler); + if (status != PJ_SUCCESS) + return status; + #ifdef STEREO_DEMO stereo_demo(); #endif diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/pjsua_wince/README.TXT b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pjsua_wince/README.TXT similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/pjsua_wince/README.TXT rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pjsua_wince/README.TXT diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/pjsua_wince/StdAfx.cpp b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pjsua_wince/StdAfx.cpp similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/pjsua_wince/StdAfx.cpp rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pjsua_wince/StdAfx.cpp diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/pjsua_wince/StdAfx.h b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pjsua_wince/StdAfx.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/pjsua_wince/StdAfx.h rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pjsua_wince/StdAfx.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/pjsua_wince/newres.h b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pjsua_wince/newres.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/pjsua_wince/newres.h rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pjsua_wince/newres.h diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pjsua_wince/pjsua_wince.cpp b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pjsua_wince/pjsua_wince.cpp new file mode 100644 index 0000000000000000000000000000000000000000..9ca242e83c8f355d783ffd36fae99d493e36538d --- /dev/null +++ b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pjsua_wince/pjsua_wince.cpp @@ -0,0 +1,828 @@ +// pjsua_wince.cpp : Defines the entry point for the application. +// + +#include "stdafx.h" +#include "pjsua_wince.h" +#include <commctrl.h> +#include <pjsua-lib/pjsua.h> + +#define MAX_LOADSTRING 100 + +// Global Variables: +static HINSTANCE hInst; +static HWND hMainWnd; +static HWND hwndCB; +static HWND hwndGlobalStatus, hwndURI, hwndCallStatus; +static HWND hwndActionButton, hwndExitButton; + + + +// +// Basic config. +// +#define SIP_PORT 5060 + + +// +// Destination URI (to make call, or to subscribe presence) +// +#define SIP_DST_URI "sip:192.168.0.7:5061" + +// +// Account +// +#define HAS_SIP_ACCOUNT 0 // 0 to disable registration +#define SIP_DOMAIN "server" +#define SIP_REALM "server" +#define SIP_USER "user" +#define SIP_PASSWD "secret" + +// +// Outbound proxy for all accounts +// +#define SIP_PROXY NULL +//#define SIP_PROXY "sip:192.168.0.2;lr" + + +// +// Configure nameserver if DNS SRV is to be used with both SIP +// or STUN (for STUN see other settings below) +// +#define NAMESERVER NULL +//#define NAMESERVER "62.241.163.201" + +// +// STUN server +#if 1 +// Use this to have the STUN server resolved normally +# define STUN_DOMAIN NULL +# define STUN_SERVER "stun.fwdnet.net" +#elif 0 +// Use this to have the STUN server resolved with DNS SRV +# define STUN_DOMAIN "iptel.org" +# define STUN_SERVER NULL +#else +// Use this to disable STUN +# define STUN_DOMAIN NULL +# define STUN_SERVER NULL +#endif + +// +// Use ICE? +// +#define USE_ICE 1 + + +// +// Globals +// +static pj_pool_t *g_pool; +static pj_str_t g_local_uri; +static int g_current_acc; +static int g_current_call = PJSUA_INVALID_ID; +static int g_current_action; + +enum { + ID_GLOBAL_STATUS = 21, + ID_URI, + ID_CALL_STATUS, + ID_POLL_TIMER, +}; + +enum { + ID_MENU_NONE = 64, + ID_MENU_CALL, + ID_MENU_ANSWER, + ID_MENU_DISCONNECT, + ID_BTN_ACTION, +}; + + +// Forward declarations of functions included in this code module: +static ATOM MyRegisterClass (HINSTANCE, LPTSTR); +BOOL InitInstance (HINSTANCE, int); +static void OnCreate (HWND hWnd); +static LRESULT CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM); + + + +///////////////////////////////////////////////////////////////////////////// + +static void OnError (const wchar_t *title, pj_status_t status) +{ + char errmsg[PJ_ERR_MSG_SIZE]; + PJ_DECL_UNICODE_TEMP_BUF (werrmsg, PJ_ERR_MSG_SIZE); + + pj_strerror (status, errmsg, sizeof (errmsg)); + + MessageBox (NULL, PJ_STRING_TO_NATIVE (errmsg, werrmsg, PJ_ERR_MSG_SIZE), + title, MB_OK); +} + + +static void SetLocalURI (const char *uri, int len, bool enabled=true) +{ + wchar_t tmp[128]; + + if (len==-1) len=pj_ansi_strlen (uri); + + pj_ansi_to_unicode (uri, len, tmp, PJ_ARRAY_SIZE (tmp)); + + SetDlgItemText (hMainWnd, ID_GLOBAL_STATUS, tmp); + + EnableWindow (hwndGlobalStatus, enabled?TRUE:FALSE); +} + + + +static void SetURI (const char *uri, int len, bool enabled=true) +{ + wchar_t tmp[128]; + + if (len==-1) len=pj_ansi_strlen (uri); + + pj_ansi_to_unicode (uri, len, tmp, PJ_ARRAY_SIZE (tmp)); + + SetDlgItemText (hMainWnd, ID_URI, tmp); + + EnableWindow (hwndURI, enabled?TRUE:FALSE); +} + + +static void SetCallStatus (const char *state, int len) +{ + wchar_t tmp[128]; + + if (len==-1) len=pj_ansi_strlen (state); + + pj_ansi_to_unicode (state, len, tmp, PJ_ARRAY_SIZE (tmp)); + + SetDlgItemText (hMainWnd, ID_CALL_STATUS, tmp); +} + +static void SetAction (int action, bool enable=true) +{ + HMENU hMenu; + + hMenu = CommandBar_GetMenu (hwndCB, 0); + + RemoveMenu (hMenu, ID_MENU_NONE, MF_BYCOMMAND); + RemoveMenu (hMenu, ID_MENU_CALL, MF_BYCOMMAND); + RemoveMenu (hMenu, ID_MENU_ANSWER, MF_BYCOMMAND); + RemoveMenu (hMenu, ID_MENU_DISCONNECT, MF_BYCOMMAND); + + switch (action) { + + case ID_MENU_NONE: + InsertMenu (hMenu, ID_EXIT, MF_BYCOMMAND, action, TEXT ("None")); + SetWindowText (hwndActionButton, TEXT ("-")); + break; + + case ID_MENU_CALL: + InsertMenu (hMenu, ID_EXIT, MF_BYCOMMAND, action, TEXT ("Call")); + SetWindowText (hwndActionButton, TEXT ("&Call")); + break; + + case ID_MENU_ANSWER: + InsertMenu (hMenu, ID_EXIT, MF_BYCOMMAND, action, TEXT ("Answer")); + SetWindowText (hwndActionButton, TEXT ("&Answer")); + break; + + case ID_MENU_DISCONNECT: + InsertMenu (hMenu, ID_EXIT, MF_BYCOMMAND, action, TEXT ("Hangup")); + SetWindowText (hwndActionButton, TEXT ("&Hangup")); + break; + } + + EnableMenuItem (hMenu, action, MF_BYCOMMAND | (enable?MF_ENABLED:MF_GRAYED)); + + DrawMenuBar (hMainWnd); + + g_current_action = action; +} + + +/* + * Handler when invite state has changed. + */ +static void on_call_state (pjsua_call_id call_id, pjsip_event *e) +{ + pjsua_call_info call_info; + + PJ_UNUSED_ARG (e); + + pjsua_call_get_info (call_id, &call_info); + + if (call_info.state == PJSIP_INV_STATE_DISCONNECTED) { + + g_current_call = PJSUA_INVALID_ID; + SetURI (SIP_DST_URI, -1); + SetAction (ID_MENU_CALL); + //SetCallStatus(call_info.state_text.ptr, call_info.state_text.slen); + SetCallStatus (call_info.last_status_text.ptr, call_info.last_status_text.slen); + + } else { + //if (g_current_call == PJSUA_INVALID_ID) + // g_current_call = call_id; + + if (call_info.remote_contact.slen) + SetURI (call_info.remote_contact.ptr, call_info.remote_contact.slen, false); + else + SetURI (call_info.remote_info.ptr, call_info.remote_info.slen, false); + + if (call_info.state == PJSIP_INV_STATE_CONFIRMED) + SetAction (ID_MENU_DISCONNECT); + + SetCallStatus (call_info.state_text.ptr, call_info.state_text.slen); + } +} + + +/* + * Callback on media state changed event. + * The action may connect the call to sound device, to file, or + * to loop the call. + */ +static void on_call_media_state (pjsua_call_id call_id) +{ + pjsua_call_info call_info; + + pjsua_call_get_info (call_id, &call_info); + + if (call_info.media_status == PJSUA_CALL_MEDIA_ACTIVE) { + pjsua_conf_connect (call_info.conf_slot, 0); + pjsua_conf_connect (0, call_info.conf_slot); + } +} + + +/** + * Handler when there is incoming call. + */ +static void on_incoming_call (pjsua_acc_id acc_id, pjsua_call_id call_id, + pjsip_rx_data *rdata) +{ + pjsua_call_info call_info; + + PJ_UNUSED_ARG (acc_id); + PJ_UNUSED_ARG (rdata); + + if (g_current_call != PJSUA_INVALID_ID) { + pj_str_t reason; + reason = pj_str ("Another call is in progress"); + pjsua_call_answer (call_id, PJSIP_SC_BUSY_HERE, &reason, NULL); + return; + } + + g_current_call = call_id; + + pjsua_call_get_info (call_id, &call_info); + + SetAction (ID_MENU_ANSWER); + SetURI (call_info.remote_info.ptr, call_info.remote_info.slen, false); + pjsua_call_answer (call_id, 200, NULL, NULL); +} + + +/* + * Handler registration status has changed. + */ +static void on_reg_state (pjsua_acc_id acc_id) +{ + PJ_UNUSED_ARG (acc_id); + + // Log already written. +} + + +/* + * Handler on buddy state changed. + */ +static void on_buddy_state (pjsua_buddy_id buddy_id) +{ +} + + +/** + * Incoming IM message (i.e. MESSAGE request)! + */ +static void on_pager (pjsua_call_id call_id, const pj_str_t *from, + const pj_str_t *to, const pj_str_t *contact, + const pj_str_t *mime_type, const pj_str_t *text) +{ +} + + +/** + * Received typing indication + */ +static void on_typing (pjsua_call_id call_id, const pj_str_t *from, + const pj_str_t *to, const pj_str_t *contact, + pj_bool_t is_typing) +{ +} + + +static BOOL OnInitStack (void) +{ + pjsua_config cfg; + pjsua_logging_config log_cfg; + pjsua_media_config media_cfg; + pjsua_transport_config udp_cfg; + pjsua_transport_config rtp_cfg; + pjsua_transport_id transport_id; + pjsua_transport_info transport_info; + pj_str_t tmp; + pj_status_t status; + + /* Create pjsua */ + status = pjsua_create(); + + if (status != PJ_SUCCESS) { + OnError (TEXT ("Error creating pjsua"), status); + return FALSE; + } + + /* Create global pool for application */ + g_pool = pjsua_pool_create ("pjsua", 4000, 4000); + + /* Init configs */ + pjsua_config_default (&cfg); + + pjsua_media_config_default (&media_cfg); + + pjsua_transport_config_default (&udp_cfg); + + udp_cfg.port = SIP_PORT; + + pjsua_transport_config_default (&rtp_cfg); + + rtp_cfg.port = 40000; + + pjsua_logging_config_default (&log_cfg); + + log_cfg.level = 5; + + log_cfg.log_filename = pj_str ("\\pjsua.txt"); + + log_cfg.msg_logging = 1; + + log_cfg.decor = pj_log_get_decor() | PJ_LOG_HAS_CR; + + /* Setup media */ + media_cfg.clock_rate = 8000; + + media_cfg.ec_options = PJMEDIA_ECHO_SIMPLE; + + media_cfg.ec_tail_len = 256; + + media_cfg.quality = 1; + + media_cfg.ptime = 20; + + media_cfg.enable_ice = USE_ICE; + + /* Initialize application callbacks */ + cfg.cb.on_call_state = &on_call_state; + + cfg.cb.on_call_media_state = &on_call_media_state; + + cfg.cb.on_incoming_call = &on_incoming_call; + + cfg.cb.on_reg_state = &on_reg_state; + + cfg.cb.on_buddy_state = &on_buddy_state; + + cfg.cb.on_pager = &on_pager; + + cfg.cb.on_typing = &on_typing; + + if (SIP_PROXY) { + cfg.outbound_proxy_cnt = 1; + cfg.outbound_proxy[0] = pj_str (SIP_PROXY); + } + + if (NAMESERVER) { + cfg.nameserver_count = 1; + cfg.nameserver[0] = pj_str (NAMESERVER); + } + + if (NAMESERVER && STUN_DOMAIN) { + cfg.stun_domain = pj_str (STUN_DOMAIN); + } else if (STUN_SERVER) { + cfg.stun_host = pj_str (STUN_SERVER); + } + + + /* Initialize pjsua */ + status = pjsua_init (&cfg, &log_cfg, &media_cfg); + + if (status != PJ_SUCCESS) { + OnError (TEXT ("Initialization error"), status); + return FALSE; + } + + /* Set codec priority */ + pjsua_codec_set_priority (pj_cstr (&tmp, "pcmu"), 240); + + pjsua_codec_set_priority (pj_cstr (&tmp, "pcma"), 230); + + pjsua_codec_set_priority (pj_cstr (&tmp, "speex/8000"), 190); + + pjsua_codec_set_priority (pj_cstr (&tmp, "ilbc"), 189); + + pjsua_codec_set_priority (pj_cstr (&tmp, "speex/16000"), 180); + + pjsua_codec_set_priority (pj_cstr (&tmp, "speex/32000"), 0); + + pjsua_codec_set_priority (pj_cstr (&tmp, "gsm"), 100); + + + /* Add UDP transport and the corresponding PJSUA account */ + status = pjsua_transport_create (PJSIP_TRANSPORT_UDP, + &udp_cfg, &transport_id); + + if (status != PJ_SUCCESS) { + OnError (TEXT ("Error starting SIP transport"), status); + return FALSE; + } + + pjsua_transport_get_info (transport_id, &transport_info); + + g_local_uri.ptr = (char*) pj_pool_alloc (g_pool, 128); + g_local_uri.slen = pj_ansi_sprintf (g_local_uri.ptr, + "<sip:%.*s:%d>", + (int) transport_info.local_name.host.slen, + transport_info.local_name.host.ptr, + transport_info.local_name.port); + + + /* Add local account */ + pjsua_acc_add_local (transport_id, PJ_TRUE, &g_current_acc); + pjsua_acc_set_online_status (g_current_acc, PJ_TRUE); + + /* Add account */ + + if (HAS_SIP_ACCOUNT) { + pjsua_acc_config cfg; + + pjsua_acc_config_default (&cfg); + cfg.id = pj_str ("sip:" SIP_USER "@" SIP_DOMAIN); + cfg.reg_uri = pj_str ("sip:" SIP_DOMAIN); + cfg.cred_count = 1; + cfg.cred_info[0].realm = pj_str (SIP_REALM); + cfg.cred_info[0].scheme = pj_str ("digest"); + cfg.cred_info[0].username = pj_str (SIP_USER); + cfg.cred_info[0].data_type = PJSIP_CRED_DATA_PLAIN_PASSWD; + cfg.cred_info[0].data = pj_str (SIP_PASSWD); + + status = pjsua_acc_add (&cfg, PJ_TRUE, &g_current_acc); + + if (status != PJ_SUCCESS) { + pjsua_destroy(); + return PJ_FALSE; + } + } + + /* Add buddy */ + if (SIP_DST_URI) { + pjsua_buddy_config bcfg; + + pjsua_buddy_config_default (&bcfg); + bcfg.uri = pj_str (SIP_DST_URI); + bcfg.subscribe = PJ_FALSE; + + pjsua_buddy_add (&bcfg, NULL); + } + + /* Start pjsua */ + status = pjsua_start(); + + if (status != PJ_SUCCESS) { + OnError (TEXT ("Error starting pjsua"), status); + return FALSE; + } + + return TRUE; +} + + +////////////////////////////////////////////////////////////////////////////// + +int WINAPI WinMain (HINSTANCE hInstance, + HINSTANCE hPrevInstance, + LPTSTR lpCmdLine, + int nCmdShow) +{ + MSG msg; + HACCEL hAccelTable; + + + + // Perform application initialization: + + if (!InitInstance (hInstance, nCmdShow)) { + return FALSE; + } + + hAccelTable = LoadAccelerators (hInstance, (LPCTSTR) IDC_PJSUA_WINCE); + + + // Main message loop: + + while (GetMessage (&msg, NULL, 0, 0)) { + if (!TranslateAccelerator (msg.hwnd, hAccelTable, &msg)) { + TranslateMessage (&msg); + DispatchMessage (&msg); + } + } + + return msg.wParam; +} + +static ATOM MyRegisterClass (HINSTANCE hInstance, LPTSTR szWindowClass) +{ + WNDCLASS wc; + + wc.style = CS_HREDRAW | CS_VREDRAW; + wc.lpfnWndProc = (WNDPROC) WndProc; + wc.cbClsExtra = 0; + wc.cbWndExtra = 0; + wc.hInstance = hInstance; + wc.hIcon = LoadIcon (hInstance, MAKEINTRESOURCE (IDI_PJSUA_WINCE)); + wc.hCursor = 0; + wc.hbrBackground = (HBRUSH) GetStockObject (WHITE_BRUSH); + wc.lpszMenuName = 0; + wc.lpszClassName = szWindowClass; + + return RegisterClass (&wc); +} + + +/* Callback upon NAT detection completion */ +static void nat_detect_cb (const pj_stun_nat_detect_result *res) +{ + if (res->status != PJ_SUCCESS) { + char msg[250]; + pj_ansi_snprintf (msg, sizeof (msg), "NAT detection failed: %s", + res->status_text); + SetCallStatus (msg, pj_ansi_strlen (msg)); + } else { + char msg[250]; + pj_ansi_snprintf (msg, sizeof (msg), "NAT type is %s", + res->nat_type_name); + SetCallStatus (msg, pj_ansi_strlen (msg)); + } +} + + +BOOL InitInstance (HINSTANCE hInstance, int nCmdShow) +{ + HWND hWnd; + TCHAR szTitle[MAX_LOADSTRING]; + TCHAR szWindowClass[MAX_LOADSTRING]; + + hInst = hInstance; + + /* Init stack */ + + if (OnInitStack() == FALSE) + return FALSE; + + LoadString (hInstance, IDC_PJSUA_WINCE, szWindowClass, MAX_LOADSTRING); + + MyRegisterClass (hInstance, szWindowClass); + + LoadString (hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING); + + hWnd = CreateWindow (szWindowClass, szTitle, WS_VISIBLE, + CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, 200, + NULL, NULL, hInstance, NULL); + + if (!hWnd) { + return FALSE; + } + + hMainWnd = hWnd; + + ShowWindow (hWnd, nCmdShow); + UpdateWindow (hWnd); + + if (hwndCB) + CommandBar_Show (hwndCB, TRUE); + + SetTimer (hMainWnd, ID_POLL_TIMER, 50, NULL); + + pjsua_detect_nat_type(); + + return TRUE; +} + + +static void OnCreate (HWND hWnd) +{ + enum { + X = 10, + Y = 40, + W = 220, + H = 30, + }; + + DWORD dwStyle; + + hMainWnd = hWnd; + + hwndCB = CommandBar_Create (hInst, hWnd, 1); + CommandBar_InsertMenubar (hwndCB, hInst, IDM_MENU, 0); + CommandBar_AddAdornments (hwndCB, 0, 0); + + // Create global status text + dwStyle = WS_CHILD | WS_VISIBLE | WS_DISABLED | ES_LEFT; + hwndGlobalStatus = CreateWindow ( + TEXT ("EDIT"), // Class name + NULL, // Window text + dwStyle, // Window style + X, // x-coordinate of the upper-left corner + Y+0, // y-coordinate of the upper-left corner + W, // Width of the window for the edit + // control + H-5, // Height of the window for the edit + // control + hWnd, // Window handle to the parent window + (HMENU) ID_GLOBAL_STATUS, // Control identifier + hInst, // Instance handle + NULL); // Specify NULL for this parameter when + // you create a control + SetLocalURI (g_local_uri.ptr, g_local_uri.slen, false); + + + // Create URI edit + dwStyle = WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_BORDER; + hwndURI = CreateWindow ( + TEXT ("EDIT"), // Class name + NULL, // Window text + dwStyle, // Window style + X, // x-coordinate of the upper-left corner + Y+H, // y-coordinate of the upper-left corner + W, // Width of the window for the edit + // control + H-5, // Height of the window for the edit + // control + hWnd, // Window handle to the parent window + (HMENU) ID_URI, // Control identifier + hInst, // Instance handle + NULL); // Specify NULL for this parameter when + // you create a control + + // Create action Button + hwndActionButton = CreateWindow (L"button", L"Action", + WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON, + X, Y+2*H, + 60, H-5, hWnd, + (HMENU) ID_BTN_ACTION, + hInst, NULL); + + // Create exit button + hwndExitButton = CreateWindow (L"button", L"E&xit", + WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON, + X+70, Y+2*H, + 60, H-5, hWnd, + (HMENU) ID_EXIT, + hInst, NULL); + + + // Create call status edit + dwStyle = WS_CHILD | WS_VISIBLE | WS_DISABLED; + hwndCallStatus = CreateWindow ( + TEXT ("EDIT"), // Class name + NULL, // Window text + dwStyle, // Window style + X, // x-coordinate of the upper-left corner + Y+3*H, // y-coordinate of the upper-left corner + W, // Width of the window for the edit + // control + H-5, // Height of the window for the edit + // control + hWnd, // Window handle to the parent window + (HMENU) ID_CALL_STATUS, // Control identifier + hInst, // Instance handle + NULL); // Specify NULL for this parameter when + // you create a control + SetCallStatus ("Ready", 5); + SetAction (ID_MENU_CALL); + SetURI (SIP_DST_URI, -1); + SetFocus (hWnd); + +} + + +static void OnDestroy (void) +{ + pjsua_destroy(); +} + +static LRESULT CALLBACK WndProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) +{ + int wmId, wmEvent; + + switch (message) { + + case WM_KEYUP: + + if (wParam==114) { + wParam = ID_MENU_CALL; + } else if (wParam==115) { + if (g_current_call == PJSUA_INVALID_ID) + wParam = ID_EXIT; + else + wParam = ID_MENU_DISCONNECT; + } else + break; + + case WM_COMMAND: + wmId = LOWORD (wParam); + + wmEvent = HIWORD (wParam); + + if (wmId == ID_BTN_ACTION) + wmId = g_current_action; + + switch (wmId) { + + case ID_MENU_CALL: + + if (g_current_call != PJSUA_INVALID_ID) { + MessageBox (NULL, TEXT ("Can not make call"), + TEXT ("You already have one call active"), MB_OK); + } + + pj_str_t dst_uri; + + wchar_t text[256]; + char tmp[256]; + pj_status_t status; + + GetWindowText (hwndURI, text, PJ_ARRAY_SIZE (text)); + pj_unicode_to_ansi (text, pj_unicode_strlen (text), + tmp, sizeof (tmp)); + dst_uri.ptr = tmp; + dst_uri.slen = pj_ansi_strlen (tmp); + status = pjsua_call_make_call (g_current_acc, + &dst_uri, 0, NULL, + NULL, &g_current_call); + + if (status != PJ_SUCCESS) + OnError (TEXT ("Unable to make call"), status); + + break; + + case ID_MENU_ANSWER: + if (g_current_call == PJSUA_INVALID_ID) + MessageBox (NULL, TEXT ("Can not answer"), + TEXT ("There is no call!"), MB_OK); + else + pjsua_call_answer (g_current_call, 200, NULL, NULL); + + break; + + case ID_MENU_DISCONNECT: + if (g_current_call == PJSUA_INVALID_ID) + MessageBox (NULL, TEXT ("Can not disconnect"), + TEXT ("There is no call!"), MB_OK); + else + pjsua_call_hangup (g_current_call, PJSIP_SC_DECLINE, NULL, NULL); + + break; + + case ID_EXIT: + DestroyWindow (hWnd); + + break; + + default: + return DefWindowProc (hWnd, message, wParam, lParam); + } + + break; + + case WM_CREATE: + OnCreate (hWnd); + break; + + case WM_DESTROY: + OnDestroy(); + CommandBar_Destroy (hwndCB); + PostQuitMessage (0); + break; + + case WM_TIMER: + pjsua_handle_events (1); + break; + + default: + return DefWindowProc (hWnd, message, wParam, lParam); + } + + return 0; +} + diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/pjsua_wince/pjsua_wince.h b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pjsua_wince/pjsua_wince.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/pjsua_wince/pjsua_wince.h rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pjsua_wince/pjsua_wince.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/pjsua_wince/pjsua_wince.ico b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pjsua_wince/pjsua_wince.ico similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/pjsua_wince/pjsua_wince.ico rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pjsua_wince/pjsua_wince.ico diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/pjsua_wince/pjsua_wince.rc b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pjsua_wince/pjsua_wince.rc similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/pjsua_wince/pjsua_wince.rc rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pjsua_wince/pjsua_wince.rc diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/pjsua_wince/pjsua_wince.vcp b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pjsua_wince/pjsua_wince.vcp similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/pjsua_wince/pjsua_wince.vcp rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pjsua_wince/pjsua_wince.vcp diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/pjsua_wince/resource.h b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pjsua_wince/resource.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/pjsua_wince/resource.h rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pjsua_wince/resource.h diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/PocketPJ.cpp b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/PocketPJ.cpp new file mode 100644 index 0000000000000000000000000000000000000000..cc75d884ba8ed66ab5e30a943b74a3ec7d4f896e --- /dev/null +++ b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/PocketPJ.cpp @@ -0,0 +1,64 @@ +// PocketPJ.cpp : Defines the class behaviors for the application. +// + +#include "stdafx.h" +#include "PocketPJ.h" +#include "PocketPJDlg.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + +///////////////////////////////////////////////////////////////////////////// +// CPocketPJApp + +BEGIN_MESSAGE_MAP (CPocketPJApp, CWinApp) + //{{AFX_MSG_MAP(CPocketPJApp) + // NOTE - the ClassWizard will add and remove mapping macros here. + // DO NOT EDIT what you see in these blocks of generated code! + //}}AFX_MSG_MAP +END_MESSAGE_MAP() + +///////////////////////////////////////////////////////////////////////////// +// CPocketPJApp construction + +CPocketPJApp::CPocketPJApp() + : CWinApp() +{ + // TODO: add construction code here, + // Place all significant initialization in InitInstance +} + +///////////////////////////////////////////////////////////////////////////// +// The one and only CPocketPJApp object + +CPocketPJApp theApp; + +///////////////////////////////////////////////////////////////////////////// +// CPocketPJApp initialization + +BOOL CPocketPJApp::InitInstance() +{ + // Standard initialization + // If you are not using these features and wish to reduce the size + // of your final executable, you should remove from the following + // the specific initialization routines you do not need. + + CPocketPJDlg dlg; + m_pMainWnd = &dlg; + int nResponse = dlg.DoModal(); + + if (nResponse == IDOK) { + // TODO: Place code here to handle when the dialog is + // dismissed with OK + } else if (nResponse == IDCANCEL) { + // TODO: Place code here to handle when the dialog is + // dismissed with Cancel + } + + // Since the dialog has been closed, return FALSE so that we exit the + // application, rather than start the application's message pump. + return FALSE; +} diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/pocketpj/PocketPJ.h b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/PocketPJ.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/pocketpj/PocketPJ.h rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/PocketPJ.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/pocketpj/PocketPJ.rc b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/PocketPJ.rc similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/pocketpj/PocketPJ.rc rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/PocketPJ.rc diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/pocketpj/PocketPJ.vcc b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/PocketPJ.vcc similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/pocketpj/PocketPJ.vcc rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/PocketPJ.vcc diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/pocketpj/PocketPJ.vcp b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/PocketPJ.vcp similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/pocketpj/PocketPJ.vcp rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/PocketPJ.vcp diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/pocketpj/PocketPJ.vcw b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/PocketPJ.vcw similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/pocketpj/PocketPJ.vcw rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/PocketPJ.vcw diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/PocketPJDlg.cpp b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/PocketPJDlg.cpp new file mode 100644 index 0000000000000000000000000000000000000000..ca8014a245239e2c5c52747a5506cf68e8ad01db --- /dev/null +++ b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/PocketPJDlg.cpp @@ -0,0 +1,824 @@ +// PocketPJDlg.cpp : implementation file +// + +#include "stdafx.h" +#include "PocketPJ.h" +#include "PocketPJDlg.h" +#include <iphlpapi.h> + +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + +#define TIMER_ID 101 +static CPocketPJDlg *theDlg; + +///////////////////////////////////////////////////////////////////////////// +// CPocketPJDlg dialog + +CPocketPJDlg::CPocketPJDlg (CWnd* pParent /*=NULL*/) + : CDialog (CPocketPJDlg::IDD, pParent), m_PopUp (NULL) +{ + //{{AFX_DATA_INIT(CPocketPJDlg) + // NOTE: the ClassWizard will add member initialization here + //}}AFX_DATA_INIT + // Note that LoadIcon does not require a subsequent DestroyIcon in Win32 + m_hIcon = AfxGetApp()->LoadIcon (IDR_MAINFRAME); + + theDlg = this; + + m_PopUp = new CPopUpWnd (this); + m_PopUp->Hide(); + + unsigned i; + m_PopUpCount = 0; + + for (i=0; i<POPUP_MAX_TYPE; ++i) { + m_PopUpState[i] = FALSE; + } +} + +void CPocketPJDlg::DoDataExchange (CDataExchange* pDX) +{ + CDialog::DoDataExchange (pDX); + //{{AFX_DATA_MAP(CPocketPJDlg) + DDX_Control (pDX, IDC_URL, m_Url); + DDX_Control (pDX, IDC_BUDDY_LIST, m_BuddyList); + DDX_Control (pDX, IDC_BTN_ACTION, m_BtnUrlAction); + DDX_Control (pDX, IDC_BTN_ACC, m_BtnAcc); + DDX_Control (pDX, IDC_ACC_ID, m_AccId); + //}}AFX_DATA_MAP +} + +BEGIN_MESSAGE_MAP (CPocketPJDlg, CDialog) + //{{AFX_MSG_MAP(CPocketPJDlg) + ON_BN_CLICKED (IDC_BTN_ACC, OnBtnAcc) + ON_BN_CLICKED (IDC_BTN_ACTION, OnBtnAction) + ON_COMMAND (IDC_ACC_SETTINGS, OnSettings) + ON_COMMAND (IDC_URI_CALL, OnUriCall) + ON_WM_TIMER() + ON_COMMAND (IDC_URI_ADD_BUDDY, OnUriAddBuddy) + ON_COMMAND (IDC_URI_DEL_BUDDY, OnUriDelBuddy) + ON_COMMAND (IDC_ACC_ONLINE, OnAccOnline) + ON_COMMAND (IDC_ACC_INVISIBLE, OnAccInvisible) + ON_NOTIFY (NM_CLICK, IDC_BUDDY_LIST, OnClickBuddyList) + //}}AFX_MSG_MAP +END_MESSAGE_MAP() + + +void CPocketPJDlg::Error (const CString &title, pj_status_t rc) +{ + char errmsg[PJ_ERR_MSG_SIZE]; + wchar_t werrmsg[PJ_ERR_MSG_SIZE]; + + pj_strerror (rc, errmsg, sizeof (errmsg)); + pj_ansi_to_unicode (errmsg, strlen (errmsg), werrmsg, PJ_ARRAY_SIZE (werrmsg)); + + AfxMessageBox (title + _T (": ") + werrmsg); +} + +BOOL CPocketPJDlg::Restart() +{ + unsigned i; + pj_status_t status; + + char ver[80]; + sprintf (ver, "PocketPJ/%s", pj_get_version()); + + ShowWindow (SW_SHOW); + PopUp_Show (POPUP_REGISTRATION, ver, + "Starting up....", "", "", "", 0); + + KillTimer (TIMER_ID); + + // Destroy first. + PopUp_Modify (POPUP_REGISTRATION, POPUP_EL_TITLE3, "Cleaning up.."); + pjsua_destroy(); + + m_BtnAcc.SetBitmap (::LoadBitmap (AfxGetInstanceHandle(), MAKEINTRESOURCE (IDB_OFFLINE))); + UpdateWindow(); + + + // Create + PopUp_Show (POPUP_REGISTRATION, ver, + "Starting up....", "Creating stack..", "", "", 0); + + status = pjsua_create(); + + if (status != PJ_SUCCESS) { + Error (_T ("Error in creating library"), status); + PopUp_Hide (POPUP_REGISTRATION); + return FALSE; + } + + pjsua_config cfg; + + pjsua_logging_config log_cfg; + pjsua_media_config media_cfg; + + pjsua_config_default (&cfg); + cfg.max_calls = 1; + cfg.thread_cnt = 0; + cfg.user_agent = pj_str (ver); + + cfg.cb.on_call_state = &on_call_state; + cfg.cb.on_call_media_state = &on_call_media_state; + cfg.cb.on_incoming_call = &on_incoming_call; + cfg.cb.on_reg_state = &on_reg_state; + cfg.cb.on_buddy_state = &on_buddy_state; + cfg.cb.on_pager = &on_pager; + + /* Configure nameserver */ + char nameserver[60]; + { + FIXED_INFO fi; + ULONG len = sizeof (fi); + CString err; + + PopUp_Modify (POPUP_REGISTRATION, POPUP_EL_TITLE3, "Retrieving network parameters.."); + + if (GetNetworkParams (&fi, &len) != ERROR_SUCCESS) { + err = _T ("Info: Error querying network parameters. You must configure DNS server."); + } else if (fi.CurrentDnsServer == NULL) { + err = _T ("Info: DNS server not configured. You must configure DNS server."); + } + + if (err.GetLength()) { + if (m_Cfg.m_DNS.GetLength()) { + pj_unicode_to_ansi ( (LPCTSTR) m_Cfg.m_DNS, m_Cfg.m_DNS.GetLength(), + nameserver, sizeof (nameserver)); + cfg.nameserver_count = 1; + cfg.nameserver[0] = pj_str (nameserver); + } else { + AfxMessageBox (err); + pjsua_destroy(); + PopUp_Hide (POPUP_REGISTRATION); + return FALSE; + } + } else { + strcpy (nameserver, fi.CurrentDnsServer->IpAddress.String); + cfg.nameserver_count = 1; + cfg.nameserver[0] = pj_str (nameserver); + } + } + + char tmp_stun[80]; + + if (m_Cfg.m_UseStun) { + pj_unicode_to_ansi ( (LPCTSTR) m_Cfg.m_StunSrv, m_Cfg.m_StunSrv.GetLength(), + tmp_stun, sizeof (tmp_stun)); + cfg.stun_host = pj_str (tmp_stun); + } + + pjsua_logging_config_default (&log_cfg); + + log_cfg.log_filename = pj_str ("\\PocketPJ.TXT"); + + pjsua_media_config_default (&media_cfg); + media_cfg.clock_rate = 8000; + media_cfg.audio_frame_ptime = 40; + media_cfg.ec_tail_len = 0; + media_cfg.ilbc_mode = 30; + media_cfg.max_media_ports = 8; + media_cfg.quality = 5; + media_cfg.thread_cnt = 1; + media_cfg.enable_ice = m_Cfg.m_UseIce; + media_cfg.no_vad = !m_Cfg.m_VAD; + + if (m_Cfg.m_EchoSuppress) { + media_cfg.ec_options = PJMEDIA_ECHO_SIMPLE; + media_cfg.ec_tail_len = m_Cfg.m_EcTail; + } + + // Init + PopUp_Modify (POPUP_REGISTRATION, POPUP_EL_TITLE3, "Initializing.."); + + status = pjsua_init (&cfg, &log_cfg, &media_cfg); + + if (status != PJ_SUCCESS) { + Error (_T ("Error initializing library"), status); + pjsua_destroy(); + PopUp_Hide (POPUP_REGISTRATION); + return FALSE; + } + + // Create one UDP transport + PopUp_Modify (POPUP_REGISTRATION, POPUP_EL_TITLE3, "Adding UDP transport.."); + + pjsua_transport_id transport_id; + + pjsua_transport_config udp_cfg; + + pjsua_transport_config_default (&udp_cfg); + + udp_cfg.port = 0; + + status = pjsua_transport_create (PJSIP_TRANSPORT_UDP, + &udp_cfg, &transport_id); + + if (status != PJ_SUCCESS) { + Error (_T ("Error creating UDP transport"), status); + pjsua_destroy(); + PopUp_Hide (POPUP_REGISTRATION); + return FALSE; + } + + if (m_Cfg.m_TCP) { + // Create one TCP transport + PopUp_Modify (POPUP_REGISTRATION, POPUP_EL_TITLE3, "Adding TCP transport.."); + pjsua_transport_id transport_id; + pjsua_transport_config tcp_cfg; + + pjsua_transport_config_default (&tcp_cfg); + tcp_cfg.port = 0; + status = pjsua_transport_create (PJSIP_TRANSPORT_TCP, + &tcp_cfg, &transport_id); + + if (status != PJ_SUCCESS) { + Error (_T ("Error creating TCP transport"), status); + pjsua_destroy(); + PopUp_Hide (POPUP_REGISTRATION); + return FALSE; + } + } + + // Adjust codecs priority + pj_str_t tmp; + + pjsua_codec_set_priority (pj_cstr (&tmp, "*"), 0); + + for (i=0; i< (unsigned) m_Cfg.m_Codecs.GetSize(); ++i) { + CString codec = m_Cfg.m_Codecs.GetAt (i); + char tmp_nam[80]; + + pj_unicode_to_ansi ( (LPCTSTR) codec, codec.GetLength(), + tmp_nam, sizeof (tmp_nam)); + pjsua_codec_set_priority (pj_cstr (&tmp, tmp_nam), 200-i); + } + + // Start! + PopUp_Modify (POPUP_REGISTRATION, POPUP_EL_TITLE3, "Starting.."); + + status = pjsua_start(); + + if (status != PJ_SUCCESS) { + Error (_T ("Error starting library"), status); + pjsua_destroy(); + PopUp_Hide (POPUP_REGISTRATION); + return FALSE; + } + + // Add account + PopUp_Modify (POPUP_REGISTRATION, POPUP_EL_TITLE3, "Adding account.."); + + char domain[80], username[80], passwd[80]; + + char id[80], reg_uri[80]; + + pjsua_acc_config acc_cfg; + + pj_unicode_to_ansi ( (LPCTSTR) m_Cfg.m_Domain, m_Cfg.m_Domain.GetLength(), + domain, sizeof (domain)); + + pj_unicode_to_ansi ( (LPCTSTR) m_Cfg.m_User, m_Cfg.m_User.GetLength(), + username, sizeof (username)); + + pj_unicode_to_ansi ( (LPCTSTR) m_Cfg.m_Password, m_Cfg.m_Password.GetLength(), + passwd, sizeof (passwd)); + + snprintf (id, sizeof (id), "<sip:%s@%s>", username, domain); + + snprintf (reg_uri, sizeof (reg_uri), "sip:%s", domain); + + pjsua_acc_config_default (&acc_cfg); + + acc_cfg.id = pj_str (id); + + acc_cfg.reg_uri = pj_str (reg_uri); + + acc_cfg.cred_count = 1; + + acc_cfg.cred_info[0].scheme = pj_str ("Digest"); + + acc_cfg.cred_info[0].realm = pj_str ("*"); + + acc_cfg.cred_info[0].username = pj_str (username); + + acc_cfg.cred_info[0].data_type = 0; + + acc_cfg.cred_info[0].data = pj_str (passwd); + +#if defined(PJMEDIA_HAS_SRTP) && (PJMEDIA_HAS_SRTP != 0) + acc_cfg.use_srtp = (m_Cfg.m_UseSrtp ? PJMEDIA_SRTP_OPTIONAL : PJMEDIA_SRTP_DISABLED); + + acc_cfg.srtp_secure_signaling = 0; + +#endif + + acc_cfg.publish_enabled = m_Cfg.m_UsePublish; + + char route[80]; + + if (m_Cfg.m_TCP) { + snprintf (route, sizeof (route), "<sip:%s;lr;transport=tcp>", domain); + acc_cfg.proxy[acc_cfg.proxy_cnt++] = pj_str (route); + } else { + snprintf (route, sizeof (route), "<sip:%s;lr>", domain); + acc_cfg.proxy[acc_cfg.proxy_cnt++] = pj_str (route); + } + + status = pjsua_acc_add (&acc_cfg, PJ_TRUE, &m_PjsuaAccId); + + if (status != PJ_SUCCESS) { + Error (_T ("Invalid account settings"), status); + pjsua_destroy(); + PopUp_Hide (POPUP_REGISTRATION); + return FALSE; + } + + CString acc_text = m_Cfg.m_User + _T ("@") + m_Cfg.m_Domain; + + m_AccId.SetWindowText (acc_text); + + PopUp_Modify (POPUP_REGISTRATION, POPUP_EL_TITLE1, acc_text); + PopUp_Modify (POPUP_REGISTRATION, POPUP_EL_TITLE2, "Registering.."); + PopUp_Modify (POPUP_REGISTRATION, POPUP_EL_TITLE3, ""); + + SetTimer (TIMER_ID, 100, NULL); + return TRUE; +} + + +void CPocketPJDlg::PopUp_Show (PopUpType type, + const CString& title1, + const CString& title2, + const CString& title3, + const CString& btn1, + const CString& btn2, + unsigned userData) +{ + if (!m_PopUpState[type]) + ++m_PopUpCount; + + m_PopUpState[type] = TRUE; + + m_PopUpContent[type].m_Title1 = title1; + + m_PopUpContent[type].m_Title2 = title2; + + m_PopUpContent[type].m_Title3 = title3; + + m_PopUpContent[type].m_Btn1 = btn1; + + m_PopUpContent[type].m_Btn2 = btn2; + + m_PopUp->SetContent (m_PopUpContent[type]); + + m_PopUp->Show(); +} + +void CPocketPJDlg::PopUp_Modify (PopUpType type, + PopUpElement el, + const CString& text) +{ + switch (el) { + + case POPUP_EL_TITLE1: + m_PopUpContent[type].m_Title1 = text; + break; + + case POPUP_EL_TITLE2: + m_PopUpContent[type].m_Title2 = text; + break; + + case POPUP_EL_TITLE3: + m_PopUpContent[type].m_Title3 = text; + break; + + case POPUP_EL_BUTTON1: + m_PopUpContent[type].m_Btn1 = text; + break; + + case POPUP_EL_BUTTON2: + m_PopUpContent[type].m_Btn1 = text; + break; + } + + m_PopUp->SetContent (m_PopUpContent[type]); +} + +void CPocketPJDlg::PopUp_Hide (PopUpType type) +{ + if (m_PopUpState[type]) + --m_PopUpCount; + + m_PopUpState[type] = FALSE; + + if (m_PopUpCount == 0) { + m_PopUp->Hide(); + UpdateWindow(); + } else { + for (int i=POPUP_MAX_TYPE-1; i>=0; --i) { + if (m_PopUpState[i]) { + m_PopUp->SetContent (m_PopUpContent[i]); + break; + } + } + } +} + +void CPocketPJDlg::OnCallState() +{ + pjsua_call_info ci; + + pjsua_call_get_info (0, &ci); + + switch (ci.state) { + + case PJSIP_INV_STATE_NULL: /**< Before INVITE is sent or received */ + break; + + case PJSIP_INV_STATE_CALLING: /**< After INVITE is sent */ + PopUp_Show (POPUP_CALL, "Calling..", ci.remote_info.ptr, "", + "", "Hangup", 0); + break; + + case PJSIP_INV_STATE_INCOMING: /**< After INVITE is received. */ + PopUp_Show (POPUP_CALL, "Incoming call..", ci.remote_info.ptr, "", + "Answer", "Hangup", 0); + pjsua_call_answer (0, 180, NULL, NULL); + + if (m_Cfg.m_AutoAnswer) + OnPopUpButton (1); + + break; + + case PJSIP_INV_STATE_EARLY: /**< After response with To tag. */ + + case PJSIP_INV_STATE_CONNECTING:/**< After 2xx is sent/received. */ + + case PJSIP_INV_STATE_CONFIRMED: { /**< After ACK is sent/received. */ + CString stateText = ci.state_text.ptr; + PopUp_Modify (POPUP_CALL, POPUP_EL_TITLE3, stateText); + } + + break; + + case PJSIP_INV_STATE_DISCONNECTED:/**< Session is terminated. */ + PopUp_Modify (POPUP_CALL, POPUP_EL_TITLE3, "Disconnected"); + PopUp_Hide (POPUP_CALL); + break; + } +} + +void CPocketPJDlg::on_call_state (pjsua_call_id call_id, pjsip_event *e) +{ + theDlg->OnCallState(); +} + +void CPocketPJDlg::on_call_media_state (pjsua_call_id call_id) +{ + pjsua_call_info call_info; + + pjsua_call_get_info (call_id, &call_info); + + if (call_info.media_status == PJSUA_CALL_MEDIA_ACTIVE) { + pjsua_conf_connect (call_info.conf_slot, 0); + pjsua_conf_connect (0, call_info.conf_slot); + } +} + +void CPocketPJDlg::on_incoming_call (pjsua_acc_id acc_id, pjsua_call_id call_id, + pjsip_rx_data *rdata) +{ +} + +void CPocketPJDlg::OnRegState() +{ + pjsua_acc_info ai; + pjsua_acc_get_info (m_PjsuaAccId, &ai); + + CString acc_text = m_Cfg.m_User + _T ("@") + m_Cfg.m_Domain; + + if (ai.expires>0 && ai.status/100==2) { + /* Registration success */ + HBITMAP old = m_BtnAcc.SetBitmap (::LoadBitmap (AfxGetInstanceHandle(), MAKEINTRESOURCE (IDB_ONLINE))); + acc_text += " (OK)"; + m_AccId.SetWindowText (acc_text); + } else if (ai.status/100 != 2) { + acc_text += " (err)"; + Error (_T ("SIP registration error"), PJSIP_ERRNO_FROM_SIP_STATUS (ai.status)); + m_AccId.SetWindowText (acc_text); + } + + PopUp_Hide (POPUP_REGISTRATION); +} + +void CPocketPJDlg::on_reg_state (pjsua_acc_id acc_id) +{ + theDlg->OnRegState(); +} + +void CPocketPJDlg::on_buddy_state (pjsua_buddy_id buddy_id) +{ + theDlg->RedrawBuddyList(); +} + +void CPocketPJDlg::on_pager (pjsua_call_id call_id, const pj_str_t *from, + const pj_str_t *to, const pj_str_t *contact, + const pj_str_t *mime_type, const pj_str_t *text) +{ +} + +///////////////////////////////////////////////////////////////////////////// +// CPocketPJDlg message handlers + +BOOL CPocketPJDlg::OnInitDialog() +{ + CDialog::OnInitDialog(); + + // Set the icon for this dialog. The framework does this automatically + // when the application's main window is not a dialog + SetIcon (m_hIcon, TRUE); // Set big icon + SetIcon (m_hIcon, FALSE); // Set small icon + + CenterWindow (GetDesktopWindow()); // center to the hpc screen + + // TODO: Add extra initialization here + + m_Cfg.LoadRegistry(); + //ShowWindow(SW_SHOW); + m_AccId.SetWindowText (m_Cfg.m_User); + + CImageList *il = new CImageList; + VERIFY (il->Create (16, 16, ILC_COLOR|ILC_MASK, 2, 4)); + + CBitmap *bmp = new CBitmap; + bmp->LoadBitmap (MAKEINTRESOURCE (IDB_BLANK)); + il->Add (bmp, RGB (255,255,255)); + bmp = new CBitmap; + bmp->LoadBitmap (MAKEINTRESOURCE (IDB_ONLINE)); + il->Add (bmp, RGB (255,255,255)); + + m_BuddyList.SetImageList (il, LVSIL_SMALL); + + if (m_Cfg.m_Domain.GetLength() ==0 || Restart() == FALSE) { + for (;;) { + CSettingsDlg dlg (m_Cfg); + + if (dlg.DoModal() != IDOK) { + EndDialog (IDOK); + return TRUE; + } + + m_Cfg.SaveRegistry(); + + if (Restart()) + break; + } + } + + RedrawBuddyList(); + + return TRUE; // return TRUE unless you set the focus to a control +} + + + +void CPocketPJDlg::OnBtnAcc() +{ + CMenu menu; + VERIFY (menu.LoadMenu (IDR_ACC_MENU)); + CMenu* pPopup = menu.GetSubMenu (0); + ASSERT (pPopup != NULL); + + RECT r; + m_BtnAcc.GetWindowRect (&r); + pPopup->TrackPopupMenu (TPM_LEFTALIGN, r.left+4, r.top+4, this); +} + +void CPocketPJDlg::OnBtnAction() +{ + CMenu menu; + VERIFY (menu.LoadMenu (IDR_URI_MENU)); + CMenu* pPopup = menu.GetSubMenu (0); + ASSERT (pPopup != NULL); + + RECT r; + this->m_BtnUrlAction.GetWindowRect (&r); + pPopup->TrackPopupMenu (TPM_LEFTALIGN, r.left+4, r.top+4, this); +} + +void CPocketPJDlg::OnSettings() +{ + for (;;) { + CSettingsDlg dlg (m_Cfg); + + if (dlg.DoModal() != IDOK) { + return; + } + + m_Cfg.SaveRegistry(); + + if (Restart()) + break; + } +} + +void CPocketPJDlg::OnOK() +{ + if (AfxMessageBox (_T ("Quit PocketPJ?"), MB_YESNO) ==IDYES) { + KillTimer (TIMER_ID); + PopUp_Show (POPUP_REGISTRATION, "", "Shutting down..", "", "", "", 0); + pjsua_destroy(); + CDialog::OnOK(); + PopUp_Hide (POPUP_REGISTRATION); + m_Cfg.SaveRegistry(); + return; + } +} + +void CPocketPJDlg::OnTimer (UINT nIDEvent) +{ + pjsua_handle_events (10); + CDialog::OnTimer (nIDEvent); +} + +int CPocketPJDlg::FindBuddyInPjsua (const CString &Uri) +{ + char uri[80]; + pjsua_buddy_id id[128]; + unsigned i, count = PJ_ARRAY_SIZE (id); + + if (pjsua_enum_buddies (id, &count) != PJ_SUCCESS) + return PJSUA_INVALID_ID; + + if (count==0) + return PJSUA_INVALID_ID; + + pj_unicode_to_ansi ( (LPCTSTR) Uri, Uri.GetLength(), uri, sizeof (uri)); + + for (i=0; i<count; ++i) { + pjsua_buddy_info bi; + pjsua_buddy_get_info (id[i], &bi); + + if (pj_strcmp2 (&bi.uri, uri) ==0) + return i; + } + + return PJSUA_INVALID_ID; +} + +int CPocketPJDlg::FindBuddyInCfg (const CString &uri) +{ + int i; + + for (i=0; i<m_Cfg.m_BuddyList.GetSize(); ++i) { + if (m_Cfg.m_BuddyList.GetAt (0) == uri) { + return i; + } + } + + return -1; +} + +void CPocketPJDlg::RedrawBuddyList() +{ + int i; + + m_BuddyList.DeleteAllItems(); + + for (i=0; i<m_Cfg.m_BuddyList.GetSize(); ++i) { + int isOnline; + int id; + + id = FindBuddyInPjsua (m_Cfg.m_BuddyList.GetAt (i)); + + if (id != PJSUA_INVALID_ID) { + pjsua_buddy_info bi; + pjsua_buddy_get_info (id, &bi); + isOnline = (bi.status == PJSUA_BUDDY_STATUS_ONLINE); + } else { + isOnline = 0; + } + + LVITEM lvi; + + memset (&lvi, 0, sizeof (lvi)); + lvi.mask = LVIF_TEXT | LVIF_IMAGE; + lvi.iItem = i; + lvi.iImage = isOnline; + lvi.pszText = (LPTSTR) (LPCTSTR) m_Cfg.m_BuddyList.GetAt (i); + + m_BuddyList.InsertItem (&lvi); + } +} + +void CPocketPJDlg::OnUriCall() +{ + char tmp[120]; + CString uri; + pj_status_t status; + + m_Url.GetWindowText (uri); + pj_unicode_to_ansi ( (LPCTSTR) uri, uri.GetLength(), tmp, sizeof (tmp)); + + if ( (status=pjsua_verify_sip_url (tmp)) != PJ_SUCCESS) { + Error ("The URL is not valid SIP URL", status); + return; + } + + pj_str_t dest_uri = pj_str (tmp); + + pjsua_call_id call_id; + + status = pjsua_call_make_call (m_PjsuaAccId, &dest_uri, 0, NULL, NULL, &call_id); + + if (status != PJ_SUCCESS) + Error ("Unable to make call", status); +} + +void CPocketPJDlg::OnUriAddBuddy() +{ + int i; + char tmp[120]; + CString uri; + pj_status_t status; + + m_Url.GetWindowText (uri); + pj_unicode_to_ansi ( (LPCTSTR) uri, uri.GetLength(), tmp, sizeof (tmp)); + + if ( (status=pjsua_verify_sip_url (tmp)) != PJ_SUCCESS) { + Error ("The URL is not valid SIP URL", status); + return; + } + + for (i=0; i<m_Cfg.m_BuddyList.GetSize(); ++i) { + if (m_Cfg.m_BuddyList.GetAt (0) == uri) { + AfxMessageBox (_T ("The URI is already in the buddy list")); + return; + } + } + + m_Cfg.m_BuddyList.Add (uri); + + RedrawBuddyList(); +} + +void CPocketPJDlg::OnUriDelBuddy() +{ + CString uri; + + m_Url.GetWindowText (uri); + int i = FindBuddyInCfg (uri); + + if (i<0) { + /* Buddy not found */ + return; + } + + m_Cfg.m_BuddyList.RemoveAt (i); + + RedrawBuddyList(); + AfxMessageBox (_T ("Buddy " + uri + " deleted")); +} + +void CPocketPJDlg::OnAccOnline() +{ + pjsua_acc_set_online_status (m_PjsuaAccId, PJ_TRUE); + m_BtnAcc.SetBitmap (::LoadBitmap (AfxGetInstanceHandle(), MAKEINTRESOURCE (IDB_ONLINE))); +} + +void CPocketPJDlg::OnAccInvisible() +{ + pjsua_acc_set_online_status (m_PjsuaAccId, PJ_FALSE); + m_BtnAcc.SetBitmap (::LoadBitmap (AfxGetInstanceHandle(), MAKEINTRESOURCE (IDB_INVISIBLE))); +} + +void CPocketPJDlg::OnPopUpButton (int btnNo) +{ + if (btnNo == 1) { + pjsua_call_answer (0, 200, NULL, 0); + PopUp_Modify (POPUP_CALL, POPUP_EL_BUTTON1, ""); + } else if (btnNo == 2) { + // Hangup button + PopUp_Modify (POPUP_CALL, POPUP_EL_TITLE2, "Hang up.."); + PopUp_Modify (POPUP_CALL, POPUP_EL_TITLE3, ""); + pjsua_call_hangup (0, PJSIP_SC_DECLINE, 0, 0); + } +} + +void CPocketPJDlg::OnClickBuddyList (NMHDR* pNMHDR, LRESULT* pResult) +{ + POSITION pos = m_BuddyList.GetFirstSelectedItemPosition(); + + if (pos != NULL) { + int iItem = m_BuddyList.GetNextSelectedItem (pos); + CString uri = m_BuddyList.GetItemText (iItem, 0); + m_Url.SetWindowText (uri); + } + + *pResult = 0; +} diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/pocketpj/PocketPJDlg.h b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/PocketPJDlg.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/pocketpj/PocketPJDlg.h rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/PocketPJDlg.h diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/PopUpWnd.cpp b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/PopUpWnd.cpp new file mode 100644 index 0000000000000000000000000000000000000000..a92d2454e21f48256aa624a55358b576c276ebc3 --- /dev/null +++ b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/PopUpWnd.cpp @@ -0,0 +1,250 @@ +#include "stdafx.h" +#include "PopUpWnd.h" +#include "resource.h" +#include "PocketPJDlg.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + +#define IDC_BTN1 10 +#define IDC_BTN2 11 + + +///////////////////////////////////////////////////////////////////////////// +// CPopUpWnd + +CPopUpWnd::CPopUpWnd (CPocketPJDlg* pParent) +{ + Create (pParent); +} + +CPopUpWnd::~CPopUpWnd() +{ + DestroyWindow(); +} + +BOOL CPopUpWnd::Create (CPocketPJDlg* pParent) +{ + BOOL bSuccess; + + m_ParentWnd = pParent; + + // Register window class + CString csClassName = AfxRegisterWndClass (CS_HREDRAW|CS_VREDRAW, + 0, + CBrush (::GetSysColor (COLOR_BTNFACE))); + + // Create popup window + bSuccess = CreateEx (WS_EX_DLGMODALFRAME|WS_EX_TOPMOST, // Extended style + csClassName, // Classname + _T ("PocketPJ"), // Title + WS_POPUP|WS_BORDER|WS_CAPTION, // style + 0,0, // position - updated soon. + 1,1, // Size - updated soon + pParent->GetSafeHwnd(), // handle to parent + 0, // No menu + NULL); + + if (!bSuccess) + return FALSE; + + ShowWindow (SW_HIDE); + + // Now create the controls + CRect TempRect (0,0,10,10); + + /* |SS_LEFTNOWORDWRAP */ + bSuccess = m_Title1.Create (_T ("Title1"), WS_CHILD|WS_VISIBLE|SS_NOPREFIX, + TempRect, this, IDC_TITLE1); + + if (!bSuccess) + return FALSE; + + bSuccess = m_Title2.Create (_T ("Title2"), WS_CHILD|WS_VISIBLE|SS_NOPREFIX, + TempRect, this, IDC_TITLE2); + + if (!bSuccess) + return FALSE; + + bSuccess = m_Title3.Create (_T ("Title3"), WS_CHILD|WS_VISIBLE|SS_NOPREFIX, + TempRect, this, IDC_TITLE3); + + if (!bSuccess) + return FALSE; + + bSuccess = m_Btn1.Create (_T ("Button1"), + WS_CHILD|WS_VISIBLE|WS_TABSTOP| BS_PUSHBUTTON, + TempRect, this, IDC_BTN1); + + if (!bSuccess) + return FALSE; + + bSuccess = m_Btn2.Create (_T ("Button2"), + WS_CHILD|WS_VISIBLE|WS_TABSTOP| BS_PUSHBUTTON, + TempRect, this, IDC_BTN2); + + if (!bSuccess) + return FALSE; + + CFont *ft1 = new CFont, + *ft2 = new CFont, + *ft3 = new CFont; + + + LOGFONT lf; + + memset (&lf, 0, sizeof (LOGFONT)); + + lf.lfHeight = 12; + + lstrcpy (lf.lfFaceName, _T ("Arial")); + + VERIFY (ft1->CreateFontIndirect (&lf)); + + VERIFY (ft3->CreateFontIndirect (&lf)); + + lf.lfHeight = 20; + + VERIFY (ft2->CreateFontIndirect (&lf)); + + m_Title1.SetFont (ft1, TRUE); + + m_Title2.SetFont (ft2, TRUE); + + m_Title3.SetFont (ft3, TRUE); + + + SetWindowSize(); + + // Center and show window + CenterWindow(); + + Show(); + + return TRUE; +} + +void CPopUpWnd::SetContent (const CPopUpContent &content) +{ + m_Title1.SetWindowText (content.m_Title1); + m_Title2.SetWindowText (content.m_Title2); + m_Title3.SetWindowText (content.m_Title3); + + if (content.m_Btn1 != "") { + m_Btn1.SetWindowText (content.m_Btn1); + m_Btn1.ShowWindow (SW_SHOW); + } else { + m_Btn1.ShowWindow (SW_HIDE); + } + + if (content.m_Btn2 != "") { + m_Btn2.SetWindowText (content.m_Btn2); + m_Btn2.ShowWindow (SW_SHOW); + } else { + m_Btn2.ShowWindow (SW_HIDE); + } + + UpdateWindow(); + + ShowWindow (SW_SHOW); +} + +void CPopUpWnd::SetWindowSize (int width, int height) +{ + enum { H1 = 16, H2 = 40, H3 = 16, S = 5, G = 10, BW=60, BH=20, BG=40}; + + CRect rootRect (0, 0, 320, 240); + int Y; + + MoveWindow ( (rootRect.Width() - width) /2, (rootRect.Height() - height) /2, + width, height); + + m_Title1.MoveWindow (10, Y=S, width-20, H1); + m_Title2.MoveWindow (10, Y+=H1+G, width-20, H2); + m_Title3.MoveWindow (10, Y+=H2+G, width-20, H3); + + m_Btn1.MoveWindow ( (width-2*BW-BG) /2, Y+=H3+G, BW, BH); + m_Btn2.MoveWindow ( (width-2*BW-BG) /2+BW+BG, Y, BW, BH); +} + +void CPopUpWnd::Hide() +{ + if (!::IsWindow (GetSafeHwnd())) + return; + + if (IsWindowVisible()) { + ShowWindow (SW_HIDE); + ModifyStyle (WS_VISIBLE, 0); + } +} + +void CPopUpWnd::Show() +{ + if (!::IsWindow (GetSafeHwnd())) + return; + + ModifyStyle (0, WS_VISIBLE); + + ShowWindow (SW_SHOWNA); + + RedrawWindow (NULL,NULL,RDW_ERASE|RDW_INVALIDATE|RDW_UPDATENOW); +} + +BEGIN_MESSAGE_MAP (CPopUpWnd, CWnd) + //{{AFX_MSG_MAP(CPopUpWnd) + ON_WM_ERASEBKGND() + //}}AFX_MSG_MAP + ON_BN_CLICKED (IDC_BTN1, OnCancel1) + ON_BN_CLICKED (IDC_BTN2, OnCancel2) +END_MESSAGE_MAP() + + +///////////////////////////////////////////////////////////////////////////// +// CPopUpWnd message handlers + +BOOL CPopUpWnd::OnEraseBkgnd (CDC* pDC) +{ + CBrush backBrush; + backBrush.CreateSolidBrush (RGB (255,255,255)); + CBrush* pOldBrush = pDC->SelectObject (&backBrush); + + CRect rect; + pDC->GetClipBox (&rect); // Erase the area needed + pDC->PatBlt (rect.left, rect.top, rect.Width(), rect.Height(), PATCOPY); + pDC->SelectObject (pOldBrush); + + return TRUE; +} + +void CPopUpWnd::OnCancel1() +{ + m_ParentWnd->OnPopUpButton (1); +} + + +void CPopUpWnd::OnCancel2() +{ + m_ParentWnd->OnPopUpButton (2); +} + + +BOOL CPopUpWnd::DestroyWindow() +{ + return CWnd::DestroyWindow(); +} + +void CPopUpWnd::PeekAndPump() +{ + MSG msg; + + while (::PeekMessage (&msg, NULL,0,0,PM_NOREMOVE)) { + if (!AfxGetApp()->PumpMessage()) { + ::PostQuitMessage (0); + return; + } + } +} + diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/pocketpj/PopUpWnd.h b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/PopUpWnd.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/pocketpj/PopUpWnd.h rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/PopUpWnd.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/pocketpj/ReadMe.txt b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/ReadMe.txt similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/pocketpj/ReadMe.txt rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/ReadMe.txt diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/SettingsDlg.cpp b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/SettingsDlg.cpp new file mode 100644 index 0000000000000000000000000000000000000000..6d963f81fa3ec9b2ec11faf8c56bd006f3464868 --- /dev/null +++ b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/SettingsDlg.cpp @@ -0,0 +1,418 @@ +// SettingsDlg.cpp : implementation file +// + +#include "stdafx.h" +#include "PocketPJ.h" +#include "SettingsDlg.h" +#include <pjsua-lib/pjsua.h> +#include <atlbase.h> + +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + +#define REG_PATH _T("pjsip.org\\PocketPC") +#define REG_DOMAIN _T("Domain") +#define REG_USER _T("User") +#define REG_PASSWD _T("Data") +#define REG_USE_STUN _T("UseSTUN") +#define REG_STUN_SRV _T("STUNSrv") +#define REG_DNS _T("DNS") +#define REG_USE_ICE _T("UseICE") +#define REG_USE_SRTP _T("UseSRTP") +#define REG_USE_PUBLISH _T("UsePUBLISH") +#define REG_BUDDY_CNT _T("BuddyCnt") +#define REG_BUDDY_X _T("Buddy%u") +#define REG_ENABLE_EC _T("EnableEC") +#define REG_EC_TAIL _T("ECTail") +#define REG_ENABLE_VAD _T("EnableVAD") +#define REG_ENABLE_TCP _T("EnableTCP") +#define REG_CODEC_CNT _T("CodecCnt") +#define REG_CODEC_X _T("Codec%u") +#define REG_AUTO_ANSWER _T("AutoAnswer") + + +///////////////////////////////////////////////////////////////////////////// +// Settings +CPocketPJSettings::CPocketPJSettings() + : m_UseStun (FALSE), m_UseIce (FALSE), m_UseSrtp (FALSE), m_UsePublish (FALSE), + m_EchoSuppress (TRUE), m_EcTail (200), m_TCP (FALSE), m_VAD (FALSE), + m_AutoAnswer (FALSE) +{ + /* Init codec list */ +#if defined(PJMEDIA_HAS_GSM_CODEC) && PJMEDIA_HAS_GSM_CODEC + m_Codecs.Add (_T ("GSM")); +#endif +#if defined(PJMEDIA_HAS_G711_CODEC) && PJMEDIA_HAS_G711_CODEC + m_Codecs.Add (_T ("PCMU")); + m_Codecs.Add (_T ("PCMA")); +#endif +#if defined(PJMEDIA_HAS_SPEEX_CODEC) && PJMEDIA_HAS_SPEEX_CODEC + m_Codecs.Add (_T ("Speex")); +#endif +} + +// Load from registry +void CPocketPJSettings::LoadRegistry() +{ + CRegKey key; + wchar_t textVal[256]; + DWORD dwordVal; + DWORD cbData; + + + if (key.Open (HKEY_CURRENT_USER, REG_PATH) != ERROR_SUCCESS) + return; + + cbData = sizeof (textVal); + + if (key.QueryValue (textVal, REG_DOMAIN, &cbData) == ERROR_SUCCESS) { + m_Domain = textVal; + } + + cbData = sizeof (textVal); + + if (key.QueryValue (textVal, REG_USER, &cbData) == ERROR_SUCCESS) { + m_User = textVal; + } + + cbData = sizeof (textVal); + + if (key.QueryValue (textVal, REG_PASSWD, &cbData) == ERROR_SUCCESS) { + m_Password = textVal; + } + + cbData = sizeof (textVal); + + if (key.QueryValue (textVal, REG_STUN_SRV, &cbData) == ERROR_SUCCESS) { + m_StunSrv = textVal; + } + + cbData = sizeof (textVal); + + if (key.QueryValue (textVal, REG_DNS, &cbData) == ERROR_SUCCESS) { + m_DNS = textVal; + } + + dwordVal = 0; + + if (key.QueryValue (dwordVal, REG_USE_STUN) == ERROR_SUCCESS) { + m_UseStun = dwordVal != 0; + } + + if (key.QueryValue (dwordVal, REG_USE_ICE) == ERROR_SUCCESS) { + m_UseIce = dwordVal != 0; + } + + + if (key.QueryValue (dwordVal, REG_USE_SRTP) == ERROR_SUCCESS) { + m_UseSrtp = dwordVal != 0; + } + + + cbData = sizeof (dwordVal); + + if (key.QueryValue (dwordVal, REG_USE_PUBLISH) == ERROR_SUCCESS) { + m_UsePublish = dwordVal != 0; + } + + cbData = sizeof (dwordVal); + + if (key.QueryValue (dwordVal, REG_ENABLE_EC) == ERROR_SUCCESS) { + m_EchoSuppress = dwordVal != 0; + } + + cbData = sizeof (dwordVal); + + if (key.QueryValue (dwordVal, REG_EC_TAIL) == ERROR_SUCCESS) { + m_EcTail = dwordVal; + } + + cbData = sizeof (dwordVal); + + if (key.QueryValue (dwordVal, REG_ENABLE_TCP) == ERROR_SUCCESS) { + m_TCP = dwordVal != 0; + } + + cbData = sizeof (dwordVal); + + if (key.QueryValue (dwordVal, REG_ENABLE_VAD) == ERROR_SUCCESS) { + m_VAD = dwordVal != 0; + } + + cbData = sizeof (dwordVal); + + if (key.QueryValue (dwordVal, REG_AUTO_ANSWER) == ERROR_SUCCESS) { + m_AutoAnswer = dwordVal != 0; + } + + m_BuddyList.RemoveAll(); + + DWORD buddyCount = 0; + cbData = sizeof (dwordVal); + + if (key.QueryValue (dwordVal, REG_BUDDY_CNT) == ERROR_SUCCESS) { + buddyCount = dwordVal; + } + + unsigned i; + + for (i=0; i<buddyCount; ++i) { + CString entry; + entry.Format (REG_BUDDY_X, i); + + cbData = sizeof (textVal); + + if (key.QueryValue (textVal, entry, &cbData) == ERROR_SUCCESS) { + m_BuddyList.Add (textVal); + } + } + + DWORD codecCount = 0; + + cbData = sizeof (dwordVal); + + if (key.QueryValue (codecCount, REG_CODEC_CNT) == ERROR_SUCCESS) { + + m_Codecs.RemoveAll(); + + for (i=0; i<codecCount; ++i) { + CString entry; + entry.Format (REG_CODEC_X, i); + + cbData = sizeof (textVal); + + if (key.QueryValue (textVal, entry, &cbData) == ERROR_SUCCESS) { + m_Codecs.Add (textVal); + } + } + } + + key.Close(); +} + +// Save to registry +void CPocketPJSettings::SaveRegistry() +{ + CRegKey key; + + if (key.Create (HKEY_CURRENT_USER, REG_PATH) != ERROR_SUCCESS) + return; + + key.SetValue (m_Domain, REG_DOMAIN); + + key.SetValue (m_User, REG_USER); + + key.SetValue (m_Password, REG_PASSWD); + + key.SetValue (m_StunSrv, REG_STUN_SRV); + + key.SetValue (m_DNS, REG_DNS); + + key.SetValue (m_UseStun, REG_USE_STUN); + + key.SetValue (m_UseIce, REG_USE_ICE); + + key.SetValue (m_UseSrtp, REG_USE_SRTP); + + key.SetValue (m_UsePublish, REG_USE_PUBLISH); + + key.SetValue (m_EchoSuppress, REG_ENABLE_EC); + + key.SetValue (m_EcTail, REG_EC_TAIL); + + key.SetValue (m_TCP, REG_ENABLE_TCP); + + key.SetValue (m_VAD, REG_ENABLE_VAD); + + key.SetValue (m_AutoAnswer, REG_AUTO_ANSWER); + + key.SetValue (m_BuddyList.GetSize(), REG_BUDDY_CNT); + + int i; + + for (i=0; i<m_BuddyList.GetSize(); ++i) { + CString entry; + entry.Format (REG_BUDDY_X, i); + key.SetValue (m_BuddyList.GetAt (i), entry); + } + + DWORD N = m_Codecs.GetSize(); + + key.SetValue (N, REG_CODEC_CNT); + + for (i=0; i<m_Codecs.GetSize(); ++i) { + CString entry; + entry.Format (REG_CODEC_X, i); + key.SetValue (m_Codecs.GetAt (i), entry); + } + + key.Close(); +} + + +///////////////////////////////////////////////////////////////////////////// +// CSettingsDlg dialog + + +CSettingsDlg::CSettingsDlg (CPocketPJSettings &cfg, CWnd* pParent) + : CDialog (CSettingsDlg::IDD, pParent), m_Cfg (cfg) +{ + //{{AFX_DATA_INIT(CSettingsDlg) + m_Domain = _T (""); + m_ICE = FALSE; + m_Passwd = _T (""); + m_PUBLISH = FALSE; + m_SRTP = FALSE; + m_STUN = FALSE; + m_StunSrv = _T (""); + m_User = _T (""); + m_Dns = _T (""); + m_EchoSuppress = FALSE; + m_EcTail = _T (""); + m_TCP = FALSE; + m_VAD = FALSE; + m_AutoAnswer = FALSE; + //}}AFX_DATA_INIT + + m_Domain = m_Cfg.m_Domain; + m_ICE = m_Cfg.m_UseIce; + m_Passwd = m_Cfg.m_Password; + m_PUBLISH = m_Cfg.m_UsePublish; + m_SRTP = m_Cfg.m_UseSrtp; + m_STUN = m_Cfg.m_UseStun; + m_StunSrv = m_Cfg.m_StunSrv; + m_User = m_Cfg.m_User; + m_Dns = m_Cfg.m_DNS; + m_EchoSuppress = m_Cfg.m_EchoSuppress; + m_TCP = m_Cfg.m_TCP; + m_VAD = m_Cfg.m_VAD; + m_AutoAnswer= m_Cfg.m_AutoAnswer; + + CString s; + s.Format (_T ("%d"), m_Cfg.m_EcTail); + m_EcTail = s; + +} + + +void CSettingsDlg::DoDataExchange (CDataExchange* pDX) +{ + CDialog::DoDataExchange (pDX); + //{{AFX_DATA_MAP(CSettingsDlg) + DDX_Control (pDX, IDC_CODECS, m_Codecs); + DDX_Text (pDX, IDC_DOMAIN, m_Domain); + DDX_Check (pDX, IDC_ICE, m_ICE); + DDX_Text (pDX, IDC_PASSWD, m_Passwd); + DDX_Check (pDX, IDC_PUBLISH, m_PUBLISH); + DDX_Check (pDX, IDC_SRTP, m_SRTP); + DDX_Check (pDX, IDC_STUN, m_STUN); + DDX_Text (pDX, IDC_STUN_SRV, m_StunSrv); + DDX_Text (pDX, IDC_USER, m_User); + DDX_Text (pDX, IDC_DNS, m_Dns); + DDX_Check (pDX, IDC_ECHO_SUPPRESS, m_EchoSuppress); + DDX_Text (pDX, IDC_EC_TAIL, m_EcTail); + DDX_Check (pDX, IDC_TCP, m_TCP); + DDX_Check (pDX, IDC_VAD, m_VAD); + DDX_Check (pDX, IDC_AA, m_AutoAnswer); + //}}AFX_DATA_MAP + + + if (m_Codecs.GetCount() == 0) { + int i; + + for (i=0; i<m_Cfg.m_Codecs.GetSize(); ++i) { + m_Codecs.AddString (m_Cfg.m_Codecs.GetAt (i)); + } + + m_Codecs.SetCurSel (0); + } +} + + +BEGIN_MESSAGE_MAP (CSettingsDlg, CDialog) + //{{AFX_MSG_MAP(CSettingsDlg) + ON_BN_CLICKED (IDC_STUN, OnStun) + ON_BN_CLICKED (IDC_ECHO_SUPPRESS, OnEchoSuppress) + ON_CBN_SELCHANGE (IDC_CODECS, OnSelchangeCodecs) + //}}AFX_MSG_MAP +END_MESSAGE_MAP() + +///////////////////////////////////////////////////////////////////////////// +// CSettingsDlg message handlers + +int CSettingsDlg::DoModal() +{ + int rc = CDialog::DoModal(); + + return rc; +} + +void CSettingsDlg::OnStun() +{ +} + +void CSettingsDlg::OnEchoSuppress() +{ +} + +void CSettingsDlg::OnSelchangeCodecs() +{ + int cur = m_Codecs.GetCurSel(); + + if (cur < 1) + return; + + CString codec; + + DWORD N; + + m_Codecs.GetLBText (cur, codec); + + N = m_Codecs.GetCount(); + + m_Codecs.DeleteString (cur); + + N = m_Codecs.GetCount(); + + m_Codecs.InsertString (0, codec); + + N = m_Codecs.GetCount(); + + m_Codecs.SetCurSel (0); +} + + +void CSettingsDlg::OnOK() +{ + UpdateData (TRUE); + + m_Cfg.m_Domain = m_Domain; + m_Cfg.m_UseIce = m_ICE != 0; + m_Cfg.m_Password = m_Passwd; + m_Cfg.m_UsePublish = m_PUBLISH != 0; + m_Cfg.m_UseSrtp = m_SRTP != 0; + m_Cfg.m_UseStun = m_STUN != 0; + m_Cfg.m_StunSrv = m_StunSrv; + m_Cfg.m_User = m_User; + m_Cfg.m_DNS = m_Dns; + m_Cfg.m_EchoSuppress= m_EchoSuppress != 0; + m_Cfg.m_EcTail = _ttoi (m_EcTail); + m_Cfg.m_TCP = m_TCP != 0; + m_Cfg.m_VAD = m_VAD != 0; + m_Cfg.m_AutoAnswer = m_AutoAnswer != 0; + + unsigned i; + m_Cfg.m_Codecs.RemoveAll(); + DWORD N = m_Codecs.GetCount(); + + for (i=0; i<N; ++i) { + CString codec; + m_Codecs.GetLBText (i, codec); + m_Cfg.m_Codecs.Add (codec); + } + + CDialog::OnOK(); +} diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/pocketpj/SettingsDlg.h b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/SettingsDlg.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/pocketpj/SettingsDlg.h rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/SettingsDlg.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/pocketpj/StdAfx.cpp b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/StdAfx.cpp similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/pocketpj/StdAfx.cpp rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/StdAfx.cpp diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/pocketpj/StdAfx.h b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/StdAfx.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/pocketpj/StdAfx.h rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/StdAfx.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/pocketpj/newres.h b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/newres.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/pocketpj/newres.h rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/newres.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/pocketpj/res/PocketPJ.ico b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/res/PocketPJ.ico similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/pocketpj/res/PocketPJ.ico rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/res/PocketPJ.ico diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/pocketpj/res/PocketPJ.rc2 b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/res/PocketPJ.rc2 similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/pocketpj/res/PocketPJ.rc2 rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/res/PocketPJ.rc2 diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/pocketpj/res/action.bmp b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/res/action.bmp similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/pocketpj/res/action.bmp rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/res/action.bmp diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/pocketpj/res/blank.bmp b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/res/blank.bmp similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/pocketpj/res/blank.bmp rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/res/blank.bmp diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/pocketpj/res/invisibl.bmp b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/res/invisibl.bmp similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/pocketpj/res/invisibl.bmp rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/res/invisibl.bmp diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/pocketpj/res/invisibl.ico b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/res/invisibl.ico similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/pocketpj/res/invisibl.ico rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/res/invisibl.ico diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/pocketpj/res/offline.bmp b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/res/offline.bmp similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/pocketpj/res/offline.bmp rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/res/offline.bmp diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/pocketpj/res/offline.ico b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/res/offline.ico similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/pocketpj/res/offline.ico rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/res/offline.ico diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/pocketpj/res/online.bmp b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/res/online.bmp similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/pocketpj/res/online.bmp rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/res/online.bmp diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/pocketpj/res/online.ico b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/res/online.ico similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/pocketpj/res/online.ico rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/res/online.ico diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/pocketpj/resource.h b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/resource.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/pocketpj/resource.h rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/resource.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/py_pjsua/DEPRECATED.txt b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/py_pjsua/DEPRECATED.txt similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/py_pjsua/DEPRECATED.txt rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/py_pjsua/DEPRECATED.txt diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/py_pjsua/Makefile b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/py_pjsua/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..10ed2fb30d7952e3b8d7ddb6838070c1ed7cd20c --- /dev/null +++ b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/py_pjsua/Makefile @@ -0,0 +1,6 @@ +all: + python setup.py install + +clean: + python setup.py clean + rm -rf ./build diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/py_pjsua/helper.mak b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/py_pjsua/helper.mak similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/py_pjsua/helper.mak rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/py_pjsua/helper.mak diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/py_pjsua/pjsua.py b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/py_pjsua/pjsua.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/py_pjsua/pjsua.py rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/py_pjsua/pjsua.py diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/py_pjsua/pjsua_app.py b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/py_pjsua/pjsua_app.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/py_pjsua/pjsua_app.py rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/py_pjsua/pjsua_app.py diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/py_pjsua/py_pjsua.c b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/py_pjsua/py_pjsua.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/py_pjsua/py_pjsua.c rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/py_pjsua/py_pjsua.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/py_pjsua/py_pjsua.def b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/py_pjsua/py_pjsua.def similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/py_pjsua/py_pjsua.def rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/py_pjsua/py_pjsua.def diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/py_pjsua/py_pjsua.h b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/py_pjsua/py_pjsua.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/py_pjsua/py_pjsua.h rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/py_pjsua/py_pjsua.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/py_pjsua/setup.py b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/py_pjsua/setup.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/py_pjsua/setup.py rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/py_pjsua/setup.py diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/python/Makefile b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/python/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..43fe7bff70335316de393b53b6ed7ac1865cc11f --- /dev/null +++ b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/python/Makefile @@ -0,0 +1,9 @@ +all: + python setup.py install + +clean: + python setup.py clean + rm -rf ./build + +%: + python setup.py $@ diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/python/_pjsua.c b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/python/_pjsua.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/python/_pjsua.c rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/python/_pjsua.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/python/_pjsua.def b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/python/_pjsua.def similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/python/_pjsua.def rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/python/_pjsua.def diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/python/_pjsua.h b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/python/_pjsua.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/python/_pjsua.h rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/python/_pjsua.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/python/helper.mak b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/python/helper.mak similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/python/helper.mak rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/python/helper.mak diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/python/pjsua.py b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/python/pjsua.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/python/pjsua.py rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/python/pjsua.py diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/python/samples/call.py b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/python/samples/call.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/python/samples/call.py rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/python/samples/call.py diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/python/samples/presence.py b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/python/samples/presence.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/python/samples/presence.py rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/python/samples/presence.py diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/python/samples/registration.py b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/python/samples/registration.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/python/samples/registration.py rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/python/samples/registration.py diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/python/samples/simplecall.py b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/python/samples/simplecall.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/python/samples/simplecall.py rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/python/samples/simplecall.py diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/python/setup-vc.py b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/python/setup-vc.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/python/setup-vc.py rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/python/setup-vc.py diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/python/setup.py b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/python/setup.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/python/setup.py rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/python/setup.py diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/samples/aectest.c b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/aectest.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/samples/aectest.c rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/aectest.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/samples/confbench.c b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/confbench.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/samples/confbench.c rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/confbench.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/samples/confsample.c b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/confsample.c similarity index 98% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/samples/confsample.c rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/confsample.c index e5f79fc5ac2c38989cec96ed03da27a6918bbcb2..954d26e44a46ab5c5451ae8c443a43f4e7b46197 100644 --- a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/samples/confsample.c +++ b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/confsample.c @@ -1,4 +1,4 @@ -/* $Id: confsample.c 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: confsample.c 2408 2009-01-01 22:08:21Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -105,7 +105,8 @@ static pj_bool_t input(const char *title, char *buf, pj_size_t len) char *p; printf("%s (empty to cancel): ", title); fflush(stdout); - fgets(buf, len, stdin); + if (fgets(buf, len, stdin) == NULL) + return PJ_FALSE; /* Remove trailing newlines. */ for (p=buf; ; ++p) { @@ -268,7 +269,7 @@ int main(int argc, char *argv[]) char tmp1[10]; char tmp2[10]; char *err; - int src, dst, level; + int src, dst, level, dur; puts(""); conf_list(conf, 0); @@ -285,7 +286,8 @@ int main(int argc, char *argv[]) printf("Enter selection: "); fflush(stdout); - fgets(tmp, sizeof(tmp), stdin); + if (fgets(tmp, sizeof(tmp), stdin) == NULL) + break; switch (tmp[0]) { case 's': @@ -415,13 +417,13 @@ int main(int argc, char *argv[]) if (!input("Duration to monitor (in seconds)", tmp1, sizeof(tmp1)) ) continue; - strtol(tmp1, &err, 10); + dur = strtol(tmp1, &err, 10); if (*err) { puts("Invalid duration number"); continue; } - monitor_level(conf, src, tmp2[0], strtol(tmp1, &err, 10)); + monitor_level(conf, src, tmp2[0], dur); break; case 'q': diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/samples/debug.c b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/debug.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/samples/debug.c rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/debug.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/samples/encdec.c b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/encdec.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/samples/encdec.c rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/encdec.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/samples/footprint.c b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/footprint.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/samples/footprint.c rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/footprint.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/samples/invtester.c b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/invtester.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/samples/invtester.c rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/invtester.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/samples/latency.c b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/latency.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/samples/latency.c rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/latency.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/samples/level.c b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/level.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/samples/level.c rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/level.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/samples/main_rtems.c b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/main_rtems.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/samples/main_rtems.c rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/main_rtems.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/samples/mix.c b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/mix.c similarity index 98% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/samples/mix.c rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/mix.c index 05f77252178ddc5244b7c1bc5e77783b7288bb72..48c8fd8b00b86653fef6b41f076b0ecac3f7936d 100644 --- a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/samples/mix.c +++ b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/mix.c @@ -1,4 +1,4 @@ -/* $Id: mix.c 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: mix.c 2408 2009-01-01 22:08:21Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -129,7 +129,8 @@ int main(int argc, char *argv[]) printf("File %s exists, overwrite? [Y/N] ", out_fname); fflush(stdout); - fgets(in, sizeof(in), stdin); + if (fgets(in, sizeof(in), stdin) == NULL) + return 1; if (pj_tolower(in[0]) != 'y') return 1; } diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/samples/pcaputil.c b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/pcaputil.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/samples/pcaputil.c rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/pcaputil.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/samples/pjsip-perf.c b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/pjsip-perf.c similarity index 99% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/samples/pjsip-perf.c rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/pjsip-perf.c index 3bb36c1aaec006f03ac320126e2a6aef139ad901..830a93542cc3303d130298f572882fd28659050f 100644 --- a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/samples/pjsip-perf.c +++ b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/pjsip-perf.c @@ -1,4 +1,4 @@ -/* $Id: pjsip-perf.c 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: pjsip-perf.c 2408 2009-01-01 22:08:21Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -1809,7 +1809,7 @@ int main(int argc, char *argv[]) } else { /* Server mode */ - char s[10]; + char s[10], *unused; pj_status_t status; unsigned i; @@ -1844,7 +1844,8 @@ int main(int argc, char *argv[]) puts("\nPress <ENTER> to quit\n"); fflush(stdout); - fgets(s, sizeof(s), stdin); + unused = fgets(s, sizeof(s), stdin); + PJ_UNUSED_ARG(unused); app.thread_quit = PJ_TRUE; for (i=0; i<app.thread_count; ++i) { diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/samples/playfile.c b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/playfile.c similarity index 97% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/samples/playfile.c rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/playfile.c index 37c2f4ac01032e72314507ef5342a6b2cdb17aac..1e7ef0c329ef3a9edd95314c334512292b26893a 100644 --- a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/samples/playfile.c +++ b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/playfile.c @@ -1,4 +1,4 @@ -/* $Id: playfile.c 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: playfile.c 2408 2009-01-01 22:08:21Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -172,7 +172,9 @@ int main(int argc, char *argv[]) puts(""); puts("Press <ENTER> to stop playing and quit"); - fgets(tmp, sizeof(tmp), stdin); + if (fgets(tmp, sizeof(tmp), stdin) == NULL) { + puts("EOF while reading stdin, will quit now.."); + } /* Start deinitialization: */ diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/samples/playsine.c b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/playsine.c similarity index 98% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/samples/playsine.c rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/playsine.c index 4d16aa5c72988fa06cefc81d1e74637c7a7577fe..93372477b4f91639e89bef10ec5ce8a2a232e543 100644 --- a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/samples/playsine.c +++ b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/playsine.c @@ -1,4 +1,4 @@ -/* $Id: playsine.c 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: playsine.c 2408 2009-01-01 22:08:21Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -277,7 +277,9 @@ int main(int argc, char *argv[]) puts(""); puts("Press <ENTER> to stop playing and quit"); - fgets(tmp, sizeof(tmp), stdin); + if (fgets(tmp, sizeof(tmp), stdin) == NULL) { + puts("EOF while reading stdin, will quit now.."); + } /* Start deinitialization: */ diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/samples/proxy.h b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/proxy.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/samples/proxy.h rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/proxy.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/samples/recfile.c b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/recfile.c similarity index 96% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/samples/recfile.c rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/recfile.c index 36c3f0c702bdc7db694dbdf2f0af7de74903ecab..1d13547c20c02a0ce21844794f1b0ae6a4a1c373 100644 --- a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/samples/recfile.c +++ b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/recfile.c @@ -1,4 +1,4 @@ -/* $Id: recfile.c 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: recfile.c 2408 2009-01-01 22:08:21Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -167,7 +167,9 @@ int main(int argc, char *argv[]) puts(""); puts("Press <ENTER> to stop recording and quit"); - fgets(tmp, sizeof(tmp), stdin); + if (fgets(tmp, sizeof(tmp), stdin) == NULL) { + puts("EOF while reading stdin, will quit now.."); + } /* Start deinitialization: */ diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/samples/resampleplay.c b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/resampleplay.c similarity index 97% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/samples/resampleplay.c rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/resampleplay.c index 7af443f05ac20e50c3909d69df9d99899ead1032..63b4594a8cc330a6bf38a6f130b46064bd55840f 100644 --- a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/samples/resampleplay.c +++ b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/resampleplay.c @@ -1,4 +1,4 @@ -/* $Id: resampleplay.c 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: resampleplay.c 2408 2009-01-01 22:08:21Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -190,8 +190,9 @@ int main(int argc, char *argv[]) puts(""); puts("Press <ENTER> to stop playing and quit"); - fgets(tmp, sizeof(tmp), stdin); - + if (fgets(tmp, sizeof(tmp), stdin) == NULL) { + puts("EOF while reading stdin, will quit now.."); + } /* Start deinitialization: */ diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/samples/simple_pjsua.c b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/simple_pjsua.c similarity index 96% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/samples/simple_pjsua.c rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/simple_pjsua.c index 9f715d1b44ad7204221c98e6d1d930a9c500d747..3086de6d51e357b0ea02a93b9cc84f05bdc92104 100644 --- a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/samples/simple_pjsua.c +++ b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/simple_pjsua.c @@ -1,4 +1,4 @@ -/* $Id: simple_pjsua.c 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: simple_pjsua.c 2408 2009-01-01 22:08:21Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -182,7 +182,10 @@ int main(int argc, char *argv[]) char option[10]; puts("Press 'h' to hangup all calls, 'q' to quit"); - fgets(option, sizeof(option), stdin); + if (fgets(option, sizeof(option), stdin) == NULL) { + puts("EOF while reading stdin, will quit now.."); + break; + } if (option[0] == 'q') break; diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/samples/simpleua.c b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/simpleua.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/samples/simpleua.c rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/simpleua.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/samples/siprtp.c b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/siprtp.c similarity index 99% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/samples/siprtp.c rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/siprtp.c index 80a8c4cdee67bc06ebd383a6c9a7af7e1ae274b3..2735b247df9b8d04b14f042b422e554401d70871 100644 --- a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/samples/siprtp.c +++ b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/siprtp.c @@ -1,4 +1,4 @@ -/* $Id: siprtp.c 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: siprtp.c 2408 2009-01-01 22:08:21Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -1862,7 +1862,8 @@ static pj_bool_t simple_input(const char *title, char *buf, pj_size_t len) char *p; printf("%s (empty to cancel): ", title); fflush(stdout); - fgets(buf, len, stdin); + if (fgets(buf, len, stdin) == NULL) + return PJ_FALSE; /* Remove trailing newlines. */ for (p=buf; ; ++p) { @@ -1898,7 +1899,10 @@ static void console_main() for (;;) { printf(">>> "); fflush(stdout); - fgets(input1, sizeof(input1), stdin); + if (fgets(input1, sizeof(input1), stdin) == NULL) { + puts("EOF while reading stdin, will quit now.."); + break; + } switch (input1[0]) { @@ -2020,7 +2024,8 @@ static void app_log_writer(int level, const char *buffer, int len) pj_log_write(level, buffer, len); if (log_file) { - fwrite(buffer, len, 1, log_file); + int count = fwrite(buffer, len, 1, log_file); + PJ_UNUSED_ARG(count); fflush(log_file); } } diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/samples/siprtp_report.c b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/siprtp_report.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/samples/siprtp_report.c rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/siprtp_report.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/samples/sipstateless.c b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/sipstateless.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/samples/sipstateless.c rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/sipstateless.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/samples/sndinfo.c b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/sndinfo.c similarity index 97% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/samples/sndinfo.c rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/sndinfo.c index 63d93bd805726522fec1503736665129584d9fbf..42a39784e8258fc082ffd06747559b42de24de3d 100644 --- a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/samples/sndinfo.c +++ b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/sndinfo.c @@ -1,4 +1,4 @@ -/* $Id: sndinfo.c 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: sndinfo.c 2408 2009-01-01 22:08:21Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -202,8 +202,9 @@ static int open_device(int dev_id, pjmedia_dir dir, /* Let playback/capture runs for a while */ //pj_thread_sleep(1000); puts("Press <ENTER> to stop"); - fgets(tmp, sizeof(tmp), stdin); - + if (fgets(tmp, sizeof(tmp), stdin) == NULL) { + puts("EOF while reading stdin, will quit now.."); + } pjmedia_snd_stream_close(strm); diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/samples/sndtest.c b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/sndtest.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/samples/sndtest.c rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/sndtest.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/samples/stateful_proxy.c b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/stateful_proxy.c similarity index 98% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/samples/stateful_proxy.c rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/stateful_proxy.c index a432dc211954f49462b2aa173210d1cfabecf39a..ffa24dab2caf449f4ccb2ec0ad6754b7537f0df7 100644 --- a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/samples/stateful_proxy.c +++ b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/stateful_proxy.c @@ -1,4 +1,4 @@ -/* $Id: stateful_proxy.c 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: stateful_proxy.c 2408 2009-01-01 22:08:21Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -555,7 +555,11 @@ int main(int argc, char *argv[]) " dd dump detailed status\n" ""); - fgets(line, sizeof(line), stdin); + if (fgets(line, sizeof(line), stdin) == NULL) { + puts("EOF while reading stdin, will quit now.."); + global.quit_flag = PJ_TRUE; + break; + } if (line[0] == 'q') { global.quit_flag = PJ_TRUE; diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/samples/stateless_proxy.c b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/stateless_proxy.c similarity index 96% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/samples/stateless_proxy.c rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/stateless_proxy.c index 4ed9acd65a3ca03bfde596df8c9a79a9cb82d4fa..da60954c0a2e333a0fbb35e8bf343e72984cb397 100644 --- a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/samples/stateless_proxy.c +++ b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/stateless_proxy.c @@ -1,4 +1,4 @@ -/* $Id: stateless_proxy.c 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: stateless_proxy.c 2408 2009-01-01 22:08:21Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -221,7 +221,11 @@ int main(int argc, char *argv[]) " dd dump detailed status\n" ""); - fgets(line, sizeof(line), stdin); + if (fgets(line, sizeof(line), stdin) == NULL) { + puts("EOF while reading stdin, will quit now.."); + global.quit_flag = PJ_TRUE; + break; + } if (line[0] == 'q') { global.quit_flag = PJ_TRUE; diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/samples/stereotest.c b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/stereotest.c similarity index 98% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/samples/stereotest.c rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/stereotest.c index 557b78647f8d7c550fa4c76fb04529b23fb2c169..1ef18781e2571f3774a34f7e5c85fc92255c146a 100644 --- a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/samples/stereotest.c +++ b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/stereotest.c @@ -1,4 +1,4 @@ -/* $Id: stereotest.c 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: stereotest.c 2408 2009-01-01 22:08:21Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -295,8 +295,9 @@ int main(int argc, char *argv[]) puts(""); puts("Press <ENTER> to stop and quit"); - fgets(tmp, sizeof(tmp), stdin); - + if (fgets(tmp, sizeof(tmp), stdin) == NULL) { + puts("EOF while reading stdin, will quit now.."); + } /* Start deinitialization: */ diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/samples/streamutil.c b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/streamutil.c similarity index 99% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/samples/streamutil.c rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/streamutil.c index be68a0b538d545298c1cb0edfa072f6e69ed0220..4cb25e934c521a86a2cd761db49ddb7358a341d0 100644 --- a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/samples/streamutil.c +++ b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/streamutil.c @@ -1,4 +1,4 @@ -/* $Id: streamutil.c 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: streamutil.c 2408 2009-01-01 22:08:21Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -616,7 +616,10 @@ int main(int argc, char *argv[]) printf("Command: "); fflush(stdout); - fgets(tmp, sizeof(tmp), stdin); + if (fgets(tmp, sizeof(tmp), stdin) == NULL) { + puts("EOF while reading stdin, will quit now.."); + break; + } if (tmp[0] == 's') print_stream_stat(stream); diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/samples/strerror.c b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/strerror.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/samples/strerror.c rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/strerror.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/samples/tonegen.c b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/tonegen.c similarity index 96% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/samples/tonegen.c rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/tonegen.c index e77a67001b07f5bcf2bab2558db77a0e7be7b0eb..0c632d9db881f95995d94a4c6ab27fc59f87100f 100644 --- a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/samples/tonegen.c +++ b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/tonegen.c @@ -1,4 +1,4 @@ -/* $Id: tonegen.c 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: tonegen.c 2408 2009-01-01 22:08:21Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -127,8 +127,11 @@ int main() f = fopen("tonegen.pcm", "wb"); for (i=0; i<8000/SAMPLES_PER_FRAME; ++i) { + int count; pjmedia_port_get_frame(port, &frm); - fwrite(buf, SAMPLES_PER_FRAME, 2, f); + count = fwrite(buf, SAMPLES_PER_FRAME, 2, f); + if (count != 2) + break; } pj_assert(pjmedia_tonegen_is_busy(port) == 0); diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/samples/util.h b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/util.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/samples/util.h rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/util.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua/main_symbian.cpp b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua/main_symbian.cpp similarity index 80% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua/main_symbian.cpp rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua/main_symbian.cpp index 8a7f6029c840d25741ee501fb1c455e7514988ab..d7f3f0ec634d5b4165e155238d0d14921fe51101 100644 --- a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua/main_symbian.cpp +++ b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua/main_symbian.cpp @@ -1,5 +1,5 @@ /* $Id: main_symbian.cpp 2394 2008-12-23 17:27:53Z bennylp $ */ -/* +/* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> * @@ -15,7 +15,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "ua.h" @@ -29,7 +29,7 @@ CConsoleBase* console; // Needed by APS -TPtrC APP_UID = _L("A000000D"); +TPtrC APP_UID = _L ("A000000D"); //////////////////////////////////////////////////////////////////////////// @@ -37,13 +37,13 @@ TPtrC APP_UID = _L("A000000D"); LOCAL_C void DoStartL() { CActiveScheduler *scheduler = new (ELeave) CActiveScheduler; - CleanupStack::PushL(scheduler); - CActiveScheduler::Install(scheduler); + CleanupStack::PushL (scheduler); + CActiveScheduler::Install (scheduler); ua_main(); - - CActiveScheduler::Install(NULL); - CleanupStack::Pop(scheduler); + + CActiveScheduler::Install (NULL); + CleanupStack::Pop (scheduler); delete scheduler; } @@ -60,22 +60,26 @@ GLDEF_C TInt E32Main() CTrapCleanup* cleanup = CTrapCleanup::New(); // Create output console - TRAPD(createError, console = Console::NewL(_L("Console"), TSize(KConsFullScreen,KConsFullScreen))); + TRAPD (createError, console = Console::NewL (_L ("Console"), TSize (KConsFullScreen,KConsFullScreen))); + if (createError) return createError; - TRAPD(startError, DoStartL()); + TRAPD (startError, DoStartL()); + + console->Printf (_L ("[press any key to close]\n")); - console->Printf(_L("[press any key to close]\n")); console->Getch(); - + delete console; + delete cleanup; - CloseSTDLIB(); + CloseSTDLIB(); // Mark end of heap usage, detect memory leaks __UHEAP_MARKEND; + return KErrNone; } diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua/symbian_ua_reg.rss b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua/symbian_ua_reg.rss similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua/symbian_ua_reg.rss rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua/symbian_ua_reg.rss diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua/ua.cpp b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua/ua.cpp new file mode 100644 index 0000000000000000000000000000000000000000..6e790f246d61316afcd7f7edcd995f0af709dbc4 --- /dev/null +++ b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua/ua.cpp @@ -0,0 +1,1000 @@ +/* $Id: ua.cpp 2482 2009-03-02 15:50:12Z nanang $ */ +/* + * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) + * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> + * + * 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 + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#include <pjsua-lib/pjsua.h> +#include <pjsua-lib/pjsua_internal.h> +#include "ua.h" + +#define THIS_FILE "symbian_ua.cpp" +#define LOG_LEVEL 3 + +// +// Basic config. +// +#define SIP_PORT 5060 + + +// +// Destination URI (to make call, or to subscribe presence) +// +#define SIP_DST_URI "sip:100@pjsip.lab" + +// +// Account +// +#define HAS_SIP_ACCOUNT 0 // 1 to enable registration +#define SIP_DOMAIN "pjsip.lab" +#define SIP_USER "400" +#define SIP_PASSWD "400" + +// +// Outbound proxy for all accounts +// +#define SIP_PROXY NULL +//#define SIP_PROXY "<sip:192.168.0.8;lr>" + + +// +// Configure nameserver if DNS SRV is to be used with both SIP +// or STUN (for STUN see other settings below) +// +#define NAMESERVER NULL +//#define NAMESERVER "192.168.0.2" + +// +// STUN server +#if 0 +// Use this to have the STUN server resolved normally +# define STUN_DOMAIN NULL +# define STUN_SERVER "stun.pjsip.org" +#elif 0 +// Use this to have the STUN server resolved with DNS SRV +# define STUN_DOMAIN "pjsip.org" +# define STUN_SERVER NULL +#else +// Use this to disable STUN +# define STUN_DOMAIN NULL +# define STUN_SERVER NULL +#endif + +// +// Use ICE? +// +#define USE_ICE 1 + +// +// Use SRTP? +// +#define USE_SRTP PJSUA_DEFAULT_USE_SRTP + +// +// Globals +// +static pjsua_acc_id g_acc_id = PJSUA_INVALID_ID; +static pjsua_call_id g_call_id = PJSUA_INVALID_ID; +static pjsua_buddy_id g_buddy_id = PJSUA_INVALID_ID; + + +/* Callback called by the library upon receiving incoming call */ +static void on_incoming_call (pjsua_acc_id acc_id, pjsua_call_id call_id, + pjsip_rx_data *rdata) +{ + pjsua_call_info ci; + + PJ_UNUSED_ARG (acc_id); + PJ_UNUSED_ARG (rdata); + + if (g_call_id != PJSUA_INVALID_ID) { + pjsua_call_answer (call_id, PJSIP_SC_BUSY_HERE, NULL, NULL); + return; + } + + pjsua_call_get_info (call_id, &ci); + + PJ_LOG (3, (THIS_FILE, "Incoming call from %.*s!!", + (int) ci.remote_info.slen, + ci.remote_info.ptr)); + + g_call_id = call_id; + + /* Automatically answer incoming calls with 180/Ringing */ + pjsua_call_answer (call_id, 180, NULL, NULL); +} + +/* Callback called by the library when call's state has changed */ +static void on_call_state (pjsua_call_id call_id, pjsip_event *e) +{ + pjsua_call_info ci; + + PJ_UNUSED_ARG (e); + + pjsua_call_get_info (call_id, &ci); + + if (ci.state == PJSIP_INV_STATE_DISCONNECTED) { + if (call_id == g_call_id) + g_call_id = PJSUA_INVALID_ID; + } else if (ci.state != PJSIP_INV_STATE_INCOMING) { + if (g_call_id == PJSUA_INVALID_ID) + g_call_id = call_id; + } + + PJ_LOG (3, (THIS_FILE, "Call %d state=%.*s", call_id, + + (int) ci.state_text.slen, + ci.state_text.ptr)); +} + +/* Callback called by the library when call's media state has changed */ +static void on_call_media_state (pjsua_call_id call_id) +{ + pjsua_call_info ci; + + pjsua_call_get_info (call_id, &ci); + + if (ci.media_status == PJSUA_CALL_MEDIA_ACTIVE) { + // When media is active, connect call to sound device. + pjsua_conf_connect (ci.conf_slot, 0); + pjsua_conf_connect (0, ci.conf_slot); + } +} + + +/* Handler on buddy state changed. */ +static void on_buddy_state (pjsua_buddy_id buddy_id) +{ + pjsua_buddy_info info; + pjsua_buddy_get_info (buddy_id, &info); + + PJ_LOG (3, (THIS_FILE, "%.*s status is %.*s", + (int) info.uri.slen, + info.uri.ptr, + (int) info.status_text.slen, + info.status_text.ptr)); +} + + +/* Incoming IM message (i.e. MESSAGE request)! */ +static void on_pager (pjsua_call_id call_id, const pj_str_t *from, + const pj_str_t *to, const pj_str_t *contact, + const pj_str_t *mime_type, const pj_str_t *text) +{ + /* Note: call index may be -1 */ + PJ_UNUSED_ARG (call_id); + PJ_UNUSED_ARG (to); + PJ_UNUSED_ARG (contact); + PJ_UNUSED_ARG (mime_type); + + PJ_LOG (3, (THIS_FILE,"MESSAGE from %.*s: %.*s", + (int) from->slen, from->ptr, + (int) text->slen, text->ptr)); +} + + +/* Received typing indication */ +static void on_typing (pjsua_call_id call_id, const pj_str_t *from, + const pj_str_t *to, const pj_str_t *contact, + pj_bool_t is_typing) +{ + PJ_UNUSED_ARG (call_id); + PJ_UNUSED_ARG (to); + PJ_UNUSED_ARG (contact); + + PJ_LOG (3, (THIS_FILE, "IM indication: %.*s %s", + (int) from->slen, from->ptr, + (is_typing?"is typing..":"has stopped typing"))); +} + + +/* Call transfer request status. */ +static void on_call_transfer_status (pjsua_call_id call_id, + int status_code, + const pj_str_t *status_text, + pj_bool_t final, + pj_bool_t *p_cont) +{ + PJ_LOG (3, (THIS_FILE, "Call %d: transfer status=%d (%.*s) %s", + call_id, status_code, + (int) status_text->slen, status_text->ptr, + (final ? "[final]" : ""))); + + if (status_code/100 == 2) { + PJ_LOG (3, (THIS_FILE, + "Call %d: call transfered successfully, disconnecting call", + call_id)); + pjsua_call_hangup (call_id, PJSIP_SC_GONE, NULL, NULL); + *p_cont = PJ_FALSE; + } +} + + +/* NAT detection result */ +static void on_nat_detect (const pj_stun_nat_detect_result *res) +{ + if (res->status != PJ_SUCCESS) { + pjsua_perror (THIS_FILE, "NAT detection failed", res->status); + } else { + PJ_LOG (3, (THIS_FILE, "NAT detected as %s", res->nat_type_name)); + } +} + +/* Notification that call is being replaced. */ +static void on_call_replaced (pjsua_call_id old_call_id, + pjsua_call_id new_call_id) +{ + pjsua_call_info old_ci, new_ci; + + pjsua_call_get_info (old_call_id, &old_ci); + pjsua_call_get_info (new_call_id, &new_ci); + + PJ_LOG (3, (THIS_FILE, "Call %d with %.*s is being replaced by " + "call %d with %.*s", + old_call_id, + (int) old_ci.remote_info.slen, old_ci.remote_info.ptr, + new_call_id, + (int) new_ci.remote_info.slen, new_ci.remote_info.ptr)); +} + + +//#include<e32debug.h> + +/* Logging callback */ +static void log_writer (int level, const char *buf, int len) +{ + static wchar_t buf16[PJ_LOG_MAX_SIZE]; + + PJ_UNUSED_ARG (level); + + pj_ansi_to_unicode (buf, len, buf16, PJ_ARRAY_SIZE (buf16)); + + TPtrC16 aBuf ( (const TUint16*) buf16, (TInt) len); + //RDebug::Print(aBuf); + console->Write (aBuf); + +} + +/* + * app_startup() + * + * url may contain URL to call. + */ +static pj_status_t app_startup() +{ + pj_status_t status; + + /* Redirect log before pjsua_init() */ + pj_log_set_log_func (&log_writer); + + /* Set log level */ + pj_log_set_level (LOG_LEVEL); + + /* Create pjsua first! */ + status = pjsua_create(); + + if (status != PJ_SUCCESS) { + pjsua_perror (THIS_FILE, "pjsua_create() error", status); + return status; + } + + /* Init pjsua */ + pjsua_config cfg; + + pjsua_logging_config log_cfg; + + pjsua_media_config med_cfg; + + pjsua_config_default (&cfg); + + cfg.max_calls = 2; + + cfg.thread_cnt = 0; // Disable threading on Symbian + + cfg.use_srtp = USE_SRTP; + + cfg.srtp_secure_signaling = 0; + + cfg.cb.on_incoming_call = &on_incoming_call; + + cfg.cb.on_call_media_state = &on_call_media_state; + + cfg.cb.on_call_state = &on_call_state; + + cfg.cb.on_buddy_state = &on_buddy_state; + + cfg.cb.on_pager = &on_pager; + + cfg.cb.on_typing = &on_typing; + + cfg.cb.on_call_transfer_status = &on_call_transfer_status; + + cfg.cb.on_call_replaced = &on_call_replaced; + + cfg.cb.on_nat_detect = &on_nat_detect; + + if (SIP_PROXY) { + cfg.outbound_proxy_cnt = 1; + cfg.outbound_proxy[0] = pj_str (SIP_PROXY); + } + + if (NAMESERVER) { + cfg.nameserver_count = 1; + cfg.nameserver[0] = pj_str (NAMESERVER); + } + + if (NAMESERVER && STUN_DOMAIN) { + cfg.stun_domain = pj_str (STUN_DOMAIN); + } else if (STUN_SERVER) { + cfg.stun_host = pj_str (STUN_SERVER); + } + + + pjsua_logging_config_default (&log_cfg); + + log_cfg.level = LOG_LEVEL; + log_cfg.console_level = LOG_LEVEL; + log_cfg.cb = &log_writer; + //log_cfg.log_filename = pj_str("C:\\data\\symbian_ua.log"); + + pjsua_media_config_default (&med_cfg); + med_cfg.thread_cnt = 0; // Disable threading on Symbian + med_cfg.has_ioqueue = PJ_FALSE; + med_cfg.clock_rate = 8000; +#if defined(PJMEDIA_SYM_SND_USE_APS) && (PJMEDIA_SYM_SND_USE_APS==1) + med_cfg.audio_frame_ptime = 20; +#else + med_cfg.audio_frame_ptime = 40; +#endif + med_cfg.ec_tail_len = 0; + med_cfg.enable_ice = USE_ICE; + med_cfg.snd_auto_close_time = 5; // wait for 5 seconds idle before sound dev get auto-closed + + status = pjsua_init (&cfg, &log_cfg, &med_cfg); + + if (status != PJ_SUCCESS) { + pjsua_perror (THIS_FILE, "pjsua_init() error", status); + pjsua_destroy(); + return status; + } + + /* Adjust Speex priority and enable only the narrowband */ + { + pj_str_t codec_id = pj_str ("speex/8000"); + pjmedia_codec_mgr_set_codec_priority ( + pjmedia_endpt_get_codec_mgr (pjsua_var.med_endpt), + &codec_id, PJMEDIA_CODEC_PRIO_NORMAL+1); + + codec_id = pj_str ("speex/16000"); + pjmedia_codec_mgr_set_codec_priority ( + pjmedia_endpt_get_codec_mgr (pjsua_var.med_endpt), + &codec_id, PJMEDIA_CODEC_PRIO_DISABLED); + + codec_id = pj_str ("speex/32000"); + pjmedia_codec_mgr_set_codec_priority ( + pjmedia_endpt_get_codec_mgr (pjsua_var.med_endpt), + &codec_id, PJMEDIA_CODEC_PRIO_DISABLED); + } + + /* Add UDP transport. */ + pjsua_transport_config tcfg; + + pjsua_transport_id tid; + + pjsua_transport_config_default (&tcfg); + + tcfg.port = SIP_PORT; + + status = pjsua_transport_create (PJSIP_TRANSPORT_UDP, &tcfg, &tid); + + if (status != PJ_SUCCESS) { + pjsua_perror (THIS_FILE, "Error creating transport", status); + pjsua_destroy(); + return status; + } + + /* Add account for the transport */ + pjsua_acc_add_local (tid, PJ_TRUE, &g_acc_id); + + + /* Initialization is done, now start pjsua */ + status = pjsua_start(); + + if (status != PJ_SUCCESS) { + pjsua_perror (THIS_FILE, "Error starting pjsua", status); + pjsua_destroy(); + return status; + } + + /* Register to SIP server by creating SIP account. */ + if (HAS_SIP_ACCOUNT) { + pjsua_acc_config cfg; + + pjsua_acc_config_default (&cfg); + cfg.id = pj_str ("sip:" SIP_USER "@" SIP_DOMAIN); + cfg.reg_uri = pj_str ("sip:" SIP_DOMAIN); + cfg.cred_count = 1; + cfg.cred_info[0].realm = pj_str ("*"); + cfg.cred_info[0].scheme = pj_str ("digest"); + cfg.cred_info[0].username = pj_str (SIP_USER); + cfg.cred_info[0].data_type = PJSIP_CRED_DATA_PLAIN_PASSWD; + cfg.cred_info[0].data = pj_str (SIP_PASSWD); + + status = pjsua_acc_add (&cfg, PJ_TRUE, &g_acc_id); + + if (status != PJ_SUCCESS) { + pjsua_perror (THIS_FILE, "Error adding account", status); + pjsua_destroy(); + return status; + } + } + + if (SIP_DST_URI) { + pjsua_buddy_config bcfg; + + pjsua_buddy_config_default (&bcfg); + bcfg.uri = pj_str (SIP_DST_URI); + bcfg.subscribe = PJ_FALSE; + + pjsua_buddy_add (&bcfg, &g_buddy_id); + } + + return PJ_SUCCESS; +} + + +//////////////////////////////////////////////////////////////////////////// +/* + * The interractive console UI + */ +#include <e32base.h> + +class ConsoleUI : public CActive +{ + + public: + ConsoleUI (CConsoleBase *con); + ~ConsoleUI(); + + // Run console UI + void Run(); + + // Stop + void Stop(); + + protected: + // Cancel asynchronous read. + void DoCancel(); + + // Implementation: called when read has completed. + void RunL(); + + private: + CConsoleBase *con_; +}; + + +ConsoleUI::ConsoleUI (CConsoleBase *con) + : CActive (EPriorityStandard), con_ (con) +{ + CActiveScheduler::Add (this); +} + +ConsoleUI::~ConsoleUI() +{ + Stop(); +} + +// Run console UI +void ConsoleUI::Run() +{ + con_->Read (iStatus); + SetActive(); +} + +// Stop console UI +void ConsoleUI::Stop() +{ + Cancel(); +} + +// Cancel asynchronous read. +void ConsoleUI::DoCancel() +{ + con_->ReadCancel(); +} + +static void PrintMenu() +{ + PJ_LOG (3, (THIS_FILE, "\n\n" + "Menu:\n" + " d Dump states\n" + " D Dump states detail\n" + " P Dump pool factory\n" + " l Start loopback audio device\n" + " L Stop loopback audio device\n" + " m Call " SIP_DST_URI "\n" + " a Answer call\n" + " g Hangup all calls\n" + " s Subscribe " SIP_DST_URI "\n" + " S Unsubscribe presence\n" + " o Set account online\n" + " O Set account offline\n" + " w Quit\n")); +} + +// Implementation: called when read has completed. +void ConsoleUI::RunL() +{ + TKeyCode kc = con_->KeyCode(); + pj_bool_t reschedule = PJ_TRUE; + + switch (kc) { + + case 'w': + CActiveScheduler::Stop(); + reschedule = PJ_FALSE; + break; + + case 'D': + + case 'd': + pjsua_dump (kc == 'D'); + break; + + case 'p': + + case 'P': + pj_pool_factory_dump (pjsua_get_pool_factory(), PJ_TRUE); + break; + + case 'l': + pjsua_conf_connect (0, 0); + break; + + case 'L': + pjsua_conf_disconnect (0, 0); + break; + + case 'm': + + if (g_call_id != PJSUA_INVALID_ID) { + PJ_LOG (3, (THIS_FILE, "Another call is active")); + break; + } + + if (pjsua_verify_sip_url (SIP_DST_URI) == PJ_SUCCESS) { + pj_str_t dst = pj_str (SIP_DST_URI); + pjsua_call_make_call (g_acc_id, &dst, 0, NULL, + NULL, &g_call_id); + } else { + PJ_LOG (3, (THIS_FILE, "Invalid SIP URI")); + } + + break; + + case 'a': + + if (g_call_id != PJSUA_INVALID_ID) + pjsua_call_answer (g_call_id, 200, NULL, NULL); + + break; + + case 'g': + pjsua_call_hangup_all(); + + break; + + case 's': + + case 'S': + if (g_buddy_id != PJSUA_INVALID_ID) + pjsua_buddy_subscribe_pres (g_buddy_id, kc=='s'); + + break; + + case 'o': + + case 'O': + pjsua_acc_set_online_status (g_acc_id, kc=='o'); + + break; + + default: + PJ_LOG (3, (THIS_FILE, "Keycode '%c' (%d) is pressed", + kc, kc)); + + break; + } + + PrintMenu(); + + if (reschedule) + Run(); +} + +#if 0 +// IP networking related testing +static pj_status_t test_addr (void) +{ + int af; + unsigned i, count; + pj_addrinfo ai[8]; + pj_sockaddr ifs[8]; + const pj_str_t *hostname; + pj_hostent he; + pj_status_t status; + + pj_log_set_log_func (&log_writer); + + status = pj_init(); + + if (status != PJ_SUCCESS) { + pjsua_perror (THIS_FILE, "pj_init() error", status); + return status; + } + + af = pj_AF_INET(); + +#if 0 + pj_in_addr in_addr; + pj_str_t aa = pj_str ("1.1.1.1"); + in_addr = pj_inet_addr (&aa); + char *the_addr = pj_inet_ntoa (in_addr); + PJ_LOG (3, (THIS_FILE, "IP addr=%s", the_addr)); + + aa = pj_str ("192.168.0.15"); + in_addr = pj_inet_addr (&aa); + the_addr = pj_inet_ntoa (in_addr); + PJ_LOG (3, (THIS_FILE, "IP addr=%s", the_addr)); + + aa = pj_str ("2.2.2.2"); + in_addr = pj_inet_addr (&aa); + the_addr = pj_inet_ntoa (in_addr); + PJ_LOG (3, (THIS_FILE, "IP addr=%s", the_addr)); + + return -1; +#endif + + // Hostname + hostname = pj_gethostname(); + + if (hostname == NULL) { + status = PJ_ERESOLVE; + pjsua_perror (THIS_FILE, "pj_gethostname() error", status); + goto on_return; + } + + PJ_LOG (3, (THIS_FILE, "Hostname: %.*s", hostname->slen, hostname->ptr)); + + // Gethostbyname + status = pj_gethostbyname (hostname, &he); + + if (status != PJ_SUCCESS) { + pjsua_perror (THIS_FILE, "pj_gethostbyname() error", status); + } else { + PJ_LOG (3, (THIS_FILE, "gethostbyname: %s", + pj_inet_ntoa (* (pj_in_addr*) he.h_addr))); + } + + // Getaddrinfo + count = PJ_ARRAY_SIZE (ai); + + status = pj_getaddrinfo (af, hostname, &count, ai); + + if (status != PJ_SUCCESS) { + pjsua_perror (THIS_FILE, "pj_getaddrinfo() error", status); + } else { + for (i=0; i<count; ++i) { + char ipaddr[PJ_INET6_ADDRSTRLEN+2]; + PJ_LOG (3, (THIS_FILE, "Addrinfo: %s", + pj_sockaddr_print (&ai[i].ai_addr, ipaddr, sizeof (ipaddr), 2))); + } + } + + // Enum interface + count = PJ_ARRAY_SIZE (ifs); + + status = pj_enum_ip_interface (af, &count, ifs); + + if (status != PJ_SUCCESS) { + pjsua_perror (THIS_FILE, "pj_enum_ip_interface() error", status); + } else { + for (i=0; i<count; ++i) { + char ipaddr[PJ_INET6_ADDRSTRLEN+2]; + PJ_LOG (3, (THIS_FILE, "Interface: %s", + pj_sockaddr_print (&ifs[i], ipaddr, sizeof (ipaddr), 2))); + } + } + + // Get default iinterface + status = pj_getdefaultipinterface (af, &ifs[0]); + + if (status != PJ_SUCCESS) { + pjsua_perror (THIS_FILE, "pj_getdefaultipinterface() error", status); + } else { + char ipaddr[PJ_INET6_ADDRSTRLEN+2]; + PJ_LOG (3, (THIS_FILE, "Default IP: %s", + pj_sockaddr_print (&ifs[0], ipaddr, sizeof (ipaddr), 2))); + } + + // Get default IP address + status = pj_gethostip (af, &ifs[0]); + + if (status != PJ_SUCCESS) { + pjsua_perror (THIS_FILE, "pj_gethostip() error", status); + } else { + char ipaddr[PJ_INET6_ADDRSTRLEN+2]; + PJ_LOG (3, (THIS_FILE, "Host IP: %s", + pj_sockaddr_print (&ifs[0], ipaddr, sizeof (ipaddr), 2))); + } + + status = -1; + +on_return: + pj_shutdown(); + return status; +} + +#endif + + +#include <es_sock.h> + +#if 0 +// Force network connection to use the first IAP, +// this is useful for debugging on emulator without GUI. +// Include commdb.lib & apengine.lib in symbian_ua.mmp file +// if this is enabled. + +#include <apdatahandler.h> + +inline void ForceUseFirstIAP() +{ + TUint32 rank = 1; + TUint32 bearers; + TUint32 prompt; + TUint32 iap; + + CCommsDatabase* commDb = CCommsDatabase::NewL (EDatabaseTypeIAP); + CleanupStack::PushL (commDb); + + CApDataHandler* apDataHandler = CApDataHandler::NewLC (*commDb); + + TCommDbConnectionDirection direction = ECommDbConnectionDirectionOutgoing; + apDataHandler->GetPreferredIfDbIapTypeL (rank, direction, bearers, prompt, iap); + prompt = ECommDbDialogPrefDoNotPrompt; + apDataHandler->SetPreferredIfDbIapTypeL (rank, direction, bearers, (TCommDbDialogPref) prompt, iap, ETrue); + CleanupStack::PopAndDestroy (2); // apDataHandler, commDb +} + +static void SelectIAP() +{ + ForceUseFirstIAP(); +} + +#else + +static void SelectIAP() +{ +} + +#endif + + +// Class CConnMon to monitor network connection (RConnection). Whenever +// the connection is down, it will notify PJLIB and restart PJSUA-LIB. + +class CConnMon : public CActive +{ + + public: + static CConnMon* NewL (RConnection &conn, RSocketServ &sserver) { + CConnMon *self = new (ELeave) CConnMon (conn, sserver); + CleanupStack::PushL (self); + self->ConstructL(); + CleanupStack::Pop (self); + return self; + } + + void Start() { + conn_.ProgressNotification (nif_progress_, iStatus); + SetActive(); + } + + void Stop() { + Cancel(); + } + + ~CConnMon() { + Stop(); + } + + private: + CConnMon (RConnection &conn, RSocketServ &sserver) : + CActive (EPriorityHigh), + conn_ (conn), + sserver_ (sserver) { + CActiveScheduler::Add (this); + } + + void ConstructL() {} + + void DoCancel() { + conn_.CancelProgressNotification(); + } + + void RunL() { + int stage = nif_progress_().iStage; + + if (stage == KLinkLayerClosed) { + pj_status_t status; + TInt err; + + // Tell pjlib that connection is down. + pj_symbianos_set_connection_status (PJ_FALSE); + + PJ_LOG (3, (THIS_FILE, "RConnection closed, restarting PJSUA..")); + + // Destroy pjsua + pjsua_destroy(); + PJ_LOG (3, (THIS_FILE, "PJSUA destroyed.")); + + // Reopen the connection + err = conn_.Open (sserver_); + + if (err == KErrNone) + err = conn_.Start(); + + if (err != KErrNone) { + CActiveScheduler::Stop(); + return; + } + + // Reinit Symbian OS param before pj_init() + pj_symbianos_params sym_params; + + pj_bzero (&sym_params, sizeof (sym_params)); + + sym_params.rsocketserv = &sserver_; + + sym_params.rconnection = &conn_; + + pj_symbianos_set_params (&sym_params); + + // Reinit pjsua + status = app_startup(); + + if (status != PJ_SUCCESS) { + pjsua_perror (THIS_FILE, "app_startup() error", status); + CActiveScheduler::Stop(); + return; + } + + PJ_LOG (3, (THIS_FILE, "PJSUA restarted.")); + + PrintMenu(); + } + + Start(); + } + + RConnection& conn_; + RSocketServ& sserver_; + TNifProgressBuf nif_progress_; +}; + +//////////////////////////////////////////////////////////////////////////// +int ua_main() +{ + RSocketServ aSocketServer; + RConnection aConn; + TInt err; + pj_symbianos_params sym_params; + pj_status_t status; + + SelectIAP(); + + // Initialize RSocketServ + + if ( (err=aSocketServer.Connect()) != KErrNone) + return PJ_STATUS_FROM_OS (err); + + // Open up a connection + if ( (err=aConn.Open (aSocketServer)) != KErrNone) { + aSocketServer.Close(); + return PJ_STATUS_FROM_OS (err); + } + + if ( (err=aConn.Start()) != KErrNone) { + aSocketServer.Close(); + return PJ_STATUS_FROM_OS (err); + } + + // Set Symbian OS parameters in pjlib. + // This must be done before pj_init() is called. + pj_bzero (&sym_params, sizeof (sym_params)); + + sym_params.rsocketserv = &aSocketServer; + + sym_params.rconnection = &aConn; + + pj_symbianos_set_params (&sym_params); + + // Initialize pjsua + status = app_startup(); + + //status = test_addr(); + if (status != PJ_SUCCESS) { + aConn.Close(); + aSocketServer.Close(); + return status; + } + + + // Run the UI + ConsoleUI *con = new ConsoleUI (console); + + con->Run(); + + PrintMenu(); + + // Init & start connection monitor + CConnMon *connmon = CConnMon::NewL (aConn, aSocketServer); + + connmon->Start(); + + CActiveScheduler::Start(); + + delete connmon; + + delete con; + + // Dump memory statistics + PJ_LOG (3, (THIS_FILE, "Max heap usage: %u.%03uMB", + pjsua_var.cp.peak_used_size / 1000000, + (pjsua_var.cp.peak_used_size % 1000000) /1000)); + + // check max stack usage +#if defined(PJ_OS_HAS_CHECK_STACK) && PJ_OS_HAS_CHECK_STACK!=0 + pj_thread_t* this_thread = pj_thread_this(); + + if (!this_thread) + return status; + + const char* max_stack_file; + + int max_stack_line; + + status = pj_thread_get_stack_info (this_thread, &max_stack_file, &max_stack_line); + + PJ_LOG (3, (THIS_FILE, "Max stack usage: %u at %s:%d", + pj_thread_get_stack_max_usage (this_thread), + max_stack_file, max_stack_line)); + +#endif + + // Shutdown pjsua + pjsua_destroy(); + + // Close connection and socket server + aConn.Close(); + + aSocketServer.Close(); + + return status; +} + diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua/ua.h b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua/ua.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua/ua.h rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua/ua.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua_gui/application.uidesign b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/application.uidesign similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua_gui/application.uidesign rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/application.uidesign diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua_gui/data/symbian_ua_gui.l01 b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/data/symbian_ua_gui.l01 similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua_gui/data/symbian_ua_gui.l01 rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/data/symbian_ua_gui.l01 diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua_gui/data/symbian_ua_gui.loc b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/data/symbian_ua_gui.loc similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua_gui/data/symbian_ua_gui.loc rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/data/symbian_ua_gui.loc diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua_gui/data/symbian_ua_gui.rss b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/data/symbian_ua_gui.rss similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua_gui/data/symbian_ua_gui.rss rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/data/symbian_ua_gui.rss diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua_gui/data/symbian_ua_guiContainer.l01 b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/data/symbian_ua_guiContainer.l01 similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua_gui/data/symbian_ua_guiContainer.l01 rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/data/symbian_ua_guiContainer.l01 diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua_gui/data/symbian_ua_guiContainer.loc b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/data/symbian_ua_guiContainer.loc similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua_gui/data/symbian_ua_guiContainer.loc rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/data/symbian_ua_guiContainer.loc diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua_gui/data/symbian_ua_guiContainer.rssi b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/data/symbian_ua_guiContainer.rssi similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua_gui/data/symbian_ua_guiContainer.rssi rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/data/symbian_ua_guiContainer.rssi diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua_gui/data/symbian_ua_guiSettingItemList.l01 b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/data/symbian_ua_guiSettingItemList.l01 similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua_gui/data/symbian_ua_guiSettingItemList.l01 rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/data/symbian_ua_guiSettingItemList.l01 diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua_gui/data/symbian_ua_guiSettingItemList.loc b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/data/symbian_ua_guiSettingItemList.loc similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua_gui/data/symbian_ua_guiSettingItemList.loc rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/data/symbian_ua_guiSettingItemList.loc diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua_gui/data/symbian_ua_guiSettingItemList.rssi b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/data/symbian_ua_guiSettingItemList.rssi similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua_gui/data/symbian_ua_guiSettingItemList.rssi rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/data/symbian_ua_guiSettingItemList.rssi diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua_gui/data/symbian_ua_gui_reg.loc b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/data/symbian_ua_gui_reg.loc similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua_gui/data/symbian_ua_gui_reg.loc rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/data/symbian_ua_gui_reg.loc diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua_gui/data/symbian_ua_gui_reg.rss b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/data/symbian_ua_gui_reg.rss similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua_gui/data/symbian_ua_gui_reg.rss rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/data/symbian_ua_gui_reg.rss diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua_gui/gfx/list_icon.bmp b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/gfx/list_icon.bmp similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua_gui/gfx/list_icon.bmp rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/gfx/list_icon.bmp diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua_gui/gfx/list_icon_mask.bmp b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/gfx/list_icon_mask.bmp similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua_gui/gfx/list_icon_mask.bmp rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/gfx/list_icon_mask.bmp diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua_gui/gfx/mark_icon.bmp b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/gfx/mark_icon.bmp similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua_gui/gfx/mark_icon.bmp rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/gfx/mark_icon.bmp diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua_gui/gfx/mark_icon_mask.bmp b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/gfx/mark_icon_mask.bmp similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua_gui/gfx/mark_icon_mask.bmp rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/gfx/mark_icon_mask.bmp diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua_gui/gfx/qgn_menu_symbian_ua_gui.svg b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/gfx/qgn_menu_symbian_ua_gui.svg similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua_gui/gfx/qgn_menu_symbian_ua_gui.svg rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/gfx/qgn_menu_symbian_ua_gui.svg diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua_gui/group/ABLD.BAT b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/group/ABLD.BAT similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua_gui/group/ABLD.BAT rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/group/ABLD.BAT diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua_gui/group/Icons_aif_scalable_dc.mk b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/group/Icons_aif_scalable_dc.mk similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua_gui/group/Icons_aif_scalable_dc.mk rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/group/Icons_aif_scalable_dc.mk diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua_gui/group/bld.inf b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/group/bld.inf similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua_gui/group/bld.inf rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/group/bld.inf diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua_gui/group/symbian_ua_gui.mmp b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/group/symbian_ua_gui.mmp similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua_gui/group/symbian_ua_gui.mmp rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/group/symbian_ua_gui.mmp diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua_gui/inc/Symbian_ua_guiSettingItemListSettings.h b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/inc/Symbian_ua_guiSettingItemListSettings.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua_gui/inc/Symbian_ua_guiSettingItemListSettings.h rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/inc/Symbian_ua_guiSettingItemListSettings.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua.h b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua.h rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_gui.hrh b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_gui.hrh similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_gui.hrh rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_gui.hrh diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_gui.pan b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_gui.pan similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_gui.pan rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_gui.pan diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_guiAppUi.h b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_guiAppUi.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_guiAppUi.h rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_guiAppUi.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_guiApplication.h b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_guiApplication.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_guiApplication.h rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_guiApplication.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_guiContainer.h b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_guiContainer.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_guiContainer.h rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_guiContainer.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_guiContainer.hrh b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_guiContainer.hrh similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_guiContainer.hrh rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_guiContainer.hrh diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_guiContainerView.h b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_guiContainerView.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_guiContainerView.h rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_guiContainerView.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_guiDocument.h b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_guiDocument.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_guiDocument.h rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_guiDocument.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_guiSettingItemList.h b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_guiSettingItemList.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_guiSettingItemList.h rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_guiSettingItemList.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_guiSettingItemList.hrh b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_guiSettingItemList.hrh similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_guiSettingItemList.hrh rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_guiSettingItemList.hrh diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_guiSettingItemListView.h b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_guiSettingItemListView.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_guiSettingItemListView.h rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_guiSettingItemListView.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua_gui/sis/symbian_ua_gui.pkg b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/sis/symbian_ua_gui.pkg similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua_gui/sis/symbian_ua_gui.pkg rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/sis/symbian_ua_gui.pkg diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua_gui/sis/symbian_ua_gui.txt b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/sis/symbian_ua_gui.txt similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua_gui/sis/symbian_ua_gui.txt rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/sis/symbian_ua_gui.txt diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/src/Symbian_ua_guiSettingItemListSets.cpp b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/src/Symbian_ua_guiSettingItemListSets.cpp new file mode 100644 index 0000000000000000000000000000000000000000..69d842c37df7062f36df385435f9c5b97caf0431 --- /dev/null +++ b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/src/Symbian_ua_guiSettingItemListSets.cpp @@ -0,0 +1,147 @@ +/* +======================================================================== + Name : Symbian_ua_guiSettingItemListSettings.cpp + Author : nanang + Copyright : (c) 2008-2009 Teluu Inc. + Description : +======================================================================== +*/ +/** + * Generated helper class which manages the settings contained + * in 'symbian_ua_guiSettingItemList'. Each CAknSettingItem maintains + * a reference to data in this class so that changes in the setting + * item list can be synchronized with this storage. + */ + +// [[[ begin generated region: do not modify [Generated Includes] +#include <e32base.h> +#include <stringloader.h> +#include <barsread.h> +#include <symbian_ua_gui.rsg> +#include "Symbian_ua_guiSettingItemListSettings.h" +// ]]] end generated region [Generated Includes] + +/** + * C/C++ constructor for settings data, cannot throw + */ +TSymbian_ua_guiSettingItemListSettings::TSymbian_ua_guiSettingItemListSettings() +{ +} + +/** + * Two-phase constructor for settings data + */ +TSymbian_ua_guiSettingItemListSettings* TSymbian_ua_guiSettingItemListSettings::NewL() +{ + TSymbian_ua_guiSettingItemListSettings* data = new (ELeave) TSymbian_ua_guiSettingItemListSettings; + CleanupStack::PushL (data); + data->ConstructL(); + CleanupStack::Pop (data); + return data; +} + +/** + * Second phase for initializing settings data + */ +void TSymbian_ua_guiSettingItemListSettings::ConstructL() +{ + // [[[ begin generated region: do not modify [Generated Initializers] + { + HBufC* text = StringLoader::LoadLC (R_SYMBIAN_UA_GUI_SETTING_ITEM_LIST_ED_REGISTRAR); + SetEd_registrar (text->Des()); + CleanupStack::PopAndDestroy (text); + } + + { + HBufC* text = StringLoader::LoadLC (R_SYMBIAN_UA_GUI_SETTING_ITEM_LIST_ED_USER); + SetEd_user (text->Des()); + CleanupStack::PopAndDestroy (text); + } + + SetB_srtp (0); + SetB_ice (0); + { + HBufC* text = StringLoader::LoadLC (R_SYMBIAN_UA_GUI_SETTING_ITEM_LIST_ED_STUN_SERVER); + SetEd_stun_server (text->Des()); + CleanupStack::PopAndDestroy (text); + } + + // ]]] end generated region [Generated Initializers] + +} + +// [[[ begin generated region: do not modify [Generated Contents] +TDes& TSymbian_ua_guiSettingItemListSettings::Ed_registrar() +{ + return iEd_registrar; +} + +void TSymbian_ua_guiSettingItemListSettings::SetEd_registrar (const TDesC& aValue) +{ + if (aValue.Length() < KEd_registrarMaxLength) + iEd_registrar.Copy (aValue); + else + iEd_registrar.Copy (aValue.Ptr(), KEd_registrarMaxLength); +} + +TDes& TSymbian_ua_guiSettingItemListSettings::Ed_user() +{ + return iEd_user; +} + +void TSymbian_ua_guiSettingItemListSettings::SetEd_user (const TDesC& aValue) +{ + if (aValue.Length() < KEd_userMaxLength) + iEd_user.Copy (aValue); + else + iEd_user.Copy (aValue.Ptr(), KEd_userMaxLength); +} + +TDes& TSymbian_ua_guiSettingItemListSettings::Ed_password() +{ + return iEd_password; +} + +void TSymbian_ua_guiSettingItemListSettings::SetEd_password (const TDesC& aValue) +{ + if (aValue.Length() < KEd_passwordMaxLength) + iEd_password.Copy (aValue); + else + iEd_password.Copy (aValue.Ptr(), KEd_passwordMaxLength); +} + +TBool& TSymbian_ua_guiSettingItemListSettings::B_srtp() +{ + return iB_srtp; +} + +void TSymbian_ua_guiSettingItemListSettings::SetB_srtp (const TBool& aValue) +{ + iB_srtp = aValue; +} + +TBool& TSymbian_ua_guiSettingItemListSettings::B_ice() +{ + return iB_ice; +} + +void TSymbian_ua_guiSettingItemListSettings::SetB_ice (const TBool& aValue) +{ + iB_ice = aValue; +} + +TDes& TSymbian_ua_guiSettingItemListSettings::Ed_stun_server() +{ + return iEd_stun_server; +} + +void TSymbian_ua_guiSettingItemListSettings::SetEd_stun_server (const TDesC& aValue) +{ + if (aValue.Length() < KEd_stun_serverMaxLength) + iEd_stun_server.Copy (aValue); + else + iEd_stun_server.Copy (aValue.Ptr(), KEd_stun_serverMaxLength); +} + +// ]]] end generated region [Generated Contents] + diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/src/symbian_ua.cpp b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/src/symbian_ua.cpp new file mode 100644 index 0000000000000000000000000000000000000000..1e56a4f9fe5f534dd8c26789f89c068b324c340b --- /dev/null +++ b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/src/symbian_ua.cpp @@ -0,0 +1,564 @@ +/* $Id: ua.cpp 1793 2008-02-14 13:39:24Z bennylp $ */ +/* + * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) + * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> + * + * 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 + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#include <pjsua-lib/pjsua.h> +#include <pjsua-lib/pjsua_internal.h> +#include <es_sock.h> +#include "symbian_ua.h" + +#define THIS_FILE "symbian_ua.cpp" +#define LOG_LEVEL 3 + +#define SIP_PORT 5060 +#define USE_ICE 0 +#define USE_SRTP PJSUA_DEFAULT_USE_SRTP + +static RSocketServ aSocketServer; +static RConnection aConn; + +static pjsua_acc_id g_acc_id = PJSUA_INVALID_ID; +static pjsua_call_id g_call_id = PJSUA_INVALID_ID; +static pjsua_buddy_id g_buddy_id = PJSUA_INVALID_ID; + +static symbian_ua_info_cb_t g_cb = {NULL, NULL, NULL, NULL, NULL}; + +static void log_writer (int level, const char *buf, int len) +{ + static wchar_t buf16[PJ_LOG_MAX_SIZE]; + + PJ_UNUSED_ARG (level); + + if (!g_cb.on_info) + return; + + pj_ansi_to_unicode (buf, len, buf16, PJ_ARRAY_SIZE (buf16)); + + g_cb.on_info (buf16); +} + +static void on_reg_state (pjsua_acc_id acc_id) +{ + pjsua_acc_info acc_info; + pj_status_t status; + + status = pjsua_acc_get_info (acc_id, &acc_info); + + if (status != PJ_SUCCESS) + return; + + if (acc_info.status == 200) { + if (acc_info.expires) { + PJ_LOG (3, (THIS_FILE, "Registration success!")); + + if (g_cb.on_reg_state) g_cb.on_reg_state (true); + } else { + PJ_LOG (3, (THIS_FILE, "Unregistration success!")); + + if (g_cb.on_unreg_state) g_cb.on_unreg_state (true); + } + } else { + if (acc_info.expires) { + PJ_LOG (3, (THIS_FILE, "Registration failed!")); + + if (g_cb.on_reg_state) g_cb.on_reg_state (false); + } else { + PJ_LOG (3, (THIS_FILE, "Unregistration failed!")); + + if (g_cb.on_unreg_state) g_cb.on_unreg_state (false); + } + } +} + +/* Callback called by the library upon receiving incoming call */ +static void on_incoming_call (pjsua_acc_id acc_id, pjsua_call_id call_id, + pjsip_rx_data *rdata) +{ + pjsua_call_info ci; + + PJ_UNUSED_ARG (acc_id); + PJ_UNUSED_ARG (rdata); + + if (g_call_id != PJSUA_INVALID_ID) { + pjsua_call_answer (call_id, PJSIP_SC_BUSY_HERE, NULL, NULL); + return; + } + + pjsua_call_get_info (call_id, &ci); + + PJ_LOG (3, (THIS_FILE, "Incoming call from %.*s!!", + (int) ci.remote_info.slen, + ci.remote_info.ptr)); + + g_call_id = call_id; + + /* Automatically answer incoming calls with 180/Ringing */ + pjsua_call_answer (call_id, 180, NULL, NULL); + + if (g_cb.on_incoming_call) { + static wchar_t disp[256]; + static wchar_t uri[PJSIP_MAX_URL_SIZE]; + + pj_ansi_to_unicode (ci.remote_info.ptr, ci.remote_info.slen, + disp, PJ_ARRAY_SIZE (disp)); + pj_ansi_to_unicode (ci.remote_contact.ptr, ci.remote_contact.slen, + uri, PJ_ARRAY_SIZE (uri)); + + g_cb.on_incoming_call (disp, uri); + } +} + +/* Callback called by the library when call's state has changed */ +static void on_call_state (pjsua_call_id call_id, pjsip_event *e) +{ + pjsua_call_info ci; + + PJ_UNUSED_ARG (e); + + pjsua_call_get_info (call_id, &ci); + + if (ci.state == PJSIP_INV_STATE_DISCONNECTED) { + if (call_id == g_call_id) + g_call_id = PJSUA_INVALID_ID; + + if (g_cb.on_call_end) { + static wchar_t reason[256]; + pj_ansi_to_unicode (ci.last_status_text.ptr, ci.last_status_text.slen, + reason, PJ_ARRAY_SIZE (reason)); + g_cb.on_call_end (reason); + } + + } else if (ci.state != PJSIP_INV_STATE_INCOMING) { + if (g_call_id == PJSUA_INVALID_ID) + g_call_id = call_id; + } + + PJ_LOG (3, (THIS_FILE, "Call %d state=%.*s", call_id, + + (int) ci.state_text.slen, + ci.state_text.ptr)); +} + +/* Callback called by the library when call's media state has changed */ +static void on_call_media_state (pjsua_call_id call_id) +{ + pjsua_call_info ci; + + pjsua_call_get_info (call_id, &ci); + + if (ci.media_status == PJSUA_CALL_MEDIA_ACTIVE) { + // When media is active, connect call to sound device. + pjsua_conf_connect (ci.conf_slot, 0); + pjsua_conf_connect (0, ci.conf_slot); + } +} + + +/* Handler on buddy state changed. */ +static void on_buddy_state (pjsua_buddy_id buddy_id) +{ + pjsua_buddy_info info; + pjsua_buddy_get_info (buddy_id, &info); + + PJ_LOG (3, (THIS_FILE, "%.*s status is %.*s", + (int) info.uri.slen, + info.uri.ptr, + (int) info.status_text.slen, + info.status_text.ptr)); +} + + +/* Incoming IM message (i.e. MESSAGE request)! */ +static void on_pager (pjsua_call_id call_id, const pj_str_t *from, + const pj_str_t *to, const pj_str_t *contact, + const pj_str_t *mime_type, const pj_str_t *text) +{ + /* Note: call index may be -1 */ + PJ_UNUSED_ARG (call_id); + PJ_UNUSED_ARG (to); + PJ_UNUSED_ARG (contact); + PJ_UNUSED_ARG (mime_type); + + PJ_LOG (3, (THIS_FILE,"MESSAGE from %.*s: %.*s", + (int) from->slen, from->ptr, + (int) text->slen, text->ptr)); +} + + +/* Received typing indication */ +static void on_typing (pjsua_call_id call_id, const pj_str_t *from, + const pj_str_t *to, const pj_str_t *contact, + pj_bool_t is_typing) +{ + PJ_UNUSED_ARG (call_id); + PJ_UNUSED_ARG (to); + PJ_UNUSED_ARG (contact); + + PJ_LOG (3, (THIS_FILE, "IM indication: %.*s %s", + (int) from->slen, from->ptr, + (is_typing?"is typing..":"has stopped typing"))); +} + + +/* Call transfer request status. */ +static void on_call_transfer_status (pjsua_call_id call_id, + int status_code, + const pj_str_t *status_text, + pj_bool_t final, + pj_bool_t *p_cont) +{ + PJ_LOG (3, (THIS_FILE, "Call %d: transfer status=%d (%.*s) %s", + call_id, status_code, + (int) status_text->slen, status_text->ptr, + (final ? "[final]" : ""))); + + if (status_code/100 == 2) { + PJ_LOG (3, (THIS_FILE, + "Call %d: call transfered successfully, disconnecting call", + call_id)); + pjsua_call_hangup (call_id, PJSIP_SC_GONE, NULL, NULL); + *p_cont = PJ_FALSE; + } +} + + +/* NAT detection result */ +static void on_nat_detect (const pj_stun_nat_detect_result *res) +{ + if (res->status != PJ_SUCCESS) { + pjsua_perror (THIS_FILE, "NAT detection failed", res->status); + } else { + PJ_LOG (3, (THIS_FILE, "NAT detected as %s", res->nat_type_name)); + } +} + +/* Notification that call is being replaced. */ +static void on_call_replaced (pjsua_call_id old_call_id, + pjsua_call_id new_call_id) +{ + pjsua_call_info old_ci, new_ci; + + pjsua_call_get_info (old_call_id, &old_ci); + pjsua_call_get_info (new_call_id, &new_ci); + + PJ_LOG (3, (THIS_FILE, "Call %d with %.*s is being replaced by " + "call %d with %.*s", + old_call_id, + (int) old_ci.remote_info.slen, old_ci.remote_info.ptr, + new_call_id, + (int) new_ci.remote_info.slen, new_ci.remote_info.ptr)); +} + +int symbian_ua_init() +{ + TInt err; + pj_symbianos_params sym_params; + pj_status_t status; + + // Initialize RSocketServ + + if ( (err=aSocketServer.Connect()) != KErrNone) + return PJ_STATUS_FROM_OS (err); + + // Open up a connection + if ( (err=aConn.Open (aSocketServer)) != KErrNone) { + aSocketServer.Close(); + return PJ_STATUS_FROM_OS (err); + } + + if ( (err=aConn.Start()) != KErrNone) { + aConn.Close(); + aSocketServer.Close(); + return PJ_STATUS_FROM_OS (err); + } + + // Set Symbian OS parameters in pjlib. + // This must be done before pj_init() is called. + pj_bzero (&sym_params, sizeof (sym_params)); + + sym_params.rsocketserv = &aSocketServer; + + sym_params.rconnection = &aConn; + + pj_symbianos_set_params (&sym_params); + + /* Redirect log before pjsua_init() */ + pj_log_set_log_func (&log_writer); + + /* Set log level */ + pj_log_set_level (LOG_LEVEL); + + /* Create pjsua first! */ + status = pjsua_create(); + + if (status != PJ_SUCCESS) { + pjsua_perror (THIS_FILE, "pjsua_create() error", status); + return status; + } + + /* Init pjsua */ + pjsua_config cfg; + + pjsua_config_default (&cfg); + + cfg.max_calls = 2; + + cfg.thread_cnt = 0; // Disable threading on Symbian + + cfg.use_srtp = USE_SRTP; + + cfg.srtp_secure_signaling = 0; + + cfg.cb.on_incoming_call = &on_incoming_call; + + cfg.cb.on_call_media_state = &on_call_media_state; + + cfg.cb.on_call_state = &on_call_state; + + cfg.cb.on_buddy_state = &on_buddy_state; + + cfg.cb.on_pager = &on_pager; + + cfg.cb.on_typing = &on_typing; + + cfg.cb.on_call_transfer_status = &on_call_transfer_status; + + cfg.cb.on_call_replaced = &on_call_replaced; + + cfg.cb.on_nat_detect = &on_nat_detect; + + cfg.cb.on_reg_state = &on_reg_state; + + pjsua_media_config med_cfg; + + pjsua_media_config_default (&med_cfg); + + med_cfg.thread_cnt = 0; // Disable threading on Symbian + + med_cfg.has_ioqueue = PJ_FALSE; + + med_cfg.clock_rate = 8000; + +#if defined(PJMEDIA_SYM_SND_USE_APS) && (PJMEDIA_SYM_SND_USE_APS==1) + med_cfg.audio_frame_ptime = 20; + +#else + med_cfg.audio_frame_ptime = 40; + +#endif + med_cfg.ec_tail_len = 0; + + med_cfg.enable_ice = USE_ICE; + + med_cfg.snd_auto_close_time = 5; // wait for 5 seconds idle before sound dev get auto-closed + + pjsua_logging_config log_cfg; + + pjsua_logging_config_default (&log_cfg); + + log_cfg.console_level = LOG_LEVEL; + + log_cfg.cb = &log_writer; + + log_cfg.decor = 0; + + status = pjsua_init (&cfg, &log_cfg, &med_cfg); + + if (status != PJ_SUCCESS) { + pjsua_perror (THIS_FILE, "pjsua_init() error", status); + pjsua_destroy(); + return status; + } + + /* Add UDP transport. */ + pjsua_transport_config tcfg; + + pjsua_transport_id tid; + + pjsua_transport_config_default (&tcfg); + + tcfg.port = SIP_PORT; + + status = pjsua_transport_create (PJSIP_TRANSPORT_UDP, &tcfg, &tid); + + if (status != PJ_SUCCESS) { + pjsua_perror (THIS_FILE, "Error creating transport", status); + pjsua_destroy(); + return status; + } + + /* Add account for the transport */ + pjsua_acc_add_local (tid, PJ_TRUE, &g_acc_id); + + /* Initialization is done, now start pjsua */ + status = pjsua_start(); + + if (status != PJ_SUCCESS) { + pjsua_perror (THIS_FILE, "Error starting pjsua", status); + pjsua_destroy(); + return status; + } + + /* Adjust Speex priority and enable only the narrowband */ + { + pj_str_t codec_id = pj_str ("speex/8000"); + pjmedia_codec_mgr_set_codec_priority ( + pjmedia_endpt_get_codec_mgr (pjsua_var.med_endpt), + &codec_id, PJMEDIA_CODEC_PRIO_NORMAL+1); + + codec_id = pj_str ("speex/16000"); + pjmedia_codec_mgr_set_codec_priority ( + pjmedia_endpt_get_codec_mgr (pjsua_var.med_endpt), + &codec_id, PJMEDIA_CODEC_PRIO_DISABLED); + + codec_id = pj_str ("speex/32000"); + pjmedia_codec_mgr_set_codec_priority ( + pjmedia_endpt_get_codec_mgr (pjsua_var.med_endpt), + &codec_id, PJMEDIA_CODEC_PRIO_DISABLED); + } + + return PJ_SUCCESS; +} + + +int symbian_ua_destroy() +{ + // Shutdown pjsua + pjsua_destroy(); + + // Close connection and socket server + aConn.Close(); + aSocketServer.Close(); + + CloseSTDLIB(); + + return PJ_SUCCESS; +} + +void symbian_ua_set_info_callback (const symbian_ua_info_cb_t *cb) +{ + if (cb) + g_cb = *cb; + else + pj_bzero (&g_cb, sizeof (g_cb)); +} + +int symbian_ua_set_account (const char *domain, const char *username, + const char *password, + bool use_srtp, bool use_ice) +{ + pj_status_t status; + + PJ_ASSERT_RETURN (username && password && domain, PJ_EINVAL); + PJ_UNUSED_ARG (use_srtp); + PJ_UNUSED_ARG (use_ice); + + if (domain[0] == 0) { + pjsua_acc_info acc_info; + pj_status_t status; + + status = pjsua_acc_get_info (g_acc_id, &acc_info); + + if (status != PJ_SUCCESS) + return status; + + if (acc_info.status == 200) { + PJ_LOG (3, (THIS_FILE, "Unregistering..")); + pjsua_acc_set_registration (g_acc_id, PJ_FALSE); + g_acc_id = 0; + } + + return PJ_SUCCESS; + } + + if (pjsua_acc_get_count() > 1) { + status = pjsua_acc_del (g_acc_id); + + if (status != PJ_SUCCESS) { + pjsua_perror (THIS_FILE, "Error removing account", status); + return status; + } + + g_acc_id = 0; + } + + pjsua_acc_config cfg; + + char tmp_id[PJSIP_MAX_URL_SIZE]; + char tmp_reg_uri[PJSIP_MAX_URL_SIZE]; + + if (!pj_ansi_strnicmp (domain, "sip:", 4)) { + domain += 4; + } + + pjsua_acc_config_default (&cfg); + + pj_ansi_sprintf (tmp_id, "sip:%s@%s", username, domain); + cfg.id = pj_str (tmp_id); + pj_ansi_sprintf (tmp_reg_uri, "sip:%s", domain); + cfg.reg_uri = pj_str (tmp_reg_uri); + cfg.cred_count = 1; + cfg.cred_info[0].realm = pj_str ("*"); + cfg.cred_info[0].scheme = pj_str ("digest"); + cfg.cred_info[0].username = pj_str ( (char*) username); + cfg.cred_info[0].data_type = PJSIP_CRED_DATA_PLAIN_PASSWD; + cfg.cred_info[0].data = pj_str ( (char*) password); + + status = pjsua_acc_add (&cfg, PJ_TRUE, &g_acc_id); + + if (status != PJ_SUCCESS) { + pjsua_perror (THIS_FILE, "Error setting account", status); + pjsua_destroy(); + return status; + } + + return PJ_SUCCESS; +} + +int symbian_ua_makecall (const char* dest_url) +{ + if (pjsua_verify_sip_url (dest_url) == PJ_SUCCESS) { + pj_str_t dst = pj_str ( (char*) dest_url); + pjsua_call_make_call (g_acc_id, &dst, 0, NULL, + NULL, &g_call_id); + + return PJ_SUCCESS; + } + + return PJ_EINVAL; +} + +int symbian_ua_endcall() +{ + pjsua_call_hangup_all(); + + return PJ_SUCCESS; +} + +bool symbian_ua_anycall() +{ + return (pjsua_call_get_count() >0); +} + +int symbian_ua_answercall() +{ + PJ_ASSERT_RETURN (g_call_id != PJSUA_INVALID_ID, PJ_EINVAL); + + return pjsua_call_answer (g_call_id, 200, NULL, NULL); +} + diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiAppUi.cpp b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiAppUi.cpp new file mode 100644 index 0000000000000000000000000000000000000000..ab66bb27805fcce63c3a2a661ffca137f37d260c --- /dev/null +++ b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiAppUi.cpp @@ -0,0 +1,253 @@ +/* +======================================================================== + Name : symbian_ua_guiAppUi.cpp + Author : nanang + Copyright : (c) 2008-2009 Teluu Inc. + Description : +======================================================================== +*/ +// [[[ begin generated region: do not modify [Generated System Includes] +#include <eikmenub.h> +#include <akncontext.h> +#include <akntitle.h> +#include <symbian_ua_gui.rsg> +// ]]] end generated region [Generated System Includes] + +// [[[ begin generated region: do not modify [Generated User Includes] +#include "symbian_ua_guiAppUi.h" +#include "symbian_ua_gui.hrh" +#include "symbian_ua_guiContainer.hrh" +#include "symbian_ua_guiSettingItemList.hrh" +#include "symbian_ua_guiContainerView.h" +#include "symbian_ua_guiSettingItemListView.h" +// ]]] end generated region [Generated User Includes] + +// [[[ begin generated region: do not modify [Generated Constants] +// ]]] end generated region [Generated Constants] + +#include "symbian_ua.h" + +/** + * Construct the Csymbian_ua_guiAppUi instance + */ +Csymbian_ua_guiAppUi::Csymbian_ua_guiAppUi() : CTimer (0) +{ + // [[[ begin generated region: do not modify [Generated Contents] + // ]]] end generated region [Generated Contents] + +} + +/** + * The appui's destructor removes the container from the control + * stack and destroys it. + */ +Csymbian_ua_guiAppUi::~Csymbian_ua_guiAppUi() +{ + // [[[ begin generated region: do not modify [Generated Contents] + TRAPD (err_Dlg_wait_init, RemoveDlg_wait_initL()); + // ]]] end generated region [Generated Contents] +} + +// [[[ begin generated function: do not modify +void Csymbian_ua_guiAppUi::InitializeContainersL() +{ + iSymbian_ua_guiContainerView = Csymbian_ua_guiContainerView::NewL(); + AddViewL (iSymbian_ua_guiContainerView); + iSymbian_ua_guiSettingItemListView = Csymbian_ua_guiSettingItemListView::NewL(); + AddViewL (iSymbian_ua_guiSettingItemListView); + SetDefaultViewL (*iSymbian_ua_guiSettingItemListView); +} + +// ]]] end generated function + +/** + * Handle a command for this appui (override) + * @param aCommand command id to be handled + */ +void Csymbian_ua_guiAppUi::HandleCommandL (TInt aCommand) +{ + // [[[ begin generated region: do not modify [Generated Code] + TBool commandHandled = EFalse; + + switch (aCommand) { // code to dispatch to the AppUi's menu and CBA commands is generated here + + default: + break; + } + + + if (!commandHandled) { + if (aCommand == EAknSoftkeyExit || aCommand == EEikCmdExit) { + symbian_ua_destroy(); + Exit(); + } + } + + // ]]] end generated region [Generated Code] + +} + +/** + * Override of the HandleResourceChangeL virtual function + */ +void Csymbian_ua_guiAppUi::HandleResourceChangeL (TInt aType) +{ + CAknViewAppUi::HandleResourceChangeL (aType); + // [[[ begin generated region: do not modify [Generated Code] + // ]]] end generated region [Generated Code] + +} + +/** + * Override of the HandleKeyEventL virtual function + * @return EKeyWasConsumed if event was handled, EKeyWasNotConsumed if not + * @param aKeyEvent + * @param aType + */ +TKeyResponse Csymbian_ua_guiAppUi::HandleKeyEventL ( + const TKeyEvent& aKeyEvent, + TEventCode aType) +{ + // The inherited HandleKeyEventL is private and cannot be called + // [[[ begin generated region: do not modify [Generated Contents] + // ]]] end generated region [Generated Contents] + + return EKeyWasNotConsumed; +} + +/** + * Override of the HandleViewDeactivation virtual function + * + * @param aViewIdToBeDeactivated + * @param aNewlyActivatedViewId + */ +void Csymbian_ua_guiAppUi::HandleViewDeactivation ( + const TVwsViewId& aViewIdToBeDeactivated, + const TVwsViewId& aNewlyActivatedViewId) +{ + CAknViewAppUi::HandleViewDeactivation ( + aViewIdToBeDeactivated, + aNewlyActivatedViewId); + // [[[ begin generated region: do not modify [Generated Contents] + // ]]] end generated region [Generated Contents] + +} + +/** + * @brief Completes the second phase of Symbian object construction. + * Put initialization code that could leave here. + */ +void Csymbian_ua_guiAppUi::ConstructL() +{ + // [[[ begin generated region: do not modify [Generated Contents] + BaseConstructL (EAknEnableSkin); + InitializeContainersL(); + // ]]] end generated region [Generated Contents] + + // Create private folder + RProcess process; + TFileName path; + + path.Copy (process.FileName().Left (2)); + + if (path.Compare (_L ("c")) || path.Compare (_L ("C"))) + CEikonEnv::Static()->FsSession().CreatePrivatePath (EDriveC); + else if (path.Compare (_L ("e")) || path.Compare (_L ("E"))) + CEikonEnv::Static()->FsSession().CreatePrivatePath (EDriveE); + + // Init PJSUA + if (symbian_ua_init() != 0) { + symbian_ua_destroy(); + Exit(); + } + + ExecuteDlg_wait_initLD(); + + CTimer::ConstructL(); + CActiveScheduler::Add (this); + After (4000000); +} + +/** + * Override of the HandleApplicationSpecificEventL virtual function + */ +void Csymbian_ua_guiAppUi::HandleApplicationSpecificEventL ( + TInt aType, + const TWsEvent& anEvent) +{ + CAknViewAppUi::HandleApplicationSpecificEventL (aType, anEvent); + // [[[ begin generated region: do not modify [Generated Code] + // ]]] end generated region [Generated Code] + +} + +/** + * Handle the applicationSpecificEvent event. + */ +void Csymbian_ua_guiAppUi::HandleSymbian_ua_guiAppUiApplicationSpecificEventL ( + TInt /* aType */, + const TWsEvent& /* anEvent */) +{ + // TODO: implement applicationSpecificEvent event handler +} + +// [[[ begin generated function: do not modify +/** + * Execute the wait dialog for dlg_wait_init. This routine returns + * while the dialog is showing. It will be closed and destroyed when + * RemoveDlg_wait_initL() or the user selects the Cancel soft key. + * @param aOverrideText optional override text. When null the text configured + * in the UI Designer is used. + */ +void Csymbian_ua_guiAppUi::ExecuteDlg_wait_initLD (const TDesC* aOverrideText) +{ + iDlg_wait_init = new (ELeave) CAknWaitDialog ( + reinterpret_cast< CEikDialog** > (&iDlg_wait_init), EFalse); + + if (aOverrideText != NULL) { + iDlg_wait_init->SetTextL (*aOverrideText); + } + + iDlg_wait_init->ExecuteLD (R_APPLICATION_DLG_WAIT_INIT); + + iDlg_wait_initCallback = new (ELeave) CProgressDialogCallback ( + this, iDlg_wait_init, &Csymbian_ua_guiAppUi::HandleDlg_wait_initCanceledL); + iDlg_wait_init->SetCallback (iDlg_wait_initCallback); +} + +// ]]] end generated function + +// [[[ begin generated function: do not modify +/** + * Close and dispose of the wait dialog for dlg_wait_init + */ +void Csymbian_ua_guiAppUi::RemoveDlg_wait_initL() +{ + if (iDlg_wait_init != NULL) { + iDlg_wait_init->SetCallback (NULL); + iDlg_wait_init->ProcessFinishedL(); // deletes the dialog + iDlg_wait_init = NULL; + } + + delete iDlg_wait_initCallback; + + iDlg_wait_initCallback = NULL; + +} + +// ]]] end generated function + +/** + * Handle the canceled event. + */ +void Csymbian_ua_guiAppUi::HandleDlg_wait_initCanceledL (CAknProgressDialog* /* aDialog */) +{ + // TODO: implement canceled event handler + +} + +void Csymbian_ua_guiAppUi::RunL() +{ + RemoveDlg_wait_initL(); + iSymbian_ua_guiSettingItemListView->HandleCommandL (EAknSoftkeySave); +} diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiApplication.cpp b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiApplication.cpp similarity index 78% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiApplication.cpp rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiApplication.cpp index dc60fecd64d1cab99afdbb61aa15b9f49921935b..d32c672d6c7e08becc4bab7c0a2fe005a0d5948a 100644 --- a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiApplication.cpp +++ b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiApplication.cpp @@ -3,7 +3,7 @@ Name : symbian_ua_guiApplication.cpp Author : nanang Copyright : (c) 2008-2009 Teluu Inc. - Description : + Description : ======================================================================== */ // [[[ begin generated region: do not modify [Generated System Includes] @@ -19,50 +19,50 @@ // Needed by APS -TPtrC APP_UID = _L("EBD12EE4"); +TPtrC APP_UID = _L ("EBD12EE4"); /** * @brief Returns the application's UID (override from CApaApplication::AppDllUid()) * @return UID for this application (KUidsymbian_ua_guiApplication) */ TUid Csymbian_ua_guiApplication::AppDllUid() const - { - return KUidsymbian_ua_guiApplication; - } +{ + return KUidsymbian_ua_guiApplication; +} /** * @brief Creates the application's document (override from CApaApplication::CreateDocumentL()) * @return Pointer to the created document object (Csymbian_ua_guiDocument) */ CApaDocument* Csymbian_ua_guiApplication::CreateDocumentL() - { - return Csymbian_ua_guiDocument::NewL( *this ); - } +{ + return Csymbian_ua_guiDocument::NewL (*this); +} #ifdef EKA2 /** * @brief Called by the application framework to construct the application object * @return The application (Csymbian_ua_guiApplication) - */ + */ LOCAL_C CApaApplication* NewApplication() - { - return new Csymbian_ua_guiApplication; - } +{ + return new Csymbian_ua_guiApplication; +} /** * @brief This standard export is the entry point for all Series 60 applications * @return error code - */ + */ GLDEF_C TInt E32Main() - { - TInt err; - - err = EikStart::RunApplication( NewApplication ); +{ + TInt err; + + err = EikStart::RunApplication (NewApplication); + + return err; +} - return err; - } - #else // Series 60 2.x main DLL program code /** @@ -70,17 +70,17 @@ GLDEF_C TInt E32Main() * @return The application (Csymbian_ua_guiApplication) */ EXPORT_C CApaApplication* NewApplication() - { - return new Csymbian_ua_guiApplication; - } +{ + return new Csymbian_ua_guiApplication; +} /** * @brief This standard export is the entry point for all Series 60 applications * @return error code */ -GLDEF_C TInt E32Dll(TDllReason /*reason*/) - { - return KErrNone; - } +GLDEF_C TInt E32Dll (TDllReason /*reason*/) +{ + return KErrNone; +} #endif // EKA2 diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiContainer.cpp b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiContainer.cpp new file mode 100644 index 0000000000000000000000000000000000000000..1ff6ff8bd9484cc2ed32a7d5af13a3deb486a0dd --- /dev/null +++ b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiContainer.cpp @@ -0,0 +1,294 @@ +/* +======================================================================== + Name : symbian_ua_guiContainer.cpp + Author : nanang + Copyright : (c) 2008-2009 Teluu Inc. + Description : +======================================================================== +*/ +// [[[ begin generated region: do not modify [Generated System Includes] +#include <barsread.h> +#include <stringloader.h> +#include <eiklabel.h> +#include <eikenv.h> +#include <gdi.h> +#include <eikedwin.h> +#include <aknviewappui.h> +#include <eikappui.h> +#include <symbian_ua_gui.rsg> +// ]]] end generated region [Generated System Includes] + +// [[[ begin generated region: do not modify [Generated User Includes] +#include "symbian_ua_guiContainer.h" +#include "symbian_ua_guiContainerView.h" +#include "symbian_ua_gui.hrh" +#include "symbian_ua_guiContainer.hrh" +#include "symbian_ua_guiSettingItemList.hrh" +// ]]] end generated region [Generated User Includes] + +// [[[ begin generated region: do not modify [Generated Constants] +// ]]] end generated region [Generated Constants] + +/** + * First phase of Symbian two-phase construction. Should not + * contain any code that could leave. + */ +CSymbian_ua_guiContainer::CSymbian_ua_guiContainer() +{ + // [[[ begin generated region: do not modify [Generated Contents] + iLabel1 = NULL; + iEd_url = NULL; + iEd_info = NULL; + // ]]] end generated region [Generated Contents] + +} + +/** + * Destroy child controls. + */ +CSymbian_ua_guiContainer::~CSymbian_ua_guiContainer() +{ + // [[[ begin generated region: do not modify [Generated Contents] + delete iLabel1; + iLabel1 = NULL; + delete iEd_url; + iEd_url = NULL; + delete iEd_info; + iEd_info = NULL; + // ]]] end generated region [Generated Contents] + +} + +/** + * Construct the control (first phase). + * Creates an instance and initializes it. + * Instance is not left on cleanup stack. + * @param aRect bounding rectangle + * @param aParent owning parent, or NULL + * @param aCommandObserver command observer + * @return initialized instance of CSymbian_ua_guiContainer + */ +CSymbian_ua_guiContainer* CSymbian_ua_guiContainer::NewL ( + const TRect& aRect, + const CCoeControl* aParent, + MEikCommandObserver* aCommandObserver) +{ + CSymbian_ua_guiContainer* self = CSymbian_ua_guiContainer::NewLC ( + aRect, + aParent, + aCommandObserver); + CleanupStack::Pop (self); + return self; +} + +/** + * Construct the control (first phase). + * Creates an instance and initializes it. + * Instance is left on cleanup stack. + * @param aRect The rectangle for this window + * @param aParent owning parent, or NULL + * @param aCommandObserver command observer + * @return new instance of CSymbian_ua_guiContainer + */ +CSymbian_ua_guiContainer* CSymbian_ua_guiContainer::NewLC ( + const TRect& aRect, + const CCoeControl* aParent, + MEikCommandObserver* aCommandObserver) +{ + CSymbian_ua_guiContainer* self = new (ELeave) CSymbian_ua_guiContainer(); + CleanupStack::PushL (self); + self->ConstructL (aRect, aParent, aCommandObserver); + return self; +} + +/** + * Construct the control (second phase). + * Creates a window to contain the controls and activates it. + * @param aRect bounding rectangle + * @param aCommandObserver command observer + * @param aParent owning parent, or NULL + */ +void CSymbian_ua_guiContainer::ConstructL ( + const TRect& aRect, + const CCoeControl* aParent, + MEikCommandObserver* aCommandObserver) +{ + if (aParent == NULL) { + CreateWindowL(); + } else { + SetContainerWindowL (*aParent); + } + + iFocusControl = NULL; + + iCommandObserver = aCommandObserver; + InitializeControlsL(); + SetRect (aRect); + ActivateL(); + // [[[ begin generated region: do not modify [Post-ActivateL initializations] + // ]]] end generated region [Post-ActivateL initializations] + +} + +/** +* Return the number of controls in the container (override) +* @return count +*/ +TInt CSymbian_ua_guiContainer::CountComponentControls() const +{ + return (int) ELastControl; +} + +/** +* Get the control with the given index (override) +* @param aIndex Control index [0...n) (limited by #CountComponentControls) +* @return Pointer to control +*/ +CCoeControl* CSymbian_ua_guiContainer::ComponentControl (TInt aIndex) const +{ + // [[[ begin generated region: do not modify [Generated Contents] + switch (aIndex) { + + case ELabel1: + return iLabel1; + + case EEd_url: + return iEd_url; + + case EEd_info: + return iEd_info; + } + + // ]]] end generated region [Generated Contents] + + // handle any user controls here... + + return NULL; +} + +/** + * Handle resizing of the container. This implementation will lay out + * full-sized controls like list boxes for any screen size, and will layout + * labels, editors, etc. to the size they were given in the UI designer. + * This code will need to be modified to adjust arbitrary controls to + * any screen size. + */ +void CSymbian_ua_guiContainer::SizeChanged() +{ + CCoeControl::SizeChanged(); + LayoutControls(); + // [[[ begin generated region: do not modify [Generated Contents] + + // ]]] end generated region [Generated Contents] + +} + +// [[[ begin generated function: do not modify +/** + * Layout components as specified in the UI Designer + */ +void CSymbian_ua_guiContainer::LayoutControls() +{ + iLabel1->SetExtent (TPoint (2, 23), TSize (32, 28)); + iEd_url->SetExtent (TPoint (49, 25), TSize (197, 28)); + iEd_info->SetExtent (TPoint (3, 78), TSize (235, 143)); +} + +// ]]] end generated function + +/** + * Handle key events. + */ +TKeyResponse CSymbian_ua_guiContainer::OfferKeyEventL ( + const TKeyEvent& aKeyEvent, + TEventCode aType) +{ + // [[[ begin generated region: do not modify [Generated Contents] + + // ]]] end generated region [Generated Contents] + + if (iFocusControl != NULL + && iFocusControl->OfferKeyEventL (aKeyEvent, aType) == EKeyWasConsumed) { + return EKeyWasConsumed; + } + + return CCoeControl::OfferKeyEventL (aKeyEvent, aType); +} + +// [[[ begin generated function: do not modify +/** + * Initialize each control upon creation. + */ +void CSymbian_ua_guiContainer::InitializeControlsL() +{ + iLabel1 = new (ELeave) CEikLabel; + iLabel1->SetContainerWindowL (*this); + { + TResourceReader reader; + iEikonEnv->CreateResourceReaderLC (reader, R_SYMBIAN_UA_GUI_CONTAINER_LABEL1); + iLabel1->ConstructFromResourceL (reader); + CleanupStack::PopAndDestroy(); // reader internal state + } + + iEd_url = new (ELeave) CEikEdwin; + iEd_url->SetContainerWindowL (*this); + { + TResourceReader reader; + iEikonEnv->CreateResourceReaderLC (reader, R_SYMBIAN_UA_GUI_CONTAINER_ED_URL); + iEd_url->ConstructFromResourceL (reader); + CleanupStack::PopAndDestroy(); // reader internal state + } + + { + HBufC* text = StringLoader::LoadLC (R_SYMBIAN_UA_GUI_CONTAINER_ED_URL_2); + iEd_url->SetTextL (text); + CleanupStack::PopAndDestroy (text); + } + + iEd_info = new (ELeave) CEikEdwin; + iEd_info->SetContainerWindowL (*this); + { + TResourceReader reader; + iEikonEnv->CreateResourceReaderLC (reader, R_SYMBIAN_UA_GUI_CONTAINER_ED_INFO); + iEd_info->ConstructFromResourceL (reader); + CleanupStack::PopAndDestroy(); // reader internal state + } + + { + HBufC* text = StringLoader::LoadLC (R_SYMBIAN_UA_GUI_CONTAINER_ED_INFO_2); + iEd_info->SetTextL (text); + CleanupStack::PopAndDestroy (text); + } + + iEd_url->SetFocus (ETrue); + iFocusControl = iEd_url; + +} + +// ]]] end generated function + +/** + * Handle global resource changes, such as scalable UI or skin events (override) + */ +void CSymbian_ua_guiContainer::HandleResourceChange (TInt aType) +{ + CCoeControl::HandleResourceChange (aType); + SetRect (iAvkonViewAppUi->View (TUid::Uid (ESymbian_ua_guiContainerViewId))->ClientRect()); + // [[[ begin generated region: do not modify [Generated Contents] + // ]]] end generated region [Generated Contents] + +} + +/** + * Draw container contents. + */ +void CSymbian_ua_guiContainer::Draw (const TRect& aRect) const +{ + // [[[ begin generated region: do not modify [Generated Contents] + CWindowGc& gc = SystemGc(); + gc.Clear (aRect); + + // ]]] end generated region [Generated Contents] + +} + diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiContainerView.cpp b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiContainerView.cpp new file mode 100644 index 0000000000000000000000000000000000000000..a01d8f353c10d8e10622026ad2c9fcb7c0ee9973 --- /dev/null +++ b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiContainerView.cpp @@ -0,0 +1,489 @@ +/* +======================================================================== + Name : symbian_ua_guiContainerView.cpp + Author : nanang + Copyright : (c) 2008-2009 Teluu Inc. + Description : +======================================================================== +*/ +// [[[ begin generated region: do not modify [Generated System Includes] +#include <aknviewappui.h> +#include <eikmenub.h> +#include <avkon.hrh> +#include <barsread.h> +#include <stringloader.h> +#include <eiklabel.h> +#include <eikenv.h> +#include <gdi.h> +#include <eikedwin.h> +#include <akncontext.h> +#include <akntitle.h> +#include <eikbtgpc.h> +#include <aknnotewrappers.h> +#include <aknquerydialog.h> +#include <symbian_ua_gui.rsg> +// ]]] end generated region [Generated System Includes] + +// [[[ begin generated region: do not modify [Generated User Includes] +#include "symbian_ua_gui.hrh" +#include "symbian_ua_guiContainerView.h" +#include "symbian_ua_guiContainer.hrh" +#include "symbian_ua_guiSettingItemList.hrh" +#include "symbian_ua_guiContainer.h" +// ]]] end generated region [Generated User Includes] + +#include <utf.h> +#include "symbian_ua.h" + +// [[[ begin generated region: do not modify [Generated Constants] +// ]]] end generated region [Generated Constants] + +Csymbian_ua_guiContainerView *myinstance = NULL; +_LIT (KStCall, "Call"); +_LIT (KStHangUp, "Hang Up"); + +void on_info (const wchar_t* buf) +{ + TPtrC aBuf ( (const TUint16*) buf); + + if (myinstance) + myinstance->PutMessage (aBuf); +} + +void on_incoming_call (const wchar_t* caller_disp, const wchar_t* caller_uri) +{ + TBuf<512> buf; + TPtrC aDisp ( (const TUint16*) caller_disp); + TPtrC aUri ( (const TUint16*) caller_uri); + _LIT (KFormat, "Incoming call from %S, accept?"); + + buf.Format (KFormat, &aDisp); + + if (Csymbian_ua_guiContainerView::RunQry_accept_callL (&buf) == EAknSoftkeyYes) { + CEikButtonGroupContainer* cba = CEikButtonGroupContainer::Current(); + + if (cba != NULL) { + TRAPD (result, cba->SetCommandL (ESymbian_ua_guiContainerViewControlPaneRightId, KStHangUp)); + cba->DrawDeferred(); + } + + symbian_ua_answercall(); + } else { + symbian_ua_endcall(); + } +} + +void on_call_end (const wchar_t* reason) +{ + TPtrC aReason ( (const TUint16*) reason); + + CEikButtonGroupContainer* cba = CEikButtonGroupContainer::Current(); + + if (cba != NULL) { + TRAPD (result, cba->SetCommandL (ESymbian_ua_guiContainerViewControlPaneRightId, KStCall)); + cba->DrawDeferred(); + } + + Csymbian_ua_guiContainerView::RunNote_infoL (&aReason); +} + +void on_reg_state (bool success) +{ + if (success) + Csymbian_ua_guiContainerView::RunNote_infoL(); + else + Csymbian_ua_guiContainerView::RunNote_warningL(); +} + +void on_unreg_state (bool success) +{ + TPtrC st_success (_L ("Unregistration Success!")); + TPtrC st_failed (_L ("Unregistration Failed!")); + + if (success) + Csymbian_ua_guiContainerView::RunNote_infoL (&st_success); + else + Csymbian_ua_guiContainerView::RunNote_warningL (&st_failed); +} + +void Csymbian_ua_guiContainerView::PutMessage (const TDesC &msg) +{ + if (!iSymbian_ua_guiContainer) + return; + + CEikEdwin *obj_info = (CEikEdwin*) iSymbian_ua_guiContainer->ComponentControl (iSymbian_ua_guiContainer->EEd_info); + + obj_info->SetTextL (&msg); + + obj_info->DrawDeferred(); +} + +/** + * First phase of Symbian two-phase construction. Should not contain any + * code that could leave. + */ +Csymbian_ua_guiContainerView::Csymbian_ua_guiContainerView() +{ + // [[[ begin generated region: do not modify [Generated Contents] + iSymbian_ua_guiContainer = NULL; + // ]]] end generated region [Generated Contents] + +} + +/** + * The view's destructor removes the container from the control + * stack and destroys it. + */ +Csymbian_ua_guiContainerView::~Csymbian_ua_guiContainerView() +{ + // [[[ begin generated region: do not modify [Generated Contents] + delete iSymbian_ua_guiContainer; + iSymbian_ua_guiContainer = NULL; + // ]]] end generated region [Generated Contents] + + symbian_ua_set_info_callback (NULL); + myinstance = NULL; +} + +/** + * Symbian two-phase constructor. + * This creates an instance then calls the second-phase constructor + * without leaving the instance on the cleanup stack. + * @return new instance of Csymbian_ua_guiContainerView + */ +Csymbian_ua_guiContainerView* Csymbian_ua_guiContainerView::NewL() +{ + Csymbian_ua_guiContainerView* self = Csymbian_ua_guiContainerView::NewLC(); + CleanupStack::Pop (self); + return self; +} + +/** + * Symbian two-phase constructor. + * This creates an instance, pushes it on the cleanup stack, + * then calls the second-phase constructor. + * @return new instance of Csymbian_ua_guiContainerView + */ +Csymbian_ua_guiContainerView* Csymbian_ua_guiContainerView::NewLC() +{ + Csymbian_ua_guiContainerView* self = new (ELeave) Csymbian_ua_guiContainerView(); + CleanupStack::PushL (self); + self->ConstructL(); + return self; +} + + +/** + * Second-phase constructor for view. + * Initialize contents from resource. + */ +void Csymbian_ua_guiContainerView::ConstructL() +{ + // [[[ begin generated region: do not modify [Generated Code] + BaseConstructL (R_SYMBIAN_UA_GUI_CONTAINER_SYMBIAN_UA_GUI_CONTAINER_VIEW); + // ]]] end generated region [Generated Code] + + // add your own initialization code here + symbian_ua_info_cb_t cb; + Mem::FillZ (&cb, sizeof (cb)); + + cb.on_info = &on_info; + cb.on_incoming_call = &on_incoming_call; + cb.on_reg_state = &on_reg_state; + cb.on_unreg_state = &on_unreg_state; + cb.on_call_end = &on_call_end; + + symbian_ua_set_info_callback (&cb); + myinstance = this; +} + +/** + * @return The UID for this view + */ +TUid Csymbian_ua_guiContainerView::Id() const +{ + return TUid::Uid (ESymbian_ua_guiContainerViewId); +} + +/** + * Handle a command for this view (override) + * @param aCommand command id to be handled + */ +void Csymbian_ua_guiContainerView::HandleCommandL (TInt aCommand) +{ + // [[[ begin generated region: do not modify [Generated Code] + TBool commandHandled = EFalse; + + switch (aCommand) { // code to dispatch to the AknView's menu and CBA commands is generated here + + case ESymbian_ua_guiContainerViewControlPaneRightId: + commandHandled = CallSoftKeyPressedL (aCommand); + break; + + case ESymbian_ua_guiContainerViewSettingMenuItemCommand: + commandHandled = HandleSettingMenuItemSelectedL (aCommand); + break; + + default: + break; + } + + + if (!commandHandled) { + + if (aCommand == ESymbian_ua_guiContainerViewControlPaneRightId) { + AppUi()->HandleCommandL (EEikCmdExit); + } + + } + + // ]]] end generated region [Generated Code] + +} + +/** + * Handles user actions during activation of the view, + * such as initializing the content. + */ +void Csymbian_ua_guiContainerView::DoActivateL ( + const TVwsViewId& /*aPrevViewId*/, + TUid /*aCustomMessageId*/, + const TDesC8& /*aCustomMessage*/) +{ + // [[[ begin generated region: do not modify [Generated Contents] + SetupStatusPaneL(); + + CEikButtonGroupContainer* cba = AppUi()->Cba(); + + if (cba != NULL) { + cba->MakeVisible (EFalse); + } + + if (iSymbian_ua_guiContainer == NULL) { + iSymbian_ua_guiContainer = CSymbian_ua_guiContainer::NewL (ClientRect(), NULL, this); + iSymbian_ua_guiContainer->SetMopParent (this); + AppUi()->AddToStackL (*this, iSymbian_ua_guiContainer); + } + + // ]]] end generated region [Generated Contents] + + cba = CEikButtonGroupContainer::Current(); + + if (cba != NULL) { + if (symbian_ua_anycall()) + cba->SetCommandL (ESymbian_ua_guiContainerViewControlPaneRightId, KStHangUp); + else + cba->SetCommandL (ESymbian_ua_guiContainerViewControlPaneRightId, KStCall); + } + +} + +/** + */ +void Csymbian_ua_guiContainerView::DoDeactivate() +{ + // [[[ begin generated region: do not modify [Generated Contents] + CleanupStatusPane(); + + CEikButtonGroupContainer* cba = AppUi()->Cba(); + + if (cba != NULL) { + cba->MakeVisible (ETrue); + cba->DrawDeferred(); + } + + if (iSymbian_ua_guiContainer != NULL) { + AppUi()->RemoveFromViewStack (*this, iSymbian_ua_guiContainer); + delete iSymbian_ua_guiContainer; + iSymbian_ua_guiContainer = NULL; + } + + // ]]] end generated region [Generated Contents] + +} + +// [[[ begin generated function: do not modify +void Csymbian_ua_guiContainerView::SetupStatusPaneL() +{ + // reset the context pane + TUid contextPaneUid = TUid::Uid (EEikStatusPaneUidContext); + CEikStatusPaneBase::TPaneCapabilities subPaneContext = + StatusPane()->PaneCapabilities (contextPaneUid); + + if (subPaneContext.IsPresent() && subPaneContext.IsAppOwned()) { + CAknContextPane* context = static_cast< CAknContextPane* > ( + StatusPane()->ControlL (contextPaneUid)); + context->SetPictureToDefaultL(); + } + + // setup the title pane + TUid titlePaneUid = TUid::Uid (EEikStatusPaneUidTitle); + + CEikStatusPaneBase::TPaneCapabilities subPaneTitle = + StatusPane()->PaneCapabilities (titlePaneUid); + + if (subPaneTitle.IsPresent() && subPaneTitle.IsAppOwned()) { + CAknTitlePane* title = static_cast< CAknTitlePane* > ( + StatusPane()->ControlL (titlePaneUid)); + TResourceReader reader; + iEikonEnv->CreateResourceReaderLC (reader, R_SYMBIAN_UA_GUI_CONTAINER_TITLE_RESOURCE); + title->SetFromResourceL (reader); + CleanupStack::PopAndDestroy(); // reader internal state + } + +} + +// ]]] end generated function + +// [[[ begin generated function: do not modify +void Csymbian_ua_guiContainerView::CleanupStatusPane() +{ +} + +// ]]] end generated function + +/** + * Handle status pane size change for this view (override) + */ +void Csymbian_ua_guiContainerView::HandleStatusPaneSizeChange() +{ + CAknView::HandleStatusPaneSizeChange(); + + // this may fail, but we're not able to propagate exceptions here + TInt result; + TRAP (result, SetupStatusPaneL()); +} + +/** + * Handle the rightSoftKeyPressed event. + * @return ETrue if the command was handled, EFalse if not + */ +TBool Csymbian_ua_guiContainerView::CallSoftKeyPressedL (TInt aCommand) +{ + CEikEdwin *obj_url = (CEikEdwin*) iSymbian_ua_guiContainer->ComponentControl (iSymbian_ua_guiContainer->EEd_url); + CEikButtonGroupContainer* cba = CEikButtonGroupContainer::Current(); + + if (symbian_ua_anycall()) { + symbian_ua_endcall(); + return ETrue; + } + + PutMessage (_L ("Making call...")); + + if (cba != NULL) { + cba->SetCommandL (aCommand, KStHangUp); + cba->DrawDeferred(); + } + + + TUint8 url[256]; + + TPtr8 aUrl (url, 256); + + HBufC *buf = obj_url->GetTextInHBufL(); + CnvUtfConverter::ConvertFromUnicodeToUtf8 (aUrl, *buf); + delete buf; + + if (symbian_ua_makecall ( (char *) aUrl.PtrZ()) != 0) { + PutMessage (_L ("Making call failed!")); + + if (cba != NULL) { + cba->SetCommandL (aCommand, KStCall); + cba->DrawDeferred(); + } + } + + return ETrue; +} + +/** + * Handle the selected event. + * @param aCommand the command id invoked + * @return ETrue if the command was handled, EFalse if not + */ +TBool Csymbian_ua_guiContainerView::HandleSettingMenuItemSelectedL (TInt aCommand) +{ + AppUi()->ActivateLocalViewL (TUid::Uid (ESymbian_ua_guiSettingItemListViewId)); + return ETrue; +} + +// [[[ begin generated function: do not modify +/** + * Show the popup note for note_error + * @param aOverrideText optional override text + */ +void Csymbian_ua_guiContainerView::RunNote_errorL (const TDesC* aOverrideText) +{ + CAknErrorNote* note = new (ELeave) CAknErrorNote(); + + if (aOverrideText == NULL) { + HBufC* noteText = StringLoader::LoadLC (R_SYMBIAN_UA_GUI_CONTAINER_NOTE_ERROR); + note->ExecuteLD (*noteText); + CleanupStack::PopAndDestroy (noteText); + } else { + note->ExecuteLD (*aOverrideText); + } +} + +// ]]] end generated function + +// [[[ begin generated function: do not modify +/** + * Show the popup note for note_info + * @param aOverrideText optional override text + */ +void Csymbian_ua_guiContainerView::RunNote_infoL (const TDesC* aOverrideText) +{ + CAknInformationNote* note = new (ELeave) CAknInformationNote(); + + if (aOverrideText == NULL) { + HBufC* noteText = StringLoader::LoadLC (R_SYMBIAN_UA_GUI_CONTAINER_NOTE_INFO); + note->ExecuteLD (*noteText); + CleanupStack::PopAndDestroy (noteText); + } else { + note->ExecuteLD (*aOverrideText); + } +} + +// ]]] end generated function + +// [[[ begin generated function: do not modify +/** + * Show the popup note for note_warning + * @param aOverrideText optional override text + */ +void Csymbian_ua_guiContainerView::RunNote_warningL (const TDesC* aOverrideText) +{ + CAknWarningNote* note = new (ELeave) CAknWarningNote(); + + if (aOverrideText == NULL) { + HBufC* noteText = StringLoader::LoadLC (R_SYMBIAN_UA_GUI_CONTAINER_NOTE_WARNING); + note->ExecuteLD (*noteText); + CleanupStack::PopAndDestroy (noteText); + } else { + note->ExecuteLD (*aOverrideText); + } +} + +// ]]] end generated function + +// [[[ begin generated function: do not modify +/** + * Show the popup dialog for qry_accept_call + * @param aOverrideText optional override text + * @return EAknSoftkeyYes (left soft key id) or 0 + */ +TInt Csymbian_ua_guiContainerView::RunQry_accept_callL (const TDesC* aOverrideText) +{ + + CAknQueryDialog* queryDialog = CAknQueryDialog::NewL(); + + if (aOverrideText != NULL) { + queryDialog->SetPromptL (*aOverrideText); + } + + return queryDialog->ExecuteLD (R_SYMBIAN_UA_GUI_CONTAINER_QRY_ACCEPT_CALL); +} + +// ]]] end generated function + diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiDocument.cpp b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiDocument.cpp similarity index 64% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiDocument.cpp rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiDocument.cpp index 8eb54f8d74fed49b685ad511827c23256e1d61f4..209c9ebcec9f9a653241e1340be8fb8b382c2949 100644 --- a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiDocument.cpp +++ b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiDocument.cpp @@ -3,7 +3,7 @@ Name : symbian_ua_guiDocument.cpp Author : nanang Copyright : (c) 2008-2009 Teluu Inc. - Description : + Description : ======================================================================== */ // [[[ begin generated region: do not modify [Generated User Includes] @@ -15,19 +15,19 @@ * @brief Constructs the document class for the application. * @param anApplication the application instance */ -Csymbian_ua_guiDocument::Csymbian_ua_guiDocument( CEikApplication& anApplication ) - : CAknDocument( anApplication ) - { - } +Csymbian_ua_guiDocument::Csymbian_ua_guiDocument (CEikApplication& anApplication) + : CAknDocument (anApplication) +{ +} /** - * @brief Completes the second phase of Symbian object construction. - * Put initialization code that could leave here. - */ + * @brief Completes the second phase of Symbian object construction. + * Put initialization code that could leave here. + */ void Csymbian_ua_guiDocument::ConstructL() - { - } - +{ +} + /** * Symbian OS two-phase constructor. * @@ -37,21 +37,21 @@ void Csymbian_ua_guiDocument::ConstructL() * @param aApp the application instance * @return the new Csymbian_ua_guiDocument */ -Csymbian_ua_guiDocument* Csymbian_ua_guiDocument::NewL( CEikApplication& aApp ) - { - Csymbian_ua_guiDocument* self = new ( ELeave ) Csymbian_ua_guiDocument( aApp ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } +Csymbian_ua_guiDocument* Csymbian_ua_guiDocument::NewL (CEikApplication& aApp) +{ + Csymbian_ua_guiDocument* self = new (ELeave) Csymbian_ua_guiDocument (aApp); + CleanupStack::PushL (self); + self->ConstructL(); + CleanupStack::Pop (self); + return self; +} /** * @brief Creates the application UI object for this document. * @return the new instance - */ + */ CEikAppUi* Csymbian_ua_guiDocument::CreateAppUiL() - { - return new ( ELeave ) Csymbian_ua_guiAppUi; - } - +{ + return new (ELeave) Csymbian_ua_guiAppUi; +} + diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiSettingItemList.cpp b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiSettingItemList.cpp new file mode 100644 index 0000000000000000000000000000000000000000..15fba37ca33e2d2bcddce2b6c92a7d8e0621c144 --- /dev/null +++ b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiSettingItemList.cpp @@ -0,0 +1,423 @@ +/* +======================================================================== + Name : symbian_ua_guiSettingItemList.cpp + Author : nanang + Copyright : (c) 2008-2009 Teluu Inc. + Description : +======================================================================== +*/ + +// [[[ begin generated region: do not modify [Generated System Includes] +#include <avkon.hrh> +#include <avkon.rsg> +#include <eikmenup.h> +#include <aknappui.h> +#include <eikcmobs.h> +#include <barsread.h> +#include <stringloader.h> +#include <gdi.h> +#include <eikedwin.h> +#include <eikenv.h> +#include <eikseced.h> +#include <aknpopupfieldtext.h> +#include <eikappui.h> +#include <aknviewappui.h> +#include <akntextsettingpage.h> +#include <symbian_ua_gui.rsg> +// ]]] end generated region [Generated System Includes] + +// [[[ begin generated region: do not modify [Generated User Includes] +#include "symbian_ua_guiSettingItemList.h" +#include "Symbian_ua_guiSettingItemListSettings.h" +#include "symbian_ua_guiSettingItemList.hrh" +#include "symbian_ua_gui.hrh" +#include "symbian_ua_guiSettingItemListView.h" +// ]]] end generated region [Generated User Includes] + + +#include <s32stor.h> +#include <s32file.h> + + +// [[[ begin generated region: do not modify [Generated Constants] +// ]]] end generated region [Generated Constants] + + +_LIT (KtxDicFileName ,"settings.ini"); + +const TInt KRegistrar = 2; +const TInt KUsername = 3; +const TInt KPassword = 4; +const TInt KStunServer = 5; +const TInt KSrtp = 6; +const TInt KIce = 7; + +/** + * Construct the CSymbian_ua_guiSettingItemList instance + * @param aCommandObserver command observer + */ +CSymbian_ua_guiSettingItemList::CSymbian_ua_guiSettingItemList ( + TSymbian_ua_guiSettingItemListSettings& aSettings, + MEikCommandObserver* aCommandObserver) + : iSettings (aSettings), iCommandObserver (aCommandObserver) +{ + // [[[ begin generated region: do not modify [Generated Contents] + // ]]] end generated region [Generated Contents] + +} + +/** + * Destroy any instance variables + */ +CSymbian_ua_guiSettingItemList::~CSymbian_ua_guiSettingItemList() +{ + // [[[ begin generated region: do not modify [Generated Contents] + // ]]] end generated region [Generated Contents] + +} + +/** + * Handle system notification that the container's size has changed. + */ +void CSymbian_ua_guiSettingItemList::SizeChanged() +{ + if (ListBox()) { + ListBox()->SetRect (Rect()); + } +} + +/** + * Create one setting item at a time, identified by id. + * CAknSettingItemList calls this method and takes ownership + * of the returned value. The CAknSettingItem object owns + * a reference to the underlying data, which EditItemL() uses + * to edit and store the value. + */ +CAknSettingItem* CSymbian_ua_guiSettingItemList::CreateSettingItemL (TInt aId) +{ + switch (aId) { + // [[[ begin generated region: do not modify [Initializers] + + case ESymbian_ua_guiSettingItemListViewEd_registrar: { + CAknTextSettingItem* item = new (ELeave) + CAknTextSettingItem ( + aId, + iSettings.Ed_registrar()); + item->SetSettingPageFlags (CAknTextSettingPage::EZeroLengthAllowed); + return item; + } + + case ESymbian_ua_guiSettingItemListViewEd_user: { + CAknTextSettingItem* item = new (ELeave) + CAknTextSettingItem ( + aId, + iSettings.Ed_user()); + item->SetSettingPageFlags (CAknTextSettingPage::EZeroLengthAllowed); + return item; + } + + case ESymbian_ua_guiSettingItemListViewEd_password: { + CAknPasswordSettingItem* item = new (ELeave) + CAknPasswordSettingItem ( + aId, + CAknPasswordSettingItem::EAlpha, + iSettings.Ed_password()); + item->SetSettingPageFlags (CAknTextSettingPage::EZeroLengthAllowed); + return item; + } + + case ESymbian_ua_guiSettingItemListViewB_srtp: { + CAknBinaryPopupSettingItem* item = new (ELeave) + CAknBinaryPopupSettingItem ( + aId, + iSettings.B_srtp()); + item->SetHidden (ETrue); + return item; + } + + case ESymbian_ua_guiSettingItemListViewB_ice: { + CAknBinaryPopupSettingItem* item = new (ELeave) + CAknBinaryPopupSettingItem ( + aId, + iSettings.B_ice()); + item->SetHidden (ETrue); + return item; + } + + case ESymbian_ua_guiSettingItemListViewEd_stun_server: { + CAknTextSettingItem* item = new (ELeave) + CAknTextSettingItem ( + aId, + iSettings.Ed_stun_server()); + item->SetHidden (ETrue); + return item; + } + + // ]]] end generated region [Initializers] + + } + + return NULL; +} + +/** + * Edit the setting item identified by the given id and store + * the changes into the store. + * @param aIndex the index of the setting item in SettingItemArray() + * @param aCalledFromMenu true: a menu item invoked editing, thus + * always show the edit page and interactively edit the item; + * false: change the item in place if possible, else show the edit page + */ +void CSymbian_ua_guiSettingItemList::EditItemL (TInt aIndex, TBool aCalledFromMenu) +{ + CAknSettingItem* item = (*SettingItemArray()) [aIndex]; + + switch (item->Identifier()) { + // [[[ begin generated region: do not modify [Editing Started Invoker] + // ]]] end generated region [Editing Started Invoker] + + } + + CAknSettingItemList::EditItemL (aIndex, aCalledFromMenu); + + TBool storeValue = ETrue; + + switch (item->Identifier()) { + // [[[ begin generated region: do not modify [Editing Stopped Invoker] + // ]]] end generated region [Editing Stopped Invoker] + + } + + if (storeValue) { + item->StoreL(); + SaveSettingValuesL(); + } +} + +/** + * Handle the "Change" option on the Options menu. This is an + * alternative to the Selection key that forces the settings page + * to come up rather than changing the value in place (if possible). + */ +void CSymbian_ua_guiSettingItemList::ChangeSelectedItemL() +{ + if (ListBox()->CurrentItemIndex() >= 0) { + EditItemL (ListBox()->CurrentItemIndex(), ETrue); + } +} + +/** + * Load the initial contents of the setting items. By default, + * the setting items are populated with the default values from + * the design. You can override those values here. + * <p> + * Note: this call alone does not update the UI. + * LoadSettingsL() must be called afterwards. + */ +void CSymbian_ua_guiSettingItemList::LoadSettingValuesL() +{ + // load values into iSettings + + TFileName path; + TFileName pathWithoutDrive; + CEikonEnv::Static()->FsSession().PrivatePath (pathWithoutDrive); + + // Extract drive letter into appDrive: +#ifdef __WINS__ + path.Copy (_L ("c:")); +#else + RProcess process; + path.Copy (process.FileName().Left (2)); +#endif + + path.Append (pathWithoutDrive); + path.Append (KtxDicFileName); + + TFindFile AufFolder (CCoeEnv::Static()->FsSession()); + + if (KErrNone == AufFolder.FindByDir (path, KNullDesC)) { + CDictionaryFileStore* MyDStore = CDictionaryFileStore::OpenLC (CCoeEnv::Static()->FsSession(),AufFolder.File(), TUid::Uid (1)); + TUid FileUid; + + FileUid.iUid = KRegistrar; + + if (MyDStore->IsPresentL (FileUid)) { + RDictionaryReadStream in; + in.OpenLC (*MyDStore,FileUid); + in >> iSettings.Ed_registrar(); + CleanupStack::PopAndDestroy (1);// in + } + + FileUid.iUid = KUsername; + + if (MyDStore->IsPresentL (FileUid)) { + RDictionaryReadStream in; + in.OpenLC (*MyDStore,FileUid); + in >> iSettings.Ed_user(); + CleanupStack::PopAndDestroy (1);// in + } + + FileUid.iUid = KPassword; + + if (MyDStore->IsPresentL (FileUid)) { + RDictionaryReadStream in; + in.OpenLC (*MyDStore,FileUid); + in >> iSettings.Ed_password(); + CleanupStack::PopAndDestroy (1);// in + } + + FileUid.iUid = KStunServer; + + if (MyDStore->IsPresentL (FileUid)) { + RDictionaryReadStream in; + in.OpenLC (*MyDStore,FileUid); + in >> iSettings.Ed_stun_server(); + CleanupStack::PopAndDestroy (1);// in + } + + FileUid.iUid = KSrtp; + + if (MyDStore->IsPresentL (FileUid)) { + RDictionaryReadStream in; + in.OpenLC (*MyDStore,FileUid); + iSettings.SetB_srtp ( (TBool) in.ReadInt32L()); + CleanupStack::PopAndDestroy (1);// in + } + + FileUid.iUid = KIce; + + if (MyDStore->IsPresentL (FileUid)) { + RDictionaryReadStream in; + in.OpenLC (*MyDStore,FileUid); + iSettings.SetB_ice ( (TBool) in.ReadInt32L()); + CleanupStack::PopAndDestroy (1);// in + } + + CleanupStack::PopAndDestroy (1);// Store + } + +} + +/** + * Save the contents of the setting items. Note, this is called + * whenever an item is changed and stored to the model, so it + * may be called multiple times or not at all. + */ +void CSymbian_ua_guiSettingItemList::SaveSettingValuesL() +{ + // store values from iSettings + + TFileName path; + TFileName pathWithoutDrive; + CEikonEnv::Static()->FsSession().PrivatePath (pathWithoutDrive); + + // Extract drive letter into appDrive: +#ifdef __WINS__ + path.Copy (_L ("c:")); +#else + RProcess process; + path.Copy (process.FileName().Left (2)); + + if (path.Compare (_L ("c")) || path.Compare (_L ("C"))) + CEikonEnv::Static()->FsSession().CreatePrivatePath (EDriveC); + else if (path.Compare (_L ("e")) || path.Compare (_L ("E"))) + CEikonEnv::Static()->FsSession().CreatePrivatePath (EDriveE); + +#endif + + path.Append (pathWithoutDrive); + + path.Append (KtxDicFileName); + + TFindFile AufFolder (CCoeEnv::Static()->FsSession()); + + if (KErrNone == AufFolder.FindByDir (path, KNullDesC)) { + User::LeaveIfError (CCoeEnv::Static()->FsSession().Delete (AufFolder.File())); + } + + CDictionaryFileStore* MyDStore = CDictionaryFileStore::OpenLC (CCoeEnv::Static()->FsSession(),path, TUid::Uid (1)); + + TUid FileUid = {0x0}; + + FileUid.iUid = KRegistrar; + RDictionaryWriteStream out1; + out1.AssignLC (*MyDStore,FileUid); + out1 << iSettings.Ed_registrar(); + out1.CommitL(); + CleanupStack::PopAndDestroy (1);// out2 + + FileUid.iUid = KUsername; + RDictionaryWriteStream out2; + out2.AssignLC (*MyDStore,FileUid); + out2 << iSettings.Ed_user(); + out2.CommitL(); + CleanupStack::PopAndDestroy (1);// out2 + + FileUid.iUid = KPassword; + RDictionaryWriteStream out3; + out3.AssignLC (*MyDStore,FileUid); + out3 << iSettings.Ed_password(); + out3.CommitL(); + CleanupStack::PopAndDestroy (1);// out2 + + FileUid.iUid = KStunServer; + RDictionaryWriteStream out4; + out4.AssignLC (*MyDStore,FileUid); + out4 << iSettings.Ed_stun_server(); + out4.CommitL(); + CleanupStack::PopAndDestroy (1);// out2 + + FileUid.iUid = KSrtp; + RDictionaryWriteStream out5; + out5.AssignLC (*MyDStore,FileUid); + out5.WriteInt32L (iSettings.B_srtp()); + out5.CommitL(); + CleanupStack::PopAndDestroy (1);// out1 + + FileUid.iUid = KIce; + RDictionaryWriteStream out6; + out6.AssignLC (*MyDStore,FileUid); + out6.WriteInt32L (iSettings.B_ice()); + out6.CommitL(); + CleanupStack::PopAndDestroy (1);// out1 + + MyDStore->CommitL(); + CleanupStack::PopAndDestroy (1);// Store + +} + + +/** + * Handle global resource changes, such as scalable UI or skin events (override) + */ +void CSymbian_ua_guiSettingItemList::HandleResourceChange (TInt aType) +{ + CAknSettingItemList::HandleResourceChange (aType); + SetRect (iAvkonViewAppUi->View (TUid::Uid (ESymbian_ua_guiSettingItemListViewId))->ClientRect()); + // [[[ begin generated region: do not modify [Generated Contents] + // ]]] end generated region [Generated Contents] + +} + +/** + * Handle key event (override) + * @param aKeyEvent key event + * @param aType event code + * @return EKeyWasConsumed if the event was handled, else EKeyWasNotConsumed + */ +TKeyResponse CSymbian_ua_guiSettingItemList::OfferKeyEventL ( + const TKeyEvent& aKeyEvent, + TEventCode aType) +{ + // [[[ begin generated region: do not modify [Generated Contents] + // ]]] end generated region [Generated Contents] + + if (aKeyEvent.iCode == EKeyLeftArrow + || aKeyEvent.iCode == EKeyRightArrow) { + // allow the tab control to get the arrow keys + return EKeyWasNotConsumed; + } + + return CAknSettingItemList::OfferKeyEventL (aKeyEvent, aType); +} + diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiSettingItemListView.cpp b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiSettingItemListView.cpp new file mode 100644 index 0000000000000000000000000000000000000000..2a158b4bb501e994f02206f14f4330c86a027094 --- /dev/null +++ b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiSettingItemListView.cpp @@ -0,0 +1,291 @@ +/* +======================================================================== + Name : symbian_ua_guiSettingItemListView.cpp + Author : nanang + Copyright : (c) 2008-2009 Teluu Inc. + Description : +======================================================================== +*/ +// [[[ begin generated region: do not modify [Generated System Includes] +#include <aknviewappui.h> +#include <eikmenub.h> +#include <avkon.hrh> +#include <akncontext.h> +#include <akntitle.h> +#include <stringloader.h> +#include <barsread.h> +#include <eikbtgpc.h> +#include <symbian_ua_gui.rsg> +// ]]] end generated region [Generated System Includes] + +// [[[ begin generated region: do not modify [Generated User Includes] +#include "symbian_ua_gui.hrh" +#include "symbian_ua_guiSettingItemListView.h" +#include "symbian_ua_guiContainer.hrh" +#include "symbian_ua_guiSettingItemList.hrh" +#include "symbian_ua_guiSettingItemList.h" +// ]]] end generated region [Generated User Includes] + +#include "symbian_ua.h" + +// [[[ begin generated region: do not modify [Generated Constants] +// ]]] end generated region [Generated Constants] + +/** + * First phase of Symbian two-phase construction. Should not contain any + * code that could leave. + */ +Csymbian_ua_guiSettingItemListView::Csymbian_ua_guiSettingItemListView() +{ + // [[[ begin generated region: do not modify [Generated Contents] + // ]]] end generated region [Generated Contents] + +} + +/** + * The view's destructor removes the container from the control + * stack and destroys it. + */ +Csymbian_ua_guiSettingItemListView::~Csymbian_ua_guiSettingItemListView() +{ + // [[[ begin generated region: do not modify [Generated Contents] + // ]]] end generated region [Generated Contents] + +} + +/** + * Symbian two-phase constructor. + * This creates an instance then calls the second-phase constructor + * without leaving the instance on the cleanup stack. + * @return new instance of Csymbian_ua_guiSettingItemListView + */ +Csymbian_ua_guiSettingItemListView* Csymbian_ua_guiSettingItemListView::NewL() +{ + Csymbian_ua_guiSettingItemListView* self = Csymbian_ua_guiSettingItemListView::NewLC(); + CleanupStack::Pop (self); + return self; +} + +/** + * Symbian two-phase constructor. + * This creates an instance, pushes it on the cleanup stack, + * then calls the second-phase constructor. + * @return new instance of Csymbian_ua_guiSettingItemListView + */ +Csymbian_ua_guiSettingItemListView* Csymbian_ua_guiSettingItemListView::NewLC() +{ + Csymbian_ua_guiSettingItemListView* self = new (ELeave) Csymbian_ua_guiSettingItemListView(); + CleanupStack::PushL (self); + self->ConstructL(); + return self; +} + + +/** + * Second-phase constructor for view. + * Initialize contents from resource. + */ +void Csymbian_ua_guiSettingItemListView::ConstructL() +{ + // [[[ begin generated region: do not modify [Generated Code] + BaseConstructL (R_SYMBIAN_UA_GUI_SETTING_ITEM_LIST_SYMBIAN_UA_GUI_SETTING_ITEM_LIST_VIEW); + // ]]] end generated region [Generated Code] + + // add your own initialization code here +} + +/** + * @return The UID for this view + */ +TUid Csymbian_ua_guiSettingItemListView::Id() const +{ + return TUid::Uid (ESymbian_ua_guiSettingItemListViewId); +} + +/** + * Handle a command for this view (override) + * @param aCommand command id to be handled + */ +void Csymbian_ua_guiSettingItemListView::HandleCommandL (TInt aCommand) +{ + // [[[ begin generated region: do not modify [Generated Code] + TBool commandHandled = EFalse; + + switch (aCommand) { // code to dispatch to the AknView's menu and CBA commands is generated here + + case EAknSoftkeySave: + commandHandled = HandleControlPaneRightSoftKeyPressedL (aCommand); + break; + + case ESymbian_ua_guiSettingItemListViewMenuItem1Command: + commandHandled = HandleChangeSelectedSettingItemL (aCommand); + break; + + default: + break; + } + + + if (!commandHandled) { + + } + + // ]]] end generated region [Generated Code] + +} + +/** + * Handles user actions during activation of the view, + * such as initializing the content. + */ +void Csymbian_ua_guiSettingItemListView::DoActivateL ( + const TVwsViewId& /*aPrevViewId*/, + TUid /*aCustomMessageId*/, + const TDesC8& /*aCustomMessage*/) +{ + // [[[ begin generated region: do not modify [Generated Contents] + SetupStatusPaneL(); + + CEikButtonGroupContainer* cba = AppUi()->Cba(); + + if (cba != NULL) { + cba->MakeVisible (EFalse); + } + + if (iSymbian_ua_guiSettingItemList == NULL) { + iSettings = TSymbian_ua_guiSettingItemListSettings::NewL(); + iSymbian_ua_guiSettingItemList = new (ELeave) CSymbian_ua_guiSettingItemList (*iSettings, this); + iSymbian_ua_guiSettingItemList->SetMopParent (this); + iSymbian_ua_guiSettingItemList->ConstructFromResourceL (R_SYMBIAN_UA_GUI_SETTING_ITEM_LIST_SYMBIAN_UA_GUI_SETTING_ITEM_LIST); + iSymbian_ua_guiSettingItemList->ActivateL(); + iSymbian_ua_guiSettingItemList->LoadSettingValuesL(); + iSymbian_ua_guiSettingItemList->LoadSettingsL(); + AppUi()->AddToStackL (*this, iSymbian_ua_guiSettingItemList); + } + + // ]]] end generated region [Generated Contents] + +} + +/** + */ +void Csymbian_ua_guiSettingItemListView::DoDeactivate() +{ + // [[[ begin generated region: do not modify [Generated Contents] + CleanupStatusPane(); + + CEikButtonGroupContainer* cba = AppUi()->Cba(); + + if (cba != NULL) { + cba->MakeVisible (ETrue); + cba->DrawDeferred(); + } + + if (iSymbian_ua_guiSettingItemList != NULL) { + AppUi()->RemoveFromStack (iSymbian_ua_guiSettingItemList); + delete iSymbian_ua_guiSettingItemList; + iSymbian_ua_guiSettingItemList = NULL; + delete iSettings; + iSettings = NULL; + } + + // ]]] end generated region [Generated Contents] + +} + +// [[[ begin generated function: do not modify +void Csymbian_ua_guiSettingItemListView::SetupStatusPaneL() +{ + // reset the context pane + TUid contextPaneUid = TUid::Uid (EEikStatusPaneUidContext); + CEikStatusPaneBase::TPaneCapabilities subPaneContext = + StatusPane()->PaneCapabilities (contextPaneUid); + + if (subPaneContext.IsPresent() && subPaneContext.IsAppOwned()) { + CAknContextPane* context = static_cast< CAknContextPane* > ( + StatusPane()->ControlL (contextPaneUid)); + context->SetPictureToDefaultL(); + } + + // setup the title pane + TUid titlePaneUid = TUid::Uid (EEikStatusPaneUidTitle); + + CEikStatusPaneBase::TPaneCapabilities subPaneTitle = + StatusPane()->PaneCapabilities (titlePaneUid); + + if (subPaneTitle.IsPresent() && subPaneTitle.IsAppOwned()) { + CAknTitlePane* title = static_cast< CAknTitlePane* > ( + StatusPane()->ControlL (titlePaneUid)); + TResourceReader reader; + iEikonEnv->CreateResourceReaderLC (reader, R_SYMBIAN_UA_GUI_SETTING_ITEM_LIST_TITLE_RESOURCE); + title->SetFromResourceL (reader); + CleanupStack::PopAndDestroy(); // reader internal state + } + +} + +// ]]] end generated function + +// [[[ begin generated function: do not modify +void Csymbian_ua_guiSettingItemListView::CleanupStatusPane() +{ +} + +// ]]] end generated function + +/** + * Handle status pane size change for this view (override) + */ +void Csymbian_ua_guiSettingItemListView::HandleStatusPaneSizeChange() +{ + CAknView::HandleStatusPaneSizeChange(); + + // this may fail, but we're not able to propagate exceptions here + TInt result; + TRAP (result, SetupStatusPaneL()); +} + +/** + * Handle the selected event. + * @param aCommand the command id invoked + * @return ETrue if the command was handled, EFalse if not + */ +TBool Csymbian_ua_guiSettingItemListView::HandleChangeSelectedSettingItemL (TInt aCommand) +{ + iSymbian_ua_guiSettingItemList->ChangeSelectedItemL(); + return ETrue; +} + +/** + * Handle the rightSoftKeyPressed event. + * @return ETrue if the command was handled, EFalse if not + */ +TBool Csymbian_ua_guiSettingItemListView::HandleControlPaneRightSoftKeyPressedL (TInt aCommand) +{ + TUint8 domain[256] = {0}; + TPtr8 cDomain (domain, sizeof (domain)); + TUint8 user[64] = {0}; + TPtr8 cUser (user, sizeof (user)); + TUint8 pass[64] = {0}; + TPtr8 cPass (pass, sizeof (pass)); + + cDomain.Copy (iSettings->Ed_registrar()); + cUser.Copy (iSettings->Ed_user()); + cPass.Copy (iSettings->Ed_password()); + symbian_ua_set_account ( (char*) domain, (char*) user, (char*) pass, false, false); + + AppUi()->ActivateLocalViewL (TUid::Uid (ESymbian_ua_guiContainerViewId)); + return ETrue; +} + +/** + * Handle the selected event. + * @param aCommand the command id invoked + * @return ETrue if the command was handled, EFalse if not + */ +TBool Csymbian_ua_guiSettingItemListView::HandleCancelMenuItemSelectedL (TInt aCommand) +{ + AppUi()->ActivateLocalViewL (TUid::Uid (ESymbian_ua_guiContainerViewId)); + return ETrue; +} + diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua_gui/symbian_ua_guiContainer.uidesign b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/symbian_ua_guiContainer.uidesign similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua_gui/symbian_ua_guiContainer.uidesign rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/symbian_ua_guiContainer.uidesign diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua_gui/symbian_ua_guiSettingItemList.uidesign b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/symbian_ua_guiSettingItemList.uidesign similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symbian_ua_gui/symbian_ua_guiSettingItemList.uidesign rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/symbian_ua_guiSettingItemList.uidesign diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symsndtest/app_main.cpp b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symsndtest/app_main.cpp new file mode 100644 index 0000000000000000000000000000000000000000..f0168a54bfc231bb51308ae5931857a4f59114c7 --- /dev/null +++ b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symsndtest/app_main.cpp @@ -0,0 +1,398 @@ +/* $Id: app_main.cpp 2394 2008-12-23 17:27:53Z bennylp $ */ +/* + * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) + * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> + * + * 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 + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#include <pjmedia/delaybuf.h> +#include <pjmedia/sound.h> +#include <pj/errno.h> +#include <pj/os.h> +#include <pj/log.h> +#include <pj/string.h> +#include <pj/unicode.h> +#include <e32cons.h> + +#define THIS_FILE "app_main.cpp" +#define CLOCK_RATE 8000 +#define CHANNEL_COUNT 1 +#define PTIME 20 +#define SAMPLES_PER_FRAME (CLOCK_RATE*PTIME/1000) +#define BITS_PER_SAMPLE 16 + +extern CConsoleBase* console; + +static pj_caching_pool cp; +static pjmedia_snd_stream *strm; +static unsigned rec_cnt, play_cnt; +static pj_time_val t_start; + +pj_pool_t *pool; +pjmedia_delay_buf *delaybuf; + +/* Logging callback */ +static void log_writer (int level, const char *buf, unsigned len) +{ + static wchar_t buf16[PJ_LOG_MAX_SIZE]; + + PJ_UNUSED_ARG (level); + + pj_ansi_to_unicode (buf, len, buf16, PJ_ARRAY_SIZE (buf16)); + + TPtrC16 aBuf ( (const TUint16*) buf16, (TInt) len); + console->Write (aBuf); +} + +/* perror util */ +static void app_perror (const char *title, pj_status_t status) +{ + char errmsg[PJ_ERR_MSG_SIZE]; + pj_strerror (status, errmsg, sizeof (errmsg)); + PJ_LOG (1, (THIS_FILE, "Error: %s: %s", title, errmsg)); +} + +/* Application init */ +static pj_status_t app_init() +{ + unsigned i, count; + pj_status_t status; + + /* Redirect log */ + pj_log_set_log_func ( (void (*) (int,const char*,int)) &log_writer); + pj_log_set_decor (PJ_LOG_HAS_NEWLINE); + pj_log_set_level (3); + + /* Init pjlib */ + status = pj_init(); + + if (status != PJ_SUCCESS) { + app_perror ("pj_init()", status); + return status; + } + + pj_caching_pool_init (&cp, NULL, 0); + + /* Init sound subsystem */ + status = pjmedia_snd_init (&cp.factory); + + if (status != PJ_SUCCESS) { + app_perror ("pjmedia_snd_init()", status); + pj_caching_pool_destroy (&cp); + pj_shutdown(); + return status; + } + + count = pjmedia_snd_get_dev_count(); + + PJ_LOG (3, (THIS_FILE, "Device count: %d", count)); + + for (i=0; i<count; ++i) { + const pjmedia_snd_dev_info *info; + + info = pjmedia_snd_get_dev_info (i); + PJ_LOG (3, (THIS_FILE, "%d: %s %d/%d %dHz", + i, info->name, info->input_count, info->output_count, + info->default_samples_per_sec)); + } + + /* Create pool */ + pool = pj_pool_create (&cp.factory, THIS_FILE, 512, 512, NULL); + + if (pool == NULL) { + app_perror ("pj_pool_create()", status); + pj_caching_pool_destroy (&cp); + pj_shutdown(); + return status; + } + + /* Init delay buffer */ + status = pjmedia_delay_buf_create (pool, THIS_FILE, CLOCK_RATE, + SAMPLES_PER_FRAME, CHANNEL_COUNT, + 0, 0, &delaybuf); + + if (status != PJ_SUCCESS) { + app_perror ("pjmedia_delay_buf_create()", status); + //pj_caching_pool_destroy(&cp); + //pj_shutdown(); + //return status; + } + + return PJ_SUCCESS; +} + + +/* Sound capture callback */ +static pj_status_t rec_cb (void *user_data, + pj_uint32_t timestamp, + void *input, + unsigned size) +{ + PJ_UNUSED_ARG (user_data); + PJ_UNUSED_ARG (timestamp); + PJ_UNUSED_ARG (size); + + pjmedia_delay_buf_put (delaybuf, (pj_int16_t*) input); + + if (size != SAMPLES_PER_FRAME*2) { + PJ_LOG (3, (THIS_FILE, "Size captured = %u", + size)); + } + + ++rec_cnt; + + return PJ_SUCCESS; +} + +/* Play cb */ +static pj_status_t play_cb (void *user_data, + pj_uint32_t timestamp, + void *output, + unsigned size) +{ + PJ_UNUSED_ARG (user_data); + PJ_UNUSED_ARG (timestamp); + PJ_UNUSED_ARG (size); + + pjmedia_delay_buf_get (delaybuf, (pj_int16_t*) output); + + ++play_cnt; + return PJ_SUCCESS; +} + +/* Start sound */ +static pj_status_t snd_start (unsigned flag) +{ + pj_status_t status; + + if (strm != NULL) { + app_perror ("snd already open", PJ_EINVALIDOP); + return PJ_EINVALIDOP; + } + + if (flag==PJMEDIA_DIR_CAPTURE_PLAYBACK) + status = pjmedia_snd_open (-1, -1, CLOCK_RATE, CHANNEL_COUNT, + SAMPLES_PER_FRAME, BITS_PER_SAMPLE, + &rec_cb, &play_cb, NULL, &strm); + else if (flag==PJMEDIA_DIR_CAPTURE) + status = pjmedia_snd_open_rec (-1, CLOCK_RATE, CHANNEL_COUNT, + SAMPLES_PER_FRAME, BITS_PER_SAMPLE, + &rec_cb, NULL, &strm); + else + status = pjmedia_snd_open_player (-1, CLOCK_RATE, CHANNEL_COUNT, + SAMPLES_PER_FRAME, BITS_PER_SAMPLE, + &play_cb, NULL, &strm); + + if (status != PJ_SUCCESS) { + app_perror ("snd open", status); + return status; + } + + rec_cnt = play_cnt = 0; + + pj_gettimeofday (&t_start); + + pjmedia_delay_buf_reset (delaybuf); + + status = pjmedia_snd_stream_start (strm); + + if (status != PJ_SUCCESS) { + app_perror ("snd start", status); + pjmedia_snd_stream_close (strm); + strm = NULL; + return status; + } + + return PJ_SUCCESS; +} + +/* Stop sound */ +static pj_status_t snd_stop() +{ + pj_time_val now; + pj_status_t status; + + if (strm == NULL) { + app_perror ("snd not open", PJ_EINVALIDOP); + return PJ_EINVALIDOP; + } + + status = pjmedia_snd_stream_close (strm); + + strm = NULL; + + pj_gettimeofday (&now); + PJ_TIME_VAL_SUB (now, t_start); + + PJ_LOG (3, (THIS_FILE, "Duration: %d.%03d", now.sec, now.msec)); + PJ_LOG (3, (THIS_FILE, "Captured: %d", rec_cnt)); + PJ_LOG (3, (THIS_FILE, "Played: %d", play_cnt)); + + return status; +} + +/* Shutdown application */ +static void app_fini() +{ + if (strm) + snd_stop(); + + pjmedia_snd_deinit(); + + pjmedia_delay_buf_destroy (delaybuf); + + pj_pool_release (pool); + + pj_caching_pool_destroy (&cp); + + pj_shutdown(); +} + + +//////////////////////////////////////////////////////////////////////////// +/* + * The interractive console UI + */ +#include <e32base.h> + +class ConsoleUI : public CActive +{ + + public: + ConsoleUI (CActiveSchedulerWait *asw, CConsoleBase *con); + + // Run console UI + void Run(); + + // Stop + void Stop(); + + protected: + // Cancel asynchronous read. + void DoCancel(); + + // Implementation: called when read has completed. + void RunL(); + + private: + CActiveSchedulerWait *asw_; + CConsoleBase *con_; +}; + + +ConsoleUI::ConsoleUI (CActiveSchedulerWait *asw, CConsoleBase *con) + : CActive (EPriorityHigh), asw_ (asw), con_ (con) +{ + CActiveScheduler::Add (this); +} + +// Run console UI +void ConsoleUI::Run() +{ + con_->Read (iStatus); + SetActive(); +} + +// Stop console UI +void ConsoleUI::Stop() +{ + DoCancel(); +} + +// Cancel asynchronous read. +void ConsoleUI::DoCancel() +{ + con_->ReadCancel(); +} + +static void PrintMenu() +{ + PJ_LOG (3, (THIS_FILE, "\n\n" + "Menu:\n" + " a Start bidir sound\n" + " t Start recorder\n" + " p Start player\n" + " d Stop & close sound\n" + " w Quit\n")); +} + +// Implementation: called when read has completed. +void ConsoleUI::RunL() +{ + TKeyCode kc = con_->KeyCode(); + pj_bool_t reschedule = PJ_TRUE; + + switch (kc) { + + case 'w': + asw_->AsyncStop(); + reschedule = PJ_FALSE; + break; + + case 'a': + snd_start (PJMEDIA_DIR_CAPTURE_PLAYBACK); + break; + + case 't': + snd_start (PJMEDIA_DIR_CAPTURE); + break; + + case 'p': + snd_start (PJMEDIA_DIR_PLAYBACK); + break; + + case 'd': + snd_stop(); + break; + + default: + PJ_LOG (3, (THIS_FILE, "Keycode '%c' (%d) is pressed", + kc, kc)); + break; + } + + PrintMenu(); + + if (reschedule) + Run(); +} + + +//////////////////////////////////////////////////////////////////////////// +int app_main() +{ + if (app_init() != PJ_SUCCESS) + return -1; + + // Run the UI + CActiveSchedulerWait *asw = new CActiveSchedulerWait; + + ConsoleUI *con = new ConsoleUI (asw, console); + + con->Run(); + + PrintMenu(); + + asw->Start(); + + delete con; + + delete asw; + + app_fini(); + + return 0; +} + diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symsndtest/main_symbian.cpp b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symsndtest/main_symbian.cpp similarity index 65% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symsndtest/main_symbian.cpp rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symsndtest/main_symbian.cpp index e33ff6969f9fedd7f9d8e9807efa281a6536a7fe..512a0e1767d842ca28613dda7e960d2fceb1d621 100644 --- a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symsndtest/main_symbian.cpp +++ b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symsndtest/main_symbian.cpp @@ -1,5 +1,5 @@ /* $Id: main_symbian.cpp 2394 2008-12-23 17:27:53Z bennylp $ */ -/* +/* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> * @@ -15,7 +15,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include <e32std.h> @@ -29,36 +29,38 @@ CConsoleBase* console; // Needed by APS -TPtrC APP_UID = _L("A000000D"); +TPtrC APP_UID = _L ("A000000D"); int app_main(); //////////////////////////////////////////////////////////////////////////// + class MyTask : public CActive { -public: - static MyTask *NewL(CActiveSchedulerWait *asw); - ~MyTask(); - void Start(); - -protected: - MyTask(CActiveSchedulerWait *asw); - void ConstructL(); - virtual void RunL(); - virtual void DoCancel(); - -private: - RTimer timer_; - CActiveSchedulerWait *asw_; + + public: + static MyTask *NewL (CActiveSchedulerWait *asw); + ~MyTask(); + void Start(); + + protected: + MyTask (CActiveSchedulerWait *asw); + void ConstructL(); + virtual void RunL(); + virtual void DoCancel(); + + private: + RTimer timer_; + CActiveSchedulerWait *asw_; }; -MyTask::MyTask(CActiveSchedulerWait *asw) -: CActive(EPriorityNormal), asw_(asw) +MyTask::MyTask (CActiveSchedulerWait *asw) + : CActive (EPriorityNormal), asw_ (asw) { } -MyTask::~MyTask() +MyTask::~MyTask() { timer_.Close(); } @@ -66,23 +68,23 @@ MyTask::~MyTask() void MyTask::ConstructL() { timer_.CreateLocal(); - CActiveScheduler::Add(this); + CActiveScheduler::Add (this); } -MyTask *MyTask::NewL(CActiveSchedulerWait *asw) +MyTask *MyTask::NewL (CActiveSchedulerWait *asw) { - MyTask *self = new (ELeave) MyTask(asw); - CleanupStack::PushL(self); + MyTask *self = new (ELeave) MyTask (asw); + CleanupStack::PushL (self); self->ConstructL(); - CleanupStack::Pop(self); + CleanupStack::Pop (self); return self; } void MyTask::Start() { - timer_.After(iStatus, 0); + timer_.After (iStatus, 0); SetActive(); } @@ -102,24 +104,24 @@ void MyTask::DoCancel() LOCAL_C void DoStartL() { CActiveScheduler *scheduler = new (ELeave) CActiveScheduler; - CleanupStack::PushL(scheduler); - CActiveScheduler::Install(scheduler); + CleanupStack::PushL (scheduler); + CActiveScheduler::Install (scheduler); CActiveSchedulerWait *asw = new CActiveSchedulerWait; - CleanupStack::PushL(asw); - - MyTask *task = MyTask::NewL(asw); + CleanupStack::PushL (asw); + + MyTask *task = MyTask::NewL (asw); task->Start(); asw->Start(); - + delete task; - - CleanupStack::Pop(asw); + + CleanupStack::Pop (asw); delete asw; - - CActiveScheduler::Install(NULL); - CleanupStack::Pop(scheduler); + + CActiveScheduler::Install (NULL); + CleanupStack::Pop (scheduler); delete scheduler; } @@ -136,22 +138,26 @@ GLDEF_C TInt E32Main() CTrapCleanup* cleanup = CTrapCleanup::New(); // Create output console - TRAPD(createError, console = Console::NewL(_L("Console"), TSize(KConsFullScreen,KConsFullScreen))); + TRAPD (createError, console = Console::NewL (_L ("Console"), TSize (KConsFullScreen,KConsFullScreen))); + if (createError) return createError; - TRAPD(startError, DoStartL()); + TRAPD (startError, DoStartL()); + + console->Printf (_L ("[press any key to close]\n")); - console->Printf(_L("[press any key to close]\n")); console->Getch(); - + delete console; + delete cleanup; - CloseSTDLIB(); + CloseSTDLIB(); // Mark end of heap usage, detect memory leaks __UHEAP_MARKEND; + return KErrNone; } diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symsndtest/symsndtest_reg.rss b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symsndtest/symsndtest_reg.rss similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip-apps/src/symsndtest/symsndtest_reg.rss rename to sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symsndtest/symsndtest_reg.rss diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/bin/pjsip-test-x86_64-unknown-linux-gnu b/sflphone-common/libs/pjproject-1.0.2/pjsip/bin/pjsip-test-x86_64-unknown-linux-gnu new file mode 100755 index 0000000000000000000000000000000000000000..45542bd1c516ee8b685b2f16469808270c040be0 Binary files /dev/null and b/sflphone-common/libs/pjproject-1.0.2/pjsip/bin/pjsip-test-x86_64-unknown-linux-gnu differ diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/build/Makefile b/sflphone-common/libs/pjproject-1.0.2/pjsip/build/Makefile similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/build/Makefile rename to sflphone-common/libs/pjproject-1.0.2/pjsip/build/Makefile diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/build/os-auto.mak b/sflphone-common/libs/pjproject-1.0.2/pjsip/build/os-auto.mak similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/build/os-auto.mak rename to sflphone-common/libs/pjproject-1.0.2/pjsip/build/os-auto.mak diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/build/os-auto.mak.in b/sflphone-common/libs/pjproject-1.0.2/pjsip/build/os-auto.mak.in similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/build/os-auto.mak.in rename to sflphone-common/libs/pjproject-1.0.2/pjsip/build/os-auto.mak.in diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/build/os-rtems.mak b/sflphone-common/libs/pjproject-1.0.2/pjsip/build/os-rtems.mak similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/build/os-rtems.mak rename to sflphone-common/libs/pjproject-1.0.2/pjsip/build/os-rtems.mak diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/build/pjsip.dsw b/sflphone-common/libs/pjproject-1.0.2/pjsip/build/pjsip.dsw similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/build/pjsip.dsw rename to sflphone-common/libs/pjproject-1.0.2/pjsip/build/pjsip.dsw diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/build/pjsip_core.dsp b/sflphone-common/libs/pjproject-1.0.2/pjsip/build/pjsip_core.dsp similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/build/pjsip_core.dsp rename to sflphone-common/libs/pjproject-1.0.2/pjsip/build/pjsip_core.dsp diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/build/pjsip_core.vcproj b/sflphone-common/libs/pjproject-1.0.2/pjsip/build/pjsip_core.vcproj similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/build/pjsip_core.vcproj rename to sflphone-common/libs/pjproject-1.0.2/pjsip/build/pjsip_core.vcproj diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/build/pjsip_simple.dsp b/sflphone-common/libs/pjproject-1.0.2/pjsip/build/pjsip_simple.dsp similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/build/pjsip_simple.dsp rename to sflphone-common/libs/pjproject-1.0.2/pjsip/build/pjsip_simple.dsp diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/build/pjsip_simple.vcproj b/sflphone-common/libs/pjproject-1.0.2/pjsip/build/pjsip_simple.vcproj similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/build/pjsip_simple.vcproj rename to sflphone-common/libs/pjproject-1.0.2/pjsip/build/pjsip_simple.vcproj diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/build/pjsip_ua.dsp b/sflphone-common/libs/pjproject-1.0.2/pjsip/build/pjsip_ua.dsp similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/build/pjsip_ua.dsp rename to sflphone-common/libs/pjproject-1.0.2/pjsip/build/pjsip_ua.dsp diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/build/pjsip_ua.vcproj b/sflphone-common/libs/pjproject-1.0.2/pjsip/build/pjsip_ua.vcproj similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/build/pjsip_ua.vcproj rename to sflphone-common/libs/pjproject-1.0.2/pjsip/build/pjsip_ua.vcproj diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/build/pjsua_lib.dsp b/sflphone-common/libs/pjproject-1.0.2/pjsip/build/pjsua_lib.dsp similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/build/pjsua_lib.dsp rename to sflphone-common/libs/pjproject-1.0.2/pjsip/build/pjsua_lib.dsp diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/build/pjsua_lib.vcproj b/sflphone-common/libs/pjproject-1.0.2/pjsip/build/pjsua_lib.vcproj similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/build/pjsua_lib.vcproj rename to sflphone-common/libs/pjproject-1.0.2/pjsip/build/pjsua_lib.vcproj diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/build/test_pjsip.dsp b/sflphone-common/libs/pjproject-1.0.2/pjsip/build/test_pjsip.dsp similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/build/test_pjsip.dsp rename to sflphone-common/libs/pjproject-1.0.2/pjsip/build/test_pjsip.dsp diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/build/test_pjsip.vcproj b/sflphone-common/libs/pjproject-1.0.2/pjsip/build/test_pjsip.vcproj similarity index 95% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/build/test_pjsip.vcproj rename to sflphone-common/libs/pjproject-1.0.2/pjsip/build/test_pjsip.vcproj index 7ac83454c38f79584a8c8cda9034bea061774cef..4f85ee74f67b548b33681fcba07569e1c32ea7f0 100644 --- a/sflphone-common/libs/pjproject-1.0.1/pjsip/build/test_pjsip.vcproj +++ b/sflphone-common/libs/pjproject-1.0.2/pjsip/build/test_pjsip.vcproj @@ -73,7 +73,7 @@ Name="VCLinkerTool" AdditionalOptions="/FIXED:NO" AdditionalDependencies="dsound.lib dxguid.lib netapi32.lib mswsock.lib ws2_32.lib odbc32.lib odbccp32.lib ole32.lib" - OutputFile="..\bin\test-pjsip-i386-win32-vc8-release.exe" + OutputFile="..\bin\pjsip-test-i386-win32-vc8-release.exe" LinkIncremental="1" SuppressStartupBanner="true" GenerateDebugInformation="true" @@ -167,7 +167,7 @@ <Tool Name="VCLinkerTool" AdditionalDependencies="dsound.lib dxguid.lib netapi32.lib mswsock.lib ws2_32.lib odbc32.lib odbccp32.lib ole32.lib" - OutputFile="..\bin\test-pjsip-i386-win32-vc8-debug.exe" + OutputFile="..\bin\pjsip-test-i386-win32-vc8-debug.exe" LinkIncremental="2" SuppressStartupBanner="true" GenerateDebugInformation="true" diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/build/wince-evc4/pjsip_core_wince.vcp b/sflphone-common/libs/pjproject-1.0.2/pjsip/build/wince-evc4/pjsip_core_wince.vcp similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/build/wince-evc4/pjsip_core_wince.vcp rename to sflphone-common/libs/pjproject-1.0.2/pjsip/build/wince-evc4/pjsip_core_wince.vcp diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/build/wince-evc4/pjsip_simple_wince.vcp b/sflphone-common/libs/pjproject-1.0.2/pjsip/build/wince-evc4/pjsip_simple_wince.vcp similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/build/wince-evc4/pjsip_simple_wince.vcp rename to sflphone-common/libs/pjproject-1.0.2/pjsip/build/wince-evc4/pjsip_simple_wince.vcp diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/build/wince-evc4/pjsip_ua_wince.vcp b/sflphone-common/libs/pjproject-1.0.2/pjsip/build/wince-evc4/pjsip_ua_wince.vcp similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/build/wince-evc4/pjsip_ua_wince.vcp rename to sflphone-common/libs/pjproject-1.0.2/pjsip/build/wince-evc4/pjsip_ua_wince.vcp diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/build/wince-evc4/pjsip_wince.vcw b/sflphone-common/libs/pjproject-1.0.2/pjsip/build/wince-evc4/pjsip_wince.vcw similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/build/wince-evc4/pjsip_wince.vcw rename to sflphone-common/libs/pjproject-1.0.2/pjsip/build/wince-evc4/pjsip_wince.vcw diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/build/wince-evc4/pjsua_lib_wince.vcp b/sflphone-common/libs/pjproject-1.0.2/pjsip/build/wince-evc4/pjsua_lib_wince.vcp similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/build/wince-evc4/pjsua_lib_wince.vcp rename to sflphone-common/libs/pjproject-1.0.2/pjsip/build/wince-evc4/pjsua_lib_wince.vcp diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/build/wince-evc4/test_pjsip_wince.vcp b/sflphone-common/libs/pjproject-1.0.2/pjsip/build/wince-evc4/test_pjsip_wince.vcp similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/build/wince-evc4/test_pjsip_wince.vcp rename to sflphone-common/libs/pjproject-1.0.2/pjsip/build/wince-evc4/test_pjsip_wince.vcp diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/docs/PJSUA-TESTING.txt b/sflphone-common/libs/pjproject-1.0.2/pjsip/docs/PJSUA-TESTING.txt similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/docs/PJSUA-TESTING.txt rename to sflphone-common/libs/pjproject-1.0.2/pjsip/docs/PJSUA-TESTING.txt diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/docs/TRANSPORT-PROBLEMS.TXT b/sflphone-common/libs/pjproject-1.0.2/pjsip/docs/TRANSPORT-PROBLEMS.TXT similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/docs/TRANSPORT-PROBLEMS.TXT rename to sflphone-common/libs/pjproject-1.0.2/pjsip/docs/TRANSPORT-PROBLEMS.TXT diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/docs/doxygen.cfg b/sflphone-common/libs/pjproject-1.0.2/pjsip/docs/doxygen.cfg similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/docs/doxygen.cfg rename to sflphone-common/libs/pjproject-1.0.2/pjsip/docs/doxygen.cfg diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/docs/doxygen.h b/sflphone-common/libs/pjproject-1.0.2/pjsip/docs/doxygen.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/docs/doxygen.h rename to sflphone-common/libs/pjproject-1.0.2/pjsip/docs/doxygen.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/docs/footer.html b/sflphone-common/libs/pjproject-1.0.2/pjsip/docs/footer.html similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/docs/footer.html rename to sflphone-common/libs/pjproject-1.0.2/pjsip/docs/footer.html diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/docs/header.html b/sflphone-common/libs/pjproject-1.0.2/pjsip/docs/header.html similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/docs/header.html rename to sflphone-common/libs/pjproject-1.0.2/pjsip/docs/header.html diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/docs/pjsip-arch.jpg b/sflphone-common/libs/pjproject-1.0.2/pjsip/docs/pjsip-arch.jpg similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/docs/pjsip-arch.jpg rename to sflphone-common/libs/pjproject-1.0.2/pjsip/docs/pjsip-arch.jpg diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/docs/pjsip-perf.jpg b/sflphone-common/libs/pjproject-1.0.2/pjsip/docs/pjsip-perf.jpg similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/docs/pjsip-perf.jpg rename to sflphone-common/libs/pjproject-1.0.2/pjsip/docs/pjsip-perf.jpg diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/docs/pjsua.jpg b/sflphone-common/libs/pjproject-1.0.2/pjsip/docs/pjsua.jpg similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/docs/pjsua.jpg rename to sflphone-common/libs/pjproject-1.0.2/pjsip/docs/pjsua.jpg diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/docs/siprtp.jpg b/sflphone-common/libs/pjproject-1.0.2/pjsip/docs/siprtp.jpg similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/docs/siprtp.jpg rename to sflphone-common/libs/pjproject-1.0.2/pjsip/docs/siprtp.jpg diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/include/pjsip-simple/errno.h b/sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip-simple/errno.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/include/pjsip-simple/errno.h rename to sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip-simple/errno.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/include/pjsip-simple/evsub.h b/sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip-simple/evsub.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/include/pjsip-simple/evsub.h rename to sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip-simple/evsub.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/include/pjsip-simple/evsub_msg.h b/sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip-simple/evsub_msg.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/include/pjsip-simple/evsub_msg.h rename to sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip-simple/evsub_msg.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/include/pjsip-simple/iscomposing.h b/sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip-simple/iscomposing.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/include/pjsip-simple/iscomposing.h rename to sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip-simple/iscomposing.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/include/pjsip-simple/pidf.h b/sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip-simple/pidf.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/include/pjsip-simple/pidf.h rename to sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip-simple/pidf.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/include/pjsip-simple/presence.h b/sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip-simple/presence.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/include/pjsip-simple/presence.h rename to sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip-simple/presence.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/include/pjsip-simple/publish.h b/sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip-simple/publish.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/include/pjsip-simple/publish.h rename to sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip-simple/publish.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/include/pjsip-simple/rpid.h b/sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip-simple/rpid.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/include/pjsip-simple/rpid.h rename to sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip-simple/rpid.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/include/pjsip-simple/types.h b/sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip-simple/types.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/include/pjsip-simple/types.h rename to sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip-simple/types.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/include/pjsip-simple/xpidf.h b/sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip-simple/xpidf.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/include/pjsip-simple/xpidf.h rename to sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip-simple/xpidf.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/include/pjsip-ua/sip_100rel.h b/sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip-ua/sip_100rel.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/include/pjsip-ua/sip_100rel.h rename to sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip-ua/sip_100rel.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/include/pjsip-ua/sip_inv.h b/sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip-ua/sip_inv.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/include/pjsip-ua/sip_inv.h rename to sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip-ua/sip_inv.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/include/pjsip-ua/sip_regc.h b/sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip-ua/sip_regc.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/include/pjsip-ua/sip_regc.h rename to sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip-ua/sip_regc.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/include/pjsip-ua/sip_replaces.h b/sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip-ua/sip_replaces.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/include/pjsip-ua/sip_replaces.h rename to sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip-ua/sip_replaces.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/include/pjsip-ua/sip_xfer.h b/sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip-ua/sip_xfer.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/include/pjsip-ua/sip_xfer.h rename to sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip-ua/sip_xfer.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/include/pjsip.h b/sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/include/pjsip.h rename to sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/include/pjsip/print_util.h b/sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/print_util.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/include/pjsip/print_util.h rename to sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/print_util.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/include/pjsip/sip_auth.h b/sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_auth.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/include/pjsip/sip_auth.h rename to sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_auth.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/include/pjsip/sip_auth_aka.h b/sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_auth_aka.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/include/pjsip/sip_auth_aka.h rename to sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_auth_aka.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/include/pjsip/sip_auth_msg.h b/sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_auth_msg.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/include/pjsip/sip_auth_msg.h rename to sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_auth_msg.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/include/pjsip/sip_auth_parser.h b/sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_auth_parser.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/include/pjsip/sip_auth_parser.h rename to sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_auth_parser.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/include/pjsip/sip_autoconf.h b/sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_autoconf.h similarity index 97% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/include/pjsip/sip_autoconf.h rename to sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_autoconf.h index a2c22b28d8492be01c592d6d5e760d651efd1987..ff184d20d616b16ad37f2b09f6d43c1ac2b9f35b 100644 --- a/sflphone-common/libs/pjproject-1.0.1/pjsip/include/pjsip/sip_autoconf.h +++ b/sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_autoconf.h @@ -32,7 +32,7 @@ * But only do this if user doesn't explicitly configure in pj/config_site.h. */ #ifndef PJSIP_HAS_TLS_TRANSPORT -#define PJSIP_HAS_TLS_TRANSPORT 1 +/* #undef PJSIP_HAS_TLS_TRANSPORT */ #endif diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/include/pjsip/sip_autoconf.h.in b/sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_autoconf.h.in similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/include/pjsip/sip_autoconf.h.in rename to sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_autoconf.h.in diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/include/pjsip/sip_config.h b/sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_config.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/include/pjsip/sip_config.h rename to sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_config.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/include/pjsip/sip_dialog.h b/sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_dialog.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/include/pjsip/sip_dialog.h rename to sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_dialog.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/include/pjsip/sip_endpoint.h b/sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_endpoint.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/include/pjsip/sip_endpoint.h rename to sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_endpoint.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/include/pjsip/sip_errno.h b/sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_errno.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/include/pjsip/sip_errno.h rename to sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_errno.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/include/pjsip/sip_event.h b/sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_event.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/include/pjsip/sip_event.h rename to sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_event.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/include/pjsip/sip_module.h b/sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_module.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/include/pjsip/sip_module.h rename to sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_module.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/include/pjsip/sip_msg.h b/sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_msg.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/include/pjsip/sip_msg.h rename to sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_msg.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/include/pjsip/sip_parser.h b/sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_parser.h similarity index 98% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/include/pjsip/sip_parser.h rename to sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_parser.h index 85ac781cd573c1ac2d9d8f7f5ed3b71eeb0e487f..b854c27e2ffffe26e5fe80d11a047b66f81dc170 100644 --- a/sflphone-common/libs/pjproject-1.0.1/pjsip/include/pjsip/sip_parser.h +++ b/sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_parser.h @@ -1,4 +1,4 @@ -/* $Id: sip_parser.h 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: sip_parser.h 2538 2009-03-23 13:14:26Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -336,6 +336,9 @@ typedef struct pjsip_parser_const_t pj_cis_t pjsip_ALNUM_SPEC; /**< Decimal + Alpha. */ pj_cis_t pjsip_TOKEN_SPEC; /**< Token. */ pj_cis_t pjsip_TOKEN_SPEC_ESC; /**< Token without '%' character */ + pj_cis_t pjsip_VIA_PARAM_SPEC; /**< Via param is token + ":" for + IPv6. */ + pj_cis_t pjsip_VIA_PARAM_SPEC_ESC; /**< .. as above without '%' */ pj_cis_t pjsip_HEX_SPEC; /**< Hexadecimal digits. */ pj_cis_t pjsip_PARAM_CHAR_SPEC; /**< For scanning pname (or pvalue when it's not quoted.) in URI */ diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/include/pjsip/sip_private.h b/sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_private.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/include/pjsip/sip_private.h rename to sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_private.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/include/pjsip/sip_resolve.h b/sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_resolve.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/include/pjsip/sip_resolve.h rename to sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_resolve.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/include/pjsip/sip_tel_uri.h b/sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_tel_uri.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/include/pjsip/sip_tel_uri.h rename to sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_tel_uri.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/include/pjsip/sip_transaction.h b/sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_transaction.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/include/pjsip/sip_transaction.h rename to sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_transaction.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/include/pjsip/sip_transport.h b/sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_transport.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/include/pjsip/sip_transport.h rename to sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_transport.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/include/pjsip/sip_transport_loop.h b/sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_transport_loop.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/include/pjsip/sip_transport_loop.h rename to sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_transport_loop.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/include/pjsip/sip_transport_tcp.h b/sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_transport_tcp.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/include/pjsip/sip_transport_tcp.h rename to sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_transport_tcp.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/include/pjsip/sip_transport_tls.h b/sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_transport_tls.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/include/pjsip/sip_transport_tls.h rename to sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_transport_tls.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/include/pjsip/sip_transport_udp.h b/sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_transport_udp.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/include/pjsip/sip_transport_udp.h rename to sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_transport_udp.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/include/pjsip/sip_types.h b/sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_types.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/include/pjsip/sip_types.h rename to sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_types.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/include/pjsip/sip_ua_layer.h b/sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_ua_layer.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/include/pjsip/sip_ua_layer.h rename to sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_ua_layer.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/include/pjsip/sip_uri.h b/sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_uri.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/include/pjsip/sip_uri.h rename to sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_uri.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/include/pjsip/sip_util.h b/sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_util.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/include/pjsip/sip_util.h rename to sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_util.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/include/pjsip_auth.h b/sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip_auth.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/include/pjsip_auth.h rename to sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip_auth.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/include/pjsip_simple.h b/sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip_simple.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/include/pjsip_simple.h rename to sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip_simple.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/include/pjsip_ua.h b/sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip_ua.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/include/pjsip_ua.h rename to sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip_ua.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/include/pjsua-lib/pjsua.h b/sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsua-lib/pjsua.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/include/pjsua-lib/pjsua.h rename to sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsua-lib/pjsua.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/include/pjsua-lib/pjsua_internal.h b/sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsua-lib/pjsua_internal.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/include/pjsua-lib/pjsua_internal.h rename to sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsua-lib/pjsua_internal.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/src/pjsip-simple/errno.c b/sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip-simple/errno.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/src/pjsip-simple/errno.c rename to sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip-simple/errno.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/src/pjsip-simple/evsub.c b/sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip-simple/evsub.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/src/pjsip-simple/evsub.c rename to sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip-simple/evsub.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/src/pjsip-simple/evsub_msg.c b/sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip-simple/evsub_msg.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/src/pjsip-simple/evsub_msg.c rename to sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip-simple/evsub_msg.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/src/pjsip-simple/iscomposing.c b/sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip-simple/iscomposing.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/src/pjsip-simple/iscomposing.c rename to sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip-simple/iscomposing.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/src/pjsip-simple/pidf.c b/sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip-simple/pidf.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/src/pjsip-simple/pidf.c rename to sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip-simple/pidf.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/src/pjsip-simple/presence.c b/sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip-simple/presence.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/src/pjsip-simple/presence.c rename to sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip-simple/presence.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/src/pjsip-simple/presence_body.c b/sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip-simple/presence_body.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/src/pjsip-simple/presence_body.c rename to sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip-simple/presence_body.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/src/pjsip-simple/publishc.c b/sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip-simple/publishc.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/src/pjsip-simple/publishc.c rename to sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip-simple/publishc.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/src/pjsip-simple/rpid.c b/sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip-simple/rpid.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/src/pjsip-simple/rpid.c rename to sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip-simple/rpid.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/src/pjsip-simple/xpidf.c b/sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip-simple/xpidf.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/src/pjsip-simple/xpidf.c rename to sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip-simple/xpidf.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/src/pjsip-ua/sip_100rel.c b/sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip-ua/sip_100rel.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/src/pjsip-ua/sip_100rel.c rename to sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip-ua/sip_100rel.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/src/pjsip-ua/sip_inv.c b/sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip-ua/sip_inv.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/src/pjsip-ua/sip_inv.c rename to sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip-ua/sip_inv.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/src/pjsip-ua/sip_reg.c b/sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip-ua/sip_reg.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/src/pjsip-ua/sip_reg.c rename to sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip-ua/sip_reg.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/src/pjsip-ua/sip_replaces.c b/sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip-ua/sip_replaces.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/src/pjsip-ua/sip_replaces.c rename to sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip-ua/sip_replaces.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/src/pjsip-ua/sip_xfer.c b/sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip-ua/sip_xfer.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/src/pjsip-ua/sip_xfer.c rename to sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip-ua/sip_xfer.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/src/pjsip/sip_auth_aka.c b/sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip/sip_auth_aka.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/src/pjsip/sip_auth_aka.c rename to sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip/sip_auth_aka.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/src/pjsip/sip_auth_client.c b/sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip/sip_auth_client.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/src/pjsip/sip_auth_client.c rename to sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip/sip_auth_client.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/src/pjsip/sip_auth_msg.c b/sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip/sip_auth_msg.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/src/pjsip/sip_auth_msg.c rename to sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip/sip_auth_msg.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/src/pjsip/sip_auth_parser.c b/sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip/sip_auth_parser.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/src/pjsip/sip_auth_parser.c rename to sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip/sip_auth_parser.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/src/pjsip/sip_auth_server.c b/sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip/sip_auth_server.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/src/pjsip/sip_auth_server.c rename to sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip/sip_auth_server.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/src/pjsip/sip_config.c b/sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip/sip_config.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/src/pjsip/sip_config.c rename to sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip/sip_config.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/src/pjsip/sip_dialog.c b/sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip/sip_dialog.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/src/pjsip/sip_dialog.c rename to sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip/sip_dialog.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/src/pjsip/sip_endpoint.c b/sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip/sip_endpoint.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/src/pjsip/sip_endpoint.c rename to sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip/sip_endpoint.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/src/pjsip/sip_errno.c b/sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip/sip_errno.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/src/pjsip/sip_errno.c rename to sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip/sip_errno.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/src/pjsip/sip_msg.c b/sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip/sip_msg.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/src/pjsip/sip_msg.c rename to sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip/sip_msg.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/src/pjsip/sip_parser.c b/sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip/sip_parser.c similarity index 94% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/src/pjsip/sip_parser.c rename to sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip/sip_parser.c index 31cfa1a4f4a7f8051a60e18f6307371f13bdf42b..91f54687874c23ffc62c4a0f3fccc6b34d5d12d1 100644 --- a/sflphone-common/libs/pjproject-1.0.1/pjsip/src/pjsip/sip_parser.c +++ b/sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip/sip_parser.c @@ -1,4 +1,4 @@ -/* $Id: sip_parser.c 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: sip_parser.c 2538 2009-03-23 13:14:26Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -54,8 +54,6 @@ */ #define GENERIC_URI_CHARS "#?;:@&=+-_.!~*'()%$,/" "%" -#define PJSIP_VERSION "SIP/2.0" - #define UNREACHED(expr) #define IS_NEWLINE(c) ((c)=='\r' || (c)=='\n') @@ -327,6 +325,14 @@ static pj_status_t init_parser() PJ_ASSERT_RETURN(status == PJ_SUCCESS, status); pj_cis_del_str(&pconst.pjsip_TOKEN_SPEC_ESC, "%"); + status = pj_cis_dup(&pconst.pjsip_VIA_PARAM_SPEC, &pconst.pjsip_TOKEN_SPEC); + PJ_ASSERT_RETURN(status == PJ_SUCCESS, status); + pj_cis_add_str(&pconst.pjsip_VIA_PARAM_SPEC, ":"); + + status = pj_cis_dup(&pconst.pjsip_VIA_PARAM_SPEC_ESC, &pconst.pjsip_TOKEN_SPEC_ESC); + PJ_ASSERT_RETURN(status == PJ_SUCCESS, status); + pj_cis_add_str(&pconst.pjsip_VIA_PARAM_SPEC, ":"); + status = pj_cis_dup(&pconst.pjsip_HOST_SPEC, &pconst.pjsip_ALNUM_SPEC); PJ_ASSERT_RETURN(status == PJ_SUCCESS, status); pj_cis_add_str( &pconst.pjsip_HOST_SPEC, HOST); @@ -772,6 +778,8 @@ PJ_DEF(pj_bool_t) pjsip_find_msg( const char *buf, pj_size_t size, const char *pos; const char *line; int content_length = -1; + pj_str_t cur_msg; + const pj_str_t end_hdr = { "\n\r\n", 3}; *msg_size = size; @@ -781,8 +789,12 @@ PJ_DEF(pj_bool_t) pjsip_find_msg( const char *buf, pj_size_t size, } - /* Find the end of header area by finding an empty line. */ - pos = pj_ansi_strstr(buf, "\n\r\n"); + /* Find the end of header area by finding an empty line. + * Don't use plain strstr() since we want to be able to handle + * NULL character in the message + */ + cur_msg.ptr = (char*)buf; cur_msg.slen = size; + pos = pj_strstr(&cur_msg, &end_hdr); if (pos == NULL) { return PJSIP_EPARTIALMSG; } @@ -791,7 +803,7 @@ PJ_DEF(pj_bool_t) pjsip_find_msg( const char *buf, pj_size_t size, body_start = pos+3; /* Find "Content-Length" header the hard way. */ - line = pj_ansi_strchr(buf, '\n'); + line = pj_strchr(&cur_msg, '\n'); while (line && line < hdr_end) { ++line; if ( ((*line=='C' || *line=='c') && @@ -842,7 +854,9 @@ PJ_DEF(pj_bool_t) pjsip_find_msg( const char *buf, pj_size_t size, break; /* Go to next line. */ - line = pj_ansi_strchr(line, '\n'); + cur_msg.slen -= (line - cur_msg.ptr); + cur_msg.ptr = (char*)line; + line = pj_strchr(&cur_msg, '\n'); } /* Found Content-Length? */ @@ -893,6 +907,36 @@ PJ_DEF(pjsip_uri*) pjsip_parse_uri( pj_pool_t *pool, return NULL; } +/* SIP version */ +static void parse_sip_version(pj_scanner *scanner) +{ + pj_str_t SIP = { "SIP", 3 }; + pj_str_t V2 = { "2.0", 3 }; + pj_str_t sip, version; + + pj_scan_get( scanner, &pconst.pjsip_ALPHA_SPEC, &sip); + if (pj_scan_get_char(scanner) != '/') + on_syntax_error(scanner); + pj_scan_get_n( scanner, 3, &version); + if (pj_stricmp(&sip, &SIP) || pj_stricmp(&version, &V2)) + on_syntax_error(scanner); +} + +static pj_bool_t is_next_sip_version(pj_scanner *scanner) +{ + pj_str_t SIP = { "SIP", 3 }; + pj_str_t sip; + int c; + + c = pj_scan_peek(scanner, &pconst.pjsip_ALPHA_SPEC, &sip); + /* return TRUE if it is "SIP" followed by "/" or space. + * we include space since the "/" may be separated by space, + * although this would mean it would return TRUE if it is a + * request and the method is "SIP"! + */ + return c && (c=='/' || c==' ' || c=='\t') && pj_stricmp(&sip, &SIP)==0; +} + /* Internal function to parse SIP message */ static pjsip_msg *int_parse_msg( pjsip_parse_ctx *ctx, pjsip_parser_err_report *err_list) @@ -926,7 +970,7 @@ retry_parse: return NULL; /* Parse request or status line */ - if (pj_scan_stricmp_alnum( scanner, PJSIP_VERSION, 7) == 0) { + if (is_next_sip_version(scanner)) { msg = pjsip_msg_create(pool, PJSIP_RESPONSE_MSG); int_parse_status_line( scanner, &msg->line.status ); } else { @@ -1125,7 +1169,7 @@ PJ_DEF(void) pjsip_parse_uri_param_imp( pj_scanner *scanner, pj_pool_t *pool, } -/* Parse parameter (";" pname ["=" pvalue]) in header. */ +/* Parse parameter (";" pname ["=" pvalue]) in SIP header. */ static void int_parse_param( pj_scanner *scanner, pj_pool_t *pool, pj_str_t *pname, pj_str_t *pvalue, unsigned option) @@ -1513,9 +1557,7 @@ static void int_parse_req_line( pj_scanner *scanner, pj_pool_t *pool, pjsip_method_init_np( &req_line->method, &token); req_line->uri = int_parse_uri(scanner, pool, PJ_TRUE); - if (pj_scan_stricmp_alnum( scanner, PJSIP_VERSION, 7) != 0) - PJ_THROW( PJSIP_SYN_ERR_EXCEPTION); - pj_scan_advance_n (scanner, 7, 1); + parse_sip_version(scanner); pj_scan_get_newline( scanner ); } @@ -1525,10 +1567,7 @@ static void int_parse_status_line( pj_scanner *scanner, { pj_str_t token; - if (pj_scan_stricmp_alnum(scanner, PJSIP_VERSION, 7) != 0) - PJ_THROW(PJSIP_SYN_ERR_EXCEPTION); - pj_scan_advance_n( scanner, 7, 1); - + parse_sip_version(scanner); pj_scan_get( scanner, &pconst.pjsip_DIGIT_SPEC, &token); status_line->code = pj_strtoul(&token); if (*scanner->curptr != '\r' && *scanner->curptr != '\n') @@ -1618,12 +1657,32 @@ end: /* Parse generic string header. */ static void parse_generic_string_hdr( pjsip_generic_string_hdr *hdr, - pj_scanner *scanner ) + pjsip_parse_ctx *ctx) { - if (pj_cis_match(&pconst.pjsip_NOT_NEWLINE, *scanner->curptr)) + pj_scanner *scanner = ctx->scanner; + + hdr->hvalue.slen = 0; + + /* header may be mangled hence the loop */ + while (pj_cis_match(&pconst.pjsip_NOT_NEWLINE, *scanner->curptr)) { + pj_str_t next, tmp; + pj_scan_get( scanner, &pconst.pjsip_NOT_NEWLINE, &hdr->hvalue); - else - hdr->hvalue.slen = 0; + if (pj_scan_is_eof(scanner) || IS_NEWLINE(*scanner->curptr)) + break; + /* mangled, get next fraction */ + pj_scan_get( scanner, &pconst.pjsip_NOT_NEWLINE, &next); + /* concatenate */ + tmp.ptr = (char*)pj_pool_alloc(ctx->pool, + hdr->hvalue.slen + next.slen + 2); + tmp.slen = 0; + pj_strcpy(&tmp, &hdr->hvalue); + pj_strcat2(&tmp, " "); + pj_strcat(&tmp, &next); + tmp.ptr[tmp.slen] = '\0'; + + hdr->hvalue = tmp; + } parse_hdr_end(scanner); } @@ -1934,13 +1993,20 @@ static void int_parse_via_param( pjsip_via_hdr *hdr, pj_scanner *scanner, pj_str_t pname, pvalue; //Parse with PARAM_CHAR instead, to allow IPv6 + //No, back to using int_parse_param() for the "`" character! //int_parse_param( scanner, pool, &pname, &pvalue, 0); - /* Get ';' character */ + //parse_param_imp(scanner, pool, &pname, &pvalue, + // &pconst.pjsip_TOKEN_SPEC, + // &pconst.pjsip_TOKEN_SPEC_ESC, 0); + //int_parse_param(scanner, pool, &pname, &pvalue, 0); + // This should be the correct one: + // added special spec for Via parameter, basically token plus + // ":" to allow IPv6 address in the received param. pj_scan_get_char(scanner); - - parse_param_imp(scanner, pool, &pname, &pvalue, - &pconst.pjsip_PARAM_CHAR_SPEC, - &pconst.pjsip_PARAM_CHAR_SPEC_ESC, 0); + parse_param_imp(scanner, pool, &pname, &pvalue, + &pconst.pjsip_VIA_PARAM_SPEC, + &pconst.pjsip_VIA_PARAM_SPEC_ESC, + 0); if (!parser_stricmp(pname, pconst.pjsip_BRANCH_STR) && pvalue.slen) { hdr->branch_param = pvalue; @@ -2075,10 +2141,9 @@ static pjsip_hdr* parse_hdr_via( pjsip_parse_ctx *ctx ) else pj_list_insert_before(first, hdr); - if (pj_scan_stricmp_alnum( scanner, PJSIP_VERSION "/", 8) != 0) - PJ_THROW(PJSIP_SYN_ERR_EXCEPTION); - - pj_scan_advance_n( scanner, 8, 1); + parse_sip_version(scanner); + if (pj_scan_get_char(scanner) != '/') + on_syntax_error(scanner); pj_scan_get( scanner, &pconst.pjsip_TOKEN_SPEC, &hdr->transport); int_parse_host(scanner, &hdr->sent_by.host); @@ -2119,7 +2184,7 @@ static pjsip_hdr* parse_hdr_generic_string( pjsip_parse_ctx *ctx ) pjsip_generic_string_hdr *hdr; hdr = pjsip_generic_string_hdr_create(ctx->pool, NULL, NULL); - parse_generic_string_hdr(hdr, ctx->scanner); + parse_generic_string_hdr(hdr, ctx); return (pjsip_hdr*)hdr; } diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/src/pjsip/sip_resolve.c b/sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip/sip_resolve.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/src/pjsip/sip_resolve.c rename to sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip/sip_resolve.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/src/pjsip/sip_tel_uri.c b/sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip/sip_tel_uri.c similarity index 99% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/src/pjsip/sip_tel_uri.c rename to sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip/sip_tel_uri.c index 73a56385109228f0ecf7a0d7e069b7411b34f4be..5e8d55e950bdd1eadfb1394183f6ab40c23c2e0f 100644 --- a/sflphone-common/libs/pjproject-1.0.1/pjsip/src/pjsip/sip_tel_uri.c +++ b/sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip/sip_tel_uri.c @@ -1,4 +1,4 @@ -/* $Id: sip_tel_uri.c 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: sip_tel_uri.c 2536 2009-03-23 13:11:05Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -442,6 +442,7 @@ static void* tel_uri_parse( pj_scanner *scanner, pj_pool_t *pool, } scanner->skip_ws = skip_ws; + pj_scan_skip_whitespace(scanner); return uri; } diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/src/pjsip/sip_transaction.c b/sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip/sip_transaction.c similarity index 99% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/src/pjsip/sip_transaction.c rename to sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip/sip_transaction.c index a25abb9317d4dca01470b9f6b491987f70dad138..50b7cdb70fd960a286afaf233c45d2508b59dc8e 100644 --- a/sflphone-common/libs/pjproject-1.0.1/pjsip/src/pjsip/sip_transaction.c +++ b/sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip/sip_transaction.c @@ -1,4 +1,4 @@ -/* $Id: sip_transaction.c 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: sip_transaction.c 2534 2009-03-23 13:09:09Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -1376,6 +1376,9 @@ PJ_DEF(pj_status_t) pjsip_tsx_create_uas( pjsip_module *tsx_user, pj_memcpy(&tsx->addr, &tsx->res_addr.addr, tsx->res_addr.addr_len); tsx->addr_len = tsx->res_addr.addr_len; tsx->is_reliable = PJSIP_TRANSPORT_IS_RELIABLE(tsx->transport); + } else { + tsx->is_reliable = + (tsx->res_addr.dst_host.flag & PJSIP_TRANSPORT_RELIABLE); } @@ -2315,7 +2318,7 @@ static pj_status_t tsx_on_state_proceeding_uas( pjsip_transaction *tsx, */ timeout = timeout_timer_val; - } else if (PJSIP_TRANSPORT_IS_RELIABLE(tsx->transport)==0) { + } else if (!tsx->is_reliable) { /* For non-INVITE, start timer J at 64*T1 for unreliable * transport. @@ -2655,9 +2658,7 @@ static pj_status_t tsx_on_state_proceeding_uac(pjsip_transaction *tsx, /* Start Timer D with TD/T4 timer if unreliable transport is used. */ /* Note: tsx->transport may be NULL! */ - if ((tsx->transport && PJSIP_TRANSPORT_IS_RELIABLE(tsx->transport)==0) - || ((tsx->transport_flag & PJSIP_TRANSPORT_RELIABLE) == 0)) - { + if (!tsx->is_reliable) { if (tsx->method.id == PJSIP_INVITE_METHOD) { timeout = td_timer_val; } else { @@ -2722,7 +2723,7 @@ static pj_status_t tsx_on_state_completed_uas( pjsip_transaction *tsx, /* Timer I is T4 timer for unreliable transports, and * zero seconds for reliable transports. */ - if (PJSIP_TRANSPORT_IS_RELIABLE(tsx->transport)==0) { + if (!tsx->is_reliable) { timeout.sec = 0; timeout.msec = 0; } else { diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/src/pjsip/sip_transport.c b/sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip/sip_transport.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/src/pjsip/sip_transport.c rename to sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip/sip_transport.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/src/pjsip/sip_transport_loop.c b/sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip/sip_transport_loop.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/src/pjsip/sip_transport_loop.c rename to sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip/sip_transport_loop.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/src/pjsip/sip_transport_tcp.c b/sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip/sip_transport_tcp.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/src/pjsip/sip_transport_tcp.c rename to sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip/sip_transport_tcp.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/src/pjsip/sip_transport_tls_ossl.c b/sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip/sip_transport_tls_ossl.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/src/pjsip/sip_transport_tls_ossl.c rename to sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip/sip_transport_tls_ossl.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/src/pjsip/sip_transport_udp.c b/sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip/sip_transport_udp.c similarity index 96% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/src/pjsip/sip_transport_udp.c rename to sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip/sip_transport_udp.c index b0215189ddd96e135cb5e7e1969e013d3fbb428a..c1d0a406f90d41f0aae56ba6e79936eea4070645 100644 --- a/sflphone-common/libs/pjproject-1.0.1/pjsip/src/pjsip/sip_transport_udp.c +++ b/sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip/sip_transport_udp.c @@ -1,4 +1,4 @@ -/* $Id: sip_transport_udp.c 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: sip_transport_udp.c 2539 2009-03-23 13:17:30Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -494,10 +494,25 @@ static pj_status_t get_published_name(pj_sock_t sock, } } else { + /* If bound address specifies "INADDR_ANY" (IPv6), get the + * IP address of local hostname + */ + pj_uint32_t loop6[4] = { 0, 0, 0, 0}; + bound_name->port = pj_ntohs(tmp_addr.ipv6.sin6_port); + + if (pj_memcmp(&tmp_addr.ipv6.sin6_addr, loop6, sizeof(loop6))==0) { + status = pj_gethostip(tmp_addr.addr.sa_family, &tmp_addr); + if (status != PJ_SUCCESS) + return status; + } + status = pj_inet_ntop(tmp_addr.addr.sa_family, pj_sockaddr_get_addr(&tmp_addr), hostbuf, hostbufsz); + if (status == PJ_SUCCESS) { + bound_name->host.slen = pj_ansi_strlen(hostbuf); + } } @@ -509,7 +524,7 @@ static void udp_set_pub_name(struct udp_transport *tp, const pjsip_host_port *a_name) { enum { INFO_LEN = 80 }; - char local_addr[PJ_INET6_ADDRSTRLEN]; + char local_addr[PJ_INET6_ADDRSTRLEN+10]; pj_assert(a_name->host.slen != 0); pj_strdup_with_null(tp->base.pool, &tp->base.local_name.host, @@ -521,14 +536,11 @@ static void udp_set_pub_name(struct udp_transport *tp, tp->base.info = (char*) pj_pool_alloc(tp->base.pool, INFO_LEN); } - pj_inet_ntop(tp->base.local_addr.addr.sa_family, - pj_sockaddr_get_addr(&tp->base.local_addr), - local_addr, sizeof(local_addr)); + pj_sockaddr_print(&tp->base.local_addr, local_addr, sizeof(local_addr), 3); pj_ansi_snprintf( - tp->base.info, INFO_LEN, "udp %s:%d [published as %s:%d]", + tp->base.info, INFO_LEN, "udp %s [published as %s:%d]", local_addr, - pj_sockaddr_get_port(&tp->base.local_addr), tp->base.local_name.host.ptr, tp->base.local_name.port); } @@ -639,7 +651,7 @@ static pj_status_t transport_attach( pjsip_endpoint *endpt, { pj_pool_t *pool; struct udp_transport *tp; - const char *format; + const char *format, *ipv6_quoteb, *ipv6_quotee; unsigned i; pj_status_t status; @@ -647,10 +659,14 @@ static pj_status_t transport_attach( pjsip_endpoint *endpt, PJ_EINVAL); /* Object name. */ - if (type & PJSIP_TRANSPORT_IPV6) + if (type & PJSIP_TRANSPORT_IPV6) { format = "udpv6%p"; - else + ipv6_quoteb = "["; + ipv6_quotee = "]"; + } else { format = "udp%p"; + ipv6_quoteb = ipv6_quotee = ""; + } /* Create pool. */ pool = pjsip_endpt_create_pool(endpt, format, PJSIP_POOL_LEN_TRANSPORT, @@ -767,12 +783,14 @@ static pj_status_t transport_attach( pjsip_endpoint *endpt, /* Done. */ if (p_transport) *p_transport = &tp->base; - + PJ_LOG(4,(tp->base.obj_name, - "SIP %s started, published address is %.*s:%d", + "SIP %s started, published address is %s%.*s%s:%d", pjsip_transport_get_type_desc((pjsip_transport_type_e)tp->base.key.type), + ipv6_quoteb, (int)tp->base.local_name.host.slen, tp->base.local_name.host.ptr, + ipv6_quotee, tp->base.local_name.port)); return PJ_SUCCESS; @@ -859,7 +877,7 @@ PJ_DEF(pj_status_t) pjsip_udp_transport_start6(pjsip_endpoint *endpt, { pj_sock_t sock; pj_status_t status; - char addr_buf[PJ_INET_ADDRSTRLEN]; + char addr_buf[PJ_INET6_ADDRSTRLEN]; pjsip_host_port bound_name; PJ_ASSERT_RETURN(endpt && async_cnt, PJ_EINVAL); @@ -883,8 +901,8 @@ PJ_DEF(pj_status_t) pjsip_udp_transport_start6(pjsip_endpoint *endpt, a_name = &bound_name; } - return pjsip_udp_transport_attach( endpt, sock, a_name, async_cnt, - p_transport); + return pjsip_udp_transport_attach2(endpt, PJSIP_TRANSPORT_UDP6, + sock, a_name, async_cnt, p_transport); } /* @@ -981,7 +999,7 @@ PJ_DEF(pj_status_t) pjsip_udp_transport_restart(pjsip_transport *transport, tp = (struct udp_transport*) transport; if (option & PJSIP_UDP_TRANSPORT_DESTROY_SOCKET) { - char addr_buf[PJ_INET_ADDRSTRLEN]; + char addr_buf[PJ_INET6_ADDRSTRLEN]; pjsip_host_port bound_name; /* Request to recreate transport */ diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/src/pjsip/sip_ua_layer.c b/sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip/sip_ua_layer.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/src/pjsip/sip_ua_layer.c rename to sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip/sip_ua_layer.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/src/pjsip/sip_uri.c b/sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip/sip_uri.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/src/pjsip/sip_uri.c rename to sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip/sip_uri.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/src/pjsip/sip_util.c b/sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip/sip_util.c similarity index 98% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/src/pjsip/sip_util.c rename to sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip/sip_util.c index b0339e36406cdd2e014c441d791ff6447572c637..41eaaad9557315c5ba9be04c67b76dd13bd349d3 100644 --- a/sflphone-common/libs/pjproject-1.0.1/pjsip/src/pjsip/sip_util.c +++ b/sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip/sip_util.c @@ -1,4 +1,4 @@ -/* $Id: sip_util.c 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: sip_util.c 2532 2009-03-23 13:06:24Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -854,12 +854,17 @@ PJ_DEF(pj_status_t) pjsip_process_route_set(pjsip_tx_data *tdata, PJSIP_ENOTREQUESTMSG); PJ_ASSERT_RETURN(dest_info != NULL, PJ_EINVAL); - /* Assert if the request contains strict route and strict - * route processing has been applied before. We need to - * restore the strict route with pjsip_restore_strict_route_set() - * before we can call this function again, otherwise strict - * route will be swapped twice! + /* If the request contains strict route, check that the strict route + * has been restored to its original values before processing the + * route set. The strict route is restored to the original values + * with pjsip_restore_strict_route_set(). If caller did not restore + * the strict route before calling this function, we need to call it + * here, or otherwise the strict-route and Request-URI will be swapped + * twice! */ + if (tdata->saved_strict_route != NULL) { + pjsip_restore_strict_route_set(tdata); + } PJ_ASSERT_RETURN(tdata->saved_strict_route==NULL, PJ_EBUG); /* Find the first and last "Route" headers from the message. */ diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/src/pjsip/sip_util_proxy.c b/sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip/sip_util_proxy.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/src/pjsip/sip_util_proxy.c rename to sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip/sip_util_proxy.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/src/pjsip/sip_util_statefull.c b/sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip/sip_util_statefull.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/src/pjsip/sip_util_statefull.c rename to sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip/sip_util_statefull.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/src/pjsua-lib/pjsua_acc.c b/sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsua-lib/pjsua_acc.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/src/pjsua-lib/pjsua_acc.c rename to sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsua-lib/pjsua_acc.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/src/pjsua-lib/pjsua_call.c b/sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsua-lib/pjsua_call.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/src/pjsua-lib/pjsua_call.c rename to sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsua-lib/pjsua_call.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/src/pjsua-lib/pjsua_core.c b/sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsua-lib/pjsua_core.c similarity index 99% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/src/pjsua-lib/pjsua_core.c rename to sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsua-lib/pjsua_core.c index f6e51a07cbeb1763f630a676941adaef00e07b79..b5dc17d787fb8b1f02bda76632b5ad0a73860487 100644 --- a/sflphone-common/libs/pjproject-1.0.1/pjsip/src/pjsua-lib/pjsua_core.c +++ b/sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsua-lib/pjsua_core.c @@ -1,4 +1,4 @@ -/* $Id: pjsua_core.c 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: pjsua_core.c 2542 2009-03-23 13:21:01Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -89,7 +89,7 @@ PJ_DEF(void) pjsua_config_default(pjsua_config *cfg) { pj_bzero(cfg, sizeof(*cfg)); - cfg->max_calls = 4; + cfg->max_calls = ((PJSUA_MAX_CALLS) < 4) ? (PJSUA_MAX_CALLS) : 4; cfg->thread_cnt = 1; cfg->nat_type_in_sdp = 1; cfg->force_lr = PJ_TRUE; @@ -835,8 +835,10 @@ static void busy_sleep(unsigned msec) pj_time_val_normalize(&timeout); do { - while (pjsua_handle_events(10) > 0) - ; + int i; + i = msec / 10; + while (pjsua_handle_events(10) > 0 && i > 0) + --i; pj_gettimeofday(&now); } while (PJ_TIME_VAL_LT(now, timeout)); } diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/src/pjsua-lib/pjsua_im.c b/sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsua-lib/pjsua_im.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/src/pjsua-lib/pjsua_im.c rename to sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsua-lib/pjsua_im.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/src/pjsua-lib/pjsua_media.c b/sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsua-lib/pjsua_media.c similarity index 99% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/src/pjsua-lib/pjsua_media.c rename to sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsua-lib/pjsua_media.c index 009b41fdcfa66d0c684b84a9025f7cbba0206f17..538f73e5701943695b969009d60f91f8a6fe4964 100644 --- a/sflphone-common/libs/pjproject-1.0.1/pjsip/src/pjsua-lib/pjsua_media.c +++ b/sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsua-lib/pjsua_media.c @@ -1,4 +1,4 @@ -/* $Id: pjsua_media.c 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: pjsua_media.c 2541 2009-03-23 13:19:31Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -1241,6 +1241,9 @@ pj_status_t pjsua_media_channel_deinit(pjsua_call_id call_id) pjmedia_transport_close(call->med_tp); call->med_tp = call->med_orig; } + + check_snd_dev_idle(); + return PJ_SUCCESS; } diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/src/pjsua-lib/pjsua_pres.c b/sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsua-lib/pjsua_pres.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/src/pjsua-lib/pjsua_pres.c rename to sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsua-lib/pjsua_pres.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/src/test-pjsip/dlg_core_test.c b/sflphone-common/libs/pjproject-1.0.2/pjsip/src/test-pjsip/dlg_core_test.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/src/test-pjsip/dlg_core_test.c rename to sflphone-common/libs/pjproject-1.0.2/pjsip/src/test-pjsip/dlg_core_test.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/src/test-pjsip/dns_test.c b/sflphone-common/libs/pjproject-1.0.2/pjsip/src/test-pjsip/dns_test.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/src/test-pjsip/dns_test.c rename to sflphone-common/libs/pjproject-1.0.2/pjsip/src/test-pjsip/dns_test.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/src/test-pjsip/inv_offer_answer_test.c b/sflphone-common/libs/pjproject-1.0.2/pjsip/src/test-pjsip/inv_offer_answer_test.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/src/test-pjsip/inv_offer_answer_test.c rename to sflphone-common/libs/pjproject-1.0.2/pjsip/src/test-pjsip/inv_offer_answer_test.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/src/test-pjsip/main.c b/sflphone-common/libs/pjproject-1.0.2/pjsip/src/test-pjsip/main.c similarity index 94% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/src/test-pjsip/main.c rename to sflphone-common/libs/pjproject-1.0.2/pjsip/src/test-pjsip/main.c index 531559dcec81e0f01955f46a445bc4e35bd56c02..c7b3bf3e8cbcb3f2207ba26e55aad7c3e0793e9c 100644 --- a/sflphone-common/libs/pjproject-1.0.1/pjsip/src/test-pjsip/main.c +++ b/sflphone-common/libs/pjproject-1.0.2/pjsip/src/test-pjsip/main.c @@ -1,4 +1,4 @@ -/* $Id: main.c 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: main.c 2408 2009-01-01 22:08:21Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -82,7 +82,8 @@ int main(int argc, char *argv[]) if (interractive) { char s[10]; printf("<Press ENTER to quit>\n"); fflush(stdout); - fgets(s, sizeof(s), stdin); + if (fgets(s, sizeof(s), stdin) == NULL) + return retval; } return retval; diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/src/test-pjsip/main_rtems.c b/sflphone-common/libs/pjproject-1.0.2/pjsip/src/test-pjsip/main_rtems.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/src/test-pjsip/main_rtems.c rename to sflphone-common/libs/pjproject-1.0.2/pjsip/src/test-pjsip/main_rtems.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/src/test-pjsip/main_win32.c b/sflphone-common/libs/pjproject-1.0.2/pjsip/src/test-pjsip/main_win32.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/src/test-pjsip/main_win32.c rename to sflphone-common/libs/pjproject-1.0.2/pjsip/src/test-pjsip/main_win32.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/src/test-pjsip/msg_err_test.c b/sflphone-common/libs/pjproject-1.0.2/pjsip/src/test-pjsip/msg_err_test.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/src/test-pjsip/msg_err_test.c rename to sflphone-common/libs/pjproject-1.0.2/pjsip/src/test-pjsip/msg_err_test.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/src/test-pjsip/msg_logger.c b/sflphone-common/libs/pjproject-1.0.2/pjsip/src/test-pjsip/msg_logger.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/src/test-pjsip/msg_logger.c rename to sflphone-common/libs/pjproject-1.0.2/pjsip/src/test-pjsip/msg_logger.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/src/test-pjsip/msg_test.c b/sflphone-common/libs/pjproject-1.0.2/pjsip/src/test-pjsip/msg_test.c similarity index 90% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/src/test-pjsip/msg_test.c rename to sflphone-common/libs/pjproject-1.0.2/pjsip/src/test-pjsip/msg_test.c index a9728617ebefbf0ebc92191d5754732fea462238..ddcc86a43142ae273cc3301d9d52d3d104fdbb74 100644 --- a/sflphone-common/libs/pjproject-1.0.1/pjsip/src/test-pjsip/msg_test.c +++ b/sflphone-common/libs/pjproject-1.0.2/pjsip/src/test-pjsip/msg_test.c @@ -1,4 +1,4 @@ -/* $Id: msg_test.c 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: msg_test.c 2546 2009-03-23 13:26:00Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -73,6 +73,7 @@ struct test_msg "P-Associated-URI:\r\n" /* empty header without space */ "\r\n", &create_msg0, + 0, PJ_SUCCESS }, { @@ -100,6 +101,136 @@ struct test_msg "m=audio 3456 RTP/AVP 0 1 3 99\r\n" "a=rtpmap:0 PCMU/8000\r\n", &create_msg1, + 0, + PJ_SUCCESS +}, +{ + /* Torture message from RFC 4475 + * 3.1.1.1 A short tortuous INVITE + */ + "INVITE sip:vivekg@chair-dnrc.example.com;unknownparam SIP/2.0\n" + "TO :\n" + " sip:vivekg@chair-dnrc.example.com ; tag = 1918181833n\n" + "from : \"J Rosenberg \\\\\\\"\" <sip:jdrosen@example.com>\n" + " ;\n" + " tag = 98asjd8\n" + "MaX-fOrWaRdS: 0068\n" + "Call-ID: wsinv.ndaksdj@192.0.2.1\n" + "Content-Length : 150\n" + "cseq: 0009\n" + " INVITE\n" + "Via : SIP / 2.0\n" + " /UDP\n" + " 192.0.2.2;rport;branch=390skdjuw\n" + "s :\n" + "NewFangledHeader: newfangled value\n" + " continued newfangled value\n" + "UnknownHeaderWithUnusualValue: ;;,,;;,;\n" + "Content-Type: application/sdp\n" + "Route:\n" + " <sip:services.example.com;lr;unknownwith=value;unknown-no-value>\n" + "v: SIP / 2.0 / TCP spindle.example.com ;\n" + " branch = z9hG4bK9ikj8 ,\n" + " SIP / 2.0 / UDP 192.168.255.111 ; branch=\n" + " z9hG4bK30239\n" + "m:\"Quoted string \\\"\\\"\" <sip:jdrosen@example.com> ; newparam =\n" + " newvalue ;\n" + " secondparam ; q = 0.33\r\n" + "\r\n" + "v=0\r\n" + "o=mhandley 29739 7272939 IN IP4 192.0.2.3\r\n" + "s=-\r\n" + "c=IN IP4 192.0.2.4\r\n" + "t=0 0\r\n" + "m=audio 49217 RTP/AVP 0 12\r\n" + "m=video 3227 RTP/AVP 31\r\n" + "a=rtpmap:31 LPC\r\n", + NULL, + 0, + PJ_SUCCESS +}, +{ + /* Torture message from RFC 4475 + * 3.1.1.2 Wide Range of Valid Characters + */ + "!interesting-Method0123456789_*+`.%indeed'~ sip:1_unusual.URI~(to-be!sure)&isn't+it$/crazy?,/;;*:&it+has=1,weird!*pas$wo~d_too.(doesn't-it)@example.com SIP/2.0\n" + "Via: SIP/2.0/UDP host1.example.com;rport;branch=z9hG4bK-.!%66*_+`'~\n" + "To: \"BEL:\\\x07 NUL:\\\x00 DEL:\\\x7F\" <sip:1_unusual.URI~(to-be!sure)&isn't+it$/crazy?,/;;*@example.com>\n" + "From: token1~` token2'+_ token3*%!.- <sip:mundane@example.com> ;fromParam''~+*_!.-%=\"\xD1\x80\xD0\xB0\xD0\xB1\xD0\xBE\xD1\x82\xD0\xB0\xD1\x8E\xD1\x89\xD0\xB8\xD0\xB9\";tag=_token~1'+`*%!-.\n" + "Call-ID: intmeth.word%ZK-!.*_+'@word`~)(><:\\/\"][?}{\n" + "CSeq: 139122385 !interesting-Method0123456789_*+`.%indeed'~\n" + "Max-Forwards: 255\n" + "extensionHeader-!.%*+_`'~: \xEF\xBB\xBF\xE5\xA4\xA7\xE5\x81\x9C\xE9\x9B\xBB\n" + "Content-Length: 0\r\n\r\n", + NULL, + 641, + PJ_SUCCESS +}, +{ + /* Torture message from RFC 4475 + * 3.1.1.3 Valid Use of the % Escaping Mechanism + */ + "INVITE sip:sips%3Auser%40example.com@example.net SIP/2.0\n" + "To: sip:%75se%72@example.com\n" + "From: <sip:I%20have%20spaces@example.net>;tag=1234\n" + "Max-Forwards: 87\n" + "i: esc01.239409asdfakjkn23onasd0-3234\n" + "CSeq: 234234 INVITE\n" + "Via: SIP/2.0/UDP host5.example.net;rport;branch=z9hG4bKkdjuw\n" + "C: application/sdp\n" + "Contact:\n" + " <sip:cal%6Cer@192.168.0.2:5060;%6C%72;n%61me=v%61lue%25%34%31>\n" + "Content-Length: 150\r\n" + "\r\n" + "v=0\r\n" + "o=mhandley 29739 7272939 IN IP4 192.0.2.1\r\n" + "s=-\r\n" + "c=IN IP4 192.0.2.1\r\n" + "t=0 0\r\n" + "m=audio 49217 RTP/AVP 0 12\r\n" + "m=video 3227 RTP/AVP 31\r\n" + "a=rtpmap:31 LPC\r\n", + NULL, + 0, + PJ_SUCCESS +}, +{ + /* Torture message from RFC 4475 + * 3.1.1.4 Escaped Nulls in URIs + */ + "REGISTER sip:example.com SIP/2.0\r\n" + "To: sip:null-%00-null@example.com\r\n" + "From: sip:null-%00-null@example.com;tag=839923423\r\n" + "Max-Forwards: 70\r\n" + "Call-ID: escnull.39203ndfvkjdasfkq3w4otrq0adsfdfnavd\r\n" + "CSeq: 14398234 REGISTER\r\n" + "Via: SIP/2.0/UDP host5.example.com;rport;branch=z9hG4bKkdjuw\r\n" + "Contact: <sip:%00@host5.example.com>\r\n" + "Contact: <sip:%00%00@host5.example.com>\r\n" + "L:0\r\n" + "\r\n", + NULL, + 0, + PJ_SUCCESS +}, +{ + /* Torture message from RFC 4475 + * 3.1.1.5 Use of % When It Is Not an Escape + */ + "RE%47IST%45R sip:registrar.example.com SIP/2.0\r\n" + "To: \"%Z%45\" <sip:resource@example.com>\r\n" + "From: \"%Z%45\" <sip:resource@example.com>;tag=f232jadfj23\r\n" + "Call-ID: esc02.asdfnqwo34rq23i34jrjasdcnl23nrlknsdf\r\n" + "Via: SIP/2.0/TCP host.example.com;rport;branch=z9hG4bK209%fzsnel234\r\n" + "CSeq: 29344 RE%47IST%45R\r\n" + "Max-Forwards: 70\r\n" + "Contact: <sip:alias1@host1.example.com>\r\n" + "C%6Fntact: <sip:alias2@host2.example.com>\r\n" + "Contact: <sip:alias3@host3.example.com>\r\n" + "l: 0\r\n" + "\r\n", + NULL, + 0, PJ_SUCCESS } }; @@ -126,7 +257,8 @@ static pj_status_t test_entry( pj_pool_t *pool, struct test_msg *entry ) char msgbuf2[PJSIP_MAX_PKT_LEN]; enum { BUFLEN = 512 }; - entry->len = pj_ansi_strlen(entry->msg); + if (entry->len==0) + entry->len = pj_ansi_strlen(entry->msg); if (var.flag & FLAG_PARSE_ONLY) goto parse_msg; @@ -180,7 +312,7 @@ parse_msg: pj_sub_timestamp(&t2, &t1); pj_add_timestamp(&var.parse_time, &t2); - if (var.flag & FLAG_PARSE_ONLY) + if ((var.flag & FLAG_PARSE_ONLY) || entry->creator==NULL) return PJ_SUCCESS; /* Create reference message. */ @@ -1734,6 +1866,11 @@ static int hdr_test(void) pj_pool_t *pool; pjsip_hdr *parsed_hdr1=NULL, *parsed_hdr2=NULL; char *input, *output; +#if defined(PJSIP_UNESCAPE_IN_PLACE) && PJSIP_UNESCAPE_IN_PLACE!=0 + static char hcontent[1024]; +#else + char *hcontent; +#endif int rc; pool = pjsip_endpt_create_pool(endpt, NULL, POOL_SIZE, POOL_SIZE); @@ -1741,8 +1878,15 @@ static int hdr_test(void) /* Parse the header */ hname = pj_str(test->hname); len = strlen(test->hcontent); +#if defined(PJSIP_UNESCAPE_IN_PLACE) && PJSIP_UNESCAPE_IN_PLACE!=0 + PJ_ASSERT_RETURN(len < sizeof(hcontent), PJSIP_EMSGTOOLONG); + strcpy(hcontent, test->hcontent); +#else + hcontent = test->hcontent; +#endif + parsed_hdr1 = (pjsip_hdr*) pjsip_parse_hdr(pool, &hname, - test->hcontent, len, + hcontent, len, &parsed_len); if (parsed_hdr1 == NULL) { if (test->flags & HDR_FLAG_PARSE_FAIL) { @@ -1765,7 +1909,14 @@ static int hdr_test(void) if (test->hshort_name) { hname = pj_str(test->hshort_name); len = strlen(test->hcontent); - parsed_hdr2 = (pjsip_hdr*) pjsip_parse_hdr(pool, &hname, test->hcontent, len, &parsed_len); +#if defined(PJSIP_UNESCAPE_IN_PLACE) && PJSIP_UNESCAPE_IN_PLACE!=0 + PJ_ASSERT_RETURN(len < sizeof(hcontent), PJSIP_EMSGTOOLONG); + strcpy(hcontent, test->hcontent); +#else + hcontent = test->hcontent; +#endif + + parsed_hdr2 = (pjsip_hdr*) pjsip_parse_hdr(pool, &hname, hcontent, len, &parsed_len); if (parsed_hdr2 == NULL) { PJ_LOG(3,(THIS_FILE, " error parsing header %s: %s", test->hshort_name, test->hcontent)); return -510; diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/src/test-pjsip/regc_test.c b/sflphone-common/libs/pjproject-1.0.2/pjsip/src/test-pjsip/regc_test.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/src/test-pjsip/regc_test.c rename to sflphone-common/libs/pjproject-1.0.2/pjsip/src/test-pjsip/regc_test.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/src/test-pjsip/test.c b/sflphone-common/libs/pjproject-1.0.2/pjsip/src/test-pjsip/test.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/src/test-pjsip/test.c rename to sflphone-common/libs/pjproject-1.0.2/pjsip/src/test-pjsip/test.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/src/test-pjsip/test.h b/sflphone-common/libs/pjproject-1.0.2/pjsip/src/test-pjsip/test.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/src/test-pjsip/test.h rename to sflphone-common/libs/pjproject-1.0.2/pjsip/src/test-pjsip/test.h diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/src/test-pjsip/transport_loop_test.c b/sflphone-common/libs/pjproject-1.0.2/pjsip/src/test-pjsip/transport_loop_test.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/src/test-pjsip/transport_loop_test.c rename to sflphone-common/libs/pjproject-1.0.2/pjsip/src/test-pjsip/transport_loop_test.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/src/test-pjsip/transport_tcp_test.c b/sflphone-common/libs/pjproject-1.0.2/pjsip/src/test-pjsip/transport_tcp_test.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/src/test-pjsip/transport_tcp_test.c rename to sflphone-common/libs/pjproject-1.0.2/pjsip/src/test-pjsip/transport_tcp_test.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/src/test-pjsip/transport_test.c b/sflphone-common/libs/pjproject-1.0.2/pjsip/src/test-pjsip/transport_test.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/src/test-pjsip/transport_test.c rename to sflphone-common/libs/pjproject-1.0.2/pjsip/src/test-pjsip/transport_test.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/src/test-pjsip/transport_udp_test.c b/sflphone-common/libs/pjproject-1.0.2/pjsip/src/test-pjsip/transport_udp_test.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/src/test-pjsip/transport_udp_test.c rename to sflphone-common/libs/pjproject-1.0.2/pjsip/src/test-pjsip/transport_udp_test.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/src/test-pjsip/tsx_basic_test.c b/sflphone-common/libs/pjproject-1.0.2/pjsip/src/test-pjsip/tsx_basic_test.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/src/test-pjsip/tsx_basic_test.c rename to sflphone-common/libs/pjproject-1.0.2/pjsip/src/test-pjsip/tsx_basic_test.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/src/test-pjsip/tsx_bench.c b/sflphone-common/libs/pjproject-1.0.2/pjsip/src/test-pjsip/tsx_bench.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/src/test-pjsip/tsx_bench.c rename to sflphone-common/libs/pjproject-1.0.2/pjsip/src/test-pjsip/tsx_bench.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/src/test-pjsip/tsx_uac_test.c b/sflphone-common/libs/pjproject-1.0.2/pjsip/src/test-pjsip/tsx_uac_test.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/src/test-pjsip/tsx_uac_test.c rename to sflphone-common/libs/pjproject-1.0.2/pjsip/src/test-pjsip/tsx_uac_test.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/src/test-pjsip/tsx_uas_test.c b/sflphone-common/libs/pjproject-1.0.2/pjsip/src/test-pjsip/tsx_uas_test.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/src/test-pjsip/tsx_uas_test.c rename to sflphone-common/libs/pjproject-1.0.2/pjsip/src/test-pjsip/tsx_uas_test.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/src/test-pjsip/txdata_test.c b/sflphone-common/libs/pjproject-1.0.2/pjsip/src/test-pjsip/txdata_test.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/src/test-pjsip/txdata_test.c rename to sflphone-common/libs/pjproject-1.0.2/pjsip/src/test-pjsip/txdata_test.c diff --git a/sflphone-common/libs/pjproject-1.0.1/pjsip/src/test-pjsip/uri_test.c b/sflphone-common/libs/pjproject-1.0.2/pjsip/src/test-pjsip/uri_test.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/pjsip/src/test-pjsip/uri_test.c rename to sflphone-common/libs/pjproject-1.0.2/pjsip/src/test-pjsip/uri_test.c diff --git a/sflphone-common/libs/pjproject-1.0.1/self-test.mak b/sflphone-common/libs/pjproject-1.0.2/self-test.mak similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/self-test.mak rename to sflphone-common/libs/pjproject-1.0.2/self-test.mak diff --git a/sflphone-common/libs/pjproject-1.0.1/svn_add b/sflphone-common/libs/pjproject-1.0.2/svn_add similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/svn_add rename to sflphone-common/libs/pjproject-1.0.2/svn_add diff --git a/sflphone-common/libs/pjproject-1.0.1/svn_pset b/sflphone-common/libs/pjproject-1.0.2/svn_pset similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/svn_pset rename to sflphone-common/libs/pjproject-1.0.2/svn_pset diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/cdash/README.TXT b/sflphone-common/libs/pjproject-1.0.2/tests/cdash/README.TXT new file mode 100644 index 0000000000000000000000000000000000000000..69728b739fe480d7f6b9e46fcbc687a17d2aaa5e --- /dev/null +++ b/sflphone-common/libs/pjproject-1.0.2/tests/cdash/README.TXT @@ -0,0 +1,59 @@ + + PJSIP CDASH AUTOMATED TESTS + -------------------------------- + + +1. What is this + + This directory contains the scripts to run the automated, Python based tests +of PJSIP source codes, across platforms, and submit the test results to a CDash +test monitoring dashboard. + + Stuffs that are included in the test scope: + - configure (for GNU platforms, e.g. Linux, msys, and MacOS X) + - build + - standard unit tests (pjlib-test, pjsip-test, etc.) + - pjsua's Python based blackbox tests + + +2. Requirements + + To run this test, you will need: + - Python (2.4 or later) + - curl (http://curl.haxx.se) + - a CDash server to receive test submissions (http://www.cdash.org) + - ccdash to submit the tests (http://trac.pjsip.org/ccdash) + + +3. Configuration + + Create a Python configuration file by copying from "cfg_site_sample.py". +Save it as "cfg_site.py". You may create more than one configurations for your +site and save them as different files. + + +4. Running + + To execute tests for GNU based targets: + + $ python main.py cfg_gnu + + + To execute tests for MSVC based target: + + $ python main.py cfg_msvc + + To execute tests for Symbian target: + + $ python main.py cfg_symbian + + + If you have a different site configuration file, you may specify it in the +arguments, e.g.: + + $ python main.py cfg_gnu my_site_config + + For more information you can also pass "-h" or "--help", e.g.: + + $ python main.py cfg_gnu --help + diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/cdash/builder.py b/sflphone-common/libs/pjproject-1.0.2/tests/cdash/builder.py new file mode 100644 index 0000000000000000000000000000000000000000..79066e8a12ef024ead477fe9eba93cf2181701e0 --- /dev/null +++ b/sflphone-common/libs/pjproject-1.0.2/tests/cdash/builder.py @@ -0,0 +1,501 @@ +# +# builder.py - PJSIP test scenarios builder +# +# Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.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 +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# + +import ccdash +import os +import platform +import re +import subprocess +import sys +import time + +class Operation: + """\ + The Operation class describes the individual ccdash operation to be + performed. + + """ + # Types: + UPDATE = "update" # Update operation + CONFIGURE = "configure" # Configure operation + BUILD = "build" # Build operation + TEST = "test" # Unit test operation + + def __init__(self, type, cmdline, name="", wdir=""): + self.type = type + self.cmdline = cmdline + self.name = name + self.wdir = wdir + if self.type==self.TEST and not self.name: + raise "name required for tests" + + def encode(self, base_dir): + s = [self.type] + if self.type == self.TEST: + s.append(self.name) + if self.type != self.UPDATE: + s.append(self.cmdline) + s.append("-w") + if self.wdir: + s.append(base_dir + "/" + self.wdir) + else: + s.append(base_dir) + return s + + +# +# Update operation +# +update_ops = [Operation(Operation.UPDATE, "")] + +# +# The standard library tests (e.g. pjlib-test, pjsip-test, etc.) +# +std_test_ops= [ + Operation(Operation.TEST, "./pjlib-test$SUFFIX", name="pjlib test", + wdir="pjlib/bin"), + Operation(Operation.TEST, "./pjlib-util-test$SUFFIX", + name="pjlib-util test", wdir="pjlib-util/bin"), + Operation(Operation.TEST, "./pjnath-test$SUFFIX", name="pjnath test", + wdir="pjnath/bin"), + Operation(Operation.TEST, "./pjmedia-test$SUFFIX", name="pjmedia test", + wdir="pjmedia/bin"), + Operation(Operation.TEST, "./pjsip-test$SUFFIX", name="pjsip test", + wdir="pjsip/bin") +] + +# +# These are pjsua Python based unit test operations +# +def build_pjsua_test_ops(pjsua_exe=""): + ops = [] + if pjsua_exe: + exe = " -e ../../pjsip-apps/bin/" + pjsua_exe + else: + exe = "" + cwd = os.getcwd() + os.chdir("../pjsua") + os.system("python runall.py --list > list") + f = open("list", "r") + for e in f: + e = e.rstrip("\r\n ") + (mod,param) = e.split(None,2) + name = mod[4:mod.find(".py")] + "_" + \ + param[param.find("/")+1:param.find(".py")] + ops.append(Operation(Operation.TEST, "python run.py" + exe + " " + \ + e, name=name, wdir="tests/pjsua")) + f.close() + os.remove("list") + os.chdir(cwd) + return ops + +# +# Get gcc version +# +def gcc_version(gcc): + proc = subprocess.Popen(gcc + " -v", stdout=subprocess.PIPE, + stderr=subprocess.STDOUT, shell=True) + ver = "" + while True: + s = proc.stdout.readline() + if not s: + break + if s.find("gcc version") >= 0: + ver = s.split(None, 3)[2] + break + proc.wait() + return "gcc-" + ver + +# +# Get Visual Studio version +# +def vs_get_version(): + proc = subprocess.Popen("cl", stdout=subprocess.PIPE, + stderr=subprocess.STDOUT) + while True: + s = proc.stdout.readline() + if s=="": + break + pos = s.find("Version") + if pos > 0: + proc.wait() + s = s[pos+8:] + ver = s.split(None, 1)[0] + major = ver[0:2] + if major=="12": + return "vs6" + elif major=="13": + return "vs2003" + elif major=="14": + return "vs2005" + elif major=="15": + return "vs2008" + else: + return "vs-" + major + proc.wait() + return "vs-unknown" + + +# +# Test config +# +class BaseConfig: + def __init__(self, base_dir, url, site, group, options=None): + self.base_dir = base_dir + self.url = url + self.site = site + self.group = group + self.options = options + +# +# Base class for test configurator +# +class TestBuilder: + def __init__(self, config, build_config_name="", + user_mak="", config_site="", exclude=[], not_exclude=[]): + self.config = config # BaseConfig instance + self.build_config_name = build_config_name # Optional build suffix + self.user_mak = user_mak # To be put in user.mak + self.config_site = config_site # To be put in config_s.. + self.saved_user_mak = "" # To restore user.mak + self.saved_config_site = "" # To restore config_s.. + self.exclude = exclude # List of exclude pattern + self.not_exclude = not_exclude # List of include pattern + self.ccdash_args = [] # ccdash cmd line + + def stamp(self): + return time.strftime("%Y%m%d-%H%M", time.localtime()) + + def pre_action(self): + # Override user.mak + name = self.config.base_dir + "/user.mak" + if os.access(name, os.F_OK): + f = open(name, "r") + self.saved_user_mak = f.read() + f.close() + if True: + f = open(name, "w") + f.write(self.user_mak) + f.close() + # Override config_site.h + name = self.config.base_dir + "/pjlib/include/pj/config_site.h" + if os.access(name, os.F_OK): + f = open(name, "r") + self.saved_config_site= f.read() + f.close() + if True: + f = open(name, "wt") + f.write(self.config_site) + f.close() + + + def post_action(self): + # Restore user.mak + name = self.config.base_dir + "/user.mak" + f = open(name, "wt") + f.write(self.saved_user_mak) + f.close() + # Restore config_site.h + name = self.config.base_dir + "/pjlib/include/pj/config_site.h" + f = open(name, "wt") + f.write(self.saved_config_site) + f.close() + + def build_tests(self): + # This should be overridden by subclasses + pass + + def execute(self): + if len(self.ccdash_args)==0: + self.build_tests() + self.pre_action() + mandatory_op = ["update", "configure", "build"] + counter = 0 + for a in self.ccdash_args: + # Check if this test is in exclusion list + fullcmd = " ".join(a) + excluded = False + included = False + for pat in self.exclude: + if pat and re.search(pat, fullcmd) != None: + excluded = True + break + if excluded: + for pat in self.not_exclude: + if pat and re.search(pat, fullcmd) != None: + included = True + break + if excluded and not included: + if len(fullcmd)>60: + fullcmd = fullcmd[0:60] + ".." + print "Skipping '%s'" % (fullcmd) + continue + + b = ["ccdash.py"] + b.extend(a) + a = b + #print a + try: + rc = ccdash.main(a) + except Exception, e: + errmsg = str(e) + print "**** Error: ccdash got exception %s ****" % errmsg + rc = -1 + except: + print "**** Error: ccdash got unknown exception ****" + rc = -1 + + if rc!=0 and a[1] in mandatory_op: + print "Stopping because of error.." + break + counter = counter + 1 + self.post_action() + + +# +# GNU test configurator +# +class GNUTestBuilder(TestBuilder): + """\ + This class creates list of tests suitable for GNU targets. + + """ + def __init__(self, config, build_config_name="", user_mak="", \ + config_site="", cross_compile="", exclude=[], not_exclude=[]): + """\ + Parameters: + config - BaseConfig instance + build_config_name - Optional name to be added as suffix to the build + name. Sample: "min-size", "O4", "TLS", etc. + user_mak - Contents to be put on user.mak + config_site - Contents to be put on config_site.h + cross_compile - Optional cross-compile prefix. Must include the + trailing dash, e.g. "arm-unknown-linux-" + exclude - List of regular expression patterns for tests + that will be excluded from the run + not_exclude - List of regular expression patterns for tests + that will be run regardless of whether they + match the excluded pattern. + + """ + TestBuilder.__init__(self, config, build_config_name=build_config_name, + user_mak=user_mak, config_site=config_site, + exclude=exclude, not_exclude=not_exclude) + self.cross_compile = cross_compile + if self.cross_compile and self.cross_compile[-1] != '-': + self.cross_compile.append("-") + + def build_tests(self): + if self.cross_compile: + suffix = "-" + self.cross_compile[0:-1] + build_name = self.cross_compile + \ + gcc_version(self.cross_compile + "gcc") + else: + proc = subprocess.Popen("sh "+self.config.base_dir+"/config.guess", + shell=True, stdout=subprocess.PIPE) + plat = proc.stdout.readline().rstrip(" \r\n") + build_name = plat + "-"+gcc_version(self.cross_compile + "gcc") + suffix = "-" + plat + + if self.build_config_name: + build_name = build_name + "-" + self.build_config_name + cmds = [] + cmds.extend(update_ops) + cmds.append(Operation(Operation.CONFIGURE, "sh ./configure")) + if sys.platform=="win32": + # Don't build python module on Mingw + cmds.append(Operation(Operation.BUILD, + "sh -c 'make distclean && make dep && make'")) + else: + cmds.append(Operation(Operation.BUILD, + "sh -c 'make distclean && make dep && make" + \ + " && cd pjsip-apps/src/python && " + \ + "python setup.py clean build'")) + + cmds.extend(std_test_ops) + cmds.extend(build_pjsua_test_ops()) + self.ccdash_args = [] + for c in cmds: + c.cmdline = c.cmdline.replace("$SUFFIX", suffix) + args = c.encode(self.config.base_dir) + args.extend(["-U", self.config.url, + "-S", self.config.site, + "-T", self.stamp(), + "-B", build_name, + "-G", self.config.group]) + args.extend(self.config.options) + self.ccdash_args.append(args) + +# +# MSVC test configurator +# +class MSVCTestBuilder(TestBuilder): + """\ + This class creates list of tests suitable for Visual Studio builds. + You need to set the MSVC environment variables (typically by calling + vcvars32.bat) prior to running this class. + + """ + def __init__(self, config, target="Release|Win32", build_config_name="", + config_site="", exclude=[], not_exclude=[]): + """\ + Parameters: + config - BaseConfig instance + target - Visual Studio build configuration to build. + Sample: "Debug|Win32", "Release|Win32". + build_config_name - Optional name to be added as suffix to the build + name. Sample: "Debug", "Release", "IPv6", etc. + config_site - Contents to be put on config_site.h + exclude - List of regular expression patterns for tests + that will be excluded from the run + not_exclude - List of regular expression patterns for tests + that will be run regardless of whether they + match the excluded pattern. + + """ + TestBuilder.__init__(self, config, build_config_name=build_config_name, + config_site=config_site, exclude=exclude, + not_exclude=not_exclude) + self.target = target.lower() + + def build_tests(self): + + (vsbuild,sys) = self.target.split("|",2) + + build_name = sys + "-" + vs_get_version() + "-" + vsbuild + + if self.build_config_name: + build_name = build_name + "-" + self.build_config_name + + vccmd = "vcbuild.exe /nologo /nohtmllog /nocolor /rebuild " + \ + "pjproject-vs8.sln " + " \"" + self.target + "\"" + + suffix = "-i386-win32-vc8-" + vsbuild + pjsua = "pjsua_vc8" + if vsbuild=="debug": + pjsua = pjsua + "d" + + cmds = [] + cmds.extend(update_ops) + cmds.append(Operation(Operation.CONFIGURE, "CMD /C echo Nothing to do")) + cmds.append(Operation(Operation.BUILD, vccmd)) + cmds.extend(std_test_ops) + cmds.extend(build_pjsua_test_ops(pjsua)) + + self.ccdash_args = [] + for c in cmds: + c.cmdline = c.cmdline.replace("$SUFFIX", suffix) + args = c.encode(self.config.base_dir) + args.extend(["-U", self.config.url, + "-S", self.config.site, + "-T", self.stamp(), + "-B", build_name, + "-G", self.config.group]) + args.extend(self.config.options) + self.ccdash_args.append(args) + + +# +# Symbian test configurator +# +class SymbianTestBuilder(TestBuilder): + """\ + This class creates list of tests suitable for Symbian builds. You need to + set the command line build settings prior to running this class (typically + that involves setting the EPOCROOT variable and current device). + + """ + def __init__(self, config, target="gcce urel", build_config_name="", + config_site="", exclude=[], not_exclude=[]): + """\ + Parameters: + config - BaseConfig instance + target - Symbian target to build. Default is "gcce urel". + build_config_name - Optional name to be added as suffix to the build + name. Sample: "APS", "VAS", etc. + config_site - Contents to be put on config_site.h + exclude - List of regular expression patterns for tests + that will be excluded from the run + not_exclude - List of regular expression patterns for tests + that will be run regardless of whether they + match the excluded pattern. + + """ + TestBuilder.__init__(self, config, build_config_name=build_config_name, + config_site=config_site, exclude=exclude, + not_exclude=not_exclude) + self.target = target.lower() + + def build_tests(self): + + # Check that EPOCROOT is set + if not "EPOCROOT" in os.environ: + print "Error: EPOCROOT environment variable is not set" + sys.exit(1) + epocroot = os.environ["EPOCROOT"] + # EPOCROOT must have trailing backslash + if epocroot[-1] != "\\": + epocroot = epocroot + "\\" + os.environ["EPOCROOT"] = epocroot + sdk1 = epocroot.split("\\")[-2] + + # Check that correct device is set + proc = subprocess.Popen("devices", stdout=subprocess.PIPE, + stderr=subprocess.STDOUT, shell=True) + sdk2 = "" + while True: + line = proc.stdout.readline() + if line.find("- default") > 0: + sdk2 = line.split(":",1)[0] + break + proc.wait() + + if sdk1 != sdk2: + print "Error: default SDK in device doesn't match EPOCROOT" + print "Default device SDK =", sdk2 + print "EPOCROOT SDK =", sdk1 + sys.exit(1) + + build_name = sdk2.replace("_", "-") + "-" + \ + self.target.replace(" ", "-") + + if self.build_config_name: + build_name = build_name + "-" + self.build_config_name + + cmdline = "cmd /C \"cd build.symbian && bldmake bldfiles && abld build %s\"" % (self.target) + + cmds = [] + cmds.extend(update_ops) + cmds.append(Operation(Operation.CONFIGURE, "CMD /C echo Nothing to do")) + cmds.extend([Operation(Operation.BUILD, cmdline)]) + + self.ccdash_args = [] + suffix = "" + for c in cmds: + c.cmdline = c.cmdline.replace("$SUFFIX", suffix) + args = c.encode(self.config.base_dir) + args.extend(["-U", self.config.url, + "-S", self.config.site, + "-T", self.stamp(), + "-B", build_name, + "-G", self.config.group]) + args.extend(self.config.options) + self.ccdash_args.append(args) + diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/cdash/cfg_gnu.py b/sflphone-common/libs/pjproject-1.0.2/tests/cdash/cfg_gnu.py new file mode 100644 index 0000000000000000000000000000000000000000..8411b654a64dac30a0762b2487d51d3ace7a2d17 --- /dev/null +++ b/sflphone-common/libs/pjproject-1.0.2/tests/cdash/cfg_gnu.py @@ -0,0 +1,73 @@ +# +# cfg_gnu.py - GNU target configurator +# +# Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.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 +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +import builder +import os +import sys + +# Each configurator must export this function +def create_builder(args): + usage = """\ +Usage: + main.py cfg_gnu [-h|--help] [cfg_site] + +Arguments: + cfg_site: site configuration module. If not specified, "cfg_site" + is implied + -h, --help Show this help screen + +""" + # (optional) args format: + # site configuration module. If not specified, "cfg_site" is implied + + cfg_site = "cfg_site" + + for arg in args: + if arg=="-h" or arg=="--help": + print usage + sys.exit(0) + elif arg[0]=="-": + print usage + sys.exit(1) + else: + cfg_site = arg + + if os.access(cfg_site+".py", os.F_OK) == False: + print "Error: file '%s.py' doesn't exist." % (cfg_site) + sys.exit(1) + + cfg_site = __import__(cfg_site) + test_cfg = builder.BaseConfig(cfg_site.BASE_DIR, \ + cfg_site.URL, \ + cfg_site.SITE_NAME, \ + cfg_site.GROUP, \ + cfg_site.OPTIONS) + + config_site = "#define PJ_TODO(x)\n" + cfg_site.CONFIG_SITE + user_mak = "export CFLAGS+=-Wall\n" + cfg_site.USER_MAK + + builders = [ + builder.GNUTestBuilder(test_cfg, build_config_name="default", + user_mak=user_mak, + config_site=config_site, + exclude=cfg_site.EXCLUDE, + not_exclude=cfg_site.NOT_EXCLUDE) + ] + + return builders diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/cdash/cfg_msvc.py b/sflphone-common/libs/pjproject-1.0.2/tests/cdash/cfg_msvc.py new file mode 100644 index 0000000000000000000000000000000000000000..26b07855b202a0528f002e376911254d87ad4121 --- /dev/null +++ b/sflphone-common/libs/pjproject-1.0.2/tests/cdash/cfg_msvc.py @@ -0,0 +1,82 @@ +# +# cfg_msvc.py - MSVC/Visual Studio target configurator +# +# Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.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 +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +import builder +import os +import sys + +# Each configurator must export this function +def create_builder(args): + usage = """\ +Usage: + main.py cfg_msvc [-h|--help] [-t|--target TARGET] [cfg_site] + +Arguments: + cfg_site: site configuration module. If not specified, "cfg_site" + is implied + -t,--target TARGET: Visual Studio build configuration to build. Default is + "Release|Win32". Sample values: "Debug|Win32" + -h, --help Show this help screen + +""" + + cfg_site = "cfg_site" + target = "Release|Win32" + in_option = "" + + for arg in args: + if in_option=="-t": + target = arg + in_option = "" + elif arg=="--target" or arg=="-t": + in_option = "-t" + elif arg=="-h" or arg=="--help": + print usage + sys.exit(0) + elif arg[0]=="-": + print usage + sys.exit(1) + else: + cfg_site = arg + + if os.access(cfg_site+".py", os.F_OK) == False: + print "Error: file '%s.py' doesn't exist." % (cfg_site) + sys.exit(1) + + cfg_site = __import__(cfg_site) + test_cfg = builder.BaseConfig(cfg_site.BASE_DIR, \ + cfg_site.URL, \ + cfg_site.SITE_NAME, \ + cfg_site.GROUP, \ + cfg_site.OPTIONS) + + config_site = "#define PJ_TODO(x)\n" + cfg_site.CONFIG_SITE + user_mak = cfg_site.USER_MAK + + builders = [ + builder.MSVCTestBuilder(test_cfg, + target=target, + build_config_name="default", + config_site=config_site, + exclude=cfg_site.EXCLUDE, + not_exclude=cfg_site.NOT_EXCLUDE) + ] + + return builders + diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/cdash/cfg_site_sample.py b/sflphone-common/libs/pjproject-1.0.2/tests/cdash/cfg_site_sample.py new file mode 100644 index 0000000000000000000000000000000000000000..b05964279c2a34e399377d3c5bd18185f562411c --- /dev/null +++ b/sflphone-common/libs/pjproject-1.0.2/tests/cdash/cfg_site_sample.py @@ -0,0 +1,50 @@ +# +# cfg_site_sample.py - Sample site configuration +# +# Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.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 +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +import builder + +# Your site name +SITE_NAME="Newham3" + +# The URL where tests will be submitted to +URL = "http://192.168.0.2/dash/submit.php?project=PJSIP" + +# Test group +GROUP = "Experimental" + +# PJSIP base directory +BASE_DIR = "/root/project/pjproject" + +# List of additional ccdash options +#OPTIONS = ["-o", "out.xml", "-y"] +OPTIONS = [] + +# What's the content of config_site.h +CONFIG_SITE = "" + +# What's the content of user.mak +USER_MAK = "" + +# List of regular expression of test patterns to be excluded +EXCLUDE = [] + +# List of regular expression of test patterns to be included (even +# if they match EXCLUDE patterns) +NOT_EXCLUDE = [] +#"configure", "update", "build.*make", "build", "run.py mod_run.*100_simple"] diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/cdash/cfg_symbian.py b/sflphone-common/libs/pjproject-1.0.2/tests/cdash/cfg_symbian.py new file mode 100644 index 0000000000000000000000000000000000000000..94f5f3f6b626fcc791077b578e50ac1f55fa5b54 --- /dev/null +++ b/sflphone-common/libs/pjproject-1.0.2/tests/cdash/cfg_symbian.py @@ -0,0 +1,86 @@ +# +# cfg_symbian.py - Symbian target configurator +# +# Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.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 +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +import builder +import os +import sys + +# Each configurator must export this function +def create_builder(args): + usage = """\ +Usage: + main.py cfg_symbian [-h|--help] [-t|--target TARGET] [cfg_site] + +Arguments: + cfg_site: site configuration module. If not specified, "cfg_site" + is implied + -t,--target TARGET: Symbian target to build. Default is "gcce urel". + Other values: + "winscw udeb", "gcce udeb", etc. + -h, --help Show this help screen +""" + + cfg_site = "cfg_site" + target = "gcce urel" + in_option = "" + + for arg in args: + if in_option=="-t": + target = arg + in_option = "" + elif arg=="--target" or arg=="-t": + in_option = "-t" + elif arg=="--help" or arg=="-h": + print usage + sys.exit(0) + elif arg[0]=="-": + print usage + sys.exit(1) + else: + cfg_site = arg + + if os.access(cfg_site+".py", os.F_OK) == False: + print "Error: file '%s.py' doesn't exist." % (cfg_site) + sys.exit(1) + + cfg_site = __import__(cfg_site) + test_cfg = builder.BaseConfig(cfg_site.BASE_DIR, \ + cfg_site.URL, \ + cfg_site.SITE_NAME, \ + cfg_site.GROUP, \ + cfg_site.OPTIONS) + config_site1 = """\ +#define PJ_TODO(x) +#include <pj/config_site_sample.h> + +""" + + config_Site = config_site1 + cfg_site.CONFIG_SITE + + builders = [ + builder.SymbianTestBuilder(test_cfg, + target=target, + build_config_name="default", + config_site=config_site1, + exclude=cfg_site.EXCLUDE, + not_exclude=cfg_site.NOT_EXCLUDE) + ] + + return builders + diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/cdash/inc_test.py b/sflphone-common/libs/pjproject-1.0.2/tests/cdash/inc_test.py new file mode 100644 index 0000000000000000000000000000000000000000..8b137891791fe96927ad78e64b0aad7bded08bdc --- /dev/null +++ b/sflphone-common/libs/pjproject-1.0.2/tests/cdash/inc_test.py @@ -0,0 +1 @@ + diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/cdash/main.py b/sflphone-common/libs/pjproject-1.0.2/tests/cdash/main.py new file mode 100644 index 0000000000000000000000000000000000000000..8a99371455696255e816d28378f4ca63806ceb4d --- /dev/null +++ b/sflphone-common/libs/pjproject-1.0.2/tests/cdash/main.py @@ -0,0 +1,42 @@ +#!/bin/env python + +# +# main.py - main entry for PJSIP's CDash tests +# +# Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.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 +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# + +import sys + +if len(sys.argv)==1: + print "Usage: main.py cfg_file [cfg_site]" + print "Example:" + print " main.py cfg_gnu" + print " main.py cfg_gnu custom_cfg_site" + sys.exit(1) + + +args = [] +args.extend(sys.argv) +args.remove(args[1]) +args.remove(args[0]) + +cfg_file = __import__(sys.argv[1]) +builders = cfg_file.create_builder(args) + +for builder in builders: + builder.execute() diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/cdash/starttest_sample.bat b/sflphone-common/libs/pjproject-1.0.2/tests/cdash/starttest_sample.bat new file mode 100644 index 0000000000000000000000000000000000000000..752e38dbe79b3d28a9fecff37487b5191b257a4d --- /dev/null +++ b/sflphone-common/libs/pjproject-1.0.2/tests/cdash/starttest_sample.bat @@ -0,0 +1,44 @@ +@echo off + +rem *** +rem ************** VS 2005 ************** +rem *** +set OLD_PATH=%PATH% +set OLD_INCLUDE=%INCLUDE% +set OLD_LIB=%LIB% +set OLD_LIBPATH=%LIBPATH% + +call "C:\Program Files\Microsoft Visual Studio 8\VC\bin\vcvars32.bat" x86 +python main.py cfg_msvc -t "Debug|Win32" +python main.py cfg_msvc -t "Release|Win32" + +set PATH=%OLD_PATH% +set INCLUDE=%OLD_INCLUDE% +set LIB=%OLD_LIB% +set LIBPATH=%OLD_LIBPATH% + + +rem *** +rem ************** S60 3rd FP1 ************** +rem *** +set EPOCROOT=\symbian\9.2\S60_3rd_FP1\ +devices -setdefault @S60_3rd_FP1:com.nokia.s60 +python main.py cfg_symbian -t "winscw udeb" +python main.py cfg_symbian -t "gcce udeb" +python main.py cfg_symbian -t "gcce urel" + + +rem *** +rem ************** Mingw ************** +rem *** +set MSYSTEM=MINGW32 +set DISPLAY= +C:\msys\1.0\bin\sh -c "python main.py cfg_gnu" + + +rem *** +rem ************** Linux ************** +rem *** +set PATH=%PATH%;c:\msys\1.0\bin +set HOME=C:\msys\1.0\home\Administrator +C:\mingw\bin\ssh test@192.168.0.12 "cd project/pjproject/tests/cdash && python main.py cfg_gnu" diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/README.TXT b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/README.TXT similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/README.TXT rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/README.TXT diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/config_site.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/config_site.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/config_site.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/config_site.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/inc_cfg.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/inc_cfg.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/inc_cfg.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/inc_cfg.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/inc_const.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/inc_const.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/inc_const.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/inc_const.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/inc_sdp.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/inc_sdp.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/inc_sdp.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/inc_sdp.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/inc_sip.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/inc_sip.py similarity index 98% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/inc_sip.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/inc_sip.py index 0073ba6eb3926422676bf0172c5d5fe6b374e237..03f96945e05066770fa459a5bf6f42e06115ee52 100644 --- a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/inc_sip.py +++ b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/inc_sip.py @@ -1,4 +1,4 @@ -# $Id: inc_sip.py 2110 2008-07-07 20:14:41Z bennylp $ +# $Id: inc_sip.py 2548 2009-03-23 13:28:30Z bennylp $ # from socket import * import re @@ -91,11 +91,7 @@ class Dialog: if self.trace_enabled: print str(time.strftime("%H:%M:%S ")) + txt - def create_req(self, method, sdp, branch="", extra_headers=""): - if branch=="": - self.cseq = self.cseq + 1 - msg = req_templ - msg = msg.replace("$METHOD", method) + def update_fields(self, msg): if self.tcp: transport_param = ";transport=tcp" else: @@ -103,14 +99,23 @@ class Dialog: msg = msg.replace("$TARGET_URI", "sip:"+self.dst_addr+":"+str(self.dst_port) + transport_param) msg = msg.replace("$LOCAL_IP", self.local_ip) msg = msg.replace("$LOCAL_PORT", str(self.local_port)) - if branch=="": - branch=str(random.random()) - msg = msg.replace("$BRANCH", branch) msg = msg.replace("$FROM_TAG", self.local_tag) msg = msg.replace("$TO_TAG", self.rem_tag) msg = msg.replace("$CALL_ID", self.call_id) msg = msg.replace("$CSEQ", str(self.cseq)) + branch=str(random.random()) + msg = msg.replace("$BRANCH", branch) + return msg + + def create_req(self, method, sdp, branch="", extra_headers=""): + if branch=="": + self.cseq = self.cseq + 1 + msg = req_templ + msg = msg.replace("$METHOD", method) msg = msg.replace("$SIP_HEADERS", extra_headers) + if branch=="": + branch=str(random.random()) + msg = msg.replace("$BRANCH", branch) if sdp!="": msg = msg.replace("$CONTENT_LENGTH", str(len(sdp))) msg = msg + "Content-Type: application/sdp\r\n" @@ -118,7 +123,7 @@ class Dialog: msg = msg.replace("$CONTENT_LENGTH", "0") msg = msg + "\r\n" msg = msg + sdp - return msg + return self.update_fields(msg) def create_response(self, request, code, reason, to_tag=""): response = "SIP/2.0 " + str(code) + " " + reason + "\r\n" diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/mod_call.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/mod_call.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/mod_call.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/mod_call.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/mod_media_playrec.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/mod_media_playrec.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/mod_media_playrec.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/mod_media_playrec.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/mod_pesq.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/mod_pesq.py similarity index 93% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/mod_pesq.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/mod_pesq.py index be0aab245df55f41d7bc8180bfcc09dc04f45044..e2dbb60af81f6643de137c2a65c204e4597995c1 100644 --- a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/mod_pesq.py +++ b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/mod_pesq.py @@ -1,4 +1,4 @@ -# $Id: mod_pesq.py 2238 2008-08-26 12:15:31Z bennylp $ +# $Id: mod_pesq.py 2417 2009-01-05 15:31:25Z bennylp $ # Quality test of media calls. # - UA1 calls UA2 @@ -12,6 +12,7 @@ import time import imp +import os import sys import re import subprocess @@ -25,7 +26,7 @@ from inc_cfg import * cfg_file = imp.load_source("cfg_file", ARGS[1]) # PESQ configs -PESQ = "tools/pesq.exe" # PESQ executable path +PESQ = "tools/pesq" # PESQ executable path PESQ_DEFAULT_THRESHOLD = 3.4 # Default minimum acceptable PESQ MOS value # PESQ params @@ -123,9 +124,9 @@ def post_func(t): endpt = t.process[0] # Execute PESQ - fullcmd = PESQ + " " + pesq_sample_rate_opt + " " + input_filename + " " + output_filename + fullcmd = os.path.normpath(PESQ) + " " + pesq_sample_rate_opt + " " + input_filename + " " + output_filename endpt.trace("Popen " + fullcmd) - pesq_proc = subprocess.Popen(fullcmd, stdout=subprocess.PIPE, universal_newlines=True) + pesq_proc = subprocess.Popen(fullcmd, shell=True, stdout=subprocess.PIPE, universal_newlines=True) pesq_out = pesq_proc.communicate() # Parse ouput diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/mod_pres.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/mod_pres.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/mod_pres.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/mod_pres.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/mod_recvfrom.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/mod_recvfrom.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/mod_recvfrom.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/mod_recvfrom.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/mod_run.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/mod_run.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/mod_run.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/mod_run.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/mod_sendto.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/mod_sendto.py similarity index 93% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/mod_sendto.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/mod_sendto.py index 97f0f0eb93982bf40ef0aaf8cfb3044d5867eed0..cf6038ee99d4b8d5cae36221517c16d0056211be 100644 --- a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/mod_sendto.py +++ b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/mod_sendto.py @@ -1,4 +1,4 @@ -# $Id: mod_sendto.py 2080 2008-06-27 21:22:12Z bennylp $ +# $Id: mod_sendto.py 2548 2009-03-23 13:28:30Z bennylp $ import imp import sys import inc_sip as sip @@ -19,7 +19,7 @@ def test_func(t): cfg = cfg_file.sendto_cfg if len(cfg.complete_msg) != 0: - req = cfg.complete_msg + req = dlg.update_fields(cfg.complete_msg) else: req = dlg.create_invite(cfg.sdp, cfg.extra_headers) resp = dlg.send_request_wait(req, 10) diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/run.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/run.py similarity index 94% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/run.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/run.py index 18603e3ab9fc325261001650feb0cdf501c27056..0faef5cd2f4909088191b359d03b8e729267c754 100644 --- a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/run.py +++ b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/run.py @@ -1,4 +1,4 @@ -# $Id: run.py 2392 2008-12-22 18:54:58Z bennylp $ +# $Id: run.py 2414 2009-01-04 20:15:37Z bennylp $ import sys import imp import re @@ -80,7 +80,7 @@ if G_EXE == "": sys.exit(1) G_INUNIX = False else: - f = open("../../../build.mak", "r") + f = open("../../build.mak", "r") while True: line = f.readline() if not line: @@ -161,7 +161,8 @@ class Expect: def wait(self): self.trace("wait") - self.proc.wait() + self.proc.communicate() + def trace(self, s): if self.trace_enabled: now = time.time() @@ -177,8 +178,20 @@ def handle_error(errmsg, t, close_processes = True): for p in t.process: p.send("q") p.send("q") - p.expect(const.DESTROYED, False) - p.wait() + is_err = False + try: + ret = p.expect(const.DESTROYED, False) + if not ret: + is_err = True + except: + is_err = True + if is_err: + if sys.hexversion >= 0x02060000: + p.proc.terminate() + else: + p.wait() + else: + p.wait() print "Test completed with error: " + errmsg sys.exit(1) diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/runall.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/runall.py similarity index 95% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/runall.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/runall.py index 4dcd0a5380a69fed54ca311a57e70158843abf15..ac9aefee969f9ffc6c987129eb7c5d75e81cd665 100644 --- a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/runall.py +++ b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/runall.py @@ -1,4 +1,4 @@ -# $Id: runall.py 2111 2008-07-07 20:15:25Z bennylp $ +# $Id: runall.py 2398 2008-12-29 14:52:29Z bennylp $ import os import sys import time @@ -57,6 +57,12 @@ for f in os.listdir("scripts-recvfrom"): for pat in excluded_tests: tests = [t for t in tests if t.find(pat)==-1] +# List the tests only? +if len(sys.argv)==2 and sys.argv[1]=="--list": + for t in tests: + print t + sys.exit(0) + # Resume test? resume_script="" if len(sys.argv) > 1: diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-call/100_simplecall.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-call/100_simplecall.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-call/100_simplecall.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-call/100_simplecall.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-call/150_srtp_0_1.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-call/150_srtp_0_1.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-call/150_srtp_0_1.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-call/150_srtp_0_1.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-call/150_srtp_1_0.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-call/150_srtp_1_0.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-call/150_srtp_1_0.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-call/150_srtp_1_0.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-call/150_srtp_1_1.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-call/150_srtp_1_1.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-call/150_srtp_1_1.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-call/150_srtp_1_1.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-call/150_srtp_1_2.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-call/150_srtp_1_2.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-call/150_srtp_1_2.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-call/150_srtp_1_2.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-call/150_srtp_2_1.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-call/150_srtp_2_1.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-call/150_srtp_2_1.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-call/150_srtp_2_1.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-call/150_srtp_2_2.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-call/150_srtp_2_2.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-call/150_srtp_2_2.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-call/150_srtp_2_2.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-call/200_tcp.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-call/200_tcp.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-call/200_tcp.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-call/200_tcp.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-call/300_ice_0_1.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-call/300_ice_0_1.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-call/300_ice_0_1.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-call/300_ice_0_1.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-call/300_ice_1_0.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-call/300_ice_1_0.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-call/300_ice_1_0.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-call/300_ice_1_0.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-call/300_ice_1_1.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-call/300_ice_1_1.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-call/300_ice_1_1.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-call/300_ice_1_1.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-call/301_ice_public_a.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-call/301_ice_public_a.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-call/301_ice_public_a.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-call/301_ice_public_a.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-call/301_ice_public_b.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-call/301_ice_public_b.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-call/301_ice_public_b.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-call/301_ice_public_b.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-call/305_ice_comp_1_2.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-call/305_ice_comp_1_2.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-call/305_ice_comp_1_2.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-call/305_ice_comp_1_2.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-call/305_ice_comp_2_1.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-call/305_ice_comp_2_1.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-call/305_ice_comp_2_1.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-call/305_ice_comp_2_1.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-call/350_prack_a.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-call/350_prack_a.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-call/350_prack_a.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-call/350_prack_a.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-call/350_prack_b.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-call/350_prack_b.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-call/350_prack_b.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-call/350_prack_b.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-media-playrec/100_resample_lf_11_16.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-media-playrec/100_resample_lf_11_16.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-media-playrec/100_resample_lf_11_16.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-media-playrec/100_resample_lf_11_16.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-media-playrec/100_resample_lf_11_22.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-media-playrec/100_resample_lf_11_22.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-media-playrec/100_resample_lf_11_22.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-media-playrec/100_resample_lf_11_22.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-media-playrec/100_resample_lf_11_32.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-media-playrec/100_resample_lf_11_32.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-media-playrec/100_resample_lf_11_32.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-media-playrec/100_resample_lf_11_32.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-media-playrec/100_resample_lf_11_44.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-media-playrec/100_resample_lf_11_44.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-media-playrec/100_resample_lf_11_44.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-media-playrec/100_resample_lf_11_44.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-media-playrec/100_resample_lf_11_48.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-media-playrec/100_resample_lf_11_48.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-media-playrec/100_resample_lf_11_48.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-media-playrec/100_resample_lf_11_48.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-media-playrec/100_resample_lf_11_8.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-media-playrec/100_resample_lf_11_8.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-media-playrec/100_resample_lf_11_8.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-media-playrec/100_resample_lf_11_8.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-media-playrec/100_resample_lf_8_11.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-media-playrec/100_resample_lf_8_11.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-media-playrec/100_resample_lf_8_11.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-media-playrec/100_resample_lf_8_11.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-media-playrec/100_resample_lf_8_16.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-media-playrec/100_resample_lf_8_16.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-media-playrec/100_resample_lf_8_16.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-media-playrec/100_resample_lf_8_16.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-media-playrec/100_resample_lf_8_22.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-media-playrec/100_resample_lf_8_22.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-media-playrec/100_resample_lf_8_22.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-media-playrec/100_resample_lf_8_22.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-media-playrec/100_resample_lf_8_32.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-media-playrec/100_resample_lf_8_32.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-media-playrec/100_resample_lf_8_32.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-media-playrec/100_resample_lf_8_32.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-media-playrec/100_resample_lf_8_44.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-media-playrec/100_resample_lf_8_44.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-media-playrec/100_resample_lf_8_44.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-media-playrec/100_resample_lf_8_44.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-media-playrec/100_resample_lf_8_48.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-media-playrec/100_resample_lf_8_48.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-media-playrec/100_resample_lf_8_48.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-media-playrec/100_resample_lf_8_48.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-pesq/100_defaults.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-pesq/100_defaults.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-pesq/100_defaults.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-pesq/100_defaults.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-pesq/101_defaults.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-pesq/101_defaults.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-pesq/101_defaults.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-pesq/101_defaults.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-pesq/200_codec_g711a.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-pesq/200_codec_g711a.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-pesq/200_codec_g711a.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-pesq/200_codec_g711a.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-pesq/200_codec_g711u.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-pesq/200_codec_g711u.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-pesq/200_codec_g711u.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-pesq/200_codec_g711u.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-pesq/200_codec_g722.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-pesq/200_codec_g722.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-pesq/200_codec_g722.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-pesq/200_codec_g722.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-pesq/200_codec_gsm.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-pesq/200_codec_gsm.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-pesq/200_codec_gsm.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-pesq/200_codec_gsm.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-pesq/200_codec_ilbc.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-pesq/200_codec_ilbc.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-pesq/200_codec_ilbc.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-pesq/200_codec_ilbc.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-pesq/200_codec_l16_16000.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-pesq/200_codec_l16_16000.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-pesq/200_codec_l16_16000.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-pesq/200_codec_l16_16000.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-pesq/200_codec_l16_16000_stereo.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-pesq/200_codec_l16_16000_stereo.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-pesq/200_codec_l16_16000_stereo.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-pesq/200_codec_l16_16000_stereo.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-pesq/200_codec_l16_8000.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-pesq/200_codec_l16_8000.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-pesq/200_codec_l16_8000.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-pesq/200_codec_l16_8000.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-pesq/200_codec_l16_8000_stereo.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-pesq/200_codec_l16_8000_stereo.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-pesq/200_codec_l16_8000_stereo.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-pesq/200_codec_l16_8000_stereo.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-pesq/200_codec_speex_16000.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-pesq/200_codec_speex_16000.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-pesq/200_codec_speex_16000.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-pesq/200_codec_speex_16000.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-pesq/200_codec_speex_8000.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-pesq/200_codec_speex_8000.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-pesq/200_codec_speex_8000.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-pesq/200_codec_speex_8000.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-pesq/201_codec_g711a.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-pesq/201_codec_g711a.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-pesq/201_codec_g711a.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-pesq/201_codec_g711a.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-pesq/201_codec_g711u.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-pesq/201_codec_g711u.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-pesq/201_codec_g711u.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-pesq/201_codec_g711u.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-pesq/201_codec_g722.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-pesq/201_codec_g722.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-pesq/201_codec_g722.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-pesq/201_codec_g722.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-pesq/201_codec_gsm.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-pesq/201_codec_gsm.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-pesq/201_codec_gsm.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-pesq/201_codec_gsm.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-pesq/201_codec_ilbc.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-pesq/201_codec_ilbc.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-pesq/201_codec_ilbc.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-pesq/201_codec_ilbc.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-pesq/201_codec_l16_16000.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-pesq/201_codec_l16_16000.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-pesq/201_codec_l16_16000.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-pesq/201_codec_l16_16000.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-pesq/201_codec_l16_16000_stereo.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-pesq/201_codec_l16_16000_stereo.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-pesq/201_codec_l16_16000_stereo.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-pesq/201_codec_l16_16000_stereo.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-pesq/201_codec_l16_8000.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-pesq/201_codec_l16_8000.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-pesq/201_codec_l16_8000.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-pesq/201_codec_l16_8000.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-pesq/201_codec_l16_8000_stereo.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-pesq/201_codec_l16_8000_stereo.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-pesq/201_codec_l16_8000_stereo.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-pesq/201_codec_l16_8000_stereo.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-pesq/201_codec_speex_16000.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-pesq/201_codec_speex_16000.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-pesq/201_codec_speex_16000.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-pesq/201_codec_speex_16000.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-pesq/201_codec_speex_8000.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-pesq/201_codec_speex_8000.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-pesq/201_codec_speex_8000.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-pesq/201_codec_speex_8000.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-pres/100_peertopeer.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-pres/100_peertopeer.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-pres/100_peertopeer.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-pres/100_peertopeer.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-pres/200_publish.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-pres/200_publish.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-pres/200_publish.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-pres/200_publish.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-recvfrom/200_reg_good_enocredentiall.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-recvfrom/200_reg_good_enocredentiall.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-recvfrom/200_reg_good_enocredentiall.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-recvfrom/200_reg_good_enocredentiall.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-recvfrom/201_reg_good_ok.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-recvfrom/201_reg_good_ok.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-recvfrom/201_reg_good_ok.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-recvfrom/201_reg_good_ok.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-recvfrom/202_reg_good_ok_wildcard.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-recvfrom/202_reg_good_ok_wildcard.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-recvfrom/202_reg_good_ok_wildcard.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-recvfrom/202_reg_good_ok_wildcard.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-recvfrom/205_reg_good_no_realm.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-recvfrom/205_reg_good_no_realm.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-recvfrom/205_reg_good_no_realm.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-recvfrom/205_reg_good_no_realm.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-recvfrom/206_reg_good_efailedcredential.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-recvfrom/206_reg_good_efailedcredential.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-recvfrom/206_reg_good_efailedcredential.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-recvfrom/206_reg_good_efailedcredential.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-recvfrom/208_reg_good_retry_nonce_ok.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-recvfrom/208_reg_good_retry_nonce_ok.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-recvfrom/208_reg_good_retry_nonce_ok.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-recvfrom/208_reg_good_retry_nonce_ok.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-recvfrom/215_reg_good_multi_ok.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-recvfrom/215_reg_good_multi_ok.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-recvfrom/215_reg_good_multi_ok.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-recvfrom/215_reg_good_multi_ok.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-recvfrom/220_reg_good_ims_ok.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-recvfrom/220_reg_good_ims_ok.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-recvfrom/220_reg_good_ims_ok.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-recvfrom/220_reg_good_ims_ok.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-recvfrom/230_reg_bad_fail_stale_true.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-recvfrom/230_reg_bad_fail_stale_true.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-recvfrom/230_reg_bad_fail_stale_true.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-recvfrom/230_reg_bad_fail_stale_true.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-recvfrom/231_reg_bad_fail_stale_false_nonce_changed.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-recvfrom/231_reg_bad_fail_stale_false_nonce_changed.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-recvfrom/231_reg_bad_fail_stale_false_nonce_changed.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-recvfrom/231_reg_bad_fail_stale_false_nonce_changed.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-recvfrom/234_reg_bad_stale_ok.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-recvfrom/234_reg_bad_stale_ok.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-recvfrom/234_reg_bad_stale_ok.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-recvfrom/234_reg_bad_stale_ok.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-run/100_simple.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-run/100_simple.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-run/100_simple.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-run/100_simple.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-run/200_register.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-run/200_register.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-run/200_register.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-run/200_register.py diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/001_torture_4475_3_1_1_1.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/001_torture_4475_3_1_1_1.py new file mode 100644 index 0000000000000000000000000000000000000000..01ddd9a6c27b3407117522e7b0bc7f2c5362f773 --- /dev/null +++ b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/001_torture_4475_3_1_1_1.py @@ -0,0 +1,52 @@ +# $Id: 001_torture_4475_3_1_1_1.py 2538 2009-03-23 13:14:26Z bennylp $ +import inc_sip as sip +import inc_sdp as sdp + +# Torture message from RFC 4475 +# 3.1.1. Valid Messages +# 3.1.1.1. A Short Tortuous INVITE +complete_msg = \ +"""INVITE sip:vivekg@chair-dnrc.example.com;unknownparam SIP/2.0 +TO : + sip:vivekg@chair-dnrc.example.com ; tag = 1918181833n +from : "J Rosenberg \\\\\\"" <sip:jdrosen@example.com> + ; + tag = 98asjd8 +MaX-fOrWaRdS: 0068 +Call-ID: wsinv.ndaksdj@192.0.2.1 +Content-Length : 150 +cseq: 0009 + INVITE +Via : SIP / 2.0 + /UDP + 192.0.2.2;rport;branch=390skdjuw +s : +NewFangledHeader: newfangled value + continued newfangled value +UnknownHeaderWithUnusualValue: ;;,,;;,; +Content-Type: application/sdp +Route: + <sip:services.example.com;lr;unknownwith=value;unknown-no-value> +v: SIP / 2.0 / TCP spindle.example.com ; + branch = z9hG4bK9ikj8 , + SIP / 2.0 / UDP 192.168.255.111 ; branch= + z9hG4bK30239 +m:"Quoted string \\"\\"" <sip:jdrosen@example.com> ; newparam = + newvalue ; + secondparam ; q = 0.33 + +v=0 +o=mhandley 29739 7272939 IN IP4 192.0.2.3 +s=- +c=IN IP4 192.0.2.4 +t=0 0 +m=audio 49217 RTP/AVP 0 12 +m=video 3227 RTP/AVP 31 +a=rtpmap:31 LPC +""" + + +sendto_cfg = sip.SendtoCfg( "RFC 4475 3.1.1.1", + "--null-audio --auto-answer 200", + "", 481, complete_msg=complete_msg) + diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/001_torture_4475_3_1_1_2.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/001_torture_4475_3_1_1_2.py new file mode 100644 index 0000000000000000000000000000000000000000..5893093293b29bdfecfcedc482f517450d969c2d --- /dev/null +++ b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/001_torture_4475_3_1_1_2.py @@ -0,0 +1,25 @@ +# $Id: 001_torture_4475_3_1_1_2.py 2538 2009-03-23 13:14:26Z bennylp $ +import inc_sip as sip +import inc_sdp as sdp + +# Torture message from RFC 4475 +# 3.1.1. Valid Messages +# 3.1.1.2. Wide Range of Valid Characters +complete_msg = \ +"""!interesting-Method0123456789_*+`.%indeed'~ sip:1_unusual.URI~(to-be!sure)&isn't+it$/crazy?,/;;*:&it+has=1,weird!*pas$wo~d_too.(doesn't-it)@example.com SIP/2.0 +Via: SIP/2.0/UDP host1.example.com;rport;branch=z9hG4bK-.!%66*_+`'~ +To: "BEL:\\\x07 NUL:\\\x00 DEL:\\\x7F" <sip:1_unusual.URI~(to-be!sure)&isn't+it$/crazy?,/;;*@example.com> +From: token1~` token2'+_ token3*%!.- <sip:mundane@example.com> ;fromParam''~+*_!.-%="\xD1\x80\xD0\xB0\xD0\xB1\xD0\xBE\xD1\x82\xD0\xB0\xD1\x8E\xD1\x89\xD0\xB8\xD0\xB9";tag=_token~1'+`*%!-. +Call-ID: intmeth.word%ZK-!.*_+'@word`~)(><:\\/"][?}{ +CSeq: 139122385 !interesting-Method0123456789_*+`.%indeed'~ +Max-Forwards: 255 +extensionHeader-!.%*+_`'~: \xEF\xBB\xBF\xE5\xA4\xA7\xE5\x81\x9C\xE9\x9B\xBB +Content-Length: 0 + +""" + + +sendto_cfg = sip.SendtoCfg( "RFC 4475 3.1.1.2", + "--null-audio --auto-answer 200", + "", 405, complete_msg=complete_msg) + diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/001_torture_4475_3_1_1_3.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/001_torture_4475_3_1_1_3.py new file mode 100644 index 0000000000000000000000000000000000000000..2656a14bf14d935ab7c35450554614f11003d5c3 --- /dev/null +++ b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/001_torture_4475_3_1_1_3.py @@ -0,0 +1,35 @@ +# $Id: 001_torture_4475_3_1_1_3.py 2538 2009-03-23 13:14:26Z bennylp $ +import inc_sip as sip +import inc_sdp as sdp + +# Torture message from RFC 4475 +# 3.1.1. Valid Messages +# 3.1.1.3. Valid Use of the % Escaping Mechanism +complete_msg = \ +"""INVITE sip:sips%3Auser%40example.com@example.net SIP/2.0 +To: sip:%75se%72@example.com +From: <sip:I%20have%20spaces@example.net>;tag=$FROM_TAG +Max-Forwards: 87 +i: esc01.239409asdfakjkn23onasd0-3234 +CSeq: 234234 INVITE +Via: SIP/2.0/UDP host5.example.net;rport;branch=z9hG4bKkdjuw +C: application/sdp +Contact: + <sip:cal%6Cer@$LOCAL_IP:$LOCAL_PORT;%6C%72;n%61me=v%61lue%25%34%31> +Content-Length: 150 + +v=0 +o=mhandley 29739 7272939 IN IP4 192.0.2.1 +s=- +c=IN IP4 192.0.2.1 +t=0 0 +m=audio 49217 RTP/AVP 0 12 +m=video 3227 RTP/AVP 31 +a=rtpmap:31 LPC +""" + + +sendto_cfg = sip.SendtoCfg( "RFC 4475 3.1.1.3", + "--null-audio --auto-answer 200", + "", 200, complete_msg=complete_msg) + diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/001_torture_4475_3_1_1_4.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/001_torture_4475_3_1_1_4.py new file mode 100644 index 0000000000000000000000000000000000000000..8fc28dd97b7da2ea804f8f5e47533d5974d6a785 --- /dev/null +++ b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/001_torture_4475_3_1_1_4.py @@ -0,0 +1,25 @@ +# $Id: 001_torture_4475_3_1_1_4.py 2538 2009-03-23 13:14:26Z bennylp $ +import inc_sip as sip +import inc_sdp as sdp + +# Torture message from RFC 4475 +# 3.1.1. Valid Messages +# 3.1.1.4. Escaped Nulls in URIs +complete_msg = \ +"""REGISTER sip:example.com SIP/2.0 +To: sip:null-%00-null@example.com +From: sip:null-%00-null@example.com;tag=839923423 +Max-Forwards: 70 +Call-ID: escnull.39203ndfvkjdasfkq3w4otrq0adsfdfnavd +CSeq: 14398234 REGISTER +Via: SIP/2.0/UDP host5.example.com;rport;branch=z9hG4bKkdjuw +Contact: <sip:%00@host5.example.com> +Contact: <sip:%00%00@host5.example.com> +L:0 +""" + + +sendto_cfg = sip.SendtoCfg( "RFC 4475 3.1.1.4", + "--null-audio --auto-answer 200", + "", 405, complete_msg=complete_msg) + diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/001_torture_4475_3_1_1_5.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/001_torture_4475_3_1_1_5.py new file mode 100644 index 0000000000000000000000000000000000000000..da216acbfbdac1e4f9f6668d8d4b7a7ba1055fb4 --- /dev/null +++ b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/001_torture_4475_3_1_1_5.py @@ -0,0 +1,25 @@ +# $Id: 001_torture_4475_3_1_1_5.py 2538 2009-03-23 13:14:26Z bennylp $ +import inc_sip as sip +import inc_sdp as sdp + +# Torture message from RFC 4475 +# 3.1.1. Valid Messages +# 3.1.1.5. Use of % When It Is Not an Escape +complete_msg = \ +"""RE%47IST%45R sip:registrar.example.com SIP/2.0 +To: "%Z%45" <sip:resource@example.com> +From: "%Z%45" <sip:resource@example.com>;tag=f232jadfj23 +Call-ID: esc02.asdfnqwo34rq23i34jrjasdcnl23nrlknsdf +Via: SIP/2.0/TCP host.example.com;rport;branch=z9hG4bK209%fzsnel234 +CSeq: 29344 RE%47IST%45R +Max-Forwards: 70 +Contact: <sip:alias1@host1.example.com> +C%6Fntact: <sip:alias2@host2.example.com> +Contact: <sip:alias3@host3.example.com> +l: 0 +""" + +sendto_cfg = sip.SendtoCfg( "RFC 4475 3.1.1.5", + "--null-audio --auto-answer 200", + "", 405, complete_msg=complete_msg) + diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/100_simplecall.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/100_simplecall.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/100_simplecall.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/100_simplecall.py diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/110_tel_uri.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/110_tel_uri.py new file mode 100644 index 0000000000000000000000000000000000000000..e31ab2f305bfb40a1499678a8fc7d29f5dacfa9b --- /dev/null +++ b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/110_tel_uri.py @@ -0,0 +1,46 @@ +# $Id: 110_tel_uri.py 2536 2009-03-23 13:11:05Z bennylp $ +import inc_sip as sip +import inc_sdp as sdp + +# Handling of incoming tel: URI. +complete_msg = \ +"""INVITE tel:+2065551212 SIP/2.0 +Via: SIP/2.0/UDP $LOCAL_IP:$LOCAL_PORT;rport;x-route-tag="tgrp:cococisco1";branch=z9hG4bK61E05 +From: <tel:12345>$FROM_TAG +To: <tel:+2065551212> +Date: Thu, 12 Feb 2009 18:32:33 GMT +Call-ID: 58F8F7D6-F86A11DD-8013D591-5694EF79 +Supported: 100rel,timer,resource-priority +Min-SE: 86400 +Cisco-Guid: 1492551325-4167700957-2148586897-1452601209 +User-Agent: Cisco-SIPGateway/IOS-12.x +Allow: INVITE, OPTIONS, BYE, CANCEL, ACK, PRACK, UPDATE, REFER, SUBSCRIBE, NOTIFY, INFO, REGISTER +CSeq: 101 INVITE +Max-Forwards: 70 +Timestamp: 1234463553 +Contact: <tel:+1234;ext=1> +Contact: <sip:tester@$LOCAL_IP:$LOCAL_PORT> +Record-Route: <sip:tester@$LOCAL_IP:$LOCAL_PORT;lr> +Expires: 180 +Allow-Events: telephone-event +Content-Type: application/sdp +Content-Disposition: session;handling=required +Content-Length: 265 + +v=0 +o=CiscoSystemsSIP-GW-UserAgent 1296 9529 IN IP4 X.X.X.X +s=SIP Call +c=IN IP4 $LOCAL_IP +t=0 0 +m=audio 18676 RTP/AVP 0 101 19 +c=IN IP4 $LOCAL_IP +a=rtpmap:0 PCMU/8000 +a=rtpmap:101 telephone-event/8000 +a=fmtp:101 0-16 +a=rtpmap:19 CN/8000 +a=ptime:20 +""" + +sendto_cfg = sip.SendtoCfg( "tel: URI", "--null-audio --auto-answer 200", + "", 200, complete_msg=complete_msg) + diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/120_sdp_with_video_dynamic_1.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/120_sdp_with_video_dynamic_1.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/120_sdp_with_video_dynamic_1.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/120_sdp_with_video_dynamic_1.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/120_sdp_with_video_dynamic_2.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/120_sdp_with_video_dynamic_2.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/120_sdp_with_video_dynamic_2.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/120_sdp_with_video_dynamic_2.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/121_sdp_with_video_static_1.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/121_sdp_with_video_static_1.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/121_sdp_with_video_static_1.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/121_sdp_with_video_static_1.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/121_sdp_with_video_static_2.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/121_sdp_with_video_static_2.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/121_sdp_with_video_static_2.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/121_sdp_with_video_static_2.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/122_sdp_with_unknown_dynamic_1.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/122_sdp_with_unknown_dynamic_1.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/122_sdp_with_unknown_dynamic_1.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/122_sdp_with_unknown_dynamic_1.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/122_sdp_with_unknown_dynamic_2.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/122_sdp_with_unknown_dynamic_2.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/122_sdp_with_unknown_dynamic_2.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/122_sdp_with_unknown_dynamic_2.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/123_sdp_with_unknown_static_1.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/123_sdp_with_unknown_static_1.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/123_sdp_with_unknown_static_1.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/123_sdp_with_unknown_static_1.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/123_sdp_with_unknown_static_2.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/123_sdp_with_unknown_static_2.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/123_sdp_with_unknown_static_2.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/123_sdp_with_unknown_static_2.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/124_sdp_with_unknown_static_unknown_transport.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/124_sdp_with_unknown_static_unknown_transport.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/124_sdp_with_unknown_static_unknown_transport.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/124_sdp_with_unknown_static_unknown_transport.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/125_sdp_with_multi_audio_0.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/125_sdp_with_multi_audio_0.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/125_sdp_with_multi_audio_0.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/125_sdp_with_multi_audio_0.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/125_sdp_with_multi_audio_1.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/125_sdp_with_multi_audio_1.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/125_sdp_with_multi_audio_1.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/125_sdp_with_multi_audio_1.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/125_sdp_with_multi_audio_2.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/125_sdp_with_multi_audio_2.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/125_sdp_with_multi_audio_2.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/125_sdp_with_multi_audio_2.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/125_sdp_with_multi_audio_3.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/125_sdp_with_multi_audio_3.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/125_sdp_with_multi_audio_3.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/125_sdp_with_multi_audio_3.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/125_sdp_with_multi_audio_4.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/125_sdp_with_multi_audio_4.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/125_sdp_with_multi_audio_4.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/125_sdp_with_multi_audio_4.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/150_err_extension.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/150_err_extension.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/150_err_extension.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/150_err_extension.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/151_err_sdp_video.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/151_err_sdp_video.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/151_err_sdp_video.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/151_err_sdp_video.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/152_err_sdp_no_media.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/152_err_sdp_no_media.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/152_err_sdp_no_media.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/152_err_sdp_no_media.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/153_err_sdp_unsupported_codec.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/153_err_sdp_unsupported_codec.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/153_err_sdp_unsupported_codec.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/153_err_sdp_unsupported_codec.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/155_err_sdp_bad_syntax.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/155_err_sdp_bad_syntax.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/155_err_sdp_bad_syntax.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/155_err_sdp_bad_syntax.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/156_err_sdp_bad_net_type.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/156_err_sdp_bad_net_type.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/156_err_sdp_bad_net_type.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/156_err_sdp_bad_net_type.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/157_err_sdp_bad_addr_type.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/157_err_sdp_bad_addr_type.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/157_err_sdp_bad_addr_type.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/157_err_sdp_bad_addr_type.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/158_err_sdp_bad_transport_type.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/158_err_sdp_bad_transport_type.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/158_err_sdp_bad_transport_type.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/158_err_sdp_bad_transport_type.py diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/159_no_rport.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/159_no_rport.py new file mode 100644 index 0000000000000000000000000000000000000000..11a4e4d2dfb122d9baea52a2bedfc9bc6f4c871b --- /dev/null +++ b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/159_no_rport.py @@ -0,0 +1,38 @@ +# $Id: 159_no_rport.py 2534 2009-03-23 13:09:09Z bennylp $ +import inc_sip as sip +import inc_sdp as sdp + +# Ticket http://trac.pjsip.org/repos/ticket/718 +# RTC doesn't put rport in Via, and it is report to have caused segfault. +complete_msg = \ +"""INVITE sip:localhost SIP/2.0 +Via: SIP/2.0/UDP $LOCAL_IP:$LOCAL_PORT;branch=z9hG4bK74a60ee5 +From: <sip:tester@localhost>;tag=as2858a32c +To: <sip:pjsua@localhost> +Contact: <sip:tester@$LOCAL_IP:$LOCAL_PORT> +Call-ID: 123@localhost +CSeq: 1 INVITE +Max-Forwards: 70 +Content-Type: application/sdp +Content-Length: 285 + +v=0 +o=root 4236 4236 IN IP4 192.168.1.11 +s=session +c=IN IP4 192.168.1.11 +t=0 0 +m=audio 14390 RTP/AVP 0 3 8 101 +a=rtpmap:0 PCMU/8000 +a=rtpmap:3 GSM/8000 +a=rtpmap:8 PCMA/8000 +a=rtpmap:101 telephone-event/8000 +a=fmtp:101 0-16 +a=silenceSupp:off - - - - +a=ptime:20 +a=sendrecv +""" + + +sendto_cfg = sip.SendtoCfg( "RTC no rport", "--null-audio --auto-answer 200", + "", 200, complete_msg=complete_msg) + diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/159_no_rport_nit.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/159_no_rport_nit.py new file mode 100644 index 0000000000000000000000000000000000000000..93f8ae0ec1baffd2d59e05d9d19845bda5908cf7 --- /dev/null +++ b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/159_no_rport_nit.py @@ -0,0 +1,25 @@ +# $Id: 159_no_rport_nit.py 2534 2009-03-23 13:09:09Z bennylp $ +import inc_sip as sip +import inc_sdp as sdp + +# Ticket http://trac.pjsip.org/repos/ticket/718 +# RTC doesn't put rport in Via, and it is reported to have caused segfault. +# +complete_msg = \ +"""MESSAGE sip:localhost SIP/2.0 +Via: SIP/2.0/UDP localhost:$LOCAL_PORT;branch=z9hG4bK$BRANCH +From: <sip:tester@localhost>;tag=as2858a32c +To: <sip:pjsua@localhost> +Call-ID: 123@localhost +CSeq: 1 MESSAGE +Max-Forwards: 70 +Content-Length: 11 +Content-Type: text/plain + +Hello world +""" + + +sendto_cfg = sip.SendtoCfg( "RTC no rport", "--null-audio --auto-answer 200", + "", 200, complete_msg=complete_msg) + diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/160_err_duplicate_replaces.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/160_err_duplicate_replaces.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/160_err_duplicate_replaces.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/160_err_duplicate_replaces.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/161_err_replaces_dlg_not_found.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/161_err_replaces_dlg_not_found.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/161_err_replaces_dlg_not_found.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/161_err_replaces_dlg_not_found.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/200_ice_no_ice.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/200_ice_no_ice.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/200_ice_no_ice.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/200_ice_no_ice.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/200_ice_success_1.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/200_ice_success_1.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/200_ice_success_1.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/200_ice_success_1.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/200_ice_success_2.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/200_ice_success_2.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/200_ice_success_2.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/200_ice_success_2.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/200_ice_success_3.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/200_ice_success_3.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/200_ice_success_3.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/200_ice_success_3.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/200_ice_success_4.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/200_ice_success_4.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/200_ice_success_4.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/200_ice_success_4.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/201_ice_mismatch_1.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/201_ice_mismatch_1.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/201_ice_mismatch_1.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/201_ice_mismatch_1.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/201_ice_mismatch_2.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/201_ice_mismatch_2.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/201_ice_mismatch_2.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/201_ice_mismatch_2.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/201_ice_mismatch_3.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/201_ice_mismatch_3.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/201_ice_mismatch_3.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/201_ice_mismatch_3.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/300_srtp_crypto_case_insensitive.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/300_srtp_crypto_case_insensitive.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/300_srtp_crypto_case_insensitive.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/300_srtp_crypto_case_insensitive.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/300_srtp_duplicated_crypto_tag.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/300_srtp_duplicated_crypto_tag.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/300_srtp_duplicated_crypto_tag.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/300_srtp_duplicated_crypto_tag.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/300_srtp_invalid_crypto_tag_non_numeric.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/300_srtp_invalid_crypto_tag_non_numeric.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/300_srtp_invalid_crypto_tag_non_numeric.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/300_srtp_invalid_crypto_tag_non_numeric.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/300_srtp_invalid_crypto_tag_zero.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/300_srtp_invalid_crypto_tag_zero.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/300_srtp_invalid_crypto_tag_zero.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/300_srtp_invalid_crypto_tag_zero.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/300_srtp_receive_no_key_1.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/300_srtp_receive_no_key_1.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/300_srtp_receive_no_key_1.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/300_srtp_receive_no_key_1.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/300_srtp_receive_no_key_2.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/300_srtp_receive_no_key_2.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/300_srtp_receive_no_key_2.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/300_srtp_receive_no_key_2.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/300_srtp_receive_no_key_3.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/300_srtp_receive_no_key_3.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/300_srtp_receive_no_key_3.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/300_srtp_receive_no_key_3.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/301_srtp0_recv_avp.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/301_srtp0_recv_avp.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/301_srtp0_recv_avp.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/301_srtp0_recv_avp.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/301_srtp0_recv_savp.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/301_srtp0_recv_savp.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/301_srtp0_recv_savp.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/301_srtp0_recv_savp.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/310_srtp1_no_crypto.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/310_srtp1_no_crypto.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/310_srtp1_no_crypto.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/310_srtp1_no_crypto.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/311_srtp1_recv_avp.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/311_srtp1_recv_avp.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/311_srtp1_recv_avp.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/311_srtp1_recv_avp.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/312_srtp1_recv_savp.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/312_srtp1_recv_savp.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/312_srtp1_recv_savp.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/312_srtp1_recv_savp.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/313_srtp1_unsupported_crypto.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/313_srtp1_unsupported_crypto.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/313_srtp1_unsupported_crypto.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/313_srtp1_unsupported_crypto.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/320_srtp2_no_crypto.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/320_srtp2_no_crypto.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/320_srtp2_no_crypto.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/320_srtp2_no_crypto.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/320_srtp_with_unknown_media_1.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/320_srtp_with_unknown_media_1.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/320_srtp_with_unknown_media_1.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/320_srtp_with_unknown_media_1.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/320_srtp_with_unknown_media_2.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/320_srtp_with_unknown_media_2.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/320_srtp_with_unknown_media_2.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/320_srtp_with_unknown_media_2.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/320_srtp_with_unknown_transport_1.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/320_srtp_with_unknown_transport_1.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/320_srtp_with_unknown_transport_1.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/320_srtp_with_unknown_transport_1.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/320_srtp_with_unknown_transport_2.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/320_srtp_with_unknown_transport_2.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/320_srtp_with_unknown_transport_2.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/320_srtp_with_unknown_transport_2.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/321_srtp2_recv_avp.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/321_srtp2_recv_avp.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/321_srtp2_recv_avp.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/321_srtp2_recv_avp.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/322_srtp2_recv_savp.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/322_srtp2_recv_savp.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/322_srtp2_recv_savp.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/322_srtp2_recv_savp.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/323_srtp2_unsupported_crypto.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/323_srtp2_unsupported_crypto.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/323_srtp2_unsupported_crypto.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/323_srtp2_unsupported_crypto.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/330_srtp_prefer_rtp_savp.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/330_srtp_prefer_rtp_savp.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/330_srtp_prefer_rtp_savp.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/330_srtp_prefer_rtp_savp.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/331_srtp_prefer_rtp_avp.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/331_srtp_prefer_rtp_avp.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/331_srtp_prefer_rtp_avp.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/331_srtp_prefer_rtp_avp.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/360_non_sip_uri.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/360_non_sip_uri.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/360_non_sip_uri.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/360_non_sip_uri.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/361_non_sip_uri.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/361_non_sip_uri.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/361_non_sip_uri.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/361_non_sip_uri.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/362_non_sip_uri.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/362_non_sip_uri.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/362_non_sip_uri.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/362_non_sip_uri.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/363_non_sip_uri_subscribe.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/363_non_sip_uri_subscribe.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/363_non_sip_uri_subscribe.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/363_non_sip_uri_subscribe.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/364_non_sip_uri_subscribe.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/364_non_sip_uri_subscribe.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/364_non_sip_uri_subscribe.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/364_non_sip_uri_subscribe.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/400_fmtp_g7221_with_bitrate.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/400_fmtp_g7221_with_bitrate.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/400_fmtp_g7221_with_bitrate.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/400_fmtp_g7221_with_bitrate.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/401_fmtp_g7221_with_bitrate_24000.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/401_fmtp_g7221_with_bitrate_24000.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/401_fmtp_g7221_with_bitrate_24000.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/401_fmtp_g7221_with_bitrate_24000.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/401_fmtp_g7221_with_bitrate_32000.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/401_fmtp_g7221_with_bitrate_32000.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/401_fmtp_g7221_with_bitrate_32000.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/401_fmtp_g7221_with_bitrate_32000.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/410_fmtp_amrnb_offer_octet_align.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/410_fmtp_amrnb_offer_octet_align.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/410_fmtp_amrnb_offer_octet_align.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/410_fmtp_amrnb_offer_octet_align.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/411_fmtp_amrnb_offer_band_eff.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/411_fmtp_amrnb_offer_band_eff.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/411_fmtp_amrnb_offer_band_eff.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/411_fmtp_amrnb_offer_band_eff.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/412_fmtp_amrnb_offer_band_eff2.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/412_fmtp_amrnb_offer_band_eff2.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/412_fmtp_amrnb_offer_band_eff2.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/412_fmtp_amrnb_offer_band_eff2.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/500_pres_subscribe_with_bad_event.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/500_pres_subscribe_with_bad_event.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/500_pres_subscribe_with_bad_event.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/500_pres_subscribe_with_bad_event.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/999_asterisk_err.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/999_asterisk_err.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/999_asterisk_err.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/999_asterisk_err.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/999_message_no_body.py b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/999_message_no_body.py similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sendto/999_message_no_body.py rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/999_message_no_body.py diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sipp/inv_401_retry_after_100.xml b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sipp/inv_401_retry_after_100.xml similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sipp/inv_401_retry_after_100.xml rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sipp/inv_401_retry_after_100.xml diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sipp/uas-template.xml b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sipp/uas-template.xml similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/scripts-sipp/uas-template.xml rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sipp/uas-template.xml diff --git a/sflphone-common/libs/pjproject-1.0.1/tests/pjsua/tools/cmp_wav.c b/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/tools/cmp_wav.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/tests/pjsua/tools/cmp_wav.c rename to sflphone-common/libs/pjproject-1.0.2/tests/pjsua/tools/cmp_wav.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/README.txt b/sflphone-common/libs/pjproject-1.0.2/third_party/README.txt similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/README.txt rename to sflphone-common/libs/pjproject-1.0.2/third_party/README.txt diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/build/Makefile b/sflphone-common/libs/pjproject-1.0.2/third_party/build/Makefile similarity index 88% rename from sflphone-common/libs/pjproject-1.0.1/third_party/build/Makefile rename to sflphone-common/libs/pjproject-1.0.2/third_party/build/Makefile index 36d80612076f25e3761cfe4f45c6f3aae3489499..6d84db662cdb58d574db54b9cfc287e6941192b2 100644 --- a/sflphone-common/libs/pjproject-1.0.1/third_party/build/Makefile +++ b/sflphone-common/libs/pjproject-1.0.2/third_party/build/Makefile @@ -1,4 +1,4 @@ -DIRS = resample milenage srtp +DIRS = resample srtp include ../../build.mak include $(PJDIR)/build/common.mak diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/build/gsm/Makefile b/sflphone-common/libs/pjproject-1.0.2/third_party/build/gsm/Makefile similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/build/gsm/Makefile rename to sflphone-common/libs/pjproject-1.0.2/third_party/build/gsm/Makefile diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/build/gsm/config.h b/sflphone-common/libs/pjproject-1.0.2/third_party/build/gsm/config.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/build/gsm/config.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/build/gsm/config.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/build/gsm/libgsmcodec.dsp b/sflphone-common/libs/pjproject-1.0.2/third_party/build/gsm/libgsmcodec.dsp similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/build/gsm/libgsmcodec.dsp rename to sflphone-common/libs/pjproject-1.0.2/third_party/build/gsm/libgsmcodec.dsp diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/build/gsm/libgsmcodec.vcp b/sflphone-common/libs/pjproject-1.0.2/third_party/build/gsm/libgsmcodec.vcp similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/build/gsm/libgsmcodec.vcp rename to sflphone-common/libs/pjproject-1.0.2/third_party/build/gsm/libgsmcodec.vcp diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/build/gsm/libgsmcodec.vcproj b/sflphone-common/libs/pjproject-1.0.2/third_party/build/gsm/libgsmcodec.vcproj similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/build/gsm/libgsmcodec.vcproj rename to sflphone-common/libs/pjproject-1.0.2/third_party/build/gsm/libgsmcodec.vcproj diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/build/ilbc/Makefile b/sflphone-common/libs/pjproject-1.0.2/third_party/build/ilbc/Makefile similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/build/ilbc/Makefile rename to sflphone-common/libs/pjproject-1.0.2/third_party/build/ilbc/Makefile diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/build/ilbc/libilbccodec.dsp b/sflphone-common/libs/pjproject-1.0.2/third_party/build/ilbc/libilbccodec.dsp similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/build/ilbc/libilbccodec.dsp rename to sflphone-common/libs/pjproject-1.0.2/third_party/build/ilbc/libilbccodec.dsp diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/build/ilbc/libilbccodec.vcp b/sflphone-common/libs/pjproject-1.0.2/third_party/build/ilbc/libilbccodec.vcp similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/build/ilbc/libilbccodec.vcp rename to sflphone-common/libs/pjproject-1.0.2/third_party/build/ilbc/libilbccodec.vcp diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/build/ilbc/libilbccodec.vcproj b/sflphone-common/libs/pjproject-1.0.2/third_party/build/ilbc/libilbccodec.vcproj similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/build/ilbc/libilbccodec.vcproj rename to sflphone-common/libs/pjproject-1.0.2/third_party/build/ilbc/libilbccodec.vcproj diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/build/os-auto.mak b/sflphone-common/libs/pjproject-1.0.2/third_party/build/os-auto.mak similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/build/os-auto.mak rename to sflphone-common/libs/pjproject-1.0.2/third_party/build/os-auto.mak diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/build/os-auto.mak.in b/sflphone-common/libs/pjproject-1.0.2/third_party/build/os-auto.mak.in similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/build/os-auto.mak.in rename to sflphone-common/libs/pjproject-1.0.2/third_party/build/os-auto.mak.in diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/build/os-darwinos.mak b/sflphone-common/libs/pjproject-1.0.2/third_party/build/os-darwinos.mak similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/build/os-darwinos.mak rename to sflphone-common/libs/pjproject-1.0.2/third_party/build/os-darwinos.mak diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/build/os-linux.mak b/sflphone-common/libs/pjproject-1.0.2/third_party/build/os-linux.mak similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/build/os-linux.mak rename to sflphone-common/libs/pjproject-1.0.2/third_party/build/os-linux.mak diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/build/os-win32.mak b/sflphone-common/libs/pjproject-1.0.2/third_party/build/os-win32.mak similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/build/os-win32.mak rename to sflphone-common/libs/pjproject-1.0.2/third_party/build/os-win32.mak diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/build/portaudio/Makefile b/sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/Makefile similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/build/portaudio/Makefile rename to sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/Makefile diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/build/portaudio/libportaudio.dsp b/sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/libportaudio.dsp similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/build/portaudio/libportaudio.dsp rename to sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/libportaudio.dsp diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/build/portaudio/libportaudio.vcp b/sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/libportaudio.vcp similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/build/portaudio/libportaudio.vcp rename to sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/libportaudio.vcp diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/build/portaudio/libportaudio.vcproj b/sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/libportaudio.vcproj similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/build/portaudio/libportaudio.vcproj rename to sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/libportaudio.vcproj diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/build/portaudio/os-auto.mak b/sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/os-auto.mak similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/build/portaudio/os-auto.mak rename to sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/os-auto.mak diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/build/portaudio/os-auto.mak.in b/sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/os-auto.mak.in similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/build/portaudio/os-auto.mak.in rename to sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/os-auto.mak.in diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/build/portaudio/os-linux.mak b/sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/os-linux.mak similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/build/portaudio/os-linux.mak rename to sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/os-linux.mak diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/build/portaudio/src/pa_allocation.c b/sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_allocation.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/build/portaudio/src/pa_allocation.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_allocation.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/build/portaudio/src/pa_allocation.h b/sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_allocation.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/build/portaudio/src/pa_allocation.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_allocation.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/build/portaudio/src/pa_converters.c b/sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_converters.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/build/portaudio/src/pa_converters.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_converters.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/build/portaudio/src/pa_converters.h b/sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_converters.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/build/portaudio/src/pa_converters.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_converters.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/build/portaudio/src/pa_cpuload.c b/sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_cpuload.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/build/portaudio/src/pa_cpuload.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_cpuload.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/build/portaudio/src/pa_cpuload.h b/sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_cpuload.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/build/portaudio/src/pa_cpuload.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_cpuload.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/build/portaudio/src/pa_debugprint.c b/sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_debugprint.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/build/portaudio/src/pa_debugprint.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_debugprint.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/build/portaudio/src/pa_debugprint.h b/sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_debugprint.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/build/portaudio/src/pa_debugprint.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_debugprint.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/build/portaudio/src/pa_dither.c b/sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_dither.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/build/portaudio/src/pa_dither.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_dither.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/build/portaudio/src/pa_dither.h b/sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_dither.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/build/portaudio/src/pa_dither.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_dither.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/build/portaudio/src/pa_endianness.h b/sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_endianness.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/build/portaudio/src/pa_endianness.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_endianness.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/build/portaudio/src/pa_front.c b/sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_front.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/build/portaudio/src/pa_front.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_front.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/build/portaudio/src/pa_hostapi.h b/sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_hostapi.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/build/portaudio/src/pa_hostapi.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_hostapi.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/build/portaudio/src/pa_linux_alsa.c b/sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_linux_alsa.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/build/portaudio/src/pa_linux_alsa.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_linux_alsa.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/build/portaudio/src/pa_linux_alsa.h b/sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_linux_alsa.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/build/portaudio/src/pa_linux_alsa.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_linux_alsa.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/build/portaudio/src/pa_mac_core.c b/sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_mac_core.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/build/portaudio/src/pa_mac_core.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_mac_core.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/build/portaudio/src/pa_mac_core.h b/sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_mac_core.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/build/portaudio/src/pa_mac_core.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_mac_core.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/build/portaudio/src/pa_mac_core_blocking.c b/sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_mac_core_blocking.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/build/portaudio/src/pa_mac_core_blocking.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_mac_core_blocking.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/build/portaudio/src/pa_mac_core_blocking.h b/sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_mac_core_blocking.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/build/portaudio/src/pa_mac_core_blocking.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_mac_core_blocking.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/build/portaudio/src/pa_mac_core_internal.h b/sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_mac_core_internal.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/build/portaudio/src/pa_mac_core_internal.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_mac_core_internal.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/build/portaudio/src/pa_mac_core_old.c b/sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_mac_core_old.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/build/portaudio/src/pa_mac_core_old.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_mac_core_old.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/build/portaudio/src/pa_mac_core_utilities.c b/sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_mac_core_utilities.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/build/portaudio/src/pa_mac_core_utilities.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_mac_core_utilities.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/build/portaudio/src/pa_mac_core_utilities.h b/sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_mac_core_utilities.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/build/portaudio/src/pa_mac_core_utilities.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_mac_core_utilities.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/build/portaudio/src/pa_mac_hostapis.c b/sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_mac_hostapis.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/build/portaudio/src/pa_mac_hostapis.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_mac_hostapis.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/build/portaudio/src/pa_process.c b/sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_process.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/build/portaudio/src/pa_process.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_process.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/build/portaudio/src/pa_process.h b/sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_process.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/build/portaudio/src/pa_process.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_process.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/build/portaudio/src/pa_ringbuffer.c b/sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_ringbuffer.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/build/portaudio/src/pa_ringbuffer.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_ringbuffer.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/build/portaudio/src/pa_ringbuffer.h b/sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_ringbuffer.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/build/portaudio/src/pa_ringbuffer.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_ringbuffer.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/build/portaudio/src/pa_skeleton.c b/sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_skeleton.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/build/portaudio/src/pa_skeleton.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_skeleton.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/build/portaudio/src/pa_stream.c b/sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_stream.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/build/portaudio/src/pa_stream.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_stream.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/build/portaudio/src/pa_stream.h b/sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_stream.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/build/portaudio/src/pa_stream.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_stream.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/build/portaudio/src/pa_trace.c b/sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_trace.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/build/portaudio/src/pa_trace.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_trace.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/build/portaudio/src/pa_trace.h b/sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_trace.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/build/portaudio/src/pa_trace.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_trace.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/build/portaudio/src/pa_types.h b/sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_types.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/build/portaudio/src/pa_types.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_types.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/build/portaudio/src/pa_unix_hostapis.c b/sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_unix_hostapis.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/build/portaudio/src/pa_unix_hostapis.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_unix_hostapis.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/build/portaudio/src/pa_unix_oss.c b/sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_unix_oss.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/build/portaudio/src/pa_unix_oss.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_unix_oss.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/build/portaudio/src/pa_unix_util.c b/sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_unix_util.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/build/portaudio/src/pa_unix_util.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_unix_util.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/build/portaudio/src/pa_unix_util.h b/sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_unix_util.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/build/portaudio/src/pa_unix_util.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_unix_util.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/build/portaudio/src/pa_util.h b/sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_util.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/build/portaudio/src/pa_util.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_util.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/build/portaudio/src/pa_win_hostapis.c b/sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_win_hostapis.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/build/portaudio/src/pa_win_hostapis.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_win_hostapis.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/build/portaudio/src/pa_win_util.c b/sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_win_util.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/build/portaudio/src/pa_win_util.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_win_util.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/build/portaudio/src/pa_win_waveformat.c b/sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_win_waveformat.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/build/portaudio/src/pa_win_waveformat.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_win_waveformat.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/build/portaudio/src/pa_win_waveformat.h b/sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_win_waveformat.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/build/portaudio/src/pa_win_waveformat.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_win_waveformat.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/build/portaudio/src/pa_win_wmme.c b/sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_win_wmme.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/build/portaudio/src/pa_win_wmme.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_win_wmme.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/build/portaudio/src/pa_win_wmme.h b/sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_win_wmme.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/build/portaudio/src/pa_win_wmme.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_win_wmme.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/build/portaudio/src/portaudio.h b/sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/portaudio.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/build/portaudio/src/portaudio.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/portaudio.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/build/resample/Makefile b/sflphone-common/libs/pjproject-1.0.2/third_party/build/resample/Makefile similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/build/resample/Makefile rename to sflphone-common/libs/pjproject-1.0.2/third_party/build/resample/Makefile diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/build/resample/config.h b/sflphone-common/libs/pjproject-1.0.2/third_party/build/resample/config.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/build/resample/config.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/build/resample/config.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/build/resample/libresample.dsp b/sflphone-common/libs/pjproject-1.0.2/third_party/build/resample/libresample.dsp similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/build/resample/libresample.dsp rename to sflphone-common/libs/pjproject-1.0.2/third_party/build/resample/libresample.dsp diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/build/resample/libresample.vcp b/sflphone-common/libs/pjproject-1.0.2/third_party/build/resample/libresample.vcp similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/build/resample/libresample.vcp rename to sflphone-common/libs/pjproject-1.0.2/third_party/build/resample/libresample.vcp diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/build/resample/libresample.vcproj b/sflphone-common/libs/pjproject-1.0.2/third_party/build/resample/libresample.vcproj similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/build/resample/libresample.vcproj rename to sflphone-common/libs/pjproject-1.0.2/third_party/build/resample/libresample.vcproj diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/build/resample/libresample_dll.dsp b/sflphone-common/libs/pjproject-1.0.2/third_party/build/resample/libresample_dll.dsp similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/build/resample/libresample_dll.dsp rename to sflphone-common/libs/pjproject-1.0.2/third_party/build/resample/libresample_dll.dsp diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/build/resample/libresample_dll.vcproj b/sflphone-common/libs/pjproject-1.0.2/third_party/build/resample/libresample_dll.vcproj similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/build/resample/libresample_dll.vcproj rename to sflphone-common/libs/pjproject-1.0.2/third_party/build/resample/libresample_dll.vcproj diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/build/samplerate/README.txt b/sflphone-common/libs/pjproject-1.0.2/third_party/build/samplerate/README.txt similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/build/samplerate/README.txt rename to sflphone-common/libs/pjproject-1.0.2/third_party/build/samplerate/README.txt diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/build/samplerate/Static.msvc b/sflphone-common/libs/pjproject-1.0.2/third_party/build/samplerate/Static.msvc similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/build/samplerate/Static.msvc rename to sflphone-common/libs/pjproject-1.0.2/third_party/build/samplerate/Static.msvc diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/build/samplerate/libsamplerate_static.dsp b/sflphone-common/libs/pjproject-1.0.2/third_party/build/samplerate/libsamplerate_static.dsp similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/build/samplerate/libsamplerate_static.dsp rename to sflphone-common/libs/pjproject-1.0.2/third_party/build/samplerate/libsamplerate_static.dsp diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/build/speex/Makefile b/sflphone-common/libs/pjproject-1.0.2/third_party/build/speex/Makefile similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/build/speex/Makefile rename to sflphone-common/libs/pjproject-1.0.2/third_party/build/speex/Makefile diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/build/speex/config.h b/sflphone-common/libs/pjproject-1.0.2/third_party/build/speex/config.h similarity index 95% rename from sflphone-common/libs/pjproject-1.0.1/third_party/build/speex/config.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/build/speex/config.h index ba7be7a6e21d233da490e2274094580c6d416459..e04c40be4f7383fdda6c17ec53d4369e70989492 100644 --- a/sflphone-common/libs/pjproject-1.0.1/third_party/build/speex/config.h +++ b/sflphone-common/libs/pjproject-1.0.2/third_party/build/speex/config.h @@ -4,7 +4,7 @@ #if !defined(PJ_HAS_FLOATING_POINT) || PJ_HAS_FLOATING_POINT==0 # define FIXED_POINT # define USE_KISS_FFT -#else +#else # define FLOATING_POINT # define USE_SMALLFT #endif @@ -12,7 +12,7 @@ #define EXPORT #if (defined(PJ_WIN32) && PJ_WIN32!=0) || \ - (defined(PJ_WIN32_WINCE) && PJ_WIN32_WINCE != 0) + (defined(PJ_WIN32_WINCE) && PJ_WIN32_WINCE != 0) # include "../../speex/win32/config.h" #else #define inline __inline diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/build/speex/libspeex.dsp b/sflphone-common/libs/pjproject-1.0.2/third_party/build/speex/libspeex.dsp similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/build/speex/libspeex.dsp rename to sflphone-common/libs/pjproject-1.0.2/third_party/build/speex/libspeex.dsp diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/build/speex/libspeex.vcp b/sflphone-common/libs/pjproject-1.0.2/third_party/build/speex/libspeex.vcp similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/build/speex/libspeex.vcp rename to sflphone-common/libs/pjproject-1.0.2/third_party/build/speex/libspeex.vcp diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/build/speex/libspeex.vcproj b/sflphone-common/libs/pjproject-1.0.2/third_party/build/speex/libspeex.vcproj similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/build/speex/libspeex.vcproj rename to sflphone-common/libs/pjproject-1.0.2/third_party/build/speex/libspeex.vcproj diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/build/speex/speex/speex_config_types.h b/sflphone-common/libs/pjproject-1.0.2/third_party/build/speex/speex/speex_config_types.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/build/speex/speex/speex_config_types.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/build/speex/speex/speex_config_types.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/build/srtp/Makefile b/sflphone-common/libs/pjproject-1.0.2/third_party/build/srtp/Makefile similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/build/srtp/Makefile rename to sflphone-common/libs/pjproject-1.0.2/third_party/build/srtp/Makefile diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/build/srtp/libsrtp.dsp b/sflphone-common/libs/pjproject-1.0.2/third_party/build/srtp/libsrtp.dsp similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/build/srtp/libsrtp.dsp rename to sflphone-common/libs/pjproject-1.0.2/third_party/build/srtp/libsrtp.dsp diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/build/srtp/libsrtp.vcp b/sflphone-common/libs/pjproject-1.0.2/third_party/build/srtp/libsrtp.vcp similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/build/srtp/libsrtp.vcp rename to sflphone-common/libs/pjproject-1.0.2/third_party/build/srtp/libsrtp.vcp diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/build/srtp/libsrtp.vcproj b/sflphone-common/libs/pjproject-1.0.2/third_party/build/srtp/libsrtp.vcproj similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/build/srtp/libsrtp.vcproj rename to sflphone-common/libs/pjproject-1.0.2/third_party/build/srtp/libsrtp.vcproj diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/build/srtp/srtp_config.h b/sflphone-common/libs/pjproject-1.0.2/third_party/build/srtp/srtp_config.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/build/srtp/srtp_config.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/build/srtp/srtp_config.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/gsm/COPYRIGHT b/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/COPYRIGHT similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/gsm/COPYRIGHT rename to sflphone-common/libs/pjproject-1.0.2/third_party/gsm/COPYRIGHT diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/gsm/ChangeLog b/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/ChangeLog similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/gsm/ChangeLog rename to sflphone-common/libs/pjproject-1.0.2/third_party/gsm/ChangeLog diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/INSTALL b/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/INSTALL new file mode 100644 index 0000000000000000000000000000000000000000..5850304f8bd4085a8b25e5f7a478ea229fee20fe --- /dev/null +++ b/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/INSTALL @@ -0,0 +1,99 @@ +How to get started: + + Edit the Makefile. + + You should configure a few machine-dependencies and what + compiler you want to use. + + The code works both with ANSI and K&R-C. Use + -DNeedFunctionPrototypes to compile with, or + -UNeedFunctionPrototypes to compile without, function + prototypes in the header files. + + Make addtst + + The "add" program that will be compiled and run checks whether + the basic math functions of the gsm library work with your + compiler. If it prints anything to stderr, complain (to us). + + Edit inc/config.h. + + Make + + Local versions of the gsm library and the "compress"-like filters + toast, untoast and tcat will be generated. + + If the compilation aborts because of a missing function, + declaration, or header file, see if there's something in + inc/config.h to work around it. If not, complain. + + Try it + + Grab an audio file from somewhere (raw u-law or Sun .au is fine, + linear 16-bit in host byte order will do), copy it, toast it, + untoast it, and listen to the result. + + The GSM-encoded and -decoded audio should have the quality + of a good phone line. If the resulting audio is noisier than + your original, or if you hear compression artifacts, complain; + that's a bug in our software, not a bug in the GSM encoding + standard itself. + +Installation + + You can install the gsm library interface, or the toast binaries, + or both. + + Edit the Makefile + + Fill in the directories where you want to install the + library, header files, manual pages, and binaries. + + Turn off the installation of one half of the distribution + (i.e., gsm library or toast binaries) by not setting the + corresponding directory root Makefile macro. + + make install + + will install the programs "toast" with two links named + "tcat" and "untoast", and the gsm library "libgsm.a" with + a "gsm.h" header file, and their respective manual pages. + + +Optimizing + + This code was developed on a machine without an integer + multiplication instruction, where we obtained the fastest result by + replacing some of the integer multiplications with floating point + multiplications. + + If your machine does multiply integers fast enough, + leave USE_FLOAT_MUL undefined. The results should be the + same in both cases. + + On machines with fast floating point arithmetic, defining + both USE_FLOAT_MUL and FAST makes a run-time library + option available that will (in a few crucial places) use + ``native'' floating point operations rather than the bit-by-bit + defined ones of the GSM standard. If you use this fast + option, the outcome will not be bitwise identical to the + results prescribed by the standard, but it is compatible with + the standard encoding, and a user is unlikely to notice a + difference. + + +Bug Reports + + Please direct bug reports, questions, and comments to + jutta@cs.tu-berlin.de and cabo@informatik.uni-bremen.de. + + +Good luck, + + Jutta Degener, + Carsten Bormann + +-- +Copyright 1992, 1993, 1994, by Jutta Degener and Carsten Bormann, +Technische Universitaet Berlin. See the accompanying file "COPYRIGHT" +for details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/gsm/MACHINES b/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/MACHINES similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/gsm/MACHINES rename to sflphone-common/libs/pjproject-1.0.2/third_party/gsm/MACHINES diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/gsm/MANIFEST b/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/MANIFEST similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/gsm/MANIFEST rename to sflphone-common/libs/pjproject-1.0.2/third_party/gsm/MANIFEST diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/gsm/Makefile b/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/Makefile similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/gsm/Makefile rename to sflphone-common/libs/pjproject-1.0.2/third_party/gsm/Makefile diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/gsm/README b/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/README similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/gsm/README rename to sflphone-common/libs/pjproject-1.0.2/third_party/gsm/README diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/gsm/add-test/add_test.c b/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/add-test/add_test.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/gsm/add-test/add_test.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/gsm/add-test/add_test.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/gsm/add-test/add_test.dta b/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/add-test/add_test.dta similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/gsm/add-test/add_test.dta rename to sflphone-common/libs/pjproject-1.0.2/third_party/gsm/add-test/add_test.dta diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/gsm/inc/config.h b/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/inc/config.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/gsm/inc/config.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/gsm/inc/config.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/gsm/inc/gsm.h b/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/inc/gsm.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/gsm/inc/gsm.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/gsm/inc/gsm.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/gsm/inc/private.h b/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/inc/private.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/gsm/inc/private.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/gsm/inc/private.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/gsm/inc/proto.h b/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/inc/proto.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/gsm/inc/proto.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/gsm/inc/proto.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/gsm/inc/toast.h b/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/inc/toast.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/gsm/inc/toast.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/gsm/inc/toast.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/gsm/inc/unproto.h b/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/inc/unproto.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/gsm/inc/unproto.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/gsm/inc/unproto.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/gsm/man/gsm.3 b/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/man/gsm.3 similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/gsm/man/gsm.3 rename to sflphone-common/libs/pjproject-1.0.2/third_party/gsm/man/gsm.3 diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/gsm/man/gsm_explode.3 b/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/man/gsm_explode.3 similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/gsm/man/gsm_explode.3 rename to sflphone-common/libs/pjproject-1.0.2/third_party/gsm/man/gsm_explode.3 diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/gsm/man/gsm_option.3 b/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/man/gsm_option.3 similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/gsm/man/gsm_option.3 rename to sflphone-common/libs/pjproject-1.0.2/third_party/gsm/man/gsm_option.3 diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/gsm/man/gsm_print.3 b/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/man/gsm_print.3 similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/gsm/man/gsm_print.3 rename to sflphone-common/libs/pjproject-1.0.2/third_party/gsm/man/gsm_print.3 diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/gsm/src/add.c b/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/src/add.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/gsm/src/add.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/gsm/src/add.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/gsm/src/code.c b/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/src/code.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/gsm/src/code.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/gsm/src/code.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/gsm/src/debug.c b/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/src/debug.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/gsm/src/debug.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/gsm/src/debug.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/gsm/src/decode.c b/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/src/decode.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/gsm/src/decode.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/gsm/src/decode.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/gsm/src/gsm_create.c b/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/src/gsm_create.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/gsm/src/gsm_create.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/gsm/src/gsm_create.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/gsm/src/gsm_decode.c b/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/src/gsm_decode.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/gsm/src/gsm_decode.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/gsm/src/gsm_decode.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/gsm/src/gsm_destroy.c b/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/src/gsm_destroy.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/gsm/src/gsm_destroy.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/gsm/src/gsm_destroy.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/gsm/src/gsm_encode.c b/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/src/gsm_encode.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/gsm/src/gsm_encode.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/gsm/src/gsm_encode.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/gsm/src/gsm_explode.c b/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/src/gsm_explode.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/gsm/src/gsm_explode.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/gsm/src/gsm_explode.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/gsm/src/gsm_implode.c b/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/src/gsm_implode.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/gsm/src/gsm_implode.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/gsm/src/gsm_implode.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/gsm/src/gsm_option.c b/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/src/gsm_option.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/gsm/src/gsm_option.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/gsm/src/gsm_option.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/gsm/src/gsm_print.c b/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/src/gsm_print.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/gsm/src/gsm_print.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/gsm/src/gsm_print.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/gsm/src/long_term.c b/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/src/long_term.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/gsm/src/long_term.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/gsm/src/long_term.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/gsm/src/lpc.c b/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/src/lpc.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/gsm/src/lpc.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/gsm/src/lpc.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/gsm/src/preprocess.c b/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/src/preprocess.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/gsm/src/preprocess.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/gsm/src/preprocess.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/gsm/src/rpe.c b/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/src/rpe.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/gsm/src/rpe.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/gsm/src/rpe.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/gsm/src/short_term.c b/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/src/short_term.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/gsm/src/short_term.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/gsm/src/short_term.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/gsm/src/table.c b/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/src/table.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/gsm/src/table.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/gsm/src/table.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/gsm/src/toast.c b/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/src/toast.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/gsm/src/toast.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/gsm/src/toast.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/gsm/src/toast_alaw.c b/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/src/toast_alaw.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/gsm/src/toast_alaw.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/gsm/src/toast_alaw.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/gsm/src/toast_audio.c b/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/src/toast_audio.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/gsm/src/toast_audio.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/gsm/src/toast_audio.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/gsm/src/toast_lin.c b/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/src/toast_lin.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/gsm/src/toast_lin.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/gsm/src/toast_lin.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/gsm/src/toast_ulaw.c b/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/src/toast_ulaw.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/gsm/src/toast_ulaw.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/gsm/src/toast_ulaw.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/gsm/tls/bitter.c b/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/tls/bitter.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/gsm/tls/bitter.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/gsm/tls/bitter.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/gsm/tls/bitter.dta b/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/tls/bitter.dta similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/gsm/tls/bitter.dta rename to sflphone-common/libs/pjproject-1.0.2/third_party/gsm/tls/bitter.dta diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/gsm/tls/ginger.c b/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/tls/ginger.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/gsm/tls/ginger.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/gsm/tls/ginger.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/gsm/tls/sour.c b/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/tls/sour.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/gsm/tls/sour.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/gsm/tls/sour.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/gsm/tls/sour1.dta b/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/tls/sour1.dta similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/gsm/tls/sour1.dta rename to sflphone-common/libs/pjproject-1.0.2/third_party/gsm/tls/sour1.dta diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/gsm/tls/sour2.dta b/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/tls/sour2.dta similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/gsm/tls/sour2.dta rename to sflphone-common/libs/pjproject-1.0.2/third_party/gsm/tls/sour2.dta diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/gsm/tls/sweet.c b/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/tls/sweet.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/gsm/tls/sweet.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/gsm/tls/sweet.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/gsm/tls/taste.c b/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/tls/taste.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/gsm/tls/taste.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/gsm/tls/taste.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/gsm/tls/taste.h b/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/tls/taste.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/gsm/tls/taste.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/gsm/tls/taste.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/gsm/tst/cod2lin.c b/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/tst/cod2lin.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/gsm/tst/cod2lin.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/gsm/tst/cod2lin.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/gsm/tst/cod2txt.c b/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/tst/cod2txt.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/gsm/tst/cod2txt.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/gsm/tst/cod2txt.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/gsm/tst/gsm2cod.c b/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/tst/gsm2cod.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/gsm/tst/gsm2cod.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/gsm/tst/gsm2cod.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/gsm/tst/lin2cod.c b/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/tst/lin2cod.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/gsm/tst/lin2cod.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/gsm/tst/lin2cod.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/gsm/tst/lin2txt.c b/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/tst/lin2txt.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/gsm/tst/lin2txt.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/gsm/tst/lin2txt.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/gsm/tst/run b/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/tst/run similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/gsm/tst/run rename to sflphone-common/libs/pjproject-1.0.2/third_party/gsm/tst/run diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/ilbc/FrameClassify.c b/sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/FrameClassify.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/ilbc/FrameClassify.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/FrameClassify.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/ilbc/FrameClassify.h b/sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/FrameClassify.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/ilbc/FrameClassify.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/FrameClassify.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/ilbc/LPCdecode.c b/sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/LPCdecode.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/ilbc/LPCdecode.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/LPCdecode.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/ilbc/LPCdecode.h b/sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/LPCdecode.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/ilbc/LPCdecode.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/LPCdecode.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/ilbc/LPCencode.c b/sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/LPCencode.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/ilbc/LPCencode.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/LPCencode.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/ilbc/LPCencode.h b/sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/LPCencode.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/ilbc/LPCencode.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/LPCencode.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/ilbc/StateConstructW.c b/sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/StateConstructW.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/ilbc/StateConstructW.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/StateConstructW.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/ilbc/StateConstructW.h b/sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/StateConstructW.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/ilbc/StateConstructW.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/StateConstructW.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/ilbc/StateSearchW.c b/sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/StateSearchW.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/ilbc/StateSearchW.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/StateSearchW.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/ilbc/StateSearchW.h b/sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/StateSearchW.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/ilbc/StateSearchW.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/StateSearchW.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/ilbc/anaFilter.c b/sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/anaFilter.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/ilbc/anaFilter.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/anaFilter.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/ilbc/anaFilter.h b/sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/anaFilter.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/ilbc/anaFilter.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/anaFilter.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/ilbc/constants.c b/sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/constants.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/ilbc/constants.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/constants.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/ilbc/constants.h b/sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/constants.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/ilbc/constants.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/constants.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/ilbc/createCB.c b/sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/createCB.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/ilbc/createCB.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/createCB.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/ilbc/createCB.h b/sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/createCB.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/ilbc/createCB.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/createCB.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/ilbc/doCPLC.c b/sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/doCPLC.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/ilbc/doCPLC.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/doCPLC.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/ilbc/doCPLC.h b/sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/doCPLC.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/ilbc/doCPLC.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/doCPLC.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/ilbc/enhancer.c b/sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/enhancer.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/ilbc/enhancer.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/enhancer.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/ilbc/enhancer.h b/sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/enhancer.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/ilbc/enhancer.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/enhancer.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/ilbc/filter.c b/sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/filter.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/ilbc/filter.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/filter.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/ilbc/filter.h b/sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/filter.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/ilbc/filter.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/filter.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/ilbc/gainquant.c b/sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/gainquant.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/ilbc/gainquant.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/gainquant.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/ilbc/gainquant.h b/sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/gainquant.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/ilbc/gainquant.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/gainquant.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/ilbc/getCBvec.c b/sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/getCBvec.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/ilbc/getCBvec.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/getCBvec.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/ilbc/getCBvec.h b/sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/getCBvec.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/ilbc/getCBvec.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/getCBvec.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/ilbc/helpfun.c b/sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/helpfun.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/ilbc/helpfun.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/helpfun.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/ilbc/helpfun.h b/sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/helpfun.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/ilbc/helpfun.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/helpfun.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/ilbc/hpInput.c b/sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/hpInput.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/ilbc/hpInput.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/hpInput.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/ilbc/hpInput.h b/sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/hpInput.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/ilbc/hpInput.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/hpInput.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/ilbc/hpOutput.c b/sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/hpOutput.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/ilbc/hpOutput.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/hpOutput.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/ilbc/hpOutput.h b/sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/hpOutput.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/ilbc/hpOutput.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/hpOutput.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/ilbc/iCBConstruct.c b/sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/iCBConstruct.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/ilbc/iCBConstruct.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/iCBConstruct.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/ilbc/iCBConstruct.h b/sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/iCBConstruct.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/ilbc/iCBConstruct.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/iCBConstruct.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/ilbc/iCBSearch.c b/sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/iCBSearch.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/ilbc/iCBSearch.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/iCBSearch.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/ilbc/iCBSearch.h b/sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/iCBSearch.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/ilbc/iCBSearch.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/iCBSearch.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/ilbc/iLBC_decode.c b/sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/iLBC_decode.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/ilbc/iLBC_decode.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/iLBC_decode.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/ilbc/iLBC_decode.h b/sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/iLBC_decode.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/ilbc/iLBC_decode.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/iLBC_decode.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/ilbc/iLBC_define.h b/sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/iLBC_define.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/ilbc/iLBC_define.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/iLBC_define.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/ilbc/iLBC_encode.c b/sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/iLBC_encode.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/ilbc/iLBC_encode.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/iLBC_encode.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/ilbc/iLBC_encode.h b/sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/iLBC_encode.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/ilbc/iLBC_encode.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/iLBC_encode.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/ilbc/iLBC_test.c b/sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/iLBC_test.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/ilbc/iLBC_test.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/iLBC_test.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/ilbc/lsf.c b/sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/lsf.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/ilbc/lsf.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/lsf.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/ilbc/lsf.h b/sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/lsf.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/ilbc/lsf.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/lsf.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/ilbc/packing.c b/sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/packing.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/ilbc/packing.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/packing.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/ilbc/packing.h b/sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/packing.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/ilbc/packing.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/packing.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/ilbc/syntFilter.c b/sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/syntFilter.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/ilbc/syntFilter.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/syntFilter.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/ilbc/syntFilter.h b/sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/syntFilter.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/ilbc/syntFilter.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/syntFilter.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/mp3/BladeMP3EncDLL.h b/sflphone-common/libs/pjproject-1.0.2/third_party/mp3/BladeMP3EncDLL.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/mp3/BladeMP3EncDLL.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/mp3/BladeMP3EncDLL.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/mp3/mp3_port.h b/sflphone-common/libs/pjproject-1.0.2/third_party/mp3/mp3_port.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/mp3/mp3_port.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/mp3/mp3_port.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/mp3/mp3_writer.c b/sflphone-common/libs/pjproject-1.0.2/third_party/mp3/mp3_writer.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/mp3/mp3_writer.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/mp3/mp3_writer.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/Doxyfile b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/Doxyfile similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/Doxyfile rename to sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/Doxyfile diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/LICENSE.txt b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/LICENSE.txt similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/LICENSE.txt rename to sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/LICENSE.txt diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/README.txt b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/README.txt similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/README.txt rename to sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/README.txt diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/SConstruct b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/SConstruct similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/SConstruct rename to sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/SConstruct diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/build/dev-cpp/Makefile-dll b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/build/dev-cpp/Makefile-dll similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/build/dev-cpp/Makefile-dll rename to sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/build/dev-cpp/Makefile-dll diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/build/dev-cpp/Makefile-static b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/build/dev-cpp/Makefile-static similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/build/dev-cpp/Makefile-static rename to sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/build/dev-cpp/Makefile-static diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/build/dev-cpp/portaudio-dll.dev b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/build/dev-cpp/portaudio-dll.dev similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/build/dev-cpp/portaudio-dll.dev rename to sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/build/dev-cpp/portaudio-dll.dev diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/build/dev-cpp/portaudio-static.dev b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/build/dev-cpp/portaudio-static.dev similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/build/dev-cpp/portaudio-static.dev rename to sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/build/dev-cpp/portaudio-static.dev diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/build/dev-cpp/readme.txt b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/build/dev-cpp/readme.txt similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/build/dev-cpp/readme.txt rename to sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/build/dev-cpp/readme.txt diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/build/msvc/portaudio.def b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/build/msvc/portaudio.def similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/build/msvc/portaudio.def rename to sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/build/msvc/portaudio.def diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/build/msvc/portaudio.dsp b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/build/msvc/portaudio.dsp similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/build/msvc/portaudio.dsp rename to sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/build/msvc/portaudio.dsp diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/build/msvc/portaudio.dsw b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/build/msvc/portaudio.dsw similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/build/msvc/portaudio.dsw rename to sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/build/msvc/portaudio.dsw diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/build/msvc/portaudio.sln b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/build/msvc/portaudio.sln similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/build/msvc/portaudio.sln rename to sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/build/msvc/portaudio.sln diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/build/msvc/portaudio.vcproj b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/build/msvc/portaudio.vcproj similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/build/msvc/portaudio.vcproj rename to sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/build/msvc/portaudio.vcproj diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/build/msvc/readme.txt b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/build/msvc/readme.txt similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/build/msvc/readme.txt rename to sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/build/msvc/readme.txt diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/build/scons/SConscript_common b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/build/scons/SConscript_common similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/build/scons/SConscript_common rename to sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/build/scons/SConscript_common diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/build/scons/SConscript_opts b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/build/scons/SConscript_opts similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/build/scons/SConscript_opts rename to sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/build/scons/SConscript_opts diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/config.guess b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/config.guess similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/config.guess rename to sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/config.guess diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/config.sub b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/config.sub similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/config.sub rename to sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/config.sub diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/configure b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/configure similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/configure rename to sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/configure diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/configure.in b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/configure.in similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/configure.in rename to sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/configure.in diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/depcomp b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/depcomp similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/depcomp rename to sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/depcomp diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/fixdir.bat b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/fixdir.bat similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/fixdir.bat rename to sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/fixdir.bat diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/fixfile.bat b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/fixfile.bat similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/fixfile.bat rename to sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/fixfile.bat diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/include/pa_asio.h b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/include/pa_asio.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/include/pa_asio.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/include/pa_asio.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/include/pa_jack.h b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/include/pa_jack.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/include/pa_jack.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/include/pa_jack.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/include/pa_linux_alsa.h b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/include/pa_linux_alsa.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/include/pa_linux_alsa.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/include/pa_linux_alsa.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/include/pa_mac_core.h b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/include/pa_mac_core.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/include/pa_mac_core.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/include/pa_mac_core.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/include/pa_win_ds.h b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/include/pa_win_ds.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/include/pa_win_ds.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/include/pa_win_ds.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/include/pa_win_waveformat.h b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/include/pa_win_waveformat.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/include/pa_win_waveformat.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/include/pa_win_waveformat.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/include/pa_win_wmme.h b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/include/pa_win_wmme.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/include/pa_win_wmme.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/include/pa_win_wmme.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/include/portaudio.h b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/include/portaudio.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/include/portaudio.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/include/portaudio.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/index.html b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/index.html similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/index.html rename to sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/index.html diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/install-sh b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/install-sh similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/install-sh rename to sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/install-sh diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/ltmain.sh b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/ltmain.sh similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/ltmain.sh rename to sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/ltmain.sh diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/missing b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/missing similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/missing rename to sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/missing diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/pablio/README.txt b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/pablio/README.txt similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/pablio/README.txt rename to sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/pablio/README.txt diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/pablio/pablio.c b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/pablio/pablio.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/pablio/pablio.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/pablio/pablio.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/pablio/pablio.def b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/pablio/pablio.def similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/pablio/pablio.def rename to sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/pablio/pablio.def diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/pablio/pablio.h b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/pablio/pablio.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/pablio/pablio.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/pablio/pablio.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/pablio/test_rw.c b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/pablio/test_rw.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/pablio/test_rw.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/pablio/test_rw.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/pablio/test_rw_echo.c b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/pablio/test_rw_echo.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/pablio/test_rw_echo.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/pablio/test_rw_echo.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/pablio/test_w_saw.c b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/pablio/test_w_saw.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/pablio/test_w_saw.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/pablio/test_w_saw.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/pablio/test_w_saw8.c b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/pablio/test_w_saw8.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/pablio/test_w_saw8.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/pablio/test_w_saw8.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/portaudio-2.0.pc.in b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/portaudio-2.0.pc.in similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/portaudio-2.0.pc.in rename to sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/portaudio-2.0.pc.in diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/SConscript b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/SConscript similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/SConscript rename to sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/SConscript diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/common/pa_allocation.c b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/common/pa_allocation.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/common/pa_allocation.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/common/pa_allocation.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/common/pa_allocation.h b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/common/pa_allocation.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/common/pa_allocation.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/common/pa_allocation.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/common/pa_converters.c b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/common/pa_converters.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/common/pa_converters.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/common/pa_converters.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/common/pa_converters.h b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/common/pa_converters.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/common/pa_converters.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/common/pa_converters.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/common/pa_cpuload.c b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/common/pa_cpuload.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/common/pa_cpuload.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/common/pa_cpuload.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/common/pa_cpuload.h b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/common/pa_cpuload.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/common/pa_cpuload.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/common/pa_cpuload.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/common/pa_debugprint.c b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/common/pa_debugprint.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/common/pa_debugprint.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/common/pa_debugprint.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/common/pa_debugprint.h b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/common/pa_debugprint.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/common/pa_debugprint.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/common/pa_debugprint.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/common/pa_dither.c b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/common/pa_dither.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/common/pa_dither.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/common/pa_dither.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/common/pa_dither.h b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/common/pa_dither.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/common/pa_dither.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/common/pa_dither.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/common/pa_endianness.h b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/common/pa_endianness.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/common/pa_endianness.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/common/pa_endianness.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/common/pa_front.c b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/common/pa_front.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/common/pa_front.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/common/pa_front.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/common/pa_hostapi.h b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/common/pa_hostapi.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/common/pa_hostapi.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/common/pa_hostapi.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/common/pa_memorybarrier.h b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/common/pa_memorybarrier.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/common/pa_memorybarrier.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/common/pa_memorybarrier.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/common/pa_process.c b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/common/pa_process.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/common/pa_process.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/common/pa_process.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/common/pa_process.h b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/common/pa_process.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/common/pa_process.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/common/pa_process.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/common/pa_ringbuffer.c b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/common/pa_ringbuffer.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/common/pa_ringbuffer.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/common/pa_ringbuffer.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/common/pa_ringbuffer.h b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/common/pa_ringbuffer.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/common/pa_ringbuffer.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/common/pa_ringbuffer.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/common/pa_skeleton.c b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/common/pa_skeleton.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/common/pa_skeleton.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/common/pa_skeleton.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/common/pa_stream.c b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/common/pa_stream.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/common/pa_stream.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/common/pa_stream.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/common/pa_stream.h b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/common/pa_stream.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/common/pa_stream.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/common/pa_stream.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/common/pa_trace.c b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/common/pa_trace.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/common/pa_trace.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/common/pa_trace.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/common/pa_trace.h b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/common/pa_trace.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/common/pa_trace.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/common/pa_trace.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/common/pa_types.h b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/common/pa_types.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/common/pa_types.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/common/pa_types.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/common/pa_util.h b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/common/pa_util.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/common/pa_util.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/common/pa_util.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/hostapi/alsa/pa_linux_alsa.c b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/alsa/pa_linux_alsa.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/hostapi/alsa/pa_linux_alsa.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/alsa/pa_linux_alsa.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/hostapi/asihpi/pa_linux_asihpi.c b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/asihpi/pa_linux_asihpi.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/hostapi/asihpi/pa_linux_asihpi.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/asihpi/pa_linux_asihpi.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/hostapi/asio/ASIO-README.txt b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/asio/ASIO-README.txt similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/hostapi/asio/ASIO-README.txt rename to sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/asio/ASIO-README.txt diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/hostapi/asio/Callback_adaptation_.pdf b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/asio/Callback_adaptation_.pdf similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/hostapi/asio/Callback_adaptation_.pdf rename to sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/asio/Callback_adaptation_.pdf diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/hostapi/asio/Pa_ASIO.pdf b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/asio/Pa_ASIO.pdf similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/hostapi/asio/Pa_ASIO.pdf rename to sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/asio/Pa_ASIO.pdf diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/hostapi/asio/iasiothiscallresolver.cpp b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/asio/iasiothiscallresolver.cpp similarity index 87% rename from sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/hostapi/asio/iasiothiscallresolver.cpp rename to sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/asio/iasiothiscallresolver.cpp index 8dfefbd67b95ffc0d64194ab75ab7a05e1b1f72f..1b4b33781f155d3eb78dbbfe53dba83bee14ac08 100644 --- a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/hostapi/asio/iasiothiscallresolver.cpp +++ b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/asio/iasiothiscallresolver.cpp @@ -71,7 +71,7 @@ (IUnknown functions) 0 virtual HRESULT STDMETHODCALLTYPE (*QueryInterface)(REFIID riid, void **ppv) = 0; 4 virtual ULONG STDMETHODCALLTYPE (*AddRef)() = 0; - 8 virtual ULONG STDMETHODCALLTYPE (*Release)() = 0; + 8 virtual ULONG STDMETHODCALLTYPE (*Release)() = 0; (IASIO functions) 12 virtual ASIOBool (*init)(void *sysHandle) = 0; @@ -128,7 +128,7 @@ with MSVC, and requires that you ship the OpenASIO DLL with your application. - + ACKNOWLEDGEMENTS Ross Bencina: worked out the thiscall details above, wrote the original @@ -186,7 +186,7 @@ extern IASIO* theAsioDriver; // The following macros define the inline assembler for BORLAND first then gcc -#if defined(__BCPLUSPLUS__) || defined(__BORLANDC__) +#if defined(__BCPLUSPLUS__) || defined(__BORLANDC__) #define CALL_THISCALL_0( resultName, thisPtr, funcOffset )\ @@ -277,7 +277,7 @@ extern IASIO* theAsioDriver; :"=a"(resultName) /* Output Operands */ \ :"c"(thisPtr) /* Input Operands */ \ ); \ - + #define CALL_VOID_THISCALL_1( thisPtr, funcOffset, param1 ) \ __asm__ __volatile__ ("pushl %0\n\t" \ @@ -287,7 +287,7 @@ extern IASIO* theAsioDriver; :"r"(param1), /* Input Operands */ \ "c"(thisPtr) \ ); \ - + #define CALL_THISCALL_1( resultName, thisPtr, funcOffset, param1 ) \ __asm__ __volatile__ ("pushl %1\n\t" \ @@ -297,7 +297,7 @@ extern IASIO* theAsioDriver; :"r"(param1), /* Input Operands */ \ "c"(thisPtr) \ ); \ - + #define CALL_THISCALL_1_DOUBLE( resultName, thisPtr, funcOffset, param1 ) \ __asm__ __volatile__ ("pushl 4(%1)\n\t" \ @@ -310,7 +310,7 @@ extern IASIO* theAsioDriver; /* when using GCC 3.3.3, and maybe later versions*/\ "c"(thisPtr) \ ); \ - + #define CALL_THISCALL_2( resultName, thisPtr, funcOffset, param1, param2 ) \ __asm__ __volatile__ ("pushl %1\n\t" \ @@ -322,7 +322,7 @@ extern IASIO* theAsioDriver; "r"(param1), \ "c"(thisPtr) \ ); \ - + #define CALL_THISCALL_4( resultName, thisPtr, funcOffset, param1, param2, param3, param4 )\ __asm__ __volatile__ ("pushl %1\n\t" \ @@ -338,7 +338,7 @@ extern IASIO* theAsioDriver; "r"(param1), \ "c"(thisPtr) \ ); \ - + #endif @@ -354,8 +354,8 @@ IASIOThiscallResolver::IASIOThiscallResolver() } // Constructor called from ASIOInit() below -IASIOThiscallResolver::IASIOThiscallResolver(IASIO* that) -: that_( that ) +IASIOThiscallResolver::IASIOThiscallResolver (IASIO* that) + : that_ (that) { } @@ -363,11 +363,11 @@ IASIOThiscallResolver::IASIOThiscallResolver(IASIO* that) // really a COM object, just a wrapper which will work with the ASIO SDK. // If you wanted to use ASIO without the SDK you might want to implement COM // aggregation in these methods. -HRESULT STDMETHODCALLTYPE IASIOThiscallResolver::QueryInterface(REFIID riid, void **ppv) +HRESULT STDMETHODCALLTYPE IASIOThiscallResolver::QueryInterface (REFIID riid, void **ppv) { - (void)riid; // suppress unused variable warning + (void) riid; // suppress unused variable warning - assert( false ); // this function should never be called by the ASIO SDK. + assert (false); // this function should never be called by the ASIO SDK. *ppv = NULL; return E_NOINTERFACE; @@ -375,176 +375,176 @@ HRESULT STDMETHODCALLTYPE IASIOThiscallResolver::QueryInterface(REFIID riid, voi ULONG STDMETHODCALLTYPE IASIOThiscallResolver::AddRef() { - assert( false ); // this function should never be called by the ASIO SDK. + assert (false); // this function should never be called by the ASIO SDK. return 1; } ULONG STDMETHODCALLTYPE IASIOThiscallResolver::Release() { - assert( false ); // this function should never be called by the ASIO SDK. - + assert (false); // this function should never be called by the ASIO SDK. + return 1; } // Implement the IASIO interface methods by performing the vptr manipulation // described above then delegating to the real implementation. -ASIOBool IASIOThiscallResolver::init(void *sysHandle) +ASIOBool IASIOThiscallResolver::init (void *sysHandle) { ASIOBool result; - CALL_THISCALL_1( result, that_, 12, sysHandle ); + CALL_THISCALL_1 (result, that_, 12, sysHandle); return result; } -void IASIOThiscallResolver::getDriverName(char *name) +void IASIOThiscallResolver::getDriverName (char *name) { - CALL_VOID_THISCALL_1( that_, 16, name ); + CALL_VOID_THISCALL_1 (that_, 16, name); } long IASIOThiscallResolver::getDriverVersion() { ASIOBool result; - CALL_THISCALL_0( result, that_, 20 ); + CALL_THISCALL_0 (result, that_, 20); return result; } -void IASIOThiscallResolver::getErrorMessage(char *string) +void IASIOThiscallResolver::getErrorMessage (char *string) { - CALL_VOID_THISCALL_1( that_, 24, string ); + CALL_VOID_THISCALL_1 (that_, 24, string); } ASIOError IASIOThiscallResolver::start() { ASIOBool result; - CALL_THISCALL_0( result, that_, 28 ); + CALL_THISCALL_0 (result, that_, 28); return result; } ASIOError IASIOThiscallResolver::stop() { ASIOBool result; - CALL_THISCALL_0( result, that_, 32 ); + CALL_THISCALL_0 (result, that_, 32); return result; } -ASIOError IASIOThiscallResolver::getChannels(long *numInputChannels, long *numOutputChannels) +ASIOError IASIOThiscallResolver::getChannels (long *numInputChannels, long *numOutputChannels) { ASIOBool result; - CALL_THISCALL_2( result, that_, 36, numInputChannels, numOutputChannels ); + CALL_THISCALL_2 (result, that_, 36, numInputChannels, numOutputChannels); return result; } -ASIOError IASIOThiscallResolver::getLatencies(long *inputLatency, long *outputLatency) +ASIOError IASIOThiscallResolver::getLatencies (long *inputLatency, long *outputLatency) { ASIOBool result; - CALL_THISCALL_2( result, that_, 40, inputLatency, outputLatency ); + CALL_THISCALL_2 (result, that_, 40, inputLatency, outputLatency); return result; } -ASIOError IASIOThiscallResolver::getBufferSize(long *minSize, long *maxSize, +ASIOError IASIOThiscallResolver::getBufferSize (long *minSize, long *maxSize, long *preferredSize, long *granularity) { ASIOBool result; - CALL_THISCALL_4( result, that_, 44, minSize, maxSize, preferredSize, granularity ); + CALL_THISCALL_4 (result, that_, 44, minSize, maxSize, preferredSize, granularity); return result; } -ASIOError IASIOThiscallResolver::canSampleRate(ASIOSampleRate sampleRate) +ASIOError IASIOThiscallResolver::canSampleRate (ASIOSampleRate sampleRate) { ASIOBool result; - CALL_THISCALL_1_DOUBLE( result, that_, 48, sampleRate ); + CALL_THISCALL_1_DOUBLE (result, that_, 48, sampleRate); return result; } -ASIOError IASIOThiscallResolver::getSampleRate(ASIOSampleRate *sampleRate) +ASIOError IASIOThiscallResolver::getSampleRate (ASIOSampleRate *sampleRate) { ASIOBool result; - CALL_THISCALL_1( result, that_, 52, sampleRate ); + CALL_THISCALL_1 (result, that_, 52, sampleRate); return result; } -ASIOError IASIOThiscallResolver::setSampleRate(ASIOSampleRate sampleRate) -{ +ASIOError IASIOThiscallResolver::setSampleRate (ASIOSampleRate sampleRate) +{ ASIOBool result; - CALL_THISCALL_1_DOUBLE( result, that_, 56, sampleRate ); + CALL_THISCALL_1_DOUBLE (result, that_, 56, sampleRate); return result; } -ASIOError IASIOThiscallResolver::getClockSources(ASIOClockSource *clocks, long *numSources) +ASIOError IASIOThiscallResolver::getClockSources (ASIOClockSource *clocks, long *numSources) { ASIOBool result; - CALL_THISCALL_2( result, that_, 60, clocks, numSources ); + CALL_THISCALL_2 (result, that_, 60, clocks, numSources); return result; } -ASIOError IASIOThiscallResolver::setClockSource(long reference) +ASIOError IASIOThiscallResolver::setClockSource (long reference) { ASIOBool result; - CALL_THISCALL_1( result, that_, 64, reference ); + CALL_THISCALL_1 (result, that_, 64, reference); return result; } -ASIOError IASIOThiscallResolver::getSamplePosition(ASIOSamples *sPos, ASIOTimeStamp *tStamp) +ASIOError IASIOThiscallResolver::getSamplePosition (ASIOSamples *sPos, ASIOTimeStamp *tStamp) { ASIOBool result; - CALL_THISCALL_2( result, that_, 68, sPos, tStamp ); + CALL_THISCALL_2 (result, that_, 68, sPos, tStamp); return result; } -ASIOError IASIOThiscallResolver::getChannelInfo(ASIOChannelInfo *info) +ASIOError IASIOThiscallResolver::getChannelInfo (ASIOChannelInfo *info) { ASIOBool result; - CALL_THISCALL_1( result, that_, 72, info ); + CALL_THISCALL_1 (result, that_, 72, info); return result; } -ASIOError IASIOThiscallResolver::createBuffers(ASIOBufferInfo *bufferInfos, +ASIOError IASIOThiscallResolver::createBuffers (ASIOBufferInfo *bufferInfos, long numChannels, long bufferSize, ASIOCallbacks *callbacks) { ASIOBool result; - CALL_THISCALL_4( result, that_, 76, bufferInfos, numChannels, bufferSize, callbacks ); + CALL_THISCALL_4 (result, that_, 76, bufferInfos, numChannels, bufferSize, callbacks); return result; } ASIOError IASIOThiscallResolver::disposeBuffers() { ASIOBool result; - CALL_THISCALL_0( result, that_, 80 ); + CALL_THISCALL_0 (result, that_, 80); return result; } ASIOError IASIOThiscallResolver::controlPanel() { ASIOBool result; - CALL_THISCALL_0( result, that_, 84 ); + CALL_THISCALL_0 (result, that_, 84); return result; } -ASIOError IASIOThiscallResolver::future(long selector,void *opt) +ASIOError IASIOThiscallResolver::future (long selector,void *opt) { ASIOBool result; - CALL_THISCALL_2( result, that_, 88, selector, opt ); + CALL_THISCALL_2 (result, that_, 88, selector, opt); return result; } ASIOError IASIOThiscallResolver::outputReady() { ASIOBool result; - CALL_THISCALL_0( result, that_, 92 ); + CALL_THISCALL_0 (result, that_, 92); return result; } // Implement our substitute ASIOInit() method -ASIOError IASIOThiscallResolver::ASIOInit(ASIODriverInfo *info) +ASIOError IASIOThiscallResolver::ASIOInit (ASIODriverInfo *info) { // To ensure that our instance's vptr is correctly constructed, even if // ASIOInit is called prior to main(), we explicitly call its constructor // (potentially over the top of an existing instance). Note that this is // pretty ugly, and is only safe because IASIOThiscallResolver has no // destructor and contains no objects with destructors. - new((void*)&instance) IASIOThiscallResolver( theAsioDriver ); + new ( (void*) &instance) IASIOThiscallResolver (theAsioDriver); // Interpose between ASIO client code and the real driver. theAsioDriver = &instance; @@ -553,7 +553,7 @@ ASIOError IASIOThiscallResolver::ASIOInit(ASIODriverInfo *info) // real driver because theAsioDriver is reset to zero in ASIOExit(). // Delegate to the real ASIOInit - return ::ASIOInit(info); + return ::ASIOInit (info); } diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/hostapi/asio/iasiothiscallresolver.h b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/asio/iasiothiscallresolver.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/hostapi/asio/iasiothiscallresolver.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/asio/iasiothiscallresolver.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/hostapi/asio/pa_asio.cpp b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/asio/pa_asio.cpp similarity index 55% rename from sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/hostapi/asio/pa_asio.cpp rename to sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/asio/pa_asio.cpp index 1ba67e92ae9080876f6b83b5550b241819acfe0f..cf54465cfa65c74901ed79159748ab6f2232d66f 100644 --- a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/hostapi/asio/pa_asio.cpp +++ b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/asio/pa_asio.cpp @@ -29,13 +29,13 @@ */ /* - * The text above constitutes the entire PortAudio license; however, + * The text above constitutes the entire PortAudio license; however, * the PortAudio community also makes the following non-binding requests: * * Any person wishing to distribute modifications to the Software is * requested to send the modifications to the original developer so that - * they can be incorporated into the canonical version. It is also - * requested that these non-binding requests be included along with the + * they can be incorporated into the canonical version. It is also + * requested that these non-binding requests be included along with the * license above. */ @@ -83,7 +83,7 @@ @todo review ReadStream, WriteStream, GetStreamReadAvailable, GetStreamWriteAvailable - @todo review Blocking i/o latency computations in OpenStream(), changing ring + @todo review Blocking i/o latency computations in OpenStream(), changing ring buffer to a non-power-of-two structure could reduce blocking i/o latency. @todo implement IsFormatSupported @@ -171,8 +171,8 @@ /* external reference to ASIO SDK's asioDrivers. - This is a bit messy because we want to explicitly manage - allocation/deallocation of this structure, but some layers of the SDK + This is a bit messy because we want to explicitly manage + allocation/deallocation of this structure, but some layers of the SDK which we currently use (eg the implementation in asio.cpp) still use this global version. @@ -190,9 +190,9 @@ extern AsioDrivers* asioDrivers; /* prototypes for functions declared in this file */ -extern "C" PaError PaAsio_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex hostApiIndex ); -static void Terminate( struct PaUtilHostApiRepresentation *hostApi ); -static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi, +extern "C" PaError PaAsio_Initialize (PaUtilHostApiRepresentation **hostApi, PaHostApiIndex hostApiIndex); +static void Terminate (struct PaUtilHostApiRepresentation *hostApi); +static PaError OpenStream (struct PaUtilHostApiRepresentation *hostApi, PaStream** s, const PaStreamParameters *inputParameters, const PaStreamParameters *outputParameters, @@ -200,82 +200,109 @@ static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi, unsigned long framesPerBuffer, PaStreamFlags streamFlags, PaStreamCallback *streamCallback, - void *userData ); -static PaError IsFormatSupported( struct PaUtilHostApiRepresentation *hostApi, + void *userData); +static PaError IsFormatSupported (struct PaUtilHostApiRepresentation *hostApi, const PaStreamParameters *inputParameters, const PaStreamParameters *outputParameters, - double sampleRate ); -static PaError CloseStream( PaStream* stream ); -static PaError StartStream( PaStream *stream ); -static PaError StopStream( PaStream *stream ); -static PaError AbortStream( PaStream *stream ); -static PaError IsStreamStopped( PaStream *s ); -static PaError IsStreamActive( PaStream *stream ); -static PaTime GetStreamTime( PaStream *stream ); -static double GetStreamCpuLoad( PaStream* stream ); -static PaError ReadStream( PaStream* stream, void *buffer, unsigned long frames ); -static PaError WriteStream( PaStream* stream, const void *buffer, unsigned long frames ); -static signed long GetStreamReadAvailable( PaStream* stream ); -static signed long GetStreamWriteAvailable( PaStream* stream ); + double sampleRate); +static PaError CloseStream (PaStream* stream); +static PaError StartStream (PaStream *stream); +static PaError StopStream (PaStream *stream); +static PaError AbortStream (PaStream *stream); +static PaError IsStreamStopped (PaStream *s); +static PaError IsStreamActive (PaStream *stream); +static PaTime GetStreamTime (PaStream *stream); +static double GetStreamCpuLoad (PaStream* stream); +static PaError ReadStream (PaStream* stream, void *buffer, unsigned long frames); +static PaError WriteStream (PaStream* stream, const void *buffer, unsigned long frames); +static signed long GetStreamReadAvailable (PaStream* stream); +static signed long GetStreamWriteAvailable (PaStream* stream); /* Blocking i/o callback function. */ -static int BlockingIoPaCallback(const void *inputBuffer , - void *outputBuffer , - unsigned long framesPerBuffer, - const PaStreamCallbackTimeInfo *timeInfo , - PaStreamCallbackFlags statusFlags , - void *userData ); +static int BlockingIoPaCallback (const void *inputBuffer , + void *outputBuffer , + unsigned long framesPerBuffer, + const PaStreamCallbackTimeInfo *timeInfo , + PaStreamCallbackFlags statusFlags , + void *userData); /* our ASIO callback functions */ -static void bufferSwitch(long index, ASIOBool processNow); -static ASIOTime *bufferSwitchTimeInfo(ASIOTime *timeInfo, long index, ASIOBool processNow); -static void sampleRateChanged(ASIOSampleRate sRate); -static long asioMessages(long selector, long value, void* message, double* opt); +static void bufferSwitch (long index, ASIOBool processNow); +static ASIOTime *bufferSwitchTimeInfo (ASIOTime *timeInfo, long index, ASIOBool processNow); +static void sampleRateChanged (ASIOSampleRate sRate); +static long asioMessages (long selector, long value, void* message, double* opt); -static ASIOCallbacks asioCallbacks_ = - { bufferSwitch, sampleRateChanged, asioMessages, bufferSwitchTimeInfo }; +static ASIOCallbacks asioCallbacks_ = { bufferSwitch, sampleRateChanged, asioMessages, bufferSwitchTimeInfo }; #define PA_ASIO_SET_LAST_HOST_ERROR( errorCode, errorText ) \ PaUtil_SetLastHostErrorInfo( paASIO, errorCode, errorText ) -static void PaAsio_SetLastSystemError( DWORD errorCode ) +static void PaAsio_SetLastSystemError (DWORD errorCode) { LPVOID lpMsgBuf; - FormatMessage( + FormatMessage ( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL, errorCode, - MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), + MAKELANGID (LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR) &lpMsgBuf, 0, NULL ); - PaUtil_SetLastHostErrorInfo( paASIO, errorCode, (const char*)lpMsgBuf ); - LocalFree( lpMsgBuf ); + PaUtil_SetLastHostErrorInfo (paASIO, errorCode, (const char*) lpMsgBuf); + LocalFree (lpMsgBuf); } #define PA_ASIO_SET_LAST_SYSTEM_ERROR( errorCode ) \ PaAsio_SetLastSystemError( errorCode ) -static const char* PaAsio_GetAsioErrorText( ASIOError asioError ) +static const char* PaAsio_GetAsioErrorText (ASIOError asioError) { const char *result; - switch( asioError ){ + switch (asioError) { + case ASE_OK: - case ASE_SUCCESS: result = "Success"; break; - case ASE_NotPresent: result = "Hardware input or output is not present or available"; break; - case ASE_HWMalfunction: result = "Hardware is malfunctioning"; break; - case ASE_InvalidParameter: result = "Input parameter invalid"; break; - case ASE_InvalidMode: result = "Hardware is in a bad mode or used in a bad mode"; break; - case ASE_SPNotAdvancing: result = "Hardware is not running when sample position is inquired"; break; - case ASE_NoClock: result = "Sample clock or rate cannot be determined or is not present"; break; - case ASE_NoMemory: result = "Not enough memory for completing the request"; break; - default: result = "Unknown ASIO error"; break; + + case ASE_SUCCESS: + result = "Success"; + break; + + case ASE_NotPresent: + result = "Hardware input or output is not present or available"; + break; + + case ASE_HWMalfunction: + result = "Hardware is malfunctioning"; + break; + + case ASE_InvalidParameter: + result = "Input parameter invalid"; + break; + + case ASE_InvalidMode: + result = "Hardware is in a bad mode or used in a bad mode"; + break; + + case ASE_SPNotAdvancing: + result = "Hardware is not running when sample position is inquired"; + break; + + case ASE_NoClock: + result = "Sample clock or rate cannot be determined or is not present"; + break; + + case ASE_NoMemory: + result = "Not enough memory for completing the request"; + break; + + default: + result = "Unknown ASIO error"; + break; } return result; @@ -290,30 +317,45 @@ static const char* PaAsio_GetAsioErrorText( ASIOError asioError ) // Atomic increment and decrement operations #if MAC - /* need to be implemented on Mac */ - inline long PaAsio_AtomicIncrement(volatile long* v) {return ++(*const_cast<long*>(v));} - inline long PaAsio_AtomicDecrement(volatile long* v) {return --(*const_cast<long*>(v));} +/* need to be implemented on Mac */ +inline long PaAsio_AtomicIncrement (volatile long* v) +{ + return ++ (*const_cast<long*> (v)); +} + +inline long PaAsio_AtomicDecrement (volatile long* v) +{ + return -- (*const_cast<long*> (v)); +} + #elif WINDOWS - inline long PaAsio_AtomicIncrement(volatile long* v) {return InterlockedIncrement(const_cast<long*>(v));} - inline long PaAsio_AtomicDecrement(volatile long* v) {return InterlockedDecrement(const_cast<long*>(v));} +inline long PaAsio_AtomicIncrement (volatile long* v) +{ + return InterlockedIncrement (const_cast<long*> (v)); +} + +inline long PaAsio_AtomicDecrement (volatile long* v) +{ + return InterlockedDecrement (const_cast<long*> (v)); +} + #endif -typedef struct PaAsioDriverInfo -{ +typedef struct PaAsioDriverInfo { ASIODriverInfo asioDriverInfo; long inputChannelCount, outputChannelCount; long bufferMinSize, bufferMaxSize, bufferPreferredSize, bufferGranularity; bool postOutput; } + PaAsioDriverInfo; /* PaAsioHostApiRepresentation - host api datastructure specific to this implementation */ -typedef struct -{ +typedef struct { PaUtilHostApiRepresentation inheritedHostApiRep; PaUtilStreamInterface callbackStreamInterface; PaUtilStreamInterface blockingStreamInterface; @@ -322,7 +364,7 @@ typedef struct AsioDrivers *asioDrivers; void *systemSpecific; - + /* the ASIO C API only allows one ASIO driver to be open at a time, so we keep track of whether we have the driver open here, and use this information to return errors from OpenStream if the @@ -337,6 +379,7 @@ typedef struct PaDeviceIndex openAsioDeviceIndex; PaAsioDriverInfo openAsioDriverInfo; } + PaAsioHostApiRepresentation; @@ -344,117 +387,206 @@ PaAsioHostApiRepresentation; Retrieve <driverCount> driver names from ASIO, returned in a char** allocated in <group>. */ -static char **GetAsioDriverNames( PaAsioHostApiRepresentation *asioHostApi, PaUtilAllocationGroup *group, long driverCount ) +static char **GetAsioDriverNames (PaAsioHostApiRepresentation *asioHostApi, PaUtilAllocationGroup *group, long driverCount) { char **result = 0; int i; - result =(char**)PaUtil_GroupAllocateMemory( - group, sizeof(char*) * driverCount ); - if( !result ) + result = (char**) PaUtil_GroupAllocateMemory ( + group, sizeof (char*) * driverCount); + + if (!result) goto error; - result[0] = (char*)PaUtil_GroupAllocateMemory( - group, 32 * driverCount ); - if( !result[0] ) + result[0] = (char*) PaUtil_GroupAllocateMemory ( + group, 32 * driverCount); + + if (!result[0]) goto error; - for( i=0; i<driverCount; ++i ) + for (i=0; i<driverCount; ++i) result[i] = result[0] + (32 * i); - asioHostApi->asioDrivers->getDriverNames( result, driverCount ); + asioHostApi->asioDrivers->getDriverNames (result, driverCount); error: return result; } -static PaSampleFormat AsioSampleTypeToPaNativeSampleFormat(ASIOSampleType type) +static PaSampleFormat AsioSampleTypeToPaNativeSampleFormat (ASIOSampleType type) { switch (type) { + case ASIOSTInt16MSB: + case ASIOSTInt16LSB: - return paInt16; + return paInt16; case ASIOSTFloat32MSB: + case ASIOSTFloat32LSB: + case ASIOSTFloat64MSB: + case ASIOSTFloat64LSB: - return paFloat32; + return paFloat32; case ASIOSTInt32MSB: + case ASIOSTInt32LSB: + case ASIOSTInt32MSB16: + case ASIOSTInt32LSB16: + case ASIOSTInt32MSB18: + case ASIOSTInt32MSB20: + case ASIOSTInt32MSB24: + case ASIOSTInt32LSB18: + case ASIOSTInt32LSB20: + case ASIOSTInt32LSB24: - return paInt32; + return paInt32; case ASIOSTInt24MSB: + case ASIOSTInt24LSB: - return paInt24; + return paInt24; default: - return paCustomFormat; + return paCustomFormat; } } -void AsioSampleTypeLOG(ASIOSampleType type) +void AsioSampleTypeLOG (ASIOSampleType type) { switch (type) { - case ASIOSTInt16MSB: PA_DEBUG(("ASIOSTInt16MSB\n")); break; - case ASIOSTInt16LSB: PA_DEBUG(("ASIOSTInt16LSB\n")); break; - case ASIOSTFloat32MSB:PA_DEBUG(("ASIOSTFloat32MSB\n"));break; - case ASIOSTFloat32LSB:PA_DEBUG(("ASIOSTFloat32LSB\n"));break; - case ASIOSTFloat64MSB:PA_DEBUG(("ASIOSTFloat64MSB\n"));break; - case ASIOSTFloat64LSB:PA_DEBUG(("ASIOSTFloat64LSB\n"));break; - case ASIOSTInt32MSB: PA_DEBUG(("ASIOSTInt32MSB\n")); break; - case ASIOSTInt32LSB: PA_DEBUG(("ASIOSTInt32LSB\n")); break; - case ASIOSTInt32MSB16:PA_DEBUG(("ASIOSTInt32MSB16\n"));break; - case ASIOSTInt32LSB16:PA_DEBUG(("ASIOSTInt32LSB16\n"));break; - case ASIOSTInt32MSB18:PA_DEBUG(("ASIOSTInt32MSB18\n"));break; - case ASIOSTInt32MSB20:PA_DEBUG(("ASIOSTInt32MSB20\n"));break; - case ASIOSTInt32MSB24:PA_DEBUG(("ASIOSTInt32MSB24\n"));break; - case ASIOSTInt32LSB18:PA_DEBUG(("ASIOSTInt32LSB18\n"));break; - case ASIOSTInt32LSB20:PA_DEBUG(("ASIOSTInt32LSB20\n"));break; - case ASIOSTInt32LSB24:PA_DEBUG(("ASIOSTInt32LSB24\n"));break; - case ASIOSTInt24MSB: PA_DEBUG(("ASIOSTInt24MSB\n")); break; - case ASIOSTInt24LSB: PA_DEBUG(("ASIOSTInt24LSB\n")); break; - default: PA_DEBUG(("Custom Format%d\n",type));break; + + case ASIOSTInt16MSB: + PA_DEBUG ( ("ASIOSTInt16MSB\n")); + break; + + case ASIOSTInt16LSB: + PA_DEBUG ( ("ASIOSTInt16LSB\n")); + break; + + case ASIOSTFloat32MSB: + PA_DEBUG ( ("ASIOSTFloat32MSB\n")); + break; + + case ASIOSTFloat32LSB: + PA_DEBUG ( ("ASIOSTFloat32LSB\n")); + break; + + case ASIOSTFloat64MSB: + PA_DEBUG ( ("ASIOSTFloat64MSB\n")); + break; + + case ASIOSTFloat64LSB: + PA_DEBUG ( ("ASIOSTFloat64LSB\n")); + break; + + case ASIOSTInt32MSB: + PA_DEBUG ( ("ASIOSTInt32MSB\n")); + break; + + case ASIOSTInt32LSB: + PA_DEBUG ( ("ASIOSTInt32LSB\n")); + break; + + case ASIOSTInt32MSB16: + PA_DEBUG ( ("ASIOSTInt32MSB16\n")); + break; + + case ASIOSTInt32LSB16: + PA_DEBUG ( ("ASIOSTInt32LSB16\n")); + break; + + case ASIOSTInt32MSB18: + PA_DEBUG ( ("ASIOSTInt32MSB18\n")); + break; + + case ASIOSTInt32MSB20: + PA_DEBUG ( ("ASIOSTInt32MSB20\n")); + break; + + case ASIOSTInt32MSB24: + PA_DEBUG ( ("ASIOSTInt32MSB24\n")); + break; + + case ASIOSTInt32LSB18: + PA_DEBUG ( ("ASIOSTInt32LSB18\n")); + break; + + case ASIOSTInt32LSB20: + PA_DEBUG ( ("ASIOSTInt32LSB20\n")); + break; + + case ASIOSTInt32LSB24: + PA_DEBUG ( ("ASIOSTInt32LSB24\n")); + break; + + case ASIOSTInt24MSB: + PA_DEBUG ( ("ASIOSTInt24MSB\n")); + break; + + case ASIOSTInt24LSB: + PA_DEBUG ( ("ASIOSTInt24LSB\n")); + break; + + default: + PA_DEBUG ( ("Custom Format%d\n",type)); + break; } } -static int BytesPerAsioSample( ASIOSampleType sampleType ) +static int BytesPerAsioSample (ASIOSampleType sampleType) { switch (sampleType) { + case ASIOSTInt16MSB: + case ASIOSTInt16LSB: return 2; case ASIOSTFloat64MSB: + case ASIOSTFloat64LSB: return 8; case ASIOSTFloat32MSB: + case ASIOSTFloat32LSB: + case ASIOSTInt32MSB: + case ASIOSTInt32LSB: + case ASIOSTInt32MSB16: + case ASIOSTInt32LSB16: + case ASIOSTInt32MSB18: + case ASIOSTInt32MSB20: + case ASIOSTInt32MSB24: + case ASIOSTInt32LSB18: + case ASIOSTInt32LSB20: + case ASIOSTInt32LSB24: return 4; case ASIOSTInt24MSB: + case ASIOSTInt24LSB: return 3; @@ -464,93 +596,86 @@ static int BytesPerAsioSample( ASIOSampleType sampleType ) } -static void Swap16( void *buffer, long shift, long count ) +static void Swap16 (void *buffer, long shift, long count) { - unsigned short *p = (unsigned short*)buffer; + unsigned short *p = (unsigned short*) buffer; unsigned short temp; (void) shift; /* unused parameter */ - while( count-- ) - { + while (count--) { temp = *p; - *p++ = (unsigned short)((temp<<8) | (temp>>8)); + *p++ = (unsigned short) ( (temp<<8) | (temp>>8)); } } -static void Swap24( void *buffer, long shift, long count ) +static void Swap24 (void *buffer, long shift, long count) { - unsigned char *p = (unsigned char*)buffer; + unsigned char *p = (unsigned char*) buffer; unsigned char temp; (void) shift; /* unused parameter */ - while( count-- ) - { + while (count--) { temp = *p; - *p = *(p+2); - *(p+2) = temp; + *p = * (p+2); + * (p+2) = temp; p += 3; } } #define PA_SWAP32_( x ) ((x>>24) | ((x>>8)&0xFF00) | ((x<<8)&0xFF0000) | (x<<24)); -static void Swap32( void *buffer, long shift, long count ) +static void Swap32 (void *buffer, long shift, long count) { - unsigned long *p = (unsigned long*)buffer; + unsigned long *p = (unsigned long*) buffer; unsigned long temp; (void) shift; /* unused parameter */ - while( count-- ) - { + while (count--) { temp = *p; - *p++ = PA_SWAP32_( temp); + *p++ = PA_SWAP32_ (temp); } } -static void SwapShiftLeft32( void *buffer, long shift, long count ) +static void SwapShiftLeft32 (void *buffer, long shift, long count) { - unsigned long *p = (unsigned long*)buffer; + unsigned long *p = (unsigned long*) buffer; unsigned long temp; - while( count-- ) - { + while (count--) { temp = *p; - temp = PA_SWAP32_( temp); + temp = PA_SWAP32_ (temp); *p++ = temp << shift; } } -static void ShiftRightSwap32( void *buffer, long shift, long count ) +static void ShiftRightSwap32 (void *buffer, long shift, long count) { - unsigned long *p = (unsigned long*)buffer; + unsigned long *p = (unsigned long*) buffer; unsigned long temp; - while( count-- ) - { + while (count--) { temp = *p >> shift; - *p++ = PA_SWAP32_( temp); + *p++ = PA_SWAP32_ (temp); } } -static void ShiftLeft32( void *buffer, long shift, long count ) +static void ShiftLeft32 (void *buffer, long shift, long count) { - unsigned long *p = (unsigned long*)buffer; + unsigned long *p = (unsigned long*) buffer; unsigned long temp; - while( count-- ) - { + while (count--) { temp = *p; *p++ = temp << shift; } } -static void ShiftRight32( void *buffer, long shift, long count ) +static void ShiftRight32 (void *buffer, long shift, long count) { - unsigned long *p = (unsigned long*)buffer; + unsigned long *p = (unsigned long*) buffer; unsigned long temp; - while( count-- ) - { + while (count--) { temp = *p; *p++ = temp >> shift; } @@ -558,65 +683,63 @@ static void ShiftRight32( void *buffer, long shift, long count ) #define PA_SWAP_( x, y ) temp=x; x = y; y = temp; -static void Swap64ConvertFloat64ToFloat32( void *buffer, long shift, long count ) +static void Swap64ConvertFloat64ToFloat32 (void *buffer, long shift, long count) { - double *in = (double*)buffer; - float *out = (float*)buffer; + double *in = (double*) buffer; + float *out = (float*) buffer; unsigned char *p; unsigned char temp; (void) shift; /* unused parameter */ - while( count-- ) - { - p = (unsigned char*)in; - PA_SWAP_( p[0], p[7] ); - PA_SWAP_( p[1], p[6] ); - PA_SWAP_( p[2], p[5] ); - PA_SWAP_( p[3], p[4] ); + while (count--) { + p = (unsigned char*) in; + PA_SWAP_ (p[0], p[7]); + PA_SWAP_ (p[1], p[6]); + PA_SWAP_ (p[2], p[5]); + PA_SWAP_ (p[3], p[4]); *out++ = (float) (*in++); } } -static void ConvertFloat64ToFloat32( void *buffer, long shift, long count ) +static void ConvertFloat64ToFloat32 (void *buffer, long shift, long count) { - double *in = (double*)buffer; - float *out = (float*)buffer; + double *in = (double*) buffer; + float *out = (float*) buffer; (void) shift; /* unused parameter */ - while( count-- ) + while (count--) *out++ = (float) (*in++); } -static void ConvertFloat32ToFloat64Swap64( void *buffer, long shift, long count ) +static void ConvertFloat32ToFloat64Swap64 (void *buffer, long shift, long count) { - float *in = ((float*)buffer) + (count-1); - double *out = ((double*)buffer) + (count-1); + float *in = ( (float*) buffer) + (count-1); + double *out = ( (double*) buffer) + (count-1); unsigned char *p; unsigned char temp; (void) shift; /* unused parameter */ - while( count-- ) - { + while (count--) { *out = *in--; - p = (unsigned char*)out; - PA_SWAP_( p[0], p[7] ); - PA_SWAP_( p[1], p[6] ); - PA_SWAP_( p[2], p[5] ); - PA_SWAP_( p[3], p[4] ); + p = (unsigned char*) out; + PA_SWAP_ (p[0], p[7]); + PA_SWAP_ (p[1], p[6]); + PA_SWAP_ (p[2], p[5]); + PA_SWAP_ (p[3], p[4]); out--; } } -static void ConvertFloat32ToFloat64( void *buffer, long shift, long count ) +static void ConvertFloat32ToFloat64 (void *buffer, long shift, long count) { - float *in = ((float*)buffer) + (count-1); - double *out = ((double*)buffer) + (count-1); + float *in = ( (float*) buffer) + (count-1); + double *out = ( (double*) buffer) + (count-1); (void) shift; /* unused parameter */ - while( count-- ) + while (count--) *out-- = *in--; } @@ -630,302 +753,337 @@ static void ConvertFloat32ToFloat64( void *buffer, long shift, long count ) #define PA_LSB_IS_NATIVE_ #endif -typedef void PaAsioBufferConverter( void *, long, long ); +typedef void PaAsioBufferConverter (void *, long, long); -static void SelectAsioToPaConverter( ASIOSampleType type, PaAsioBufferConverter **converter, long *shift ) +static void SelectAsioToPaConverter (ASIOSampleType type, PaAsioBufferConverter **converter, long *shift) { *shift = 0; *converter = 0; switch (type) { + case ASIOSTInt16MSB: /* dest: paInt16, no conversion necessary, possible byte swap*/ - #ifdef PA_LSB_IS_NATIVE_ - *converter = Swap16; - #endif +#ifdef PA_LSB_IS_NATIVE_ + *converter = Swap16; +#endif break; + case ASIOSTInt16LSB: /* dest: paInt16, no conversion necessary, possible byte swap*/ - #ifdef PA_MSB_IS_NATIVE_ - *converter = Swap16; - #endif +#ifdef PA_MSB_IS_NATIVE_ + *converter = Swap16; +#endif break; + case ASIOSTFloat32MSB: /* dest: paFloat32, no conversion necessary, possible byte swap*/ - #ifdef PA_LSB_IS_NATIVE_ - *converter = Swap32; - #endif +#ifdef PA_LSB_IS_NATIVE_ + *converter = Swap32; +#endif break; + case ASIOSTFloat32LSB: /* dest: paFloat32, no conversion necessary, possible byte swap*/ - #ifdef PA_MSB_IS_NATIVE_ - *converter = Swap32; - #endif +#ifdef PA_MSB_IS_NATIVE_ + *converter = Swap32; +#endif break; + case ASIOSTFloat64MSB: /* dest: paFloat32, in-place conversion to/from float32, possible byte swap*/ - #ifdef PA_LSB_IS_NATIVE_ - *converter = Swap64ConvertFloat64ToFloat32; - #else - *converter = ConvertFloat64ToFloat32; - #endif +#ifdef PA_LSB_IS_NATIVE_ + *converter = Swap64ConvertFloat64ToFloat32; +#else + *converter = ConvertFloat64ToFloat32; +#endif break; + case ASIOSTFloat64LSB: /* dest: paFloat32, in-place conversion to/from float32, possible byte swap*/ - #ifdef PA_MSB_IS_NATIVE_ - *converter = Swap64ConvertFloat64ToFloat32; - #else - *converter = ConvertFloat64ToFloat32; - #endif +#ifdef PA_MSB_IS_NATIVE_ + *converter = Swap64ConvertFloat64ToFloat32; +#else + *converter = ConvertFloat64ToFloat32; +#endif break; + case ASIOSTInt32MSB: /* dest: paInt32, no conversion necessary, possible byte swap */ - #ifdef PA_LSB_IS_NATIVE_ - *converter = Swap32; - #endif +#ifdef PA_LSB_IS_NATIVE_ + *converter = Swap32; +#endif break; + case ASIOSTInt32LSB: /* dest: paInt32, no conversion necessary, possible byte swap */ - #ifdef PA_MSB_IS_NATIVE_ - *converter = Swap32; - #endif +#ifdef PA_MSB_IS_NATIVE_ + *converter = Swap32; +#endif break; + case ASIOSTInt32MSB16: /* dest: paInt32, 16 bit shift, possible byte swap */ - #ifdef PA_LSB_IS_NATIVE_ - *converter = SwapShiftLeft32; - #else - *converter = ShiftLeft32; - #endif +#ifdef PA_LSB_IS_NATIVE_ + *converter = SwapShiftLeft32; +#else + *converter = ShiftLeft32; +#endif *shift = 16; break; + case ASIOSTInt32MSB18: /* dest: paInt32, 14 bit shift, possible byte swap */ - #ifdef PA_LSB_IS_NATIVE_ - *converter = SwapShiftLeft32; - #else - *converter = ShiftLeft32; - #endif +#ifdef PA_LSB_IS_NATIVE_ + *converter = SwapShiftLeft32; +#else + *converter = ShiftLeft32; +#endif *shift = 14; break; + case ASIOSTInt32MSB20: /* dest: paInt32, 12 bit shift, possible byte swap */ - #ifdef PA_LSB_IS_NATIVE_ - *converter = SwapShiftLeft32; - #else - *converter = ShiftLeft32; - #endif +#ifdef PA_LSB_IS_NATIVE_ + *converter = SwapShiftLeft32; +#else + *converter = ShiftLeft32; +#endif *shift = 12; break; + case ASIOSTInt32MSB24: /* dest: paInt32, 8 bit shift, possible byte swap */ - #ifdef PA_LSB_IS_NATIVE_ - *converter = SwapShiftLeft32; - #else - *converter = ShiftLeft32; - #endif +#ifdef PA_LSB_IS_NATIVE_ + *converter = SwapShiftLeft32; +#else + *converter = ShiftLeft32; +#endif *shift = 8; break; + case ASIOSTInt32LSB16: /* dest: paInt32, 16 bit shift, possible byte swap */ - #ifdef PA_MSB_IS_NATIVE_ - *converter = SwapShiftLeft32; - #else - *converter = ShiftLeft32; - #endif +#ifdef PA_MSB_IS_NATIVE_ + *converter = SwapShiftLeft32; +#else + *converter = ShiftLeft32; +#endif *shift = 16; break; + case ASIOSTInt32LSB18: /* dest: paInt32, 14 bit shift, possible byte swap */ - #ifdef PA_MSB_IS_NATIVE_ - *converter = SwapShiftLeft32; - #else - *converter = ShiftLeft32; - #endif +#ifdef PA_MSB_IS_NATIVE_ + *converter = SwapShiftLeft32; +#else + *converter = ShiftLeft32; +#endif *shift = 14; break; + case ASIOSTInt32LSB20: /* dest: paInt32, 12 bit shift, possible byte swap */ - #ifdef PA_MSB_IS_NATIVE_ - *converter = SwapShiftLeft32; - #else - *converter = ShiftLeft32; - #endif +#ifdef PA_MSB_IS_NATIVE_ + *converter = SwapShiftLeft32; +#else + *converter = ShiftLeft32; +#endif *shift = 12; break; + case ASIOSTInt32LSB24: /* dest: paInt32, 8 bit shift, possible byte swap */ - #ifdef PA_MSB_IS_NATIVE_ - *converter = SwapShiftLeft32; - #else - *converter = ShiftLeft32; - #endif +#ifdef PA_MSB_IS_NATIVE_ + *converter = SwapShiftLeft32; +#else + *converter = ShiftLeft32; +#endif *shift = 8; break; + case ASIOSTInt24MSB: /* dest: paInt24, no conversion necessary, possible byte swap */ - #ifdef PA_LSB_IS_NATIVE_ - *converter = Swap24; - #endif +#ifdef PA_LSB_IS_NATIVE_ + *converter = Swap24; +#endif break; + case ASIOSTInt24LSB: /* dest: paInt24, no conversion necessary, possible byte swap */ - #ifdef PA_MSB_IS_NATIVE_ - *converter = Swap24; - #endif +#ifdef PA_MSB_IS_NATIVE_ + *converter = Swap24; +#endif break; } } -static void SelectPaToAsioConverter( ASIOSampleType type, PaAsioBufferConverter **converter, long *shift ) +static void SelectPaToAsioConverter (ASIOSampleType type, PaAsioBufferConverter **converter, long *shift) { *shift = 0; *converter = 0; switch (type) { + case ASIOSTInt16MSB: /* src: paInt16, no conversion necessary, possible byte swap*/ - #ifdef PA_LSB_IS_NATIVE_ - *converter = Swap16; - #endif +#ifdef PA_LSB_IS_NATIVE_ + *converter = Swap16; +#endif break; + case ASIOSTInt16LSB: /* src: paInt16, no conversion necessary, possible byte swap*/ - #ifdef PA_MSB_IS_NATIVE_ - *converter = Swap16; - #endif +#ifdef PA_MSB_IS_NATIVE_ + *converter = Swap16; +#endif break; + case ASIOSTFloat32MSB: /* src: paFloat32, no conversion necessary, possible byte swap*/ - #ifdef PA_LSB_IS_NATIVE_ - *converter = Swap32; - #endif +#ifdef PA_LSB_IS_NATIVE_ + *converter = Swap32; +#endif break; + case ASIOSTFloat32LSB: /* src: paFloat32, no conversion necessary, possible byte swap*/ - #ifdef PA_MSB_IS_NATIVE_ - *converter = Swap32; - #endif +#ifdef PA_MSB_IS_NATIVE_ + *converter = Swap32; +#endif break; + case ASIOSTFloat64MSB: /* src: paFloat32, in-place conversion to/from float32, possible byte swap*/ - #ifdef PA_LSB_IS_NATIVE_ - *converter = ConvertFloat32ToFloat64Swap64; - #else - *converter = ConvertFloat32ToFloat64; - #endif +#ifdef PA_LSB_IS_NATIVE_ + *converter = ConvertFloat32ToFloat64Swap64; +#else + *converter = ConvertFloat32ToFloat64; +#endif break; + case ASIOSTFloat64LSB: /* src: paFloat32, in-place conversion to/from float32, possible byte swap*/ - #ifdef PA_MSB_IS_NATIVE_ - *converter = ConvertFloat32ToFloat64Swap64; - #else - *converter = ConvertFloat32ToFloat64; - #endif +#ifdef PA_MSB_IS_NATIVE_ + *converter = ConvertFloat32ToFloat64Swap64; +#else + *converter = ConvertFloat32ToFloat64; +#endif break; + case ASIOSTInt32MSB: /* src: paInt32, no conversion necessary, possible byte swap */ - #ifdef PA_LSB_IS_NATIVE_ - *converter = Swap32; - #endif +#ifdef PA_LSB_IS_NATIVE_ + *converter = Swap32; +#endif break; + case ASIOSTInt32LSB: /* src: paInt32, no conversion necessary, possible byte swap */ - #ifdef PA_MSB_IS_NATIVE_ - *converter = Swap32; - #endif +#ifdef PA_MSB_IS_NATIVE_ + *converter = Swap32; +#endif break; + case ASIOSTInt32MSB16: /* src: paInt32, 16 bit shift, possible byte swap */ - #ifdef PA_LSB_IS_NATIVE_ - *converter = ShiftRightSwap32; - #else - *converter = ShiftRight32; - #endif +#ifdef PA_LSB_IS_NATIVE_ + *converter = ShiftRightSwap32; +#else + *converter = ShiftRight32; +#endif *shift = 16; break; + case ASIOSTInt32MSB18: /* src: paInt32, 14 bit shift, possible byte swap */ - #ifdef PA_LSB_IS_NATIVE_ - *converter = ShiftRightSwap32; - #else - *converter = ShiftRight32; - #endif +#ifdef PA_LSB_IS_NATIVE_ + *converter = ShiftRightSwap32; +#else + *converter = ShiftRight32; +#endif *shift = 14; break; + case ASIOSTInt32MSB20: /* src: paInt32, 12 bit shift, possible byte swap */ - #ifdef PA_LSB_IS_NATIVE_ - *converter = ShiftRightSwap32; - #else - *converter = ShiftRight32; - #endif +#ifdef PA_LSB_IS_NATIVE_ + *converter = ShiftRightSwap32; +#else + *converter = ShiftRight32; +#endif *shift = 12; break; + case ASIOSTInt32MSB24: /* src: paInt32, 8 bit shift, possible byte swap */ - #ifdef PA_LSB_IS_NATIVE_ - *converter = ShiftRightSwap32; - #else - *converter = ShiftRight32; - #endif +#ifdef PA_LSB_IS_NATIVE_ + *converter = ShiftRightSwap32; +#else + *converter = ShiftRight32; +#endif *shift = 8; break; + case ASIOSTInt32LSB16: /* src: paInt32, 16 bit shift, possible byte swap */ - #ifdef PA_MSB_IS_NATIVE_ - *converter = ShiftRightSwap32; - #else - *converter = ShiftRight32; - #endif +#ifdef PA_MSB_IS_NATIVE_ + *converter = ShiftRightSwap32; +#else + *converter = ShiftRight32; +#endif *shift = 16; break; + case ASIOSTInt32LSB18: /* src: paInt32, 14 bit shift, possible byte swap */ - #ifdef PA_MSB_IS_NATIVE_ - *converter = ShiftRightSwap32; - #else - *converter = ShiftRight32; - #endif +#ifdef PA_MSB_IS_NATIVE_ + *converter = ShiftRightSwap32; +#else + *converter = ShiftRight32; +#endif *shift = 14; break; + case ASIOSTInt32LSB20: /* src: paInt32, 12 bit shift, possible byte swap */ - #ifdef PA_MSB_IS_NATIVE_ - *converter = ShiftRightSwap32; - #else - *converter = ShiftRight32; - #endif +#ifdef PA_MSB_IS_NATIVE_ + *converter = ShiftRightSwap32; +#else + *converter = ShiftRight32; +#endif *shift = 12; break; + case ASIOSTInt32LSB24: /* src: paInt32, 8 bit shift, possible byte swap */ - #ifdef PA_MSB_IS_NATIVE_ - *converter = ShiftRightSwap32; - #else - *converter = ShiftRight32; - #endif +#ifdef PA_MSB_IS_NATIVE_ + *converter = ShiftRightSwap32; +#else + *converter = ShiftRight32; +#endif *shift = 8; break; + case ASIOSTInt24MSB: /* src: paInt24, no conversion necessary, possible byte swap */ - #ifdef PA_LSB_IS_NATIVE_ - *converter = Swap24; - #endif +#ifdef PA_LSB_IS_NATIVE_ + *converter = Swap24; +#endif break; + case ASIOSTInt24LSB: /* src: paInt24, no conversion necessary, possible byte swap */ - #ifdef PA_MSB_IS_NATIVE_ - *converter = Swap24; - #endif +#ifdef PA_MSB_IS_NATIVE_ + *converter = Swap24; +#endif break; } } -typedef struct PaAsioDeviceInfo -{ +typedef struct PaAsioDeviceInfo { PaDeviceInfo commonDeviceInfo; long minBufferSize; long maxBufferSize; @@ -934,26 +1092,25 @@ typedef struct PaAsioDeviceInfo ASIOChannelInfo *asioChannelInfos; } + PaAsioDeviceInfo; -PaError PaAsio_GetAvailableLatencyValues( PaDeviceIndex device, - long *minLatency, long *maxLatency, long *preferredLatency, long *granularity ) +PaError PaAsio_GetAvailableLatencyValues (PaDeviceIndex device, + long *minLatency, long *maxLatency, long *preferredLatency, long *granularity) { PaError result; PaUtilHostApiRepresentation *hostApi; PaDeviceIndex hostApiDevice; - result = PaUtil_GetHostApiRepresentation( &hostApi, paASIO ); + result = PaUtil_GetHostApiRepresentation (&hostApi, paASIO); - if( result == paNoError ) - { - result = PaUtil_DeviceIndexToHostApiDeviceIndex( &hostApiDevice, device, hostApi ); + if (result == paNoError) { + result = PaUtil_DeviceIndexToHostApiDeviceIndex (&hostApiDevice, device, hostApi); - if( result == paNoError ) - { + if (result == paNoError) { PaAsioDeviceInfo *asioDeviceInfo = - (PaAsioDeviceInfo*)hostApi->deviceInfos[hostApiDevice]; + (PaAsioDeviceInfo*) hostApi->deviceInfos[hostApiDevice]; *minLatency = asioDeviceInfo->minBufferSize; *maxLatency = asioDeviceInfo->maxBufferSize; @@ -968,10 +1125,10 @@ PaError PaAsio_GetAvailableLatencyValues( PaDeviceIndex device, /* Unload whatever we loaded in LoadAsioDriver(). Also balance the call to CoInitialize(0). */ -static void UnloadAsioDriver( void ) +static void UnloadAsioDriver (void) { - ASIOExit(); - CoUninitialize(); + ASIOExit(); + CoUninitialize(); } /* @@ -980,67 +1137,63 @@ static void UnloadAsioDriver( void ) and must be closed by the called by calling UnloadAsioDriver() - if an error is returned the driver will already be unloaded. */ -static PaError LoadAsioDriver( PaAsioHostApiRepresentation *asioHostApi, const char *driverName, - PaAsioDriverInfo *driverInfo, void *systemSpecific ) +static PaError LoadAsioDriver (PaAsioHostApiRepresentation *asioHostApi, const char *driverName, + PaAsioDriverInfo *driverInfo, void *systemSpecific) { PaError result = paNoError; ASIOError asioError; int asioIsInitialized = 0; - /* - ASIO uses CoCreateInstance() to load a driver. That requires that - CoInitialize(0) be called for every thread that loads a driver. - It is OK to call CoInitialize(0) multiple times form one thread as long - as it is balanced by a call to CoUninitialize(). See UnloadAsioDriver(). - - The V18 version called CoInitialize() starting on 2/19/02. - That was removed from PA V19 for unknown reasons. - Phil Burk added it back on 6/27/08 so that JSyn would work. + /* + ASIO uses CoCreateInstance() to load a driver. That requires that + CoInitialize(0) be called for every thread that loads a driver. + It is OK to call CoInitialize(0) multiple times form one thread as long + as it is balanced by a call to CoUninitialize(). See UnloadAsioDriver(). + + The V18 version called CoInitialize() starting on 2/19/02. + That was removed from PA V19 for unknown reasons. + Phil Burk added it back on 6/27/08 so that JSyn would work. */ - CoInitialize( 0 ); + CoInitialize (0); - if( !asioHostApi->asioDrivers->loadDriver( const_cast<char*>(driverName) ) ) - { - /* If this returns an error then it might be because CoInitialize(0) was removed. - It should be called right before this. - */ + if (!asioHostApi->asioDrivers->loadDriver (const_cast<char*> (driverName))) { + /* If this returns an error then it might be because CoInitialize(0) was removed. + It should be called right before this. + */ result = paUnanticipatedHostError; - PA_ASIO_SET_LAST_HOST_ERROR( 0, "Failed to load ASIO driver" ); + PA_ASIO_SET_LAST_HOST_ERROR (0, "Failed to load ASIO driver"); goto error; } - memset( &driverInfo->asioDriverInfo, 0, sizeof(ASIODriverInfo) ); + memset (&driverInfo->asioDriverInfo, 0, sizeof (ASIODriverInfo)); + driverInfo->asioDriverInfo.asioVersion = 2; driverInfo->asioDriverInfo.sysRef = systemSpecific; - if( (asioError = ASIOInit( &driverInfo->asioDriverInfo )) != ASE_OK ) - { + + if ( (asioError = ASIOInit (&driverInfo->asioDriverInfo)) != ASE_OK) { result = paUnanticipatedHostError; - PA_ASIO_SET_LAST_ASIO_ERROR( asioError ); + PA_ASIO_SET_LAST_ASIO_ERROR (asioError); goto error; - } - else - { + } else { asioIsInitialized = 1; } - if( (asioError = ASIOGetChannels(&driverInfo->inputChannelCount, - &driverInfo->outputChannelCount)) != ASE_OK ) - { + if ( (asioError = ASIOGetChannels (&driverInfo->inputChannelCount, + &driverInfo->outputChannelCount)) != ASE_OK) { result = paUnanticipatedHostError; - PA_ASIO_SET_LAST_ASIO_ERROR( asioError ); + PA_ASIO_SET_LAST_ASIO_ERROR (asioError); goto error; } - if( (asioError = ASIOGetBufferSize(&driverInfo->bufferMinSize, - &driverInfo->bufferMaxSize, &driverInfo->bufferPreferredSize, - &driverInfo->bufferGranularity)) != ASE_OK ) - { + if ( (asioError = ASIOGetBufferSize (&driverInfo->bufferMinSize, + &driverInfo->bufferMaxSize, &driverInfo->bufferPreferredSize, + &driverInfo->bufferGranularity)) != ASE_OK) { result = paUnanticipatedHostError; - PA_ASIO_SET_LAST_ASIO_ERROR( asioError ); + PA_ASIO_SET_LAST_ASIO_ERROR (asioError); goto error; } - if( ASIOOutputReady() == ASE_OK ) + if (ASIOOutputReady() == ASE_OK) driverInfo->postOutput = true; else driverInfo->postOutput = false; @@ -1048,27 +1201,29 @@ static PaError LoadAsioDriver( PaAsioHostApiRepresentation *asioHostApi, const c return result; error: - if( asioIsInitialized ) - { - ASIOExit(); - } - CoUninitialize(); + if (asioIsInitialized) { + ASIOExit(); + } + + CoUninitialize(); + return result; } #define PA_DEFAULTSAMPLERATESEARCHORDER_COUNT_ 13 /* must be the same number of elements as in the array below */ static ASIOSampleRate defaultSampleRateSearchOrder_[] - = {44100.0, 48000.0, 32000.0, 24000.0, 22050.0, 88200.0, 96000.0, - 192000.0, 16000.0, 12000.0, 11025.0, 9600.0, 8000.0 }; += {44100.0, 48000.0, 32000.0, 24000.0, 22050.0, 88200.0, 96000.0, + 192000.0, 16000.0, 12000.0, 11025.0, 9600.0, 8000.0 + }; /* we look up IsDebuggerPresent at runtime incase it isn't present (on Win95 for example) */ -typedef BOOL (WINAPI *IsDebuggerPresentPtr)(VOID); +typedef BOOL (WINAPI *IsDebuggerPresentPtr) (VOID); IsDebuggerPresentPtr IsDebuggerPresent_ = 0; //FARPROC IsDebuggerPresent_ = 0; // this is the current way to do it apparently according to davidv -PaError PaAsio_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex hostApiIndex ) +PaError PaAsio_Initialize (PaUtilHostApiRepresentation **hostApi, PaHostApiIndex hostApiIndex) { PaError result = paNoError; int i, driverCount; @@ -1077,9 +1232,9 @@ PaError PaAsio_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex char **names; PaAsioDriverInfo paAsioDriverInfo; - asioHostApi = (PaAsioHostApiRepresentation*)PaUtil_AllocateMemory( sizeof(PaAsioHostApiRepresentation) ); - if( !asioHostApi ) - { + asioHostApi = (PaAsioHostApiRepresentation*) PaUtil_AllocateMemory (sizeof (PaAsioHostApiRepresentation)); + + if (!asioHostApi) { result = paInsufficientMemory; goto error; } @@ -1087,25 +1242,22 @@ PaError PaAsio_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex asioHostApi->asioDrivers = 0; /* avoid surprises in our error handler below */ asioHostApi->allocations = PaUtil_CreateAllocationGroup(); - if( !asioHostApi->allocations ) - { + + if (!asioHostApi->allocations) { result = paInsufficientMemory; goto error; } /* Allocate the AsioDrivers() driver list (class from ASIO SDK) */ - try - { + try { asioHostApi->asioDrivers = new AsioDrivers(); /* calls CoInitialize(0) */ - } - catch (std::bad_alloc) - { + } catch (std::bad_alloc) { asioHostApi->asioDrivers = 0; } + /* some implementations of new (ie MSVC, see http://support.microsoft.com/?kbid=167733) don't throw std::bad_alloc, so we also explicitly test for a null return. */ - if( asioHostApi->asioDrivers == 0 ) - { + if (asioHostApi->asioDrivers == 0) { result = paInsufficientMemory; goto error; } @@ -1122,24 +1274,23 @@ PaError PaAsio_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex (*hostApi)->info.name = "ASIO"; (*hostApi)->info.deviceCount = 0; - #ifdef WINDOWS - /* use desktop window as system specific ptr */ - asioHostApi->systemSpecific = GetDesktopWindow(); - #endif +#ifdef WINDOWS + /* use desktop window as system specific ptr */ + asioHostApi->systemSpecific = GetDesktopWindow(); +#endif /* driverCount is the number of installed drivers - not necessarily the number of installed physical devices. */ - #if MAC - driverCount = asioHostApi->asioDrivers->getNumFragments(); - #elif WINDOWS - driverCount = asioHostApi->asioDrivers->asioGetNumDev(); - #endif +#if MAC + driverCount = asioHostApi->asioDrivers->getNumFragments(); +#elif WINDOWS + driverCount = asioHostApi->asioDrivers->asioGetNumDev(); +#endif - if( driverCount > 0 ) - { - names = GetAsioDriverNames( asioHostApi, asioHostApi->allocations, driverCount ); - if( !names ) - { + if (driverCount > 0) { + names = GetAsioDriverNames (asioHostApi, asioHostApi->allocations, driverCount); + + if (!names) { result = paInsufficientMemory; goto error; } @@ -1147,64 +1298,59 @@ PaError PaAsio_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex /* allocate enough space for all drivers, even if some aren't installed */ - (*hostApi)->deviceInfos = (PaDeviceInfo**)PaUtil_GroupAllocateMemory( - asioHostApi->allocations, sizeof(PaDeviceInfo*) * driverCount ); - if( !(*hostApi)->deviceInfos ) - { + (*hostApi)->deviceInfos = (PaDeviceInfo**) PaUtil_GroupAllocateMemory ( + asioHostApi->allocations, sizeof (PaDeviceInfo*) * driverCount); + + if (! (*hostApi)->deviceInfos) { result = paInsufficientMemory; goto error; } /* allocate all device info structs in a contiguous block */ - deviceInfoArray = (PaAsioDeviceInfo*)PaUtil_GroupAllocateMemory( - asioHostApi->allocations, sizeof(PaAsioDeviceInfo) * driverCount ); - if( !deviceInfoArray ) - { + deviceInfoArray = (PaAsioDeviceInfo*) PaUtil_GroupAllocateMemory ( + asioHostApi->allocations, sizeof (PaAsioDeviceInfo) * driverCount); + + if (!deviceInfoArray) { result = paInsufficientMemory; goto error; } - IsDebuggerPresent_ = GetProcAddress( LoadLibrary( "Kernel32.dll" ), "IsDebuggerPresent" ); + IsDebuggerPresent_ = GetProcAddress (LoadLibrary ("Kernel32.dll"), "IsDebuggerPresent"); - for( i=0; i < driverCount; ++i ) - { + for (i=0; i < driverCount; ++i) { - PA_DEBUG(("ASIO names[%d]:%s\n",i,names[i])); + PA_DEBUG ( ("ASIO names[%d]:%s\n",i,names[i])); // Since portaudio opens ALL ASIO drivers, and no one else does that, // we face fact that some drivers were not meant for it, drivers which act // like shells on top of REAL drivers, for instance. // so we get duplicate handles, locks and other problems. - // so lets NOT try to load any such wrappers. + // so lets NOT try to load any such wrappers. // The ones i [davidv] know of so far are: - if ( strcmp (names[i],"ASIO DirectX Full Duplex Driver") == 0 - || strcmp (names[i],"ASIO Multimedia Driver") == 0 - || strncmp(names[i],"Premiere",8) == 0 //"Premiere Elements Windows Sound 1.0" - || strncmp(names[i],"Adobe",5) == 0 //"Adobe Default Windows Sound 1.5" - || strncmp(names[i],"ReaRoute ASIO",13) == 0 //Reaper www.reaper.fm <- fix your stuff man. - ) - { - PA_DEBUG(("BLACKLISTED!!!\n")); + if (strcmp (names[i],"ASIO DirectX Full Duplex Driver") == 0 + || strcmp (names[i],"ASIO Multimedia Driver") == 0 + || strncmp (names[i],"Premiere",8) == 0 //"Premiere Elements Windows Sound 1.0" + || strncmp (names[i],"Adobe",5) == 0 //"Adobe Default Windows Sound 1.5" + || strncmp (names[i],"ReaRoute ASIO",13) == 0 //Reaper www.reaper.fm <- fix your stuff man. + ) { + PA_DEBUG ( ("BLACKLISTED!!!\n")); continue; } - if( IsDebuggerPresent_ && IsDebuggerPresent_() ) - { + if (IsDebuggerPresent_ && IsDebuggerPresent_()) { /* ASIO Digidesign Driver uses PACE copy protection which quits out if a debugger is running. So we don't load it if a debugger is running. */ - if( strcmp(names[i], "ASIO Digidesign Driver") == 0 ) - { - PA_DEBUG(("BLACKLISTED!!! ASIO Digidesign Driver would quit the debugger\n")); - continue; - } - } + if (strcmp (names[i], "ASIO Digidesign Driver") == 0) { + PA_DEBUG ( ("BLACKLISTED!!! ASIO Digidesign Driver would quit the debugger\n")); + continue; + } + } /* Attempt to load the asio driver... */ - if( LoadAsioDriver( asioHostApi, names[i], &paAsioDriverInfo, asioHostApi->systemSpecific ) == paNoError ) - { + if (LoadAsioDriver (asioHostApi, names[i], &paAsioDriverInfo, asioHostApi->systemSpecific) == paNoError) { PaAsioDeviceInfo *asioDeviceInfo = &deviceInfoArray[ (*hostApi)->info.deviceCount ]; PaDeviceInfo *deviceInfo = &asioDeviceInfo->commonDeviceInfo; @@ -1212,33 +1358,33 @@ PaError PaAsio_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex deviceInfo->hostApi = hostApiIndex; deviceInfo->name = names[i]; - PA_DEBUG(("PaAsio_Initialize: drv:%d name = %s\n", i,deviceInfo->name)); - PA_DEBUG(("PaAsio_Initialize: drv:%d inputChannels = %d\n", i, paAsioDriverInfo.inputChannelCount)); - PA_DEBUG(("PaAsio_Initialize: drv:%d outputChannels = %d\n", i, paAsioDriverInfo.outputChannelCount)); - PA_DEBUG(("PaAsio_Initialize: drv:%d bufferMinSize = %d\n", i, paAsioDriverInfo.bufferMinSize)); - PA_DEBUG(("PaAsio_Initialize: drv:%d bufferMaxSize = %d\n", i, paAsioDriverInfo.bufferMaxSize)); - PA_DEBUG(("PaAsio_Initialize: drv:%d bufferPreferredSize = %d\n", i, paAsioDriverInfo.bufferPreferredSize)); - PA_DEBUG(("PaAsio_Initialize: drv:%d bufferGranularity = %d\n", i, paAsioDriverInfo.bufferGranularity)); + PA_DEBUG ( ("PaAsio_Initialize: drv:%d name = %s\n", i,deviceInfo->name)); + PA_DEBUG ( ("PaAsio_Initialize: drv:%d inputChannels = %d\n", i, paAsioDriverInfo.inputChannelCount)); + PA_DEBUG ( ("PaAsio_Initialize: drv:%d outputChannels = %d\n", i, paAsioDriverInfo.outputChannelCount)); + PA_DEBUG ( ("PaAsio_Initialize: drv:%d bufferMinSize = %d\n", i, paAsioDriverInfo.bufferMinSize)); + PA_DEBUG ( ("PaAsio_Initialize: drv:%d bufferMaxSize = %d\n", i, paAsioDriverInfo.bufferMaxSize)); + PA_DEBUG ( ("PaAsio_Initialize: drv:%d bufferPreferredSize = %d\n", i, paAsioDriverInfo.bufferPreferredSize)); + PA_DEBUG ( ("PaAsio_Initialize: drv:%d bufferGranularity = %d\n", i, paAsioDriverInfo.bufferGranularity)); deviceInfo->maxInputChannels = paAsioDriverInfo.inputChannelCount; deviceInfo->maxOutputChannels = paAsioDriverInfo.outputChannelCount; deviceInfo->defaultSampleRate = 0.; bool foundDefaultSampleRate = false; - for( int j=0; j < PA_DEFAULTSAMPLERATESEARCHORDER_COUNT_; ++j ) - { - ASIOError asioError = ASIOCanSampleRate( defaultSampleRateSearchOrder_[j] ); - if( asioError != ASE_NoClock && asioError != ASE_NotPresent ) - { + + for (int j=0; j < PA_DEFAULTSAMPLERATESEARCHORDER_COUNT_; ++j) { + ASIOError asioError = ASIOCanSampleRate (defaultSampleRateSearchOrder_[j]); + + if (asioError != ASE_NoClock && asioError != ASE_NotPresent) { deviceInfo->defaultSampleRate = defaultSampleRateSearchOrder_[j]; foundDefaultSampleRate = true; break; } } - PA_DEBUG(("PaAsio_Initialize: drv:%d defaultSampleRate = %f\n", i, deviceInfo->defaultSampleRate)); + PA_DEBUG ( ("PaAsio_Initialize: drv:%d defaultSampleRate = %f\n", i, deviceInfo->defaultSampleRate)); - if( foundDefaultSampleRate ){ + if (foundDefaultSampleRate) { /* calculate default latency values from bufferPreferredSize for default low latency, and bufferPreferredSize * 3 @@ -1249,27 +1395,28 @@ PaError PaAsio_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex */ double defaultLowLatency = - paAsioDriverInfo.bufferPreferredSize / deviceInfo->defaultSampleRate; + paAsioDriverInfo.bufferPreferredSize / deviceInfo->defaultSampleRate; deviceInfo->defaultLowInputLatency = defaultLowLatency; deviceInfo->defaultLowOutputLatency = defaultLowLatency; long defaultHighLatencyBufferSize = - paAsioDriverInfo.bufferPreferredSize * 3; + paAsioDriverInfo.bufferPreferredSize * 3; - if( defaultHighLatencyBufferSize > paAsioDriverInfo.bufferMaxSize ) + if (defaultHighLatencyBufferSize > paAsioDriverInfo.bufferMaxSize) defaultHighLatencyBufferSize = paAsioDriverInfo.bufferMaxSize; double defaultHighLatency = - defaultHighLatencyBufferSize / deviceInfo->defaultSampleRate; + defaultHighLatencyBufferSize / deviceInfo->defaultSampleRate; + + if (defaultHighLatency < defaultLowLatency) + defaultHighLatency = defaultLowLatency; /* just incase the driver returns something strange */ - if( defaultHighLatency < defaultLowLatency ) - defaultHighLatency = defaultLowLatency; /* just incase the driver returns something strange */ - deviceInfo->defaultHighInputLatency = defaultHighLatency; + deviceInfo->defaultHighOutputLatency = defaultHighLatency; - - }else{ + + } else { deviceInfo->defaultLowInputLatency = 0.; deviceInfo->defaultLowOutputLatency = 0.; @@ -1277,10 +1424,11 @@ PaError PaAsio_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex deviceInfo->defaultHighOutputLatency = 0.; } - PA_DEBUG(("PaAsio_Initialize: drv:%d defaultLowInputLatency = %f\n", i, deviceInfo->defaultLowInputLatency)); - PA_DEBUG(("PaAsio_Initialize: drv:%d defaultLowOutputLatency = %f\n", i, deviceInfo->defaultLowOutputLatency)); - PA_DEBUG(("PaAsio_Initialize: drv:%d defaultHighInputLatency = %f\n", i, deviceInfo->defaultHighInputLatency)); - PA_DEBUG(("PaAsio_Initialize: drv:%d defaultHighOutputLatency = %f\n", i, deviceInfo->defaultHighOutputLatency)); + PA_DEBUG ( ("PaAsio_Initialize: drv:%d defaultLowInputLatency = %f\n", i, deviceInfo->defaultLowInputLatency)); + + PA_DEBUG ( ("PaAsio_Initialize: drv:%d defaultLowOutputLatency = %f\n", i, deviceInfo->defaultLowOutputLatency)); + PA_DEBUG ( ("PaAsio_Initialize: drv:%d defaultHighInputLatency = %f\n", i, deviceInfo->defaultHighInputLatency)); + PA_DEBUG ( ("PaAsio_Initialize: drv:%d defaultHighOutputLatency = %f\n", i, deviceInfo->defaultHighOutputLatency)); asioDeviceInfo->minBufferSize = paAsioDriverInfo.bufferMinSize; asioDeviceInfo->maxBufferSize = paAsioDriverInfo.bufferMaxSize; @@ -1288,39 +1436,39 @@ PaError PaAsio_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex asioDeviceInfo->bufferGranularity = paAsioDriverInfo.bufferGranularity; - asioDeviceInfo->asioChannelInfos = (ASIOChannelInfo*)PaUtil_GroupAllocateMemory( - asioHostApi->allocations, - sizeof(ASIOChannelInfo) * (deviceInfo->maxInputChannels - + deviceInfo->maxOutputChannels) ); - if( !asioDeviceInfo->asioChannelInfos ) - { + asioDeviceInfo->asioChannelInfos = (ASIOChannelInfo*) PaUtil_GroupAllocateMemory ( + asioHostApi->allocations, + sizeof (ASIOChannelInfo) * (deviceInfo->maxInputChannels + + deviceInfo->maxOutputChannels)); + + if (!asioDeviceInfo->asioChannelInfos) { result = paInsufficientMemory; goto error_unload; } int a; - for( a=0; a < deviceInfo->maxInputChannels; ++a ){ + for (a=0; a < deviceInfo->maxInputChannels; ++a) { asioDeviceInfo->asioChannelInfos[a].channel = a; asioDeviceInfo->asioChannelInfos[a].isInput = ASIOTrue; - ASIOError asioError = ASIOGetChannelInfo( &asioDeviceInfo->asioChannelInfos[a] ); - if( asioError != ASE_OK ) - { + ASIOError asioError = ASIOGetChannelInfo (&asioDeviceInfo->asioChannelInfos[a]); + + if (asioError != ASE_OK) { result = paUnanticipatedHostError; - PA_ASIO_SET_LAST_ASIO_ERROR( asioError ); + PA_ASIO_SET_LAST_ASIO_ERROR (asioError); goto error_unload; } } - for( a=0; a < deviceInfo->maxOutputChannels; ++a ){ + for (a=0; a < deviceInfo->maxOutputChannels; ++a) { int b = deviceInfo->maxInputChannels + a; asioDeviceInfo->asioChannelInfos[b].channel = a; asioDeviceInfo->asioChannelInfos[b].isInput = ASIOFalse; - ASIOError asioError = ASIOGetChannelInfo( &asioDeviceInfo->asioChannelInfos[b] ); - if( asioError != ASE_OK ) - { + ASIOError asioError = ASIOGetChannelInfo (&asioDeviceInfo->asioChannelInfos[b]); + + if (asioError != ASE_OK) { result = paUnanticipatedHostError; - PA_ASIO_SET_LAST_ASIO_ERROR( asioError ); + PA_ASIO_SET_LAST_ASIO_ERROR (asioError); goto error_unload; } } @@ -1330,18 +1478,16 @@ PaError PaAsio_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex UnloadAsioDriver(); (*hostApi)->deviceInfos[ (*hostApi)->info.deviceCount ] = deviceInfo; - ++(*hostApi)->info.deviceCount; + + ++ (*hostApi)->info.deviceCount; } } } - if( (*hostApi)->info.deviceCount > 0 ) - { + if ( (*hostApi)->info.deviceCount > 0) { (*hostApi)->info.defaultInputDevice = 0; (*hostApi)->info.defaultOutputDevice = 0; - } - else - { + } else { (*hostApi)->info.defaultInputDevice = paNoDevice; (*hostApi)->info.defaultOutputDevice = paNoDevice; } @@ -1351,97 +1497,97 @@ PaError PaAsio_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex (*hostApi)->OpenStream = OpenStream; (*hostApi)->IsFormatSupported = IsFormatSupported; - PaUtil_InitializeStreamInterface( &asioHostApi->callbackStreamInterface, CloseStream, StartStream, + PaUtil_InitializeStreamInterface (&asioHostApi->callbackStreamInterface, CloseStream, StartStream, StopStream, AbortStream, IsStreamStopped, IsStreamActive, GetStreamTime, GetStreamCpuLoad, PaUtil_DummyRead, PaUtil_DummyWrite, - PaUtil_DummyGetReadAvailable, PaUtil_DummyGetWriteAvailable ); + PaUtil_DummyGetReadAvailable, PaUtil_DummyGetWriteAvailable); - PaUtil_InitializeStreamInterface( &asioHostApi->blockingStreamInterface, CloseStream, StartStream, + PaUtil_InitializeStreamInterface (&asioHostApi->blockingStreamInterface, CloseStream, StartStream, StopStream, AbortStream, IsStreamStopped, IsStreamActive, GetStreamTime, PaUtil_DummyGetCpuLoad, - ReadStream, WriteStream, GetStreamReadAvailable, GetStreamWriteAvailable ); + ReadStream, WriteStream, GetStreamReadAvailable, GetStreamWriteAvailable); return result; error_unload: - UnloadAsioDriver(); + UnloadAsioDriver(); error: - if( asioHostApi ) - { - if( asioHostApi->allocations ) - { - PaUtil_FreeAllAllocations( asioHostApi->allocations ); - PaUtil_DestroyAllocationGroup( asioHostApi->allocations ); + + if (asioHostApi) { + if (asioHostApi->allocations) { + PaUtil_FreeAllAllocations (asioHostApi->allocations); + PaUtil_DestroyAllocationGroup (asioHostApi->allocations); } delete asioHostApi->asioDrivers; + asioDrivers = 0; /* keep SDK global in sync until we stop depending on it */ - PaUtil_FreeMemory( asioHostApi ); + PaUtil_FreeMemory (asioHostApi); } + return result; } -static void Terminate( struct PaUtilHostApiRepresentation *hostApi ) +static void Terminate (struct PaUtilHostApiRepresentation *hostApi) { - PaAsioHostApiRepresentation *asioHostApi = (PaAsioHostApiRepresentation*)hostApi; + PaAsioHostApiRepresentation *asioHostApi = (PaAsioHostApiRepresentation*) hostApi; /* IMPLEMENT ME: - clean up any resources not handled by the allocation group (need to review if there are any) */ - if( asioHostApi->allocations ) - { - PaUtil_FreeAllAllocations( asioHostApi->allocations ); - PaUtil_DestroyAllocationGroup( asioHostApi->allocations ); + if (asioHostApi->allocations) { + PaUtil_FreeAllAllocations (asioHostApi->allocations); + PaUtil_DestroyAllocationGroup (asioHostApi->allocations); } delete asioHostApi->asioDrivers; /* calls CoUninitialize() */ + asioDrivers = 0; /* keep SDK global in sync until we stop depending on it */ - PaUtil_FreeMemory( asioHostApi ); + PaUtil_FreeMemory (asioHostApi); } -static PaError IsFormatSupported( struct PaUtilHostApiRepresentation *hostApi, +static PaError IsFormatSupported (struct PaUtilHostApiRepresentation *hostApi, const PaStreamParameters *inputParameters, const PaStreamParameters *outputParameters, - double sampleRate ) + double sampleRate) { PaError result = paNoError; - PaAsioHostApiRepresentation *asioHostApi = (PaAsioHostApiRepresentation*)hostApi; + PaAsioHostApiRepresentation *asioHostApi = (PaAsioHostApiRepresentation*) hostApi; PaAsioDriverInfo *driverInfo = &asioHostApi->openAsioDriverInfo; int inputChannelCount, outputChannelCount; PaSampleFormat inputSampleFormat, outputSampleFormat; - PaDeviceIndex asioDeviceIndex; + PaDeviceIndex asioDeviceIndex; ASIOError asioError; - - if( inputParameters && outputParameters ) - { + + if (inputParameters && outputParameters) { /* full duplex ASIO stream must use the same device for input and output */ - if( inputParameters->device != outputParameters->device ) + if (inputParameters->device != outputParameters->device) return paBadIODeviceCombination; } - - if( inputParameters ) - { + + if (inputParameters) { inputChannelCount = inputParameters->channelCount; inputSampleFormat = inputParameters->sampleFormat; /* all standard sample formats are supported by the buffer adapter, this implementation doesn't support any custom sample formats */ - if( inputSampleFormat & paCustomFormat ) + + if (inputSampleFormat & paCustomFormat) return paSampleFormatNotSupported; - + /* unless alternate device specification is supported, reject the use of paUseHostApiSpecificDeviceSpecification */ - if( inputParameters->device == paUseHostApiSpecificDeviceSpecification ) + if (inputParameters->device == paUseHostApiSpecificDeviceSpecification) return paInvalidDevice; asioDeviceIndex = inputParameters->device; @@ -1450,26 +1596,24 @@ static PaError IsFormatSupported( struct PaUtilHostApiRepresentation *hostApi, /** @todo do more validation here */ // if( inputParameters->hostApiSpecificStreamInfo ) // return paIncompatibleHostApiSpecificStreamInfo; /* this implementation doesn't use custom stream info */ - } - else - { + } else { inputChannelCount = 0; } - if( outputParameters ) - { + if (outputParameters) { outputChannelCount = outputParameters->channelCount; outputSampleFormat = outputParameters->sampleFormat; /* all standard sample formats are supported by the buffer adapter, this implementation doesn't support any custom sample formats */ - if( outputSampleFormat & paCustomFormat ) + + if (outputSampleFormat & paCustomFormat) return paSampleFormatNotSupported; - + /* unless alternate device specification is supported, reject the use of paUseHostApiSpecificDeviceSpecification */ - if( outputParameters->device == paUseHostApiSpecificDeviceSpecification ) + if (outputParameters->device == paUseHostApiSpecificDeviceSpecification) return paInvalidDevice; asioDeviceIndex = outputParameters->device; @@ -1478,9 +1622,7 @@ static PaError IsFormatSupported( struct PaUtilHostApiRepresentation *hostApi, /** @todo do more validation here */ // if( outputParameters->hostApiSpecificStreamInfo ) // return paIncompatibleHostApiSpecificStreamInfo; /* this implementation doesn't use custom stream info */ - } - else - { + } else { outputChannelCount = 0; } @@ -1488,9 +1630,8 @@ static PaError IsFormatSupported( struct PaUtilHostApiRepresentation *hostApi, /* if an ASIO device is open we can only get format information for the currently open device */ - if( asioHostApi->openAsioDeviceIndex != paNoDevice - && asioHostApi->openAsioDeviceIndex != asioDeviceIndex ) - { + if (asioHostApi->openAsioDeviceIndex != paNoDevice + && asioHostApi->openAsioDeviceIndex != asioDeviceIndex) { return paDeviceUnavailable; } @@ -1499,50 +1640,47 @@ static PaError IsFormatSupported( struct PaUtilHostApiRepresentation *hostApi, rather than the ones in our device info structure which may be stale */ /* open the device if it's not already open */ - if( asioHostApi->openAsioDeviceIndex == paNoDevice ) - { - result = LoadAsioDriver( asioHostApi, asioHostApi->inheritedHostApiRep.deviceInfos[ asioDeviceIndex ]->name, - driverInfo, asioHostApi->systemSpecific ); - if( result != paNoError ) + if (asioHostApi->openAsioDeviceIndex == paNoDevice) { + result = LoadAsioDriver (asioHostApi, asioHostApi->inheritedHostApiRep.deviceInfos[ asioDeviceIndex ]->name, + driverInfo, asioHostApi->systemSpecific); + + if (result != paNoError) return result; } /* check that input device can support inputChannelCount */ - if( inputChannelCount > 0 ) - { - if( inputChannelCount > driverInfo->inputChannelCount ) - { + if (inputChannelCount > 0) { + if (inputChannelCount > driverInfo->inputChannelCount) { result = paInvalidChannelCount; goto done; } } /* check that output device can support outputChannelCount */ - if( outputChannelCount ) - { - if( outputChannelCount > driverInfo->outputChannelCount ) - { + if (outputChannelCount) { + if (outputChannelCount > driverInfo->outputChannelCount) { result = paInvalidChannelCount; goto done; } } - + /* query for sample rate support */ - asioError = ASIOCanSampleRate( sampleRate ); - if( asioError == ASE_NoClock || asioError == ASE_NotPresent ) - { + asioError = ASIOCanSampleRate (sampleRate); + + if (asioError == ASE_NoClock || asioError == ASE_NotPresent) { result = paInvalidSampleRate; goto done; } done: + /* close the device if it wasn't already open */ - if( asioHostApi->openAsioDeviceIndex == paNoDevice ) - { + + if (asioHostApi->openAsioDeviceIndex == paNoDevice) { UnloadAsioDriver(); /* not sure if we should check for errors here */ } - if( result == paNoError ) + if (result == paNoError) return paFormatIsSupported; else return result; @@ -1551,8 +1689,8 @@ done: /** A data structure specifically for storing blocking i/o related data. */ -typedef struct PaAsioStreamBlockingState -{ + +typedef struct PaAsioStreamBlockingState { int stopFlag; /**< Flag indicating that block processing is to be stopped. */ unsigned long writeBuffersRequested; /**< The number of available output buffers, requested by the #WriteStream() function. */ @@ -1580,14 +1718,14 @@ typedef struct PaAsioStreamBlockingState int outputUnderflowFlag; /**< Flag to signal an output underflow from within the callback function. */ int inputOverflowFlag; /**< Flag to signal an input overflow from within the callback function. */ } + PaAsioStreamBlockingState; /* PaAsioStream - a stream data structure specifically for this implementation */ -typedef struct PaAsioStream -{ +typedef struct PaAsioStream { PaUtilStreamRepresentation streamRepresentation; PaUtilCpuLoadMeasurer cpuLoadMeasurer; PaUtilBufferProcessor bufferProcessor; @@ -1630,86 +1768,71 @@ typedef struct PaAsioStream PaAsioStreamBlockingState *blockingState; /**< Blocking i/o data struct, or NULL when using callback interface. */ } + PaAsioStream; static PaAsioStream *theAsioStream = 0; /* due to ASIO sdk limitations there can be only one stream */ -static void ZeroOutputBuffers( PaAsioStream *stream, long index ) +static void ZeroOutputBuffers (PaAsioStream *stream, long index) { int i; - for( i=0; i < stream->outputChannelCount; ++i ) - { + for (i=0; i < stream->outputChannelCount; ++i) { void *buffer = stream->asioBufferInfos[ i + stream->inputChannelCount ].buffers[index]; - int bytesPerSample = BytesPerAsioSample( stream->asioChannelInfos[ i + stream->inputChannelCount ].type ); + int bytesPerSample = BytesPerAsioSample (stream->asioChannelInfos[ i + stream->inputChannelCount ].type); - memset( buffer, 0, stream->framesPerHostCallback * bytesPerSample ); + memset (buffer, 0, stream->framesPerHostCallback * bytesPerSample); } } -static unsigned long SelectHostBufferSize( unsigned long suggestedLatencyFrames, - PaAsioDriverInfo *driverInfo ) +static unsigned long SelectHostBufferSize (unsigned long suggestedLatencyFrames, + PaAsioDriverInfo *driverInfo) { unsigned long result; - if( suggestedLatencyFrames == 0 ) - { + if (suggestedLatencyFrames == 0) { result = driverInfo->bufferPreferredSize; - } - else{ - if( suggestedLatencyFrames <= (unsigned long)driverInfo->bufferMinSize ) - { + } else { + if (suggestedLatencyFrames <= (unsigned long) driverInfo->bufferMinSize) { result = driverInfo->bufferMinSize; - } - else if( suggestedLatencyFrames >= (unsigned long)driverInfo->bufferMaxSize ) - { + } else if (suggestedLatencyFrames >= (unsigned long) driverInfo->bufferMaxSize) { result = driverInfo->bufferMaxSize; - } - else - { - if( driverInfo->bufferGranularity == -1 ) - { + } else { + if (driverInfo->bufferGranularity == -1) { /* power-of-two */ result = 2; - while( result < suggestedLatencyFrames ) + while (result < suggestedLatencyFrames) result *= 2; - if( result < (unsigned long)driverInfo->bufferMinSize ) + if (result < (unsigned long) driverInfo->bufferMinSize) result = driverInfo->bufferMinSize; - if( result > (unsigned long)driverInfo->bufferMaxSize ) + if (result > (unsigned long) driverInfo->bufferMaxSize) result = driverInfo->bufferMaxSize; - } - else if( driverInfo->bufferGranularity == 0 ) - { + } else if (driverInfo->bufferGranularity == 0) { /* the documentation states that bufferGranularity should be zero when bufferMinSize, bufferMaxSize and bufferPreferredSize are the same. We assume that is the case. */ result = driverInfo->bufferPreferredSize; - } - else - { + } else { /* modulo granularity */ unsigned long remainder = - suggestedLatencyFrames % driverInfo->bufferGranularity; + suggestedLatencyFrames % driverInfo->bufferGranularity; - if( remainder == 0 ) - { + if (remainder == 0) { result = suggestedLatencyFrames; - } - else - { + } else { result = suggestedLatencyFrames - + (driverInfo->bufferGranularity - remainder); + + (driverInfo->bufferGranularity - remainder); - if( result > (unsigned long)driverInfo->bufferMaxSize ) + if (result > (unsigned long) driverInfo->bufferMaxSize) result = driverInfo->bufferMaxSize; } } @@ -1722,31 +1845,29 @@ static unsigned long SelectHostBufferSize( unsigned long suggestedLatencyFrames, /* returns channelSelectors if present */ -static PaError ValidateAsioSpecificStreamInfo( - const PaStreamParameters *streamParameters, - const PaAsioStreamInfo *streamInfo, - int deviceChannelCount, - int **channelSelectors ) +static PaError ValidateAsioSpecificStreamInfo ( + const PaStreamParameters *streamParameters, + const PaAsioStreamInfo *streamInfo, + int deviceChannelCount, + int **channelSelectors) { - if( streamInfo ) - { - if( streamInfo->size != sizeof( PaAsioStreamInfo ) - || streamInfo->version != 1 ) - { + if (streamInfo) { + if (streamInfo->size != sizeof (PaAsioStreamInfo) + || streamInfo->version != 1) { return paIncompatibleHostApiSpecificStreamInfo; } - if( streamInfo->flags & paAsioUseChannelSelectors ) + if (streamInfo->flags & paAsioUseChannelSelectors) *channelSelectors = streamInfo->channelSelectors; - if( !(*channelSelectors) ) + if (! (*channelSelectors)) return paIncompatibleHostApiSpecificStreamInfo; - for( int i=0; i < streamParameters->channelCount; ++i ){ - if( (*channelSelectors)[i] < 0 - || (*channelSelectors)[i] >= deviceChannelCount ){ + for (int i=0; i < streamParameters->channelCount; ++i) { + if ( (*channelSelectors) [i] < 0 + || (*channelSelectors) [i] >= deviceChannelCount) { return paInvalidChannelCount; - } + } } } @@ -1756,7 +1877,7 @@ static PaError ValidateAsioSpecificStreamInfo( /* see pa_hostapi.h for a list of validity guarantees made about OpenStream parameters */ -static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi, +static PaError OpenStream (struct PaUtilHostApiRepresentation *hostApi, PaStream** s, const PaStreamParameters *inputParameters, const PaStreamParameters *outputParameters, @@ -1764,10 +1885,10 @@ static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi, unsigned long framesPerBuffer, PaStreamFlags streamFlags, PaStreamCallback *streamCallback, - void *userData ) + void *userData) { PaError result = paNoError; - PaAsioHostApiRepresentation *asioHostApi = (PaAsioHostApiRepresentation*)hostApi; + PaAsioHostApiRepresentation *asioHostApi = (PaAsioHostApiRepresentation*) hostApi; PaAsioStream *stream = 0; PaAsioStreamInfo *inputStreamInfo, *outputStreamInfo; unsigned long framesPerHostBuffer; @@ -1788,7 +1909,7 @@ static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi, bool isExternal = false; /* Are we using blocking i/o interface? */ - int usingBlockingIo = ( !streamCallback ) ? TRUE : FALSE; + int usingBlockingIo = (!streamCallback) ? TRUE : FALSE; /* Blocking i/o stuff */ long lBlockingBufferSize = 0; /* Desired ring buffer size in samples. */ long lBlockingBufferSizePow2 = 0; /* Power-of-2 rounded ring buffer size. */ @@ -1801,78 +1922,76 @@ static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi, /* unless we move to using lower level ASIO calls, we can only have one device open at a time */ - if( asioHostApi->openAsioDeviceIndex != paNoDevice ) - { - PA_DEBUG(("OpenStream paDeviceUnavailable\n")); + + if (asioHostApi->openAsioDeviceIndex != paNoDevice) { + PA_DEBUG ( ("OpenStream paDeviceUnavailable\n")); return paDeviceUnavailable; } - if( inputParameters && outputParameters ) - { + if (inputParameters && outputParameters) { /* full duplex ASIO stream must use the same device for input and output */ - if( inputParameters->device != outputParameters->device ) - { - PA_DEBUG(("OpenStream paBadIODeviceCombination\n")); + if (inputParameters->device != outputParameters->device) { + PA_DEBUG ( ("OpenStream paBadIODeviceCombination\n")); return paBadIODeviceCombination; } } - if( inputParameters ) - { + if (inputParameters) { inputChannelCount = inputParameters->channelCount; inputSampleFormat = inputParameters->sampleFormat; - suggestedInputLatencyFrames = (unsigned long)((inputParameters->suggestedLatency * sampleRate)+0.5f); + suggestedInputLatencyFrames = (unsigned long) ( (inputParameters->suggestedLatency * sampleRate) +0.5f); /* unless alternate device specification is supported, reject the use of paUseHostApiSpecificDeviceSpecification */ - if( inputParameters->device == paUseHostApiSpecificDeviceSpecification ) + + if (inputParameters->device == paUseHostApiSpecificDeviceSpecification) return paInvalidDevice; asioDeviceIndex = inputParameters->device; - PaAsioDeviceInfo *asioDeviceInfo = (PaAsioDeviceInfo*)hostApi->deviceInfos[asioDeviceIndex]; + PaAsioDeviceInfo *asioDeviceInfo = (PaAsioDeviceInfo*) hostApi->deviceInfos[asioDeviceIndex]; /* validate hostApiSpecificStreamInfo */ - inputStreamInfo = (PaAsioStreamInfo*)inputParameters->hostApiSpecificStreamInfo; - result = ValidateAsioSpecificStreamInfo( inputParameters, inputStreamInfo, - asioDeviceInfo->commonDeviceInfo.maxInputChannels, - &inputChannelSelectors - ); - if( result != paNoError ) return result; - } - else - { + inputStreamInfo = (PaAsioStreamInfo*) inputParameters->hostApiSpecificStreamInfo; + + result = ValidateAsioSpecificStreamInfo (inputParameters, inputStreamInfo, + asioDeviceInfo->commonDeviceInfo.maxInputChannels, + &inputChannelSelectors + ); + + if (result != paNoError) return result; + } else { inputChannelCount = 0; inputSampleFormat = 0; suggestedInputLatencyFrames = 0; } - if( outputParameters ) - { + if (outputParameters) { outputChannelCount = outputParameters->channelCount; outputSampleFormat = outputParameters->sampleFormat; - suggestedOutputLatencyFrames = (unsigned long)((outputParameters->suggestedLatency * sampleRate)+0.5f); + suggestedOutputLatencyFrames = (unsigned long) ( (outputParameters->suggestedLatency * sampleRate) +0.5f); /* unless alternate device specification is supported, reject the use of paUseHostApiSpecificDeviceSpecification */ - if( outputParameters->device == paUseHostApiSpecificDeviceSpecification ) + + if (outputParameters->device == paUseHostApiSpecificDeviceSpecification) return paInvalidDevice; asioDeviceIndex = outputParameters->device; - PaAsioDeviceInfo *asioDeviceInfo = (PaAsioDeviceInfo*)hostApi->deviceInfos[asioDeviceIndex]; + PaAsioDeviceInfo *asioDeviceInfo = (PaAsioDeviceInfo*) hostApi->deviceInfos[asioDeviceIndex]; /* validate hostApiSpecificStreamInfo */ - outputStreamInfo = (PaAsioStreamInfo*)outputParameters->hostApiSpecificStreamInfo; - result = ValidateAsioSpecificStreamInfo( outputParameters, outputStreamInfo, - asioDeviceInfo->commonDeviceInfo.maxOutputChannels, - &outputChannelSelectors - ); - if( result != paNoError ) return result; - } - else - { + outputStreamInfo = (PaAsioStreamInfo*) outputParameters->hostApiSpecificStreamInfo; + + result = ValidateAsioSpecificStreamInfo (outputParameters, outputStreamInfo, + asioDeviceInfo->commonDeviceInfo.maxOutputChannels, + &outputChannelSelectors + ); + + if (result != paNoError) return result; + } else { outputChannelCount = 0; outputSampleFormat = 0; suggestedOutputLatencyFrames = 0; @@ -1883,33 +2002,30 @@ static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi, /* NOTE: we load the driver and use its current settings rather than the ones in our device info structure which may be stale */ - result = LoadAsioDriver( asioHostApi, asioHostApi->inheritedHostApiRep.deviceInfos[ asioDeviceIndex ]->name, - driverInfo, asioHostApi->systemSpecific ); - if( result == paNoError ) + result = LoadAsioDriver (asioHostApi, asioHostApi->inheritedHostApiRep.deviceInfos[ asioDeviceIndex ]->name, + driverInfo, asioHostApi->systemSpecific); + + if (result == paNoError) asioIsInitialized = 1; - else{ - PA_DEBUG(("OpenStream ERROR1 - LoadAsioDriver returned %d\n", result)); + else { + PA_DEBUG ( ("OpenStream ERROR1 - LoadAsioDriver returned %d\n", result)); goto error; } /* check that input device can support inputChannelCount */ - if( inputChannelCount > 0 ) - { - if( inputChannelCount > driverInfo->inputChannelCount ) - { + if (inputChannelCount > 0) { + if (inputChannelCount > driverInfo->inputChannelCount) { result = paInvalidChannelCount; - PA_DEBUG(("OpenStream ERROR2\n")); + PA_DEBUG ( ("OpenStream ERROR2\n")); goto error; } } /* check that output device can support outputChannelCount */ - if( outputChannelCount ) - { - if( outputChannelCount > driverInfo->outputChannelCount ) - { + if (outputChannelCount) { + if (outputChannelCount > driverInfo->outputChannelCount) { result = paInvalidChannelCount; - PA_DEBUG(("OpenStream ERROR3\n")); + PA_DEBUG ( ("OpenStream ERROR3\n")); goto error; } } @@ -1921,16 +2037,18 @@ static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi, { ASIOClockSource clocks[32]; long numSources=32; - asioError = ASIOGetClockSources(clocks, &numSources); - if( asioError != ASE_OK ){ - PA_DEBUG(("ERROR: ASIOGetClockSources: %s\n", PaAsio_GetAsioErrorText(asioError) )); - }else{ - PA_DEBUG(("INFO ASIOGetClockSources listing %d clocks\n", numSources )); - for (int i=0;i<numSources;++i){ - PA_DEBUG(("ASIOClockSource%d %s current:%d\n", i,clocks[i].name, clocks[i].isCurrentSource )); - + asioError = ASIOGetClockSources (clocks, &numSources); + + if (asioError != ASE_OK) { + PA_DEBUG ( ("ERROR: ASIOGetClockSources: %s\n", PaAsio_GetAsioErrorText (asioError))); + } else { + PA_DEBUG ( ("INFO ASIOGetClockSources listing %d clocks\n", numSources)); + + for (int i=0;i<numSources;++i) { + PA_DEBUG ( ("ASIOClockSource%d %s current:%d\n", i,clocks[i].name, clocks[i].isCurrentSource)); + /* - If you have problems with some drivers when externally clocked, + If you have problems with some drivers when externally clocked, uncomment the next two lines */ //if (clocks[i].isCurrentSource) @@ -1939,15 +2057,15 @@ static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi, } } - // check that the device supports the requested sample rate + // check that the device supports the requested sample rate - asioError = ASIOCanSampleRate( sampleRate ); - PA_DEBUG(("ASIOCanSampleRate(%f):%d\n",sampleRate, asioError )); + asioError = ASIOCanSampleRate (sampleRate); - if( asioError != ASE_OK ) - { + PA_DEBUG ( ("ASIOCanSampleRate(%f):%d\n",sampleRate, asioError)); + + if (asioError != ASE_OK) { result = paInvalidSampleRate; - PA_DEBUG(("ERROR: ASIOCanSampleRate: %s\n", PaAsio_GetAsioErrorText(asioError) )); + PA_DEBUG ( ("ERROR: ASIOCanSampleRate: %s\n", PaAsio_GetAsioErrorText (asioError))); goto error; } @@ -1956,32 +2074,33 @@ static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi, // sample rate if the device is not already in that rate. ASIOSampleRate oldRate; - asioError = ASIOGetSampleRate(&oldRate); - if( asioError != ASE_OK ) - { + + asioError = ASIOGetSampleRate (&oldRate); + + if (asioError != ASE_OK) { result = paInvalidSampleRate; - PA_DEBUG(("ERROR: ASIOGetSampleRate: %s\n", PaAsio_GetAsioErrorText(asioError) )); + PA_DEBUG ( ("ERROR: ASIOGetSampleRate: %s\n", PaAsio_GetAsioErrorText (asioError))); goto error; } - PA_DEBUG(("ASIOGetSampleRate:%f\n",oldRate)); - if (oldRate != sampleRate){ + PA_DEBUG ( ("ASIOGetSampleRate:%f\n",oldRate)); - PA_DEBUG(("before ASIOSetSampleRate(%f)\n",sampleRate)); + if (oldRate != sampleRate) { - asioError = ASIOSetSampleRate( isExternal?0:sampleRate ); + PA_DEBUG ( ("before ASIOSetSampleRate(%f)\n",sampleRate)); + + asioError = ASIOSetSampleRate (isExternal?0:sampleRate); /* Set sample rate */ - if( asioError != ASE_OK ) - { + + if (asioError != ASE_OK) { result = paInvalidSampleRate; - PA_DEBUG(("ERROR: ASIOSetSampleRate: %s\n", PaAsio_GetAsioErrorText(asioError) )); + PA_DEBUG ( ("ERROR: ASIOSetSampleRate: %s\n", PaAsio_GetAsioErrorText (asioError))); goto error; } - PA_DEBUG(("after ASIOSetSampleRate(%f)\n",sampleRate)); - } - else - { - PA_DEBUG(("No Need to change SR\n")); + + PA_DEBUG ( ("after ASIOSetSampleRate(%f)\n",sampleRate)); + } else { + PA_DEBUG ( ("No Need to change SR\n")); } @@ -1992,30 +2111,32 @@ static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi, */ /* validate platform specific flags */ - if( (streamFlags & paPlatformSpecificFlags) != 0 ){ - PA_DEBUG(("OpenStream invalid flags!!\n")); + if ( (streamFlags & paPlatformSpecificFlags) != 0) { + PA_DEBUG ( ("OpenStream invalid flags!!\n")); return paInvalidFlag; /* unexpected platform specific flag */ } - stream = (PaAsioStream*)PaUtil_AllocateMemory( sizeof(PaAsioStream) ); - if( !stream ) - { + stream = (PaAsioStream*) PaUtil_AllocateMemory (sizeof (PaAsioStream)); + + if (!stream) { result = paInsufficientMemory; - PA_DEBUG(("OpenStream ERROR5\n")); + PA_DEBUG ( ("OpenStream ERROR5\n")); goto error; } + stream->blockingState = NULL; /* Blocking i/o not initialized, yet. */ - stream->completedBuffersPlayedEvent = CreateEvent( NULL, TRUE, FALSE, NULL ); - if( stream->completedBuffersPlayedEvent == NULL ) - { + stream->completedBuffersPlayedEvent = CreateEvent (NULL, TRUE, FALSE, NULL); + + if (stream->completedBuffersPlayedEvent == NULL) { result = paUnanticipatedHostError; - PA_ASIO_SET_LAST_SYSTEM_ERROR( GetLastError() ); - PA_DEBUG(("OpenStream ERROR6\n")); + PA_ASIO_SET_LAST_SYSTEM_ERROR (GetLastError()); + PA_DEBUG ( ("OpenStream ERROR6\n")); goto error; } + completedBuffersPlayedEventInited = 1; @@ -2024,95 +2145,88 @@ static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi, stream->bufferPtrs = 0; /* for deallocation in error */ /* Using blocking i/o interface... */ - if( usingBlockingIo ) - { + + if (usingBlockingIo) { /* Blocking i/o is implemented by running callback mode, using a special blocking i/o callback. */ streamCallback = BlockingIoPaCallback; /* Setup PA to use the ASIO blocking i/o callback. */ userData = &theAsioStream; /* The callback user data will be the PA ASIO stream. */ - PaUtil_InitializeStreamRepresentation( &stream->streamRepresentation, - &asioHostApi->blockingStreamInterface, streamCallback, userData ); - } - else /* Using callback interface... */ - { - PaUtil_InitializeStreamRepresentation( &stream->streamRepresentation, - &asioHostApi->callbackStreamInterface, streamCallback, userData ); + PaUtil_InitializeStreamRepresentation (&stream->streamRepresentation, + &asioHostApi->blockingStreamInterface, streamCallback, userData); + } else { /* Using callback interface... */ + PaUtil_InitializeStreamRepresentation (&stream->streamRepresentation, + &asioHostApi->callbackStreamInterface, streamCallback, userData); } - PaUtil_InitializeCpuLoadMeasurer( &stream->cpuLoadMeasurer, sampleRate ); + PaUtil_InitializeCpuLoadMeasurer (&stream->cpuLoadMeasurer, sampleRate); - stream->asioBufferInfos = (ASIOBufferInfo*)PaUtil_AllocateMemory( - sizeof(ASIOBufferInfo) * (inputChannelCount + outputChannelCount) ); - if( !stream->asioBufferInfos ) - { + stream->asioBufferInfos = (ASIOBufferInfo*) PaUtil_AllocateMemory ( + sizeof (ASIOBufferInfo) * (inputChannelCount + outputChannelCount)); + + if (!stream->asioBufferInfos) { result = paInsufficientMemory; - PA_DEBUG(("OpenStream ERROR7\n")); + PA_DEBUG ( ("OpenStream ERROR7\n")); goto error; } - for( i=0; i < inputChannelCount; ++i ) - { + for (i=0; i < inputChannelCount; ++i) { ASIOBufferInfo *info = &stream->asioBufferInfos[i]; info->isInput = ASIOTrue; - if( inputChannelSelectors ){ + if (inputChannelSelectors) { // inputChannelSelectors values have already been validated in // ValidateAsioSpecificStreamInfo() above info->channelNum = inputChannelSelectors[i]; - }else{ + } else { info->channelNum = i; } info->buffers[0] = info->buffers[1] = 0; } - for( i=0; i < outputChannelCount; ++i ){ + for (i=0; i < outputChannelCount; ++i) { ASIOBufferInfo *info = &stream->asioBufferInfos[inputChannelCount+i]; info->isInput = ASIOFalse; - if( outputChannelSelectors ){ + if (outputChannelSelectors) { // outputChannelSelectors values have already been validated in // ValidateAsioSpecificStreamInfo() above info->channelNum = outputChannelSelectors[i]; - }else{ + } else { info->channelNum = i; } - + info->buffers[0] = info->buffers[1] = 0; } /* Using blocking i/o interface... */ - if( usingBlockingIo ) - { -/** @todo REVIEW selection of host buffer size for blocking i/o */ + if (usingBlockingIo) { + /** @todo REVIEW selection of host buffer size for blocking i/o */ /* Use default host latency for blocking i/o. */ - framesPerHostBuffer = SelectHostBufferSize( 0, driverInfo ); + framesPerHostBuffer = SelectHostBufferSize (0, driverInfo); - } - else /* Using callback interface... */ - { - framesPerHostBuffer = SelectHostBufferSize( - (( suggestedInputLatencyFrames > suggestedOutputLatencyFrames ) - ? suggestedInputLatencyFrames : suggestedOutputLatencyFrames), - driverInfo ); + } else { /* Using callback interface... */ + framesPerHostBuffer = SelectHostBufferSize ( + ( (suggestedInputLatencyFrames > suggestedOutputLatencyFrames) + ? suggestedInputLatencyFrames : suggestedOutputLatencyFrames), + driverInfo); } - PA_DEBUG(("PaAsioOpenStream: framesPerHostBuffer :%d\n", framesPerHostBuffer)); + PA_DEBUG ( ("PaAsioOpenStream: framesPerHostBuffer :%d\n", framesPerHostBuffer)); - asioError = ASIOCreateBuffers( stream->asioBufferInfos, - inputChannelCount+outputChannelCount, - framesPerHostBuffer, &asioCallbacks_ ); + asioError = ASIOCreateBuffers (stream->asioBufferInfos, + inputChannelCount+outputChannelCount, + framesPerHostBuffer, &asioCallbacks_); - if( asioError != ASE_OK - && framesPerHostBuffer != (unsigned long)driverInfo->bufferPreferredSize ) - { - PA_DEBUG(("ERROR: ASIOCreateBuffers: %s\n", PaAsio_GetAsioErrorText(asioError) )); + if (asioError != ASE_OK + && framesPerHostBuffer != (unsigned long) driverInfo->bufferPreferredSize) { + PA_DEBUG ( ("ERROR: ASIOCreateBuffers: %s\n", PaAsio_GetAsioErrorText (asioError))); /* Some buggy drivers (like the Hoontech DSP24) give incorrect [min, preferred, max] values They should work with the preferred size @@ -2122,221 +2236,217 @@ static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi, framesPerHostBuffer = driverInfo->bufferPreferredSize; - PA_DEBUG(("PaAsioOpenStream: CORRECTED framesPerHostBuffer :%d\n", framesPerHostBuffer)); + PA_DEBUG ( ("PaAsioOpenStream: CORRECTED framesPerHostBuffer :%d\n", framesPerHostBuffer)); - ASIOError asioError2 = ASIOCreateBuffers( stream->asioBufferInfos, - inputChannelCount+outputChannelCount, - framesPerHostBuffer, &asioCallbacks_ ); - if( asioError2 == ASE_OK ) + ASIOError asioError2 = ASIOCreateBuffers (stream->asioBufferInfos, + inputChannelCount+outputChannelCount, + framesPerHostBuffer, &asioCallbacks_); + + if (asioError2 == ASE_OK) asioError = ASE_OK; } - if( asioError != ASE_OK ) - { + if (asioError != ASE_OK) { result = paUnanticipatedHostError; - PA_ASIO_SET_LAST_ASIO_ERROR( asioError ); - PA_DEBUG(("OpenStream ERROR9\n")); + PA_ASIO_SET_LAST_ASIO_ERROR (asioError); + PA_DEBUG ( ("OpenStream ERROR9\n")); goto error; } asioBuffersCreated = 1; - stream->asioChannelInfos = (ASIOChannelInfo*)PaUtil_AllocateMemory( - sizeof(ASIOChannelInfo) * (inputChannelCount + outputChannelCount) ); - if( !stream->asioChannelInfos ) - { + stream->asioChannelInfos = (ASIOChannelInfo*) PaUtil_AllocateMemory ( + sizeof (ASIOChannelInfo) * (inputChannelCount + outputChannelCount)); + + if (!stream->asioChannelInfos) { result = paInsufficientMemory; - PA_DEBUG(("OpenStream ERROR10\n")); + PA_DEBUG ( ("OpenStream ERROR10\n")); goto error; } - for( i=0; i < inputChannelCount + outputChannelCount; ++i ) - { + for (i=0; i < inputChannelCount + outputChannelCount; ++i) { stream->asioChannelInfos[i].channel = stream->asioBufferInfos[i].channelNum; stream->asioChannelInfos[i].isInput = stream->asioBufferInfos[i].isInput; - asioError = ASIOGetChannelInfo( &stream->asioChannelInfos[i] ); - if( asioError != ASE_OK ) - { + asioError = ASIOGetChannelInfo (&stream->asioChannelInfos[i]); + + if (asioError != ASE_OK) { result = paUnanticipatedHostError; - PA_ASIO_SET_LAST_ASIO_ERROR( asioError ); - PA_DEBUG(("OpenStream ERROR11\n")); + PA_ASIO_SET_LAST_ASIO_ERROR (asioError); + PA_DEBUG ( ("OpenStream ERROR11\n")); goto error; } } - stream->bufferPtrs = (void**)PaUtil_AllocateMemory( - 2 * sizeof(void*) * (inputChannelCount + outputChannelCount) ); - if( !stream->bufferPtrs ) - { + stream->bufferPtrs = (void**) PaUtil_AllocateMemory ( + + 2 * sizeof (void*) * (inputChannelCount + outputChannelCount)); + + if (!stream->bufferPtrs) { result = paInsufficientMemory; - PA_DEBUG(("OpenStream ERROR12\n")); + PA_DEBUG ( ("OpenStream ERROR12\n")); goto error; } - if( inputChannelCount > 0 ) - { + if (inputChannelCount > 0) { stream->inputBufferPtrs[0] = stream-> bufferPtrs; stream->inputBufferPtrs[1] = &stream->bufferPtrs[inputChannelCount]; - for( i=0; i<inputChannelCount; ++i ) - { + for (i=0; i<inputChannelCount; ++i) { stream->inputBufferPtrs[0][i] = stream->asioBufferInfos[i].buffers[0]; stream->inputBufferPtrs[1][i] = stream->asioBufferInfos[i].buffers[1]; } - } - else - { + } else { stream->inputBufferPtrs[0] = 0; stream->inputBufferPtrs[1] = 0; } - if( outputChannelCount > 0 ) - { + if (outputChannelCount > 0) { stream->outputBufferPtrs[0] = &stream->bufferPtrs[inputChannelCount*2]; stream->outputBufferPtrs[1] = &stream->bufferPtrs[inputChannelCount*2 + outputChannelCount]; - for( i=0; i<outputChannelCount; ++i ) - { + for (i=0; i<outputChannelCount; ++i) { stream->outputBufferPtrs[0][i] = stream->asioBufferInfos[inputChannelCount+i].buffers[0]; stream->outputBufferPtrs[1][i] = stream->asioBufferInfos[inputChannelCount+i].buffers[1]; } - } - else - { + } else { stream->outputBufferPtrs[0] = 0; stream->outputBufferPtrs[1] = 0; } - if( inputChannelCount > 0 ) - { + if (inputChannelCount > 0) { /* FIXME: assume all channels use the same type for now */ ASIOSampleType inputType = stream->asioChannelInfos[0].type; - PA_DEBUG(("ASIO Input type:%d",inputType)); - AsioSampleTypeLOG(inputType); - hostInputSampleFormat = AsioSampleTypeToPaNativeSampleFormat( inputType ); + PA_DEBUG ( ("ASIO Input type:%d",inputType)); + AsioSampleTypeLOG (inputType); + hostInputSampleFormat = AsioSampleTypeToPaNativeSampleFormat (inputType); - SelectAsioToPaConverter( inputType, &stream->inputBufferConverter, &stream->inputShift ); - } - else - { + SelectAsioToPaConverter (inputType, &stream->inputBufferConverter, &stream->inputShift); + } else { hostInputSampleFormat = 0; stream->inputBufferConverter = 0; } - if( outputChannelCount > 0 ) - { + if (outputChannelCount > 0) { /* FIXME: assume all channels use the same type for now */ ASIOSampleType outputType = stream->asioChannelInfos[inputChannelCount].type; - PA_DEBUG(("ASIO Output type:%d",outputType)); - AsioSampleTypeLOG(outputType); - hostOutputSampleFormat = AsioSampleTypeToPaNativeSampleFormat( outputType ); + PA_DEBUG ( ("ASIO Output type:%d",outputType)); + AsioSampleTypeLOG (outputType); + hostOutputSampleFormat = AsioSampleTypeToPaNativeSampleFormat (outputType); - SelectPaToAsioConverter( outputType, &stream->outputBufferConverter, &stream->outputShift ); - } - else - { + SelectPaToAsioConverter (outputType, &stream->outputBufferConverter, &stream->outputShift); + } else { hostOutputSampleFormat = 0; stream->outputBufferConverter = 0; } - ASIOGetLatencies( &stream->inputLatency, &stream->outputLatency ); + ASIOGetLatencies (&stream->inputLatency, &stream->outputLatency); /* Using blocking i/o interface... */ - if( usingBlockingIo ) - { + + if (usingBlockingIo) { /* Allocate the blocking i/o input ring buffer memory. */ - stream->blockingState = (PaAsioStreamBlockingState*)PaUtil_AllocateMemory( sizeof(PaAsioStreamBlockingState) ); - if( !stream->blockingState ) - { + stream->blockingState = (PaAsioStreamBlockingState*) PaUtil_AllocateMemory (sizeof (PaAsioStreamBlockingState)); + + if (!stream->blockingState) { result = paInsufficientMemory; - PA_DEBUG(("ERROR! Blocking i/o interface struct allocation failed in OpenStream()\n")); + PA_DEBUG ( ("ERROR! Blocking i/o interface struct allocation failed in OpenStream()\n")); goto error; } /* Initialize blocking i/o interface struct. */ stream->blockingState->readFramesReadyEvent = NULL; /* Uninitialized, yet. */ + stream->blockingState->writeBuffersReadyEvent = NULL; /* Uninitialized, yet. */ + stream->blockingState->readRingBufferData = NULL; /* Uninitialized, yet. */ + stream->blockingState->writeRingBufferData = NULL; /* Uninitialized, yet. */ + stream->blockingState->readStreamBuffer = NULL; /* Uninitialized, yet. */ + stream->blockingState->writeStreamBuffer = NULL; /* Uninitialized, yet. */ + stream->blockingState->stopFlag = TRUE; /* Not started, yet. */ /* If the user buffer is unspecified */ - if( framesPerBuffer == paFramesPerBufferUnspecified ) - { + if (framesPerBuffer == paFramesPerBufferUnspecified) { /* Make the user buffer the same size as the host buffer. */ framesPerBuffer = framesPerHostBuffer; } /* Initialize callback buffer processor. */ - result = PaUtil_InitializeBufferProcessor( &stream->bufferProcessor , - inputChannelCount , - inputSampleFormat & ~paNonInterleaved , /* Ring buffer. */ - hostInputSampleFormat , /* Host format. */ - outputChannelCount , - outputSampleFormat & ~paNonInterleaved, /* Ring buffer. */ - hostOutputSampleFormat , /* Host format. */ - sampleRate , - streamFlags , - framesPerBuffer , /* Frames per ring buffer block. */ - framesPerHostBuffer , /* Frames per asio buffer. */ - paUtilFixedHostBufferSize , - streamCallback , - userData ); - if( result != paNoError ){ - PA_DEBUG(("OpenStream ERROR13\n")); + result = PaUtil_InitializeBufferProcessor (&stream->bufferProcessor , + inputChannelCount , + inputSampleFormat & ~paNonInterleaved , /* Ring buffer. */ + hostInputSampleFormat , /* Host format. */ + outputChannelCount , + outputSampleFormat & ~paNonInterleaved, /* Ring buffer. */ + hostOutputSampleFormat , /* Host format. */ + sampleRate , + streamFlags , + framesPerBuffer , /* Frames per ring buffer block. */ + framesPerHostBuffer , /* Frames per asio buffer. */ + paUtilFixedHostBufferSize , + streamCallback , + userData); + + if (result != paNoError) { + PA_DEBUG ( ("OpenStream ERROR13\n")); goto error; } + callbackBufferProcessorInited = TRUE; /* Initialize the blocking i/o buffer processor. */ - result = PaUtil_InitializeBufferProcessor(&stream->blockingState->bufferProcessor, - inputChannelCount , - inputSampleFormat , /* User format. */ - inputSampleFormat & ~paNonInterleaved , /* Ring buffer. */ - outputChannelCount , - outputSampleFormat , /* User format. */ - outputSampleFormat & ~paNonInterleaved, /* Ring buffer. */ - sampleRate , - paClipOff | paDitherOff , /* Don't use dither nor clipping. */ - framesPerBuffer , /* Frames per user buffer. */ - framesPerBuffer , /* Frames per ring buffer block. */ - paUtilBoundedHostBufferSize , - NULL, NULL );/* No callback! */ - if( result != paNoError ){ - PA_DEBUG(("ERROR! Blocking i/o buffer processor initialization failed in OpenStream()\n")); + result = PaUtil_InitializeBufferProcessor (&stream->blockingState->bufferProcessor, + inputChannelCount , + inputSampleFormat , /* User format. */ + inputSampleFormat & ~paNonInterleaved , /* Ring buffer. */ + outputChannelCount , + outputSampleFormat , /* User format. */ + outputSampleFormat & ~paNonInterleaved, /* Ring buffer. */ + sampleRate , + paClipOff | paDitherOff , /* Don't use dither nor clipping. */ + framesPerBuffer , /* Frames per user buffer. */ + framesPerBuffer , /* Frames per ring buffer block. */ + paUtilBoundedHostBufferSize , + NULL, NULL); /* No callback! */ + + if (result != paNoError) { + PA_DEBUG ( ("ERROR! Blocking i/o buffer processor initialization failed in OpenStream()\n")); goto error; } + blockingBufferProcessorInited = TRUE; /* If input is requested. */ - if( inputChannelCount ) - { + + if (inputChannelCount) { /* Create the callback sync-event. */ - stream->blockingState->readFramesReadyEvent = CreateEvent( NULL, FALSE, FALSE, NULL ); - if( stream->blockingState->readFramesReadyEvent == NULL ) - { + stream->blockingState->readFramesReadyEvent = CreateEvent (NULL, FALSE, FALSE, NULL); + + if (stream->blockingState->readFramesReadyEvent == NULL) { result = paUnanticipatedHostError; - PA_ASIO_SET_LAST_SYSTEM_ERROR( GetLastError() ); - PA_DEBUG(("ERROR! Blocking i/o \"read frames ready\" event creation failed in OpenStream()\n")); + PA_ASIO_SET_LAST_SYSTEM_ERROR (GetLastError()); + PA_DEBUG ( ("ERROR! Blocking i/o \"read frames ready\" event creation failed in OpenStream()\n")); goto error; } + blockingReadFramesReadyEventInitialized = 1; /* Create pointer buffer to access non-interleaved data in ReadStream() */ - stream->blockingState->readStreamBuffer = (void**)PaUtil_AllocateMemory( sizeof(void*) * inputChannelCount ); - if( !stream->blockingState->readStreamBuffer ) - { + stream->blockingState->readStreamBuffer = (void**) PaUtil_AllocateMemory (sizeof (void*) * inputChannelCount); + + if (!stream->blockingState->readStreamBuffer) { result = paInsufficientMemory; - PA_DEBUG(("ERROR! Blocking i/o read stream buffer allocation failed in OpenStream()\n")); + PA_DEBUG ( ("ERROR! Blocking i/o read stream buffer allocation failed in OpenStream()\n")); goto error; } @@ -2355,74 +2465,79 @@ static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi, 5) Get the next larger (or equal) power-of-two buffer size. */ lBlockingBufferSize = suggestedInputLatencyFrames - stream->inputLatency; + lBlockingBufferSize = (lBlockingBufferSize > 0) ? lBlockingBufferSize : 1; + lBlockingBufferSize = (lBlockingBufferSize + framesPerBuffer - 1) / framesPerBuffer; + lBlockingBufferSize = (lBlockingBufferSize + 1) * framesPerBuffer; /* Get the next larger or equal power-of-two buffersize. */ lBlockingBufferSizePow2 = 1; - while( lBlockingBufferSize > (lBlockingBufferSizePow2<<=1) ); + + while (lBlockingBufferSize > (lBlockingBufferSizePow2<<=1)); + lBlockingBufferSize = lBlockingBufferSizePow2; /* Compute total intput latency in seconds */ stream->streamRepresentation.streamInfo.inputLatency = - (double)( PaUtil_GetBufferProcessorInputLatency(&stream->bufferProcessor ) - + PaUtil_GetBufferProcessorInputLatency(&stream->blockingState->bufferProcessor) - + (lBlockingBufferSize / framesPerBuffer - 1) * framesPerBuffer - + stream->inputLatency ) + (double) (PaUtil_GetBufferProcessorInputLatency (&stream->bufferProcessor) + + PaUtil_GetBufferProcessorInputLatency (&stream->blockingState->bufferProcessor) + + (lBlockingBufferSize / framesPerBuffer - 1) * framesPerBuffer + + stream->inputLatency) / sampleRate; /* The code below prints the ASIO latency which doesn't include the buffer processor latency nor the blocking i/o latency. It reports the added latency separately. */ - PA_DEBUG(("PaAsio : ASIO InputLatency = %ld (%ld ms),\n added buffProc:%ld (%ld ms),\n added blocking:%ld (%ld ms)\n", - stream->inputLatency, - (long)( stream->inputLatency * (1000.0 / sampleRate) ), - PaUtil_GetBufferProcessorInputLatency(&stream->bufferProcessor), - (long)( PaUtil_GetBufferProcessorInputLatency(&stream->bufferProcessor) * (1000.0 / sampleRate) ), - PaUtil_GetBufferProcessorInputLatency(&stream->blockingState->bufferProcessor) + (lBlockingBufferSize / framesPerBuffer - 1) * framesPerBuffer, - (long)( (PaUtil_GetBufferProcessorInputLatency(&stream->blockingState->bufferProcessor) + (lBlockingBufferSize / framesPerBuffer - 1) * framesPerBuffer) * (1000.0 / sampleRate) ) - )); + PA_DEBUG ( ("PaAsio : ASIO InputLatency = %ld (%ld ms),\n added buffProc:%ld (%ld ms),\n added blocking:%ld (%ld ms)\n", + stream->inputLatency, + (long) (stream->inputLatency * (1000.0 / sampleRate)), + PaUtil_GetBufferProcessorInputLatency (&stream->bufferProcessor), + (long) (PaUtil_GetBufferProcessorInputLatency (&stream->bufferProcessor) * (1000.0 / sampleRate)), + PaUtil_GetBufferProcessorInputLatency (&stream->blockingState->bufferProcessor) + (lBlockingBufferSize / framesPerBuffer - 1) * framesPerBuffer, + (long) ( (PaUtil_GetBufferProcessorInputLatency (&stream->blockingState->bufferProcessor) + (lBlockingBufferSize / framesPerBuffer - 1) * framesPerBuffer) * (1000.0 / sampleRate)) + )); /* Determine the size of ring buffer in bytes. */ - lBytesPerFrame = inputChannelCount * Pa_GetSampleSize(inputSampleFormat ); + lBytesPerFrame = inputChannelCount * Pa_GetSampleSize (inputSampleFormat); /* Allocate the blocking i/o input ring buffer memory. */ - stream->blockingState->readRingBufferData = (void*)PaUtil_AllocateMemory( lBlockingBufferSize * lBytesPerFrame ); - if( !stream->blockingState->readRingBufferData ) - { + stream->blockingState->readRingBufferData = (void*) PaUtil_AllocateMemory (lBlockingBufferSize * lBytesPerFrame); + + if (!stream->blockingState->readRingBufferData) { result = paInsufficientMemory; - PA_DEBUG(("ERROR! Blocking i/o input ring buffer allocation failed in OpenStream()\n")); + PA_DEBUG ( ("ERROR! Blocking i/o input ring buffer allocation failed in OpenStream()\n")); goto error; } /* Initialize the input ring buffer struct. */ - PaUtil_InitializeRingBuffer( &stream->blockingState->readRingBuffer , - lBytesPerFrame , - lBlockingBufferSize , - stream->blockingState->readRingBufferData ); + PaUtil_InitializeRingBuffer (&stream->blockingState->readRingBuffer , + lBytesPerFrame , + lBlockingBufferSize , + stream->blockingState->readRingBufferData); } /* If output is requested. */ - if( outputChannelCount ) - { - stream->blockingState->writeBuffersReadyEvent = CreateEvent( NULL, FALSE, FALSE, NULL ); - if( stream->blockingState->writeBuffersReadyEvent == NULL ) - { + if (outputChannelCount) { + stream->blockingState->writeBuffersReadyEvent = CreateEvent (NULL, FALSE, FALSE, NULL); + + if (stream->blockingState->writeBuffersReadyEvent == NULL) { result = paUnanticipatedHostError; - PA_ASIO_SET_LAST_SYSTEM_ERROR( GetLastError() ); - PA_DEBUG(("ERROR! Blocking i/o \"write buffers ready\" event creation failed in OpenStream()\n")); + PA_ASIO_SET_LAST_SYSTEM_ERROR (GetLastError()); + PA_DEBUG ( ("ERROR! Blocking i/o \"write buffers ready\" event creation failed in OpenStream()\n")); goto error; } + blockingWriteBuffersReadyEventInitialized = 1; /* Create pointer buffer to access non-interleaved data in WriteStream() */ - stream->blockingState->writeStreamBuffer = (const void**)PaUtil_AllocateMemory( sizeof(const void*) * outputChannelCount ); - if( !stream->blockingState->writeStreamBuffer ) - { + stream->blockingState->writeStreamBuffer = (const void**) PaUtil_AllocateMemory (sizeof (const void*) * outputChannelCount); + + if (!stream->blockingState->writeStreamBuffer) { result = paInsufficientMemory; - PA_DEBUG(("ERROR! Blocking i/o write stream buffer allocation failed in OpenStream()\n")); + PA_DEBUG ( ("ERROR! Blocking i/o write stream buffer allocation failed in OpenStream()\n")); goto error; } @@ -2441,8 +2556,11 @@ static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi, 5) Get the next larger (or equal) power-of-two buffer size. */ lBlockingBufferSize = suggestedOutputLatencyFrames - stream->outputLatency; + lBlockingBufferSize = (lBlockingBufferSize > 0) ? lBlockingBufferSize : 1; + lBlockingBufferSize = (lBlockingBufferSize + framesPerBuffer - 1) / framesPerBuffer; + lBlockingBufferSize = (lBlockingBufferSize + 1) * framesPerBuffer; /* The buffer size (without the additional block) corresponds @@ -2452,93 +2570,96 @@ static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi, /* Get the next larger or equal power-of-two buffersize. */ lBlockingBufferSizePow2 = 1; - while( lBlockingBufferSize > (lBlockingBufferSizePow2<<=1) ); + + while (lBlockingBufferSize > (lBlockingBufferSizePow2<<=1)); + lBlockingBufferSize = lBlockingBufferSizePow2; /* Compute total output latency in seconds */ stream->streamRepresentation.streamInfo.outputLatency = - (double)( PaUtil_GetBufferProcessorOutputLatency(&stream->bufferProcessor ) - + PaUtil_GetBufferProcessorOutputLatency(&stream->blockingState->bufferProcessor) - + (lBlockingBufferSize / framesPerBuffer - 1) * framesPerBuffer - + stream->outputLatency ) + (double) (PaUtil_GetBufferProcessorOutputLatency (&stream->bufferProcessor) + + PaUtil_GetBufferProcessorOutputLatency (&stream->blockingState->bufferProcessor) + + (lBlockingBufferSize / framesPerBuffer - 1) * framesPerBuffer + + stream->outputLatency) / sampleRate; /* The code below prints the ASIO latency which doesn't include the buffer processor latency nor the blocking i/o latency. It reports the added latency separately. */ - PA_DEBUG(("PaAsio : ASIO OutputLatency = %ld (%ld ms),\n added buffProc:%ld (%ld ms),\n added blocking:%ld (%ld ms)\n", - stream->outputLatency, - (long)( stream->inputLatency * (1000.0 / sampleRate) ), - PaUtil_GetBufferProcessorOutputLatency(&stream->bufferProcessor), - (long)( PaUtil_GetBufferProcessorOutputLatency(&stream->bufferProcessor) * (1000.0 / sampleRate) ), - PaUtil_GetBufferProcessorOutputLatency(&stream->blockingState->bufferProcessor) + (lBlockingBufferSize / framesPerBuffer - 1) * framesPerBuffer, - (long)( (PaUtil_GetBufferProcessorOutputLatency(&stream->blockingState->bufferProcessor) + (lBlockingBufferSize / framesPerBuffer - 1) * framesPerBuffer) * (1000.0 / sampleRate) ) - )); + PA_DEBUG ( ("PaAsio : ASIO OutputLatency = %ld (%ld ms),\n added buffProc:%ld (%ld ms),\n added blocking:%ld (%ld ms)\n", + stream->outputLatency, + (long) (stream->inputLatency * (1000.0 / sampleRate)), + PaUtil_GetBufferProcessorOutputLatency (&stream->bufferProcessor), + (long) (PaUtil_GetBufferProcessorOutputLatency (&stream->bufferProcessor) * (1000.0 / sampleRate)), + PaUtil_GetBufferProcessorOutputLatency (&stream->blockingState->bufferProcessor) + (lBlockingBufferSize / framesPerBuffer - 1) * framesPerBuffer, + (long) ( (PaUtil_GetBufferProcessorOutputLatency (&stream->blockingState->bufferProcessor) + (lBlockingBufferSize / framesPerBuffer - 1) * framesPerBuffer) * (1000.0 / sampleRate)) + )); /* Determine the size of ring buffer in bytes. */ - lBytesPerFrame = outputChannelCount * Pa_GetSampleSize(outputSampleFormat); + lBytesPerFrame = outputChannelCount * Pa_GetSampleSize (outputSampleFormat); /* Allocate the blocking i/o output ring buffer memory. */ - stream->blockingState->writeRingBufferData = (void*)PaUtil_AllocateMemory( lBlockingBufferSize * lBytesPerFrame ); - if( !stream->blockingState->writeRingBufferData ) - { + stream->blockingState->writeRingBufferData = (void*) PaUtil_AllocateMemory (lBlockingBufferSize * lBytesPerFrame); + + if (!stream->blockingState->writeRingBufferData) { result = paInsufficientMemory; - PA_DEBUG(("ERROR! Blocking i/o output ring buffer allocation failed in OpenStream()\n")); + PA_DEBUG ( ("ERROR! Blocking i/o output ring buffer allocation failed in OpenStream()\n")); goto error; } /* Initialize the output ring buffer struct. */ - PaUtil_InitializeRingBuffer( &stream->blockingState->writeRingBuffer , - lBytesPerFrame , - lBlockingBufferSize , - stream->blockingState->writeRingBufferData ); + PaUtil_InitializeRingBuffer (&stream->blockingState->writeRingBuffer , + lBytesPerFrame , + lBlockingBufferSize , + stream->blockingState->writeRingBufferData); } stream->streamRepresentation.streamInfo.sampleRate = sampleRate; - } - else /* Using callback interface... */ - { - result = PaUtil_InitializeBufferProcessor( &stream->bufferProcessor, - inputChannelCount, inputSampleFormat, hostInputSampleFormat, - outputChannelCount, outputSampleFormat, hostOutputSampleFormat, - sampleRate, streamFlags, framesPerBuffer, - framesPerHostBuffer, paUtilFixedHostBufferSize, - streamCallback, userData ); - if( result != paNoError ){ - PA_DEBUG(("OpenStream ERROR13\n")); + } else { /* Using callback interface... */ + result = PaUtil_InitializeBufferProcessor (&stream->bufferProcessor, + inputChannelCount, inputSampleFormat, hostInputSampleFormat, + outputChannelCount, outputSampleFormat, hostOutputSampleFormat, + sampleRate, streamFlags, framesPerBuffer, + framesPerHostBuffer, paUtilFixedHostBufferSize, + streamCallback, userData); + + if (result != paNoError) { + PA_DEBUG ( ("OpenStream ERROR13\n")); goto error; } + callbackBufferProcessorInited = TRUE; stream->streamRepresentation.streamInfo.inputLatency = - (double)( PaUtil_GetBufferProcessorInputLatency(&stream->bufferProcessor) - + stream->inputLatency) / sampleRate; // seconds + (double) (PaUtil_GetBufferProcessorInputLatency (&stream->bufferProcessor) + + stream->inputLatency) / sampleRate; // seconds stream->streamRepresentation.streamInfo.outputLatency = - (double)( PaUtil_GetBufferProcessorOutputLatency(&stream->bufferProcessor) - + stream->outputLatency) / sampleRate; // seconds + (double) (PaUtil_GetBufferProcessorOutputLatency (&stream->bufferProcessor) + + stream->outputLatency) / sampleRate; // seconds stream->streamRepresentation.streamInfo.sampleRate = sampleRate; // the code below prints the ASIO latency which doesn't include the // buffer processor latency. it reports the added latency separately - PA_DEBUG(("PaAsio : ASIO InputLatency = %ld (%ld ms), added buffProc:%ld (%ld ms)\n", - stream->inputLatency, - (long)((stream->inputLatency*1000)/ sampleRate), - PaUtil_GetBufferProcessorInputLatency(&stream->bufferProcessor), - (long)((PaUtil_GetBufferProcessorInputLatency(&stream->bufferProcessor)*1000)/ sampleRate) - )); - - PA_DEBUG(("PaAsio : ASIO OuputLatency = %ld (%ld ms), added buffProc:%ld (%ld ms)\n", - stream->outputLatency, - (long)((stream->outputLatency*1000)/ sampleRate), - PaUtil_GetBufferProcessorOutputLatency(&stream->bufferProcessor), - (long)((PaUtil_GetBufferProcessorOutputLatency(&stream->bufferProcessor)*1000)/ sampleRate) - )); + PA_DEBUG ( ("PaAsio : ASIO InputLatency = %ld (%ld ms), added buffProc:%ld (%ld ms)\n", + stream->inputLatency, + (long) ( (stream->inputLatency*1000) / sampleRate), + PaUtil_GetBufferProcessorInputLatency (&stream->bufferProcessor), + (long) ( (PaUtil_GetBufferProcessorInputLatency (&stream->bufferProcessor) *1000) / sampleRate) + )); + + PA_DEBUG ( ("PaAsio : ASIO OuputLatency = %ld (%ld ms), added buffProc:%ld (%ld ms)\n", + stream->outputLatency, + (long) ( (stream->outputLatency*1000) / sampleRate), + PaUtil_GetBufferProcessorOutputLatency (&stream->bufferProcessor), + (long) ( (PaUtil_GetBufferProcessorOutputLatency (&stream->bufferProcessor) *1000) / sampleRate) + )); } stream->asioHostApi = asioHostApi; + stream->framesPerHostCallback = framesPerHostBuffer; stream->inputChannelCount = inputChannelCount; @@ -2548,61 +2669,64 @@ static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi, asioHostApi->openAsioDeviceIndex = asioDeviceIndex; - *s = (PaStream*)stream; + *s = (PaStream*) stream; return result; error: - PA_DEBUG(("goto errored\n")); - if( stream ) - { - if( stream->blockingState ) - { - if( blockingBufferProcessorInited ) - PaUtil_TerminateBufferProcessor( &stream->blockingState->bufferProcessor ); - - if( stream->blockingState->writeRingBufferData ) - PaUtil_FreeMemory( stream->blockingState->writeRingBufferData ); - if( stream->blockingState->writeStreamBuffer ) - PaUtil_FreeMemory( stream->blockingState->writeStreamBuffer ); - if( blockingWriteBuffersReadyEventInitialized ) - CloseHandle( stream->blockingState->writeBuffersReadyEvent ); - - if( stream->blockingState->readRingBufferData ) - PaUtil_FreeMemory( stream->blockingState->readRingBufferData ); - if( stream->blockingState->readStreamBuffer ) - PaUtil_FreeMemory( stream->blockingState->readStreamBuffer ); - if( blockingReadFramesReadyEventInitialized ) - CloseHandle( stream->blockingState->readFramesReadyEvent ); - - PaUtil_FreeMemory( stream->blockingState ); + PA_DEBUG ( ("goto errored\n")); + + if (stream) { + if (stream->blockingState) { + if (blockingBufferProcessorInited) + PaUtil_TerminateBufferProcessor (&stream->blockingState->bufferProcessor); + + if (stream->blockingState->writeRingBufferData) + PaUtil_FreeMemory (stream->blockingState->writeRingBufferData); + + if (stream->blockingState->writeStreamBuffer) + PaUtil_FreeMemory (stream->blockingState->writeStreamBuffer); + + if (blockingWriteBuffersReadyEventInitialized) + CloseHandle (stream->blockingState->writeBuffersReadyEvent); + + if (stream->blockingState->readRingBufferData) + PaUtil_FreeMemory (stream->blockingState->readRingBufferData); + + if (stream->blockingState->readStreamBuffer) + PaUtil_FreeMemory (stream->blockingState->readStreamBuffer); + + if (blockingReadFramesReadyEventInitialized) + CloseHandle (stream->blockingState->readFramesReadyEvent); + + PaUtil_FreeMemory (stream->blockingState); } - if( callbackBufferProcessorInited ) - PaUtil_TerminateBufferProcessor( &stream->bufferProcessor ); + if (callbackBufferProcessorInited) + PaUtil_TerminateBufferProcessor (&stream->bufferProcessor); - if( completedBuffersPlayedEventInited ) - CloseHandle( stream->completedBuffersPlayedEvent ); + if (completedBuffersPlayedEventInited) + CloseHandle (stream->completedBuffersPlayedEvent); - if( stream->asioBufferInfos ) - PaUtil_FreeMemory( stream->asioBufferInfos ); + if (stream->asioBufferInfos) + PaUtil_FreeMemory (stream->asioBufferInfos); - if( stream->asioChannelInfos ) - PaUtil_FreeMemory( stream->asioChannelInfos ); + if (stream->asioChannelInfos) + PaUtil_FreeMemory (stream->asioChannelInfos); - if( stream->bufferPtrs ) - PaUtil_FreeMemory( stream->bufferPtrs ); + if (stream->bufferPtrs) + PaUtil_FreeMemory (stream->bufferPtrs); - PaUtil_FreeMemory( stream ); + PaUtil_FreeMemory (stream); } - if( asioBuffersCreated ) + if (asioBuffersCreated) ASIODisposeBuffers(); - if( asioIsInitialized ) - { - UnloadAsioDriver(); - } + if (asioIsInitialized) { + UnloadAsioDriver(); + } + return result; } @@ -2611,46 +2735,48 @@ error: When CloseStream() is called, the multi-api layer ensures that the stream has already been stopped or aborted. */ -static PaError CloseStream( PaStream* s ) +static PaError CloseStream (PaStream* s) { PaError result = paNoError; - PaAsioStream *stream = (PaAsioStream*)s; + PaAsioStream *stream = (PaAsioStream*) s; /* IMPLEMENT ME: - additional stream closing + cleanup */ - PaUtil_TerminateBufferProcessor( &stream->bufferProcessor ); - PaUtil_TerminateStreamRepresentation( &stream->streamRepresentation ); + PaUtil_TerminateBufferProcessor (&stream->bufferProcessor); + PaUtil_TerminateStreamRepresentation (&stream->streamRepresentation); stream->asioHostApi->openAsioDeviceIndex = paNoDevice; - CloseHandle( stream->completedBuffersPlayedEvent ); + CloseHandle (stream->completedBuffersPlayedEvent); /* Using blocking i/o interface... */ - if( stream->blockingState ) - { - PaUtil_TerminateBufferProcessor( &stream->blockingState->bufferProcessor ); - if( stream->inputChannelCount ) { - PaUtil_FreeMemory( stream->blockingState->readRingBufferData ); - PaUtil_FreeMemory( stream->blockingState->readStreamBuffer ); - CloseHandle( stream->blockingState->readFramesReadyEvent ); + if (stream->blockingState) { + PaUtil_TerminateBufferProcessor (&stream->blockingState->bufferProcessor); + + if (stream->inputChannelCount) { + PaUtil_FreeMemory (stream->blockingState->readRingBufferData); + PaUtil_FreeMemory (stream->blockingState->readStreamBuffer); + CloseHandle (stream->blockingState->readFramesReadyEvent); } - if( stream->outputChannelCount ) { - PaUtil_FreeMemory( stream->blockingState->writeRingBufferData ); - PaUtil_FreeMemory( stream->blockingState->writeStreamBuffer ); - CloseHandle( stream->blockingState->writeBuffersReadyEvent ); + + if (stream->outputChannelCount) { + PaUtil_FreeMemory (stream->blockingState->writeRingBufferData); + PaUtil_FreeMemory (stream->blockingState->writeStreamBuffer); + CloseHandle (stream->blockingState->writeBuffersReadyEvent); } - PaUtil_FreeMemory( stream->blockingState ); + PaUtil_FreeMemory (stream->blockingState); } - PaUtil_FreeMemory( stream->asioBufferInfos ); - PaUtil_FreeMemory( stream->asioChannelInfos ); - PaUtil_FreeMemory( stream->bufferPtrs ); - PaUtil_FreeMemory( stream ); + PaUtil_FreeMemory (stream->asioBufferInfos); + + PaUtil_FreeMemory (stream->asioChannelInfos); + PaUtil_FreeMemory (stream->bufferPtrs); + PaUtil_FreeMemory (stream); ASIODisposeBuffers(); UnloadAsioDriver(); @@ -2659,7 +2785,7 @@ static PaError CloseStream( PaStream* s ) } -static void bufferSwitch(long index, ASIOBool directProcess) +static void bufferSwitch (long index, ASIOBool directProcess) { //TAKEN FROM THE ASIO SDK @@ -2673,27 +2799,28 @@ static void bufferSwitch(long index, ASIOBool directProcess) // timeInfo.systemTime fields and the according flags ASIOTime timeInfo; - memset( &timeInfo, 0, sizeof (timeInfo) ); + memset (&timeInfo, 0, sizeof (timeInfo)); // get the time stamp of the buffer, not necessary if no // synchronization to other media is required - if( ASIOGetSamplePosition(&timeInfo.timeInfo.samplePosition, &timeInfo.timeInfo.systemTime) == ASE_OK) - timeInfo.timeInfo.flags = kSystemTimeValid | kSamplePositionValid; + + if (ASIOGetSamplePosition (&timeInfo.timeInfo.samplePosition, &timeInfo.timeInfo.systemTime) == ASE_OK) + timeInfo.timeInfo.flags = kSystemTimeValid | kSamplePositionValid; // Call the real callback - bufferSwitchTimeInfo( &timeInfo, index, directProcess ); + bufferSwitchTimeInfo (&timeInfo, index, directProcess); } // conversion from 64 bit ASIOSample/ASIOTimeStamp to double float #if NATIVE_INT64 - #define ASIO64toDouble(a) (a) +#define ASIO64toDouble(a) (a) #else - const double twoRaisedTo32 = 4294967296.; - #define ASIO64toDouble(a) ((a).lo + (a).hi * twoRaisedTo32) +const double twoRaisedTo32 = 4294967296.; +#define ASIO64toDouble(a) ((a).lo + (a).hi * twoRaisedTo32) #endif -static ASIOTime *bufferSwitchTimeInfo( ASIOTime *timeInfo, long index, ASIOBool directProcess ) +static ASIOTime *bufferSwitchTimeInfo (ASIOTime *timeInfo, long index, ASIOBool directProcess) { // the actual processing callback. // Beware that this is normally in a seperate thread, hence be sure that @@ -2722,22 +2849,23 @@ static ASIOTime *bufferSwitchTimeInfo( ASIOTime *timeInfo, long index, ASIOBool // synchronization to other media is required if (timeInfo->timeInfo.flags & kSystemTimeValid) - asioDriverInfo.nanoSeconds = ASIO64toDouble(timeInfo->timeInfo.systemTime); + asioDriverInfo.nanoSeconds = ASIO64toDouble (timeInfo->timeInfo.systemTime); else - asioDriverInfo.nanoSeconds = 0; + asioDriverInfo.nanoSeconds = 0; if (timeInfo->timeInfo.flags & kSamplePositionValid) - asioDriverInfo.samples = ASIO64toDouble(timeInfo->timeInfo.samplePosition); + asioDriverInfo.samples = ASIO64toDouble (timeInfo->timeInfo.samplePosition); else - asioDriverInfo.samples = 0; + asioDriverInfo.samples = 0; if (timeInfo->timeCode.flags & kTcValid) - asioDriverInfo.tcSamples = ASIO64toDouble(timeInfo->timeCode.timeCodeSamples); + asioDriverInfo.tcSamples = ASIO64toDouble (timeInfo->timeCode.timeCodeSamples); else - asioDriverInfo.tcSamples = 0; + asioDriverInfo.tcSamples = 0; // get the system reference time asioDriverInfo.sysRefTime = get_sys_reference_time(); + #endif #if 0 @@ -2745,14 +2873,19 @@ static ASIOTime *bufferSwitchTimeInfo( ASIOTime *timeInfo, long index, ASIOBool // tells you the time when driver got its interrupt and the delay until the app receives // the event notification. static double last_samples = 0; + char tmp[128]; - sprintf (tmp, "diff: %d / %d ms / %d ms / %d samples \n", asioDriverInfo.sysRefTime - (long)(asioDriverInfo.nanoSeconds / 1000000.0), asioDriverInfo.sysRefTime, (long)(asioDriverInfo.nanoSeconds / 1000000.0), (long)(asioDriverInfo.samples - last_samples)); + + sprintf (tmp, "diff: %d / %d ms / %d ms / %d samples \n", asioDriverInfo.sysRefTime - (long) (asioDriverInfo.nanoSeconds / 1000000.0), asioDriverInfo.sysRefTime, (long) (asioDriverInfo.nanoSeconds / 1000000.0), (long) (asioDriverInfo.samples - last_samples)); + OutputDebugString (tmp); + last_samples = asioDriverInfo.samples; + #endif - if( !theAsioStream ) + if (!theAsioStream) return 0L; // Keep sample position @@ -2760,57 +2893,51 @@ static ASIOTime *bufferSwitchTimeInfo( ASIOTime *timeInfo, long index, ASIOBool // protect against reentrancy - if( PaAsio_AtomicIncrement(&theAsioStream->reenterCount) ) - { + if (PaAsio_AtomicIncrement (&theAsioStream->reenterCount)) { theAsioStream->reenterError++; //DBUG(("bufferSwitchTimeInfo : reentrancy detection = %d\n", asioDriverInfo.reenterError)); return 0L; } int buffersDone = 0; - - do - { - if( buffersDone > 0 ) - { + + do { + if (buffersDone > 0) { // this is a reentered buffer, we missed processing it on time // set the input overflow and output underflow flags as appropriate - - if( theAsioStream->inputChannelCount > 0 ) + + if (theAsioStream->inputChannelCount > 0) theAsioStream->callbackFlags |= paInputOverflow; - - if( theAsioStream->outputChannelCount > 0 ) + + if (theAsioStream->outputChannelCount > 0) theAsioStream->callbackFlags |= paOutputUnderflow; - } - else - { - if( theAsioStream->zeroOutput ) - { - ZeroOutputBuffers( theAsioStream, index ); + } else { + if (theAsioStream->zeroOutput) { + ZeroOutputBuffers (theAsioStream, index); // Finally if the driver supports the ASIOOutputReady() optimization, // do it here, all data are in place - if( theAsioStream->postOutput ) + + if (theAsioStream->postOutput) ASIOOutputReady(); - if( theAsioStream->stopProcessing ) - { - if( theAsioStream->stopPlayoutCount < 2 ) - { + if (theAsioStream->stopProcessing) { + if (theAsioStream->stopPlayoutCount < 2) { ++theAsioStream->stopPlayoutCount; - if( theAsioStream->stopPlayoutCount == 2 ) - { + + if (theAsioStream->stopPlayoutCount == 2) { theAsioStream->isActive = 0; - if( theAsioStream->streamRepresentation.streamFinishedCallback != 0 ) - theAsioStream->streamRepresentation.streamFinishedCallback( theAsioStream->streamRepresentation.userData ); + + if (theAsioStream->streamRepresentation.streamFinishedCallback != 0) + theAsioStream->streamRepresentation.streamFinishedCallback (theAsioStream->streamRepresentation.userData); + theAsioStream->streamFinishedCallbackCalled = true; - SetEvent( theAsioStream->completedBuffersPlayedEvent ); + + SetEvent (theAsioStream->completedBuffersPlayedEvent); } } } - } - else - { + } else { #if 0 // test code to try to detect slip conditions... these may work on some systems @@ -2818,165 +2945,168 @@ static ASIOTime *bufferSwitchTimeInfo( ASIOTime *timeInfo, long index, ASIOBool // check that sample delta matches buffer size (otherwise we must have skipped // a buffer. -static double last_samples = -512; -double samples; + static double last_samples = -512; + double samples; //if( timeInfo->timeCode.flags & kTcValid ) // samples = ASIO64toDouble(timeInfo->timeCode.timeCodeSamples); //else - samples = ASIO64toDouble(timeInfo->timeInfo.samplePosition); -int delta = samples - last_samples; + samples = ASIO64toDouble (timeInfo->timeInfo.samplePosition); + int delta = samples - last_samples; //printf( "%d\n", delta); -last_samples = samples; + last_samples = samples; -if( delta > theAsioStream->framesPerHostCallback ) -{ - if( theAsioStream->inputChannelCount > 0 ) - theAsioStream->callbackFlags |= paInputOverflow; + if (delta > theAsioStream->framesPerHostCallback) { + if (theAsioStream->inputChannelCount > 0) + theAsioStream->callbackFlags |= paInputOverflow; - if( theAsioStream->outputChannelCount > 0 ) - theAsioStream->callbackFlags |= paOutputUnderflow; -} + if (theAsioStream->outputChannelCount > 0) + theAsioStream->callbackFlags |= paOutputUnderflow; + } // check that the buffer index is not the previous index (which would indicate // that a buffer was skipped. -static int previousIndex = 1; -if( index == previousIndex ) -{ - if( theAsioStream->inputChannelCount > 0 ) - theAsioStream->callbackFlags |= paInputOverflow; + static int previousIndex = 1; + + if (index == previousIndex) { + if (theAsioStream->inputChannelCount > 0) + theAsioStream->callbackFlags |= paInputOverflow; + + if (theAsioStream->outputChannelCount > 0) + theAsioStream->callbackFlags |= paOutputUnderflow; + } + + previousIndex = index; - if( theAsioStream->outputChannelCount > 0 ) - theAsioStream->callbackFlags |= paOutputUnderflow; -} -previousIndex = index; #endif int i; - PaUtil_BeginCpuLoadMeasurement( &theAsioStream->cpuLoadMeasurer ); + PaUtil_BeginCpuLoadMeasurement (&theAsioStream->cpuLoadMeasurer); PaStreamCallbackTimeInfo paTimeInfo; // asio systemTime is supposed to be measured according to the same // clock as timeGetTime - paTimeInfo.currentTime = (ASIO64toDouble( timeInfo->timeInfo.systemTime ) * .000000001); + paTimeInfo.currentTime = (ASIO64toDouble (timeInfo->timeInfo.systemTime) * .000000001); /* patch from Paul Boege */ paTimeInfo.inputBufferAdcTime = paTimeInfo.currentTime - - ((double)theAsioStream->inputLatency/theAsioStream->streamRepresentation.streamInfo.sampleRate); + ( (double) theAsioStream->inputLatency/theAsioStream->streamRepresentation.streamInfo.sampleRate); paTimeInfo.outputBufferDacTime = paTimeInfo.currentTime + - ((double)theAsioStream->outputLatency/theAsioStream->streamRepresentation.streamInfo.sampleRate); + ( (double) theAsioStream->outputLatency/theAsioStream->streamRepresentation.streamInfo.sampleRate); /* old version is buggy because the buffer processor also adds in its latency to the time parameters paTimeInfo.inputBufferAdcTime = paTimeInfo.currentTime - theAsioStream->streamRepresentation.streamInfo.inputLatency; paTimeInfo.outputBufferDacTime = paTimeInfo.currentTime + theAsioStream->streamRepresentation.streamInfo.outputLatency; */ -/* Disabled! Stopping and re-starting the stream causes an input overflow / output undeflow. S.Fischer */ + /* Disabled! Stopping and re-starting the stream causes an input overflow / output undeflow. S.Fischer */ #if 0 // detect underflows by checking inter-callback time > 2 buffer period -static double previousTime = -1; -if( previousTime > 0 ){ + static double previousTime = -1; - double delta = paTimeInfo.currentTime - previousTime; + if (previousTime > 0) { - if( delta >= 2. * (theAsioStream->framesPerHostCallback / theAsioStream->streamRepresentation.streamInfo.sampleRate) ){ - if( theAsioStream->inputChannelCount > 0 ) - theAsioStream->callbackFlags |= paInputOverflow; + double delta = paTimeInfo.currentTime - previousTime; + + if (delta >= 2. * (theAsioStream->framesPerHostCallback / theAsioStream->streamRepresentation.streamInfo.sampleRate)) { + if (theAsioStream->inputChannelCount > 0) + theAsioStream->callbackFlags |= paInputOverflow; + + if (theAsioStream->outputChannelCount > 0) + theAsioStream->callbackFlags |= paOutputUnderflow; + } + } + + previousTime = paTimeInfo.currentTime; - if( theAsioStream->outputChannelCount > 0 ) - theAsioStream->callbackFlags |= paOutputUnderflow; - } -} -previousTime = paTimeInfo.currentTime; #endif // note that the above input and output times do not need to be // adjusted for the latency of the buffer processor -- the buffer // processor handles that. - if( theAsioStream->inputBufferConverter ) - { - for( i=0; i<theAsioStream->inputChannelCount; i++ ) - { - theAsioStream->inputBufferConverter( theAsioStream->inputBufferPtrs[index][i], - theAsioStream->inputShift, theAsioStream->framesPerHostCallback ); + if (theAsioStream->inputBufferConverter) { + for (i=0; i<theAsioStream->inputChannelCount; i++) { + theAsioStream->inputBufferConverter (theAsioStream->inputBufferPtrs[index][i], + theAsioStream->inputShift, theAsioStream->framesPerHostCallback); } } - PaUtil_BeginBufferProcessing( &theAsioStream->bufferProcessor, &paTimeInfo, theAsioStream->callbackFlags ); + PaUtil_BeginBufferProcessing (&theAsioStream->bufferProcessor, &paTimeInfo, theAsioStream->callbackFlags); /* reset status flags once they've been passed to the callback */ theAsioStream->callbackFlags = 0; - PaUtil_SetInputFrameCount( &theAsioStream->bufferProcessor, 0 /* default to host buffer size */ ); - for( i=0; i<theAsioStream->inputChannelCount; ++i ) - PaUtil_SetNonInterleavedInputChannel( &theAsioStream->bufferProcessor, i, theAsioStream->inputBufferPtrs[index][i] ); + PaUtil_SetInputFrameCount (&theAsioStream->bufferProcessor, 0 /* default to host buffer size */); + + for (i=0; i<theAsioStream->inputChannelCount; ++i) + PaUtil_SetNonInterleavedInputChannel (&theAsioStream->bufferProcessor, i, theAsioStream->inputBufferPtrs[index][i]); - PaUtil_SetOutputFrameCount( &theAsioStream->bufferProcessor, 0 /* default to host buffer size */ ); - for( i=0; i<theAsioStream->outputChannelCount; ++i ) - PaUtil_SetNonInterleavedOutputChannel( &theAsioStream->bufferProcessor, i, theAsioStream->outputBufferPtrs[index][i] ); + PaUtil_SetOutputFrameCount (&theAsioStream->bufferProcessor, 0 /* default to host buffer size */); + + for (i=0; i<theAsioStream->outputChannelCount; ++i) + PaUtil_SetNonInterleavedOutputChannel (&theAsioStream->bufferProcessor, i, theAsioStream->outputBufferPtrs[index][i]); int callbackResult; - if( theAsioStream->stopProcessing ) + + if (theAsioStream->stopProcessing) callbackResult = paComplete; else callbackResult = paContinue; - unsigned long framesProcessed = PaUtil_EndBufferProcessing( &theAsioStream->bufferProcessor, &callbackResult ); - - if( theAsioStream->outputBufferConverter ) - { - for( i=0; i<theAsioStream->outputChannelCount; i++ ) - { - theAsioStream->outputBufferConverter( theAsioStream->outputBufferPtrs[index][i], - theAsioStream->outputShift, theAsioStream->framesPerHostCallback ); + + unsigned long framesProcessed = PaUtil_EndBufferProcessing (&theAsioStream->bufferProcessor, &callbackResult); + + if (theAsioStream->outputBufferConverter) { + for (i=0; i<theAsioStream->outputChannelCount; i++) { + theAsioStream->outputBufferConverter (theAsioStream->outputBufferPtrs[index][i], + theAsioStream->outputShift, theAsioStream->framesPerHostCallback); } } - PaUtil_EndCpuLoadMeasurement( &theAsioStream->cpuLoadMeasurer, framesProcessed ); + PaUtil_EndCpuLoadMeasurement (&theAsioStream->cpuLoadMeasurer, framesProcessed); // Finally if the driver supports the ASIOOutputReady() optimization, // do it here, all data are in place - if( theAsioStream->postOutput ) + + if (theAsioStream->postOutput) ASIOOutputReady(); - if( callbackResult == paContinue ) - { + if (callbackResult == paContinue) { /* nothing special to do */ - } - else if( callbackResult == paAbort ) - { + } else if (callbackResult == paAbort) { /* finish playback immediately */ theAsioStream->isActive = 0; - if( theAsioStream->streamRepresentation.streamFinishedCallback != 0 ) - theAsioStream->streamRepresentation.streamFinishedCallback( theAsioStream->streamRepresentation.userData ); + + if (theAsioStream->streamRepresentation.streamFinishedCallback != 0) + theAsioStream->streamRepresentation.streamFinishedCallback (theAsioStream->streamRepresentation.userData); + theAsioStream->streamFinishedCallbackCalled = true; - SetEvent( theAsioStream->completedBuffersPlayedEvent ); + + SetEvent (theAsioStream->completedBuffersPlayedEvent); + theAsioStream->zeroOutput = true; - } - else /* paComplete or other non-zero value indicating complete */ - { + } else { /* paComplete or other non-zero value indicating complete */ /* Finish playback once currently queued audio has completed. */ theAsioStream->stopProcessing = true; - if( PaUtil_IsBufferProcessorOutputEmpty( &theAsioStream->bufferProcessor ) ) - { + if (PaUtil_IsBufferProcessorOutputEmpty (&theAsioStream->bufferProcessor)) { theAsioStream->zeroOutput = true; theAsioStream->stopPlayoutCount = 0; } } } } - + ++buffersDone; - }while( PaAsio_AtomicDecrement(&theAsioStream->reenterCount) >= 0 ); + } while (PaAsio_AtomicDecrement (&theAsioStream->reenterCount) >= 0); return 0L; } -static void sampleRateChanged(ASIOSampleRate sRate) +static void sampleRateChanged (ASIOSampleRate sRate) { // TAKEN FROM THE ASIO SDK // do whatever you need to do if the sample rate changed @@ -2987,10 +3117,10 @@ static void sampleRateChanged(ASIOSampleRate sRate) // You might have to update time/sample related conversion routines, etc. (void) sRate; /* unused parameter */ - PA_DEBUG( ("sampleRateChanged : %d \n", sRate)); + PA_DEBUG ( ("sampleRateChanged : %d \n", sRate)); } -static long asioMessages(long selector, long value, void* message, double* opt) +static long asioMessages (long selector, long value, void* message, double* opt) { // TAKEN FROM THE ASIO SDK // currently the parameters "value", "message" and "opt" are not used. @@ -2999,20 +3129,22 @@ static long asioMessages(long selector, long value, void* message, double* opt) (void) message; /* unused parameters */ (void) opt; - PA_DEBUG( ("asioMessages : %d , %d \n", selector, value)); + PA_DEBUG ( ("asioMessages : %d , %d \n", selector, value)); + + switch (selector) { - switch(selector) - { case kAsioSelectorSupported: - if(value == kAsioResetRequest - || value == kAsioEngineVersion - || value == kAsioResyncRequest - || value == kAsioLatenciesChanged - // the following three were added for ASIO 2.0, you don't necessarily have to support them - || value == kAsioSupportsTimeInfo - || value == kAsioSupportsTimeCode - || value == kAsioSupportsInputMonitor) - ret = 1L; + + if (value == kAsioResetRequest + || value == kAsioEngineVersion + || value == kAsioResyncRequest + || value == kAsioLatenciesChanged + // the following three were added for ASIO 2.0, you don't necessarily have to support them + || value == kAsioSupportsTimeInfo + || value == kAsioSupportsTimeCode + || value == kAsioSupportsInputMonitor) + ret = 1L; + break; case kAsioBufferSizeChange: @@ -3028,6 +3160,7 @@ static long asioMessages(long selector, long value, void* message, double* opt) /*FIXME: commented the next line out */ //asioDriverInfo.stopped; // In this sample the processing will just stop ret = 1L; + break; case kAsioResyncRequest: @@ -3038,6 +3171,7 @@ static long asioMessages(long selector, long value, void* message, double* opt) // by another thread. // However a driver can issue it in other situations, too. ret = 1L; + break; case kAsioLatenciesChanged: @@ -3045,6 +3179,7 @@ static long asioMessages(long selector, long value, void* message, double* opt) // Beware, it this does not mean that the buffer sizes have changed! // You might need to update internal delay data. ret = 1L; + //printf("kAsioLatenciesChanged \n"); break; @@ -3053,6 +3188,7 @@ static long asioMessages(long selector, long value, void* message, double* opt) // If a host applications does not implement this selector, ASIO 1.0 is assumed // by the driver ret = 2L; + break; case kAsioSupportsTimeInfo: @@ -3061,6 +3197,7 @@ static long asioMessages(long selector, long value, void* message, double* opt) // For compatibility with ASIO 1.0 drivers the host application should always support // the "old" bufferSwitch method, too. ret = 1; + break; case kAsioSupportsTimeCode: @@ -3068,26 +3205,28 @@ static long asioMessages(long selector, long value, void* message, double* opt) // If an application does not need to know about time code, the driver has less work // to do. ret = 0; + break; } + return ret; } -static PaError StartStream( PaStream *s ) +static PaError StartStream (PaStream *s) { PaError result = paNoError; - PaAsioStream *stream = (PaAsioStream*)s; + PaAsioStream *stream = (PaAsioStream*) s; PaAsioStreamBlockingState *blockingState = stream->blockingState; ASIOError asioError; - if( stream->outputChannelCount > 0 ) - { - ZeroOutputBuffers( stream, 0 ); - ZeroOutputBuffers( stream, 1 ); + if (stream->outputChannelCount > 0) { + ZeroOutputBuffers (stream, 0); + ZeroOutputBuffers (stream, 1); } - PaUtil_ResetBufferProcessor( &stream->bufferProcessor ); + PaUtil_ResetBufferProcessor (&stream->bufferProcessor); + stream->stopProcessing = false; stream->zeroOutput = false; @@ -3097,77 +3236,77 @@ static PaError StartStream( PaStream *s ) stream->callbackFlags = 0; - if( ResetEvent( stream->completedBuffersPlayedEvent ) == 0 ) - { + if (ResetEvent (stream->completedBuffersPlayedEvent) == 0) { result = paUnanticipatedHostError; - PA_ASIO_SET_LAST_SYSTEM_ERROR( GetLastError() ); + PA_ASIO_SET_LAST_SYSTEM_ERROR (GetLastError()); } /* Using blocking i/o interface... */ - if( blockingState ) - { + if (blockingState) { /* Reset blocking i/o buffer processor. */ - PaUtil_ResetBufferProcessor( &blockingState->bufferProcessor ); + PaUtil_ResetBufferProcessor (&blockingState->bufferProcessor); /* If we're about to process some input data. */ - if( stream->inputChannelCount ) - { + + if (stream->inputChannelCount) { /* Reset callback-ReadStream sync event. */ - if( ResetEvent( blockingState->readFramesReadyEvent ) == 0 ) - { + if (ResetEvent (blockingState->readFramesReadyEvent) == 0) { result = paUnanticipatedHostError; - PA_ASIO_SET_LAST_SYSTEM_ERROR( GetLastError() ); + PA_ASIO_SET_LAST_SYSTEM_ERROR (GetLastError()); } /* Flush blocking i/o ring buffer. */ - PaUtil_FlushRingBuffer( &blockingState->readRingBuffer ); - (*blockingState->bufferProcessor.inputZeroer)( blockingState->readRingBuffer.buffer, 1, blockingState->bufferProcessor.inputChannelCount * blockingState->readRingBuffer.bufferSize ); + PaUtil_FlushRingBuffer (&blockingState->readRingBuffer); + + (*blockingState->bufferProcessor.inputZeroer) (blockingState->readRingBuffer.buffer, 1, blockingState->bufferProcessor.inputChannelCount * blockingState->readRingBuffer.bufferSize); } /* If we're about to process some output data. */ - if( stream->outputChannelCount ) - { + if (stream->outputChannelCount) { /* Reset callback-WriteStream sync event. */ - if( ResetEvent( blockingState->writeBuffersReadyEvent ) == 0 ) - { + if (ResetEvent (blockingState->writeBuffersReadyEvent) == 0) { result = paUnanticipatedHostError; - PA_ASIO_SET_LAST_SYSTEM_ERROR( GetLastError() ); + PA_ASIO_SET_LAST_SYSTEM_ERROR (GetLastError()); } /* Flush blocking i/o ring buffer. */ - PaUtil_FlushRingBuffer( &blockingState->writeRingBuffer ); - (*blockingState->bufferProcessor.outputZeroer)( blockingState->writeRingBuffer.buffer, 1, blockingState->bufferProcessor.outputChannelCount * blockingState->writeRingBuffer.bufferSize ); + PaUtil_FlushRingBuffer (&blockingState->writeRingBuffer); + + (*blockingState->bufferProcessor.outputZeroer) (blockingState->writeRingBuffer.buffer, 1, blockingState->bufferProcessor.outputChannelCount * blockingState->writeRingBuffer.bufferSize); /* Initialize the output ring buffer to "silence". */ - PaUtil_AdvanceRingBufferWriteIndex( &blockingState->writeRingBuffer, blockingState->writeRingBufferInitialFrames ); + PaUtil_AdvanceRingBufferWriteIndex (&blockingState->writeRingBuffer, blockingState->writeRingBufferInitialFrames); } /* Clear requested frames / buffers count. */ blockingState->writeBuffersRequested = 0; + blockingState->readFramesRequested = 0; + blockingState->writeBuffersRequestedFlag = FALSE; + blockingState->readFramesRequestedFlag = FALSE; + blockingState->outputUnderflowFlag = FALSE; + blockingState->inputOverflowFlag = FALSE; + blockingState->stopFlag = FALSE; } - if( result == paNoError ) - { + if (result == paNoError) { theAsioStream = stream; asioError = ASIOStart(); - if( asioError == ASE_OK ) - { + + if (asioError == ASE_OK) { stream->isActive = 1; stream->streamFinishedCallbackCalled = false; - } - else - { + } else { theAsioStream = 0; result = paUnanticipatedHostError; - PA_ASIO_SET_LAST_ASIO_ERROR( asioError ); + PA_ASIO_SET_LAST_ASIO_ERROR (asioError); } } @@ -3175,18 +3314,16 @@ static PaError StartStream( PaStream *s ) } -static PaError StopStream( PaStream *s ) +static PaError StopStream (PaStream *s) { PaError result = paNoError; - PaAsioStream *stream = (PaAsioStream*)s; + PaAsioStream *stream = (PaAsioStream*) s; PaAsioStreamBlockingState *blockingState = stream->blockingState; ASIOError asioError; - if( stream->isActive ) - { + if (stream->isActive) { /* If blocking i/o output is in use */ - if( blockingState && stream->outputChannelCount ) - { + if (blockingState && stream->outputChannelCount) { /* Request the whole output buffer to be available. */ blockingState->writeBuffersRequested = blockingState->writeRingBuffer.bufferSize; /* Signalize that additional buffers are need. */ @@ -3197,20 +3334,18 @@ static PaError StopStream( PaStream *s ) /* Wait until requested number of buffers has been freed. Time out after twice the blocking i/o ouput buffer could have been consumed. */ - DWORD timeout = (DWORD)( 2 * blockingState->writeRingBuffer.bufferSize * 1000 - / stream->streamRepresentation.streamInfo.sampleRate ); - DWORD waitResult = WaitForSingleObject( blockingState->writeBuffersReadyEvent, timeout ); + DWORD timeout = (DWORD) (2 * blockingState->writeRingBuffer.bufferSize * 1000 + / stream->streamRepresentation.streamInfo.sampleRate); + DWORD waitResult = WaitForSingleObject (blockingState->writeBuffersReadyEvent, timeout); /* If something seriously went wrong... */ - if( waitResult == WAIT_FAILED ) - { - PA_DEBUG(("WaitForSingleObject() failed in StopStream()\n")); + + if (waitResult == WAIT_FAILED) { + PA_DEBUG ( ("WaitForSingleObject() failed in StopStream()\n")); result = paUnanticipatedHostError; - PA_ASIO_SET_LAST_SYSTEM_ERROR( GetLastError() ); - } - else if( waitResult == WAIT_TIMEOUT ) - { - PA_DEBUG(("WaitForSingleObject() timed out in StopStream()\n")); + PA_ASIO_SET_LAST_SYSTEM_ERROR (GetLastError()); + } else if (waitResult == WAIT_TIMEOUT) { + PA_DEBUG ( ("WaitForSingleObject() timed out in StopStream()\n")); result = paTimedOut; } } @@ -3224,57 +3359,55 @@ static PaError StopStream( PaStream *s ) length is longer than the asio buffer size then that should be taken into account. */ - if( WaitForSingleObject( theAsioStream->completedBuffersPlayedEvent, - (DWORD)(stream->streamRepresentation.streamInfo.outputLatency * 1000. * 4.) ) - == WAIT_TIMEOUT ) - { - PA_DEBUG(("WaitForSingleObject() timed out in StopStream()\n" )); + + if (WaitForSingleObject (theAsioStream->completedBuffersPlayedEvent, + (DWORD) (stream->streamRepresentation.streamInfo.outputLatency * 1000. * 4.)) + == WAIT_TIMEOUT) { + PA_DEBUG ( ("WaitForSingleObject() timed out in StopStream()\n")); } } asioError = ASIOStop(); - if( asioError != ASE_OK ) - { + + if (asioError != ASE_OK) { result = paUnanticipatedHostError; - PA_ASIO_SET_LAST_ASIO_ERROR( asioError ); + PA_ASIO_SET_LAST_ASIO_ERROR (asioError); } theAsioStream = 0; + stream->isActive = 0; - if( !stream->streamFinishedCallbackCalled ) - { - if( stream->streamRepresentation.streamFinishedCallback != 0 ) - stream->streamRepresentation.streamFinishedCallback( stream->streamRepresentation.userData ); + if (!stream->streamFinishedCallbackCalled) { + if (stream->streamRepresentation.streamFinishedCallback != 0) + stream->streamRepresentation.streamFinishedCallback (stream->streamRepresentation.userData); } return result; } -static PaError AbortStream( PaStream *s ) +static PaError AbortStream (PaStream *s) { PaError result = paNoError; - PaAsioStream *stream = (PaAsioStream*)s; + PaAsioStream *stream = (PaAsioStream*) s; ASIOError asioError; stream->zeroOutput = true; asioError = ASIOStop(); - if( asioError != ASE_OK ) - { + + if (asioError != ASE_OK) { result = paUnanticipatedHostError; - PA_ASIO_SET_LAST_ASIO_ERROR( asioError ); - } - else - { + PA_ASIO_SET_LAST_ASIO_ERROR (asioError); + } else { // make sure that the callback is not still in-flight when ASIOStop() // returns. This has been observed to happen on the Hoontech DSP24 for // example. int count = 2000; // only wait for 2 seconds, rather than hanging. - while( theAsioStream->reenterCount != -1 && count > 0 ) - { - Sleep(1); + + while (theAsioStream->reenterCount != -1 && count > 0) { + Sleep (1); --count; } } @@ -3284,21 +3417,21 @@ static PaError AbortStream( PaStream *s ) not - this is based on the fact that ASIOStop is unlikely to fail if the callback is running - it's more likely to fail because the callback is not running. */ - + theAsioStream = 0; + stream->isActive = 0; - if( !stream->streamFinishedCallbackCalled ) - { - if( stream->streamRepresentation.streamFinishedCallback != 0 ) - stream->streamRepresentation.streamFinishedCallback( stream->streamRepresentation.userData ); + if (!stream->streamFinishedCallbackCalled) { + if (stream->streamRepresentation.streamFinishedCallback != 0) + stream->streamRepresentation.streamFinishedCallback (stream->streamRepresentation.userData); } return result; } -static PaError IsStreamStopped( PaStream *s ) +static PaError IsStreamStopped (PaStream *s) { //PaAsioStream *stream = (PaAsioStream*)s; (void) s; /* unused parameter */ @@ -3306,26 +3439,26 @@ static PaError IsStreamStopped( PaStream *s ) } -static PaError IsStreamActive( PaStream *s ) +static PaError IsStreamActive (PaStream *s) { - PaAsioStream *stream = (PaAsioStream*)s; + PaAsioStream *stream = (PaAsioStream*) s; return stream->isActive; } -static PaTime GetStreamTime( PaStream *s ) +static PaTime GetStreamTime (PaStream *s) { (void) s; /* unused parameter */ - return (double)timeGetTime() * .001; + return (double) timeGetTime() * .001; } -static double GetStreamCpuLoad( PaStream* s ) +static double GetStreamCpuLoad (PaStream* s) { - PaAsioStream *stream = (PaAsioStream*)s; + PaAsioStream *stream = (PaAsioStream*) s; - return PaUtil_GetCpuLoad( &stream->cpuLoadMeasurer ); + return PaUtil_GetCpuLoad (&stream->cpuLoadMeasurer); } @@ -3335,12 +3468,12 @@ static double GetStreamCpuLoad( PaStream* s ) for blocking streams. */ -static PaError ReadStream( PaStream *s , +static PaError ReadStream (PaStream *s , void *buffer, - unsigned long frames ) + unsigned long frames) { PaError result = paNoError; /* Initial return value. */ - PaAsioStream *stream = (PaAsioStream*)s; /* The PA ASIO stream. */ + PaAsioStream *stream = (PaAsioStream*) s; /* The PA ASIO stream. */ /* Pointer to the blocking i/o data struct. */ PaAsioStreamBlockingState *blockingState = stream->blockingState; @@ -3369,45 +3502,44 @@ static PaError ReadStream( PaStream *s , unsigned int i; /* Just a counter. */ /* About the time, needed to process 8 data blocks. */ - DWORD timeout = (DWORD)( 8 * lFramesPerBlock * 1000 / stream->streamRepresentation.streamInfo.sampleRate ); + DWORD timeout = (DWORD) (8 * lFramesPerBlock * 1000 / stream->streamRepresentation.streamInfo.sampleRate); DWORD waitResult = 0; /* Check if the stream is still available ready to gather new data. */ - if( blockingState->stopFlag || !stream->isActive ) - { - PA_DEBUG(("Warning! Stream no longer available for reading in ReadStream()\n")); + + if (blockingState->stopFlag || !stream->isActive) { + PA_DEBUG ( ("Warning! Stream no longer available for reading in ReadStream()\n")); result = paStreamIsStopped; return result; } /* If the stream is a input stream. */ - if( stream->inputChannelCount ) - { + if (stream->inputChannelCount) { /* Prepare buffer access. */ - if( !pBp->userOutputIsInterleaved ) - { + if (!pBp->userOutputIsInterleaved) { userBuffer = blockingState->readStreamBuffer; - for( i = 0; i<pBp->inputChannelCount; ++i ) - { - ((void**)userBuffer)[i] = ((void**)buffer)[i]; + + for (i = 0; i<pBp->inputChannelCount; ++i) { + ( (void**) userBuffer) [i] = ( (void**) buffer) [i]; } } /* Use the unchanged buffer. */ - else { userBuffer = buffer; } + else { + userBuffer = buffer; + } - do /* Internal block processing for too large user data buffers. */ - { + do { /* Internal block processing for too large user data buffers. */ /* Get the size of the current data block to be processed. */ - lFramesPerBlock =(lFramesPerBlock < lFramesRemaining) - ? lFramesPerBlock : lFramesRemaining; + lFramesPerBlock = (lFramesPerBlock < lFramesRemaining) + ? lFramesPerBlock : lFramesRemaining; /* Use predefined block size for as long there are enough buffers available, thereafter reduce the processing block size to match the number of remaining buffers. So the final data block is processed although it may be incomplete. */ /* If the available amount of data frames is insufficient. */ - if( PaUtil_GetRingBufferReadAvailable(pRb) < (long) lFramesPerBlock ) - { + + if (PaUtil_GetRingBufferReadAvailable (pRb) < (long) lFramesPerBlock) { /* Make sure, the event isn't already set! */ /* ResetEvent( blockingState->readFramesReadyEvent ); */ @@ -3418,30 +3550,33 @@ static PaError ReadStream( PaStream *s , blockingState->readFramesRequestedFlag = TRUE; /* Wait until requested number of buffers has been freed. */ - waitResult = WaitForSingleObject( blockingState->readFramesReadyEvent, timeout ); + waitResult = WaitForSingleObject (blockingState->readFramesReadyEvent, timeout); /* If something seriously went wrong... */ - if( waitResult == WAIT_FAILED ) - { - PA_DEBUG(("WaitForSingleObject() failed in ReadStream()\n")); + + if (waitResult == WAIT_FAILED) { + PA_DEBUG ( ("WaitForSingleObject() failed in ReadStream()\n")); result = paUnanticipatedHostError; - PA_ASIO_SET_LAST_SYSTEM_ERROR( GetLastError() ); + PA_ASIO_SET_LAST_SYSTEM_ERROR (GetLastError()); return result; - } - else if( waitResult == WAIT_TIMEOUT ) - { - PA_DEBUG(("WaitForSingleObject() timed out in ReadStream()\n")); + } else if (waitResult == WAIT_TIMEOUT) { + PA_DEBUG ( ("WaitForSingleObject() timed out in ReadStream()\n")); /* If block processing has stopped, abort! */ - if( blockingState->stopFlag ) { return result = paStreamIsStopped; } + + if (blockingState->stopFlag) { + return result = paStreamIsStopped; + } /* if a timeout is encountered, continue, perhaps we should give up eventually */ continue; + /* To give up eventually, we may increase the time out period and return an error if it fails anyway. */ /* retrun result = paTimedOut; */ } } + /* Now, the ring buffer contains the required amount of data frames. (Therefor we don't need to check the return argument of @@ -3454,47 +3589,48 @@ static PaError ReadStream( PaStream *s , segment is returned. Otherwise, i.e. if the first segment is large enough, the second segment's pointer will be NULL. */ - PaUtil_GetRingBufferReadRegions(pRb , - lFramesPerBlock , - &pRingBufferData1st, - &lRingBufferSize1st, - &pRingBufferData2nd, - &lRingBufferSize2nd); + PaUtil_GetRingBufferReadRegions (pRb , + lFramesPerBlock , + &pRingBufferData1st, + &lRingBufferSize1st, + &pRingBufferData2nd, + &lRingBufferSize2nd); /* Set number of frames to be copied from the ring buffer. */ - PaUtil_SetInputFrameCount( pBp, lRingBufferSize1st ); + PaUtil_SetInputFrameCount (pBp, lRingBufferSize1st); + /* Setup ring buffer access. */ - PaUtil_SetInterleavedInputChannels(pBp , /* Buffer processor. */ - 0 , /* The first channel's index. */ - pRingBufferData1st, /* First ring buffer segment. */ - 0 ); /* Use all available channels. */ + PaUtil_SetInterleavedInputChannels (pBp , /* Buffer processor. */ + 0 , /* The first channel's index. */ + pRingBufferData1st, /* First ring buffer segment. */ + 0); /* Use all available channels. */ /* If a second ring buffer segment is required. */ - if( lRingBufferSize2nd ) { + if (lRingBufferSize2nd) { /* Set number of frames to be copied from the ring buffer. */ - PaUtil_Set2ndInputFrameCount( pBp, lRingBufferSize2nd ); + PaUtil_Set2ndInputFrameCount (pBp, lRingBufferSize2nd); /* Setup ring buffer access. */ - PaUtil_Set2ndInterleavedInputChannels(pBp , /* Buffer processor. */ - 0 , /* The first channel's index. */ - pRingBufferData2nd, /* Second ring buffer segment. */ - 0 ); /* Use all available channels. */ + PaUtil_Set2ndInterleavedInputChannels (pBp , /* Buffer processor. */ + 0 , /* The first channel's index. */ + pRingBufferData2nd, /* Second ring buffer segment. */ + 0); /* Use all available channels. */ } /* Let the buffer processor handle "copy and conversion" and update the ring buffer indices manually. */ - lFramesCopied = PaUtil_CopyInput( pBp, &buffer, lFramesPerBlock ); - PaUtil_AdvanceRingBufferReadIndex( pRb, lFramesCopied ); + lFramesCopied = PaUtil_CopyInput (pBp, &buffer, lFramesPerBlock); + + PaUtil_AdvanceRingBufferReadIndex (pRb, lFramesCopied); /* Decrease number of unprocessed frames. */ lFramesRemaining -= lFramesCopied; } /* Continue with the next data chunk. */ - while( lFramesRemaining ); + while (lFramesRemaining); /* If there has been an input overflow within the callback */ - if( blockingState->inputOverflowFlag ) - { + if (blockingState->inputOverflowFlag) { blockingState->inputOverflowFlag = FALSE; /* Return the corresponding error code. */ @@ -3509,12 +3645,12 @@ static PaError ReadStream( PaStream *s , return result; } -static PaError WriteStream( PaStream *s , +static PaError WriteStream (PaStream *s , const void *buffer, - unsigned long frames ) + unsigned long frames) { PaError result = paNoError; /* Initial return value. */ - PaAsioStream *stream = (PaAsioStream*)s; /* The PA ASIO stream. */ + PaAsioStream *stream = (PaAsioStream*) s; /* The PA ASIO stream. */ /* Pointer to the blocking i/o data struct. */ PaAsioStreamBlockingState *blockingState = stream->blockingState; @@ -3539,7 +3675,7 @@ static PaError WriteStream( PaStream *s , unsigned long lFramesRemaining = frames; /* About the time, needed to process 8 data blocks. */ - DWORD timeout = (DWORD)( 8 * lFramesPerBlock * 1000 / stream->streamRepresentation.streamInfo.sampleRate ); + DWORD timeout = (DWORD) (8 * lFramesPerBlock * 1000 / stream->streamRepresentation.streamInfo.sampleRate); DWORD waitResult = 0; /* Copy the input argument to avoid pointer increment! */ @@ -3548,41 +3684,40 @@ static PaError WriteStream( PaStream *s , /* Check if the stream ist still available ready to recieve new data. */ - if( blockingState->stopFlag || !stream->isActive ) - { - PA_DEBUG(("Warning! Stream no longer available for writing in WriteStream()\n")); + + if (blockingState->stopFlag || !stream->isActive) { + PA_DEBUG ( ("Warning! Stream no longer available for writing in WriteStream()\n")); result = paStreamIsStopped; return result; } /* If the stream is a output stream. */ - if( stream->outputChannelCount ) - { + if (stream->outputChannelCount) { /* Prepare buffer access. */ - if( !pBp->userOutputIsInterleaved ) - { + if (!pBp->userOutputIsInterleaved) { userBuffer = blockingState->writeStreamBuffer; - for( i = 0; i<pBp->outputChannelCount; ++i ) - { - ((const void**)userBuffer)[i] = ((const void**)buffer)[i]; + + for (i = 0; i<pBp->outputChannelCount; ++i) { + ( (const void**) userBuffer) [i] = ( (const void**) buffer) [i]; } } /* Use the unchanged buffer. */ - else { userBuffer = buffer; } + else { + userBuffer = buffer; + } - do /* Internal block processing for too large user data buffers. */ - { + do { /* Internal block processing for too large user data buffers. */ /* Get the size of the current data block to be processed. */ - lFramesPerBlock =(lFramesPerBlock < lFramesRemaining) - ? lFramesPerBlock : lFramesRemaining; + lFramesPerBlock = (lFramesPerBlock < lFramesRemaining) + ? lFramesPerBlock : lFramesRemaining; /* Use predefined block size for as long there are enough frames available, thereafter reduce the processing block size to match the number of remaining frames. So the final data block is processed although it may be incomplete. */ /* If the available amount of buffers is insufficient. */ - if( PaUtil_GetRingBufferWriteAvailable(pRb) < (long) lFramesPerBlock ) - { + + if (PaUtil_GetRingBufferWriteAvailable (pRb) < (long) lFramesPerBlock) { /* Make sure, the event isn't already set! */ /* ResetEvent( blockingState->writeBuffersReadyEvent ); */ @@ -3593,29 +3728,33 @@ static PaError WriteStream( PaStream *s , blockingState->writeBuffersRequestedFlag = TRUE; /* Wait until requested number of buffers has been freed. */ - waitResult = WaitForSingleObject( blockingState->writeBuffersReadyEvent, timeout ); + waitResult = WaitForSingleObject (blockingState->writeBuffersReadyEvent, timeout); /* If something seriously went wrong... */ - if( waitResult == WAIT_FAILED ) - { - PA_DEBUG(("WaitForSingleObject() failed in WriteStream()\n")); + + if (waitResult == WAIT_FAILED) { + PA_DEBUG ( ("WaitForSingleObject() failed in WriteStream()\n")); result = paUnanticipatedHostError; - PA_ASIO_SET_LAST_SYSTEM_ERROR( GetLastError() ); + PA_ASIO_SET_LAST_SYSTEM_ERROR (GetLastError()); return result; - } - else if( waitResult == WAIT_TIMEOUT ) - { - PA_DEBUG(("WaitForSingleObject() timed out in WriteStream()\n")); + } else if (waitResult == WAIT_TIMEOUT) { + PA_DEBUG ( ("WaitForSingleObject() timed out in WriteStream()\n")); /* If block processing has stopped, abort! */ - if( blockingState->stopFlag ) { return result = paStreamIsStopped; } + + if (blockingState->stopFlag) { + return result = paStreamIsStopped; + } + /* if a timeout is encountered, continue, perhaps we should give up eventually */ continue; + /* To give up eventually, we may increase the time out period and return an error if it fails anyway. */ /* retrun result = paTimedOut; */ } } + /* Now, the ring buffer contains the required amount of free space to store the provided number of data frames. (Therefor we don't need to check the return argument of @@ -3628,47 +3767,48 @@ static PaError WriteStream( PaStream *s , segment is returned. Otherwise, i.e. if the first segment is large enough, the second segment's pointer will be NULL. */ - PaUtil_GetRingBufferWriteRegions(pRb , - lFramesPerBlock , - &pRingBufferData1st, - &lRingBufferSize1st, - &pRingBufferData2nd, - &lRingBufferSize2nd); + PaUtil_GetRingBufferWriteRegions (pRb , + lFramesPerBlock , + &pRingBufferData1st, + &lRingBufferSize1st, + &pRingBufferData2nd, + &lRingBufferSize2nd); /* Set number of frames to be copied to the ring buffer. */ - PaUtil_SetOutputFrameCount( pBp, lRingBufferSize1st ); + PaUtil_SetOutputFrameCount (pBp, lRingBufferSize1st); + /* Setup ring buffer access. */ - PaUtil_SetInterleavedOutputChannels(pBp , /* Buffer processor. */ - 0 , /* The first channel's index. */ - pRingBufferData1st, /* First ring buffer segment. */ - 0 ); /* Use all available channels. */ + PaUtil_SetInterleavedOutputChannels (pBp , /* Buffer processor. */ + 0 , /* The first channel's index. */ + pRingBufferData1st, /* First ring buffer segment. */ + 0); /* Use all available channels. */ /* If a second ring buffer segment is required. */ - if( lRingBufferSize2nd ) { + if (lRingBufferSize2nd) { /* Set number of frames to be copied to the ring buffer. */ - PaUtil_Set2ndOutputFrameCount( pBp, lRingBufferSize2nd ); + PaUtil_Set2ndOutputFrameCount (pBp, lRingBufferSize2nd); /* Setup ring buffer access. */ - PaUtil_Set2ndInterleavedOutputChannels(pBp , /* Buffer processor. */ - 0 , /* The first channel's index. */ - pRingBufferData2nd, /* Second ring buffer segment. */ - 0 ); /* Use all available channels. */ + PaUtil_Set2ndInterleavedOutputChannels (pBp , /* Buffer processor. */ + 0 , /* The first channel's index. */ + pRingBufferData2nd, /* Second ring buffer segment. */ + 0); /* Use all available channels. */ } /* Let the buffer processor handle "copy and conversion" and update the ring buffer indices manually. */ - lFramesCopied = PaUtil_CopyOutput( pBp, &userBuffer, lFramesPerBlock ); - PaUtil_AdvanceRingBufferWriteIndex( pRb, lFramesCopied ); + lFramesCopied = PaUtil_CopyOutput (pBp, &userBuffer, lFramesPerBlock); + + PaUtil_AdvanceRingBufferWriteIndex (pRb, lFramesCopied); /* Decrease number of unprocessed frames. */ lFramesRemaining -= lFramesCopied; } /* Continue with the next data chunk. */ - while( lFramesRemaining ); + while (lFramesRemaining); /* If there has been an output underflow within the callback */ - if( blockingState->outputUnderflowFlag ) - { + if (blockingState->outputUnderflowFlag) { blockingState->outputUnderflowFlag = FALSE; /* Return the corresponding error code. */ @@ -3676,8 +3816,7 @@ static PaError WriteStream( PaStream *s , } } /* If this is not an output stream. */ - else - { + else { result = paCanNotWriteToAnInputOnlyStream; } @@ -3685,25 +3824,25 @@ static PaError WriteStream( PaStream *s , } -static signed long GetStreamReadAvailable( PaStream* s ) +static signed long GetStreamReadAvailable (PaStream* s) { - PaAsioStream *stream = (PaAsioStream*)s; + PaAsioStream *stream = (PaAsioStream*) s; /* Call buffer utility routine to get the number of available frames. */ - return PaUtil_GetRingBufferReadAvailable( &stream->blockingState->readRingBuffer ); + return PaUtil_GetRingBufferReadAvailable (&stream->blockingState->readRingBuffer); } -static signed long GetStreamWriteAvailable( PaStream* s ) +static signed long GetStreamWriteAvailable (PaStream* s) { - PaAsioStream *stream = (PaAsioStream*)s; + PaAsioStream *stream = (PaAsioStream*) s; /* Call buffer utility routine to get the number of empty buffers. */ - return PaUtil_GetRingBufferWriteAvailable( &stream->blockingState->writeRingBuffer ); + return PaUtil_GetRingBufferWriteAvailable (&stream->blockingState->writeRingBuffer); } -PaError PaAsio_ShowControlPanel( PaDeviceIndex device, void* systemSpecific ) +PaError PaAsio_ShowControlPanel (PaDeviceIndex device, void* systemSpecific) { PaError result = paNoError; PaUtilHostApiRepresentation *hostApi; @@ -3715,12 +3854,14 @@ PaError PaAsio_ShowControlPanel( PaDeviceIndex device, void* systemSpecific ) PaAsioDeviceInfo *asioDeviceInfo; - result = PaUtil_GetHostApiRepresentation( &hostApi, paASIO ); - if( result != paNoError ) + result = PaUtil_GetHostApiRepresentation (&hostApi, paASIO); + + if (result != paNoError) goto error; - result = PaUtil_DeviceIndexToHostApiDeviceIndex( &hostApiDevice, device, hostApi ); - if( result != paNoError ) + result = PaUtil_DeviceIndexToHostApiDeviceIndex (&hostApiDevice, device, hostApi); + + if (result != paNoError) goto error; /* @@ -3731,84 +3872,87 @@ PaError PaAsio_ShowControlPanel( PaDeviceIndex device, void* systemSpecific ) done safely while a stream is open. */ - asioHostApi = (PaAsioHostApiRepresentation*)hostApi; - if( asioHostApi->openAsioDeviceIndex != paNoDevice ) - { + asioHostApi = (PaAsioHostApiRepresentation*) hostApi; + + if (asioHostApi->openAsioDeviceIndex != paNoDevice) { result = paDeviceUnavailable; goto error; } - asioDeviceInfo = (PaAsioDeviceInfo*)hostApi->deviceInfos[hostApiDevice]; + asioDeviceInfo = (PaAsioDeviceInfo*) hostApi->deviceInfos[hostApiDevice]; /* See notes about CoInitialize(0) in LoadAsioDriver(). */ - CoInitialize(0); + CoInitialize (0); - if( !asioHostApi->asioDrivers->loadDriver( const_cast<char*>(asioDeviceInfo->commonDeviceInfo.name) ) ) - { + if (!asioHostApi->asioDrivers->loadDriver (const_cast<char*> (asioDeviceInfo->commonDeviceInfo.name))) { result = paUnanticipatedHostError; goto error; } /* CRUCIAL!!! */ - memset( &asioDriverInfo, 0, sizeof(ASIODriverInfo) ); + memset (&asioDriverInfo, 0, sizeof (ASIODriverInfo)); + asioDriverInfo.asioVersion = 2; + asioDriverInfo.sysRef = systemSpecific; - asioError = ASIOInit( &asioDriverInfo ); - if( asioError != ASE_OK ) - { + + asioError = ASIOInit (&asioDriverInfo); + + if (asioError != ASE_OK) { result = paUnanticipatedHostError; - PA_ASIO_SET_LAST_ASIO_ERROR( asioError ); + PA_ASIO_SET_LAST_ASIO_ERROR (asioError); goto error; - } - else - { + } else { asioIsInitialized = 1; } -PA_DEBUG(("PaAsio_ShowControlPanel: ASIOInit(): %s\n", PaAsio_GetAsioErrorText(asioError) )); -PA_DEBUG(("asioVersion: ASIOInit(): %ld\n", asioDriverInfo.asioVersion )); -PA_DEBUG(("driverVersion: ASIOInit(): %ld\n", asioDriverInfo.driverVersion )); -PA_DEBUG(("Name: ASIOInit(): %s\n", asioDriverInfo.name )); -PA_DEBUG(("ErrorMessage: ASIOInit(): %s\n", asioDriverInfo.errorMessage )); + PA_DEBUG ( ("PaAsio_ShowControlPanel: ASIOInit(): %s\n", PaAsio_GetAsioErrorText (asioError))); + + PA_DEBUG ( ("asioVersion: ASIOInit(): %ld\n", asioDriverInfo.asioVersion)); + PA_DEBUG ( ("driverVersion: ASIOInit(): %ld\n", asioDriverInfo.driverVersion)); + PA_DEBUG ( ("Name: ASIOInit(): %s\n", asioDriverInfo.name)); + PA_DEBUG ( ("ErrorMessage: ASIOInit(): %s\n", asioDriverInfo.errorMessage)); asioError = ASIOControlPanel(); - if( asioError != ASE_OK ) - { - PA_DEBUG(("PaAsio_ShowControlPanel: ASIOControlPanel(): %s\n", PaAsio_GetAsioErrorText(asioError) )); + + if (asioError != ASE_OK) { + PA_DEBUG ( ("PaAsio_ShowControlPanel: ASIOControlPanel(): %s\n", PaAsio_GetAsioErrorText (asioError))); result = paUnanticipatedHostError; - PA_ASIO_SET_LAST_ASIO_ERROR( asioError ); + PA_ASIO_SET_LAST_ASIO_ERROR (asioError); goto error; } -PA_DEBUG(("PaAsio_ShowControlPanel: ASIOControlPanel(): %s\n", PaAsio_GetAsioErrorText(asioError) )); + PA_DEBUG ( ("PaAsio_ShowControlPanel: ASIOControlPanel(): %s\n", PaAsio_GetAsioErrorText (asioError))); asioError = ASIOExit(); - if( asioError != ASE_OK ) - { + + if (asioError != ASE_OK) { result = paUnanticipatedHostError; - PA_ASIO_SET_LAST_ASIO_ERROR( asioError ); + PA_ASIO_SET_LAST_ASIO_ERROR (asioError); asioIsInitialized = 0; goto error; } - CoUninitialize(); -PA_DEBUG(("PaAsio_ShowControlPanel: ASIOExit(): %s\n", PaAsio_GetAsioErrorText(asioError) )); + CoUninitialize(); + + PA_DEBUG ( ("PaAsio_ShowControlPanel: ASIOExit(): %s\n", PaAsio_GetAsioErrorText (asioError))); return result; error: - if( asioIsInitialized ) - { - ASIOExit(); - } - CoUninitialize(); + + if (asioIsInitialized) { + ASIOExit(); + } + + CoUninitialize(); return result; } -PaError PaAsio_GetInputChannelName( PaDeviceIndex device, int channelIndex, - const char** channelName ) +PaError PaAsio_GetInputChannelName (PaDeviceIndex device, int channelIndex, + const char** channelName) { PaError result = paNoError; PaUtilHostApiRepresentation *hostApi; @@ -3816,17 +3960,19 @@ PaError PaAsio_GetInputChannelName( PaDeviceIndex device, int channelIndex, PaAsioDeviceInfo *asioDeviceInfo; - result = PaUtil_GetHostApiRepresentation( &hostApi, paASIO ); - if( result != paNoError ) + result = PaUtil_GetHostApiRepresentation (&hostApi, paASIO); + + if (result != paNoError) goto error; - result = PaUtil_DeviceIndexToHostApiDeviceIndex( &hostApiDevice, device, hostApi ); - if( result != paNoError ) + result = PaUtil_DeviceIndexToHostApiDeviceIndex (&hostApiDevice, device, hostApi); + + if (result != paNoError) goto error; - asioDeviceInfo = (PaAsioDeviceInfo*)hostApi->deviceInfos[hostApiDevice]; + asioDeviceInfo = (PaAsioDeviceInfo*) hostApi->deviceInfos[hostApiDevice]; - if( channelIndex < 0 || channelIndex >= asioDeviceInfo->commonDeviceInfo.maxInputChannels ){ + if (channelIndex < 0 || channelIndex >= asioDeviceInfo->commonDeviceInfo.maxInputChannels) { result = paInvalidChannelCount; goto error; } @@ -3834,14 +3980,14 @@ PaError PaAsio_GetInputChannelName( PaDeviceIndex device, int channelIndex, *channelName = asioDeviceInfo->asioChannelInfos[channelIndex].name; return paNoError; - + error: return result; } -PaError PaAsio_GetOutputChannelName( PaDeviceIndex device, int channelIndex, - const char** channelName ) +PaError PaAsio_GetOutputChannelName (PaDeviceIndex device, int channelIndex, + const char** channelName) { PaError result = paNoError; PaUtilHostApiRepresentation *hostApi; @@ -3849,26 +3995,29 @@ PaError PaAsio_GetOutputChannelName( PaDeviceIndex device, int channelIndex, PaAsioDeviceInfo *asioDeviceInfo; - result = PaUtil_GetHostApiRepresentation( &hostApi, paASIO ); - if( result != paNoError ) + result = PaUtil_GetHostApiRepresentation (&hostApi, paASIO); + + if (result != paNoError) goto error; - result = PaUtil_DeviceIndexToHostApiDeviceIndex( &hostApiDevice, device, hostApi ); - if( result != paNoError ) + result = PaUtil_DeviceIndexToHostApiDeviceIndex (&hostApiDevice, device, hostApi); + + if (result != paNoError) goto error; - asioDeviceInfo = (PaAsioDeviceInfo*)hostApi->deviceInfos[hostApiDevice]; + asioDeviceInfo = (PaAsioDeviceInfo*) hostApi->deviceInfos[hostApiDevice]; - if( channelIndex < 0 || channelIndex >= asioDeviceInfo->commonDeviceInfo.maxOutputChannels ){ + if (channelIndex < 0 || channelIndex >= asioDeviceInfo->commonDeviceInfo.maxOutputChannels) { result = paInvalidChannelCount; goto error; } *channelName = asioDeviceInfo->asioChannelInfos[ - asioDeviceInfo->commonDeviceInfo.maxInputChannels + channelIndex].name; + + asioDeviceInfo->commonDeviceInfo.maxInputChannels + channelIndex].name; return paNoError; - + error: return result; } @@ -3884,15 +4033,15 @@ error: ** It may called at interrupt level on some machines so don't do anything ** that could mess up the system like calling malloc() or free(). */ -static int BlockingIoPaCallback(const void *inputBuffer , - void *outputBuffer , - unsigned long framesPerBuffer, - const PaStreamCallbackTimeInfo *timeInfo , - PaStreamCallbackFlags statusFlags , - void *userData ) +static int BlockingIoPaCallback (const void *inputBuffer , + void *outputBuffer , + unsigned long framesPerBuffer, + const PaStreamCallbackTimeInfo *timeInfo , + PaStreamCallbackFlags statusFlags , + void *userData) { PaError result = paNoError; /* Initial return value. */ - PaAsioStream *stream = *(PaAsioStream**)userData; /* The PA ASIO stream. */ /* This is a pointer to "theAsioStream", see OpenStream(). */ + PaAsioStream *stream = * (PaAsioStream**) userData; /* The PA ASIO stream. */ /* This is a pointer to "theAsioStream", see OpenStream(). */ PaAsioStreamBlockingState *blockingState = stream->blockingState; /* Persume blockingState is valid, otherwise the callback wouldn't be running. */ /* Get a pointer to the stream's blocking i/o buffer processor. */ @@ -3900,11 +4049,11 @@ static int BlockingIoPaCallback(const void *inputBuffer , PaUtilRingBuffer *pRb = NULL; /* If output data has been requested. */ - if( stream->outputChannelCount ) - { + + if (stream->outputChannelCount) { /* If the callback input argument signalizes a output underflow, make sure the WriteStream() function knows about it, too! */ - if( statusFlags & paOutputUnderflowed ) { + if (statusFlags & paOutputUnderflowed) { blockingState->outputUnderflowFlag = TRUE; } @@ -3912,36 +4061,32 @@ static int BlockingIoPaCallback(const void *inputBuffer , pRb = &blockingState->writeRingBuffer; /* If the blocking i/o buffer contains enough output data, */ - if( PaUtil_GetRingBufferReadAvailable(pRb) >= (long) framesPerBuffer ) - { + if (PaUtil_GetRingBufferReadAvailable (pRb) >= (long) framesPerBuffer) { /* Extract the requested data from the ring buffer. */ - PaUtil_ReadRingBuffer( pRb, outputBuffer, framesPerBuffer ); - } - else /* If no output data is available :-( */ - { + PaUtil_ReadRingBuffer (pRb, outputBuffer, framesPerBuffer); + } else { /* If no output data is available :-( */ /* Signalize a write-buffer underflow. */ blockingState->outputUnderflowFlag = TRUE; /* Fill the output buffer with silence. */ - (*pBp->outputZeroer)( outputBuffer, 1, pBp->outputChannelCount * framesPerBuffer ); + (*pBp->outputZeroer) (outputBuffer, 1, pBp->outputChannelCount * framesPerBuffer); /* If playback is to be stopped */ - if( blockingState->stopFlag && PaUtil_GetRingBufferReadAvailable(pRb) < (long) framesPerBuffer ) - { + + if (blockingState->stopFlag && PaUtil_GetRingBufferReadAvailable (pRb) < (long) framesPerBuffer) { /* Extract all the remaining data from the ring buffer, whether it is a complete data block or not. */ - PaUtil_ReadRingBuffer( pRb, outputBuffer, PaUtil_GetRingBufferReadAvailable(pRb) ); + PaUtil_ReadRingBuffer (pRb, outputBuffer, PaUtil_GetRingBufferReadAvailable (pRb)); } } /* Set blocking i/o event? */ - if( blockingState->writeBuffersRequestedFlag && PaUtil_GetRingBufferWriteAvailable(pRb) >= (long) blockingState->writeBuffersRequested ) - { + if (blockingState->writeBuffersRequestedFlag && PaUtil_GetRingBufferWriteAvailable (pRb) >= (long) blockingState->writeBuffersRequested) { /* Reset buffer request. */ blockingState->writeBuffersRequestedFlag = FALSE; blockingState->writeBuffersRequested = 0; /* Signalize that requested buffers are ready. */ - SetEvent( blockingState->writeBuffersReadyEvent ); + SetEvent (blockingState->writeBuffersReadyEvent); /* What do we do if SetEvent() returns zero, i.e. the event could not be set? How to return errors from within the callback? - S.Fischer */ @@ -3949,11 +4094,10 @@ static int BlockingIoPaCallback(const void *inputBuffer , } /* If input data has been supplied. */ - if( stream->inputChannelCount ) - { + if (stream->inputChannelCount) { /* If the callback input argument signalizes a input overflow, make sure the ReadStream() function knows about it, too! */ - if( statusFlags & paInputOverflowed ) { + if (statusFlags & paInputOverflowed) { blockingState->inputOverflowFlag = TRUE; } @@ -3961,26 +4105,24 @@ static int BlockingIoPaCallback(const void *inputBuffer , pRb = &blockingState->readRingBuffer; /* If the blocking i/o buffer contains not enough input buffers */ - if( PaUtil_GetRingBufferWriteAvailable(pRb) < (long) framesPerBuffer ) - { + if (PaUtil_GetRingBufferWriteAvailable (pRb) < (long) framesPerBuffer) { /* Signalize a read-buffer overflow. */ blockingState->inputOverflowFlag = TRUE; /* Remove some old data frames from the buffer. */ - PaUtil_AdvanceRingBufferReadIndex( pRb, framesPerBuffer ); + PaUtil_AdvanceRingBufferReadIndex (pRb, framesPerBuffer); } /* Insert the current input data into the ring buffer. */ - PaUtil_WriteRingBuffer( pRb, inputBuffer, framesPerBuffer ); + PaUtil_WriteRingBuffer (pRb, inputBuffer, framesPerBuffer); /* Set blocking i/o event? */ - if( blockingState->readFramesRequestedFlag && PaUtil_GetRingBufferReadAvailable(pRb) >= (long) blockingState->readFramesRequested ) - { + if (blockingState->readFramesRequestedFlag && PaUtil_GetRingBufferReadAvailable (pRb) >= (long) blockingState->readFramesRequested) { /* Reset buffer request. */ blockingState->readFramesRequestedFlag = FALSE; blockingState->readFramesRequested = 0; /* Signalize that requested buffers are ready. */ - SetEvent( blockingState->readFramesReadyEvent ); + SetEvent (blockingState->readFramesReadyEvent); /* What do we do if SetEvent() returns zero, i.e. the event could not be set? How to return errors from within the callback? - S.Fischer */ diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/hostapi/coreaudio/notes.txt b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/coreaudio/notes.txt similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/hostapi/coreaudio/notes.txt rename to sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/coreaudio/notes.txt diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/hostapi/coreaudio/pa_mac_core.c b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/coreaudio/pa_mac_core.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/hostapi/coreaudio/pa_mac_core.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/coreaudio/pa_mac_core.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/hostapi/coreaudio/pa_mac_core_blocking.c b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/coreaudio/pa_mac_core_blocking.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/hostapi/coreaudio/pa_mac_core_blocking.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/coreaudio/pa_mac_core_blocking.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/hostapi/coreaudio/pa_mac_core_blocking.h b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/coreaudio/pa_mac_core_blocking.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/hostapi/coreaudio/pa_mac_core_blocking.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/coreaudio/pa_mac_core_blocking.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/hostapi/coreaudio/pa_mac_core_internal.h b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/coreaudio/pa_mac_core_internal.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/hostapi/coreaudio/pa_mac_core_internal.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/coreaudio/pa_mac_core_internal.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/hostapi/coreaudio/pa_mac_core_old.c b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/coreaudio/pa_mac_core_old.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/hostapi/coreaudio/pa_mac_core_old.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/coreaudio/pa_mac_core_old.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/hostapi/coreaudio/pa_mac_core_utilities.c b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/coreaudio/pa_mac_core_utilities.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/hostapi/coreaudio/pa_mac_core_utilities.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/coreaudio/pa_mac_core_utilities.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/hostapi/coreaudio/pa_mac_core_utilities.h b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/coreaudio/pa_mac_core_utilities.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/hostapi/coreaudio/pa_mac_core_utilities.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/coreaudio/pa_mac_core_utilities.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/hostapi/dsound/pa_win_ds.c b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/dsound/pa_win_ds.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/hostapi/dsound/pa_win_ds.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/dsound/pa_win_ds.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/hostapi/dsound/pa_win_ds_dynlink.c b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/dsound/pa_win_ds_dynlink.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/hostapi/dsound/pa_win_ds_dynlink.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/dsound/pa_win_ds_dynlink.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/hostapi/dsound/pa_win_ds_dynlink.h b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/dsound/pa_win_ds_dynlink.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/hostapi/dsound/pa_win_ds_dynlink.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/dsound/pa_win_ds_dynlink.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/hostapi/jack/pa_jack.c b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/jack/pa_jack.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/hostapi/jack/pa_jack.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/jack/pa_jack.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/hostapi/oss/low_latency_tip.txt b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/oss/low_latency_tip.txt similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/hostapi/oss/low_latency_tip.txt rename to sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/oss/low_latency_tip.txt diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/hostapi/oss/pa_unix_oss.c b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/oss/pa_unix_oss.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/hostapi/oss/pa_unix_oss.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/oss/pa_unix_oss.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/hostapi/oss/recplay.c b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/oss/recplay.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/hostapi/oss/recplay.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/oss/recplay.c diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/wasapi/pa_win_wasapi.cpp b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/wasapi/pa_win_wasapi.cpp new file mode 100644 index 0000000000000000000000000000000000000000..0653b138b06b8af86dcc82464d605d4e3eac2922 --- /dev/null +++ b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/wasapi/pa_win_wasapi.cpp @@ -0,0 +1,2133 @@ +/* + * Portable Audio I/O Library WASAPI implementation + * Copyright (c) 2006-2007 David Viens + * + * Based on the Open Source API proposed by Ross Bencina + * Copyright (c) 1999-2002 Ross Bencina, Phil Burk + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files + * (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, + * and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF + * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +/* + * The text above constitutes the entire PortAudio license; however, + * the PortAudio community also makes the following non-binding requests: + * + * Any person wishing to distribute modifications to the Software is + * requested to send the modifications to the original developer so that + * they can be incorporated into the canonical version. It is also + * requested that these non-binding requests be included along with the + * license above. + */ + +/** @file + @ingroup hostapi_src + @brief WASAPI implementation of support for a host API. + + @note pa_wasapi currently requires VC 2005, and the latest Vista SDK +*/ + +#if _MSC_VER >= 1400 +#include <windows.h> +#include <MMReg.h> //must be before other Wasapi headers +#include <strsafe.h> +#include <mmdeviceapi.h> +#include <Avrt.h> +#include <audioclient.h> +#include <Endpointvolume.h> + +#include <KsMedia.h> +#include <functiondiscoverykeys.h> // PKEY_Device_FriendlyName +#endif + +#include "pa_util.h" +#include "pa_allocation.h" +#include "pa_hostapi.h" +#include "pa_stream.h" +#include "pa_cpuload.h" +#include "pa_process.h" +#include "pa_debugprint.h" + + +/* + davidv : work in progress. try using with 48000 , then 44100 + and shared mode FIRST. + */ + +#define PORTAUDIO_SHAREMODE AUDCLNT_SHAREMODE_SHARED +//#define PORTAUDIO_SHAREMODE AUDCLNT_SHAREMODE_EXCLUSIVE + + + +/* prototypes for functions declared in this file */ + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + + PaError PaWinWasapi_Initialize (PaUtilHostApiRepresentation **hostApi, PaHostApiIndex index); + +#ifdef __cplusplus +} + +#endif /* __cplusplus */ + + + + +static void Terminate (struct PaUtilHostApiRepresentation *hostApi); +static PaError IsFormatSupported (struct PaUtilHostApiRepresentation *hostApi, + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate); +static PaError OpenStream (struct PaUtilHostApiRepresentation *hostApi, + PaStream** s, + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate, + unsigned long framesPerBuffer, + PaStreamFlags streamFlags, + PaStreamCallback *streamCallback, + void *userData); +static PaError CloseStream (PaStream* stream); +static PaError StartStream (PaStream *stream); +static PaError StopStream (PaStream *stream); +static PaError AbortStream (PaStream *stream); +static PaError IsStreamStopped (PaStream *s); +static PaError IsStreamActive (PaStream *stream); +static PaTime GetStreamTime (PaStream *stream); +static double GetStreamCpuLoad (PaStream* stream); +static PaError ReadStream (PaStream* stream, void *buffer, unsigned long frames); +static PaError WriteStream (PaStream* stream, const void *buffer, unsigned long frames); +static signed long GetStreamReadAvailable (PaStream* stream); +static signed long GetStreamWriteAvailable (PaStream* stream); + + +/* IMPLEMENT ME: a macro like the following one should be used for reporting + host errors */ +#define PA_SKELETON_SET_LAST_HOST_ERROR( errorCode, errorText ) \ + PaUtil_SetLastHostErrorInfo( paInDevelopment, errorCode, errorText ) + +/* PaWinWasapiHostApiRepresentation - host api datastructure specific to this implementation */ + + + +//dummy entry point for other compilers and sdks +//currently built using RC1 SDK (5600) +#if _MSC_VER < 1400 + +PaError PaWinWasapi_Initialize (PaUtilHostApiRepresentation **hostApi, PaHostApiIndex hostApiIndex) +{ + return paNoError; +} + +#else + + + + +#define MAX_STR_LEN 512 + +/* + These are fields that can be gathered from IDevice + and IAudioDevice PRIOR to Initialize, and done in first pass + i assume that neither of these will cause the Driver to "load", + but again, who knows how they implement their stuff + */ + +typedef struct PaWinWasapiDeviceInfo { + //hmm is it wise to keep a reference until Terminate? + //TODO Check if that interface requires the driver to be loaded! + IMMDevice * device; + + //Fields filled from IDevice + //from GetId + WCHAR szDeviceID[MAX_STR_LEN]; + //from GetState + DWORD state; + + //Fields filled from IMMEndpoint'sGetDataFlow + EDataFlow flow; + + //Fields filled from IAudioDevice (_prior_ to Initialize) + //from GetDevicePeriod( + REFERENCE_TIME DefaultDevicePeriod; + REFERENCE_TIME MinimumDevicePeriod; + //from GetMixFormat + WAVEFORMATEX *MixFormat;//needs to be CoTaskMemFree'd after use! + +} PaWinWasapiDeviceInfo; + + +typedef struct { + PaUtilHostApiRepresentation inheritedHostApiRep; + PaUtilStreamInterface callbackStreamInterface; + PaUtilStreamInterface blockingStreamInterface; + + PaUtilAllocationGroup *allocations; + + /* implementation specific data goes here */ + + //in case we later need the synch + IMMDeviceEnumerator * enumerator; + + //this is the REAL number of devices, whether they are usefull to PA or not! + UINT deviceCount; + + WCHAR defaultRenderer [MAX_STR_LEN]; + WCHAR defaultCapturer [MAX_STR_LEN]; + + PaWinWasapiDeviceInfo *devInfo; +}PaWinWasapiHostApiRepresentation; + + +/* PaWinWasapiStream - a stream data structure specifically for this implementation */ + +typedef struct PaWinWasapiSubStream { + IAudioClient *client; + WAVEFORMATEXTENSIBLE wavex; + UINT32 bufferSize; + REFERENCE_TIME latency; + REFERENCE_TIME period; + unsigned long framesPerHostCallback; /* just an example */ +}PaWinWasapiSubStream; + +typedef struct PaWinWasapiStream { /* IMPLEMENT ME: rename this */ + PaUtilStreamRepresentation streamRepresentation; + PaUtilCpuLoadMeasurer cpuLoadMeasurer; + PaUtilBufferProcessor bufferProcessor; + + /* IMPLEMENT ME: + - implementation specific data goes here + */ + + + //input + PaWinWasapiSubStream in; + IAudioCaptureClient *cclient; + IAudioEndpointVolume *inVol; + //output + PaWinWasapiSubStream out; + IAudioRenderClient *rclient; + IAudioEndpointVolume *outVol; + + bool running; + bool closeRequest; + + DWORD dwThreadId; + HANDLE hThread; + HANDLE hNotificationEvent; + + GUID session; + +}PaWinWasapiStream; + +#define PRINT(x) PA_DEBUG(x); + +void +logAUDCLNT_E (HRESULT res) +{ + + char *text = 0; + + switch (res) { + + case S_OK: + return; + break; + + case E_POINTER : + text ="E_POINTER"; + break; + + case E_INVALIDARG : + text ="E_INVALIDARG"; + break; + + case AUDCLNT_E_NOT_INITIALIZED : + text ="AUDCLNT_E_NOT_INITIALIZED"; + break; + + case AUDCLNT_E_ALREADY_INITIALIZED : + text ="AUDCLNT_E_ALREADY_INITIALIZED"; + break; + + case AUDCLNT_E_WRONG_ENDPOINT_TYPE : + text ="AUDCLNT_E_WRONG_ENDPOINT_TYPE"; + break; + + case AUDCLNT_E_DEVICE_INVALIDATED : + text ="AUDCLNT_E_DEVICE_INVALIDATED"; + break; + + case AUDCLNT_E_NOT_STOPPED : + text ="AUDCLNT_E_NOT_STOPPED"; + break; + + case AUDCLNT_E_BUFFER_TOO_LARGE : + text ="AUDCLNT_E_BUFFER_TOO_LARGE"; + break; + + case AUDCLNT_E_OUT_OF_ORDER : + text ="AUDCLNT_E_OUT_OF_ORDER"; + break; + + case AUDCLNT_E_UNSUPPORTED_FORMAT : + text ="AUDCLNT_E_UNSUPPORTED_FORMAT"; + break; + + case AUDCLNT_E_INVALID_SIZE : + text ="AUDCLNT_E_INVALID_SIZE"; + break; + + case AUDCLNT_E_DEVICE_IN_USE : + text ="AUDCLNT_E_DEVICE_IN_USE"; + break; + + case AUDCLNT_E_BUFFER_OPERATION_PENDING : + text ="AUDCLNT_E_BUFFER_OPERATION_PENDING"; + break; + + case AUDCLNT_E_THREAD_NOT_REGISTERED : + text ="AUDCLNT_E_THREAD_NOT_REGISTERED"; + break; + + case AUDCLNT_E_EXCLUSIVE_MODE_NOT_ALLOWED : + text ="AUDCLNT_E_EXCLUSIVE_MODE_NOT_ALLOWED"; + break; + + case AUDCLNT_E_ENDPOINT_CREATE_FAILED : + text ="AUDCLNT_E_ENDPOINT_CREATE_FAILED"; + break; + + case AUDCLNT_E_SERVICE_NOT_RUNNING : + text ="AUDCLNT_E_SERVICE_NOT_RUNNING"; + break; + // case AUDCLNT_E_CPUUSAGE_EXCEEDED :text ="AUDCLNT_E_CPUUSAGE_EXCEEDED"; break; + //Header error? + + case AUDCLNT_E_EVENTHANDLE_NOT_EXPECTED : + text ="AUDCLNT_E_EVENTHANDLE_NOT_EXPECTED"; + break; + + case AUDCLNT_E_EXCLUSIVE_MODE_ONLY : + text ="AUDCLNT_E_EXCLUSIVE_MODE_ONLY"; + break; + + case AUDCLNT_E_BUFDURATION_PERIOD_NOT_EQUAL : + text ="AUDCLNT_E_BUFDURATION_PERIOD_NOT_EQUAL"; + break; + + case AUDCLNT_E_EVENTHANDLE_NOT_SET : + text ="AUDCLNT_E_EVENTHANDLE_NOT_SET"; + break; + + case AUDCLNT_E_INCORRECT_BUFFER_SIZE : + text ="AUDCLNT_E_INCORRECT_BUFFER_SIZE"; + break; + + case AUDCLNT_E_BUFFER_SIZE_ERROR : + text ="AUDCLNT_E_BUFFER_SIZE_ERROR"; + break; + + case AUDCLNT_S_BUFFER_EMPTY : + text ="AUDCLNT_S_BUFFER_EMPTY"; + break; + + case AUDCLNT_S_THREAD_ALREADY_REGISTERED : + text ="AUDCLNT_S_THREAD_ALREADY_REGISTERED"; + break; + + default: + text =" dunno!"; + return ; + break; + + } + + PRINT ( ("WASAPI ERROR HRESULT: 0x%X : %s\n",res,text)); +} + +inline double +nano100ToMillis (const REFERENCE_TIME &ref) +{ + // 1 nano = 0.000000001 seconds + //100 nano = 0.0000001 seconds + //100 nano = 0.0001 milliseconds + return ( (double) ref) *0.0001; +} + +inline double +nano100ToSeconds (const REFERENCE_TIME &ref) +{ + // 1 nano = 0.000000001 seconds + //100 nano = 0.0000001 seconds + //100 nano = 0.0001 milliseconds + return ( (double) ref) *0.0000001; +} + +#ifndef IF_FAILED_JUMP +#define IF_FAILED_JUMP(hr, label) if(FAILED(hr)) goto label; +#endif + + + +//AVRT is the new "multimedia schedulling stuff" + +typedef BOOL (WINAPI *FAvRtCreateThreadOrderingGroup) (PHANDLE,PLARGE_INTEGER,GUID*,PLARGE_INTEGER); +typedef BOOL (WINAPI *FAvRtDeleteThreadOrderingGroup) (HANDLE); +typedef BOOL (WINAPI *FAvRtWaitOnThreadOrderingGroup) (HANDLE); +typedef HANDLE (WINAPI *FAvSetMmThreadCharacteristics) (LPCTSTR,LPDWORD); +typedef BOOL (WINAPI *FAvSetMmThreadPriority) (HANDLE,AVRT_PRIORITY); + +HMODULE hDInputDLL = 0; +FAvRtCreateThreadOrderingGroup pAvRtCreateThreadOrderingGroup=0; +FAvRtDeleteThreadOrderingGroup pAvRtDeleteThreadOrderingGroup=0; +FAvRtWaitOnThreadOrderingGroup pAvRtWaitOnThreadOrderingGroup=0; +FAvSetMmThreadCharacteristics pAvSetMmThreadCharacteristics=0; +FAvSetMmThreadPriority pAvSetMmThreadPriority=0; + + + +#define setupPTR(fun, type, name) { \ + fun = (type) GetProcAddress(hDInputDLL,name); \ + if(fun == NULL) { \ + PRINT(("GetProcAddr failed for %s" ,name)); \ + return false; \ + } \ + } \ + +bool +setupAVRT() +{ + + hDInputDLL = LoadLibraryA ("avrt.dll"); + + if (hDInputDLL == NULL) + return false; + + setupPTR (pAvRtCreateThreadOrderingGroup, FAvRtCreateThreadOrderingGroup, "AvRtCreateThreadOrderingGroup"); + + setupPTR (pAvRtDeleteThreadOrderingGroup, FAvRtDeleteThreadOrderingGroup, "AvRtDeleteThreadOrderingGroup"); + + setupPTR (pAvRtWaitOnThreadOrderingGroup, FAvRtWaitOnThreadOrderingGroup, "AvRtWaitOnThreadOrderingGroup"); + + setupPTR (pAvSetMmThreadCharacteristics, FAvSetMmThreadCharacteristics, "AvSetMmThreadCharacteristicsA"); + + setupPTR (pAvSetMmThreadPriority, FAvSetMmThreadPriority, "AvSetMmThreadPriority"); + + return true; +} + + + +PaError PaWinWasapi_Initialize (PaUtilHostApiRepresentation **hostApi, PaHostApiIndex hostApiIndex) +{ + if (!setupAVRT()) { + PRINT ( ("Windows WASAPI : No AVRT! (not VISTA?)")); + return paNoError; + } + + CoInitialize (NULL); + + PaError result = paNoError; + PaWinWasapiHostApiRepresentation *paWasapi; + PaDeviceInfo *deviceInfoArray; + + paWasapi = (PaWinWasapiHostApiRepresentation*) PaUtil_AllocateMemory (sizeof (PaWinWasapiHostApiRepresentation)); + + if (!paWasapi) { + result = paInsufficientMemory; + goto error; + } + + paWasapi->allocations = PaUtil_CreateAllocationGroup(); + + if (!paWasapi->allocations) { + result = paInsufficientMemory; + goto error; + } + + *hostApi = &paWasapi->inheritedHostApiRep; + + (*hostApi)->info.structVersion = 1; + (*hostApi)->info.type = paWASAPI; + (*hostApi)->info.name = "Windows WASAPI"; + (*hostApi)->info.deviceCount = 0; //so far, we must investigate each + (*hostApi)->info.defaultInputDevice = paNoDevice; /* IMPLEMENT ME */ + (*hostApi)->info.defaultOutputDevice = paNoDevice; /* IMPLEMENT ME */ + + + HRESULT hResult = S_OK; + IMMDeviceCollection* spEndpoints=0; + paWasapi->enumerator = 0; + + hResult = CoCreateInstance ( + __uuidof (MMDeviceEnumerator), NULL,CLSCTX_INPROC_SERVER, + __uuidof (IMMDeviceEnumerator), + (void**) &paWasapi->enumerator); + + IF_FAILED_JUMP (hResult, error); + + //getting default device ids in the eMultimedia "role" + { + { + IMMDevice* defaultRenderer=0; + hResult = paWasapi->enumerator->GetDefaultAudioEndpoint (eRender, eMultimedia, &defaultRenderer); + IF_FAILED_JUMP (hResult, error); + WCHAR* pszDeviceId = NULL; + hResult = defaultRenderer->GetId (&pszDeviceId); + IF_FAILED_JUMP (hResult, error); + StringCchCopyW (paWasapi->defaultRenderer, MAX_STR_LEN-1, pszDeviceId); + CoTaskMemFree (pszDeviceId); + defaultRenderer->Release(); + } + + { + IMMDevice* defaultCapturer=0; + hResult = paWasapi->enumerator->GetDefaultAudioEndpoint (eCapture, eMultimedia, &defaultCapturer); + IF_FAILED_JUMP (hResult, error); + WCHAR* pszDeviceId = NULL; + hResult = defaultCapturer->GetId (&pszDeviceId); + IF_FAILED_JUMP (hResult, error); + StringCchCopyW (paWasapi->defaultCapturer, MAX_STR_LEN-1, pszDeviceId); + CoTaskMemFree (pszDeviceId); + defaultCapturer->Release(); + } + } + + + hResult = paWasapi->enumerator->EnumAudioEndpoints (eAll, DEVICE_STATE_ACTIVE, &spEndpoints); + IF_FAILED_JUMP (hResult, error); + + hResult = spEndpoints->GetCount (&paWasapi->deviceCount); + IF_FAILED_JUMP (hResult, error); + + paWasapi->devInfo = new PaWinWasapiDeviceInfo[paWasapi->deviceCount]; + { + for (size_t step=0;step<paWasapi->deviceCount;++step) + memset (&paWasapi->devInfo[step],0,sizeof (PaWinWasapiDeviceInfo)); + } + + + + if (paWasapi->deviceCount > 0) { + (*hostApi)->deviceInfos = (PaDeviceInfo**) PaUtil_GroupAllocateMemory ( + paWasapi->allocations, sizeof (PaDeviceInfo*) * paWasapi->deviceCount); + + if (! (*hostApi)->deviceInfos) { + result = paInsufficientMemory; + goto error; + } + + /* allocate all device info structs in a contiguous block */ + deviceInfoArray = (PaDeviceInfo*) PaUtil_GroupAllocateMemory ( + paWasapi->allocations, sizeof (PaDeviceInfo) * paWasapi->deviceCount); + + if (!deviceInfoArray) { + result = paInsufficientMemory; + goto error; + } + + for (UINT i=0; i < paWasapi->deviceCount; ++i) { + + PA_DEBUG ( ("i:%d\n",i)); + PaDeviceInfo *deviceInfo = &deviceInfoArray[i]; + deviceInfo->structVersion = 2; + deviceInfo->hostApi = hostApiIndex; + + hResult = spEndpoints->Item (i, &paWasapi->devInfo[i].device); + IF_FAILED_JUMP (hResult, error); + + //getting ID + { + WCHAR* pszDeviceId = NULL; + hResult = paWasapi->devInfo[i].device->GetId (&pszDeviceId); + IF_FAILED_JUMP (hResult, error); + StringCchCopyW (paWasapi->devInfo[i].szDeviceID, MAX_STR_LEN-1, pszDeviceId); + CoTaskMemFree (pszDeviceId); + + if (lstrcmpW (paWasapi->devInfo[i].szDeviceID, paWasapi->defaultCapturer) ==0) { + //we found the default input! + (*hostApi)->info.defaultInputDevice = (*hostApi)->info.deviceCount; + } + + if (lstrcmpW (paWasapi->devInfo[i].szDeviceID, paWasapi->defaultRenderer) ==0) { + //we found the default output! + (*hostApi)->info.defaultOutputDevice = (*hostApi)->info.deviceCount; + } + } + + DWORD state=0; + hResult = paWasapi->devInfo[i].device->GetState (&paWasapi->devInfo[i].state); + IF_FAILED_JUMP (hResult, error); + + if (paWasapi->devInfo[i].state != DEVICE_STATE_ACTIVE) { + PRINT ( ("WASAPI device:%d is not currently available (state:%d)\n",i,state)); + //spDevice->Release(); + //continue; + } + + { + IPropertyStore* spProperties; + hResult = paWasapi->devInfo[i].device->OpenPropertyStore (STGM_READ, &spProperties); + IF_FAILED_JUMP (hResult, error); + + //getting "Friendly" Name + { + PROPVARIANT value; + PropVariantInit (&value); + hResult = spProperties->GetValue (PKEY_Device_FriendlyName, &value); + IF_FAILED_JUMP (hResult, error); + deviceInfo->name = 0; + char* deviceName = (char*) PaUtil_GroupAllocateMemory (paWasapi->allocations, MAX_STR_LEN + 1); + + if (!deviceName) { + result = paInsufficientMemory; + goto error; + } + + if (value.pwszVal) + wcstombs (deviceName, value.pwszVal,MAX_STR_LEN-1); //todo proper size + else { + sprintf (deviceName,"baddev%d",i); + } + + deviceInfo->name = deviceName; + + PropVariantClear (&value); + } + +#if 0 + DWORD numProps = 0; + hResult = spProperties->GetCount (&numProps); + IF_FAILED_JUMP (hResult, error); + { + for (DWORD i=0;i<numProps;++i) { + PROPERTYKEY pkey; + hResult = spProperties->GetAt (i,&pkey); + + PROPVARIANT value; + PropVariantInit (&value); + hResult = spProperties->GetValue (pkey, &value); + + switch (value.vt) { + + case 11: + PRINT ( ("property*%u*\n",value.ulVal)); + break; + + case 19: + PRINT ( ("property*%d*\n",value.boolVal)); + break; + + case 31: { + char temp[512]; + wcstombs (temp, value.pwszVal,MAX_STR_LEN-1); + PRINT ( ("property*%s*\n",temp)); + } + + break; + + default: + break; + } + + PropVariantClear (&value); + } + } + +#endif + + /* These look interresting... but they are undocumented + PKEY_AudioEndpoint_FormFactor + PKEY_AudioEndpoint_ControlPanelPageProvider + PKEY_AudioEndpoint_Association + PKEY_AudioEndpoint_PhysicalSpeakerConfig + PKEY_AudioEngine_DeviceFormat + */ + spProperties->Release(); + } + + + //getting the Endpoint data + { + IMMEndpoint *endpoint=0; + hResult = paWasapi->devInfo[i].device->QueryInterface (__uuidof (IMMEndpoint), (void **) &endpoint); + + if (SUCCEEDED (hResult)) { + hResult = endpoint->GetDataFlow (&paWasapi->devInfo[i].flow); + endpoint->Release(); + } + } + + //Getting a temporary IAudioDevice for more fields + //we make sure NOT to call Initialize yet! + { + IAudioClient *myClient=0; + + hResult = paWasapi->devInfo[i].device->Activate (__uuidof (IAudioClient), CLSCTX_INPROC_SERVER, NULL, (void**) &myClient); + IF_FAILED_JUMP (hResult, error); + + hResult = myClient->GetDevicePeriod ( + &paWasapi->devInfo[i].DefaultDevicePeriod, + &paWasapi->devInfo[i].MinimumDevicePeriod); + IF_FAILED_JUMP (hResult, error); + + hResult = myClient->GetMixFormat (&paWasapi->devInfo[i].MixFormat); + + if (hResult != S_OK) { + /*davidv: this happened with my hardware, previously for that same device in DirectSound: + Digital Output (Realtek AC'97 Audio)'s GUID: {0x38f2cf50,0x7b4c,0x4740,0x86,0xeb,0xd4,0x38,0x66,0xd8,0xc8, 0x9f} + so something must be _really_ wrong with this device, TODO handle this better. We kind of need GetMixFormat*/ + logAUDCLNT_E (hResult); + goto error; + } + + myClient->Release(); + } + + //we can now fill in portaudio device data + deviceInfo->maxInputChannels = 0; //for now + + deviceInfo->maxOutputChannels = 0; //for now + + switch (paWasapi->devInfo[i].flow) { + + case eRender: + //hum not exaclty maximum, more like "default" + deviceInfo->maxOutputChannels = paWasapi->devInfo[i].MixFormat->nChannels; + + deviceInfo->defaultHighOutputLatency = nano100ToSeconds (paWasapi->devInfo[i].DefaultDevicePeriod); + deviceInfo->defaultLowOutputLatency = nano100ToSeconds (paWasapi->devInfo[i].MinimumDevicePeriod); + break; + + case eCapture: + //hum not exaclty maximum, more like "default" + deviceInfo->maxInputChannels = paWasapi->devInfo[i].MixFormat->nChannels; + + deviceInfo->defaultHighInputLatency = nano100ToSeconds (paWasapi->devInfo[i].DefaultDevicePeriod); + deviceInfo->defaultLowInputLatency = nano100ToSeconds (paWasapi->devInfo[i].MinimumDevicePeriod); + break; + + default: + PRINT ( ("WASAPI device:%d bad Data FLow! \n",i)); + goto error; + break; + } + + deviceInfo->defaultSampleRate = (double) paWasapi->devInfo[i].MixFormat->nSamplesPerSec; + + (*hostApi)->deviceInfos[i] = deviceInfo; + ++ (*hostApi)->info.deviceCount; + } + } + + spEndpoints->Release(); + + (*hostApi)->Terminate = Terminate; + (*hostApi)->OpenStream = OpenStream; + (*hostApi)->IsFormatSupported = IsFormatSupported; + + PaUtil_InitializeStreamInterface (&paWasapi->callbackStreamInterface, CloseStream, StartStream, + StopStream, AbortStream, IsStreamStopped, IsStreamActive, + GetStreamTime, GetStreamCpuLoad, + PaUtil_DummyRead, PaUtil_DummyWrite, + PaUtil_DummyGetReadAvailable, PaUtil_DummyGetWriteAvailable); + + PaUtil_InitializeStreamInterface (&paWasapi->blockingStreamInterface, CloseStream, StartStream, + StopStream, AbortStream, IsStreamStopped, IsStreamActive, + GetStreamTime, PaUtil_DummyGetCpuLoad, + ReadStream, WriteStream, GetStreamReadAvailable, GetStreamWriteAvailable); + + return result; + +error: + + if (spEndpoints) + spEndpoints->Release(); + + if (paWasapi->enumerator) + paWasapi->enumerator->Release(); + + if (paWasapi) { + if (paWasapi->allocations) { + PaUtil_FreeAllAllocations (paWasapi->allocations); + PaUtil_DestroyAllocationGroup (paWasapi->allocations); + } + + PaUtil_FreeMemory (paWasapi); + } + + return result; +} + + +static void Terminate (struct PaUtilHostApiRepresentation *hostApi) +{ + PaWinWasapiHostApiRepresentation *paWasapi = (PaWinWasapiHostApiRepresentation*) hostApi; + + paWasapi->enumerator->Release(); + + for (UINT i=0;i<paWasapi->deviceCount;++i) { + PaWinWasapiDeviceInfo *info = &paWasapi->devInfo[i]; + + if (info->device) + info->device->Release(); + + if (info->MixFormat) + CoTaskMemFree (info->MixFormat); + } + + delete [] paWasapi->devInfo; + + CoUninitialize(); + + if (paWasapi->allocations) { + PaUtil_FreeAllAllocations (paWasapi->allocations); + PaUtil_DestroyAllocationGroup (paWasapi->allocations); + } + + PaUtil_FreeMemory (paWasapi); +} + +static void +LogWAVEFORMATEXTENSIBLE (const WAVEFORMATEXTENSIBLE *in) +{ + + const WAVEFORMATEX *old = (WAVEFORMATEX *) in; + + switch (old->wFormatTag) { + + case WAVE_FORMAT_EXTENSIBLE: { + + PRINT ( ("wFormatTag=WAVE_FORMAT_EXTENSIBLE\n")); + + if (in->SubFormat == KSDATAFORMAT_SUBTYPE_IEEE_FLOAT) { + PRINT ( ("SubFormat=KSDATAFORMAT_SUBTYPE_IEEE_FLOAT\n")); + } else if (in->SubFormat == KSDATAFORMAT_SUBTYPE_PCM) { + PRINT ( ("SubFormat=KSDATAFORMAT_SUBTYPE_PCM\n")); + } else { + PRINT ( ("SubFormat=CUSTOM GUID{%d:%d:%d:%d%d%d%d%d%d%d%d}\n", + in->SubFormat.Data1, + in->SubFormat.Data2, + in->SubFormat.Data3, + (int) in->SubFormat.Data4[0], + (int) in->SubFormat.Data4[1], + (int) in->SubFormat.Data4[2], + (int) in->SubFormat.Data4[3], + (int) in->SubFormat.Data4[4], + (int) in->SubFormat.Data4[5], + (int) in->SubFormat.Data4[6], + (int) in->SubFormat.Data4[7])); + } + + PRINT ( ("Samples.wValidBitsPerSample=%d\n", in->Samples.wValidBitsPerSample)); + + PRINT ( ("dwChannelMask=0x%X\n",in->dwChannelMask)); + } + + break; + + case WAVE_FORMAT_PCM: + PRINT ( ("wFormatTag=WAVE_FORMAT_PCM\n")); + break; + + case WAVE_FORMAT_IEEE_FLOAT: + PRINT ( ("wFormatTag=WAVE_FORMAT_IEEE_FLOAT\n")); + break; + + default : + PRINT ( ("wFormatTag=UNKNOWN(%d)\n",old->wFormatTag)); + break; + } + + PRINT ( ("nChannels =%d\n",old->nChannels)); + + PRINT ( ("nSamplesPerSec =%d\n",old->nSamplesPerSec)); + PRINT ( ("nAvgBytesPerSec=%d\n",old->nAvgBytesPerSec)); + PRINT ( ("nBlockAlign =%d\n",old->nBlockAlign)); + PRINT ( ("wBitsPerSample =%d\n",old->wBitsPerSample)); + PRINT ( ("cbSize =%d\n",old->cbSize)); +} + + + +/* + WAVEFORMATXXX is always interleaved + */ +static PaSampleFormat +waveformatToPaFormat (const WAVEFORMATEXTENSIBLE *in) +{ + + const WAVEFORMATEX *old = (WAVEFORMATEX*) in; + + switch (old->wFormatTag) { + + case WAVE_FORMAT_EXTENSIBLE: { + if (in->SubFormat == KSDATAFORMAT_SUBTYPE_IEEE_FLOAT) { + if (in->Samples.wValidBitsPerSample == 32) + return paFloat32; + else + return paCustomFormat; + } else if (in->SubFormat == KSDATAFORMAT_SUBTYPE_PCM) { + switch (old->wBitsPerSample) { + + case 32: + return paInt32; + break; + + case 24: + return paInt24; + break; + + case 8: + return paUInt8; + break; + + case 16: + return paInt16; + break; + + default: + return paCustomFormat; + break; + } + } else + return paCustomFormat; + } + + break; + + case WAVE_FORMAT_IEEE_FLOAT: + return paFloat32; + break; + + case WAVE_FORMAT_PCM: { + switch (old->wBitsPerSample) { + + case 32: + return paInt32; + break; + + case 24: + return paInt24; + break; + + case 8: + return paUInt8; + break; + + case 16: + return paInt16; + break; + + default: + return paCustomFormat; + break; + } + } + + break; + + default: + return paCustomFormat; + break; + } + + return paCustomFormat; +} + + + +static PaError +waveformatFromParams (WAVEFORMATEXTENSIBLE*wavex, + const PaStreamParameters * params, + double sampleRate) +{ + + size_t bytesPerSample = 0; + + switch (params->sampleFormat & ~paNonInterleaved) { + + case paFloat32: + + case paInt32: + bytesPerSample=4; + break; + + case paInt16: + bytesPerSample=2; + break; + + case paInt24: + bytesPerSample=3; + break; + + case paInt8: + + case paUInt8: + bytesPerSample=1; + break; + + case paCustomFormat: + + default: + return paSampleFormatNotSupported; + break; + } + + memset (wavex,0,sizeof (WAVEFORMATEXTENSIBLE)); + + WAVEFORMATEX *old = (WAVEFORMATEX *) wavex; + old->nChannels = (WORD) params->channelCount; + old->nSamplesPerSec = (DWORD) sampleRate; + old->wBitsPerSample = (WORD) (bytesPerSample*8); + old->nAvgBytesPerSec = (DWORD) (old->nSamplesPerSec * old->nChannels * bytesPerSample); + old->nBlockAlign = (WORD) (old->nChannels * bytesPerSample); + + //WAVEFORMATEX + + if (params->channelCount <=2 && (bytesPerSample == 2 || bytesPerSample == 1)) { + old->cbSize = 0; + old->wFormatTag = WAVE_FORMAT_PCM; + } + + //WAVEFORMATEXTENSIBLE + else { + old->wFormatTag = WAVE_FORMAT_EXTENSIBLE; + + old->cbSize = sizeof (WAVEFORMATEXTENSIBLE) - sizeof (WAVEFORMATEX); + + if ( (params->sampleFormat & ~paNonInterleaved) == paFloat32) + wavex->SubFormat = KSDATAFORMAT_SUBTYPE_IEEE_FLOAT; + else + wavex->SubFormat = KSDATAFORMAT_SUBTYPE_PCM; + + wavex->Samples.wValidBitsPerSample = old->wBitsPerSample; //no extra padding! + + switch (params->channelCount) { + + case 1: + wavex->dwChannelMask = SPEAKER_FRONT_CENTER; + break; + + case 2: + wavex->dwChannelMask = 0x1 | 0x2; + break; + + case 4: + wavex->dwChannelMask = 0x1 | 0x2 | 0x10 | 0x20; + break; + + case 6: + wavex->dwChannelMask = 0x1 | 0x2 | 0x4 | 0x8 | 0x10 | 0x20; + break; + + case 8: + wavex->dwChannelMask = 0x1 | 0x2 | 0x4 | 0x8 | 0x10 | 0x20 | 0x40 | 0x80; + break; + + default: + wavex->dwChannelMask = 0; + break; + } + } + + return paNoError; +} + + + + + + +/* +#define paFloat32 ((PaSampleFormat) 0x00000001) +#define paInt32 ((PaSampleFormat) 0x00000002) +#define paInt24 ((PaSampleFormat) 0x00000004) +#define paInt16 ((PaSampleFormat) 0x00000008) +*/ +//lifted from pa_wdmks +static void wasapiFillWFEXT (WAVEFORMATEXTENSIBLE* pwfext, PaSampleFormat sampleFormat, double sampleRate, int channelCount) +{ + PA_DEBUG ( ("sampleFormat = %lx\n" , sampleFormat)); + PA_DEBUG ( ("sampleRate = %f\n" , sampleRate)); + PA_DEBUG ( ("chanelCount = %d\n", channelCount)); + + pwfext->Format.wFormatTag = WAVE_FORMAT_EXTENSIBLE; + pwfext->Format.nChannels = channelCount; + pwfext->Format.nSamplesPerSec = (int) sampleRate; + + if (channelCount == 1) + pwfext->dwChannelMask = KSAUDIO_SPEAKER_DIRECTOUT; + else + pwfext->dwChannelMask = KSAUDIO_SPEAKER_STEREO; + + if (sampleFormat == paFloat32) { + pwfext->Format.nBlockAlign = channelCount * 4; + pwfext->Format.wBitsPerSample = 32; + pwfext->Format.cbSize = sizeof (WAVEFORMATEXTENSIBLE)-sizeof (WAVEFORMATEX); + pwfext->Samples.wValidBitsPerSample = 32; + pwfext->SubFormat = KSDATAFORMAT_SUBTYPE_IEEE_FLOAT; + } else if (sampleFormat == paInt32) { + pwfext->Format.nBlockAlign = channelCount * 4; + pwfext->Format.wBitsPerSample = 32; + pwfext->Format.cbSize = sizeof (WAVEFORMATEXTENSIBLE)-sizeof (WAVEFORMATEX); + pwfext->Samples.wValidBitsPerSample = 32; + pwfext->SubFormat = KSDATAFORMAT_SUBTYPE_PCM; + } else if (sampleFormat == paInt24) { + pwfext->Format.nBlockAlign = channelCount * 3; + pwfext->Format.wBitsPerSample = 24; + pwfext->Format.cbSize = sizeof (WAVEFORMATEXTENSIBLE)-sizeof (WAVEFORMATEX); + pwfext->Samples.wValidBitsPerSample = 24; + pwfext->SubFormat = KSDATAFORMAT_SUBTYPE_PCM; + } else if (sampleFormat == paInt16) { + pwfext->Format.nBlockAlign = channelCount * 2; + pwfext->Format.wBitsPerSample = 16; + pwfext->Format.cbSize = sizeof (WAVEFORMATEXTENSIBLE)-sizeof (WAVEFORMATEX); + pwfext->Samples.wValidBitsPerSample = 16; + pwfext->SubFormat = KSDATAFORMAT_SUBTYPE_PCM; + } + + pwfext->Format.nAvgBytesPerSec = pwfext->Format.nSamplesPerSec * pwfext->Format.nBlockAlign; +} + + + +/* +#define FORMATTESTS 4 +const int BestToWorst[FORMATTESTS]={paFloat32,paInt32,paInt24,paInt16}; +*/ + +#define FORMATTESTS 3 +const int BestToWorst[FORMATTESTS]={paFloat32,paInt24,paInt16}; + + +static PaError +GetClosestFormat (IAudioClient * myClient, double sampleRate,const PaStreamParameters * params, + AUDCLNT_SHAREMODE *shareMode, WAVEFORMATEXTENSIBLE *outWavex) +{ + //TODO we should try exclusive first and shared after + *shareMode = PORTAUDIO_SHAREMODE; + + PaError answer = paInvalidSampleRate; + + waveformatFromParams (outWavex,params,sampleRate); + WAVEFORMATEX *sharedClosestMatch=0; + HRESULT hResult=!S_OK; + + if (*shareMode == AUDCLNT_SHAREMODE_EXCLUSIVE) + hResult = myClient->IsFormatSupported (AUDCLNT_SHAREMODE_EXCLUSIVE, (WAVEFORMATEX*) outWavex,NULL); + else + hResult = myClient->IsFormatSupported (AUDCLNT_SHAREMODE_SHARED, (WAVEFORMATEX*) &outWavex,&sharedClosestMatch); + + if (hResult == S_OK) + answer = paFormatIsSupported; + else if (sharedClosestMatch) { + WAVEFORMATEXTENSIBLE* ext = (WAVEFORMATEXTENSIBLE*) sharedClosestMatch; + + int closestMatchSR = (int) sharedClosestMatch->nSamplesPerSec; + + if (sharedClosestMatch->wFormatTag == WAVE_FORMAT_EXTENSIBLE) + memcpy (outWavex,sharedClosestMatch,sizeof (WAVEFORMATEXTENSIBLE)); + else + memcpy (outWavex,sharedClosestMatch,sizeof (WAVEFORMATEX)); + + CoTaskMemFree (sharedClosestMatch); + + if ( (int) sampleRate == closestMatchSR) + answer = paFormatIsSupported; + else + answer = paInvalidSampleRate; + + } else { + + //it doesnt suggest anything?? ok lets show it the MENU! + + //ok fun time as with pa_win_mme, we know only a refusal of the user-requested + //sampleRate+num Channel is disastrous, as the portaudio buffer processor converts between anything + //so lets only use the number + for (int i=0;i<FORMATTESTS;++i) { + WAVEFORMATEXTENSIBLE ext; + wasapiFillWFEXT (&ext,BestToWorst[i],sampleRate,params->channelCount); + + if (*shareMode == AUDCLNT_SHAREMODE_EXCLUSIVE) + hResult = myClient->IsFormatSupported (AUDCLNT_SHAREMODE_EXCLUSIVE, (WAVEFORMATEX*) &ext,NULL); + else + hResult = myClient->IsFormatSupported (AUDCLNT_SHAREMODE_SHARED, (WAVEFORMATEX*) &ext,&sharedClosestMatch); + + if (hResult == S_OK) { + memcpy (outWavex,&ext,sizeof (WAVEFORMATEXTENSIBLE)); + answer = paFormatIsSupported; + break; + } + } + + if (answer!=paFormatIsSupported) { + //try MIX format? + //why did it HAVE to come to this .... + WAVEFORMATEX pcm16WaveFormat; + memset (&pcm16WaveFormat,0,sizeof (WAVEFORMATEX)); + pcm16WaveFormat.wFormatTag = WAVE_FORMAT_PCM; + pcm16WaveFormat.nChannels = 2; + pcm16WaveFormat.nSamplesPerSec = (DWORD) sampleRate; + pcm16WaveFormat.nBlockAlign = 4; + pcm16WaveFormat.nAvgBytesPerSec = pcm16WaveFormat.nSamplesPerSec*pcm16WaveFormat.nBlockAlign; + pcm16WaveFormat.wBitsPerSample = 16; + pcm16WaveFormat.cbSize = 0; + + if (*shareMode == AUDCLNT_SHAREMODE_EXCLUSIVE) + hResult = myClient->IsFormatSupported (AUDCLNT_SHAREMODE_EXCLUSIVE, (WAVEFORMATEX*) &pcm16WaveFormat,NULL); + else + hResult = myClient->IsFormatSupported (AUDCLNT_SHAREMODE_SHARED, (WAVEFORMATEX*) &pcm16WaveFormat,&sharedClosestMatch); + + if (hResult == S_OK) { + memcpy (outWavex,&pcm16WaveFormat,sizeof (WAVEFORMATEX)); + answer = paFormatIsSupported; + } + } + + logAUDCLNT_E (hResult); + } + + return answer; +} + + +static PaError IsFormatSupported (struct PaUtilHostApiRepresentation *hostApi, + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate) +{ + + int inputChannelCount, outputChannelCount; + PaSampleFormat inputSampleFormat, outputSampleFormat; + + if (inputParameters) { + inputChannelCount = inputParameters->channelCount; + inputSampleFormat = inputParameters->sampleFormat; + + /* all standard sample formats are supported by the buffer adapter, + this implementation doesn't support any custom sample formats */ + + if (inputSampleFormat & paCustomFormat) + return paSampleFormatNotSupported; + + /* unless alternate device specification is supported, reject the use of + paUseHostApiSpecificDeviceSpecification */ + + if (inputParameters->device == paUseHostApiSpecificDeviceSpecification) + return paInvalidDevice; + + /* check that input device can support inputChannelCount */ + if (inputChannelCount > hostApi->deviceInfos[ inputParameters->device ]->maxInputChannels) + return paInvalidChannelCount; + + /* validate inputStreamInfo */ + if (inputParameters->hostApiSpecificStreamInfo) + return paIncompatibleHostApiSpecificStreamInfo; /* this implementation doesn't use custom stream info */ + + + PaWinWasapiHostApiRepresentation *paWasapi = (PaWinWasapiHostApiRepresentation*) hostApi; + + + IAudioClient *myClient=0; + + HRESULT hResult = paWasapi->devInfo[inputParameters->device].device->Activate ( + __uuidof (IAudioClient), CLSCTX_INPROC_SERVER, NULL, (void**) &myClient); + + if (hResult != S_OK) { + logAUDCLNT_E (hResult); + return paInvalidDevice; + } + + WAVEFORMATEXTENSIBLE wavex; + + AUDCLNT_SHAREMODE shareMode; + PaError answer = GetClosestFormat (myClient,sampleRate,inputParameters,&shareMode,&wavex); + myClient->Release(); + + if (answer !=paFormatIsSupported) + return answer; + } else { + inputChannelCount = 0; + } + + if (outputParameters) { + outputChannelCount = outputParameters->channelCount; + outputSampleFormat = outputParameters->sampleFormat; + + /* all standard sample formats are supported by the buffer adapter, + this implementation doesn't support any custom sample formats */ + + if (outputSampleFormat & paCustomFormat) + return paSampleFormatNotSupported; + + /* unless alternate device specification is supported, reject the use of + paUseHostApiSpecificDeviceSpecification */ + + if (outputParameters->device == paUseHostApiSpecificDeviceSpecification) + return paInvalidDevice; + + /* check that output device can support outputChannelCount */ + if (outputChannelCount > hostApi->deviceInfos[ outputParameters->device ]->maxOutputChannels) + return paInvalidChannelCount; + + /* validate outputStreamInfo */ + if (outputParameters->hostApiSpecificStreamInfo) + return paIncompatibleHostApiSpecificStreamInfo; /* this implementation doesn't use custom stream info */ + + + PaWinWasapiHostApiRepresentation *paWasapi = (PaWinWasapiHostApiRepresentation*) hostApi; + + IAudioClient *myClient=0; + + HRESULT hResult = paWasapi->devInfo[outputParameters->device].device->Activate ( + __uuidof (IAudioClient), CLSCTX_INPROC_SERVER, NULL, (void**) &myClient); + + if (hResult != S_OK) { + logAUDCLNT_E (hResult); + return paInvalidDevice; + } + + WAVEFORMATEXTENSIBLE wavex; + + AUDCLNT_SHAREMODE shareMode; + PaError answer = GetClosestFormat (myClient,sampleRate,outputParameters,&shareMode,&wavex); + myClient->Release(); + + if (answer !=paFormatIsSupported) + return answer; + } else { + outputChannelCount = 0; + } + + + return paFormatIsSupported; +} + + + +/* see pa_hostapi.h for a list of validity guarantees made about OpenStream parameters */ + +static PaError OpenStream (struct PaUtilHostApiRepresentation *hostApi, + PaStream** s, + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate, + unsigned long framesPerBuffer, + PaStreamFlags streamFlags, + PaStreamCallback *streamCallback, + void *userData) +{ + PaError result = paNoError; + PaWinWasapiHostApiRepresentation *paWasapi = (PaWinWasapiHostApiRepresentation*) hostApi; + PaWinWasapiStream *stream = 0; + int inputChannelCount, outputChannelCount; + PaSampleFormat inputSampleFormat, outputSampleFormat; + PaSampleFormat hostInputSampleFormat, hostOutputSampleFormat; + + + stream = (PaWinWasapiStream*) PaUtil_AllocateMemory (sizeof (PaWinWasapiStream)); + + if (!stream) { + result = paInsufficientMemory; + goto error; + } + + if (inputParameters) { + inputChannelCount = inputParameters->channelCount; + inputSampleFormat = inputParameters->sampleFormat; + + /* unless alternate device specification is supported, reject the use of + paUseHostApiSpecificDeviceSpecification */ + + if (inputParameters->device == paUseHostApiSpecificDeviceSpecification) + return paInvalidDevice; + + /* check that input device can support inputChannelCount */ + if (inputChannelCount > hostApi->deviceInfos[ inputParameters->device ]->maxInputChannels) + return paInvalidChannelCount; + + /* validate inputStreamInfo */ + if (inputParameters->hostApiSpecificStreamInfo) + return paIncompatibleHostApiSpecificStreamInfo; /* this implementation doesn't use custom stream info */ + + + PaWinWasapiDeviceInfo &info = paWasapi->devInfo[inputParameters->device]; + + HRESULT hResult = info.device->Activate ( + __uuidof (IAudioClient), CLSCTX_INPROC_SERVER, NULL, + (void**) &stream->in.client); + + if (hResult != S_OK) + return paInvalidDevice; + + hResult = info.device->Activate ( + __uuidof (IAudioEndpointVolume), CLSCTX_INPROC_SERVER, NULL, + (void**) &stream->inVol); + + if (hResult != S_OK) + return paInvalidDevice; + + AUDCLNT_SHAREMODE shareMode; + + PaError answer = GetClosestFormat (stream->in.client,sampleRate,inputParameters,&shareMode,&stream->in.wavex); + + if (answer !=paFormatIsSupported) + return answer; + + //stream->out.period = info.DefaultDevicePeriod; + stream->in.period = info.MinimumDevicePeriod; + + hResult = stream->in.client->Initialize ( + shareMode, + 0, //no flags + stream->in.period, + 0,//stream->out.period, + (WAVEFORMATEX*) &stream->in.wavex, + &stream->session + ); + + if (hResult != S_OK) { + logAUDCLNT_E (hResult); + return paInvalidDevice; + } + + hResult = stream->in.client->GetBufferSize (&stream->in.bufferSize); + + if (hResult != S_OK) + return paInvalidDevice; + + hResult = stream->in.client->GetStreamLatency (&stream->in.latency); + + if (hResult != S_OK) + return paInvalidDevice; + + double periodsPerSecond = 1.0/nano100ToSeconds (stream->in.period); + + double samplesPerPeriod = (double) (stream->in.wavex.Format.nSamplesPerSec) /periodsPerSecond; + + //this is the number of samples that are required at each period + stream->in.framesPerHostCallback = (unsigned long) samplesPerPeriod;//unrelated to channels + + /* IMPLEMENT ME - establish which host formats are available */ + hostInputSampleFormat = + PaUtil_SelectClosestAvailableFormat (waveformatToPaFormat (&stream->in.wavex), inputSampleFormat); + } else { + inputChannelCount = 0; + inputSampleFormat = hostInputSampleFormat = paInt16; /* Surpress 'uninitialised var' warnings. */ + } + + if (outputParameters) { + outputChannelCount = outputParameters->channelCount; + outputSampleFormat = outputParameters->sampleFormat; + + /* unless alternate device specification is supported, reject the use of + paUseHostApiSpecificDeviceSpecification */ + + if (outputParameters->device == paUseHostApiSpecificDeviceSpecification) + return paInvalidDevice; + + /* check that output device can support inputChannelCount */ + if (outputChannelCount > hostApi->deviceInfos[ outputParameters->device ]->maxOutputChannels) + return paInvalidChannelCount; + + /* validate outputStreamInfo */ + if (outputParameters->hostApiSpecificStreamInfo) + return paIncompatibleHostApiSpecificStreamInfo; /* this implementation doesn't use custom stream info */ + + + PaWinWasapiDeviceInfo &info = paWasapi->devInfo[outputParameters->device]; + + HRESULT hResult = info.device->Activate ( + __uuidof (IAudioClient), CLSCTX_INPROC_SERVER, NULL, + (void**) &stream->out.client); + + if (hResult != S_OK) + return paInvalidDevice; + + AUDCLNT_SHAREMODE shareMode; + + PaError answer = GetClosestFormat (stream->out.client,sampleRate,outputParameters,&shareMode,&stream->out.wavex); + + if (answer !=paFormatIsSupported) + return answer; + + LogWAVEFORMATEXTENSIBLE (&stream->out.wavex); + + // stream->out.period = info.DefaultDevicePeriod; + stream->out.period = info.MinimumDevicePeriod; + + /*For an exclusive-mode stream that uses event-driven buffering, + the caller must specify nonzero values for hnsPeriodicity and hnsBufferDuration, + and the values of these two parameters must be equal */ + if (shareMode == AUDCLNT_SHAREMODE_EXCLUSIVE) { + hResult = stream->out.client->Initialize ( + shareMode, + AUDCLNT_STREAMFLAGS_EVENTCALLBACK, + stream->out.period, + stream->out.period, + (WAVEFORMATEX*) &stream->out.wavex, + &stream->session + ); + } else { + hResult = stream->out.client->Initialize ( + shareMode, + AUDCLNT_STREAMFLAGS_EVENTCALLBACK, + 0, + 0, + (WAVEFORMATEX*) &stream->out.wavex, + &stream->session + ); + } + + + if (hResult != S_OK) { + logAUDCLNT_E (hResult); + return paInvalidDevice; + } + + hResult = info.device->Activate ( + + __uuidof (IAudioEndpointVolume), CLSCTX_INPROC_SERVER, NULL, + (void**) &stream->outVol); + + if (hResult != S_OK) + return paInvalidDevice; + + hResult = stream->out.client->GetBufferSize (&stream->out.bufferSize); + + if (hResult != S_OK) + return paInvalidDevice; + + hResult = stream->out.client->GetStreamLatency (&stream->out.latency); + + if (hResult != S_OK) + return paInvalidDevice; + + double periodsPerSecond = 1.0/nano100ToSeconds (stream->out.period); + + double samplesPerPeriod = (double) (stream->out.wavex.Format.nSamplesPerSec) /periodsPerSecond; + + //this is the number of samples that are required at each period + stream->out.framesPerHostCallback = stream->out.bufferSize; //(unsigned long)samplesPerPeriod;//unrelated to channels + + /* IMPLEMENT ME - establish which host formats are available */ + hostOutputSampleFormat = PaUtil_SelectClosestAvailableFormat (waveformatToPaFormat (&stream->out.wavex), outputSampleFormat); + } else { + outputChannelCount = 0; + outputSampleFormat = hostOutputSampleFormat = paInt16; /* Surpress 'uninitialized var' warnings. */ + } + + + + /* + IMPLEMENT ME: + + ( the following two checks are taken care of by PaUtil_InitializeBufferProcessor() FIXME - checks needed? ) + + - check that input device can support inputSampleFormat, or that + we have the capability to convert from outputSampleFormat to + a native format + + - check that output device can support outputSampleFormat, or that + we have the capability to convert from outputSampleFormat to + a native format + + - if a full duplex stream is requested, check that the combination + of input and output parameters is supported + + - check that the device supports sampleRate + + - alter sampleRate to a close allowable rate if possible / necessary + + - validate suggestedInputLatency and suggestedOutputLatency parameters, + use default values where necessary + */ + + + + /* validate platform specific flags */ + if ( (streamFlags & paPlatformSpecificFlags) != 0) + return paInvalidFlag; /* unexpected platform specific flag */ + + + + if (streamCallback) { + PaUtil_InitializeStreamRepresentation (&stream->streamRepresentation, + &paWasapi->callbackStreamInterface, streamCallback, userData); + } else { + PaUtil_InitializeStreamRepresentation (&stream->streamRepresentation, + &paWasapi->blockingStreamInterface, streamCallback, userData); + } + + PaUtil_InitializeCpuLoadMeasurer (&stream->cpuLoadMeasurer, sampleRate); + + + if (outputParameters && inputParameters) { + + //serious problem #1 + if (stream->in.period != stream->out.period) { + PRINT ( ("OpenStream: period discrepancy\n")); + goto error; + } + + //serious problem #2 + if (stream->out.framesPerHostCallback != stream->in.framesPerHostCallback) { + PRINT ( ("OpenStream: framesPerHostCallback discrepancy\n")); + goto error; + } + } + + unsigned long framesPerHostCallback = (outputParameters) ? + + stream->out.framesPerHostCallback: + stream->in.framesPerHostCallback; + + /* we assume a fixed host buffer size in this example, but the buffer processor + can also support bounded and unknown host buffer sizes by passing + paUtilBoundedHostBufferSize or paUtilUnknownHostBufferSize instead of + paUtilFixedHostBufferSize below. */ + + result = PaUtil_InitializeBufferProcessor (&stream->bufferProcessor, + inputChannelCount, inputSampleFormat, hostInputSampleFormat, + outputChannelCount, outputSampleFormat, hostOutputSampleFormat, + sampleRate, streamFlags, framesPerBuffer, + framesPerHostCallback, paUtilFixedHostBufferSize, + streamCallback, userData); + + if (result != paNoError) + goto error; + + + /* + IMPLEMENT ME: initialise the following fields with estimated or actual + values. + */ + stream->streamRepresentation.streamInfo.inputLatency = + PaUtil_GetBufferProcessorInputLatency (&stream->bufferProcessor) + + ( (inputParameters) ?nano100ToSeconds (stream->in.latency) :0); + + stream->streamRepresentation.streamInfo.outputLatency = + PaUtil_GetBufferProcessorOutputLatency (&stream->bufferProcessor) + + ( (outputParameters) ?nano100ToSeconds (stream->out.latency) :0); + + stream->streamRepresentation.streamInfo.sampleRate = sampleRate; + + + *s = (PaStream*) stream; + + + return result; + +error: + if (stream) + PaUtil_FreeMemory (stream); + + return result; +} + + + +/* + When CloseStream() is called, the multi-api layer ensures that + the stream has already been stopped or aborted. +*/ + +#define SAFE_RELEASE(punk) \ + if ((punk) != NULL) \ + { (punk)->Release(); (punk) = NULL; } + +static PaError CloseStream (PaStream* s) +{ + PaError result = paNoError; + PaWinWasapiStream *stream = (PaWinWasapiStream*) s; + + /* + IMPLEMENT ME: + - additional stream closing + cleanup + */ + + SAFE_RELEASE (stream->out.client); + SAFE_RELEASE (stream->in.client); + SAFE_RELEASE (stream->cclient); + SAFE_RELEASE (stream->rclient); + SAFE_RELEASE (stream->inVol); + SAFE_RELEASE (stream->outVol); + CloseHandle (stream->hThread); + CloseHandle (stream->hNotificationEvent); + + PaUtil_TerminateBufferProcessor (&stream->bufferProcessor); + PaUtil_TerminateStreamRepresentation (&stream->streamRepresentation); + PaUtil_FreeMemory (stream); + + return result; +} + +DWORD WINAPI ProcThread (void *client); + +static PaError StartStream (PaStream *s) +{ + PaError result = paNoError; + PaWinWasapiStream *stream = (PaWinWasapiStream*) s; + + PaUtil_ResetBufferProcessor (&stream->bufferProcessor); + + HRESULT hResult=S_OK; + + if (stream->out.client) { + hResult = stream->out.client->GetService (__uuidof (IAudioRenderClient), (void**) &stream->rclient); + logAUDCLNT_E (hResult); + + if (hResult!=S_OK) + return paUnanticipatedHostError; + } + + if (stream->in.client) { + hResult = stream->in.client->GetService (__uuidof (IAudioCaptureClient), (void**) &stream->cclient); + logAUDCLNT_E (hResult); + + if (hResult!=S_OK) + return paUnanticipatedHostError; + } + + // Create a thread for this client. + stream->hThread = CreateThread ( + NULL, // no security attribute + 0, // default stack size + ProcThread, + (LPVOID) stream, // thread parameter + 0, // not suspended + &stream->dwThreadId); // returns thread ID + + if (stream->hThread == NULL) + return paUnanticipatedHostError; + + return paNoError; +} + + +static PaError StopStream (PaStream *s) +{ + PaError result = paNoError; + PaWinWasapiStream *stream = (PaWinWasapiStream*) s; + + /* suppress unused variable warnings */ + stream->closeRequest = true; + //todo something MUCH better than this + + while (stream->closeRequest) + Sleep (100); + + /* IMPLEMENT ME, see portaudio.h for required behavior */ + + stream->running = false; + + return result; +} + + +static PaError AbortStream (PaStream *s) +{ + PaError result = paNoError; + PaWinWasapiStream *stream = (PaWinWasapiStream*) s; + + /* suppress unused variable warnings */ + stream->closeRequest = true; + //todo something MUCH better than this + + while (stream->closeRequest) + Sleep (100); + + /* IMPLEMENT ME, see portaudio.h for required behavior */ + + return result; +} + + +static PaError IsStreamStopped (PaStream *s) +{ + PaWinWasapiStream *stream = (PaWinWasapiStream*) s; + + return !stream->running; +} + + +static PaError IsStreamActive (PaStream *s) +{ + PaWinWasapiStream *stream = (PaWinWasapiStream*) s; + return stream->running; +} + + +static PaTime GetStreamTime (PaStream *s) +{ + PaWinWasapiStream *stream = (PaWinWasapiStream*) s; + + /* suppress unused variable warnings */ + (void) stream; + + /* IMPLEMENT ME, see portaudio.h for required behavior*/ + + //this is lame ds and mme does the same thing, quite useless method imho + //why dont we fetch the time in the pa callbacks? + //at least its doing to be clocked to something + return PaUtil_GetTime(); +} + + +static double GetStreamCpuLoad (PaStream* s) +{ + PaWinWasapiStream *stream = (PaWinWasapiStream*) s; + + return PaUtil_GetCpuLoad (&stream->cpuLoadMeasurer); +} + + +/* + As separate stream interfaces are used for blocking and callback + streams, the following functions can be guaranteed to only be called + for blocking streams. +*/ + +static PaError ReadStream (PaStream* s, + void *buffer, + unsigned long frames) +{ + PaWinWasapiStream *stream = (PaWinWasapiStream*) s; + + /* suppress unused variable warnings */ + (void) buffer; + (void) frames; + (void) stream; + + /* IMPLEMENT ME, see portaudio.h for required behavior*/ + + return paNoError; +} + + +static PaError WriteStream (PaStream* s, + const void *buffer, + unsigned long frames) +{ + PaWinWasapiStream *stream = (PaWinWasapiStream*) s; + + /* suppress unused variable warnings */ + (void) buffer; + (void) frames; + (void) stream; + + /* IMPLEMENT ME, see portaudio.h for required behavior*/ + + return paNoError; +} + + +static signed long GetStreamReadAvailable (PaStream* s) +{ + PaWinWasapiStream *stream = (PaWinWasapiStream*) s; + + /* suppress unused variable warnings */ + (void) stream; + + /* IMPLEMENT ME, see portaudio.h for required behavior*/ + + return 0; +} + + +static signed long GetStreamWriteAvailable (PaStream* s) +{ + PaWinWasapiStream *stream = (PaWinWasapiStream*) s; + + /* suppress unused variable warnings */ + (void) stream; + + /* IMPLEMENT ME, see portaudio.h for required behavior*/ + + return 0; +} + + + +/* + ExampleHostProcessingLoop() illustrates the kind of processing which may + occur in a host implementation. + +*/ +static void WaspiHostProcessingLoop (void *inputBuffer, long inputFrames, + void *outputBuffer, long outputFrames, + void *userData) +{ + PaWinWasapiStream *stream = (PaWinWasapiStream*) userData; + PaStreamCallbackTimeInfo timeInfo = {0,0,0}; /* IMPLEMENT ME */ + int callbackResult; + unsigned long framesProcessed; + + PaUtil_BeginCpuLoadMeasurement (&stream->cpuLoadMeasurer); + + + /* + IMPLEMENT ME: + - generate timing information + - handle buffer slips + */ + + /* + If you need to byte swap or shift inputBuffer to convert it into a + portaudio format, do it here. + */ + + + + PaUtil_BeginBufferProcessing (&stream->bufferProcessor, &timeInfo, 0 /* IMPLEMENT ME: pass underflow/overflow flags when necessary */); + + /* + depending on whether the host buffers are interleaved, non-interleaved + or a mixture, you will want to call PaUtil_SetInterleaved*Channels(), + PaUtil_SetNonInterleaved*Channel() or PaUtil_Set*Channel() here. + */ + + if (stream->bufferProcessor.inputChannelCount > 0) { + PaUtil_SetInputFrameCount (&stream->bufferProcessor, inputFrames); + PaUtil_SetInterleavedInputChannels (&stream->bufferProcessor, + 0, /* first channel of inputBuffer is channel 0 */ + inputBuffer, + 0); /* 0 - use inputChannelCount passed to init buffer processor */ + } + + if (stream->bufferProcessor.outputChannelCount > 0) { + PaUtil_SetOutputFrameCount (&stream->bufferProcessor, outputFrames); + PaUtil_SetInterleavedOutputChannels (&stream->bufferProcessor, + 0, /* first channel of outputBuffer is channel 0 */ + outputBuffer, + 0); /* 0 - use outputChannelCount passed to init buffer processor */ + } + + /* you must pass a valid value of callback result to PaUtil_EndBufferProcessing() + in general you would pass paContinue for normal operation, and + paComplete to drain the buffer processor's internal output buffer. + You can check whether the buffer processor's output buffer is empty + using PaUtil_IsBufferProcessorOuputEmpty( bufferProcessor ) + */ + callbackResult = paContinue; + + framesProcessed = PaUtil_EndBufferProcessing (&stream->bufferProcessor, &callbackResult); + + + /* + If you need to byte swap or shift outputBuffer to convert it to + host format, do it here. + */ + + PaUtil_EndCpuLoadMeasurement (&stream->cpuLoadMeasurer, framesProcessed); + + + if (callbackResult == paContinue) { + /* nothing special to do */ + } else if (callbackResult == paAbort) { + /* IMPLEMENT ME - finish playback immediately */ + + /* once finished, call the finished callback */ + if (stream->streamRepresentation.streamFinishedCallback != 0) + stream->streamRepresentation.streamFinishedCallback (stream->streamRepresentation.userData); + } else { + /* User callback has asked us to stop with paComplete or other non-zero value */ + + /* IMPLEMENT ME - finish playback once currently queued audio has completed */ + + /* once finished, call the finished callback */ + if (stream->streamRepresentation.streamFinishedCallback != 0) + stream->streamRepresentation.streamFinishedCallback (stream->streamRepresentation.userData); + } +} + + +void +MMCSS_activate() +{ + + DWORD stuff=0; + HANDLE thCarac = pAvSetMmThreadCharacteristics ("Pro Audio",&stuff); + + if (!thCarac) { + PRINT ( ("AvSetMmThreadCharacteristics failed!\n")); + } + + BOOL prio = pAvSetMmThreadPriority (thCarac,AVRT_PRIORITY_NORMAL); + + if (!prio) { + PRINT ( ("AvSetMmThreadPriority failed!\n")); + } + + //debug + { + HANDLE hh = GetCurrentThread(); + int currprio = GetThreadPriority (hh); + DWORD currclass = GetPriorityClass (GetCurrentProcess()); + PRINT ( ("currprio 0x%X currclass 0x%X\n",currprio,currclass)); + } +} + + +DWORD WINAPI +ProcThread (void* param) +{ + HRESULT hResult; + MMCSS_activate(); + + PaWinWasapiStream *stream = (PaWinWasapiStream*) param; + + stream->hNotificationEvent = CreateEvent (NULL, + FALSE, //bManualReset are we sure?? + FALSE, + "PAWASA"); + hResult = stream->out.client->SetEventHandle (stream->hNotificationEvent); + + if (hResult != S_OK) + logAUDCLNT_E (hResult); + + if (stream->out.client) { + hResult = stream->out.client->Start(); + + if (hResult != S_OK) + logAUDCLNT_E (hResult); + } + + stream->running = true; + + bool bOne = false; + + while (!stream->closeRequest) { + //lets wait but have a 1 second timeout + DWORD dwResult = WaitForSingleObject (stream->hNotificationEvent, 1000); + + switch (dwResult) { + + case WAIT_OBJECT_0: { + + unsigned long usingBS = stream->out.framesPerHostCallback; + + BYTE* indata = 0; + BYTE* outdata = 0; + + hResult = stream->rclient->GetBuffer (usingBS, &outdata); + + if (hResult != S_OK || !outdata) { + //logAUDCLNT_E(hResult); + //most probably shared mode and hResult=AUDCLNT_E_BUFFER_TOO_LARGE + UINT32 padding = 0; + hResult = stream->out.client->GetCurrentPadding (&padding); + + if (padding == 0) + break; + + usingBS = usingBS-padding; + + if (usingBS == 0) + break;//huh? + + hResult = stream->rclient->GetBuffer (usingBS, &outdata); + + if (hResult != S_OK) //what can we do NOW?? + break; + + //logAUDCLNT_E(hResult); + } + + WaspiHostProcessingLoop (indata, usingBS ,outdata, usingBS, stream); + + hResult = stream->rclient->ReleaseBuffer (usingBS, 0); + + if (hResult != S_OK) + logAUDCLNT_E (hResult); + + /* This was suggested, but in my tests it doesnt seem to improve the + locking behaviour some drivers have running in exclusive mode. + if(!ResetEvent(stream->hNotificationEvent)){ + logAUDCLNT_E(hResult); + } + */ + + } + + break; + + } + } + + stream->out.client->Stop(); + + stream->closeRequest = false; + + return 0; +} + + + + +#endif //VC 2005 + + + + +#if 0 + +if (bFirst) +{ + float masteur; + hResult = stream->outVol->GetMasterVolumeLevelScalar (&masteur); + + if (hResult != S_OK) + logAUDCLNT_E (hResult); + + float chan1, chan2; + + hResult = stream->outVol->GetChannelVolumeLevelScalar (0, &chan1); + + if (hResult != S_OK) + logAUDCLNT_E (hResult); + + hResult = stream->outVol->GetChannelVolumeLevelScalar (1, &chan2); + + if (hResult != S_OK) + logAUDCLNT_E (hResult); + + BOOL bMute; + + hResult = stream->outVol->GetMute (&bMute); + + if (hResult != S_OK) + logAUDCLNT_E (hResult); + + stream->outVol->SetMasterVolumeLevelScalar (0.5, NULL); + + stream->outVol->SetChannelVolumeLevelScalar (0, 0.5, NULL); + + stream->outVol->SetChannelVolumeLevelScalar (1, 0.5, NULL); + + stream->outVol->SetMute (FALSE, NULL); + + bFirst = false; +} +#endif \ No newline at end of file diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/hostapi/wdmks/pa_win_wdmks.c b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/wdmks/pa_win_wdmks.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/hostapi/wdmks/pa_win_wdmks.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/wdmks/pa_win_wdmks.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/hostapi/wdmks/readme.txt b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/wdmks/readme.txt similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/hostapi/wdmks/readme.txt rename to sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/wdmks/readme.txt diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/hostapi/wmme/pa_win_wmme.c b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/wmme/pa_win_wmme.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/hostapi/wmme/pa_win_wmme.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/wmme/pa_win_wmme.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/os/unix/pa_unix_hostapis.c b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/os/unix/pa_unix_hostapis.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/os/unix/pa_unix_hostapis.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/os/unix/pa_unix_hostapis.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/os/unix/pa_unix_util.c b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/os/unix/pa_unix_util.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/os/unix/pa_unix_util.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/os/unix/pa_unix_util.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/os/unix/pa_unix_util.h b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/os/unix/pa_unix_util.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/os/unix/pa_unix_util.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/os/unix/pa_unix_util.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/os/win/pa_win_hostapis.c b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/os/win/pa_win_hostapis.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/os/win/pa_win_hostapis.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/os/win/pa_win_hostapis.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/os/win/pa_win_util.c b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/os/win/pa_win_util.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/os/win/pa_win_util.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/os/win/pa_win_util.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/os/win/pa_win_waveformat.c b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/os/win/pa_win_waveformat.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/os/win/pa_win_waveformat.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/os/win/pa_win_waveformat.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/os/win/pa_win_wdmks_utils.c b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/os/win/pa_win_wdmks_utils.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/os/win/pa_win_wdmks_utils.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/os/win/pa_win_wdmks_utils.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/os/win/pa_win_wdmks_utils.h b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/os/win/pa_win_wdmks_utils.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/os/win/pa_win_wdmks_utils.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/os/win/pa_win_wdmks_utils.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/os/win/pa_x86_plain_converters.c b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/os/win/pa_x86_plain_converters.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/os/win/pa_x86_plain_converters.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/os/win/pa_x86_plain_converters.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/os/win/pa_x86_plain_converters.h b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/os/win/pa_x86_plain_converters.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/src/os/win/pa_x86_plain_converters.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/os/win/pa_x86_plain_converters.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/testcvs/changeme.txt b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/testcvs/changeme.txt similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/portaudio/testcvs/changeme.txt rename to sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/testcvs/changeme.txt diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/resample/COPYING b/sflphone-common/libs/pjproject-1.0.2/third_party/resample/COPYING similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/resample/COPYING rename to sflphone-common/libs/pjproject-1.0.2/third_party/resample/COPYING diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/resample/README.resample b/sflphone-common/libs/pjproject-1.0.2/third_party/resample/README.resample similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/resample/README.resample rename to sflphone-common/libs/pjproject-1.0.2/third_party/resample/README.resample diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/resample/include/resamplesubs.h b/sflphone-common/libs/pjproject-1.0.2/third_party/resample/include/resamplesubs.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/resample/include/resamplesubs.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/resample/include/resamplesubs.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/resample/src/largefilter.h b/sflphone-common/libs/pjproject-1.0.2/third_party/resample/src/largefilter.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/resample/src/largefilter.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/resample/src/largefilter.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/resample/src/libresample_dll.c b/sflphone-common/libs/pjproject-1.0.2/third_party/resample/src/libresample_dll.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/resample/src/libresample_dll.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/resample/src/libresample_dll.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/resample/src/resample.h b/sflphone-common/libs/pjproject-1.0.2/third_party/resample/src/resample.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/resample/src/resample.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/resample/src/resample.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/resample/src/resamplesubs.c b/sflphone-common/libs/pjproject-1.0.2/third_party/resample/src/resamplesubs.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/resample/src/resamplesubs.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/resample/src/resamplesubs.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/resample/src/smallfilter.h b/sflphone-common/libs/pjproject-1.0.2/third_party/resample/src/smallfilter.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/resample/src/smallfilter.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/resample/src/smallfilter.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/resample/src/stddefs.h b/sflphone-common/libs/pjproject-1.0.2/third_party/resample/src/stddefs.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/resample/src/stddefs.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/resample/src/stddefs.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/speex/AUTHORS b/sflphone-common/libs/pjproject-1.0.2/third_party/speex/AUTHORS similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/speex/AUTHORS rename to sflphone-common/libs/pjproject-1.0.2/third_party/speex/AUTHORS diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/speex/COPYING b/sflphone-common/libs/pjproject-1.0.2/third_party/speex/COPYING similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/speex/COPYING rename to sflphone-common/libs/pjproject-1.0.2/third_party/speex/COPYING diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/speex/include/speex/speex.h b/sflphone-common/libs/pjproject-1.0.2/third_party/speex/include/speex/speex.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/speex/include/speex/speex.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/speex/include/speex/speex.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/speex/include/speex/speex_bits.h b/sflphone-common/libs/pjproject-1.0.2/third_party/speex/include/speex/speex_bits.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/speex/include/speex/speex_bits.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/speex/include/speex/speex_bits.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/speex/include/speex/speex_buffer.h b/sflphone-common/libs/pjproject-1.0.2/third_party/speex/include/speex/speex_buffer.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/speex/include/speex/speex_buffer.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/speex/include/speex/speex_buffer.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/speex/include/speex/speex_callbacks.h b/sflphone-common/libs/pjproject-1.0.2/third_party/speex/include/speex/speex_callbacks.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/speex/include/speex/speex_callbacks.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/speex/include/speex/speex_callbacks.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/speex/include/speex/speex_config_types.h.in b/sflphone-common/libs/pjproject-1.0.2/third_party/speex/include/speex/speex_config_types.h.in similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/speex/include/speex/speex_config_types.h.in rename to sflphone-common/libs/pjproject-1.0.2/third_party/speex/include/speex/speex_config_types.h.in diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/speex/include/speex/speex_echo.h b/sflphone-common/libs/pjproject-1.0.2/third_party/speex/include/speex/speex_echo.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/speex/include/speex/speex_echo.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/speex/include/speex/speex_echo.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/speex/include/speex/speex_header.h b/sflphone-common/libs/pjproject-1.0.2/third_party/speex/include/speex/speex_header.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/speex/include/speex/speex_header.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/speex/include/speex/speex_header.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/speex/include/speex/speex_jitter.h b/sflphone-common/libs/pjproject-1.0.2/third_party/speex/include/speex/speex_jitter.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/speex/include/speex/speex_jitter.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/speex/include/speex/speex_jitter.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/speex/include/speex/speex_preprocess.h b/sflphone-common/libs/pjproject-1.0.2/third_party/speex/include/speex/speex_preprocess.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/speex/include/speex/speex_preprocess.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/speex/include/speex/speex_preprocess.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/speex/include/speex/speex_resampler.h b/sflphone-common/libs/pjproject-1.0.2/third_party/speex/include/speex/speex_resampler.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/speex/include/speex/speex_resampler.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/speex/include/speex/speex_resampler.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/speex/include/speex/speex_stereo.h b/sflphone-common/libs/pjproject-1.0.2/third_party/speex/include/speex/speex_stereo.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/speex/include/speex/speex_stereo.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/speex/include/speex/speex_stereo.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/speex/include/speex/speex_types.h b/sflphone-common/libs/pjproject-1.0.2/third_party/speex/include/speex/speex_types.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/speex/include/speex/speex_types.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/speex/include/speex/speex_types.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/_kiss_fft_guts.h b/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/_kiss_fft_guts.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/_kiss_fft_guts.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/_kiss_fft_guts.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/arch.h b/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/arch.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/arch.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/arch.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/bits.c b/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/bits.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/bits.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/bits.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/buffer.c b/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/buffer.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/buffer.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/buffer.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/cb_search.c b/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/cb_search.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/cb_search.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/cb_search.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/cb_search.h b/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/cb_search.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/cb_search.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/cb_search.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/cb_search_arm4.h b/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/cb_search_arm4.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/cb_search_arm4.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/cb_search_arm4.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/cb_search_bfin.h b/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/cb_search_bfin.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/cb_search_bfin.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/cb_search_bfin.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/cb_search_sse.h b/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/cb_search_sse.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/cb_search_sse.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/cb_search_sse.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/echo_diagnostic.m b/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/echo_diagnostic.m similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/echo_diagnostic.m rename to sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/echo_diagnostic.m diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/exc_10_16_table.c b/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/exc_10_16_table.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/exc_10_16_table.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/exc_10_16_table.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/exc_10_32_table.c b/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/exc_10_32_table.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/exc_10_32_table.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/exc_10_32_table.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/exc_20_32_table.c b/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/exc_20_32_table.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/exc_20_32_table.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/exc_20_32_table.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/exc_5_256_table.c b/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/exc_5_256_table.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/exc_5_256_table.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/exc_5_256_table.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/exc_5_64_table.c b/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/exc_5_64_table.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/exc_5_64_table.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/exc_5_64_table.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/exc_8_128_table.c b/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/exc_8_128_table.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/exc_8_128_table.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/exc_8_128_table.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/fftwrap.c b/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/fftwrap.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/fftwrap.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/fftwrap.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/fftwrap.h b/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/fftwrap.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/fftwrap.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/fftwrap.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/filterbank.c b/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/filterbank.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/filterbank.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/filterbank.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/filterbank.h b/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/filterbank.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/filterbank.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/filterbank.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/filters.c b/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/filters.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/filters.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/filters.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/filters.h b/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/filters.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/filters.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/filters.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/filters_arm4.h b/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/filters_arm4.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/filters_arm4.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/filters_arm4.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/filters_bfin.h b/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/filters_bfin.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/filters_bfin.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/filters_bfin.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/filters_sse.h b/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/filters_sse.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/filters_sse.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/filters_sse.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/fixed_arm4.h b/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/fixed_arm4.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/fixed_arm4.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/fixed_arm4.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/fixed_arm5e.h b/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/fixed_arm5e.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/fixed_arm5e.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/fixed_arm5e.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/fixed_bfin.h b/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/fixed_bfin.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/fixed_bfin.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/fixed_bfin.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/fixed_debug.h b/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/fixed_debug.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/fixed_debug.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/fixed_debug.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/fixed_generic.h b/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/fixed_generic.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/fixed_generic.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/fixed_generic.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/gain_table.c b/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/gain_table.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/gain_table.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/gain_table.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/gain_table_lbr.c b/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/gain_table_lbr.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/gain_table_lbr.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/gain_table_lbr.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/hexc_10_32_table.c b/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/hexc_10_32_table.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/hexc_10_32_table.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/hexc_10_32_table.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/hexc_table.c b/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/hexc_table.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/hexc_table.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/hexc_table.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/high_lsp_tables.c b/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/high_lsp_tables.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/high_lsp_tables.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/high_lsp_tables.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/jitter.c b/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/jitter.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/jitter.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/jitter.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/kiss_fft.c b/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/kiss_fft.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/kiss_fft.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/kiss_fft.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/kiss_fft.h b/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/kiss_fft.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/kiss_fft.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/kiss_fft.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/kiss_fftr.c b/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/kiss_fftr.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/kiss_fftr.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/kiss_fftr.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/kiss_fftr.h b/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/kiss_fftr.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/kiss_fftr.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/kiss_fftr.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/lpc.c b/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/lpc.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/lpc.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/lpc.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/lpc.h b/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/lpc.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/lpc.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/lpc.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/lpc_bfin.h b/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/lpc_bfin.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/lpc_bfin.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/lpc_bfin.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/lsp.c b/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/lsp.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/lsp.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/lsp.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/lsp.h b/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/lsp.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/lsp.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/lsp.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/lsp_bfin.h b/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/lsp_bfin.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/lsp_bfin.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/lsp_bfin.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/lsp_tables_nb.c b/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/lsp_tables_nb.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/lsp_tables_nb.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/lsp_tables_nb.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/ltp.c b/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/ltp.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/ltp.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/ltp.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/ltp.h b/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/ltp.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/ltp.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/ltp.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/ltp_arm4.h b/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/ltp_arm4.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/ltp_arm4.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/ltp_arm4.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/ltp_bfin.h b/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/ltp_bfin.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/ltp_bfin.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/ltp_bfin.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/ltp_sse.h b/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/ltp_sse.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/ltp_sse.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/ltp_sse.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/math_approx.h b/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/math_approx.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/math_approx.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/math_approx.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/mdf.c b/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/mdf.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/mdf.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/mdf.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/misc_bfin.h b/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/misc_bfin.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/misc_bfin.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/misc_bfin.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/modes.c b/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/modes.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/modes.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/modes.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/modes.h b/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/modes.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/modes.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/modes.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/modes_wb.c b/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/modes_wb.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/modes_wb.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/modes_wb.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/nb_celp.c b/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/nb_celp.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/nb_celp.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/nb_celp.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/nb_celp.h b/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/nb_celp.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/nb_celp.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/nb_celp.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/os_support.h b/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/os_support.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/os_support.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/os_support.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/preprocess.c b/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/preprocess.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/preprocess.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/preprocess.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/pseudofloat.h b/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/pseudofloat.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/pseudofloat.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/pseudofloat.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/quant_lsp.c b/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/quant_lsp.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/quant_lsp.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/quant_lsp.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/quant_lsp.h b/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/quant_lsp.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/quant_lsp.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/quant_lsp.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/quant_lsp_bfin.h b/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/quant_lsp_bfin.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/quant_lsp_bfin.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/quant_lsp_bfin.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/resample.c b/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/resample.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/resample.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/resample.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/resample_sse.h b/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/resample_sse.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/resample_sse.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/resample_sse.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/sb_celp.c b/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/sb_celp.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/sb_celp.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/sb_celp.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/sb_celp.h b/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/sb_celp.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/sb_celp.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/sb_celp.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/scal.c b/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/scal.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/scal.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/scal.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/smallft.c b/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/smallft.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/smallft.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/smallft.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/smallft.h b/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/smallft.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/smallft.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/smallft.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/speex.c b/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/speex.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/speex.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/speex.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/speex_callbacks.c b/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/speex_callbacks.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/speex_callbacks.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/speex_callbacks.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/speex_header.c b/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/speex_header.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/speex_header.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/speex_header.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/stack_alloc.h b/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/stack_alloc.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/stack_alloc.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/stack_alloc.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/stereo.c b/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/stereo.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/stereo.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/stereo.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/testdenoise.c b/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/testdenoise.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/testdenoise.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/testdenoise.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/testecho.c b/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/testecho.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/testecho.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/testecho.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/testenc.c b/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/testenc.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/testenc.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/testenc.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/testenc_uwb.c b/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/testenc_uwb.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/testenc_uwb.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/testenc_uwb.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/testenc_wb.c b/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/testenc_wb.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/testenc_wb.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/testenc_wb.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/testjitter.c b/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/testjitter.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/testjitter.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/testjitter.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/testresample.c b/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/testresample.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/testresample.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/testresample.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/vbr.c b/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/vbr.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/vbr.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/vbr.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/vbr.h b/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/vbr.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/vbr.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/vbr.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/vorbis_psy.c b/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/vorbis_psy.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/vorbis_psy.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/vorbis_psy.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/vorbis_psy.h b/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/vorbis_psy.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/vorbis_psy.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/vorbis_psy.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/vq.c b/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/vq.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/vq.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/vq.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/vq.h b/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/vq.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/vq.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/vq.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/vq_arm4.h b/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/vq_arm4.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/vq_arm4.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/vq_arm4.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/vq_bfin.h b/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/vq_bfin.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/vq_bfin.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/vq_bfin.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/vq_sse.h b/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/vq_sse.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/vq_sse.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/vq_sse.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/window.c b/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/window.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/speex/libspeex/window.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/window.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/speex/symbian/config.h b/sflphone-common/libs/pjproject-1.0.2/third_party/speex/symbian/config.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/speex/symbian/config.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/speex/symbian/config.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/speex/win32/config.h b/sflphone-common/libs/pjproject-1.0.2/third_party/speex/win32/config.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/speex/win32/config.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/speex/win32/config.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/srtp/CHANGES b/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/CHANGES similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/srtp/CHANGES rename to sflphone-common/libs/pjproject-1.0.2/third_party/srtp/CHANGES diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/srtp/LICENSE b/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/LICENSE similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/srtp/LICENSE rename to sflphone-common/libs/pjproject-1.0.2/third_party/srtp/LICENSE diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/srtp/README b/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/README similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/srtp/README rename to sflphone-common/libs/pjproject-1.0.2/third_party/srtp/README diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/srtp/TODO b/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/TODO similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/srtp/TODO rename to sflphone-common/libs/pjproject-1.0.2/third_party/srtp/TODO diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/srtp/VERSION b/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/VERSION similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/srtp/VERSION rename to sflphone-common/libs/pjproject-1.0.2/third_party/srtp/VERSION diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/srtp/config.guess b/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/config.guess similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/srtp/config.guess rename to sflphone-common/libs/pjproject-1.0.2/third_party/srtp/config.guess diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/srtp/config.h_win32vc7 b/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/config.h_win32vc7 similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/srtp/config.h_win32vc7 rename to sflphone-common/libs/pjproject-1.0.2/third_party/srtp/config.h_win32vc7 diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/srtp/config.hw b/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/config.hw similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/srtp/config.hw rename to sflphone-common/libs/pjproject-1.0.2/third_party/srtp/config.hw diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/srtp/config.sub b/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/config.sub similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/srtp/config.sub rename to sflphone-common/libs/pjproject-1.0.2/third_party/srtp/config.sub diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/srtp/config_in.h b/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/config_in.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/srtp/config_in.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/srtp/config_in.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/srtp/configure b/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/configure similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/srtp/configure rename to sflphone-common/libs/pjproject-1.0.2/third_party/srtp/configure diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/srtp/configure.in b/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/configure.in similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/srtp/configure.in rename to sflphone-common/libs/pjproject-1.0.2/third_party/srtp/configure.in diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/Makefile b/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/Makefile similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/Makefile rename to sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/Makefile diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/VERSION b/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/VERSION similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/VERSION rename to sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/VERSION diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/ae_xfm/xfm.c b/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/ae_xfm/xfm.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/ae_xfm/xfm.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/ae_xfm/xfm.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/cipher/aes.c b/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/cipher/aes.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/cipher/aes.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/cipher/aes.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/cipher/aes_cbc.c b/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/cipher/aes_cbc.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/cipher/aes_cbc.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/cipher/aes_cbc.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/cipher/aes_icm.c b/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/cipher/aes_icm.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/cipher/aes_icm.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/cipher/aes_icm.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/cipher/cipher.c b/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/cipher/cipher.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/cipher/cipher.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/cipher/cipher.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/cipher/null_cipher.c b/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/cipher/null_cipher.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/cipher/null_cipher.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/cipher/null_cipher.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/hash/auth.c b/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/hash/auth.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/hash/auth.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/hash/auth.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/hash/hmac.c b/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/hash/hmac.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/hash/hmac.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/hash/hmac.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/hash/null_auth.c b/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/hash/null_auth.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/hash/null_auth.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/hash/null_auth.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/hash/sha1.c b/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/hash/sha1.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/hash/sha1.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/hash/sha1.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/include/aes.h b/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/include/aes.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/include/aes.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/include/aes.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/include/aes_cbc.h b/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/include/aes_cbc.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/include/aes_cbc.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/include/aes_cbc.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/include/aes_icm.h b/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/include/aes_icm.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/include/aes_icm.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/include/aes_icm.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/include/alloc.h b/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/include/alloc.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/include/alloc.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/include/alloc.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/include/auth.h b/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/include/auth.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/include/auth.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/include/auth.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/include/cipher.h b/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/include/cipher.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/include/cipher.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/include/cipher.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/include/crypto.h b/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/include/crypto.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/include/crypto.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/include/crypto.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/include/crypto_kernel.h b/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/include/crypto_kernel.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/include/crypto_kernel.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/include/crypto_kernel.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/include/crypto_math.h b/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/include/crypto_math.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/include/crypto_math.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/include/crypto_math.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/include/crypto_types.h b/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/include/crypto_types.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/include/crypto_types.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/include/crypto_types.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/include/cryptoalg.h b/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/include/cryptoalg.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/include/cryptoalg.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/include/cryptoalg.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/include/datatypes.h b/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/include/datatypes.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/include/datatypes.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/include/datatypes.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/include/err.h b/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/include/err.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/include/err.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/include/err.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/include/gf2_8.h b/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/include/gf2_8.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/include/gf2_8.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/include/gf2_8.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/include/hmac.h b/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/include/hmac.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/include/hmac.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/include/hmac.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/include/integers.h b/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/include/integers.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/include/integers.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/include/integers.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/include/kernel_compat.h b/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/include/kernel_compat.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/include/kernel_compat.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/include/kernel_compat.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/include/key.h b/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/include/key.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/include/key.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/include/key.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/include/null_auth.h b/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/include/null_auth.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/include/null_auth.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/include/null_auth.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/include/null_cipher.h b/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/include/null_cipher.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/include/null_cipher.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/include/null_cipher.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/include/prng.h b/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/include/prng.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/include/prng.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/include/prng.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/include/rand_source.h b/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/include/rand_source.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/include/rand_source.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/include/rand_source.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/include/rdb.h b/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/include/rdb.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/include/rdb.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/include/rdb.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/include/rdbx.h b/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/include/rdbx.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/include/rdbx.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/include/rdbx.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/include/sha1.h b/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/include/sha1.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/include/sha1.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/include/sha1.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/include/stat.h b/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/include/stat.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/include/stat.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/include/stat.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/include/xfm.h b/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/include/xfm.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/include/xfm.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/include/xfm.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/kernel/alloc.c b/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/kernel/alloc.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/kernel/alloc.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/kernel/alloc.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/kernel/crypto_kernel.c b/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/kernel/crypto_kernel.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/kernel/crypto_kernel.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/kernel/crypto_kernel.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/kernel/err.c b/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/kernel/err.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/kernel/err.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/kernel/err.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/kernel/key.c b/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/kernel/key.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/kernel/key.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/kernel/key.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/math/datatypes.c b/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/math/datatypes.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/math/datatypes.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/math/datatypes.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/math/gf2_8.c b/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/math/gf2_8.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/math/gf2_8.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/math/gf2_8.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/math/math.c b/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/math/math.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/math/math.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/math/math.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/math/stat.c b/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/math/stat.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/math/stat.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/math/stat.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/replay/rdb.c b/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/replay/rdb.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/replay/rdb.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/replay/rdb.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/replay/rdbx.c b/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/replay/rdbx.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/replay/rdbx.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/replay/rdbx.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/replay/ut_sim.c b/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/replay/ut_sim.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/replay/ut_sim.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/replay/ut_sim.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/rng/ctr_prng.c b/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/rng/ctr_prng.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/rng/ctr_prng.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/rng/ctr_prng.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/rng/prng.c b/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/rng/prng.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/rng/prng.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/rng/prng.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/rng/rand_linux_kernel.c b/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/rng/rand_linux_kernel.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/rng/rand_linux_kernel.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/rng/rand_linux_kernel.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/rng/rand_source.c b/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/rng/rand_source.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/rng/rand_source.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/rng/rand_source.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/test/aes_calc.c b/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/test/aes_calc.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/test/aes_calc.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/test/aes_calc.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/test/auth_driver.c b/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/test/auth_driver.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/test/auth_driver.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/test/auth_driver.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/test/cipher_driver.c b/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/test/cipher_driver.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/test/cipher_driver.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/test/cipher_driver.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/test/datatypes_driver.c b/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/test/datatypes_driver.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/test/datatypes_driver.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/test/datatypes_driver.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/test/env.c b/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/test/env.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/test/env.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/test/env.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/test/kernel_driver.c b/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/test/kernel_driver.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/test/kernel_driver.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/test/kernel_driver.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/test/rand_gen.c b/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/test/rand_gen.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/test/rand_gen.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/test/rand_gen.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/test/sha1_driver.c b/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/test/sha1_driver.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/test/sha1_driver.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/test/sha1_driver.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/test/stat_driver.c b/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/test/stat_driver.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/srtp/crypto/test/stat_driver.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/test/stat_driver.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/srtp/include/getopt_s.h b/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/include/getopt_s.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/srtp/include/getopt_s.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/srtp/include/getopt_s.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/srtp/include/rtp.h b/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/include/rtp.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/srtp/include/rtp.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/srtp/include/rtp.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/srtp/include/rtp_priv.h b/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/include/rtp_priv.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/srtp/include/rtp_priv.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/srtp/include/rtp_priv.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/srtp/include/srtp.h b/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/include/srtp.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/srtp/include/srtp.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/srtp/include/srtp.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/srtp/include/srtp_priv.h b/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/include/srtp_priv.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/srtp/include/srtp_priv.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/srtp/include/srtp_priv.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/srtp/include/ut_sim.h b/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/include/ut_sim.h similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/srtp/include/ut_sim.h rename to sflphone-common/libs/pjproject-1.0.2/third_party/srtp/include/ut_sim.h diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/srtp/install-sh b/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/install-sh similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/srtp/install-sh rename to sflphone-common/libs/pjproject-1.0.2/third_party/srtp/install-sh diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/srtp/pjlib/srtp_err.c b/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/pjlib/srtp_err.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/srtp/pjlib/srtp_err.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/srtp/pjlib/srtp_err.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/srtp/srtp.def b/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/srtp.def similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/srtp/srtp.def rename to sflphone-common/libs/pjproject-1.0.2/third_party/srtp/srtp.def diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/srtp/srtp.vcproj b/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/srtp.vcproj similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/srtp/srtp.vcproj rename to sflphone-common/libs/pjproject-1.0.2/third_party/srtp/srtp.vcproj diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/srtp/srtp/srtp.c b/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/srtp/srtp.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/srtp/srtp/srtp.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/srtp/srtp/srtp.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/srtp/srtp7.sln b/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/srtp7.sln similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/srtp/srtp7.sln rename to sflphone-common/libs/pjproject-1.0.2/third_party/srtp/srtp7.sln diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/srtp/srtp7.vcproj b/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/srtp7.vcproj similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/srtp/srtp7.vcproj rename to sflphone-common/libs/pjproject-1.0.2/third_party/srtp/srtp7.vcproj diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/srtp/tables/aes_tables.c b/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/tables/aes_tables.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/srtp/tables/aes_tables.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/srtp/tables/aes_tables.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/srtp/test/dtls_srtp_driver.c b/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/test/dtls_srtp_driver.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/srtp/test/dtls_srtp_driver.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/srtp/test/dtls_srtp_driver.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/srtp/test/getopt_s.c b/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/test/getopt_s.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/srtp/test/getopt_s.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/srtp/test/getopt_s.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/srtp/test/lfsr.c b/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/test/lfsr.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/srtp/test/lfsr.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/srtp/test/lfsr.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/srtp/test/rdbx_driver.c b/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/test/rdbx_driver.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/srtp/test/rdbx_driver.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/srtp/test/rdbx_driver.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/srtp/test/replay_driver.c b/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/test/replay_driver.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/srtp/test/replay_driver.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/srtp/test/replay_driver.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/srtp/test/roc_driver.c b/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/test/roc_driver.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/srtp/test/roc_driver.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/srtp/test/roc_driver.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/srtp/test/rtp.c b/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/test/rtp.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/srtp/test/rtp.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/srtp/test/rtp.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/srtp/test/rtpw.c b/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/test/rtpw.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/srtp/test/rtpw.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/srtp/test/rtpw.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/srtp/test/rtpw_test.sh b/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/test/rtpw_test.sh similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/srtp/test/rtpw_test.sh rename to sflphone-common/libs/pjproject-1.0.2/third_party/srtp/test/rtpw_test.sh diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/srtp/test/srtp_driver.c b/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/test/srtp_driver.c similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/srtp/test/srtp_driver.c rename to sflphone-common/libs/pjproject-1.0.2/third_party/srtp/test/srtp_driver.c diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/srtp/timing b/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/timing similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/srtp/timing rename to sflphone-common/libs/pjproject-1.0.2/third_party/srtp/timing diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/srtp/undos.sh b/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/undos.sh similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/srtp/undos.sh rename to sflphone-common/libs/pjproject-1.0.2/third_party/srtp/undos.sh diff --git a/sflphone-common/libs/pjproject-1.0.1/third_party/srtp/update.sh b/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/update.sh similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/third_party/srtp/update.sh rename to sflphone-common/libs/pjproject-1.0.2/third_party/srtp/update.sh diff --git a/sflphone-common/libs/pjproject-1.0.1/user.mak.sample b/sflphone-common/libs/pjproject-1.0.2/user.mak.sample similarity index 100% rename from sflphone-common/libs/pjproject-1.0.1/user.mak.sample rename to sflphone-common/libs/pjproject-1.0.2/user.mak.sample diff --git a/sflphone-common/libs/utilspp/singleton/LifetimeLibrary.cpp b/sflphone-common/libs/utilspp/singleton/LifetimeLibrary.cpp index e58932ebde4692b55b67fdce9b569bea80b5b5bc..7f7afac3b23beb5eeeba4ee3c951a1dca5d81c48 100644 --- a/sflphone-common/libs/utilspp/singleton/LifetimeLibrary.cpp +++ b/sflphone-common/libs/utilspp/singleton/LifetimeLibrary.cpp @@ -2,71 +2,70 @@ #include "LifetimeLibrary.hpp" utilspp::LifetimeLibraryImpl::LifetimeLibraryImpl() - : - mTrackerArray( NULL ), - mNbElements( 0 ) + : + mTrackerArray (NULL), + mNbElements (0) {} utilspp::LifetimeLibraryImpl::~LifetimeLibraryImpl() { - terminate(); + terminate(); } void -utilspp::LifetimeLibraryImpl::add( utilspp::PrivateMembers::LifetimeTracker *tracker ) +utilspp::LifetimeLibraryImpl::add (utilspp::PrivateMembers::LifetimeTracker *tracker) { - utilspp::PrivateMembers::TrackerArray newArray = static_cast< - utilspp::PrivateMembers::TrackerArray >(std::realloc(mTrackerArray, - mNbElements + 1)); - if( newArray == NULL ) - { - throw std::bad_alloc(); - } + utilspp::PrivateMembers::TrackerArray newArray = static_cast< + utilspp::PrivateMembers::TrackerArray > (std::realloc (mTrackerArray, + mNbElements + 1)); - mTrackerArray = newArray; + if (newArray == NULL) { + throw std::bad_alloc(); + } - utilspp::PrivateMembers::TrackerArray pos = - std::upper_bound(mTrackerArray, - mTrackerArray + mNbElements, - tracker, - &utilspp::PrivateMembers::LifetimeTracker::compare); - std::copy_backward(pos, - mTrackerArray + mNbElements, - mTrackerArray + mNbElements + 1); - - *pos = tracker; - mNbElements++; + mTrackerArray = newArray; + + utilspp::PrivateMembers::TrackerArray pos = + std::upper_bound (mTrackerArray, + mTrackerArray + mNbElements, + tracker, + &utilspp::PrivateMembers::LifetimeTracker::compare); + std::copy_backward (pos, + mTrackerArray + mNbElements, + mTrackerArray + mNbElements + 1); + + *pos = tracker; + mNbElements++; }; void utilspp::LifetimeLibraryImpl::terminate() { - //The number of elements MUST always be equal or over zero. - assert( mNbElements >= 0 ); + //The number of elements MUST always be equal or over zero. + assert (mNbElements >= 0); + + while (mNbElements > 0) { + //At this point the mTrackerArray MUST not be NULL. + assert (mTrackerArray != NULL); + + //Pick the element at the top of the stack. + utilspp::PrivateMembers::LifetimeTracker* top = + mTrackerArray[mNbElements - 1]; - while( mNbElements > 0 ) - { - //At this point the mTrackerArray MUST not be NULL. - assert( mTrackerArray != NULL ); - - //Pick the element at the top of the stack. - utilspp::PrivateMembers::LifetimeTracker* top = - mTrackerArray[mNbElements - 1]; + //Remove that object off the stack. + //Don't check errors-realloc with less memory, cause that can't fail. + mTrackerArray = + static_cast< utilspp::PrivateMembers::TrackerArray > + (std::realloc (mTrackerArray, --mNbElements)); - //Remove that object off the stack. - //Don't check errors-realloc with less memory, cause that can't fail. - mTrackerArray = - static_cast< utilspp::PrivateMembers::TrackerArray > - (std::realloc(mTrackerArray, --mNbElements)); - - //Destroy the element. - delete top; - } + //Destroy the element. + delete top; + } } -unsigned int -utilspp::getLongevity( utilspp::LifetimeLibraryImpl * ) +unsigned int +utilspp::getLongevity (utilspp::LifetimeLibraryImpl *) { - return 0; + return 0; } diff --git a/sflphone-common/libs/utilspp/singleton/PrivateMembers.cpp b/sflphone-common/libs/utilspp/singleton/PrivateMembers.cpp index 901c9bcc1de5cca25b5d5d2d7b3c2ee93df7c04b..194fbda664470c36a6f0d4264c8058726d82139d 100644 --- a/sflphone-common/libs/utilspp/singleton/PrivateMembers.cpp +++ b/sflphone-common/libs/utilspp/singleton/PrivateMembers.cpp @@ -3,44 +3,44 @@ #include "PrivateMembers.hpp" utilspp::PrivateMembers::TrackerArray - utilspp::PrivateMembers::mTrackerArray = NULL; +utilspp::PrivateMembers::mTrackerArray = NULL; int utilspp::PrivateMembers::mNbElements = 0; -utilspp::PrivateMembers::LifetimeTracker::LifetimeTracker( unsigned int - longevity ) -: -mLongevity( longevity ) +utilspp::PrivateMembers::LifetimeTracker::LifetimeTracker (unsigned int + longevity) + : + mLongevity (longevity) {} utilspp::PrivateMembers::LifetimeTracker::~LifetimeTracker() {} bool -utilspp::PrivateMembers::LifetimeTracker::compare( - const LifetimeTracker *l, - const LifetimeTracker *r - ) +utilspp::PrivateMembers::LifetimeTracker::compare ( + const LifetimeTracker *l, + const LifetimeTracker *r +) { - return l->mLongevity < r->mLongevity; + return l->mLongevity < r->mLongevity; } void utilspp::PrivateMembers::atExitFunc() { - assert((mTrackerArray != NULL) && - (mNbElements > 0)); + assert ( (mTrackerArray != NULL) && + (mNbElements > 0)); - //Pick the element at the top of the stack. - LifetimeTracker* top = mTrackerArray[mNbElements - 1]; + //Pick the element at the top of the stack. + LifetimeTracker* top = mTrackerArray[mNbElements - 1]; - //Remove that object off the stack. - //Don't check errors-realloc with less memory, cause that can't fail. - mTrackerArray = static_cast< - utilspp::PrivateMembers::TrackerArray >(std::realloc(mTrackerArray, - --mNbElements)); + //Remove that object off the stack. + //Don't check errors-realloc with less memory, cause that can't fail. + mTrackerArray = static_cast< + utilspp::PrivateMembers::TrackerArray > (std::realloc (mTrackerArray, + --mNbElements)); - //Destroy the element. - delete top; + //Destroy the element. + delete top; } diff --git a/sflphone-common/po/de.po b/sflphone-common/po/de.po index 4371c318d078fe25c7b44ea8d964d4412ac0e597..0cc3e2d8012ecbc7e454c023882b58875ad7c06c 100644 --- a/sflphone-common/po/de.po +++ b/sflphone-common/po/de.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: sflphone\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-05-21 10:45-0400\n" +"POT-Creation-Date: 2009-06-12 18:05-0400\n" "PO-Revision-Date: 2009-01-08 10:46-0500\n" "Last-Translator: Sven Werlen <sven.werlen@savoirfairelinux.com>\n" "Language-Team: SavoirFaire Linux Inc <sflphoneteam@savoirfairelinux.com>\n" @@ -17,50 +17,50 @@ msgstr "" "X-Generator: Lokalize 0.2\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" -#: ../../sflphone-client-gnome/src/accountlist.c:169 +#: ../../sflphone-client-gnome/src/accountlist.c:175 msgid "Registered" msgstr "registriert" -#: ../../sflphone-client-gnome/src/accountlist.c:172 +#: ../../sflphone-client-gnome/src/accountlist.c:178 msgid "Not Registered" msgstr "nicht registriert" -#: ../../sflphone-client-gnome/src/accountlist.c:175 +#: ../../sflphone-client-gnome/src/accountlist.c:181 msgid "Trying..." msgstr "Am versuchen..." -#: ../../sflphone-client-gnome/src/accountlist.c:178 -#: ../../sflphone-client-gnome/src/sflnotify.c:176 -#: ../../sflphone-client-gnome/src/sflnotify.c:217 +#: ../../sflphone-client-gnome/src/accountlist.c:184 +#: ../../sflphone-client-gnome/src/sflnotify.c:131 +#: ../../sflphone-client-gnome/src/sflnotify.c:148 msgid "Error" msgstr "Fehler" -#: ../../sflphone-client-gnome/src/accountlist.c:181 +#: ../../sflphone-client-gnome/src/accountlist.c:187 msgid "Bad authentification" msgstr "Falsche Authentifizierung" -#: ../../sflphone-client-gnome/src/accountlist.c:184 +#: ../../sflphone-client-gnome/src/accountlist.c:190 msgid "Network unreachable" msgstr "Kein Netzwerk" -#: ../../sflphone-client-gnome/src/accountlist.c:187 +#: ../../sflphone-client-gnome/src/accountlist.c:193 msgid "Host unreachable" msgstr "Host unerreichbar" -#: ../../sflphone-client-gnome/src/accountlist.c:190 +#: ../../sflphone-client-gnome/src/accountlist.c:196 msgid "Stun configuration error" msgstr "Stun: Konfigurationsfehler" -#: ../../sflphone-client-gnome/src/accountlist.c:193 +#: ../../sflphone-client-gnome/src/accountlist.c:199 msgid "Stun server invalid" msgstr "Ungültiger Stun Server" -#: ../../sflphone-client-gnome/src/accountlist.c:196 +#: ../../sflphone-client-gnome/src/accountlist.c:202 msgid "Invalid" msgstr "Ungültig" #: ../../sflphone-client-gnome/src/actions.c:55 -#: ../../sflphone-client-gnome/src/sflnotify.c:108 +#: ../../sflphone-client-gnome/src/sflnotify.c:94 #, c-format msgid "%d voice mails" msgstr "%d Voice Nachrichten" @@ -76,11 +76,10 @@ msgid "Using %s (%s)" msgstr "" #: ../../sflphone-client-gnome/src/actions.c:87 -#, fuzzy msgid "No registered account" -msgstr "Sie haben noch kein registriertes Konto" +msgstr "Kein registriertes Konto" -#: ../../sflphone-client-gnome/src/actions.c:229 +#: ../../sflphone-client-gnome/src/actions.c:232 msgid "" "Unable to connect to the SFLphone server.\n" "Make sure the daemon is running." @@ -88,17 +87,17 @@ msgstr "" "SFLphone Server kann nicht verbunden werden. Stellen Sie sicher, dass der " "Dämon läuft." -#: ../../sflphone-client-gnome/src/actions.c:787 +#: ../../sflphone-client-gnome/src/actions.c:807 #, c-format msgid "IP call - %s" msgstr "" -#: ../../sflphone-client-gnome/src/actions.c:790 +#: ../../sflphone-client-gnome/src/actions.c:810 #, c-format msgid "Using %s (%s) - Codec: %s" msgstr "" -#: ../../sflphone-client-gnome/src/actions.c:880 +#: ../../sflphone-client-gnome/src/actions.c:900 #, c-format msgid "" "<b>Error: No audio codecs found.\n" @@ -112,7 +111,7 @@ msgstr "" "Verzeichniss ( <i>%s</i> ) gespeichert werden." #: ../../sflphone-client-gnome/src/assistant.c:35 -#, fuzzy, c-format +#, c-format msgid "" "This assistant is now finished.\n" "You can at any time check your registration state or modify your accounts " @@ -130,157 +129,152 @@ msgstr "" "Alias : %s\n" "Server : %s\n" "Benutzername : %s\n" -"Passwort : %s" -#: ../../sflphone-client-gnome/src/assistant.c:160 +#: ../../sflphone-client-gnome/src/assistant.c:159 msgid "SFLphone account configuration wizard" msgstr "SFLphone Konto (Konfigurationsassistent)" -#: ../../sflphone-client-gnome/src/assistant.c:186 +#: ../../sflphone-client-gnome/src/assistant.c:185 msgid "Welcome to SFLphone!" msgstr "Wilkommen zu SFLphone!" -#: ../../sflphone-client-gnome/src/assistant.c:187 +#: ../../sflphone-client-gnome/src/assistant.c:186 msgid "This installation wizard will help you configure an account." msgstr "" "The Installationsassistent wird Ihnen helfen, ein Konto zu konfigurieren." -#: ../../sflphone-client-gnome/src/assistant.c:201 +#: ../../sflphone-client-gnome/src/assistant.c:200 msgid "VoIP Protocols" msgstr "VoIP Protokoll" -#: ../../sflphone-client-gnome/src/assistant.c:201 +#: ../../sflphone-client-gnome/src/assistant.c:200 msgid "Select an account type:" msgstr "Kontotyp auswählen:" -#: ../../sflphone-client-gnome/src/assistant.c:219 +#: ../../sflphone-client-gnome/src/assistant.c:218 msgid "Account" msgstr "Konto" -#: ../../sflphone-client-gnome/src/assistant.c:219 +#: ../../sflphone-client-gnome/src/assistant.c:218 msgid "Please select one of the following option:" msgstr "Bitte eine Option auswählen:" -#: ../../sflphone-client-gnome/src/assistant.c:221 +#: ../../sflphone-client-gnome/src/assistant.c:220 msgid "Create a free SIP/IAX2 account on sflphone.org" msgstr "" -#: ../../sflphone-client-gnome/src/assistant.c:223 +#: ../../sflphone-client-gnome/src/assistant.c:222 msgid "Register an existing SIP or IAX2 account" msgstr "" -#: ../../sflphone-client-gnome/src/assistant.c:236 +#: ../../sflphone-client-gnome/src/assistant.c:235 msgid "SIP account configuration" msgstr "Konfiguration des SIP-Konto" -#: ../../sflphone-client-gnome/src/assistant.c:236 -#: ../../sflphone-client-gnome/src/assistant.c:332 +#: ../../sflphone-client-gnome/src/assistant.c:235 +#: ../../sflphone-client-gnome/src/assistant.c:331 msgid "Please fill the following information:" msgstr "Folgende Informationen bitte ausfühlen:" -#: ../../sflphone-client-gnome/src/assistant.c:244 -#: ../../sflphone-client-gnome/src/assistant.c:340 -#: ../../sflphone-client-gnome/src/config/accountwindow.c:148 +#: ../../sflphone-client-gnome/src/assistant.c:243 +#: ../../sflphone-client-gnome/src/assistant.c:339 +#: ../../sflphone-client-gnome/src/config/accountwindow.c:153 msgid "_Alias" msgstr "_Alias" -#: ../../sflphone-client-gnome/src/assistant.c:252 -#: ../../sflphone-client-gnome/src/assistant.c:348 -#: ../../sflphone-client-gnome/src/config/accountwindow.c:184 +#: ../../sflphone-client-gnome/src/assistant.c:251 +#: ../../sflphone-client-gnome/src/assistant.c:347 +#: ../../sflphone-client-gnome/src/config/accountwindow.c:189 msgid "_Host name" msgstr "_Hostname" -#: ../../sflphone-client-gnome/src/assistant.c:260 -#: ../../sflphone-client-gnome/src/assistant.c:356 -#: ../../sflphone-client-gnome/src/config/accountwindow.c:192 +#: ../../sflphone-client-gnome/src/assistant.c:259 +#: ../../sflphone-client-gnome/src/assistant.c:355 +#: ../../sflphone-client-gnome/src/config/accountwindow.c:197 msgid "_User name" msgstr "_Benutzername" -#: ../../sflphone-client-gnome/src/assistant.c:276 -#: ../../sflphone-client-gnome/src/assistant.c:371 -#: ../../sflphone-client-gnome/src/config/accountwindow.c:207 +#: ../../sflphone-client-gnome/src/assistant.c:275 +#: ../../sflphone-client-gnome/src/assistant.c:370 +#: ../../sflphone-client-gnome/src/config/accountwindow.c:212 msgid "_Password" msgstr "_Passwort" -#: ../../sflphone-client-gnome/src/assistant.c:294 -#: ../../sflphone-client-gnome/src/assistant.c:387 -#: ../../sflphone-client-gnome/src/config/accountwindow.c:223 -#, fuzzy +#: ../../sflphone-client-gnome/src/assistant.c:293 +#: ../../sflphone-client-gnome/src/assistant.c:386 +#: ../../sflphone-client-gnome/src/config/accountwindow.c:228 msgid "_Voicemail number" -msgstr "_Voicemail Boxnummer" +msgstr "_Voicemail Nummer" -#: ../../sflphone-client-gnome/src/assistant.c:309 +#: ../../sflphone-client-gnome/src/assistant.c:308 msgid "Optional Email Address " msgstr "" -#: ../../sflphone-client-gnome/src/assistant.c:309 +#: ../../sflphone-client-gnome/src/assistant.c:308 msgid "This email address will be use to send your voicemail messages" msgstr "" -#: ../../sflphone-client-gnome/src/assistant.c:317 +#: ../../sflphone-client-gnome/src/assistant.c:316 msgid "_Email" msgstr "_Email" -#: ../../sflphone-client-gnome/src/assistant.c:332 +#: ../../sflphone-client-gnome/src/assistant.c:331 msgid "IAX2 account configuration" msgstr "Konfiguration des IAX2 Konto" -#: ../../sflphone-client-gnome/src/assistant.c:405 -#: ../../sflphone-client-gnome/src/config/configwindow.c:863 +#: ../../sflphone-client-gnome/src/assistant.c:404 +#: ../../sflphone-client-gnome/src/config/configwindow.c:855 msgid "Network Address Translation" msgstr "Network Address Translation (NAT)" -#: ../../sflphone-client-gnome/src/assistant.c:405 +#: ../../sflphone-client-gnome/src/assistant.c:404 msgid "You should probably enable this if you are behind a firewall." msgstr "Sie sollten dieses einschalten, falls Sie hinter einer Firewall sind." -#: ../../sflphone-client-gnome/src/assistant.c:414 -#: ../../sflphone-client-gnome/src/config/configwindow.c:516 +#: ../../sflphone-client-gnome/src/assistant.c:413 +#: ../../sflphone-client-gnome/src/config/configwindow.c:532 msgid "E_nable STUN" msgstr "STUN Ei_nschalten" -#: ../../sflphone-client-gnome/src/assistant.c:421 +#: ../../sflphone-client-gnome/src/assistant.c:420 msgid "_STUN server" msgstr "_STUN Server" -#: ../../sflphone-client-gnome/src/assistant.c:435 +#: ../../sflphone-client-gnome/src/assistant.c:434 msgid "Account Registration" msgstr "Konto Registrierung" -#: ../../sflphone-client-gnome/src/assistant.c:435 +#: ../../sflphone-client-gnome/src/assistant.c:434 msgid "Congratulations!" msgstr "Gratulation!" -#: ../../sflphone-client-gnome/src/errors.c:28 -#, fuzzy +#: ../../sflphone-client-gnome/src/errors.c:29 msgid "" "ALSA notification\n" "\n" "Error while opening playback device" msgstr "" -"<b>ALSA Benachrichtigung</b>\n" +"ALSA Benachrichtigung\n" "\n" "Fehler während Öffnen des \"playback device\"" -#: ../../sflphone-client-gnome/src/errors.c:31 -#, fuzzy +#: ../../sflphone-client-gnome/src/errors.c:32 msgid "" "ALSA notification\n" "\n" "Error while opening capture device" msgstr "" -"<b>ALSA Benachrichtigung</b>\n" +"ALSA Benachrichtigung\n" "\n" "Fehler während Öffnen des \"capture device\"" -#: ../../sflphone-client-gnome/src/errors.c:34 -#, fuzzy +#: ../../sflphone-client-gnome/src/errors.c:35 msgid "" "Pulseaudio notification\n" "\n" "Pulseaudio is not running" msgstr "" -"<b>Pulseaudio Benachrichtigung</b>\n" +"Pulseaudio Benachrichtigung\n" "\n" "Pulseaudio nicht gestartet" @@ -297,9 +291,8 @@ msgid "Do you still want to quit?" msgstr "" #: ../../sflphone-client-gnome/src/mainwindow.c:296 -#, fuzzy msgid "SFLphone Error" -msgstr "SFLphone 0.9.2" +msgstr "SFLphone Fehler" #: ../../sflphone-client-gnome/src/menus.c:134 msgid "SFLphone is a VoIP client compatible with SIP and IAX2 protocols." @@ -313,115 +306,101 @@ msgstr "Über SFLphone" msgid "_Help" msgstr "_Hilfe" -#: ../../sflphone-client-gnome/src/menus.c:300 -#: ../../sflphone-client-gnome/src/menus.c:971 +#: ../../sflphone-client-gnome/src/menus.c:296 +#: ../../sflphone-client-gnome/src/menus.c:962 msgid "_New call" msgstr "_Neuer Anruf" -#: ../../sflphone-client-gnome/src/menus.c:312 -#: ../../sflphone-client-gnome/src/menus.c:803 +#: ../../sflphone-client-gnome/src/menus.c:308 +#: ../../sflphone-client-gnome/src/menus.c:794 msgid "_Pick up" msgstr "_Abnehmen" -#: ../../sflphone-client-gnome/src/menus.c:322 -#: ../../sflphone-client-gnome/src/menus.c:815 +#: ../../sflphone-client-gnome/src/menus.c:318 +#: ../../sflphone-client-gnome/src/menus.c:806 msgid "_Hang up" msgstr "A_uflegen" -#: ../../sflphone-client-gnome/src/menus.c:332 -#: ../../sflphone-client-gnome/src/menus.c:827 +#: ../../sflphone-client-gnome/src/menus.c:328 +#: ../../sflphone-client-gnome/src/menus.c:818 msgid "On _Hold" msgstr "in _Warteschleife" -#: ../../sflphone-client-gnome/src/menus.c:344 -#: ../../sflphone-client-gnome/src/menus.c:839 +#: ../../sflphone-client-gnome/src/menus.c:340 +#: ../../sflphone-client-gnome/src/menus.c:830 msgid "_Record" msgstr "_Gespräch aufzeichnen" -#: ../../sflphone-client-gnome/src/menus.c:358 -#, fuzzy +#: ../../sflphone-client-gnome/src/menus.c:354 msgid "_Account creation wizard" -msgstr "SFLphone Konto (Konfigurationsassistent)" +msgstr "SFLphone _Konto (Konfigurationsassistent)" -#: ../../sflphone-client-gnome/src/menus.c:388 +#: ../../sflphone-client-gnome/src/menus.c:384 msgid "_Call" msgstr "_Anruf" -#: ../../sflphone-client-gnome/src/menus.c:561 -msgid "_Clear history" +#: ../../sflphone-client-gnome/src/menus.c:552 +#, fuzzy +msgid "Clear _history" msgstr "Liste der vorherigen Anrufen _leeren" -#: ../../sflphone-client-gnome/src/menus.c:573 +#: ../../sflphone-client-gnome/src/menus.c:564 msgid "_Accounts" msgstr "_Konten" -#: ../../sflphone-client-gnome/src/menus.c:588 +#: ../../sflphone-client-gnome/src/menus.c:579 msgid "_Edit" msgstr "_Editieren" -#: ../../sflphone-client-gnome/src/menus.c:649 +#: ../../sflphone-client-gnome/src/menus.c:640 msgid "_Dialpad" msgstr "_Wählscheibe" -#: ../../sflphone-client-gnome/src/menus.c:661 +#: ../../sflphone-client-gnome/src/menus.c:652 msgid "_Volume controls" msgstr "Lautstärke Kontrollen" -#: ../../sflphone-client-gnome/src/menus.c:679 +#: ../../sflphone-client-gnome/src/menus.c:670 msgid "_View" msgstr "_Anzeigen" -#: ../../sflphone-client-gnome/src/menus.c:899 +#: ../../sflphone-client-gnome/src/menus.c:890 msgid "_Call back" msgstr "_zurückrufen" -#: ../../sflphone-client-gnome/src/menus.c:1082 +#: ../../sflphone-client-gnome/src/menus.c:1070 msgid "Edit phone" msgstr "" -#: ../../sflphone-client-gnome/src/menus.c:1093 +#: ../../sflphone-client-gnome/src/menus.c:1081 msgid "Edit the phone number before making a call" msgstr "" -#: ../../sflphone-client-gnome/src/sflnotify.c:38 -#: ../../sflphone-client-gnome/src/sflnotify.c:105 +#: ../../sflphone-client-gnome/src/sflnotify.c:71 +#: ../../sflphone-client-gnome/src/sflnotify.c:91 #, c-format msgid "%s account: %s" msgstr "%s Konto: %s" -#: ../../sflphone-client-gnome/src/sflnotify.c:42 +#: ../../sflphone-client-gnome/src/sflnotify.c:75 #, c-format msgid "<i>From:</i> %s" msgstr "<i>Von:</i> %s" -#: ../../sflphone-client-gnome/src/sflnotify.c:57 -msgid "Accept" -msgstr "Annehmen" - -#: ../../sflphone-client-gnome/src/sflnotify.c:58 -msgid "Refuse" -msgstr "Ablehnen" - -#: ../../sflphone-client-gnome/src/sflnotify.c:59 -#: ../../sflphone-client-gnome/src/sflnotify.c:122 -#: ../../sflphone-client-gnome/src/sflnotify.c:159 -msgid "Ignore" -msgstr "Ignorieren" - -#: ../../sflphone-client-gnome/src/sflnotify.c:141 +#: ../../sflphone-client-gnome/src/sflnotify.c:111 #, c-format msgid "Calling with %s account <i>%s</i>" msgstr "Mit %s Konto <i>%s</i> anrufen" -#: ../../sflphone-client-gnome/src/sflnotify.c:145 +#: ../../sflphone-client-gnome/src/sflnotify.c:115 msgid "Current account" msgstr "Aktuelles Konto" -#: ../../sflphone-client-gnome/src/sflnotify.c:174 +#: ../../sflphone-client-gnome/src/sflnotify.c:130 msgid "You haven't setup any accounts" msgstr "Sie haben noch kein Konto eingestellt" -#: ../../sflphone-client-gnome/src/sflnotify.c:214 +#: ../../sflphone-client-gnome/src/sflnotify.c:147 msgid "You have no registered accounts" msgstr "Sie haben noch kein registriertes Konto" @@ -438,381 +417,409 @@ msgid "_Show main window" msgstr "_Hauptfenster anzeigen" #: ../../sflphone-client-gnome/src/statusicon.c:124 -#, fuzzy, c-format -msgid "SFLphone - %i accounts configured" -msgstr "SFLphone - %i Konten registriert" - -#: ../../sflphone-client-gnome/src/timestamp.c:46 -msgid "<small>Missed call</small>" -msgstr "<small>Anruf verpasst</small>" - -#: ../../sflphone-client-gnome/src/timestamp.c:64 #, c-format -msgid "<small>Duration:</small> %s" -msgstr "<small>Dauer:</small> %s" +msgid "SFLphone - %i accounts configured" +msgstr "SFLphone - %i Konten konfiguriert" #: ../../sflphone-client-gnome/src/toolbar.c:50 #, c-format msgid "\"Voicemail\" <%s>" msgstr "\"Voicemail\" <%s>" -#: ../../sflphone-client-gnome/src/toolbar.c:176 -#: ../../sflphone-client-gnome/src/toolbar.c:178 +#: ../../sflphone-client-gnome/src/toolbar.c:168 +#: ../../sflphone-client-gnome/src/toolbar.c:170 msgid "Place a call" msgstr "Anrufen" -#: ../../sflphone-client-gnome/src/toolbar.c:185 -#: ../../sflphone-client-gnome/src/toolbar.c:187 +#: ../../sflphone-client-gnome/src/toolbar.c:177 +#: ../../sflphone-client-gnome/src/toolbar.c:179 msgid "Pick up" msgstr "Abnehmen" -#: ../../sflphone-client-gnome/src/toolbar.c:195 -#: ../../sflphone-client-gnome/src/toolbar.c:197 +#: ../../sflphone-client-gnome/src/toolbar.c:187 +#: ../../sflphone-client-gnome/src/toolbar.c:189 msgid "Hang up" msgstr "Auflegen" -#: ../../sflphone-client-gnome/src/toolbar.c:205 -#: ../../sflphone-client-gnome/src/toolbar.c:207 +#: ../../sflphone-client-gnome/src/toolbar.c:197 +#: ../../sflphone-client-gnome/src/toolbar.c:199 msgid "Off Hold" msgstr "Aus Warteschleife" -#: ../../sflphone-client-gnome/src/toolbar.c:216 -#: ../../sflphone-client-gnome/src/toolbar.c:218 +#: ../../sflphone-client-gnome/src/toolbar.c:208 +#: ../../sflphone-client-gnome/src/toolbar.c:210 msgid "On Hold" msgstr "In Warteschleife" -#: ../../sflphone-client-gnome/src/toolbar.c:229 -#: ../../sflphone-client-gnome/src/toolbar.c:231 +#: ../../sflphone-client-gnome/src/toolbar.c:221 +#: ../../sflphone-client-gnome/src/toolbar.c:223 msgid "Transfer" msgstr "Weiterleiten" -#: ../../sflphone-client-gnome/src/toolbar.c:241 -#: ../../sflphone-client-gnome/src/toolbar.c:243 +#: ../../sflphone-client-gnome/src/toolbar.c:233 +#: ../../sflphone-client-gnome/src/toolbar.c:235 msgid "History" msgstr "Vorherige Anrufe" -#: ../../sflphone-client-gnome/src/toolbar.c:252 -#: ../../sflphone-client-gnome/src/toolbar.c:254 +#: ../../sflphone-client-gnome/src/toolbar.c:244 +#: ../../sflphone-client-gnome/src/toolbar.c:246 msgid "Address book" msgstr "" -#: ../../sflphone-client-gnome/src/toolbar.c:260 -#: ../../sflphone-client-gnome/src/toolbar.c:264 +#: ../../sflphone-client-gnome/src/toolbar.c:252 +#: ../../sflphone-client-gnome/src/toolbar.c:256 msgid "Voicemail" msgstr "Voicemail" -#: ../../sflphone-client-gnome/src/toolbar.c:272 +#: ../../sflphone-client-gnome/src/toolbar.c:264 msgid "Record a call" msgstr "Gespräch aufzeichnen" -#: ../../sflphone-client-gnome/src/config/accountwindow.c:108 +#: ../../sflphone-client-gnome/src/config/accountwindow.c:113 msgid "Account settings" msgstr "Kontoeinstellungen" -#: ../../sflphone-client-gnome/src/config/accountwindow.c:120 -#, fuzzy +#: ../../sflphone-client-gnome/src/config/accountwindow.c:125 msgid "Account Parameters" msgstr "Kontoparameter" -#: ../../sflphone-client-gnome/src/config/accountwindow.c:142 +#: ../../sflphone-client-gnome/src/config/accountwindow.c:147 msgid "_Enable this account" msgstr "" -#: ../../sflphone-client-gnome/src/config/accountwindow.c:156 +#: ../../sflphone-client-gnome/src/config/accountwindow.c:161 msgid "_Protocol" msgstr "_Protokoll" -#: ../../sflphone-client-gnome/src/config/accountwindow.c:174 +#: ../../sflphone-client-gnome/src/config/accountwindow.c:179 msgid "Unknown" msgstr "unbekannt" -#: ../../sflphone-client-gnome/src/config/addressbook-config.c:265 -#: ../../sflphone-client-gnome/src/config/configwindow.c:732 +#: ../../sflphone-client-gnome/src/config/addressbook-config.c:306 +#: ../../sflphone-client-gnome/src/config/configwindow.c:721 msgid "General" msgstr "Allgemein" -#: ../../sflphone-client-gnome/src/config/addressbook-config.c:276 +#: ../../sflphone-client-gnome/src/config/addressbook-config.c:312 msgid "_Use Evolution address books" msgstr "" -#: ../../sflphone-client-gnome/src/config/addressbook-config.c:283 +#: ../../sflphone-client-gnome/src/config/addressbook-config.c:319 msgid "Download limit:" msgstr "" -#: ../../sflphone-client-gnome/src/config/addressbook-config.c:294 -msgid "_Display contact photo if available" +#: ../../sflphone-client-gnome/src/config/addressbook-config.c:327 +msgid "cards" msgstr "" -#: ../../sflphone-client-gnome/src/config/addressbook-config.c:301 -msgid "Fields" +#: ../../sflphone-client-gnome/src/config/addressbook-config.c:333 +msgid "_Display contact photo if available" msgstr "" -#: ../../sflphone-client-gnome/src/config/addressbook-config.c:311 -msgid "Use the following fields from Evolution's address books:" +#: ../../sflphone-client-gnome/src/config/addressbook-config.c:341 +msgid "Fields from Evolution's address books" msgstr "" -#: ../../sflphone-client-gnome/src/config/addressbook-config.c:316 +#: ../../sflphone-client-gnome/src/config/addressbook-config.c:345 msgid "_Business phone" msgstr "" -#: ../../sflphone-client-gnome/src/config/addressbook-config.c:321 +#: ../../sflphone-client-gnome/src/config/addressbook-config.c:351 msgid "_Home phone" msgstr "" -#: ../../sflphone-client-gnome/src/config/addressbook-config.c:326 +#: ../../sflphone-client-gnome/src/config/addressbook-config.c:357 msgid "_Mobile phone" msgstr "" -#: ../../sflphone-client-gnome/src/config/addressbook-config.c:333 +#: ../../sflphone-client-gnome/src/config/addressbook-config.c:364 msgid "Address Books" msgstr "" -#: ../../sflphone-client-gnome/src/config/addressbook-config.c:343 +#: ../../sflphone-client-gnome/src/config/addressbook-config.c:368 msgid "Select which Evolution address books to use:" msgstr "" -#: ../../sflphone-client-gnome/src/config/addressbook-config.c:377 -#: ../../sflphone-client-gnome/src/config/audioconf.c:574 +#: ../../sflphone-client-gnome/src/config/addressbook-config.c:404 +#: ../../sflphone-client-gnome/src/config/audioconf.c:576 msgid "Name" msgstr "Name" #: ../../sflphone-client-gnome/src/config/audioconf.c:155 -#, fuzzy, c-format +#, c-format msgid "audio device index for output = %d" -msgstr "\"Audio device index\" für Ausgabe = %d\n" +msgstr "\"Audio device index\" für Ausgabe = %d" -#: ../../sflphone-client-gnome/src/config/audioconf.c:579 +#: ../../sflphone-client-gnome/src/config/audioconf.c:581 msgid "Frequency" msgstr "Frequenz" -#: ../../sflphone-client-gnome/src/config/audioconf.c:584 +#: ../../sflphone-client-gnome/src/config/audioconf.c:586 msgid "Bitrate" msgstr "Bitrate" -#: ../../sflphone-client-gnome/src/config/audioconf.c:589 +#: ../../sflphone-client-gnome/src/config/audioconf.c:591 msgid "Bandwidth" msgstr "Bandbreite" -#: ../../sflphone-client-gnome/src/config/audioconf.c:652 -msgid "Pulseaudio" -msgstr "Pulseaudio" - -#: ../../sflphone-client-gnome/src/config/audioconf.c:655 -msgid "ALSA" -msgstr "ALSA" - -#: ../../sflphone-client-gnome/src/config/audioconf.c:681 +#: ../../sflphone-client-gnome/src/config/audioconf.c:662 msgid "ALSA plugin" msgstr "ALSA Plugin" -#: ../../sflphone-client-gnome/src/config/audioconf.c:703 +#: ../../sflphone-client-gnome/src/config/audioconf.c:684 msgid "Output" msgstr "Ausgabe" -#: ../../sflphone-client-gnome/src/config/audioconf.c:725 +#: ../../sflphone-client-gnome/src/config/audioconf.c:706 msgid "Input" msgstr "Eingabe" -#: ../../sflphone-client-gnome/src/config/audioconf.c:758 -msgid "_Enable ringtones" -msgstr "Klingeltöne _einschalten" - -#: ../../sflphone-client-gnome/src/config/audioconf.c:764 -msgid "Choose a ringtone" -msgstr "Klingelton auswählen" - -#: ../../sflphone-client-gnome/src/config/audioconf.c:769 -msgid "Audio Files" -msgstr "Audio Dateien" - -#: ../../sflphone-client-gnome/src/config/audioconf.c:788 +#: ../../sflphone-client-gnome/src/config/audioconf.c:741 msgid "_Voice Activity Detection" msgstr "" -#: ../../sflphone-client-gnome/src/config/audioconf.c:798 +#: ../../sflphone-client-gnome/src/config/audioconf.c:751 msgid "_Noise Reduction (Narrow-Band Companding)" msgstr "" -#: ../../sflphone-client-gnome/src/config/audioconf.c:826 +#: ../../sflphone-client-gnome/src/config/audioconf.c:780 msgid "Sound Manager" msgstr "Sound Manager" -#: ../../sflphone-client-gnome/src/config/audioconf.c:833 +#: ../../sflphone-client-gnome/src/config/audioconf.c:783 +#, fuzzy +msgid "_Pulseaudio" +msgstr "Pulseaudio" + +#: ../../sflphone-client-gnome/src/config/audioconf.c:788 +#, fuzzy +msgid "_ALSA" +msgstr "ALSA" + +#: ../../sflphone-client-gnome/src/config/audioconf.c:795 msgid "ALSA configuration" msgstr "ALSA Konfiguration" -#: ../../sflphone-client-gnome/src/config/audioconf.c:850 +#: ../../sflphone-client-gnome/src/config/audioconf.c:812 msgid "Codecs" msgstr "Codecs" -#: ../../sflphone-client-gnome/src/config/audioconf.c:873 +#: ../../sflphone-client-gnome/src/config/audioconf.c:835 msgid "Ringtones" msgstr "Klingeltöne" -#: ../../sflphone-client-gnome/src/config/configwindow.c:402 +#: ../../sflphone-client-gnome/src/config/audioconf.c:841 +msgid "_Enable ringtones" +msgstr "Klingeltöne _einschalten" + +#: ../../sflphone-client-gnome/src/config/audioconf.c:847 +msgid "Choose a ringtone" +msgstr "Klingelton auswählen" + +#: ../../sflphone-client-gnome/src/config/audioconf.c:853 +msgid "Audio Files" +msgstr "Audio Dateien" + +#: ../../sflphone-client-gnome/src/config/configwindow.c:418 msgid "Protocol" msgstr "Protokoll" -#: ../../sflphone-client-gnome/src/config/configwindow.c:409 +#: ../../sflphone-client-gnome/src/config/configwindow.c:425 msgid "Status" msgstr "Status" -#: ../../sflphone-client-gnome/src/config/configwindow.c:512 +#: ../../sflphone-client-gnome/src/config/configwindow.c:528 msgid "Stun parameters will apply to each SIP account created." msgstr "" -#: ../../sflphone-client-gnome/src/config/configwindow.c:520 +#: ../../sflphone-client-gnome/src/config/configwindow.c:536 msgid "Enable it if you are behind a firewall" msgstr "Einschalten falls Sie hinter einer Firewall sind" -#: ../../sflphone-client-gnome/src/config/configwindow.c:528 +#: ../../sflphone-client-gnome/src/config/configwindow.c:544 msgid "Format: name.server:port" msgstr "Format: Name.Server:Port" -#: ../../sflphone-client-gnome/src/config/configwindow.c:579 -#, fuzzy +#: ../../sflphone-client-gnome/src/config/configwindow.c:589 msgid "Desktop Notifications" -msgstr "Desktopbenachrichtigung" +msgstr "Desktopbenachrichtigungen" -#: ../../sflphone-client-gnome/src/config/configwindow.c:588 -#, fuzzy +#: ../../sflphone-client-gnome/src/config/configwindow.c:593 msgid "_Enable notifications" -msgstr "Klingeltöne _einschalten" +msgstr "Benachrichtigungen _einschalten" -#: ../../sflphone-client-gnome/src/config/configwindow.c:594 +#: ../../sflphone-client-gnome/src/config/configwindow.c:599 msgid "Enable voicemail _notifications" msgstr "" -#: ../../sflphone-client-gnome/src/config/configwindow.c:605 +#: ../../sflphone-client-gnome/src/config/configwindow.c:611 msgid "System Tray Icon" msgstr "Benachrichtigungsfeld (\"System Tray\") Icon" -#: ../../sflphone-client-gnome/src/config/configwindow.c:613 +#: ../../sflphone-client-gnome/src/config/configwindow.c:614 msgid "_Popup main window on incoming call" msgstr "Hauptfenster anzeigen wenn eingehendes Gespräch" -#: ../../sflphone-client-gnome/src/config/configwindow.c:618 +#: ../../sflphone-client-gnome/src/config/configwindow.c:619 msgid "Ne_ver popup main window" msgstr "_Hauptfenster nie anzeigen" -#: ../../sflphone-client-gnome/src/config/configwindow.c:622 +#: ../../sflphone-client-gnome/src/config/configwindow.c:623 msgid "Hide SFLphone window on _startup" msgstr "" -#: ../../sflphone-client-gnome/src/config/configwindow.c:628 +#: ../../sflphone-client-gnome/src/config/configwindow.c:629 msgid "Calls History" msgstr "Liste der vorherigen Anrufen" -#: ../../sflphone-client-gnome/src/config/configwindow.c:636 -#, fuzzy -msgid "_History size limit" -msgstr "Liste der vorherigen Anrufen is leer" +#: ../../sflphone-client-gnome/src/config/configwindow.c:632 +msgid "_Keep my history for at least" +msgstr "" + +#: ../../sflphone-client-gnome/src/config/configwindow.c:643 +msgid " days" +msgstr "" -#: ../../sflphone-client-gnome/src/config/configwindow.c:653 +#: ../../sflphone-client-gnome/src/config/configwindow.c:647 msgid "PulseAudio sound server" msgstr "PulseAudio Sound Server" -#: ../../sflphone-client-gnome/src/config/configwindow.c:661 -msgid "Mute other applications during a _call" +#: ../../sflphone-client-gnome/src/config/configwindow.c:650 +msgid "_Mute other applications during a call" msgstr "" -#: ../../sflphone-client-gnome/src/config/configwindow.c:674 +#: ../../sflphone-client-gnome/src/config/configwindow.c:664 msgid "SIP Port" msgstr "SIP Port" -#: ../../sflphone-client-gnome/src/config/configwindow.c:687 +#: ../../sflphone-client-gnome/src/config/configwindow.c:677 msgid "Port:" msgstr "Port:" -#: ../../sflphone-client-gnome/src/config/configwindow.c:742 -msgid "_Recordings folder" -msgstr "" +#: ../../sflphone-client-gnome/src/config/configwindow.c:725 +#, fuzzy +msgid "Recordings folder" +msgstr "Tonaufnahmen" -#: ../../sflphone-client-gnome/src/config/configwindow.c:748 +#: ../../sflphone-client-gnome/src/config/configwindow.c:731 msgid "Select a folder" msgstr "" -#: ../../sflphone-client-gnome/src/config/configwindow.c:773 +#: ../../sflphone-client-gnome/src/config/configwindow.c:765 msgid "Preferences" msgstr "Einstellungen" -#: ../../sflphone-client-gnome/src/config/configwindow.c:793 +#: ../../sflphone-client-gnome/src/config/configwindow.c:785 msgid "General Settings" msgstr "Allgemeine Einstellungen" -#: ../../sflphone-client-gnome/src/config/configwindow.c:798 +#: ../../sflphone-client-gnome/src/config/configwindow.c:790 msgid "Audio Settings" msgstr "Audio Einstellungen" -#: ../../sflphone-client-gnome/src/config/configwindow.c:803 -#, fuzzy +#: ../../sflphone-client-gnome/src/config/configwindow.c:795 msgid "Recordings" -msgstr "_Gespräch aufzeichnen" +msgstr "Tonaufnahmen" -#: ../../sflphone-client-gnome/src/config/configwindow.c:808 +#: ../../sflphone-client-gnome/src/config/configwindow.c:800 msgid "Address Book" msgstr "" -#: ../../sflphone-client-gnome/src/config/configwindow.c:813 +#: ../../sflphone-client-gnome/src/config/configwindow.c:805 msgid "Hooks" msgstr "" -#: ../../sflphone-client-gnome/src/config/configwindow.c:840 +#: ../../sflphone-client-gnome/src/config/configwindow.c:832 msgid "Accounts" msgstr "Konten" -#: ../../sflphone-client-gnome/src/config/configwindow.c:852 -#, fuzzy +#: ../../sflphone-client-gnome/src/config/configwindow.c:844 msgid "Configured Accounts" -msgstr "Aktuelles Konto" +msgstr "Konfigurierten Konten" #: ../../sflphone-client-gnome/src/config/hooks-config.c:130 msgid "URL Passing" msgstr "" -#: ../../sflphone-client-gnome/src/config/hooks-config.c:140 +#: ../../sflphone-client-gnome/src/config/hooks-config.c:135 +msgid "Custom commands on incoming calls with URL," +msgstr "" + +#: ../../sflphone-client-gnome/src/config/hooks-config.c:138 #, c-format -msgid "" -"SFLphone can run custom commands if incoming calls come with an URL " -"attached.\n" -"In this case, %s will be replaced with the passed URL." +msgid "%s will be replaced with the passed URL." msgstr "" -#: ../../sflphone-client-gnome/src/config/hooks-config.c:143 +#: ../../sflphone-client-gnome/src/config/hooks-config.c:141 msgid "Trigger on specific _SIP header" msgstr "" -#: ../../sflphone-client-gnome/src/config/hooks-config.c:155 +#: ../../sflphone-client-gnome/src/config/hooks-config.c:150 msgid "Trigger on _IAX2 URL" msgstr "" -#: ../../sflphone-client-gnome/src/config/hooks-config.c:160 -msgid "_Command to run: " +#: ../../sflphone-client-gnome/src/config/hooks-config.c:155 +msgid "Command to _run: " msgstr "" -#: ../../sflphone-client-gnome/src/config/hooks-config.c:168 +#: ../../sflphone-client-gnome/src/config/hooks-config.c:165 msgid "Phone Number Rewriting" msgstr "" -#: ../../sflphone-client-gnome/src/config/hooks-config.c:178 +#: ../../sflphone-client-gnome/src/config/hooks-config.c:169 msgid "_Prefix dialed numbers with:" msgstr "" -#: ../../sflphone-client-gnome/src/contacts/history.c:83 -#: ../../sflphone-client-gnome/src/contacts/searchbar.c:123 -#, fuzzy -msgid "Search history" -msgstr "Liste der vorherigen Anrufen _leeren" +#: ../../sflphone-client-gnome/src/contacts/searchbar.c:55 +msgid "" +"Search all\n" +"Click here to change the search type" +msgstr "" -#: ../../sflphone-client-gnome/src/contacts/history.c:83 -#: ../../sflphone-client-gnome/src/contacts/searchbar.c:110 -#, fuzzy -msgid "Search contact" -msgstr "Adressbuch _Suche" +#: ../../sflphone-client-gnome/src/contacts/searchbar.c:67 +msgid "" +"Search by missed call\n" +"Click here to change the search type" +msgstr "" + +#: ../../sflphone-client-gnome/src/contacts/searchbar.c:79 +msgid "" +"Search by incoming call\n" +"Click here to change the search type" +msgstr "" + +#: ../../sflphone-client-gnome/src/contacts/searchbar.c:91 +msgid "" +"Search by outgoing call\n" +"Click here to change the search type" +msgstr "" + +#~ msgid "Accept" +#~ msgstr "Annehmen" + +#~ msgid "Refuse" +#~ msgstr "Ablehnen" + +#~ msgid "Ignore" +#~ msgstr "Ignorieren" + +#~ msgid "<small>Missed call</small>" +#~ msgstr "<small>Anruf verpasst</small>" + +#~ msgid "<small>Duration:</small> %s" +#~ msgstr "<small>Dauer:</small> %s" + +#~ msgid "_History size limit" +#~ msgstr "Max. _Anzahl von vorherigen Anrufen" + +#~ msgid "Search history" +#~ msgstr "In vorherigen Anrufen suchen" + +#~ msgid "Search contact" +#~ msgstr "Adressbuch Suche" -#, fuzzy #~ msgid "Registered to %s (%s)" -#~ msgstr "registriert" +#~ msgstr "zu %s (%s) registriert" #~ msgid "%s account- %s %s" #~ msgstr "%s Konto- %s %s" @@ -832,7 +839,6 @@ msgstr "Adressbuch _Suche" #~ msgid "_Control running applications volume" #~ msgstr "Lautstärke für laufende Anwendungen _einstellen" -#, fuzzy #~ msgid "Account previously setup" #~ msgstr "Zuvor eingestellte Konten" diff --git a/sflphone-common/po/es.po b/sflphone-common/po/es.po index df246654f815314fd63936b6e3d4d33edd42db3d..d23b86974a3753c8e12c4590a899267c5e329c68 100644 --- a/sflphone-common/po/es.po +++ b/sflphone-common/po/es.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: SFLphone 0.9.4\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-05-21 10:45-0400\n" +"POT-Creation-Date: 2009-06-12 18:05-0400\n" "PO-Revision-Date: 2008-08-11 11:53+0200\n" "Last-Translator: Carlos Galisteo <cgalisteo AT k-rolus.net>\n" "Language-Team: SavoirFaireLinux Inc <sflphoneteam@savoirfairelinux.com>\n" @@ -18,50 +18,50 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n>1;\n" -#: ../../sflphone-client-gnome/src/accountlist.c:169 +#: ../../sflphone-client-gnome/src/accountlist.c:175 msgid "Registered" msgstr "Registrado" -#: ../../sflphone-client-gnome/src/accountlist.c:172 +#: ../../sflphone-client-gnome/src/accountlist.c:178 msgid "Not Registered" msgstr "No registrado" -#: ../../sflphone-client-gnome/src/accountlist.c:175 +#: ../../sflphone-client-gnome/src/accountlist.c:181 msgid "Trying..." msgstr "Intentando..." -#: ../../sflphone-client-gnome/src/accountlist.c:178 -#: ../../sflphone-client-gnome/src/sflnotify.c:176 -#: ../../sflphone-client-gnome/src/sflnotify.c:217 +#: ../../sflphone-client-gnome/src/accountlist.c:184 +#: ../../sflphone-client-gnome/src/sflnotify.c:131 +#: ../../sflphone-client-gnome/src/sflnotify.c:148 msgid "Error" msgstr "Error" -#: ../../sflphone-client-gnome/src/accountlist.c:181 +#: ../../sflphone-client-gnome/src/accountlist.c:187 msgid "Bad authentification" msgstr "Autenticación erronea" -#: ../../sflphone-client-gnome/src/accountlist.c:184 +#: ../../sflphone-client-gnome/src/accountlist.c:190 msgid "Network unreachable" msgstr "Red Inaccesible" -#: ../../sflphone-client-gnome/src/accountlist.c:187 +#: ../../sflphone-client-gnome/src/accountlist.c:193 msgid "Host unreachable" msgstr "_Parte del servidor" -#: ../../sflphone-client-gnome/src/accountlist.c:190 +#: ../../sflphone-client-gnome/src/accountlist.c:196 msgid "Stun configuration error" msgstr "Error de configuración Stun" -#: ../../sflphone-client-gnome/src/accountlist.c:193 +#: ../../sflphone-client-gnome/src/accountlist.c:199 msgid "Stun server invalid" msgstr "Servidor stun inválido" -#: ../../sflphone-client-gnome/src/accountlist.c:196 +#: ../../sflphone-client-gnome/src/accountlist.c:202 msgid "Invalid" msgstr "Inválido" #: ../../sflphone-client-gnome/src/actions.c:55 -#: ../../sflphone-client-gnome/src/sflnotify.c:108 +#: ../../sflphone-client-gnome/src/sflnotify.c:94 #, c-format msgid "%d voice mails" msgstr "%d mensajes de voz" @@ -80,7 +80,7 @@ msgstr "" msgid "No registered account" msgstr "No tiene ninguna cuenta registrada" -#: ../../sflphone-client-gnome/src/actions.c:229 +#: ../../sflphone-client-gnome/src/actions.c:232 msgid "" "Unable to connect to the SFLphone server.\n" "Make sure the daemon is running." @@ -88,17 +88,17 @@ msgstr "" "Incapaz de conectar con el servidor SFLphone.\n" " Asegúrese de que el demonio esté funcionando." -#: ../../sflphone-client-gnome/src/actions.c:787 +#: ../../sflphone-client-gnome/src/actions.c:807 #, c-format msgid "IP call - %s" msgstr "Llamada IP - %s" -#: ../../sflphone-client-gnome/src/actions.c:790 +#: ../../sflphone-client-gnome/src/actions.c:810 #, c-format msgid "Using %s (%s) - Codec: %s" msgstr "" -#: ../../sflphone-client-gnome/src/actions.c:880 +#: ../../sflphone-client-gnome/src/actions.c:900 #, c-format msgid "" "<b>Error: No audio codecs found.\n" @@ -130,124 +130,124 @@ msgstr "" "Server : %s\n" "Username : %s\n" -#: ../../sflphone-client-gnome/src/assistant.c:160 +#: ../../sflphone-client-gnome/src/assistant.c:159 msgid "SFLphone account configuration wizard" msgstr "Asistente de configuración de cuentas de SFLphone" -#: ../../sflphone-client-gnome/src/assistant.c:186 +#: ../../sflphone-client-gnome/src/assistant.c:185 msgid "Welcome to SFLphone!" msgstr "¡Bienvenido a SFLphone!" -#: ../../sflphone-client-gnome/src/assistant.c:187 +#: ../../sflphone-client-gnome/src/assistant.c:186 msgid "This installation wizard will help you configure an account." msgstr "Este asistente de instalación le ayudará a configurar una cuenta." -#: ../../sflphone-client-gnome/src/assistant.c:201 +#: ../../sflphone-client-gnome/src/assistant.c:200 msgid "VoIP Protocols" msgstr "Protocolos VoIP" -#: ../../sflphone-client-gnome/src/assistant.c:201 +#: ../../sflphone-client-gnome/src/assistant.c:200 msgid "Select an account type:" msgstr "Escoja un tipo de cuenta:" -#: ../../sflphone-client-gnome/src/assistant.c:219 +#: ../../sflphone-client-gnome/src/assistant.c:218 msgid "Account" msgstr "Cuenta" -#: ../../sflphone-client-gnome/src/assistant.c:219 +#: ../../sflphone-client-gnome/src/assistant.c:218 msgid "Please select one of the following option:" msgstr "Por favor, elija una de las siguientes opciones:" -#: ../../sflphone-client-gnome/src/assistant.c:221 +#: ../../sflphone-client-gnome/src/assistant.c:220 msgid "Create a free SIP/IAX2 account on sflphone.org" msgstr "Crear una cuenta SIP/IAX2 gratis en sflphone.org" -#: ../../sflphone-client-gnome/src/assistant.c:223 +#: ../../sflphone-client-gnome/src/assistant.c:222 msgid "Register an existing SIP or IAX2 account" msgstr "Registrar una cuenta SIP o IAX2 existente" -#: ../../sflphone-client-gnome/src/assistant.c:236 +#: ../../sflphone-client-gnome/src/assistant.c:235 msgid "SIP account configuration" msgstr "Configuración de cuenta SIP" -#: ../../sflphone-client-gnome/src/assistant.c:236 -#: ../../sflphone-client-gnome/src/assistant.c:332 +#: ../../sflphone-client-gnome/src/assistant.c:235 +#: ../../sflphone-client-gnome/src/assistant.c:331 msgid "Please fill the following information:" msgstr "Por favor, rellene la siguiente información:" -#: ../../sflphone-client-gnome/src/assistant.c:244 -#: ../../sflphone-client-gnome/src/assistant.c:340 -#: ../../sflphone-client-gnome/src/config/accountwindow.c:148 +#: ../../sflphone-client-gnome/src/assistant.c:243 +#: ../../sflphone-client-gnome/src/assistant.c:339 +#: ../../sflphone-client-gnome/src/config/accountwindow.c:153 msgid "_Alias" msgstr "_Alias" -#: ../../sflphone-client-gnome/src/assistant.c:252 -#: ../../sflphone-client-gnome/src/assistant.c:348 -#: ../../sflphone-client-gnome/src/config/accountwindow.c:184 +#: ../../sflphone-client-gnome/src/assistant.c:251 +#: ../../sflphone-client-gnome/src/assistant.c:347 +#: ../../sflphone-client-gnome/src/config/accountwindow.c:189 msgid "_Host name" msgstr "_Nombre de equipo" -#: ../../sflphone-client-gnome/src/assistant.c:260 -#: ../../sflphone-client-gnome/src/assistant.c:356 -#: ../../sflphone-client-gnome/src/config/accountwindow.c:192 +#: ../../sflphone-client-gnome/src/assistant.c:259 +#: ../../sflphone-client-gnome/src/assistant.c:355 +#: ../../sflphone-client-gnome/src/config/accountwindow.c:197 msgid "_User name" msgstr "_Usuario" -#: ../../sflphone-client-gnome/src/assistant.c:276 -#: ../../sflphone-client-gnome/src/assistant.c:371 -#: ../../sflphone-client-gnome/src/config/accountwindow.c:207 +#: ../../sflphone-client-gnome/src/assistant.c:275 +#: ../../sflphone-client-gnome/src/assistant.c:370 +#: ../../sflphone-client-gnome/src/config/accountwindow.c:212 msgid "_Password" msgstr "_Contraseña" -#: ../../sflphone-client-gnome/src/assistant.c:294 -#: ../../sflphone-client-gnome/src/assistant.c:387 -#: ../../sflphone-client-gnome/src/config/accountwindow.c:223 +#: ../../sflphone-client-gnome/src/assistant.c:293 +#: ../../sflphone-client-gnome/src/assistant.c:386 +#: ../../sflphone-client-gnome/src/config/accountwindow.c:228 msgid "_Voicemail number" msgstr "_Número de buzón de voz" -#: ../../sflphone-client-gnome/src/assistant.c:309 +#: ../../sflphone-client-gnome/src/assistant.c:308 msgid "Optional Email Address " msgstr "Dirección de correo opcional " -#: ../../sflphone-client-gnome/src/assistant.c:309 +#: ../../sflphone-client-gnome/src/assistant.c:308 msgid "This email address will be use to send your voicemail messages" msgstr "Esta dirección de correo se usará para mandar sus mensajes de voz" -#: ../../sflphone-client-gnome/src/assistant.c:317 +#: ../../sflphone-client-gnome/src/assistant.c:316 msgid "_Email" msgstr "_Correo" -#: ../../sflphone-client-gnome/src/assistant.c:332 +#: ../../sflphone-client-gnome/src/assistant.c:331 msgid "IAX2 account configuration" msgstr "Configuración de cuenta IAX2" -#: ../../sflphone-client-gnome/src/assistant.c:405 -#: ../../sflphone-client-gnome/src/config/configwindow.c:863 +#: ../../sflphone-client-gnome/src/assistant.c:404 +#: ../../sflphone-client-gnome/src/config/configwindow.c:855 msgid "Network Address Translation" msgstr "Conversión de Dirección de Red (NAT)" -#: ../../sflphone-client-gnome/src/assistant.c:405 +#: ../../sflphone-client-gnome/src/assistant.c:404 msgid "You should probably enable this if you are behind a firewall." msgstr "Probablemente tiene que activar esto si está detrás de un cortafuegos." -#: ../../sflphone-client-gnome/src/assistant.c:414 -#: ../../sflphone-client-gnome/src/config/configwindow.c:516 +#: ../../sflphone-client-gnome/src/assistant.c:413 +#: ../../sflphone-client-gnome/src/config/configwindow.c:532 msgid "E_nable STUN" msgstr "A_ctivar STUN" -#: ../../sflphone-client-gnome/src/assistant.c:421 +#: ../../sflphone-client-gnome/src/assistant.c:420 msgid "_STUN server" msgstr "_Servidor STUN" -#: ../../sflphone-client-gnome/src/assistant.c:435 +#: ../../sflphone-client-gnome/src/assistant.c:434 msgid "Account Registration" msgstr "Registro de cuenta" -#: ../../sflphone-client-gnome/src/assistant.c:435 +#: ../../sflphone-client-gnome/src/assistant.c:434 msgid "Congratulations!" msgstr "¡Enhorabuena!" -#: ../../sflphone-client-gnome/src/errors.c:28 +#: ../../sflphone-client-gnome/src/errors.c:29 msgid "" "ALSA notification\n" "\n" @@ -257,7 +257,7 @@ msgstr "" "\n" "Error al abrir el dispositivo de reproducción" -#: ../../sflphone-client-gnome/src/errors.c:31 +#: ../../sflphone-client-gnome/src/errors.c:32 msgid "" "ALSA notification\n" "\n" @@ -267,7 +267,7 @@ msgstr "" "\n" "Error al abrir el dispositivo de captura" -#: ../../sflphone-client-gnome/src/errors.c:34 +#: ../../sflphone-client-gnome/src/errors.c:35 msgid "" "Pulseaudio notification\n" "\n" @@ -306,114 +306,101 @@ msgstr "Sobre SFLphone" msgid "_Help" msgstr "_Ayuda" -#: ../../sflphone-client-gnome/src/menus.c:300 -#: ../../sflphone-client-gnome/src/menus.c:971 +#: ../../sflphone-client-gnome/src/menus.c:296 +#: ../../sflphone-client-gnome/src/menus.c:962 msgid "_New call" msgstr "_Nueva llamada" -#: ../../sflphone-client-gnome/src/menus.c:312 -#: ../../sflphone-client-gnome/src/menus.c:803 +#: ../../sflphone-client-gnome/src/menus.c:308 +#: ../../sflphone-client-gnome/src/menus.c:794 msgid "_Pick up" msgstr "_Descolgar" -#: ../../sflphone-client-gnome/src/menus.c:322 -#: ../../sflphone-client-gnome/src/menus.c:815 +#: ../../sflphone-client-gnome/src/menus.c:318 +#: ../../sflphone-client-gnome/src/menus.c:806 msgid "_Hang up" msgstr "_Colgar" -#: ../../sflphone-client-gnome/src/menus.c:332 -#: ../../sflphone-client-gnome/src/menus.c:827 +#: ../../sflphone-client-gnome/src/menus.c:328 +#: ../../sflphone-client-gnome/src/menus.c:818 msgid "On _Hold" msgstr "En _Espera" -#: ../../sflphone-client-gnome/src/menus.c:344 -#: ../../sflphone-client-gnome/src/menus.c:839 +#: ../../sflphone-client-gnome/src/menus.c:340 +#: ../../sflphone-client-gnome/src/menus.c:830 msgid "_Record" msgstr "_Recordar" -#: ../../sflphone-client-gnome/src/menus.c:358 +#: ../../sflphone-client-gnome/src/menus.c:354 msgid "_Account creation wizard" msgstr "Asistente de configuración de cuentas" -#: ../../sflphone-client-gnome/src/menus.c:388 +#: ../../sflphone-client-gnome/src/menus.c:384 msgid "_Call" msgstr "_Llamar" -#: ../../sflphone-client-gnome/src/menus.c:561 -msgid "_Clear history" +#: ../../sflphone-client-gnome/src/menus.c:552 +#, fuzzy +msgid "Clear _history" msgstr "_Limpiar historial" -#: ../../sflphone-client-gnome/src/menus.c:573 +#: ../../sflphone-client-gnome/src/menus.c:564 msgid "_Accounts" msgstr "_Cuentas" -#: ../../sflphone-client-gnome/src/menus.c:588 +#: ../../sflphone-client-gnome/src/menus.c:579 msgid "_Edit" msgstr "_Editar" -#: ../../sflphone-client-gnome/src/menus.c:649 +#: ../../sflphone-client-gnome/src/menus.c:640 msgid "_Dialpad" msgstr "_Teclado numérico" -#: ../../sflphone-client-gnome/src/menus.c:661 +#: ../../sflphone-client-gnome/src/menus.c:652 msgid "_Volume controls" msgstr "_Controles de volumen" -#: ../../sflphone-client-gnome/src/menus.c:679 +#: ../../sflphone-client-gnome/src/menus.c:670 msgid "_View" msgstr "_Ver" -#: ../../sflphone-client-gnome/src/menus.c:899 +#: ../../sflphone-client-gnome/src/menus.c:890 msgid "_Call back" msgstr "_Llamar" -#: ../../sflphone-client-gnome/src/menus.c:1082 +#: ../../sflphone-client-gnome/src/menus.c:1070 msgid "Edit phone" msgstr "Editar teléfono" -#: ../../sflphone-client-gnome/src/menus.c:1093 +#: ../../sflphone-client-gnome/src/menus.c:1081 msgid "Edit the phone number before making a call" msgstr "Editar el número de teléfono antes de llamar" -#: ../../sflphone-client-gnome/src/sflnotify.c:38 -#: ../../sflphone-client-gnome/src/sflnotify.c:105 +#: ../../sflphone-client-gnome/src/sflnotify.c:71 +#: ../../sflphone-client-gnome/src/sflnotify.c:91 #, c-format msgid "%s account: %s" msgstr "%s cuenta: %s" -#: ../../sflphone-client-gnome/src/sflnotify.c:42 +#: ../../sflphone-client-gnome/src/sflnotify.c:75 #, c-format msgid "<i>From:</i> %s" msgstr "<i>De:</i> %s" -#: ../../sflphone-client-gnome/src/sflnotify.c:57 -msgid "Accept" -msgstr "Aceptar" - -#: ../../sflphone-client-gnome/src/sflnotify.c:58 -msgid "Refuse" -msgstr "Rechazar" - -#: ../../sflphone-client-gnome/src/sflnotify.c:59 -#: ../../sflphone-client-gnome/src/sflnotify.c:122 -#: ../../sflphone-client-gnome/src/sflnotify.c:159 -msgid "Ignore" -msgstr "Ignorar" - -#: ../../sflphone-client-gnome/src/sflnotify.c:141 +#: ../../sflphone-client-gnome/src/sflnotify.c:111 #, c-format msgid "Calling with %s account <i>%s</i>" msgstr "Llamando con la cuenta %s <i>%s</i>" -#: ../../sflphone-client-gnome/src/sflnotify.c:145 +#: ../../sflphone-client-gnome/src/sflnotify.c:115 msgid "Current account" msgstr "Cuenta actual" -#: ../../sflphone-client-gnome/src/sflnotify.c:174 +#: ../../sflphone-client-gnome/src/sflnotify.c:130 msgid "You haven't setup any accounts" msgstr "No ha configurado cuentas" -#: ../../sflphone-client-gnome/src/sflnotify.c:214 +#: ../../sflphone-client-gnome/src/sflnotify.c:147 msgid "You have no registered accounts" msgstr "No tiene ninguna cuenta registrada" @@ -434,136 +421,128 @@ msgstr "Mostrar ventana principal" msgid "SFLphone - %i accounts configured" msgstr "SFLphone - %i cuentas configuradas" -#: ../../sflphone-client-gnome/src/timestamp.c:46 -msgid "<small>Missed call</small>" -msgstr "<small>Llamada fallida</small>" - -#: ../../sflphone-client-gnome/src/timestamp.c:64 -#, c-format -msgid "<small>Duration:</small> %s" -msgstr "<small>Duración:</small> %s" - #: ../../sflphone-client-gnome/src/toolbar.c:50 #, c-format msgid "\"Voicemail\" <%s>" msgstr "\"Mensaje\" <%s>" -#: ../../sflphone-client-gnome/src/toolbar.c:176 -#: ../../sflphone-client-gnome/src/toolbar.c:178 +#: ../../sflphone-client-gnome/src/toolbar.c:168 +#: ../../sflphone-client-gnome/src/toolbar.c:170 msgid "Place a call" msgstr "Llamar" -#: ../../sflphone-client-gnome/src/toolbar.c:185 -#: ../../sflphone-client-gnome/src/toolbar.c:187 +#: ../../sflphone-client-gnome/src/toolbar.c:177 +#: ../../sflphone-client-gnome/src/toolbar.c:179 msgid "Pick up" msgstr "Descolgar" -#: ../../sflphone-client-gnome/src/toolbar.c:195 -#: ../../sflphone-client-gnome/src/toolbar.c:197 +#: ../../sflphone-client-gnome/src/toolbar.c:187 +#: ../../sflphone-client-gnome/src/toolbar.c:189 msgid "Hang up" msgstr "Colgar" -#: ../../sflphone-client-gnome/src/toolbar.c:205 -#: ../../sflphone-client-gnome/src/toolbar.c:207 +#: ../../sflphone-client-gnome/src/toolbar.c:197 +#: ../../sflphone-client-gnome/src/toolbar.c:199 msgid "Off Hold" msgstr "Seguir" -#: ../../sflphone-client-gnome/src/toolbar.c:216 -#: ../../sflphone-client-gnome/src/toolbar.c:218 +#: ../../sflphone-client-gnome/src/toolbar.c:208 +#: ../../sflphone-client-gnome/src/toolbar.c:210 msgid "On Hold" msgstr "Retener" -#: ../../sflphone-client-gnome/src/toolbar.c:229 -#: ../../sflphone-client-gnome/src/toolbar.c:231 +#: ../../sflphone-client-gnome/src/toolbar.c:221 +#: ../../sflphone-client-gnome/src/toolbar.c:223 msgid "Transfer" msgstr "Transferir" -#: ../../sflphone-client-gnome/src/toolbar.c:241 -#: ../../sflphone-client-gnome/src/toolbar.c:243 +#: ../../sflphone-client-gnome/src/toolbar.c:233 +#: ../../sflphone-client-gnome/src/toolbar.c:235 msgid "History" msgstr "Historia de Llamada" -#: ../../sflphone-client-gnome/src/toolbar.c:252 -#: ../../sflphone-client-gnome/src/toolbar.c:254 +#: ../../sflphone-client-gnome/src/toolbar.c:244 +#: ../../sflphone-client-gnome/src/toolbar.c:246 msgid "Address book" msgstr "Libreta de contactos" -#: ../../sflphone-client-gnome/src/toolbar.c:260 -#: ../../sflphone-client-gnome/src/toolbar.c:264 +#: ../../sflphone-client-gnome/src/toolbar.c:252 +#: ../../sflphone-client-gnome/src/toolbar.c:256 msgid "Voicemail" msgstr "Mensaje de voz" -#: ../../sflphone-client-gnome/src/toolbar.c:272 +#: ../../sflphone-client-gnome/src/toolbar.c:264 msgid "Record a call" msgstr "Grabar una llamada" -#: ../../sflphone-client-gnome/src/config/accountwindow.c:108 +#: ../../sflphone-client-gnome/src/config/accountwindow.c:113 msgid "Account settings" msgstr "Configuración de cuentas" -#: ../../sflphone-client-gnome/src/config/accountwindow.c:120 +#: ../../sflphone-client-gnome/src/config/accountwindow.c:125 msgid "Account Parameters" msgstr "Parámetros de cuenta" -#: ../../sflphone-client-gnome/src/config/accountwindow.c:142 +#: ../../sflphone-client-gnome/src/config/accountwindow.c:147 msgid "_Enable this account" msgstr "_Habilitar esta cuenta" -#: ../../sflphone-client-gnome/src/config/accountwindow.c:156 +#: ../../sflphone-client-gnome/src/config/accountwindow.c:161 msgid "_Protocol" msgstr "_Protocolo" -#: ../../sflphone-client-gnome/src/config/accountwindow.c:174 +#: ../../sflphone-client-gnome/src/config/accountwindow.c:179 msgid "Unknown" msgstr "Desconocido" -#: ../../sflphone-client-gnome/src/config/addressbook-config.c:265 -#: ../../sflphone-client-gnome/src/config/configwindow.c:732 +#: ../../sflphone-client-gnome/src/config/addressbook-config.c:306 +#: ../../sflphone-client-gnome/src/config/configwindow.c:721 msgid "General" msgstr "General" -#: ../../sflphone-client-gnome/src/config/addressbook-config.c:276 +#: ../../sflphone-client-gnome/src/config/addressbook-config.c:312 msgid "_Use Evolution address books" msgstr "_Usar libreta de contactos de Evolution" -#: ../../sflphone-client-gnome/src/config/addressbook-config.c:283 +#: ../../sflphone-client-gnome/src/config/addressbook-config.c:319 msgid "Download limit:" msgstr "Límite de descarga" -#: ../../sflphone-client-gnome/src/config/addressbook-config.c:294 +#: ../../sflphone-client-gnome/src/config/addressbook-config.c:327 +msgid "cards" +msgstr "" + +#: ../../sflphone-client-gnome/src/config/addressbook-config.c:333 msgid "_Display contact photo if available" msgstr "_Mostrar fotos de contactos, si está disponible" -#: ../../sflphone-client-gnome/src/config/addressbook-config.c:301 -msgid "Fields" -msgstr "Campos" - -#: ../../sflphone-client-gnome/src/config/addressbook-config.c:311 -msgid "Use the following fields from Evolution's address books:" +#: ../../sflphone-client-gnome/src/config/addressbook-config.c:341 +#, fuzzy +msgid "Fields from Evolution's address books" msgstr "Usar los siguientes campos de la libreta de direcciones de Evolution:" -#: ../../sflphone-client-gnome/src/config/addressbook-config.c:316 +#: ../../sflphone-client-gnome/src/config/addressbook-config.c:345 msgid "_Business phone" msgstr "_Numero de teléfono profesional" -#: ../../sflphone-client-gnome/src/config/addressbook-config.c:321 +#: ../../sflphone-client-gnome/src/config/addressbook-config.c:351 msgid "_Home phone" msgstr "_Numero de teléfono personal" -#: ../../sflphone-client-gnome/src/config/addressbook-config.c:326 +#: ../../sflphone-client-gnome/src/config/addressbook-config.c:357 msgid "_Mobile phone" msgstr "_Número de movil" -#: ../../sflphone-client-gnome/src/config/addressbook-config.c:333 +#: ../../sflphone-client-gnome/src/config/addressbook-config.c:364 msgid "Address Books" msgstr "Libreta de direcciones" -#: ../../sflphone-client-gnome/src/config/addressbook-config.c:343 +#: ../../sflphone-client-gnome/src/config/addressbook-config.c:368 msgid "Select which Evolution address books to use:" msgstr "Seleccione las libretas de direcciones de Evolution a usar:" -#: ../../sflphone-client-gnome/src/config/addressbook-config.c:377 -#: ../../sflphone-client-gnome/src/config/audioconf.c:574 +#: ../../sflphone-client-gnome/src/config/addressbook-config.c:404 +#: ../../sflphone-client-gnome/src/config/audioconf.c:576 msgid "Name" msgstr "Nombre" @@ -572,183 +551,191 @@ msgstr "Nombre" msgid "audio device index for output = %d" msgstr "índice del dispositivo de salida de audio = %d" -#: ../../sflphone-client-gnome/src/config/audioconf.c:579 +#: ../../sflphone-client-gnome/src/config/audioconf.c:581 msgid "Frequency" msgstr "Frecuencia" -#: ../../sflphone-client-gnome/src/config/audioconf.c:584 +#: ../../sflphone-client-gnome/src/config/audioconf.c:586 msgid "Bitrate" msgstr "Tasa de transferencia" -#: ../../sflphone-client-gnome/src/config/audioconf.c:589 +#: ../../sflphone-client-gnome/src/config/audioconf.c:591 msgid "Bandwidth" msgstr "Ancho de banda" -#: ../../sflphone-client-gnome/src/config/audioconf.c:652 -msgid "Pulseaudio" -msgstr "Pulseaudio" - -#: ../../sflphone-client-gnome/src/config/audioconf.c:655 -msgid "ALSA" -msgstr "ALSA" - -#: ../../sflphone-client-gnome/src/config/audioconf.c:681 +#: ../../sflphone-client-gnome/src/config/audioconf.c:662 msgid "ALSA plugin" msgstr "Plugin ALSA" -#: ../../sflphone-client-gnome/src/config/audioconf.c:703 +#: ../../sflphone-client-gnome/src/config/audioconf.c:684 msgid "Output" msgstr "Salida" -#: ../../sflphone-client-gnome/src/config/audioconf.c:725 +#: ../../sflphone-client-gnome/src/config/audioconf.c:706 msgid "Input" msgstr "Entrada" -#: ../../sflphone-client-gnome/src/config/audioconf.c:758 -msgid "_Enable ringtones" -msgstr "_Habilitar tonos de llamada" - -#: ../../sflphone-client-gnome/src/config/audioconf.c:764 -msgid "Choose a ringtone" -msgstr "Elija un tono de llmada" - -#: ../../sflphone-client-gnome/src/config/audioconf.c:769 -msgid "Audio Files" -msgstr "Archivos de Audio" - -#: ../../sflphone-client-gnome/src/config/audioconf.c:788 +#: ../../sflphone-client-gnome/src/config/audioconf.c:741 msgid "_Voice Activity Detection" msgstr "_Detección de actividad de voz" -#: ../../sflphone-client-gnome/src/config/audioconf.c:798 +#: ../../sflphone-client-gnome/src/config/audioconf.c:751 msgid "_Noise Reduction (Narrow-Band Companding)" msgstr "_Reducción de ruido" -#: ../../sflphone-client-gnome/src/config/audioconf.c:826 +#: ../../sflphone-client-gnome/src/config/audioconf.c:780 msgid "Sound Manager" msgstr "Gestor de audio" -#: ../../sflphone-client-gnome/src/config/audioconf.c:833 +#: ../../sflphone-client-gnome/src/config/audioconf.c:783 +#, fuzzy +msgid "_Pulseaudio" +msgstr "Pulseaudio" + +#: ../../sflphone-client-gnome/src/config/audioconf.c:788 +#, fuzzy +msgid "_ALSA" +msgstr "ALSA" + +#: ../../sflphone-client-gnome/src/config/audioconf.c:795 msgid "ALSA configuration" msgstr "Configuración de ALSA" -#: ../../sflphone-client-gnome/src/config/audioconf.c:850 +#: ../../sflphone-client-gnome/src/config/audioconf.c:812 msgid "Codecs" msgstr "Códecs" -#: ../../sflphone-client-gnome/src/config/audioconf.c:873 +#: ../../sflphone-client-gnome/src/config/audioconf.c:835 msgid "Ringtones" msgstr "Tonos de llamada" -#: ../../sflphone-client-gnome/src/config/configwindow.c:402 +#: ../../sflphone-client-gnome/src/config/audioconf.c:841 +msgid "_Enable ringtones" +msgstr "_Habilitar tonos de llamada" + +#: ../../sflphone-client-gnome/src/config/audioconf.c:847 +msgid "Choose a ringtone" +msgstr "Elija un tono de llmada" + +#: ../../sflphone-client-gnome/src/config/audioconf.c:853 +msgid "Audio Files" +msgstr "Archivos de Audio" + +#: ../../sflphone-client-gnome/src/config/configwindow.c:418 msgid "Protocol" msgstr "Protocolo" -#: ../../sflphone-client-gnome/src/config/configwindow.c:409 +#: ../../sflphone-client-gnome/src/config/configwindow.c:425 msgid "Status" msgstr "Estado" -#: ../../sflphone-client-gnome/src/config/configwindow.c:512 +#: ../../sflphone-client-gnome/src/config/configwindow.c:528 msgid "Stun parameters will apply to each SIP account created." msgstr "Parámetros de stun se aplicarán a cada cuenta SIP creada." -#: ../../sflphone-client-gnome/src/config/configwindow.c:520 +#: ../../sflphone-client-gnome/src/config/configwindow.c:536 msgid "Enable it if you are behind a firewall" msgstr "Actívelo si está detrás de un cortafuegos" -#: ../../sflphone-client-gnome/src/config/configwindow.c:528 +#: ../../sflphone-client-gnome/src/config/configwindow.c:544 msgid "Format: name.server:port" msgstr "Formato: nombre.servidor:puerto" -#: ../../sflphone-client-gnome/src/config/configwindow.c:579 +#: ../../sflphone-client-gnome/src/config/configwindow.c:589 msgid "Desktop Notifications" msgstr "Notificación de escritorio" -#: ../../sflphone-client-gnome/src/config/configwindow.c:588 +#: ../../sflphone-client-gnome/src/config/configwindow.c:593 msgid "_Enable notifications" msgstr "_Habilitar notificaciones" -#: ../../sflphone-client-gnome/src/config/configwindow.c:594 +#: ../../sflphone-client-gnome/src/config/configwindow.c:599 msgid "Enable voicemail _notifications" msgstr "Habilitar _notificaciones de mensajes de voz" -#: ../../sflphone-client-gnome/src/config/configwindow.c:605 +#: ../../sflphone-client-gnome/src/config/configwindow.c:611 msgid "System Tray Icon" msgstr "Icono de bandeja del sistema" -#: ../../sflphone-client-gnome/src/config/configwindow.c:613 +#: ../../sflphone-client-gnome/src/config/configwindow.c:614 msgid "_Popup main window on incoming call" msgstr "_Popup ventana principal al recibir llamadas" -#: ../../sflphone-client-gnome/src/config/configwindow.c:618 +#: ../../sflphone-client-gnome/src/config/configwindow.c:619 msgid "Ne_ver popup main window" msgstr "_Nunca mostrar ventana principal" -#: ../../sflphone-client-gnome/src/config/configwindow.c:622 +#: ../../sflphone-client-gnome/src/config/configwindow.c:623 msgid "Hide SFLphone window on _startup" msgstr "Esconder SFLphone en el arranque" -#: ../../sflphone-client-gnome/src/config/configwindow.c:628 +#: ../../sflphone-client-gnome/src/config/configwindow.c:629 msgid "Calls History" msgstr "Historial de llamadas" -#: ../../sflphone-client-gnome/src/config/configwindow.c:636 -msgid "_History size limit" -msgstr "Límite de tamaño de _historial" +#: ../../sflphone-client-gnome/src/config/configwindow.c:632 +msgid "_Keep my history for at least" +msgstr "" + +#: ../../sflphone-client-gnome/src/config/configwindow.c:643 +msgid " days" +msgstr "" -#: ../../sflphone-client-gnome/src/config/configwindow.c:653 +#: ../../sflphone-client-gnome/src/config/configwindow.c:647 msgid "PulseAudio sound server" msgstr "Servidor de sonido Pulseaudio" -#: ../../sflphone-client-gnome/src/config/configwindow.c:661 -msgid "Mute other applications during a _call" +#: ../../sflphone-client-gnome/src/config/configwindow.c:650 +#, fuzzy +msgid "_Mute other applications during a call" msgstr "Silenciar el resto de aplicaciones durante una llamada" -#: ../../sflphone-client-gnome/src/config/configwindow.c:674 +#: ../../sflphone-client-gnome/src/config/configwindow.c:664 msgid "SIP Port" msgstr "Puerto SIP" -#: ../../sflphone-client-gnome/src/config/configwindow.c:687 +#: ../../sflphone-client-gnome/src/config/configwindow.c:677 msgid "Port:" msgstr "Puerto:" -#: ../../sflphone-client-gnome/src/config/configwindow.c:742 -msgid "_Recordings folder" +#: ../../sflphone-client-gnome/src/config/configwindow.c:725 +#, fuzzy +msgid "Recordings folder" msgstr "Directorio de Grabaciones" -#: ../../sflphone-client-gnome/src/config/configwindow.c:748 +#: ../../sflphone-client-gnome/src/config/configwindow.c:731 msgid "Select a folder" msgstr "Seleccione un directorio" -#: ../../sflphone-client-gnome/src/config/configwindow.c:773 +#: ../../sflphone-client-gnome/src/config/configwindow.c:765 msgid "Preferences" msgstr "Preferencias" -#: ../../sflphone-client-gnome/src/config/configwindow.c:793 +#: ../../sflphone-client-gnome/src/config/configwindow.c:785 msgid "General Settings" msgstr "Configuración general" -#: ../../sflphone-client-gnome/src/config/configwindow.c:798 +#: ../../sflphone-client-gnome/src/config/configwindow.c:790 msgid "Audio Settings" msgstr "Configuración de audio" -#: ../../sflphone-client-gnome/src/config/configwindow.c:803 +#: ../../sflphone-client-gnome/src/config/configwindow.c:795 msgid "Recordings" msgstr "Grabaciones" -#: ../../sflphone-client-gnome/src/config/configwindow.c:808 +#: ../../sflphone-client-gnome/src/config/configwindow.c:800 msgid "Address Book" msgstr "Libreta de direcciones" -#: ../../sflphone-client-gnome/src/config/configwindow.c:813 +#: ../../sflphone-client-gnome/src/config/configwindow.c:805 msgid "Hooks" msgstr "Disparadores" -#: ../../sflphone-client-gnome/src/config/configwindow.c:840 +#: ../../sflphone-client-gnome/src/config/configwindow.c:832 msgid "Accounts" msgstr "Cuentas" -#: ../../sflphone-client-gnome/src/config/configwindow.c:852 +#: ../../sflphone-client-gnome/src/config/configwindow.c:844 msgid "Configured Accounts" msgstr "Cuentas Configuradas" @@ -756,46 +743,95 @@ msgstr "Cuentas Configuradas" msgid "URL Passing" msgstr "Paso de URL" -#: ../../sflphone-client-gnome/src/config/hooks-config.c:140 +#: ../../sflphone-client-gnome/src/config/hooks-config.c:135 +msgid "Custom commands on incoming calls with URL," +msgstr "" + +#: ../../sflphone-client-gnome/src/config/hooks-config.c:138 #, c-format -msgid "" -"SFLphone can run custom commands if incoming calls come with an URL " -"attached.\n" -"In this case, %s will be replaced with the passed URL." +msgid "%s will be replaced with the passed URL." msgstr "" -"SFLphone puede ejecutar órdenes personalizadas si las llamadas entrantes " -"incluyen una URL.\n" -"En este caso, %s se remplazará por la URL." -#: ../../sflphone-client-gnome/src/config/hooks-config.c:143 +#: ../../sflphone-client-gnome/src/config/hooks-config.c:141 msgid "Trigger on specific _SIP header" msgstr "Evento desencadenado con una cabecera _SIP específica" -#: ../../sflphone-client-gnome/src/config/hooks-config.c:155 +#: ../../sflphone-client-gnome/src/config/hooks-config.c:150 msgid "Trigger on _IAX2 URL" msgstr "Evento desencadenado con una URL _IAX2" -#: ../../sflphone-client-gnome/src/config/hooks-config.c:160 -msgid "_Command to run: " +#: ../../sflphone-client-gnome/src/config/hooks-config.c:155 +#, fuzzy +msgid "Command to _run: " msgstr "_Orden a ejecutar: " -#: ../../sflphone-client-gnome/src/config/hooks-config.c:168 +#: ../../sflphone-client-gnome/src/config/hooks-config.c:165 msgid "Phone Number Rewriting" msgstr "Reescritura de número de teléfono" -#: ../../sflphone-client-gnome/src/config/hooks-config.c:178 +#: ../../sflphone-client-gnome/src/config/hooks-config.c:169 msgid "_Prefix dialed numbers with:" msgstr "_prefijar los números marcados con:" -#: ../../sflphone-client-gnome/src/contacts/history.c:83 -#: ../../sflphone-client-gnome/src/contacts/searchbar.c:123 -msgid "Search history" -msgstr "Historial de búsquedas" +#: ../../sflphone-client-gnome/src/contacts/searchbar.c:55 +msgid "" +"Search all\n" +"Click here to change the search type" +msgstr "" + +#: ../../sflphone-client-gnome/src/contacts/searchbar.c:67 +msgid "" +"Search by missed call\n" +"Click here to change the search type" +msgstr "" + +#: ../../sflphone-client-gnome/src/contacts/searchbar.c:79 +msgid "" +"Search by incoming call\n" +"Click here to change the search type" +msgstr "" + +#: ../../sflphone-client-gnome/src/contacts/searchbar.c:91 +msgid "" +"Search by outgoing call\n" +"Click here to change the search type" +msgstr "" + +#~ msgid "Accept" +#~ msgstr "Aceptar" + +#~ msgid "Refuse" +#~ msgstr "Rechazar" + +#~ msgid "Ignore" +#~ msgstr "Ignorar" + +#~ msgid "<small>Missed call</small>" +#~ msgstr "<small>Llamada fallida</small>" + +#~ msgid "<small>Duration:</small> %s" +#~ msgstr "<small>Duración:</small> %s" + +#~ msgid "Fields" +#~ msgstr "Campos" + +#~ msgid "_History size limit" +#~ msgstr "Límite de tamaño de _historial" + +#~ msgid "" +#~ "SFLphone can run custom commands if incoming calls come with an URL " +#~ "attached.\n" +#~ "In this case, %s will be replaced with the passed URL." +#~ msgstr "" +#~ "SFLphone puede ejecutar órdenes personalizadas si las llamadas entrantes " +#~ "incluyen una URL.\n" +#~ "En este caso, %s se remplazará por la URL." + +#~ msgid "Search history" +#~ msgstr "Historial de búsquedas" -#: ../../sflphone-client-gnome/src/contacts/history.c:83 -#: ../../sflphone-client-gnome/src/contacts/searchbar.c:110 -msgid "Search contact" -msgstr "_Buscar contacto" +#~ msgid "Search contact" +#~ msgstr "_Buscar contacto" #~ msgid "Registered to %s (%s)" #~ msgstr "Registrado en %s (%s)" diff --git a/sflphone-common/po/fr.po b/sflphone-common/po/fr.po index e820d6547fc188eeacd4397ad2991f890521629c..00f01e79b6dfb7900d21bc86dda72d4b25baac44 100644 --- a/sflphone-common/po/fr.po +++ b/sflphone-common/po/fr.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: SFLphone 0.9.4\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-05-21 10:45-0400\n" +"POT-Creation-Date: 2009-06-12 18:05-0400\n" "PO-Revision-Date: 2008-03-31 14:15\n" "Last-Translator: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com>\n" "Language-Team: SavoirFaireLinux Inc <sflphoneteam@savoirfairelinux.com>\n" @@ -18,50 +18,50 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n>1;\n" -#: ../../sflphone-client-gnome/src/accountlist.c:169 +#: ../../sflphone-client-gnome/src/accountlist.c:175 msgid "Registered" msgstr "Enregistré" -#: ../../sflphone-client-gnome/src/accountlist.c:172 +#: ../../sflphone-client-gnome/src/accountlist.c:178 msgid "Not Registered" msgstr "Non Enregistré" -#: ../../sflphone-client-gnome/src/accountlist.c:175 +#: ../../sflphone-client-gnome/src/accountlist.c:181 msgid "Trying..." msgstr "En cours..." -#: ../../sflphone-client-gnome/src/accountlist.c:178 -#: ../../sflphone-client-gnome/src/sflnotify.c:176 -#: ../../sflphone-client-gnome/src/sflnotify.c:217 +#: ../../sflphone-client-gnome/src/accountlist.c:184 +#: ../../sflphone-client-gnome/src/sflnotify.c:131 +#: ../../sflphone-client-gnome/src/sflnotify.c:148 msgid "Error" msgstr "Erreur" -#: ../../sflphone-client-gnome/src/accountlist.c:181 +#: ../../sflphone-client-gnome/src/accountlist.c:187 msgid "Bad authentification" msgstr "Erreur d'authentification" -#: ../../sflphone-client-gnome/src/accountlist.c:184 +#: ../../sflphone-client-gnome/src/accountlist.c:190 msgid "Network unreachable" msgstr "Réseau non trouvé" -#: ../../sflphone-client-gnome/src/accountlist.c:187 +#: ../../sflphone-client-gnome/src/accountlist.c:193 msgid "Host unreachable" msgstr "Serveur introuvable" -#: ../../sflphone-client-gnome/src/accountlist.c:190 +#: ../../sflphone-client-gnome/src/accountlist.c:196 msgid "Stun configuration error" msgstr "Erreur de configuration Stun" -#: ../../sflphone-client-gnome/src/accountlist.c:193 +#: ../../sflphone-client-gnome/src/accountlist.c:199 msgid "Stun server invalid" msgstr "Serveur Stun invalide" -#: ../../sflphone-client-gnome/src/accountlist.c:196 +#: ../../sflphone-client-gnome/src/accountlist.c:202 msgid "Invalid" msgstr "Non valide" #: ../../sflphone-client-gnome/src/actions.c:55 -#: ../../sflphone-client-gnome/src/sflnotify.c:108 +#: ../../sflphone-client-gnome/src/sflnotify.c:94 #, c-format msgid "%d voice mails" msgstr "%d messages vocaux" @@ -80,7 +80,7 @@ msgstr "Utilise %s (%s)" msgid "No registered account" msgstr "Aucun compte enregistré" -#: ../../sflphone-client-gnome/src/actions.c:229 +#: ../../sflphone-client-gnome/src/actions.c:232 msgid "" "Unable to connect to the SFLphone server.\n" "Make sure the daemon is running." @@ -88,17 +88,17 @@ msgstr "" "Impossible de se connecter au serveur SFLphone.\n" " Assurez-vous que le démon est lancé." -#: ../../sflphone-client-gnome/src/actions.c:787 +#: ../../sflphone-client-gnome/src/actions.c:807 #, c-format msgid "IP call - %s" msgstr "Appel IP - %s" -#: ../../sflphone-client-gnome/src/actions.c:790 +#: ../../sflphone-client-gnome/src/actions.c:810 #, c-format msgid "Using %s (%s) - Codec: %s" msgstr "Utilise %s (%s) - Codec: %s" -#: ../../sflphone-client-gnome/src/actions.c:880 +#: ../../sflphone-client-gnome/src/actions.c:900 #, c-format msgid "" "<b>Error: No audio codecs found.\n" @@ -130,126 +130,126 @@ msgstr "" "Serveur : %s\n" "Nom d'usager : %s\n" -#: ../../sflphone-client-gnome/src/assistant.c:160 +#: ../../sflphone-client-gnome/src/assistant.c:159 msgid "SFLphone account configuration wizard" msgstr "Assistant de configuration de compte" -#: ../../sflphone-client-gnome/src/assistant.c:186 +#: ../../sflphone-client-gnome/src/assistant.c:185 msgid "Welcome to SFLphone!" msgstr "Bienvenue dans SFLphone" -#: ../../sflphone-client-gnome/src/assistant.c:187 +#: ../../sflphone-client-gnome/src/assistant.c:186 msgid "This installation wizard will help you configure an account." msgstr "Cet assistant va vous guider dans la configuration d'un compte. " -#: ../../sflphone-client-gnome/src/assistant.c:201 +#: ../../sflphone-client-gnome/src/assistant.c:200 msgid "VoIP Protocols" msgstr "Protocoles VoIP" -#: ../../sflphone-client-gnome/src/assistant.c:201 +#: ../../sflphone-client-gnome/src/assistant.c:200 msgid "Select an account type:" msgstr "Choisissez un type de compte:" -#: ../../sflphone-client-gnome/src/assistant.c:219 +#: ../../sflphone-client-gnome/src/assistant.c:218 msgid "Account" msgstr "Compte" -#: ../../sflphone-client-gnome/src/assistant.c:219 +#: ../../sflphone-client-gnome/src/assistant.c:218 msgid "Please select one of the following option:" msgstr "Veuillez remplir les champs suivants:" -#: ../../sflphone-client-gnome/src/assistant.c:221 +#: ../../sflphone-client-gnome/src/assistant.c:220 msgid "Create a free SIP/IAX2 account on sflphone.org" msgstr "Créer un compte SIP/IAX2 gratuit sur sflphone.org" -#: ../../sflphone-client-gnome/src/assistant.c:223 +#: ../../sflphone-client-gnome/src/assistant.c:222 msgid "Register an existing SIP or IAX2 account" msgstr "Enregistrer un compte SIP ou IAX2 existant" -#: ../../sflphone-client-gnome/src/assistant.c:236 +#: ../../sflphone-client-gnome/src/assistant.c:235 msgid "SIP account configuration" msgstr "Configuration d'un compte SIP" -#: ../../sflphone-client-gnome/src/assistant.c:236 -#: ../../sflphone-client-gnome/src/assistant.c:332 +#: ../../sflphone-client-gnome/src/assistant.c:235 +#: ../../sflphone-client-gnome/src/assistant.c:331 msgid "Please fill the following information:" msgstr "Veuillez remplir les champs suivants:" -#: ../../sflphone-client-gnome/src/assistant.c:244 -#: ../../sflphone-client-gnome/src/assistant.c:340 -#: ../../sflphone-client-gnome/src/config/accountwindow.c:148 +#: ../../sflphone-client-gnome/src/assistant.c:243 +#: ../../sflphone-client-gnome/src/assistant.c:339 +#: ../../sflphone-client-gnome/src/config/accountwindow.c:153 msgid "_Alias" msgstr "A_lias" -#: ../../sflphone-client-gnome/src/assistant.c:252 -#: ../../sflphone-client-gnome/src/assistant.c:348 -#: ../../sflphone-client-gnome/src/config/accountwindow.c:184 +#: ../../sflphone-client-gnome/src/assistant.c:251 +#: ../../sflphone-client-gnome/src/assistant.c:347 +#: ../../sflphone-client-gnome/src/config/accountwindow.c:189 msgid "_Host name" msgstr "_Serveur" -#: ../../sflphone-client-gnome/src/assistant.c:260 -#: ../../sflphone-client-gnome/src/assistant.c:356 -#: ../../sflphone-client-gnome/src/config/accountwindow.c:192 +#: ../../sflphone-client-gnome/src/assistant.c:259 +#: ../../sflphone-client-gnome/src/assistant.c:355 +#: ../../sflphone-client-gnome/src/config/accountwindow.c:197 msgid "_User name" msgstr "Usa_ger" -#: ../../sflphone-client-gnome/src/assistant.c:276 -#: ../../sflphone-client-gnome/src/assistant.c:371 -#: ../../sflphone-client-gnome/src/config/accountwindow.c:207 +#: ../../sflphone-client-gnome/src/assistant.c:275 +#: ../../sflphone-client-gnome/src/assistant.c:370 +#: ../../sflphone-client-gnome/src/config/accountwindow.c:212 msgid "_Password" msgstr "_Mot de passe" -#: ../../sflphone-client-gnome/src/assistant.c:294 -#: ../../sflphone-client-gnome/src/assistant.c:387 -#: ../../sflphone-client-gnome/src/config/accountwindow.c:223 +#: ../../sflphone-client-gnome/src/assistant.c:293 +#: ../../sflphone-client-gnome/src/assistant.c:386 +#: ../../sflphone-client-gnome/src/config/accountwindow.c:228 msgid "_Voicemail number" msgstr "_Boite vocale #" -#: ../../sflphone-client-gnome/src/assistant.c:309 +#: ../../sflphone-client-gnome/src/assistant.c:308 msgid "Optional Email Address " msgstr "Courriel optionnel" -#: ../../sflphone-client-gnome/src/assistant.c:309 +#: ../../sflphone-client-gnome/src/assistant.c:308 msgid "This email address will be use to send your voicemail messages" msgstr "Vos messages vocaux seront envoyés par courriel à cette adresse " -#: ../../sflphone-client-gnome/src/assistant.c:317 +#: ../../sflphone-client-gnome/src/assistant.c:316 msgid "_Email" msgstr "_Email" -#: ../../sflphone-client-gnome/src/assistant.c:332 +#: ../../sflphone-client-gnome/src/assistant.c:331 msgid "IAX2 account configuration" msgstr "Configuration d'un compte IAX2" -#: ../../sflphone-client-gnome/src/assistant.c:405 -#: ../../sflphone-client-gnome/src/config/configwindow.c:863 +#: ../../sflphone-client-gnome/src/assistant.c:404 +#: ../../sflphone-client-gnome/src/config/configwindow.c:855 msgid "Network Address Translation" msgstr "Traduction d'adresse réseau (NAT)" -#: ../../sflphone-client-gnome/src/assistant.c:405 +#: ../../sflphone-client-gnome/src/assistant.c:404 msgid "You should probably enable this if you are behind a firewall." msgstr "" "Vous devriez probablement activer cette option si vous vous trouvez derrière " "un pare-feu." -#: ../../sflphone-client-gnome/src/assistant.c:414 -#: ../../sflphone-client-gnome/src/config/configwindow.c:516 +#: ../../sflphone-client-gnome/src/assistant.c:413 +#: ../../sflphone-client-gnome/src/config/configwindow.c:532 msgid "E_nable STUN" msgstr "A_ctiver STUN" -#: ../../sflphone-client-gnome/src/assistant.c:421 +#: ../../sflphone-client-gnome/src/assistant.c:420 msgid "_STUN server" msgstr "S_erveur STUN" -#: ../../sflphone-client-gnome/src/assistant.c:435 +#: ../../sflphone-client-gnome/src/assistant.c:434 msgid "Account Registration" msgstr "Enregistrement du compte" -#: ../../sflphone-client-gnome/src/assistant.c:435 +#: ../../sflphone-client-gnome/src/assistant.c:434 msgid "Congratulations!" msgstr "Félicitations!" -#: ../../sflphone-client-gnome/src/errors.c:28 +#: ../../sflphone-client-gnome/src/errors.c:29 msgid "" "ALSA notification\n" "\n" @@ -259,7 +259,7 @@ msgstr "" "\n" "Erreur lors de l'ouverture du périphérique de sortie" -#: ../../sflphone-client-gnome/src/errors.c:31 +#: ../../sflphone-client-gnome/src/errors.c:32 msgid "" "ALSA notification\n" "\n" @@ -269,7 +269,7 @@ msgstr "" "\n" "Erreur lors de l'ouverture du périphérique d'entrée" -#: ../../sflphone-client-gnome/src/errors.c:34 +#: ../../sflphone-client-gnome/src/errors.c:35 msgid "" "Pulseaudio notification\n" "\n" @@ -308,114 +308,100 @@ msgstr "A propos de SFLphone" msgid "_Help" msgstr "A_ide" -#: ../../sflphone-client-gnome/src/menus.c:300 -#: ../../sflphone-client-gnome/src/menus.c:971 +#: ../../sflphone-client-gnome/src/menus.c:296 +#: ../../sflphone-client-gnome/src/menus.c:962 msgid "_New call" msgstr "_Nouvel appel" -#: ../../sflphone-client-gnome/src/menus.c:312 -#: ../../sflphone-client-gnome/src/menus.c:803 +#: ../../sflphone-client-gnome/src/menus.c:308 +#: ../../sflphone-client-gnome/src/menus.c:794 msgid "_Pick up" msgstr "_Décrocher" -#: ../../sflphone-client-gnome/src/menus.c:322 -#: ../../sflphone-client-gnome/src/menus.c:815 +#: ../../sflphone-client-gnome/src/menus.c:318 +#: ../../sflphone-client-gnome/src/menus.c:806 msgid "_Hang up" msgstr "_Raccrocher" -#: ../../sflphone-client-gnome/src/menus.c:332 -#: ../../sflphone-client-gnome/src/menus.c:827 +#: ../../sflphone-client-gnome/src/menus.c:328 +#: ../../sflphone-client-gnome/src/menus.c:818 msgid "On _Hold" msgstr "_Mettre en attente" -#: ../../sflphone-client-gnome/src/menus.c:344 -#: ../../sflphone-client-gnome/src/menus.c:839 +#: ../../sflphone-client-gnome/src/menus.c:340 +#: ../../sflphone-client-gnome/src/menus.c:830 msgid "_Record" msgstr "Enregistrer" -#: ../../sflphone-client-gnome/src/menus.c:358 +#: ../../sflphone-client-gnome/src/menus.c:354 msgid "_Account creation wizard" -msgstr "Assistant de création de compte" +msgstr "_Assistant de création de compte" -#: ../../sflphone-client-gnome/src/menus.c:388 +#: ../../sflphone-client-gnome/src/menus.c:384 msgid "_Call" msgstr "_Actions" -#: ../../sflphone-client-gnome/src/menus.c:561 -msgid "_Clear history" -msgstr "Effacer l'historique" +#: ../../sflphone-client-gnome/src/menus.c:552 +msgid "Clear _history" +msgstr "Effacer l'_historique" -#: ../../sflphone-client-gnome/src/menus.c:573 +#: ../../sflphone-client-gnome/src/menus.c:564 msgid "_Accounts" msgstr "Co_mptes" -#: ../../sflphone-client-gnome/src/menus.c:588 +#: ../../sflphone-client-gnome/src/menus.c:579 msgid "_Edit" -msgstr "_Options" +msgstr "_Editer" -#: ../../sflphone-client-gnome/src/menus.c:649 +#: ../../sflphone-client-gnome/src/menus.c:640 msgid "_Dialpad" msgstr "_Clavier" -#: ../../sflphone-client-gnome/src/menus.c:661 +#: ../../sflphone-client-gnome/src/menus.c:652 msgid "_Volume controls" -msgstr "_Contrôle du volume" +msgstr "Contrôle du _volume" -#: ../../sflphone-client-gnome/src/menus.c:679 +#: ../../sflphone-client-gnome/src/menus.c:670 msgid "_View" msgstr "A_ffichage" -#: ../../sflphone-client-gnome/src/menus.c:899 +#: ../../sflphone-client-gnome/src/menus.c:890 msgid "_Call back" msgstr "_Rappeler" -#: ../../sflphone-client-gnome/src/menus.c:1082 +#: ../../sflphone-client-gnome/src/menus.c:1070 msgid "Edit phone" msgstr "Éditer numéro" -#: ../../sflphone-client-gnome/src/menus.c:1093 +#: ../../sflphone-client-gnome/src/menus.c:1081 msgid "Edit the phone number before making a call" msgstr "Éditer le numéro de téléphone avant d'appeler" -#: ../../sflphone-client-gnome/src/sflnotify.c:38 -#: ../../sflphone-client-gnome/src/sflnotify.c:105 +#: ../../sflphone-client-gnome/src/sflnotify.c:71 +#: ../../sflphone-client-gnome/src/sflnotify.c:91 #, c-format msgid "%s account: %s" msgstr "Compte %s: %s" -#: ../../sflphone-client-gnome/src/sflnotify.c:42 +#: ../../sflphone-client-gnome/src/sflnotify.c:75 #, c-format msgid "<i>From:</i> %s" msgstr "<i>De:</i> %s" -#: ../../sflphone-client-gnome/src/sflnotify.c:57 -msgid "Accept" -msgstr "Accepter" - -#: ../../sflphone-client-gnome/src/sflnotify.c:58 -msgid "Refuse" -msgstr "Refuser" - -#: ../../sflphone-client-gnome/src/sflnotify.c:59 -#: ../../sflphone-client-gnome/src/sflnotify.c:122 -#: ../../sflphone-client-gnome/src/sflnotify.c:159 -msgid "Ignore" -msgstr "Ignorer" - -#: ../../sflphone-client-gnome/src/sflnotify.c:141 +#: ../../sflphone-client-gnome/src/sflnotify.c:111 #, c-format msgid "Calling with %s account <i>%s</i>" msgstr "Appel avec le compte %s <i>%s</i>" -#: ../../sflphone-client-gnome/src/sflnotify.c:145 +#: ../../sflphone-client-gnome/src/sflnotify.c:115 msgid "Current account" msgstr "Compte courant" -#: ../../sflphone-client-gnome/src/sflnotify.c:174 +#: ../../sflphone-client-gnome/src/sflnotify.c:130 msgid "You haven't setup any accounts" msgstr "Vous n'avez aucun compte configuré" -#: ../../sflphone-client-gnome/src/sflnotify.c:214 +#: ../../sflphone-client-gnome/src/sflnotify.c:147 msgid "You have no registered accounts" msgstr "Vous n'avez aucun compte enregistré" @@ -436,136 +422,127 @@ msgstr "_Afficher la fenêtre principale" msgid "SFLphone - %i accounts configured" msgstr "SFLphone - %i comptes configurés" -#: ../../sflphone-client-gnome/src/timestamp.c:46 -msgid "<small>Missed call</small>" -msgstr "<small>Appel manqué</small>" - -#: ../../sflphone-client-gnome/src/timestamp.c:64 -#, c-format -msgid "<small>Duration:</small> %s" -msgstr "<small>Durée:</small> %s" - #: ../../sflphone-client-gnome/src/toolbar.c:50 #, c-format msgid "\"Voicemail\" <%s>" msgstr "\"Boite vocale\" <%s>" -#: ../../sflphone-client-gnome/src/toolbar.c:176 -#: ../../sflphone-client-gnome/src/toolbar.c:178 +#: ../../sflphone-client-gnome/src/toolbar.c:168 +#: ../../sflphone-client-gnome/src/toolbar.c:170 msgid "Place a call" msgstr "Appeler" -#: ../../sflphone-client-gnome/src/toolbar.c:185 -#: ../../sflphone-client-gnome/src/toolbar.c:187 +#: ../../sflphone-client-gnome/src/toolbar.c:177 +#: ../../sflphone-client-gnome/src/toolbar.c:179 msgid "Pick up" msgstr "Décrocher" -#: ../../sflphone-client-gnome/src/toolbar.c:195 -#: ../../sflphone-client-gnome/src/toolbar.c:197 +#: ../../sflphone-client-gnome/src/toolbar.c:187 +#: ../../sflphone-client-gnome/src/toolbar.c:189 msgid "Hang up" msgstr "Raccrocher" -#: ../../sflphone-client-gnome/src/toolbar.c:205 -#: ../../sflphone-client-gnome/src/toolbar.c:207 +#: ../../sflphone-client-gnome/src/toolbar.c:197 +#: ../../sflphone-client-gnome/src/toolbar.c:199 msgid "Off Hold" msgstr "Reprendre" -#: ../../sflphone-client-gnome/src/toolbar.c:216 -#: ../../sflphone-client-gnome/src/toolbar.c:218 +#: ../../sflphone-client-gnome/src/toolbar.c:208 +#: ../../sflphone-client-gnome/src/toolbar.c:210 msgid "On Hold" msgstr "Mettre en attente" -#: ../../sflphone-client-gnome/src/toolbar.c:229 -#: ../../sflphone-client-gnome/src/toolbar.c:231 +#: ../../sflphone-client-gnome/src/toolbar.c:221 +#: ../../sflphone-client-gnome/src/toolbar.c:223 msgid "Transfer" msgstr "Transférer" -#: ../../sflphone-client-gnome/src/toolbar.c:241 -#: ../../sflphone-client-gnome/src/toolbar.c:243 +#: ../../sflphone-client-gnome/src/toolbar.c:233 +#: ../../sflphone-client-gnome/src/toolbar.c:235 msgid "History" msgstr "Historique" -#: ../../sflphone-client-gnome/src/toolbar.c:252 -#: ../../sflphone-client-gnome/src/toolbar.c:254 +#: ../../sflphone-client-gnome/src/toolbar.c:244 +#: ../../sflphone-client-gnome/src/toolbar.c:246 msgid "Address book" msgstr "Carnet d'adresse" -#: ../../sflphone-client-gnome/src/toolbar.c:260 -#: ../../sflphone-client-gnome/src/toolbar.c:264 +#: ../../sflphone-client-gnome/src/toolbar.c:252 +#: ../../sflphone-client-gnome/src/toolbar.c:256 msgid "Voicemail" msgstr "Boite vocale" -#: ../../sflphone-client-gnome/src/toolbar.c:272 +#: ../../sflphone-client-gnome/src/toolbar.c:264 msgid "Record a call" -msgstr "Enregistrer un appel" +msgstr "_Enregistrer un appel" -#: ../../sflphone-client-gnome/src/config/accountwindow.c:108 +#: ../../sflphone-client-gnome/src/config/accountwindow.c:113 msgid "Account settings" msgstr "Configuration des comptes" -#: ../../sflphone-client-gnome/src/config/accountwindow.c:120 +#: ../../sflphone-client-gnome/src/config/accountwindow.c:125 msgid "Account Parameters" msgstr "Paramètres du Compte" -#: ../../sflphone-client-gnome/src/config/accountwindow.c:142 +#: ../../sflphone-client-gnome/src/config/accountwindow.c:147 msgid "_Enable this account" msgstr "Activer ce compte" -#: ../../sflphone-client-gnome/src/config/accountwindow.c:156 +#: ../../sflphone-client-gnome/src/config/accountwindow.c:161 msgid "_Protocol" -msgstr "_Protocole" +msgstr "P_rotocole" -#: ../../sflphone-client-gnome/src/config/accountwindow.c:174 +#: ../../sflphone-client-gnome/src/config/accountwindow.c:179 msgid "Unknown" msgstr "Inconnu" -#: ../../sflphone-client-gnome/src/config/addressbook-config.c:265 -#: ../../sflphone-client-gnome/src/config/configwindow.c:732 +#: ../../sflphone-client-gnome/src/config/addressbook-config.c:306 +#: ../../sflphone-client-gnome/src/config/configwindow.c:721 msgid "General" msgstr "Général" -#: ../../sflphone-client-gnome/src/config/addressbook-config.c:276 +#: ../../sflphone-client-gnome/src/config/addressbook-config.c:312 msgid "_Use Evolution address books" -msgstr "Utiliser les carnets d'adresse d'Évolution" +msgstr "_Utiliser les carnets d'adresse d'Évolution" -#: ../../sflphone-client-gnome/src/config/addressbook-config.c:283 +#: ../../sflphone-client-gnome/src/config/addressbook-config.c:319 msgid "Download limit:" -msgstr "Limite de téléchargement:" +msgstr "Limite de _téléchargement:" -#: ../../sflphone-client-gnome/src/config/addressbook-config.c:294 -msgid "_Display contact photo if available" -msgstr "Afficher la photo si disponible" +#: ../../sflphone-client-gnome/src/config/addressbook-config.c:327 +msgid "cards" +msgstr "" -#: ../../sflphone-client-gnome/src/config/addressbook-config.c:301 -msgid "Fields" -msgstr "Champs" +#: ../../sflphone-client-gnome/src/config/addressbook-config.c:333 +msgid "_Display contact photo if available" +msgstr "_Afficher la photo si disponible" -#: ../../sflphone-client-gnome/src/config/addressbook-config.c:311 -msgid "Use the following fields from Evolution's address books:" +#: ../../sflphone-client-gnome/src/config/addressbook-config.c:341 +msgid "Fields from Evolution's address books" msgstr "Utiliser les champs suivants des carnets d'adresse d'Évolution" -#: ../../sflphone-client-gnome/src/config/addressbook-config.c:316 +#: ../../sflphone-client-gnome/src/config/addressbook-config.c:345 msgid "_Business phone" -msgstr "Tél du bureau" +msgstr "Tél du _bureau" -#: ../../sflphone-client-gnome/src/config/addressbook-config.c:321 +#: ../../sflphone-client-gnome/src/config/addressbook-config.c:351 msgid "_Home phone" -msgstr "Tél du domicile" +msgstr "Tél du _domicile" -#: ../../sflphone-client-gnome/src/config/addressbook-config.c:326 +#: ../../sflphone-client-gnome/src/config/addressbook-config.c:357 msgid "_Mobile phone" -msgstr "Tél portable" +msgstr "Tél _portable" -#: ../../sflphone-client-gnome/src/config/addressbook-config.c:333 +#: ../../sflphone-client-gnome/src/config/addressbook-config.c:364 msgid "Address Books" msgstr "Carnets d'adresse" -#: ../../sflphone-client-gnome/src/config/addressbook-config.c:343 +#: ../../sflphone-client-gnome/src/config/addressbook-config.c:368 msgid "Select which Evolution address books to use:" msgstr "Sélectionner quels carnets d'adresse d'Évolution utiliser:" -#: ../../sflphone-client-gnome/src/config/addressbook-config.c:377 -#: ../../sflphone-client-gnome/src/config/audioconf.c:574 +#: ../../sflphone-client-gnome/src/config/addressbook-config.c:404 +#: ../../sflphone-client-gnome/src/config/audioconf.c:576 msgid "Name" msgstr "Nom" @@ -574,183 +551,187 @@ msgstr "Nom" msgid "audio device index for output = %d" msgstr "index du device audio de sortie = %d" -#: ../../sflphone-client-gnome/src/config/audioconf.c:579 +#: ../../sflphone-client-gnome/src/config/audioconf.c:581 msgid "Frequency" msgstr "Fréquence" -#: ../../sflphone-client-gnome/src/config/audioconf.c:584 +#: ../../sflphone-client-gnome/src/config/audioconf.c:586 msgid "Bitrate" msgstr "Bitrate" -#: ../../sflphone-client-gnome/src/config/audioconf.c:589 +#: ../../sflphone-client-gnome/src/config/audioconf.c:591 msgid "Bandwidth" msgstr "Bande passante" -#: ../../sflphone-client-gnome/src/config/audioconf.c:652 -msgid "Pulseaudio" -msgstr "" - -#: ../../sflphone-client-gnome/src/config/audioconf.c:655 -msgid "ALSA" -msgstr "" - -#: ../../sflphone-client-gnome/src/config/audioconf.c:681 +#: ../../sflphone-client-gnome/src/config/audioconf.c:662 msgid "ALSA plugin" msgstr "Greffon ALSA" -#: ../../sflphone-client-gnome/src/config/audioconf.c:703 +#: ../../sflphone-client-gnome/src/config/audioconf.c:684 msgid "Output" msgstr "Sortie" -#: ../../sflphone-client-gnome/src/config/audioconf.c:725 +#: ../../sflphone-client-gnome/src/config/audioconf.c:706 msgid "Input" msgstr "Entrée" -#: ../../sflphone-client-gnome/src/config/audioconf.c:758 -msgid "_Enable ringtones" -msgstr "_Activer les sonneries" - -#: ../../sflphone-client-gnome/src/config/audioconf.c:764 -msgid "Choose a ringtone" -msgstr "Sélectionner une sonnerie" - -#: ../../sflphone-client-gnome/src/config/audioconf.c:769 -msgid "Audio Files" -msgstr "Fichier Audio" - -#: ../../sflphone-client-gnome/src/config/audioconf.c:788 +#: ../../sflphone-client-gnome/src/config/audioconf.c:741 msgid "_Voice Activity Detection" msgstr "Détection de l'activité de la voix" -#: ../../sflphone-client-gnome/src/config/audioconf.c:798 +#: ../../sflphone-client-gnome/src/config/audioconf.c:751 msgid "_Noise Reduction (Narrow-Band Companding)" msgstr "Réduction du bruit (Compresseur extenseur LBR)" -#: ../../sflphone-client-gnome/src/config/audioconf.c:826 +#: ../../sflphone-client-gnome/src/config/audioconf.c:780 msgid "Sound Manager" msgstr "Interface Audio" -#: ../../sflphone-client-gnome/src/config/audioconf.c:833 +#: ../../sflphone-client-gnome/src/config/audioconf.c:783 +msgid "_Pulseaudio" +msgstr "" + +#: ../../sflphone-client-gnome/src/config/audioconf.c:788 +msgid "_ALSA" +msgstr "" + +#: ../../sflphone-client-gnome/src/config/audioconf.c:795 msgid "ALSA configuration" msgstr "Configuration ALSA" -#: ../../sflphone-client-gnome/src/config/audioconf.c:850 +#: ../../sflphone-client-gnome/src/config/audioconf.c:812 msgid "Codecs" msgstr "" -#: ../../sflphone-client-gnome/src/config/audioconf.c:873 +#: ../../sflphone-client-gnome/src/config/audioconf.c:835 msgid "Ringtones" msgstr "Sonneries" -#: ../../sflphone-client-gnome/src/config/configwindow.c:402 +#: ../../sflphone-client-gnome/src/config/audioconf.c:841 +msgid "_Enable ringtones" +msgstr "_Activer les sonneries" + +#: ../../sflphone-client-gnome/src/config/audioconf.c:847 +msgid "Choose a ringtone" +msgstr "Sélectionner une sonnerie" + +#: ../../sflphone-client-gnome/src/config/audioconf.c:853 +msgid "Audio Files" +msgstr "Fichier Audio" + +#: ../../sflphone-client-gnome/src/config/configwindow.c:418 msgid "Protocol" msgstr "Protocole" -#: ../../sflphone-client-gnome/src/config/configwindow.c:409 +#: ../../sflphone-client-gnome/src/config/configwindow.c:425 msgid "Status" msgstr "Statut" -#: ../../sflphone-client-gnome/src/config/configwindow.c:512 +#: ../../sflphone-client-gnome/src/config/configwindow.c:528 msgid "Stun parameters will apply to each SIP account created." msgstr "Les paramètres STUN sont appliqués à tous les comptes SIP créés" -#: ../../sflphone-client-gnome/src/config/configwindow.c:520 +#: ../../sflphone-client-gnome/src/config/configwindow.c:536 msgid "Enable it if you are behind a firewall" msgstr "À activer si vous êtes derrière un pare-feu, puis redémarrez SFLphone" -#: ../../sflphone-client-gnome/src/config/configwindow.c:528 +#: ../../sflphone-client-gnome/src/config/configwindow.c:544 msgid "Format: name.server:port" msgstr "Format: nom.serveur:port" -#: ../../sflphone-client-gnome/src/config/configwindow.c:579 +#: ../../sflphone-client-gnome/src/config/configwindow.c:589 msgid "Desktop Notifications" msgstr "Notifications de Bureau" -#: ../../sflphone-client-gnome/src/config/configwindow.c:588 +#: ../../sflphone-client-gnome/src/config/configwindow.c:593 msgid "_Enable notifications" msgstr "_Activer les notifications" -#: ../../sflphone-client-gnome/src/config/configwindow.c:594 +#: ../../sflphone-client-gnome/src/config/configwindow.c:599 msgid "Enable voicemail _notifications" -msgstr "Activer les notifications de boîte vocale" +msgstr "Activer les notifications de boîte _vocale" -#: ../../sflphone-client-gnome/src/config/configwindow.c:605 +#: ../../sflphone-client-gnome/src/config/configwindow.c:611 msgid "System Tray Icon" msgstr "Icône dans la barre des tâches" -#: ../../sflphone-client-gnome/src/config/configwindow.c:613 +#: ../../sflphone-client-gnome/src/config/configwindow.c:614 msgid "_Popup main window on incoming call" -msgstr "_Faire apparaître la fenêtre principale lors d'appel entrant" +msgstr "Faire apparaître la fenêtre _principale lors d'appel entrant" -#: ../../sflphone-client-gnome/src/config/configwindow.c:618 +#: ../../sflphone-client-gnome/src/config/configwindow.c:619 msgid "Ne_ver popup main window" msgstr "Ne _jamais afficher la fenêtre principale" -#: ../../sflphone-client-gnome/src/config/configwindow.c:622 +#: ../../sflphone-client-gnome/src/config/configwindow.c:623 msgid "Hide SFLphone window on _startup" -msgstr "Cacher la fenêtre de SFLphone au démarrage" +msgstr "_Cacher la fenêtre de SFLphone au démarrage" -#: ../../sflphone-client-gnome/src/config/configwindow.c:628 +#: ../../sflphone-client-gnome/src/config/configwindow.c:629 msgid "Calls History" msgstr "Historique des appels" -#: ../../sflphone-client-gnome/src/config/configwindow.c:636 -msgid "_History size limit" -msgstr "_Taille limite de l'historique" +#: ../../sflphone-client-gnome/src/config/configwindow.c:632 +msgid "_Keep my history for at least" +msgstr "" + +#: ../../sflphone-client-gnome/src/config/configwindow.c:643 +msgid " days" +msgstr "" -#: ../../sflphone-client-gnome/src/config/configwindow.c:653 +#: ../../sflphone-client-gnome/src/config/configwindow.c:647 msgid "PulseAudio sound server" msgstr "Serveur de son PulseAudio" -#: ../../sflphone-client-gnome/src/config/configwindow.c:661 -msgid "Mute other applications during a _call" -msgstr "Éteindre le son des autres applications lors d'un appel" +#: ../../sflphone-client-gnome/src/config/configwindow.c:650 +msgid "_Mute other applications during a call" +msgstr "Éteindre le _son des autres applications lors d'un appel" -#: ../../sflphone-client-gnome/src/config/configwindow.c:674 +#: ../../sflphone-client-gnome/src/config/configwindow.c:664 msgid "SIP Port" msgstr "Port SIP" -#: ../../sflphone-client-gnome/src/config/configwindow.c:687 +#: ../../sflphone-client-gnome/src/config/configwindow.c:677 msgid "Port:" msgstr "" -#: ../../sflphone-client-gnome/src/config/configwindow.c:742 -msgid "_Recordings folder" +#: ../../sflphone-client-gnome/src/config/configwindow.c:725 +msgid "Recordings folder" msgstr "Dossier pour les enregistrements" -#: ../../sflphone-client-gnome/src/config/configwindow.c:748 +#: ../../sflphone-client-gnome/src/config/configwindow.c:731 msgid "Select a folder" msgstr "Choisissez un dossier" -#: ../../sflphone-client-gnome/src/config/configwindow.c:773 +#: ../../sflphone-client-gnome/src/config/configwindow.c:765 msgid "Preferences" msgstr "Préférences" -#: ../../sflphone-client-gnome/src/config/configwindow.c:793 +#: ../../sflphone-client-gnome/src/config/configwindow.c:785 msgid "General Settings" msgstr "Préférences" -#: ../../sflphone-client-gnome/src/config/configwindow.c:798 +#: ../../sflphone-client-gnome/src/config/configwindow.c:790 msgid "Audio Settings" msgstr "Paramètres Audio" -#: ../../sflphone-client-gnome/src/config/configwindow.c:803 +#: ../../sflphone-client-gnome/src/config/configwindow.c:795 msgid "Recordings" msgstr "Enregistrements" -#: ../../sflphone-client-gnome/src/config/configwindow.c:808 +#: ../../sflphone-client-gnome/src/config/configwindow.c:800 msgid "Address Book" msgstr "Carnet d'adresse" -#: ../../sflphone-client-gnome/src/config/configwindow.c:813 +#: ../../sflphone-client-gnome/src/config/configwindow.c:805 msgid "Hooks" msgstr "Ancrage" -#: ../../sflphone-client-gnome/src/config/configwindow.c:840 +#: ../../sflphone-client-gnome/src/config/configwindow.c:832 msgid "Accounts" msgstr "Comptes" -#: ../../sflphone-client-gnome/src/config/configwindow.c:852 +#: ../../sflphone-client-gnome/src/config/configwindow.c:844 msgid "Configured Accounts" msgstr "Comptes Configurés" @@ -758,46 +739,94 @@ msgstr "Comptes Configurés" msgid "URL Passing" msgstr "Passage d'URL" -#: ../../sflphone-client-gnome/src/config/hooks-config.c:140 +#: ../../sflphone-client-gnome/src/config/hooks-config.c:135 +msgid "Custom commands on incoming calls with URL," +msgstr "" + +#: ../../sflphone-client-gnome/src/config/hooks-config.c:138 #, c-format -msgid "" -"SFLphone can run custom commands if incoming calls come with an URL " -"attached.\n" -"In this case, %s will be replaced with the passed URL." +msgid "%s will be replaced with the passed URL." msgstr "" -"SFLphone peut exécuter des commandes lors d'appels entrants qui ont un URL " -"associé.\n" -"Dans ce cas, %s sera remplacé par l'URL en question." -#: ../../sflphone-client-gnome/src/config/hooks-config.c:143 +#: ../../sflphone-client-gnome/src/config/hooks-config.c:141 msgid "Trigger on specific _SIP header" msgstr "Déclencher sur un entête _SIP spécifique" -#: ../../sflphone-client-gnome/src/config/hooks-config.c:155 +#: ../../sflphone-client-gnome/src/config/hooks-config.c:150 msgid "Trigger on _IAX2 URL" msgstr "Déclencher en _IAX2" -#: ../../sflphone-client-gnome/src/config/hooks-config.c:160 -msgid "_Command to run: " -msgstr "Commande à exécuter: " +#: ../../sflphone-client-gnome/src/config/hooks-config.c:155 +msgid "Command to _run: " +msgstr "Commande à _exécuter: " -#: ../../sflphone-client-gnome/src/config/hooks-config.c:168 +#: ../../sflphone-client-gnome/src/config/hooks-config.c:165 msgid "Phone Number Rewriting" msgstr "Rééecriture du numéro" -#: ../../sflphone-client-gnome/src/config/hooks-config.c:178 +#: ../../sflphone-client-gnome/src/config/hooks-config.c:169 msgid "_Prefix dialed numbers with:" -msgstr "Préfixer les numéros composés par:" +msgstr "_Préfixer les numéros composés par:" + +#: ../../sflphone-client-gnome/src/contacts/searchbar.c:55 +msgid "" +"Search all\n" +"Click here to change the search type" +msgstr "" + +#: ../../sflphone-client-gnome/src/contacts/searchbar.c:67 +msgid "" +"Search by missed call\n" +"Click here to change the search type" +msgstr "" + +#: ../../sflphone-client-gnome/src/contacts/searchbar.c:79 +msgid "" +"Search by incoming call\n" +"Click here to change the search type" +msgstr "" + +#: ../../sflphone-client-gnome/src/contacts/searchbar.c:91 +msgid "" +"Search by outgoing call\n" +"Click here to change the search type" +msgstr "" + +#~ msgid "Accept" +#~ msgstr "Accepter" + +#~ msgid "Refuse" +#~ msgstr "Refuser" + +#~ msgid "Ignore" +#~ msgstr "Ignorer" + +#~ msgid "<small>Missed call</small>" +#~ msgstr "<small>Appel manqué</small>" + +#~ msgid "<small>Duration:</small> %s" +#~ msgstr "<small>Durée:</small> %s" + +#~ msgid "Fields" +#~ msgstr "Champs" + +#~ msgid "_History size limit" +#~ msgstr "_Taille limite de l'historique" + +#~ msgid "" +#~ "SFLphone can run custom commands if incoming calls come with an URL " +#~ "attached.\n" +#~ "In this case, %s will be replaced with the passed URL." +#~ msgstr "" +#~ "SFLphone peut exécuter des commandes lors d'appels entrants qui ont un " +#~ "URL associé.\n" +#~ "Dans ce cas, %s sera remplacé par l'URL en question." -#: ../../sflphone-client-gnome/src/contacts/history.c:83 -#: ../../sflphone-client-gnome/src/contacts/searchbar.c:123 -msgid "Search history" -msgstr "Rechercher" +#~ msgid "Search history" +#~ msgstr "Rechercher" -#: ../../sflphone-client-gnome/src/contacts/history.c:83 -#: ../../sflphone-client-gnome/src/contacts/searchbar.c:110 -msgid "Search contact" -msgstr "Rechercher un contact" +#~ msgid "Search contact" +#~ msgstr "Rechercher un contact" #~ msgid "Registered to %s (%s)" #~ msgstr "Connecté avec %s (%s)" diff --git a/sflphone-common/po/ru.po b/sflphone-common/po/ru.po index 32edc9fd5bffff08ed0407437e881a9ac5195f87..9cc3d5c8977fe4521a5b35a6d37e1173c95063d1 100644 --- a/sflphone-common/po/ru.po +++ b/sflphone-common/po/ru.po @@ -6,60 +6,60 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: SFLphone 0.9.4\n" +"Project-Id-Version: SFLphone 0.9.6\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-05-21 10:45-0400\n" -"PO-Revision-Date: 2009-01-08 15:19 GMT-5\n" +"POT-Creation-Date: 2009-06-12 18:05-0400\n" +"PO-Revision-Date: 2009-06-08 10:19 GMT-5\n" "Last-Translator: HUSSEIN ABDALLAH <hussein.abdallah@savoirfairelinux.com>\n" "Language-Team: Savoir-Faire Linux Inc <sflphoneteam@savoirfairelinux.com>\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: ../../sflphone-client-gnome/src/accountlist.c:169 +#: ../../sflphone-client-gnome/src/accountlist.c:175 msgid "Registered" msgstr "Зарегистрирован" -#: ../../sflphone-client-gnome/src/accountlist.c:172 +#: ../../sflphone-client-gnome/src/accountlist.c:178 msgid "Not Registered" msgstr "Не зарегистрирован" -#: ../../sflphone-client-gnome/src/accountlist.c:175 +#: ../../sflphone-client-gnome/src/accountlist.c:181 msgid "Trying..." msgstr "Пробует подключиться..." -#: ../../sflphone-client-gnome/src/accountlist.c:178 -#: ../../sflphone-client-gnome/src/sflnotify.c:176 -#: ../../sflphone-client-gnome/src/sflnotify.c:217 +#: ../../sflphone-client-gnome/src/accountlist.c:184 +#: ../../sflphone-client-gnome/src/sflnotify.c:131 +#: ../../sflphone-client-gnome/src/sflnotify.c:148 msgid "Error" msgstr "Ошибка" -#: ../../sflphone-client-gnome/src/accountlist.c:181 +#: ../../sflphone-client-gnome/src/accountlist.c:187 msgid "Bad authentification" msgstr "Неправильная идентификация" -#: ../../sflphone-client-gnome/src/accountlist.c:184 +#: ../../sflphone-client-gnome/src/accountlist.c:190 msgid "Network unreachable" msgstr "Сеть недоступна" -#: ../../sflphone-client-gnome/src/accountlist.c:187 +#: ../../sflphone-client-gnome/src/accountlist.c:193 msgid "Host unreachable" msgstr "Хост недоступен" -#: ../../sflphone-client-gnome/src/accountlist.c:190 +#: ../../sflphone-client-gnome/src/accountlist.c:196 msgid "Stun configuration error" msgstr "Ошибка настройки Stun" -#: ../../sflphone-client-gnome/src/accountlist.c:193 +#: ../../sflphone-client-gnome/src/accountlist.c:199 msgid "Stun server invalid" msgstr "Недействительный Stun-сервер" -#: ../../sflphone-client-gnome/src/accountlist.c:196 +#: ../../sflphone-client-gnome/src/accountlist.c:202 msgid "Invalid" msgstr "Недействительный" #: ../../sflphone-client-gnome/src/actions.c:55 -#: ../../sflphone-client-gnome/src/sflnotify.c:108 +#: ../../sflphone-client-gnome/src/sflnotify.c:94 #, c-format msgid "%d voice mails" msgstr "%d речевые сообщения" @@ -75,11 +75,10 @@ msgid "Using %s (%s)" msgstr "" #: ../../sflphone-client-gnome/src/actions.c:87 -#, fuzzy msgid "No registered account" msgstr "У вас нет зарегистрированных аккаунтов" -#: ../../sflphone-client-gnome/src/actions.c:229 +#: ../../sflphone-client-gnome/src/actions.c:232 msgid "" "Unable to connect to the SFLphone server.\n" "Make sure the daemon is running." @@ -87,17 +86,17 @@ msgstr "" "Невозможно подключиться к SFLphone-серверу.\n" "Проверьте если демон работает." -#: ../../sflphone-client-gnome/src/actions.c:787 +#: ../../sflphone-client-gnome/src/actions.c:807 #, c-format msgid "IP call - %s" -msgstr "" +msgstr "IP звонок - %s" -#: ../../sflphone-client-gnome/src/actions.c:790 +#: ../../sflphone-client-gnome/src/actions.c:810 #, c-format msgid "Using %s (%s) - Codec: %s" msgstr "" -#: ../../sflphone-client-gnome/src/actions.c:880 +#: ../../sflphone-client-gnome/src/actions.c:900 #, c-format msgid "" "<b>Error: No audio codecs found.\n" @@ -111,7 +110,7 @@ msgstr "" "b> каталоге в вашем домашнем каталоге( <i>%s</i> )" #: ../../sflphone-client-gnome/src/assistant.c:35 -#, fuzzy, c-format +#, c-format msgid "" "This assistant is now finished.\n" "You can at any time check your registration state or modify your accounts " @@ -122,130 +121,130 @@ msgid "" "Username : %s\n" msgstr "" "Мастер закончил настройку.\n" -"\n" " Вы можете в любое время проверить статус регистрации или изменить " -"параметры ваших аккаунтов в меню Правка / Аккаунты." +"параметры ваших аккаунтов в меню Правка / Аккаунты.\n" +"Псевдоним : %s\n" +"Сервер : %s\n" +"Пользователь : %s\n" -#: ../../sflphone-client-gnome/src/assistant.c:160 +#: ../../sflphone-client-gnome/src/assistant.c:159 msgid "SFLphone account configuration wizard" msgstr "Мастер настройки SFLphone" -#: ../../sflphone-client-gnome/src/assistant.c:186 +#: ../../sflphone-client-gnome/src/assistant.c:185 msgid "Welcome to SFLphone!" msgstr "Добро пожаловать в SFLphone!" -#: ../../sflphone-client-gnome/src/assistant.c:187 +#: ../../sflphone-client-gnome/src/assistant.c:186 msgid "This installation wizard will help you configure an account." msgstr "Этот мастер установки поможет вам настроить ваш аккаунт." -#: ../../sflphone-client-gnome/src/assistant.c:201 +#: ../../sflphone-client-gnome/src/assistant.c:200 msgid "VoIP Protocols" msgstr "VoIP-протоколы" -#: ../../sflphone-client-gnome/src/assistant.c:201 +#: ../../sflphone-client-gnome/src/assistant.c:200 msgid "Select an account type:" msgstr "Выберите тип аккаунта:" -#: ../../sflphone-client-gnome/src/assistant.c:219 +#: ../../sflphone-client-gnome/src/assistant.c:218 msgid "Account" msgstr "Аккаунты" -#: ../../sflphone-client-gnome/src/assistant.c:219 +#: ../../sflphone-client-gnome/src/assistant.c:218 msgid "Please select one of the following option:" -msgstr "Введите пожалуйста следующие данные" +msgstr "Введите пожалуйста следующие данные:" -#: ../../sflphone-client-gnome/src/assistant.c:221 +#: ../../sflphone-client-gnome/src/assistant.c:220 msgid "Create a free SIP/IAX2 account on sflphone.org" msgstr "Создать бесплатный SIP/IAX2-аккаунт на sflphone.org" -#: ../../sflphone-client-gnome/src/assistant.c:223 +#: ../../sflphone-client-gnome/src/assistant.c:222 msgid "Register an existing SIP or IAX2 account" msgstr "Зарегистрировать существующий SIP или IAX2 аккаунт" -#: ../../sflphone-client-gnome/src/assistant.c:236 +#: ../../sflphone-client-gnome/src/assistant.c:235 msgid "SIP account configuration" msgstr "Настройка SIP-аккаунта" -#: ../../sflphone-client-gnome/src/assistant.c:236 -#: ../../sflphone-client-gnome/src/assistant.c:332 +#: ../../sflphone-client-gnome/src/assistant.c:235 +#: ../../sflphone-client-gnome/src/assistant.c:331 msgid "Please fill the following information:" msgstr "Введите пожалуйста следующие данные" -#: ../../sflphone-client-gnome/src/assistant.c:244 -#: ../../sflphone-client-gnome/src/assistant.c:340 -#: ../../sflphone-client-gnome/src/config/accountwindow.c:148 +#: ../../sflphone-client-gnome/src/assistant.c:243 +#: ../../sflphone-client-gnome/src/assistant.c:339 +#: ../../sflphone-client-gnome/src/config/accountwindow.c:153 msgid "_Alias" msgstr "_Псевдоним" -#: ../../sflphone-client-gnome/src/assistant.c:252 -#: ../../sflphone-client-gnome/src/assistant.c:348 -#: ../../sflphone-client-gnome/src/config/accountwindow.c:184 +#: ../../sflphone-client-gnome/src/assistant.c:251 +#: ../../sflphone-client-gnome/src/assistant.c:347 +#: ../../sflphone-client-gnome/src/config/accountwindow.c:189 msgid "_Host name" msgstr "Имя или IP-адрес _сервера" -#: ../../sflphone-client-gnome/src/assistant.c:260 -#: ../../sflphone-client-gnome/src/assistant.c:356 -#: ../../sflphone-client-gnome/src/config/accountwindow.c:192 +#: ../../sflphone-client-gnome/src/assistant.c:259 +#: ../../sflphone-client-gnome/src/assistant.c:355 +#: ../../sflphone-client-gnome/src/config/accountwindow.c:197 msgid "_User name" msgstr "Имя или _номер пользователя" -#: ../../sflphone-client-gnome/src/assistant.c:276 -#: ../../sflphone-client-gnome/src/assistant.c:371 -#: ../../sflphone-client-gnome/src/config/accountwindow.c:207 +#: ../../sflphone-client-gnome/src/assistant.c:275 +#: ../../sflphone-client-gnome/src/assistant.c:370 +#: ../../sflphone-client-gnome/src/config/accountwindow.c:212 msgid "_Password" msgstr "Па_роль" -#: ../../sflphone-client-gnome/src/assistant.c:294 -#: ../../sflphone-client-gnome/src/assistant.c:387 -#: ../../sflphone-client-gnome/src/config/accountwindow.c:223 -#, fuzzy +#: ../../sflphone-client-gnome/src/assistant.c:293 +#: ../../sflphone-client-gnome/src/assistant.c:386 +#: ../../sflphone-client-gnome/src/config/accountwindow.c:228 msgid "_Voicemail number" msgstr "Номер _автоответчика #" -#: ../../sflphone-client-gnome/src/assistant.c:309 +#: ../../sflphone-client-gnome/src/assistant.c:308 msgid "Optional Email Address " msgstr "Электронный адрес (необязательный) " -#: ../../sflphone-client-gnome/src/assistant.c:309 +#: ../../sflphone-client-gnome/src/assistant.c:308 msgid "This email address will be use to send your voicemail messages" msgstr "Этот электронный адрес будет использоваться для речевых сообщений" -#: ../../sflphone-client-gnome/src/assistant.c:317 +#: ../../sflphone-client-gnome/src/assistant.c:316 msgid "_Email" -msgstr "_Включить" +msgstr "_Адрес эл. почты" -#: ../../sflphone-client-gnome/src/assistant.c:332 +#: ../../sflphone-client-gnome/src/assistant.c:331 msgid "IAX2 account configuration" msgstr "Настройка IAX2-аккаунта" -#: ../../sflphone-client-gnome/src/assistant.c:405 -#: ../../sflphone-client-gnome/src/config/configwindow.c:863 +#: ../../sflphone-client-gnome/src/assistant.c:404 +#: ../../sflphone-client-gnome/src/config/configwindow.c:855 msgid "Network Address Translation" msgstr "Network Address Translation" -#: ../../sflphone-client-gnome/src/assistant.c:405 +#: ../../sflphone-client-gnome/src/assistant.c:404 msgid "You should probably enable this if you are behind a firewall." msgstr "Вы наверное должны это включить если вы находитесь за сетевым экраном." -#: ../../sflphone-client-gnome/src/assistant.c:414 -#: ../../sflphone-client-gnome/src/config/configwindow.c:516 +#: ../../sflphone-client-gnome/src/assistant.c:413 +#: ../../sflphone-client-gnome/src/config/configwindow.c:532 msgid "E_nable STUN" msgstr "Включить STUN" -#: ../../sflphone-client-gnome/src/assistant.c:421 +#: ../../sflphone-client-gnome/src/assistant.c:420 msgid "_STUN server" msgstr "_STUN-сервер" -#: ../../sflphone-client-gnome/src/assistant.c:435 +#: ../../sflphone-client-gnome/src/assistant.c:434 msgid "Account Registration" msgstr "Регистрация аккаунта" -#: ../../sflphone-client-gnome/src/assistant.c:435 +#: ../../sflphone-client-gnome/src/assistant.c:434 msgid "Congratulations!" msgstr "Поздравляем!" -#: ../../sflphone-client-gnome/src/errors.c:28 -#, fuzzy +#: ../../sflphone-client-gnome/src/errors.c:29 msgid "" "ALSA notification\n" "\n" @@ -255,8 +254,7 @@ msgstr "" "\n" "Ошибка во время активирования устройства проигрывания" -#: ../../sflphone-client-gnome/src/errors.c:31 -#, fuzzy +#: ../../sflphone-client-gnome/src/errors.c:32 msgid "" "ALSA notification\n" "\n" @@ -266,8 +264,7 @@ msgstr "" "\n" "Ошибка во время активирования устройства входа" -#: ../../sflphone-client-gnome/src/errors.c:34 -#, fuzzy +#: ../../sflphone-client-gnome/src/errors.c:35 msgid "" "Pulseaudio notification\n" "\n" @@ -279,20 +276,19 @@ msgstr "" #: ../../sflphone-client-gnome/src/mainwindow.c:70 msgid "There is one call in progress." -msgstr "Звонок ещё не окончен" +msgstr "Звонок ещё не окончен." #: ../../sflphone-client-gnome/src/mainwindow.c:74 msgid "There are calls in progress." -msgstr "Несколько звонков ещё не окончены" +msgstr "Несколько звонков ещё не окончены." #: ../../sflphone-client-gnome/src/mainwindow.c:83 msgid "Do you still want to quit?" msgstr "Вы уверенны что хотите выйти?" #: ../../sflphone-client-gnome/src/mainwindow.c:296 -#, fuzzy msgid "SFLphone Error" -msgstr "SFLphone 0.9.2" +msgstr "Ошибка SFLphone." #: ../../sflphone-client-gnome/src/menus.c:134 msgid "SFLphone is a VoIP client compatible with SIP and IAX2 protocols." @@ -306,116 +302,102 @@ msgstr "О SFLphone" msgid "_Help" msgstr "_Помощь" -#: ../../sflphone-client-gnome/src/menus.c:300 -#: ../../sflphone-client-gnome/src/menus.c:971 +#: ../../sflphone-client-gnome/src/menus.c:296 +#: ../../sflphone-client-gnome/src/menus.c:962 msgid "_New call" msgstr "_Новый звонок" -#: ../../sflphone-client-gnome/src/menus.c:312 -#: ../../sflphone-client-gnome/src/menus.c:803 +#: ../../sflphone-client-gnome/src/menus.c:308 +#: ../../sflphone-client-gnome/src/menus.c:794 msgid "_Pick up" msgstr "_Взять трубку" -#: ../../sflphone-client-gnome/src/menus.c:322 -#: ../../sflphone-client-gnome/src/menus.c:815 +#: ../../sflphone-client-gnome/src/menus.c:318 +#: ../../sflphone-client-gnome/src/menus.c:806 msgid "_Hang up" msgstr "_Положить трубку" -#: ../../sflphone-client-gnome/src/menus.c:332 -#: ../../sflphone-client-gnome/src/menus.c:827 +#: ../../sflphone-client-gnome/src/menus.c:328 +#: ../../sflphone-client-gnome/src/menus.c:818 msgid "On _Hold" msgstr "_Удержать звонок" -#: ../../sflphone-client-gnome/src/menus.c:344 -#: ../../sflphone-client-gnome/src/menus.c:839 +#: ../../sflphone-client-gnome/src/menus.c:340 +#: ../../sflphone-client-gnome/src/menus.c:830 msgid "_Record" msgstr "Записать" -#: ../../sflphone-client-gnome/src/menus.c:358 -#, fuzzy +#: ../../sflphone-client-gnome/src/menus.c:354 msgid "_Account creation wizard" msgstr "Мастер настройки SFLphone" -#: ../../sflphone-client-gnome/src/menus.c:388 +#: ../../sflphone-client-gnome/src/menus.c:384 msgid "_Call" msgstr "_Звонок" -#: ../../sflphone-client-gnome/src/menus.c:561 -msgid "_Clear history" +#: ../../sflphone-client-gnome/src/menus.c:552 +#, fuzzy +msgid "Clear _history" msgstr "_Стереть журнал" -#: ../../sflphone-client-gnome/src/menus.c:573 +#: ../../sflphone-client-gnome/src/menus.c:564 msgid "_Accounts" msgstr "_Аккаунты" -#: ../../sflphone-client-gnome/src/menus.c:588 +#: ../../sflphone-client-gnome/src/menus.c:579 msgid "_Edit" msgstr "_Правка" -#: ../../sflphone-client-gnome/src/menus.c:649 +#: ../../sflphone-client-gnome/src/menus.c:640 msgid "_Dialpad" msgstr "_Клавиатура" -#: ../../sflphone-client-gnome/src/menus.c:661 +#: ../../sflphone-client-gnome/src/menus.c:652 msgid "_Volume controls" msgstr "_Настройки громкости" -#: ../../sflphone-client-gnome/src/menus.c:679 +#: ../../sflphone-client-gnome/src/menus.c:670 msgid "_View" msgstr "_Вид" -#: ../../sflphone-client-gnome/src/menus.c:899 +#: ../../sflphone-client-gnome/src/menus.c:890 msgid "_Call back" msgstr "_Перезвонить" -#: ../../sflphone-client-gnome/src/menus.c:1082 +#: ../../sflphone-client-gnome/src/menus.c:1070 #, fuzzy msgid "Edit phone" msgstr "_Мобильный телефон" -#: ../../sflphone-client-gnome/src/menus.c:1093 +#: ../../sflphone-client-gnome/src/menus.c:1081 msgid "Edit the phone number before making a call" -msgstr "" +msgstr "Изменить номер телефона перед звонком" -#: ../../sflphone-client-gnome/src/sflnotify.c:38 -#: ../../sflphone-client-gnome/src/sflnotify.c:105 +#: ../../sflphone-client-gnome/src/sflnotify.c:71 +#: ../../sflphone-client-gnome/src/sflnotify.c:91 #, c-format msgid "%s account: %s" msgstr "%s аккаунт: %s" -#: ../../sflphone-client-gnome/src/sflnotify.c:42 +#: ../../sflphone-client-gnome/src/sflnotify.c:75 #, c-format msgid "<i>From:</i> %s" msgstr "<i>От:</i> %s" -#: ../../sflphone-client-gnome/src/sflnotify.c:57 -msgid "Accept" -msgstr "Согласиться" - -#: ../../sflphone-client-gnome/src/sflnotify.c:58 -msgid "Refuse" -msgstr "Отказаться" - -#: ../../sflphone-client-gnome/src/sflnotify.c:59 -#: ../../sflphone-client-gnome/src/sflnotify.c:122 -#: ../../sflphone-client-gnome/src/sflnotify.c:159 -msgid "Ignore" -msgstr "Пропустить" - -#: ../../sflphone-client-gnome/src/sflnotify.c:141 +#: ../../sflphone-client-gnome/src/sflnotify.c:111 #, c-format msgid "Calling with %s account <i>%s</i>" msgstr "Звонок с аккаунтом %s <i>%s</i>" -#: ../../sflphone-client-gnome/src/sflnotify.c:145 +#: ../../sflphone-client-gnome/src/sflnotify.c:115 msgid "Current account" msgstr "Нынешний аккаунт" -#: ../../sflphone-client-gnome/src/sflnotify.c:174 +#: ../../sflphone-client-gnome/src/sflnotify.c:130 msgid "You haven't setup any accounts" msgstr "Вы не настроили ни одного аккаунта" -#: ../../sflphone-client-gnome/src/sflnotify.c:214 +#: ../../sflphone-client-gnome/src/sflnotify.c:147 msgid "You have no registered accounts" msgstr "У вас нет зарегистрированных аккаунтов" @@ -432,382 +414,422 @@ msgid "_Show main window" msgstr "_Показать главное окно" #: ../../sflphone-client-gnome/src/statusicon.c:124 -#, fuzzy, c-format +#, c-format msgid "SFLphone - %i accounts configured" msgstr "SFLphone - Зарегистрировано %i аккаунтов" -#: ../../sflphone-client-gnome/src/timestamp.c:46 -msgid "<small>Missed call</small>" -msgstr "<small>Пропущенный звонок</small>" - -#: ../../sflphone-client-gnome/src/timestamp.c:64 -#, c-format -msgid "<small>Duration:</small> %s" -msgstr "<small>Время:</small> %s" - #: ../../sflphone-client-gnome/src/toolbar.c:50 #, c-format msgid "\"Voicemail\" <%s>" msgstr "\"Автоответчик\" <%s>" -#: ../../sflphone-client-gnome/src/toolbar.c:176 -#: ../../sflphone-client-gnome/src/toolbar.c:178 +#: ../../sflphone-client-gnome/src/toolbar.c:168 +#: ../../sflphone-client-gnome/src/toolbar.c:170 msgid "Place a call" msgstr "Позвонить" -#: ../../sflphone-client-gnome/src/toolbar.c:185 -#: ../../sflphone-client-gnome/src/toolbar.c:187 +#: ../../sflphone-client-gnome/src/toolbar.c:177 +#: ../../sflphone-client-gnome/src/toolbar.c:179 msgid "Pick up" msgstr "Взять трубку" -#: ../../sflphone-client-gnome/src/toolbar.c:195 -#: ../../sflphone-client-gnome/src/toolbar.c:197 +#: ../../sflphone-client-gnome/src/toolbar.c:187 +#: ../../sflphone-client-gnome/src/toolbar.c:189 msgid "Hang up" msgstr "Положить трубку" -#: ../../sflphone-client-gnome/src/toolbar.c:205 -#: ../../sflphone-client-gnome/src/toolbar.c:207 +#: ../../sflphone-client-gnome/src/toolbar.c:197 +#: ../../sflphone-client-gnome/src/toolbar.c:199 msgid "Off Hold" msgstr "Снова взять" -#: ../../sflphone-client-gnome/src/toolbar.c:216 -#: ../../sflphone-client-gnome/src/toolbar.c:218 +#: ../../sflphone-client-gnome/src/toolbar.c:208 +#: ../../sflphone-client-gnome/src/toolbar.c:210 msgid "On Hold" msgstr "Удержать звонок" -#: ../../sflphone-client-gnome/src/toolbar.c:229 -#: ../../sflphone-client-gnome/src/toolbar.c:231 +#: ../../sflphone-client-gnome/src/toolbar.c:221 +#: ../../sflphone-client-gnome/src/toolbar.c:223 msgid "Transfer" msgstr "Переслать звонок на другой номер" -#: ../../sflphone-client-gnome/src/toolbar.c:241 -#: ../../sflphone-client-gnome/src/toolbar.c:243 +#: ../../sflphone-client-gnome/src/toolbar.c:233 +#: ../../sflphone-client-gnome/src/toolbar.c:235 msgid "History" msgstr "Журнал" -#: ../../sflphone-client-gnome/src/toolbar.c:252 -#: ../../sflphone-client-gnome/src/toolbar.c:254 +#: ../../sflphone-client-gnome/src/toolbar.c:244 +#: ../../sflphone-client-gnome/src/toolbar.c:246 msgid "Address book" msgstr "Адресная книга" -#: ../../sflphone-client-gnome/src/toolbar.c:260 -#: ../../sflphone-client-gnome/src/toolbar.c:264 +#: ../../sflphone-client-gnome/src/toolbar.c:252 +#: ../../sflphone-client-gnome/src/toolbar.c:256 msgid "Voicemail" msgstr "Автоответчик" -#: ../../sflphone-client-gnome/src/toolbar.c:272 +#: ../../sflphone-client-gnome/src/toolbar.c:264 msgid "Record a call" msgstr "Записать переговор" -#: ../../sflphone-client-gnome/src/config/accountwindow.c:108 +#: ../../sflphone-client-gnome/src/config/accountwindow.c:113 msgid "Account settings" msgstr "Настройки аккаунта" -#: ../../sflphone-client-gnome/src/config/accountwindow.c:120 -#, fuzzy +#: ../../sflphone-client-gnome/src/config/accountwindow.c:125 msgid "Account Parameters" msgstr "Параметры аккаунта" -#: ../../sflphone-client-gnome/src/config/accountwindow.c:142 +#: ../../sflphone-client-gnome/src/config/accountwindow.c:147 msgid "_Enable this account" -msgstr "" +msgstr "_Включить" -#: ../../sflphone-client-gnome/src/config/accountwindow.c:156 +#: ../../sflphone-client-gnome/src/config/accountwindow.c:161 msgid "_Protocol" msgstr "Пр_отокол" -#: ../../sflphone-client-gnome/src/config/accountwindow.c:174 +#: ../../sflphone-client-gnome/src/config/accountwindow.c:179 msgid "Unknown" msgstr "Неизвестный" -#: ../../sflphone-client-gnome/src/config/addressbook-config.c:265 -#: ../../sflphone-client-gnome/src/config/configwindow.c:732 +#: ../../sflphone-client-gnome/src/config/addressbook-config.c:306 +#: ../../sflphone-client-gnome/src/config/configwindow.c:721 msgid "General" msgstr "Общие настройки" -#: ../../sflphone-client-gnome/src/config/addressbook-config.c:276 +#: ../../sflphone-client-gnome/src/config/addressbook-config.c:312 msgid "_Use Evolution address books" -msgstr "" +msgstr "_Использовать адресную книгу Evolution" -#: ../../sflphone-client-gnome/src/config/addressbook-config.c:283 +#: ../../sflphone-client-gnome/src/config/addressbook-config.c:319 msgid "Download limit:" +msgstr "Ограничение скорости скачивания:" + +#: ../../sflphone-client-gnome/src/config/addressbook-config.c:327 +msgid "cards" msgstr "" -#: ../../sflphone-client-gnome/src/config/addressbook-config.c:294 +#: ../../sflphone-client-gnome/src/config/addressbook-config.c:333 msgid "_Display contact photo if available" msgstr "_Показать фотографию контакта (если имеется):" -#: ../../sflphone-client-gnome/src/config/addressbook-config.c:301 -msgid "Fields" -msgstr "" - -#: ../../sflphone-client-gnome/src/config/addressbook-config.c:311 -msgid "Use the following fields from Evolution's address books:" -msgstr "" +#: ../../sflphone-client-gnome/src/config/addressbook-config.c:341 +#, fuzzy +msgid "Fields from Evolution's address books" +msgstr "Исполоьзовать следующие поля из адресной книги Evolution:" -#: ../../sflphone-client-gnome/src/config/addressbook-config.c:316 +#: ../../sflphone-client-gnome/src/config/addressbook-config.c:345 msgid "_Business phone" msgstr "_Рабочий телефон" -#: ../../sflphone-client-gnome/src/config/addressbook-config.c:321 +#: ../../sflphone-client-gnome/src/config/addressbook-config.c:351 msgid "_Home phone" msgstr "_Домашний телефон" -#: ../../sflphone-client-gnome/src/config/addressbook-config.c:326 +#: ../../sflphone-client-gnome/src/config/addressbook-config.c:357 msgid "_Mobile phone" msgstr "_Мобильный телефон" -#: ../../sflphone-client-gnome/src/config/addressbook-config.c:333 -#, fuzzy +#: ../../sflphone-client-gnome/src/config/addressbook-config.c:364 msgid "Address Books" msgstr "Адресная книга" -#: ../../sflphone-client-gnome/src/config/addressbook-config.c:343 +#: ../../sflphone-client-gnome/src/config/addressbook-config.c:368 msgid "Select which Evolution address books to use:" -msgstr "" +msgstr "Выбрать адресную книгу Evolution:" -#: ../../sflphone-client-gnome/src/config/addressbook-config.c:377 -#: ../../sflphone-client-gnome/src/config/audioconf.c:574 +#: ../../sflphone-client-gnome/src/config/addressbook-config.c:404 +#: ../../sflphone-client-gnome/src/config/audioconf.c:576 msgid "Name" msgstr "Имя" #: ../../sflphone-client-gnome/src/config/audioconf.c:155 -#, fuzzy, c-format +#, c-format msgid "audio device index for output = %d" -msgstr "Индекс звукового устройства = %d\n" +msgstr "Индекс звукового устройства = %d" -#: ../../sflphone-client-gnome/src/config/audioconf.c:579 +#: ../../sflphone-client-gnome/src/config/audioconf.c:581 msgid "Frequency" msgstr "Частота" -#: ../../sflphone-client-gnome/src/config/audioconf.c:584 +#: ../../sflphone-client-gnome/src/config/audioconf.c:586 msgid "Bitrate" msgstr "Битрейт" -#: ../../sflphone-client-gnome/src/config/audioconf.c:589 +#: ../../sflphone-client-gnome/src/config/audioconf.c:591 msgid "Bandwidth" msgstr "Пропускная способность" -#: ../../sflphone-client-gnome/src/config/audioconf.c:652 -msgid "Pulseaudio" -msgstr "Pulseaudio" - -#: ../../sflphone-client-gnome/src/config/audioconf.c:655 -msgid "ALSA" -msgstr "ALSA" - -#: ../../sflphone-client-gnome/src/config/audioconf.c:681 +#: ../../sflphone-client-gnome/src/config/audioconf.c:662 msgid "ALSA plugin" msgstr "ALSA-плагин" -#: ../../sflphone-client-gnome/src/config/audioconf.c:703 +#: ../../sflphone-client-gnome/src/config/audioconf.c:684 msgid "Output" msgstr "Выход" -#: ../../sflphone-client-gnome/src/config/audioconf.c:725 +#: ../../sflphone-client-gnome/src/config/audioconf.c:706 msgid "Input" msgstr "Вход" -#: ../../sflphone-client-gnome/src/config/audioconf.c:758 -msgid "_Enable ringtones" -msgstr "Включить звонок" - -#: ../../sflphone-client-gnome/src/config/audioconf.c:764 -msgid "Choose a ringtone" -msgstr "Выберите звонок" - -#: ../../sflphone-client-gnome/src/config/audioconf.c:769 -msgid "Audio Files" -msgstr "Звуковые файлы" - -#: ../../sflphone-client-gnome/src/config/audioconf.c:788 -#, fuzzy +#: ../../sflphone-client-gnome/src/config/audioconf.c:741 msgid "_Voice Activity Detection" msgstr "Включить детектор тишины" -#: ../../sflphone-client-gnome/src/config/audioconf.c:798 +#: ../../sflphone-client-gnome/src/config/audioconf.c:751 msgid "_Noise Reduction (Narrow-Band Companding)" -msgstr "" +msgstr "Шумоподавление" -#: ../../sflphone-client-gnome/src/config/audioconf.c:826 +#: ../../sflphone-client-gnome/src/config/audioconf.c:780 msgid "Sound Manager" msgstr "Менеджер звука" -#: ../../sflphone-client-gnome/src/config/audioconf.c:833 +#: ../../sflphone-client-gnome/src/config/audioconf.c:783 +#, fuzzy +msgid "_Pulseaudio" +msgstr "Pulseaudio" + +#: ../../sflphone-client-gnome/src/config/audioconf.c:788 +#, fuzzy +msgid "_ALSA" +msgstr "ALSA" + +#: ../../sflphone-client-gnome/src/config/audioconf.c:795 msgid "ALSA configuration" msgstr "Настройка ALSA" -#: ../../sflphone-client-gnome/src/config/audioconf.c:850 +#: ../../sflphone-client-gnome/src/config/audioconf.c:812 msgid "Codecs" msgstr "Кодеки" -#: ../../sflphone-client-gnome/src/config/audioconf.c:873 +#: ../../sflphone-client-gnome/src/config/audioconf.c:835 msgid "Ringtones" msgstr "Звонки" -#: ../../sflphone-client-gnome/src/config/configwindow.c:402 +#: ../../sflphone-client-gnome/src/config/audioconf.c:841 +msgid "_Enable ringtones" +msgstr "Включить звонок" + +#: ../../sflphone-client-gnome/src/config/audioconf.c:847 +msgid "Choose a ringtone" +msgstr "Выберите звонок" + +#: ../../sflphone-client-gnome/src/config/audioconf.c:853 +msgid "Audio Files" +msgstr "Звуковые файлы" + +#: ../../sflphone-client-gnome/src/config/configwindow.c:418 msgid "Protocol" msgstr "Протокол" -#: ../../sflphone-client-gnome/src/config/configwindow.c:409 +#: ../../sflphone-client-gnome/src/config/configwindow.c:425 msgid "Status" msgstr "Статус" -#: ../../sflphone-client-gnome/src/config/configwindow.c:512 +#: ../../sflphone-client-gnome/src/config/configwindow.c:528 msgid "Stun parameters will apply to each SIP account created." msgstr "STUN-параметры будут эффективны для каждого созданного SIP-аккаунта" -#: ../../sflphone-client-gnome/src/config/configwindow.c:520 +#: ../../sflphone-client-gnome/src/config/configwindow.c:536 msgid "Enable it if you are behind a firewall" msgstr "" "Включите это если вы находитесь за сетевым экраном и потом перезагрузите " "SFLphone" -#: ../../sflphone-client-gnome/src/config/configwindow.c:528 +#: ../../sflphone-client-gnome/src/config/configwindow.c:544 msgid "Format: name.server:port" msgstr "Формат: имя.сервер:порт" -#: ../../sflphone-client-gnome/src/config/configwindow.c:579 -#, fuzzy +#: ../../sflphone-client-gnome/src/config/configwindow.c:589 msgid "Desktop Notifications" msgstr "Извещения на рабочем столе" -#: ../../sflphone-client-gnome/src/config/configwindow.c:588 -#, fuzzy +#: ../../sflphone-client-gnome/src/config/configwindow.c:593 msgid "_Enable notifications" msgstr "Включить звонок" -#: ../../sflphone-client-gnome/src/config/configwindow.c:594 +#: ../../sflphone-client-gnome/src/config/configwindow.c:599 msgid "Enable voicemail _notifications" -msgstr "" +msgstr "Включить предупреждения о речевых сообщениях" -#: ../../sflphone-client-gnome/src/config/configwindow.c:605 +#: ../../sflphone-client-gnome/src/config/configwindow.c:611 msgid "System Tray Icon" msgstr "System Tray Icon" -#: ../../sflphone-client-gnome/src/config/configwindow.c:613 +#: ../../sflphone-client-gnome/src/config/configwindow.c:614 msgid "_Popup main window on incoming call" msgstr "_Показать главное окно при входящем звонке" -#: ../../sflphone-client-gnome/src/config/configwindow.c:618 +#: ../../sflphone-client-gnome/src/config/configwindow.c:619 msgid "Ne_ver popup main window" msgstr "Никогда не показывать главное окно" -#: ../../sflphone-client-gnome/src/config/configwindow.c:622 +#: ../../sflphone-client-gnome/src/config/configwindow.c:623 msgid "Hide SFLphone window on _startup" -msgstr "" +msgstr "Спрятать окно SFLphone при пуске" -#: ../../sflphone-client-gnome/src/config/configwindow.c:628 +#: ../../sflphone-client-gnome/src/config/configwindow.c:629 msgid "Calls History" msgstr "Журнал звонков" -#: ../../sflphone-client-gnome/src/config/configwindow.c:636 -#, fuzzy -msgid "_History size limit" -msgstr "Журнал пуст" +#: ../../sflphone-client-gnome/src/config/configwindow.c:632 +msgid "_Keep my history for at least" +msgstr "" -#: ../../sflphone-client-gnome/src/config/configwindow.c:653 +#: ../../sflphone-client-gnome/src/config/configwindow.c:643 +msgid " days" +msgstr "" + +#: ../../sflphone-client-gnome/src/config/configwindow.c:647 msgid "PulseAudio sound server" msgstr "Сервер звука PulseAudio" -#: ../../sflphone-client-gnome/src/config/configwindow.c:661 -msgid "Mute other applications during a _call" -msgstr "" +#: ../../sflphone-client-gnome/src/config/configwindow.c:650 +#, fuzzy +msgid "_Mute other applications during a call" +msgstr "Приглушать звук других програм во время звонка" -#: ../../sflphone-client-gnome/src/config/configwindow.c:674 +#: ../../sflphone-client-gnome/src/config/configwindow.c:664 msgid "SIP Port" msgstr "SIP-порт" -#: ../../sflphone-client-gnome/src/config/configwindow.c:687 +#: ../../sflphone-client-gnome/src/config/configwindow.c:677 msgid "Port:" msgstr "Порт:" -#: ../../sflphone-client-gnome/src/config/configwindow.c:742 -msgid "_Recordings folder" -msgstr "" +#: ../../sflphone-client-gnome/src/config/configwindow.c:725 +#, fuzzy +msgid "Recordings folder" +msgstr "Папка для записи переговоров" -#: ../../sflphone-client-gnome/src/config/configwindow.c:748 +#: ../../sflphone-client-gnome/src/config/configwindow.c:731 msgid "Select a folder" msgstr "Выберите папку" -#: ../../sflphone-client-gnome/src/config/configwindow.c:773 +#: ../../sflphone-client-gnome/src/config/configwindow.c:765 msgid "Preferences" msgstr "Предпочтения" -#: ../../sflphone-client-gnome/src/config/configwindow.c:793 +#: ../../sflphone-client-gnome/src/config/configwindow.c:785 msgid "General Settings" msgstr "Общие настройки" -#: ../../sflphone-client-gnome/src/config/configwindow.c:798 +#: ../../sflphone-client-gnome/src/config/configwindow.c:790 msgid "Audio Settings" msgstr "Настройки звука" -#: ../../sflphone-client-gnome/src/config/configwindow.c:803 -#, fuzzy +#: ../../sflphone-client-gnome/src/config/configwindow.c:795 msgid "Recordings" -msgstr "Записать" +msgstr "Запись" -#: ../../sflphone-client-gnome/src/config/configwindow.c:808 +#: ../../sflphone-client-gnome/src/config/configwindow.c:800 msgid "Address Book" msgstr "Адресная книга" -#: ../../sflphone-client-gnome/src/config/configwindow.c:813 +#: ../../sflphone-client-gnome/src/config/configwindow.c:805 msgid "Hooks" msgstr "перехватчики (hooks)" -#: ../../sflphone-client-gnome/src/config/configwindow.c:840 +#: ../../sflphone-client-gnome/src/config/configwindow.c:832 msgid "Accounts" msgstr "Аккаунты" -#: ../../sflphone-client-gnome/src/config/configwindow.c:852 -#, fuzzy +#: ../../sflphone-client-gnome/src/config/configwindow.c:844 msgid "Configured Accounts" msgstr "Нынешний аккаунт" #: ../../sflphone-client-gnome/src/config/hooks-config.c:130 msgid "URL Passing" +msgstr "Передача URL" + +#: ../../sflphone-client-gnome/src/config/hooks-config.c:135 +msgid "Custom commands on incoming calls with URL," msgstr "" -#: ../../sflphone-client-gnome/src/config/hooks-config.c:140 +#: ../../sflphone-client-gnome/src/config/hooks-config.c:138 #, c-format -msgid "" -"SFLphone can run custom commands if incoming calls come with an URL " -"attached.\n" -"In this case, %s will be replaced with the passed URL." +msgid "%s will be replaced with the passed URL." msgstr "" -#: ../../sflphone-client-gnome/src/config/hooks-config.c:143 +#: ../../sflphone-client-gnome/src/config/hooks-config.c:141 msgid "Trigger on specific _SIP header" -msgstr "" +msgstr "Запустить при определëнном SIP-заголовке" -#: ../../sflphone-client-gnome/src/config/hooks-config.c:155 +#: ../../sflphone-client-gnome/src/config/hooks-config.c:150 msgid "Trigger on _IAX2 URL" -msgstr "" +msgstr "Запустить при наличии URL _IAX2" -#: ../../sflphone-client-gnome/src/config/hooks-config.c:160 +#: ../../sflphone-client-gnome/src/config/hooks-config.c:155 #, fuzzy -msgid "_Command to run: " -msgstr "_Команда" +msgid "Command to _run: " +msgstr "_Выполнить команду:" -#: ../../sflphone-client-gnome/src/config/hooks-config.c:168 +#: ../../sflphone-client-gnome/src/config/hooks-config.c:165 msgid "Phone Number Rewriting" -msgstr "" +msgstr "Переписка номера телефона" -#: ../../sflphone-client-gnome/src/config/hooks-config.c:178 +#: ../../sflphone-client-gnome/src/config/hooks-config.c:169 msgid "_Prefix dialed numbers with:" +msgstr "Добавить перед на набранными номерами:" + +#: ../../sflphone-client-gnome/src/contacts/searchbar.c:55 +msgid "" +"Search all\n" +"Click here to change the search type" msgstr "" -#: ../../sflphone-client-gnome/src/contacts/history.c:83 -#: ../../sflphone-client-gnome/src/contacts/searchbar.c:123 -#, fuzzy -msgid "Search history" -msgstr "_Стереть журнал" +#: ../../sflphone-client-gnome/src/contacts/searchbar.c:67 +msgid "" +"Search by missed call\n" +"Click here to change the search type" +msgstr "" -#: ../../sflphone-client-gnome/src/contacts/history.c:83 -#: ../../sflphone-client-gnome/src/contacts/searchbar.c:110 -#, fuzzy -msgid "Search contact" -msgstr "_Искать в журнале" +#: ../../sflphone-client-gnome/src/contacts/searchbar.c:79 +msgid "" +"Search by incoming call\n" +"Click here to change the search type" +msgstr "" + +#: ../../sflphone-client-gnome/src/contacts/searchbar.c:91 +msgid "" +"Search by outgoing call\n" +"Click here to change the search type" +msgstr "" + +#~ msgid "Accept" +#~ msgstr "Согласиться" + +#~ msgid "Refuse" +#~ msgstr "Отказаться" + +#~ msgid "Ignore" +#~ msgstr "Пропустить" + +#~ msgid "<small>Missed call</small>" +#~ msgstr "<small>Пропущенный звонок</small>" + +#~ msgid "<small>Duration:</small> %s" +#~ msgstr "<small>Время:</small> %s" + +#~ msgid "Fields" +#~ msgstr "Поля" + +#~ msgid "_History size limit" +#~ msgstr "Ограничение размера журнала" + +#~ msgid "" +#~ "SFLphone can run custom commands if incoming calls come with an URL " +#~ "attached.\n" +#~ "In this case, %s will be replaced with the passed URL." +#~ msgstr "" +#~ "SFLphone может выполнять комманды если входящие звонки имеют URL.\n" +#~ "В этом случае %s будет заменена на переданную URL." + +#~ msgid "Search history" +#~ msgstr "_Стереть журнал" + +#~ msgid "Search contact" +#~ msgstr "_Искать контакт" #, fuzzy #~ msgid "Registered to %s (%s)" diff --git a/sflphone-common/po/sflphone.pot b/sflphone-common/po/sflphone.pot index b00ff4c9854108cda6e75fccfa3023e583f76b5e..4d624badbeb9cc691b461a8c420062ad13745a1d 100644 --- a/sflphone-common/po/sflphone.pot +++ b/sflphone-common/po/sflphone.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-05-21 10:45-0400\n" +"POT-Creation-Date: 2009-06-12 18:05-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -16,50 +16,50 @@ msgstr "" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" -#: ../../sflphone-client-gnome/src/accountlist.c:169 +#: ../../sflphone-client-gnome/src/accountlist.c:175 msgid "Registered" msgstr "" -#: ../../sflphone-client-gnome/src/accountlist.c:172 +#: ../../sflphone-client-gnome/src/accountlist.c:178 msgid "Not Registered" msgstr "" -#: ../../sflphone-client-gnome/src/accountlist.c:175 +#: ../../sflphone-client-gnome/src/accountlist.c:181 msgid "Trying..." msgstr "" -#: ../../sflphone-client-gnome/src/accountlist.c:178 -#: ../../sflphone-client-gnome/src/sflnotify.c:176 -#: ../../sflphone-client-gnome/src/sflnotify.c:217 +#: ../../sflphone-client-gnome/src/accountlist.c:184 +#: ../../sflphone-client-gnome/src/sflnotify.c:131 +#: ../../sflphone-client-gnome/src/sflnotify.c:148 msgid "Error" msgstr "" -#: ../../sflphone-client-gnome/src/accountlist.c:181 +#: ../../sflphone-client-gnome/src/accountlist.c:187 msgid "Bad authentification" msgstr "" -#: ../../sflphone-client-gnome/src/accountlist.c:184 +#: ../../sflphone-client-gnome/src/accountlist.c:190 msgid "Network unreachable" msgstr "" -#: ../../sflphone-client-gnome/src/accountlist.c:187 +#: ../../sflphone-client-gnome/src/accountlist.c:193 msgid "Host unreachable" msgstr "" -#: ../../sflphone-client-gnome/src/accountlist.c:190 +#: ../../sflphone-client-gnome/src/accountlist.c:196 msgid "Stun configuration error" msgstr "" -#: ../../sflphone-client-gnome/src/accountlist.c:193 +#: ../../sflphone-client-gnome/src/accountlist.c:199 msgid "Stun server invalid" msgstr "" -#: ../../sflphone-client-gnome/src/accountlist.c:196 +#: ../../sflphone-client-gnome/src/accountlist.c:202 msgid "Invalid" msgstr "" #: ../../sflphone-client-gnome/src/actions.c:55 -#: ../../sflphone-client-gnome/src/sflnotify.c:108 +#: ../../sflphone-client-gnome/src/sflnotify.c:94 #, c-format msgid "%d voice mails" msgstr "" @@ -78,23 +78,23 @@ msgstr "" msgid "No registered account" msgstr "" -#: ../../sflphone-client-gnome/src/actions.c:229 +#: ../../sflphone-client-gnome/src/actions.c:232 msgid "" "Unable to connect to the SFLphone server.\n" "Make sure the daemon is running." msgstr "" -#: ../../sflphone-client-gnome/src/actions.c:787 +#: ../../sflphone-client-gnome/src/actions.c:807 #, c-format msgid "IP call - %s" msgstr "" -#: ../../sflphone-client-gnome/src/actions.c:790 +#: ../../sflphone-client-gnome/src/actions.c:810 #, c-format msgid "Using %s (%s) - Codec: %s" msgstr "" -#: ../../sflphone-client-gnome/src/actions.c:880 +#: ../../sflphone-client-gnome/src/actions.c:900 #, c-format msgid "" "<b>Error: No audio codecs found.\n" @@ -115,138 +115,138 @@ msgid "" "Username : %s\n" msgstr "" -#: ../../sflphone-client-gnome/src/assistant.c:160 +#: ../../sflphone-client-gnome/src/assistant.c:159 msgid "SFLphone account configuration wizard" msgstr "" -#: ../../sflphone-client-gnome/src/assistant.c:186 +#: ../../sflphone-client-gnome/src/assistant.c:185 msgid "Welcome to SFLphone!" msgstr "" -#: ../../sflphone-client-gnome/src/assistant.c:187 +#: ../../sflphone-client-gnome/src/assistant.c:186 msgid "This installation wizard will help you configure an account." msgstr "" -#: ../../sflphone-client-gnome/src/assistant.c:201 +#: ../../sflphone-client-gnome/src/assistant.c:200 msgid "VoIP Protocols" msgstr "" -#: ../../sflphone-client-gnome/src/assistant.c:201 +#: ../../sflphone-client-gnome/src/assistant.c:200 msgid "Select an account type:" msgstr "" -#: ../../sflphone-client-gnome/src/assistant.c:219 +#: ../../sflphone-client-gnome/src/assistant.c:218 msgid "Account" msgstr "" -#: ../../sflphone-client-gnome/src/assistant.c:219 +#: ../../sflphone-client-gnome/src/assistant.c:218 msgid "Please select one of the following option:" msgstr "" -#: ../../sflphone-client-gnome/src/assistant.c:221 +#: ../../sflphone-client-gnome/src/assistant.c:220 msgid "Create a free SIP/IAX2 account on sflphone.org" msgstr "" -#: ../../sflphone-client-gnome/src/assistant.c:223 +#: ../../sflphone-client-gnome/src/assistant.c:222 msgid "Register an existing SIP or IAX2 account" msgstr "" -#: ../../sflphone-client-gnome/src/assistant.c:236 +#: ../../sflphone-client-gnome/src/assistant.c:235 msgid "SIP account configuration" msgstr "" -#: ../../sflphone-client-gnome/src/assistant.c:236 -#: ../../sflphone-client-gnome/src/assistant.c:332 +#: ../../sflphone-client-gnome/src/assistant.c:235 +#: ../../sflphone-client-gnome/src/assistant.c:331 msgid "Please fill the following information:" msgstr "" -#: ../../sflphone-client-gnome/src/assistant.c:244 -#: ../../sflphone-client-gnome/src/assistant.c:340 -#: ../../sflphone-client-gnome/src/config/accountwindow.c:148 +#: ../../sflphone-client-gnome/src/assistant.c:243 +#: ../../sflphone-client-gnome/src/assistant.c:339 +#: ../../sflphone-client-gnome/src/config/accountwindow.c:153 msgid "_Alias" msgstr "" -#: ../../sflphone-client-gnome/src/assistant.c:252 -#: ../../sflphone-client-gnome/src/assistant.c:348 -#: ../../sflphone-client-gnome/src/config/accountwindow.c:184 +#: ../../sflphone-client-gnome/src/assistant.c:251 +#: ../../sflphone-client-gnome/src/assistant.c:347 +#: ../../sflphone-client-gnome/src/config/accountwindow.c:189 msgid "_Host name" msgstr "" -#: ../../sflphone-client-gnome/src/assistant.c:260 -#: ../../sflphone-client-gnome/src/assistant.c:356 -#: ../../sflphone-client-gnome/src/config/accountwindow.c:192 +#: ../../sflphone-client-gnome/src/assistant.c:259 +#: ../../sflphone-client-gnome/src/assistant.c:355 +#: ../../sflphone-client-gnome/src/config/accountwindow.c:197 msgid "_User name" msgstr "" -#: ../../sflphone-client-gnome/src/assistant.c:276 -#: ../../sflphone-client-gnome/src/assistant.c:371 -#: ../../sflphone-client-gnome/src/config/accountwindow.c:207 +#: ../../sflphone-client-gnome/src/assistant.c:275 +#: ../../sflphone-client-gnome/src/assistant.c:370 +#: ../../sflphone-client-gnome/src/config/accountwindow.c:212 msgid "_Password" msgstr "" -#: ../../sflphone-client-gnome/src/assistant.c:294 -#: ../../sflphone-client-gnome/src/assistant.c:387 -#: ../../sflphone-client-gnome/src/config/accountwindow.c:223 +#: ../../sflphone-client-gnome/src/assistant.c:293 +#: ../../sflphone-client-gnome/src/assistant.c:386 +#: ../../sflphone-client-gnome/src/config/accountwindow.c:228 msgid "_Voicemail number" msgstr "" -#: ../../sflphone-client-gnome/src/assistant.c:309 +#: ../../sflphone-client-gnome/src/assistant.c:308 msgid "Optional Email Address " msgstr "" -#: ../../sflphone-client-gnome/src/assistant.c:309 +#: ../../sflphone-client-gnome/src/assistant.c:308 msgid "This email address will be use to send your voicemail messages" msgstr "" -#: ../../sflphone-client-gnome/src/assistant.c:317 +#: ../../sflphone-client-gnome/src/assistant.c:316 msgid "_Email" msgstr "" -#: ../../sflphone-client-gnome/src/assistant.c:332 +#: ../../sflphone-client-gnome/src/assistant.c:331 msgid "IAX2 account configuration" msgstr "" -#: ../../sflphone-client-gnome/src/assistant.c:405 -#: ../../sflphone-client-gnome/src/config/configwindow.c:863 +#: ../../sflphone-client-gnome/src/assistant.c:404 +#: ../../sflphone-client-gnome/src/config/configwindow.c:855 msgid "Network Address Translation" msgstr "" -#: ../../sflphone-client-gnome/src/assistant.c:405 +#: ../../sflphone-client-gnome/src/assistant.c:404 msgid "You should probably enable this if you are behind a firewall." msgstr "" -#: ../../sflphone-client-gnome/src/assistant.c:414 -#: ../../sflphone-client-gnome/src/config/configwindow.c:516 +#: ../../sflphone-client-gnome/src/assistant.c:413 +#: ../../sflphone-client-gnome/src/config/configwindow.c:532 msgid "E_nable STUN" msgstr "" -#: ../../sflphone-client-gnome/src/assistant.c:421 +#: ../../sflphone-client-gnome/src/assistant.c:420 msgid "_STUN server" msgstr "" -#: ../../sflphone-client-gnome/src/assistant.c:435 +#: ../../sflphone-client-gnome/src/assistant.c:434 msgid "Account Registration" msgstr "" -#: ../../sflphone-client-gnome/src/assistant.c:435 +#: ../../sflphone-client-gnome/src/assistant.c:434 msgid "Congratulations!" msgstr "" -#: ../../sflphone-client-gnome/src/errors.c:28 +#: ../../sflphone-client-gnome/src/errors.c:29 msgid "" "ALSA notification\n" "\n" "Error while opening playback device" msgstr "" -#: ../../sflphone-client-gnome/src/errors.c:31 +#: ../../sflphone-client-gnome/src/errors.c:32 msgid "" "ALSA notification\n" "\n" "Error while opening capture device" msgstr "" -#: ../../sflphone-client-gnome/src/errors.c:34 +#: ../../sflphone-client-gnome/src/errors.c:35 msgid "" "Pulseaudio notification\n" "\n" @@ -281,114 +281,100 @@ msgstr "" msgid "_Help" msgstr "" -#: ../../sflphone-client-gnome/src/menus.c:300 -#: ../../sflphone-client-gnome/src/menus.c:971 +#: ../../sflphone-client-gnome/src/menus.c:296 +#: ../../sflphone-client-gnome/src/menus.c:962 msgid "_New call" msgstr "" -#: ../../sflphone-client-gnome/src/menus.c:312 -#: ../../sflphone-client-gnome/src/menus.c:803 +#: ../../sflphone-client-gnome/src/menus.c:308 +#: ../../sflphone-client-gnome/src/menus.c:794 msgid "_Pick up" msgstr "" -#: ../../sflphone-client-gnome/src/menus.c:322 -#: ../../sflphone-client-gnome/src/menus.c:815 +#: ../../sflphone-client-gnome/src/menus.c:318 +#: ../../sflphone-client-gnome/src/menus.c:806 msgid "_Hang up" msgstr "" -#: ../../sflphone-client-gnome/src/menus.c:332 -#: ../../sflphone-client-gnome/src/menus.c:827 +#: ../../sflphone-client-gnome/src/menus.c:328 +#: ../../sflphone-client-gnome/src/menus.c:818 msgid "On _Hold" msgstr "" -#: ../../sflphone-client-gnome/src/menus.c:344 -#: ../../sflphone-client-gnome/src/menus.c:839 +#: ../../sflphone-client-gnome/src/menus.c:340 +#: ../../sflphone-client-gnome/src/menus.c:830 msgid "_Record" msgstr "" -#: ../../sflphone-client-gnome/src/menus.c:358 +#: ../../sflphone-client-gnome/src/menus.c:354 msgid "_Account creation wizard" msgstr "" -#: ../../sflphone-client-gnome/src/menus.c:388 +#: ../../sflphone-client-gnome/src/menus.c:384 msgid "_Call" msgstr "" -#: ../../sflphone-client-gnome/src/menus.c:561 -msgid "_Clear history" +#: ../../sflphone-client-gnome/src/menus.c:552 +msgid "Clear _history" msgstr "" -#: ../../sflphone-client-gnome/src/menus.c:573 +#: ../../sflphone-client-gnome/src/menus.c:564 msgid "_Accounts" msgstr "" -#: ../../sflphone-client-gnome/src/menus.c:588 +#: ../../sflphone-client-gnome/src/menus.c:579 msgid "_Edit" msgstr "" -#: ../../sflphone-client-gnome/src/menus.c:649 +#: ../../sflphone-client-gnome/src/menus.c:640 msgid "_Dialpad" msgstr "" -#: ../../sflphone-client-gnome/src/menus.c:661 +#: ../../sflphone-client-gnome/src/menus.c:652 msgid "_Volume controls" msgstr "" -#: ../../sflphone-client-gnome/src/menus.c:679 +#: ../../sflphone-client-gnome/src/menus.c:670 msgid "_View" msgstr "" -#: ../../sflphone-client-gnome/src/menus.c:899 +#: ../../sflphone-client-gnome/src/menus.c:890 msgid "_Call back" msgstr "" -#: ../../sflphone-client-gnome/src/menus.c:1082 +#: ../../sflphone-client-gnome/src/menus.c:1070 msgid "Edit phone" msgstr "" -#: ../../sflphone-client-gnome/src/menus.c:1093 +#: ../../sflphone-client-gnome/src/menus.c:1081 msgid "Edit the phone number before making a call" msgstr "" -#: ../../sflphone-client-gnome/src/sflnotify.c:38 -#: ../../sflphone-client-gnome/src/sflnotify.c:105 +#: ../../sflphone-client-gnome/src/sflnotify.c:71 +#: ../../sflphone-client-gnome/src/sflnotify.c:91 #, c-format msgid "%s account: %s" msgstr "" -#: ../../sflphone-client-gnome/src/sflnotify.c:42 +#: ../../sflphone-client-gnome/src/sflnotify.c:75 #, c-format msgid "<i>From:</i> %s" msgstr "" -#: ../../sflphone-client-gnome/src/sflnotify.c:57 -msgid "Accept" -msgstr "" - -#: ../../sflphone-client-gnome/src/sflnotify.c:58 -msgid "Refuse" -msgstr "" - -#: ../../sflphone-client-gnome/src/sflnotify.c:59 -#: ../../sflphone-client-gnome/src/sflnotify.c:122 -#: ../../sflphone-client-gnome/src/sflnotify.c:159 -msgid "Ignore" -msgstr "" - -#: ../../sflphone-client-gnome/src/sflnotify.c:141 +#: ../../sflphone-client-gnome/src/sflnotify.c:111 #, c-format msgid "Calling with %s account <i>%s</i>" msgstr "" -#: ../../sflphone-client-gnome/src/sflnotify.c:145 +#: ../../sflphone-client-gnome/src/sflnotify.c:115 msgid "Current account" msgstr "" -#: ../../sflphone-client-gnome/src/sflnotify.c:174 +#: ../../sflphone-client-gnome/src/sflnotify.c:130 msgid "You haven't setup any accounts" msgstr "" -#: ../../sflphone-client-gnome/src/sflnotify.c:214 +#: ../../sflphone-client-gnome/src/sflnotify.c:147 msgid "You have no registered accounts" msgstr "" @@ -409,136 +395,127 @@ msgstr "" msgid "SFLphone - %i accounts configured" msgstr "" -#: ../../sflphone-client-gnome/src/timestamp.c:46 -msgid "<small>Missed call</small>" -msgstr "" - -#: ../../sflphone-client-gnome/src/timestamp.c:64 -#, c-format -msgid "<small>Duration:</small> %s" -msgstr "" - #: ../../sflphone-client-gnome/src/toolbar.c:50 #, c-format msgid "\"Voicemail\" <%s>" msgstr "" -#: ../../sflphone-client-gnome/src/toolbar.c:176 -#: ../../sflphone-client-gnome/src/toolbar.c:178 +#: ../../sflphone-client-gnome/src/toolbar.c:168 +#: ../../sflphone-client-gnome/src/toolbar.c:170 msgid "Place a call" msgstr "" -#: ../../sflphone-client-gnome/src/toolbar.c:185 -#: ../../sflphone-client-gnome/src/toolbar.c:187 +#: ../../sflphone-client-gnome/src/toolbar.c:177 +#: ../../sflphone-client-gnome/src/toolbar.c:179 msgid "Pick up" msgstr "" -#: ../../sflphone-client-gnome/src/toolbar.c:195 -#: ../../sflphone-client-gnome/src/toolbar.c:197 +#: ../../sflphone-client-gnome/src/toolbar.c:187 +#: ../../sflphone-client-gnome/src/toolbar.c:189 msgid "Hang up" msgstr "" -#: ../../sflphone-client-gnome/src/toolbar.c:205 -#: ../../sflphone-client-gnome/src/toolbar.c:207 +#: ../../sflphone-client-gnome/src/toolbar.c:197 +#: ../../sflphone-client-gnome/src/toolbar.c:199 msgid "Off Hold" msgstr "" -#: ../../sflphone-client-gnome/src/toolbar.c:216 -#: ../../sflphone-client-gnome/src/toolbar.c:218 +#: ../../sflphone-client-gnome/src/toolbar.c:208 +#: ../../sflphone-client-gnome/src/toolbar.c:210 msgid "On Hold" msgstr "" -#: ../../sflphone-client-gnome/src/toolbar.c:229 -#: ../../sflphone-client-gnome/src/toolbar.c:231 +#: ../../sflphone-client-gnome/src/toolbar.c:221 +#: ../../sflphone-client-gnome/src/toolbar.c:223 msgid "Transfer" msgstr "" -#: ../../sflphone-client-gnome/src/toolbar.c:241 -#: ../../sflphone-client-gnome/src/toolbar.c:243 +#: ../../sflphone-client-gnome/src/toolbar.c:233 +#: ../../sflphone-client-gnome/src/toolbar.c:235 msgid "History" msgstr "" -#: ../../sflphone-client-gnome/src/toolbar.c:252 -#: ../../sflphone-client-gnome/src/toolbar.c:254 +#: ../../sflphone-client-gnome/src/toolbar.c:244 +#: ../../sflphone-client-gnome/src/toolbar.c:246 msgid "Address book" msgstr "" -#: ../../sflphone-client-gnome/src/toolbar.c:260 -#: ../../sflphone-client-gnome/src/toolbar.c:264 +#: ../../sflphone-client-gnome/src/toolbar.c:252 +#: ../../sflphone-client-gnome/src/toolbar.c:256 msgid "Voicemail" msgstr "" -#: ../../sflphone-client-gnome/src/toolbar.c:272 +#: ../../sflphone-client-gnome/src/toolbar.c:264 msgid "Record a call" msgstr "" -#: ../../sflphone-client-gnome/src/config/accountwindow.c:108 +#: ../../sflphone-client-gnome/src/config/accountwindow.c:113 msgid "Account settings" msgstr "" -#: ../../sflphone-client-gnome/src/config/accountwindow.c:120 +#: ../../sflphone-client-gnome/src/config/accountwindow.c:125 msgid "Account Parameters" msgstr "" -#: ../../sflphone-client-gnome/src/config/accountwindow.c:142 +#: ../../sflphone-client-gnome/src/config/accountwindow.c:147 msgid "_Enable this account" msgstr "" -#: ../../sflphone-client-gnome/src/config/accountwindow.c:156 +#: ../../sflphone-client-gnome/src/config/accountwindow.c:161 msgid "_Protocol" msgstr "" -#: ../../sflphone-client-gnome/src/config/accountwindow.c:174 +#: ../../sflphone-client-gnome/src/config/accountwindow.c:179 msgid "Unknown" msgstr "" -#: ../../sflphone-client-gnome/src/config/addressbook-config.c:265 -#: ../../sflphone-client-gnome/src/config/configwindow.c:732 +#: ../../sflphone-client-gnome/src/config/addressbook-config.c:306 +#: ../../sflphone-client-gnome/src/config/configwindow.c:721 msgid "General" msgstr "" -#: ../../sflphone-client-gnome/src/config/addressbook-config.c:276 +#: ../../sflphone-client-gnome/src/config/addressbook-config.c:312 msgid "_Use Evolution address books" msgstr "" -#: ../../sflphone-client-gnome/src/config/addressbook-config.c:283 +#: ../../sflphone-client-gnome/src/config/addressbook-config.c:319 msgid "Download limit:" msgstr "" -#: ../../sflphone-client-gnome/src/config/addressbook-config.c:294 -msgid "_Display contact photo if available" +#: ../../sflphone-client-gnome/src/config/addressbook-config.c:327 +msgid "cards" msgstr "" -#: ../../sflphone-client-gnome/src/config/addressbook-config.c:301 -msgid "Fields" +#: ../../sflphone-client-gnome/src/config/addressbook-config.c:333 +msgid "_Display contact photo if available" msgstr "" -#: ../../sflphone-client-gnome/src/config/addressbook-config.c:311 -msgid "Use the following fields from Evolution's address books:" +#: ../../sflphone-client-gnome/src/config/addressbook-config.c:341 +msgid "Fields from Evolution's address books" msgstr "" -#: ../../sflphone-client-gnome/src/config/addressbook-config.c:316 +#: ../../sflphone-client-gnome/src/config/addressbook-config.c:345 msgid "_Business phone" msgstr "" -#: ../../sflphone-client-gnome/src/config/addressbook-config.c:321 +#: ../../sflphone-client-gnome/src/config/addressbook-config.c:351 msgid "_Home phone" msgstr "" -#: ../../sflphone-client-gnome/src/config/addressbook-config.c:326 +#: ../../sflphone-client-gnome/src/config/addressbook-config.c:357 msgid "_Mobile phone" msgstr "" -#: ../../sflphone-client-gnome/src/config/addressbook-config.c:333 +#: ../../sflphone-client-gnome/src/config/addressbook-config.c:364 msgid "Address Books" msgstr "" -#: ../../sflphone-client-gnome/src/config/addressbook-config.c:343 +#: ../../sflphone-client-gnome/src/config/addressbook-config.c:368 msgid "Select which Evolution address books to use:" msgstr "" -#: ../../sflphone-client-gnome/src/config/addressbook-config.c:377 -#: ../../sflphone-client-gnome/src/config/audioconf.c:574 +#: ../../sflphone-client-gnome/src/config/addressbook-config.c:404 +#: ../../sflphone-client-gnome/src/config/audioconf.c:576 msgid "Name" msgstr "" @@ -547,183 +524,187 @@ msgstr "" msgid "audio device index for output = %d" msgstr "" -#: ../../sflphone-client-gnome/src/config/audioconf.c:579 +#: ../../sflphone-client-gnome/src/config/audioconf.c:581 msgid "Frequency" msgstr "" -#: ../../sflphone-client-gnome/src/config/audioconf.c:584 +#: ../../sflphone-client-gnome/src/config/audioconf.c:586 msgid "Bitrate" msgstr "" -#: ../../sflphone-client-gnome/src/config/audioconf.c:589 +#: ../../sflphone-client-gnome/src/config/audioconf.c:591 msgid "Bandwidth" msgstr "" -#: ../../sflphone-client-gnome/src/config/audioconf.c:652 -msgid "Pulseaudio" -msgstr "" - -#: ../../sflphone-client-gnome/src/config/audioconf.c:655 -msgid "ALSA" -msgstr "" - -#: ../../sflphone-client-gnome/src/config/audioconf.c:681 +#: ../../sflphone-client-gnome/src/config/audioconf.c:662 msgid "ALSA plugin" msgstr "" -#: ../../sflphone-client-gnome/src/config/audioconf.c:703 +#: ../../sflphone-client-gnome/src/config/audioconf.c:684 msgid "Output" msgstr "" -#: ../../sflphone-client-gnome/src/config/audioconf.c:725 +#: ../../sflphone-client-gnome/src/config/audioconf.c:706 msgid "Input" msgstr "" -#: ../../sflphone-client-gnome/src/config/audioconf.c:758 -msgid "_Enable ringtones" -msgstr "" - -#: ../../sflphone-client-gnome/src/config/audioconf.c:764 -msgid "Choose a ringtone" +#: ../../sflphone-client-gnome/src/config/audioconf.c:741 +msgid "_Voice Activity Detection" msgstr "" -#: ../../sflphone-client-gnome/src/config/audioconf.c:769 -msgid "Audio Files" +#: ../../sflphone-client-gnome/src/config/audioconf.c:751 +msgid "_Noise Reduction (Narrow-Band Companding)" msgstr "" -#: ../../sflphone-client-gnome/src/config/audioconf.c:788 -msgid "_Voice Activity Detection" +#: ../../sflphone-client-gnome/src/config/audioconf.c:780 +msgid "Sound Manager" msgstr "" -#: ../../sflphone-client-gnome/src/config/audioconf.c:798 -msgid "_Noise Reduction (Narrow-Band Companding)" +#: ../../sflphone-client-gnome/src/config/audioconf.c:783 +msgid "_Pulseaudio" msgstr "" -#: ../../sflphone-client-gnome/src/config/audioconf.c:826 -msgid "Sound Manager" +#: ../../sflphone-client-gnome/src/config/audioconf.c:788 +msgid "_ALSA" msgstr "" -#: ../../sflphone-client-gnome/src/config/audioconf.c:833 +#: ../../sflphone-client-gnome/src/config/audioconf.c:795 msgid "ALSA configuration" msgstr "" -#: ../../sflphone-client-gnome/src/config/audioconf.c:850 +#: ../../sflphone-client-gnome/src/config/audioconf.c:812 msgid "Codecs" msgstr "" -#: ../../sflphone-client-gnome/src/config/audioconf.c:873 +#: ../../sflphone-client-gnome/src/config/audioconf.c:835 msgid "Ringtones" msgstr "" -#: ../../sflphone-client-gnome/src/config/configwindow.c:402 +#: ../../sflphone-client-gnome/src/config/audioconf.c:841 +msgid "_Enable ringtones" +msgstr "" + +#: ../../sflphone-client-gnome/src/config/audioconf.c:847 +msgid "Choose a ringtone" +msgstr "" + +#: ../../sflphone-client-gnome/src/config/audioconf.c:853 +msgid "Audio Files" +msgstr "" + +#: ../../sflphone-client-gnome/src/config/configwindow.c:418 msgid "Protocol" msgstr "" -#: ../../sflphone-client-gnome/src/config/configwindow.c:409 +#: ../../sflphone-client-gnome/src/config/configwindow.c:425 msgid "Status" msgstr "" -#: ../../sflphone-client-gnome/src/config/configwindow.c:512 +#: ../../sflphone-client-gnome/src/config/configwindow.c:528 msgid "Stun parameters will apply to each SIP account created." msgstr "" -#: ../../sflphone-client-gnome/src/config/configwindow.c:520 +#: ../../sflphone-client-gnome/src/config/configwindow.c:536 msgid "Enable it if you are behind a firewall" msgstr "" -#: ../../sflphone-client-gnome/src/config/configwindow.c:528 +#: ../../sflphone-client-gnome/src/config/configwindow.c:544 msgid "Format: name.server:port" msgstr "" -#: ../../sflphone-client-gnome/src/config/configwindow.c:579 +#: ../../sflphone-client-gnome/src/config/configwindow.c:589 msgid "Desktop Notifications" msgstr "" -#: ../../sflphone-client-gnome/src/config/configwindow.c:588 +#: ../../sflphone-client-gnome/src/config/configwindow.c:593 msgid "_Enable notifications" msgstr "" -#: ../../sflphone-client-gnome/src/config/configwindow.c:594 +#: ../../sflphone-client-gnome/src/config/configwindow.c:599 msgid "Enable voicemail _notifications" msgstr "" -#: ../../sflphone-client-gnome/src/config/configwindow.c:605 +#: ../../sflphone-client-gnome/src/config/configwindow.c:611 msgid "System Tray Icon" msgstr "" -#: ../../sflphone-client-gnome/src/config/configwindow.c:613 +#: ../../sflphone-client-gnome/src/config/configwindow.c:614 msgid "_Popup main window on incoming call" msgstr "" -#: ../../sflphone-client-gnome/src/config/configwindow.c:618 +#: ../../sflphone-client-gnome/src/config/configwindow.c:619 msgid "Ne_ver popup main window" msgstr "" -#: ../../sflphone-client-gnome/src/config/configwindow.c:622 +#: ../../sflphone-client-gnome/src/config/configwindow.c:623 msgid "Hide SFLphone window on _startup" msgstr "" -#: ../../sflphone-client-gnome/src/config/configwindow.c:628 +#: ../../sflphone-client-gnome/src/config/configwindow.c:629 msgid "Calls History" msgstr "" -#: ../../sflphone-client-gnome/src/config/configwindow.c:636 -msgid "_History size limit" +#: ../../sflphone-client-gnome/src/config/configwindow.c:632 +msgid "_Keep my history for at least" msgstr "" -#: ../../sflphone-client-gnome/src/config/configwindow.c:653 +#: ../../sflphone-client-gnome/src/config/configwindow.c:643 +msgid " days" +msgstr "" + +#: ../../sflphone-client-gnome/src/config/configwindow.c:647 msgid "PulseAudio sound server" msgstr "" -#: ../../sflphone-client-gnome/src/config/configwindow.c:661 -msgid "Mute other applications during a _call" +#: ../../sflphone-client-gnome/src/config/configwindow.c:650 +msgid "_Mute other applications during a call" msgstr "" -#: ../../sflphone-client-gnome/src/config/configwindow.c:674 +#: ../../sflphone-client-gnome/src/config/configwindow.c:664 msgid "SIP Port" msgstr "" -#: ../../sflphone-client-gnome/src/config/configwindow.c:687 +#: ../../sflphone-client-gnome/src/config/configwindow.c:677 msgid "Port:" msgstr "" -#: ../../sflphone-client-gnome/src/config/configwindow.c:742 -msgid "_Recordings folder" +#: ../../sflphone-client-gnome/src/config/configwindow.c:725 +msgid "Recordings folder" msgstr "" -#: ../../sflphone-client-gnome/src/config/configwindow.c:748 +#: ../../sflphone-client-gnome/src/config/configwindow.c:731 msgid "Select a folder" msgstr "" -#: ../../sflphone-client-gnome/src/config/configwindow.c:773 +#: ../../sflphone-client-gnome/src/config/configwindow.c:765 msgid "Preferences" msgstr "" -#: ../../sflphone-client-gnome/src/config/configwindow.c:793 +#: ../../sflphone-client-gnome/src/config/configwindow.c:785 msgid "General Settings" msgstr "" -#: ../../sflphone-client-gnome/src/config/configwindow.c:798 +#: ../../sflphone-client-gnome/src/config/configwindow.c:790 msgid "Audio Settings" msgstr "" -#: ../../sflphone-client-gnome/src/config/configwindow.c:803 +#: ../../sflphone-client-gnome/src/config/configwindow.c:795 msgid "Recordings" msgstr "" -#: ../../sflphone-client-gnome/src/config/configwindow.c:808 +#: ../../sflphone-client-gnome/src/config/configwindow.c:800 msgid "Address Book" msgstr "" -#: ../../sflphone-client-gnome/src/config/configwindow.c:813 +#: ../../sflphone-client-gnome/src/config/configwindow.c:805 msgid "Hooks" msgstr "" -#: ../../sflphone-client-gnome/src/config/configwindow.c:840 +#: ../../sflphone-client-gnome/src/config/configwindow.c:832 msgid "Accounts" msgstr "" -#: ../../sflphone-client-gnome/src/config/configwindow.c:852 +#: ../../sflphone-client-gnome/src/config/configwindow.c:844 msgid "Configured Accounts" msgstr "" @@ -731,40 +712,55 @@ msgstr "" msgid "URL Passing" msgstr "" -#: ../../sflphone-client-gnome/src/config/hooks-config.c:140 +#: ../../sflphone-client-gnome/src/config/hooks-config.c:135 +msgid "Custom commands on incoming calls with URL," +msgstr "" + +#: ../../sflphone-client-gnome/src/config/hooks-config.c:138 #, c-format -msgid "" -"SFLphone can run custom commands if incoming calls come with an URL " -"attached.\n" -"In this case, %s will be replaced with the passed URL." +msgid "%s will be replaced with the passed URL." msgstr "" -#: ../../sflphone-client-gnome/src/config/hooks-config.c:143 +#: ../../sflphone-client-gnome/src/config/hooks-config.c:141 msgid "Trigger on specific _SIP header" msgstr "" -#: ../../sflphone-client-gnome/src/config/hooks-config.c:155 +#: ../../sflphone-client-gnome/src/config/hooks-config.c:150 msgid "Trigger on _IAX2 URL" msgstr "" -#: ../../sflphone-client-gnome/src/config/hooks-config.c:160 -msgid "_Command to run: " +#: ../../sflphone-client-gnome/src/config/hooks-config.c:155 +msgid "Command to _run: " msgstr "" -#: ../../sflphone-client-gnome/src/config/hooks-config.c:168 +#: ../../sflphone-client-gnome/src/config/hooks-config.c:165 msgid "Phone Number Rewriting" msgstr "" -#: ../../sflphone-client-gnome/src/config/hooks-config.c:178 +#: ../../sflphone-client-gnome/src/config/hooks-config.c:169 msgid "_Prefix dialed numbers with:" msgstr "" -#: ../../sflphone-client-gnome/src/contacts/history.c:83 -#: ../../sflphone-client-gnome/src/contacts/searchbar.c:123 -msgid "Search history" +#: ../../sflphone-client-gnome/src/contacts/searchbar.c:55 +msgid "" +"Search all\n" +"Click here to change the search type" +msgstr "" + +#: ../../sflphone-client-gnome/src/contacts/searchbar.c:67 +msgid "" +"Search by missed call\n" +"Click here to change the search type" msgstr "" -#: ../../sflphone-client-gnome/src/contacts/history.c:83 -#: ../../sflphone-client-gnome/src/contacts/searchbar.c:110 -msgid "Search contact" +#: ../../sflphone-client-gnome/src/contacts/searchbar.c:79 +msgid "" +"Search by incoming call\n" +"Click here to change the search type" +msgstr "" + +#: ../../sflphone-client-gnome/src/contacts/searchbar.c:91 +msgid "" +"Search by outgoing call\n" +"Click here to change the search type" msgstr "" diff --git a/sflphone-common/po/zh_CN.po b/sflphone-common/po/zh_CN.po index 7de05fd789dc5291fc8b58039702ca8ef61aa695..0347cfcfed711a7e67e8a9718e8b1214b64fb0d0 100644 --- a/sflphone-common/po/zh_CN.po +++ b/sflphone-common/po/zh_CN.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: SFLphone 0.9.2\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-05-21 10:45-0400\n" +"POT-Creation-Date: 2009-06-12 18:05-0400\n" "PO-Revision-Date: 2008-10-28 14:15\n" "Last-Translator: Yun Liu <yun.liu@savoirfairelinux.com>\n" "Language-Team: SavoirFaireLinux Inc <sflphoneteam@savoirfairelinux.com>\n" @@ -17,50 +17,50 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n>1;\n" -#: ../../sflphone-client-gnome/src/accountlist.c:169 +#: ../../sflphone-client-gnome/src/accountlist.c:175 msgid "Registered" msgstr "已注册" -#: ../../sflphone-client-gnome/src/accountlist.c:172 +#: ../../sflphone-client-gnome/src/accountlist.c:178 msgid "Not Registered" msgstr "未注册" -#: ../../sflphone-client-gnome/src/accountlist.c:175 +#: ../../sflphone-client-gnome/src/accountlist.c:181 msgid "Trying..." msgstr "正在连接..." -#: ../../sflphone-client-gnome/src/accountlist.c:178 -#: ../../sflphone-client-gnome/src/sflnotify.c:176 -#: ../../sflphone-client-gnome/src/sflnotify.c:217 +#: ../../sflphone-client-gnome/src/accountlist.c:184 +#: ../../sflphone-client-gnome/src/sflnotify.c:131 +#: ../../sflphone-client-gnome/src/sflnotify.c:148 msgid "Error" msgstr "注册失败" -#: ../../sflphone-client-gnome/src/accountlist.c:181 +#: ../../sflphone-client-gnome/src/accountlist.c:187 msgid "Bad authentification" msgstr "认证错误" -#: ../../sflphone-client-gnome/src/accountlist.c:184 +#: ../../sflphone-client-gnome/src/accountlist.c:190 msgid "Network unreachable" msgstr "网络连接失败" -#: ../../sflphone-client-gnome/src/accountlist.c:187 +#: ../../sflphone-client-gnome/src/accountlist.c:193 msgid "Host unreachable" msgstr "服务器连接失败" -#: ../../sflphone-client-gnome/src/accountlist.c:190 +#: ../../sflphone-client-gnome/src/accountlist.c:196 msgid "Stun configuration error" msgstr "Stun配置有误" -#: ../../sflphone-client-gnome/src/accountlist.c:193 +#: ../../sflphone-client-gnome/src/accountlist.c:199 msgid "Stun server invalid" msgstr "Stun服务器无效" -#: ../../sflphone-client-gnome/src/accountlist.c:196 +#: ../../sflphone-client-gnome/src/accountlist.c:202 msgid "Invalid" msgstr "无效" #: ../../sflphone-client-gnome/src/actions.c:55 -#: ../../sflphone-client-gnome/src/sflnotify.c:108 +#: ../../sflphone-client-gnome/src/sflnotify.c:94 #, c-format msgid "%d voice mails" msgstr "%d 个语音信息" @@ -79,7 +79,7 @@ msgstr "" msgid "No registered account" msgstr "未发现已注册帐户" -#: ../../sflphone-client-gnome/src/actions.c:229 +#: ../../sflphone-client-gnome/src/actions.c:232 msgid "" "Unable to connect to the SFLphone server.\n" "Make sure the daemon is running." @@ -87,17 +87,17 @@ msgstr "" "连接SFLphone服务器失败.\n" "请检查daemon是否还在运行." -#: ../../sflphone-client-gnome/src/actions.c:787 +#: ../../sflphone-client-gnome/src/actions.c:807 #, c-format msgid "IP call - %s" msgstr "IP 电话 - %s" -#: ../../sflphone-client-gnome/src/actions.c:790 +#: ../../sflphone-client-gnome/src/actions.c:810 #, c-format msgid "Using %s (%s) - Codec: %s" msgstr "" -#: ../../sflphone-client-gnome/src/actions.c:880 +#: ../../sflphone-client-gnome/src/actions.c:900 #, c-format msgid "" "<b>Error: No audio codecs found.\n" @@ -128,124 +128,124 @@ msgstr "" "服务器: %s\n" "用户名: %s\n" -#: ../../sflphone-client-gnome/src/assistant.c:160 +#: ../../sflphone-client-gnome/src/assistant.c:159 msgid "SFLphone account configuration wizard" msgstr "SFLphone 帐户设置向导" -#: ../../sflphone-client-gnome/src/assistant.c:186 +#: ../../sflphone-client-gnome/src/assistant.c:185 msgid "Welcome to SFLphone!" msgstr "欢迎使用SFLphone!" -#: ../../sflphone-client-gnome/src/assistant.c:187 +#: ../../sflphone-client-gnome/src/assistant.c:186 msgid "This installation wizard will help you configure an account." msgstr "安装向导将帮助您配置帐户" -#: ../../sflphone-client-gnome/src/assistant.c:201 +#: ../../sflphone-client-gnome/src/assistant.c:200 msgid "VoIP Protocols" msgstr "VoIP协议" -#: ../../sflphone-client-gnome/src/assistant.c:201 +#: ../../sflphone-client-gnome/src/assistant.c:200 msgid "Select an account type:" msgstr "选择帐户类型:" -#: ../../sflphone-client-gnome/src/assistant.c:219 +#: ../../sflphone-client-gnome/src/assistant.c:218 msgid "Account" msgstr "帐户" -#: ../../sflphone-client-gnome/src/assistant.c:219 +#: ../../sflphone-client-gnome/src/assistant.c:218 msgid "Please select one of the following option:" msgstr "请选择以下选项中的一个:" -#: ../../sflphone-client-gnome/src/assistant.c:221 +#: ../../sflphone-client-gnome/src/assistant.c:220 msgid "Create a free SIP/IAX2 account on sflphone.org" msgstr "在sflphone.org上创建免费的SIP/IAX2帐户" -#: ../../sflphone-client-gnome/src/assistant.c:223 +#: ../../sflphone-client-gnome/src/assistant.c:222 msgid "Register an existing SIP or IAX2 account" msgstr "注册已存在的SIP或IAX2帐户" -#: ../../sflphone-client-gnome/src/assistant.c:236 +#: ../../sflphone-client-gnome/src/assistant.c:235 msgid "SIP account configuration" msgstr "SIP帐户配置" -#: ../../sflphone-client-gnome/src/assistant.c:236 -#: ../../sflphone-client-gnome/src/assistant.c:332 +#: ../../sflphone-client-gnome/src/assistant.c:235 +#: ../../sflphone-client-gnome/src/assistant.c:331 msgid "Please fill the following information:" msgstr "请填写以下信息:" -#: ../../sflphone-client-gnome/src/assistant.c:244 -#: ../../sflphone-client-gnome/src/assistant.c:340 -#: ../../sflphone-client-gnome/src/config/accountwindow.c:148 +#: ../../sflphone-client-gnome/src/assistant.c:243 +#: ../../sflphone-client-gnome/src/assistant.c:339 +#: ../../sflphone-client-gnome/src/config/accountwindow.c:153 msgid "_Alias" msgstr "别名(A)" -#: ../../sflphone-client-gnome/src/assistant.c:252 -#: ../../sflphone-client-gnome/src/assistant.c:348 -#: ../../sflphone-client-gnome/src/config/accountwindow.c:184 +#: ../../sflphone-client-gnome/src/assistant.c:251 +#: ../../sflphone-client-gnome/src/assistant.c:347 +#: ../../sflphone-client-gnome/src/config/accountwindow.c:189 msgid "_Host name" msgstr "主机名(H)" -#: ../../sflphone-client-gnome/src/assistant.c:260 -#: ../../sflphone-client-gnome/src/assistant.c:356 -#: ../../sflphone-client-gnome/src/config/accountwindow.c:192 +#: ../../sflphone-client-gnome/src/assistant.c:259 +#: ../../sflphone-client-gnome/src/assistant.c:355 +#: ../../sflphone-client-gnome/src/config/accountwindow.c:197 msgid "_User name" msgstr "用户名(U)" -#: ../../sflphone-client-gnome/src/assistant.c:276 -#: ../../sflphone-client-gnome/src/assistant.c:371 -#: ../../sflphone-client-gnome/src/config/accountwindow.c:207 +#: ../../sflphone-client-gnome/src/assistant.c:275 +#: ../../sflphone-client-gnome/src/assistant.c:370 +#: ../../sflphone-client-gnome/src/config/accountwindow.c:212 msgid "_Password" msgstr "密码(P)" -#: ../../sflphone-client-gnome/src/assistant.c:294 -#: ../../sflphone-client-gnome/src/assistant.c:387 -#: ../../sflphone-client-gnome/src/config/accountwindow.c:223 +#: ../../sflphone-client-gnome/src/assistant.c:293 +#: ../../sflphone-client-gnome/src/assistant.c:386 +#: ../../sflphone-client-gnome/src/config/accountwindow.c:228 msgid "_Voicemail number" msgstr "语音信箱号码(V)" -#: ../../sflphone-client-gnome/src/assistant.c:309 +#: ../../sflphone-client-gnome/src/assistant.c:308 msgid "Optional Email Address " msgstr "可选邮件地址 " -#: ../../sflphone-client-gnome/src/assistant.c:309 +#: ../../sflphone-client-gnome/src/assistant.c:308 msgid "This email address will be use to send your voicemail messages" msgstr "这个邮件地址将被用来发送您的语音邮箱消息" -#: ../../sflphone-client-gnome/src/assistant.c:317 +#: ../../sflphone-client-gnome/src/assistant.c:316 msgid "_Email" msgstr " 邮件(E)" -#: ../../sflphone-client-gnome/src/assistant.c:332 +#: ../../sflphone-client-gnome/src/assistant.c:331 msgid "IAX2 account configuration" msgstr "IAX2帐户配置" -#: ../../sflphone-client-gnome/src/assistant.c:405 -#: ../../sflphone-client-gnome/src/config/configwindow.c:863 +#: ../../sflphone-client-gnome/src/assistant.c:404 +#: ../../sflphone-client-gnome/src/config/configwindow.c:855 msgid "Network Address Translation" msgstr "网络地址解析" -#: ../../sflphone-client-gnome/src/assistant.c:405 +#: ../../sflphone-client-gnome/src/assistant.c:404 msgid "You should probably enable this if you are behind a firewall." msgstr "如果你使用网络使用防火墙,你很有可能需要设定此项." -#: ../../sflphone-client-gnome/src/assistant.c:414 -#: ../../sflphone-client-gnome/src/config/configwindow.c:516 +#: ../../sflphone-client-gnome/src/assistant.c:413 +#: ../../sflphone-client-gnome/src/config/configwindow.c:532 msgid "E_nable STUN" msgstr "使用STUN(n)" -#: ../../sflphone-client-gnome/src/assistant.c:421 +#: ../../sflphone-client-gnome/src/assistant.c:420 msgid "_STUN server" msgstr "STUN服务器(S)" -#: ../../sflphone-client-gnome/src/assistant.c:435 +#: ../../sflphone-client-gnome/src/assistant.c:434 msgid "Account Registration" msgstr "帐户注册" -#: ../../sflphone-client-gnome/src/assistant.c:435 +#: ../../sflphone-client-gnome/src/assistant.c:434 msgid "Congratulations!" msgstr "恭喜!" -#: ../../sflphone-client-gnome/src/errors.c:28 +#: ../../sflphone-client-gnome/src/errors.c:29 msgid "" "ALSA notification\n" "\n" @@ -255,7 +255,7 @@ msgstr "" "\n" "打开回放设备时出错" -#: ../../sflphone-client-gnome/src/errors.c:31 +#: ../../sflphone-client-gnome/src/errors.c:32 msgid "" "ALSA notification\n" "\n" @@ -265,7 +265,7 @@ msgstr "" "\n" "打开采集设备时出错" -#: ../../sflphone-client-gnome/src/errors.c:34 +#: ../../sflphone-client-gnome/src/errors.c:35 msgid "" "Pulseaudio notification\n" "\n" @@ -303,114 +303,101 @@ msgstr "关于SFLphone" msgid "_Help" msgstr "帮助(H)" -#: ../../sflphone-client-gnome/src/menus.c:300 -#: ../../sflphone-client-gnome/src/menus.c:971 +#: ../../sflphone-client-gnome/src/menus.c:296 +#: ../../sflphone-client-gnome/src/menus.c:962 msgid "_New call" msgstr "新电话(N)" -#: ../../sflphone-client-gnome/src/menus.c:312 -#: ../../sflphone-client-gnome/src/menus.c:803 +#: ../../sflphone-client-gnome/src/menus.c:308 +#: ../../sflphone-client-gnome/src/menus.c:794 msgid "_Pick up" msgstr "拨出(P)" -#: ../../sflphone-client-gnome/src/menus.c:322 -#: ../../sflphone-client-gnome/src/menus.c:815 +#: ../../sflphone-client-gnome/src/menus.c:318 +#: ../../sflphone-client-gnome/src/menus.c:806 msgid "_Hang up" msgstr "放下(H)" -#: ../../sflphone-client-gnome/src/menus.c:332 -#: ../../sflphone-client-gnome/src/menus.c:827 +#: ../../sflphone-client-gnome/src/menus.c:328 +#: ../../sflphone-client-gnome/src/menus.c:818 msgid "On _Hold" msgstr "保持(H)" -#: ../../sflphone-client-gnome/src/menus.c:344 -#: ../../sflphone-client-gnome/src/menus.c:839 +#: ../../sflphone-client-gnome/src/menus.c:340 +#: ../../sflphone-client-gnome/src/menus.c:830 msgid "_Record" msgstr "记录(R)" -#: ../../sflphone-client-gnome/src/menus.c:358 +#: ../../sflphone-client-gnome/src/menus.c:354 msgid "_Account creation wizard" msgstr "帐户创建向导" -#: ../../sflphone-client-gnome/src/menus.c:388 +#: ../../sflphone-client-gnome/src/menus.c:384 msgid "_Call" msgstr "电话" -#: ../../sflphone-client-gnome/src/menus.c:561 -msgid "_Clear history" +#: ../../sflphone-client-gnome/src/menus.c:552 +#, fuzzy +msgid "Clear _history" msgstr "清空历史记录(C)" -#: ../../sflphone-client-gnome/src/menus.c:573 +#: ../../sflphone-client-gnome/src/menus.c:564 msgid "_Accounts" msgstr "帐户(A)" -#: ../../sflphone-client-gnome/src/menus.c:588 +#: ../../sflphone-client-gnome/src/menus.c:579 msgid "_Edit" msgstr "编辑(E)" -#: ../../sflphone-client-gnome/src/menus.c:649 +#: ../../sflphone-client-gnome/src/menus.c:640 msgid "_Dialpad" msgstr "拨号面板" -#: ../../sflphone-client-gnome/src/menus.c:661 +#: ../../sflphone-client-gnome/src/menus.c:652 msgid "_Volume controls" msgstr "音量控制(V)" -#: ../../sflphone-client-gnome/src/menus.c:679 +#: ../../sflphone-client-gnome/src/menus.c:670 msgid "_View" msgstr "查看(V)" -#: ../../sflphone-client-gnome/src/menus.c:899 +#: ../../sflphone-client-gnome/src/menus.c:890 msgid "_Call back" msgstr "回叫(C)" -#: ../../sflphone-client-gnome/src/menus.c:1082 +#: ../../sflphone-client-gnome/src/menus.c:1070 msgid "Edit phone" msgstr "编辑电话" -#: ../../sflphone-client-gnome/src/menus.c:1093 +#: ../../sflphone-client-gnome/src/menus.c:1081 msgid "Edit the phone number before making a call" msgstr "拨出电话前编辑电话号码" -#: ../../sflphone-client-gnome/src/sflnotify.c:38 -#: ../../sflphone-client-gnome/src/sflnotify.c:105 +#: ../../sflphone-client-gnome/src/sflnotify.c:71 +#: ../../sflphone-client-gnome/src/sflnotify.c:91 #, c-format msgid "%s account: %s" msgstr "%s 帐户: %s" -#: ../../sflphone-client-gnome/src/sflnotify.c:42 +#: ../../sflphone-client-gnome/src/sflnotify.c:75 #, c-format msgid "<i>From:</i> %s" msgstr "<i>拨入方:</i> %s" -#: ../../sflphone-client-gnome/src/sflnotify.c:57 -msgid "Accept" -msgstr "接受" - -#: ../../sflphone-client-gnome/src/sflnotify.c:58 -msgid "Refuse" -msgstr "拒绝" - -#: ../../sflphone-client-gnome/src/sflnotify.c:59 -#: ../../sflphone-client-gnome/src/sflnotify.c:122 -#: ../../sflphone-client-gnome/src/sflnotify.c:159 -msgid "Ignore" -msgstr "忽略" - -#: ../../sflphone-client-gnome/src/sflnotify.c:141 +#: ../../sflphone-client-gnome/src/sflnotify.c:111 #, c-format msgid "Calling with %s account <i>%s</i>" msgstr "使用%s帐户<i>%s</i>呼叫" -#: ../../sflphone-client-gnome/src/sflnotify.c:145 +#: ../../sflphone-client-gnome/src/sflnotify.c:115 msgid "Current account" msgstr "当前帐户" -#: ../../sflphone-client-gnome/src/sflnotify.c:174 +#: ../../sflphone-client-gnome/src/sflnotify.c:130 msgid "You haven't setup any accounts" msgstr "你没有设置任何帐户" -#: ../../sflphone-client-gnome/src/sflnotify.c:214 +#: ../../sflphone-client-gnome/src/sflnotify.c:147 msgid "You have no registered accounts" msgstr "未发现已注册帐户" @@ -431,136 +418,128 @@ msgstr "显示主窗口(S)" msgid "SFLphone - %i accounts configured" msgstr "SFLphone - %i 个帐户已配置" -#: ../../sflphone-client-gnome/src/timestamp.c:46 -msgid "<small>Missed call</small>" -msgstr "<small>未接电话</small>" - -#: ../../sflphone-client-gnome/src/timestamp.c:64 -#, c-format -msgid "<small>Duration:</small> %s" -msgstr "<small>时长:</small> %s" - #: ../../sflphone-client-gnome/src/toolbar.c:50 #, c-format msgid "\"Voicemail\" <%s>" msgstr "\"语音邮件\" <%s>" -#: ../../sflphone-client-gnome/src/toolbar.c:176 -#: ../../sflphone-client-gnome/src/toolbar.c:178 +#: ../../sflphone-client-gnome/src/toolbar.c:168 +#: ../../sflphone-client-gnome/src/toolbar.c:170 msgid "Place a call" msgstr "拨号" -#: ../../sflphone-client-gnome/src/toolbar.c:185 -#: ../../sflphone-client-gnome/src/toolbar.c:187 +#: ../../sflphone-client-gnome/src/toolbar.c:177 +#: ../../sflphone-client-gnome/src/toolbar.c:179 msgid "Pick up" msgstr "接电话" -#: ../../sflphone-client-gnome/src/toolbar.c:195 -#: ../../sflphone-client-gnome/src/toolbar.c:197 +#: ../../sflphone-client-gnome/src/toolbar.c:187 +#: ../../sflphone-client-gnome/src/toolbar.c:189 msgid "Hang up" msgstr "放电话" -#: ../../sflphone-client-gnome/src/toolbar.c:205 -#: ../../sflphone-client-gnome/src/toolbar.c:207 +#: ../../sflphone-client-gnome/src/toolbar.c:197 +#: ../../sflphone-client-gnome/src/toolbar.c:199 msgid "Off Hold" msgstr "恢复通话" -#: ../../sflphone-client-gnome/src/toolbar.c:216 -#: ../../sflphone-client-gnome/src/toolbar.c:218 +#: ../../sflphone-client-gnome/src/toolbar.c:208 +#: ../../sflphone-client-gnome/src/toolbar.c:210 msgid "On Hold" msgstr "待机" -#: ../../sflphone-client-gnome/src/toolbar.c:229 -#: ../../sflphone-client-gnome/src/toolbar.c:231 +#: ../../sflphone-client-gnome/src/toolbar.c:221 +#: ../../sflphone-client-gnome/src/toolbar.c:223 msgid "Transfer" msgstr "转接" -#: ../../sflphone-client-gnome/src/toolbar.c:241 -#: ../../sflphone-client-gnome/src/toolbar.c:243 +#: ../../sflphone-client-gnome/src/toolbar.c:233 +#: ../../sflphone-client-gnome/src/toolbar.c:235 msgid "History" msgstr "历史" -#: ../../sflphone-client-gnome/src/toolbar.c:252 -#: ../../sflphone-client-gnome/src/toolbar.c:254 +#: ../../sflphone-client-gnome/src/toolbar.c:244 +#: ../../sflphone-client-gnome/src/toolbar.c:246 msgid "Address book" msgstr "地址簿" -#: ../../sflphone-client-gnome/src/toolbar.c:260 -#: ../../sflphone-client-gnome/src/toolbar.c:264 +#: ../../sflphone-client-gnome/src/toolbar.c:252 +#: ../../sflphone-client-gnome/src/toolbar.c:256 msgid "Voicemail" msgstr "语音信箱" -#: ../../sflphone-client-gnome/src/toolbar.c:272 +#: ../../sflphone-client-gnome/src/toolbar.c:264 msgid "Record a call" msgstr "记录通话" -#: ../../sflphone-client-gnome/src/config/accountwindow.c:108 +#: ../../sflphone-client-gnome/src/config/accountwindow.c:113 msgid "Account settings" msgstr "帐户设置" -#: ../../sflphone-client-gnome/src/config/accountwindow.c:120 +#: ../../sflphone-client-gnome/src/config/accountwindow.c:125 msgid "Account Parameters" msgstr "帐户相关参数" -#: ../../sflphone-client-gnome/src/config/accountwindow.c:142 +#: ../../sflphone-client-gnome/src/config/accountwindow.c:147 msgid "_Enable this account" msgstr "启用该账户(E)" -#: ../../sflphone-client-gnome/src/config/accountwindow.c:156 +#: ../../sflphone-client-gnome/src/config/accountwindow.c:161 msgid "_Protocol" msgstr "协议(P)" -#: ../../sflphone-client-gnome/src/config/accountwindow.c:174 +#: ../../sflphone-client-gnome/src/config/accountwindow.c:179 msgid "Unknown" msgstr "未知" -#: ../../sflphone-client-gnome/src/config/addressbook-config.c:265 -#: ../../sflphone-client-gnome/src/config/configwindow.c:732 +#: ../../sflphone-client-gnome/src/config/addressbook-config.c:306 +#: ../../sflphone-client-gnome/src/config/configwindow.c:721 msgid "General" msgstr "常用配置" -#: ../../sflphone-client-gnome/src/config/addressbook-config.c:276 +#: ../../sflphone-client-gnome/src/config/addressbook-config.c:312 msgid "_Use Evolution address books" msgstr "使用Evolution地址薄(U)" -#: ../../sflphone-client-gnome/src/config/addressbook-config.c:283 +#: ../../sflphone-client-gnome/src/config/addressbook-config.c:319 msgid "Download limit:" msgstr "下载上限:" -#: ../../sflphone-client-gnome/src/config/addressbook-config.c:294 +#: ../../sflphone-client-gnome/src/config/addressbook-config.c:327 +msgid "cards" +msgstr "" + +#: ../../sflphone-client-gnome/src/config/addressbook-config.c:333 msgid "_Display contact photo if available" msgstr "如果可行则显示联系人照片(D)" -#: ../../sflphone-client-gnome/src/config/addressbook-config.c:301 -msgid "Fields" -msgstr "字段" - -#: ../../sflphone-client-gnome/src/config/addressbook-config.c:311 -msgid "Use the following fields from Evolution's address books:" +#: ../../sflphone-client-gnome/src/config/addressbook-config.c:341 +#, fuzzy +msgid "Fields from Evolution's address books" msgstr "使用Evolution地址薄中的如下字段:" -#: ../../sflphone-client-gnome/src/config/addressbook-config.c:316 +#: ../../sflphone-client-gnome/src/config/addressbook-config.c:345 msgid "_Business phone" msgstr "商务电话(B)" -#: ../../sflphone-client-gnome/src/config/addressbook-config.c:321 +#: ../../sflphone-client-gnome/src/config/addressbook-config.c:351 msgid "_Home phone" msgstr "家庭电话(H)" -#: ../../sflphone-client-gnome/src/config/addressbook-config.c:326 +#: ../../sflphone-client-gnome/src/config/addressbook-config.c:357 msgid "_Mobile phone" msgstr "移动电话(M)" -#: ../../sflphone-client-gnome/src/config/addressbook-config.c:333 +#: ../../sflphone-client-gnome/src/config/addressbook-config.c:364 msgid "Address Books" msgstr "地址簿" -#: ../../sflphone-client-gnome/src/config/addressbook-config.c:343 +#: ../../sflphone-client-gnome/src/config/addressbook-config.c:368 msgid "Select which Evolution address books to use:" msgstr "选择使用如下Evolution地址薄:" -#: ../../sflphone-client-gnome/src/config/addressbook-config.c:377 -#: ../../sflphone-client-gnome/src/config/audioconf.c:574 +#: ../../sflphone-client-gnome/src/config/addressbook-config.c:404 +#: ../../sflphone-client-gnome/src/config/audioconf.c:576 msgid "Name" msgstr "名称" @@ -569,183 +548,191 @@ msgstr "名称" msgid "audio device index for output = %d" msgstr "音频设备输出索引 = %d" -#: ../../sflphone-client-gnome/src/config/audioconf.c:579 +#: ../../sflphone-client-gnome/src/config/audioconf.c:581 msgid "Frequency" msgstr "频率" -#: ../../sflphone-client-gnome/src/config/audioconf.c:584 +#: ../../sflphone-client-gnome/src/config/audioconf.c:586 msgid "Bitrate" msgstr "比率" -#: ../../sflphone-client-gnome/src/config/audioconf.c:589 +#: ../../sflphone-client-gnome/src/config/audioconf.c:591 msgid "Bandwidth" msgstr "带宽" -#: ../../sflphone-client-gnome/src/config/audioconf.c:652 -msgid "Pulseaudio" -msgstr "Pulseaudio" - -#: ../../sflphone-client-gnome/src/config/audioconf.c:655 -msgid "ALSA" -msgstr "ALSA" - -#: ../../sflphone-client-gnome/src/config/audioconf.c:681 +#: ../../sflphone-client-gnome/src/config/audioconf.c:662 msgid "ALSA plugin" msgstr "ALSA插件" -#: ../../sflphone-client-gnome/src/config/audioconf.c:703 +#: ../../sflphone-client-gnome/src/config/audioconf.c:684 msgid "Output" msgstr "输出" -#: ../../sflphone-client-gnome/src/config/audioconf.c:725 +#: ../../sflphone-client-gnome/src/config/audioconf.c:706 msgid "Input" msgstr "输入" -#: ../../sflphone-client-gnome/src/config/audioconf.c:758 -msgid "_Enable ringtones" -msgstr "启用铃声(E)" - -#: ../../sflphone-client-gnome/src/config/audioconf.c:764 -msgid "Choose a ringtone" -msgstr "选择铃声" - -#: ../../sflphone-client-gnome/src/config/audioconf.c:769 -msgid "Audio Files" -msgstr "音频文件" - -#: ../../sflphone-client-gnome/src/config/audioconf.c:788 +#: ../../sflphone-client-gnome/src/config/audioconf.c:741 msgid "_Voice Activity Detection" msgstr "声音状态检测(V)" -#: ../../sflphone-client-gnome/src/config/audioconf.c:798 +#: ../../sflphone-client-gnome/src/config/audioconf.c:751 msgid "_Noise Reduction (Narrow-Band Companding)" msgstr "降噪处理-窄频压缩(N)" -#: ../../sflphone-client-gnome/src/config/audioconf.c:826 +#: ../../sflphone-client-gnome/src/config/audioconf.c:780 msgid "Sound Manager" msgstr "音频管理器" -#: ../../sflphone-client-gnome/src/config/audioconf.c:833 +#: ../../sflphone-client-gnome/src/config/audioconf.c:783 +#, fuzzy +msgid "_Pulseaudio" +msgstr "Pulseaudio" + +#: ../../sflphone-client-gnome/src/config/audioconf.c:788 +#, fuzzy +msgid "_ALSA" +msgstr "ALSA" + +#: ../../sflphone-client-gnome/src/config/audioconf.c:795 msgid "ALSA configuration" msgstr "ALSA 配置" -#: ../../sflphone-client-gnome/src/config/audioconf.c:850 +#: ../../sflphone-client-gnome/src/config/audioconf.c:812 msgid "Codecs" msgstr "Codecs编码" -#: ../../sflphone-client-gnome/src/config/audioconf.c:873 +#: ../../sflphone-client-gnome/src/config/audioconf.c:835 msgid "Ringtones" msgstr "铃声" -#: ../../sflphone-client-gnome/src/config/configwindow.c:402 +#: ../../sflphone-client-gnome/src/config/audioconf.c:841 +msgid "_Enable ringtones" +msgstr "启用铃声(E)" + +#: ../../sflphone-client-gnome/src/config/audioconf.c:847 +msgid "Choose a ringtone" +msgstr "选择铃声" + +#: ../../sflphone-client-gnome/src/config/audioconf.c:853 +msgid "Audio Files" +msgstr "音频文件" + +#: ../../sflphone-client-gnome/src/config/configwindow.c:418 msgid "Protocol" msgstr "协议" -#: ../../sflphone-client-gnome/src/config/configwindow.c:409 +#: ../../sflphone-client-gnome/src/config/configwindow.c:425 msgid "Status" msgstr "状态" -#: ../../sflphone-client-gnome/src/config/configwindow.c:512 +#: ../../sflphone-client-gnome/src/config/configwindow.c:528 msgid "Stun parameters will apply to each SIP account created." msgstr "Stun参数将应用于每一个注册的SIP帐户" -#: ../../sflphone-client-gnome/src/config/configwindow.c:520 +#: ../../sflphone-client-gnome/src/config/configwindow.c:536 msgid "Enable it if you are behind a firewall" msgstr "当使用防火墙时,启用该项" -#: ../../sflphone-client-gnome/src/config/configwindow.c:528 +#: ../../sflphone-client-gnome/src/config/configwindow.c:544 msgid "Format: name.server:port" msgstr "格式:name.server:port" -#: ../../sflphone-client-gnome/src/config/configwindow.c:579 +#: ../../sflphone-client-gnome/src/config/configwindow.c:589 msgid "Desktop Notifications" msgstr "桌面提示" -#: ../../sflphone-client-gnome/src/config/configwindow.c:588 +#: ../../sflphone-client-gnome/src/config/configwindow.c:593 msgid "_Enable notifications" msgstr "启用提示(E)" -#: ../../sflphone-client-gnome/src/config/configwindow.c:594 +#: ../../sflphone-client-gnome/src/config/configwindow.c:599 msgid "Enable voicemail _notifications" msgstr "启用语音邮箱提示(n)" -#: ../../sflphone-client-gnome/src/config/configwindow.c:605 +#: ../../sflphone-client-gnome/src/config/configwindow.c:611 msgid "System Tray Icon" msgstr "系统托盘图标" -#: ../../sflphone-client-gnome/src/config/configwindow.c:613 +#: ../../sflphone-client-gnome/src/config/configwindow.c:614 msgid "_Popup main window on incoming call" msgstr "来电时弹出主窗口(P)" -#: ../../sflphone-client-gnome/src/config/configwindow.c:618 +#: ../../sflphone-client-gnome/src/config/configwindow.c:619 msgid "Ne_ver popup main window" msgstr "从不弹出主窗口(v)" -#: ../../sflphone-client-gnome/src/config/configwindow.c:622 +#: ../../sflphone-client-gnome/src/config/configwindow.c:623 msgid "Hide SFLphone window on _startup" msgstr "在启动时隐藏SFLphone主窗口" -#: ../../sflphone-client-gnome/src/config/configwindow.c:628 +#: ../../sflphone-client-gnome/src/config/configwindow.c:629 msgid "Calls History" msgstr "拨号历史" -#: ../../sflphone-client-gnome/src/config/configwindow.c:636 -msgid "_History size limit" -msgstr "历史记录上限(H)" +#: ../../sflphone-client-gnome/src/config/configwindow.c:632 +msgid "_Keep my history for at least" +msgstr "" + +#: ../../sflphone-client-gnome/src/config/configwindow.c:643 +msgid " days" +msgstr "" -#: ../../sflphone-client-gnome/src/config/configwindow.c:653 +#: ../../sflphone-client-gnome/src/config/configwindow.c:647 msgid "PulseAudio sound server" msgstr "PulseAudio服务器" -#: ../../sflphone-client-gnome/src/config/configwindow.c:661 -msgid "Mute other applications during a _call" +#: ../../sflphone-client-gnome/src/config/configwindow.c:650 +#, fuzzy +msgid "_Mute other applications during a call" msgstr "当有来电时静音其它应用程序(c)" -#: ../../sflphone-client-gnome/src/config/configwindow.c:674 +#: ../../sflphone-client-gnome/src/config/configwindow.c:664 msgid "SIP Port" msgstr "SIP端口号" -#: ../../sflphone-client-gnome/src/config/configwindow.c:687 +#: ../../sflphone-client-gnome/src/config/configwindow.c:677 msgid "Port:" msgstr "端口:" -#: ../../sflphone-client-gnome/src/config/configwindow.c:742 -msgid "_Recordings folder" +#: ../../sflphone-client-gnome/src/config/configwindow.c:725 +#, fuzzy +msgid "Recordings folder" msgstr "记录文件夹(R)" -#: ../../sflphone-client-gnome/src/config/configwindow.c:748 +#: ../../sflphone-client-gnome/src/config/configwindow.c:731 msgid "Select a folder" msgstr "选择文件夹" -#: ../../sflphone-client-gnome/src/config/configwindow.c:773 +#: ../../sflphone-client-gnome/src/config/configwindow.c:765 msgid "Preferences" msgstr "属性" -#: ../../sflphone-client-gnome/src/config/configwindow.c:793 +#: ../../sflphone-client-gnome/src/config/configwindow.c:785 msgid "General Settings" msgstr "常用配置" -#: ../../sflphone-client-gnome/src/config/configwindow.c:798 +#: ../../sflphone-client-gnome/src/config/configwindow.c:790 msgid "Audio Settings" msgstr "音频配置" -#: ../../sflphone-client-gnome/src/config/configwindow.c:803 +#: ../../sflphone-client-gnome/src/config/configwindow.c:795 msgid "Recordings" msgstr "记录" -#: ../../sflphone-client-gnome/src/config/configwindow.c:808 +#: ../../sflphone-client-gnome/src/config/configwindow.c:800 msgid "Address Book" msgstr "地址簿" -#: ../../sflphone-client-gnome/src/config/configwindow.c:813 +#: ../../sflphone-client-gnome/src/config/configwindow.c:805 msgid "Hooks" msgstr "钩键" -#: ../../sflphone-client-gnome/src/config/configwindow.c:840 +#: ../../sflphone-client-gnome/src/config/configwindow.c:832 msgid "Accounts" msgstr "帐户" -#: ../../sflphone-client-gnome/src/config/configwindow.c:852 +#: ../../sflphone-client-gnome/src/config/configwindow.c:844 msgid "Configured Accounts" msgstr "已配置帐户" @@ -753,45 +740,94 @@ msgstr "已配置帐户" msgid "URL Passing" msgstr "传输URL" -#: ../../sflphone-client-gnome/src/config/hooks-config.c:140 +#: ../../sflphone-client-gnome/src/config/hooks-config.c:135 +msgid "Custom commands on incoming calls with URL," +msgstr "" + +#: ../../sflphone-client-gnome/src/config/hooks-config.c:138 #, c-format -msgid "" -"SFLphone can run custom commands if incoming calls come with an URL " -"attached.\n" -"In this case, %s will be replaced with the passed URL." +msgid "%s will be replaced with the passed URL." msgstr "" -"当来电有附加的URL时,SFLphone可运行客户命令.\n" -"在此情况下,传输的URL会被替换成%s." -#: ../../sflphone-client-gnome/src/config/hooks-config.c:143 +#: ../../sflphone-client-gnome/src/config/hooks-config.c:141 msgid "Trigger on specific _SIP header" msgstr "激活指定的SIP头(S)" -#: ../../sflphone-client-gnome/src/config/hooks-config.c:155 +#: ../../sflphone-client-gnome/src/config/hooks-config.c:150 msgid "Trigger on _IAX2 URL" msgstr "激活IAX2 URL(I)" -#: ../../sflphone-client-gnome/src/config/hooks-config.c:160 -msgid "_Command to run: " +#: ../../sflphone-client-gnome/src/config/hooks-config.c:155 +#, fuzzy +msgid "Command to _run: " msgstr "运行命令(C):" -#: ../../sflphone-client-gnome/src/config/hooks-config.c:168 +#: ../../sflphone-client-gnome/src/config/hooks-config.c:165 msgid "Phone Number Rewriting" msgstr "重设电话号码" -#: ../../sflphone-client-gnome/src/config/hooks-config.c:178 +#: ../../sflphone-client-gnome/src/config/hooks-config.c:169 msgid "_Prefix dialed numbers with:" msgstr "号码前缀:" -#: ../../sflphone-client-gnome/src/contacts/history.c:83 -#: ../../sflphone-client-gnome/src/contacts/searchbar.c:123 -msgid "Search history" -msgstr "查找历史记录" +#: ../../sflphone-client-gnome/src/contacts/searchbar.c:55 +msgid "" +"Search all\n" +"Click here to change the search type" +msgstr "" + +#: ../../sflphone-client-gnome/src/contacts/searchbar.c:67 +msgid "" +"Search by missed call\n" +"Click here to change the search type" +msgstr "" + +#: ../../sflphone-client-gnome/src/contacts/searchbar.c:79 +msgid "" +"Search by incoming call\n" +"Click here to change the search type" +msgstr "" + +#: ../../sflphone-client-gnome/src/contacts/searchbar.c:91 +msgid "" +"Search by outgoing call\n" +"Click here to change the search type" +msgstr "" + +#~ msgid "Accept" +#~ msgstr "接受" + +#~ msgid "Refuse" +#~ msgstr "拒绝" + +#~ msgid "Ignore" +#~ msgstr "忽略" + +#~ msgid "<small>Missed call</small>" +#~ msgstr "<small>未接电话</small>" + +#~ msgid "<small>Duration:</small> %s" +#~ msgstr "<small>时长:</small> %s" + +#~ msgid "Fields" +#~ msgstr "字段" + +#~ msgid "_History size limit" +#~ msgstr "历史记录上限(H)" + +#~ msgid "" +#~ "SFLphone can run custom commands if incoming calls come with an URL " +#~ "attached.\n" +#~ "In this case, %s will be replaced with the passed URL." +#~ msgstr "" +#~ "当来电有附加的URL时,SFLphone可运行客户命令.\n" +#~ "在此情况下,传输的URL会被替换成%s." + +#~ msgid "Search history" +#~ msgstr "查找历史记录" -#: ../../sflphone-client-gnome/src/contacts/history.c:83 -#: ../../sflphone-client-gnome/src/contacts/searchbar.c:110 -msgid "Search contact" -msgstr "查找联系人(S)" +#~ msgid "Search contact" +#~ msgstr "查找联系人(S)" #~ msgid "Registered to %s (%s)" #~ msgstr "注册到 %s (%s)" diff --git a/sflphone-common/po/zh_HK.po b/sflphone-common/po/zh_HK.po index bb25b47ecffb24f99e8eef4b1790661177fdebc5..2df95b89a9afc094bd3c61ee5762b0bf3baad932 100644 --- a/sflphone-common/po/zh_HK.po +++ b/sflphone-common/po/zh_HK.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: SFLphone 0.9.2\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-05-21 10:45-0400\n" +"POT-Creation-Date: 2009-06-12 18:05-0400\n" "PO-Revision-Date: 2008-10-28 14:15\n" "Last-Translator: Yun Liu <yun.liu@savoirfairelinux.com>\n" "Language-Team: SavoirFaireLinux Inc <sflphoneteam@savoirfairelinux.com>\n" @@ -17,50 +17,50 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n>1;\n" -#: ../../sflphone-client-gnome/src/accountlist.c:169 +#: ../../sflphone-client-gnome/src/accountlist.c:175 msgid "Registered" msgstr "已註冊" -#: ../../sflphone-client-gnome/src/accountlist.c:172 +#: ../../sflphone-client-gnome/src/accountlist.c:178 msgid "Not Registered" msgstr "未註冊" -#: ../../sflphone-client-gnome/src/accountlist.c:175 +#: ../../sflphone-client-gnome/src/accountlist.c:181 msgid "Trying..." msgstr "正在連接..." -#: ../../sflphone-client-gnome/src/accountlist.c:178 -#: ../../sflphone-client-gnome/src/sflnotify.c:176 -#: ../../sflphone-client-gnome/src/sflnotify.c:217 +#: ../../sflphone-client-gnome/src/accountlist.c:184 +#: ../../sflphone-client-gnome/src/sflnotify.c:131 +#: ../../sflphone-client-gnome/src/sflnotify.c:148 msgid "Error" msgstr "註冊失敗" -#: ../../sflphone-client-gnome/src/accountlist.c:181 +#: ../../sflphone-client-gnome/src/accountlist.c:187 msgid "Bad authentification" msgstr "認證錯誤" -#: ../../sflphone-client-gnome/src/accountlist.c:184 +#: ../../sflphone-client-gnome/src/accountlist.c:190 msgid "Network unreachable" msgstr "網路連線失敗" -#: ../../sflphone-client-gnome/src/accountlist.c:187 +#: ../../sflphone-client-gnome/src/accountlist.c:193 msgid "Host unreachable" msgstr "伺服器連線失敗" -#: ../../sflphone-client-gnome/src/accountlist.c:190 +#: ../../sflphone-client-gnome/src/accountlist.c:196 msgid "Stun configuration error" msgstr "Stun配置有誤" -#: ../../sflphone-client-gnome/src/accountlist.c:193 +#: ../../sflphone-client-gnome/src/accountlist.c:199 msgid "Stun server invalid" msgstr "Stun伺服器無效" -#: ../../sflphone-client-gnome/src/accountlist.c:196 +#: ../../sflphone-client-gnome/src/accountlist.c:202 msgid "Invalid" msgstr "無效" #: ../../sflphone-client-gnome/src/actions.c:55 -#: ../../sflphone-client-gnome/src/sflnotify.c:108 +#: ../../sflphone-client-gnome/src/sflnotify.c:94 #, c-format msgid "%d voice mails" msgstr "%d 個語音郵件" @@ -79,7 +79,7 @@ msgstr "" msgid "No registered account" msgstr "未發現已註冊帳戶" -#: ../../sflphone-client-gnome/src/actions.c:229 +#: ../../sflphone-client-gnome/src/actions.c:232 msgid "" "Unable to connect to the SFLphone server.\n" "Make sure the daemon is running." @@ -87,17 +87,17 @@ msgstr "" "連接SFLphone伺服器失敗.\n" "請核查daemon是否正在運行." -#: ../../sflphone-client-gnome/src/actions.c:787 +#: ../../sflphone-client-gnome/src/actions.c:807 #, c-format msgid "IP call - %s" msgstr "IP電話- %s" -#: ../../sflphone-client-gnome/src/actions.c:790 +#: ../../sflphone-client-gnome/src/actions.c:810 #, c-format msgid "Using %s (%s) - Codec: %s" msgstr "" -#: ../../sflphone-client-gnome/src/actions.c:880 +#: ../../sflphone-client-gnome/src/actions.c:900 #, c-format msgid "" "<b>Error: No audio codecs found.\n" @@ -127,124 +127,124 @@ msgstr "" "伺服器: %s\n" "使用者名稱: %s\n" -#: ../../sflphone-client-gnome/src/assistant.c:160 +#: ../../sflphone-client-gnome/src/assistant.c:159 msgid "SFLphone account configuration wizard" msgstr "SFLphone 帳戶設置向導" -#: ../../sflphone-client-gnome/src/assistant.c:186 +#: ../../sflphone-client-gnome/src/assistant.c:185 msgid "Welcome to SFLphone!" msgstr "歡迎使用SFLphone!" -#: ../../sflphone-client-gnome/src/assistant.c:187 +#: ../../sflphone-client-gnome/src/assistant.c:186 msgid "This installation wizard will help you configure an account." msgstr "安裝向導將幫助您配置帳戶" -#: ../../sflphone-client-gnome/src/assistant.c:201 +#: ../../sflphone-client-gnome/src/assistant.c:200 msgid "VoIP Protocols" msgstr "VoIP協議" -#: ../../sflphone-client-gnome/src/assistant.c:201 +#: ../../sflphone-client-gnome/src/assistant.c:200 msgid "Select an account type:" msgstr "選擇帳戶類型:" -#: ../../sflphone-client-gnome/src/assistant.c:219 +#: ../../sflphone-client-gnome/src/assistant.c:218 msgid "Account" msgstr "帳戶" -#: ../../sflphone-client-gnome/src/assistant.c:219 +#: ../../sflphone-client-gnome/src/assistant.c:218 msgid "Please select one of the following option:" msgstr "請選擇以下選項中的一個:" -#: ../../sflphone-client-gnome/src/assistant.c:221 +#: ../../sflphone-client-gnome/src/assistant.c:220 msgid "Create a free SIP/IAX2 account on sflphone.org" msgstr "在sflphone.org上創建免費的SIP/IAX2帳戶" -#: ../../sflphone-client-gnome/src/assistant.c:223 +#: ../../sflphone-client-gnome/src/assistant.c:222 msgid "Register an existing SIP or IAX2 account" msgstr "註冊已存在的SIP或IAX2帳戶" -#: ../../sflphone-client-gnome/src/assistant.c:236 +#: ../../sflphone-client-gnome/src/assistant.c:235 msgid "SIP account configuration" msgstr "SIP帳戶配置" -#: ../../sflphone-client-gnome/src/assistant.c:236 -#: ../../sflphone-client-gnome/src/assistant.c:332 +#: ../../sflphone-client-gnome/src/assistant.c:235 +#: ../../sflphone-client-gnome/src/assistant.c:331 msgid "Please fill the following information:" msgstr "請填寫如下信息:" -#: ../../sflphone-client-gnome/src/assistant.c:244 -#: ../../sflphone-client-gnome/src/assistant.c:340 -#: ../../sflphone-client-gnome/src/config/accountwindow.c:148 +#: ../../sflphone-client-gnome/src/assistant.c:243 +#: ../../sflphone-client-gnome/src/assistant.c:339 +#: ../../sflphone-client-gnome/src/config/accountwindow.c:153 msgid "_Alias" msgstr "別稱(A)" -#: ../../sflphone-client-gnome/src/assistant.c:252 -#: ../../sflphone-client-gnome/src/assistant.c:348 -#: ../../sflphone-client-gnome/src/config/accountwindow.c:184 +#: ../../sflphone-client-gnome/src/assistant.c:251 +#: ../../sflphone-client-gnome/src/assistant.c:347 +#: ../../sflphone-client-gnome/src/config/accountwindow.c:189 msgid "_Host name" msgstr "主机名稱(H)" -#: ../../sflphone-client-gnome/src/assistant.c:260 -#: ../../sflphone-client-gnome/src/assistant.c:356 -#: ../../sflphone-client-gnome/src/config/accountwindow.c:192 +#: ../../sflphone-client-gnome/src/assistant.c:259 +#: ../../sflphone-client-gnome/src/assistant.c:355 +#: ../../sflphone-client-gnome/src/config/accountwindow.c:197 msgid "_User name" msgstr "使用者名稱(U)" -#: ../../sflphone-client-gnome/src/assistant.c:276 -#: ../../sflphone-client-gnome/src/assistant.c:371 -#: ../../sflphone-client-gnome/src/config/accountwindow.c:207 +#: ../../sflphone-client-gnome/src/assistant.c:275 +#: ../../sflphone-client-gnome/src/assistant.c:370 +#: ../../sflphone-client-gnome/src/config/accountwindow.c:212 msgid "_Password" msgstr "密碼(P)" -#: ../../sflphone-client-gnome/src/assistant.c:294 -#: ../../sflphone-client-gnome/src/assistant.c:387 -#: ../../sflphone-client-gnome/src/config/accountwindow.c:223 +#: ../../sflphone-client-gnome/src/assistant.c:293 +#: ../../sflphone-client-gnome/src/assistant.c:386 +#: ../../sflphone-client-gnome/src/config/accountwindow.c:228 msgid "_Voicemail number" msgstr "語音郵箱(V)" -#: ../../sflphone-client-gnome/src/assistant.c:309 +#: ../../sflphone-client-gnome/src/assistant.c:308 msgid "Optional Email Address " msgstr "可選郵件地址 " -#: ../../sflphone-client-gnome/src/assistant.c:309 +#: ../../sflphone-client-gnome/src/assistant.c:308 msgid "This email address will be use to send your voicemail messages" msgstr "這個郵件地址將被用來發送您的語音郵箱消息" -#: ../../sflphone-client-gnome/src/assistant.c:317 +#: ../../sflphone-client-gnome/src/assistant.c:316 msgid "_Email" msgstr "郵件(E)" -#: ../../sflphone-client-gnome/src/assistant.c:332 +#: ../../sflphone-client-gnome/src/assistant.c:331 msgid "IAX2 account configuration" msgstr "IAX2帳戶配置" -#: ../../sflphone-client-gnome/src/assistant.c:405 -#: ../../sflphone-client-gnome/src/config/configwindow.c:863 +#: ../../sflphone-client-gnome/src/assistant.c:404 +#: ../../sflphone-client-gnome/src/config/configwindow.c:855 msgid "Network Address Translation" msgstr "網路地址分析" -#: ../../sflphone-client-gnome/src/assistant.c:405 +#: ../../sflphone-client-gnome/src/assistant.c:404 msgid "You should probably enable this if you are behind a firewall." msgstr "如果你使用網路防火牆,你很有可能需要設定該項." -#: ../../sflphone-client-gnome/src/assistant.c:414 -#: ../../sflphone-client-gnome/src/config/configwindow.c:516 +#: ../../sflphone-client-gnome/src/assistant.c:413 +#: ../../sflphone-client-gnome/src/config/configwindow.c:532 msgid "E_nable STUN" msgstr "啟用STUN(n)" -#: ../../sflphone-client-gnome/src/assistant.c:421 +#: ../../sflphone-client-gnome/src/assistant.c:420 msgid "_STUN server" msgstr "STUN伺服器(S)" -#: ../../sflphone-client-gnome/src/assistant.c:435 +#: ../../sflphone-client-gnome/src/assistant.c:434 msgid "Account Registration" msgstr "帳戶註冊" -#: ../../sflphone-client-gnome/src/assistant.c:435 +#: ../../sflphone-client-gnome/src/assistant.c:434 msgid "Congratulations!" msgstr "恭喜!" -#: ../../sflphone-client-gnome/src/errors.c:28 +#: ../../sflphone-client-gnome/src/errors.c:29 msgid "" "ALSA notification\n" "\n" @@ -254,7 +254,7 @@ msgstr "" "\n" "打開回放設備時出錯" -#: ../../sflphone-client-gnome/src/errors.c:31 +#: ../../sflphone-client-gnome/src/errors.c:32 msgid "" "ALSA notification\n" "\n" @@ -264,7 +264,7 @@ msgstr "" "\n" "打開采集設備時出錯" -#: ../../sflphone-client-gnome/src/errors.c:34 +#: ../../sflphone-client-gnome/src/errors.c:35 msgid "" "Pulseaudio notification\n" "\n" @@ -302,114 +302,101 @@ msgstr "有關SFLphone" msgid "_Help" msgstr "幫助(H)" -#: ../../sflphone-client-gnome/src/menus.c:300 -#: ../../sflphone-client-gnome/src/menus.c:971 +#: ../../sflphone-client-gnome/src/menus.c:296 +#: ../../sflphone-client-gnome/src/menus.c:962 msgid "_New call" msgstr "新電話(N)" -#: ../../sflphone-client-gnome/src/menus.c:312 -#: ../../sflphone-client-gnome/src/menus.c:803 +#: ../../sflphone-client-gnome/src/menus.c:308 +#: ../../sflphone-client-gnome/src/menus.c:794 msgid "_Pick up" msgstr "撥出(P)" -#: ../../sflphone-client-gnome/src/menus.c:322 -#: ../../sflphone-client-gnome/src/menus.c:815 +#: ../../sflphone-client-gnome/src/menus.c:318 +#: ../../sflphone-client-gnome/src/menus.c:806 msgid "_Hang up" msgstr "放下(H)" -#: ../../sflphone-client-gnome/src/menus.c:332 -#: ../../sflphone-client-gnome/src/menus.c:827 +#: ../../sflphone-client-gnome/src/menus.c:328 +#: ../../sflphone-client-gnome/src/menus.c:818 msgid "On _Hold" msgstr "待机" -#: ../../sflphone-client-gnome/src/menus.c:344 -#: ../../sflphone-client-gnome/src/menus.c:839 +#: ../../sflphone-client-gnome/src/menus.c:340 +#: ../../sflphone-client-gnome/src/menus.c:830 msgid "_Record" msgstr "記錄(R)" -#: ../../sflphone-client-gnome/src/menus.c:358 +#: ../../sflphone-client-gnome/src/menus.c:354 msgid "_Account creation wizard" msgstr "帳戶創建向導(A)" -#: ../../sflphone-client-gnome/src/menus.c:388 +#: ../../sflphone-client-gnome/src/menus.c:384 msgid "_Call" msgstr "電話" -#: ../../sflphone-client-gnome/src/menus.c:561 -msgid "_Clear history" +#: ../../sflphone-client-gnome/src/menus.c:552 +#, fuzzy +msgid "Clear _history" msgstr "清空曆史記錄(C)" -#: ../../sflphone-client-gnome/src/menus.c:573 +#: ../../sflphone-client-gnome/src/menus.c:564 msgid "_Accounts" msgstr "帳戶(A)" -#: ../../sflphone-client-gnome/src/menus.c:588 +#: ../../sflphone-client-gnome/src/menus.c:579 msgid "_Edit" msgstr "編輯(E)" -#: ../../sflphone-client-gnome/src/menus.c:649 +#: ../../sflphone-client-gnome/src/menus.c:640 msgid "_Dialpad" msgstr "撥號面板" -#: ../../sflphone-client-gnome/src/menus.c:661 +#: ../../sflphone-client-gnome/src/menus.c:652 msgid "_Volume controls" msgstr "音量控制(V)" -#: ../../sflphone-client-gnome/src/menus.c:679 +#: ../../sflphone-client-gnome/src/menus.c:670 msgid "_View" msgstr "查看(V)" -#: ../../sflphone-client-gnome/src/menus.c:899 +#: ../../sflphone-client-gnome/src/menus.c:890 msgid "_Call back" msgstr "回叫(C)" -#: ../../sflphone-client-gnome/src/menus.c:1082 +#: ../../sflphone-client-gnome/src/menus.c:1070 msgid "Edit phone" msgstr "編輯電話" -#: ../../sflphone-client-gnome/src/menus.c:1093 +#: ../../sflphone-client-gnome/src/menus.c:1081 msgid "Edit the phone number before making a call" msgstr "撥出電話前編輯電話號碼" -#: ../../sflphone-client-gnome/src/sflnotify.c:38 -#: ../../sflphone-client-gnome/src/sflnotify.c:105 +#: ../../sflphone-client-gnome/src/sflnotify.c:71 +#: ../../sflphone-client-gnome/src/sflnotify.c:91 #, c-format msgid "%s account: %s" msgstr "%s 帳戶: %s" -#: ../../sflphone-client-gnome/src/sflnotify.c:42 +#: ../../sflphone-client-gnome/src/sflnotify.c:75 #, c-format msgid "<i>From:</i> %s" msgstr "<i>撥入方:</i> %s" -#: ../../sflphone-client-gnome/src/sflnotify.c:57 -msgid "Accept" -msgstr "接受" - -#: ../../sflphone-client-gnome/src/sflnotify.c:58 -msgid "Refuse" -msgstr "拒絕" - -#: ../../sflphone-client-gnome/src/sflnotify.c:59 -#: ../../sflphone-client-gnome/src/sflnotify.c:122 -#: ../../sflphone-client-gnome/src/sflnotify.c:159 -msgid "Ignore" -msgstr "忽略" - -#: ../../sflphone-client-gnome/src/sflnotify.c:141 +#: ../../sflphone-client-gnome/src/sflnotify.c:111 #, c-format msgid "Calling with %s account <i>%s</i>" msgstr "使用%s帳戶<i>%s</i>呼叫" -#: ../../sflphone-client-gnome/src/sflnotify.c:145 +#: ../../sflphone-client-gnome/src/sflnotify.c:115 msgid "Current account" msgstr "當前帳戶" -#: ../../sflphone-client-gnome/src/sflnotify.c:174 +#: ../../sflphone-client-gnome/src/sflnotify.c:130 msgid "You haven't setup any accounts" msgstr "你沒有設置任何帳戶" -#: ../../sflphone-client-gnome/src/sflnotify.c:214 +#: ../../sflphone-client-gnome/src/sflnotify.c:147 msgid "You have no registered accounts" msgstr "未發現已註冊帳戶" @@ -430,136 +417,128 @@ msgstr "顯示主窗口(S)" msgid "SFLphone - %i accounts configured" msgstr "SFLphone - %i 個帳戶已配置" -#: ../../sflphone-client-gnome/src/timestamp.c:46 -msgid "<small>Missed call</small>" -msgstr "<small>未接電話</small>" - -#: ../../sflphone-client-gnome/src/timestamp.c:64 -#, c-format -msgid "<small>Duration:</small> %s" -msgstr "<small>時長:</small> %s" - #: ../../sflphone-client-gnome/src/toolbar.c:50 #, c-format msgid "\"Voicemail\" <%s>" msgstr "\"語音郵件\" <%s>" -#: ../../sflphone-client-gnome/src/toolbar.c:176 -#: ../../sflphone-client-gnome/src/toolbar.c:178 +#: ../../sflphone-client-gnome/src/toolbar.c:168 +#: ../../sflphone-client-gnome/src/toolbar.c:170 msgid "Place a call" msgstr "打電話" -#: ../../sflphone-client-gnome/src/toolbar.c:185 -#: ../../sflphone-client-gnome/src/toolbar.c:187 +#: ../../sflphone-client-gnome/src/toolbar.c:177 +#: ../../sflphone-client-gnome/src/toolbar.c:179 msgid "Pick up" msgstr "接電話" -#: ../../sflphone-client-gnome/src/toolbar.c:195 -#: ../../sflphone-client-gnome/src/toolbar.c:197 +#: ../../sflphone-client-gnome/src/toolbar.c:187 +#: ../../sflphone-client-gnome/src/toolbar.c:189 msgid "Hang up" msgstr "放電話" -#: ../../sflphone-client-gnome/src/toolbar.c:205 -#: ../../sflphone-client-gnome/src/toolbar.c:207 +#: ../../sflphone-client-gnome/src/toolbar.c:197 +#: ../../sflphone-client-gnome/src/toolbar.c:199 msgid "Off Hold" msgstr "恢复通話" -#: ../../sflphone-client-gnome/src/toolbar.c:216 -#: ../../sflphone-client-gnome/src/toolbar.c:218 +#: ../../sflphone-client-gnome/src/toolbar.c:208 +#: ../../sflphone-client-gnome/src/toolbar.c:210 msgid "On Hold" msgstr "待机" -#: ../../sflphone-client-gnome/src/toolbar.c:229 -#: ../../sflphone-client-gnome/src/toolbar.c:231 +#: ../../sflphone-client-gnome/src/toolbar.c:221 +#: ../../sflphone-client-gnome/src/toolbar.c:223 msgid "Transfer" msgstr "轉接" -#: ../../sflphone-client-gnome/src/toolbar.c:241 -#: ../../sflphone-client-gnome/src/toolbar.c:243 +#: ../../sflphone-client-gnome/src/toolbar.c:233 +#: ../../sflphone-client-gnome/src/toolbar.c:235 msgid "History" msgstr "歷史" -#: ../../sflphone-client-gnome/src/toolbar.c:252 -#: ../../sflphone-client-gnome/src/toolbar.c:254 +#: ../../sflphone-client-gnome/src/toolbar.c:244 +#: ../../sflphone-client-gnome/src/toolbar.c:246 msgid "Address book" msgstr "地址簿" -#: ../../sflphone-client-gnome/src/toolbar.c:260 -#: ../../sflphone-client-gnome/src/toolbar.c:264 +#: ../../sflphone-client-gnome/src/toolbar.c:252 +#: ../../sflphone-client-gnome/src/toolbar.c:256 msgid "Voicemail" msgstr "語音郵件" -#: ../../sflphone-client-gnome/src/toolbar.c:272 +#: ../../sflphone-client-gnome/src/toolbar.c:264 msgid "Record a call" msgstr "記錄通話" -#: ../../sflphone-client-gnome/src/config/accountwindow.c:108 +#: ../../sflphone-client-gnome/src/config/accountwindow.c:113 msgid "Account settings" msgstr "帳戶設置" -#: ../../sflphone-client-gnome/src/config/accountwindow.c:120 +#: ../../sflphone-client-gnome/src/config/accountwindow.c:125 msgid "Account Parameters" msgstr "帳戶相關參數" -#: ../../sflphone-client-gnome/src/config/accountwindow.c:142 +#: ../../sflphone-client-gnome/src/config/accountwindow.c:147 msgid "_Enable this account" msgstr "啟用該賬戶(E)" -#: ../../sflphone-client-gnome/src/config/accountwindow.c:156 +#: ../../sflphone-client-gnome/src/config/accountwindow.c:161 msgid "_Protocol" msgstr "協議(P)" -#: ../../sflphone-client-gnome/src/config/accountwindow.c:174 +#: ../../sflphone-client-gnome/src/config/accountwindow.c:179 msgid "Unknown" msgstr "未知" -#: ../../sflphone-client-gnome/src/config/addressbook-config.c:265 -#: ../../sflphone-client-gnome/src/config/configwindow.c:732 +#: ../../sflphone-client-gnome/src/config/addressbook-config.c:306 +#: ../../sflphone-client-gnome/src/config/configwindow.c:721 msgid "General" msgstr "常用配置" -#: ../../sflphone-client-gnome/src/config/addressbook-config.c:276 +#: ../../sflphone-client-gnome/src/config/addressbook-config.c:312 msgid "_Use Evolution address books" msgstr "使用Evolution地址薄(U)" -#: ../../sflphone-client-gnome/src/config/addressbook-config.c:283 +#: ../../sflphone-client-gnome/src/config/addressbook-config.c:319 msgid "Download limit:" msgstr "下載上限:" -#: ../../sflphone-client-gnome/src/config/addressbook-config.c:294 +#: ../../sflphone-client-gnome/src/config/addressbook-config.c:327 +msgid "cards" +msgstr "" + +#: ../../sflphone-client-gnome/src/config/addressbook-config.c:333 msgid "_Display contact photo if available" msgstr "如果可以則顯示聯繫人照片(D)" -#: ../../sflphone-client-gnome/src/config/addressbook-config.c:301 -msgid "Fields" -msgstr "字段" - -#: ../../sflphone-client-gnome/src/config/addressbook-config.c:311 -msgid "Use the following fields from Evolution's address books:" +#: ../../sflphone-client-gnome/src/config/addressbook-config.c:341 +#, fuzzy +msgid "Fields from Evolution's address books" msgstr "使用Evolution地址薄中的如下字段:" -#: ../../sflphone-client-gnome/src/config/addressbook-config.c:316 +#: ../../sflphone-client-gnome/src/config/addressbook-config.c:345 msgid "_Business phone" msgstr "商務電話(B)" -#: ../../sflphone-client-gnome/src/config/addressbook-config.c:321 +#: ../../sflphone-client-gnome/src/config/addressbook-config.c:351 msgid "_Home phone" msgstr "家庭電話(H)" -#: ../../sflphone-client-gnome/src/config/addressbook-config.c:326 +#: ../../sflphone-client-gnome/src/config/addressbook-config.c:357 msgid "_Mobile phone" msgstr "移動電話(M)" -#: ../../sflphone-client-gnome/src/config/addressbook-config.c:333 +#: ../../sflphone-client-gnome/src/config/addressbook-config.c:364 msgid "Address Books" msgstr "地址簿" -#: ../../sflphone-client-gnome/src/config/addressbook-config.c:343 +#: ../../sflphone-client-gnome/src/config/addressbook-config.c:368 msgid "Select which Evolution address books to use:" msgstr "選擇使用如下Evolution地址薄:" -#: ../../sflphone-client-gnome/src/config/addressbook-config.c:377 -#: ../../sflphone-client-gnome/src/config/audioconf.c:574 +#: ../../sflphone-client-gnome/src/config/addressbook-config.c:404 +#: ../../sflphone-client-gnome/src/config/audioconf.c:576 msgid "Name" msgstr "名稱" @@ -568,183 +547,191 @@ msgstr "名稱" msgid "audio device index for output = %d" msgstr "音訊設備輸出索引 = %d" -#: ../../sflphone-client-gnome/src/config/audioconf.c:579 +#: ../../sflphone-client-gnome/src/config/audioconf.c:581 msgid "Frequency" msgstr "顰律" -#: ../../sflphone-client-gnome/src/config/audioconf.c:584 +#: ../../sflphone-client-gnome/src/config/audioconf.c:586 msgid "Bitrate" msgstr "比率" -#: ../../sflphone-client-gnome/src/config/audioconf.c:589 +#: ../../sflphone-client-gnome/src/config/audioconf.c:591 msgid "Bandwidth" msgstr "顰寬" -#: ../../sflphone-client-gnome/src/config/audioconf.c:652 -msgid "Pulseaudio" -msgstr "Pulseaudio" - -#: ../../sflphone-client-gnome/src/config/audioconf.c:655 -msgid "ALSA" -msgstr "ALSA" - -#: ../../sflphone-client-gnome/src/config/audioconf.c:681 +#: ../../sflphone-client-gnome/src/config/audioconf.c:662 msgid "ALSA plugin" msgstr "ALSA插件" -#: ../../sflphone-client-gnome/src/config/audioconf.c:703 +#: ../../sflphone-client-gnome/src/config/audioconf.c:684 msgid "Output" msgstr "輸出" -#: ../../sflphone-client-gnome/src/config/audioconf.c:725 +#: ../../sflphone-client-gnome/src/config/audioconf.c:706 msgid "Input" msgstr "輸入" -#: ../../sflphone-client-gnome/src/config/audioconf.c:758 -msgid "_Enable ringtones" -msgstr "啟動鈴聲(E)" - -#: ../../sflphone-client-gnome/src/config/audioconf.c:764 -msgid "Choose a ringtone" -msgstr "鈴聲選擇" - -#: ../../sflphone-client-gnome/src/config/audioconf.c:769 -msgid "Audio Files" -msgstr "音訊檔案" - -#: ../../sflphone-client-gnome/src/config/audioconf.c:788 +#: ../../sflphone-client-gnome/src/config/audioconf.c:741 msgid "_Voice Activity Detection" msgstr "聲音狀態檢測(V)" -#: ../../sflphone-client-gnome/src/config/audioconf.c:798 +#: ../../sflphone-client-gnome/src/config/audioconf.c:751 msgid "_Noise Reduction (Narrow-Band Companding)" msgstr "降噪處理-窄頻壓縮(N)" -#: ../../sflphone-client-gnome/src/config/audioconf.c:826 +#: ../../sflphone-client-gnome/src/config/audioconf.c:780 msgid "Sound Manager" msgstr "聲音管理器" -#: ../../sflphone-client-gnome/src/config/audioconf.c:833 +#: ../../sflphone-client-gnome/src/config/audioconf.c:783 +#, fuzzy +msgid "_Pulseaudio" +msgstr "Pulseaudio" + +#: ../../sflphone-client-gnome/src/config/audioconf.c:788 +#, fuzzy +msgid "_ALSA" +msgstr "ALSA" + +#: ../../sflphone-client-gnome/src/config/audioconf.c:795 msgid "ALSA configuration" msgstr "ALSA 配置" -#: ../../sflphone-client-gnome/src/config/audioconf.c:850 +#: ../../sflphone-client-gnome/src/config/audioconf.c:812 msgid "Codecs" msgstr "編碼" -#: ../../sflphone-client-gnome/src/config/audioconf.c:873 +#: ../../sflphone-client-gnome/src/config/audioconf.c:835 msgid "Ringtones" msgstr "鈴聲" -#: ../../sflphone-client-gnome/src/config/configwindow.c:402 +#: ../../sflphone-client-gnome/src/config/audioconf.c:841 +msgid "_Enable ringtones" +msgstr "啟動鈴聲(E)" + +#: ../../sflphone-client-gnome/src/config/audioconf.c:847 +msgid "Choose a ringtone" +msgstr "鈴聲選擇" + +#: ../../sflphone-client-gnome/src/config/audioconf.c:853 +msgid "Audio Files" +msgstr "音訊檔案" + +#: ../../sflphone-client-gnome/src/config/configwindow.c:418 msgid "Protocol" msgstr "協議" -#: ../../sflphone-client-gnome/src/config/configwindow.c:409 +#: ../../sflphone-client-gnome/src/config/configwindow.c:425 msgid "Status" msgstr "狀態" -#: ../../sflphone-client-gnome/src/config/configwindow.c:512 +#: ../../sflphone-client-gnome/src/config/configwindow.c:528 msgid "Stun parameters will apply to each SIP account created." msgstr "Stun參數將應用於每一個註冊的SIP帳戶" -#: ../../sflphone-client-gnome/src/config/configwindow.c:520 +#: ../../sflphone-client-gnome/src/config/configwindow.c:536 msgid "Enable it if you are behind a firewall" msgstr "當使用防火牆時,需要設定此項" -#: ../../sflphone-client-gnome/src/config/configwindow.c:528 +#: ../../sflphone-client-gnome/src/config/configwindow.c:544 msgid "Format: name.server:port" msgstr "格式:name.server:port" -#: ../../sflphone-client-gnome/src/config/configwindow.c:579 +#: ../../sflphone-client-gnome/src/config/configwindow.c:589 msgid "Desktop Notifications" msgstr "桌面提示" -#: ../../sflphone-client-gnome/src/config/configwindow.c:588 +#: ../../sflphone-client-gnome/src/config/configwindow.c:593 msgid "_Enable notifications" msgstr "啟動提示(E)" -#: ../../sflphone-client-gnome/src/config/configwindow.c:594 +#: ../../sflphone-client-gnome/src/config/configwindow.c:599 msgid "Enable voicemail _notifications" msgstr "啟用語音郵箱提示(n)" -#: ../../sflphone-client-gnome/src/config/configwindow.c:605 +#: ../../sflphone-client-gnome/src/config/configwindow.c:611 msgid "System Tray Icon" msgstr "系統托盤圖標" -#: ../../sflphone-client-gnome/src/config/configwindow.c:613 +#: ../../sflphone-client-gnome/src/config/configwindow.c:614 msgid "_Popup main window on incoming call" msgstr "來電話時彈出主視窗(P)" -#: ../../sflphone-client-gnome/src/config/configwindow.c:618 +#: ../../sflphone-client-gnome/src/config/configwindow.c:619 msgid "Ne_ver popup main window" msgstr "從不彈出主視窗(v)" -#: ../../sflphone-client-gnome/src/config/configwindow.c:622 +#: ../../sflphone-client-gnome/src/config/configwindow.c:623 msgid "Hide SFLphone window on _startup" msgstr "在啟動時隱藏SFLphone主窗口" -#: ../../sflphone-client-gnome/src/config/configwindow.c:628 +#: ../../sflphone-client-gnome/src/config/configwindow.c:629 msgid "Calls History" msgstr "打電話歷史" -#: ../../sflphone-client-gnome/src/config/configwindow.c:636 -msgid "_History size limit" -msgstr "歷史記錄上限(H)" +#: ../../sflphone-client-gnome/src/config/configwindow.c:632 +msgid "_Keep my history for at least" +msgstr "" + +#: ../../sflphone-client-gnome/src/config/configwindow.c:643 +msgid " days" +msgstr "" -#: ../../sflphone-client-gnome/src/config/configwindow.c:653 +#: ../../sflphone-client-gnome/src/config/configwindow.c:647 msgid "PulseAudio sound server" msgstr "PulseAudio聲音伺服器" -#: ../../sflphone-client-gnome/src/config/configwindow.c:661 -msgid "Mute other applications during a _call" +#: ../../sflphone-client-gnome/src/config/configwindow.c:650 +#, fuzzy +msgid "_Mute other applications during a call" msgstr "當有來電時靜音其它應用程序(c)" -#: ../../sflphone-client-gnome/src/config/configwindow.c:674 +#: ../../sflphone-client-gnome/src/config/configwindow.c:664 msgid "SIP Port" msgstr "SIP端口" -#: ../../sflphone-client-gnome/src/config/configwindow.c:687 +#: ../../sflphone-client-gnome/src/config/configwindow.c:677 msgid "Port:" msgstr "端口:" -#: ../../sflphone-client-gnome/src/config/configwindow.c:742 -msgid "_Recordings folder" +#: ../../sflphone-client-gnome/src/config/configwindow.c:725 +#, fuzzy +msgid "Recordings folder" msgstr "記錄文件夾(R)" -#: ../../sflphone-client-gnome/src/config/configwindow.c:748 +#: ../../sflphone-client-gnome/src/config/configwindow.c:731 msgid "Select a folder" msgstr "選擇文件夾" -#: ../../sflphone-client-gnome/src/config/configwindow.c:773 +#: ../../sflphone-client-gnome/src/config/configwindow.c:765 msgid "Preferences" msgstr "屬性" -#: ../../sflphone-client-gnome/src/config/configwindow.c:793 +#: ../../sflphone-client-gnome/src/config/configwindow.c:785 msgid "General Settings" msgstr "常用配置" -#: ../../sflphone-client-gnome/src/config/configwindow.c:798 +#: ../../sflphone-client-gnome/src/config/configwindow.c:790 msgid "Audio Settings" msgstr "音訊配置" -#: ../../sflphone-client-gnome/src/config/configwindow.c:803 +#: ../../sflphone-client-gnome/src/config/configwindow.c:795 msgid "Recordings" msgstr "記錄" -#: ../../sflphone-client-gnome/src/config/configwindow.c:808 +#: ../../sflphone-client-gnome/src/config/configwindow.c:800 msgid "Address Book" msgstr "地址簿" -#: ../../sflphone-client-gnome/src/config/configwindow.c:813 +#: ../../sflphone-client-gnome/src/config/configwindow.c:805 msgid "Hooks" msgstr "鉤鍵" -#: ../../sflphone-client-gnome/src/config/configwindow.c:840 +#: ../../sflphone-client-gnome/src/config/configwindow.c:832 msgid "Accounts" msgstr "帳戶" -#: ../../sflphone-client-gnome/src/config/configwindow.c:852 +#: ../../sflphone-client-gnome/src/config/configwindow.c:844 msgid "Configured Accounts" msgstr "已配置帳戶" @@ -752,45 +739,94 @@ msgstr "已配置帳戶" msgid "URL Passing" msgstr "傳輸URL" -#: ../../sflphone-client-gnome/src/config/hooks-config.c:140 +#: ../../sflphone-client-gnome/src/config/hooks-config.c:135 +msgid "Custom commands on incoming calls with URL," +msgstr "" + +#: ../../sflphone-client-gnome/src/config/hooks-config.c:138 #, c-format -msgid "" -"SFLphone can run custom commands if incoming calls come with an URL " -"attached.\n" -"In this case, %s will be replaced with the passed URL." +msgid "%s will be replaced with the passed URL." msgstr "" -"當來電有附加的URL時,SFLphone可運行客戶命令.\n" -"在此情況下,傳輸的URL會被替換成%s." -#: ../../sflphone-client-gnome/src/config/hooks-config.c:143 +#: ../../sflphone-client-gnome/src/config/hooks-config.c:141 msgid "Trigger on specific _SIP header" msgstr "激活指定的SIP頭(S)" -#: ../../sflphone-client-gnome/src/config/hooks-config.c:155 +#: ../../sflphone-client-gnome/src/config/hooks-config.c:150 msgid "Trigger on _IAX2 URL" msgstr "激活IAX2 URL(I)" -#: ../../sflphone-client-gnome/src/config/hooks-config.c:160 -msgid "_Command to run: " +#: ../../sflphone-client-gnome/src/config/hooks-config.c:155 +#, fuzzy +msgid "Command to _run: " msgstr "運行命令(C):" -#: ../../sflphone-client-gnome/src/config/hooks-config.c:168 +#: ../../sflphone-client-gnome/src/config/hooks-config.c:165 msgid "Phone Number Rewriting" msgstr "重設電話號碼" -#: ../../sflphone-client-gnome/src/config/hooks-config.c:178 +#: ../../sflphone-client-gnome/src/config/hooks-config.c:169 msgid "_Prefix dialed numbers with:" msgstr "號碼前綴:" -#: ../../sflphone-client-gnome/src/contacts/history.c:83 -#: ../../sflphone-client-gnome/src/contacts/searchbar.c:123 -msgid "Search history" -msgstr "搜尋歷史記錄" +#: ../../sflphone-client-gnome/src/contacts/searchbar.c:55 +msgid "" +"Search all\n" +"Click here to change the search type" +msgstr "" + +#: ../../sflphone-client-gnome/src/contacts/searchbar.c:67 +msgid "" +"Search by missed call\n" +"Click here to change the search type" +msgstr "" + +#: ../../sflphone-client-gnome/src/contacts/searchbar.c:79 +msgid "" +"Search by incoming call\n" +"Click here to change the search type" +msgstr "" + +#: ../../sflphone-client-gnome/src/contacts/searchbar.c:91 +msgid "" +"Search by outgoing call\n" +"Click here to change the search type" +msgstr "" + +#~ msgid "Accept" +#~ msgstr "接受" + +#~ msgid "Refuse" +#~ msgstr "拒絕" + +#~ msgid "Ignore" +#~ msgstr "忽略" + +#~ msgid "<small>Missed call</small>" +#~ msgstr "<small>未接電話</small>" + +#~ msgid "<small>Duration:</small> %s" +#~ msgstr "<small>時長:</small> %s" + +#~ msgid "Fields" +#~ msgstr "字段" + +#~ msgid "_History size limit" +#~ msgstr "歷史記錄上限(H)" + +#~ msgid "" +#~ "SFLphone can run custom commands if incoming calls come with an URL " +#~ "attached.\n" +#~ "In this case, %s will be replaced with the passed URL." +#~ msgstr "" +#~ "當來電有附加的URL時,SFLphone可運行客戶命令.\n" +#~ "在此情況下,傳輸的URL會被替換成%s." + +#~ msgid "Search history" +#~ msgstr "搜尋歷史記錄" -#: ../../sflphone-client-gnome/src/contacts/history.c:83 -#: ../../sflphone-client-gnome/src/contacts/searchbar.c:110 -msgid "Search contact" -msgstr "搜尋聯繫人(S)" +#~ msgid "Search contact" +#~ msgstr "搜尋聯繫人(S)" #~ msgid "Registered to %s (%s)" #~ msgstr "註冊到 %s (%s)" diff --git a/sflphone-common/src/Makefile.am b/sflphone-common/src/Makefile.am index c3037e3293409b4897d88384f4e51b74ddefe8b3..74cb553b3ece79c0fe0391dbafd697eec87af4c5 100644 --- a/sflphone-common/src/Makefile.am +++ b/sflphone-common/src/Makefile.am @@ -1,6 +1,8 @@ include ../globals.mak -bin_PROGRAMS = sflphoned +libexecdir=$(libdir)/sflphone +libexec_PROGRAMS = sflphoned + if USE_IAX # Use the global instead of locally built @@ -13,7 +15,7 @@ IAXSOURCES = IAXHEADERS = endif -SUBDIRS = dbus audio config plug-in hooks +SUBDIRS = dbus audio config plug-in hooks history # Add here the cpp files to be build with sflphone sflphoned_SOURCES = \ @@ -84,6 +86,7 @@ libsflphone_la_LIBADD = \ ./config/libconfig.la \ ./plug-in/libplugin.la \ ./plug-in/audiorecorder/libaudiorecorder.la \ - ./hooks/libhooks.la + ./hooks/libhooks.la \ + ./history/libhistory.la libsflphone_la_SOURCES = diff --git a/sflphone-common/src/account.cpp b/sflphone-common/src/account.cpp index efadf2e6da0df636531d493217767e40ff349b10..e22cf874d059f8641fa5341b8ea618eea4a1feba 100644 --- a/sflphone-common/src/account.cpp +++ b/sflphone-common/src/account.cpp @@ -22,10 +22,10 @@ #include "account.h" #include "manager.h" -Account::Account(const AccountID& accountID, std::string type) : - _accountID(accountID), _link(NULL), _enabled(false), _type(type) +Account::Account (const AccountID& accountID, std::string type) : + _accountID (accountID), _link (NULL), _enabled (false), _type (type) { - setRegistrationState(Unregistered); + setRegistrationState (Unregistered); } Account::~Account() @@ -36,23 +36,27 @@ void Account::loadConfig() { std::string p; - p = Manager::instance().getConfigString( _accountID , CONFIG_ACCOUNT_TYPE ); -#ifdef USE_IAX - _enabled = Manager::instance().getConfigInt(_accountID, CONFIG_ACCOUNT_ENABLE) ? true : false; + p = Manager::instance().getConfigString (_accountID , CONFIG_ACCOUNT_TYPE); +#ifdef USE_IAX + _enabled = Manager::instance().getConfigInt (_accountID, CONFIG_ACCOUNT_ENABLE) ? true : false; #else - if( p.c_str() == "IAX" ) + + if (p.c_str() == "IAX") _enabled = false; else - _enabled = Manager::instance().getConfigInt(_accountID, CONFIG_ACCOUNT_ENABLE) ? true : false; + _enabled = Manager::instance().getConfigInt (_accountID, CONFIG_ACCOUNT_ENABLE) ? true : false; + #endif } -void Account::setRegistrationState( RegistrationState state ) { - +void Account::setRegistrationState (RegistrationState state) +{ + if (state != _registrationState) { - _registrationState = state; + _debug ("Account::setRegistrationState\n"); + _registrationState = state; - // Notify the client - Manager::instance().connectionStatusNotification( ); + // Notify the client + Manager::instance().connectionStatusNotification(); } } diff --git a/sflphone-common/src/accountcreator.cpp b/sflphone-common/src/accountcreator.cpp index c196597e78018463243d8ae0ba14dec00d49404b..e3b5855f20a90b6003146fcdf6db92b4ff81bbbc 100644 --- a/sflphone-common/src/accountcreator.cpp +++ b/sflphone-common/src/accountcreator.cpp @@ -2,17 +2,17 @@ * Copyright (C) 2006-2007 Savoir-Faire Linux inc. * Author: Alexandre Bourget <alexandre.bourget@savoirfairelinux.com> * Author: Yan Morin <yan.morin@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 * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. @@ -32,19 +32,22 @@ AccountCreator::~AccountCreator() { } -Account* -AccountCreator::createAccount(AccountType type, AccountID accountID) +Account* +AccountCreator::createAccount (AccountType type, AccountID accountID) { - switch(type) { - case SIP_ACCOUNT: - return new SIPAccount(accountID); - break; + switch (type) { + + case SIP_ACCOUNT: + return new SIPAccount (accountID); + break; #ifdef USE_IAX - case IAX_ACCOUNT: - return new IAXAccount(accountID); - break; + + case IAX_ACCOUNT: + return new IAXAccount (accountID); + break; #endif - } - return 0; + } + + return 0; } diff --git a/sflphone-common/src/audio/alsalayer.cpp b/sflphone-common/src/audio/alsalayer.cpp index 2a3939bfc37fd012bb27fb36ef56b3ba9a705786..55ed04817f412ae44d50e4fe81d6fddc3921942a 100644 --- a/sflphone-common/src/audio/alsalayer.cpp +++ b/sflphone-common/src/audio/alsalayer.cpp @@ -22,107 +22,114 @@ int framesPerBufferAlsa = 2048; // Constructor - AlsaLayer::AlsaLayer( ManagerImpl* manager ) - : AudioLayer( manager , ALSA ) - , _PlaybackHandle(NULL) - , _CaptureHandle(NULL) - , _periodSize() - , _audioPlugin() - , IDSoundCards() - , _is_prepared_playback (false) - , _is_running_playback (false) - , _is_open_playback (false) - , _is_prepared_capture (false) - , _is_running_capture (false) - , _is_open_capture (false) - , _trigger_request (false) - +AlsaLayer::AlsaLayer (ManagerImpl* manager) + : AudioLayer (manager , ALSA) + , _PlaybackHandle (NULL) + , _CaptureHandle (NULL) + , _periodSize() + , _audioPlugin() + , IDSoundCards() + , _is_prepared_playback (false) + , _is_running_playback (false) + , _is_open_playback (false) + , _is_prepared_capture (false) + , _is_running_capture (false) + , _is_open_capture (false) + , _trigger_request (false) + { - _debug(" Constructor of AlsaLayer called\n"); + _debug (" Constructor of AlsaLayer called\n"); /* Instanciate the audio thread */ _audioThread = new AudioThread (this); } // Destructor -AlsaLayer::~AlsaLayer (void) -{ - _debug("Destructor of AlsaLayer called\n"); +AlsaLayer::~AlsaLayer (void) +{ + _debug ("Destructor of AlsaLayer called\n"); closeLayer(); } bool AlsaLayer::closeLayer() { - _debugAlsa("Close ALSA streams\n"); - + _debugAlsa ("Close ALSA streams\n"); + try { - /* Stop the audio thread first */ - if (_audioThread) - { - delete _audioThread; _audioThread=NULL; + /* Stop the audio thread first */ + if (_audioThread) { + delete _audioThread; + _audioThread=NULL; } - } - catch(...) { - _debugException("! ARTP Exception: when stopping audiortp\n"); + } catch (...) { + _debugException ("! ARTP Exception: when stopping audiortp\n"); throw; } - + /* Then close the audio devices */ closeCaptureStream(); + closePlaybackStream(); - + _CaptureHandle = 0; + _PlaybackHandle = 0; return true; } - bool -AlsaLayer::openDevice (int indexIn, int indexOut, int sampleRate, int frameSize, int stream , std::string plugin) +bool +AlsaLayer::openDevice (int indexIn, int indexOut, int sampleRate, int frameSize, int stream , std::string plugin) { - /* Close the devices before open it */ - if (stream == SFL_PCM_BOTH && is_capture_open() == true && is_playback_open() == true) - { + /* Close the devices before open it */ + if (stream == SFL_PCM_BOTH && is_capture_open() == true && is_playback_open() == true) { closeCaptureStream(); closePlaybackStream(); - } - else if ((stream == SFL_PCM_CAPTURE || stream == SFL_PCM_BOTH) && is_capture_open() == true) + } else if ( (stream == SFL_PCM_CAPTURE || stream == SFL_PCM_BOTH) && is_capture_open() == true) closeCaptureStream (); - else if ((stream == SFL_PCM_PLAYBACK || stream == SFL_PCM_BOTH) && is_playback_open () == true) + else if ( (stream == SFL_PCM_PLAYBACK || stream == SFL_PCM_BOTH) && is_playback_open () == true) closePlaybackStream (); _indexIn = indexIn; + _indexOut = indexOut; + _sampleRate = sampleRate; - _frameSize = frameSize; + + _frameSize = frameSize; + _audioPlugin = plugin; - _debugAlsa(" Setting AlsaLayer: device in=%2d, out=%2d\n", _indexIn, _indexOut); - _debugAlsa(" : alsa plugin=%s\n", _audioPlugin.c_str()); - _debugAlsa(" : nb channel in=%2d, out=%2d\n", _inChannel, _outChannel); - _debugAlsa(" : sample rate=%5d, format=%s\n", _sampleRate, SFLDataFormatString); + _debugAlsa (" Setting AlsaLayer: device in=%2d, out=%2d\n", _indexIn, _indexOut); - ost::MutexLock lock( _mutex ); - - std::string pcmp = buildDeviceTopo( plugin , indexOut , 0); - std::string pcmc = buildDeviceTopo( PCM_PLUGHW , indexIn , 0); + _debugAlsa (" : alsa plugin=%s\n", _audioPlugin.c_str()); - return open_device( pcmp , pcmc , stream); + _debugAlsa (" : nb channel in=%2d, out=%2d\n", _inChannel, _outChannel); + + _debugAlsa (" : sample rate=%5d, format=%s\n", _sampleRate, SFLDataFormatString); + + ost::MutexLock lock (_mutex); + + std::string pcmp = buildDeviceTopo (plugin , indexOut , 0); + + std::string pcmc = buildDeviceTopo (PCM_PLUGHW , indexIn , 0); + + return open_device (pcmp , pcmc , stream); } - void -AlsaLayer::startStream(void) +void +AlsaLayer::startStream (void) { _debug ("Start ALSA streams\n"); prepareCaptureStream (); startCaptureStream (); startPlaybackStream (); -} +} - void -AlsaLayer::stopStream(void) +void +AlsaLayer::stopStream (void) { _debug ("AlsaLayer::stopStream :: Stop ALSA streams\n"); stopCaptureStream (); @@ -134,9 +141,9 @@ AlsaLayer::stopStream(void) flushMic (); } - int +int AlsaLayer::canGetMic() -{ +{ int avail; if (!_CaptureHandle) @@ -144,44 +151,45 @@ AlsaLayer::canGetMic() avail = snd_pcm_avail_update (_CaptureHandle); - if (avail == -EPIPE) - { + if (avail == -EPIPE) { stop_capture (); return 0; - } - else - return ((avail<0)?0:avail); + } else + return ( (avail<0) ?0:avail); /* - if(_CaptureHandle) + if(_CaptureHandle) return _micRingBuffer.AvailForGet(); else return 0;*/ } - int -AlsaLayer::getMic(void *buffer, int toCopy) +int +AlsaLayer::getMic (void *buffer, int toCopy) { /* if( _CaptureHandle ){ return _micRingBuffer.Get(buffer, toCopy,100); - } + } else return 0;*/ - int res = 0; - if( _CaptureHandle ) - { - res = read( buffer, toCopy); - adjustVolume (buffer, toCopy, SFL_PCM_CAPTURE); - } - return res; + int res = 0; + + if (_CaptureHandle) { + res = read (buffer, toCopy); + adjustVolume (buffer, toCopy, SFL_PCM_CAPTURE); + } + + return res; } -bool AlsaLayer::isCaptureActive(void) { - ost::MutexLock guard( _mutex ); - if( _CaptureHandle ) - return (snd_pcm_state( _CaptureHandle) == SND_PCM_STATE_RUNNING ? true : false); +bool AlsaLayer::isCaptureActive (void) +{ + ost::MutexLock guard (_mutex); + + if (_CaptureHandle) + return (snd_pcm_state (_CaptureHandle) == SND_PCM_STATE_RUNNING ? true : false); else return false; } @@ -189,12 +197,12 @@ bool AlsaLayer::isCaptureActive(void) { ////////////////////////////////////////////////////////////////////////////////////////////// ///////////////// ALSA PRIVATE FUNCTIONS //////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////// - + void AlsaLayer::stopCaptureStream (void) { - int err; + int err; - if(_CaptureHandle){ + if (_CaptureHandle) { err = snd_pcm_drop (_CaptureHandle); stop_capture (); @@ -204,8 +212,9 @@ void AlsaLayer::stopCaptureStream (void) void AlsaLayer::closeCaptureStream (void) { - if( is_capture_prepared() == true && is_capture_running() == true ) + if (is_capture_prepared() == true && is_capture_running() == true) stopCaptureStream (); + if (is_capture_open()) snd_pcm_close (_CaptureHandle); @@ -214,8 +223,8 @@ void AlsaLayer::closeCaptureStream (void) void AlsaLayer::startCaptureStream (void) { - if(_CaptureHandle){ - _debug("Start the capture\n"); + if (_CaptureHandle) { + _debug ("Start the capture\n"); snd_pcm_start (_CaptureHandle); start_capture(); } @@ -223,9 +232,9 @@ void AlsaLayer::startCaptureStream (void) void AlsaLayer::prepareCaptureStream (void) { - if (is_capture_open() ) { - if(snd_pcm_prepare (_CaptureHandle) < 0) - _debug(""); + if (is_capture_open()) { + if (snd_pcm_prepare (_CaptureHandle) < 0) + _debug (""); else prepare_capture (); } @@ -233,7 +242,7 @@ void AlsaLayer::prepareCaptureStream (void) void AlsaLayer::stopPlaybackStream (void) { - if( _PlaybackHandle){ + if (_PlaybackHandle) { snd_pcm_drop (_PlaybackHandle); stop_playback (); } @@ -242,9 +251,10 @@ void AlsaLayer::stopPlaybackStream (void) void AlsaLayer::closePlaybackStream (void) { - if( is_playback_prepared() == true && is_playback_running() == true ) + if (is_playback_prepared() == true && is_playback_running() == true) stopPlaybackStream (); - if (is_playback_open()) + + if (is_playback_open()) snd_pcm_close (_PlaybackHandle); close_playback (); @@ -252,7 +262,7 @@ void AlsaLayer::closePlaybackStream (void) void AlsaLayer::startPlaybackStream (void) { - if( _PlaybackHandle){ + if (_PlaybackHandle) { snd_pcm_start (_PlaybackHandle); start_playback(); } @@ -260,13 +270,15 @@ void AlsaLayer::startPlaybackStream (void) void AlsaLayer::preparePlaybackStream (void) { - if(is_playback_open()){ - if( snd_pcm_prepare (_PlaybackHandle) < 0) _debug("Error preparing the device\n"); + if (is_playback_open()) { + if (snd_pcm_prepare (_PlaybackHandle) < 0) _debug ("Error preparing the device\n"); + prepare_playback (); } } -bool AlsaLayer::alsa_set_params( snd_pcm_t *pcm_handle, int type, int rate ){ +bool AlsaLayer::alsa_set_params (snd_pcm_t *pcm_handle, int type, int rate) +{ snd_pcm_hw_params_t *hwparams = NULL; snd_pcm_sw_params_t *swparams = NULL; @@ -279,116 +291,133 @@ bool AlsaLayer::alsa_set_params( snd_pcm_t *pcm_handle, int type, int rate ){ int periodsize = 1024; /* Allocate the snd_pcm_hw_params_t struct */ - snd_pcm_hw_params_malloc( &hwparams ); + snd_pcm_hw_params_malloc (&hwparams); _periodSize = 940; /* Full configuration space */ - if( (err = snd_pcm_hw_params_any(pcm_handle, hwparams)) < 0) { - _debugAlsa(" Cannot initialize hardware parameter structure (%s)\n", snd_strerror(err)); + + if ( (err = snd_pcm_hw_params_any (pcm_handle, hwparams)) < 0) { + _debugAlsa (" Cannot initialize hardware parameter structure (%s)\n", snd_strerror (err)); return false; } - if( (err = snd_pcm_hw_params_set_access( pcm_handle, hwparams, SND_PCM_ACCESS_RW_INTERLEAVED)) < 0) { - _debugAlsa(" Cannot set access type (%s)\n", snd_strerror(err)); + if ( (err = snd_pcm_hw_params_set_access (pcm_handle, hwparams, SND_PCM_ACCESS_RW_INTERLEAVED)) < 0) { + _debugAlsa (" Cannot set access type (%s)\n", snd_strerror (err)); return false; } /* Set sample format */ format = SND_PCM_FORMAT_S16_LE; - if( (err = snd_pcm_hw_params_set_format( pcm_handle, hwparams, (snd_pcm_format_t)format)) < 0) { - _debugAlsa(" Cannot set sample format (%s)\n", snd_strerror(err)); + + if ( (err = snd_pcm_hw_params_set_format (pcm_handle, hwparams, (snd_pcm_format_t) format)) < 0) { + _debugAlsa (" Cannot set sample format (%s)\n", snd_strerror (err)); return false; } - + /* Set sample rate. If we can't set to the desired exact value, we set to the nearest acceptable */ dir=0; + rate = getSampleRate(); + exact_ivalue = rate; - if( (err = snd_pcm_hw_params_set_rate_near( pcm_handle, hwparams, &exact_ivalue, &dir) < 0)) { - _debugAlsa(" Cannot set sample rate (%s)\n", snd_strerror(err)); + + if ( (err = snd_pcm_hw_params_set_rate_near (pcm_handle, hwparams, &exact_ivalue, &dir) < 0)) { + _debugAlsa (" Cannot set sample rate (%s)\n", snd_strerror (err)); return false; } - if( dir!= 0 ){ - _debugAlsa(" (%i) The choosen rate %d Hz is not supported by your hardware.\nUsing %d Hz instead.\n ",type ,rate, exact_ivalue); + + if (dir!= 0) { + _debugAlsa (" (%i) The choosen rate %d Hz is not supported by your hardware.\nUsing %d Hz instead.\n ",type ,rate, exact_ivalue); } /* Set the number of channels */ - if( (err = snd_pcm_hw_params_set_channels( pcm_handle, hwparams, 1)) < 0){ - _debugAlsa(" Cannot set channel count (%s)\n", snd_strerror(err)); + if ( (err = snd_pcm_hw_params_set_channels (pcm_handle, hwparams, 1)) < 0) { + _debugAlsa (" Cannot set channel count (%s)\n", snd_strerror (err)); return false; } /* Set the buffer size in frames */ exact_lvalue = periodsize; + dir=0; - if( (err = snd_pcm_hw_params_set_period_size_near( pcm_handle, hwparams, &exact_lvalue , &dir)) < 0) { - _debugAlsa(" Cannot set period time (%s)\n", snd_strerror(err)); + + if ( (err = snd_pcm_hw_params_set_period_size_near (pcm_handle, hwparams, &exact_lvalue , &dir)) < 0) { + _debugAlsa (" Cannot set period time (%s)\n", snd_strerror (err)); return false; } - if(dir!=0) { - _debugAlsa("(%i) The choosen period size %d bytes is not supported by your hardware.\nUsing %d instead.\n ", type, (int)periodsize, (int)exact_lvalue); + + if (dir!=0) { + _debugAlsa ("(%i) The choosen period size %d bytes is not supported by your hardware.\nUsing %d instead.\n ", type, (int) periodsize, (int) exact_lvalue); } + periodsize = exact_lvalue; + _periodSize = exact_lvalue; /* Set the number of fragments */ exact_ivalue = periods; dir=0; - if( (err = snd_pcm_hw_params_set_periods_near( pcm_handle, hwparams, &exact_ivalue, &dir)) < 0) { - _debugAlsa(" Cannot set periods number (%s)\n", snd_strerror(err)); + + if ( (err = snd_pcm_hw_params_set_periods_near (pcm_handle, hwparams, &exact_ivalue, &dir)) < 0) { + _debugAlsa (" Cannot set periods number (%s)\n", snd_strerror (err)); return false; } - if(dir!=0) { - _debugAlsa(" The choosen period number %i bytes is not supported by your hardware.\nUsing %i instead.\n ", periods, exact_ivalue); + + if (dir!=0) { + _debugAlsa (" The choosen period number %i bytes is not supported by your hardware.\nUsing %i instead.\n ", periods, exact_ivalue); } + periods=exact_ivalue; /* Set the hw parameters */ - if( (err = snd_pcm_hw_params( pcm_handle, hwparams )) < 0) { - _debugAlsa(" Cannot set hw parameters (%s)\n", snd_strerror(err)); + + if ( (err = snd_pcm_hw_params (pcm_handle, hwparams)) < 0) { + _debugAlsa (" Cannot set hw parameters (%s)\n", snd_strerror (err)); return false; } - snd_pcm_hw_params_free( hwparams ); + snd_pcm_hw_params_free (hwparams); /* Set the sw parameters */ - snd_pcm_sw_params_malloc( &swparams ); - snd_pcm_sw_params_current( pcm_handle, swparams ); + snd_pcm_sw_params_malloc (&swparams); + snd_pcm_sw_params_current (pcm_handle, swparams); /* Set the start threshold */ - if( (err = snd_pcm_sw_params_set_start_threshold( pcm_handle, swparams, 2700 /*periodsize*2*/ )) < 0 ) { - _debugAlsa(" Cannot set start threshold (%s)\n", snd_strerror(err)); + + if ( (err = snd_pcm_sw_params_set_start_threshold (pcm_handle, swparams, 2700 /*periodsize*2*/)) < 0) { + _debugAlsa (" Cannot set start threshold (%s)\n", snd_strerror (err)); return false; } - if( (err = snd_pcm_sw_params( pcm_handle, swparams)) < 0 ) { - _debugAlsa(" Cannot set sw parameters (%s)\n", snd_strerror(err)); + + if ( (err = snd_pcm_sw_params (pcm_handle, swparams)) < 0) { + _debugAlsa (" Cannot set sw parameters (%s)\n", snd_strerror (err)); return false; } - snd_pcm_sw_params_free( swparams ); + snd_pcm_sw_params_free (swparams); return true; } - bool -AlsaLayer::open_device(std::string pcm_p, std::string pcm_c, int flag) +bool +AlsaLayer::open_device (std::string pcm_p, std::string pcm_c, int flag) { int err; - - if(flag == SFL_PCM_BOTH || flag == SFL_PCM_PLAYBACK) - { - // if((err = snd_pcm_open(&_PlaybackHandle, pcm_p.c_str(), SND_PCM_STREAM_PLAYBACK, 0 )) < 0){ - if((err = snd_pcm_open(&_PlaybackHandle, pcm_p.c_str(), SND_PCM_STREAM_PLAYBACK, 0 )) < 0){ - _debugAlsa("Error while opening playback device %s\n", pcm_p.c_str()); - setErrorMessage( ALSA_PLAYBACK_DEVICE ); + + if (flag == SFL_PCM_BOTH || flag == SFL_PCM_PLAYBACK) { + // if((err = snd_pcm_open(&_PlaybackHandle, pcm_p.c_str(), SND_PCM_STREAM_PLAYBACK, 0 )) < 0){ + if ( (err = snd_pcm_open (&_PlaybackHandle, pcm_p.c_str(), SND_PCM_STREAM_PLAYBACK, 0)) < 0) { + _debugAlsa ("Error while opening playback device %s\n", pcm_p.c_str()); + setErrorMessage (ALSA_PLAYBACK_DEVICE); close_playback (); return false; } - if(!alsa_set_params( _PlaybackHandle, 1, getSampleRate() )){ - _debug("playback failed\n"); - snd_pcm_close( _PlaybackHandle ); + + if (!alsa_set_params (_PlaybackHandle, 1, getSampleRate())) { + _debug ("playback failed\n"); + snd_pcm_close (_PlaybackHandle); close_playback (); return false; } @@ -396,104 +425,117 @@ AlsaLayer::open_device(std::string pcm_p, std::string pcm_c, int flag) open_playback (); } - if(flag == SFL_PCM_BOTH || flag == SFL_PCM_CAPTURE) - { - if( (err = snd_pcm_open(&_CaptureHandle, pcm_c.c_str(), SND_PCM_STREAM_CAPTURE, 0)) < 0){ - _debugAlsa("Error while opening capture device %s\n", pcm_c.c_str()); - setErrorMessage( ALSA_CAPTURE_DEVICE ); + if (flag == SFL_PCM_BOTH || flag == SFL_PCM_CAPTURE) { + if ( (err = snd_pcm_open (&_CaptureHandle, pcm_c.c_str(), SND_PCM_STREAM_CAPTURE, 0)) < 0) { + _debugAlsa ("Error while opening capture device %s\n", pcm_c.c_str()); + setErrorMessage (ALSA_CAPTURE_DEVICE); close_capture (); return false; } - if(!alsa_set_params( _CaptureHandle, 0, 8000 )){ - _debug("capture failed\n"); - snd_pcm_close( _CaptureHandle ); + + if (!alsa_set_params (_CaptureHandle, 0, 8000)) { + _debug ("capture failed\n"); + snd_pcm_close (_CaptureHandle); close_capture (); return false; } open_capture (); + prepare_capture (); } /* Start the secondary audio thread for callbacks */ - try{ + try { _audioThread->start(); - } - catch (...) { - _debugException("Fail to start audio thread\n"); + } catch (...) { + _debugException ("Fail to start audio thread\n"); } return true; } //TODO first frame causes broken pipe (underrun) because not enough data are send --> make the handle wait to be ready - int -AlsaLayer::write(void* buffer, int length) +int +AlsaLayer::write (void* buffer, int length) { - if (_trigger_request == true) - { + if (_trigger_request == true) { _trigger_request = false; startPlaybackStream (); } - snd_pcm_uframes_t frames = snd_pcm_bytes_to_frames( _PlaybackHandle, length); + snd_pcm_uframes_t frames = snd_pcm_bytes_to_frames (_PlaybackHandle, length); + int err; - if ((err=snd_pcm_writei( _PlaybackHandle , buffer , frames ))<0) - { - switch(err) { - case -EPIPE: - case -ESTRPIPE: - case -EIO: + + if ( (err=snd_pcm_writei (_PlaybackHandle , buffer , frames)) <0) { + switch (err) { + + case -EPIPE: + + case -ESTRPIPE: + + case -EIO: //_debugAlsa(" XRUN playback ignored (%s)\n", snd_strerror(err)); handle_xrun_playback(); - if (snd_pcm_writei( _PlaybackHandle , buffer , frames )<0) + + if (snd_pcm_writei (_PlaybackHandle , buffer , frames) <0) _debugAlsa ("XRUN handling failed\n"); + _trigger_request = true; + break; + default: //_debugAlsa ("Write error unknown - dropping frames **********************************: %s\n", snd_strerror(err)); stopPlaybackStream (); + break; } } - return ( err > 0 )? err : 0 ; + return (err > 0) ? err : 0 ; } - int -AlsaLayer::read( void* buffer, int toCopy) +int +AlsaLayer::read (void* buffer, int toCopy) { //ost::MutexLock lock( _mutex ); - + int samples; - if(snd_pcm_state( _CaptureHandle ) == SND_PCM_STATE_XRUN) - { + if (snd_pcm_state (_CaptureHandle) == SND_PCM_STATE_XRUN) { prepareCaptureStream (); startCaptureStream (); } - - snd_pcm_uframes_t frames = snd_pcm_bytes_to_frames( _CaptureHandle, toCopy ); - if(( samples = snd_pcm_readi( _CaptureHandle, buffer, frames)) < 0 ) { - switch (samples) - { + + snd_pcm_uframes_t frames = snd_pcm_bytes_to_frames (_CaptureHandle, toCopy); + + if ( (samples = snd_pcm_readi (_CaptureHandle, buffer, frames)) < 0) { + switch (samples) { + case -EPIPE: + case -ESTRPIPE: + case -EIO: - _debugAlsa(" XRUN capture ignored (%s)\n", snd_strerror(samples)); + _debugAlsa (" XRUN capture ignored (%s)\n", snd_strerror (samples)); handle_xrun_capture(); //samples = snd_pcm_readi( _CaptureHandle, buffer, frames); //if (samples<0) samples=0; break; + case EPERM: - _debugAlsa(" Capture EPERM (%s)\n", snd_strerror(samples)); + _debugAlsa (" Capture EPERM (%s)\n", snd_strerror (samples)); prepareCaptureStream (); startCaptureStream (); break; + default: //_debugAlsa("%s\n", snd_strerror(samples)); break; } + return 0; } @@ -501,37 +543,36 @@ AlsaLayer::read( void* buffer, int toCopy) } - void -AlsaLayer::handle_xrun_capture( void ) +void +AlsaLayer::handle_xrun_capture (void) { snd_pcm_status_t* status; - snd_pcm_status_alloca( &status ); + snd_pcm_status_alloca (&status); - int res = snd_pcm_status( _CaptureHandle, status ); - if( res <= 0){ - if(snd_pcm_status_get_state(status) == SND_PCM_STATE_XRUN ){ + int res = snd_pcm_status (_CaptureHandle, status); + + if (res <= 0) { + if (snd_pcm_status_get_state (status) == SND_PCM_STATE_XRUN) { stopCaptureStream (); prepareCaptureStream (); startCaptureStream (); } - } - else - _debugAlsa(" Get status failed\n"); + } else + _debugAlsa (" Get status failed\n"); } - void -AlsaLayer::handle_xrun_playback( void ) +void +AlsaLayer::handle_xrun_playback (void) { - int state; + int state; snd_pcm_status_t* status; - snd_pcm_status_alloca( &status ); + snd_pcm_status_alloca (&status); - if( (state = snd_pcm_status( _PlaybackHandle, status )) < 0 ) _debugAlsa(" Error: Cannot get playback handle status (%s)\n" , snd_strerror( state ) ); - else - { - state = snd_pcm_status_get_state( status ); - if( state == SND_PCM_STATE_XRUN ) - { + if ( (state = snd_pcm_status (_PlaybackHandle, status)) < 0) _debugAlsa (" Error: Cannot get playback handle status (%s)\n" , snd_strerror (state)); + else { + state = snd_pcm_status_get_state (status); + + if (state == SND_PCM_STATE_XRUN) { stopPlaybackStream (); preparePlaybackStream (); _trigger_request = true; @@ -539,26 +580,32 @@ AlsaLayer::handle_xrun_playback( void ) } } - std::string -AlsaLayer::buildDeviceTopo( std::string plugin, int card, int subdevice ) +std::string +AlsaLayer::buildDeviceTopo (std::string plugin, int card, int subdevice) { std::string pcm = plugin; std::stringstream ss,ss1; - if( pcm == "default" || pcm == "pulse") + + if (pcm == "default" || pcm == "pulse") return pcm; + ss << card; - pcm.append(":"); - pcm.append(ss.str()); - if( subdevice != 0 ){ - pcm.append(","); + + pcm.append (":"); + + pcm.append (ss.str()); + + if (subdevice != 0) { + pcm.append (","); ss1 << subdevice; - pcm.append(ss1.str()); + pcm.append (ss1.str()); } + return pcm; } - std::vector<std::string> -AlsaLayer::getSoundCardsInfo( int stream ) +std::vector<std::string> +AlsaLayer::getSoundCardsInfo (int stream) { std::vector<std::string> cards_id; HwIDPair p; @@ -566,81 +613,88 @@ AlsaLayer::getSoundCardsInfo( int stream ) snd_ctl_t* handle; snd_ctl_card_info_t *info; snd_pcm_info_t* pcminfo; - snd_ctl_card_info_alloca( &info ); - snd_pcm_info_alloca( &pcminfo ); + snd_ctl_card_info_alloca (&info); + snd_pcm_info_alloca (&pcminfo); int numCard = -1 ; std::string description; - if(snd_card_next( &numCard ) < 0 || numCard < 0) + if (snd_card_next (&numCard) < 0 || numCard < 0) return cards_id; - while(numCard >= 0){ + while (numCard >= 0) { std::stringstream ss; ss << numCard; std::string name= "hw:"; - name.append(ss.str()); - - if( snd_ctl_open( &handle, name.c_str(), 0) == 0 ){ - if( snd_ctl_card_info( handle, info) == 0){ - snd_pcm_info_set_device( pcminfo , 0); - snd_pcm_info_set_stream( pcminfo, ( stream == SFL_PCM_CAPTURE )? SND_PCM_STREAM_CAPTURE : SND_PCM_STREAM_PLAYBACK ); - if( snd_ctl_pcm_info ( handle ,pcminfo ) < 0) _debugAlsa(" Cannot get info\n"); - else{ - _debugAlsa("card %i : %s [%s]\n", - numCard, - snd_ctl_card_info_get_id(info), - snd_ctl_card_info_get_name( info )); - description = snd_ctl_card_info_get_name( info ); - description.append(" - "); - description.append(snd_pcm_info_get_name( pcminfo )); - cards_id.push_back( description ); - // The number of the sound card is associated with a string description - p = HwIDPair( numCard , description ); - IDSoundCards.push_back( p ); + name.append (ss.str()); + + if (snd_ctl_open (&handle, name.c_str(), 0) == 0) { + if (snd_ctl_card_info (handle, info) == 0) { + snd_pcm_info_set_device (pcminfo , 0); + snd_pcm_info_set_stream (pcminfo, (stream == SFL_PCM_CAPTURE) ? SND_PCM_STREAM_CAPTURE : SND_PCM_STREAM_PLAYBACK); + + if (snd_ctl_pcm_info (handle ,pcminfo) < 0) _debugAlsa (" Cannot get info\n"); + else { + _debugAlsa ("card %i : %s [%s]\n", + numCard, + snd_ctl_card_info_get_id (info), + snd_ctl_card_info_get_name (info)); + description = snd_ctl_card_info_get_name (info); + description.append (" - "); + description.append (snd_pcm_info_get_name (pcminfo)); + cards_id.push_back (description); + // The number of the sound card is associated with a string description + p = HwIDPair (numCard , description); + IDSoundCards.push_back (p); } } - snd_ctl_close( handle ); + + snd_ctl_close (handle); } - if ( snd_card_next( &numCard ) < 0 ) { + + if (snd_card_next (&numCard) < 0) { break; } } + return cards_id; } - bool -AlsaLayer::soundCardIndexExist( int card , int stream ) +bool +AlsaLayer::soundCardIndexExist (int card , int stream) { snd_ctl_t* handle; snd_pcm_info_t *pcminfo; - snd_pcm_info_alloca( &pcminfo ); + snd_pcm_info_alloca (&pcminfo); std::string name = "hw:"; std::stringstream ss; ss << card ; - name.append(ss.str()); - if(snd_ctl_open( &handle, name.c_str(), 0) == 0 ){ - snd_pcm_info_set_stream( pcminfo , ( stream == SFL_PCM_PLAYBACK )? SND_PCM_STREAM_PLAYBACK : SND_PCM_STREAM_CAPTURE ); - if( snd_ctl_pcm_info( handle , pcminfo ) < 0) return false; + name.append (ss.str()); + + if (snd_ctl_open (&handle, name.c_str(), 0) == 0) { + snd_pcm_info_set_stream (pcminfo , (stream == SFL_PCM_PLAYBACK) ? SND_PCM_STREAM_PLAYBACK : SND_PCM_STREAM_CAPTURE); + + if (snd_ctl_pcm_info (handle , pcminfo) < 0) return false; else return true; - } - else + } else return false; -} +} - int -AlsaLayer::soundCardGetIndex( std::string description ) +int +AlsaLayer::soundCardGetIndex (std::string description) { unsigned int i; - for( i = 0 ; i < IDSoundCards.size() ; i++ ) - { + + for (i = 0 ; i < IDSoundCards.size() ; i++) { HwIDPair p = IDSoundCards[i]; - if( p.second == description ) + + if (p.second == description) return p.first ; } + // else return the default one return 0; } @@ -648,7 +702,7 @@ AlsaLayer::soundCardGetIndex( std::string description ) void AlsaLayer::audioCallback (void) { - int toGet, toPut, urgentAvail, normalAvail, micAvailAlsa, micAvailPut, maxBytes; + int toGet, toPut, urgentAvail, normalAvail, micAvailAlsa, micAvailPut, maxBytes; unsigned short spkrVolume, micVolume; AudioLoop *tone; @@ -661,46 +715,52 @@ void AlsaLayer::audioCallback (void) // AvailForGet tell the number of chars inside the buffer // framePerBuffer are the number of data for one channel (left) urgentAvail = _urgentRingBuffer.AvailForGet(); + if (urgentAvail > 0) { - // Urgent data (dtmf, incoming call signal) come first. - toGet = (urgentAvail < (int)(framesPerBufferAlsa * sizeof(SFLDataFormat))) ? urgentAvail : framesPerBufferAlsa * sizeof(SFLDataFormat); - out = (SFLDataFormat*)malloc(toGet * sizeof(SFLDataFormat) ); - _urgentRingBuffer.Get(out, toGet, spkrVolume); + // Urgent data (dtmf, incoming call signal) come first. + toGet = (urgentAvail < (int) (framesPerBufferAlsa * sizeof (SFLDataFormat))) ? urgentAvail : framesPerBufferAlsa * sizeof (SFLDataFormat); + out = (SFLDataFormat*) malloc (toGet * sizeof (SFLDataFormat)); + _urgentRingBuffer.Get (out, toGet, spkrVolume); /* Play the sound */ - write( out , toGet ); - free(out); out=0; + write (out , toGet); + free (out); + out=0; // Consume the regular one as well (same amount of bytes) - _voiceRingBuffer.Discard(toGet); + _voiceRingBuffer.Discard (toGet); } else { tone = _manager->getTelephoneTone(); - toGet = 940 ; - maxBytes = toGet * sizeof(SFLDataFormat) ; - if ( tone != 0) { - out = (SFLDataFormat*)malloc(maxBytes * sizeof(SFLDataFormat)); - tone->getNext(out, toGet, spkrVolume); + toGet = 940 ; + maxBytes = toGet * sizeof (SFLDataFormat) ; + + if (tone != 0) { + out = (SFLDataFormat*) malloc (maxBytes * sizeof (SFLDataFormat)); + tone->getNext (out, toGet, spkrVolume); write (out , maxBytes); - } else if ( (tone=_manager->getTelephoneFile()) != 0 ) { - out = (SFLDataFormat*)malloc(maxBytes * sizeof(SFLDataFormat) ); - tone->getNext(out, toGet, spkrVolume); + } else if ( (tone=_manager->getTelephoneFile()) != 0) { + out = (SFLDataFormat*) malloc (maxBytes * sizeof (SFLDataFormat)); + tone->getNext (out, toGet, spkrVolume); write (out , maxBytes); } else { // If nothing urgent, play the regular sound samples normalAvail = _voiceRingBuffer.AvailForGet(); - toGet = (normalAvail < (int)(framesPerBufferAlsa * sizeof(SFLDataFormat))) ? normalAvail : framesPerBufferAlsa * sizeof(SFLDataFormat); - out = (SFLDataFormat*)malloc(framesPerBufferAlsa * sizeof(SFLDataFormat)); + toGet = (normalAvail < (int) (framesPerBufferAlsa * sizeof (SFLDataFormat))) ? normalAvail : framesPerBufferAlsa * sizeof (SFLDataFormat); + out = (SFLDataFormat*) malloc (framesPerBufferAlsa * sizeof (SFLDataFormat)); if (toGet) { - _voiceRingBuffer.Get(out, toGet, spkrVolume); + _voiceRingBuffer.Get (out, toGet, spkrVolume); write (out, toGet); } else { - bzero(out, framesPerBufferAlsa * sizeof(SFLDataFormat)); + bzero (out, framesPerBufferAlsa * sizeof (SFLDataFormat)); } } - free(out); out=0; + + free (out); + + out=0; } - - // Additionally handle the mic's audio stream - //if(is_capture_running()){ + + // Additionally handle the mic's audio stream + //if(is_capture_running()){ /*micAvailAlsa = snd_pcm_avail_update(_CaptureHandle); if(micAvailAlsa > 0) { micAvailPut = _micRingBuffer.AvailForPut(); @@ -708,28 +768,29 @@ void AlsaLayer::audioCallback (void) in = (SFLDataFormat*)malloc(toPut * sizeof(SFLDataFormat)); toPut = read (in, toPut); if (in != 0) - { + { _micRingBuffer.Put(in, toPut, 100); } free(in); in=0; }*/ } -void* AlsaLayer::adjustVolume( void* buffer , int len, int stream ) +void* AlsaLayer::adjustVolume (void* buffer , int len, int stream) { int vol, i, size; SFLDataFormat *src = NULL; - (stream == SFL_PCM_PLAYBACK)? vol = _manager->getSpkrVolume() : vol = _manager->getMicVolume(); + (stream == SFL_PCM_PLAYBACK) ? vol = _manager->getSpkrVolume() : vol = _manager->getMicVolume(); src = (SFLDataFormat*) buffer; - if( vol != 100 ) - { - size = len / sizeof(SFLDataFormat); - for( i = 0 ; i < size ; i++ ){ + if (vol != 100) { + size = len / sizeof (SFLDataFormat); + + for (i = 0 ; i < size ; i++) { src[i] = src[i] * vol / 100 ; } } - return src ; + + return src ; } diff --git a/sflphone-common/src/audio/audiodevice.cpp b/sflphone-common/src/audio/audiodevice.cpp index f82ce075a2757dffef338decb534c39097c4be24..07c3edb4f23b8b9be2f44ce6b90048b8688ba66a 100644 --- a/sflphone-common/src/audio/audiodevice.cpp +++ b/sflphone-common/src/audio/audiodevice.cpp @@ -22,13 +22,13 @@ const double AudioDevice::DEFAULT_RATE = 8000.0; -AudioDevice::AudioDevice(int id, const std::string& name) : - _id(id), _name(name), _rate(DEFAULT_RATE) +AudioDevice::AudioDevice (int id, const std::string& name) : + _id (id), _name (name), _rate (DEFAULT_RATE) { - _rate = DEFAULT_RATE; + _rate = DEFAULT_RATE; } -AudioDevice::~AudioDevice() +AudioDevice::~AudioDevice() { } diff --git a/sflphone-common/src/audio/audiofile.cpp b/sflphone-common/src/audio/audiofile.cpp index 5d639f296ffe393dbdfdab06bfa45de1ad1def3d..82518c850bcb9943de717eaedd445dd1055e6332 100644 --- a/sflphone-common/src/audio/audiofile.cpp +++ b/sflphone-common/src/audio/audiofile.cpp @@ -2,10 +2,10 @@ * Copyright (C) 2005-2007 Savoir-Faire Linux inc. * Author: Yan Morin <yan.morin@savoirfairelinux.com> * - * Inspired by tonegenerator of + * Inspired by tonegenerator of * Laurielle Lea <laurielle.lea@savoirfairelinux.com> (2004) * Inspired by ringbuffer of Audacity Project - * + * * 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 * the Free Software Foundation; either version 3 of the License, or @@ -28,10 +28,10 @@ #include <cstring> AudioFile::AudioFile() - : AudioLoop(), - _filename(), - _codec(NULL), - _start(false) + : AudioLoop(), + _filename(), + _codec (NULL), + _start (false) { } @@ -42,114 +42,125 @@ AudioFile::~AudioFile() // load file in mono format bool -AudioFile::loadFile(const std::string& filename, AudioCodec* codec , unsigned int sampleRate=8000) +AudioFile::loadFile (const std::string& filename, AudioCodec* codec , unsigned int sampleRate=8000) { - _codec = codec; + _codec = codec; - // if the filename was already load, with the same samplerate - // we do nothing - if ( strcmp(_filename.c_str(), filename.c_str()) == 0 && _sampleRate == (int)sampleRate) { - return true; - } else { - // reset to 0 - delete [] _buffer; _buffer = 0; - _size = 0; - _pos = 0; - } - - - - // no filename to load - if (filename.empty()) { - _debug("Unable to open audio file: filename is empty\n"); - return false; - } - - std::fstream file; - file.open(filename.c_str(), std::fstream::in); - if (!file.is_open()) { - // unable to load the file - _debug("Unable to open audio file %s\n", filename.c_str()); - return false; - } - - // get length of file: - file.seekg (0, std::ios::end); - int length = file.tellg(); - file.seekg (0, std::ios::beg); - - // allocate memory: - char fileBuffer[length]; - - // read data as a block: - file.read (fileBuffer,length); - file.close(); - - - // Decode file.ul - // expandedsize is the number of bytes, not the number of int - // expandedsize should be exactly two time more, else failed - int16 monoBuffer[length]; - int expandedsize = (int)_codec->codecDecode (monoBuffer, (unsigned char *) fileBuffer, length); - if (expandedsize != length*2) { - _debug("Audio file error on loading audio file!"); - return false; - } - unsigned int nbSampling = expandedsize/sizeof(int16); - - // we need to change the sample rating here: - // case 1: we don't have to resample : only do splitting and convert - if ( sampleRate == 8000 ) { - // just s - _size = nbSampling; - _buffer = new SFLDataFormat[_size]; + // if the filename was already load, with the same samplerate + // we do nothing + + if (strcmp (_filename.c_str(), filename.c_str()) == 0 && _sampleRate == (int) sampleRate) { + return true; + } else { + // reset to 0 + delete [] _buffer; + _buffer = 0; + _size = 0; + _pos = 0; + } + + + + // no filename to load + if (filename.empty()) { + _debug ("Unable to open audio file: filename is empty\n"); + return false; + } + + std::fstream file; + + file.open (filename.c_str(), std::fstream::in); + + if (!file.is_open()) { + // unable to load the file + _debug ("Unable to open audio file %s\n", filename.c_str()); + return false; + } + + // get length of file: + file.seekg (0, std::ios::end); + + int length = file.tellg(); + + file.seekg (0, std::ios::beg); + + // allocate memory: + char fileBuffer[length]; + + // read data as a block: + file.read (fileBuffer,length); + + file.close(); + + + // Decode file.ul + // expandedsize is the number of bytes, not the number of int + // expandedsize should be exactly two time more, else failed + int16 monoBuffer[length]; + + int expandedsize = (int) _codec->codecDecode (monoBuffer, (unsigned char *) fileBuffer, length); + + if (expandedsize != length*2) { + _debug ("Audio file error on loading audio file!"); + return false; + } + + unsigned int nbSampling = expandedsize/sizeof (int16); + + // we need to change the sample rating here: + // case 1: we don't have to resample : only do splitting and convert + + if (sampleRate == 8000) { + // just s + _size = nbSampling; + _buffer = new SFLDataFormat[_size]; #ifdef DATAFORMAT_IS_FLOAT - // src to dest - src_short_to_float_array(monoBuffer, _buffer, nbSampling); + // src to dest + src_short_to_float_array (monoBuffer, _buffer, nbSampling); #else - // dest to src - memcpy(_buffer, monoBuffer, _size*sizeof(SFLDataFormat)); + // dest to src + memcpy (_buffer, monoBuffer, _size*sizeof (SFLDataFormat)); #endif - } else { - // case 2: we need to convert it and split it - // convert here - double factord = (double)sampleRate / 8000; - float* floatBufferIn = new float[nbSampling]; - int sizeOut = (int)(ceil(factord*nbSampling)); - src_short_to_float_array(monoBuffer, floatBufferIn, nbSampling); - SFLDataFormat* bufferTmp = new SFLDataFormat[sizeOut]; - - SRC_DATA src_data; - src_data.data_in = floatBufferIn; - src_data.input_frames = nbSampling; - src_data.output_frames = sizeOut; - src_data.src_ratio = factord; + } else { + // case 2: we need to convert it and split it + // convert here + double factord = (double) sampleRate / 8000; + float* floatBufferIn = new float[nbSampling]; + int sizeOut = (int) (ceil (factord*nbSampling)); + src_short_to_float_array (monoBuffer, floatBufferIn, nbSampling); + SFLDataFormat* bufferTmp = new SFLDataFormat[sizeOut]; + + SRC_DATA src_data; + src_data.data_in = floatBufferIn; + src_data.input_frames = nbSampling; + src_data.output_frames = sizeOut; + src_data.src_ratio = factord; #ifdef DATAFORMAT_IS_FLOAT - // case number 2.1: the output is float32 : convert directly in _bufferTmp - src_data.data_out = bufferTmp; - src_simple (&src_data, SRC_SINC_BEST_QUALITY, 1); + // case number 2.1: the output is float32 : convert directly in _bufferTmp + src_data.data_out = bufferTmp; + src_simple (&src_data, SRC_SINC_BEST_QUALITY, 1); #else - // case number 2.2: the output is int16 : convert and change to int16 - float* floatBufferOut = new float[sizeOut]; - src_data.data_out = floatBufferOut; + // case number 2.2: the output is int16 : convert and change to int16 + float* floatBufferOut = new float[sizeOut]; + src_data.data_out = floatBufferOut; - src_simple (&src_data, SRC_SINC_BEST_QUALITY, 1); - src_float_to_short_array(floatBufferOut, bufferTmp, src_data.output_frames_gen); + src_simple (&src_data, SRC_SINC_BEST_QUALITY, 1); + src_float_to_short_array (floatBufferOut, bufferTmp, src_data.output_frames_gen); - delete [] floatBufferOut; + delete [] floatBufferOut; #endif - delete [] floatBufferIn; - nbSampling = src_data.output_frames_gen; - - // if we are in mono, we send the bufferTmp location and don't delete it - // else we split the audio in 2 and put it into buffer - _size = nbSampling; - _buffer = bufferTmp; // just send the buffer pointer; - bufferTmp = 0; - } - - return true; + delete [] floatBufferIn; + nbSampling = src_data.output_frames_gen; + + // if we are in mono, we send the bufferTmp location and don't delete it + // else we split the audio in 2 and put it into buffer + _size = nbSampling; + _buffer = bufferTmp; // just send the buffer pointer; + bufferTmp = 0; + } + + return true; } diff --git a/sflphone-common/src/audio/audiolayer.cpp b/sflphone-common/src/audio/audiolayer.cpp index 3eea4392c737b51c3f954b438ca3dac7b57a30b9..68eca5a9c7bc2045732f1588ceac705ca107c339 100644 --- a/sflphone-common/src/audio/audiolayer.cpp +++ b/sflphone-common/src/audio/audiolayer.cpp @@ -6,12 +6,12 @@ * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. @@ -21,33 +21,35 @@ void AudioLayer::flushMain (void) { - ost::MutexLock guard(_mutex); + ost::MutexLock guard (_mutex); _voiceRingBuffer.flush(); } void AudioLayer::flushUrgent (void) { - ost::MutexLock guard(_mutex); + ost::MutexLock guard (_mutex); _urgentRingBuffer.flush(); } void AudioLayer::flushMic (void) { - ost::MutexLock guard(_mutex); + ost::MutexLock guard (_mutex); _micRingBuffer.flush(); } -int AudioLayer::putUrgent(void* buffer, int toCopy) +int AudioLayer::putUrgent (void* buffer, int toCopy) { int a; - ost::MutexLock guard(_mutex); + ost::MutexLock guard (_mutex); a = _urgentRingBuffer.AvailForPut(); - if ( a >= toCopy ) { - return _urgentRingBuffer.Put(buffer, toCopy, _defaultVolume); + + if (a >= toCopy) { + return _urgentRingBuffer.Put (buffer, toCopy, _defaultVolume); } else { - return _urgentRingBuffer.Put(buffer, a, _defaultVolume); + return _urgentRingBuffer.Put (buffer, a, _defaultVolume); } + return 0; } @@ -55,14 +57,16 @@ int AudioLayer::putMain (void *buffer, int toCopy) { int a; - ost::MutexLock guard(_mutex); + ost::MutexLock guard (_mutex); a = _voiceRingBuffer.AvailForPut(); - if ( a >= toCopy ) { - return _voiceRingBuffer.Put(buffer, toCopy, _defaultVolume); + + if (a >= toCopy) { + return _voiceRingBuffer.Put (buffer, toCopy, _defaultVolume); } else { - _debug("Chopping sound, Ouch! RingBuffer full ?\n"); - return _voiceRingBuffer.Put(buffer, a, _defaultVolume); + _debug ("Chopping sound, Ouch! RingBuffer full ?\n"); + return _voiceRingBuffer.Put (buffer, a, _defaultVolume); } + return 0; } diff --git a/sflphone-common/src/audio/audioloop.cpp b/sflphone-common/src/audio/audioloop.cpp index ecf85d1b03f6b8d89c85ff8dcaf9c86f60a920fd..633192de44bf5a4ed82b5d9fb34e28117d3e0fa5 100644 --- a/sflphone-common/src/audio/audioloop.cpp +++ b/sflphone-common/src/audio/audioloop.cpp @@ -2,10 +2,10 @@ * Copyright (C) 2005 Savoir-Faire Linux inc. * Author: Yan Morin <yan.morin@savoirfairelinux.com> * - * Inspired by tonegenerator of + * Inspired by tonegenerator of * Laurielle Lea <laurielle.lea@savoirfairelinux.com> (2004) * Inspired by ringbuffer of Audacity Project - * + * * 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 * the Free Software Foundation; either version 3 of the License, or @@ -24,42 +24,52 @@ #include <math.h> #include <strings.h> -AudioLoop::AudioLoop():_buffer(0), _size(0), _pos(0), _sampleRate(0) +AudioLoop::AudioLoop() :_buffer (0), _size (0), _pos (0), _sampleRate (0) { } AudioLoop::~AudioLoop() { - delete [] _buffer; _buffer = 0; + delete [] _buffer; + _buffer = 0; } int -AudioLoop::getNext(SFLDataFormat* output, int nb, short volume) +AudioLoop::getNext (SFLDataFormat* output, int nb, short volume) { - int copied = 0; - int block; - int pos = _pos; - while(nb) { - block = nb; - if ( block > (_size-pos) ) { - block = _size-pos; - } - // src, dest, len - bcopy(_buffer+pos, output, block*sizeof(SFLDataFormat)); // short>char conversion - if (volume!=100) { - for (int i=0;i<block;i++) { - *output = (*output * volume)/100; - output++; - } - } else { - output += block; // this is the destination... + int copied = 0; + int block; + int pos = _pos; + + while (nb) { + block = nb; + + if (block > (_size-pos)) { + block = _size-pos; + } + + // src, dest, len + bcopy (_buffer+pos, output, block*sizeof (SFLDataFormat)); // short>char conversion + + if (volume!=100) { + for (int i=0;i<block;i++) { + *output = (*output * volume) /100; + output++; + } + } else { + output += block; // this is the destination... + } + + // should adjust sound here, in output??? + pos = (pos + block) % _size; + + nb -= block; + + copied += block; } - // should adjust sound here, in output??? - pos = (pos + block ) % _size; - nb -= block; - copied += block; - } - _pos = pos; - return copied; + + _pos = pos; + + return copied; } diff --git a/sflphone-common/src/audio/audiortp.cpp b/sflphone-common/src/audio/audiortp.cpp index 9b07c1ff3be1996f1f770a6f224e4ce177163249..b16147e9e8cd96d762d23daf0a1a23453c0fccc1 100644 --- a/sflphone-common/src/audio/audiortp.cpp +++ b/sflphone-common/src/audio/audiortp.cpp @@ -4,6 +4,7 @@ * Author: Alexandre Bourget <alexandre.bourget@savoirfairelinux.com> * Author: Yan Morin <yan.morin@savoirfairelinux.com> * Author: Laurielle Lea <laurielle.lea@savoirfairelinux.com> + * Author: Alexandre Savard <alexandre.savard@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 @@ -41,41 +42,59 @@ #include "../sipcall.h" //////////////////////////////////////////////////////////////////////////////// -// AudioRtp +// AudioRtp //////////////////////////////////////////////////////////////////////////////// -AudioRtp::AudioRtp() :_RTXThread(0), _symmetric(), _threadMutex() +AudioRtp::AudioRtp() :_RTXThread (0), _symmetric(), _threadMutex() { } -AudioRtp::~AudioRtp (void) { - delete _RTXThread; _RTXThread = 0; +AudioRtp::~AudioRtp (void) +{ + delete _RTXThread; + _RTXThread = 0; } -int -AudioRtp::createNewSession (SIPCall *ca) { +void +AudioRtp::createNewSession (SIPCall *ca) +{ - ost::MutexLock m(_threadMutex); + ost::MutexLock m (_threadMutex); - _debug("AudioRtp::Create new rtp session\n"); + _debug ("AudioRtp::Create new rtp session\n"); // something should stop the thread before... - if ( _RTXThread != 0 ) { - _debug("**********************************************************\n"); - _debug("! ARTP Failure: Thread already exists..., stopping it\n"); - _debug("**********************************************************\n"); - delete _RTXThread; _RTXThread = 0; + + if (_RTXThread != 0) { + _debug ("**********************************************************\n"); + _debug ("! ARTP Failure: Thread already exists..., stopping it\n"); + _debug ("**********************************************************\n"); + delete _RTXThread; + _RTXThread = 0; } // Start RTP Send/Receive threads - _symmetric = Manager::instance().getConfigInt(SIGNALISATION,SYMMETRIC) ? true : false; + _symmetric = Manager::instance().getConfigInt (SIGNALISATION,SYMMETRIC) ? true : false; + _RTXThread = new AudioRtpRTX (ca, _symmetric); + +} + +int +AudioRtp::start (void) +{ + if (_RTXThread == 0) { + _debug ("! ARTP Failure: Cannot start audiortp thread since not yet created\n"); + throw AudioRtpException(); + } + + try { if (_RTXThread->start() != 0) { - _debug("! ARTP Failure: unable to start RTX Thread\n"); + _debug ("! ARTP Failure: unable to start RTX Thread\n"); return -1; } - } catch(...) { - _debugException("! ARTP Failure: when trying to start a thread"); + } catch (...) { + _debugException ("! ARTP Failure: when trying to start a thread"); throw; } @@ -84,98 +103,133 @@ AudioRtp::createNewSession (SIPCall *ca) { bool -AudioRtp::closeRtpSession () { +AudioRtp::closeRtpSession () +{ - ost::MutexLock m(_threadMutex); + ost::MutexLock m (_threadMutex); // This will make RTP threads finish. - _debug("AudioRtp::Stopping rtp session\n"); - try { + _debug ("AudioRtp::Stopping rtp session\n"); - delete _RTXThread; _RTXThread = 0; - } catch(...) { - _debugException("! ARTP Exception: when stopping audiortp\n"); + + try { + delete _RTXThread; + _RTXThread = 0; + } catch (...) { + _debugException ("! ARTP Exception: when stopping audiortp\n"); throw; } - AudioLayer* audiolayer = Manager::instance().getAudioDriver(); - audiolayer->stopStream(); + + // AudioLayer* audiolayer = Manager::instance().getAudioDriver(); + // audiolayer->stopStream(); + + _debug ("AudioRtp::Audio rtp stopped\n"); return true; } +AudioRtpRTX* +AudioRtp::getRTX() +{ + return _RTXThread; +} + + void -AudioRtp::setRecording() { +AudioRtp::setRecording() +{ - _debug("AudioRtp::setRecording\n"); + _debug ("AudioRtp::setRecording\n"); _RTXThread->_ca->setRecording(); } + + //////////////////////////////////////////////////////////////////////////////// // AudioRtpRTX Class // //////////////////////////////////////////////////////////////////////////////// -AudioRtpRTX::AudioRtpRTX (SIPCall *sipcall, bool sym) : time(new ost::Time()), _ca(sipcall), _sessionSend(NULL), _sessionRecv(NULL), _session(NULL), _start(), - _sym(sym), micData(NULL), micDataConverted(NULL), micDataEncoded(NULL), spkrDataDecoded(NULL), spkrDataConverted(NULL), - converter(NULL), _layerSampleRate(),_codecSampleRate(), _layerFrameSize(), _audiocodec(NULL) +AudioRtpRTX::AudioRtpRTX (SIPCall *sipcall, bool sym) : time (new ost::Time()), _ca (sipcall), _sessionSend (NULL), _sessionRecv (NULL), _session (NULL), + _sym (sym), micData (NULL), micDataConverted (NULL), micDataEncoded (NULL), spkrDataDecoded (NULL), spkrDataConverted (NULL), + converter (NULL), _layerSampleRate(),_codecSampleRate(), _layerFrameSize(), _audiocodec (NULL) { - setCancel(cancelDefault); + setCancel (cancelDefault); // AudioRtpRTX should be close if we change sample rate // TODO: Change bind address according to user settings. // TODO: this should be the local ip not the external (router) IP std::string localipConfig = _ca->getLocalIp(); // _ca->getLocalIp(); - ost::InetHostAddress local_ip(localipConfig.c_str()); - if (!_sym) { - _sessionRecv = new ost::RTPSession(local_ip, _ca->getLocalAudioPort()); - _sessionSend = new ost::RTPSession(local_ip, _ca->getLocalAudioPort()); - _session = NULL; - } else { - _debug ("%i\n", _ca->getLocalAudioPort()); - _session = new ost::SymmetricRTPSession (local_ip, _ca->getLocalAudioPort()); - _sessionRecv = NULL; - _sessionSend = NULL; - } + ost::InetHostAddress local_ip (localipConfig.c_str()); + + _debug ("%i\n", _ca->getLocalAudioPort()); + _session = new ost::SymmetricRTPSession (local_ip, _ca->getLocalAudioPort()); + // _session = new ost::RTPSessionBase(local_ip, _ca->getLocalAudioPort()); + _sessionRecv = NULL; + _sessionSend = NULL; + + //mic, we receive from soundcard in stereo, and we send encoded + //encoding before sending + _audiolayer = Manager::instance().getAudioDriver(); + _layerFrameSize = _audiolayer->getFrameSize(); // in ms + _layerSampleRate = _audiolayer->getSampleRate(); + + // initBuffers(); + + // initAudioRtpSession(); + + _payloadIsSet = false; + _remoteIpIsSet = false; + } -AudioRtpRTX::~AudioRtpRTX () { - _start.wait(); +AudioRtpRTX::~AudioRtpRTX () +{ + + _debug ("Delete AudioRtpRTX instance\n"); try { this->terminate(); - } catch(...) { - _debugException("! ARTP: Thread destructor didn't terminate correctly"); + } catch (...) { + _debugException ("! ARTP: Thread destructor didn't terminate correctly"); throw; } + _ca = 0; - if (!_sym) { - delete _sessionRecv; _sessionRecv = NULL; - delete _sessionSend; _sessionSend = NULL; - } else { - delete _session; _session = NULL; - } + delete [] micData; + micData = NULL; + delete [] micDataConverted; + micDataConverted = NULL; + delete [] micDataEncoded; + micDataEncoded = NULL; - delete [] micData; micData = NULL; - delete [] micDataConverted; micDataConverted = NULL; - delete [] micDataEncoded; micDataEncoded = NULL; + delete [] spkrDataDecoded; + spkrDataDecoded = NULL; + delete [] spkrDataConverted; + spkrDataConverted = NULL; - delete [] spkrDataDecoded; spkrDataDecoded = NULL; - delete [] spkrDataConverted; spkrDataConverted = NULL; + delete time; + time = NULL; - delete time; time = NULL; + delete converter; + converter = NULL; - delete converter; converter = NULL; + // _session->terminate(); -} + delete _session; + _session = NULL; + _debug ("AudioRtpRTX instance deleted\n"); + +} - void +void AudioRtpRTX::initBuffers() { - converter = new SamplerateConverter( _layerSampleRate , _layerFrameSize ); + converter = new SamplerateConverter (_layerSampleRate , _layerFrameSize); int nbSamplesMax = (int) (_layerSampleRate * _layerFrameSize /1000); @@ -187,198 +241,139 @@ AudioRtpRTX::initBuffers() spkrDataDecoded = new SFLDataFormat[nbSamplesMax]; } - void -AudioRtpRTX::initAudioRtpSession (void) + +void +AudioRtpRTX::initAudioRtpSession (void) { try { - if (_ca == 0) { return; } - _audiocodec = _ca->getLocalSDP()->get_session_media (); - if (_audiocodec == NULL) { return; } + _session->setSchedulingTimeout (100000); + _session->setExpireTimeout (1000000); - _codecSampleRate = _audiocodec->getClockRate(); - _codecFrameSize = _audiocodec->getFrameSize(); - - ost::InetHostAddress remote_ip(_ca->getLocalSDP()->get_remote_ip().c_str()); - _debug("Init audio RTP session %s\n", _ca->getLocalSDP()->get_remote_ip().data()); - if (!remote_ip) { - _debug("! ARTP Thread Error: Target IP address [%s] is not correct!\n", _ca->getLocalSDP()->get_remote_ip().data()); - return; - } + } catch (...) { + _debugException ("! ARTP Failure: initialisation failed"); + throw; + } +} - if (!_sym) { - _sessionRecv->setSchedulingTimeout (10000); - _sessionRecv->setExpireTimeout(1000000); +void +AudioRtpRTX::setRtpSessionMedia (void) +{ - _sessionSend->setSchedulingTimeout(10000); - _sessionSend->setExpireTimeout(1000000); - } else { - _session->setSchedulingTimeout(10000); - _session->setExpireTimeout(1000000); - } + if (_ca == 0) { + _debug (" !ARTP: No call, can't init RTP media\n"); + return; + } - if (!_sym) { - if ( !_sessionRecv->addDestination(remote_ip, (unsigned short) _ca->getLocalSDP()->get_remote_audio_port()) ) { - _debug("AudioRTP Thread Error: could not connect to port %d\n", _ca->getLocalSDP()->get_remote_audio_port()); - return; - } - if (!_sessionSend->addDestination (remote_ip, (unsigned short) _ca->getLocalSDP()->get_remote_audio_port())) { - _debug("! ARTP Thread Error: could not connect to port %d\n", _ca->getLocalSDP()->get_remote_audio_port()); - return; - } + _audiocodec = _ca->getLocalSDP()->get_session_media (); - bool payloadIsSet = false; - if (_audiocodec) { - if (_audiocodec->hasDynamicPayload()) { - payloadIsSet = _sessionRecv->setPayloadFormat(ost::DynamicPayloadFormat((ost::PayloadType) _audiocodec->getPayload(), _audiocodec->getClockRate())); - } else { - payloadIsSet= _sessionRecv->setPayloadFormat(ost::StaticPayloadFormat((ost::StaticPayloadType) _audiocodec->getPayload())); - payloadIsSet = _sessionSend->setPayloadFormat(ost::StaticPayloadFormat((ost::StaticPayloadType) _audiocodec->getPayload())); - } - } - _sessionSend->setMark(true); - } else { + if (_audiocodec == NULL) { + _debug (" !ARTP: No audiocodec, can't init RTP media\n"); + return; + } - if (!_session->addDestination (remote_ip, (unsigned short)_ca->getLocalSDP()->get_remote_audio_port() )) { - return; - } + _debug ("Init audio RTP session: codec payload %i\n", _audiocodec->getPayload()); - bool payloadIsSet = false; - if (_audiocodec) { - if (_audiocodec->hasDynamicPayload()) { - payloadIsSet = _session->setPayloadFormat(ost::DynamicPayloadFormat((ost::PayloadType) _audiocodec->getPayload(), _audiocodec->getClockRate())); - } else { - payloadIsSet = _session->setPayloadFormat(ost::StaticPayloadFormat((ost::StaticPayloadType) _audiocodec->getPayload())); - } - } - } + if (_audiocodec == NULL) { + return; + } + _codecSampleRate = _audiocodec->getClockRate(); - } catch(...) { - _debugException("! ARTP Failure: initialisation failed"); - throw; - } + _codecFrameSize = _audiocodec->getFrameSize(); -/* - std::string remoteIP; - unsigned int remotePort; + if (_audiocodec->getPayload() == 9) { + _debug ("We Are G722\n"); + _payloadIsSet = _session->setPayloadFormat (ost::DynamicPayloadFormat ( (ost::PayloadType) _audiocodec->getPayload(), _audiocodec->getClockRate())); + } else if (_audiocodec->hasDynamicPayload()) { + _debug ("We Are Dynamic\n"); + _payloadIsSet = _session->setPayloadFormat (ost::DynamicPayloadFormat ( (ost::PayloadType) _audiocodec->getPayload(), _audiocodec->getClockRate())); + } else if (!_audiocodec->hasDynamicPayload() && _audiocodec->getPayload() != 9) { + _debug ("We Are Static\n"); + _payloadIsSet = _session->setPayloadFormat (ost::StaticPayloadFormat ( (ost::StaticPayloadType) _audiocodec->getPayload())); + } - try { - if (_ca == 0) { return; } - _audiocodec = _ca->getLocalSDP()->get_session_media (); - if(_audiocodec == 0) { return; } +} - _codecSampleRate = _audiocodec->getClockRate(); +void +AudioRtpRTX::setRtpSessionRemoteIp (void) +{ - remoteIP = _ca->getLocalSDP()->get_remote_ip(); - //remoteIP = "192.168.1.234"; - remotePort = _ca->getLocalSDP()->get_remote_audio_port(); - _debug("Init audio RTP session - remote IP = %s\n", remoteIP.c_str()); - ost::InetHostAddress remote_ip(remoteIP.c_str()); - if (!remote_ip) { - _debug("! ARTP Thread Error: Target IP address [%s] is not correct!\n", remoteIP.data()); + if (!_remoteIpIsSet) { + + _debug ("++++++++++++++++++++++++++ SET IP ADDRESS ++++++++++++++++++++++++++++\n"); + + if (_ca == 0) { + _debug (" !ARTP: No call, can't init RTP media \n"); return; } - if (!_sym) { - _sessionRecv->setSchedulingTimeout (10000); - _sessionRecv->setExpireTimeout(1000000); + ost::InetHostAddress remote_ip (_ca->getLocalSDP()->get_remote_ip().c_str()); - _sessionSend->setSchedulingTimeout(10000); - _sessionSend->setExpireTimeout(1000000); - } else { - _session->setSchedulingTimeout(10000); - _session->setExpireTimeout(1000000); + _debug ("Init audio RTP session: remote ip %s\n", _ca->getLocalSDP()->get_remote_ip().data()); + + if (!remote_ip) { + _debug (" !ARTP Thread Error: Target IP address [%s] is not correct!\n", _ca->getLocalSDP()->get_remote_ip().data()); + return; } - if (!_sym) { - _debug("! AudioRTP Thread: Added session destination %s:%d\n", remote_ip.getHostname(), remotePort ); - if ( !_sessionRecv->addDestination(remote_ip, (unsigned short) remotePort) ) { - _debug("AudioRTP Thread Error: could not connect to port %d\n", remotePort); - return; - } - if (!_sessionSend->addDestination (remote_ip, (unsigned short) remotePort)) { - _debug("! ARTP Thread Error: could not connect to port %d\n", remotePort); - return; - } + _debug ("++++Address: %s, audioport: %d\n", _ca->getLocalSDP()->get_remote_ip().c_str(), _ca->getLocalSDP()->get_remote_audio_port()); - bool payloadIsSet = false; - if (_audiocodec) { - if (_audiocodec->hasDynamicPayload()) { - payloadIsSet = _sessionRecv->setPayloadFormat(ost::DynamicPayloadFormat((ost::PayloadType) _audiocodec->getPayload(), _audiocodec->getClockRate())); - } else { - payloadIsSet= _sessionRecv->setPayloadFormat(ost::StaticPayloadFormat((ost::StaticPayloadType) _audiocodec->getPayload())); - payloadIsSet = _sessionSend->setPayloadFormat(ost::StaticPayloadFormat((ost::StaticPayloadType) _audiocodec->getPayload())); - } - } - _sessionSend->setMark(true); - } else { + _debug ("++++Audioport: %d\n", (int) _ca->getLocalSDP()->get_remote_audio_port()); - _debug("AudioRTP Thread: Added session destination %s:%d\n", remote_ip.getHostname(), remotePort ); + if (!_session->addDestination (remote_ip, (unsigned short) _ca->getLocalSDP()->get_remote_audio_port())) { + _debug (" !ARTP Thread Error: can't add destination to session!\n"); + return; + } - if (!_session->addDestination (remote_ip, (unsigned short) remotePort)) { - _debug ("could not connect to port %d\n", remotePort); - return; - } + _remoteIpIsSet = true; + } else { + _debug ("+++++++++++++++++++++++ IP ADDRESS ALREADY SET ++++++++++++++++++++++++\n"); + } - bool payloadIsSet = false; - if (_audiocodec) { - if (_audiocodec->hasDynamicPayload()) { - payloadIsSet = _session->setPayloadFormat(ost::DynamicPayloadFormat((ost::PayloadType) _audiocodec->getPayload(), _audiocodec->getClockRate())); - } else { - payloadIsSet = _session->setPayloadFormat(ost::StaticPayloadFormat((ost::StaticPayloadType) _audiocodec->getPayload())); - } - } - } +} - } catch(...) { - _debugException("! ARTP Failure: initialisation failed"); - throw; - }*/ +float +AudioRtpRTX::computeCodecFrameSize (int codecSamplePerFrame, int codecClockRate) +{ + return ( (float) codecSamplePerFrame * 1000.0) / (float) codecClockRate; } - void -AudioRtpRTX::sendSessionFromMic(int timestamp) +int +AudioRtpRTX::computeNbByteAudioLayer (float codecFrameSize) { - // STEP: - // 1. get data from mic - // 2. convert it to int16 - good sample, good rate - // 3. encode it - // 4. send it - //try { - - timestamp += time->getSecond(); - if (_ca==0) { _debug(" !ARTP: No call associated (mic)\n"); return; } // no call, so we do nothing - AudioLayer* audiolayer = Manager::instance().getAudioDriver(); - if (!audiolayer) { _debug(" !ARTP: No audiolayer available for mic\n"); return; } + return (int) ( (float) _layerSampleRate * codecFrameSize * (float) sizeof (SFLDataFormat) / 1000.0); +} - if (!_audiocodec) { _debug(" !ARTP: No audiocodec available for mic\n"); return; } - // we have to get 20ms of data from the mic *20/1000 = /50 - // int maxBytesToGet = _layerSampleRate * _layerFrameSize * sizeof(SFLDataFormat) / 1000; +int +AudioRtpRTX::processDataEncode() +{ // compute codec framesize in ms - float fixed_codec_framesize = ((float)_audiocodec->getFrameSize() * 1000.0) / (float)_audiocodec->getClockRate(); + float fixed_codec_framesize = computeCodecFrameSize (_audiocodec->getFrameSize(), _audiocodec->getClockRate()); + + // compute nb of byte to get coresponding to 20 ms at audio layer frame size (44.1 khz) + int maxBytesToGet = computeNbByteAudioLayer (fixed_codec_framesize); - int maxBytesToGet = (int)((float)_layerSampleRate * fixed_codec_framesize * (float)sizeof(SFLDataFormat) / 1000.0); - // available bytes inside ringbuffer - int availBytesFromMic = audiolayer->canGetMic(); - + int availBytesFromMic = _audiolayer->canGetMic(); + + // set available byte to maxByteToGet int bytesAvail = (availBytesFromMic < maxBytesToGet) ? availBytesFromMic : maxBytesToGet; if (bytesAvail == 0) - return; + return 0; // Get bytes from micRingBuffer to data_from_mic - int nbSample = audiolayer->getMic( micData , bytesAvail ) / sizeof(SFLDataFormat); + int nbSample = _audiolayer->getMic (micData , bytesAvail) / sizeof (SFLDataFormat); // nb bytes to be sent over RTP int compSize = 0; @@ -388,126 +383,68 @@ AudioRtpRTX::sendSessionFromMic(int timestamp) int nb_sample_up = nbSample; // _debug("_nbSample audiolayer->getMic(): %i \n", nbSample); - + // Store the length of the mic buffer in samples for recording _nSamplesMic = nbSample; - int nbSamplesMax = _layerFrameSize * _audiocodec->getClockRate() / 1000; - // _debug("_nbSamplesMax %i\n", nbSamplesMax); - nbSample = reSampleData(_audiocodec->getClockRate(), nb_sample_up, DOWN_SAMPLING); + // int nbSamplesMax = _layerFrameSize * _audiocodec->getClockRate() / 1000; + nbSample = reSampleData (micData , micDataConverted, _audiocodec->getClockRate(), nb_sample_up, DOWN_SAMPLING); - if ( nbSample < nbSamplesMax - 10 ) { // if only 10 is missing, it's ok - // fill end with 0... - memset( micDataConverted + nbSample, 0, (nbSamplesMax-nbSample)*sizeof(int16)); - nbSample = nbSamplesMax; - } - compSize = _audiocodec->codecEncode( micDataEncoded, micDataConverted, nbSample*sizeof(int16)); + compSize = _audiocodec->codecEncode (micDataEncoded, micDataConverted, nbSample*sizeof (int16)); } else { // no resampling required - int nbSamplesMax = _codecFrameSize; - compSize = _audiocodec->codecEncode( micDataEncoded, micData, nbSample*sizeof(int16)); + // int nbSamplesMax = _codecFrameSize; + compSize = _audiocodec->codecEncode (micDataEncoded, micData, nbSample*sizeof (int16)); } - // encode divise by two - // Send encoded audio sample over the network - // if (compSize > nbSamplesMax) { _debug("! ARTP: %d should be %d\n", compSize, nbSamplesMax);} - if (!_sym) { - _sessionSend->putData(timestamp, micDataEncoded, compSize); - } else { - _session->putData(timestamp, micDataEncoded, compSize); - } - /*} catch(...) { - _debugException("! ARTP: sending failed"); - throw; - }*/ + return compSize; } - void -AudioRtpRTX::receiveSessionForSpkr (int& countTime) -{ - - - - if (_ca == 0) { return; } - //try { - AudioLayer* audiolayer = Manager::instance().getAudioDriver(); - if (!audiolayer) { return; } - - const ost::AppDataUnit* adu = NULL; - // Get audio data stream - - - if (!_sym) { - adu = _sessionRecv->getData(_sessionRecv->getFirstTimestamp()); - } else { - adu = _session->getData(_session->getFirstTimestamp()); - } - if (adu == NULL) { - //_debug("No RTP audio stream\n"); - return; - } - - - - //int payload = adu->getType(); // codec type - unsigned char* spkrData = (unsigned char*)adu->getData(); // data in char - unsigned int size = adu->getSize(); // size in char - - - // Decode data with relevant codec - unsigned int max = (unsigned int)(_codecSampleRate * _layerFrameSize / 1000); - - // if ( size > max ) { - // _debug("We have received from RTP a packet larger than expected: %d VS %d\n", size, max); - // _debug("The packet size has been cropped\n"); - // size=max; - // } - - // test if resampling is required +void +AudioRtpRTX::processDataDecode (unsigned char* spkrData, unsigned int size, int& countTime) +{ if (_audiocodec != NULL) { + // Return the size of data in bytes + int expandedSize = _audiocodec->codecDecode (spkrDataDecoded , spkrData , size); + + // buffer _receiveDataDecoded ----> short int or int16, coded on 2 bytes + int nbSample = expandedSize / sizeof (SFLDataFormat); - int expandedSize = _audiocodec->codecDecode( spkrDataDecoded , spkrData , size ); - //buffer _receiveDataDecoded ----> short int or int16, coded on 2 bytes - int nbInt16 = expandedSize / sizeof(int16); - //nbInt16 represents the number of samples we just decoded - // if ((unsigned int)nbInt16 > max) { - // _debug("We have decoded an RTP packet larger than expected: %d VS %d. Cropping.\n", nbInt16, max); - // nbInt16=max; - // } - int nbSample = nbInt16; + // test if resampling is required if (_audiocodec->getClockRate() != _layerSampleRate) { // Do sample rate conversion int nb_sample_down = nbSample; - nbSample = reSampleData(_codecSampleRate , nb_sample_down, UP_SAMPLING); - - // #ifdef DATAFORMAT_IS_FLOAT - // #else - // #endif + nbSample = reSampleData (spkrDataDecoded, spkrDataConverted, _codecSampleRate, nb_sample_down, UP_SAMPLING); - // Stor the number of samples for recording + // Store the number of samples for recording _nSamplesSpkr = nbSample; - //audiolayer->playSamples( spkrDataConverted, nbSample * sizeof(SFLDataFormat), true); - audiolayer->putMain (spkrDataConverted, nbSample * sizeof(SFLDataFormat)); + // put data in audio layer, size in byte + _audiolayer->putMain (spkrDataConverted, nbSample * sizeof (SFLDataFormat)); + } else { // Stor the number of samples for recording _nSamplesSpkr = nbSample; - audiolayer->putMain (spkrDataDecoded, nbSample * sizeof(SFLDataFormat)); + + // put data in audio layer, size in byte + _audiolayer->putMain (spkrDataDecoded, nbSample * sizeof (SFLDataFormat)); } - // Notify (with a beep) an incoming call when there is already a call + // Notify (with a beep) an incoming call when there is already a call countTime += time->getSecond(); + if (Manager::instance().incomingCallWaiting() > 0) { countTime = countTime % 500; // more often... + if (countTime == 0) { Manager::instance().notificationIncomingCall(); } @@ -516,129 +453,166 @@ AudioRtpRTX::receiveSessionForSpkr (int& countTime) } else { countTime += time->getSecond(); } - delete adu; adu = NULL; - //} catch(...) { - //_debugException("! ARTP: receiving failed"); - //throw; - //} - } - int -AudioRtpRTX::reSampleData(int sampleRate_codec, int nbSamples, int status) +void +AudioRtpRTX::sendSessionFromMic (int timestamp) { - if(status==UP_SAMPLING){ - return converter->upsampleData( spkrDataDecoded , spkrDataConverted , sampleRate_codec , _layerSampleRate , nbSamples ); + // STEP: + // 1. get data from mic + // 2. convert it to int16 - good sample, good rate + // 3. encode it + // 4. send it + + timestamp += time->getSecond(); + // no call, so we do nothing + + if (_ca==0) { + _debug (" !ARTP: No call associated (mic)\n"); + return; } - else if(status==DOWN_SAMPLING){ - return converter->downsampleData( micData , micDataConverted , sampleRate_codec , _layerSampleRate , nbSamples ); + + // AudioLayer* audiolayer = Manager::instance().getAudioDriver(); + if (!_audiolayer) { + _debug (" !ARTP: No audiolayer available for MIC\n"); + return; } - else - return 0; -} + + if (!_audiocodec) { + _debug (" !ARTP: No audiocodec available for MIC\n"); + return; + } + + + int compSize = processDataEncode(); + + _debug ("compSize: %i ", compSize); + // putData put the data on RTP queue, sendImmediate bypass this queue + _session->putData (timestamp, micDataEncoded, compSize); + // _session->sendImmediate(timestamp, micDataEncoded, compSize); +} + void -AudioRtpRTX::run () { +AudioRtpRTX::receiveSessionForSpkr (int& countTime) +{ + + if (_ca == 0) { + return; + } - //mic, we receive from soundcard in stereo, and we send encoded - //encoding before sending - AudioLayer *audiolayer = Manager::instance().getAudioDriver(); - _layerFrameSize = audiolayer->getFrameSize(); // en ms - _layerSampleRate = audiolayer->getSampleRate(); - - initBuffers(); - int step; + if (!_audiolayer) { + _debug (" !ARTP: No audiolayer available for SPEAKER\n"); + return; + } - int sessionWaiting; + if (!_audiocodec) { + _debug (" !ARTP: No audiocodec available for SPEAKER\n"); + return; + } - //try { + const ost::AppDataUnit* adu = NULL; - // Init the session - initAudioRtpSession(); + adu = _session->getData (_session->getFirstTimestamp()); - // step = (int) (_layerFrameSize * _codecSampleRate / 1000); - step = _codecFrameSize; - // start running the packet queue scheduler. - //_debug("AudioRTP Thread started\n"); - if (!_sym) { - _sessionRecv->startRunning(); - _sessionSend->startRunning(); - } else { - _session->startRunning(); - //_debug("Session is now: %d active\n", _session->isActive()); + // _debug("payloadType: %i\n", adu->getType()); + + if (adu == NULL) { + // _debug("No RTP audio stream\n"); + return; } - int timestamp = 0; // for mic - // step = (int) (_layerFrameSize * _codecSampleRate / 1000); - step = _codecFrameSize; + unsigned char* spkrData = (unsigned char*) adu->getData(); // data in char + + unsigned int size = adu->getSize(); // size in char + + processDataDecode (spkrData, size, countTime); + +} + + +int +AudioRtpRTX::reSampleData (SFLDataFormat *input, SFLDataFormat *output, int sampleRate_codec, int nbSamples, int status) +{ + if (status==UP_SAMPLING) { + return converter->upsampleData (input, output, sampleRate_codec , _layerSampleRate , nbSamples); + } else if (status==DOWN_SAMPLING) { + return converter->downsampleData (micData , micDataConverted , sampleRate_codec , _layerSampleRate , nbSamples); + } else + + return 0; +} + + + +void +AudioRtpRTX::run () +{ + + int sessionWaiting; + + initBuffers(); + initAudioRtpSession(); + setRtpSessionRemoteIp(); + setRtpSessionMedia(); + + int timestep = _codecFrameSize; + + int timestamp = _session->getCurrentTimestamp(); // for mic int countTime = 0; // for receive - + int threadSleep = 0; + if (_codecSampleRate != 0) threadSleep = (_codecFrameSize * 1000) / _codecSampleRate; else - threadSleep = _layerFrameSize; + threadSleep = _layerFrameSize; + + TimerPort::setTimer (threadSleep); - TimerPort::setTimer(threadSleep); + _audiolayer->startStream(); + + _session->startRunning(); + + _debug ("- ARTP Action: Start call %s\n",_ca->getCallId().c_str()); - audiolayer->startStream(); - _start.post(); - _debug("- ARTP Action: Start call %s\n",_ca->getCallId().c_str()); while (!testCancel()) { - - // printf("AudioRtpRTX::run() _session->getFirstTimestamp() %i \n",_session->getFirstTimestamp()); - - // printf("AudioRtpRTX::run() _session->isWaiting() %i \n",_session->isWaiting()); - ///////////////////// - //////////////////////////// - // Send session - //////////////////////////// - - sessionWaiting = _session->isWaiting(); - - sendSessionFromMic(timestamp); - timestamp += step; - - //////////////////////////// - // Recv session - //////////////////////////// - receiveSessionForSpkr(countTime); - - // Let's wait for the next transmit cycle - - - if(sessionWaiting == 1){ - // Record mic and speaker during conversation - _ca->recAudio.recData(spkrDataConverted,micData,_nSamplesSpkr,_nSamplesMic); - } - else { - // Record mic only while leaving a message - _ca->recAudio.recData(micData,_nSamplesMic); - } - - Thread::sleep(TimerPort::getTimer()); - // TimerPort::incTimer(20); // 'frameSize' ms - TimerPort::incTimer(threadSleep); - + // Send session + sessionWaiting = _session->isWaiting(); + + sendSessionFromMic (timestamp); + timestamp += timestep; + // timestamp = _session->getCurrentTimestamp(); + + // Recv session + receiveSessionForSpkr (countTime); + + // Let's wait for the next transmit cycle + + if (sessionWaiting == 1) { + // Record mic and speaker during conversation + _ca->recAudio.recData (spkrDataConverted,micData,_nSamplesSpkr,_nSamplesMic); + } else { + // Record mic only while leaving a message + _ca->recAudio.recData (micData,_nSamplesMic); + } + + // Let's wait for the next transmit cycle + Thread::sleep (TimerPort::getTimer()); + + // TimerPort::incTimer(20); // 'frameSize' ms + TimerPort::incTimer (threadSleep); } - - audiolayer->stopStream(); - _debug("- ARTP Action: Stop call %s\n",_ca->getCallId().c_str()); - //} catch(std::exception &e) { - //_start.post(); - //_debug("! ARTP: Stop %s\n", e.what()); - //throw; - //} catch(...) { - //_start.post(); - //_debugException("* ARTP Action: Stop"); - //throw; - //} - + + // _audiolayer->stopStream(); + _debug ("- ARTP Action: Stop call %s\n",_ca->getCallId().c_str()); + + } diff --git a/sflphone-common/src/audio/audiortp.h b/sflphone-common/src/audio/audiortp.h index 65669dc5d8fc729e94d00af47d9f04d121cf4636..e40f7a39798c0f154afdf32de62418d81b2b7055 100644 --- a/sflphone-common/src/audio/audiortp.h +++ b/sflphone-common/src/audio/audiortp.h @@ -35,6 +35,17 @@ #define UP_SAMPLING 0 #define DOWN_SAMPLING 1 + + +class AudioRtpException: public std::exception +{ + virtual const char* what() const throw() + { + return "AudioRtpException occured"; + } +}; + + /** * @file audiortp.h * @brief Manage the real-time data transport in a SIP call @@ -53,7 +64,7 @@ class AudioRtpRTX : public ost::Thread, public ost::TimerPort { * @param sipcall The pointer on the SIP call * @param sym Tells whether or not the voip links are symmetric */ - AudioRtpRTX (SIPCall* sipcall, bool sym); + AudioRtpRTX (SIPCall* sipcall, bool sym); /** * Destructor @@ -72,7 +83,17 @@ class AudioRtpRTX : public ost::Thread, public ost::TimerPort { // AudioRecord recAudio; /** A SIP call */ - SIPCall* _ca; + SIPCall* _ca; + + /** + * Update RTP session media info as received from SDP negociation + */ + void setRtpSessionMedia(void); + + /** + * Update RTP session remote ip destination as received from sip transaction + */ + void setRtpSessionRemoteIp(void); friend class RtpTest; @@ -95,7 +116,7 @@ class AudioRtpRTX : public ost::Thread, public ost::TimerPort { ost::SymmetricRTPSession *_session; /** Semaphore */ - ost::Semaphore _start; + // ost::Semaphore _start; /** Is the session symmetric or not */ bool _sym; @@ -112,6 +133,9 @@ class AudioRtpRTX : public ost::Thread, public ost::TimerPort { /** Sample rate converter object */ SamplerateConverter* converter; + /** audio layer */ + AudioLayer *_audiolayer; + /** Variables to process audio stream: sample rate for playing sound (typically 44100HZ) */ int _layerSampleRate; @@ -138,7 +162,12 @@ class AudioRtpRTX : public ost::Thread, public ost::TimerPort { /** * Maximum number of sample for audio buffers (mic and spkr) */ - int nbSamplesMax; + int nbSamplesMax; + + + + bool _payloadIsSet; + bool _remoteIpIsSet; /** * Init the RTP session. Create either symmetric or double sessions to manage data transport @@ -146,6 +175,23 @@ class AudioRtpRTX : public ost::Thread, public ost::TimerPort { */ void initAudioRtpSession(void); + /** + * Return the lenth the codec frame in ms + */ + float computeCodecFrameSize(int codecSamplePerFrame, int codecClockRate); + + /** + * Compute nb of byte to get coresponding to X ms at audio layer frame size (44.1 khz) + */ + int computeNbByteAudioLayer(float codecFrameSize); + + + int processDataEncode(); + + + void processDataDecode(unsigned char* spkrData, unsigned int size, int& countTime); + + /** * Get the data from the mic, encode it and send it through the RTP session * @param timestamp To manage time and synchronizing @@ -172,7 +218,7 @@ class AudioRtpRTX : public ost::Thread, public ost::TimerPort { * DOWNSAMPLING * @return int The number of samples after process */ - int reSampleData(int sampleRate_codec, int nbSamples, int status); + int reSampleData(SFLDataFormat *input, SFLDataFormat *output,int sampleRate_codec, int nbSamples, int status); /** The audio codec used during the session */ AudioCodec* _audiocodec; @@ -198,18 +244,29 @@ class AudioRtp { * Create a brand new RTP session by calling the AudioRtpRTX constructor * @param ca A pointer on a SIP call */ - int createNewSession (SIPCall *ca); + void createNewSession (SIPCall *ca); + + /** + * Start the AudioRtpRTX thread created with createNewSession + */ + int start(void); /** * Close a RTP session and kills the remaining threads */ bool closeRtpSession( void ); + /** + * Return a pointer to the RTP thead + */ + AudioRtpRTX* getRTX(); + /** * Start recording */ void setRecording (); + friend class RtpTest; private: // copy constructor @@ -220,7 +277,7 @@ class AudioRtp { /** The RTP thread */ AudioRtpRTX* _RTXThread; - + /** Symmetric session or not */ bool _symmetric; diff --git a/sflphone-common/src/audio/audiostream.cpp b/sflphone-common/src/audio/audiostream.cpp index 08587fdb310803fe561ae208c025869f6b7ab86b..8054c1e10ea9bb01056a214127dec0eb77b40029 100644 --- a/sflphone-common/src/audio/audiostream.cpp +++ b/sflphone-common/src/audio/audiostream.cpp @@ -6,12 +6,12 @@ * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. @@ -23,140 +23,149 @@ static pa_channel_map channel_map ; -AudioStream::AudioStream( pa_context* context, int type, std::string desc, double vol UNUSED ) - : _audiostream(NULL), _streamType(type), _streamDescription(desc), flag(PA_STREAM_AUTO_TIMING_UPDATE), sample_spec(), _volume() -{ - sample_spec.format = PA_SAMPLE_S16LE; - sample_spec.rate = 44100; - sample_spec.channels = 1; - channel_map.channels = 1; - pa_cvolume_set( &_volume , 1 , PA_VOLUME_NORM ) ; // * vol / 100 ; - - _context = context; +AudioStream::AudioStream (pa_context* context, int type, std::string desc, double vol UNUSED) + : _audiostream (NULL), _streamType (type), _streamDescription (desc), flag (PA_STREAM_AUTO_TIMING_UPDATE), sample_spec(), _volume() +{ + sample_spec.format = PA_SAMPLE_S16LE; + sample_spec.rate = 44100; + sample_spec.channels = 1; + channel_map.channels = 1; + pa_cvolume_set (&_volume , 1 , PA_VOLUME_NORM) ; // * vol / 100 ; - // connectStream(); -} + _context = context; + + // connectStream(); +} AudioStream::~AudioStream() -{ - disconnectStream(); +{ + disconnectStream(); } bool AudioStream::connectStream() { - ost::MutexLock guard(_mutex); + ost::MutexLock guard (_mutex); - if(!_audiostream) - _audiostream = createStream( _context ); - else { - disconnectStream(); - _audiostream = createStream( _context ); - } + if (!_audiostream) + _audiostream = createStream (_context); - return true; + return true; } bool -AudioStream::disconnectStream( void ) -{ - ost::MutexLock guard(_mutex); +AudioStream::disconnectStream (void) +{ + ost::MutexLock guard (_mutex); - _debug("Destroy audio streams\n"); - pa_stream_disconnect( _audiostream ); - pa_stream_unref( _audiostream ); + _debug ("Destroy audio streams\n"); + pa_stream_disconnect (_audiostream); + pa_stream_unref (_audiostream); - _audiostream = NULL; + _audiostream = NULL; - return true; -} + return true; +} -void -AudioStream::stream_state_callback( pa_stream* s, void* user_data UNUSED ) +void +AudioStream::stream_state_callback (pa_stream* s, void* user_data UNUSED) { - - - _debug("AudioStream::stream_state_callback :: The state of the stream changed\n"); - assert(s); - switch(pa_stream_get_state(s)){ - case PA_STREAM_CREATING: - _debug("Stream is creating...\n"); - break; - case PA_STREAM_TERMINATED: - _debug("Stream is terminating...\n" ); - PulseLayer::streamState++; - break; - case PA_STREAM_READY: - - _debug("Stream successfully created, connected to %s\n", pa_stream_get_device_name( s )); - // pa_stream_cork( s, 0, NULL, NULL); - break; - case PA_STREAM_UNCONNECTED: - _debug("Stream unconnected\n"); - break; - case PA_STREAM_FAILED: - default: - _debug("Stream error - Sink/Source doesn't exists: %s\n" , pa_strerror(pa_context_errno(pa_stream_get_context(s)))); - exit(0); - break; - } + + + _debug ("AudioStream::stream_state_callback :: The state of the stream changed\n"); + assert (s); + + switch (pa_stream_get_state (s)) { + + case PA_STREAM_CREATING: + _debug ("Stream is creating...\n"); + break; + + case PA_STREAM_TERMINATED: + _debug ("Stream is terminating...\n"); + PulseLayer::streamState++; + break; + + case PA_STREAM_READY: + + _debug ("Stream successfully created, connected to %s\n", pa_stream_get_device_name (s)); + // pa_stream_cork( s, 0, NULL, NULL); + break; + + case PA_STREAM_UNCONNECTED: + _debug ("Stream unconnected\n"); + break; + + case PA_STREAM_FAILED: + + default: + _debug ("Stream error - Sink/Source doesn't exists: %s\n" , pa_strerror (pa_context_errno (pa_stream_get_context (s)))); + exit (0); + break; + } } -pa_stream_state_t -AudioStream::getStreamState(void) { +pa_stream_state_t +AudioStream::getStreamState (void) +{ - ost::MutexLock guard(_mutex); - return pa_stream_get_state(_audiostream); + ost::MutexLock guard (_mutex); + return pa_stream_get_state (_audiostream); } - pa_stream* -AudioStream::createStream( pa_context* c ) +pa_stream* +AudioStream::createStream (pa_context* c) { - ost::MutexLock guard(_mutex); - - pa_stream* s; - //pa_cvolume cv; - - assert(pa_sample_spec_valid(&sample_spec)); - assert(pa_channel_map_valid(&channel_map)); - - pa_buffer_attr* attributes = (pa_buffer_attr*)malloc( sizeof(pa_buffer_attr) ); - if( !( s = pa_stream_new( c, _streamDescription.c_str() , &sample_spec, &channel_map ) ) ) - _debug("%s: pa_stream_new() failed : %s\n" , _streamDescription.c_str(), pa_strerror( pa_context_errno( c))); - - assert( s ); - - if( _streamType == PLAYBACK_STREAM ){ - attributes->maxlength = 66500; - attributes->tlength = 10000; - attributes->prebuf = 10000; - attributes->minreq = 940; - // pa_stream_connect_playback( s , NULL , attributes, PA_STREAM_INTERPOLATE_TIMING, &_volume, NULL); - pa_stream_connect_playback( s , NULL , attributes, PA_STREAM_START_CORKED, &_volume, NULL); - } - else if( _streamType == CAPTURE_STREAM ){ - - attributes->maxlength = 66500; - attributes->fragsize = (uint32_t)-1; - - pa_stream_connect_record( s , NULL , attributes , PA_STREAM_START_CORKED ); - // pa_stream_connect_record( s , NULL , attributes , PA_STREAM_INTERPOLATE_TIMING ); - } - else if( _streamType == UPLOAD_STREAM ){ - pa_stream_connect_upload( s , 1024 ); - } - else{ - _debug( "Stream type unknown \n"); - } - - pa_stream_set_state_callback( s , stream_state_callback, NULL); - - free(attributes); - - return s; + ost::MutexLock guard (_mutex); + + pa_stream* s; + //pa_cvolume cv; + + assert (pa_sample_spec_valid (&sample_spec)); + assert (pa_channel_map_valid (&channel_map)); + + pa_buffer_attr* attributes = (pa_buffer_attr*) malloc (sizeof (pa_buffer_attr)); + + if (! (s = pa_stream_new (c, _streamDescription.c_str() , &sample_spec, &channel_map))) + _debug ("%s: pa_stream_new() failed : %s\n" , _streamDescription.c_str(), pa_strerror (pa_context_errno (c))); + + assert (s); + + if (_streamType == PLAYBACK_STREAM) { + attributes->maxlength = 60000; + attributes->tlength = 4096; + attributes->prebuf = 4096; + attributes->minreq = 940; + attributes->fragsize = 4096; + // pa_stream_connect_playback( s , NULL , attributes, PA_STREAM_INTERPOLATE_TIMING, &_volume, NULL); + pa_stream_connect_playback (s , NULL , attributes, PA_STREAM_START_CORKED, &_volume, NULL); + } else if (_streamType == CAPTURE_STREAM) { + + // attributes->maxlength = 66500; + // attributes->fragsize = (uint32_t)-1; + + attributes->maxlength = 60000; + attributes->tlength = 4096; + attributes->prebuf = 4096; + attributes->minreq = 940; + attributes->fragsize = 4096; + + pa_stream_connect_record (s , NULL , attributes , PA_STREAM_START_CORKED); + // pa_stream_connect_record( s , NULL , attributes , PA_STREAM_INTERPOLATE_TIMING ); + } else if (_streamType == UPLOAD_STREAM) { + pa_stream_connect_upload (s , 1024); + } else { + _debug ("Stream type unknown \n"); + } + + pa_stream_set_state_callback (s , stream_state_callback, NULL); + + free (attributes); + + return s; } diff --git a/sflphone-common/src/audio/codecDescriptor.cpp b/sflphone-common/src/audio/codecDescriptor.cpp index 1b927cfa1648644e0cf3a584b855979dac222658..d0fa1da9274a5325ab164a90cfe3aa0f89ce691d 100644 --- a/sflphone-common/src/audio/codecDescriptor.cpp +++ b/sflphone-common/src/audio/codecDescriptor.cpp @@ -3,17 +3,17 @@ * Author: Yan Morin <yan.morin@savoirfairelinux.com> * Author: Laurielle Lea <laurielle.lea@savoirfairelinux.com> * Author: Emmanuel Milou <emmanuel.milou@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 * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. @@ -24,7 +24,7 @@ #include "codecDescriptor.h" -CodecDescriptor::CodecDescriptor() : _CodecsMap(), _codecOrder(), _Cache(), _nbCodecs(), _CodecInMemory() +CodecDescriptor::CodecDescriptor() : _CodecsMap(), _codecOrder(), _Cache(), _nbCodecs(), _CodecInMemory() { } @@ -32,304 +32,337 @@ CodecDescriptor::~CodecDescriptor() { } - void -CodecDescriptor::deleteHandlePointer( void ) +void +CodecDescriptor::deleteHandlePointer (void) { - int i; - for( i = 0 ; (unsigned int)i < _CodecInMemory.size() ; i++) - { - unloadCodec( _CodecInMemory[i] ); - } + int i; + + for (i = 0 ; (unsigned int) i < _CodecInMemory.size() ; i++) { + unloadCodec (_CodecInMemory[i]); + } } - void +void CodecDescriptor::init() { - std::vector<AudioCodec*> CodecDynamicList = scanCodecDirectory(); - _nbCodecs = CodecDynamicList.size(); - if( _nbCodecs <= 0 ){ - _debug(" Error - No codecs available in directory %s\n" , CODECS_DIR); - } - - int i; - for( i = 0 ; i < _nbCodecs ; i++ ) { - _CodecsMap[(AudioCodecType)CodecDynamicList[i]->getPayload()] = CodecDynamicList[i]; - _debug("%s\n" , CodecDynamicList[i]->getCodecName().c_str()); - } + std::vector<AudioCodec*> CodecDynamicList = scanCodecDirectory(); + _nbCodecs = CodecDynamicList.size(); + + if (_nbCodecs <= 0) { + _debug (" Error - No codecs available in directory %s\n" , CODECS_DIR); + } + + int i; + + for (i = 0 ; i < _nbCodecs ; i++) { + _CodecsMap[ (AudioCodecType) CodecDynamicList[i]->getPayload() ] = CodecDynamicList[i]; + _debug ("%s\n" , CodecDynamicList[i]->getCodecName().c_str()); + } } - void +void CodecDescriptor::setDefaultOrder() { - _codecOrder.clear(); - CodecsMap::iterator iter = _CodecsMap.begin(); - while( iter != _CodecsMap.end()) - { - _codecOrder.push_back(iter->first); - iter->second->setState( true ); - iter ++ ; - } + _codecOrder.clear(); + CodecsMap::iterator iter = _CodecsMap.begin(); + + while (iter != _CodecsMap.end()) { + _codecOrder.push_back (iter->first); + iter->second->setState (true); + iter ++ ; + } } - std::string -CodecDescriptor::getCodecName(AudioCodecType payload) +std::string +CodecDescriptor::getCodecName (AudioCodecType payload) { - std::string resNull = ""; - CodecsMap::iterator iter = _CodecsMap.find(payload); - if (iter!=_CodecsMap.end()) { - return (iter->second->getCodecName()); - } - return resNull; + std::string resNull = ""; + CodecsMap::iterator iter = _CodecsMap.find (payload); + + if (iter!=_CodecsMap.end()) { + return (iter->second->getCodecName()); + } + + return resNull; } - AudioCodec* -CodecDescriptor::getCodec(AudioCodecType payload) +AudioCodec* +CodecDescriptor::getCodec (AudioCodecType payload) { - CodecsMap::iterator iter = _CodecsMap.find(payload); - if (iter!=_CodecsMap.end()) { - return (iter->second); - } - return NULL; + CodecsMap::iterator iter = _CodecsMap.find (payload); + + if (iter!=_CodecsMap.end()) { + return (iter->second); + } + + return NULL; } - bool -CodecDescriptor::isActive(AudioCodecType payload) +bool +CodecDescriptor::isActive (AudioCodecType payload) { - int i; - for(i=0 ; (unsigned int)i < _codecOrder.size() ; i++) - { - if(_codecOrder[i] == payload) - return true; - } - return false; + int i; + + for (i=0 ; (unsigned int) i < _codecOrder.size() ; i++) { + if (_codecOrder[i] == payload) + return true; + } + + return false; } - void -CodecDescriptor::removeCodec(AudioCodecType payload UNUSED) +void +CodecDescriptor::removeCodec (AudioCodecType payload UNUSED) { } - void -CodecDescriptor::addCodec(AudioCodecType payload UNUSED) +void +CodecDescriptor::addCodec (AudioCodecType payload UNUSED) { } - double -CodecDescriptor::getBitRate(AudioCodecType payload) +double +CodecDescriptor::getBitRate (AudioCodecType payload) { - CodecsMap::iterator iter = _CodecsMap.find(payload); - if (iter!=_CodecsMap.end()) - return (iter->second->getBitRate()); - else - return 0.0; + CodecsMap::iterator iter = _CodecsMap.find (payload); + + if (iter!=_CodecsMap.end()) + return (iter->second->getBitRate()); + else + return 0.0; } - double -CodecDescriptor::getBandwidthPerCall(AudioCodecType payload) +double +CodecDescriptor::getBandwidthPerCall (AudioCodecType payload) { - CodecsMap::iterator iter = _CodecsMap.find(payload); - if (iter!=_CodecsMap.end()) - return (iter->second->getBandwidth()); - else - return 0.0; + CodecsMap::iterator iter = _CodecsMap.find (payload); + + if (iter!=_CodecsMap.end()) + return (iter->second->getBandwidth()); + else + return 0.0; } - int -CodecDescriptor::getSampleRate(AudioCodecType payload) +int +CodecDescriptor::getSampleRate (AudioCodecType payload) { - CodecsMap::iterator iter = _CodecsMap.find(payload); - if (iter!=_CodecsMap.end()) - return (iter->second->getClockRate()); - else - return 0; + CodecsMap::iterator iter = _CodecsMap.find (payload); + + if (iter!=_CodecsMap.end()) + return (iter->second->getClockRate()); + else + return 0; } - int -CodecDescriptor::getChannel(AudioCodecType payload) +int +CodecDescriptor::getChannel (AudioCodecType payload) { - CodecsMap::iterator iter = _CodecsMap.find(payload); - if (iter!=_CodecsMap.end()) - return (iter->second->getChannel()); - else - return 0; + CodecsMap::iterator iter = _CodecsMap.find (payload); + + if (iter!=_CodecsMap.end()) + return (iter->second->getChannel()); + else + return 0; } - void -CodecDescriptor::saveActiveCodecs(const std::vector<std::string>& list) +void +CodecDescriptor::saveActiveCodecs (const std::vector<std::string>& list) { - _codecOrder.clear(); - // list contains the ordered payload of active codecs picked by the user - // we used the CodecOrder vector to save the order. - int i=0; - int payload; - size_t size = list.size(); - while( (unsigned int)i < size ) - { - payload = std::atoi(list[i].data()); - if( isCodecLoaded( payload ) ) { - _codecOrder.push_back((AudioCodecType)payload); - _CodecsMap.find((AudioCodecType)payload)->second->setState( true ); + _codecOrder.clear(); + // list contains the ordered payload of active codecs picked by the user + // we used the CodecOrder vector to save the order. + int i=0; + int payload; + size_t size = list.size(); + + while ( (unsigned int) i < size) { + payload = std::atoi (list[i].data()); + + if (isCodecLoaded (payload)) { + _codecOrder.push_back ( (AudioCodecType) payload); + _CodecsMap.find ( (AudioCodecType) payload)->second->setState (true); + } + + i++; } - i++; - } } - std::vector<AudioCodec*> -CodecDescriptor::scanCodecDirectory( void ) +std::vector<AudioCodec*> +CodecDescriptor::scanCodecDirectory (void) { - std::vector<AudioCodec*> codecs; - std::string tmp; - int i; - - std::string libDir = std::string(CODECS_DIR).append("/"); - std::string homeDir = std::string(HOMEDIR) + DIR_SEPARATOR_STR + "." + PROGDIR + "/"; - std::vector<std::string> dirToScan; - dirToScan.push_back(homeDir); - dirToScan.push_back(libDir); - - for( i = 0 ; (unsigned int)i < dirToScan.size() ; i++ ) - { - std::string dirStr = dirToScan[i]; - _debug("Scanning %s to find audio codecs....\n", dirStr.c_str()); - DIR *dir = opendir( dirStr.c_str() ); - AudioCodec* audioCodec; - if( dir ){ - dirent *dirStruct; - while( (dirStruct = readdir( dir )) ) { - tmp = dirStruct -> d_name ; - if( tmp == CURRENT_DIR || tmp == PARENT_DIR){} - else{ - if( seemsValid( tmp ) && !alreadyInCache( tmp )) - { - //_debug("Codec : %s\n", tmp.c_str()); - _Cache.push_back( tmp ); - audioCodec = loadCodec( dirStr.append(tmp) ); - codecs.push_back( audioCodec ); - dirStr = dirToScan[i]; - } - } - } + std::vector<AudioCodec*> codecs; + std::string tmp; + int i; + + std::string libDir = std::string (CODECS_DIR).append ("/"); + std::string homeDir = std::string (HOMEDIR) + DIR_SEPARATOR_STR + "." + PROGDIR + "/"; + std::vector<std::string> dirToScan; + dirToScan.push_back (homeDir); + dirToScan.push_back (libDir); + + for (i = 0 ; (unsigned int) i < dirToScan.size() ; i++) { + std::string dirStr = dirToScan[i]; + _debug ("Scanning %s to find audio codecs....\n", dirStr.c_str()); + DIR *dir = opendir (dirStr.c_str()); + AudioCodec* audioCodec; + + if (dir) { + dirent *dirStruct; + + while ( (dirStruct = readdir (dir))) { + tmp = dirStruct -> d_name ; + if (tmp == CURRENT_DIR || tmp == PARENT_DIR) {} else { + if (seemsValid (tmp) && !alreadyInCache (tmp)) { + //_debug("Codec : %s\n", tmp.c_str()); + _Cache.push_back (tmp); + audioCodec = loadCodec (dirStr.append (tmp)); + codecs.push_back (audioCodec); + dirStr = dirToScan[i]; + } + } + } + } + + closedir (dir); } - closedir( dir ); - } - return codecs; + + return codecs; } - AudioCodec* -CodecDescriptor::loadCodec( std::string path ) +AudioCodec* +CodecDescriptor::loadCodec (std::string path) { - //_debug("Load path %s\n", path.c_str()); - CodecHandlePointer p; - using std::cerr; - void * codecHandle = dlopen( path.c_str() , RTLD_LAZY ); - if( !codecHandle ) - cerr << dlerror() << '\n'; - dlerror(); - create_t* createCodec = (create_t*)dlsym( codecHandle , "create" ); - if( dlerror() ) - cerr << dlerror() << '\n'; - AudioCodec* a = createCodec(); - p = CodecHandlePointer( a, codecHandle ); - _CodecInMemory.push_back(p); - - return a; + //_debug("Load path %s\n", path.c_str()); + CodecHandlePointer p; + using std::cerr; + void * codecHandle = dlopen (path.c_str() , RTLD_LAZY); + + if (!codecHandle) + cerr << dlerror() << '\n'; + + dlerror(); + + create_t* createCodec = (create_t*) dlsym (codecHandle , "create"); + + if (dlerror()) + cerr << dlerror() << '\n'; + + AudioCodec* a = createCodec(); + + p = CodecHandlePointer (a, codecHandle); + + _CodecInMemory.push_back (p); + + return a; } - void -CodecDescriptor::unloadCodec( CodecHandlePointer p ) +void +CodecDescriptor::unloadCodec (CodecHandlePointer p) { - // _debug("Unload codec %s\n", p.first->getCodecName().c_str()); - using std::cerr; - destroy_t* destroyCodec = (destroy_t*)dlsym( p.second , "destroy"); - if(dlerror()) - cerr << dlerror() << '\n'; - destroyCodec(p.first); - dlclose(p.second); + // _debug("Unload codec %s\n", p.first->getCodecName().c_str()); + using std::cerr; + destroy_t* destroyCodec = (destroy_t*) dlsym (p.second , "destroy"); + + if (dlerror()) + cerr << dlerror() << '\n'; + + destroyCodec (p.first); + + dlclose (p.second); } - AudioCodec* -CodecDescriptor::getFirstCodecAvailable( void ) +AudioCodec* +CodecDescriptor::getFirstCodecAvailable (void) { - CodecsMap::iterator iter = _CodecsMap.begin(); - if( iter != _CodecsMap.end()) - return iter->second; - else - return NULL; + CodecsMap::iterator iter = _CodecsMap.begin(); + + if (iter != _CodecsMap.end()) + return iter->second; + else + return NULL; } - bool -CodecDescriptor::seemsValid( std::string lib) +bool +CodecDescriptor::seemsValid (std::string lib) { - // The name of the shared library seems valid <==> it looks like libcodec_xxx.so - // We check this - std::string begin = SFL_CODEC_VALID_PREFIX; - std::string end = SFL_CODEC_VALID_EXTEN; - - // First : check the length of the file name. - // If it is shorter than begin.length() + end.length() , not a SFL shared library - if( lib.length() <= begin.length() + end.length() ) - return false; + // The name of the shared library seems valid <==> it looks like libcodec_xxx.so + // We check this + std::string begin = SFL_CODEC_VALID_PREFIX; + std::string end = SFL_CODEC_VALID_EXTEN; - // Second: check the extension of the file name. - // If it is different than SFL_CODEC_VALID_EXTEN , not a SFL shared library - if( lib.substr( lib.length() - end.length() , lib.length()) != end ) - return false; + // First : check the length of the file name. + // If it is shorter than begin.length() + end.length() , not a SFL shared library + + if (lib.length() <= begin.length() + end.length()) + return false; + + // Second: check the extension of the file name. + // If it is different than SFL_CODEC_VALID_EXTEN , not a SFL shared library + if (lib.substr (lib.length() - end.length() , lib.length()) != end) + return false; #ifdef HAVE_SPEEX_CODEC - // Nothing special + // Nothing special #else - if( lib.substr(begin.length() , lib.length() - begin.length() - end.length()) == SPEEX_STRING_DESCRIPTION) - return false; + if (lib.substr (begin.length() , lib.length() - begin.length() - end.length()) == SPEEX_STRING_DESCRIPTION) + return false; + #endif #ifdef HAVE_GSM_CODEC - // Nothing special + // Nothing special #else - if( lib.substr(begin.length() , lib.length() - begin.length() - end.length()) == GSM_STRING_DESCRIPTION ) - return false; + if (lib.substr (begin.length() , lib.length() - begin.length() - end.length()) == GSM_STRING_DESCRIPTION) + return false; + #endif #ifdef BUILD_ILBC - // Nothing special + // Nothing special #else - if( lib.substr(begin.length() , lib.length() - begin.length() - end.length()) == ILBC_STRING_DESCRIPTION ) - return false; + if (lib.substr (begin.length() , lib.length() - begin.length() - end.length()) == ILBC_STRING_DESCRIPTION) + return false; + #endif - if(lib.substr(0, begin.length()) == begin) - if(lib.substr(lib.length() - end.length() , end.length() ) == end) - return true; + if (lib.substr (0, begin.length()) == begin) + if (lib.substr (lib.length() - end.length() , end.length()) == end) + return true; + else + return false; else - return false; - else - return false; + return false; } - bool -CodecDescriptor::alreadyInCache( std::string lib ) +bool +CodecDescriptor::alreadyInCache (std::string lib) { - int i; - for( i = 0 ; (unsigned int)i < _Cache.size() ; i++ ) - { - if( _Cache[i] == lib ){ - return true;} - } - return false; + int i; + + for (i = 0 ; (unsigned int) i < _Cache.size() ; i++) { + if (_Cache[i] == lib) { + return true; + } + } + + return false; } bool -CodecDescriptor::isCodecLoaded( int payload ) +CodecDescriptor::isCodecLoaded (int payload) { - CodecsMap::iterator iter = _CodecsMap.begin(); - while( iter != _CodecsMap.end()) - { - if( iter -> first == payload) - return true; - iter++; - } - return false; + CodecsMap::iterator iter = _CodecsMap.begin(); + + while (iter != _CodecsMap.end()) { + if (iter -> first == payload) + return true; + + iter++; + } + + return false; } diff --git a/sflphone-common/src/audio/codecDescriptor.h b/sflphone-common/src/audio/codecDescriptor.h index e23a18509dae5555938deb0b02ec363560097966..ade7c1272329f9853cf855278da9983656b64717 100644 --- a/sflphone-common/src/audio/codecDescriptor.h +++ b/sflphone-common/src/audio/codecDescriptor.h @@ -40,6 +40,8 @@ typedef enum { PAYLOAD_CODEC_GSM = 3, // 8 PCMA A 8000 1 [RFC3551] PAYLOAD_CODEC_ALAW = 8, + // 9 G722 A 8000 1 [RFC3551] + PAYLOAD_CODEC_G722 = 9, // http://www.ietf.org/rfc/rfc3952.txt // 97 iLBC/8000 PAYLOAD_CODEC_ILBC_20 = 97, diff --git a/sflphone-common/src/audio/codecs/Makefile.am b/sflphone-common/src/audio/codecs/Makefile.am index 5595edfae999604a00d8b24a1e22182499d8f388..4cd422d798678bffaee2dcfadf3f0e37277177ef 100644 --- a/sflphone-common/src/audio/codecs/Makefile.am +++ b/sflphone-common/src/audio/codecs/Makefile.am @@ -31,6 +31,14 @@ libcodec_speex_wb_so_LDFLAGS = --shared -lc -lspeex $(SPEEX_NIMP) INSTALL_SPEEX_WB_RULE = install-libcodec_speex_wb_so endif +if BUILD_SPEEX +SPEEX_UB_LIB = libcodec_speex_ub.so +libcodec_speex_ub_so_SOURCES = speexcodec_ub.cpp +libcodec_speex_ub_so_CFLAGS = -fPIC -g -Wall +libcodec_speex_ub_so_CXXFLAGS = -fPIC -g -Wall $(SPEEXDSP) +libcodec_speex_ub_so_LDFLAGS = --shared -lc -lspeex $(SPEEX_NIMP) +INSTALL_SPEEX_UB_RULE = install-libcodec_speex_ub_so +endif if BUILD_CELT CELT_LIB = libcodec_celt.so @@ -42,17 +50,7 @@ INSTALL_CELT_RULE = install-libcodec_celt_so endif -if BUILD_ILBC -ILBC_LIB = libcodec_ilbc.so -libcodec_ilbc_so_SOURCES = ilbc.cpp -libcodec_ilbc_so_CFLAGS = -fPIC -g -Wall -libcodec_ilbc_so_CXXFLAGS = -fPIC -g -Wall -libcodec_ilbc_so_LDFLAGS = --shared ilbc/*.o -lc -INSTALL_ILBC_RULE = install-libcodec_ilbc_so -SUBDIRS = ilbc -endif - -noinst_PROGRAMS = libcodec_ulaw.so libcodec_alaw.so $(GSM_LIB) $(SPEEX_NB_LIB) $(SPEEX_WB_LIB) $(CELT_LIB) $(ILBC_LIB) +noinst_PROGRAMS = libcodec_ulaw.so libcodec_alaw.so libcodec_g722.so $(GSM_LIB) $(SPEEX_NB_LIB) $(SPEEX_WB_LIB) $(SPEEX_UB_LIB) $(CELT_LIB) noinst_HEADERS = audiocodec.h @@ -67,8 +65,13 @@ libcodec_alaw_so_CFLAGS = -fPIC -g -Wall libcodec_alaw_so_CXXFLAGS = -fPIC -g -Wall libcodec_alaw_so_LDFLAGS = --shared -lc -install-exec-local: install-libcodec_ulaw_so install-libcodec_alaw_so $(INSTALL_GSM_RULE) $(INSTALL_SPEEX_NB_RULE) $(INSTALL_SPEEX_WB_RULE) $(INSTALL_CELT_RULE) $(INSTALL_ILBC_RULE) -uninstall-local: uninstall-libcodec_ulaw_so uninstall-libcodec_alaw_so uninstall-libcodec_gsm_so uninstall-libcodec_speex_nb_so uninstall-libcodec_speex_wb_so uninstall-libcodec_celt_so +libcodec_g722_so_SOURCES = g722.cpp +libcodec_g722_so_CFLAGS = -fPIC -g -Wall +libcodec_g722_so_CXXFLAGS = -fPIC -g -Wall +libcodec_g722_so_LDFLAGS = --shared -lc + +install-exec-local: install-libcodec_ulaw_so install-libcodec_alaw_so install-libcodec_g722_so $(INSTALL_GSM_RULE) $(INSTALL_SPEEX_NB_RULE) $(INSTALL_SPEEX_WB_RULE) $(INSTALL_SPEEX_UB_RULE) $(INSTALL_CELT_RULE) $(INSTALL_ILBC_RULE) +uninstall-local: uninstall-libcodec_ulaw_so uninstall-libcodec_alaw_so uninstall-libcodec_g722_so uninstall-libcodec_gsm_so uninstall-libcodec_speex_nb_so uninstall-libcodec_speex_wb_so uninstall-libcodec_speex_ub_so uninstall-libcodec_celt_so install-libcodec_ulaw_so: libcodec_ulaw.so @@ -76,31 +79,35 @@ install-libcodec_ulaw_so: libcodec_ulaw.so $(INSTALL_PROGRAM) libcodec_ulaw.so $(sflcodecdir) install-libcodec_alaw_so: libcodec_alaw.so $(INSTALL_PROGRAM) libcodec_alaw.so $(sflcodecdir) +install-libcodec_g722_so: libcodec_g722.so + $(INSTALL_PROGRAM) libcodec_g722.so $(sflcodecdir) install-libcodec_gsm_so: libcodec_gsm.so $(INSTALL_PROGRAM) libcodec_gsm.so $(sflcodecdir) install-libcodec_speex_nb_so: libcodec_speex_nb.so $(INSTALL_PROGRAM) libcodec_speex_nb.so $(sflcodecdir) install-libcodec_speex_wb_so: libcodec_speex_wb.so $(INSTALL_PROGRAM) libcodec_speex_wb.so $(sflcodecdir) +install-libcodec_speex_ub_so: libcodec_speex_ub.so + $(INSTALL_PROGRAM) libcodec_speex_ub.so $(sflcodecdir) install-libcodec_celt_so: libcodec_celt.so $(INSTALL_PROGRAM) libcodec_celt.so $(sflcodecdir) -install-libcodec_ilbc_so: libcodec_ilbc.so - $(INSTALL_PROGRAM) libcodec_ilbc.so $(sflcodecdir) uninstall-libcodec_ulaw_so: rm -f $(sflcodecdir)/libcodec_ulaw.so uninstall-libcodec_alaw_so: rm -f $(sflcodecdir)/libcodec_alaw.so +uninstall-libcodec_g722_so: + rm -f $(sflcodecdir)/libcodec_g722.so uninstall-libcodec_gsm_so: rm -f $(sflcodecdir)/libcodec_gsm.so uninstall-libcodec_speex_nb_so: rm -f $(sflcodecdir)/libcodec_speex_nb.so uninstall-libcodec_speex_wb_so: rm -f $(sflcodecdir)/libcodec_speex_wb.so +uninstall-libcodec_speex_ub_so: + rm -f $(sflcodecdir)/libcodec_speex_ub.so rm -rf $(sflcodecdir) -install-libcodec_celt_so: libcodec_celt.so +uninstall-libcodec_celt_so: libcodec_celt.so $(INSTALL_PROGRAM) libcodec_celt.so $(sflcodecdir) -uninstall-libcodec_ilbc_so: - rm -f $(sflcodecdir)/libcodec_ilbc.so diff --git a/sflphone-common/src/audio/codecs/alaw.cpp b/sflphone-common/src/audio/codecs/alaw.cpp index c0e0c02c9483ed629c67da88df38ab4ec523b39d..e8a3928a7283e620b2dc2341cc0ea5df429f3bb7 100644 --- a/sflphone-common/src/audio/codecs/alaw.cpp +++ b/sflphone-common/src/audio/codecs/alaw.cpp @@ -2,7 +2,7 @@ * Copyright (C) 2004-2005 Savoir-Faire Linux inc. * Author: Yan Morin <yan.morin@savoirfairelinux.com> * Author: Laurielle Lea <laurielle.lea@savoirfairelinux.com> - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or @@ -12,7 +12,7 @@ * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. @@ -21,113 +21,115 @@ #include "../common.h" #include "audiocodec.h" -class Alaw : public AudioCodec { -public: - // 8 PCMA A 8000 1 [RFC3551] - Alaw(int payload=0) - : AudioCodec(payload, "PCMA") - { - _clockRate = 8000; - _frameSize = 160; // samples, 20 ms at 8kHz - _channel = 1; - _bitrate = 64; - _bandwidth = 80; - } - - virtual ~Alaw(){} - virtual int codecDecode (short *dst, unsigned char *src, unsigned int size) - { - // _debug("Decoded by alaw \n"); - int16* end = dst+size; - while(dst<end) - *dst++ = ALawDecode(*src++); - return size<<1; - } - - virtual int codecEncode (unsigned char *dst, short *src, unsigned int size) - { - // _debug("Encoded by alaw \n"); - size >>= 1; - uint8* end = dst+size; - while(dst<end) - *dst++ = ALawEncode(*src++); - return size; - } - - - - int ALawDecode(uint8 alaw) - { - alaw ^= 0x55; // A-law has alternate bits inverted for transmission - uint sign = alaw&0x80; - int linear = alaw&0x1f; - linear <<= 4; - linear += 8; // Add a 'half' bit (0x08) to place PCM value in middle of range - - alaw &= 0x7f; - if(alaw>=0x20) - { - linear |= 0x100; // Put in MSB - uint shift = (alaw>>4)-1; - linear <<= shift; - } - - if(!sign) - return -linear; - else - return linear; - } - - - uint8 ALawEncode (int16 pcm16) - { - int p = pcm16; - uint a; // u-law value we are forming - - if(p<0) - { - p = ~p; - a = 0x00; // sign = 0 - } - else - { - //+ve value - a = 0x80; //sign = 1 - } - //calculate segment and interval numbers - p >>= 4; - if(p>=0x20) - { - if(p>=0x100) - { - p >>= 4; - a += 0x40; - } - if(p>=0x40) - { - p >>= 2; - a += 0x20; - } - if(p>=0x20) - { - p >>= 1; - a += 0x10; - } +class Alaw : public AudioCodec +{ + + public: + // 8 PCMA A 8000 1 [RFC3551] + Alaw (int payload=0) + : AudioCodec (payload, "PCMA") { + _clockRate = 8000; + _frameSize = 160; // samples, 20 ms at 8kHz + _channel = 1; + _bitrate = 64; + _bandwidth = 80; + } + + virtual ~Alaw() {} + + virtual int codecDecode (short *dst, unsigned char *src, unsigned int size) { + // _debug("Decoded by alaw \n"); + int16* end = dst+size; + + while (dst<end) + *dst++ = ALawDecode (*src++); + + return size<<1; + } + + virtual int codecEncode (unsigned char *dst, short *src, unsigned int size) { + // _debug("Encoded by alaw \n"); + size >>= 1; + uint8* end = dst+size; + + while (dst<end) + *dst++ = ALawEncode (*src++); + + return size; + } + + + + int ALawDecode (uint8 alaw) { + alaw ^= 0x55; // A-law has alternate bits inverted for transmission + uint sign = alaw&0x80; + int linear = alaw&0x1f; + linear <<= 4; + linear += 8; // Add a 'half' bit (0x08) to place PCM value in middle of range + + alaw &= 0x7f; + + if (alaw>=0x20) { + linear |= 0x100; // Put in MSB + uint shift = (alaw>>4)-1; + linear <<= shift; + } + + if (!sign) + return -linear; + else + return linear; + } + + + uint8 ALawEncode (int16 pcm16) { + int p = pcm16; + uint a; // u-law value we are forming + + if (p<0) { + p = ~p; + a = 0x00; // sign = 0 + } else { + //+ve value + a = 0x80; //sign = 1 + } + + //calculate segment and interval numbers + p >>= 4; + + if (p>=0x20) { + if (p>=0x100) { + p >>= 4; + a += 0x40; + } + + if (p>=0x40) { + p >>= 2; + a += 0x20; } - // a&0x70 now holds segment value and 'p' the interval number - a += p; // a now equal to encoded A-law value - return a^0x55; // A-law has alternate bits inverted for transmission - } + if (p>=0x20) { + p >>= 1; + a += 0x10; + } + } + + // a&0x70 now holds segment value and 'p' the interval number + a += p; // a now equal to encoded A-law value + + return a^0x55; // A-law has alternate bits inverted for transmission + } }; // the class factories -extern "C" AudioCodec* create() { - return new Alaw(8); +extern "C" AudioCodec* create() +{ + return new Alaw (8); } -extern "C" void destroy(AudioCodec* a) { +extern "C" void destroy (AudioCodec* a) +{ delete a; } diff --git a/sflphone-common/src/audio/codecs/audiocodec.h b/sflphone-common/src/audio/codecs/audiocodec.h index c7ad5ccf1468a78c025c5dbecee0887a68d960d9..1487fb465dce56cd9a5821ba8cd3a4695398adca 100644 --- a/sflphone-common/src/audio/codecs/audiocodec.h +++ b/sflphone-common/src/audio/codecs/audiocodec.h @@ -34,12 +34,30 @@ public: : _codecName(codecName), _clockRate(8000), _channel(1), _bitrate(0.0),_bandwidth(0),_payload(payload), _hasDynamicPayload(false),_state(true) { _hasDynamicPayload = (_payload >= 96 && _payload <= 127) ? true : false; + + // If g722 (payload 9), we need to init libccrtp symetric sessions with using + // dynamic payload format. This way we get control on rtp clockrate. + + if(_payload == 9) + { + _hasDynamicPayload = true; + } + } AudioCodec( const AudioCodec& codec ) : _codecName(codec._codecName), _clockRate(codec._clockRate), _channel(codec._channel), _bitrate(codec._bitrate),_bandwidth(codec._bandwidth),_payload(codec._payload), _hasDynamicPayload(false),_state(true) { _hasDynamicPayload = (_payload >= 96 && _payload <= 127) ? true : false; + + // If g722 (payload 9), we need to init libccrtp symetric sessions with using + // dynamic payload format. This way we get control on rtp clockrate. + + if(_payload == 9) + { + _hasDynamicPayload = true; + } + } virtual ~AudioCodec() { diff --git a/sflphone-common/src/audio/codecs/celtcodec.cpp b/sflphone-common/src/audio/codecs/celtcodec.cpp index 574b11394fa889b25452939934a9b35c6faa5771..93cf4470d4aac4bb97b56105395db0c5b5f66a3c 100644 --- a/sflphone-common/src/audio/codecs/celtcodec.cpp +++ b/sflphone-common/src/audio/codecs/celtcodec.cpp @@ -22,31 +22,31 @@ #include <celt/celt.h> -class Celt : public AudioCodec{ +class Celt : public AudioCodec +{ + public: - Celt(int payload=0) - : AudioCodec(payload, "celt") - { - _clockRate = 44100; - _frameSize = 512; // fixed frameSize, TODO: support variable size from 64 to 512 - _channel = 1; - _bitrate = 0; - _bandwidth = 0; - initCelt(); - } - - Celt( const Celt& ); - Celt& operator=(const Celt&); + Celt (int payload=0) + : AudioCodec (payload, "celt") { + _clockRate = 44100; + _frameSize = 512; // fixed frameSize, TODO: support variable size from 64 to 512 + _channel = 1; + _bitrate = 0; + _bandwidth = 0; + initCelt(); + } + + Celt (const Celt&); + Celt& operator= (const Celt&); void initCelt() { - printf("init celt"); - - mode = celt_mode_create(_clockRate, _channel, _frameSize, NULL); + printf ("init celt"); + + mode = celt_mode_create (_clockRate, _channel, _frameSize, NULL); // celt_mode_info(mode, CELT_GET_LOOKAHEAD, &skip); - if (mode == NULL) - { - printf("failed to create a mode\n"); + if (mode == NULL) { + printf ("failed to create a mode\n"); } // bytes_per_packet = 1024; @@ -58,35 +58,33 @@ class Celt : public AudioCodec{ // celt_mode_info(mode, CELT_GET_FRAME_SIZE, &frame_size); // celt_mode_info(mode, CELT_GET_NB_CHANNELS, &_channel); - enc = celt_encoder_create(mode); - dec = celt_decoder_create(mode); + enc = celt_encoder_create (mode); + + dec = celt_decoder_create (mode); + + celt_encoder_ctl (enc,CELT_SET_COMPLEXITY (10)); - celt_encoder_ctl(enc,CELT_SET_COMPLEXITY(10)); - } - ~Celt() - { + ~Celt() { terminateCelt(); } void terminateCelt() { - - celt_encoder_destroy(enc); - celt_decoder_destroy(dec); + + celt_encoder_destroy (enc); + celt_decoder_destroy (dec); } - virtual int codecDecode (short *dst, unsigned char *src, unsigned int size) - { + virtual int codecDecode (short *dst, unsigned char *src, unsigned int size) { int err = 0; - err = celt_decode(dec, src, size, (celt_int16_t*)dst); - return _frameSize * sizeof(celt_int16_t); + err = celt_decode (dec, src, size, (celt_int16_t*) dst); + return _frameSize * sizeof (celt_int16_t); } - virtual int codecEncode (unsigned char *dst, short *src, unsigned int size) - { + virtual int codecEncode (unsigned char *dst, short *src, unsigned int size) { int len = 0; - len = celt_encode(enc, (celt_int16_t *)src, (celt_int16_t *)src, dst, 512); + len = celt_encode (enc, (celt_int16_t *) src, (celt_int16_t *) src, dst, 512); // returns the number of bytes writen return len; } @@ -94,20 +92,22 @@ class Celt : public AudioCodec{ private: CELTMode *mode; - + CELTEncoder *enc; CELTDecoder *dec; celt_int32_t _celt_frame_size; celt_int32_t skip; - + }; // the class factories -extern "C" AudioCodec* create() { - return new Celt(115); +extern "C" AudioCodec* create() +{ + return new Celt (115); } -extern "C" void destroy(AudioCodec* a) { +extern "C" void destroy (AudioCodec* a) +{ delete a; } diff --git a/sflphone-common/src/audio/codecs/g722.cpp b/sflphone-common/src/audio/codecs/g722.cpp new file mode 100644 index 0000000000000000000000000000000000000000..45db24c5df0f442b9fdd607ca12e575f00a4cf97 --- /dev/null +++ b/sflphone-common/src/audio/codecs/g722.cpp @@ -0,0 +1,799 @@ +/** + * Copyright (C) 2009 Savoir-Faire Linux inc. + * Author: Alexandre Savard <alexandre.savard@savoirfairelinux.com> + * + * Motly borrowed from asterisk's sources (Steve Underwood <steveu@coppice.org>) + * + * 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 + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + **/ + + + +#include "../common.h" +#include "audiocodec.h" +#include "g722.h" + +#include <stdlib.h> +#include <string.h> + +#define TRUE 1 +#define FALSE 0 + + +class G722 : public AudioCodec +{ + + public: + + G722 (int payload=9) + : AudioCodec (payload, "G722") { + _clockRate = 16000; + _frameSize = 320; // samples, 10 ms at 16kHz + _channel = 1; + _bitrate = 64; + _bandwidth = 80; + + + decode_s = new g722_decode_state_t; + encode_s = new g722_encode_state_t; + + g722_decode_init (64000, 0); + g722_encode_init (64000, 0); + + } + + virtual int codecDecode (short *dst, unsigned char *src, unsigned int size) { + + int in_byte = size; + int out_samples; + + out_samples = g722_decode ( (int16_t*) dst, (const uint8_t*) src, in_byte); + + return out_samples * 2; + } + + virtual int codecEncode (unsigned char *dst, short *src, unsigned int size) { + + // 2 bytes per sample (int16) + int in_samples = size / 2; + int out_bytes; + + out_bytes = g722_encode ( (uint8_t*) dst, (const int16_t*) src, in_samples); + + return out_bytes; + } + + + void g722_encode_init (int rate, int options) { + + encode_s->itu_test_mode = FALSE; + + // 8 => 64 kbps; 7 => 56 kbps; 6 => 48 kbps + encode_s->bits_per_sample = 8; + + // Enable 8khz mode, encode using lower subband only + encode_s->eight_k = FALSE; + + // Never set packed TRUE when using 64 kbps + encode_s->packed = FALSE; + encode_s->band[0].det = 32; + encode_s->band[1].det = 8; + } + + void g722_decode_init (int rate, int options) { + + decode_s->itu_test_mode = FALSE; + + // 8 => 64 kbps; 7 => 56 kbps; 6 => 48 kbps + decode_s->bits_per_sample = 8; + + // Enable 8khz mode, encode using lower subband only + decode_s->eight_k = FALSE; + + // Never set packed TRUE when using 64 kbps + decode_s->packed = FALSE; + decode_s->band[0].det = 32; + decode_s->band[1].det = 8; + } + + int16_t saturate (int32_t amp) { + int16_t amp16; + + /* Hopefully this is optimised for the common case - not clipping */ + amp16 = (int16_t) amp; + + if (amp == amp16) + return amp16; + + if (amp > INT16_MAX) + return INT16_MAX; + + return INT16_MIN; + } + + + void block4_encode (int band, int d) { + int wd1; + int wd2; + int wd3; + int i; + + /* Block 4, RECONS */ + encode_s->band[band].d[0] = d; + encode_s->band[band].r[0] = saturate (encode_s->band[band].s + d); + + /* Block 4, PARREC */ + encode_s->band[band].p[0] = saturate (encode_s->band[band].sz + d); + + /* Block 4, UPPOL2 */ + + for (i = 0; i < 3; i++) + encode_s->band[band].sg[i] = encode_s->band[band].p[i] >> 15; + + wd1 = saturate (encode_s->band[band].a[1] << 2); + + wd2 = (encode_s->band[band].sg[0] == encode_s->band[band].sg[1]) ? -wd1 : wd1; + + if (wd2 > 32767) + wd2 = 32767; + + wd3 = (wd2 >> 7) + ( (encode_s->band[band].sg[0] == encode_s->band[band].sg[2]) ? 128 : -128); + + wd3 += (encode_s->band[band].a[2]*32512) >> 15; + + if (wd3 > 12288) + wd3 = 12288; + else if (wd3 < -12288) + wd3 = -12288; + + encode_s->band[band].ap[2] = wd3; + + /* Block 4, UPPOL1 */ + encode_s->band[band].sg[0] = encode_s->band[band].p[0] >> 15; + + encode_s->band[band].sg[1] = encode_s->band[band].p[1] >> 15; + + wd1 = (encode_s->band[band].sg[0] == encode_s->band[band].sg[1]) ? 192 : -192; + + wd2 = (encode_s->band[band].a[1]*32640) >> 15; + + encode_s->band[band].ap[1] = saturate (wd1 + wd2); + + wd3 = saturate (15360 - encode_s->band[band].ap[2]); + + if (encode_s->band[band].ap[1] > wd3) + encode_s->band[band].ap[1] = wd3; + else if (encode_s->band[band].ap[1] < -wd3) + encode_s->band[band].ap[1] = -wd3; + + /* Block 4, UPZERO */ + wd1 = (d == 0) ? 0 : 128; + + encode_s->band[band].sg[0] = d >> 15; + + for (i = 1; i < 7; i++) { + encode_s->band[band].sg[i] = encode_s->band[band].d[i] >> 15; + wd2 = (encode_s->band[band].sg[i] == encode_s->band[band].sg[0]) ? wd1 : -wd1; + wd3 = (encode_s->band[band].b[i]*32640) >> 15; + encode_s->band[band].bp[i] = saturate (wd2 + wd3); + } + + /* Block 4, DELAYA */ + for (i = 6; i > 0; i--) { + encode_s->band[band].d[i] = encode_s->band[band].d[i - 1]; + encode_s->band[band].b[i] = encode_s->band[band].bp[i]; + } + + for (i = 2; i > 0; i--) { + encode_s->band[band].r[i] = encode_s->band[band].r[i - 1]; + encode_s->band[band].p[i] = encode_s->band[band].p[i - 1]; + encode_s->band[band].a[i] = encode_s->band[band].ap[i]; + } + + /* Block 4, FILTEP */ + wd1 = saturate (encode_s->band[band].r[1] + encode_s->band[band].r[1]); + + wd1 = (encode_s->band[band].a[1]*wd1) >> 15; + + wd2 = saturate (encode_s->band[band].r[2] + encode_s->band[band].r[2]); + + wd2 = (encode_s->band[band].a[2]*wd2) >> 15; + + encode_s->band[band].sp = saturate (wd1 + wd2); + + /* Block 4, FILTEZ */ + encode_s->band[band].sz = 0; + + for (i = 6; i > 0; i--) { + wd1 = saturate (encode_s->band[band].d[i] + encode_s->band[band].d[i]); + encode_s->band[band].sz += (encode_s->band[band].b[i]*wd1) >> 15; + } + + encode_s->band[band].sz = saturate (encode_s->band[band].sz); + + /* Block 4, PREDIC */ + encode_s->band[band].s = saturate (encode_s->band[band].sp + encode_s->band[band].sz); + + } + + void block4_decode (int band, int d) { + int wd1; + int wd2; + int wd3; + int i; + + /* Block 4, RECONS */ + decode_s->band[band].d[0] = d; + decode_s->band[band].r[0] = saturate (decode_s->band[band].s + d); + + /* Block 4, PARREC */ + decode_s->band[band].p[0] = saturate (decode_s->band[band].sz + d); + + /* Block 4, UPPOL2 */ + + for (i = 0; i < 3; i++) + decode_s->band[band].sg[i] = decode_s->band[band].p[i] >> 15; + + wd1 = saturate (decode_s->band[band].a[1] << 2); + + wd2 = (decode_s->band[band].sg[0] == decode_s->band[band].sg[1]) ? -wd1 : wd1; + + if (wd2 > 32767) + wd2 = 32767; + + wd3 = (decode_s->band[band].sg[0] == decode_s->band[band].sg[2]) ? 128 : -128; + + wd3 += (wd2 >> 7); + + wd3 += (decode_s->band[band].a[2]*32512) >> 15; + + if (wd3 > 12288) + wd3 = 12288; + else if (wd3 < -12288) + wd3 = -12288; + + decode_s->band[band].ap[2] = wd3; + + /* Block 4, UPPOL1 */ + decode_s->band[band].sg[0] = decode_s->band[band].p[0] >> 15; + + decode_s->band[band].sg[1] = decode_s->band[band].p[1] >> 15; + + wd1 = (decode_s->band[band].sg[0] == decode_s->band[band].sg[1]) ? 192 : -192; + + wd2 = (decode_s->band[band].a[1]*32640) >> 15; + + decode_s->band[band].ap[1] = saturate (wd1 + wd2); + + wd3 = saturate (15360 - decode_s->band[band].ap[2]); + + if (decode_s->band[band].ap[1] > wd3) + decode_s->band[band].ap[1] = wd3; + else if (decode_s->band[band].ap[1] < -wd3) + decode_s->band[band].ap[1] = -wd3; + + /* Block 4, UPZERO */ + wd1 = (d == 0) ? 0 : 128; + + decode_s->band[band].sg[0] = d >> 15; + + for (i = 1; i < 7; i++) { + decode_s->band[band].sg[i] = decode_s->band[band].d[i] >> 15; + wd2 = (decode_s->band[band].sg[i] == decode_s->band[band].sg[0]) ? wd1 : -wd1; + wd3 = (decode_s->band[band].b[i]*32640) >> 15; + decode_s->band[band].bp[i] = saturate (wd2 + wd3); + } + + /* Block 4, DELAYA */ + for (i = 6; i > 0; i--) { + decode_s->band[band].d[i] = decode_s->band[band].d[i - 1]; + decode_s->band[band].b[i] = decode_s->band[band].bp[i]; + } + + for (i = 2; i > 0; i--) { + decode_s->band[band].r[i] = decode_s->band[band].r[i - 1]; + decode_s->band[band].p[i] = decode_s->band[band].p[i - 1]; + decode_s->band[band].a[i] = decode_s->band[band].ap[i]; + } + + /* Block 4, FILTEP */ + wd1 = saturate (decode_s->band[band].r[1] + decode_s->band[band].r[1]); + + wd1 = (decode_s->band[band].a[1]*wd1) >> 15; + + wd2 = saturate (decode_s->band[band].r[2] + decode_s->band[band].r[2]); + + wd2 = (decode_s->band[band].a[2]*wd2) >> 15; + + decode_s->band[band].sp = saturate (wd1 + wd2); + + /* Block 4, FILTEZ */ + decode_s->band[band].sz = 0; + + for (i = 6; i > 0; i--) { + wd1 = saturate (decode_s->band[band].d[i] + decode_s->band[band].d[i]); + decode_s->band[band].sz += (decode_s->band[band].b[i]*wd1) >> 15; + } + + decode_s->band[band].sz = saturate (decode_s->band[band].sz); + + /* Block 4, PREDIC */ + decode_s->band[band].s = saturate (decode_s->band[band].sp + decode_s->band[band].sz); + } + + int g722_encode_release() { + delete decode_s; + } + + + int g722_decode_release() { + delete encode_s; + } + + int g722_decode (int16_t amp[], const uint8_t g722_data[], int len) { + static const int wl[8] = {-60, -30, 58, 172, 334, 538, 1198, 3042 }; + static const int rl42[16] = {0, 7, 6, 5, 4, 3, 2, 1, 7, 6, 5, 4, 3, 2, 1, 0 }; + static const int ilb[32] = { + 2048, 2093, 2139, 2186, 2233, 2282, 2332, + 2383, 2435, 2489, 2543, 2599, 2656, 2714, + 2774, 2834, 2896, 2960, 3025, 3091, 3158, + 3228, 3298, 3371, 3444, 3520, 3597, 3676, + 3756, 3838, 3922, 4008 + }; + static const int wh[3] = {0, -214, 798}; + static const int rh2[4] = {2, 1, 2, 1}; + static const int qm2[4] = {-7408, -1616, 7408, 1616}; + static const int qm4[16] = { + 0, -20456, -12896, -8968, + -6288, -4240, -2584, -1200, + 20456, 12896, 8968, 6288, + 4240, 2584, 1200, 0 + }; + static const int qm5[32] = { + -280, -280, -23352, -17560, + -14120, -11664, -9752, -8184, + -6864, -5712, -4696, -3784, + -2960, -2208, -1520, -880, + 23352, 17560, 14120, 11664, + 9752, 8184, 6864, 5712, + 4696, 3784, 2960, 2208, + 1520, 880, 280, -280 + }; + static const int qm6[64] = { + -136, -136, -136, -136, + -24808, -21904, -19008, -16704, + -14984, -13512, -12280, -11192, + -10232, -9360, -8576, -7856, + -7192, -6576, -6000, -5456, + -4944, -4464, -4008, -3576, + -3168, -2776, -2400, -2032, + -1688, -1360, -1040, -728, + 24808, 21904, 19008, 16704, + 14984, 13512, 12280, 11192, + 10232, 9360, 8576, 7856, + 7192, 6576, 6000, 5456, + 4944, 4464, 4008, 3576, + 3168, 2776, 2400, 2032, + 1688, 1360, 1040, 728, + 432, 136, -432, -136 + }; + static const int qmf_coeffs[12] = { + 3, -11, 12, 32, -210, 951, 3876, -805, 362, -156, 53, -11, + }; + + int dlowt; + int rlow; + int ihigh; + int dhigh; + int rhigh; + int xout1; + int xout2; + int wd1; + int wd2; + int wd3; + int code; + int outlen; + int i; + int j; + + outlen = 0; + rhigh = 0; + + for (j = 0; j < len;) { + if (decode_s->packed) { + /* Unpack the code bits */ + if (decode_s->in_bits < decode_s->bits_per_sample) { + decode_s->in_buffer |= (g722_data[j++] << decode_s->in_bits); + decode_s->in_bits += 8; + } + + code = decode_s->in_buffer & ( (1 << decode_s->bits_per_sample) - 1); + + decode_s->in_buffer >>= decode_s->bits_per_sample; + decode_s->in_bits -= decode_s->bits_per_sample; + } else { + code = g722_data[j++]; + } + + switch (decode_s->bits_per_sample) { + + default: + + case 8: + wd1 = code & 0x3F; + ihigh = (code >> 6) & 0x03; + wd2 = qm6[wd1]; + wd1 >>= 2; + break; + + case 7: + wd1 = code & 0x1F; + ihigh = (code >> 5) & 0x03; + wd2 = qm5[wd1]; + wd1 >>= 1; + break; + + case 6: + wd1 = code & 0x0F; + ihigh = (code >> 4) & 0x03; + wd2 = qm4[wd1]; + break; + } + + /* Block 5L, LOW BAND INVQBL */ + wd2 = (decode_s->band[0].det*wd2) >> 15; + + /* Block 5L, RECONS */ + rlow = decode_s->band[0].s + wd2; + + /* Block 6L, LIMIT */ + if (rlow > 16383) + rlow = 16383; + else if (rlow < -16384) + rlow = -16384; + + /* Block 2L, INVQAL */ + wd2 = qm4[wd1]; + + dlowt = (decode_s->band[0].det*wd2) >> 15; + + /* Block 3L, LOGSCL */ + wd2 = rl42[wd1]; + + wd1 = (decode_s->band[0].nb*127) >> 7; + + wd1 += wl[wd2]; + + if (wd1 < 0) + wd1 = 0; + else if (wd1 > 18432) + wd1 = 18432; + + decode_s->band[0].nb = wd1; + + /* Block 3L, SCALEL */ + wd1 = (decode_s->band[0].nb >> 6) & 31; + + wd2 = 8 - (decode_s->band[0].nb >> 11); + + wd3 = (wd2 < 0) ? (ilb[wd1] << -wd2) : (ilb[wd1] >> wd2); + + decode_s->band[0].det = wd3 << 2; + + block4_decode (0, dlowt); + + if (!decode_s->eight_k) { + /* Block 2H, INVQAH */ + wd2 = qm2[ihigh]; + dhigh = (decode_s->band[1].det*wd2) >> 15; + /* Block 5H, RECONS */ + rhigh = dhigh + decode_s->band[1].s; + /* Block 6H, LIMIT */ + + if (rhigh > 16383) + rhigh = 16383; + else if (rhigh < -16384) + rhigh = -16384; + + /* Block 2H, INVQAH */ + wd2 = rh2[ihigh]; + + wd1 = (decode_s->band[1].nb*127) >> 7; + + wd1 += wh[wd2]; + + if (wd1 < 0) + wd1 = 0; + else if (wd1 > 22528) + wd1 = 22528; + + decode_s->band[1].nb = wd1; + + /* Block 3H, SCALEH */ + wd1 = (decode_s->band[1].nb >> 6) & 31; + + wd2 = 10 - (decode_s->band[1].nb >> 11); + + wd3 = (wd2 < 0) ? (ilb[wd1] << -wd2) : (ilb[wd1] >> wd2); + + decode_s->band[1].det = wd3 << 2; + + block4_decode (1, dhigh); + } + + if (decode_s->itu_test_mode) { + amp[outlen++] = (int16_t) (rlow << 1); + amp[outlen++] = (int16_t) (rhigh << 1); + } else { + if (decode_s->eight_k) { + amp[outlen++] = (int16_t) rlow; + } else { + /* Apply the receive QMF */ + for (i = 0; i < 22; i++) + decode_s->x[i] = decode_s->x[i + 2]; + + decode_s->x[22] = rlow + rhigh; + + decode_s->x[23] = rlow - rhigh; + + xout1 = 0; + + xout2 = 0; + + for (i = 0; i < 12; i++) { + xout2 += decode_s->x[2*i]*qmf_coeffs[i]; + xout1 += decode_s->x[2*i + 1]*qmf_coeffs[11 - i]; + } + + amp[outlen++] = (int16_t) (xout1 >> 12); + + amp[outlen++] = (int16_t) (xout2 >> 12); + } + } + } + + return outlen; + } + + int g722_encode (uint8_t g722_data[], const int16_t amp[], int len) { + static const int q6[32] = { + 0, 35, 72, 110, 150, 190, 233, 276, + 323, 370, 422, 473, 530, 587, 650, 714, + 786, 858, 940, 1023, 1121, 1219, 1339, 1458, + 1612, 1765, 1980, 2195, 2557, 2919, 0, 0 + }; + static const int iln[32] = { + 0, 63, 62, 31, 30, 29, 28, 27, + 26, 25, 24, 23, 22, 21, 20, 19, + 18, 17, 16, 15, 14, 13, 12, 11, + 10, 9, 8, 7, 6, 5, 4, 0 + }; + static const int ilp[32] = { + 0, 61, 60, 59, 58, 57, 56, 55, + 54, 53, 52, 51, 50, 49, 48, 47, + 46, 45, 44, 43, 42, 41, 40, 39, + 38, 37, 36, 35, 34, 33, 32, 0 + }; + static const int wl[8] = { + -60, -30, 58, 172, 334, 538, 1198, 3042 + }; + static const int rl42[16] = { + 0, 7, 6, 5, 4, 3, 2, 1, 7, 6, 5, 4, 3, 2, 1, 0 + }; + static const int ilb[32] = { + 2048, 2093, 2139, 2186, 2233, 2282, 2332, + 2383, 2435, 2489, 2543, 2599, 2656, 2714, + 2774, 2834, 2896, 2960, 3025, 3091, 3158, + 3228, 3298, 3371, 3444, 3520, 3597, 3676, + 3756, 3838, 3922, 4008 + }; + static const int qm4[16] = { + 0, -20456, -12896, -8968, + -6288, -4240, -2584, -1200, + 20456, 12896, 8968, 6288, + 4240, 2584, 1200, 0 + }; + static const int qm2[4] = { + -7408, -1616, 7408, 1616 + }; + static const int qmf_coeffs[12] = { + 3, -11, 12, 32, -210, 951, 3876, -805, 362, -156, 53, -11, + }; + static const int ihn[3] = {0, 1, 0}; + static const int ihp[3] = {0, 3, 2}; + static const int wh[3] = {0, -214, 798}; + static const int rh2[4] = {2, 1, 2, 1}; + + int dlow; + int dhigh; + int el; + int wd; + int wd1; + int ril; + int wd2; + int il4; + int ih2; + int wd3; + int eh; + int mih; + int i; + int j; + /* Low and high band PCM from the QMF */ + int xlow; + int xhigh; + int g722_bytes; + /* Even and odd tap accumulators */ + int sumeven; + int sumodd; + int ihigh; + int ilow; + int code; + + g722_bytes = 0; + xhigh = 0; + + for (j = 0; j < len;) { + if (encode_s->itu_test_mode) { + xlow = + xhigh = amp[j++] >> 1; + } else { + if (encode_s->eight_k) { + xlow = amp[j++]; + } else { + /* Apply the transmit QMF */ + /* Shuffle the buffer down */ + for (i = 0; i < 22; i++) + encode_s->x[i] = encode_s->x[i + 2]; + + encode_s->x[22] = amp[j++]; + + encode_s->x[23] = amp[j++]; + + /* Discard every other QMF output */ + sumeven = 0; + + sumodd = 0; + + for (i = 0; i < 12; i++) { + sumodd += encode_s->x[2*i]*qmf_coeffs[i]; + sumeven += encode_s->x[2*i + 1]*qmf_coeffs[11 - i]; + } + + xlow = (sumeven + sumodd) >> 13; + + xhigh = (sumeven - sumodd) >> 13; + } + } + + /* Block 1L, SUBTRA */ + el = saturate (xlow - encode_s->band[0].s); + + /* Block 1L, QUANTL */ + wd = (el >= 0) ? el : - (el + 1); + + for (i = 1; i < 30; i++) { + wd1 = (q6[i]*encode_s->band[0].det) >> 12; + + if (wd < wd1) + break; + } + + ilow = (el < 0) ? iln[i] : ilp[i]; + + /* Block 2L, INVQAL */ + ril = ilow >> 2; + wd2 = qm4[ril]; + dlow = (encode_s->band[0].det*wd2) >> 15; + + /* Block 3L, LOGSCL */ + il4 = rl42[ril]; + wd = (encode_s->band[0].nb*127) >> 7; + encode_s->band[0].nb = wd + wl[il4]; + + if (encode_s->band[0].nb < 0) + encode_s->band[0].nb = 0; + else if (encode_s->band[0].nb > 18432) + encode_s->band[0].nb = 18432; + + /* Block 3L, SCALEL */ + wd1 = (encode_s->band[0].nb >> 6) & 31; + + wd2 = 8 - (encode_s->band[0].nb >> 11); + + wd3 = (wd2 < 0) ? (ilb[wd1] << -wd2) : (ilb[wd1] >> wd2); + + encode_s->band[0].det = wd3 << 2; + + block4_encode (0, dlow); + + if (encode_s->eight_k) { + /* Just leave the high bits as zero */ + code = (0xC0 | ilow) >> (8 - encode_s->bits_per_sample); + } else { + /* Block 1H, SUBTRA */ + eh = saturate (xhigh - encode_s->band[1].s); + + /* Block 1H, QUANTH */ + wd = (eh >= 0) ? eh : - (eh + 1); + wd1 = (564*encode_s->band[1].det) >> 12; + mih = (wd >= wd1) ? 2 : 1; + ihigh = (eh < 0) ? ihn[mih] : ihp[mih]; + + /* Block 2H, INVQAH */ + wd2 = qm2[ihigh]; + dhigh = (encode_s->band[1].det*wd2) >> 15; + + /* Block 3H, LOGSCH */ + ih2 = rh2[ihigh]; + wd = (encode_s->band[1].nb*127) >> 7; + encode_s->band[1].nb = wd + wh[ih2]; + + if (encode_s->band[1].nb < 0) + encode_s->band[1].nb = 0; + else if (encode_s->band[1].nb > 22528) + encode_s->band[1].nb = 22528; + + /* Block 3H, SCALEH */ + wd1 = (encode_s->band[1].nb >> 6) & 31; + + wd2 = 10 - (encode_s->band[1].nb >> 11); + + wd3 = (wd2 < 0) ? (ilb[wd1] << -wd2) : (ilb[wd1] >> wd2); + + encode_s->band[1].det = wd3 << 2; + + block4_encode (1, dhigh); + + code = ( (ihigh << 6) | ilow) >> (8 - encode_s->bits_per_sample); + } + + if (encode_s->packed) { + /* Pack the code bits */ + encode_s->out_buffer |= (code << encode_s->out_bits); + encode_s->out_bits += encode_s->bits_per_sample; + + if (encode_s->out_bits >= 8) { + g722_data[g722_bytes++] = (uint8_t) (encode_s->out_buffer & 0xFF); + encode_s->out_bits -= 8; + encode_s->out_buffer >>= 8; + } + } else { + g722_data[g722_bytes++] = (uint8_t) code; + } + } + + return g722_bytes; + } + + + private: + + g722_decode_state_t *decode_s; + g722_encode_state_t *encode_s; + +}; + +// the class factories +extern "C" AudioCodec* create() +{ + return new G722 (9); +} + +extern "C" void destroy (AudioCodec* a) +{ + delete a; +} + + diff --git a/sflphone-common/src/audio/codecs/g722.h b/sflphone-common/src/audio/codecs/g722.h new file mode 100644 index 0000000000000000000000000000000000000000..7d8cf4f725605d399c4a6c27ac85a8502c144736 --- /dev/null +++ b/sflphone-common/src/audio/codecs/g722.h @@ -0,0 +1,143 @@ +/** + * Copyright (C) 2009 Savoir-Faire Linux inc. + * Author: Alexandre Savard <alexandre.savard@savoirfairelinux.com> + * + * Motly borrowed from asterisk's sources (Steve Underwood <steveu@coppice.org>) + * + * 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 + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + **/ + + + +#if !defined(_G722_H_) +#define _G722_H_ + +/** + +The G.722 module is a bit exact implementation of the ITU G.722 specification for all three +specified bit rates - 64000bps, 56000bps and 48000bps. It passes the ITU tests. + +To allow fast and flexible interworking with narrow band telephony, the encoder and decoder +support an option for the linear audio to be an 8k samples/second stream. In this mode the +codec is considerably faster, and still fully compatible with wideband terminals using G.722. + +*/ + +enum +{ + G722_SAMPLE_RATE_8000 = 0x0001, + G722_PACKED = 0x0002 +}; + +#ifndef INT16_MAX +#define INT16_MAX 32767 +#endif +#ifndef INT16_MIN +#define INT16_MIN (-32768) +#endif + +typedef struct +{ + /*! TRUE if the operating in the special ITU test mode, with the band split filters + disabled. */ + int itu_test_mode; + /*! TRUE if the G.722 data is packed */ + int packed; + /*! TRUE if encode from 8k samples/second */ + int eight_k; + /*! 6 for 48000kbps, 7 for 56000kbps, or 8 for 64000kbps. */ + int bits_per_sample; + + /*! Signal history for the QMF */ + int x[24]; + + struct + { + int s; + int sp; + int sz; + int r[3]; + int a[3]; + int ap[3]; + int p[3]; + int d[7]; + int b[7]; + int bp[7]; + int sg[7]; + int nb; + int det; + } band[2]; + + unsigned int in_buffer; + int in_bits; + unsigned int out_buffer; + int out_bits; +} g722_encode_state_t; + +typedef struct +{ + /*! TRUE if the operating in the special ITU test mode, with the band split filters + disabled. */ + int itu_test_mode; + /*! TRUE if the G.722 data is packed */ + int packed; + /*! TRUE if decode to 8k samples/second */ + int eight_k; + /*! 6 for 48000kbps, 7 for 56000kbps, or 8 for 64000kbps. */ + int bits_per_sample; + + /*! Signal history for the QMF */ + int x[24]; + + struct + { + int s; + int sp; + int sz; + int r[3]; + int a[3]; + int ap[3]; + int p[3]; + int d[7]; + int b[7]; + int bp[7]; + int sg[7]; + int nb; + int det; + } band[2]; + + unsigned int in_buffer; + int in_bits; + unsigned int out_buffer; + int out_bits; +} g722_decode_state_t; + +#ifdef __cplusplus +extern "C" { +#endif + +void g722_encode_init(int rate, int options); +int g722_encode_release(); +int g722_encode(uint8_t g722_data[], const int16_t amp[], int len); + +void g722_decode_init(int rate, int options); +int g722_decode_release(); +int g722_decode(int16_t amp[], const uint8_t g722_data[], int len); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sflphone-common/src/audio/codecs/gsmcodec.cpp b/sflphone-common/src/audio/codecs/gsmcodec.cpp index 6f5a4269eca5b7adfcc03d230609ea90bcd0a172..8543dec2b59ed44e86766565444406fc2663de46 100644 --- a/sflphone-common/src/audio/codecs/gsmcodec.cpp +++ b/sflphone-common/src/audio/codecs/gsmcodec.cpp @@ -20,63 +20,72 @@ #include "audiocodec.h" -extern "C"{ +extern "C" +{ #include <gsm/gsm.h> } /** * GSM audio codec C++ class (over gsm/gsm.h) */ -class Gsm : public AudioCodec { -public: - // _payload should be 3 - Gsm (int payload=3): AudioCodec(payload, "GSM"), _decode_gsmhandle(NULL), _encode_gsmhandle(NULL){ - _clockRate = 8000; - _frameSize = 160; // samples, 20 ms at 8kHz - _channel = 1; - _bitrate = 13.3; - _bandwidth = 29.2; - - if (!(_decode_gsmhandle = gsm_create() )) - printf("ERROR: decode_gsm_create\n"); - if (!(_encode_gsmhandle = gsm_create() )) - printf("AudioCodec: ERROR: encode_gsm_create\n"); - } - - Gsm( const Gsm& ); - - Gsm& operator=( const Gsm& ); - - virtual ~Gsm (void){ - gsm_destroy(_decode_gsmhandle); - gsm_destroy(_encode_gsmhandle); - } - - virtual int codecDecode (short * dst, unsigned char * src, unsigned int size){ - // _debug("Decoded by gsm \n"); - (void)size; - if(gsm_decode(_decode_gsmhandle, (gsm_byte*)src, (gsm_signal*)dst) < 0) - printf("ERROR: gsm_decode\n"); - return 320; - } - - virtual int codecEncode (unsigned char * dst, short * src, unsigned int size){ - - // _debug("Encoded by gsm \n"); - (void)size; - gsm_encode(_encode_gsmhandle, (gsm_signal*)src, (gsm_byte*) dst); - return 33; - } - -private: - gsm _decode_gsmhandle; - gsm _encode_gsmhandle; + +class Gsm : public AudioCodec +{ + + public: + // _payload should be 3 + Gsm (int payload=3) : AudioCodec (payload, "GSM"), _decode_gsmhandle (NULL), _encode_gsmhandle (NULL) { + _clockRate = 8000; + _frameSize = 160; // samples, 20 ms at 8kHz + _channel = 1; + _bitrate = 13.3; + _bandwidth = 29.2; + + if (! (_decode_gsmhandle = gsm_create())) + printf ("ERROR: decode_gsm_create\n"); + + if (! (_encode_gsmhandle = gsm_create())) + printf ("AudioCodec: ERROR: encode_gsm_create\n"); + } + + Gsm (const Gsm&); + + Gsm& operator= (const Gsm&); + + virtual ~Gsm (void) { + gsm_destroy (_decode_gsmhandle); + gsm_destroy (_encode_gsmhandle); + } + + virtual int codecDecode (short * dst, unsigned char * src, unsigned int size) { + // _debug("Decoded by gsm \n"); + (void) size; + + if (gsm_decode (_decode_gsmhandle, (gsm_byte*) src, (gsm_signal*) dst) < 0) + printf ("ERROR: gsm_decode\n"); + + return 320; + } + + virtual int codecEncode (unsigned char * dst, short * src, unsigned int size) { + + // _debug("Encoded by gsm \n"); + (void) size; + gsm_encode (_encode_gsmhandle, (gsm_signal*) src, (gsm_byte*) dst); + return 33; + } + + private: + gsm _decode_gsmhandle; + gsm _encode_gsmhandle; }; -extern "C" AudioCodec* create(){ - return new Gsm(3); +extern "C" AudioCodec* create() +{ + return new Gsm (3); } -extern "C" void destroy(AudioCodec* a){ - delete a; +extern "C" void destroy (AudioCodec* a) +{ + delete a; } diff --git a/sflphone-common/src/audio/codecs/ilbc.cpp b/sflphone-common/src/audio/codecs/ilbc.cpp deleted file mode 100644 index 3c56b599f03e90000db589814d7bba43fce600ec..0000000000000000000000000000000000000000 --- a/sflphone-common/src/audio/codecs/ilbc.cpp +++ /dev/null @@ -1,50 +0,0 @@ -#include "audiocodec.h" - -extern "C" { -#include "ilbc/iLBC_encode.h" -#include "ilbc/iLBC_decode.h" -} - -class Ilbc: public AudioCodec -{ -public: - Ilbc(int payload) - : AudioCodec(payload, "iLBC"){ - _clockRate = 8000; - _channel = 1; - _bitrate = 13.3; - _bandwidth = 31.3; - - initILBC(); - - } - - void initILBC(){ - initDecode(ilbc_dec, 20, 1); - initEncode(ilbc_enc, 20); - } - - virtual int codecDecode(short *dst, unsigned char *src, unsigned int size){ - iLBC_decode((float*) dst, src, ilbc_dec, 0); - return 160; - } - - virtual int codecEncode(unsigned char *dst, short* src, unsigned int size){ - iLBC_encode(dst, (float*) src, ilbc_enc); - return 160; - } - -private: - iLBC_Dec_Inst_t* ilbc_dec; - iLBC_Enc_Inst_t* ilbc_enc; -}; - -// the class factories -extern "C" AudioCodec* create(){ - return new Ilbc(97); -} - -extern "C" void destroy(AudioCodec* a){ - delete a; -} - diff --git a/sflphone-common/src/audio/codecs/ilbc/FrameClassify.c b/sflphone-common/src/audio/codecs/ilbc/FrameClassify.c deleted file mode 100644 index 80d72d917d51b3bc30e22e54eb4f544d7ada33e5..0000000000000000000000000000000000000000 --- a/sflphone-common/src/audio/codecs/ilbc/FrameClassify.c +++ /dev/null @@ -1,114 +0,0 @@ - - /****************************************************************** - - iLBC Speech Coder ANSI-C Source Code - - FrameClassify.c - - Copyright (C) The Internet Society (2004). - All Rights Reserved. - - ******************************************************************/ - - #include "iLBC_define.h" - - /*---------------------------------------------------------------* - * Classification of subframes to localize start state - *--------------------------------------------------------------*/ - - int FrameClassify( /* index to the max-energy sub-frame */ - iLBC_Enc_Inst_t *iLBCenc_inst, - /* (i/o) the encoder state structure */ - float *residual /* (i) lpc residual signal */ - ) { - float max_ssqEn, fssqEn[NSUB_MAX], bssqEn[NSUB_MAX], *pp; - int n, l, max_ssqEn_n; - const float ssqEn_win[NSUB_MAX-1]={(float)0.8,(float)0.9, - (float)1.0,(float)0.9,(float)0.8}; - const float sampEn_win[5]={(float)1.0/(float)6.0, - (float)2.0/(float)6.0, (float)3.0/(float)6.0, - (float)4.0/(float)6.0, (float)5.0/(float)6.0}; - - /* init the front and back energies to zero */ - - memset(fssqEn, 0, NSUB_MAX*sizeof(float)); - memset(bssqEn, 0, NSUB_MAX*sizeof(float)); - - /* Calculate front of first seqence */ - - n=0; - pp=residual; - for (l=0; l<5; l++) { - fssqEn[n] += sampEn_win[l] * (*pp) * (*pp); - pp++; - } - for (l=5; l<SUBL; l++) { - - - - - - fssqEn[n] += (*pp) * (*pp); - pp++; - } - - /* Calculate front and back of all middle sequences */ - - for (n=1; n<iLBCenc_inst->nsub-1; n++) { - pp=residual+n*SUBL; - for (l=0; l<5; l++) { - fssqEn[n] += sampEn_win[l] * (*pp) * (*pp); - bssqEn[n] += (*pp) * (*pp); - pp++; - } - for (l=5; l<SUBL-5; l++) { - fssqEn[n] += (*pp) * (*pp); - bssqEn[n] += (*pp) * (*pp); - pp++; - } - for (l=SUBL-5; l<SUBL; l++) { - fssqEn[n] += (*pp) * (*pp); - bssqEn[n] += sampEn_win[SUBL-l-1] * (*pp) * (*pp); - pp++; - } - } - - /* Calculate back of last seqence */ - - n=iLBCenc_inst->nsub-1; - pp=residual+n*SUBL; - for (l=0; l<SUBL-5; l++) { - bssqEn[n] += (*pp) * (*pp); - pp++; - } - for (l=SUBL-5; l<SUBL; l++) { - bssqEn[n] += sampEn_win[SUBL-l-1] * (*pp) * (*pp); - pp++; - } - - /* find the index to the weighted 80 sample with - most energy */ - - if (iLBCenc_inst->mode==20) l=1; - else l=0; - - max_ssqEn=(fssqEn[0]+bssqEn[1])*ssqEn_win[l]; - max_ssqEn_n=1; - for (n=2; n<iLBCenc_inst->nsub; n++) { - - - - - - - l++; - if ((fssqEn[n-1]+bssqEn[n])*ssqEn_win[l] > max_ssqEn) { - max_ssqEn=(fssqEn[n-1]+bssqEn[n]) * - ssqEn_win[l]; - max_ssqEn_n=n; - } - } - - return max_ssqEn_n; - } - diff --git a/sflphone-common/src/audio/codecs/ilbc/FrameClassify.h b/sflphone-common/src/audio/codecs/ilbc/FrameClassify.h deleted file mode 100644 index 018ddbe5daec5c2a7b9670e2cc1de2140b0e5cbe..0000000000000000000000000000000000000000 --- a/sflphone-common/src/audio/codecs/ilbc/FrameClassify.h +++ /dev/null @@ -1,27 +0,0 @@ - - /****************************************************************** - - iLBC Speech Coder ANSI-C Source Code - - FrameClassify.h - - Copyright (C) The Internet Society (2004). - All Rights Reserved. - - ******************************************************************/ - - #ifndef __iLBC_FRAMECLASSIFY_H - #define __iLBC_FRAMECLASSIFY_H - - int FrameClassify( /* index to the max-energy sub-frame */ - iLBC_Enc_Inst_t *iLBCenc_inst, - /* (i/o) the encoder state structure */ - float *residual /* (i) lpc residual signal */ - ); - - - - - - #endif - diff --git a/sflphone-common/src/audio/codecs/ilbc/LPCdecode.c b/sflphone-common/src/audio/codecs/ilbc/LPCdecode.c deleted file mode 100644 index 81bab90485c7f201aeb34df64ed26703a907b195..0000000000000000000000000000000000000000 --- a/sflphone-common/src/audio/codecs/ilbc/LPCdecode.c +++ /dev/null @@ -1,158 +0,0 @@ - - /****************************************************************** - - iLBC Speech Coder ANSI-C Source Code - - LPC_decode.c - - Copyright (C) The Internet Society (2004). - All Rights Reserved. - - ******************************************************************/ - - #include <math.h> - #include <string.h> - - #include "helpfun.h" - #include "lsf.h" - #include "iLBC_define.h" - #include "constants.h" - - /*---------------------------------------------------------------* - * interpolation of lsf coefficients for the decoder - *--------------------------------------------------------------*/ - - void LSFinterpolate2a_dec( - float *a, /* (o) lpc coefficients for a sub-frame */ - float *lsf1, /* (i) first lsf coefficient vector */ - float *lsf2, /* (i) second lsf coefficient vector */ - float coef, /* (i) interpolation weight */ - int length /* (i) length of lsf vectors */ - ){ - float lsftmp[LPC_FILTERORDER]; - - interpolate(lsftmp, lsf1, lsf2, coef, length); - lsf2a(a, lsftmp); - } - - /*---------------------------------------------------------------* - * obtain dequantized lsf coefficients from quantization index - *--------------------------------------------------------------*/ - - void SimplelsfDEQ( - float *lsfdeq, /* (o) dequantized lsf coefficients */ - int *index, /* (i) quantization index */ - int lpc_n /* (i) number of LPCs */ - ){ - int i, j, pos, cb_pos; - - - - - - /* decode first LSF */ - - pos = 0; - cb_pos = 0; - for (i = 0; i < LSF_NSPLIT; i++) { - for (j = 0; j < dim_lsfCbTbl[i]; j++) { - lsfdeq[pos + j] = lsfCbTbl[cb_pos + - (long)(index[i])*dim_lsfCbTbl[i] + j]; - } - pos += dim_lsfCbTbl[i]; - cb_pos += size_lsfCbTbl[i]*dim_lsfCbTbl[i]; - } - - if (lpc_n>1) { - - /* decode last LSF */ - - pos = 0; - cb_pos = 0; - for (i = 0; i < LSF_NSPLIT; i++) { - for (j = 0; j < dim_lsfCbTbl[i]; j++) { - lsfdeq[LPC_FILTERORDER + pos + j] = - lsfCbTbl[cb_pos + - (long)(index[LSF_NSPLIT + i])* - dim_lsfCbTbl[i] + j]; - } - pos += dim_lsfCbTbl[i]; - cb_pos += size_lsfCbTbl[i]*dim_lsfCbTbl[i]; - } - } - } - - /*----------------------------------------------------------------* - * obtain synthesis and weighting filters form lsf coefficients - *---------------------------------------------------------------*/ - - void DecoderInterpolateLSF( - float *syntdenum, /* (o) synthesis filter coefficients */ - float *weightdenum, /* (o) weighting denumerator - coefficients */ - float *lsfdeq, /* (i) dequantized lsf coefficients */ - int length, /* (i) length of lsf coefficient vector */ - iLBC_Dec_Inst_t *iLBCdec_inst - /* (i) the decoder state structure */ - ){ - int i, pos, lp_length; - float lp[LPC_FILTERORDER + 1], *lsfdeq2; - - - - - - - lsfdeq2 = lsfdeq + length; - lp_length = length + 1; - - if (iLBCdec_inst->mode==30) { - /* sub-frame 1: Interpolation between old and first */ - - LSFinterpolate2a_dec(lp, iLBCdec_inst->lsfdeqold, lsfdeq, - lsf_weightTbl_30ms[0], length); - memcpy(syntdenum,lp,lp_length*sizeof(float)); - bwexpand(weightdenum, lp, LPC_CHIRP_WEIGHTDENUM, - lp_length); - - /* sub-frames 2 to 6: interpolation between first - and last LSF */ - - pos = lp_length; - for (i = 1; i < 6; i++) { - LSFinterpolate2a_dec(lp, lsfdeq, lsfdeq2, - lsf_weightTbl_30ms[i], length); - memcpy(syntdenum + pos,lp,lp_length*sizeof(float)); - bwexpand(weightdenum + pos, lp, - LPC_CHIRP_WEIGHTDENUM, lp_length); - pos += lp_length; - } - } - else { - pos = 0; - for (i = 0; i < iLBCdec_inst->nsub; i++) { - LSFinterpolate2a_dec(lp, iLBCdec_inst->lsfdeqold, - lsfdeq, lsf_weightTbl_20ms[i], length); - memcpy(syntdenum+pos,lp,lp_length*sizeof(float)); - bwexpand(weightdenum+pos, lp, LPC_CHIRP_WEIGHTDENUM, - lp_length); - pos += lp_length; - } - } - - /* update memory */ - - if (iLBCdec_inst->mode==30) - memcpy(iLBCdec_inst->lsfdeqold, lsfdeq2, - length*sizeof(float)); - else - memcpy(iLBCdec_inst->lsfdeqold, lsfdeq, - length*sizeof(float)); - - } - - - - - - diff --git a/sflphone-common/src/audio/codecs/ilbc/LPCdecode.h b/sflphone-common/src/audio/codecs/ilbc/LPCdecode.h deleted file mode 100644 index abe1d7b3b1db0521daf95abbd4e9bbec2b06fe52..0000000000000000000000000000000000000000 --- a/sflphone-common/src/audio/codecs/ilbc/LPCdecode.h +++ /dev/null @@ -1,52 +0,0 @@ - - /****************************************************************** - - iLBC Speech Coder ANSI-C Source Code - - LPC_decode.h - - Copyright (C) The Internet Society (2004). - All Rights Reserved. - - ******************************************************************/ - - #ifndef __iLBC_LPC_DECODE_H - #define __iLBC_LPC_DECODE_H - - void LSFinterpolate2a_dec( - float *a, /* (o) lpc coefficients for a sub-frame */ - float *lsf1, /* (i) first lsf coefficient vector */ - float *lsf2, /* (i) second lsf coefficient vector */ - float coef, /* (i) interpolation weight */ - int length /* (i) length of lsf vectors */ - ); - - void SimplelsfDEQ( - float *lsfdeq, /* (o) dequantized lsf coefficients */ - int *index, /* (i) quantization index */ - int lpc_n /* (i) number of LPCs */ - ); - - void DecoderInterpolateLSF( - float *syntdenum, /* (o) synthesis filter coefficients */ - float *weightdenum, /* (o) weighting denumerator - coefficients */ - float *lsfdeq, /* (i) dequantized lsf coefficients */ - int length, /* (i) length of lsf coefficient vector */ - iLBC_Dec_Inst_t *iLBCdec_inst - /* (i) the decoder state structure */ - ); - - #endif - - - - - - - - - - - - diff --git a/sflphone-common/src/audio/codecs/ilbc/LPCencode.c b/sflphone-common/src/audio/codecs/ilbc/LPCencode.c deleted file mode 100644 index 19695c0fa552eece2761a4d9edd8b37abe10bd9f..0000000000000000000000000000000000000000 --- a/sflphone-common/src/audio/codecs/ilbc/LPCencode.c +++ /dev/null @@ -1,241 +0,0 @@ - - /****************************************************************** - - iLBC Speech Coder ANSI-C Source Code - - LPCencode.c - - Copyright (C) The Internet Society (2004). - All Rights Reserved. - - ******************************************************************/ - - #include <string.h> - - #include "iLBC_define.h" - #include "helpfun.h" - #include "lsf.h" - #include "constants.h" - - - - - - /*----------------------------------------------------------------* - * lpc analysis (subrutine to LPCencode) - *---------------------------------------------------------------*/ - - void SimpleAnalysis( - float *lsf, /* (o) lsf coefficients */ - float *data, /* (i) new data vector */ - iLBC_Enc_Inst_t *iLBCenc_inst - /* (i/o) the encoder state structure */ - ){ - int k, is; - float temp[BLOCKL_MAX], lp[LPC_FILTERORDER + 1]; - float lp2[LPC_FILTERORDER + 1]; - float r[LPC_FILTERORDER + 1]; - - is=LPC_LOOKBACK+BLOCKL_MAX-iLBCenc_inst->blockl; - memcpy(iLBCenc_inst->lpc_buffer+is,data, - iLBCenc_inst->blockl*sizeof(float)); - - /* No lookahead, last window is asymmetric */ - - for (k = 0; k < iLBCenc_inst->lpc_n; k++) { - - is = LPC_LOOKBACK; - - if (k < (iLBCenc_inst->lpc_n - 1)) { - window(temp, lpc_winTbl, - iLBCenc_inst->lpc_buffer, BLOCKL_MAX); - } else { - window(temp, lpc_asymwinTbl, - iLBCenc_inst->lpc_buffer + is, BLOCKL_MAX); - } - - autocorr(r, temp, BLOCKL_MAX, LPC_FILTERORDER); - window(r, r, lpc_lagwinTbl, LPC_FILTERORDER + 1); - - levdurb(lp, temp, r, LPC_FILTERORDER); - bwexpand(lp2, lp, LPC_CHIRP_SYNTDENUM, LPC_FILTERORDER+1); - - a2lsf(lsf + k*LPC_FILTERORDER, lp2); - } - is=LPC_LOOKBACK+BLOCKL_MAX-iLBCenc_inst->blockl; - memmove(iLBCenc_inst->lpc_buffer, - iLBCenc_inst->lpc_buffer+LPC_LOOKBACK+BLOCKL_MAX-is, - is*sizeof(float)); - } - - /*----------------------------------------------------------------* - - - - - - * lsf interpolator and conversion from lsf to a coefficients - * (subrutine to SimpleInterpolateLSF) - *---------------------------------------------------------------*/ - - void LSFinterpolate2a_enc( - float *a, /* (o) lpc coefficients */ - float *lsf1,/* (i) first set of lsf coefficients */ - float *lsf2,/* (i) second set of lsf coefficients */ - float coef, /* (i) weighting coefficient to use between - lsf1 and lsf2 */ - long length /* (i) length of coefficient vectors */ - ){ - float lsftmp[LPC_FILTERORDER]; - - interpolate(lsftmp, lsf1, lsf2, coef, length); - lsf2a(a, lsftmp); - } - - /*----------------------------------------------------------------* - * lsf interpolator (subrutine to LPCencode) - *---------------------------------------------------------------*/ - - void SimpleInterpolateLSF( - float *syntdenum, /* (o) the synthesis filter denominator - resulting from the quantized - interpolated lsf */ - float *weightdenum, /* (o) the weighting filter denominator - resulting from the unquantized - interpolated lsf */ - float *lsf, /* (i) the unquantized lsf coefficients */ - float *lsfdeq, /* (i) the dequantized lsf coefficients */ - float *lsfold, /* (i) the unquantized lsf coefficients of - the previous signal frame */ - float *lsfdeqold, /* (i) the dequantized lsf coefficients of - the previous signal frame */ - int length, /* (i) should equate LPC_FILTERORDER */ - iLBC_Enc_Inst_t *iLBCenc_inst - /* (i/o) the encoder state structure */ - ){ - int i, pos, lp_length; - float lp[LPC_FILTERORDER + 1], *lsf2, *lsfdeq2; - - lsf2 = lsf + length; - lsfdeq2 = lsfdeq + length; - lp_length = length + 1; - - if (iLBCenc_inst->mode==30) { - /* sub-frame 1: Interpolation between old and first - - - - - - set of lsf coefficients */ - - LSFinterpolate2a_enc(lp, lsfdeqold, lsfdeq, - lsf_weightTbl_30ms[0], length); - memcpy(syntdenum,lp,lp_length*sizeof(float)); - LSFinterpolate2a_enc(lp, lsfold, lsf, - lsf_weightTbl_30ms[0], length); - bwexpand(weightdenum, lp, LPC_CHIRP_WEIGHTDENUM, lp_length); - - /* sub-frame 2 to 6: Interpolation between first - and second set of lsf coefficients */ - - pos = lp_length; - for (i = 1; i < iLBCenc_inst->nsub; i++) { - LSFinterpolate2a_enc(lp, lsfdeq, lsfdeq2, - lsf_weightTbl_30ms[i], length); - memcpy(syntdenum + pos,lp,lp_length*sizeof(float)); - - LSFinterpolate2a_enc(lp, lsf, lsf2, - lsf_weightTbl_30ms[i], length); - bwexpand(weightdenum + pos, lp, - LPC_CHIRP_WEIGHTDENUM, lp_length); - pos += lp_length; - } - } - else { - pos = 0; - for (i = 0; i < iLBCenc_inst->nsub; i++) { - LSFinterpolate2a_enc(lp, lsfdeqold, lsfdeq, - lsf_weightTbl_20ms[i], length); - memcpy(syntdenum+pos,lp,lp_length*sizeof(float)); - LSFinterpolate2a_enc(lp, lsfold, lsf, - lsf_weightTbl_20ms[i], length); - bwexpand(weightdenum+pos, lp, - LPC_CHIRP_WEIGHTDENUM, lp_length); - pos += lp_length; - } - } - - /* update memory */ - - if (iLBCenc_inst->mode==30) { - memcpy(lsfold, lsf2, length*sizeof(float)); - memcpy(lsfdeqold, lsfdeq2, length*sizeof(float)); - } - else { - memcpy(lsfold, lsf, length*sizeof(float)); - memcpy(lsfdeqold, lsfdeq, length*sizeof(float)); - - - - - - } - } - - /*----------------------------------------------------------------* - * lsf quantizer (subrutine to LPCencode) - *---------------------------------------------------------------*/ - - void SimplelsfQ( - float *lsfdeq, /* (o) dequantized lsf coefficients - (dimension FILTERORDER) */ - int *index, /* (o) quantization index */ - float *lsf, /* (i) the lsf coefficient vector to be - quantized (dimension FILTERORDER ) */ - int lpc_n /* (i) number of lsf sets to quantize */ - ){ - /* Quantize first LSF with memoryless split VQ */ - SplitVQ(lsfdeq, index, lsf, lsfCbTbl, LSF_NSPLIT, - dim_lsfCbTbl, size_lsfCbTbl); - - if (lpc_n==2) { - /* Quantize second LSF with memoryless split VQ */ - SplitVQ(lsfdeq + LPC_FILTERORDER, index + LSF_NSPLIT, - lsf + LPC_FILTERORDER, lsfCbTbl, LSF_NSPLIT, - dim_lsfCbTbl, size_lsfCbTbl); - } - } - - /*----------------------------------------------------------------* - * lpc encoder - *---------------------------------------------------------------*/ - - void LPCencode( - float *syntdenum, /* (i/o) synthesis filter coefficients - before/after encoding */ - float *weightdenum, /* (i/o) weighting denumerator - coefficients before/after - encoding */ - int *lsf_index, /* (o) lsf quantization index */ - float *data, /* (i) lsf coefficients to quantize */ - iLBC_Enc_Inst_t *iLBCenc_inst - /* (i/o) the encoder state structure */ - ){ - float lsf[LPC_FILTERORDER * LPC_N_MAX]; - float lsfdeq[LPC_FILTERORDER * LPC_N_MAX]; - int change=0; - - SimpleAnalysis(lsf, data, iLBCenc_inst); - SimplelsfQ(lsfdeq, lsf_index, lsf, iLBCenc_inst->lpc_n); - - - - - - change=LSF_check(lsfdeq, LPC_FILTERORDER, iLBCenc_inst->lpc_n); - SimpleInterpolateLSF(syntdenum, weightdenum, - lsf, lsfdeq, iLBCenc_inst->lsfold, - iLBCenc_inst->lsfdeqold, LPC_FILTERORDER, iLBCenc_inst); - } - diff --git a/sflphone-common/src/audio/codecs/ilbc/LPCencode.h b/sflphone-common/src/audio/codecs/ilbc/LPCencode.h deleted file mode 100644 index 39a9b04037f6e9a3195d1ebc41a7f5bb1bbb16a9..0000000000000000000000000000000000000000 --- a/sflphone-common/src/audio/codecs/ilbc/LPCencode.h +++ /dev/null @@ -1,28 +0,0 @@ - - /****************************************************************** - - iLBC Speech Coder ANSI-C Source Code - - LPCencode.h - - Copyright (C) The Internet Society (2004). - All Rights Reserved. - - ******************************************************************/ - - #ifndef __iLBC_LPCENCOD_H - #define __iLBC_LPCENCOD_H - - void LPCencode( - float *syntdenum, /* (i/o) synthesis filter coefficients - before/after encoding */ - float *weightdenum, /* (i/o) weighting denumerator coefficients - before/after encoding */ - int *lsf_index, /* (o) lsf quantization index */ - float *data, /* (i) lsf coefficients to quantize */ - iLBC_Enc_Inst_t *iLBCenc_inst - /* (i/o) the encoder state structure */ - ); - - #endif - diff --git a/sflphone-common/src/audio/codecs/ilbc/Makefile.am b/sflphone-common/src/audio/codecs/ilbc/Makefile.am deleted file mode 100644 index 05ace76beca96af222f05e8a1428a80fe7df8800..0000000000000000000000000000000000000000 --- a/sflphone-common/src/audio/codecs/ilbc/Makefile.am +++ /dev/null @@ -1,29 +0,0 @@ -noinst_LTLIBRARIES = libilbc.la - -noinst_HEADERS = constants.h anaFilter.h createCB.h doCPLC.h enhancer.h filter.h FrameClassify.h gainquant.h getCBvec.h helpfun.h hpInput.h hpOutput.h iCBConstruct.h iCBSearch.h iLBC_decode.h iLBC_encode.h LPCdecode.h LPCencode.h lsf.h packing.h StateConstructW.h StateSearchW.h syntFilter.h - -libilbc_la_SOURCES = \ - constants.c \ - anaFilter.c \ - createCB.c \ - doCPLC.c \ - enhancer.c \ - filter.c \ - FrameClassify.c \ - gainquant.c \ - getCBvec.c \ - helpfun.c \ - hpInput.c \ - hpOutput.c \ - iCBConstruct.c \ - iCBSearch.c \ - iLBC_decode.c \ - iLBC_encode.c \ - LPCdecode.c \ - LPCencode.c \ - lsf.c \ - packing.c \ - StateConstructW.c \ - StateSearchW.c \ - syntFilter.c - diff --git a/sflphone-common/src/audio/codecs/ilbc/StateConstructW.c b/sflphone-common/src/audio/codecs/ilbc/StateConstructW.c deleted file mode 100644 index 1d3e65fa634e6562cf9d75800fafa24383874858..0000000000000000000000000000000000000000 --- a/sflphone-common/src/audio/codecs/ilbc/StateConstructW.c +++ /dev/null @@ -1,86 +0,0 @@ - - /****************************************************************** - - iLBC Speech Coder ANSI-C Source Code - - StateConstructW.c - - Copyright (C) The Internet Society (2004). - All Rights Reserved. - - ******************************************************************/ - - #include <math.h> - #include <string.h> - - #include "iLBC_define.h" - #include "constants.h" - #include "filter.h" - - /*----------------------------------------------------------------* - * decoding of the start state - *---------------------------------------------------------------*/ - - void StateConstructW( - int idxForMax, /* (i) 6-bit index for the quantization of - max amplitude */ - int *idxVec, /* (i) vector of quantization indexes */ - float *syntDenum, /* (i) synthesis filter denumerator */ - - - - - - float *out, /* (o) the decoded state vector */ - int len /* (i) length of a state vector */ - ){ - float maxVal, tmpbuf[LPC_FILTERORDER+2*STATE_LEN], *tmp, - numerator[LPC_FILTERORDER+1]; - float foutbuf[LPC_FILTERORDER+2*STATE_LEN], *fout; - int k,tmpi; - - /* decoding of the maximum value */ - - maxVal = state_frgqTbl[idxForMax]; - maxVal = (float)pow(10,maxVal)/(float)4.5; - - /* initialization of buffers and coefficients */ - - memset(tmpbuf, 0, LPC_FILTERORDER*sizeof(float)); - memset(foutbuf, 0, LPC_FILTERORDER*sizeof(float)); - for (k=0; k<LPC_FILTERORDER; k++) { - numerator[k]=syntDenum[LPC_FILTERORDER-k]; - } - numerator[LPC_FILTERORDER]=syntDenum[0]; - tmp = &tmpbuf[LPC_FILTERORDER]; - fout = &foutbuf[LPC_FILTERORDER]; - - /* decoding of the sample values */ - - for (k=0; k<len; k++) { - tmpi = len-1-k; - /* maxVal = 1/scal */ - tmp[k] = maxVal*state_sq3Tbl[idxVec[tmpi]]; - } - - /* circular convolution with all-pass filter */ - - memset(tmp+len, 0, len*sizeof(float)); - ZeroPoleFilter(tmp, numerator, syntDenum, 2*len, - LPC_FILTERORDER, fout); - for (k=0;k<len;k++) { - out[k] = fout[len-1-k]+fout[2*len-1-k]; - } - } - - - - - - - - - - - - diff --git a/sflphone-common/src/audio/codecs/ilbc/StateConstructW.h b/sflphone-common/src/audio/codecs/ilbc/StateConstructW.h deleted file mode 100644 index 08f93d2815bebc9d54654f238c3c569d957f4b90..0000000000000000000000000000000000000000 --- a/sflphone-common/src/audio/codecs/ilbc/StateConstructW.h +++ /dev/null @@ -1,31 +0,0 @@ - - /****************************************************************** - - iLBC Speech Coder ANSI-C Source Code - - StateConstructW.h - - - - - - - Copyright (C) The Internet Society (2004). - All Rights Reserved. - - ******************************************************************/ - - #ifndef __iLBC_STATECONSTRUCTW_H - #define __iLBC_STATECONSTRUCTW_H - - void StateConstructW( - int idxForMax, /* (i) 6-bit index for the quantization of - max amplitude */ - int *idxVec, /* (i) vector of quantization indexes */ - float *syntDenum, /* (i) synthesis filter denumerator */ - float *out, /* (o) the decoded state vector */ - int len /* (i) length of a state vector */ - ); - - #endif - diff --git a/sflphone-common/src/audio/codecs/ilbc/StateSearchW.c b/sflphone-common/src/audio/codecs/ilbc/StateSearchW.c deleted file mode 100644 index 1eeee936c1321ec7605c04e369ed1485a801e5d1..0000000000000000000000000000000000000000 --- a/sflphone-common/src/audio/codecs/ilbc/StateSearchW.c +++ /dev/null @@ -1,211 +0,0 @@ - - /****************************************************************** - - iLBC Speech Coder ANSI-C Source Code - - StateSearchW.c - - Copyright (C) The Internet Society (2004). - All Rights Reserved. - - ******************************************************************/ - - #include <math.h> - #include <string.h> - - #include "iLBC_define.h" - #include "constants.h" - #include "filter.h" - #include "helpfun.h" - - /*----------------------------------------------------------------* - * predictive noise shaping encoding of scaled start state - * (subrutine for StateSearchW) - *---------------------------------------------------------------*/ - - void AbsQuantW( - iLBC_Enc_Inst_t *iLBCenc_inst, - /* (i) Encoder instance */ - float *in, /* (i) vector to encode */ - float *syntDenum, /* (i) denominator of synthesis filter */ - float *weightDenum, /* (i) denominator of weighting filter */ - int *out, /* (o) vector of quantizer indexes */ - int len, /* (i) length of vector to encode and - vector of quantizer indexes */ - int state_first /* (i) position of start state in the - 80 vec */ - ){ - float *syntOut; - float syntOutBuf[LPC_FILTERORDER+STATE_SHORT_LEN_30MS]; - float toQ, xq; - int n; - int index; - - /* initialization of buffer for filtering */ - - memset(syntOutBuf, 0, LPC_FILTERORDER*sizeof(float)); - - - - - - - /* initialization of pointer for filtering */ - - syntOut = &syntOutBuf[LPC_FILTERORDER]; - - /* synthesis and weighting filters on input */ - - if (state_first) { - AllPoleFilter (in, weightDenum, SUBL, LPC_FILTERORDER); - } else { - AllPoleFilter (in, weightDenum, - iLBCenc_inst->state_short_len-SUBL, - LPC_FILTERORDER); - } - - /* encoding loop */ - - for (n=0; n<len; n++) { - - /* time update of filter coefficients */ - - if ((state_first)&&(n==SUBL)){ - syntDenum += (LPC_FILTERORDER+1); - weightDenum += (LPC_FILTERORDER+1); - - /* synthesis and weighting filters on input */ - AllPoleFilter (&in[n], weightDenum, len-n, - LPC_FILTERORDER); - - } else if ((state_first==0)&& - (n==(iLBCenc_inst->state_short_len-SUBL))) { - syntDenum += (LPC_FILTERORDER+1); - weightDenum += (LPC_FILTERORDER+1); - - /* synthesis and weighting filters on input */ - AllPoleFilter (&in[n], weightDenum, len-n, - LPC_FILTERORDER); - - } - - /* prediction of synthesized and weighted input */ - - syntOut[n] = 0.0; - AllPoleFilter (&syntOut[n], weightDenum, 1, - LPC_FILTERORDER); - - /* quantization */ - - toQ = in[n]-syntOut[n]; - - - - - - sort_sq(&xq, &index, toQ, state_sq3Tbl, 8); - out[n]=index; - syntOut[n] = state_sq3Tbl[out[n]]; - - /* update of the prediction filter */ - - AllPoleFilter(&syntOut[n], weightDenum, 1, - LPC_FILTERORDER); - } - } - - /*----------------------------------------------------------------* - * encoding of start state - *---------------------------------------------------------------*/ - - void StateSearchW( - iLBC_Enc_Inst_t *iLBCenc_inst, - /* (i) Encoder instance */ - float *residual,/* (i) target residual vector */ - float *syntDenum, /* (i) lpc synthesis filter */ - float *weightDenum, /* (i) weighting filter denuminator */ - int *idxForMax, /* (o) quantizer index for maximum - amplitude */ - int *idxVec, /* (o) vector of quantization indexes */ - int len, /* (i) length of all vectors */ - int state_first /* (i) position of start state in the - 80 vec */ - ){ - float dtmp, maxVal; - float tmpbuf[LPC_FILTERORDER+2*STATE_SHORT_LEN_30MS]; - float *tmp, numerator[1+LPC_FILTERORDER]; - float foutbuf[LPC_FILTERORDER+2*STATE_SHORT_LEN_30MS], *fout; - int k; - float qmax, scal; - - /* initialization of buffers and filter coefficients */ - - memset(tmpbuf, 0, LPC_FILTERORDER*sizeof(float)); - memset(foutbuf, 0, LPC_FILTERORDER*sizeof(float)); - for (k=0; k<LPC_FILTERORDER; k++) { - numerator[k]=syntDenum[LPC_FILTERORDER-k]; - } - numerator[LPC_FILTERORDER]=syntDenum[0]; - tmp = &tmpbuf[LPC_FILTERORDER]; - fout = &foutbuf[LPC_FILTERORDER]; - - /* circular convolution with the all-pass filter */ - - - - - - - memcpy(tmp, residual, len*sizeof(float)); - memset(tmp+len, 0, len*sizeof(float)); - ZeroPoleFilter(tmp, numerator, syntDenum, 2*len, - LPC_FILTERORDER, fout); - for (k=0; k<len; k++) { - fout[k] += fout[k+len]; - } - - /* identification of the maximum amplitude value */ - - maxVal = fout[0]; - for (k=1; k<len; k++) { - - if (fout[k]*fout[k] > maxVal*maxVal){ - maxVal = fout[k]; - } - } - maxVal=(float)fabs(maxVal); - - /* encoding of the maximum amplitude value */ - - if (maxVal < 10.0) { - maxVal = 10.0; - } - maxVal = (float)log10(maxVal); - sort_sq(&dtmp, idxForMax, maxVal, state_frgqTbl, 64); - - /* decoding of the maximum amplitude representation value, - and corresponding scaling of start state */ - - maxVal=state_frgqTbl[*idxForMax]; - qmax = (float)pow(10,maxVal); - scal = (float)(4.5)/qmax; - for (k=0; k<len; k++){ - fout[k] *= scal; - } - - /* predictive noise shaping encoding of scaled start state */ - - AbsQuantW(iLBCenc_inst, fout,syntDenum, - weightDenum,idxVec, len, state_first); - } - - - - - - - - - - - diff --git a/sflphone-common/src/audio/codecs/ilbc/StateSearchW.h b/sflphone-common/src/audio/codecs/ilbc/StateSearchW.h deleted file mode 100644 index 9036daa892e80c0b1fddccd6b085dabf2e0f674b..0000000000000000000000000000000000000000 --- a/sflphone-common/src/audio/codecs/ilbc/StateSearchW.h +++ /dev/null @@ -1,52 +0,0 @@ - - /****************************************************************** - - iLBC Speech Coder ANSI-C Source Code - - StateSearchW.h - - Copyright (C) The Internet Society (2004). - All Rights Reserved. - - ******************************************************************/ - - #ifndef __iLBC_STATESEARCHW_H - #define __iLBC_STATESEARCHW_H - - void AbsQuantW( - iLBC_Enc_Inst_t *iLBCenc_inst, - /* (i) Encoder instance */ - float *in, /* (i) vector to encode */ - float *syntDenum, /* (i) denominator of synthesis filter */ - float *weightDenum, /* (i) denominator of weighting filter */ - int *out, /* (o) vector of quantizer indexes */ - int len, /* (i) length of vector to encode and - vector of quantizer indexes */ - int state_first /* (i) position of start state in the - 80 vec */ - ); - - void StateSearchW( - iLBC_Enc_Inst_t *iLBCenc_inst, - /* (i) Encoder instance */ - float *residual,/* (i) target residual vector */ - float *syntDenum, /* (i) lpc synthesis filter */ - float *weightDenum, /* (i) weighting filter denuminator */ - int *idxForMax, /* (o) quantizer index for maximum - amplitude */ - int *idxVec, /* (o) vector of quantization indexes */ - int len, /* (i) length of all vectors */ - int state_first /* (i) position of start state in the - 80 vec */ - ); - - - #endif - - - - - - - - diff --git a/sflphone-common/src/audio/codecs/ilbc/anaFilter.c b/sflphone-common/src/audio/codecs/ilbc/anaFilter.c deleted file mode 100644 index c161f98a5bf78702c9d7b64a784a6f06c2df7ade..0000000000000000000000000000000000000000 --- a/sflphone-common/src/audio/codecs/ilbc/anaFilter.c +++ /dev/null @@ -1,72 +0,0 @@ - - /****************************************************************** - - iLBC Speech Coder ANSI-C Source Code - - anaFilter.c - - Copyright (C) The Internet Society (2004). - All Rights Reserved. - - ******************************************************************/ - - #include <string.h> - #include "iLBC_define.h" - - /*----------------------------------------------------------------* - * LP analysis filter. - *---------------------------------------------------------------*/ - - void anaFilter( - float *In, /* (i) Signal to be filtered */ - float *a, /* (i) LP parameters */ - int len,/* (i) Length of signal */ - float *Out, /* (o) Filtered signal */ - float *mem /* (i/o) Filter state */ - ){ - int i, j; - float *po, *pi, *pm, *pa; - - po = Out; - - /* Filter first part using memory from past */ - - for (i=0; i<LPC_FILTERORDER; i++) { - pi = &In[i]; - pm = &mem[LPC_FILTERORDER-1]; - pa = a; - *po=0.0; - - - - - - for (j=0; j<=i; j++) { - *po+=(*pa++)*(*pi--); - } - for (j=i+1; j<LPC_FILTERORDER+1; j++) { - - *po+=(*pa++)*(*pm--); - } - po++; - } - - /* Filter last part where the state is entirely - in the input vector */ - - for (i=LPC_FILTERORDER; i<len; i++) { - pi = &In[i]; - pa = a; - *po=0.0; - for (j=0; j<LPC_FILTERORDER+1; j++) { - *po+=(*pa++)*(*pi--); - } - po++; - } - - /* Update state vector */ - - memcpy(mem, &In[len-LPC_FILTERORDER], - LPC_FILTERORDER*sizeof(float)); - } - diff --git a/sflphone-common/src/audio/codecs/ilbc/anaFilter.h b/sflphone-common/src/audio/codecs/ilbc/anaFilter.h deleted file mode 100644 index 91367f95e04513d38e37e8e9b87e89340d342081..0000000000000000000000000000000000000000 --- a/sflphone-common/src/audio/codecs/ilbc/anaFilter.h +++ /dev/null @@ -1,30 +0,0 @@ - - /****************************************************************** - - iLBC Speech Coder ANSI-C Source Code - - anaFilter.h - - Copyright (C) The Internet Society (2004). - All Rights Reserved. - - ******************************************************************/ - - #ifndef __iLBC_ANAFILTER_H - #define __iLBC_ANAFILTER_H - - void anaFilter( - - - - - - float *In, /* (i) Signal to be filtered */ - float *a, /* (i) LP parameters */ - int len,/* (i) Length of signal */ - float *Out, /* (o) Filtered signal */ - float *mem /* (i/o) Filter state */ - ); - - #endif - diff --git a/sflphone-common/src/audio/codecs/ilbc/audiocodec.h b/sflphone-common/src/audio/codecs/ilbc/audiocodec.h deleted file mode 100644 index e0cd7fe31e374686ef76a3455b9053a1ac76d4e6..0000000000000000000000000000000000000000 --- a/sflphone-common/src/audio/codecs/ilbc/audiocodec.h +++ /dev/null @@ -1,55 +0,0 @@ -#ifndef _CODEC_AUDIO_H -#define _CODEC_AUDIO_H - -#include <string> -#include <iostream> -#include <dlfcn.h> - -class AudioCodec { -protected: - /** Holds SDP-compliant codec name */ - std::string _codecName; // what we put inside sdp - - /** Clock rate or sample rate of the codec, in Hz */ - unsigned int _clockRate; - - /** Number of channel 1 = mono, 2 = stereo */ - unsigned int _channel; - -private: - int _payload; - bool _hasDynamicPayload; - -public: - AudioCodec(int payload, const std::string &codecName) - : _codecName(codecName) { - _payload = payload; - _clockRate = 8000; // default - _channel = 1; // default - - _hasDynamicPayload = (_payload >= 96 && _payload <= 127) ? true : false; -} - - virtual ~AudioCodec() {} - - /** - * @return the number of bytes decoded - */ - virtual int codecDecode(short *, unsigned char *, unsigned int) = 0; - virtual int codecEncode(unsigned char *, short *, unsigned int) = 0; - - /** Value used for SDP negotiation */ - std::string getCodecName() { return _codecName; } - int getPayload() { return _payload; } - bool hasDynamicPayload() { return _hasDynamicPayload; } - unsigned int getClockRate() { return _clockRate; } - unsigned int getChannel() { return _channel; } - - -}; - -// the types of the class factories -typedef AudioCodec* create_t(); -typedef void destroy_t(AudioCodec*); - -#endif diff --git a/sflphone-common/src/audio/codecs/ilbc/common.h b/sflphone-common/src/audio/codecs/ilbc/common.h deleted file mode 100644 index fb2cb85c834069230c1f350bb2ed82047d00146e..0000000000000000000000000000000000000000 --- a/sflphone-common/src/audio/codecs/ilbc/common.h +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright (C) 2004-2005 Savoir-Faire Linux inc. - * Author: - * - * 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 - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -/* - Type definitions and helper macros which aren't part of Standard C++ - This will need to be edited on systems where 'char', 'short' and 'int' - have sizes different from 8, 16 and 32 bits. -*/ - -#ifndef __COMMON_H__ -#define __COMMON_H__ - - -// #define DEBUG /**< Defined when compiling code for debugging */ - -/* -Basic integer types. -Note 'int' is assumed to be in 2s complement format and at least 32 bits in size -*/ -typedef unsigned char uint8; /**< An 8 bit unsigned integer */ -typedef unsigned short uint16; /**< An 16 bit unsigned integer */ -typedef unsigned int uint32; /**< An 32 bit unsigned integer */ -typedef signed char int8; /**< An 8 bit signed integer (2s complement) */ -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 */ -#define IMPORT __declspec(dllexport) /**< Mark a function which is to be imported from a DLL */ -#define EXPORT __declspec(dllexport) /**< Mark a function to be exported from a DLL */ -#define ASSERT(c) { if(!(c)) DEBUGGER; } /**< Assert that expression 'c' is true */ - -#else // Not compiling for Microsoft Visual C++ ... - -#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/sflphone-common/src/audio/codecs/ilbc/constants.c b/sflphone-common/src/audio/codecs/ilbc/constants.c deleted file mode 100644 index d43dac4d4e5a825d223c761307a74f758467d61b..0000000000000000000000000000000000000000 --- a/sflphone-common/src/audio/codecs/ilbc/constants.c +++ /dev/null @@ -1,770 +0,0 @@ - - /****************************************************************** - - iLBC Speech Coder ANSI-C Source Code - - constants.c - - Copyright (C) The Internet Society (2004). - All Rights Reserved. - - ******************************************************************/ - - #include "iLBC_define.h" - - /* ULP bit allocation */ - - /* 20 ms frame */ - - const iLBC_ULP_Inst_t ULP_20msTbl = { - /* LSF */ - { {6,0,0,0,0}, {7,0,0,0,0}, {7,0,0,0,0}, - {0,0,0,0,0}, {0,0,0,0,0}, {0,0,0,0,0}}, - /* Start state location, gain and samples */ - {2,0,0,0,0}, - {1,0,0,0,0}, - {6,0,0,0,0}, - {0,1,2,0,0}, - /* extra CB index and extra CB gain */ - {{6,0,1,0,0}, {0,0,7,0,0}, {0,0,7,0,0}}, - {{2,0,3,0,0}, {1,1,2,0,0}, {0,0,3,0,0}}, - /* CB index and CB gain */ - { {{7,0,1,0,0}, {0,0,7,0,0}, {0,0,7,0,0}}, - {{0,0,8,0,0}, {0,0,8,0,0}, {0,0,8,0,0}}, - {{0,0,0,0,0}, {0,0,0,0,0}, {0,0,0,0,0}}, - {{0,0,0,0,0}, {0,0,0,0,0}, {0,0,0,0,0}}}, - { {{1,2,2,0,0}, {1,1,2,0,0}, {0,0,3,0,0}}, - {{1,1,3,0,0}, {0,2,2,0,0}, {0,0,3,0,0}}, - {{0,0,0,0,0}, {0,0,0,0,0}, {0,0,0,0,0}}, - {{0,0,0,0,0}, {0,0,0,0,0}, {0,0,0,0,0}}} - }; - - /* 30 ms frame */ - - const iLBC_ULP_Inst_t ULP_30msTbl = { - /* LSF */ - - - - - - { {6,0,0,0,0}, {7,0,0,0,0}, {7,0,0,0,0}, - {6,0,0,0,0}, {7,0,0,0,0}, {7,0,0,0,0}}, - /* Start state location, gain and samples */ - {3,0,0,0,0}, - {1,0,0,0,0}, - {6,0,0,0,0}, - {0,1,2,0,0}, - /* extra CB index and extra CB gain */ - {{4,2,1,0,0}, {0,0,7,0,0}, {0,0,7,0,0}}, - {{1,1,3,0,0}, {1,1,2,0,0}, {0,0,3,0,0}}, - /* CB index and CB gain */ - { {{6,1,1,0,0}, {0,0,7,0,0}, {0,0,7,0,0}}, - {{0,7,1,0,0}, {0,0,8,0,0}, {0,0,8,0,0}}, - {{0,7,1,0,0}, {0,0,8,0,0}, {0,0,8,0,0}}, - {{0,7,1,0,0}, {0,0,8,0,0}, {0,0,8,0,0}}}, - { {{1,2,2,0,0}, {1,2,1,0,0}, {0,0,3,0,0}}, - {{0,2,3,0,0}, {0,2,2,0,0}, {0,0,3,0,0}}, - {{0,1,4,0,0}, {0,1,3,0,0}, {0,0,3,0,0}}, - {{0,1,4,0,0}, {0,1,3,0,0}, {0,0,3,0,0}}} - }; - - /* HP Filters */ - - float hpi_zero_coefsTbl[3] = { - (float)0.92727436, (float)-1.8544941, (float)0.92727436 - }; - float hpi_pole_coefsTbl[3] = { - (float)1.0, (float)-1.9059465, (float)0.9114024 - }; - float hpo_zero_coefsTbl[3] = { - (float)0.93980581, (float)-1.8795834, (float)0.93980581 - }; - float hpo_pole_coefsTbl[3] = { - (float)1.0, (float)-1.9330735, (float)0.93589199 - }; - - /* LP Filter */ - - float lpFilt_coefsTbl[FILTERORDER_DS]={ - (float)-0.066650, (float)0.125000, (float)0.316650, - (float)0.414063, (float)0.316650, - (float)0.125000, (float)-0.066650 - }; - - /* State quantization tables */ - - float state_sq3Tbl[8] = { - (float)-3.719849, (float)-2.177490, (float)-1.130005, - - - - - - (float)-0.309692, (float)0.444214, (float)1.329712, - (float)2.436279, (float)3.983887 - }; - - float state_frgqTbl[64] = { - (float)1.000085, (float)1.071695, (float)1.140395, - (float)1.206868, (float)1.277188, (float)1.351503, - (float)1.429380, (float)1.500727, (float)1.569049, - (float)1.639599, (float)1.707071, (float)1.781531, - (float)1.840799, (float)1.901550, (float)1.956695, - (float)2.006750, (float)2.055474, (float)2.102787, - (float)2.142819, (float)2.183592, (float)2.217962, - (float)2.257177, (float)2.295739, (float)2.332967, - (float)2.369248, (float)2.402792, (float)2.435080, - (float)2.468598, (float)2.503394, (float)2.539284, - (float)2.572944, (float)2.605036, (float)2.636331, - (float)2.668939, (float)2.698780, (float)2.729101, - (float)2.759786, (float)2.789834, (float)2.818679, - (float)2.848074, (float)2.877470, (float)2.906899, - (float)2.936655, (float)2.967804, (float)3.000115, - (float)3.033367, (float)3.066355, (float)3.104231, - (float)3.141499, (float)3.183012, (float)3.222952, - (float)3.265433, (float)3.308441, (float)3.350823, - (float)3.395275, (float)3.442793, (float)3.490801, - (float)3.542514, (float)3.604064, (float)3.666050, - (float)3.740994, (float)3.830749, (float)3.938770, - (float)4.101764 - }; - - /* CB tables */ - - int search_rangeTbl[5][CB_NSTAGES]={{58,58,58}, {108,44,44}, - {108,108,108}, {108,108,108}, {108,108,108}}; - int stMemLTbl=85; - int memLfTbl[NASUB_MAX]={147,147,147,147}; - - /* expansion filter(s) */ - - float cbfiltersTbl[CB_FILTERLEN]={ - (float)-0.034180, (float)0.108887, (float)-0.184326, - (float)0.806152, (float)0.713379, (float)-0.144043, - (float)0.083740, (float)-0.033691 - }; - - /* Gain Quantization */ - - float gain_sq3Tbl[8]={ - (float)-1.000000, (float)-0.659973, (float)-0.330017, - - - - - - (float)0.000000, (float)0.250000, (float)0.500000, - (float)0.750000, (float)1.00000}; - - float gain_sq4Tbl[16]={ - (float)-1.049988, (float)-0.900024, (float)-0.750000, - (float)-0.599976, (float)-0.450012, (float)-0.299988, - (float)-0.150024, (float)0.000000, (float)0.150024, - (float)0.299988, (float)0.450012, (float)0.599976, - (float)0.750000, (float)0.900024, (float)1.049988, - (float)1.200012}; - - float gain_sq5Tbl[32]={ - (float)0.037476, (float)0.075012, (float)0.112488, - (float)0.150024, (float)0.187500, (float)0.224976, - (float)0.262512, (float)0.299988, (float)0.337524, - (float)0.375000, (float)0.412476, (float)0.450012, - (float)0.487488, (float)0.525024, (float)0.562500, - (float)0.599976, (float)0.637512, (float)0.674988, - (float)0.712524, (float)0.750000, (float)0.787476, - (float)0.825012, (float)0.862488, (float)0.900024, - (float)0.937500, (float)0.974976, (float)1.012512, - (float)1.049988, (float)1.087524, (float)1.125000, - (float)1.162476, (float)1.200012}; - - /* Enhancer - Upsamling a factor 4 (ENH_UPS0 = 4) */ - float polyphaserTbl[ENH_UPS0*(2*ENH_FL0+1)]={ - (float)0.000000, (float)0.000000, (float)0.000000, - (float)1.000000, - (float)0.000000, (float)0.000000, (float)0.000000, - (float)0.015625, (float)-0.076904, (float)0.288330, - (float)0.862061, - (float)-0.106445, (float)0.018799, (float)-0.015625, - (float)0.023682, (float)-0.124268, (float)0.601563, - (float)0.601563, - (float)-0.124268, (float)0.023682, (float)-0.023682, - (float)0.018799, (float)-0.106445, (float)0.862061, - (float)0.288330, - (float)-0.076904, (float)0.015625, (float)-0.018799}; - - float enh_plocsTbl[ENH_NBLOCKS_TOT] = {(float)40.0, (float)120.0, - (float)200.0, (float)280.0, (float)360.0, - (float)440.0, (float)520.0, (float)600.0}; - - /* LPC analysis and quantization */ - - int dim_lsfCbTbl[LSF_NSPLIT] = {3, 3, 4}; - int size_lsfCbTbl[LSF_NSPLIT] = {64,128,128}; - - - - - - - float lsfmeanTbl[LPC_FILTERORDER] = { - (float)0.281738, (float)0.445801, (float)0.663330, - (float)0.962524, (float)1.251831, (float)1.533081, - (float)1.850586, (float)2.137817, (float)2.481445, - (float)2.777344}; - - float lsf_weightTbl_30ms[6] = {(float)(1.0/2.0), (float)1.0, - (float)(2.0/3.0), - (float)(1.0/3.0), (float)0.0, (float)0.0}; - - float lsf_weightTbl_20ms[4] = {(float)(3.0/4.0), (float)(2.0/4.0), - (float)(1.0/4.0), (float)(0.0)}; - - /* Hanning LPC window */ - float lpc_winTbl[BLOCKL_MAX]={ - (float)0.000183, (float)0.000671, (float)0.001526, - (float)0.002716, (float)0.004242, (float)0.006104, - (float)0.008301, (float)0.010834, (float)0.013702, - (float)0.016907, (float)0.020416, (float)0.024261, - (float)0.028442, (float)0.032928, (float)0.037750, - (float)0.042877, (float)0.048309, (float)0.054047, - (float)0.060089, (float)0.066437, (float)0.073090, - (float)0.080017, (float)0.087219, (float)0.094727, - (float)0.102509, (float)0.110535, (float)0.118835, - (float)0.127411, (float)0.136230, (float)0.145294, - (float)0.154602, (float)0.164154, (float)0.173920, - (float)0.183899, (float)0.194122, (float)0.204529, - (float)0.215149, (float)0.225952, (float)0.236938, - (float)0.248108, (float)0.259460, (float)0.270966, - (float)0.282654, (float)0.294464, (float)0.306396, - (float)0.318481, (float)0.330688, (float)0.343018, - (float)0.355438, (float)0.367981, (float)0.380585, - (float)0.393280, (float)0.406067, (float)0.418884, - (float)0.431763, (float)0.444702, (float)0.457672, - (float)0.470673, (float)0.483704, (float)0.496735, - (float)0.509766, (float)0.522797, (float)0.535828, - (float)0.548798, (float)0.561768, (float)0.574677, - (float)0.587524, (float)0.600342, (float)0.613068, - (float)0.625732, (float)0.638306, (float)0.650787, - (float)0.663147, (float)0.675415, (float)0.687561, - (float)0.699585, (float)0.711487, (float)0.723206, - (float)0.734802, (float)0.746216, (float)0.757477, - (float)0.768585, (float)0.779480, (float)0.790192, - (float)0.800720, (float)0.811005, (float)0.821106, - (float)0.830994, (float)0.840668, (float)0.850067, - (float)0.859253, (float)0.868225, (float)0.876892, - (float)0.885345, (float)0.893524, (float)0.901428, - (float)0.909058, (float)0.916412, (float)0.923492, - - - - - - (float)0.930267, (float)0.936768, (float)0.942963, - (float)0.948853, (float)0.954437, (float)0.959717, - (float)0.964691, (float)0.969360, (float)0.973694, - (float)0.977692, (float)0.981384, (float)0.984741, - (float)0.987762, (float)0.990479, (float)0.992828, - (float)0.994873, (float)0.996552, (float)0.997925, - (float)0.998932, (float)0.999603, (float)0.999969, - (float)0.999969, (float)0.999603, (float)0.998932, - (float)0.997925, (float)0.996552, (float)0.994873, - (float)0.992828, (float)0.990479, (float)0.987762, - (float)0.984741, (float)0.981384, (float)0.977692, - (float)0.973694, (float)0.969360, (float)0.964691, - (float)0.959717, (float)0.954437, (float)0.948853, - (float)0.942963, (float)0.936768, (float)0.930267, - (float)0.923492, (float)0.916412, (float)0.909058, - (float)0.901428, (float)0.893524, (float)0.885345, - (float)0.876892, (float)0.868225, (float)0.859253, - (float)0.850067, (float)0.840668, (float)0.830994, - (float)0.821106, (float)0.811005, (float)0.800720, - (float)0.790192, (float)0.779480, (float)0.768585, - (float)0.757477, (float)0.746216, (float)0.734802, - (float)0.723206, (float)0.711487, (float)0.699585, - (float)0.687561, (float)0.675415, (float)0.663147, - (float)0.650787, (float)0.638306, (float)0.625732, - (float)0.613068, (float)0.600342, (float)0.587524, - (float)0.574677, (float)0.561768, (float)0.548798, - (float)0.535828, (float)0.522797, (float)0.509766, - (float)0.496735, (float)0.483704, (float)0.470673, - (float)0.457672, (float)0.444702, (float)0.431763, - (float)0.418884, (float)0.406067, (float)0.393280, - (float)0.380585, (float)0.367981, (float)0.355438, - (float)0.343018, (float)0.330688, (float)0.318481, - (float)0.306396, (float)0.294464, (float)0.282654, - (float)0.270966, (float)0.259460, (float)0.248108, - (float)0.236938, (float)0.225952, (float)0.215149, - (float)0.204529, (float)0.194122, (float)0.183899, - (float)0.173920, (float)0.164154, (float)0.154602, - (float)0.145294, (float)0.136230, (float)0.127411, - (float)0.118835, (float)0.110535, (float)0.102509, - (float)0.094727, (float)0.087219, (float)0.080017, - (float)0.073090, (float)0.066437, (float)0.060089, - (float)0.054047, (float)0.048309, (float)0.042877, - (float)0.037750, (float)0.032928, (float)0.028442, - (float)0.024261, (float)0.020416, (float)0.016907, - (float)0.013702, (float)0.010834, (float)0.008301, - (float)0.006104, (float)0.004242, (float)0.002716, - (float)0.001526, (float)0.000671, (float)0.000183 - }; - - - - - - /* Asymmetric LPC window */ - float lpc_asymwinTbl[BLOCKL_MAX]={ - (float)0.000061, (float)0.000214, (float)0.000458, - (float)0.000824, (float)0.001282, (float)0.001831, - (float)0.002472, (float)0.003235, (float)0.004120, - (float)0.005066, (float)0.006134, (float)0.007294, - (float)0.008545, (float)0.009918, (float)0.011383, - (float)0.012939, (float)0.014587, (float)0.016357, - (float)0.018219, (float)0.020172, (float)0.022217, - (float)0.024353, (float)0.026611, (float)0.028961, - (float)0.031372, (float)0.033905, (float)0.036530, - (float)0.039276, (float)0.042084, (float)0.044983, - (float)0.047974, (float)0.051086, (float)0.054260, - (float)0.057526, (float)0.060883, (float)0.064331, - (float)0.067871, (float)0.071503, (float)0.075226, - (float)0.079010, (float)0.082916, (float)0.086884, - (float)0.090942, (float)0.095062, (float)0.099304, - (float)0.103607, (float)0.107971, (float)0.112427, - (float)0.116974, (float)0.121582, (float)0.126282, - (float)0.131073, (float)0.135895, (float)0.140839, - (float)0.145813, (float)0.150879, (float)0.156006, - (float)0.161224, (float)0.166504, (float)0.171844, - (float)0.177246, (float)0.182709, (float)0.188263, - (float)0.193848, (float)0.199524, (float)0.205231, - (float)0.211029, (float)0.216858, (float)0.222778, - (float)0.228729, (float)0.234741, (float)0.240814, - (float)0.246918, (float)0.253082, (float)0.259308, - (float)0.265564, (float)0.271881, (float)0.278259, - (float)0.284668, (float)0.291107, (float)0.297607, - (float)0.304138, (float)0.310730, (float)0.317322, - (float)0.323975, (float)0.330658, (float)0.337372, - (float)0.344147, (float)0.350922, (float)0.357727, - (float)0.364594, (float)0.371460, (float)0.378357, - (float)0.385284, (float)0.392212, (float)0.399170, - (float)0.406158, (float)0.413177, (float)0.420197, - (float)0.427246, (float)0.434296, (float)0.441376, - (float)0.448456, (float)0.455536, (float)0.462646, - (float)0.469757, (float)0.476868, (float)0.483978, - (float)0.491089, (float)0.498230, (float)0.505341, - (float)0.512451, (float)0.519592, (float)0.526703, - (float)0.533813, (float)0.540924, (float)0.548004, - (float)0.555084, (float)0.562164, (float)0.569244, - (float)0.576294, (float)0.583313, (float)0.590332, - (float)0.597321, (float)0.604309, (float)0.611267, - (float)0.618195, (float)0.625092, (float)0.631989, - (float)0.638855, (float)0.645660, (float)0.652466, - (float)0.659241, (float)0.665985, (float)0.672668, - (float)0.679352, (float)0.685974, (float)0.692566, - - - - - - (float)0.699127, (float)0.705658, (float)0.712128, - (float)0.718536, (float)0.724945, (float)0.731262, - (float)0.737549, (float)0.743805, (float)0.750000, - (float)0.756134, (float)0.762238, (float)0.768280, - (float)0.774261, (float)0.780182, (float)0.786072, - (float)0.791870, (float)0.797638, (float)0.803314, - (float)0.808960, (float)0.814514, (float)0.820038, - (float)0.825470, (float)0.830841, (float)0.836151, - (float)0.841400, (float)0.846558, (float)0.851654, - (float)0.856689, (float)0.861633, (float)0.866516, - (float)0.871338, (float)0.876068, (float)0.880737, - (float)0.885315, (float)0.889801, (float)0.894226, - (float)0.898560, (float)0.902832, (float)0.907013, - (float)0.911102, (float)0.915100, (float)0.919037, - (float)0.922882, (float)0.926636, (float)0.930328, - (float)0.933899, (float)0.937408, (float)0.940796, - (float)0.944122, (float)0.947357, (float)0.950470, - (float)0.953522, (float)0.956482, (float)0.959351, - (float)0.962097, (float)0.964783, (float)0.967377, - (float)0.969849, (float)0.972229, (float)0.974518, - (float)0.976715, (float)0.978821, (float)0.980835, - (float)0.982727, (float)0.984528, (float)0.986237, - (float)0.987854, (float)0.989380, (float)0.990784, - (float)0.992096, (float)0.993317, (float)0.994415, - (float)0.995422, (float)0.996338, (float)0.997162, - (float)0.997864, (float)0.998474, (float)0.998962, - (float)0.999390, (float)0.999695, (float)0.999878, - (float)0.999969, (float)0.999969, (float)0.996918, - (float)0.987701, (float)0.972382, (float)0.951050, - (float)0.923889, (float)0.891022, (float)0.852631, - (float)0.809021, (float)0.760406, (float)0.707092, - (float)0.649445, (float)0.587799, (float)0.522491, - (float)0.453979, (float)0.382690, (float)0.309021, - (float)0.233459, (float)0.156433, (float)0.078461 - }; - - /* Lag window for LPC */ - float lpc_lagwinTbl[LPC_FILTERORDER + 1]={ - (float)1.000100, (float)0.998890, (float)0.995569, - (float)0.990057, (float)0.982392, - (float)0.972623, (float)0.960816, (float)0.947047, - (float)0.931405, (float)0.913989, (float)0.894909}; - - /* LSF quantization*/ - float lsfCbTbl[64 * 3 + 128 * 3 + 128 * 4] = { - (float)0.155396, (float)0.273193, (float)0.451172, - (float)0.390503, (float)0.648071, (float)1.002075, - (float)0.440186, (float)0.692261, (float)0.955688, - - - - - - (float)0.343628, (float)0.642334, (float)1.071533, - (float)0.318359, (float)0.491577, (float)0.670532, - (float)0.193115, (float)0.375488, (float)0.725708, - (float)0.364136, (float)0.510376, (float)0.658691, - (float)0.297485, (float)0.527588, (float)0.842529, - (float)0.227173, (float)0.365967, (float)0.563110, - (float)0.244995, (float)0.396729, (float)0.636475, - (float)0.169434, (float)0.300171, (float)0.520264, - (float)0.312866, (float)0.464478, (float)0.643188, - (float)0.248535, (float)0.429932, (float)0.626099, - (float)0.236206, (float)0.491333, (float)0.817139, - (float)0.334961, (float)0.625122, (float)0.895752, - (float)0.343018, (float)0.518555, (float)0.698608, - (float)0.372803, (float)0.659790, (float)0.945435, - (float)0.176880, (float)0.316528, (float)0.581421, - (float)0.416382, (float)0.625977, (float)0.805176, - (float)0.303223, (float)0.568726, (float)0.915039, - (float)0.203613, (float)0.351440, (float)0.588135, - (float)0.221191, (float)0.375000, (float)0.614746, - (float)0.199951, (float)0.323364, (float)0.476074, - (float)0.300781, (float)0.433350, (float)0.566895, - (float)0.226196, (float)0.354004, (float)0.507568, - (float)0.300049, (float)0.508179, (float)0.711670, - (float)0.312012, (float)0.492676, (float)0.763428, - (float)0.329956, (float)0.541016, (float)0.795776, - (float)0.373779, (float)0.604614, (float)0.928833, - (float)0.210571, (float)0.452026, (float)0.755249, - (float)0.271118, (float)0.473267, (float)0.662476, - (float)0.285522, (float)0.436890, (float)0.634399, - (float)0.246704, (float)0.565552, (float)0.859009, - (float)0.270508, (float)0.406250, (float)0.553589, - (float)0.361450, (float)0.578491, (float)0.813843, - (float)0.342651, (float)0.482788, (float)0.622437, - (float)0.340332, (float)0.549438, (float)0.743164, - (float)0.200439, (float)0.336304, (float)0.540894, - (float)0.407837, (float)0.644775, (float)0.895142, - (float)0.294678, (float)0.454834, (float)0.699097, - (float)0.193115, (float)0.344482, (float)0.643188, - (float)0.275757, (float)0.420776, (float)0.598755, - (float)0.380493, (float)0.608643, (float)0.861084, - (float)0.222778, (float)0.426147, (float)0.676514, - (float)0.407471, (float)0.700195, (float)1.053101, - (float)0.218384, (float)0.377197, (float)0.669922, - (float)0.313232, (float)0.454102, (float)0.600952, - (float)0.347412, (float)0.571533, (float)0.874146, - (float)0.238037, (float)0.405396, (float)0.729492, - (float)0.223877, (float)0.412964, (float)0.822021, - (float)0.395264, (float)0.582153, (float)0.743896, - - - - - - (float)0.247925, (float)0.485596, (float)0.720581, - (float)0.229126, (float)0.496582, (float)0.907715, - (float)0.260132, (float)0.566895, (float)1.012695, - (float)0.337402, (float)0.611572, (float)0.978149, - (float)0.267822, (float)0.447632, (float)0.769287, - (float)0.250610, (float)0.381714, (float)0.530029, - (float)0.430054, (float)0.805054, (float)1.221924, - (float)0.382568, (float)0.544067, (float)0.701660, - (float)0.383545, (float)0.710327, (float)1.149170, - (float)0.271362, (float)0.529053, (float)0.775513, - (float)0.246826, (float)0.393555, (float)0.588623, - (float)0.266846, (float)0.422119, (float)0.676758, - (float)0.311523, (float)0.580688, (float)0.838623, - (float)1.331177, (float)1.576782, (float)1.779541, - (float)1.160034, (float)1.401978, (float)1.768188, - (float)1.161865, (float)1.525146, (float)1.715332, - (float)0.759521, (float)0.913940, (float)1.119873, - (float)0.947144, (float)1.121338, (float)1.282471, - (float)1.015015, (float)1.557007, (float)1.804932, - (float)1.172974, (float)1.402100, (float)1.692627, - (float)1.087524, (float)1.474243, (float)1.665405, - (float)0.899536, (float)1.105225, (float)1.406250, - (float)1.148438, (float)1.484741, (float)1.796265, - (float)0.785645, (float)1.209839, (float)1.567749, - (float)0.867798, (float)1.166504, (float)1.450684, - (float)0.922485, (float)1.229858, (float)1.420898, - (float)0.791260, (float)1.123291, (float)1.409546, - (float)0.788940, (float)0.966064, (float)1.340332, - (float)1.051147, (float)1.272827, (float)1.556641, - (float)0.866821, (float)1.181152, (float)1.538818, - (float)0.906738, (float)1.373535, (float)1.607910, - (float)1.244751, (float)1.581421, (float)1.933838, - (float)0.913940, (float)1.337280, (float)1.539673, - (float)0.680542, (float)0.959229, (float)1.662720, - (float)0.887207, (float)1.430542, (float)1.800781, - (float)0.912598, (float)1.433594, (float)1.683960, - (float)0.860474, (float)1.060303, (float)1.455322, - (float)1.005127, (float)1.381104, (float)1.706909, - (float)0.800781, (float)1.363892, (float)1.829102, - (float)0.781860, (float)1.124390, (float)1.505981, - (float)1.003662, (float)1.471436, (float)1.684692, - (float)0.981323, (float)1.309570, (float)1.618042, - (float)1.228760, (float)1.554321, (float)1.756470, - (float)0.734375, (float)0.895752, (float)1.225586, - (float)0.841797, (float)1.055664, (float)1.249268, - (float)0.920166, (float)1.119385, (float)1.486206, - (float)0.894409, (float)1.539063, (float)1.828979, - (float)1.283691, (float)1.543335, (float)1.858276, - - - - - - (float)0.676025, (float)0.933105, (float)1.490845, - (float)0.821289, (float)1.491821, (float)1.739868, - (float)0.923218, (float)1.144653, (float)1.580566, - (float)1.057251, (float)1.345581, (float)1.635864, - (float)0.888672, (float)1.074951, (float)1.353149, - (float)0.942749, (float)1.195435, (float)1.505493, - (float)1.492310, (float)1.788086, (float)2.039673, - (float)1.070313, (float)1.634399, (float)1.860962, - (float)1.253296, (float)1.488892, (float)1.686035, - (float)0.647095, (float)0.864014, (float)1.401855, - (float)0.866699, (float)1.254883, (float)1.453369, - (float)1.063965, (float)1.532593, (float)1.731323, - (float)1.167847, (float)1.521484, (float)1.884033, - (float)0.956055, (float)1.502075, (float)1.745605, - (float)0.928711, (float)1.288574, (float)1.479614, - (float)1.088013, (float)1.380737, (float)1.570801, - (float)0.905029, (float)1.186768, (float)1.371948, - (float)1.057861, (float)1.421021, (float)1.617432, - (float)1.108276, (float)1.312500, (float)1.501465, - (float)0.979492, (float)1.416992, (float)1.624268, - (float)1.276001, (float)1.661011, (float)2.007935, - (float)0.993042, (float)1.168579, (float)1.331665, - (float)0.778198, (float)0.944946, (float)1.235962, - (float)1.223755, (float)1.491333, (float)1.815674, - (float)0.852661, (float)1.350464, (float)1.722290, - (float)1.134766, (float)1.593140, (float)1.787354, - (float)1.051392, (float)1.339722, (float)1.531006, - (float)0.803589, (float)1.271240, (float)1.652100, - (float)0.755737, (float)1.143555, (float)1.639404, - (float)0.700928, (float)0.837280, (float)1.130371, - (float)0.942749, (float)1.197876, (float)1.669800, - (float)0.993286, (float)1.378296, (float)1.566528, - (float)0.801025, (float)1.095337, (float)1.298950, - (float)0.739990, (float)1.032959, (float)1.383667, - (float)0.845703, (float)1.072266, (float)1.543823, - (float)0.915649, (float)1.072266, (float)1.224487, - (float)1.021973, (float)1.226196, (float)1.481323, - (float)0.999878, (float)1.204102, (float)1.555908, - (float)0.722290, (float)0.913940, (float)1.340210, - (float)0.673340, (float)0.835938, (float)1.259521, - (float)0.832397, (float)1.208374, (float)1.394165, - (float)0.962158, (float)1.576172, (float)1.912842, - (float)1.166748, (float)1.370850, (float)1.556763, - (float)0.946289, (float)1.138550, (float)1.400391, - (float)1.035034, (float)1.218262, (float)1.386475, - (float)1.393799, (float)1.717773, (float)2.000244, - (float)0.972656, (float)1.260986, (float)1.760620, - (float)1.028198, (float)1.288452, (float)1.484619, - - - - - - (float)0.773560, (float)1.258057, (float)1.756714, - (float)1.080322, (float)1.328003, (float)1.742676, - (float)0.823975, (float)1.450806, (float)1.917725, - (float)0.859009, (float)1.016602, (float)1.191895, - (float)0.843994, (float)1.131104, (float)1.645020, - (float)1.189697, (float)1.702759, (float)1.894409, - (float)1.346680, (float)1.763184, (float)2.066040, - (float)0.980469, (float)1.253784, (float)1.441650, - (float)1.338135, (float)1.641968, (float)1.932739, - (float)1.223267, (float)1.424194, (float)1.626465, - (float)0.765747, (float)1.004150, (float)1.579102, - (float)1.042847, (float)1.269165, (float)1.647461, - (float)0.968750, (float)1.257568, (float)1.555786, - (float)0.826294, (float)0.993408, (float)1.275146, - (float)0.742310, (float)0.950439, (float)1.430542, - (float)1.054321, (float)1.439819, (float)1.828003, - (float)1.072998, (float)1.261719, (float)1.441895, - (float)0.859375, (float)1.036377, (float)1.314819, - (float)0.895752, (float)1.267212, (float)1.605591, - (float)0.805420, (float)0.962891, (float)1.142334, - (float)0.795654, (float)1.005493, (float)1.468506, - (float)1.105347, (float)1.313843, (float)1.584839, - (float)0.792236, (float)1.221802, (float)1.465698, - (float)1.170532, (float)1.467651, (float)1.664063, - (float)0.838257, (float)1.153198, (float)1.342163, - (float)0.968018, (float)1.198242, (float)1.391235, - (float)1.250122, (float)1.623535, (float)1.823608, - (float)0.711670, (float)1.058350, (float)1.512085, - (float)1.204834, (float)1.454468, (float)1.739136, - (float)1.137451, (float)1.421753, (float)1.620117, - (float)0.820435, (float)1.322754, (float)1.578247, - (float)0.798706, (float)1.005005, (float)1.213867, - (float)0.980713, (float)1.324951, (float)1.512939, - (float)1.112305, (float)1.438843, (float)1.735596, - (float)1.135498, (float)1.356689, (float)1.635742, - (float)1.101318, (float)1.387451, (float)1.686523, - (float)0.849854, (float)1.276978, (float)1.523438, - (float)1.377930, (float)1.627563, (float)1.858154, - (float)0.884888, (float)1.095459, (float)1.287476, - (float)1.289795, (float)1.505859, (float)1.756592, - (float)0.817505, (float)1.384155, (float)1.650513, - (float)1.446655, (float)1.702148, (float)1.931885, - (float)0.835815, (float)1.023071, (float)1.385376, - (float)0.916626, (float)1.139038, (float)1.335327, - (float)0.980103, (float)1.174072, (float)1.453735, - (float)1.705688, (float)2.153809, (float)2.398315, (float)2.743408, - (float)1.797119, (float)2.016846, (float)2.445679, (float)2.701904, - (float)1.990356, (float)2.219116, (float)2.576416, (float)2.813477, - - - - - - (float)1.849365, (float)2.190918, (float)2.611572, (float)2.835083, - (float)1.657959, (float)1.854370, (float)2.159058, (float)2.726196, - (float)1.437744, (float)1.897705, (float)2.253174, (float)2.655396, - (float)2.028687, (float)2.247314, (float)2.542358, (float)2.875854, - (float)1.736938, (float)1.922119, (float)2.185913, (float)2.743408, - (float)1.521606, (float)1.870972, (float)2.526855, (float)2.786987, - (float)1.841431, (float)2.050659, (float)2.463623, (float)2.857666, - (float)1.590088, (float)2.067261, (float)2.427979, (float)2.794434, - (float)1.746826, (float)2.057373, (float)2.320190, (float)2.800781, - (float)1.734619, (float)1.940552, (float)2.306030, (float)2.826416, - (float)1.786255, (float)2.204468, (float)2.457520, (float)2.795288, - (float)1.861084, (float)2.170532, (float)2.414551, (float)2.763672, - (float)2.001465, (float)2.307617, (float)2.552734, (float)2.811890, - (float)1.784424, (float)2.124146, (float)2.381592, (float)2.645508, - (float)1.888794, (float)2.135864, (float)2.418579, (float)2.861206, - (float)2.301147, (float)2.531250, (float)2.724976, (float)2.913086, - (float)1.837769, (float)2.051270, (float)2.261963, (float)2.553223, - (float)2.012939, (float)2.221191, (float)2.440186, (float)2.678101, - (float)1.429565, (float)1.858276, (float)2.582275, (float)2.845703, - (float)1.622803, (float)1.897705, (float)2.367310, (float)2.621094, - (float)1.581543, (float)1.960449, (float)2.515869, (float)2.736450, - (float)1.419434, (float)1.933960, (float)2.394653, (float)2.746704, - (float)1.721924, (float)2.059570, (float)2.421753, (float)2.769653, - (float)1.911011, (float)2.220703, (float)2.461060, (float)2.740723, - (float)1.581177, (float)1.860840, (float)2.516968, (float)2.874634, - (float)1.870361, (float)2.098755, (float)2.432373, (float)2.656494, - (float)2.059692, (float)2.279785, (float)2.495605, (float)2.729370, - (float)1.815674, (float)2.181519, (float)2.451538, (float)2.680542, - (float)1.407959, (float)1.768311, (float)2.343018, (float)2.668091, - (float)2.168701, (float)2.394653, (float)2.604736, (float)2.829346, - (float)1.636230, (float)1.865723, (float)2.329102, (float)2.824219, - (float)1.878906, (float)2.139526, (float)2.376709, (float)2.679810, - (float)1.765381, (float)1.971802, (float)2.195435, (float)2.586914, - (float)2.164795, (float)2.410889, (float)2.673706, (float)2.903198, - (float)2.071899, (float)2.331055, (float)2.645874, (float)2.907104, - (float)2.026001, (float)2.311523, (float)2.594849, (float)2.863892, - (float)1.948975, (float)2.180786, (float)2.514893, (float)2.797852, - (float)1.881836, (float)2.130859, (float)2.478149, (float)2.804199, - (float)2.238159, (float)2.452759, (float)2.652832, (float)2.868286, - (float)1.897949, (float)2.101685, (float)2.524292, (float)2.880127, - (float)1.856445, (float)2.074585, (float)2.541016, (float)2.791748, - (float)1.695557, (float)2.199097, (float)2.506226, (float)2.742676, - (float)1.612671, (float)1.877075, (float)2.435425, (float)2.732910, - (float)1.568848, (float)1.786499, (float)2.194580, (float)2.768555, - (float)1.953369, (float)2.164551, (float)2.486938, (float)2.874023, - (float)1.388306, (float)1.725342, (float)2.384521, (float)2.771851, - (float)2.115356, (float)2.337769, (float)2.592896, (float)2.864014, - (float)1.905762, (float)2.111328, (float)2.363525, (float)2.789307, - - - - - - (float)1.882568, (float)2.332031, (float)2.598267, (float)2.827637, - (float)1.683594, (float)2.088745, (float)2.361938, (float)2.608643, - (float)1.874023, (float)2.182129, (float)2.536133, (float)2.766968, - (float)1.861938, (float)2.070435, (float)2.309692, (float)2.700562, - (float)1.722168, (float)2.107422, (float)2.477295, (float)2.837646, - (float)1.926880, (float)2.184692, (float)2.442627, (float)2.663818, - (float)2.123901, (float)2.337280, (float)2.553101, (float)2.777466, - (float)1.588135, (float)1.911499, (float)2.212769, (float)2.543945, - (float)2.053955, (float)2.370850, (float)2.712158, (float)2.939941, - (float)2.210449, (float)2.519653, (float)2.770386, (float)2.958618, - (float)2.199463, (float)2.474731, (float)2.718262, (float)2.919922, - (float)1.960083, (float)2.175415, (float)2.608032, (float)2.888794, - (float)1.953735, (float)2.185181, (float)2.428223, (float)2.809570, - (float)1.615234, (float)2.036499, (float)2.576538, (float)2.834595, - (float)1.621094, (float)2.028198, (float)2.431030, (float)2.664673, - (float)1.824951, (float)2.267456, (float)2.514526, (float)2.747925, - (float)1.994263, (float)2.229126, (float)2.475220, (float)2.833984, - (float)1.746338, (float)2.011353, (float)2.588257, (float)2.826904, - (float)1.562866, (float)2.135986, (float)2.471680, (float)2.687256, - (float)1.748901, (float)2.083496, (float)2.460938, (float)2.686279, - (float)1.758057, (float)2.131470, (float)2.636597, (float)2.891602, - (float)2.071289, (float)2.299072, (float)2.550781, (float)2.814331, - (float)1.839600, (float)2.094360, (float)2.496460, (float)2.723999, - (float)1.882202, (float)2.088257, (float)2.636841, (float)2.923096, - (float)1.957886, (float)2.153198, (float)2.384399, (float)2.615234, - (float)1.992920, (float)2.351196, (float)2.654419, (float)2.889771, - (float)2.012817, (float)2.262451, (float)2.643799, (float)2.903076, - (float)2.025635, (float)2.254761, (float)2.508423, (float)2.784058, - (float)2.316040, (float)2.589355, (float)2.794189, (float)2.963623, - (float)1.741211, (float)2.279541, (float)2.578491, (float)2.816284, - (float)1.845337, (float)2.055786, (float)2.348511, (float)2.822021, - (float)1.679932, (float)1.926514, (float)2.499756, (float)2.835693, - (float)1.722534, (float)1.946899, (float)2.448486, (float)2.728760, - (float)1.829834, (float)2.043213, (float)2.580444, (float)2.867676, - (float)1.676636, (float)2.071655, (float)2.322510, (float)2.704834, - (float)1.791504, (float)2.113525, (float)2.469727, (float)2.784058, - (float)1.977051, (float)2.215088, (float)2.497437, (float)2.726929, - (float)1.800171, (float)2.106689, (float)2.357788, (float)2.738892, - (float)1.827759, (float)2.170166, (float)2.525879, (float)2.852417, - (float)1.918335, (float)2.132813, (float)2.488403, (float)2.728149, - (float)1.916748, (float)2.225098, (float)2.542603, (float)2.857666, - (float)1.761230, (float)1.976074, (float)2.507446, (float)2.884521, - (float)2.053711, (float)2.367432, (float)2.608032, (float)2.837646, - (float)1.595337, (float)2.000977, (float)2.307129, (float)2.578247, - (float)1.470581, (float)2.031250, (float)2.375854, (float)2.647583, - (float)1.801392, (float)2.128052, (float)2.399780, (float)2.822876, - (float)1.853638, (float)2.066650, (float)2.429199, (float)2.751465, - (float)1.956299, (float)2.163696, (float)2.394775, (float)2.734253, - - - - - - (float)1.963623, (float)2.275757, (float)2.585327, (float)2.865234, - (float)1.887451, (float)2.105469, (float)2.331787, (float)2.587402, - (float)2.120117, (float)2.443359, (float)2.733887, (float)2.941406, - (float)1.506348, (float)1.766968, (float)2.400513, (float)2.851807, - (float)1.664551, (float)1.981079, (float)2.375732, (float)2.774414, - (float)1.720703, (float)1.978882, (float)2.391479, (float)2.640991, - (float)1.483398, (float)1.814819, (float)2.434448, (float)2.722290, - (float)1.769043, (float)2.136597, (float)2.563721, (float)2.774414, - (float)1.810791, (float)2.049316, (float)2.373901, (float)2.613647, - (float)1.788330, (float)2.005981, (float)2.359131, (float)2.723145, - (float)1.785156, (float)1.993164, (float)2.399780, (float)2.832520, - (float)1.695313, (float)2.022949, (float)2.522583, (float)2.745117, - (float)1.584106, (float)1.965576, (float)2.299927, (float)2.715576, - (float)1.894897, (float)2.249878, (float)2.655884, (float)2.897705, - (float)1.720581, (float)1.995728, (float)2.299438, (float)2.557007, - (float)1.619385, (float)2.173950, (float)2.574219, (float)2.787964, - (float)1.883179, (float)2.220459, (float)2.474365, (float)2.825073, - (float)1.447632, (float)2.045044, (float)2.555542, (float)2.744873, - (float)1.502686, (float)2.156616, (float)2.653320, (float)2.846558, - (float)1.711548, (float)1.944092, (float)2.282959, (float)2.685791, - (float)1.499756, (float)1.867554, (float)2.341064, (float)2.578857, - (float)1.916870, (float)2.135132, (float)2.568237, (float)2.826050, - (float)1.498047, (float)1.711182, (float)2.223267, (float)2.755127, - (float)1.808716, (float)1.997559, (float)2.256470, (float)2.758545, - (float)2.088501, (float)2.402710, (float)2.667358, (float)2.890259, - (float)1.545044, (float)1.819214, (float)2.324097, (float)2.692993, - (float)1.796021, (float)2.012573, (float)2.505737, (float)2.784912, - (float)1.786499, (float)2.041748, (float)2.290405, (float)2.650757, - (float)1.938232, (float)2.264404, (float)2.529053, (float)2.796143 - }; - diff --git a/sflphone-common/src/audio/codecs/ilbc/constants.h b/sflphone-common/src/audio/codecs/ilbc/constants.h deleted file mode 100644 index 3487d529dbecc8fd7799e47870e3908550b55fdf..0000000000000000000000000000000000000000 --- a/sflphone-common/src/audio/codecs/ilbc/constants.h +++ /dev/null @@ -1,80 +0,0 @@ - - /****************************************************************** - - iLBC Speech Coder ANSI-C Source Code - - constants.h - - Copyright (C) The Internet Society (2004). - All Rights Reserved. - - ******************************************************************/ - - #ifndef __iLBC_CONSTANTS_H - #define __iLBC_CONSTANTS_H - - #include "iLBC_define.h" - - - /* ULP bit allocation */ - - - - - - - extern const iLBC_ULP_Inst_t ULP_20msTbl; - extern const iLBC_ULP_Inst_t ULP_30msTbl; - - /* high pass filters */ - - extern float hpi_zero_coefsTbl[]; - extern float hpi_pole_coefsTbl[]; - extern float hpo_zero_coefsTbl[]; - extern float hpo_pole_coefsTbl[]; - - /* low pass filters */ - extern float lpFilt_coefsTbl[]; - - /* LPC analysis and quantization */ - - extern float lpc_winTbl[]; - extern float lpc_asymwinTbl[]; - extern float lpc_lagwinTbl[]; - extern float lsfCbTbl[]; - extern float lsfmeanTbl[]; - extern int dim_lsfCbTbl[]; - extern int size_lsfCbTbl[]; - extern float lsf_weightTbl_30ms[]; - extern float lsf_weightTbl_20ms[]; - - /* state quantization tables */ - - extern float state_sq3Tbl[]; - extern float state_frgqTbl[]; - - /* gain quantization tables */ - - extern float gain_sq3Tbl[]; - extern float gain_sq4Tbl[]; - extern float gain_sq5Tbl[]; - - /* adaptive codebook definitions */ - - extern int search_rangeTbl[5][CB_NSTAGES]; - extern int memLfTbl[]; - extern int stMemLTbl; - extern float cbfiltersTbl[CB_FILTERLEN]; - - /* enhancer definitions */ - - extern float polyphaserTbl[]; - extern float enh_plocsTbl[]; - - - - - - - #endif - diff --git a/sflphone-common/src/audio/codecs/ilbc/createCB.c b/sflphone-common/src/audio/codecs/ilbc/createCB.c deleted file mode 100644 index aefacf200aa83c88e8f55bb9e0a44b053e2047b3..0000000000000000000000000000000000000000 --- a/sflphone-common/src/audio/codecs/ilbc/createCB.c +++ /dev/null @@ -1,231 +0,0 @@ - - - /****************************************************************** - - iLBC Speech Coder ANSI-C Source Code - - createCB.c - - Copyright (C) The Internet Society (2004). - All Rights Reserved. - - ******************************************************************/ - - - - - - #include "iLBC_define.h" - #include "constants.h" - #include <string.h> - #include <math.h> - - /*----------------------------------------------------------------* - * Construct an additional codebook vector by filtering the - * initial codebook buffer. This vector is then used to expand - * the codebook with an additional section. - *---------------------------------------------------------------*/ - - void filteredCBvecs( - float *cbvectors, /* (o) Codebook vectors for the - higher section */ - float *mem, /* (i) Buffer to create codebook - vector from */ - int lMem /* (i) Length of buffer */ - ){ - int j, k; - float *pp, *pp1; - float tempbuff2[CB_MEML+CB_FILTERLEN]; - float *pos; - - memset(tempbuff2, 0, (CB_HALFFILTERLEN-1)*sizeof(float)); - memcpy(&tempbuff2[CB_HALFFILTERLEN-1], mem, lMem*sizeof(float)); - memset(&tempbuff2[lMem+CB_HALFFILTERLEN-1], 0, - (CB_HALFFILTERLEN+1)*sizeof(float)); - - /* Create codebook vector for higher section by filtering */ - - /* do filtering */ - pos=cbvectors; - memset(pos, 0, lMem*sizeof(float)); - for (k=0; k<lMem; k++) { - pp=&tempbuff2[k]; - pp1=&cbfiltersTbl[CB_FILTERLEN-1]; - for (j=0;j<CB_FILTERLEN;j++) { - (*pos)+=(*pp++)*(*pp1--); - } - pos++; - } - } - - /*----------------------------------------------------------------* - * Search the augmented part of the codebook to find the best - * measure. - *----------------------------------------------------------------*/ - - - - - - - void searchAugmentedCB( - int low, /* (i) Start index for the search */ - int high, /* (i) End index for the search */ - int stage, /* (i) Current stage */ - int startIndex, /* (i) Codebook index for the first - aug vector */ - float *target, /* (i) Target vector for encoding */ - float *buffer, /* (i) Pointer to the end of the buffer for - augmented codebook construction */ - float *max_measure, /* (i/o) Currently maximum measure */ - int *best_index,/* (o) Currently the best index */ - float *gain, /* (o) Currently the best gain */ - float *energy, /* (o) Energy of augmented codebook - vectors */ - float *invenergy/* (o) Inv energy of augmented codebook - vectors */ - ) { - int icount, ilow, j, tmpIndex; - float *pp, *ppo, *ppi, *ppe, crossDot, alfa; - float weighted, measure, nrjRecursive; - float ftmp; - - /* Compute the energy for the first (low-5) - noninterpolated samples */ - nrjRecursive = (float) 0.0; - pp = buffer - low + 1; - for (j=0; j<(low-5); j++) { - nrjRecursive += ( (*pp)*(*pp) ); - pp++; - } - ppe = buffer - low; - - - for (icount=low; icount<=high; icount++) { - - /* Index of the codebook vector used for retrieving - energy values */ - tmpIndex = startIndex+icount-20; - - ilow = icount-4; - - /* Update the energy recursively to save complexity */ - nrjRecursive = nrjRecursive + (*ppe)*(*ppe); - ppe--; - energy[tmpIndex] = nrjRecursive; - - /* Compute cross dot product for the first (low-5) - samples */ - - - - - - crossDot = (float) 0.0; - pp = buffer-icount; - for (j=0; j<ilow; j++) { - crossDot += target[j]*(*pp++); - } - - /* interpolation */ - alfa = (float) 0.2; - ppo = buffer-4; - ppi = buffer-icount-4; - for (j=ilow; j<icount; j++) { - weighted = ((float)1.0-alfa)*(*ppo)+alfa*(*ppi); - ppo++; - ppi++; - energy[tmpIndex] += weighted*weighted; - crossDot += target[j]*weighted; - alfa += (float)0.2; - } - - /* Compute energy and cross dot product for the - remaining samples */ - pp = buffer - icount; - for (j=icount; j<SUBL; j++) { - energy[tmpIndex] += (*pp)*(*pp); - crossDot += target[j]*(*pp++); - } - - if (energy[tmpIndex]>0.0) { - invenergy[tmpIndex]=(float)1.0/(energy[tmpIndex]+EPS); - } else { - invenergy[tmpIndex] = (float) 0.0; - } - - if (stage==0) { - measure = (float)-10000000.0; - - if (crossDot > 0.0) { - measure = crossDot*crossDot*invenergy[tmpIndex]; - } - } - else { - measure = crossDot*crossDot*invenergy[tmpIndex]; - } - - /* check if measure is better */ - ftmp = crossDot*invenergy[tmpIndex]; - - if ((measure>*max_measure) && (fabs(ftmp)<CB_MAXGAIN)) { - - - - - - *best_index = tmpIndex; - *max_measure = measure; - *gain = ftmp; - } - } - } - - - /*----------------------------------------------------------------* - * Recreate a specific codebook vector from the augmented part. - * - *----------------------------------------------------------------*/ - - void createAugmentedVec( - int index, /* (i) Index for the augmented vector - to be created */ - float *buffer, /* (i) Pointer to the end of the buffer for - augmented codebook construction */ - float *cbVec/* (o) The construced codebook vector */ - ) { - int ilow, j; - float *pp, *ppo, *ppi, alfa, alfa1, weighted; - - ilow = index-5; - - /* copy the first noninterpolated part */ - - pp = buffer-index; - memcpy(cbVec,pp,sizeof(float)*index); - - /* interpolation */ - - alfa1 = (float)0.2; - alfa = 0.0; - ppo = buffer-5; - ppi = buffer-index-5; - for (j=ilow; j<index; j++) { - weighted = ((float)1.0-alfa)*(*ppo)+alfa*(*ppi); - ppo++; - ppi++; - cbVec[j] = weighted; - alfa += alfa1; - } - - /* copy the second noninterpolated part */ - - pp = buffer - index; - memcpy(cbVec+index,pp,sizeof(float)*(SUBL-index)); - - - - - - } - diff --git a/sflphone-common/src/audio/codecs/ilbc/createCB.h b/sflphone-common/src/audio/codecs/ilbc/createCB.h deleted file mode 100644 index eda547c6692451e297ad38421e4040d716d2acb1..0000000000000000000000000000000000000000 --- a/sflphone-common/src/audio/codecs/ilbc/createCB.h +++ /dev/null @@ -1,58 +0,0 @@ - - /****************************************************************** - - iLBC Speech Coder ANSI-C Source Code - - createCB.h - - Copyright (C) The Internet Society (2004). - All Rights Reserved. - - ******************************************************************/ - - #ifndef __iLBC_CREATECB_H - #define __iLBC_CREATECB_H - - void filteredCBvecs( - float *cbvectors, /* (o) Codebook vector for the - higher section */ - - - - - - float *mem, /* (i) Buffer to create codebook - vectors from */ - int lMem /* (i) Length of buffer */ - ); - - void searchAugmentedCB( - int low, /* (i) Start index for the search */ - int high, /* (i) End index for the search */ - int stage, /* (i) Current stage */ - int startIndex, /* (i) CB index for the first - augmented vector */ - float *target, /* (i) Target vector for encoding */ - float *buffer, /* (i) Pointer to the end of the - buffer for augmented codebook - construction */ - float *max_measure, /* (i/o) Currently maximum measure */ - int *best_index,/* (o) Currently the best index */ - float *gain, /* (o) Currently the best gain */ - float *energy, /* (o) Energy of augmented - codebook vectors */ - float *invenergy/* (o) Inv energy of aug codebook - vectors */ - ); - - void createAugmentedVec( - int index, /* (i) Index for the aug vector - to be created */ - float *buffer, /* (i) Pointer to the end of the - buffer for augmented codebook - construction */ - float *cbVec /* (o) The construced codebook vector */ - ); - - #endif - diff --git a/sflphone-common/src/audio/codecs/ilbc/doCPLC.c b/sflphone-common/src/audio/codecs/ilbc/doCPLC.c deleted file mode 100644 index adbfac71a2404ef421035d4b037e27f4b191b4c7..0000000000000000000000000000000000000000 --- a/sflphone-common/src/audio/codecs/ilbc/doCPLC.c +++ /dev/null @@ -1,270 +0,0 @@ - - /****************************************************************** - - iLBC Speech Coder ANSI-C Source Code - - doCPLC.c - - Copyright (C) The Internet Society (2004). - All Rights Reserved. - - ******************************************************************/ - - #include <math.h> - #include <string.h> - #include <stdio.h> - - - - - - #include "iLBC_define.h" - - /*----------------------------------------------------------------* - * Compute cross correlation and pitch gain for pitch prediction - * of last subframe at given lag. - *---------------------------------------------------------------*/ - - void compCorr( - float *cc, /* (o) cross correlation coefficient */ - float *gc, /* (o) gain */ - float *pm, - float *buffer, /* (i) signal buffer */ - int lag, /* (i) pitch lag */ - int bLen, /* (i) length of buffer */ - int sRange /* (i) correlation search length */ - ){ - int i; - float ftmp1, ftmp2, ftmp3; - - /* Guard against getting outside buffer */ - if ((bLen-sRange-lag)<0) { - sRange=bLen-lag; - } - - ftmp1 = 0.0; - ftmp2 = 0.0; - ftmp3 = 0.0; - for (i=0; i<sRange; i++) { - ftmp1 += buffer[bLen-sRange+i] * - buffer[bLen-sRange+i-lag]; - ftmp2 += buffer[bLen-sRange+i-lag] * - buffer[bLen-sRange+i-lag]; - ftmp3 += buffer[bLen-sRange+i] * - buffer[bLen-sRange+i]; - } - - if (ftmp2 > 0.0) { - *cc = ftmp1*ftmp1/ftmp2; - *gc = (float)fabs(ftmp1/ftmp2); - *pm=(float)fabs(ftmp1)/ - ((float)sqrt(ftmp2)*(float)sqrt(ftmp3)); - } - else { - *cc = 0.0; - *gc = 0.0; - *pm=0.0; - } - } - - - - - - /*----------------------------------------------------------------* - * Packet loss concealment routine. Conceals a residual signal - * and LP parameters. If no packet loss, update state. - *---------------------------------------------------------------*/ - - void doThePLC( - float *PLCresidual, /* (o) concealed residual */ - float *PLClpc, /* (o) concealed LP parameters */ - int PLI, /* (i) packet loss indicator - 0 - no PL, 1 = PL */ - float *decresidual, /* (i) decoded residual */ - float *lpc, /* (i) decoded LPC (only used for no PL) */ - int inlag, /* (i) pitch lag */ - iLBC_Dec_Inst_t *iLBCdec_inst - /* (i/o) decoder instance */ - ){ - int lag=20, randlag; - float gain, maxcc; - float use_gain; - float gain_comp, maxcc_comp, per, max_per; - int i, pick, use_lag; - float ftmp, randvec[BLOCKL_MAX], pitchfact, energy; - - /* Packet Loss */ - - if (PLI == 1) { - - iLBCdec_inst->consPLICount += 1; - - /* if previous frame not lost, - determine pitch pred. gain */ - - if (iLBCdec_inst->prevPLI != 1) { - - /* Search around the previous lag to find the - best pitch period */ - - lag=inlag-3; - compCorr(&maxcc, &gain, &max_per, - iLBCdec_inst->prevResidual, - lag, iLBCdec_inst->blockl, 60); - for (i=inlag-2;i<=inlag+3;i++) { - compCorr(&maxcc_comp, &gain_comp, &per, - iLBCdec_inst->prevResidual, - i, iLBCdec_inst->blockl, 60); - - if (maxcc_comp>maxcc) { - maxcc=maxcc_comp; - - - - - - gain=gain_comp; - lag=i; - max_per=per; - } - } - - } - - /* previous frame lost, use recorded lag and periodicity */ - - else { - lag=iLBCdec_inst->prevLag; - max_per=iLBCdec_inst->per; - } - - /* downscaling */ - - use_gain=1.0; - if (iLBCdec_inst->consPLICount*iLBCdec_inst->blockl>320) - use_gain=(float)0.9; - else if (iLBCdec_inst->consPLICount* - iLBCdec_inst->blockl>2*320) - use_gain=(float)0.7; - else if (iLBCdec_inst->consPLICount* - iLBCdec_inst->blockl>3*320) - use_gain=(float)0.5; - else if (iLBCdec_inst->consPLICount* - iLBCdec_inst->blockl>4*320) - use_gain=(float)0.0; - - /* mix noise and pitch repeatition */ - ftmp=(float)sqrt(max_per); - if (ftmp>(float)0.7) - pitchfact=(float)1.0; - else if (ftmp>(float)0.4) - pitchfact=(ftmp-(float)0.4)/((float)0.7-(float)0.4); - else - pitchfact=0.0; - - - /* avoid repetition of same pitch cycle */ - use_lag=lag; - if (lag<80) { - use_lag=2*lag; - } - - /* compute concealed residual */ - - - - - - - energy = 0.0; - for (i=0; i<iLBCdec_inst->blockl; i++) { - - /* noise component */ - - iLBCdec_inst->seed=(iLBCdec_inst->seed*69069L+1) & - (0x80000000L-1); - randlag = 50 + ((signed long) iLBCdec_inst->seed)%70; - pick = i - randlag; - - if (pick < 0) { - randvec[i] = - iLBCdec_inst->prevResidual[ - iLBCdec_inst->blockl+pick]; - } else { - randvec[i] = randvec[pick]; - } - - /* pitch repeatition component */ - pick = i - use_lag; - - if (pick < 0) { - PLCresidual[i] = - iLBCdec_inst->prevResidual[ - iLBCdec_inst->blockl+pick]; - } else { - PLCresidual[i] = PLCresidual[pick]; - } - - /* mix random and periodicity component */ - - if (i<80) - PLCresidual[i] = use_gain*(pitchfact * - PLCresidual[i] + - ((float)1.0 - pitchfact) * randvec[i]); - else if (i<160) - PLCresidual[i] = (float)0.95*use_gain*(pitchfact * - PLCresidual[i] + - ((float)1.0 - pitchfact) * randvec[i]); - else - PLCresidual[i] = (float)0.9*use_gain*(pitchfact * - PLCresidual[i] + - ((float)1.0 - pitchfact) * randvec[i]); - - energy += PLCresidual[i] * PLCresidual[i]; - } - - /* less than 30 dB, use only noise */ - - - - - - - if (sqrt(energy/(float)iLBCdec_inst->blockl) < 30.0) { - gain=0.0; - for (i=0; i<iLBCdec_inst->blockl; i++) { - PLCresidual[i] = randvec[i]; - } - } - - /* use old LPC */ - - memcpy(PLClpc,iLBCdec_inst->prevLpc, - (LPC_FILTERORDER+1)*sizeof(float)); - - } - - /* no packet loss, copy input */ - - else { - memcpy(PLCresidual, decresidual, - iLBCdec_inst->blockl*sizeof(float)); - memcpy(PLClpc, lpc, (LPC_FILTERORDER+1)*sizeof(float)); - iLBCdec_inst->consPLICount = 0; - } - - /* update state */ - - if (PLI) { - iLBCdec_inst->prevLag = lag; - iLBCdec_inst->per=max_per; - } - - iLBCdec_inst->prevPLI = PLI; - memcpy(iLBCdec_inst->prevLpc, PLClpc, - (LPC_FILTERORDER+1)*sizeof(float)); - memcpy(iLBCdec_inst->prevResidual, PLCresidual, - iLBCdec_inst->blockl*sizeof(float)); - } - diff --git a/sflphone-common/src/audio/codecs/ilbc/doCPLC.h b/sflphone-common/src/audio/codecs/ilbc/doCPLC.h deleted file mode 100644 index 2bda7a144108248dd1de2e37fb59bf94ef55817d..0000000000000000000000000000000000000000 --- a/sflphone-common/src/audio/codecs/ilbc/doCPLC.h +++ /dev/null @@ -1,29 +0,0 @@ - - /****************************************************************** - - iLBC Speech Coder ANSI-C Source Code - - doCPLC.h - - Copyright (C) The Internet Society (2004). - All Rights Reserved. - - ******************************************************************/ - - #ifndef __iLBC_DOLPC_H - #define __iLBC_DOLPC_H - - void doThePLC( - float *PLCresidual, /* (o) concealed residual */ - float *PLClpc, /* (o) concealed LP parameters */ - int PLI, /* (i) packet loss indicator - 0 - no PL, 1 = PL */ - float *decresidual, /* (i) decoded residual */ - float *lpc, /* (i) decoded LPC (only used for no PL) */ - int inlag, /* (i) pitch lag */ - iLBC_Dec_Inst_t *iLBCdec_inst - /* (i/o) decoder instance */ - ); - - #endif - diff --git a/sflphone-common/src/audio/codecs/ilbc/enhancer.c b/sflphone-common/src/audio/codecs/ilbc/enhancer.c deleted file mode 100644 index 1770207dd30cfa5a45a52a026b8928c002371988..0000000000000000000000000000000000000000 --- a/sflphone-common/src/audio/codecs/ilbc/enhancer.c +++ /dev/null @@ -1,701 +0,0 @@ - - /****************************************************************** - - iLBC Speech Coder ANSI-C Source Code - - enhancer.c - - Copyright (C) The Internet Society (2004). - All Rights Reserved. - - ******************************************************************/ - - #include <math.h> - #include <string.h> - #include "iLBC_define.h" - #include "constants.h" - #include "filter.h" - - /*----------------------------------------------------------------* - * Find index in array such that the array element with said - * index is the element of said array closest to "value" - * according to the squared-error criterion - *---------------------------------------------------------------*/ - - void NearestNeighbor( - - - - - - int *index, /* (o) index of array element closest - to value */ - float *array, /* (i) data array */ - float value,/* (i) value */ - int arlength/* (i) dimension of data array */ - ){ - int i; - float bestcrit,crit; - - crit=array[0]-value; - bestcrit=crit*crit; - *index=0; - for (i=1; i<arlength; i++) { - crit=array[i]-value; - crit=crit*crit; - - if (crit<bestcrit) { - bestcrit=crit; - *index=i; - } - } - } - - /*----------------------------------------------------------------* - * compute cross correlation between sequences - *---------------------------------------------------------------*/ - - void mycorr1( - float* corr, /* (o) correlation of seq1 and seq2 */ - float* seq1, /* (i) first sequence */ - int dim1, /* (i) dimension first seq1 */ - const float *seq2, /* (i) second sequence */ - int dim2 /* (i) dimension seq2 */ - ){ - int i,j; - - for (i=0; i<=dim1-dim2; i++) { - corr[i]=0.0; - for (j=0; j<dim2; j++) { - corr[i] += seq1[i+j] * seq2[j]; - } - } - } - - /*----------------------------------------------------------------* - * upsample finite array assuming zeros outside bounds - *---------------------------------------------------------------*/ - - - - - - - void enh_upsample( - float* useq1, /* (o) upsampled output sequence */ - float* seq1,/* (i) unupsampled sequence */ - int dim1, /* (i) dimension seq1 */ - int hfl /* (i) polyphase filter length=2*hfl+1 */ - ){ - float *pu,*ps; - int i,j,k,q,filterlength,hfl2; - const float *polyp[ENH_UPS0]; /* pointers to - polyphase columns */ - const float *pp; - - /* define pointers for filter */ - - filterlength=2*hfl+1; - - if ( filterlength > dim1 ) { - hfl2=(int) (dim1/2); - for (j=0; j<ENH_UPS0; j++) { - polyp[j]=polyphaserTbl+j*filterlength+hfl-hfl2; - } - hfl=hfl2; - filterlength=2*hfl+1; - } - else { - for (j=0; j<ENH_UPS0; j++) { - polyp[j]=polyphaserTbl+j*filterlength; - } - } - - /* filtering: filter overhangs left side of sequence */ - - pu=useq1; - for (i=hfl; i<filterlength; i++) { - for (j=0; j<ENH_UPS0; j++) { - *pu=0.0; - pp = polyp[j]; - ps = seq1+i; - for (k=0; k<=i; k++) { - *pu += *ps-- * *pp++; - } - pu++; - } - } - - /* filtering: simple convolution=inner products */ - - for (i=filterlength; i<dim1; i++) { - - - - - - for (j=0;j<ENH_UPS0; j++){ - *pu=0.0; - pp = polyp[j]; - ps = seq1+i; - for (k=0; k<filterlength; k++) { - *pu += *ps-- * *pp++; - } - pu++; - } - } - - /* filtering: filter overhangs right side of sequence */ - - for (q=1; q<=hfl; q++) { - for (j=0; j<ENH_UPS0; j++) { - *pu=0.0; - pp = polyp[j]+q; - ps = seq1+dim1-1; - for (k=0; k<filterlength-q; k++) { - *pu += *ps-- * *pp++; - } - pu++; - } - } - } - - - /*----------------------------------------------------------------* - * find segment starting near idata+estSegPos that has highest - * correlation with idata+centerStartPos through - * idata+centerStartPos+ENH_BLOCKL-1 segment is found at a - * resolution of ENH_UPSO times the original of the original - * sampling rate - *---------------------------------------------------------------*/ - - void refiner( - float *seg, /* (o) segment array */ - float *updStartPos, /* (o) updated start point */ - float* idata, /* (i) original data buffer */ - int idatal, /* (i) dimension of idata */ - int centerStartPos, /* (i) beginning center segment */ - float estSegPos,/* (i) estimated beginning other segment */ - float period /* (i) estimated pitch period */ - ){ - int estSegPosRounded,searchSegStartPos,searchSegEndPos,corrdim; - int tloc,tloc2,i,st,en,fraction; - float vect[ENH_VECTL],corrVec[ENH_CORRDIM],maxv; - float corrVecUps[ENH_CORRDIM*ENH_UPS0]; - - - - - - /* defining array bounds */ - - estSegPosRounded=(int)(estSegPos - 0.5); - - searchSegStartPos=estSegPosRounded-ENH_SLOP; - - if (searchSegStartPos<0) { - searchSegStartPos=0; - } - searchSegEndPos=estSegPosRounded+ENH_SLOP; - - if (searchSegEndPos+ENH_BLOCKL >= idatal) { - searchSegEndPos=idatal-ENH_BLOCKL-1; - } - corrdim=searchSegEndPos-searchSegStartPos+1; - - /* compute upsampled correlation (corr33) and find - location of max */ - - mycorr1(corrVec,idata+searchSegStartPos, - corrdim+ENH_BLOCKL-1,idata+centerStartPos,ENH_BLOCKL); - enh_upsample(corrVecUps,corrVec,corrdim,ENH_FL0); - tloc=0; maxv=corrVecUps[0]; - for (i=1; i<ENH_UPS0*corrdim; i++) { - - if (corrVecUps[i]>maxv) { - tloc=i; - maxv=corrVecUps[i]; - } - } - - /* make vector can be upsampled without ever running outside - bounds */ - - *updStartPos= (float)searchSegStartPos + - (float)tloc/(float)ENH_UPS0+(float)1.0; - tloc2=(int)(tloc/ENH_UPS0); - - if (tloc>tloc2*ENH_UPS0) { - tloc2++; - } - st=searchSegStartPos+tloc2-ENH_FL0; - - if (st<0) { - memset(vect,0,-st*sizeof(float)); - memcpy(&vect[-st],idata, (ENH_VECTL+st)*sizeof(float)); - } - else { - - - - - - en=st+ENH_VECTL; - - if (en>idatal) { - memcpy(vect, &idata[st], - (ENH_VECTL-(en-idatal))*sizeof(float)); - memset(&vect[ENH_VECTL-(en-idatal)], 0, - (en-idatal)*sizeof(float)); - } - else { - memcpy(vect, &idata[st], ENH_VECTL*sizeof(float)); - } - } - fraction=tloc2*ENH_UPS0-tloc; - - /* compute the segment (this is actually a convolution) */ - - mycorr1(seg,vect,ENH_VECTL,polyphaserTbl+(2*ENH_FL0+1)*fraction, - 2*ENH_FL0+1); - } - - /*----------------------------------------------------------------* - * find the smoothed output data - *---------------------------------------------------------------*/ - - void smath( - float *odata, /* (o) smoothed output */ - float *sseq,/* (i) said second sequence of waveforms */ - int hl, /* (i) 2*hl+1 is sseq dimension */ - float alpha0/* (i) max smoothing energy fraction */ - ){ - int i,k; - float w00,w10,w11,A,B,C,*psseq,err,errs; - float surround[BLOCKL_MAX]; /* shape contributed by other than - current */ - float wt[2*ENH_HL+1]; /* waveform weighting to get - surround shape */ - float denom; - - /* create shape of contribution from all waveforms except the - current one */ - - for (i=1; i<=2*hl+1; i++) { - wt[i-1] = (float)0.5*(1 - (float)cos(2*PI*i/(2*hl+2))); - } - wt[hl]=0.0; /* for clarity, not used */ - for (i=0; i<ENH_BLOCKL; i++) { - surround[i]=sseq[i]*wt[0]; - } - - - - - - for (k=1; k<hl; k++) { - psseq=sseq+k*ENH_BLOCKL; - for(i=0;i<ENH_BLOCKL; i++) { - surround[i]+=psseq[i]*wt[k]; - } - } - for (k=hl+1; k<=2*hl; k++) { - psseq=sseq+k*ENH_BLOCKL; - for(i=0;i<ENH_BLOCKL; i++) { - surround[i]+=psseq[i]*wt[k]; - } - } - - /* compute some inner products */ - - w00 = w10 = w11 = 0.0; - psseq=sseq+hl*ENH_BLOCKL; /* current block */ - for (i=0; i<ENH_BLOCKL;i++) { - w00+=psseq[i]*psseq[i]; - w11+=surround[i]*surround[i]; - w10+=surround[i]*psseq[i]; - } - - if (fabs(w11) < 1.0) { - w11=1.0; - } - C = (float)sqrt( w00/w11); - - /* first try enhancement without power-constraint */ - - errs=0.0; - psseq=sseq+hl*ENH_BLOCKL; - for (i=0; i<ENH_BLOCKL; i++) { - odata[i]=C*surround[i]; - err=psseq[i]-odata[i]; - errs+=err*err; - } - - /* if constraint violated by first try, add constraint */ - - if (errs > alpha0 * w00) { - if ( w00 < 1) { - w00=1; - } - denom = (w11*w00-w10*w10)/(w00*w00); - - if (denom > 0.0001) { /* eliminates numerical problems - for if smooth */ - - - - - - A = (float)sqrt( (alpha0- alpha0*alpha0/4)/denom); - B = -alpha0/2 - A * w10/w00; - B = B+1; - } - else { /* essentially no difference between cycles; - smoothing not needed */ - A= 0.0; - B= 1.0; - } - - /* create smoothed sequence */ - - psseq=sseq+hl*ENH_BLOCKL; - for (i=0; i<ENH_BLOCKL; i++) { - odata[i]=A*surround[i]+B*psseq[i]; - } - } - } - - /*----------------------------------------------------------------* - * get the pitch-synchronous sample sequence - *---------------------------------------------------------------*/ - - void getsseq( - float *sseq, /* (o) the pitch-synchronous sequence */ - float *idata, /* (i) original data */ - int idatal, /* (i) dimension of data */ - int centerStartPos, /* (i) where current block starts */ - float *period, /* (i) rough-pitch-period array */ - float *plocs, /* (i) where periods of period array - are taken */ - int periodl, /* (i) dimension period array */ - int hl /* (i) 2*hl+1 is the number of sequences */ - ){ - int i,centerEndPos,q; - float blockStartPos[2*ENH_HL+1]; - int lagBlock[2*ENH_HL+1]; - float plocs2[ENH_PLOCSL]; - float *psseq; - - centerEndPos=centerStartPos+ENH_BLOCKL-1; - - /* present */ - - NearestNeighbor(lagBlock+hl,plocs, - (float)0.5*(centerStartPos+centerEndPos),periodl); - - blockStartPos[hl]=(float)centerStartPos; - - - - - - psseq=sseq+ENH_BLOCKL*hl; - memcpy(psseq, idata+centerStartPos, ENH_BLOCKL*sizeof(float)); - - /* past */ - - for (q=hl-1; q>=0; q--) { - blockStartPos[q]=blockStartPos[q+1]-period[lagBlock[q+1]]; - NearestNeighbor(lagBlock+q,plocs, - blockStartPos[q]+ - ENH_BLOCKL_HALF-period[lagBlock[q+1]], periodl); - - - if (blockStartPos[q]-ENH_OVERHANG>=0) { - refiner(sseq+q*ENH_BLOCKL, blockStartPos+q, idata, - idatal, centerStartPos, blockStartPos[q], - period[lagBlock[q+1]]); - } else { - psseq=sseq+q*ENH_BLOCKL; - memset(psseq, 0, ENH_BLOCKL*sizeof(float)); - } - } - - /* future */ - - for (i=0; i<periodl; i++) { - plocs2[i]=plocs[i]-period[i]; - } - for (q=hl+1; q<=2*hl; q++) { - NearestNeighbor(lagBlock+q,plocs2, - blockStartPos[q-1]+ENH_BLOCKL_HALF,periodl); - - blockStartPos[q]=blockStartPos[q-1]+period[lagBlock[q]]; - if (blockStartPos[q]+ENH_BLOCKL+ENH_OVERHANG<idatal) { - refiner(sseq+ENH_BLOCKL*q, blockStartPos+q, idata, - idatal, centerStartPos, blockStartPos[q], - period[lagBlock[q]]); - } - else { - psseq=sseq+q*ENH_BLOCKL; - memset(psseq, 0, ENH_BLOCKL*sizeof(float)); - } - } - } - - /*----------------------------------------------------------------* - * perform enhancement on idata+centerStartPos through - * idata+centerStartPos+ENH_BLOCKL-1 - *---------------------------------------------------------------*/ - - - - - - void enhancer( - float *odata, /* (o) smoothed block, dimension blockl */ - float *idata, /* (i) data buffer used for enhancing */ - int idatal, /* (i) dimension idata */ - int centerStartPos, /* (i) first sample current block - within idata */ - float alpha0, /* (i) max correction-energy-fraction - (in [0,1]) */ - float *period, /* (i) pitch period array */ - float *plocs, /* (i) locations where period array - values valid */ - int periodl /* (i) dimension of period and plocs */ - ){ - float sseq[(2*ENH_HL+1)*ENH_BLOCKL]; - - /* get said second sequence of segments */ - - getsseq(sseq,idata,idatal,centerStartPos,period, - plocs,periodl,ENH_HL); - - /* compute the smoothed output from said second sequence */ - - smath(odata,sseq,ENH_HL,alpha0); - - } - - /*----------------------------------------------------------------* - * cross correlation - *---------------------------------------------------------------*/ - - float xCorrCoef( - float *target, /* (i) first array */ - float *regressor, /* (i) second array */ - int subl /* (i) dimension arrays */ - ){ - int i; - float ftmp1, ftmp2; - - ftmp1 = 0.0; - ftmp2 = 0.0; - for (i=0; i<subl; i++) { - ftmp1 += target[i]*regressor[i]; - ftmp2 += regressor[i]*regressor[i]; - } - - if (ftmp1 > 0.0) { - return (float)(ftmp1*ftmp1/ftmp2); - } - - - - - - else { - return (float)0.0; - } - } - - /*----------------------------------------------------------------* - * interface for enhancer - *---------------------------------------------------------------*/ - - int enhancerInterface( - float *out, /* (o) enhanced signal */ - float *in, /* (i) unenhanced signal */ - iLBC_Dec_Inst_t *iLBCdec_inst /* (i) buffers etc */ - ){ - float *enh_buf, *enh_period; - int iblock, isample; - int lag=0, ilag, i, ioffset; - float cc, maxcc; - float ftmp1, ftmp2; - float *inPtr, *enh_bufPtr1, *enh_bufPtr2; - float plc_pred[ENH_BLOCKL]; - - float lpState[6], downsampled[(ENH_NBLOCKS*ENH_BLOCKL+120)/2]; - int inLen=ENH_NBLOCKS*ENH_BLOCKL+120; - int start, plc_blockl, inlag; - - enh_buf=iLBCdec_inst->enh_buf; - enh_period=iLBCdec_inst->enh_period; - - memmove(enh_buf, &enh_buf[iLBCdec_inst->blockl], - (ENH_BUFL-iLBCdec_inst->blockl)*sizeof(float)); - - memcpy(&enh_buf[ENH_BUFL-iLBCdec_inst->blockl], in, - iLBCdec_inst->blockl*sizeof(float)); - - if (iLBCdec_inst->mode==30) - plc_blockl=ENH_BLOCKL; - else - plc_blockl=40; - - /* when 20 ms frame, move processing one block */ - ioffset=0; - if (iLBCdec_inst->mode==20) ioffset=1; - - i=3-ioffset; - memmove(enh_period, &enh_period[i], - (ENH_NBLOCKS_TOT-i)*sizeof(float)); - - - - - - - /* Set state information to the 6 samples right before - the samples to be downsampled. */ - - memcpy(lpState, - enh_buf+(ENH_NBLOCKS_EXTRA+ioffset)*ENH_BLOCKL-126, - 6*sizeof(float)); - - /* Down sample a factor 2 to save computations */ - - DownSample(enh_buf+(ENH_NBLOCKS_EXTRA+ioffset)*ENH_BLOCKL-120, - lpFilt_coefsTbl, inLen-ioffset*ENH_BLOCKL, - lpState, downsampled); - - /* Estimate the pitch in the down sampled domain. */ - for (iblock = 0; iblock<ENH_NBLOCKS-ioffset; iblock++) { - - lag = 10; - maxcc = xCorrCoef(downsampled+60+iblock* - ENH_BLOCKL_HALF, downsampled+60+iblock* - ENH_BLOCKL_HALF-lag, ENH_BLOCKL_HALF); - for (ilag=11; ilag<60; ilag++) { - cc = xCorrCoef(downsampled+60+iblock* - ENH_BLOCKL_HALF, downsampled+60+iblock* - ENH_BLOCKL_HALF-ilag, ENH_BLOCKL_HALF); - - if (cc > maxcc) { - maxcc = cc; - lag = ilag; - } - } - - /* Store the estimated lag in the non-downsampled domain */ - enh_period[iblock+ENH_NBLOCKS_EXTRA+ioffset] = (float)lag*2; - - - } - - - /* PLC was performed on the previous packet */ - if (iLBCdec_inst->prev_enh_pl==1) { - - inlag=(int)enh_period[ENH_NBLOCKS_EXTRA+ioffset]; - - lag = inlag-1; - maxcc = xCorrCoef(in, in+lag, plc_blockl); - for (ilag=inlag; ilag<=inlag+1; ilag++) { - cc = xCorrCoef(in, in+ilag, plc_blockl); - - - - - - - if (cc > maxcc) { - maxcc = cc; - lag = ilag; - } - } - - enh_period[ENH_NBLOCKS_EXTRA+ioffset-1]=(float)lag; - - /* compute new concealed residual for the old lookahead, - mix the forward PLC with a backward PLC from - the new frame */ - - inPtr=&in[lag-1]; - - enh_bufPtr1=&plc_pred[plc_blockl-1]; - - if (lag>plc_blockl) { - start=plc_blockl; - } else { - start=lag; - } - - for (isample = start; isample>0; isample--) { - *enh_bufPtr1-- = *inPtr--; - } - - enh_bufPtr2=&enh_buf[ENH_BUFL-1-iLBCdec_inst->blockl]; - for (isample = (plc_blockl-1-lag); isample>=0; isample--) { - *enh_bufPtr1-- = *enh_bufPtr2--; - } - - /* limit energy change */ - ftmp2=0.0; - ftmp1=0.0; - for (i=0;i<plc_blockl;i++) { - ftmp2+=enh_buf[ENH_BUFL-1-iLBCdec_inst->blockl-i]* - enh_buf[ENH_BUFL-1-iLBCdec_inst->blockl-i]; - ftmp1+=plc_pred[i]*plc_pred[i]; - } - ftmp1=(float)sqrt(ftmp1/(float)plc_blockl); - ftmp2=(float)sqrt(ftmp2/(float)plc_blockl); - if (ftmp1>(float)2.0*ftmp2 && ftmp1>0.0) { - for (i=0;i<plc_blockl-10;i++) { - plc_pred[i]*=(float)2.0*ftmp2/ftmp1; - } - for (i=plc_blockl-10;i<plc_blockl;i++) { - plc_pred[i]*=(float)(i-plc_blockl+10)* - ((float)1.0-(float)2.0*ftmp2/ftmp1)/(float)(10)+ - - - - - - (float)2.0*ftmp2/ftmp1; - } - } - - enh_bufPtr1=&enh_buf[ENH_BUFL-1-iLBCdec_inst->blockl]; - for (i=0; i<plc_blockl; i++) { - ftmp1 = (float) (i+1) / (float) (plc_blockl+1); - *enh_bufPtr1 *= ftmp1; - *enh_bufPtr1 += ((float)1.0-ftmp1)* - plc_pred[plc_blockl-1-i]; - enh_bufPtr1--; - } - } - - if (iLBCdec_inst->mode==20) { - /* Enhancer with 40 samples delay */ - for (iblock = 0; iblock<2; iblock++) { - enhancer(out+iblock*ENH_BLOCKL, enh_buf, - ENH_BUFL, (5+iblock)*ENH_BLOCKL+40, - ENH_ALPHA0, enh_period, enh_plocsTbl, - ENH_NBLOCKS_TOT); - } - } else if (iLBCdec_inst->mode==30) { - /* Enhancer with 80 samples delay */ - for (iblock = 0; iblock<3; iblock++) { - enhancer(out+iblock*ENH_BLOCKL, enh_buf, - ENH_BUFL, (4+iblock)*ENH_BLOCKL, - ENH_ALPHA0, enh_period, enh_plocsTbl, - ENH_NBLOCKS_TOT); - } - } - - return (lag*2); - } - diff --git a/sflphone-common/src/audio/codecs/ilbc/enhancer.h b/sflphone-common/src/audio/codecs/ilbc/enhancer.h deleted file mode 100644 index 8a081fb1bc21934a883a34398a531a7a37cc3caa..0000000000000000000000000000000000000000 --- a/sflphone-common/src/audio/codecs/ilbc/enhancer.h +++ /dev/null @@ -1,36 +0,0 @@ - - /****************************************************************** - - iLBC Speech Coder ANSI-C Source Code - - enhancer.h - - Copyright (C) The Internet Society (2004). - All Rights Reserved. - - - - - - ******************************************************************/ - - #ifndef __ENHANCER_H - #define __ENHANCER_H - - #include "iLBC_define.h" - - float xCorrCoef( - float *target, /* (i) first array */ - float *regressor, /* (i) second array */ - int subl /* (i) dimension arrays */ - ); - - int enhancerInterface( - float *out, /* (o) the enhanced recidual signal */ - float *in, /* (i) the recidual signal to enhance */ - iLBC_Dec_Inst_t *iLBCdec_inst - /* (i/o) the decoder state structure */ - ); - - #endif - diff --git a/sflphone-common/src/audio/codecs/ilbc/filter.c b/sflphone-common/src/audio/codecs/ilbc/filter.c deleted file mode 100644 index 6565c2beee0ccfac27f6cdf92a81272982b9dffb..0000000000000000000000000000000000000000 --- a/sflphone-common/src/audio/codecs/ilbc/filter.c +++ /dev/null @@ -1,175 +0,0 @@ - - /****************************************************************** - - iLBC Speech Coder ANSI-C Source Code - - filter.c - - Copyright (C) The Internet Society (2004). - All Rights Reserved. - - ******************************************************************/ - - #include "iLBC_define.h" - - /*----------------------------------------------------------------* - * all-pole filter - *---------------------------------------------------------------*/ - - void AllPoleFilter( - float *InOut, /* (i/o) on entrance InOut[-orderCoef] to - InOut[-1] contain the state of the - filter (delayed samples). InOut[0] to - InOut[lengthInOut-1] contain the filter - input, on en exit InOut[-orderCoef] to - InOut[-1] is unchanged and InOut[0] to - InOut[lengthInOut-1] contain filtered - samples */ - float *Coef,/* (i) filter coefficients, Coef[0] is assumed - to be 1.0 */ - int lengthInOut,/* (i) number of input/output samples */ - int orderCoef /* (i) number of filter coefficients */ - ){ - int n,k; - - for(n=0;n<lengthInOut;n++){ - for(k=1;k<=orderCoef;k++){ - *InOut -= Coef[k]*InOut[-k]; - - - - - - } - InOut++; - } - } - - /*----------------------------------------------------------------* - * all-zero filter - *---------------------------------------------------------------*/ - - void AllZeroFilter( - float *In, /* (i) In[0] to In[lengthInOut-1] contain - filter input samples */ - float *Coef,/* (i) filter coefficients (Coef[0] is assumed - to be 1.0) */ - int lengthInOut,/* (i) number of input/output samples */ - int orderCoef, /* (i) number of filter coefficients */ - float *Out /* (i/o) on entrance Out[-orderCoef] to Out[-1] - contain the filter state, on exit Out[0] - to Out[lengthInOut-1] contain filtered - samples */ - ){ - int n,k; - - for(n=0;n<lengthInOut;n++){ - *Out = Coef[0]*In[0]; - for(k=1;k<=orderCoef;k++){ - *Out += Coef[k]*In[-k]; - } - Out++; - In++; - } - } - - /*----------------------------------------------------------------* - * pole-zero filter - *---------------------------------------------------------------*/ - - void ZeroPoleFilter( - float *In, /* (i) In[0] to In[lengthInOut-1] contain - filter input samples In[-orderCoef] to - In[-1] contain state of all-zero - section */ - float *ZeroCoef,/* (i) filter coefficients for all-zero - section (ZeroCoef[0] is assumed to - be 1.0) */ - float *PoleCoef,/* (i) filter coefficients for all-pole section - (ZeroCoef[0] is assumed to be 1.0) */ - int lengthInOut,/* (i) number of input/output samples */ - - - - - - int orderCoef, /* (i) number of filter coefficients */ - float *Out /* (i/o) on entrance Out[-orderCoef] to Out[-1] - contain state of all-pole section. On - exit Out[0] to Out[lengthInOut-1] - contain filtered samples */ - ){ - AllZeroFilter(In,ZeroCoef,lengthInOut,orderCoef,Out); - AllPoleFilter(Out,PoleCoef,lengthInOut,orderCoef); - } - - /*----------------------------------------------------------------* - * downsample (LP filter and decimation) - *---------------------------------------------------------------*/ - - void DownSample ( - float *In, /* (i) input samples */ - float *Coef, /* (i) filter coefficients */ - int lengthIn, /* (i) number of input samples */ - float *state, /* (i) filter state */ - float *Out /* (o) downsampled output */ - ){ - float o; - float *Out_ptr = Out; - float *Coef_ptr, *In_ptr; - float *state_ptr; - int i, j, stop; - - /* LP filter and decimate at the same time */ - - for (i = DELAY_DS; i < lengthIn; i+=FACTOR_DS) - { - Coef_ptr = &Coef[0]; - In_ptr = &In[i]; - state_ptr = &state[FILTERORDER_DS-2]; - - o = (float)0.0; - - stop = (i < FILTERORDER_DS) ? i + 1 : FILTERORDER_DS; - - for (j = 0; j < stop; j++) - { - o += *Coef_ptr++ * (*In_ptr--); - } - for (j = i + 1; j < FILTERORDER_DS; j++) - { - o += *Coef_ptr++ * (*state_ptr--); - } - - - - - - - *Out_ptr++ = o; - } - - /* Get the last part (use zeros as input for the future) */ - - for (i=(lengthIn+FACTOR_DS); i<(lengthIn+DELAY_DS); - i+=FACTOR_DS) { - - o=(float)0.0; - - if (i<lengthIn) { - Coef_ptr = &Coef[0]; - In_ptr = &In[i]; - for (j=0; j<FILTERORDER_DS; j++) { - o += *Coef_ptr++ * (*Out_ptr--); - } - } else { - Coef_ptr = &Coef[i-lengthIn]; - In_ptr = &In[lengthIn-1]; - for (j=0; j<FILTERORDER_DS-(i-lengthIn); j++) { - o += *Coef_ptr++ * (*In_ptr--); - } - } - *Out_ptr++ = o; - } - } - diff --git a/sflphone-common/src/audio/codecs/ilbc/filter.h b/sflphone-common/src/audio/codecs/ilbc/filter.h deleted file mode 100644 index 4c512cd9376beb643234893f840467927d53c1ae..0000000000000000000000000000000000000000 --- a/sflphone-common/src/audio/codecs/ilbc/filter.h +++ /dev/null @@ -1,80 +0,0 @@ - - /****************************************************************** - - iLBC Speech Coder ANSI-C Source Code - - filter.h - - Copyright (C) The Internet Society (2004). - All Rights Reserved. - - ******************************************************************/ - - - - - - - #ifndef __iLBC_FILTER_H - #define __iLBC_FILTER_H - - void AllPoleFilter( - float *InOut, /* (i/o) on entrance InOut[-orderCoef] to - InOut[-1] contain the state of the - filter (delayed samples). InOut[0] to - InOut[lengthInOut-1] contain the filter - input, on en exit InOut[-orderCoef] to - InOut[-1] is unchanged and InOut[0] to - InOut[lengthInOut-1] contain filtered - samples */ - float *Coef,/* (i) filter coefficients, Coef[0] is assumed - to be 1.0 */ - int lengthInOut,/* (i) number of input/output samples */ - int orderCoef /* (i) number of filter coefficients */ - ); - - void AllZeroFilter( - float *In, /* (i) In[0] to In[lengthInOut-1] contain - filter input samples */ - float *Coef,/* (i) filter coefficients (Coef[0] is assumed - to be 1.0) */ - int lengthInOut,/* (i) number of input/output samples */ - int orderCoef, /* (i) number of filter coefficients */ - float *Out /* (i/o) on entrance Out[-orderCoef] to Out[-1] - contain the filter state, on exit Out[0] - to Out[lengthInOut-1] contain filtered - samples */ - ); - - void ZeroPoleFilter( - float *In, /* (i) In[0] to In[lengthInOut-1] contain filter - input samples In[-orderCoef] to In[-1] - contain state of all-zero section */ - float *ZeroCoef,/* (i) filter coefficients for all-zero - section (ZeroCoef[0] is assumed to - be 1.0) */ - float *PoleCoef,/* (i) filter coefficients for all-pole section - (ZeroCoef[0] is assumed to be 1.0) */ - int lengthInOut,/* (i) number of input/output samples */ - int orderCoef, /* (i) number of filter coefficients */ - float *Out /* (i/o) on entrance Out[-orderCoef] to Out[-1] - contain state of all-pole section. On - exit Out[0] to Out[lengthInOut-1] - contain filtered samples */ - ); - - - - - - - void DownSample ( - float *In, /* (i) input samples */ - float *Coef, /* (i) filter coefficients */ - int lengthIn, /* (i) number of input samples */ - float *state, /* (i) filter state */ - float *Out /* (o) downsampled output */ - ); - - #endif - diff --git a/sflphone-common/src/audio/codecs/ilbc/gainquant.c b/sflphone-common/src/audio/codecs/ilbc/gainquant.c deleted file mode 100644 index 0e74ff827050bc56fd50755ce31944c92e319ad2..0000000000000000000000000000000000000000 --- a/sflphone-common/src/audio/codecs/ilbc/gainquant.c +++ /dev/null @@ -1,116 +0,0 @@ - - /****************************************************************** - - iLBC Speech Coder ANSI-C Source Code - - - - - - - gainquant.c - - Copyright (C) The Internet Society (2004). - All Rights Reserved. - - ******************************************************************/ - - #include <string.h> - #include <math.h> - #include "constants.h" - #include "filter.h" - - /*----------------------------------------------------------------* - * quantizer for the gain in the gain-shape coding of residual - *---------------------------------------------------------------*/ - - float gainquant(/* (o) quantized gain value */ - float in, /* (i) gain value */ - float maxIn,/* (i) maximum of gain value */ - int cblen, /* (i) number of quantization indices */ - int *index /* (o) quantization index */ - ){ - int i, tindex; - float minmeasure,measure, *cb, scale; - - /* ensure a lower bound on the scaling factor */ - - scale=maxIn; - - if (scale<0.1) { - scale=(float)0.1; - } - - /* select the quantization table */ - - if (cblen == 8) { - cb = gain_sq3Tbl; - } else if (cblen == 16) { - cb = gain_sq4Tbl; - } else { - cb = gain_sq5Tbl; - } - - /* select the best index in the quantization table */ - - minmeasure=10000000.0; - tindex=0; - for (i=0; i<cblen; i++) { - - - - - - measure=(in-scale*cb[i])*(in-scale*cb[i]); - - if (measure<minmeasure) { - tindex=i; - minmeasure=measure; - } - } - *index=tindex; - - /* return the quantized value */ - - return scale*cb[tindex]; - } - - /*----------------------------------------------------------------* - * decoder for quantized gains in the gain-shape coding of - * residual - *---------------------------------------------------------------*/ - - float gaindequant( /* (o) quantized gain value */ - int index, /* (i) quantization index */ - float maxIn,/* (i) maximum of unquantized gain */ - int cblen /* (i) number of quantization indices */ - ){ - float scale; - - /* obtain correct scale factor */ - - scale=(float)fabs(maxIn); - - if (scale<0.1) { - scale=(float)0.1; - } - - /* select the quantization table and return the decoded value */ - - if (cblen==8) { - return scale*gain_sq3Tbl[index]; - } else if (cblen==16) { - return scale*gain_sq4Tbl[index]; - } - else if (cblen==32) { - return scale*gain_sq5Tbl[index]; - } - - return 0.0; - } - - - - - - diff --git a/sflphone-common/src/audio/codecs/ilbc/gainquant.h b/sflphone-common/src/audio/codecs/ilbc/gainquant.h deleted file mode 100644 index 0d024246d7d38bc3e5d495a9b19720bce27aa073..0000000000000000000000000000000000000000 --- a/sflphone-common/src/audio/codecs/ilbc/gainquant.h +++ /dev/null @@ -1,30 +0,0 @@ - - /****************************************************************** - - iLBC Speech Coder ANSI-C Source Code - - gainquant.h - - Copyright (C) The Internet Society (2004). - All Rights Reserved. - - ******************************************************************/ - - #ifndef __iLBC_GAINQUANT_H - #define __iLBC_GAINQUANT_H - - float gainquant(/* (o) quantized gain value */ - float in, /* (i) gain value */ - float maxIn,/* (i) maximum of gain value */ - int cblen, /* (i) number of quantization indices */ - int *index /* (o) quantization index */ - ); - - float gaindequant( /* (o) quantized gain value */ - int index, /* (i) quantization index */ - float maxIn,/* (i) maximum of unquantized gain */ - int cblen /* (i) number of quantization indices */ - ); - - #endif - diff --git a/sflphone-common/src/audio/codecs/ilbc/getCBvec.c b/sflphone-common/src/audio/codecs/ilbc/getCBvec.c deleted file mode 100644 index 4f2d291417505de51e3d1db92b384a045f9b9bb7..0000000000000000000000000000000000000000 --- a/sflphone-common/src/audio/codecs/ilbc/getCBvec.c +++ /dev/null @@ -1,193 +0,0 @@ - - /****************************************************************** - - iLBC Speech Coder ANSI-C Source Code - - getCBvec.c - - Copyright (C) The Internet Society (2004). - All Rights Reserved. - - ******************************************************************/ - - #include "iLBC_define.h" - #include "constants.h" - #include <string.h> - - /*----------------------------------------------------------------* - * Construct codebook vector for given index. - *---------------------------------------------------------------*/ - - void getCBvec( - - - - - - float *cbvec, /* (o) Constructed codebook vector */ - float *mem, /* (i) Codebook buffer */ - int index, /* (i) Codebook index */ - int lMem, /* (i) Length of codebook buffer */ - int cbveclen/* (i) Codebook vector length */ - ){ - int j, k, n, memInd, sFilt; - float tmpbuf[CB_MEML]; - int base_size; - int ilow, ihigh; - float alfa, alfa1; - - /* Determine size of codebook sections */ - - base_size=lMem-cbveclen+1; - - if (cbveclen==SUBL) { - base_size+=cbveclen/2; - } - - /* No filter -> First codebook section */ - - if (index<lMem-cbveclen+1) { - - /* first non-interpolated vectors */ - - k=index+cbveclen; - /* get vector */ - memcpy(cbvec, mem+lMem-k, cbveclen*sizeof(float)); - - } else if (index < base_size) { - - k=2*(index-(lMem-cbveclen+1))+cbveclen; - - ihigh=k/2; - ilow=ihigh-5; - - /* Copy first noninterpolated part */ - - memcpy(cbvec, mem+lMem-k/2, ilow*sizeof(float)); - - /* interpolation */ - - alfa1=(float)0.2; - alfa=0.0; - for (j=ilow; j<ihigh; j++) { - cbvec[j]=((float)1.0-alfa)*mem[lMem-k/2+j]+ - alfa*mem[lMem-k+j]; - - - - - - alfa+=alfa1; - } - - /* Copy second noninterpolated part */ - - memcpy(cbvec+ihigh, mem+lMem-k+ihigh, - (cbveclen-ihigh)*sizeof(float)); - - } - - /* Higher codebook section based on filtering */ - - else { - - /* first non-interpolated vectors */ - - if (index-base_size<lMem-cbveclen+1) { - float tempbuff2[CB_MEML+CB_FILTERLEN+1]; - float *pos; - float *pp, *pp1; - - memset(tempbuff2, 0, - CB_HALFFILTERLEN*sizeof(float)); - memcpy(&tempbuff2[CB_HALFFILTERLEN], mem, - lMem*sizeof(float)); - memset(&tempbuff2[lMem+CB_HALFFILTERLEN], 0, - (CB_HALFFILTERLEN+1)*sizeof(float)); - - k=index-base_size+cbveclen; - sFilt=lMem-k; - memInd=sFilt+1-CB_HALFFILTERLEN; - - /* do filtering */ - pos=cbvec; - memset(pos, 0, cbveclen*sizeof(float)); - for (n=0; n<cbveclen; n++) { - pp=&tempbuff2[memInd+n+CB_HALFFILTERLEN]; - pp1=&cbfiltersTbl[CB_FILTERLEN-1]; - for (j=0; j<CB_FILTERLEN; j++) { - (*pos)+=(*pp++)*(*pp1--); - } - pos++; - } - } - - /* interpolated vectors */ - - else { - - - - - - float tempbuff2[CB_MEML+CB_FILTERLEN+1]; - - float *pos; - float *pp, *pp1; - int i; - - memset(tempbuff2, 0, - CB_HALFFILTERLEN*sizeof(float)); - memcpy(&tempbuff2[CB_HALFFILTERLEN], mem, - lMem*sizeof(float)); - memset(&tempbuff2[lMem+CB_HALFFILTERLEN], 0, - (CB_HALFFILTERLEN+1)*sizeof(float)); - - k=2*(index-base_size- - (lMem-cbveclen+1))+cbveclen; - sFilt=lMem-k; - memInd=sFilt+1-CB_HALFFILTERLEN; - - /* do filtering */ - pos=&tmpbuf[sFilt]; - memset(pos, 0, k*sizeof(float)); - for (i=0; i<k; i++) { - pp=&tempbuff2[memInd+i+CB_HALFFILTERLEN]; - pp1=&cbfiltersTbl[CB_FILTERLEN-1]; - for (j=0; j<CB_FILTERLEN; j++) { - (*pos)+=(*pp++)*(*pp1--); - } - pos++; - } - - ihigh=k/2; - ilow=ihigh-5; - - /* Copy first noninterpolated part */ - - memcpy(cbvec, tmpbuf+lMem-k/2, - ilow*sizeof(float)); - - /* interpolation */ - - alfa1=(float)0.2; - alfa=0.0; - for (j=ilow; j<ihigh; j++) { - cbvec[j]=((float)1.0-alfa)* - tmpbuf[lMem-k/2+j]+alfa*tmpbuf[lMem-k+j]; - alfa+=alfa1; - } - - - - - - - /* Copy second noninterpolated part */ - - memcpy(cbvec+ihigh, tmpbuf+lMem-k+ihigh, - (cbveclen-ihigh)*sizeof(float)); - } - } - } - diff --git a/sflphone-common/src/audio/codecs/ilbc/getCBvec.h b/sflphone-common/src/audio/codecs/ilbc/getCBvec.h deleted file mode 100644 index 0080907c02ec39f6bb21578fdb884499ce217d3e..0000000000000000000000000000000000000000 --- a/sflphone-common/src/audio/codecs/ilbc/getCBvec.h +++ /dev/null @@ -1,25 +0,0 @@ - - /****************************************************************** - - iLBC Speech Coder ANSI-C Source Code - - getCBvec.h - - Copyright (C) The Internet Society (2004). - All Rights Reserved. - - ******************************************************************/ - - #ifndef __iLBC_GETCBVEC_H - #define __iLBC_GETCBVEC_H - - void getCBvec( - float *cbvec, /* (o) Constructed codebook vector */ - float *mem, /* (i) Codebook buffer */ - int index, /* (i) Codebook index */ - int lMem, /* (i) Length of codebook buffer */ - int cbveclen/* (i) Codebook vector length */ - ); - - #endif - diff --git a/sflphone-common/src/audio/codecs/ilbc/helpfun.c b/sflphone-common/src/audio/codecs/ilbc/helpfun.c deleted file mode 100644 index 1aba65788f0deb2d3a22d231ba44d792151a6c95..0000000000000000000000000000000000000000 --- a/sflphone-common/src/audio/codecs/ilbc/helpfun.c +++ /dev/null @@ -1,326 +0,0 @@ - - /****************************************************************** - - iLBC Speech Coder ANSI-C Source Code - - helpfun.c - - Copyright (C) The Internet Society (2004). - All Rights Reserved. - - ******************************************************************/ - - #include <math.h> - - #include "iLBC_define.h" - #include "constants.h" - - /*----------------------------------------------------------------* - * calculation of auto correlation - *---------------------------------------------------------------*/ - - void autocorr( - float *r, /* (o) autocorrelation vector */ - const float *x, /* (i) data vector */ - int N, /* (i) length of data vector */ - int order /* largest lag for calculated - autocorrelations */ - ){ - int lag, n; - float sum; - - for (lag = 0; lag <= order; lag++) { - sum = 0; - for (n = 0; n < N - lag; n++) { - sum += x[n] * x[n+lag]; - } - r[lag] = sum; - } - - - - - - } - - /*----------------------------------------------------------------* - * window multiplication - *---------------------------------------------------------------*/ - - void window( - float *z, /* (o) the windowed data */ - const float *x, /* (i) the original data vector */ - const float *y, /* (i) the window */ - int N /* (i) length of all vectors */ - ){ - int i; - - for (i = 0; i < N; i++) { - z[i] = x[i] * y[i]; - } - } - - /*----------------------------------------------------------------* - * levinson-durbin solution for lpc coefficients - *---------------------------------------------------------------*/ - - void levdurb( - float *a, /* (o) lpc coefficient vector starting - with 1.0 */ - float *k, /* (o) reflection coefficients */ - float *r, /* (i) autocorrelation vector */ - int order /* (i) order of lpc filter */ - ){ - float sum, alpha; - int m, m_h, i; - - a[0] = 1.0; - - if (r[0] < EPS) { /* if r[0] <= 0, set LPC coeff. to zero */ - for (i = 0; i < order; i++) { - k[i] = 0; - a[i+1] = 0; - } - } else { - a[1] = k[0] = -r[1]/r[0]; - alpha = r[0] + r[1] * k[0]; - for (m = 1; m < order; m++){ - sum = r[m + 1]; - for (i = 0; i < m; i++){ - sum += a[i+1] * r[m - i]; - } - - - - - - k[m] = -sum / alpha; - alpha += k[m] * sum; - m_h = (m + 1) >> 1; - for (i = 0; i < m_h; i++){ - sum = a[i+1] + k[m] * a[m - i]; - a[m - i] += k[m] * a[i+1]; - a[i+1] = sum; - } - a[m+1] = k[m]; - } - } - } - - /*----------------------------------------------------------------* - * interpolation between vectors - *---------------------------------------------------------------*/ - - void interpolate( - float *out, /* (o) the interpolated vector */ - float *in1, /* (i) the first vector for the - interpolation */ - float *in2, /* (i) the second vector for the - interpolation */ - float coef, /* (i) interpolation weights */ - int length /* (i) length of all vectors */ - ){ - int i; - float invcoef; - - invcoef = (float)1.0 - coef; - for (i = 0; i < length; i++) { - out[i] = coef * in1[i] + invcoef * in2[i]; - } - } - - /*----------------------------------------------------------------* - * lpc bandwidth expansion - *---------------------------------------------------------------*/ - - void bwexpand( - float *out, /* (o) the bandwidth expanded lpc - coefficients */ - float *in, /* (i) the lpc coefficients before bandwidth - expansion */ - float coef, /* (i) the bandwidth expansion factor */ - int length /* (i) the length of lpc coefficient vectors */ - ){ - int i; - - - - - - float chirp; - - chirp = coef; - - out[0] = in[0]; - for (i = 1; i < length; i++) { - out[i] = chirp * in[i]; - chirp *= coef; - } - } - - /*----------------------------------------------------------------* - * vector quantization - *---------------------------------------------------------------*/ - - void vq( - float *Xq, /* (o) the quantized vector */ - int *index, /* (o) the quantization index */ - const float *CB,/* (i) the vector quantization codebook */ - float *X, /* (i) the vector to quantize */ - int n_cb, /* (i) the number of vectors in the codebook */ - int dim /* (i) the dimension of all vectors */ - ){ - int i, j; - int pos, minindex; - float dist, tmp, mindist; - - pos = 0; - mindist = FLOAT_MAX; - minindex = 0; - for (j = 0; j < n_cb; j++) { - dist = X[0] - CB[pos]; - dist *= dist; - for (i = 1; i < dim; i++) { - tmp = X[i] - CB[pos + i]; - dist += tmp*tmp; - } - - if (dist < mindist) { - mindist = dist; - minindex = j; - } - pos += dim; - } - for (i = 0; i < dim; i++) { - Xq[i] = CB[minindex*dim + i]; - } - *index = minindex; - - - - - - } - - /*----------------------------------------------------------------* - * split vector quantization - *---------------------------------------------------------------*/ - - void SplitVQ( - float *qX, /* (o) the quantized vector */ - int *index, /* (o) a vector of indexes for all vector - codebooks in the split */ - float *X, /* (i) the vector to quantize */ - const float *CB,/* (i) the quantizer codebook */ - int nsplit, /* the number of vector splits */ - const int *dim, /* the dimension of X and qX */ - const int *cbsize /* the number of vectors in the codebook */ - ){ - int cb_pos, X_pos, i; - - cb_pos = 0; - X_pos= 0; - for (i = 0; i < nsplit; i++) { - vq(qX + X_pos, index + i, CB + cb_pos, X + X_pos, - cbsize[i], dim[i]); - X_pos += dim[i]; - cb_pos += dim[i] * cbsize[i]; - } - } - - /*----------------------------------------------------------------* - * scalar quantization - *---------------------------------------------------------------*/ - - void sort_sq( - float *xq, /* (o) the quantized value */ - int *index, /* (o) the quantization index */ - float x, /* (i) the value to quantize */ - const float *cb,/* (i) the quantization codebook */ - int cb_size /* (i) the size of the quantization codebook */ - ){ - int i; - - if (x <= cb[0]) { - *index = 0; - *xq = cb[0]; - } else { - i = 0; - while ((x > cb[i]) && i < cb_size - 1) { - i++; - - - - - - } - - if (x > ((cb[i] + cb[i - 1])/2)) { - *index = i; - *xq = cb[i]; - } else { - *index = i - 1; - *xq = cb[i - 1]; - } - } - } - - /*----------------------------------------------------------------* - * check for stability of lsf coefficients - *---------------------------------------------------------------*/ - - int LSF_check( /* (o) 1 for stable lsf vectors and 0 for - nonstable ones */ - float *lsf, /* (i) a table of lsf vectors */ - int dim, /* (i) the dimension of each lsf vector */ - int NoAn /* (i) the number of lsf vectors in the - table */ - ){ - int k,n,m, Nit=2, change=0,pos; - float tmp; - static float eps=(float)0.039; /* 50 Hz */ - static float eps2=(float)0.0195; - static float maxlsf=(float)3.14; /* 4000 Hz */ - static float minlsf=(float)0.01; /* 0 Hz */ - - /* LSF separation check*/ - - for (n=0; n<Nit; n++) { /* Run through a couple of times */ - for (m=0; m<NoAn; m++) { /* Number of analyses per frame */ - for (k=0; k<(dim-1); k++) { - pos=m*dim+k; - - if ((lsf[pos+1]-lsf[pos])<eps) { - - if (lsf[pos+1]<lsf[pos]) { - tmp=lsf[pos+1]; - lsf[pos+1]= lsf[pos]+eps2; - lsf[pos]= lsf[pos+1]-eps2; - } else { - lsf[pos]-=eps2; - lsf[pos+1]+=eps2; - } - change=1; - - - - - - } - - if (lsf[pos]<minlsf) { - lsf[pos]=minlsf; - change=1; - } - - if (lsf[pos]>maxlsf) { - lsf[pos]=maxlsf; - change=1; - } - } - } - } - - return change; - } - diff --git a/sflphone-common/src/audio/codecs/ilbc/helpfun.h b/sflphone-common/src/audio/codecs/ilbc/helpfun.h deleted file mode 100644 index 931ca68a64da2705c6669c1f985ca5183287e0dd..0000000000000000000000000000000000000000 --- a/sflphone-common/src/audio/codecs/ilbc/helpfun.h +++ /dev/null @@ -1,106 +0,0 @@ - - /****************************************************************** - - iLBC Speech Coder ANSI-C Source Code - - helpfun.h - - Copyright (C) The Internet Society (2004). - All Rights Reserved. - - ******************************************************************/ - - #ifndef __iLBC_HELPFUN_H - #define __iLBC_HELPFUN_H - - void autocorr( - float *r, /* (o) autocorrelation vector */ - const float *x, /* (i) data vector */ - int N, /* (i) length of data vector */ - int order /* largest lag for calculated - autocorrelations */ - ); - - void window( - float *z, /* (o) the windowed data */ - const float *x, /* (i) the original data vector */ - const float *y, /* (i) the window */ - int N /* (i) length of all vectors */ - ); - - void levdurb( - float *a, /* (o) lpc coefficient vector starting - with 1.0 */ - float *k, /* (o) reflection coefficients */ - float *r, /* (i) autocorrelation vector */ - int order /* (i) order of lpc filter */ - ); - - void interpolate( - - - - - - float *out, /* (o) the interpolated vector */ - float *in1, /* (i) the first vector for the - interpolation */ - float *in2, /* (i) the second vector for the - interpolation */ - float coef, /* (i) interpolation weights */ - int length /* (i) length of all vectors */ - ); - - void bwexpand( - float *out, /* (o) the bandwidth expanded lpc - coefficients */ - float *in, /* (i) the lpc coefficients before bandwidth - expansion */ - float coef, /* (i) the bandwidth expansion factor */ - int length /* (i) the length of lpc coefficient vectors */ - ); - - void vq( - float *Xq, /* (o) the quantized vector */ - int *index, /* (o) the quantization index */ - const float *CB,/* (i) the vector quantization codebook */ - float *X, /* (i) the vector to quantize */ - int n_cb, /* (i) the number of vectors in the codebook */ - int dim /* (i) the dimension of all vectors */ - ); - - void SplitVQ( - float *qX, /* (o) the quantized vector */ - int *index, /* (o) a vector of indexes for all vector - codebooks in the split */ - float *X, /* (i) the vector to quantize */ - const float *CB,/* (i) the quantizer codebook */ - int nsplit, /* the number of vector splits */ - const int *dim, /* the dimension of X and qX */ - const int *cbsize /* the number of vectors in the codebook */ - ); - - - void sort_sq( - float *xq, /* (o) the quantized value */ - int *index, /* (o) the quantization index */ - float x, /* (i) the value to quantize */ - const float *cb,/* (i) the quantization codebook */ - int cb_size /* (i) the size of the quantization codebook */ - ); - - int LSF_check( /* (o) 1 for stable lsf vectors and 0 for - - - - - - nonstable ones */ - float *lsf, /* (i) a table of lsf vectors */ - int dim, /* (i) the dimension of each lsf vector */ - int NoAn /* (i) the number of lsf vectors in the - table */ - ); - - #endif - diff --git a/sflphone-common/src/audio/codecs/ilbc/hpInput.c b/sflphone-common/src/audio/codecs/ilbc/hpInput.c deleted file mode 100644 index 7ceee09643715f91229629f87fb65ca8717e8bf4..0000000000000000000000000000000000000000 --- a/sflphone-common/src/audio/codecs/ilbc/hpInput.c +++ /dev/null @@ -1,65 +0,0 @@ - - /****************************************************************** - - iLBC Speech Coder ANSI-C Source Code - - - - - - hpInput.c - - Copyright (C) The Internet Society (2004). - All Rights Reserved. - - ******************************************************************/ - - #include "constants.h" - - /*----------------------------------------------------------------* - * Input high-pass filter - *---------------------------------------------------------------*/ - - void hpInput( - float *In, /* (i) vector to filter */ - int len, /* (i) length of vector to filter */ - float *Out, /* (o) the resulting filtered vector */ - float *mem /* (i/o) the filter state */ - ){ - int i; - float *pi, *po; - - /* all-zero section*/ - - pi = &In[0]; - po = &Out[0]; - for (i=0; i<len; i++) { - *po = hpi_zero_coefsTbl[0] * (*pi); - *po += hpi_zero_coefsTbl[1] * mem[0]; - *po += hpi_zero_coefsTbl[2] * mem[1]; - - mem[1] = mem[0]; - mem[0] = *pi; - po++; - pi++; - - } - - /* all-pole section*/ - - po = &Out[0]; - for (i=0; i<len; i++) { - *po -= hpi_pole_coefsTbl[1] * mem[2]; - *po -= hpi_pole_coefsTbl[2] * mem[3]; - - mem[3] = mem[2]; - mem[2] = *po; - po++; - - - - - - } - } - diff --git a/sflphone-common/src/audio/codecs/ilbc/hpInput.h b/sflphone-common/src/audio/codecs/ilbc/hpInput.h deleted file mode 100644 index 3b020d11df050e976cf2044fc1ce3a1beddcefa9..0000000000000000000000000000000000000000 --- a/sflphone-common/src/audio/codecs/ilbc/hpInput.h +++ /dev/null @@ -1,24 +0,0 @@ - - /****************************************************************** - - iLBC Speech Coder ANSI-C Source Code - - hpInput.h - - Copyright (C) The Internet Society (2004). - All Rights Reserved. - - ******************************************************************/ - - #ifndef __iLBC_HPINPUT_H - #define __iLBC_HPINPUT_H - - void hpInput( - float *In, /* (i) vector to filter */ - int len, /* (i) length of vector to filter */ - float *Out, /* (o) the resulting filtered vector */ - float *mem /* (i/o) the filter state */ - ); - - #endif - diff --git a/sflphone-common/src/audio/codecs/ilbc/hpOutput.c b/sflphone-common/src/audio/codecs/ilbc/hpOutput.c deleted file mode 100644 index 756160a657f9c0fa36ae28279db67a8263b4275f..0000000000000000000000000000000000000000 --- a/sflphone-common/src/audio/codecs/ilbc/hpOutput.c +++ /dev/null @@ -1,61 +0,0 @@ - - /****************************************************************** - - iLBC Speech Coder ANSI-C Source Code - - hpOutput.c - - Copyright (C) The Internet Society (2004). - All Rights Reserved. - - ******************************************************************/ - - #include "constants.h" - - /*----------------------------------------------------------------* - * Output high-pass filter - *---------------------------------------------------------------*/ - - void hpOutput( - - - - - - float *In, /* (i) vector to filter */ - int len,/* (i) length of vector to filter */ - float *Out, /* (o) the resulting filtered vector */ - float *mem /* (i/o) the filter state */ - ){ - int i; - float *pi, *po; - - /* all-zero section*/ - - pi = &In[0]; - po = &Out[0]; - for (i=0; i<len; i++) { - *po = hpo_zero_coefsTbl[0] * (*pi); - *po += hpo_zero_coefsTbl[1] * mem[0]; - *po += hpo_zero_coefsTbl[2] * mem[1]; - - mem[1] = mem[0]; - mem[0] = *pi; - po++; - pi++; - - } - - /* all-pole section*/ - - po = &Out[0]; - for (i=0; i<len; i++) { - *po -= hpo_pole_coefsTbl[1] * mem[2]; - *po -= hpo_pole_coefsTbl[2] * mem[3]; - - mem[3] = mem[2]; - mem[2] = *po; - po++; - } - } - diff --git a/sflphone-common/src/audio/codecs/ilbc/hpOutput.h b/sflphone-common/src/audio/codecs/ilbc/hpOutput.h deleted file mode 100644 index b213a19348ef39bfe6d718971dc0f9f61e65ca01..0000000000000000000000000000000000000000 --- a/sflphone-common/src/audio/codecs/ilbc/hpOutput.h +++ /dev/null @@ -1,24 +0,0 @@ - - /****************************************************************** - - iLBC Speech Coder ANSI-C Source Code - - hpOutput.h - - Copyright (C) The Internet Society (2004). - All Rights Reserved. - - ******************************************************************/ - - #ifndef __iLBC_HPOUTPUT_H - #define __iLBC_HPOUTPUT_H - - void hpOutput( - float *In, /* (i) vector to filter */ - int len,/* (i) length of vector to filter */ - float *Out, /* (o) the resulting filtered vector */ - float *mem /* (i/o) the filter state */ - ); - - #endif - diff --git a/sflphone-common/src/audio/codecs/ilbc/iCBConstruct.c b/sflphone-common/src/audio/codecs/ilbc/iCBConstruct.c deleted file mode 100644 index ee9a73ca5896b687562181176fc16b4cd45c4eb5..0000000000000000000000000000000000000000 --- a/sflphone-common/src/audio/codecs/ilbc/iCBConstruct.c +++ /dev/null @@ -1,112 +0,0 @@ - - /****************************************************************** - - iLBC Speech Coder ANSI-C Source Code - - iCBConstruct.c - - Copyright (C) The Internet Society (2004). - All Rights Reserved. - - ******************************************************************/ - - #include <math.h> - - #include "iLBC_define.h" - #include "gainquant.h" - #include "getCBvec.h" - - /*----------------------------------------------------------------* - * Convert the codebook indexes to make the search easier - *---------------------------------------------------------------*/ - - - - - - - void index_conv_enc( - int *index /* (i/o) Codebook indexes */ - ){ - int k; - - for (k=1; k<CB_NSTAGES; k++) { - - if ((index[k]>=108)&&(index[k]<172)) { - index[k]-=64; - } else if (index[k]>=236) { - index[k]-=128; - } else { - /* ERROR */ - } - } - } - - void index_conv_dec( - int *index /* (i/o) Codebook indexes */ - ){ - int k; - - for (k=1; k<CB_NSTAGES; k++) { - - if ((index[k]>=44)&&(index[k]<108)) { - index[k]+=64; - } else if ((index[k]>=108)&&(index[k]<128)) { - index[k]+=128; - } else { - /* ERROR */ - } - } - } - - /*----------------------------------------------------------------* - * Construct decoded vector from codebook and gains. - *---------------------------------------------------------------*/ - - void iCBConstruct( - float *decvector, /* (o) Decoded vector */ - int *index, /* (i) Codebook indices */ - int *gain_index,/* (i) Gain quantization indices */ - float *mem, /* (i) Buffer for codevector construction */ - int lMem, /* (i) Length of buffer */ - int veclen, /* (i) Length of vector */ - int nStages /* (i) Number of codebook stages */ - ){ - int j,k; - - - - - - float gain[CB_NSTAGES]; - float cbvec[SUBL]; - - /* gain de-quantization */ - - gain[0] = gaindequant(gain_index[0], 1.0, 32); - if (nStages > 1) { - gain[1] = gaindequant(gain_index[1], - (float)fabs(gain[0]), 16); - } - if (nStages > 2) { - gain[2] = gaindequant(gain_index[2], - (float)fabs(gain[1]), 8); - } - - /* codebook vector construction and construction of - total vector */ - - getCBvec(cbvec, mem, index[0], lMem, veclen); - for (j=0;j<veclen;j++){ - decvector[j] = gain[0]*cbvec[j]; - } - if (nStages > 1) { - for (k=1; k<nStages; k++) { - getCBvec(cbvec, mem, index[k], lMem, veclen); - for (j=0;j<veclen;j++) { - decvector[j] += gain[k]*cbvec[j]; - } - } - } - } - diff --git a/sflphone-common/src/audio/codecs/ilbc/iCBConstruct.h b/sflphone-common/src/audio/codecs/ilbc/iCBConstruct.h deleted file mode 100644 index 143501ed64787106eb384f34a841b97b7ab7b9c4..0000000000000000000000000000000000000000 --- a/sflphone-common/src/audio/codecs/ilbc/iCBConstruct.h +++ /dev/null @@ -1,40 +0,0 @@ - - /****************************************************************** - - iLBC Speech Coder ANSI-C Source Code - - iCBConstruct.h - - Copyright (C) The Internet Society (2004). - All Rights Reserved. - - - - - - - ******************************************************************/ - - #ifndef __iLBC_ICBCONSTRUCT_H - #define __iLBC_ICBCONSTRUCT_H - - void index_conv_enc( - int *index /* (i/o) Codebook indexes */ - ); - - void index_conv_dec( - int *index /* (i/o) Codebook indexes */ - ); - - void iCBConstruct( - float *decvector, /* (o) Decoded vector */ - int *index, /* (i) Codebook indices */ - int *gain_index,/* (i) Gain quantization indices */ - float *mem, /* (i) Buffer for codevector construction */ - int lMem, /* (i) Length of buffer */ - int veclen, /* (i) Length of vector */ - int nStages /* (i) Number of codebook stages */ - ); - - #endif - diff --git a/sflphone-common/src/audio/codecs/ilbc/iCBSearch.c b/sflphone-common/src/audio/codecs/ilbc/iCBSearch.c deleted file mode 100644 index 0f65e4493b17a04ea850e7c4c37ad74d77a7f017..0000000000000000000000000000000000000000 --- a/sflphone-common/src/audio/codecs/ilbc/iCBSearch.c +++ /dev/null @@ -1,512 +0,0 @@ - - /****************************************************************** - - iLBC Speech Coder ANSI-C Source Code - - iCBSearch.c - - Copyright (C) The Internet Society (2004). - All Rights Reserved. - - ******************************************************************/ - - #include <math.h> - #include <string.h> - - #include "iLBC_define.h" - #include "gainquant.h" - #include "createCB.h" - #include "filter.h" - #include "constants.h" - - /*----------------------------------------------------------------* - * Search routine for codebook encoding and gain quantization. - *---------------------------------------------------------------*/ - - void iCBSearch( - iLBC_Enc_Inst_t *iLBCenc_inst, - /* (i) the encoder state structure */ - int *index, /* (o) Codebook indices */ - int *gain_index,/* (o) Gain quantization indices */ - - - - - - float *intarget,/* (i) Target vector for encoding */ - float *mem, /* (i) Buffer for codebook construction */ - int lMem, /* (i) Length of buffer */ - int lTarget, /* (i) Length of vector */ - int nStages, /* (i) Number of codebook stages */ - float *weightDenum, /* (i) weighting filter coefficients */ - float *weightState, /* (i) weighting filter state */ - int block /* (i) the sub-block number */ - ){ - int i, j, icount, stage, best_index, range, counter; - float max_measure, gain, measure, crossDot, ftmp; - float gains[CB_NSTAGES]; - float target[SUBL]; - int base_index, sInd, eInd, base_size; - int sIndAug=0, eIndAug=0; - float buf[CB_MEML+SUBL+2*LPC_FILTERORDER]; - float invenergy[CB_EXPAND*128], energy[CB_EXPAND*128]; - float *pp, *ppi=0, *ppo=0, *ppe=0; - float cbvectors[CB_MEML]; - float tene, cene, cvec[SUBL]; - float aug_vec[SUBL]; - - memset(cvec,0,SUBL*sizeof(float)); - - /* Determine size of codebook sections */ - - base_size=lMem-lTarget+1; - - if (lTarget==SUBL) { - base_size=lMem-lTarget+1+lTarget/2; - } - - /* setup buffer for weighting */ - - memcpy(buf,weightState,sizeof(float)*LPC_FILTERORDER); - memcpy(buf+LPC_FILTERORDER,mem,lMem*sizeof(float)); - memcpy(buf+LPC_FILTERORDER+lMem,intarget,lTarget*sizeof(float)); - - /* weighting */ - - AllPoleFilter(buf+LPC_FILTERORDER, weightDenum, - lMem+lTarget, LPC_FILTERORDER); - - /* Construct the codebook and target needed */ - - memcpy(target, buf+LPC_FILTERORDER+lMem, lTarget*sizeof(float)); - - tene=0.0; - - - - - - for (i=0; i<lTarget; i++) { - tene+=target[i]*target[i]; - } - - /* Prepare search over one more codebook section. This section - is created by filtering the original buffer with a filter. */ - - filteredCBvecs(cbvectors, buf+LPC_FILTERORDER, lMem); - - /* The Main Loop over stages */ - - for (stage=0; stage<nStages; stage++) { - - range = search_rangeTbl[block][stage]; - - /* initialize search measure */ - - max_measure = (float)-10000000.0; - gain = (float)0.0; - best_index = 0; - - /* Compute cross dot product between the target - and the CB memory */ - - crossDot=0.0; - pp=buf+LPC_FILTERORDER+lMem-lTarget; - for (j=0; j<lTarget; j++) { - crossDot += target[j]*(*pp++); - } - - if (stage==0) { - - /* Calculate energy in the first block of - 'lTarget' samples. */ - ppe = energy; - ppi = buf+LPC_FILTERORDER+lMem-lTarget-1; - ppo = buf+LPC_FILTERORDER+lMem-1; - - *ppe=0.0; - pp=buf+LPC_FILTERORDER+lMem-lTarget; - for (j=0; j<lTarget; j++) { - *ppe+=(*pp)*(*pp++); - } - - if (*ppe>0.0) { - invenergy[0] = (float) 1.0 / (*ppe + EPS); - } else { - invenergy[0] = (float) 0.0; - - - - - - } - ppe++; - - measure=(float)-10000000.0; - - if (crossDot > 0.0) { - measure = crossDot*crossDot*invenergy[0]; - } - } - else { - measure = crossDot*crossDot*invenergy[0]; - } - - /* check if measure is better */ - ftmp = crossDot*invenergy[0]; - - if ((measure>max_measure) && (fabs(ftmp)<CB_MAXGAIN)) { - best_index = 0; - max_measure = measure; - gain = ftmp; - } - - /* loop over the main first codebook section, - full search */ - - for (icount=1; icount<range; icount++) { - - /* calculate measure */ - - crossDot=0.0; - pp = buf+LPC_FILTERORDER+lMem-lTarget-icount; - - for (j=0; j<lTarget; j++) { - crossDot += target[j]*(*pp++); - } - - if (stage==0) { - *ppe++ = energy[icount-1] + (*ppi)*(*ppi) - - (*ppo)*(*ppo); - ppo--; - ppi--; - - if (energy[icount]>0.0) { - invenergy[icount] = - (float)1.0/(energy[icount]+EPS); - } else { - invenergy[icount] = (float) 0.0; - } - - - - - - measure=(float)-10000000.0; - - if (crossDot > 0.0) { - measure = crossDot*crossDot*invenergy[icount]; - } - } - else { - measure = crossDot*crossDot*invenergy[icount]; - } - - /* check if measure is better */ - ftmp = crossDot*invenergy[icount]; - - if ((measure>max_measure) && (fabs(ftmp)<CB_MAXGAIN)) { - best_index = icount; - max_measure = measure; - gain = ftmp; - } - } - - /* Loop over augmented part in the first codebook - * section, full search. - * The vectors are interpolated. - */ - - if (lTarget==SUBL) { - - /* Search for best possible cb vector and - compute the CB-vectors' energy. */ - searchAugmentedCB(20, 39, stage, base_size-lTarget/2, - target, buf+LPC_FILTERORDER+lMem, - &max_measure, &best_index, &gain, energy, - invenergy); - } - - /* set search range for following codebook sections */ - - base_index=best_index; - - /* unrestricted search */ - - if (CB_RESRANGE == -1) { - sInd=0; - eInd=range-1; - sIndAug=20; - eIndAug=39; - } - - - - - - - /* restricted search around best index from first - codebook section */ - - else { - /* Initialize search indices */ - sIndAug=0; - eIndAug=0; - sInd=base_index-CB_RESRANGE/2; - eInd=sInd+CB_RESRANGE; - - if (lTarget==SUBL) { - - if (sInd<0) { - - sIndAug = 40 + sInd; - eIndAug = 39; - sInd=0; - - } else if ( base_index < (base_size-20) ) { - - if (eInd > range) { - sInd -= (eInd-range); - eInd = range; - } - } else { /* base_index >= (base_size-20) */ - - if (sInd < (base_size-20)) { - sIndAug = 20; - sInd = 0; - eInd = 0; - eIndAug = 19 + CB_RESRANGE; - - if(eIndAug > 39) { - eInd = eIndAug-39; - eIndAug = 39; - } - } else { - sIndAug = 20 + sInd - (base_size-20); - eIndAug = 39; - sInd = 0; - eInd = CB_RESRANGE - (eIndAug-sIndAug+1); - } - } - - } else { /* lTarget = 22 or 23 */ - - if (sInd < 0) { - eInd -= sInd; - - - - - - sInd = 0; - } - - if(eInd > range) { - sInd -= (eInd - range); - eInd = range; - } - } - } - - /* search of higher codebook section */ - - /* index search range */ - counter = sInd; - sInd += base_size; - eInd += base_size; - - - if (stage==0) { - ppe = energy+base_size; - *ppe=0.0; - - pp=cbvectors+lMem-lTarget; - for (j=0; j<lTarget; j++) { - *ppe+=(*pp)*(*pp++); - } - - ppi = cbvectors + lMem - 1 - lTarget; - ppo = cbvectors + lMem - 1; - - for (j=0; j<(range-1); j++) { - *(ppe+1) = *ppe + (*ppi)*(*ppi) - (*ppo)*(*ppo); - ppo--; - ppi--; - ppe++; - } - } - - /* loop over search range */ - - for (icount=sInd; icount<eInd; icount++) { - - /* calculate measure */ - - crossDot=0.0; - pp=cbvectors + lMem - (counter++) - lTarget; - - for (j=0;j<lTarget;j++) { - - - - - - crossDot += target[j]*(*pp++); - } - - if (energy[icount]>0.0) { - invenergy[icount] =(float)1.0/(energy[icount]+EPS); - } else { - invenergy[icount] =(float)0.0; - } - - if (stage==0) { - - measure=(float)-10000000.0; - - if (crossDot > 0.0) { - measure = crossDot*crossDot* - invenergy[icount]; - } - } - else { - measure = crossDot*crossDot*invenergy[icount]; - } - - /* check if measure is better */ - ftmp = crossDot*invenergy[icount]; - - if ((measure>max_measure) && (fabs(ftmp)<CB_MAXGAIN)) { - best_index = icount; - max_measure = measure; - gain = ftmp; - } - } - - /* Search the augmented CB inside the limited range. */ - - if ((lTarget==SUBL)&&(sIndAug!=0)) { - searchAugmentedCB(sIndAug, eIndAug, stage, - 2*base_size-20, target, cbvectors+lMem, - &max_measure, &best_index, &gain, energy, - invenergy); - } - - /* record best index */ - - index[stage] = best_index; - - /* gain quantization */ - - if (stage==0){ - - - - - - - if (gain<0.0){ - gain = 0.0; - } - - if (gain>CB_MAXGAIN) { - gain = (float)CB_MAXGAIN; - } - gain = gainquant(gain, 1.0, 32, &gain_index[stage]); - } - else { - if (stage==1) { - gain = gainquant(gain, (float)fabs(gains[stage-1]), - 16, &gain_index[stage]); - } else { - gain = gainquant(gain, (float)fabs(gains[stage-1]), - 8, &gain_index[stage]); - } - } - - /* Extract the best (according to measure) - codebook vector */ - - if (lTarget==(STATE_LEN-iLBCenc_inst->state_short_len)) { - - if (index[stage]<base_size) { - pp=buf+LPC_FILTERORDER+lMem-lTarget-index[stage]; - } else { - pp=cbvectors+lMem-lTarget- - index[stage]+base_size; - } - } else { - - if (index[stage]<base_size) { - if (index[stage]<(base_size-20)) { - pp=buf+LPC_FILTERORDER+lMem- - lTarget-index[stage]; - } else { - createAugmentedVec(index[stage]-base_size+40, - buf+LPC_FILTERORDER+lMem,aug_vec); - pp=aug_vec; - } - } else { - int filterno, position; - - filterno=index[stage]/base_size; - position=index[stage]-filterno*base_size; - - - - - - - - if (position<(base_size-20)) { - pp=cbvectors+filterno*lMem-lTarget- - index[stage]+filterno*base_size; - } else { - createAugmentedVec( - index[stage]-(filterno+1)*base_size+40, - cbvectors+filterno*lMem,aug_vec); - pp=aug_vec; - } - } - } - - /* Subtract the best codebook vector, according - to measure, from the target vector */ - - for (j=0;j<lTarget;j++) { - cvec[j] += gain*(*pp); - target[j] -= gain*(*pp++); - } - - /* record quantized gain */ - - gains[stage]=gain; - - }/* end of Main Loop. for (stage=0;... */ - - /* Gain adjustment for energy matching */ - cene=0.0; - for (i=0; i<lTarget; i++) { - cene+=cvec[i]*cvec[i]; - } - j=gain_index[0]; - - for (i=gain_index[0]; i<32; i++) { - ftmp=cene*gain_sq5Tbl[i]*gain_sq5Tbl[i]; - - if ((ftmp<(tene*gains[0]*gains[0])) && - (gain_sq5Tbl[j]<(2.0*gains[0]))) { - j=i; - } - } - gain_index[0]=j; - } - - - - - - - - - diff --git a/sflphone-common/src/audio/codecs/ilbc/iCBSearch.h b/sflphone-common/src/audio/codecs/ilbc/iCBSearch.h deleted file mode 100644 index a61db15403215beedc47ef0957d0b3f110432d19..0000000000000000000000000000000000000000 --- a/sflphone-common/src/audio/codecs/ilbc/iCBSearch.h +++ /dev/null @@ -1,37 +0,0 @@ - - /****************************************************************** - - iLBC Speech Coder ANSI-C Source Code - - iCBSearch.h - - Copyright (C) The Internet Society (2004). - All Rights Reserved. - - ******************************************************************/ - - #ifndef __iLBC_ICBSEARCH_H - #define __iLBC_ICBSEARCH_H - - - - - - - void iCBSearch( - iLBC_Enc_Inst_t *iLBCenc_inst, - /* (i) the encoder state structure */ - int *index, /* (o) Codebook indices */ - int *gain_index,/* (o) Gain quantization indices */ - float *intarget,/* (i) Target vector for encoding */ - float *mem, /* (i) Buffer for codebook construction */ - int lMem, /* (i) Length of buffer */ - int lTarget, /* (i) Length of vector */ - int nStages, /* (i) Number of codebook stages */ - float *weightDenum, /* (i) weighting filter coefficients */ - float *weightState, /* (i) weighting filter state */ - int block /* (i) the sub-block number */ - ); - - #endif - diff --git a/sflphone-common/src/audio/codecs/ilbc/iLBC_decode.c b/sflphone-common/src/audio/codecs/ilbc/iLBC_decode.c deleted file mode 100644 index ae62bf44080c8ce42facf9bbf571d9b7a1fdd4b1..0000000000000000000000000000000000000000 --- a/sflphone-common/src/audio/codecs/ilbc/iLBC_decode.c +++ /dev/null @@ -1,652 +0,0 @@ - - /****************************************************************** - - iLBC Speech Coder ANSI-C Source Code - - iLBC_decode.c - - Copyright (C) The Internet Society (2004). - All Rights Reserved. - - ******************************************************************/ - - #include <math.h> - #include <stdlib.h> - - #include "iLBC_define.h" - #include "StateConstructW.h" - #include "LPCdecode.h" - #include "iCBConstruct.h" - #include "doCPLC.h" - #include "helpfun.h" - #include "constants.h" - #include "packing.h" - #include "string.h" - #include "enhancer.h" - #include "hpOutput.h" - #include "syntFilter.h" - - /*----------------------------------------------------------------* - * Initiation of decoder instance. - *---------------------------------------------------------------*/ - - short initDecode( /* (o) Number of decoded - samples */ - iLBC_Dec_Inst_t *iLBCdec_inst, /* (i/o) Decoder instance */ - int mode, /* (i) frame size mode */ - int use_enhancer /* (i) 1 to use enhancer - 0 to run without - enhancer */ - ){ - int i; - - iLBCdec_inst->mode = mode; - - - - - - if (mode==30) { - iLBCdec_inst->blockl = BLOCKL_30MS; - iLBCdec_inst->nsub = NSUB_30MS; - iLBCdec_inst->nasub = NASUB_30MS; - iLBCdec_inst->lpc_n = LPC_N_30MS; - iLBCdec_inst->no_of_bytes = NO_OF_BYTES_30MS; - iLBCdec_inst->no_of_words = NO_OF_WORDS_30MS; - iLBCdec_inst->state_short_len=STATE_SHORT_LEN_30MS; - /* ULP init */ - iLBCdec_inst->ULP_inst=&ULP_30msTbl; - } - else if (mode==20) { - iLBCdec_inst->blockl = BLOCKL_20MS; - iLBCdec_inst->nsub = NSUB_20MS; - iLBCdec_inst->nasub = NASUB_20MS; - iLBCdec_inst->lpc_n = LPC_N_20MS; - iLBCdec_inst->no_of_bytes = NO_OF_BYTES_20MS; - iLBCdec_inst->no_of_words = NO_OF_WORDS_20MS; - iLBCdec_inst->state_short_len=STATE_SHORT_LEN_20MS; - /* ULP init */ - iLBCdec_inst->ULP_inst=&ULP_20msTbl; - } - else { - exit(2); - } - - memset(iLBCdec_inst->syntMem, 0, - LPC_FILTERORDER*sizeof(float)); - memcpy((*iLBCdec_inst).lsfdeqold, lsfmeanTbl, - LPC_FILTERORDER*sizeof(float)); - - memset(iLBCdec_inst->old_syntdenum, 0, - ((LPC_FILTERORDER + 1)*NSUB_MAX)*sizeof(float)); - for (i=0; i<NSUB_MAX; i++) - iLBCdec_inst->old_syntdenum[i*(LPC_FILTERORDER+1)]=1.0; - - iLBCdec_inst->last_lag = 20; - - iLBCdec_inst->prevLag = 120; - iLBCdec_inst->per = 0.0; - iLBCdec_inst->consPLICount = 0; - iLBCdec_inst->prevPLI = 0; - iLBCdec_inst->prevLpc[0] = 1.0; - memset(iLBCdec_inst->prevLpc+1,0, - LPC_FILTERORDER*sizeof(float)); - memset(iLBCdec_inst->prevResidual, 0, BLOCKL_MAX*sizeof(float)); - iLBCdec_inst->seed=777; - - - - - - - memset(iLBCdec_inst->hpomem, 0, 4*sizeof(float)); - - iLBCdec_inst->use_enhancer = use_enhancer; - memset(iLBCdec_inst->enh_buf, 0, ENH_BUFL*sizeof(float)); - for (i=0;i<ENH_NBLOCKS_TOT;i++) - iLBCdec_inst->enh_period[i]=(float)40.0; - - iLBCdec_inst->prev_enh_pl = 0; - - return (iLBCdec_inst->blockl); - } - - /*----------------------------------------------------------------* - * frame residual decoder function (subrutine to iLBC_decode) - *---------------------------------------------------------------*/ - - void Decode( - iLBC_Dec_Inst_t *iLBCdec_inst, /* (i/o) the decoder state - structure */ - float *decresidual, /* (o) decoded residual frame */ - int start, /* (i) location of start - state */ - int idxForMax, /* (i) codebook index for the - maximum value */ - int *idxVec, /* (i) codebook indexes for the - samples in the start - state */ - float *syntdenum, /* (i) the decoded synthesis - filter coefficients */ - int *cb_index, /* (i) the indexes for the - adaptive codebook */ - int *gain_index, /* (i) the indexes for the - corresponding gains */ - int *extra_cb_index, /* (i) the indexes for the - adaptive codebook part - of start state */ - int *extra_gain_index, /* (i) the indexes for the - corresponding gains */ - int state_first /* (i) 1 if non adaptive part - of start state comes - first 0 if that part - comes last */ - ){ - float reverseDecresidual[BLOCKL_MAX], mem[CB_MEML]; - int k, meml_gotten, Nfor, Nback, i; - int diff, start_pos; - int subcount, subframe; - - - - - - - diff = STATE_LEN - iLBCdec_inst->state_short_len; - - if (state_first == 1) { - start_pos = (start-1)*SUBL; - } else { - start_pos = (start-1)*SUBL + diff; - } - - /* decode scalar part of start state */ - - StateConstructW(idxForMax, idxVec, - &syntdenum[(start-1)*(LPC_FILTERORDER+1)], - &decresidual[start_pos], iLBCdec_inst->state_short_len); - - - if (state_first) { /* put adaptive part in the end */ - - /* setup memory */ - - memset(mem, 0, - (CB_MEML-iLBCdec_inst->state_short_len)*sizeof(float)); - memcpy(mem+CB_MEML-iLBCdec_inst->state_short_len, - decresidual+start_pos, - iLBCdec_inst->state_short_len*sizeof(float)); - - /* construct decoded vector */ - - iCBConstruct( - &decresidual[start_pos+iLBCdec_inst->state_short_len], - extra_cb_index, extra_gain_index, mem+CB_MEML-stMemLTbl, - stMemLTbl, diff, CB_NSTAGES); - - } - else {/* put adaptive part in the beginning */ - - /* create reversed vectors for prediction */ - - for (k=0; k<diff; k++) { - reverseDecresidual[k] = - decresidual[(start+1)*SUBL-1- - (k+iLBCdec_inst->state_short_len)]; - } - - /* setup memory */ - - meml_gotten = iLBCdec_inst->state_short_len; - for (k=0; k<meml_gotten; k++){ - mem[CB_MEML-1-k] = decresidual[start_pos + k]; - - - - - - } - memset(mem, 0, (CB_MEML-k)*sizeof(float)); - - /* construct decoded vector */ - - iCBConstruct(reverseDecresidual, extra_cb_index, - extra_gain_index, mem+CB_MEML-stMemLTbl, stMemLTbl, - diff, CB_NSTAGES); - - /* get decoded residual from reversed vector */ - - for (k=0; k<diff; k++) { - decresidual[start_pos-1-k] = reverseDecresidual[k]; - } - } - - /* counter for predicted sub-frames */ - - subcount=0; - - /* forward prediction of sub-frames */ - - Nfor = iLBCdec_inst->nsub-start-1; - - if ( Nfor > 0 ){ - - /* setup memory */ - - memset(mem, 0, (CB_MEML-STATE_LEN)*sizeof(float)); - memcpy(mem+CB_MEML-STATE_LEN, decresidual+(start-1)*SUBL, - STATE_LEN*sizeof(float)); - - /* loop over sub-frames to encode */ - - for (subframe=0; subframe<Nfor; subframe++) { - - /* construct decoded vector */ - - iCBConstruct(&decresidual[(start+1+subframe)*SUBL], - cb_index+subcount*CB_NSTAGES, - gain_index+subcount*CB_NSTAGES, - mem+CB_MEML-memLfTbl[subcount], - memLfTbl[subcount], SUBL, CB_NSTAGES); - - /* update memory */ - - memcpy(mem, mem+SUBL, (CB_MEML-SUBL)*sizeof(float)); - memcpy(mem+CB_MEML-SUBL, - - - - - - &decresidual[(start+1+subframe)*SUBL], - SUBL*sizeof(float)); - - subcount++; - - } - - } - - /* backward prediction of sub-frames */ - - Nback = start-1; - - if ( Nback > 0 ) { - - /* setup memory */ - - meml_gotten = SUBL*(iLBCdec_inst->nsub+1-start); - - if ( meml_gotten > CB_MEML ) { - meml_gotten=CB_MEML; - } - for (k=0; k<meml_gotten; k++) { - mem[CB_MEML-1-k] = decresidual[(start-1)*SUBL + k]; - } - memset(mem, 0, (CB_MEML-k)*sizeof(float)); - - /* loop over subframes to decode */ - - for (subframe=0; subframe<Nback; subframe++) { - - /* construct decoded vector */ - - iCBConstruct(&reverseDecresidual[subframe*SUBL], - cb_index+subcount*CB_NSTAGES, - gain_index+subcount*CB_NSTAGES, - mem+CB_MEML-memLfTbl[subcount], memLfTbl[subcount], - SUBL, CB_NSTAGES); - - /* update memory */ - - memcpy(mem, mem+SUBL, (CB_MEML-SUBL)*sizeof(float)); - memcpy(mem+CB_MEML-SUBL, - &reverseDecresidual[subframe*SUBL], - SUBL*sizeof(float)); - - subcount++; - } - - - - - - /* get decoded residual from reversed vector */ - - for (i=0; i<SUBL*Nback; i++) - decresidual[SUBL*Nback - i - 1] = - reverseDecresidual[i]; - } - } - - /*----------------------------------------------------------------* - * main decoder function - *---------------------------------------------------------------*/ - - void iLBC_decode( - float *decblock, /* (o) decoded signal block */ - unsigned char *bytes, /* (i) encoded signal bits */ - iLBC_Dec_Inst_t *iLBCdec_inst, /* (i/o) the decoder state - structure */ - int mode /* (i) 0: bad packet, PLC, - 1: normal */ - ){ - float data[BLOCKL_MAX]; - float lsfdeq[LPC_FILTERORDER*LPC_N_MAX]; - float PLCresidual[BLOCKL_MAX], PLClpc[LPC_FILTERORDER + 1]; - float zeros[BLOCKL_MAX], one[LPC_FILTERORDER + 1]; - int k, i, start, idxForMax, pos, lastpart, ulp; - int lag, ilag; - float cc, maxcc; - int idxVec[STATE_LEN]; - int check; - int gain_index[NASUB_MAX*CB_NSTAGES], - extra_gain_index[CB_NSTAGES]; - int cb_index[CB_NSTAGES*NASUB_MAX], extra_cb_index[CB_NSTAGES]; - int lsf_i[LSF_NSPLIT*LPC_N_MAX]; - int state_first; - int last_bit; - unsigned char *pbytes; - float weightdenum[(LPC_FILTERORDER + 1)*NSUB_MAX]; - int order_plus_one; - float syntdenum[NSUB_MAX*(LPC_FILTERORDER+1)]; - float decresidual[BLOCKL_MAX]; - - if (mode>0) { /* the data are good */ - - /* decode data */ - - pbytes=bytes; - pos=0; - - - - - - - /* Set everything to zero before decoding */ - - for (k=0; k<LSF_NSPLIT*LPC_N_MAX; k++) { - lsf_i[k]=0; - } - start=0; - state_first=0; - idxForMax=0; - for (k=0; k<iLBCdec_inst->state_short_len; k++) { - idxVec[k]=0; - } - for (k=0; k<CB_NSTAGES; k++) { - extra_cb_index[k]=0; - } - for (k=0; k<CB_NSTAGES; k++) { - extra_gain_index[k]=0; - } - for (i=0; i<iLBCdec_inst->nasub; i++) { - for (k=0; k<CB_NSTAGES; k++) { - cb_index[i*CB_NSTAGES+k]=0; - } - } - for (i=0; i<iLBCdec_inst->nasub; i++) { - for (k=0; k<CB_NSTAGES; k++) { - gain_index[i*CB_NSTAGES+k]=0; - } - } - - /* loop over ULP classes */ - - for (ulp=0; ulp<3; ulp++) { - - /* LSF */ - for (k=0; k<LSF_NSPLIT*iLBCdec_inst->lpc_n; k++){ - unpack( &pbytes, &lastpart, - iLBCdec_inst->ULP_inst->lsf_bits[k][ulp], &pos); - packcombine(&lsf_i[k], lastpart, - iLBCdec_inst->ULP_inst->lsf_bits[k][ulp]); - } - - /* Start block info */ - - unpack( &pbytes, &lastpart, - iLBCdec_inst->ULP_inst->start_bits[ulp], &pos); - packcombine(&start, lastpart, - iLBCdec_inst->ULP_inst->start_bits[ulp]); - - unpack( &pbytes, &lastpart, - - - - - - iLBCdec_inst->ULP_inst->startfirst_bits[ulp], &pos); - packcombine(&state_first, lastpart, - iLBCdec_inst->ULP_inst->startfirst_bits[ulp]); - - unpack( &pbytes, &lastpart, - iLBCdec_inst->ULP_inst->scale_bits[ulp], &pos); - packcombine(&idxForMax, lastpart, - iLBCdec_inst->ULP_inst->scale_bits[ulp]); - - for (k=0; k<iLBCdec_inst->state_short_len; k++) { - unpack( &pbytes, &lastpart, - iLBCdec_inst->ULP_inst->state_bits[ulp], &pos); - packcombine(idxVec+k, lastpart, - iLBCdec_inst->ULP_inst->state_bits[ulp]); - } - - /* 23/22 (20ms/30ms) sample block */ - - for (k=0; k<CB_NSTAGES; k++) { - unpack( &pbytes, &lastpart, - iLBCdec_inst->ULP_inst->extra_cb_index[k][ulp], - &pos); - packcombine(extra_cb_index+k, lastpart, - iLBCdec_inst->ULP_inst->extra_cb_index[k][ulp]); - } - for (k=0; k<CB_NSTAGES; k++) { - unpack( &pbytes, &lastpart, - iLBCdec_inst->ULP_inst->extra_cb_gain[k][ulp], - &pos); - packcombine(extra_gain_index+k, lastpart, - iLBCdec_inst->ULP_inst->extra_cb_gain[k][ulp]); - } - - /* The two/four (20ms/30ms) 40 sample sub-blocks */ - - for (i=0; i<iLBCdec_inst->nasub; i++) { - for (k=0; k<CB_NSTAGES; k++) { - unpack( &pbytes, &lastpart, - iLBCdec_inst->ULP_inst->cb_index[i][k][ulp], - &pos); - packcombine(cb_index+i*CB_NSTAGES+k, lastpart, - iLBCdec_inst->ULP_inst->cb_index[i][k][ulp]); - } - } - - for (i=0; i<iLBCdec_inst->nasub; i++) { - for (k=0; k<CB_NSTAGES; k++) { - unpack( &pbytes, &lastpart, - - - - - - iLBCdec_inst->ULP_inst->cb_gain[i][k][ulp], - &pos); - packcombine(gain_index+i*CB_NSTAGES+k, lastpart, - iLBCdec_inst->ULP_inst->cb_gain[i][k][ulp]); - } - } - } - /* Extract last bit. If it is 1 this indicates an - empty/lost frame */ - unpack( &pbytes, &last_bit, 1, &pos); - - /* Check for bit errors or empty/lost frames */ - if (start<1) - mode = 0; - if (iLBCdec_inst->mode==20 && start>3) - mode = 0; - if (iLBCdec_inst->mode==30 && start>5) - mode = 0; - if (last_bit==1) - mode = 0; - - if (mode==1) { /* No bit errors was detected, - continue decoding */ - - /* adjust index */ - index_conv_dec(cb_index); - - /* decode the lsf */ - - SimplelsfDEQ(lsfdeq, lsf_i, iLBCdec_inst->lpc_n); - check=LSF_check(lsfdeq, LPC_FILTERORDER, - iLBCdec_inst->lpc_n); - DecoderInterpolateLSF(syntdenum, weightdenum, - lsfdeq, LPC_FILTERORDER, iLBCdec_inst); - - Decode(iLBCdec_inst, decresidual, start, idxForMax, - idxVec, syntdenum, cb_index, gain_index, - extra_cb_index, extra_gain_index, - state_first); - - /* preparing the plc for a future loss! */ - - doThePLC(PLCresidual, PLClpc, 0, decresidual, - syntdenum + - (LPC_FILTERORDER + 1)*(iLBCdec_inst->nsub - 1), - (*iLBCdec_inst).last_lag, iLBCdec_inst); - - - - - - - - memcpy(decresidual, PLCresidual, - iLBCdec_inst->blockl*sizeof(float)); - } - - } - - if (mode == 0) { - /* the data is bad (either a PLC call - * was made or a severe bit error was detected) - */ - - /* packet loss conceal */ - - memset(zeros, 0, BLOCKL_MAX*sizeof(float)); - - one[0] = 1; - memset(one+1, 0, LPC_FILTERORDER*sizeof(float)); - - start=0; - - doThePLC(PLCresidual, PLClpc, 1, zeros, one, - (*iLBCdec_inst).last_lag, iLBCdec_inst); - memcpy(decresidual, PLCresidual, - iLBCdec_inst->blockl*sizeof(float)); - - order_plus_one = LPC_FILTERORDER + 1; - for (i = 0; i < iLBCdec_inst->nsub; i++) { - memcpy(syntdenum+(i*order_plus_one), PLClpc, - order_plus_one*sizeof(float)); - } - } - - if (iLBCdec_inst->use_enhancer == 1) { - - /* post filtering */ - - iLBCdec_inst->last_lag = - enhancerInterface(data, decresidual, iLBCdec_inst); - - /* synthesis filtering */ - - if (iLBCdec_inst->mode==20) { - /* Enhancer has 40 samples delay */ - i=0; - syntFilter(data + i*SUBL, - iLBCdec_inst->old_syntdenum + - (i+iLBCdec_inst->nsub-1)*(LPC_FILTERORDER+1), - SUBL, iLBCdec_inst->syntMem); - - - - - - for (i=1; i < iLBCdec_inst->nsub; i++) { - syntFilter(data + i*SUBL, - syntdenum + (i-1)*(LPC_FILTERORDER+1), - SUBL, iLBCdec_inst->syntMem); - } - } else if (iLBCdec_inst->mode==30) { - /* Enhancer has 80 samples delay */ - for (i=0; i < 2; i++) { - syntFilter(data + i*SUBL, - iLBCdec_inst->old_syntdenum + - (i+iLBCdec_inst->nsub-2)*(LPC_FILTERORDER+1), - SUBL, iLBCdec_inst->syntMem); - } - for (i=2; i < iLBCdec_inst->nsub; i++) { - syntFilter(data + i*SUBL, - syntdenum + (i-2)*(LPC_FILTERORDER+1), SUBL, - iLBCdec_inst->syntMem); - } - } - - } else { - - /* Find last lag */ - lag = 20; - maxcc = xCorrCoef(&decresidual[BLOCKL_MAX-ENH_BLOCKL], - &decresidual[BLOCKL_MAX-ENH_BLOCKL-lag], ENH_BLOCKL); - - for (ilag=21; ilag<120; ilag++) { - cc = xCorrCoef(&decresidual[BLOCKL_MAX-ENH_BLOCKL], - &decresidual[BLOCKL_MAX-ENH_BLOCKL-ilag], - ENH_BLOCKL); - - if (cc > maxcc) { - maxcc = cc; - lag = ilag; - } - } - iLBCdec_inst->last_lag = lag; - - /* copy data and run synthesis filter */ - - memcpy(data, decresidual, - iLBCdec_inst->blockl*sizeof(float)); - for (i=0; i < iLBCdec_inst->nsub; i++) { - syntFilter(data + i*SUBL, - syntdenum + i*(LPC_FILTERORDER+1), SUBL, - iLBCdec_inst->syntMem); - } - - - - - - } - - /* high pass filtering on output if desired, otherwise - copy to out */ - - hpOutput(data, iLBCdec_inst->blockl, - decblock,iLBCdec_inst->hpomem); - - /* memcpy(decblock,data,iLBCdec_inst->blockl*sizeof(float));*/ - - memcpy(iLBCdec_inst->old_syntdenum, syntdenum, - - iLBCdec_inst->nsub*(LPC_FILTERORDER+1)*sizeof(float)); - - iLBCdec_inst->prev_enh_pl=0; - - if (mode==0) { /* PLC was used */ - iLBCdec_inst->prev_enh_pl=1; - } - } - diff --git a/sflphone-common/src/audio/codecs/ilbc/iLBC_decode.h b/sflphone-common/src/audio/codecs/ilbc/iLBC_decode.h deleted file mode 100644 index 5f4384dcde8fc9400ccab82ae7df7cd010a0191a..0000000000000000000000000000000000000000 --- a/sflphone-common/src/audio/codecs/ilbc/iLBC_decode.h +++ /dev/null @@ -1,42 +0,0 @@ - - /****************************************************************** - - iLBC Speech Coder ANSI-C Source Code - - iLBC_decode.h - - Copyright (C) The Internet Society (2004). - All Rights Reserved. - - ******************************************************************/ - - #ifndef __iLBC_ILBCDECODE_H - #define __iLBC_ILBCDECODE_H - - #include "iLBC_define.h" - - short initDecode( /* (o) Number of decoded - samples */ - iLBC_Dec_Inst_t *iLBCdec_inst, /* (i/o) Decoder instance */ - int mode, /* (i) frame size mode */ - int use_enhancer /* (i) 1 to use enhancer - 0 to run without - enhancer */ - ); - - void iLBC_decode( - float *decblock, /* (o) decoded signal block */ - unsigned char *bytes, /* (i) encoded signal bits */ - iLBC_Dec_Inst_t *iLBCdec_inst, /* (i/o) the decoder state - structure */ - int mode /* (i) 0: bad packet, PLC, - 1: normal */ - - - - - - ); - - #endif - diff --git a/sflphone-common/src/audio/codecs/ilbc/iLBC_define.h b/sflphone-common/src/audio/codecs/ilbc/iLBC_define.h deleted file mode 100644 index 480c834b97c36d9fe0685bf57e337b532d7700a3..0000000000000000000000000000000000000000 --- a/sflphone-common/src/audio/codecs/ilbc/iLBC_define.h +++ /dev/null @@ -1,217 +0,0 @@ - - /****************************************************************** - - iLBC Speech Coder ANSI-C Source Code - - iLBC_define.h - - Copyright (C) The Internet Society (2004). - All Rights Reserved. - - ******************************************************************/ - #include <string.h> - - #ifndef __iLBC_ILBCDEFINE_H - #define __iLBC_ILBCDEFINE_H - - /* general codec settings */ - - #define FS (float)8000.0 - #define BLOCKL_20MS 160 - #define BLOCKL_30MS 240 - #define BLOCKL_MAX 240 - #define NSUB_20MS 4 - #define NSUB_30MS 6 - #define NSUB_MAX 6 - #define NASUB_20MS 2 - - - - - - #define NASUB_30MS 4 - #define NASUB_MAX 4 - #define SUBL 40 - #define STATE_LEN 80 - #define STATE_SHORT_LEN_30MS 58 - #define STATE_SHORT_LEN_20MS 57 - - /* LPC settings */ - - #define LPC_FILTERORDER 10 - #define LPC_CHIRP_SYNTDENUM (float)0.9025 - #define LPC_CHIRP_WEIGHTDENUM (float)0.4222 - #define LPC_LOOKBACK 60 - #define LPC_N_20MS 1 - #define LPC_N_30MS 2 - #define LPC_N_MAX 2 - #define LPC_ASYMDIFF 20 - #define LPC_BW (float)60.0 - #define LPC_WN (float)1.0001 - #define LSF_NSPLIT 3 - #define LSF_NUMBER_OF_STEPS 4 - #define LPC_HALFORDER (LPC_FILTERORDER/2) - - /* cb settings */ - - #define CB_NSTAGES 3 - #define CB_EXPAND 2 - #define CB_MEML 147 - #define CB_FILTERLEN 2*4 - #define CB_HALFFILTERLEN 4 - #define CB_RESRANGE 34 - #define CB_MAXGAIN (float)1.3 - - /* enhancer */ - - #define ENH_BLOCKL 80 /* block length */ - #define ENH_BLOCKL_HALF (ENH_BLOCKL/2) - #define ENH_HL 3 /* 2*ENH_HL+1 is number blocks - in said second sequence */ - #define ENH_SLOP 2 /* max difference estimated and - correct pitch period */ - #define ENH_PLOCSL 20 /* pitch-estimates and pitch- - locations buffer length */ - #define ENH_OVERHANG 2 - #define ENH_UPS0 4 /* upsampling rate */ - #define ENH_FL0 3 /* 2*FLO+1 is the length of - each filter */ - #define ENH_VECTL (ENH_BLOCKL+2*ENH_FL0) - - - - - - #define ENH_CORRDIM (2*ENH_SLOP+1) - #define ENH_NBLOCKS (BLOCKL_MAX/ENH_BLOCKL) - #define ENH_NBLOCKS_EXTRA 5 - #define ENH_NBLOCKS_TOT 8 /* ENH_NBLOCKS + - ENH_NBLOCKS_EXTRA */ - #define ENH_BUFL (ENH_NBLOCKS_TOT)*ENH_BLOCKL - #define ENH_ALPHA0 (float)0.05 - - /* Down sampling */ - - #define FILTERORDER_DS 7 - #define DELAY_DS 3 - #define FACTOR_DS 2 - - /* bit stream defs */ - - #define NO_OF_BYTES_20MS 38 - #define NO_OF_BYTES_30MS 50 - #define NO_OF_WORDS_20MS 19 - #define NO_OF_WORDS_30MS 25 - #define STATE_BITS 3 - #define BYTE_LEN 8 - #define ULP_CLASSES 3 - - /* help parameters */ - - #define FLOAT_MAX (float)1.0e37 - #define EPS (float)2.220446049250313e-016 - #define PI (float)3.14159265358979323846 - #define MIN_SAMPLE -32768 - #define MAX_SAMPLE 32767 - #define TWO_PI (float)6.283185307 - #define PI2 (float)0.159154943 - - /* type definition encoder instance */ - typedef struct iLBC_ULP_Inst_t_ { - int lsf_bits[6][ULP_CLASSES+2]; - int start_bits[ULP_CLASSES+2]; - int startfirst_bits[ULP_CLASSES+2]; - int scale_bits[ULP_CLASSES+2]; - int state_bits[ULP_CLASSES+2]; - int extra_cb_index[CB_NSTAGES][ULP_CLASSES+2]; - int extra_cb_gain[CB_NSTAGES][ULP_CLASSES+2]; - int cb_index[NSUB_MAX][CB_NSTAGES][ULP_CLASSES+2]; - int cb_gain[NSUB_MAX][CB_NSTAGES][ULP_CLASSES+2]; - } iLBC_ULP_Inst_t; - - /* type definition encoder instance */ - - - - - - typedef struct iLBC_Enc_Inst_t_ { - - /* flag for frame size mode */ - int mode; - - /* basic parameters for different frame sizes */ - int blockl; - int nsub; - int nasub; - int no_of_bytes, no_of_words; - int lpc_n; - int state_short_len; - const iLBC_ULP_Inst_t *ULP_inst; - - /* analysis filter state */ - float anaMem[LPC_FILTERORDER]; - - /* old lsf parameters for interpolation */ - float lsfold[LPC_FILTERORDER]; - float lsfdeqold[LPC_FILTERORDER]; - - /* signal buffer for LP analysis */ - float lpc_buffer[LPC_LOOKBACK + BLOCKL_MAX]; - - /* state of input HP filter */ - float hpimem[4]; - - } iLBC_Enc_Inst_t; - - /* type definition decoder instance */ - typedef struct iLBC_Dec_Inst_t_ { - - /* flag for frame size mode */ - int mode; - - /* basic parameters for different frame sizes */ - int blockl; - int nsub; - int nasub; - int no_of_bytes, no_of_words; - int lpc_n; - int state_short_len; - const iLBC_ULP_Inst_t *ULP_inst; - - /* synthesis filter state */ - float syntMem[LPC_FILTERORDER]; - - /* old LSF for interpolation */ - - - - - - float lsfdeqold[LPC_FILTERORDER]; - - /* pitch lag estimated in enhancer and used in PLC */ - int last_lag; - - /* PLC state information */ - int prevLag, consPLICount, prevPLI, prev_enh_pl; - float prevLpc[LPC_FILTERORDER+1]; - float prevResidual[NSUB_MAX*SUBL]; - float per; - unsigned long seed; - - /* previous synthesis filter parameters */ - float old_syntdenum[(LPC_FILTERORDER + 1)*NSUB_MAX]; - - /* state of output HP filter */ - float hpomem[4]; - - /* enhancer state information */ - int use_enhancer; - float enh_buf[ENH_BUFL]; - float enh_period[ENH_NBLOCKS_TOT]; - - } iLBC_Dec_Inst_t; - - #endif - diff --git a/sflphone-common/src/audio/codecs/ilbc/iLBC_encode.c b/sflphone-common/src/audio/codecs/ilbc/iLBC_encode.c deleted file mode 100644 index 463641403083d2fbb2203a9abd00e0cc78b78db9..0000000000000000000000000000000000000000 --- a/sflphone-common/src/audio/codecs/ilbc/iLBC_encode.c +++ /dev/null @@ -1,543 +0,0 @@ - - /****************************************************************** - - iLBC Speech Coder ANSI-C Source Code - - iLBC_encode.c - - Copyright (C) The Internet Society (2004). - All Rights Reserved. - - ******************************************************************/ - - #include <math.h> - #include <stdlib.h> - #include <string.h> - - #include "iLBC_define.h" - #include "LPCencode.h" - #include "FrameClassify.h" - #include "StateSearchW.h" - #include "StateConstructW.h" - #include "helpfun.h" - #include "constants.h" - #include "packing.h" - #include "iCBSearch.h" - #include "iCBConstruct.h" - #include "hpInput.h" - #include "anaFilter.h" - #include "syntFilter.h" - - /*----------------------------------------------------------------* - * Initiation of encoder instance. - *---------------------------------------------------------------*/ - - short initEncode( /* (o) Number of bytes - encoded */ - iLBC_Enc_Inst_t *iLBCenc_inst, /* (i/o) Encoder instance */ - int mode /* (i) frame size mode */ - ){ - iLBCenc_inst->mode = mode; - if (mode==30) { - iLBCenc_inst->blockl = BLOCKL_30MS; - iLBCenc_inst->nsub = NSUB_30MS; - iLBCenc_inst->nasub = NASUB_30MS; - iLBCenc_inst->lpc_n = LPC_N_30MS; - iLBCenc_inst->no_of_bytes = NO_OF_BYTES_30MS; - iLBCenc_inst->no_of_words = NO_OF_WORDS_30MS; - - - - - - iLBCenc_inst->state_short_len=STATE_SHORT_LEN_30MS; - /* ULP init */ - iLBCenc_inst->ULP_inst=&ULP_30msTbl; - } - else if (mode==20) { - iLBCenc_inst->blockl = BLOCKL_20MS; - iLBCenc_inst->nsub = NSUB_20MS; - iLBCenc_inst->nasub = NASUB_20MS; - iLBCenc_inst->lpc_n = LPC_N_20MS; - iLBCenc_inst->no_of_bytes = NO_OF_BYTES_20MS; - iLBCenc_inst->no_of_words = NO_OF_WORDS_20MS; - iLBCenc_inst->state_short_len=STATE_SHORT_LEN_20MS; - /* ULP init */ - iLBCenc_inst->ULP_inst=&ULP_20msTbl; - } - else { - exit(2); - } - - memset((*iLBCenc_inst).anaMem, 0, - LPC_FILTERORDER*sizeof(float)); - memcpy((*iLBCenc_inst).lsfold, lsfmeanTbl, - LPC_FILTERORDER*sizeof(float)); - memcpy((*iLBCenc_inst).lsfdeqold, lsfmeanTbl, - LPC_FILTERORDER*sizeof(float)); - memset((*iLBCenc_inst).lpc_buffer, 0, - (LPC_LOOKBACK+BLOCKL_MAX)*sizeof(float)); - memset((*iLBCenc_inst).hpimem, 0, 4*sizeof(float)); - - return (iLBCenc_inst->no_of_bytes); - } - - /*----------------------------------------------------------------* - * main encoder function - *---------------------------------------------------------------*/ - - void iLBC_encode( - unsigned char *bytes, /* (o) encoded data bits iLBC */ - float *block, /* (o) speech vector to - encode */ - iLBC_Enc_Inst_t *iLBCenc_inst /* (i/o) the general encoder - state */ - ){ - - float data[BLOCKL_MAX]; - float residual[BLOCKL_MAX], reverseResidual[BLOCKL_MAX]; - - int start, idxForMax, idxVec[STATE_LEN]; - - - - - - float reverseDecresidual[BLOCKL_MAX], mem[CB_MEML]; - int n, k, meml_gotten, Nfor, Nback, i, pos; - int gain_index[CB_NSTAGES*NASUB_MAX], - extra_gain_index[CB_NSTAGES]; - int cb_index[CB_NSTAGES*NASUB_MAX],extra_cb_index[CB_NSTAGES]; - int lsf_i[LSF_NSPLIT*LPC_N_MAX]; - unsigned char *pbytes; - int diff, start_pos, state_first; - float en1, en2; - int index, ulp, firstpart; - int subcount, subframe; - float weightState[LPC_FILTERORDER]; - float syntdenum[NSUB_MAX*(LPC_FILTERORDER+1)]; - float weightdenum[NSUB_MAX*(LPC_FILTERORDER+1)]; - float decresidual[BLOCKL_MAX]; - - /* high pass filtering of input signal if such is not done - prior to calling this function */ - - hpInput(block, iLBCenc_inst->blockl, - data, (*iLBCenc_inst).hpimem); - - /* otherwise simply copy */ - - /*memcpy(data,block,iLBCenc_inst->blockl*sizeof(float));*/ - - /* LPC of hp filtered input data */ - - LPCencode(syntdenum, weightdenum, lsf_i, data, iLBCenc_inst); - - - /* inverse filter to get residual */ - - for (n=0; n<iLBCenc_inst->nsub; n++) { - anaFilter(&data[n*SUBL], &syntdenum[n*(LPC_FILTERORDER+1)], - SUBL, &residual[n*SUBL], iLBCenc_inst->anaMem); - } - - /* find state location */ - - start = FrameClassify(iLBCenc_inst, residual); - - /* check if state should be in first or last part of the - two subframes */ - - diff = STATE_LEN - iLBCenc_inst->state_short_len; - en1 = 0; - index = (start-1)*SUBL; - - - - - - for (i = 0; i < iLBCenc_inst->state_short_len; i++) { - en1 += residual[index+i]*residual[index+i]; - } - en2 = 0; - index = (start-1)*SUBL+diff; - for (i = 0; i < iLBCenc_inst->state_short_len; i++) { - en2 += residual[index+i]*residual[index+i]; - } - - - if (en1 > en2) { - state_first = 1; - start_pos = (start-1)*SUBL; - } else { - state_first = 0; - start_pos = (start-1)*SUBL + diff; - } - - /* scalar quantization of state */ - - StateSearchW(iLBCenc_inst, &residual[start_pos], - &syntdenum[(start-1)*(LPC_FILTERORDER+1)], - &weightdenum[(start-1)*(LPC_FILTERORDER+1)], &idxForMax, - idxVec, iLBCenc_inst->state_short_len, state_first); - - StateConstructW(idxForMax, idxVec, - &syntdenum[(start-1)*(LPC_FILTERORDER+1)], - &decresidual[start_pos], iLBCenc_inst->state_short_len); - - /* predictive quantization in state */ - - if (state_first) { /* put adaptive part in the end */ - - /* setup memory */ - - memset(mem, 0, - (CB_MEML-iLBCenc_inst->state_short_len)*sizeof(float)); - memcpy(mem+CB_MEML-iLBCenc_inst->state_short_len, - decresidual+start_pos, - iLBCenc_inst->state_short_len*sizeof(float)); - memset(weightState, 0, LPC_FILTERORDER*sizeof(float)); - - /* encode sub-frames */ - - iCBSearch(iLBCenc_inst, extra_cb_index, extra_gain_index, - &residual[start_pos+iLBCenc_inst->state_short_len], - mem+CB_MEML-stMemLTbl, - stMemLTbl, diff, CB_NSTAGES, - - - - - - &weightdenum[start*(LPC_FILTERORDER+1)], - weightState, 0); - - /* construct decoded vector */ - - iCBConstruct( - &decresidual[start_pos+iLBCenc_inst->state_short_len], - extra_cb_index, extra_gain_index, - mem+CB_MEML-stMemLTbl, - stMemLTbl, diff, CB_NSTAGES); - - } - else { /* put adaptive part in the beginning */ - - /* create reversed vectors for prediction */ - - for (k=0; k<diff; k++) { - reverseResidual[k] = residual[(start+1)*SUBL-1 - -(k+iLBCenc_inst->state_short_len)]; - } - - /* setup memory */ - - meml_gotten = iLBCenc_inst->state_short_len; - for (k=0; k<meml_gotten; k++) { - mem[CB_MEML-1-k] = decresidual[start_pos + k]; - } - memset(mem, 0, (CB_MEML-k)*sizeof(float)); - memset(weightState, 0, LPC_FILTERORDER*sizeof(float)); - - /* encode sub-frames */ - - iCBSearch(iLBCenc_inst, extra_cb_index, extra_gain_index, - reverseResidual, mem+CB_MEML-stMemLTbl, stMemLTbl, - diff, CB_NSTAGES, - &weightdenum[(start-1)*(LPC_FILTERORDER+1)], - weightState, 0); - - /* construct decoded vector */ - - iCBConstruct(reverseDecresidual, extra_cb_index, - extra_gain_index, mem+CB_MEML-stMemLTbl, stMemLTbl, - diff, CB_NSTAGES); - - /* get decoded residual from reversed vector */ - - for (k=0; k<diff; k++) { - decresidual[start_pos-1-k] = reverseDecresidual[k]; - - - - - - } - } - - /* counter for predicted sub-frames */ - - subcount=0; - - /* forward prediction of sub-frames */ - - Nfor = iLBCenc_inst->nsub-start-1; - - - if ( Nfor > 0 ) { - - /* setup memory */ - - memset(mem, 0, (CB_MEML-STATE_LEN)*sizeof(float)); - memcpy(mem+CB_MEML-STATE_LEN, decresidual+(start-1)*SUBL, - STATE_LEN*sizeof(float)); - memset(weightState, 0, LPC_FILTERORDER*sizeof(float)); - - /* loop over sub-frames to encode */ - - for (subframe=0; subframe<Nfor; subframe++) { - - /* encode sub-frame */ - - iCBSearch(iLBCenc_inst, cb_index+subcount*CB_NSTAGES, - gain_index+subcount*CB_NSTAGES, - &residual[(start+1+subframe)*SUBL], - mem+CB_MEML-memLfTbl[subcount], - memLfTbl[subcount], SUBL, CB_NSTAGES, - &weightdenum[(start+1+subframe)* - (LPC_FILTERORDER+1)], - weightState, subcount+1); - - /* construct decoded vector */ - - iCBConstruct(&decresidual[(start+1+subframe)*SUBL], - cb_index+subcount*CB_NSTAGES, - gain_index+subcount*CB_NSTAGES, - mem+CB_MEML-memLfTbl[subcount], - memLfTbl[subcount], SUBL, CB_NSTAGES); - - /* update memory */ - - memcpy(mem, mem+SUBL, (CB_MEML-SUBL)*sizeof(float)); - memcpy(mem+CB_MEML-SUBL, - - - - - - &decresidual[(start+1+subframe)*SUBL], - SUBL*sizeof(float)); - memset(weightState, 0, LPC_FILTERORDER*sizeof(float)); - - subcount++; - } - } - - - /* backward prediction of sub-frames */ - - Nback = start-1; - - - if ( Nback > 0 ) { - - /* create reverse order vectors */ - - for (n=0; n<Nback; n++) { - for (k=0; k<SUBL; k++) { - reverseResidual[n*SUBL+k] = - residual[(start-1)*SUBL-1-n*SUBL-k]; - reverseDecresidual[n*SUBL+k] = - decresidual[(start-1)*SUBL-1-n*SUBL-k]; - } - } - - /* setup memory */ - - meml_gotten = SUBL*(iLBCenc_inst->nsub+1-start); - - - if ( meml_gotten > CB_MEML ) { - meml_gotten=CB_MEML; - } - for (k=0; k<meml_gotten; k++) { - mem[CB_MEML-1-k] = decresidual[(start-1)*SUBL + k]; - } - memset(mem, 0, (CB_MEML-k)*sizeof(float)); - memset(weightState, 0, LPC_FILTERORDER*sizeof(float)); - - /* loop over sub-frames to encode */ - - for (subframe=0; subframe<Nback; subframe++) { - - /* encode sub-frame */ - - iCBSearch(iLBCenc_inst, cb_index+subcount*CB_NSTAGES, - - - - - - gain_index+subcount*CB_NSTAGES, - &reverseResidual[subframe*SUBL], - mem+CB_MEML-memLfTbl[subcount], - memLfTbl[subcount], SUBL, CB_NSTAGES, - &weightdenum[(start-2-subframe)* - (LPC_FILTERORDER+1)], - weightState, subcount+1); - - /* construct decoded vector */ - - iCBConstruct(&reverseDecresidual[subframe*SUBL], - cb_index+subcount*CB_NSTAGES, - gain_index+subcount*CB_NSTAGES, - mem+CB_MEML-memLfTbl[subcount], - memLfTbl[subcount], SUBL, CB_NSTAGES); - - /* update memory */ - - memcpy(mem, mem+SUBL, (CB_MEML-SUBL)*sizeof(float)); - memcpy(mem+CB_MEML-SUBL, - &reverseDecresidual[subframe*SUBL], - SUBL*sizeof(float)); - memset(weightState, 0, LPC_FILTERORDER*sizeof(float)); - - subcount++; - - } - - /* get decoded residual from reversed vector */ - - for (i=0; i<SUBL*Nback; i++) { - decresidual[SUBL*Nback - i - 1] = - reverseDecresidual[i]; - } - } - /* end encoding part */ - - /* adjust index */ - index_conv_enc(cb_index); - - /* pack bytes */ - - pbytes=bytes; - pos=0; - - /* loop over the 3 ULP classes */ - - for (ulp=0; ulp<3; ulp++) { - - - - - - - /* LSF */ - for (k=0; k<LSF_NSPLIT*iLBCenc_inst->lpc_n; k++) { - packsplit(&lsf_i[k], &firstpart, &lsf_i[k], - iLBCenc_inst->ULP_inst->lsf_bits[k][ulp], - iLBCenc_inst->ULP_inst->lsf_bits[k][ulp]+ - iLBCenc_inst->ULP_inst->lsf_bits[k][ulp+1]+ - iLBCenc_inst->ULP_inst->lsf_bits[k][ulp+2]); - dopack( &pbytes, firstpart, - iLBCenc_inst->ULP_inst->lsf_bits[k][ulp], &pos); - } - - /* Start block info */ - - packsplit(&start, &firstpart, &start, - iLBCenc_inst->ULP_inst->start_bits[ulp], - iLBCenc_inst->ULP_inst->start_bits[ulp]+ - iLBCenc_inst->ULP_inst->start_bits[ulp+1]+ - iLBCenc_inst->ULP_inst->start_bits[ulp+2]); - dopack( &pbytes, firstpart, - iLBCenc_inst->ULP_inst->start_bits[ulp], &pos); - - packsplit(&state_first, &firstpart, &state_first, - iLBCenc_inst->ULP_inst->startfirst_bits[ulp], - iLBCenc_inst->ULP_inst->startfirst_bits[ulp]+ - iLBCenc_inst->ULP_inst->startfirst_bits[ulp+1]+ - iLBCenc_inst->ULP_inst->startfirst_bits[ulp+2]); - dopack( &pbytes, firstpart, - iLBCenc_inst->ULP_inst->startfirst_bits[ulp], &pos); - - packsplit(&idxForMax, &firstpart, &idxForMax, - iLBCenc_inst->ULP_inst->scale_bits[ulp], - iLBCenc_inst->ULP_inst->scale_bits[ulp]+ - iLBCenc_inst->ULP_inst->scale_bits[ulp+1]+ - iLBCenc_inst->ULP_inst->scale_bits[ulp+2]); - dopack( &pbytes, firstpart, - iLBCenc_inst->ULP_inst->scale_bits[ulp], &pos); - - for (k=0; k<iLBCenc_inst->state_short_len; k++) { - packsplit(idxVec+k, &firstpart, idxVec+k, - iLBCenc_inst->ULP_inst->state_bits[ulp], - iLBCenc_inst->ULP_inst->state_bits[ulp]+ - iLBCenc_inst->ULP_inst->state_bits[ulp+1]+ - iLBCenc_inst->ULP_inst->state_bits[ulp+2]); - dopack( &pbytes, firstpart, - iLBCenc_inst->ULP_inst->state_bits[ulp], &pos); - } - - - - - - - /* 23/22 (20ms/30ms) sample block */ - - for (k=0;k<CB_NSTAGES;k++) { - packsplit(extra_cb_index+k, &firstpart, - extra_cb_index+k, - iLBCenc_inst->ULP_inst->extra_cb_index[k][ulp], - iLBCenc_inst->ULP_inst->extra_cb_index[k][ulp]+ - iLBCenc_inst->ULP_inst->extra_cb_index[k][ulp+1]+ - iLBCenc_inst->ULP_inst->extra_cb_index[k][ulp+2]); - dopack( &pbytes, firstpart, - iLBCenc_inst->ULP_inst->extra_cb_index[k][ulp], - &pos); - } - - for (k=0;k<CB_NSTAGES;k++) { - packsplit(extra_gain_index+k, &firstpart, - extra_gain_index+k, - iLBCenc_inst->ULP_inst->extra_cb_gain[k][ulp], - iLBCenc_inst->ULP_inst->extra_cb_gain[k][ulp]+ - iLBCenc_inst->ULP_inst->extra_cb_gain[k][ulp+1]+ - iLBCenc_inst->ULP_inst->extra_cb_gain[k][ulp+2]); - dopack( &pbytes, firstpart, - iLBCenc_inst->ULP_inst->extra_cb_gain[k][ulp], - &pos); - } - - /* The two/four (20ms/30ms) 40 sample sub-blocks */ - - for (i=0; i<iLBCenc_inst->nasub; i++) { - for (k=0; k<CB_NSTAGES; k++) { - packsplit(cb_index+i*CB_NSTAGES+k, &firstpart, - cb_index+i*CB_NSTAGES+k, - iLBCenc_inst->ULP_inst->cb_index[i][k][ulp], - iLBCenc_inst->ULP_inst->cb_index[i][k][ulp]+ - iLBCenc_inst->ULP_inst->cb_index[i][k][ulp+1]+ - iLBCenc_inst->ULP_inst->cb_index[i][k][ulp+2]); - dopack( &pbytes, firstpart, - iLBCenc_inst->ULP_inst->cb_index[i][k][ulp], - &pos); - } - } - - for (i=0; i<iLBCenc_inst->nasub; i++) { - for (k=0; k<CB_NSTAGES; k++) { - packsplit(gain_index+i*CB_NSTAGES+k, &firstpart, - gain_index+i*CB_NSTAGES+k, - iLBCenc_inst->ULP_inst->cb_gain[i][k][ulp], - iLBCenc_inst->ULP_inst->cb_gain[i][k][ulp]+ - - - - - - iLBCenc_inst->ULP_inst->cb_gain[i][k][ulp+1]+ - iLBCenc_inst->ULP_inst->cb_gain[i][k][ulp+2]); - dopack( &pbytes, firstpart, - iLBCenc_inst->ULP_inst->cb_gain[i][k][ulp], - &pos); - } - } - } - - /* set the last bit to zero (otherwise the decoder - will treat it as a lost frame) */ - dopack( &pbytes, 0, 1, &pos); - } - diff --git a/sflphone-common/src/audio/codecs/ilbc/iLBC_encode.h b/sflphone-common/src/audio/codecs/ilbc/iLBC_encode.h deleted file mode 100644 index a3ab55f9dcea93d6a5379933adbd4d092c7d2687..0000000000000000000000000000000000000000 --- a/sflphone-common/src/audio/codecs/ilbc/iLBC_encode.h +++ /dev/null @@ -1,39 +0,0 @@ - - /****************************************************************** - - iLBC Speech Coder ANSI-C Source Code - - iLBC_encode.h - - Copyright (C) The Internet Society (2004). - All Rights Reserved. - - ******************************************************************/ - - #ifndef __iLBC_ILBCENCODE_H - #define __iLBC_ILBCENCODE_H - - #include "iLBC_define.h" - - short initEncode( /* (o) Number of bytes - encoded */ - iLBC_Enc_Inst_t *iLBCenc_inst, /* (i/o) Encoder instance */ - int mode /* (i) frame size mode */ - ); - - void iLBC_encode( - - unsigned char *bytes, /* (o) encoded data bits iLBC */ - float *block, /* (o) speech vector to - encode */ - iLBC_Enc_Inst_t *iLBCenc_inst /* (i/o) the general encoder - state */ - ); - - #endif - - - - - - diff --git a/sflphone-common/src/audio/codecs/ilbc/iLBC_test.c b/sflphone-common/src/audio/codecs/ilbc/iLBC_test.c deleted file mode 100644 index 473cc7b68ae885e24029f65e145078d990166a51..0000000000000000000000000000000000000000 --- a/sflphone-common/src/audio/codecs/ilbc/iLBC_test.c +++ /dev/null @@ -1,310 +0,0 @@ - - /****************************************************************** - - iLBC Speech Coder ANSI-C Source Code - - iLBC_test.c - - Copyright (C) The Internet Society (2004). - All Rights Reserved. - - ******************************************************************/ - - #include <math.h> - #include <stdlib.h> - #include <stdio.h> - #include <string.h> - #include "iLBC_define.h" - #include "iLBC_encode.h" - #include "iLBC_decode.h" - - /* Runtime statistics */ - #include <time.h> - - #define ILBCNOOFWORDS_MAX (NO_OF_BYTES_30MS/2) - - /*----------------------------------------------------------------* - * Encoder interface function - - - - - - *---------------------------------------------------------------*/ - - short encode( /* (o) Number of bytes encoded */ - iLBC_Enc_Inst_t *iLBCenc_inst, - /* (i/o) Encoder instance */ - short *encoded_data, /* (o) The encoded bytes */ - short *data /* (i) The signal block to encode*/ - ){ - float block[BLOCKL_MAX]; - int k; - - /* convert signal to float */ - - for (k=0; k<iLBCenc_inst->blockl; k++) - block[k] = (float)data[k]; - - /* do the actual encoding */ - - iLBC_encode((unsigned char *)encoded_data, block, iLBCenc_inst); - - - return (iLBCenc_inst->no_of_bytes); - } - - /*----------------------------------------------------------------* - * Decoder interface function - *---------------------------------------------------------------*/ - - short decode( /* (o) Number of decoded samples */ - iLBC_Dec_Inst_t *iLBCdec_inst, /* (i/o) Decoder instance */ - short *decoded_data, /* (o) Decoded signal block*/ - short *encoded_data, /* (i) Encoded bytes */ - short mode /* (i) 0=PL, 1=Normal */ - ){ - int k; - float decblock[BLOCKL_MAX], dtmp; - - /* check if mode is valid */ - - if (mode<0 || mode>1) { - printf("\nERROR - Wrong mode - 0, 1 allowed\n"); exit(3);} - - /* do actual decoding of block */ - - iLBC_decode(decblock, (unsigned char *)encoded_data, - iLBCdec_inst, mode); - - /* convert to short */ - - - - - - for (k=0; k<iLBCdec_inst->blockl; k++){ - dtmp=decblock[k]; - - if (dtmp<MIN_SAMPLE) - dtmp=MIN_SAMPLE; - else if (dtmp>MAX_SAMPLE) - dtmp=MAX_SAMPLE; - decoded_data[k] = (short) dtmp; - } - - return (iLBCdec_inst->blockl); - } - - /*---------------------------------------------------------------* - * Main program to test iLBC encoding and decoding - * - * Usage: - * exefile_name.exe <infile> <bytefile> <outfile> <channel> - * - * <infile> : Input file, speech for encoder (16-bit pcm file) - * <bytefile> : Bit stream output from the encoder - * <outfile> : Output file, decoded speech (16-bit pcm file) - * <channel> : Bit error file, optional (16-bit) - * 1 - Packet received correctly - * 0 - Packet Lost - * - *--------------------------------------------------------------*/ - - int main(int argc, char* argv[]) - { - - /* Runtime statistics */ - - float starttime; - float runtime; - float outtime; - - FILE *ifileid,*efileid,*ofileid, *cfileid; - short data[BLOCKL_MAX]; - short encoded_data[ILBCNOOFWORDS_MAX], decoded_data[BLOCKL_MAX]; - int len; - short pli, mode; - int blockcount = 0; - int packetlosscount = 0; - - /* Create structs */ - iLBC_Enc_Inst_t Enc_Inst; - iLBC_Dec_Inst_t Dec_Inst; - - - - - - /* get arguments and open files */ - - if ((argc!=5) && (argc!=6)) { - fprintf(stderr, - "\n*-----------------------------------------------*\n"); - fprintf(stderr, - " %s <20,30> input encoded decoded (channel)\n\n", - argv[0]); - fprintf(stderr, - " mode : Frame size for the encoding/decoding\n"); - fprintf(stderr, - " 20 - 20 ms\n"); - fprintf(stderr, - " 30 - 30 ms\n"); - fprintf(stderr, - " input : Speech for encoder (16-bit pcm file)\n"); - fprintf(stderr, - " encoded : Encoded bit stream\n"); - fprintf(stderr, - " decoded : Decoded speech (16-bit pcm file)\n"); - fprintf(stderr, - " channel : Packet loss pattern, optional (16-bit)\n"); - fprintf(stderr, - " 1 - Packet received correctly\n"); - fprintf(stderr, - " 0 - Packet Lost\n"); - fprintf(stderr, - "*-----------------------------------------------*\n\n"); - exit(1); - } - mode=atoi(argv[1]); - if (mode != 20 && mode != 30) { - fprintf(stderr,"Wrong mode %s, must be 20, or 30\n", - argv[1]); - exit(2); - } - if ( (ifileid=fopen(argv[2],"rb")) == NULL) { - fprintf(stderr,"Cannot open input file %s\n", argv[2]); - exit(2);} - if ( (efileid=fopen(argv[3],"wb")) == NULL) { - fprintf(stderr, "Cannot open encoded file %s\n", - argv[3]); exit(1);} - if ( (ofileid=fopen(argv[4],"wb")) == NULL) { - fprintf(stderr, "Cannot open decoded file %s\n", - argv[4]); exit(1);} - if (argc==6) { - if( (cfileid=fopen(argv[5],"rb")) == NULL) { - fprintf(stderr, "Cannot open channel file %s\n", - - - - - - argv[5]); - exit(1); - } - } else { - cfileid=NULL; - } - - /* print info */ - - fprintf(stderr, "\n"); - fprintf(stderr, - "*---------------------------------------------------*\n"); - fprintf(stderr, - "* *\n"); - fprintf(stderr, - "* iLBC test program *\n"); - fprintf(stderr, - "* *\n"); - fprintf(stderr, - "* *\n"); - fprintf(stderr, - "*---------------------------------------------------*\n"); - fprintf(stderr,"\nMode : %2d ms\n", mode); - fprintf(stderr,"Input file : %s\n", argv[2]); - fprintf(stderr,"Encoded file : %s\n", argv[3]); - fprintf(stderr,"Output file : %s\n", argv[4]); - if (argc==6) { - fprintf(stderr,"Channel file : %s\n", argv[5]); - } - fprintf(stderr,"\n"); - - /* Initialization */ - - initEncode(&Enc_Inst, mode); - initDecode(&Dec_Inst, mode, 1); - - /* Runtime statistics */ - - starttime=clock()/(float)CLOCKS_PER_SEC; - - /* loop over input blocks */ - - while (fread(data,sizeof(short),Enc_Inst.blockl,ifileid)== - Enc_Inst.blockl) { - - blockcount++; - - /* encoding */ - - - - - - fprintf(stderr, "--- Encoding block %i --- ",blockcount); - len=encode(&Enc_Inst, encoded_data, data); - fprintf(stderr, "\r"); - - /* write byte file */ - - fwrite(encoded_data, sizeof(unsigned char), len, efileid); - - /* get channel data if provided */ - if (argc==6) { - if (fread(&pli, sizeof(short), 1, cfileid)) { - if ((pli!=0)&&(pli!=1)) { - fprintf(stderr, "Error in channel file\n"); - exit(0); - } - if (pli==0) { - /* Packet loss -> remove info from frame */ - memset(encoded_data, 0, - sizeof(short)*ILBCNOOFWORDS_MAX); - packetlosscount++; - } - } else { - fprintf(stderr, "Error. Channel file too short\n"); - exit(0); - } - } else { - pli=1; - } - - /* decoding */ - - fprintf(stderr, "--- Decoding block %i --- ",blockcount); - - len=decode(&Dec_Inst, decoded_data, encoded_data, pli); - fprintf(stderr, "\r"); - - /* write output file */ - - fwrite(decoded_data,sizeof(short),len,ofileid); - } - - /* Runtime statistics */ - - runtime = (float)(clock()/(float)CLOCKS_PER_SEC-starttime); - outtime = (float)((float)blockcount*(float)mode/1000.0); - printf("\n\nLength of speech file: %.1f s\n", outtime); - printf("Packet loss : %.1f%%\n", - 100.0*(float)packetlosscount/(float)blockcount); - - - - - - printf("Time to run iLBC :"); - printf(" %.1f s (%.1f %% of realtime)\n\n", runtime, - (100*runtime/outtime)); - - /* close files */ - - fclose(ifileid); fclose(efileid); fclose(ofileid); - if (argc==6) { - fclose(cfileid); - } - return(0); - } - diff --git a/sflphone-common/src/audio/codecs/ilbc/lsf.c b/sflphone-common/src/audio/codecs/ilbc/lsf.c deleted file mode 100644 index b4fe0eda3de10394e21f49209f7342d049a3f386..0000000000000000000000000000000000000000 --- a/sflphone-common/src/audio/codecs/ilbc/lsf.c +++ /dev/null @@ -1,283 +0,0 @@ - - /****************************************************************** - - iLBC Speech Coder ANSI-C Source Code - - lsf.c - - Copyright (C) The Internet Society (2004). - All Rights Reserved. - - ******************************************************************/ - - #include <string.h> - - - - - - #include <math.h> - - #include "iLBC_define.h" - - /*----------------------------------------------------------------* - * conversion from lpc coefficients to lsf coefficients - *---------------------------------------------------------------*/ - - void a2lsf( - float *freq,/* (o) lsf coefficients */ - float *a /* (i) lpc coefficients */ - ){ - float steps[LSF_NUMBER_OF_STEPS] = - {(float)0.00635, (float)0.003175, (float)0.0015875, - (float)0.00079375}; - float step; - int step_idx; - int lsp_index; - float p[LPC_HALFORDER]; - float q[LPC_HALFORDER]; - float p_pre[LPC_HALFORDER]; - float q_pre[LPC_HALFORDER]; - float old_p, old_q, *old; - float *pq_coef; - float omega, old_omega; - int i; - float hlp, hlp1, hlp2, hlp3, hlp4, hlp5; - - for (i=0; i<LPC_HALFORDER; i++) { - p[i] = (float)-1.0 * (a[i + 1] + a[LPC_FILTERORDER - i]); - q[i] = a[LPC_FILTERORDER - i] - a[i + 1]; - } - - p_pre[0] = (float)-1.0 - p[0]; - p_pre[1] = - p_pre[0] - p[1]; - p_pre[2] = - p_pre[1] - p[2]; - p_pre[3] = - p_pre[2] - p[3]; - p_pre[4] = - p_pre[3] - p[4]; - p_pre[4] = p_pre[4] / 2; - - q_pre[0] = (float)1.0 - q[0]; - q_pre[1] = q_pre[0] - q[1]; - q_pre[2] = q_pre[1] - q[2]; - q_pre[3] = q_pre[2] - q[3]; - q_pre[4] = q_pre[3] - q[4]; - q_pre[4] = q_pre[4] / 2; - - omega = 0.0; - - - - - - old_omega = 0.0; - - old_p = FLOAT_MAX; - old_q = FLOAT_MAX; - - /* Here we loop through lsp_index to find all the - LPC_FILTERORDER roots for omega. */ - - for (lsp_index = 0; lsp_index<LPC_FILTERORDER; lsp_index++) { - - /* Depending on lsp_index being even or odd, we - alternatively solve the roots for the two LSP equations. */ - - - if ((lsp_index & 0x1) == 0) { - pq_coef = p_pre; - old = &old_p; - } else { - pq_coef = q_pre; - old = &old_q; - } - - /* Start with low resolution grid */ - - for (step_idx = 0, step = steps[step_idx]; - step_idx < LSF_NUMBER_OF_STEPS;){ - - /* cos(10piw) + pq(0)cos(8piw) + pq(1)cos(6piw) + - pq(2)cos(4piw) + pq(3)cod(2piw) + pq(4) */ - - hlp = (float)cos(omega * TWO_PI); - hlp1 = (float)2.0 * hlp + pq_coef[0]; - hlp2 = (float)2.0 * hlp * hlp1 - (float)1.0 + - pq_coef[1]; - hlp3 = (float)2.0 * hlp * hlp2 - hlp1 + pq_coef[2]; - hlp4 = (float)2.0 * hlp * hlp3 - hlp2 + pq_coef[3]; - hlp5 = hlp * hlp4 - hlp3 + pq_coef[4]; - - - if (((hlp5 * (*old)) <= 0.0) || (omega >= 0.5)){ - - if (step_idx == (LSF_NUMBER_OF_STEPS - 1)){ - - if (fabs(hlp5) >= fabs(*old)) { - freq[lsp_index] = omega - step; - } else { - freq[lsp_index] = omega; - } - - - - - - - - if ((*old) >= 0.0){ - *old = (float)-1.0 * FLOAT_MAX; - } else { - *old = FLOAT_MAX; - } - - omega = old_omega; - step_idx = 0; - - step_idx = LSF_NUMBER_OF_STEPS; - } else { - - if (step_idx == 0) { - old_omega = omega; - } - - step_idx++; - omega -= steps[step_idx]; - - /* Go back one grid step */ - - step = steps[step_idx]; - } - } else { - - /* increment omega until they are of different sign, - and we know there is at least one root between omega - and old_omega */ - *old = hlp5; - omega += step; - } - } - } - - for (i = 0; i<LPC_FILTERORDER; i++) { - freq[i] = freq[i] * TWO_PI; - } - } - - /*----------------------------------------------------------------* - * conversion from lsf coefficients to lpc coefficients - *---------------------------------------------------------------*/ - - void lsf2a( - float *a_coef, /* (o) lpc coefficients */ - float *freq /* (i) lsf coefficients */ - - - - - - ){ - int i, j; - float hlp; - float p[LPC_HALFORDER], q[LPC_HALFORDER]; - float a[LPC_HALFORDER + 1], a1[LPC_HALFORDER], - a2[LPC_HALFORDER]; - float b[LPC_HALFORDER + 1], b1[LPC_HALFORDER], - b2[LPC_HALFORDER]; - - for (i=0; i<LPC_FILTERORDER; i++) { - freq[i] = freq[i] * PI2; - } - - /* Check input for ill-conditioned cases. This part is not - found in the TIA standard. It involves the following 2 IF - blocks. If "freq" is judged ill-conditioned, then we first - modify freq[0] and freq[LPC_HALFORDER-1] (normally - LPC_HALFORDER = 10 for LPC applications), then we adjust - the other "freq" values slightly */ - - - if ((freq[0] <= 0.0) || (freq[LPC_FILTERORDER - 1] >= 0.5)){ - - - if (freq[0] <= 0.0) { - freq[0] = (float)0.022; - } - - - if (freq[LPC_FILTERORDER - 1] >= 0.5) { - freq[LPC_FILTERORDER - 1] = (float)0.499; - } - - hlp = (freq[LPC_FILTERORDER - 1] - freq[0]) / - (float) (LPC_FILTERORDER - 1); - - for (i=1; i<LPC_FILTERORDER; i++) { - freq[i] = freq[i - 1] + hlp; - } - } - - memset(a1, 0, LPC_HALFORDER*sizeof(float)); - memset(a2, 0, LPC_HALFORDER*sizeof(float)); - memset(b1, 0, LPC_HALFORDER*sizeof(float)); - memset(b2, 0, LPC_HALFORDER*sizeof(float)); - memset(a, 0, (LPC_HALFORDER+1)*sizeof(float)); - memset(b, 0, (LPC_HALFORDER+1)*sizeof(float)); - - - - - - - /* p[i] and q[i] compute cos(2*pi*omega_{2j}) and - cos(2*pi*omega_{2j-1} in eqs. 4.2.2.2-1 and 4.2.2.2-2. - Note that for this code p[i] specifies the coefficients - used in .Q_A(z) while q[i] specifies the coefficients used - in .P_A(z) */ - - for (i=0; i<LPC_HALFORDER; i++) { - p[i] = (float)cos(TWO_PI * freq[2 * i]); - q[i] = (float)cos(TWO_PI * freq[2 * i + 1]); - } - - a[0] = 0.25; - b[0] = 0.25; - - for (i= 0; i<LPC_HALFORDER; i++) { - a[i + 1] = a[i] - 2 * p[i] * a1[i] + a2[i]; - b[i + 1] = b[i] - 2 * q[i] * b1[i] + b2[i]; - a2[i] = a1[i]; - a1[i] = a[i]; - b2[i] = b1[i]; - b1[i] = b[i]; - } - - for (j=0; j<LPC_FILTERORDER; j++) { - - if (j == 0) { - a[0] = 0.25; - b[0] = -0.25; - } else { - a[0] = b[0] = 0.0; - } - - for (i=0; i<LPC_HALFORDER; i++) { - a[i + 1] = a[i] - 2 * p[i] * a1[i] + a2[i]; - b[i + 1] = b[i] - 2 * q[i] * b1[i] + b2[i]; - a2[i] = a1[i]; - a1[i] = a[i]; - b2[i] = b1[i]; - b1[i] = b[i]; - } - - a_coef[j + 1] = 2 * (a[LPC_HALFORDER] + b[LPC_HALFORDER]); - } - - a_coef[0] = 1.0; - } - - - - - - - diff --git a/sflphone-common/src/audio/codecs/ilbc/lsf.h b/sflphone-common/src/audio/codecs/ilbc/lsf.h deleted file mode 100644 index caff77ec0d6fd3428297f5fd07efa98b23788088..0000000000000000000000000000000000000000 --- a/sflphone-common/src/audio/codecs/ilbc/lsf.h +++ /dev/null @@ -1,27 +0,0 @@ - - /****************************************************************** - - iLBC Speech Coder ANSI-C Source Code - - lsf.h - - Copyright (C) The Internet Society (2004). - All Rights Reserved. - - ******************************************************************/ - - #ifndef __iLBC_LSF_H - #define __iLBC_LSF_H - - void a2lsf( - float *freq,/* (o) lsf coefficients */ - float *a /* (i) lpc coefficients */ - ); - - void lsf2a( - float *a_coef, /* (o) lpc coefficients */ - float *freq /* (i) lsf coefficients */ - ); - - #endif - diff --git a/sflphone-common/src/audio/codecs/ilbc/packing.c b/sflphone-common/src/audio/codecs/ilbc/packing.c deleted file mode 100644 index b7496a48eaa72f3034e53936a7d022be12fc79e7..0000000000000000000000000000000000000000 --- a/sflphone-common/src/audio/codecs/ilbc/packing.c +++ /dev/null @@ -1,182 +0,0 @@ - - /****************************************************************** - - iLBC Speech Coder ANSI-C Source Code - - packing.c - - Copyright (C) The Internet Society (2004). - All Rights Reserved. - - ******************************************************************/ - - #include <math.h> - #include <stdlib.h> - - #include "iLBC_define.h" - #include "constants.h" - #include "helpfun.h" - #include "string.h" - - /*----------------------------------------------------------------* - * splitting an integer into first most significant bits and - * remaining least significant bits - *---------------------------------------------------------------*/ - - void packsplit( - int *index, /* (i) the value to split */ - int *firstpart, /* (o) the value specified by most - significant bits */ - int *rest, /* (o) the value specified by least - significant bits */ - - - - - - int bitno_firstpart, /* (i) number of bits in most - significant part */ - int bitno_total /* (i) number of bits in full range - of value */ - ){ - int bitno_rest = bitno_total-bitno_firstpart; - - *firstpart = *index>>(bitno_rest); - *rest = *index-(*firstpart<<(bitno_rest)); - } - - /*----------------------------------------------------------------* - * combining a value corresponding to msb's with a value - * corresponding to lsb's - *---------------------------------------------------------------*/ - - void packcombine( - int *index, /* (i/o) the msb value in the - combined value out */ - int rest, /* (i) the lsb value */ - int bitno_rest /* (i) the number of bits in the - lsb part */ - ){ - *index = *index<<bitno_rest; - *index += rest; - } - - /*----------------------------------------------------------------* - * packing of bits into bitstream, i.e., vector of bytes - *---------------------------------------------------------------*/ - - void dopack( - unsigned char **bitstream, /* (i/o) on entrance pointer to - place in bitstream to pack - new data, on exit pointer - to place in bitstream to - pack future data */ - int index, /* (i) the value to pack */ - int bitno, /* (i) the number of bits that the - value will fit within */ - int *pos /* (i/o) write position in the - current byte */ - ){ - int posLeft; - - /* Clear the bits before starting in a new byte */ - - if ((*pos)==0) { - - - - - - **bitstream=0; - } - - while (bitno>0) { - - /* Jump to the next byte if end of this byte is reached*/ - - if (*pos==8) { - *pos=0; - (*bitstream)++; - **bitstream=0; - } - - posLeft=8-(*pos); - - /* Insert index into the bitstream */ - - if (bitno <= posLeft) { - **bitstream |= (unsigned char)(index<<(posLeft-bitno)); - *pos+=bitno; - bitno=0; - } else { - **bitstream |= (unsigned char)(index>>(bitno-posLeft)); - - *pos=8; - index-=((index>>(bitno-posLeft))<<(bitno-posLeft)); - - bitno-=posLeft; - } - } - } - - /*----------------------------------------------------------------* - * unpacking of bits from bitstream, i.e., vector of bytes - *---------------------------------------------------------------*/ - - void unpack( - unsigned char **bitstream, /* (i/o) on entrance pointer to - place in bitstream to - unpack new data from, on - exit pointer to place in - bitstream to unpack future - data from */ - int *index, /* (o) resulting value */ - int bitno, /* (i) number of bits used to - represent the value */ - int *pos /* (i/o) read position in the - current byte */ - - - - - - ){ - int BitsLeft; - - *index=0; - - while (bitno>0) { - - /* move forward in bitstream when the end of the - byte is reached */ - - if (*pos==8) { - *pos=0; - (*bitstream)++; - } - - BitsLeft=8-(*pos); - - /* Extract bits to index */ - - if (BitsLeft>=bitno) { - *index+=((((**bitstream)<<(*pos)) & 0xFF)>>(8-bitno)); - - *pos+=bitno; - bitno=0; - } else { - - if ((8-bitno)>0) { - *index+=((((**bitstream)<<(*pos)) & 0xFF)>> - (8-bitno)); - *pos=8; - } else { - *index+=(((int)(((**bitstream)<<(*pos)) & 0xFF))<< - (bitno-8)); - *pos=8; - } - bitno-=BitsLeft; - } - } - } - diff --git a/sflphone-common/src/audio/codecs/ilbc/packing.h b/sflphone-common/src/audio/codecs/ilbc/packing.h deleted file mode 100644 index cbb9f82dfd24411a2edc41c843b2f4f9ad046e23..0000000000000000000000000000000000000000 --- a/sflphone-common/src/audio/codecs/ilbc/packing.h +++ /dev/null @@ -1,68 +0,0 @@ - - /****************************************************************** - - iLBC Speech Coder ANSI-C Source Code - - packing.h - - Copyright (C) The Internet Society (2004). - All Rights Reserved. - - ******************************************************************/ - - #ifndef __PACKING_H - #define __PACKING_H - - void packsplit( - int *index, /* (i) the value to split */ - int *firstpart, /* (o) the value specified by most - significant bits */ - int *rest, /* (o) the value specified by least - significant bits */ - int bitno_firstpart, /* (i) number of bits in most - significant part */ - int bitno_total /* (i) number of bits in full range - of value */ - ); - - void packcombine( - int *index, /* (i/o) the msb value in the - combined value out */ - int rest, /* (i) the lsb value */ - int bitno_rest /* (i) the number of bits in the - lsb part */ - ); - - void dopack( - unsigned char **bitstream, /* (i/o) on entrance pointer to - place in bitstream to pack - new data, on exit pointer - to place in bitstream to - pack future data */ - int index, /* (i) the value to pack */ - int bitno, /* (i) the number of bits that the - value will fit within */ - int *pos /* (i/o) write position in the - current byte */ - ); - - - - - - void unpack( - unsigned char **bitstream, /* (i/o) on entrance pointer to - place in bitstream to - unpack new data from, on - exit pointer to place in - bitstream to unpack future - data from */ - int *index, /* (o) resulting value */ - int bitno, /* (i) number of bits used to - represent the value */ - int *pos /* (i/o) read position in the - current byte */ - ); - - #endif - diff --git a/sflphone-common/src/audio/codecs/ilbc/syntFilter.c b/sflphone-common/src/audio/codecs/ilbc/syntFilter.c deleted file mode 100644 index 190eb009db7029d1cc5bfe8740d5fe153c0d5da0..0000000000000000000000000000000000000000 --- a/sflphone-common/src/audio/codecs/ilbc/syntFilter.c +++ /dev/null @@ -1,80 +0,0 @@ - - /****************************************************************** - - iLBC Speech Coder ANSI-C Source Code - - syntFilter.c - - Copyright (C) The Internet Society (2004). - All Rights Reserved. - - ******************************************************************/ - - #include "iLBC_define.h" - - /*----------------------------------------------------------------* - * LP synthesis filter. - *---------------------------------------------------------------*/ - - void syntFilter( - float *Out, /* (i/o) Signal to be filtered */ - float *a, /* (i) LP parameters */ - int len, /* (i) Length of signal */ - - - - - - float *mem /* (i/o) Filter state */ - ){ - int i, j; - float *po, *pi, *pa, *pm; - - po=Out; - - /* Filter first part using memory from past */ - - for (i=0; i<LPC_FILTERORDER; i++) { - pi=&Out[i-1]; - pa=&a[1]; - pm=&mem[LPC_FILTERORDER-1]; - for (j=1; j<=i; j++) { - *po-=(*pa++)*(*pi--); - } - for (j=i+1; j<LPC_FILTERORDER+1; j++) { - *po-=(*pa++)*(*pm--); - } - po++; - } - - /* Filter last part where the state is entirely in - the output vector */ - - for (i=LPC_FILTERORDER; i<len; i++) { - pi=&Out[i-1]; - pa=&a[1]; - for (j=1; j<LPC_FILTERORDER+1; j++) { - *po-=(*pa++)*(*pi--); - } - po++; - } - - /* Update state vector */ - - memcpy(mem, &Out[len-LPC_FILTERORDER], - LPC_FILTERORDER*sizeof(float)); - } - - - - - - - - - - - - - - diff --git a/sflphone-common/src/audio/codecs/ilbc/syntFilter.h b/sflphone-common/src/audio/codecs/ilbc/syntFilter.h deleted file mode 100644 index 8865b8917fa97c43326ab1d908ea3a13c68fbddb..0000000000000000000000000000000000000000 --- a/sflphone-common/src/audio/codecs/ilbc/syntFilter.h +++ /dev/null @@ -1,24 +0,0 @@ - - /****************************************************************** - - iLBC Speech Coder ANSI-C Source Code - - syntFilter.h - - Copyright (C) The Internet Society (2004). - All Rights Reserved. - - ******************************************************************/ - - #ifndef __iLBC_SYNTFILTER_H - #define __iLBC_SYNTFILTER_H - - void syntFilter( - float *Out, /* (i/o) Signal to be filtered */ - float *a, /* (i) LP parameters */ - int len, /* (i) Length of signal */ - float *mem /* (i/o) Filter state */ - ); - - #endif - diff --git a/sflphone-common/src/audio/codecs/speexcodec_nb.cpp b/sflphone-common/src/audio/codecs/speexcodec_nb.cpp index 22089f0454c7f7654de0a4c3f57275c1056dfda4..60d86bb129ab6a71c9cef59db97e88ec257b6138 100644 --- a/sflphone-common/src/audio/codecs/speexcodec_nb.cpp +++ b/sflphone-common/src/audio/codecs/speexcodec_nb.cpp @@ -23,50 +23,51 @@ #include <speex/speex.h> #include <speex/speex_preprocess.h> -class Speex : public AudioCodec{ +class Speex : public AudioCodec +{ + public: - Speex(int payload=0) - : AudioCodec(payload, "speex"), - _speexModePtr(NULL), - _speex_dec_bits(), - _speex_enc_bits(), - _speex_dec_state(), - _speex_enc_state(), - _speex_frame_size(), - _preprocess_state() - { - _clockRate = 8000; - _frameSize = 160; // samples, 20 ms at 8kHz - _channel = 1; - _bitrate = 0; - _bandwidth = 0; - initSpeex(); - } - - Speex( const Speex& ); - Speex& operator=(const Speex&); - - void initSpeex() { - - int _samplingRate = 8000; + Speex (int payload=0) + : AudioCodec (payload, "speex"), + _speexModePtr (NULL), + _speex_dec_bits(), + _speex_enc_bits(), + _speex_dec_state(), + _speex_enc_state(), + _speex_frame_size(), + _preprocess_state() { + _clockRate = 8000; + _frameSize = 160; // samples, 20 ms at 8kHz + _channel = 1; + _bitrate = 0; + _bandwidth = 0; + initSpeex(); + } + + Speex (const Speex&); + Speex& operator= (const Speex&); + + void initSpeex() { + + int _samplingRate = 8000; // 8000 HZ --> Narrow-band mode // TODO Manage the other modes - _speexModePtr = &speex_nb_mode; - // _speexModePtr = &speex_wb_mode; + _speexModePtr = &speex_nb_mode; + // _speexModePtr = &speex_wb_mode; // Init the decoder struct - speex_bits_init(&_speex_dec_bits); - _speex_dec_state = speex_decoder_init(_speexModePtr); + speex_bits_init (&_speex_dec_bits); + _speex_dec_state = speex_decoder_init (_speexModePtr); // Init the encoder struct - speex_bits_init(&_speex_enc_bits); - _speex_enc_state = speex_encoder_init(_speexModePtr); + speex_bits_init (&_speex_enc_bits); + _speex_enc_state = speex_encoder_init (_speexModePtr); + + speex_encoder_ctl (_speex_enc_state,SPEEX_SET_SAMPLING_RATE,&_clockRate); - speex_encoder_ctl(_speex_enc_state,SPEEX_SET_SAMPLING_RATE,&_clockRate); + speex_decoder_ctl (_speex_dec_state, SPEEX_GET_FRAME_SIZE, &_speex_frame_size); - speex_decoder_ctl(_speex_dec_state, SPEEX_GET_FRAME_SIZE, &_speex_frame_size); - #ifdef HAVE_SPEEXDSP_LIB int enable = 1; @@ -74,62 +75,61 @@ class Speex : public AudioCodec{ int complex = 10; int attenuation = -10; - speex_encoder_ctl(_speex_enc_state, SPEEX_SET_VAD, &enable); - speex_encoder_ctl(_speex_enc_state, SPEEX_SET_DTX, &enable); - speex_encoder_ctl(_speex_enc_state, SPEEX_SET_VBR_QUALITY, &quality); - speex_encoder_ctl(_speex_enc_state, SPEEX_SET_COMPLEXITY, &complex); + speex_encoder_ctl (_speex_enc_state, SPEEX_SET_VAD, &enable); + speex_encoder_ctl (_speex_enc_state, SPEEX_SET_DTX, &enable); + speex_encoder_ctl (_speex_enc_state, SPEEX_SET_VBR_QUALITY, &quality); + speex_encoder_ctl (_speex_enc_state, SPEEX_SET_COMPLEXITY, &complex); // Init the decoder struct - speex_decoder_ctl(_speex_dec_state, SPEEX_GET_FRAME_SIZE, &_speex_frame_size); + speex_decoder_ctl (_speex_dec_state, SPEEX_GET_FRAME_SIZE, &_speex_frame_size); // Init the preprocess struct - _preprocess_state = speex_preprocess_state_init(_speex_frame_size,_clockRate); - speex_preprocess_ctl(_preprocess_state, SPEEX_PREPROCESS_SET_DENOISE, &enable); - speex_preprocess_ctl(_preprocess_state, SPEEX_PREPROCESS_SET_NOISE_SUPPRESS, &attenuation); - speex_preprocess_ctl(_preprocess_state, SPEEX_PREPROCESS_SET_VAD, &enable); - speex_preprocess_ctl(_preprocess_state, SPEEX_PREPROCESS_SET_AGC, &enable); + _preprocess_state = speex_preprocess_state_init (_speex_frame_size,_clockRate); + speex_preprocess_ctl (_preprocess_state, SPEEX_PREPROCESS_SET_DENOISE, &enable); + speex_preprocess_ctl (_preprocess_state, SPEEX_PREPROCESS_SET_NOISE_SUPPRESS, &attenuation); + speex_preprocess_ctl (_preprocess_state, SPEEX_PREPROCESS_SET_VAD, &enable); + speex_preprocess_ctl (_preprocess_state, SPEEX_PREPROCESS_SET_AGC, &enable); #endif - + } - ~Speex() - { + ~Speex() { terminateSpeex(); } void terminateSpeex() { // Destroy the decoder struct - speex_bits_destroy(&_speex_dec_bits); - speex_decoder_destroy(_speex_dec_state); + speex_bits_destroy (&_speex_dec_bits); + speex_decoder_destroy (_speex_dec_state); _speex_dec_state = 0; // Destroy the encoder struct - speex_bits_destroy(&_speex_enc_bits); - speex_encoder_destroy(_speex_enc_state); + speex_bits_destroy (&_speex_enc_bits); + speex_encoder_destroy (_speex_enc_state); _speex_enc_state = 0; } - virtual int codecDecode (short *dst, unsigned char *src, unsigned int size) - { - + virtual int codecDecode (short *dst, unsigned char *src, unsigned int size) { + int ratio = 320 / _speex_frame_size; - speex_bits_read_from(&_speex_dec_bits, (char*)src, size); - speex_decode_int(_speex_dec_state, &_speex_dec_bits, dst); + speex_bits_read_from (&_speex_dec_bits, (char*) src, size); + speex_decode_int (_speex_dec_state, &_speex_dec_bits, dst); - return _speex_frame_size * ratio; + return _speex_frame_size * ratio; } - virtual int codecEncode (unsigned char *dst, short *src, unsigned int size) - { - speex_bits_reset(&_speex_enc_bits); + virtual int codecEncode (unsigned char *dst, short *src, unsigned int size) { + speex_bits_reset (&_speex_enc_bits); #ifdef HAVE_SPEEXDSP_LIB - - speex_preprocess_run(_preprocess_state, src); -#endif - speex_encode_int(_speex_enc_state, src, &_speex_enc_bits); - int nbBytes = speex_bits_write(&_speex_enc_bits, (char*)dst, size); + speex_preprocess_run (_preprocess_state, src); +#endif + + + speex_encode_int (_speex_enc_state, src, &_speex_enc_bits); + int nbBytes = speex_bits_write (&_speex_enc_bits, (char*) dst, size); + return nbBytes; } @@ -144,11 +144,13 @@ class Speex : public AudioCodec{ }; // the class factories -extern "C" AudioCodec* create() { - return new Speex(110); +extern "C" AudioCodec* create() +{ + return new Speex (110); } -extern "C" void destroy(AudioCodec* a) { +extern "C" void destroy (AudioCodec* a) +{ delete a; } diff --git a/sflphone-common/src/audio/codecs/speexcodec_ub.cpp b/sflphone-common/src/audio/codecs/speexcodec_ub.cpp new file mode 100644 index 0000000000000000000000000000000000000000..05c6dec9eb94e5418afc949e2e256d92443e9e6c --- /dev/null +++ b/sflphone-common/src/audio/codecs/speexcodec_ub.cpp @@ -0,0 +1,158 @@ +/* + * Copyright (C) 2007-2009 Savoir-Faire Linux inc. + * Author: Alexandre Savard <alexandre.savard@savoirfairelinux.com> + * Author: Emmanuel Milou <emmanuel.milou@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 + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include "audiocodec.h" +#include <cstdio> +#include <speex/speex.h> +#include <speex/speex_preprocess.h> + +class Speex : public AudioCodec +{ + + public: + Speex (int payload=0) + : AudioCodec (payload, "speex"), + _speexModePtr (NULL), + _speex_dec_bits(), + _speex_enc_bits(), + _speex_dec_state(), + _speex_enc_state(), + _speex_frame_size(), + _preprocess_state() { + _clockRate = 32000; + _frameSize = 320; // 10 ms at 32 kHz + _channel = 1; + _bitrate = 0; + _bandwidth = 0; + initSpeex(); + } + + Speex (const Speex&); + Speex& operator= (const Speex&); + + void initSpeex() { + + // int _samplingRate = 32000; + + // 8000 HZ --> Narrow-band mode + // TODO Manage the other modes + _speexModePtr = &speex_wb_mode; + // _speexModePtr = &speex_wb_mode; + + // Init the decoder struct + speex_bits_init (&_speex_dec_bits); + _speex_dec_state = speex_decoder_init (_speexModePtr); + + // Init the encoder struct + speex_bits_init (&_speex_enc_bits); + _speex_enc_state = speex_encoder_init (_speexModePtr); + + speex_encoder_ctl (_speex_enc_state,SPEEX_SET_SAMPLING_RATE,&_clockRate); + + speex_decoder_ctl (_speex_dec_state, SPEEX_GET_FRAME_SIZE, &_speex_frame_size); + +#ifdef HAVE_SPEEXDSP_LIB + + int enable = 1; + int quality = 10; + int complex = 10; + int attenuation = -10; + + speex_encoder_ctl (_speex_enc_state, SPEEX_SET_VAD, &enable); + speex_encoder_ctl (_speex_enc_state, SPEEX_SET_DTX, &enable); + // speex_encoder_ctl(_speex_enc_state, SPEEX_SET_VBR_QUALITY, &quality); + speex_encoder_ctl (_speex_enc_state, SPEEX_SET_COMPLEXITY, &complex); + + // Init the decoder struct + speex_decoder_ctl (_speex_dec_state, SPEEX_GET_FRAME_SIZE, &_speex_frame_size); + + // Init the preprocess struct + _preprocess_state = speex_preprocess_state_init (_speex_frame_size,_clockRate); + speex_preprocess_ctl (_preprocess_state, SPEEX_PREPROCESS_SET_DENOISE, &enable); + speex_preprocess_ctl (_preprocess_state, SPEEX_PREPROCESS_SET_NOISE_SUPPRESS, &attenuation); + speex_preprocess_ctl (_preprocess_state, SPEEX_PREPROCESS_SET_VAD, &enable); + speex_preprocess_ctl (_preprocess_state, SPEEX_PREPROCESS_SET_AGC, &enable); +#endif + + } + + ~Speex() { + terminateSpeex(); + } + + void terminateSpeex() { + // Destroy the decoder struct + speex_bits_destroy (&_speex_dec_bits); + speex_decoder_destroy (_speex_dec_state); + _speex_dec_state = 0; + + // Destroy the encoder struct + speex_bits_destroy (&_speex_enc_bits); + speex_encoder_destroy (_speex_enc_state); + _speex_enc_state = 0; + } + + virtual int codecDecode (short *dst, unsigned char *src, unsigned int size) { + + // int ratio = 320 / _speex_frame_size; + speex_bits_read_from (&_speex_dec_bits, (char*) src, size); + speex_decode_int (_speex_dec_state, &_speex_dec_bits, dst); + + // return the nuber of byte, not the number of sample + return _speex_frame_size * 2; + } + + virtual int codecEncode (unsigned char *dst, short *src, unsigned int size) { + speex_bits_reset (&_speex_enc_bits); + +#ifdef HAVE_SPEEXDSP_LIB + + speex_preprocess_run (_preprocess_state, src); +#endif + + + speex_encode_int (_speex_enc_state, src, &_speex_enc_bits); + speex_bits_nbytes (&_speex_enc_bits); + int nbBytes = speex_bits_write (&_speex_enc_bits, (char*) dst, size); + + return nbBytes; + } + + private: + const SpeexMode* _speexModePtr; + SpeexBits _speex_dec_bits; + SpeexBits _speex_enc_bits; + void *_speex_dec_state; + void *_speex_enc_state; + int _speex_frame_size; + SpeexPreprocessState *_preprocess_state; +}; + +// the class factories +extern "C" AudioCodec* create() +{ + return new Speex (112); +} + +extern "C" void destroy (AudioCodec* a) +{ + delete a; +} + diff --git a/sflphone-common/src/audio/codecs/speexcodec_wb.cpp b/sflphone-common/src/audio/codecs/speexcodec_wb.cpp index 81d27bbcb0eebee7d7a75687bf82c0a8e410b9b6..065609ceea8fd60736324b27fd1cada9c42d6108 100644 --- a/sflphone-common/src/audio/codecs/speexcodec_wb.cpp +++ b/sflphone-common/src/audio/codecs/speexcodec_wb.cpp @@ -23,50 +23,51 @@ #include <speex/speex.h> #include <speex/speex_preprocess.h> -class Speex : public AudioCodec{ +class Speex : public AudioCodec +{ + public: - Speex(int payload=0) - : AudioCodec(payload, "speex"), - _speexModePtr(NULL), - _speex_dec_bits(), - _speex_enc_bits(), - _speex_dec_state(), - _speex_enc_state(), - _speex_frame_size(), - _preprocess_state() - { - _clockRate = 16000; - _frameSize = 320; // 20 ms at 16 kHz - _channel = 1; - _bitrate = 0; - _bandwidth = 0; - initSpeex(); - } - - Speex( const Speex& ); - Speex& operator=(const Speex&); - - void initSpeex() { - - int _samplingRate = 16000; + Speex (int payload=0) + : AudioCodec (payload, "speex"), + _speexModePtr (NULL), + _speex_dec_bits(), + _speex_enc_bits(), + _speex_dec_state(), + _speex_enc_state(), + _speex_frame_size(), + _preprocess_state() { + _clockRate = 16000; + _frameSize = 320; // 20 ms at 16 kHz + _channel = 1; + _bitrate = 0; + _bandwidth = 0; + initSpeex(); + } + + Speex (const Speex&); + Speex& operator= (const Speex&); + + void initSpeex() { + + int _samplingRate = 16000; // 8000 HZ --> Narrow-band mode // TODO Manage the other modes - _speexModePtr = &speex_wb_mode; - // _speexModePtr = &speex_wb_mode; + _speexModePtr = &speex_wb_mode; + // _speexModePtr = &speex_wb_mode; // Init the decoder struct - speex_bits_init(&_speex_dec_bits); - _speex_dec_state = speex_decoder_init(_speexModePtr); + speex_bits_init (&_speex_dec_bits); + _speex_dec_state = speex_decoder_init (_speexModePtr); // Init the encoder struct - speex_bits_init(&_speex_enc_bits); - _speex_enc_state = speex_encoder_init(_speexModePtr); + speex_bits_init (&_speex_enc_bits); + _speex_enc_state = speex_encoder_init (_speexModePtr); + + speex_encoder_ctl (_speex_enc_state,SPEEX_SET_SAMPLING_RATE,&_clockRate); - speex_encoder_ctl(_speex_enc_state,SPEEX_SET_SAMPLING_RATE,&_clockRate); + speex_decoder_ctl (_speex_dec_state, SPEEX_GET_FRAME_SIZE, &_speex_frame_size); - speex_decoder_ctl(_speex_dec_state, SPEEX_GET_FRAME_SIZE, &_speex_frame_size); - #ifdef HAVE_SPEEXDSP_LIB int enable = 1; @@ -74,63 +75,62 @@ class Speex : public AudioCodec{ int complex = 10; int attenuation = -10; - speex_encoder_ctl(_speex_enc_state, SPEEX_SET_VAD, &enable); - speex_encoder_ctl(_speex_enc_state, SPEEX_SET_DTX, &enable); - speex_encoder_ctl(_speex_enc_state, SPEEX_SET_VBR_QUALITY, &quality); - speex_encoder_ctl(_speex_enc_state, SPEEX_SET_COMPLEXITY, &complex); + speex_encoder_ctl (_speex_enc_state, SPEEX_SET_VAD, &enable); + speex_encoder_ctl (_speex_enc_state, SPEEX_SET_DTX, &enable); + speex_encoder_ctl (_speex_enc_state, SPEEX_SET_VBR_QUALITY, &quality); + speex_encoder_ctl (_speex_enc_state, SPEEX_SET_COMPLEXITY, &complex); // Init the decoder struct - speex_decoder_ctl(_speex_dec_state, SPEEX_GET_FRAME_SIZE, &_speex_frame_size); + speex_decoder_ctl (_speex_dec_state, SPEEX_GET_FRAME_SIZE, &_speex_frame_size); // Init the preprocess struct - _preprocess_state = speex_preprocess_state_init(_speex_frame_size,_clockRate); - speex_preprocess_ctl(_preprocess_state, SPEEX_PREPROCESS_SET_DENOISE, &enable); - speex_preprocess_ctl(_preprocess_state, SPEEX_PREPROCESS_SET_NOISE_SUPPRESS, &attenuation); - speex_preprocess_ctl(_preprocess_state, SPEEX_PREPROCESS_SET_VAD, &enable); - speex_preprocess_ctl(_preprocess_state, SPEEX_PREPROCESS_SET_AGC, &enable); + _preprocess_state = speex_preprocess_state_init (_speex_frame_size,_clockRate); + speex_preprocess_ctl (_preprocess_state, SPEEX_PREPROCESS_SET_DENOISE, &enable); + speex_preprocess_ctl (_preprocess_state, SPEEX_PREPROCESS_SET_NOISE_SUPPRESS, &attenuation); + speex_preprocess_ctl (_preprocess_state, SPEEX_PREPROCESS_SET_VAD, &enable); + speex_preprocess_ctl (_preprocess_state, SPEEX_PREPROCESS_SET_AGC, &enable); #endif - + } - ~Speex() - { + ~Speex() { terminateSpeex(); } void terminateSpeex() { // Destroy the decoder struct - speex_bits_destroy(&_speex_dec_bits); - speex_decoder_destroy(_speex_dec_state); + speex_bits_destroy (&_speex_dec_bits); + speex_decoder_destroy (_speex_dec_state); _speex_dec_state = 0; // Destroy the encoder struct - speex_bits_destroy(&_speex_enc_bits); - speex_encoder_destroy(_speex_enc_state); + speex_bits_destroy (&_speex_enc_bits); + speex_encoder_destroy (_speex_enc_state); _speex_enc_state = 0; } - virtual int codecDecode (short *dst, unsigned char *src, unsigned int size) - { - + virtual int codecDecode (short *dst, unsigned char *src, unsigned int size) { + int ratio = 320 / _speex_frame_size; - speex_bits_read_from(&_speex_dec_bits, (char*)src, size); - speex_decode_int(_speex_dec_state, &_speex_dec_bits, dst); - return 2 * _speex_frame_size * ratio; + speex_bits_read_from (&_speex_dec_bits, (char*) src, size); + speex_decode_int (_speex_dec_state, &_speex_dec_bits, dst); + + return 2 * _speex_frame_size * ratio; } - virtual int codecEncode (unsigned char *dst, short *src, unsigned int size) - { - speex_bits_reset(&_speex_enc_bits); + virtual int codecEncode (unsigned char *dst, short *src, unsigned int size) { + speex_bits_reset (&_speex_enc_bits); #ifdef HAVE_SPEEXDSP_LIB - - speex_preprocess_run(_preprocess_state, src); -#endif - speex_encode_int(_speex_enc_state, src, &_speex_enc_bits); - int nbBytes = speex_bits_write(&_speex_enc_bits, (char*)dst, size); - printf("Codec::codecEncode() nbBytes: %i \n",nbBytes); + speex_preprocess_run (_preprocess_state, src); +#endif + + printf ("Codec::codecEncode() size %i\n", size); + speex_encode_int (_speex_enc_state, src, &_speex_enc_bits); + int nbBytes = speex_bits_write (&_speex_enc_bits, (char*) dst, size); + printf ("Codec::codecEncode() nbBytes %i\n", nbBytes); return nbBytes; } @@ -145,11 +145,13 @@ class Speex : public AudioCodec{ }; // the class factories -extern "C" AudioCodec* create() { - return new Speex(111); +extern "C" AudioCodec* create() +{ + return new Speex (111); } -extern "C" void destroy(AudioCodec* a) { +extern "C" void destroy (AudioCodec* a) +{ delete a; } diff --git a/sflphone-common/src/audio/codecs/ulaw.cpp b/sflphone-common/src/audio/codecs/ulaw.cpp index 588ff212ca5a5de2cf1ade09f5f85ecfa5442fc3..9b619c31eccf80b1e6b946c08a911c4759bfa911 100644 --- a/sflphone-common/src/audio/codecs/ulaw.cpp +++ b/sflphone-common/src/audio/codecs/ulaw.cpp @@ -7,12 +7,12 @@ * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. @@ -23,100 +23,105 @@ #include "../common.h" #include "audiocodec.h" -class Ulaw : public AudioCodec { -public: - // 0 PCMU A 8000 1 [RFC3551] - Ulaw(int payload=0) - : AudioCodec(payload, "PCMU") - { - _clockRate = 8000; - _frameSize = 160; // samples, 20 ms at 8kHz - _channel = 1; - _bitrate = 64; - _bandwidth = 80; - } - - virtual int codecDecode (short *dst, unsigned char *src, unsigned int size) { - // _debug("Decoded by ulaw"); - int16* end = dst+size; - while(dst<end) - *dst++ = ULawDecode(*src++); - return size<<1; - } - - virtual int codecEncode (unsigned char *dst, short *src, unsigned int size) { - // _debug("Encoded by ulaw \n"); - size >>= 1; - uint8* end = dst+size; - while(dst<end) - *dst++ = ULawEncode(*src++); - return size; - } - - int ULawDecode(uint8 ulaw) - { - ulaw ^= 0xff; // u-law has all bits inverted for transmission - int linear = ulaw&0x0f; - linear <<= 3; - linear |= 0x84; // Set MSB (0x80) and a 'half' bit (0x04) to place PCM value in middle of range - - uint shift = ulaw>>4; - shift &= 7; - linear <<= shift; - linear -= 0x84; // Subract uLaw bias - - if(ulaw&0x80) - return -linear; - else - return linear; - } - - uint8 ULawEncode(int16 pcm16) - { - int p = pcm16; - uint u; // u-law value we are forming - - if(p<0) - { - p = ~p; - u = 0x80^0x10^0xff; // Sign bit = 1 (^0x10 because this will get inverted later) ^0xff ^0xff to invert final u-Law code - } - else{ - u = 0x00^0x10^0xff; // Sign bit = 0 (-0x10 because this amount extra will get added later) ^0xff to invert final u-Law code - } - - p += 0x84; // Add uLaw bias - - if(p>0x7f00) - p = 0x7f00; // Clip to 15 bits - // Calculate segment and interval numbers - p >>= 3; // Shift down to 13bit - if(p>=0x100) - { - p >>= 4; - u ^= 0x40; - } - if(p>=0x40) - { - p >>= 2; - u ^= 0x20; - } - if(p>=0x20) - { - p >>= 1; - u ^= 0x10; - } - u ^= p; // u now equal to encoded u-law value (with all bits inverted) - - return u; - } +class Ulaw : public AudioCodec +{ + + public: + // 0 PCMU A 8000 1 [RFC3551] + Ulaw (int payload=0) + : AudioCodec (payload, "PCMU") { + _clockRate = 8000; + _frameSize = 160; // samples, 20 ms at 8kHz + _channel = 1; + _bitrate = 64; + _bandwidth = 80; + } + + virtual int codecDecode (short *dst, unsigned char *src, unsigned int size) { + // _debug("Decoded by ulaw"); + int16* end = dst+size; + + while (dst<end) + *dst++ = ULawDecode (*src++); + + return size<<1; + } + + virtual int codecEncode (unsigned char *dst, short *src, unsigned int size) { + // _debug("Encoded by ulaw \n"); + size >>= 1; + uint8* end = dst+size; + + while (dst<end) + *dst++ = ULawEncode (*src++); + + return size; + } + + int ULawDecode (uint8 ulaw) { + ulaw ^= 0xff; // u-law has all bits inverted for transmission + int linear = ulaw&0x0f; + linear <<= 3; + linear |= 0x84; // Set MSB (0x80) and a 'half' bit (0x04) to place PCM value in middle of range + + uint shift = ulaw>>4; + shift &= 7; + linear <<= shift; + linear -= 0x84; // Subract uLaw bias + + if (ulaw&0x80) + return -linear; + else + return linear; + } + + uint8 ULawEncode (int16 pcm16) { + int p = pcm16; + uint u; // u-law value we are forming + + if (p<0) { + p = ~p; + u = 0x80^0x10^0xff; // Sign bit = 1 (^0x10 because this will get inverted later) ^0xff ^0xff to invert final u-Law code + } else { + u = 0x00^0x10^0xff; // Sign bit = 0 (-0x10 because this amount extra will get added later) ^0xff to invert final u-Law code + } + + p += 0x84; // Add uLaw bias + + if (p>0x7f00) + p = 0x7f00; // Clip to 15 bits + + // Calculate segment and interval numbers + p >>= 3; // Shift down to 13bit + + if (p>=0x100) { + p >>= 4; + u ^= 0x40; + } + + if (p>=0x40) { + p >>= 2; + u ^= 0x20; + } + + if (p>=0x20) { + p >>= 1; + u ^= 0x10; + } + + u ^= p; // u now equal to encoded u-law value (with all bits inverted) + + return u; + } }; // the class factories -extern "C" AudioCodec* create() { - return new Ulaw(0); +extern "C" AudioCodec* create() +{ + return new Ulaw (0); } -extern "C" void destroy(AudioCodec* a) { +extern "C" void destroy (AudioCodec* a) +{ delete a; } diff --git a/sflphone-common/src/audio/dtmf.cpp b/sflphone-common/src/audio/dtmf.cpp index c6ba907aae2cd16c24d38b581fd05318c25a8fd7..22fc94b952947b9fafada8642cc341504500bc5f 100644 --- a/sflphone-common/src/audio/dtmf.cpp +++ b/sflphone-common/src/audio/dtmf.cpp @@ -1,21 +1,21 @@ /* * Copyright (C) 2004-2006 Savoir-Faire Linux inc. * Author : Yan Morin <yan.morin@savoirfairelinux.com> - * Author : Laurielle Lea <laurielle.lea@savoirfairelinux.com> + * Author : Laurielle Lea <laurielle.lea@savoirfairelinux.com> * * Portions Copyright (c) 2000 Billy Biggs <bbiggs@div8.net> * Portions Copyright (c) 2004 Wirlab <kphone@wirlab.net> - * + * * 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 * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. @@ -23,56 +23,57 @@ #include "dtmf.h" -DTMF::DTMF (unsigned int sampleRate) -: currentTone(0), newTone(0), dtmfgenerator(sampleRate) +DTMF::DTMF (unsigned int sampleRate) + : currentTone (0), newTone (0), dtmfgenerator (sampleRate) { } -DTMF::~DTMF (void) +DTMF::~DTMF (void) { } -void -DTMF::startTone (char code) +void +DTMF::startTone (char code) { - newTone = code; + newTone = code; } -bool -DTMF::generateDTMF (SFLDataFormat* buffer, size_t n) +bool +DTMF::generateDTMF (SFLDataFormat* buffer, size_t n) { - if (!buffer) return false; + if (!buffer) return false; + + try { + if (currentTone != 0) { + // Currently generating a DTMF tone + if (currentTone == newTone) { + // Continue generating the same tone + dtmfgenerator.getNextSamples (buffer, n); + return true; + } else if (newTone != 0) { + // New tone requested + dtmfgenerator.getSamples (buffer, n, newTone); + currentTone = newTone; + return true; + } else { + // Stop requested + currentTone = newTone; + return false; + } + } else { + // Not generating any DTMF tone + if (newTone) { + // Requested to generate a DTMF tone + dtmfgenerator.getSamples (buffer, n, newTone); + currentTone = newTone; + return true; + } - try { - if (currentTone != 0) { - // Currently generating a DTMF tone - if (currentTone == newTone) { - // Continue generating the same tone - dtmfgenerator.getNextSamples(buffer, n); - return true; - } else if (newTone != 0) { - // New tone requested - dtmfgenerator.getSamples(buffer, n, newTone); - currentTone = newTone; - return true; - } else { - // Stop requested - currentTone = newTone; + return false; + } + } catch (DTMFException e) { + // invalid key return false; - } - } else { - // Not generating any DTMF tone - if (newTone) { - // Requested to generate a DTMF tone - dtmfgenerator.getSamples(buffer, n, newTone); - currentTone = newTone; - return true; - } - return false; } - } catch(DTMFException e) { - // invalid key - return false; - } } diff --git a/sflphone-common/src/audio/dtmfgenerator.cpp b/sflphone-common/src/audio/dtmfgenerator.cpp index f35f1e50ace125f943a921ba25d0068dccd3214a..da6e7f0c1c32befe67ae3838be87f4e124e14355 100644 --- a/sflphone-common/src/audio/dtmfgenerator.cpp +++ b/sflphone-common/src/audio/dtmfgenerator.cpp @@ -1,7 +1,7 @@ /* * Copyright (C) 2004-2005 Savoir-Faire Linux inc. * Author: Yan Morin <yan.morin@savoirfairelinux.com> - * Author: Laurielle Lea <laurielle.lea@savoirfairelinux.com> + * Author: Laurielle Lea <laurielle.lea@savoirfairelinux.com> * * Portions (c) 2003 iptel.org * @@ -9,12 +9,12 @@ * under the terms of the GNU Library General Public License as published by * the Free Software Foundation; either version 3 of the License, or (at your * option) any later version. - * + * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public * License for more details. - * + * * You should have received a copy of the GNU Library General Public License * along with this library; see the file COPYING.LIB. If not, write to the * Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, @@ -32,26 +32,26 @@ * Tone frequencies */ const DTMFGenerator::DTMFTone DTMFGenerator::tones[NUM_TONES] = { - {'0', 941, 1336}, - {'1', 697, 1209}, - {'2', 697, 1336}, - {'3', 697, 1477}, - {'4', 770, 1209}, - {'5', 770, 1336}, - {'6', 770, 1477}, - {'7', 852, 1209}, - {'8', 852, 1336}, - {'9', 852, 1477}, - {'A', 697, 1633}, - {'B', 770, 1633}, - {'C', 852, 1633}, - {'D', 941, 1633}, - {'*', 941, 1209}, - {'#', 941, 1477} + {'0', 941, 1336}, + {'1', 697, 1209}, + {'2', 697, 1336}, + {'3', 697, 1477}, + {'4', 770, 1209}, + {'5', 770, 1336}, + {'6', 770, 1477}, + {'7', 852, 1209}, + {'8', 852, 1336}, + {'9', 852, 1477}, + {'A', 697, 1633}, + {'B', 770, 1633}, + {'C', 852, 1633}, + {'D', 941, 1633}, + {'*', 941, 1209}, + {'#', 941, 1477} }; -DTMFException::DTMFException(const char* _reason) throw() : reason(_reason) +DTMFException::DTMFException (const char* _reason) throw() : reason (_reason) { } @@ -62,7 +62,7 @@ DTMFException::~DTMFException() throw() const char* DTMFException::what() const throw() { - return reason; + return reason; } @@ -70,64 +70,121 @@ const char* DTMFException::what() const throw() /* * Initialize the generator */ -DTMFGenerator::DTMFGenerator(unsigned int sampleRate) : state(), _sampleRate(sampleRate), tone("", sampleRate) +DTMFGenerator::DTMFGenerator (unsigned int sampleRate) : state(), _sampleRate (sampleRate), tone ("", sampleRate) { - state.offset = 0; - state.sample = 0; + state.offset = 0; + state.sample = 0; - for(int i = 0; i < NUM_TONES; i++) { - samples[i] = generateSample(i); - } + for (int i = 0; i < NUM_TONES; i++) { + samples[i] = generateSample (i); + } } - -DTMFGenerator::~DTMFGenerator() { - for(int i = 0; i < NUM_TONES; i++) { - delete[] samples[i]; samples[i] = NULL; - } + +DTMFGenerator::~DTMFGenerator() +{ + for (int i = 0; i < NUM_TONES; i++) { + delete[] samples[i]; + samples[i] = NULL; + } } /* * Get n samples of the signal of code code */ -void DTMFGenerator::getSamples(SFLDataFormat* buffer, size_t n, unsigned char code) throw(DTMFException) { - size_t i; - if (!buffer) { - throw DTMFException("Invalid parameter value"); - } - - switch(code) { - case '0': state.sample = samples[0]; break; - case '1': state.sample = samples[1]; break; - case '2': state.sample = samples[2]; break; - case '3': state.sample = samples[3]; break; - case '4': state.sample = samples[4]; break; - case '5': state.sample = samples[5]; break; - case '6': state.sample = samples[6]; break; - case '7': state.sample = samples[7]; break; - case '8': state.sample = samples[8]; break; - case '9': state.sample = samples[9]; break; - case 'A': - case 'a': state.sample = samples[10]; break; - case 'B': - case 'b': state.sample = samples[11]; break; - case 'C': - case 'c': state.sample = samples[12]; break; - case 'D': - case 'd': state.sample = samples[13]; break; - case '*': state.sample = samples[14]; break; - case '#': state.sample = samples[15]; break; - default: - throw DTMFException("Invalid code"); - return; - break; - } - - for(i = 0; i < n; i++) { - buffer[i] = state.sample[i % _sampleRate]; - } - - state.offset = i % _sampleRate; +void DTMFGenerator::getSamples (SFLDataFormat* buffer, size_t n, unsigned char code) throw (DTMFException) +{ + size_t i; + + if (!buffer) { + throw DTMFException ("Invalid parameter value"); + } + + switch (code) { + + case '0': + state.sample = samples[0]; + break; + + case '1': + state.sample = samples[1]; + break; + + case '2': + state.sample = samples[2]; + break; + + case '3': + state.sample = samples[3]; + break; + + case '4': + state.sample = samples[4]; + break; + + case '5': + state.sample = samples[5]; + break; + + case '6': + state.sample = samples[6]; + break; + + case '7': + state.sample = samples[7]; + break; + + case '8': + state.sample = samples[8]; + break; + + case '9': + state.sample = samples[9]; + break; + + case 'A': + + case 'a': + state.sample = samples[10]; + break; + + case 'B': + + case 'b': + state.sample = samples[11]; + break; + + case 'C': + + case 'c': + state.sample = samples[12]; + break; + + case 'D': + + case 'd': + state.sample = samples[13]; + break; + + case '*': + state.sample = samples[14]; + break; + + case '#': + state.sample = samples[15]; + break; + + default: + throw DTMFException ("Invalid code"); + return; + break; + } + + for (i = 0; i < n; i++) { + buffer[i] = state.sample[i % _sampleRate]; + } + + state.offset = i % _sampleRate; } @@ -135,45 +192,47 @@ void DTMFGenerator::getSamples(SFLDataFormat* buffer, size_t n, unsigned char co * Get next n samples (continues where previous call to * genSample or genNextSamples stopped */ -void DTMFGenerator::getNextSamples(SFLDataFormat* buffer, size_t n) throw(DTMFException) +void DTMFGenerator::getNextSamples (SFLDataFormat* buffer, size_t n) throw (DTMFException) { - size_t i; + size_t i; - if (!buffer) { - throw DTMFException("Invalid parameter"); - } + if (!buffer) { + throw DTMFException ("Invalid parameter"); + } - if (state.sample == 0) { - throw DTMFException("DTMF generator not initialized"); - } + if (state.sample == 0) { + throw DTMFException ("DTMF generator not initialized"); + } - for(i = 0; i < n; i++) { - buffer[i] = state.sample[(state.offset + i) % _sampleRate]; - } - - state.offset = (state.offset + i) % _sampleRate; + for (i = 0; i < n; i++) { + buffer[i] = state.sample[ (state.offset + i) % _sampleRate]; + } + + state.offset = (state.offset + i) % _sampleRate; } /* * Generate a tone sample */ -SFLDataFormat* DTMFGenerator::generateSample(unsigned char code) throw (DTMFException) { - SFLDataFormat* ptr; - - try { - ptr = new SFLDataFormat[_sampleRate]; - if (!ptr) { - throw new DTMFException("No memory left"); - return 0; - } - - tone.genSin(ptr, tones[code].higher, tones[code].lower, _sampleRate); - - return ptr; - } catch(...) { - throw new DTMFException("No memory left"); - return 0; - } +SFLDataFormat* DTMFGenerator::generateSample (unsigned char code) throw (DTMFException) +{ + SFLDataFormat* ptr; + + try { + ptr = new SFLDataFormat[_sampleRate]; + + if (!ptr) { + throw new DTMFException ("No memory left"); + return 0; + } + + tone.genSin (ptr, tones[code].higher, tones[code].lower, _sampleRate); + + return ptr; + } catch (...) { + throw new DTMFException ("No memory left"); + return 0; + } } diff --git a/sflphone-common/src/audio/pulselayer.cpp b/sflphone-common/src/audio/pulselayer.cpp index fd71c8473568e414169c5be2eb3cd498f71fb2e9..9d586d2041301be4440f6631b55335459a95c87c 100644 --- a/sflphone-common/src/audio/pulselayer.cpp +++ b/sflphone-common/src/audio/pulselayer.cpp @@ -23,282 +23,307 @@ int framesPerBuffer = 2048; int PulseLayer::streamState; -static void audioCallback ( pa_stream* s, size_t bytes, void* userdata ) -{ - assert( s && bytes ); - assert( bytes > 0 ); - static_cast<PulseLayer*>(userdata)->processData(); +static void audioCallback (pa_stream* s, size_t bytes, void* userdata) +{ + assert (s && bytes); + assert (bytes > 0); + static_cast<PulseLayer*> (userdata)->processData(); } - PulseLayer::PulseLayer(ManagerImpl* manager) - : AudioLayer( manager , PULSEAUDIO ) - , context(NULL) - , m(NULL) - , playback() - , record() +PulseLayer::PulseLayer (ManagerImpl* manager) + : AudioLayer (manager , PULSEAUDIO) + , context (NULL) + , m (NULL) + , playback() + , record() { PulseLayer::streamState = 0; - _debug("PulseLayer::Pulse audio constructor: Create context\n"); - + _debug ("PulseLayer::Pulse audio constructor: Create context\n"); + } // Destructor -PulseLayer::~PulseLayer (void) -{ +PulseLayer::~PulseLayer (void) +{ closeLayer (); - // pa_context_disconnect( context ); + // pa_context_disconnect( context ); // pa_context_unref( context ); } bool -PulseLayer::closeLayer( void ) -{ - _debug("PulseLayer::closeLayer :: Destroy pulselayer\n"); +PulseLayer::closeLayer (void) +{ + _debug ("PulseLayer::closeLayer :: Destroy pulselayer\n"); - playback->disconnectStream(); + playback->disconnectStream(); record->disconnectStream(); - while(PulseLayer::streamState != 2); - PulseLayer::streamState = 0; + while (PulseLayer::streamState != 2); + + PulseLayer::streamState = 0; //TODO Remove this ugly hack - sleep(2); + sleep (2); - pa_context_disconnect( context ); - pa_context_unref( context ); + pa_context_disconnect (context); + + pa_context_unref (context); return true; } void -PulseLayer::connectPulseAudioServer( void ) +PulseLayer::connectPulseAudioServer (void) { - _debug("PulseLayer::connectPulseAudioServer \n"); - pa_context_flags_t flag = PA_CONTEXT_NOAUTOSPAWN ; + _debug ("PulseLayer::connectPulseAudioServer \n"); + pa_context_flags_t flag = PA_CONTEXT_NOAUTOSPAWN ; - pa_threaded_mainloop_lock( m ); + pa_threaded_mainloop_lock (m); - _debug("Connect the context to the server\n"); - pa_context_connect( context, NULL , flag , NULL ); + _debug ("Connect the context to the server\n"); + pa_context_connect (context, NULL , flag , NULL); - pa_context_set_state_callback(context, context_state_callback, this); - pa_threaded_mainloop_wait( m ); + pa_context_set_state_callback (context, context_state_callback, this); + pa_threaded_mainloop_wait (m); // Run the main loop - if( pa_context_get_state( context ) != PA_CONTEXT_READY ){ - _debug("Error connecting to pulse audio server\n"); - pa_threaded_mainloop_unlock( m ); + + if (pa_context_get_state (context) != PA_CONTEXT_READY) { + _debug ("Error connecting to pulse audio server\n"); + pa_threaded_mainloop_unlock (m); } - pa_threaded_mainloop_unlock( m ); + pa_threaded_mainloop_unlock (m); + //serverinfo(); //muteAudioApps(99); - _debug("Context creation done\n"); + _debug ("Context creation done\n"); } -void PulseLayer::context_state_callback( pa_context* c, void* user_data ) +void PulseLayer::context_state_callback (pa_context* c, void* user_data) { - _debug("PulseLayer::context_state_callback ::The state of the context changed\n"); - PulseLayer* pulse = (PulseLayer*)user_data; - assert(c && pulse->m); - switch(pa_context_get_state(c)){ + _debug ("PulseLayer::context_state_callback ::The state of the context changed\n"); + PulseLayer* pulse = (PulseLayer*) user_data; + assert (c && pulse->m); + + switch (pa_context_get_state (c)) { + case PA_CONTEXT_CONNECTING: + case PA_CONTEXT_AUTHORIZING: + case PA_CONTEXT_SETTING_NAME: - _debug("Waiting....\n"); + _debug ("Waiting....\n"); break; + case PA_CONTEXT_READY: - pulse->createStreams( c ); - _debug("Connection to PulseAudio server established\n"); - + pulse->createStreams (c); + _debug ("Connection to PulseAudio server established\n"); + break; + case PA_CONTEXT_TERMINATED: - _debug("Context terminated\n"); + _debug ("Context terminated\n"); break; + case PA_CONTEXT_FAILED: + default: - _debug(" Error : %s\n" , pa_strerror(pa_context_errno(c))); + _debug (" Error : %s\n" , pa_strerror (pa_context_errno (c))); pulse->disconnectPulseAudioServer(); - exit(0); + exit (0); break; } } -bool PulseLayer::disconnectPulseAudioServer( void ) +bool PulseLayer::disconnectPulseAudioServer (void) { - _debug(" PulseLayer::disconnectPulseAudioServer( void ) \n"); + _debug (" PulseLayer::disconnectPulseAudioServer( void ) \n"); - if( playback ){ - // playback->disconnectStream(); - delete playback; playback=NULL; + if (playback) { + // playback->disconnectStream(); + delete playback; + playback=NULL; } - if( record ){ - // record->disconnectStream(); - delete record; record=NULL; + + if (record) { + // record->disconnectStream(); + delete record; + record=NULL; } + if (!playback && !record) - return true; + return true; else - return false; + return false; } -bool PulseLayer::createStreams( pa_context* c ) +bool PulseLayer::createStreams (pa_context* c) { - _debug("PulseLayer::createStreams \n"); - - playback = new AudioStream(c, PLAYBACK_STREAM, PLAYBACK_STREAM_NAME, _manager->getSpkrVolume()); + _debug ("PulseLayer::createStreams \n"); + + playback = new AudioStream (c, PLAYBACK_STREAM, PLAYBACK_STREAM_NAME, _manager->getSpkrVolume()); playback->connectStream(); - pa_stream_set_write_callback( playback->pulseStream(), audioCallback, this); + pa_stream_set_write_callback (playback->pulseStream(), audioCallback, this); // pa_stream_set_overflow_callback( playback->pulseStream() , overflow , this); // pa_stream_set_suspended_callback( playback->pulseStream(), stream_suspended_callback, this); - - record = new AudioStream(c, CAPTURE_STREAM, CAPTURE_STREAM_NAME , _manager->getMicVolume()); + + record = new AudioStream (c, CAPTURE_STREAM, CAPTURE_STREAM_NAME , _manager->getMicVolume()); record->connectStream(); - pa_stream_set_read_callback( record->pulseStream() , audioCallback, this); + pa_stream_set_read_callback (record->pulseStream() , audioCallback, this); // pa_stream_set_underflow_callback( record->pulseStream() , underflow , this); // pa_stream_set_suspended_callback(record->pulseStream(), stream_suspended_callback, this); - pa_threaded_mainloop_signal(m , 0); + pa_threaded_mainloop_signal (m , 0); + + isCorked = true; return true; } -bool PulseLayer::openDevice(int indexIn UNUSED, int indexOut UNUSED, int sampleRate, int frameSize , int stream UNUSED, std::string plugin UNUSED) +bool PulseLayer::openDevice (int indexIn UNUSED, int indexOut UNUSED, int sampleRate, int frameSize , int stream UNUSED, std::string plugin UNUSED) { - _debug("PulseLayer::openDevice \n"); + + _debug ("PulseLayer::openDevice \n"); _sampleRate = sampleRate; - _frameSize = frameSize; + _frameSize = frameSize; m = pa_threaded_mainloop_new(); - assert(m); + assert (m); - if( pa_threaded_mainloop_start( m ) < 0 ){ - _debug("Failed starting the mainloop\n"); + if (pa_threaded_mainloop_start (m) < 0) { + _debug ("Failed starting the mainloop\n"); } // Instanciate a context - if( !(context = pa_context_new( pa_threaded_mainloop_get_api( m ) , "SFLphone" ))) - _debug("Error while creating the context\n"); + if (! (context = pa_context_new (pa_threaded_mainloop_get_api (m) , "SFLphone"))) + _debug ("Error while creating the context\n"); - assert(context); + assert (context); connectPulseAudioServer(); - + // startStream(); - _debug("Connection Done!! \n"); + _debug ("Connection Done!! \n"); } -void PulseLayer::closeCaptureStream( void ) +void PulseLayer::closeCaptureStream (void) { } -void PulseLayer::closePlaybackStream( void ) -{ +void PulseLayer::closePlaybackStream (void) +{ } int PulseLayer::canGetMic() { - if( record ) + if (record) return _micRingBuffer.AvailForGet(); else return 0; } -int PulseLayer::getMic(void *buffer, int toCopy) +int PulseLayer::getMic (void *buffer, int toCopy) { - if( record ){ - return _micRingBuffer.Get(buffer, toCopy, 100); - } - else + if (record) { + return _micRingBuffer.Get (buffer, toCopy, 100); + } else return 0; } -void PulseLayer::startStream (void) +void PulseLayer::startStream (void) { - flushMic(); - _debug("PulseLayer::Start stream\n"); - pa_threaded_mainloop_lock(m); - - pa_stream_cork( playback->pulseStream(), 0, NULL, NULL); - pa_stream_cork( record->pulseStream(), 0, NULL, NULL); - - pa_threaded_mainloop_unlock(m); + _debug ("PulseLayer::Start stream\n"); + _urgentRingBuffer.flush(); + _micRingBuffer.flush(); + _voiceRingBuffer.flush(); + + pa_threaded_mainloop_lock (m); + + pa_stream_cork (playback->pulseStream(), 0, NULL, NULL); + pa_stream_cork (record->pulseStream(), 0, NULL, NULL); + + pa_threaded_mainloop_unlock (m); + + isCorked = false; } - void -PulseLayer::stopStream (void) +void +PulseLayer::stopStream (void) { - _debug("PulseLayer::Stop stream\n"); - //pa_stream_flush( playback->pulseStream(), NULL, NULL ); - //pa_stream_flush( record->pulseStream(), NULL, NULL ); - - + + _debug ("PulseLayer::Stop stream\n"); + pa_stream_flush (playback->pulseStream(), NULL, NULL); + pa_stream_flush (record->pulseStream(), NULL, NULL); + flushMic(); flushMain(); flushUrgent(); - pa_stream_cork( playback->pulseStream(), 1, NULL, NULL); - pa_stream_cork( record->pulseStream(), 1, NULL, NULL); + pa_stream_cork (playback->pulseStream(), 1, NULL, NULL); + pa_stream_cork (record->pulseStream(), 1, NULL, NULL); + + isCorked = true; + } -void PulseLayer::underflow ( pa_stream* s UNUSED, void* userdata UNUSED ) -{ - _debug("PulseLayer::Buffer Underflow\n"); +void PulseLayer::underflow (pa_stream* s UNUSED, void* userdata UNUSED) +{ + _debug ("PulseLayer::Buffer Underflow\n"); } -void PulseLayer::overflow ( pa_stream* s, void* userdata UNUSED ) -{ +void PulseLayer::overflow (pa_stream* s, void* userdata UNUSED) +{ //PulseLayer* pulse = (PulseLayer*) userdata; - pa_stream_drop( s ); - pa_stream_trigger( s, NULL, NULL); + pa_stream_drop (s); + pa_stream_trigger (s, NULL, NULL); } -void PulseLayer::stream_suspended_callback(pa_stream *s, void *userdata UNUSED ) +void PulseLayer::stream_suspended_callback (pa_stream *s, void *userdata UNUSED) { - + } -void PulseLayer::processData( void ) +void PulseLayer::processData (void) { - - // Handle the mic - // We check if the stream is ready - if( (record->pulseStream()) && (pa_stream_get_state( record->pulseStream()) == PA_STREAM_READY)) - readFromMic(); + // Handle the mic + // We check if the stream is ready + if ( (record->pulseStream()) && (pa_stream_get_state (record->pulseStream()) == PA_STREAM_READY)) + readFromMic(); + + // _debug("PulseLayer::processData() playback->pulseStream() \n"); - // _debug("PulseLayer::processData() playback->pulseStream() \n"); - - // Handle the data for the speakers - if( (playback->pulseStream()) && (pa_stream_get_state( playback->pulseStream()) == PA_STREAM_READY)){ + // Handle the data for the speakers + if ( (playback->pulseStream()) && (pa_stream_get_state (playback->pulseStream()) == PA_STREAM_READY)) { // If the playback buffer is full, we don't overflow it; wait for it to have free space - if( pa_stream_writable_size(playback->pulseStream()) == 0 ) + if (pa_stream_writable_size (playback->pulseStream()) == 0) return; - + writeToSpeaker(); } } -void PulseLayer::writeToSpeaker( void ) -{ +void PulseLayer::writeToSpeaker (void) +{ /** Bytes available in the urgent ringbuffer ( reserved for DTMF ) */ - int urgentAvail; + int urgentAvail; /** Bytes available in the regular ringbuffer ( reserved for voice ) */ - int normalAvail; + int normalAvail; int toGet; int toPlay; @@ -306,104 +331,106 @@ void PulseLayer::writeToSpeaker( void ) urgentAvail = _urgentRingBuffer.AvailForGet(); if (urgentAvail > 0) { - // Urgent data (dtmf, incoming call signal) come first. + // Urgent data (dtmf, incoming call signal) come first. //_debug("Play urgent!: %i\e" , urgentAvail); - toGet = (urgentAvail < (int)(framesPerBuffer * sizeof(SFLDataFormat))) ? urgentAvail : framesPerBuffer * sizeof(SFLDataFormat); - out = (SFLDataFormat*)pa_xmalloc(toGet * sizeof(SFLDataFormat) ); - _urgentRingBuffer.Get(out, toGet, 100); - pa_stream_write( playback->pulseStream() , out , toGet , pa_xfree, 0 , PA_SEEK_RELATIVE); + toGet = (urgentAvail < (int) (framesPerBuffer * sizeof (SFLDataFormat))) ? urgentAvail : framesPerBuffer * sizeof (SFLDataFormat); + out = (SFLDataFormat*) pa_xmalloc (toGet * sizeof (SFLDataFormat)); + _urgentRingBuffer.Get (out, toGet, 100); + pa_stream_write (playback->pulseStream() , out , toGet , pa_xfree, 0 , PA_SEEK_RELATIVE); // Consume the regular one as well (same amount of bytes) - _voiceRingBuffer.Discard(toGet); - } - else - { + _voiceRingBuffer.Discard (toGet); + } else { AudioLoop* tone = _manager->getTelephoneTone(); - if ( tone != 0) { + + if (tone != 0) { toGet = framesPerBuffer; - out = (SFLDataFormat*)pa_xmalloc(toGet * sizeof(SFLDataFormat) ); - tone->getNext(out, toGet , 100); - pa_stream_write( playback->pulseStream() , out , toGet * sizeof(SFLDataFormat) , pa_xfree, 0 , PA_SEEK_RELATIVE); - } - if ( (tone=_manager->getTelephoneFile()) != 0 ) { + out = (SFLDataFormat*) pa_xmalloc (toGet * sizeof (SFLDataFormat)); + tone->getNext (out, toGet , 100); + pa_stream_write (playback->pulseStream() , out , toGet * sizeof (SFLDataFormat) , pa_xfree, 0 , PA_SEEK_RELATIVE); + } + + if ( (tone=_manager->getTelephoneFile()) != 0) { toGet = framesPerBuffer; - toPlay = ( (int)(toGet * sizeof(SFLDataFormat)) > framesPerBuffer )? framesPerBuffer : toGet * sizeof(SFLDataFormat) ; - out = (SFLDataFormat*)pa_xmalloc(toPlay); - tone->getNext(out, toPlay/2 , 100); - pa_stream_write( playback->pulseStream() , out , toPlay , pa_xfree, 0 , PA_SEEK_RELATIVE) ; - } - else { - out = (SFLDataFormat*)pa_xmalloc(framesPerBuffer * sizeof(SFLDataFormat)); + toPlay = ( (int) (toGet * sizeof (SFLDataFormat)) > framesPerBuffer) ? framesPerBuffer : toGet * sizeof (SFLDataFormat) ; + out = (SFLDataFormat*) pa_xmalloc (toPlay); + tone->getNext (out, toPlay/2 , 100); + pa_stream_write (playback->pulseStream() , out , toPlay , pa_xfree, 0 , PA_SEEK_RELATIVE) ; + } else { + out = (SFLDataFormat*) pa_xmalloc (framesPerBuffer * sizeof (SFLDataFormat)); normalAvail = _voiceRingBuffer.AvailForGet(); - toGet = (normalAvail < (int)(framesPerBuffer * sizeof(SFLDataFormat))) ? normalAvail : framesPerBuffer * sizeof(SFLDataFormat); + toGet = (normalAvail < (int) (framesPerBuffer * sizeof (SFLDataFormat))) ? normalAvail : framesPerBuffer * sizeof (SFLDataFormat); + if (toGet) { - _voiceRingBuffer.Get(out, toGet, 100); - _voiceRingBuffer.Discard(toGet); - } - else { - bzero(out, framesPerBuffer * sizeof(SFLDataFormat)); + _voiceRingBuffer.Get (out, toGet, 100); + _voiceRingBuffer.Discard (toGet); + } else { + bzero (out, framesPerBuffer * sizeof (SFLDataFormat)); } - pa_stream_write( playback->pulseStream() , out , toGet , NULL, 0 , PA_SEEK_RELATIVE); - pa_xfree(out); + pa_stream_write (playback->pulseStream() , out , toGet , NULL, 0 , PA_SEEK_RELATIVE); + + pa_xfree (out); } } } -void PulseLayer::readFromMic( void ) +void PulseLayer::readFromMic (void) { const char* data; size_t r; - if( pa_stream_peek( record->pulseStream() , (const void**)&data , &r ) < 0 || !data ){ + if (pa_stream_peek (record->pulseStream() , (const void**) &data , &r) < 0 || !data) { //_debug("pa_stream_peek() failed: %s\n" , pa_strerror( pa_context_errno( context) )); } - if( data != 0 ){ - _micRingBuffer.Put( (void*)data ,r, 100); + if (data != 0) { + _micRingBuffer.Put ( (void*) data ,r, 100); } - if( pa_stream_drop( record->pulseStream() ) < 0 ) { + if (pa_stream_drop (record->pulseStream()) < 0) { //_debug("pa_stream_drop() failed: %s\n" , pa_strerror( pa_context_errno( context) )); } } -static void retrieve_server_info(pa_context *c UNUSED, const pa_server_info *i, void *userdata UNUSED) +static void retrieve_server_info (pa_context *c UNUSED, const pa_server_info *i, void *userdata UNUSED) { - _debug("Server Info: Process owner : %s\n" , i->user_name); - _debug("\t\tServer name : %s - Server version = %s\n" , i->server_name, i->server_version); - _debug("\t\tDefault sink name : %s\n" , i->default_sink_name); - _debug("\t\tDefault source name : %s\n" , i->default_source_name); + _debug ("Server Info: Process owner : %s\n" , i->user_name); + _debug ("\t\tServer name : %s - Server version = %s\n" , i->server_name, i->server_version); + _debug ("\t\tDefault sink name : %s\n" , i->default_sink_name); + _debug ("\t\tDefault source name : %s\n" , i->default_source_name); } -static void reduce_sink_list_cb(pa_context *c UNUSED, const pa_sink_input_info *i, int eol, void *userdata) +static void reduce_sink_list_cb (pa_context *c UNUSED, const pa_sink_input_info *i, int eol, void *userdata) { PulseLayer* pulse = (PulseLayer*) userdata; - if( !eol ){ - //_debug("Sink Info: index : %i\n" , i->index); - //_debug("\t\tClient : %i\n" , i->client); - //_debug("\t\tVolume : %i\n" , i->volume.values[0]); - //_debug("\t\tChannels : %i\n" , i->volume.channels); - if( strcmp( i->name , PLAYBACK_STREAM_NAME ) != 0) - pulse->setSinkVolume( i->index , i->volume.channels, 10 ); - } + + if (!eol) { + //_debug("Sink Info: index : %i\n" , i->index); + //_debug("\t\tClient : %i\n" , i->client); + //_debug("\t\tVolume : %i\n" , i->volume.values[0]); + //_debug("\t\tChannels : %i\n" , i->volume.channels); + if (strcmp (i->name , PLAYBACK_STREAM_NAME) != 0) + pulse->setSinkVolume (i->index , i->volume.channels, 10); + } } -static void restore_sink_list_cb(pa_context *c UNUSED, const pa_sink_input_info *i, int eol, void *userdata) +static void restore_sink_list_cb (pa_context *c UNUSED, const pa_sink_input_info *i, int eol, void *userdata) { PulseLayer* pulse = (PulseLayer*) userdata; - if( !eol ){ - //_debug("Sink Info: index : %i\n" , i->index); - //_debug("\t\tSink name : -%s-\n" , i->name); - //_debug("\t\tClient : %i\n" , i->client); - //_debug("\t\tVolume : %i\n" , i->volume.values[0]); - //_debug("\t\tChannels : %i\n" , i->volume.channels); - if( strcmp( i->name , PLAYBACK_STREAM_NAME ) != 0) - pulse->setSinkVolume( i->index , i->volume.channels, 100); - } + + if (!eol) { + //_debug("Sink Info: index : %i\n" , i->index); + //_debug("\t\tSink name : -%s-\n" , i->name); + //_debug("\t\tClient : %i\n" , i->client); + //_debug("\t\tVolume : %i\n" , i->volume.values[0]); + //_debug("\t\tChannels : %i\n" , i->volume.channels); + if (strcmp (i->name , PLAYBACK_STREAM_NAME) != 0) + pulse->setSinkVolume (i->index , i->volume.channels, 100); + } } -static void set_playback_volume_cb(pa_context *c UNUSED, const pa_sink_input_info *i, int eol, void *userdata) +static void set_playback_volume_cb (pa_context *c UNUSED, const pa_sink_input_info *i, int eol, void *userdata) { PulseLayer* pulse; int volume; @@ -411,13 +438,13 @@ static void set_playback_volume_cb(pa_context *c UNUSED, const pa_sink_input_inf pulse = (PulseLayer*) userdata; volume = pulse->getSpkrVolume(); - if( !eol ){ - if( strcmp( i->name , PLAYBACK_STREAM_NAME ) == 0) - pulse->setSinkVolume( i->index , i->volume.channels, volume ); - } + if (!eol) { + if (strcmp (i->name , PLAYBACK_STREAM_NAME) == 0) + pulse->setSinkVolume (i->index , i->volume.channels, volume); + } } -static void set_capture_volume_cb(pa_context *c UNUSED, const pa_source_output_info *i, int eol, void *userdata) +static void set_capture_volume_cb (pa_context *c UNUSED, const pa_source_output_info *i, int eol, void *userdata) { PulseLayer* pulse; int volume; @@ -425,65 +452,65 @@ static void set_capture_volume_cb(pa_context *c UNUSED, const pa_source_output_i pulse = (PulseLayer*) userdata; volume = pulse->getMicVolume(); - if( !eol ){ - if( strcmp( i->name , CAPTURE_STREAM_NAME ) == 0) - pulse->setSourceVolume( i->index , i->channel_map.channels, volume ); - } + if (!eol) { + if (strcmp (i->name , CAPTURE_STREAM_NAME) == 0) + pulse->setSourceVolume (i->index , i->channel_map.channels, volume); + } } - void -PulseLayer::reducePulseAppsVolume( void ) +void +PulseLayer::reducePulseAppsVolume (void) { - pa_context_get_sink_input_info_list( context , reduce_sink_list_cb , this ); + pa_context_get_sink_input_info_list (context , reduce_sink_list_cb , this); } - void -PulseLayer::restorePulseAppsVolume( void ) +void +PulseLayer::restorePulseAppsVolume (void) { - pa_context_get_sink_input_info_list( context , restore_sink_list_cb , this ); + pa_context_get_sink_input_info_list (context , restore_sink_list_cb , this); } - void -PulseLayer::serverinfo( void ) +void +PulseLayer::serverinfo (void) { - pa_context_get_server_info( context , retrieve_server_info , NULL ); + pa_context_get_server_info (context , retrieve_server_info , NULL); } -void PulseLayer::setSinkVolume( int index, int channels, int volume ) +void PulseLayer::setSinkVolume (int index, int channels, int volume) { pa_cvolume cvolume; - pa_volume_t vol = PA_VOLUME_NORM * ((double)volume / 100) ; + pa_volume_t vol = PA_VOLUME_NORM * ( (double) volume / 100) ; - pa_cvolume_set( &cvolume , channels , vol); - _debug("Set sink volume of index %i\n" , index); - pa_context_set_sink_input_volume( context, index, &cvolume, NULL, NULL) ; + pa_cvolume_set (&cvolume , channels , vol); + _debug ("Set sink volume of index %i\n" , index); + pa_context_set_sink_input_volume (context, index, &cvolume, NULL, NULL) ; } -void PulseLayer::setSourceVolume( int index, int channels, int volume ) +void PulseLayer::setSourceVolume (int index, int channels, int volume) { pa_cvolume cvolume; - pa_volume_t vol = PA_VOLUME_NORM * ((double)volume / 100) ; + pa_volume_t vol = PA_VOLUME_NORM * ( (double) volume / 100) ; - pa_cvolume_set( &cvolume , channels , vol); - _debug("Set source volume of index %i\n" , index); - pa_context_set_source_volume_by_index(context, index, &cvolume, NULL, NULL); + pa_cvolume_set (&cvolume , channels , vol); + _debug ("Set source volume of index %i\n" , index); + pa_context_set_source_volume_by_index (context, index, &cvolume, NULL, NULL); } -void PulseLayer::setPlaybackVolume( int volume ) +void PulseLayer::setPlaybackVolume (int volume) { - setSpkrVolume( volume ); - pa_context_get_sink_input_info_list( context , set_playback_volume_cb , this ); + setSpkrVolume (volume); + pa_context_get_sink_input_info_list (context , set_playback_volume_cb , this); } -void PulseLayer::setCaptureVolume( int volume ) +void PulseLayer::setCaptureVolume (int volume) { - setMicVolume( volume ); - pa_context_get_source_output_info_list( context , set_capture_volume_cb , this ); + setMicVolume (volume); + pa_context_get_source_output_info_list (context , set_capture_volume_cb , this); } diff --git a/sflphone-common/src/audio/pulselayer.h b/sflphone-common/src/audio/pulselayer.h index beae9eacc2b5b7400aca9ccd6d25a79b98dcd1c8..698cc9bf6b68b6ff7009b35efcccba3c664d2729 100644 --- a/sflphone-common/src/audio/pulselayer.h +++ b/sflphone-common/src/audio/pulselayer.h @@ -189,6 +189,8 @@ class PulseLayer : public AudioLayer { */ AudioStream* record; + bool isCorked; + int spkrVolume; int micVolume; diff --git a/sflphone-common/src/audio/ringbuffer.cpp b/sflphone-common/src/audio/ringbuffer.cpp index 52317ffffb90225e9c000a8f1da91d0cddb4228d..991ad2103ad6f642705889f6e850af87a2c0d6d4 100644 --- a/sflphone-common/src/audio/ringbuffer.cpp +++ b/sflphone-common/src/audio/ringbuffer.cpp @@ -1,179 +1,208 @@ /* * Copyright (C) 2004, 2005, 2006 Savoir-Faire Linux inc. * Author: Yan Morin <yan.morin@savoirfairelinux.com> - * Author: Laurielle Lea <laurielle.lea@savoirfairelinux.com> + * Author: Laurielle Lea <laurielle.lea@savoirfairelinux.com> * * Portions (c) Dominic Mazzoni (Audacity) - * + * * 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 * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include <assert.h> -#include <stdlib.h> -#include <string.h> +#include <stdlib.h> +#include <string.h> #include "ringbuffer.h" #include "../global.h" - + #define MIN_BUFFER_SIZE 1280 // Create a ring buffer with 'size' bytes -RingBuffer::RingBuffer(int size): mStart( 0 ), mEnd( 0 ) - , mBufferSize( size > MIN_BUFFER_SIZE ? size : MIN_BUFFER_SIZE ) - , mBuffer(NULL) +RingBuffer::RingBuffer (int size) : mStart (0), mEnd (0) + , mBufferSize (size > MIN_BUFFER_SIZE ? size : MIN_BUFFER_SIZE) + , mBuffer (NULL) { mBuffer = new unsigned char[mBufferSize]; - assert (mBuffer != NULL); + assert (mBuffer != NULL); } // Free memory on object deletion -RingBuffer::~RingBuffer() { - delete[] mBuffer; mBuffer = NULL; +RingBuffer::~RingBuffer() +{ + delete[] mBuffer; + mBuffer = NULL; } void -RingBuffer::flush (void) { - mStart = 0; - mEnd = 0; -} - -int -RingBuffer::Len() const { - return (mEnd + mBufferSize - mStart) % mBufferSize; +RingBuffer::flush (void) +{ + mStart = 0; + mEnd = 0; } -void -RingBuffer::debug() { - _debug("Start=%d; End=%d; BufferSize=%d\n", mStart, mEnd, mBufferSize); +int +RingBuffer::Len() const +{ + return (mEnd + mBufferSize - mStart) % mBufferSize; +} + +void +RingBuffer::debug() +{ + _debug ("Start=%d; End=%d; BufferSize=%d\n", mStart, mEnd, mBufferSize); } - + // // For the writer only: // -int -RingBuffer::AvailForPut() const { - // Always keep 4 bytes safe (?) - return (mBufferSize-4) - Len(); -} +int +RingBuffer::AvailForPut() const +{ + // Always keep 4 bytes safe (?) + return (mBufferSize-4) - Len(); +} // This one puts some data inside the ring buffer. // Change the volume if it's not 100 -int -RingBuffer::Put(void* buffer, int toCopy, unsigned short volume) { - samplePtr src; - int block; - int copied; - int pos; - int len = Len(); - - if (toCopy > (mBufferSize-4) - len) - toCopy = (mBufferSize-4) - len; - - src = (samplePtr) buffer; - - - copied = 0; - pos = mEnd; - - while(toCopy) { - block = toCopy; - - // Wrap block around ring ? - if (block > (mBufferSize - pos)) { - // Fill in to the end of the buffer - block = mBufferSize - pos; - } - - // Gain adjustment (when Mic vol. is changed) - if (volume != 100) { - SFLDataFormat* start = (SFLDataFormat*) src; - int nbSample = block / sizeof(SFLDataFormat); - for (int i=0; i<nbSample; i++) { start[i] = start[i] * volume / 100; } - } - - // bcopy(src, dest, len) - //fprintf(stderr, "has %d put %d\t", len, block); - bcopy (src, mBuffer + pos, block); - src += block; - pos = (pos + block) % mBufferSize; - toCopy -= block; - copied += block; - } - - mEnd = pos; - - // How many items copied. - return copied; +int +RingBuffer::Put (void* buffer, int toCopy, unsigned short volume) +{ + samplePtr src; + int block; + int copied; + int pos; + int len = Len(); + + if (toCopy > (mBufferSize-4) - len) + toCopy = (mBufferSize-4) - len; + + src = (samplePtr) buffer; + + + copied = 0; + + pos = mEnd; + + while (toCopy) { + block = toCopy; + + // Wrap block around ring ? + + if (block > (mBufferSize - pos)) { + // Fill in to the end of the buffer + block = mBufferSize - pos; + } + + // Gain adjustment (when Mic vol. is changed) + if (volume != 100) { + SFLDataFormat* start = (SFLDataFormat*) src; + int nbSample = block / sizeof (SFLDataFormat); + + for (int i=0; i<nbSample; i++) { + start[i] = start[i] * volume / 100; + } + } + + // bcopy(src, dest, len) + //fprintf(stderr, "has %d put %d\t", len, block); + bcopy (src, mBuffer + pos, block); + + src += block; + + pos = (pos + block) % mBufferSize; + + toCopy -= block; + + copied += block; + } + + mEnd = pos; + + // How many items copied. + return copied; } // // For the reader only: // -int -RingBuffer::AvailForGet() const { - // Used space - return Len(); +int +RingBuffer::AvailForGet() const +{ + // Used space + return Len(); } // Get will move 'toCopy' bytes from the internal FIFO to 'buffer' -int -RingBuffer::Get(void *buffer, int toCopy, unsigned short volume) { - samplePtr dest; - int block; - int copied; - int len = Len(); - - if (toCopy > len) - toCopy = len; - - dest = (samplePtr) buffer; - copied = 0; - - //fprintf(stderr, "G"); - while(toCopy) { - block = toCopy; - if (block > (mBufferSize - mStart)) { - block = mBufferSize - mStart; - } - - if(volume!=100) { - SFLDataFormat* start = (SFLDataFormat*)(mBuffer + mStart); - int nbSample = block / sizeof(SFLDataFormat); - for (int i=0; i<nbSample; i++) { start[i] = start[i] * volume / 100; } - } - // bcopy(src, dest, len) - bcopy (mBuffer + mStart, dest, block); - dest += block; - mStart = (mStart + block) % mBufferSize; - toCopy -= block; - copied += block; - } - - return copied; +int +RingBuffer::Get (void *buffer, int toCopy, unsigned short volume) +{ + samplePtr dest; + int block; + int copied; + int len = Len(); + + if (toCopy > len) + toCopy = len; + + dest = (samplePtr) buffer; + + copied = 0; + + //fprintf(stderr, "G"); + while (toCopy) { + block = toCopy; + + if (block > (mBufferSize - mStart)) { + block = mBufferSize - mStart; + } + + if (volume!=100) { + SFLDataFormat* start = (SFLDataFormat*) (mBuffer + mStart); + int nbSample = block / sizeof (SFLDataFormat); + + for (int i=0; i<nbSample; i++) { + start[i] = start[i] * volume / 100; + } + } + + // bcopy(src, dest, len) + bcopy (mBuffer + mStart, dest, block); + + dest += block; + + mStart = (mStart + block) % mBufferSize; + + toCopy -= block; + + copied += block; + } + + return copied; } // Used to discard some bytes. -int -RingBuffer::Discard(int toDiscard) { - int len = Len(); +int +RingBuffer::Discard (int toDiscard) +{ + int len = Len(); - if (toDiscard > len) - toDiscard = len; + if (toDiscard > len) + toDiscard = len; - mStart = (mStart + toDiscard) % mBufferSize; + mStart = (mStart + toDiscard) % mBufferSize; - return toDiscard; + return toDiscard; } diff --git a/sflphone-common/src/audio/tone.cpp b/sflphone-common/src/audio/tone.cpp index ac6cfda8b785e60b50369dc5e592e30c78185f76..d8849cbf3235ffe1db8b1c0b9daa64f41238b55e 100644 --- a/sflphone-common/src/audio/tone.cpp +++ b/sflphone-common/src/audio/tone.cpp @@ -2,10 +2,10 @@ * Copyright (C) 2005, 2006 Savoir-Faire Linux inc. * Author: Yan Morin <yan.morin@savoirfairelinux.com> * - * Inspired by tonegenerator of + * Inspired by tonegenerator of * Laurielle Lea <laurielle.lea@savoirfairelinux.com> (2004) * Inspired by ringbuffer of Audacity Project - * + * * 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 * the Free Software Foundation; either version 3 of the License, or @@ -28,102 +28,116 @@ #include <cstdlib> #include <strings.h> -Tone::Tone(const std::string& definition, unsigned int sampleRate) : AudioLoop(), _sampleRate(sampleRate) +Tone::Tone (const std::string& definition, unsigned int sampleRate) : AudioLoop(), _sampleRate (sampleRate) { - genBuffer(definition); // allocate memory with definition parameter + genBuffer (definition); // allocate memory with definition parameter } Tone::~Tone() { } -void -Tone::genBuffer(const std::string& definition) +void +Tone::genBuffer (const std::string& definition) { - if (definition.empty()) { return; } - _size = 0; + if (definition.empty()) { + return; + } - SFLDataFormat* buffer = new SFLDataFormat[SIZEBUF]; //1kb - SFLDataFormat* bufferPos = buffer; + _size = 0; - // Number of format sections - std::string::size_type posStart = 0; // position of precedent comma - std::string::size_type posEnd = 0; // position of the next comma + SFLDataFormat* buffer = new SFLDataFormat[SIZEBUF]; //1kb + SFLDataFormat* bufferPos = buffer; - std::string s; // portion of frequency - int count; // number of int for one sequence + // Number of format sections + std::string::size_type posStart = 0; // position of precedent comma + std::string::size_type posEnd = 0; // position of the next comma - std::string::size_type deflen = definition.length(); - do { - posEnd = definition.find(',', posStart); - if (posEnd == std::string::npos) { - posEnd = deflen; - } + std::string s; // portion of frequency + int count; // number of int for one sequence - { - // Sample string: "350+440" or "350+440/2000,244+655/2000" - int freq1, freq2, time; - s = definition.substr(posStart, posEnd-posStart); - - // The 1st frequency is before the first + or the / - std::string::size_type pos_plus = s.find('+'); - std::string::size_type pos_slash = s.find('/'); - std::string::size_type len = s.length(); - std::string::size_type endfrequency = 0; - - if ( pos_slash == std::string::npos ) { - time = 0; - endfrequency = len; - } else { - time = atoi((s.substr(pos_slash+1,len-pos_slash-1)).data()); - endfrequency = pos_slash; - } - - // without a plus = 1 frequency - if (pos_plus == std::string::npos ) { - freq1 = atoi((s.substr(0,endfrequency)).data()); - freq2 = 0; - } else { - freq1 = atoi((s.substr(0,pos_plus)).data()); - freq2 = atoi((s.substr(pos_plus+1, endfrequency-pos_plus-1)).data()); - } - - // If there is time or if it's unlimited - if (time == 0) { - count = _sampleRate; - } else { - count = (_sampleRate * time) / 1000; - } - // Generate SAMPLING_RATE samples of sinus, buffer is the result - genSin(bufferPos, freq1, freq2, count); - - // To concatenate the different buffers for each section. - _size += (count); - bufferPos += (count); - } + std::string::size_type deflen = definition.length(); + + do { + posEnd = definition.find (',', posStart); + + if (posEnd == std::string::npos) { + posEnd = deflen; + } + + { + // Sample string: "350+440" or "350+440/2000,244+655/2000" + int freq1, freq2, time; + s = definition.substr (posStart, posEnd-posStart); + + // The 1st frequency is before the first + or the / + std::string::size_type pos_plus = s.find ('+'); + std::string::size_type pos_slash = s.find ('/'); + std::string::size_type len = s.length(); + std::string::size_type endfrequency = 0; + + if (pos_slash == std::string::npos) { + time = 0; + endfrequency = len; + } else { + time = atoi ( (s.substr (pos_slash+1,len-pos_slash-1)).data()); + endfrequency = pos_slash; + } + + // without a plus = 1 frequency + if (pos_plus == std::string::npos) { + freq1 = atoi ( (s.substr (0,endfrequency)).data()); + freq2 = 0; + } else { + freq1 = atoi ( (s.substr (0,pos_plus)).data()); + freq2 = atoi ( (s.substr (pos_plus+1, endfrequency-pos_plus-1)).data()); + } - posStart = posEnd+1; - } while (posStart < deflen); + // If there is time or if it's unlimited + if (time == 0) { + count = _sampleRate; + } else { + count = (_sampleRate * time) / 1000; + } - _buffer = new SFLDataFormat[_size]; - // src, dest, tocopy - bcopy(buffer, _buffer, _size*sizeof(SFLDataFormat)); // copy char, not SFLDataFormat. - delete[] buffer; buffer=0; bufferPos=0; + // Generate SAMPLING_RATE samples of sinus, buffer is the result + genSin (bufferPos, freq1, freq2, count); + + // To concatenate the different buffers for each section. + _size += (count); + + bufferPos += (count); + } + + posStart = posEnd+1; + } while (posStart < deflen); + + _buffer = new SFLDataFormat[_size]; + + // src, dest, tocopy + bcopy (buffer, _buffer, _size*sizeof (SFLDataFormat)); // copy char, not SFLDataFormat. + + delete[] buffer; + + buffer=0; + + bufferPos=0; } void -Tone::genSin(SFLDataFormat* buffer, int frequency1, int frequency2, int nb) +Tone::genSin (SFLDataFormat* buffer, int frequency1, int frequency2, int nb) { - double pi2 = 6.28318520; - double var1 = pi2 * (double)frequency1 / (double)_sampleRate; - double var2 = pi2 * (double)frequency2 / (double)_sampleRate; + double pi2 = 6.28318520; + double var1 = pi2 * (double) frequency1 / (double) _sampleRate; + double var2 = pi2 * (double) frequency2 / (double) _sampleRate; - // softer - double amp = (double)SFLDataAmplitude; - for(int t = 0; t < nb; t++) { - buffer[t] = (SFLDataFormat)(amp * ((sin(var1 * t) + sin(var2 * t)))); - } + // softer + double amp = (double) SFLDataAmplitude; + + for (int t = 0; t < nb; t++) { + buffer[t] = (SFLDataFormat) (amp * ( (sin (var1 * t) + sin (var2 * t)))); + } } diff --git a/sflphone-common/src/audio/tonegenerator.cpp b/sflphone-common/src/audio/tonegenerator.cpp index f053bfa9b8fca73f573677bebf107ff190948cf5..6fc84d537347afcf2c4cd6908a3f4c6d23da4286 100644 --- a/sflphone-common/src/audio/tonegenerator.cpp +++ b/sflphone-common/src/audio/tonegenerator.cpp @@ -2,26 +2,26 @@ * Copyright (C) 2004-2005 Savoir-Faire Linux inc. * Author: Yan Morin <yan.morin@savoirfairelinux.com> * Author: Laurielle Lea <laurielle.lea@savoirfairelinux.com> - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - + */ + #include <fstream> -#include <math.h> +#include <math.h> #include <stdlib.h> - + #include "tonegenerator.h" #include "../global.h" @@ -31,28 +31,30 @@ int AMPLITUDE = 32767; // ToneGenerator implementation /////////////////////////////////////////////////////////////////////////////// -ToneGenerator::ToneGenerator (unsigned int sampleRate): sample(NULL), freq1(), freq2(), time(), totalbytes(), _sampleRate(sampleRate) -{ +ToneGenerator::ToneGenerator (unsigned int sampleRate) : sample (NULL), freq1(), freq2(), time(), totalbytes(), _sampleRate (sampleRate) +{ } -ToneGenerator::~ToneGenerator (void) { +ToneGenerator::~ToneGenerator (void) +{ } /** - * Calculate superposition of 2 sinus + * Calculate superposition of 2 sinus * */ void -ToneGenerator::generateSin (int lowerfreq, int higherfreq, int16* ptr, int len) const { - double var1, var2; - - var1 = (double)2 * (double)M_PI * (double)higherfreq / (double)_sampleRate; - var2 = (double)2 * (double)M_PI * (double)lowerfreq / (double)_sampleRate; - - double amp = (double)(AMPLITUDE >> 2); - - for(int t = 0; t < len; t++) { - ptr[t] = (int16)(amp * ((sin(var1 * t) + sin(var2 * t)))); - } +ToneGenerator::generateSin (int lowerfreq, int higherfreq, int16* ptr, int len) const +{ + double var1, var2; + + var1 = (double) 2 * (double) M_PI * (double) higherfreq / (double) _sampleRate; + var2 = (double) 2 * (double) M_PI * (double) lowerfreq / (double) _sampleRate; + + double amp = (double) (AMPLITUDE >> 2); + + for (int t = 0; t < len; t++) { + ptr[t] = (int16) (amp * ( (sin (var1 * t) + sin (var2 * t)))); + } } diff --git a/sflphone-common/src/audio/tonelist.cpp b/sflphone-common/src/audio/tonelist.cpp index e3c739e3f5cd6bc265808d231a1a0ef925dd9f7b..d28d3a5520006975b78043ad6a6d57ba30b9a331 100644 --- a/sflphone-common/src/audio/tonelist.cpp +++ b/sflphone-common/src/audio/tonelist.cpp @@ -2,9 +2,9 @@ * Copyright (C) 2005 Savoir-Faire Linux inc. * Author: Yan Morin <yan.morin@savoirfairelinux.com> * - * Inspired by tonegenerator of + * Inspired by tonegenerator of * Laurielle Lea <laurielle.lea@savoirfairelinux.com> (2004) - * + * * 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 * the Free Software Foundation; either version 3 of the License, or @@ -21,128 +21,136 @@ */ #include "tonelist.h" -ToneList::ToneList() : _nbTone( TONE_NBTONE ) , - _nbCountry( TONE_NBCOUNTRY ), - _defaultCountryId( ZID_NORTH_AMERICA ){ - initToneDefinition(); +ToneList::ToneList() : _nbTone (TONE_NBTONE) , + _nbCountry (TONE_NBCOUNTRY), + _defaultCountryId (ZID_NORTH_AMERICA) +{ + initToneDefinition(); } -ToneList::~ToneList() { +ToneList::~ToneList() +{ } -void -ToneList::initToneDefinition() +void +ToneList::initToneDefinition() { - _toneZone[ZID_NORTH_AMERICA][Tone::TONE_DIALTONE] = "350+440"; - _toneZone[ZID_NORTH_AMERICA][Tone::TONE_BUSY] = "480+620/500,0/500"; - _toneZone[ZID_NORTH_AMERICA][Tone::TONE_RINGTONE] = "440+480/2000,0/4000"; - _toneZone[ZID_NORTH_AMERICA][Tone::TONE_CONGESTION] = "480+620/250,0/250"; - - _toneZone[ZID_FRANCE][Tone::TONE_DIALTONE] = "440"; - _toneZone[ZID_FRANCE][Tone::TONE_BUSY] = "440/500,0/500"; - _toneZone[ZID_FRANCE][Tone::TONE_RINGTONE] = "440/1500,0/3500"; - _toneZone[ZID_FRANCE][Tone::TONE_CONGESTION] = "440/250,0/250"; - - _toneZone[ZID_AUSTRALIA][Tone::TONE_DIALTONE] = "413+438"; - _toneZone[ZID_AUSTRALIA][Tone::TONE_BUSY] = "425/375,0/375"; - _toneZone[ZID_AUSTRALIA][Tone::TONE_RINGTONE] = - "413+438/400,0/200,413+438/400,0/2000"; - _toneZone[ZID_AUSTRALIA][Tone::TONE_CONGESTION] = "425/375,0/375,420/375,8/375"; - - _toneZone[ZID_UNITED_KINGDOM][Tone::TONE_DIALTONE] = "350+440"; - _toneZone[ZID_UNITED_KINGDOM][Tone::TONE_BUSY] = "400/375,0/375"; - _toneZone[ZID_UNITED_KINGDOM][Tone::TONE_RINGTONE] = - "400+450/400,0/200,400+450/400,0/2000"; - _toneZone[ZID_UNITED_KINGDOM][Tone::TONE_CONGESTION] = - "400/400,0/350,400/225,0/525"; - - _toneZone[ZID_SPAIN][Tone::TONE_DIALTONE] = "425"; - _toneZone[ZID_SPAIN][Tone::TONE_BUSY] = "425/200,0/200"; - _toneZone[ZID_SPAIN][Tone::TONE_RINGTONE] = "425/1500,0/3000"; - _toneZone[ZID_SPAIN][Tone::TONE_CONGESTION] = - "425/200,0/200,425/200,0/200,425/200,0/600"; - - _toneZone[ZID_ITALY][Tone::TONE_DIALTONE] = "425/600,0/1000,425/200,0/200"; - _toneZone[ZID_ITALY][Tone::TONE_BUSY] = "425/500,0/500"; - _toneZone[ZID_ITALY][Tone::TONE_RINGTONE] = "425/1000,0/4000"; - _toneZone[ZID_ITALY][Tone::TONE_CONGESTION] = "425/200,0/200"; - - _toneZone[ZID_JAPAN][Tone::TONE_DIALTONE] = "400"; - _toneZone[ZID_JAPAN][Tone::TONE_BUSY] = "400/500,0/500"; - _toneZone[ZID_JAPAN][Tone::TONE_RINGTONE] = "400+15/1000,0/2000"; - _toneZone[ZID_JAPAN][Tone::TONE_CONGESTION] = "400/500,0/500"; + _toneZone[ZID_NORTH_AMERICA][Tone::TONE_DIALTONE] = "350+440"; + _toneZone[ZID_NORTH_AMERICA][Tone::TONE_BUSY] = "480+620/500,0/500"; + _toneZone[ZID_NORTH_AMERICA][Tone::TONE_RINGTONE] = "440+480/2000,0/4000"; + _toneZone[ZID_NORTH_AMERICA][Tone::TONE_CONGESTION] = "480+620/250,0/250"; + + _toneZone[ZID_FRANCE][Tone::TONE_DIALTONE] = "440"; + _toneZone[ZID_FRANCE][Tone::TONE_BUSY] = "440/500,0/500"; + _toneZone[ZID_FRANCE][Tone::TONE_RINGTONE] = "440/1500,0/3500"; + _toneZone[ZID_FRANCE][Tone::TONE_CONGESTION] = "440/250,0/250"; + + _toneZone[ZID_AUSTRALIA][Tone::TONE_DIALTONE] = "413+438"; + _toneZone[ZID_AUSTRALIA][Tone::TONE_BUSY] = "425/375,0/375"; + _toneZone[ZID_AUSTRALIA][Tone::TONE_RINGTONE] = + "413+438/400,0/200,413+438/400,0/2000"; + _toneZone[ZID_AUSTRALIA][Tone::TONE_CONGESTION] = "425/375,0/375,420/375,8/375"; + + _toneZone[ZID_UNITED_KINGDOM][Tone::TONE_DIALTONE] = "350+440"; + _toneZone[ZID_UNITED_KINGDOM][Tone::TONE_BUSY] = "400/375,0/375"; + _toneZone[ZID_UNITED_KINGDOM][Tone::TONE_RINGTONE] = + "400+450/400,0/200,400+450/400,0/2000"; + _toneZone[ZID_UNITED_KINGDOM][Tone::TONE_CONGESTION] = + "400/400,0/350,400/225,0/525"; + + _toneZone[ZID_SPAIN][Tone::TONE_DIALTONE] = "425"; + _toneZone[ZID_SPAIN][Tone::TONE_BUSY] = "425/200,0/200"; + _toneZone[ZID_SPAIN][Tone::TONE_RINGTONE] = "425/1500,0/3000"; + _toneZone[ZID_SPAIN][Tone::TONE_CONGESTION] = + "425/200,0/200,425/200,0/200,425/200,0/600"; + + _toneZone[ZID_ITALY][Tone::TONE_DIALTONE] = "425/600,0/1000,425/200,0/200"; + _toneZone[ZID_ITALY][Tone::TONE_BUSY] = "425/500,0/500"; + _toneZone[ZID_ITALY][Tone::TONE_RINGTONE] = "425/1000,0/4000"; + _toneZone[ZID_ITALY][Tone::TONE_CONGESTION] = "425/200,0/200"; + + _toneZone[ZID_JAPAN][Tone::TONE_DIALTONE] = "400"; + _toneZone[ZID_JAPAN][Tone::TONE_BUSY] = "400/500,0/500"; + _toneZone[ZID_JAPAN][Tone::TONE_RINGTONE] = "400+15/1000,0/2000"; + _toneZone[ZID_JAPAN][Tone::TONE_CONGESTION] = "400/500,0/500"; } std::string -ToneList::getDefinition(COUNTRYID countryId, Tone::TONEID toneId) +ToneList::getDefinition (COUNTRYID countryId, Tone::TONEID toneId) { - if (toneId == Tone::TONE_NULL) { return ""; } - return _toneZone[countryId][toneId]; + if (toneId == Tone::TONE_NULL) { + return ""; + } + + return _toneZone[countryId][toneId]; } -ToneList::COUNTRYID -ToneList::getCountryId(const std::string& countryName) +ToneList::COUNTRYID +ToneList::getCountryId (const std::string& countryName) { - if (countryName.compare("North America") == 0) { - return ZID_NORTH_AMERICA; - } else if (countryName.compare("France") == 0) { - return ZID_FRANCE; - } else if (countryName.compare("Australia") == 0) { - return ZID_AUSTRALIA; - } else if (countryName.compare("United Kingdom") == 0) { - return ZID_UNITED_KINGDOM; - } else if (countryName.compare("Spain") == 0) { - return ZID_SPAIN; - } else if (countryName.compare("Italy") == 0) { - return ZID_ITALY; - } else if (countryName.compare("Japan") == 0) { - return ZID_JAPAN; - } else { - return _defaultCountryId; // default, we don't want segmentation fault - } + if (countryName.compare ("North America") == 0) { + return ZID_NORTH_AMERICA; + } else if (countryName.compare ("France") == 0) { + return ZID_FRANCE; + } else if (countryName.compare ("Australia") == 0) { + return ZID_AUSTRALIA; + } else if (countryName.compare ("United Kingdom") == 0) { + return ZID_UNITED_KINGDOM; + } else if (countryName.compare ("Spain") == 0) { + return ZID_SPAIN; + } else if (countryName.compare ("Italy") == 0) { + return ZID_ITALY; + } else if (countryName.compare ("Japan") == 0) { + return ZID_JAPAN; + } else { + return _defaultCountryId; // default, we don't want segmentation fault + } } -TelephoneTone::TelephoneTone(const std::string& countryName, unsigned int sampleRate) : - _currentTone( Tone::TONE_NULL ), - _toneList() +TelephoneTone::TelephoneTone (const std::string& countryName, unsigned int sampleRate) : + _currentTone (Tone::TONE_NULL), + _toneList() { - ToneList::COUNTRYID countryId = _toneList.getCountryId(countryName); - _tone[Tone::TONE_DIALTONE] = new Tone(_toneList.getDefinition(countryId, Tone::TONE_DIALTONE), sampleRate); - _tone[Tone::TONE_BUSY] = new Tone(_toneList.getDefinition(countryId, Tone::TONE_BUSY), sampleRate); - _tone[Tone::TONE_RINGTONE] = new Tone(_toneList.getDefinition(countryId, Tone::TONE_RINGTONE), sampleRate); - _tone[Tone::TONE_CONGESTION] = new Tone(_toneList.getDefinition(countryId, Tone::TONE_CONGESTION), sampleRate); + ToneList::COUNTRYID countryId = _toneList.getCountryId (countryName); + _tone[Tone::TONE_DIALTONE] = new Tone (_toneList.getDefinition (countryId, Tone::TONE_DIALTONE), sampleRate); + _tone[Tone::TONE_BUSY] = new Tone (_toneList.getDefinition (countryId, Tone::TONE_BUSY), sampleRate); + _tone[Tone::TONE_RINGTONE] = new Tone (_toneList.getDefinition (countryId, Tone::TONE_RINGTONE), sampleRate); + _tone[Tone::TONE_CONGESTION] = new Tone (_toneList.getDefinition (countryId, Tone::TONE_CONGESTION), sampleRate); } -TelephoneTone::~TelephoneTone() +TelephoneTone::~TelephoneTone() { - for (int i=0; i<_toneList.getNbTone(); i++) { - delete _tone[i]; _tone[i] = 0; - } + for (int i=0; i<_toneList.getNbTone(); i++) { + delete _tone[i]; + _tone[i] = 0; + } } void -TelephoneTone::setCurrentTone(Tone::TONEID toneId) +TelephoneTone::setCurrentTone (Tone::TONEID toneId) { - if ( toneId != Tone::TONE_NULL && _currentTone != toneId ) { - _tone[toneId]->reset(); - } - _currentTone = toneId; + if (toneId != Tone::TONE_NULL && _currentTone != toneId) { + _tone[toneId]->reset(); + } + + _currentTone = toneId; } Tone* TelephoneTone::getCurrentTone() { - if ( _currentTone == Tone::TONE_NULL ) { - return 0; - } - return _tone[_currentTone]; + if (_currentTone == Tone::TONE_NULL) { + return 0; + } + + return _tone[_currentTone]; } bool TelephoneTone::shouldPlay() { - return (( _currentTone != Tone::TONE_NULL ) ? true : false ); + return ( (_currentTone != Tone::TONE_NULL) ? true : false); } diff --git a/sflphone-common/src/call.cpp b/sflphone-common/src/call.cpp index 45ee195eee3aa6bfb5a32c6410e70983c166db05..d2cb79ae39f3e66e02fcda3e5fe5f681580a13ef 100644 --- a/sflphone-common/src/call.cpp +++ b/sflphone-common/src/call.cpp @@ -20,116 +20,155 @@ #include "call.h" #include "manager.h" -Call::Call(const CallID& id, Call::CallType type) - : _callMutex() - , _audioStarted(false) - , _localIPAddress("") - , _localAudioPort(0) - , _localExternalAudioPort(0) - , _id(id) - , _type(type) - , _connectionState(Call::Disconnected) - , _callState(Call::Inactive) - , _callConfig (Call::Classic) - , _peerName() - , _peerNumber() +Call::Call (const CallID& id, Call::CallType type) + : _callMutex() + , _audioStarted (false) + , _localIPAddress ("") + , _localAudioPort (0) + , _localExternalAudioPort (0) + , _id (id) + , _type (type) + , _connectionState (Call::Disconnected) + , _callState (Call::Inactive) + , _callConfig (Call::Classic) + , _peerName() + , _peerNumber() { - + FILE_TYPE fileType = FILE_WAV; SOUND_FORMAT soundFormat = INT16; - recAudio.setRecordingOption(fileType,soundFormat,44100, Manager::instance().getConfigString (AUDIO, RECORD_PATH),id); - // _debug("CALL::Constructor for this clss is called \n"); + recAudio.setRecordingOption (fileType,soundFormat,44100, Manager::instance().getConfigString (AUDIO, RECORD_PATH),id); + // _debug("CALL::Constructor for this clss is called \n"); } Call::~Call() { - // _debug("CALL::~Call(): Destructor for this clss is called \n"); - - if(recAudio.isOpenFile()) { - // _debug("CALL::~Call(): A recording file is open, close it \n"); - recAudio.closeFile(); - } + // _debug("CALL::~Call(): Destructor for this clss is called \n"); + + if (recAudio.isOpenFile()) { + // _debug("CALL::~Call(): A recording file is open, close it \n"); + recAudio.closeFile(); + } } -void -Call::setConnectionState(ConnectionState state) +void +Call::setConnectionState (ConnectionState state) { - ost::MutexLock m(_callMutex); - _connectionState = state; + ost::MutexLock m (_callMutex); + _connectionState = state; } Call::ConnectionState -Call::getConnectionState() +Call::getConnectionState() { - ost::MutexLock m(_callMutex); - return _connectionState; + ost::MutexLock m (_callMutex); + return _connectionState; } -void -Call::setState(CallState state) +void +Call::setState (CallState state) { - ost::MutexLock m(_callMutex); - _callState = state; + ost::MutexLock m (_callMutex); + _callState = state; } Call::CallState -Call::getState() +Call::getState() { - ost::MutexLock m(_callMutex); - return _callState; + ost::MutexLock m (_callMutex); + return _callState; } -const std::string& +std::string +Call::getStateStr () +{ + CallState state = getState(); + _debug ("getStateStr , state = %d\n", state); + std::string state_str; + + switch (state) { + + case Active: + state_str = "CURRENT"; + break; + + case Hold: + state_str = "HOLD"; + break; + + case Busy: + state_str = "BUSY"; + break; + + case Inactive: + state_str = "INACTIVE"; + break; + + case Refused: + + case Error: + + default: + state_str = "FAILURE"; + break; + } + + return state_str; +} + + +const std::string& Call::getLocalIp() { - ost::MutexLock m(_callMutex); - return _localIPAddress; + ost::MutexLock m (_callMutex); + return _localIPAddress; } -unsigned int +unsigned int Call::getLocalAudioPort() { - ost::MutexLock m(_callMutex); - return _localAudioPort; + ost::MutexLock m (_callMutex); + return _localAudioPort; } -void -Call::setAudioStart(bool start) +void +Call::setAudioStart (bool start) { - ost::MutexLock m(_callMutex); - _audioStarted = start; + ost::MutexLock m (_callMutex); + _audioStarted = start; } -bool +bool Call::isAudioStarted() { - ost::MutexLock m(_callMutex); - return _audioStarted; + ost::MutexLock m (_callMutex); + return _audioStarted; } void Call::setRecording() { - recAudio.setRecording(); + recAudio.setRecording(); } -void -Call::initRecFileName() { - recAudio.initFileName(_peerNumber); +void +Call::initRecFileName() +{ + recAudio.initFileName (_peerNumber); } void Call::stopRecording() { - recAudio.stopRecording(); + recAudio.stopRecording(); } bool Call::isRecording() { - return recAudio.isRecording(); + return recAudio.isRecording(); } diff --git a/sflphone-common/src/call.h b/sflphone-common/src/call.h index 1480ca94328452966ba009f84170d9f0c7b8efb3..000f2298930654374b74c21083a7edce9dead880 100644 --- a/sflphone-common/src/call.h +++ b/sflphone-common/src/call.h @@ -81,6 +81,11 @@ class Call{ */ CallID& getCallId() {return _id; } + inline CallType getCallType (void) + { + return _type; + } + /** * Set the peer number (destination on outgoing) * not protected by mutex (when created) @@ -139,6 +144,8 @@ class Call{ * @return CallState The call state */ CallState getState(); + + std::string getStateStr (); void setCallConfiguration (Call::CallConfiguration callConfig) { _callConfig = callConfig; } diff --git a/sflphone-common/src/config/config.cpp b/sflphone-common/src/config/config.cpp index 2c26e203172d28075e054901fb3a585e1e6030d3..9c6bb914baf03d73aaa73f94d6f6b2b5340730e5 100644 --- a/sflphone-common/src/config/config.cpp +++ b/sflphone-common/src/config/config.cpp @@ -23,60 +23,68 @@ #include <fstream> #include <cstdlib> -namespace Conf { +namespace Conf +{ // ctor -ConfigTree::ConfigTree():_sections() +ConfigTree::ConfigTree() :_sections() { } // dtor -ConfigTree::~ConfigTree() +ConfigTree::~ConfigTree() { - // erase every new ItemMap (by CreateSection) - SectionMap::iterator iter = _sections.begin(); - while(iter != _sections.end()) { - delete iter->second; iter->second = NULL; - iter++; - } + // erase every new ItemMap (by CreateSection) + SectionMap::iterator iter = _sections.begin(); + + while (iter != _sections.end()) { + delete iter->second; + iter->second = NULL; + iter++; + } } /** * Create the section only if it doesn't exists */ void -ConfigTree::createSection(const std::string& section) { - // if we doesn't find the item, create it - if (_sections.find(section) == _sections.end()) { - _sections[section] = new ItemMap; - } +ConfigTree::createSection (const std::string& section) +{ + // if we doesn't find the item, create it + if (_sections.find (section) == _sections.end()) { + _sections[section] = new ItemMap; + } } /** * Remove the section only if it exists */ void -ConfigTree::removeSection(const std::string& section) { - // if we doesn't find the item, create it - SectionMap::iterator iter = _sections.find(section); - if (iter != _sections.end()) { - _sections.erase(iter); - } +ConfigTree::removeSection (const std::string& section) +{ + // if we doesn't find the item, create it + SectionMap::iterator iter = _sections.find (section); + + if (iter != _sections.end()) { + _sections.erase (iter); + } } /** Retrieve the sections as an array */ TokenList ConfigTree::getSections() { - TokenList sections; - - SectionMap::iterator iter = _sections.begin(); - while(iter != _sections.end()) { - // add to token list the: iter->second; - sections.push_back(iter->first); - iter++; - } - return sections; + TokenList sections; + + SectionMap::iterator iter = _sections.begin(); + + while (iter != _sections.end()) { + // add to token list the: iter->second; + sections.push_back (iter->first); + iter++; + } + + return sections; } @@ -84,69 +92,76 @@ ConfigTree::getSections() * Add the config item only if it exists.. * If the section doesn't exists, create it */ -void -ConfigTree::addConfigTreeItem(const std::string& section, const ConfigTreeItem item) +void +ConfigTree::addConfigTreeItem (const std::string& section, const ConfigTreeItem item) { - // if we doesn't find the item, create it - SectionMap::iterator iter = _sections.find(section); - if ( iter == _sections.end()) { - _sections[section] = new ItemMap; - iter = _sections.find(section); - } - // be prudent here - if (iter != _sections.end()) { - std::string name = item.getName(); - - if ( iter->second->find(name) == iter->second->end()) { - (*(iter->second))[name] = item; + // if we doesn't find the item, create it + SectionMap::iterator iter = _sections.find (section); + + if (iter == _sections.end()) { + _sections[section] = new ItemMap; + iter = _sections.find (section); + } + + // be prudent here + if (iter != _sections.end()) { + std::string name = item.getName(); + + if (iter->second->find (name) == iter->second->end()) { + (* (iter->second)) [name] = item; + } } - } } // throw a ConfigTreeItemException if not found -std::string -ConfigTree::getConfigTreeItemValue(const std::string& section, const std::string& itemName) +std::string +ConfigTree::getConfigTreeItemValue (const std::string& section, const std::string& itemName) { - ConfigTreeItem* item = getConfigTreeItem(section, itemName); - if (item != NULL) { - return item->getValue(); - } else { - _debug("Option doesn't exist: [%s] %s\n", section.c_str(), itemName.c_str()); - /** @todo If item doesn't exist, we should check against the default values for those - * types of information, and return the default value. - * ... - * Maybe this should be implemented when called ? When we need a bit of configuration, - * we call the getConfig with a defaultValue as parameter, in that context we know best - * what would be the default value, rather than inside this generic configuration - * management class. - */ - } - return ""; + ConfigTreeItem* item = getConfigTreeItem (section, itemName); + + if (item != NULL) { + return item->getValue(); + } else { + _debug ("Option doesn't exist: [%s] %s\n", section.c_str(), itemName.c_str()); + /** @todo If item doesn't exist, we should check against the default values for those + * types of information, and return the default value. + * ... + * Maybe this should be implemented when called ? When we need a bit of configuration, + * we call the getConfig with a defaultValue as parameter, in that context we know best + * what would be the default value, rather than inside this generic configuration + * management class. + */ + } + + return ""; } // throw a ConfigTreeItemException if not found -int -ConfigTree::getConfigTreeItemIntValue(const std::string& section, const std::string& itemName) +int +ConfigTree::getConfigTreeItemIntValue (const std::string& section, const std::string& itemName) { - std::string configItem = getConfigTreeItemValue(section, itemName); - int retval = atoi(configItem.data()); + std::string configItem = getConfigTreeItemValue (section, itemName); + int retval = atoi (configItem.data()); - return retval; + return retval; } bool -ConfigTree::getConfigTreeItemToken(const std::string& section, const std::string& itemName, TokenList& arg) { - ConfigTreeItem *item = getConfigTreeItem(section, itemName); - if (item) { - arg.clear(); - arg.push_back(section); - arg.push_back(itemName); - arg.push_back(item->getType()); - arg.push_back(item->getValue()); - arg.push_back(item->getDefaultValue()); - return true; - } - return false; +ConfigTree::getConfigTreeItemToken (const std::string& section, const std::string& itemName, TokenList& arg) +{ + ConfigTreeItem *item = getConfigTreeItem (section, itemName); + + if (item) { + arg.clear(); + arg.push_back (section); + arg.push_back (itemName); + arg.push_back (item->getType()); + arg.push_back (item->getValue()); + arg.push_back (item->getDefaultValue()); + return true; + } + + return false; } @@ -154,17 +169,22 @@ ConfigTree::getConfigTreeItemToken(const std::string& section, const std::string /** * Return a ConfigTreeItem or NULL if not found */ -ConfigTreeItem* -ConfigTree::getConfigTreeItem(const std::string& section, const std::string& itemName) { - SectionMap::iterator iter = _sections.find(section); - if ( iter == _sections.end()) { - return NULL; - } - ItemMap::iterator iterItem = iter->second->find(itemName); - if ( iterItem == iter->second->end()) { - return NULL; - } - return &(iterItem->second); +ConfigTreeItem* +ConfigTree::getConfigTreeItem (const std::string& section, const std::string& itemName) +{ + SectionMap::iterator iter = _sections.find (section); + + if (iter == _sections.end()) { + return NULL; + } + + ItemMap::iterator iterItem = iter->second->find (itemName); + + if (iterItem == iter->second->end()) { + return NULL; + } + + return & (iterItem->second); } /** @@ -172,60 +192,71 @@ ConfigTree::getConfigTreeItem(const std::string& section, const std::string& ite * * @todo Élimier les 45,000 classes qui servent à rien pour Conf. */ -bool -ConfigTree::setConfigTreeItem(const std::string& section, - const std::string& itemName, - const std::string& value) { - - SectionMap::iterator iter = _sections.find(section); - if ( iter == _sections.end()) { - // Not found, create section - _sections[section] = new ItemMap; - iter = _sections.find(section); - } - - ItemMap::iterator iterItem = iter->second->find(itemName); - if ( iterItem == iter->second->end()) { - // Item not found, create it, defaults to type "string" - addConfigTreeItem(section, ConfigTreeItem(itemName, value, "string")); +bool +ConfigTree::setConfigTreeItem (const std::string& section, + const std::string& itemName, + const std::string& value) +{ + + SectionMap::iterator iter = _sections.find (section); + + if (iter == _sections.end()) { + // Not found, create section + _sections[section] = new ItemMap; + iter = _sections.find (section); + } + + ItemMap::iterator iterItem = iter->second->find (itemName); + + if (iterItem == iter->second->end()) { + // Item not found, create it, defaults to type "string" + addConfigTreeItem (section, ConfigTreeItem (itemName, value, "string")); + return true; + } + + iterItem->second.setValue (value); + return true; - } - iterItem->second.setValue(value); - return true; } // Save config to a file (ini format) // return false if empty, no config, or enable to open // return true if everything is ok -bool -ConfigTree::saveConfigTree(const std::string& fileName) { - if (fileName.empty() && _sections.begin() == _sections.end() ) { - return false; - } +bool +ConfigTree::saveConfigTree (const std::string& fileName) +{ + if (fileName.empty() && _sections.begin() == _sections.end()) { + return false; + } - std::fstream file; - file.open(fileName.data(), std::fstream::out); + std::fstream file; - if (!file.is_open()) { - return false; - } - - // for each section, for each item... - SectionMap::iterator iter = _sections.begin(); - while(iter != _sections.end()) { - file << "[" << iter->first << "]" << std::endl; - ItemMap::iterator iterItem = iter->second->begin(); - while ( iterItem != iter->second->end() ) { - file << iterItem->first << "=" << iterItem->second.getValue() << std::endl; - iterItem++; + file.open (fileName.data(), std::fstream::out); + + if (!file.is_open()) { + return false; } - file << std::endl; - iter++; - } + // for each section, for each item... + SectionMap::iterator iter = _sections.begin(); - file.close(); - return true; + while (iter != _sections.end()) { + file << "[" << iter->first << "]" << std::endl; + ItemMap::iterator iterItem = iter->second->begin(); + + while (iterItem != iter->second->end()) { + file << iterItem->first << "=" << iterItem->second.getValue() << std::endl; + iterItem++; + } + + file << std::endl; + + iter++; + } + + file.close(); + + return true; } // Create the tree from an existing ini file @@ -233,116 +264,137 @@ ConfigTree::saveConfigTree(const std::string& fileName) { // 1 = OK // 2 = unable to open int -ConfigTree::populateFromFile(const std::string& fileName) { - bool out = false; - if (fileName.empty()) { - return 0; - } - - std::fstream file; - file.open(fileName.data(), std::fstream::in); - - if (!file.is_open()) { - file.open(fileName.data(), std::fstream::out); - out = true; +ConfigTree::populateFromFile (const std::string& fileName) +{ + bool out = false; + + if (fileName.empty()) { + return 0; + } + + std::fstream file; + + file.open (fileName.data(), std::fstream::in); + if (!file.is_open()) { - return 0; + file.open (fileName.data(), std::fstream::out); + out = true; + + if (!file.is_open()) { + return 0; + } + + file.close(); + + return 2; } - file.close(); - return 2; - } - // get length of file: - file.seekg (0, std::ios::end); - int length = file.tellg(); - file.seekg (0, std::ios::beg); - - if ( length == 0 ) { - file.close(); - return 2; // should load config - } - - std::string line; - std::string section(""); - std::string key(""); - std::string val(""); - std::string::size_type pos; - - while (!file.eof()) { - // Read the file line by line - std::getline(file, line); - if (!line.empty()) { - if (line[0] == '[') { - // If the line is a section - pos = line.find(']'); - section = line.substr(1, pos - 1); - } else if (line[0] != '#') { - // If the line is "key=value" and doesn't begin with '#'(comments) - - pos = line.find('='); - key = line.substr(0, pos); - val = line.substr(pos + 1, line.length() - pos); - - if (key.length() > 0 && val.length() > 0) { - setConfigTreeItem(section, key, val); + + // get length of file: + file.seekg (0, std::ios::end); + + int length = file.tellg(); + + file.seekg (0, std::ios::beg); + + if (length == 0) { + file.close(); + return 2; // should load config + } + + std::string line; + + std::string section (""); + std::string key (""); + std::string val (""); + std::string::size_type pos; + + while (!file.eof()) { + // Read the file line by line + std::getline (file, line); + + if (!line.empty()) { + if (line[0] == '[') { + // If the line is a section + pos = line.find (']'); + section = line.substr (1, pos - 1); + } else if (line[0] != '#') { + // If the line is "key=value" and doesn't begin with '#'(comments) + + pos = line.find ('='); + key = line.substr (0, pos); + val = line.substr (pos + 1, line.length() - pos); + + if (key.length() > 0 && val.length() > 0) { + setConfigTreeItem (section, key, val); + } + } } - } } - } - - file.close(); - return 1; + + file.close(); + + return 1; } TokenList ConfigTreeIterator::begin() { - TokenList tk; - _iter = _tree->_sections.begin(); - if (_iter!=_tree->_sections.end()) { - _iterItem = _iter->second->begin(); - if (_iterItem!=_iter->second->end()) { - tk.push_back(_iter->first); - tk.push_back(_iterItem->first); - tk.push_back(_iterItem->second.getType()); - tk.push_back(_iterItem->second.getValue()); - tk.push_back(_iterItem->second.getDefaultValue()); + TokenList tk; + _iter = _tree->_sections.begin(); + + if (_iter!=_tree->_sections.end()) { + _iterItem = _iter->second->begin(); + + if (_iterItem!=_iter->second->end()) { + tk.push_back (_iter->first); + tk.push_back (_iterItem->first); + tk.push_back (_iterItem->second.getType()); + tk.push_back (_iterItem->second.getValue()); + tk.push_back (_iterItem->second.getDefaultValue()); + } } - } - return tk; + + return tk; } TokenList ConfigTreeIterator::next() { - TokenList tk; - // we return tk empty if we are at the end of the list... - if (_iter==_tree->_sections.end()) { - return tk; - } - if (_iterItem!=_iter->second->end()) { - _iterItem++; - } - if (_iterItem==_iter->second->end()) { - // if we increment, and we are at the end of a section - _iter++; - if (_iter!=_tree->_sections.end()) { - _iterItem = _iter->second->begin(); - if (_iterItem!=_iter->second->end()) { - tk.push_back(_iter->first); - tk.push_back(_iterItem->first); - tk.push_back(_iterItem->second.getType()); - tk.push_back(_iterItem->second.getValue()); - tk.push_back(_iterItem->second.getDefaultValue()); - } + TokenList tk; + // we return tk empty if we are at the end of the list... + + if (_iter==_tree->_sections.end()) { + return tk; + } + + if (_iterItem!=_iter->second->end()) { + _iterItem++; + } + + if (_iterItem==_iter->second->end()) { + // if we increment, and we are at the end of a section + _iter++; + + if (_iter!=_tree->_sections.end()) { + _iterItem = _iter->second->begin(); + + if (_iterItem!=_iter->second->end()) { + tk.push_back (_iter->first); + tk.push_back (_iterItem->first); + tk.push_back (_iterItem->second.getType()); + tk.push_back (_iterItem->second.getValue()); + tk.push_back (_iterItem->second.getDefaultValue()); + } + } + } else { + tk.push_back (_iter->first); + tk.push_back (_iterItem->first); + tk.push_back (_iterItem->second.getType()); + tk.push_back (_iterItem->second.getValue()); + tk.push_back (_iterItem->second.getDefaultValue()); } - } else { - tk.push_back(_iter->first); - tk.push_back(_iterItem->first); - tk.push_back(_iterItem->second.getType()); - tk.push_back(_iterItem->second.getValue()); - tk.push_back(_iterItem->second.getDefaultValue()); - } - return tk; + + return tk; } } // end namespace ConfigTree diff --git a/sflphone-common/src/config/config.h b/sflphone-common/src/config/config.h index e929426b5e29c394fc080dd1f1bfce876d949f35..0872889486659d2a7db64634106f36fcb58ce3a0 100644 --- a/sflphone-common/src/config/config.h +++ b/sflphone-common/src/config/config.h @@ -29,153 +29,184 @@ * @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; +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 +{ - class ConfigTreeItemException { public: - /** - * Constructor - * */ - ConfigTreeItemException() {} - - /** - * Destructor - * */ - ~ConfigTreeItemException() {} - }; - - class ConfigTree; - class ConfigTreeIterator - { + /** + * 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(); + /** + * 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), _endToken(), _iter(), _iterItem() {} - ConfigTreeIterator(const Conf::ConfigTreeIterator&); - ConfigTreeIterator& operator=(const Conf::ConfigTreeIterator&); + friend class ConfigTree; + ConfigTreeIterator (ConfigTree *configTree) : _tree (configTree), _endToken(), _iter(), _iterItem() {} + + ConfigTreeIterator (const Conf::ConfigTreeIterator&); + ConfigTreeIterator& operator= (const Conf::ConfigTreeIterator&); - ConfigTree* _tree; - TokenList _endToken; - SectionMap::iterator _iter; - ItemMap::iterator _iterItem; - }; + ConfigTree* _tree; + TokenList _endToken; + SectionMap::iterator _iter; + ItemMap::iterator _iterItem; +}; + +class ConfigTree +{ - 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); + 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); + ConfigTreeItem* getConfigTreeItem (const std::string& section, const std::string& itemName); + + /** + * List of sections. Each sections has an ItemList as child + */ + SectionMap _sections; - /** - * List of sections. Each sections has an ItemList as child - */ - SectionMap _sections; - friend class ConfigTreeIterator; + friend class ConfigTreeIterator; public: - ConfigTreeIterator createIterator() { - return ConfigTreeIterator(this); - } - }; + ConfigTreeIterator createIterator() { + return ConfigTreeIterator (this); + } +}; + +class ConfigTreeItem +{ - class ConfigTreeItem { public: - ConfigTreeItem() : _name(""), _value(""), _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; } + ConfigTreeItem() : _name (""), _value (""), _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; - }; + std::string _name; + std::string _value; + std::string _defaultValue; + std::string _type; +}; } // end namespace ConfigTree diff --git a/sflphone-common/src/dbus/Makefile.am b/sflphone-common/src/dbus/Makefile.am index b94bdbaea5455df9a88db9b760be3d786483e6ad..5a2745e257f0048291d1b6e60bf1fdb2d9b2e159 100644 --- a/sflphone-common/src/dbus/Makefile.am +++ b/sflphone-common/src/dbus/Makefile.am @@ -38,7 +38,7 @@ service_DATA = $(service_in_files:.service.in=.service) # Rule to make the service file with bindir expanded $(service_DATA): $(service_in_files) Makefile - sed -e "s|bindir|$(prefix)/bin|" $<> $@ + sed -e "s|libexec|$(prefix)/lib/sflphone|" $<> $@ EXTRA_DIST = *.xml README diff --git a/sflphone-common/src/dbus/callmanager-introspec.xml b/sflphone-common/src/dbus/callmanager-introspec.xml index dbc84d3542c77ceba6beb6f07f3904aa2e4d8ce8..dd7df126a9d53637a99f990388b38e8eba885561 100644 --- a/sflphone-common/src/dbus/callmanager-introspec.xml +++ b/sflphone-common/src/dbus/callmanager-introspec.xml @@ -67,6 +67,10 @@ <arg type="a{ss}" name="infos" direction="out"/> </method> + <method name="getCallList"> + <arg type="as" name="list" direction="out"/> + </method> + <method name="getCurrentCallID"> <arg type="s" name="callID" direction="out"/> </method> @@ -102,11 +106,16 @@ <arg type="i" name="count" direction="out"/> </signal> - <signal name="volumeChanged"> <arg type="s" name="device" direction="out"/> <arg type="d" name="value" direction="out"/> </signal> + + <signal name="transferSucceded"> + </signal> + + <signal name="transferFailed"> + </signal> <!-- <signal name="error"> diff --git a/sflphone-common/src/dbus/callmanager.cpp b/sflphone-common/src/dbus/callmanager.cpp index e013410ad59c63693896cd68bb70a40c7fed976c..88f2e349a15d1ae406bc43a44879dd2aeeffceb3 100644 --- a/sflphone-common/src/dbus/callmanager.cpp +++ b/sflphone-common/src/dbus/callmanager.cpp @@ -3,17 +3,17 @@ * Copyright (C) 2007 Savoir-Faire Linux inc. * Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com> * Author: Alexandre Bourget <alexandre.bourget@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 * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. @@ -24,152 +24,157 @@ const char* CallManager::SERVER_PATH = "/org/sflphone/SFLphone/CallManager"; -CallManager::CallManager( DBus::Connection& connection ) -: DBus::ObjectAdaptor(connection, SERVER_PATH) +CallManager::CallManager (DBus::Connection& connection) + : DBus::ObjectAdaptor (connection, SERVER_PATH) { } void -CallManager::placeCall( const std::string& accountID, - const std::string& callID, - const std::string& to ) +CallManager::placeCall (const std::string& accountID, + const std::string& callID, + const std::string& to) { - _debug("CallManager::placeCall received\n"); + _debug ("CallManager::placeCall received\n"); // Check if a destination number is available - if( to == "") _debug("No number entered - Call stopped\n"); - else Manager::instance().outgoingCall(accountID, callID, to); + + if (to == "") _debug ("No number entered - Call stopped\n"); + else Manager::instance().outgoingCall (accountID, callID, to); } void -CallManager::refuse( const std::string& callID ) +CallManager::refuse (const std::string& callID) { - _debug("CallManager::refuse received\n"); - Manager::instance().refuseCall(callID); + _debug ("CallManager::refuse received\n"); + Manager::instance().refuseCall (callID); } void -CallManager::accept( const std::string& callID ) +CallManager::accept (const std::string& callID) { - _debug("CallManager::accept received\n"); - Manager::instance().answerCall(callID); + _debug ("CallManager::accept received\n"); + Manager::instance().answerCall (callID); } void -CallManager::hangUp( const std::string& callID ) +CallManager::hangUp (const std::string& callID) { - _debug("CallManager::hangUp received\n"); - Manager::instance().hangupCall(callID); + _debug ("CallManager::hangUp received\n"); + Manager::instance().hangupCall (callID); } void -CallManager::hold( const std::string& callID ) +CallManager::hold (const std::string& callID) { - _debug("CallManager::hold received\n"); - Manager::instance().onHoldCall(callID); - + _debug ("CallManager::hold received\n"); + Manager::instance().onHoldCall (callID); + } void -CallManager::unhold( const std::string& callID ) +CallManager::unhold (const std::string& callID) { - _debug("CallManager::unhold received\n"); - Manager::instance().offHoldCall(callID); + _debug ("CallManager::unhold received\n"); + Manager::instance().offHoldCall (callID); } void -CallManager::transfert( const std::string& callID, const std::string& to ) +CallManager::transfert (const std::string& callID, const std::string& to) { - _debug("CallManager::transfert received\n"); - Manager::instance().transferCall(callID, to); + _debug ("CallManager::transfert received\n"); + Manager::instance().transferCall (callID, to); } + + void -CallManager::setVolume( const std::string& device, const double& value ) +CallManager::setVolume (const std::string& device, const double& value) { - _debug("CallManager::setVolume received\n"); - if(device == "speaker") - { - Manager::instance().setSpkrVolume((int)(value*100.0)); - } - else if (device == "mic") - { - Manager::instance().setMicVolume((int)(value*100.0)); + _debug ("CallManager::setVolume received\n"); + + if (device == "speaker") { + Manager::instance().setSpkrVolume ( (int) (value*100.0)); + } else if (device == "mic") { + Manager::instance().setMicVolume ( (int) (value*100.0)); } - volumeChanged(device, value); + + volumeChanged (device, value); } -double -CallManager::getVolume( const std::string& device ) +double +CallManager::getVolume (const std::string& device) { - _debug("CallManager::getVolume received \n"); - if(device == "speaker") - { - _debug("Current speaker = %d\n", Manager::instance().getSpkrVolume()); - return Manager::instance().getSpkrVolume()/100.0; - } - else if (device == "mic") - { - _debug("Current mic = %d\n", Manager::instance().getMicVolume()); - return Manager::instance().getMicVolume()/100.0; + _debug ("CallManager::getVolume received \n"); + + if (device == "speaker") { + _debug ("Current speaker = %d\n", Manager::instance().getSpkrVolume()); + return Manager::instance().getSpkrVolume() /100.0; + } else if (device == "mic") { + _debug ("Current mic = %d\n", Manager::instance().getMicVolume()); + return Manager::instance().getMicVolume() /100.0; } + return 0; } void -CallManager::setRecording(const std::string& callID) -{ - _debug("CallManager::setRecording received\n"); - Manager::instance().setRecordingCall(callID); +CallManager::setRecording (const std::string& callID) +{ + _debug ("CallManager::setRecording received\n"); + Manager::instance().setRecordingCall (callID); } bool -CallManager::getIsRecording(const std::string& callID) -{ - _debug("CallManager::getIsRecording received \n"); - return Manager::instance().isRecording(callID); +CallManager::getIsRecording (const std::string& callID) +{ + _debug ("CallManager::getIsRecording received \n"); + return Manager::instance().isRecording (callID); } std::string -CallManager::getCurrentCodecName(const std::string& callID) -{ - _debug("CallManager::getCurrentCodecName received %s \n",Manager::instance().getCurrentCodecName(callID).c_str()); - return Manager::instance().getCurrentCodecName(callID).c_str(); +CallManager::getCurrentCodecName (const std::string& callID) +{ + _debug ("CallManager::getCurrentCodecName received %s \n",Manager::instance().getCurrentCodecName (callID).c_str()); + return Manager::instance().getCurrentCodecName (callID).c_str(); } -std::map< std::string, std::string > -CallManager::getCallDetails( const std::string& callID ) +std::map< std::string, std::string > +CallManager::getCallDetails (const std::string& callID) { - _debug("CallManager::getCallDetails received\n"); + _debug ("CallManager::getCallDetails received\n"); return Manager::instance().getCallDetails (callID); } -std::string -CallManager::getCurrentCallID( ) +std::vector< std::string > +CallManager::getCallList (void) { - _debug("CallManager::getCurrentCallID received\n"); + return Manager::instance().getCallList(); +} + +std::string +CallManager::getCurrentCallID() +{ + _debug ("CallManager::getCurrentCallID received\n"); return Manager::instance().getCurrentCallId(); } -void -CallManager::playDTMF( const std::string& key ) +void +CallManager::playDTMF (const std::string& key) { - Manager::instance().sendDtmf(Manager::instance().getCurrentCallId(), key.c_str()[0]); + Manager::instance().sendDtmf (Manager::instance().getCurrentCallId(), key.c_str() [0]); } -void -CallManager::startTone( const int32_t& start , const int32_t& type ) +void +CallManager::startTone (const int32_t& start , const int32_t& type) { - if( start == true ) - { - if( type == 0 ) - Manager::instance().playTone(); - else - Manager::instance().playToneWithMessage(); - } - else - Manager::instance().stopTone(true); + if (start == true) { + if (type == 0) + Manager::instance().playTone(); + else + Manager::instance().playToneWithMessage(); + } else + Manager::instance().stopTone (true); } diff --git a/sflphone-common/src/dbus/callmanager.h b/sflphone-common/src/dbus/callmanager.h index e1fc6de8fa074e7d36e3f7d03738071092bc0465..0d8a93a9a3c10591fa7409a87ecdc8081d9305e0 100644 --- a/sflphone-common/src/dbus/callmanager.h +++ b/sflphone-common/src/dbus/callmanager.h @@ -51,7 +51,10 @@ public: void setRecording( const std::string& callID ); bool getIsRecording(const std::string& callID); std::string getCurrentCodecName(const std::string& callID); + std::map< std::string, std::string > getCallDetails( const std::string& callID ); + std::vector< std::string > getCallList (void); + std::string getCurrentCallID( ); void playDTMF( const std::string& key ); void startTone( const int32_t& start, const int32_t& type ); diff --git a/sflphone-common/src/dbus/configurationmanager-introspec.xml b/sflphone-common/src/dbus/configurationmanager-introspec.xml index 9a4375bb0cfce1a67ff8790ae119202015d0ce16..7e3888c2338960ea9c20d4d0d7e0fed94c09a4cf 100644 --- a/sflphone-common/src/dbus/configurationmanager-introspec.xml +++ b/sflphone-common/src/dbus/configurationmanager-introspec.xml @@ -210,6 +210,13 @@ <method name="setSearchbar"> </method> + <method name="setHistoryEnabled"> + </method> + + <method name="getHistoryEnabled"> + <arg type="i" name="state" direction="out"/> + </method> + <method name="getVolumeControls"> <arg type="i" name="state" direction="out"/> </method> @@ -217,12 +224,12 @@ <method name="setVolumeControls"> </method> - <method name="getMaxCalls"> - <arg type="i" name="calls" direction="out"/> + <method name="getHistoryLimit"> + <arg type="i" name="days" direction="out"/> </method> - <method name="setMaxCalls"> - <arg type="i" name="calls" direction="in"/> + <method name="setHistoryLimit"> + <arg type="i" name="days" direction="in"/> </method> <method name="startHidden"> @@ -302,6 +309,16 @@ <arg type="a{ss}" name="settings" direction="in"/> </method> + <method name="getHistory"> + <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="MapStringString"/> + <arg type="a{ss}" name="entries" direction="out"/> + </method> + + <method name="setHistory"> + <annotation name="com.trolltech.QtDBus.QtTypeName.In0" value="MapStringString"/> + <arg type="a{ss}" name="entries" direction="in"/> + </method> + <!-- ///////////////////////////// --> <!-- @@ -313,7 +330,7 @@ --> <signal name="accountsChanged"> - </signal> + </signal> <signal name="errorAlert"> <arg type="i" name="code" direction="out"/> diff --git a/sflphone-common/src/dbus/configurationmanager.cpp b/sflphone-common/src/dbus/configurationmanager.cpp index 510d97419acfa1e7fba26271586f9cfadcc531da..c9dfc7d52959332e208fcf41ef16bc1672366611 100644 --- a/sflphone-common/src/dbus/configurationmanager.cpp +++ b/sflphone-common/src/dbus/configurationmanager.cpp @@ -28,432 +28,473 @@ const char* ConfigurationManager::SERVER_PATH = "/org/sflphone/SFLphone/Configur - ConfigurationManager::ConfigurationManager( DBus::Connection& connection ) -: DBus::ObjectAdaptor(connection, SERVER_PATH) +ConfigurationManager::ConfigurationManager (DBus::Connection& connection) + : DBus::ObjectAdaptor (connection, SERVER_PATH) { } - std::map< std::string, std::string > -ConfigurationManager::getAccountDetails( const std::string& accountID ) + +std::map< std::string, std::string > +ConfigurationManager::getAccountDetails (const std::string& accountID) { - _debug("ConfigurationManager::getAccountDetails\n"); - return Manager::instance().getAccountDetails(accountID); + _debug ("ConfigurationManager::getAccountDetails\n"); + return Manager::instance().getAccountDetails (accountID); } - void -ConfigurationManager::setAccountDetails( const std::string& accountID, - const std::map< std::string, std::string >& details ) +void +ConfigurationManager::setAccountDetails (const std::string& accountID, + const std::map< std::string, std::string >& details) { - _debug("ConfigurationManager::setAccountDetails received\n"); - Manager::instance().setAccountDetails(accountID, details); + _debug ("ConfigurationManager::setAccountDetails received\n"); + Manager::instance().setAccountDetails (accountID, details); } - void -ConfigurationManager::sendRegister( const std::string& accountID, const int32_t& expire ) +void +ConfigurationManager::sendRegister (const std::string& accountID, const int32_t& expire) { - _debug("ConfigurationManager::sendRegister received\n"); - Manager::instance().sendRegister(accountID, expire); + _debug ("ConfigurationManager::sendRegister received\n"); + Manager::instance().sendRegister (accountID, expire); } - std::string -ConfigurationManager::addAccount( const std::map< std::string, std::string >& details ) +std::string +ConfigurationManager::addAccount (const std::map< std::string, std::string >& details) { - _debug("ConfigurationManager::addAccount received\n"); - return Manager::instance().addAccount(details); + _debug ("ConfigurationManager::addAccount received\n"); + return Manager::instance().addAccount (details); } - void -ConfigurationManager::removeAccount( const std::string& accoundID ) +void +ConfigurationManager::removeAccount (const std::string& accoundID) { - _debug("ConfigurationManager::removeAccount received\n"); - return Manager::instance().removeAccount(accoundID); + _debug ("ConfigurationManager::removeAccount received\n"); + return Manager::instance().removeAccount (accoundID); } std::vector< std::string > -ConfigurationManager::getAccountList( ) +ConfigurationManager::getAccountList() { - _debug("ConfigurationManager::getAccountList received\n"); - return Manager::instance().getAccountList(); + _debug ("ConfigurationManager::getAccountList received\n"); + return Manager::instance().getAccountList(); } std::vector< std::string > -ConfigurationManager::getToneLocaleList( ) +ConfigurationManager::getToneLocaleList() { - std::vector< std::string > ret; - _debug("ConfigurationManager::getToneLocaleList received\n"); - return ret; + std::vector< std::string > ret; + _debug ("ConfigurationManager::getToneLocaleList received\n"); + return ret; } - std::string -ConfigurationManager::getVersion( ) +std::string +ConfigurationManager::getVersion() { - std::string ret(""); - _debug("ConfigurationManager::getVersion received\n"); - return ret; + std::string ret (""); + _debug ("ConfigurationManager::getVersion received\n"); + return ret; } - std::vector< std::string > -ConfigurationManager::getRingtoneList( ) +std::vector< std::string > +ConfigurationManager::getRingtoneList() { - std::vector< std::string > ret; - _debug("ConfigurationManager::getRingtoneList received\n"); - return ret; + std::vector< std::string > ret; + _debug ("ConfigurationManager::getRingtoneList received\n"); + return ret; } - std::vector< std::string > -ConfigurationManager::getCodecList( ) +std::vector< std::string > +ConfigurationManager::getCodecList() { - _debug("ConfigurationManager::getRingtoneList received\n"); - return Manager::instance().getCodecList(); + _debug ("ConfigurationManager::getRingtoneList received\n"); + return Manager::instance().getCodecList(); } - std::vector< std::string > -ConfigurationManager::getCodecDetails( const int32_t& payload ) +std::vector< std::string > +ConfigurationManager::getCodecDetails (const int32_t& payload) { - _debug("ConfigurationManager::getRingtoneList received\n"); - return Manager::instance().getCodecDetails( payload ); + _debug ("ConfigurationManager::getRingtoneList received\n"); + return Manager::instance().getCodecDetails (payload); } - std::vector< std::string > -ConfigurationManager::getActiveCodecList( ) +std::vector< std::string > +ConfigurationManager::getActiveCodecList() { - _debug("ConfigurationManager::getActiveCodecList received\n"); - return Manager::instance().getActiveCodecList(); + _debug ("ConfigurationManager::getActiveCodecList received\n"); + return Manager::instance().getActiveCodecList(); } void -ConfigurationManager::setActiveCodecList( const std::vector< std::string >& list ) +ConfigurationManager::setActiveCodecList (const std::vector< std::string >& list) { - _debug("ConfigurationManager::setActiveCodecList received\n"); - Manager::instance().setActiveCodecList(list); + _debug ("ConfigurationManager::setActiveCodecList received\n"); + Manager::instance().setActiveCodecList (list); } // Audio devices related methods - std::vector< std::string > +std::vector< std::string > ConfigurationManager::getInputAudioPluginList() { - _debug("ConfigurationManager::getInputAudioPluginList received\n"); - return Manager::instance().getInputAudioPluginList(); + _debug ("ConfigurationManager::getInputAudioPluginList received\n"); + return Manager::instance().getInputAudioPluginList(); } - std::vector< std::string > +std::vector< std::string > ConfigurationManager::getOutputAudioPluginList() { - _debug("ConfigurationManager::getOutputAudioPluginList received\n"); - return Manager::instance().getOutputAudioPluginList(); + _debug ("ConfigurationManager::getOutputAudioPluginList received\n"); + return Manager::instance().getOutputAudioPluginList(); } - void -ConfigurationManager::setInputAudioPlugin(const std::string& audioPlugin) +void +ConfigurationManager::setInputAudioPlugin (const std::string& audioPlugin) { - _debug("ConfigurationManager::setInputAudioPlugin received\n"); - return Manager::instance().setInputAudioPlugin(audioPlugin); + _debug ("ConfigurationManager::setInputAudioPlugin received\n"); + return Manager::instance().setInputAudioPlugin (audioPlugin); } - void -ConfigurationManager::setOutputAudioPlugin(const std::string& audioPlugin) +void +ConfigurationManager::setOutputAudioPlugin (const std::string& audioPlugin) { - _debug("ConfigurationManager::setOutputAudioPlugin received\n"); - return Manager::instance().setOutputAudioPlugin(audioPlugin); + _debug ("ConfigurationManager::setOutputAudioPlugin received\n"); + return Manager::instance().setOutputAudioPlugin (audioPlugin); } - std::vector< std::string > +std::vector< std::string > ConfigurationManager::getAudioOutputDeviceList() { - _debug("ConfigurationManager::getAudioOutputDeviceList received\n"); - return Manager::instance().getAudioOutputDeviceList(); + _debug ("ConfigurationManager::getAudioOutputDeviceList received\n"); + return Manager::instance().getAudioOutputDeviceList(); } + void -ConfigurationManager::setAudioOutputDevice(const int32_t& index) +ConfigurationManager::setAudioOutputDevice (const int32_t& index) { - _debug("ConfigurationManager::setAudioOutputDevice received\n"); - return Manager::instance().setAudioOutputDevice(index); + _debug ("ConfigurationManager::setAudioOutputDevice received\n"); + return Manager::instance().setAudioOutputDevice (index); } + std::vector< std::string > ConfigurationManager::getAudioInputDeviceList() { - _debug("ConfigurationManager::getAudioInputDeviceList received\n"); - return Manager::instance().getAudioInputDeviceList(); + _debug ("ConfigurationManager::getAudioInputDeviceList received\n"); + return Manager::instance().getAudioInputDeviceList(); } + void -ConfigurationManager::setAudioInputDevice(const int32_t& index) +ConfigurationManager::setAudioInputDevice (const int32_t& index) { - _debug("ConfigurationManager::setAudioInputDevice received\n"); - return Manager::instance().setAudioInputDevice(index); + _debug ("ConfigurationManager::setAudioInputDevice received\n"); + return Manager::instance().setAudioInputDevice (index); } + std::vector< std::string > ConfigurationManager::getCurrentAudioDevicesIndex() { - _debug("ConfigurationManager::getCurrentAudioDeviceIndex received\n"); - return Manager::instance().getCurrentAudioDevicesIndex(); + _debug ("ConfigurationManager::getCurrentAudioDeviceIndex received\n"); + return Manager::instance().getCurrentAudioDevicesIndex(); } - int32_t -ConfigurationManager::getAudioDeviceIndex(const std::string& name) + +int32_t +ConfigurationManager::getAudioDeviceIndex (const std::string& name) { - _debug("ConfigurationManager::getAudioDeviceIndex received\n"); - return Manager::instance().getAudioDeviceIndex(name); + _debug ("ConfigurationManager::getAudioDeviceIndex received\n"); + return Manager::instance().getAudioDeviceIndex (name); } std::string -ConfigurationManager::getCurrentAudioOutputPlugin( void ) +ConfigurationManager::getCurrentAudioOutputPlugin (void) { - _debug("ConfigurationManager::getCurrentAudioOutputPlugin received\n"); - return Manager::instance().getCurrentAudioOutputPlugin(); + _debug ("ConfigurationManager::getCurrentAudioOutputPlugin received\n"); + return Manager::instance().getCurrentAudioOutputPlugin(); } - std::vector< std::string > -ConfigurationManager::getPlaybackDeviceList( ) +std::vector< std::string > +ConfigurationManager::getPlaybackDeviceList() { - std::vector< std::string > ret; - _debug("ConfigurationManager::getPlaybackDeviceList received\n"); - return ret; + std::vector< std::string > ret; + _debug ("ConfigurationManager::getPlaybackDeviceList received\n"); + return ret; } - std::vector< std::string > -ConfigurationManager::getRecordDeviceList( ) +std::vector< std::string > +ConfigurationManager::getRecordDeviceList() { - std::vector< std::string > ret; - _debug("ConfigurationManager::getRecordDeviceList received\n"); - return ret; + std::vector< std::string > ret; + _debug ("ConfigurationManager::getRecordDeviceList received\n"); + return ret; } int32_t -ConfigurationManager::isIax2Enabled( void ) +ConfigurationManager::isIax2Enabled (void) { - return Manager::instance().isIax2Enabled( ); + return Manager::instance().isIax2Enabled(); } void -ConfigurationManager::ringtoneEnabled( void ) +ConfigurationManager::ringtoneEnabled (void) { - Manager::instance().ringtoneEnabled( ); + Manager::instance().ringtoneEnabled(); } int32_t -ConfigurationManager::isRingtoneEnabled( void ) +ConfigurationManager::isRingtoneEnabled (void) { - return Manager::instance().isRingtoneEnabled( ); + return Manager::instance().isRingtoneEnabled(); } std::string -ConfigurationManager::getRingtoneChoice( void ) +ConfigurationManager::getRingtoneChoice (void) { - return Manager::instance().getRingtoneChoice( ); + return Manager::instance().getRingtoneChoice(); } void -ConfigurationManager::setRingtoneChoice( const std::string& tone ) +ConfigurationManager::setRingtoneChoice (const std::string& tone) { - Manager::instance().setRingtoneChoice( tone ); + Manager::instance().setRingtoneChoice (tone); } std::string -ConfigurationManager::getRecordPath( void ) +ConfigurationManager::getRecordPath (void) { - return Manager::instance().getRecordPath( ); + return Manager::instance().getRecordPath(); } void -ConfigurationManager::setRecordPath( const std::string& recPath) +ConfigurationManager::setRecordPath (const std::string& recPath) { - Manager::instance().setRecordPath( recPath ); + Manager::instance().setRecordPath (recPath); } int32_t -ConfigurationManager::getDialpad( void ) +ConfigurationManager::getDialpad (void) { - return Manager::instance().getDialpad( ); + return Manager::instance().getDialpad(); } void -ConfigurationManager::setDialpad( void ) +ConfigurationManager::setDialpad (void) { - Manager::instance().setDialpad( ); + Manager::instance().setDialpad(); } int32_t -ConfigurationManager::getSearchbar( void ) +ConfigurationManager::getSearchbar (void) { - return Manager::instance().getSearchbar( ); + return Manager::instance().getSearchbar(); } void -ConfigurationManager::setSearchbar( void ) +ConfigurationManager::setSearchbar (void) { - Manager::instance().setSearchbar( ); + Manager::instance().setSearchbar(); } int32_t -ConfigurationManager::getVolumeControls( void ) +ConfigurationManager::getVolumeControls (void) { - return Manager::instance().getVolumeControls( ); + return Manager::instance().getVolumeControls(); } void -ConfigurationManager::setVolumeControls( void ) +ConfigurationManager::setVolumeControls (void) { - Manager::instance().setVolumeControls( ); + Manager::instance().setVolumeControls(); } int32_t -ConfigurationManager::getMaxCalls( void ) +ConfigurationManager::getHistoryLimit (void) { - return Manager::instance().getMaxCalls( ); + return Manager::instance().getHistoryLimit(); } void -ConfigurationManager::setMaxCalls( const int32_t& calls ) +ConfigurationManager::setHistoryLimit (const int32_t& days) +{ + Manager::instance().setHistoryLimit (days); +} + + +void ConfigurationManager::setHistoryEnabled (void) { - Manager::instance().setMaxCalls( calls ); + Manager::instance ().setHistoryEnabled (); +} + +int32_t ConfigurationManager::getHistoryEnabled (void) +{ + return Manager::instance ().getHistoryEnabled (); } void -ConfigurationManager::startHidden( void ) +ConfigurationManager::startHidden (void) { - Manager::instance().startHidden( ); + _debug ("Manager received startHidden\n"); + Manager::instance().startHidden(); } int32_t -ConfigurationManager::isStartHidden( void ) +ConfigurationManager::isStartHidden (void) { - return Manager::instance().isStartHidden( ); + _debug ("Manager received isStartHidden\n"); + return Manager::instance().isStartHidden(); } void -ConfigurationManager::switchPopupMode( void ) +ConfigurationManager::switchPopupMode (void) { - Manager::instance().switchPopupMode( ); + _debug ("Manager received switchPopupMode\n"); + Manager::instance().switchPopupMode(); } int32_t -ConfigurationManager::popupMode( void ) +ConfigurationManager::popupMode (void) { - return Manager::instance().popupMode( ); + _debug ("Manager received popupMode\n"); + return Manager::instance().popupMode(); } void -ConfigurationManager::setNotify( void ) +ConfigurationManager::setNotify (void) { - _debug("Manager received setNotify\n"); - Manager::instance().setNotify( ); + _debug ("Manager received setNotify\n"); + Manager::instance().setNotify(); } int32_t -ConfigurationManager::getNotify( void ) +ConfigurationManager::getNotify (void) { - _debug("Manager received getNotify\n"); - return Manager::instance().getNotify( ); + _debug ("Manager received getNotify\n"); + return Manager::instance().getNotify(); } void -ConfigurationManager::setAudioManager( const int32_t& api ) +ConfigurationManager::setAudioManager (const int32_t& api) { - _debug("Manager received setAudioManager\n"); - Manager::instance().setAudioManager( api ); + _debug ("Manager received setAudioManager\n"); + Manager::instance().setAudioManager (api); } int32_t -ConfigurationManager::getAudioManager( void ) +ConfigurationManager::getAudioManager (void) { - _debug("Manager received getAudioManager\n"); - return Manager::instance().getAudioManager( ); + _debug ("Manager received getAudioManager\n"); + return Manager::instance().getAudioManager(); } void -ConfigurationManager::setMailNotify( void ) +ConfigurationManager::setMailNotify (void) { - _debug("Manager received setMailNotify\n"); - Manager::instance().setMailNotify( ); + _debug ("Manager received setMailNotify\n"); + Manager::instance().setMailNotify(); } int32_t -ConfigurationManager::getMailNotify( void ) +ConfigurationManager::getMailNotify (void) { - _debug("Manager received getMailNotify\n"); - return Manager::instance().getMailNotify( ); + _debug ("Manager received getMailNotify\n"); + return Manager::instance().getMailNotify(); } int32_t -ConfigurationManager::getPulseAppVolumeControl( void ) +ConfigurationManager::getPulseAppVolumeControl (void) { - return Manager::instance().getPulseAppVolumeControl(); + return Manager::instance().getPulseAppVolumeControl(); } void -ConfigurationManager::setPulseAppVolumeControl( void ) +ConfigurationManager::setPulseAppVolumeControl (void) { - Manager::instance().setPulseAppVolumeControl(); + Manager::instance().setPulseAppVolumeControl(); } int32_t -ConfigurationManager::getSipPort( void ) +ConfigurationManager::getSipPort (void) { - return Manager::instance().getSipPort(); + return Manager::instance().getSipPort(); } void -ConfigurationManager::setSipPort( const int32_t& portNum ) +ConfigurationManager::setSipPort (const int32_t& portNum) { - _debug("Manager received setSipPort: %d\n", portNum); - Manager::instance().setSipPort(portNum); + _debug ("Manager received setSipPort: %d\n", portNum); + Manager::instance().setSipPort (portNum); } -std::string ConfigurationManager::getStunServer( void ) +std::string ConfigurationManager::getStunServer (void) { + _debug ("Manager received getStunServer\n") ; return Manager::instance().getStunServer(); } -void ConfigurationManager::setStunServer( const std::string& server ) +void ConfigurationManager::setStunServer (const std::string& server) { - Manager::instance().setStunServer( server ); + _debug ("Manager received setStunServer\n") ; + Manager::instance().setStunServer (server); } void ConfigurationManager::enableStun (void) { + _debug ("Manager received enableStun\n") ; Manager::instance().enableStun(); } int32_t ConfigurationManager::isStunEnabled (void) { + _debug ("Manager received isStunEnabled\n") ; return Manager::instance().isStunEnabled(); } -std::map<std::string, int32_t> ConfigurationManager::getAddressbookSettings (void) { +std::map<std::string, int32_t> ConfigurationManager::getAddressbookSettings (void) +{ return Manager::instance().getAddressbookSettings (); } -void ConfigurationManager::setAddressbookSettings (const std::map<std::string, int32_t>& settings) { +void ConfigurationManager::setAddressbookSettings (const std::map<std::string, int32_t>& settings) +{ Manager::instance().setAddressbookSettings (settings); } -std::vector< std::string > ConfigurationManager::getAddressbookList ( void ) { +std::vector< std::string > ConfigurationManager::getAddressbookList (void) +{ return Manager::instance().getAddressbookList(); } -void ConfigurationManager::setAddressbookList( const std::vector< std::string >& list ) { - _debug("Manager received setAddressbookList") ; - Manager::instance().setAddressbookList(list); +void ConfigurationManager::setAddressbookList (const std::vector< std::string >& list) +{ + _debug ("Manager received setAddressbookList\n") ; + Manager::instance().setAddressbookList (list); } -std::map<std::string,std::string> ConfigurationManager::getHookSettings (void) { +std::map<std::string,std::string> ConfigurationManager::getHookSettings (void) +{ return Manager::instance().getHookSettings (); } -void ConfigurationManager::setHookSettings (const std::map<std::string, std::string>& settings) { +void ConfigurationManager::setHookSettings (const std::map<std::string, std::string>& settings) +{ Manager::instance().setHookSettings (settings); } -void ConfigurationManager::setAccountsOrder (const std::string& order) { +void ConfigurationManager::setAccountsOrder (const std::string& order) +{ Manager::instance().setAccountsOrder (order); } +std::map <std::string, std::string> ConfigurationManager::getHistory (void) +{ + return Manager::instance().send_history_to_client (); +} + +void ConfigurationManager::setHistory (const std::map <std::string, std::string>& entries) +{ + Manager::instance().receive_history_from_client (entries); +} diff --git a/sflphone-common/src/dbus/configurationmanager.h b/sflphone-common/src/dbus/configurationmanager.h index 70364ca917439a58d1b8a26e18bc5f29a9fc25ef..128f80e9605ba0a2baf1b48ad127e696290f24f8 100644 --- a/sflphone-common/src/dbus/configurationmanager.h +++ b/sflphone-common/src/dbus/configurationmanager.h @@ -82,9 +82,15 @@ public: int32_t getDialpad( void ); void setDialpad( void ); int32_t getSearchbar( void ); + void setSearchbar( void ); - void setMaxCalls( const int32_t& calls); - int32_t getMaxCalls( void ); + + void setHistoryLimit( const int32_t& days); + int32_t getHistoryLimit (void); + + void setHistoryEnabled (void); + int32_t getHistoryEnabled (void); + int32_t getVolumeControls( void ); void setVolumeControls( void ); int32_t isStartHidden( void ); @@ -113,6 +119,9 @@ public: std::map<std::string, std::string> getHookSettings (void); void setHookSettings (const std::map<std::string, std::string>& settings); + + std::map <std::string, std::string> getHistory (void); + void setHistory (const std::map <std::string, std::string>& entries); }; diff --git a/sflphone-common/src/dbus/contactmanager.cpp b/sflphone-common/src/dbus/contactmanager.cpp index 885585c40ec05bfdf682b9263a78abf9b9222032..2764d30e56ff2b75382a45e401b2f3a113ad5db9 100644 --- a/sflphone-common/src/dbus/contactmanager.cpp +++ b/sflphone-common/src/dbus/contactmanager.cpp @@ -1,17 +1,17 @@ /* * Copyright (C) 2008 Savoir-Faire Linux inc. * 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 * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. @@ -23,27 +23,27 @@ const char* ContactManager::SERVER_PATH = "/org/sflphone/SFLphone/ContactManager"; std::map< std::string, std::string > -ContactManager::getContacts( const std::string& accountID UNUSED) +ContactManager::getContacts (const std::string& accountID UNUSED) { - // TODO + // TODO std::map< std::string, std::string > ret; return ret; } void -ContactManager::setContacts( const std::string& accountID UNUSED, const std::map< std::string UNUSED, std::string >& details UNUSED) +ContactManager::setContacts (const std::string& accountID UNUSED, const std::map< std::string UNUSED, std::string >& details UNUSED) { - // TODO + // TODO } void -ContactManager::setPresence( const std::string& accountID UNUSED, const std::string& presence UNUSED, const std::string& additionalInfo UNUSED) +ContactManager::setPresence (const std::string& accountID UNUSED, const std::string& presence UNUSED, const std::string& additionalInfo UNUSED) { - // TODO + // TODO } void -ContactManager::setContactPresence( const std::string& accountID UNUSED, const std::string& presence UNUSED, const std::string& additionalInfo UNUSED) +ContactManager::setContactPresence (const std::string& accountID UNUSED, const std::string& presence UNUSED, const std::string& additionalInfo UNUSED) { - // TODO + // TODO } diff --git a/sflphone-common/src/dbus/dbusmanagerimpl.cpp b/sflphone-common/src/dbus/dbusmanagerimpl.cpp index c2103892f70153549b301c480350c8037e60a0a0..fce993fd79ff3bef80848d87f77540c26a99f367 100644 --- a/sflphone-common/src/dbus/dbusmanagerimpl.cpp +++ b/sflphone-common/src/dbus/dbusmanagerimpl.cpp @@ -1,53 +1,54 @@ /* * Copyright (C) 2007 Savoir-Faire Linux inc. * Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@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 * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ - + #include <dbusmanagerimpl.h> #include "manager.h" const char* DBusManagerImpl::SERVER_NAME = "org.sflphone.SFLphone"; -int -DBusManagerImpl::exec(){ - +int +DBusManagerImpl::exec() +{ + DBus::default_dispatcher = &_dispatcher; DBus::Connection conn = DBus::Connection::SessionBus(); - conn.request_name(SERVER_NAME); + conn.request_name (SERVER_NAME); - _callManager = new CallManager(conn); - _configurationManager = new ConfigurationManager(conn); - _instanceManager = new Instance(conn); + _callManager = new CallManager (conn); + _configurationManager = new ConfigurationManager (conn); + _instanceManager = new Instance (conn); // Register accounts Manager::instance().initRegisterAccounts(); //getEvents(); - _debug("Starting DBus event loop\n"); + _debug ("Starting DBus event loop\n"); _dispatcher.enter(); return 1; } - + void DBusManagerImpl::exit() { - + _dispatcher.leave(); - + } diff --git a/sflphone-common/src/dbus/instance.cpp b/sflphone-common/src/dbus/instance.cpp index 4e880722e75e7dc87a1ef72670befed9447eb082..233978ae630d03f1425977a42a3ba1a1b309389c 100644 --- a/sflphone-common/src/dbus/instance.cpp +++ b/sflphone-common/src/dbus/instance.cpp @@ -1,17 +1,17 @@ /* * Copyright (C) 2007 Savoir-Faire Linux inc. * Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@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 * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. @@ -22,30 +22,30 @@ const char* Instance::SERVER_PATH = "/org/sflphone/SFLphone/Instance"; -Instance::Instance( DBus::Connection& connection ) -: DBus::ObjectAdaptor(connection, SERVER_PATH) +Instance::Instance (DBus::Connection& connection) + : DBus::ObjectAdaptor (connection, SERVER_PATH) { - count = 0; + count = 0; } void -Instance::Register( const int32_t& pid UNUSED, - const std::string& name UNUSED) +Instance::Register (const int32_t& pid UNUSED, + const std::string& name UNUSED) { - _debug("Instance::register received\n"); + _debug ("Instance::register received\n"); count++; } void -Instance::Unregister( const int32_t& pid UNUSED) +Instance::Unregister (const int32_t& pid UNUSED) { - _debug("Instance::unregister received\n"); + _debug ("Instance::unregister received\n"); count --; - if(count <= 0) - { - + if (count <= 0) { + + Manager::instance().terminate(); DBusManager::instance().exit(); @@ -53,11 +53,11 @@ Instance::Unregister( const int32_t& pid UNUSED) } } -int32_t -Instance::getRegistrationCount( void ) +int32_t +Instance::getRegistrationCount (void) { - - return count; + + return count; } diff --git a/sflphone-common/src/dbus/org.sflphone.SFLphone.service.in b/sflphone-common/src/dbus/org.sflphone.SFLphone.service.in index 031173b777cc5a516d135beb81ebd312322f860e..b319dd220161c1133bd7afa711ec843b565fb828 100644 --- a/sflphone-common/src/dbus/org.sflphone.SFLphone.service.in +++ b/sflphone-common/src/dbus/org.sflphone.SFLphone.service.in @@ -1,3 +1,3 @@ [D-BUS Service] Name=org.sflphone.SFLphone -Exec=bindir/sflphoned +Exec=libexec/sflphoned diff --git a/sflphone-common/src/eventthread.cpp b/sflphone-common/src/eventthread.cpp index 0ecc444b41b1f2bdc52167d6796859d4173bf983..b111c11c1b7e83fa61bba2c51e48c93641fcfa1b 100644 --- a/sflphone-common/src/eventthread.cpp +++ b/sflphone-common/src/eventthread.cpp @@ -6,12 +6,12 @@ * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. @@ -22,39 +22,39 @@ #include "audio/alsalayer.h" /********************************** Voiplink thread *************************************/ -EventThread::EventThread( VoIPLink *link ) - : Thread(), _linkthread(link) +EventThread::EventThread (VoIPLink *link) + : Thread(), _linkthread (link) { - setCancel( cancelDeferred ); + setCancel (cancelDeferred); } /** - * Reimplementation of run() + * Reimplementation of run() */ -void EventThread::run (void) +void EventThread::run (void) { - while(!testCancel()) { - _linkthread->getEvent(); - } -} + while (!testCancel()) { + _linkthread->getEvent(); + } +} /********************************************************************************************/ AudioThread::AudioThread (AlsaLayer *alsa) - : Thread(), _alsa(alsa) + : Thread(), _alsa (alsa) { setCancel (cancelDeferred); } /** - * Reimplementation of run() + * Reimplementation of run() */ -void AudioThread::run (void) +void AudioThread::run (void) { - while(!testCancel()) { + while (!testCancel()) { _alsa->audioCallback(); - Thread::sleep(3); + Thread::sleep (3); } } diff --git a/sflphone-common/src/global.h b/sflphone-common/src/global.h index 56b5e2f43cff576e5462b945327b54339d2822b1..d08d9ce8524dddad65ddb2831421baf27eaa2d62 100644 --- a/sflphone-common/src/global.h +++ b/sflphone-common/src/global.h @@ -32,7 +32,7 @@ #include <map> #include <vector> -#define SFLPHONED_VERSION "0.9.5~beta" /** Version number */ +#define SFLPHONED_VERSION "0.9.6~beta" /** Version number */ #define HOMEDIR (getenv ("HOME")) /** Home directory */ diff --git a/sflphone-common/src/history/Makefile.am b/sflphone-common/src/history/Makefile.am new file mode 100644 index 0000000000000000000000000000000000000000..843782642e70135c44b95385a0d22671618925c0 --- /dev/null +++ b/sflphone-common/src/history/Makefile.am @@ -0,0 +1,11 @@ +include ../../globals.mak + +SUBDIRS = + +noinst_LTLIBRARIES = libhistory.la + +libhistory_la_SOURCES = \ + historyitem.h \ + historyitem.cpp \ + historymanager.h \ + historymanager.cpp diff --git a/sflphone-common/src/history/historyitem.cpp b/sflphone-common/src/history/historyitem.cpp new file mode 100644 index 0000000000000000000000000000000000000000..90a5ff02a5706d8eb75b89790bfb0052cef06f86 --- /dev/null +++ b/sflphone-common/src/history/historyitem.cpp @@ -0,0 +1,132 @@ +/* + * Copyright (C) 2009 Savoir-Faire Linux inc. + * + * Author: Emmanuel Milou <emmanuel.milou@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 + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include <historyitem.h> +#include <sstream> +#include "stdlib.h" +#include <manager.h> + +#define ITEM_SEPARATOR "|" +#define EMPTY_STRING "empty" + +HistoryItem::HistoryItem (std::string timestamp_start, CallType call_type, std::string timestamp_stop, std::string name, std::string number, std::string account_id) + : _timestamp_start (timestamp_start), _call_type (call_type), _timestamp_stop (timestamp_stop), _name (name), _number (number), _account_id (account_id) +{ +} + + +HistoryItem::HistoryItem (std::string timestamp, std::string serialized_form) + : _timestamp_start (timestamp) +{ + size_t pos; + std::string tmp, id, name, number, stop, account; + int indice=0; + + while (serialized_form.find (ITEM_SEPARATOR, 0) != std::string::npos) { + pos = serialized_form.find (ITEM_SEPARATOR, 0); + tmp = serialized_form.substr (0, pos); + serialized_form.erase (0, pos + 1); + + switch (indice) { + + case 0: // The call type + id = tmp; + break; + + case 1: // The number field + number = tmp; + break; + + case 2: // The name field + name = tmp; + break; + + case 3: // The end timestamp + stop = tmp; + break; + + case 4: // The account ID + account = tmp; + break; + + default: // error + std::cout <<"[ERROR] unserialized form not recognized."<<std::endl; + break; + } + + indice ++; + } + + _call_type = (CallType) atoi (id.c_str()); + + _number = number; + (name == EMPTY_STRING) ? _name = "" : _name = name; + _timestamp_stop = stop; + (serialized_form == EMPTY_STRING) ? _account_id = "" : _account_id=serialized_form ; +} + +HistoryItem::~HistoryItem () +{ + // TODO +} + +bool HistoryItem::save (Conf::ConfigTree **history) +{ + + std::string section, timestamp; + std::stringstream call_type; + bool res; + + // The section is : "[" + timestamp = "]" + section = get_timestamp (); + call_type << _call_type; + + res = ( (*history)->setConfigTreeItem (section, "type", call_type.str()) + && (*history)->setConfigTreeItem (section, "timestamp_stop", _timestamp_stop) + && (*history)->setConfigTreeItem (section, "number", _number) + && (*history)->setConfigTreeItem (section, "accountid", _account_id) + && (*history)->setConfigTreeItem (section, "name", _name)); + + return res; +} + +std::string HistoryItem::serialize (void) +{ + std::stringstream res; + std::string separator = ITEM_SEPARATOR; + std::string name, accountID; + + // Replace empty string with a valid standard string value + (_name == "") ? name = EMPTY_STRING : name = _name; + // For the account ID, check also if the accountID corresponds to an existing account + // ie the account may have been removed + (_account_id == "" || non_valid_account (_account_id)) ? accountID = "empty" : accountID = _account_id; + + // Serialize it + res << _call_type << separator << _number << separator << name << separator << _timestamp_stop << separator << accountID; + + return res.str(); +} + + +bool HistoryItem::non_valid_account (std::string id) +{ + return !Manager::instance().accountExists (id); +} diff --git a/sflphone-common/src/history/historyitem.h b/sflphone-common/src/history/historyitem.h new file mode 100644 index 0000000000000000000000000000000000000000..1d429a26e745cd2590561517b20dd24e94ef097d --- /dev/null +++ b/sflphone-common/src/history/historyitem.h @@ -0,0 +1,93 @@ +/* + * Copyright (C) 2009 Savoir-Faire Linux inc. + * + * Author: Emmanuel Milou <emmanuel.milou@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 + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#ifndef _HISTORY_ITEM +#define _HISTORY_ITEM + +#include <string> +#include <config/config.h> +#include <iostream> + +typedef enum CallType { + CALL_MISSED, + CALL_INCOMING, + CALL_OUTGOING +}CallType; + + +class HistoryItem { + + public: + /* + * Constructor + */ + HistoryItem (std::string, CallType, std::string, std::string, std::string, std::string=""); + + /* + * Constructor from a serialized form + */ + HistoryItem (std::string, std::string=""); + + /* + * Destructor + */ + ~HistoryItem (); + + inline std::string get_timestamp () { + return _timestamp_start; + } + + bool save (Conf::ConfigTree **history); + + std::string serialize (void); + + private: + + /* + * @return true if the account ID corresponds to a loaded account + */ + bool non_valid_account (std::string); + + /* + * Timestamp representing the date of the call + */ + std::string _timestamp_start; + std::string _timestamp_stop; + + /* + * Represents the type of call + * Has be either CALL_MISSED, CALL_INCOMING or CALL_OUTGOING + */ + CallType _call_type; + + /* + * The information about the callee/caller, depending on the type of call. + */ + std::string _name; + std::string _number; + + /* + * The account the call was made with + */ + std::string _account_id; +}; + + +#endif // HISTORY_ITEM diff --git a/sflphone-common/src/history/historymanager.cpp b/sflphone-common/src/history/historymanager.cpp new file mode 100644 index 0000000000000000000000000000000000000000..8cb5fc7b9f64e24c53a574509da95bc2e8412c64 --- /dev/null +++ b/sflphone-common/src/history/historymanager.cpp @@ -0,0 +1,249 @@ +/* + * Copyright (C) 2009 Savoir-Faire Linux inc. + * + * Author: Emmanuel Milou <emmanuel.milou@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 + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include <historymanager.h> +#include <errno.h> +#include <cc++/file.h> +#include <time.h> + +HistoryManager::HistoryManager () : _history_loaded (false), _history_path ("") +{ + +} + +HistoryManager::~HistoryManager () +{ + + // Clear the history map + _history_items.clear (); +} + +int HistoryManager::load_history (int limit, std::string path) +{ + Conf::ConfigTree history_list; + + create_history_path (path); + load_history_from_file (&history_list); + return load_history_items_map (&history_list, limit); +} + +bool HistoryManager::save_history (void) +{ + Conf::ConfigTree history_list; + + save_history_items_map (&history_list); + return save_history_to_file (&history_list); +} + +bool HistoryManager::load_history_from_file (Conf::ConfigTree *history_list) +{ + bool exist; + + exist = history_list->populateFromFile (_history_path); + _history_loaded = (exist == 2) ? false : true; + + return exist; +} + +int HistoryManager::load_history_items_map (Conf::ConfigTree *history_list, int limit) +{ + + short nb_items = 0; + Conf::TokenList sections; + HistoryItem *item; + Conf::TokenList::iterator iter; + std::string number, name, accountID, timestamp_start, timestamp_stop; + CallType type; + int history_limit; + time_t current_timestamp; + + // We want to save only the items recent enough (ie compared to CONFIG_HISTORY_LIMIT) + // Get the current timestamp + (void) time (¤t_timestamp); + history_limit = get_unix_timestamp_equivalent (limit); + + sections = history_list->getSections(); + iter = sections.begin(); + + while (iter != sections.end()) { + + type = (CallType) getConfigInt (*iter, "type", history_list); + timestamp_stop = getConfigString (*iter, "timestamp_stop", history_list); + name = getConfigString (*iter, "name", history_list); + number = getConfigString (*iter, "number", history_list); + accountID = getConfigString (*iter, "accountid", history_list); + timestamp_start = *iter; + + // Make a check on the start timestamp to know it is loadable according to CONFIG_HISTORY_LIMIT + + if (atoi (timestamp_start.c_str ()) >= ( (int) current_timestamp - history_limit)) { + item = new HistoryItem (timestamp_start, type, timestamp_stop, name, number, accountID); + add_new_history_entry (item); + nb_items ++; + } + + iter ++; + } + + return nb_items; +} + +bool HistoryManager::save_history_to_file (Conf::ConfigTree *history_list) +{ + return history_list->saveConfigTree (_history_path.data()); +} + + +int HistoryManager::save_history_items_map (Conf::ConfigTree *history_list) +{ + HistoryItemMap::iterator iter; + HistoryItem *item; + int items_saved = 0; + + iter = _history_items.begin (); + + while (iter != _history_items.end ()) { + item = iter->second; + + if (item) { + if (item->save (&history_list)) + items_saved ++; + } else { + std::cout << "[DEBUG]: can't save NULL history item." << std::endl; + } + + iter ++; + } + + return items_saved; +} + +void HistoryManager::add_new_history_entry (HistoryItem *new_item) +{ + // Add it in the map + _history_items [new_item->get_timestamp () ] = new_item; +} + +int HistoryManager::create_history_path (std::string path) +{ + + std::string filename; + + if (path == "") { + filename = std::string (HOMEDIR) + DIR_SEPARATOR_STR + "." + PROGDIR; + + if (mkdir (filename.data(), 0755) != 0) { + // If directory creation failed + if (errno != EEXIST) { + _debug ("Cannot create directory: %s\n", strerror (errno)); + return -1; + } + } + + // Load user's history + _history_path = filename + DIR_SEPARATOR_STR + "history"; + } else + set_history_path (path); + + + return 0; +} + +// throw an Conf::ConfigTreeItemException if not found +int +HistoryManager::getConfigInt (const std::string& section, const std::string& name, Conf::ConfigTree *history_list) +{ + try { + return history_list->getConfigTreeItemIntValue (section, name); + } catch (Conf::ConfigTreeItemException& e) { + throw e; + } + + return 0; +} + +std::string +HistoryManager::getConfigString (const std::string& section, const std::string& name, Conf::ConfigTree *history_list) +{ + try { + return history_list->getConfigTreeItemValue (section, name); + } catch (Conf::ConfigTreeItemException& e) { + throw e; + } + + return ""; +} + +std::map <std::string, std::string> HistoryManager::get_history_serialized (void) +{ + std::map <std::string, std::string> serialized; + HistoryItemMap::iterator iter; + HistoryItem *current; + std::string res, key; + + iter = _history_items.begin (); + + while (iter != _history_items.end()) { + current = iter->second; + + if (current) { + key = current->get_timestamp (); + res = current->serialize (); + serialized [key] = res; + } + + iter ++; + } + + return serialized; +} + + +int HistoryManager::set_serialized_history (std::map <std::string, std::string> history, int limit) +{ + std::map <std::string, std::string>::iterator iter; + HistoryItem *new_item; + int items_added = 0; + int history_limit; + time_t current_timestamp; + + // Clear the existing history + _history_items.clear (); + + // We want to save only the items recent enough (ie compared to CONFIG_HISTORY_LIMIT) + // Get the current timestamp + (void) time (¤t_timestamp); + history_limit = get_unix_timestamp_equivalent (limit); + iter = history.begin (); + + while (iter != history.end ()) { + if (atoi (iter->first.c_str ()) >= ( (int) current_timestamp - history_limit)) { + new_item = new HistoryItem (iter->first, iter->second); + add_new_history_entry (new_item); + items_added ++; + } + + iter ++; + } + + return items_added; +} + + diff --git a/sflphone-common/src/history/historymanager.h b/sflphone-common/src/history/historymanager.h new file mode 100644 index 0000000000000000000000000000000000000000..7fadbcdadc57e7badfb6bba9ce0db59981db9bb8 --- /dev/null +++ b/sflphone-common/src/history/historymanager.h @@ -0,0 +1,138 @@ +/* + * Copyright (C) 2009 Savoir-Faire Linux inc. + * + * Author: Emmanuel Milou <emmanuel.milou@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 + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#ifndef _HISTORY_MANAGER +#define _HISTORY_MANAGER + +#include "historyitem.h" +#include <global.h> +#include <user_cfg.h> + +#define DAY_UNIX_TIMESTAMP 86400 // Number of seconds in one day: 60 x 60 x 24 + +typedef std::map <std::string, HistoryItem*> HistoryItemMap; + +class HistoryManager { + + public: + /* + * Constructor + */ + HistoryManager (); + + /* + * Destructor + */ + ~HistoryManager (); + + /** + *@param path A specific file to use; if empty, use the global one + * + *@return int The number of history items succesfully loaded + */ + int load_history (int limit, std::string path=""); + + /** + *@return bool True if the history has been successfully saved in the file + */ + bool save_history (void); + + /* + * Load the history from a file to the dedicated data structure + */ + bool load_history_from_file (Conf::ConfigTree *history_list); + + /* + * @return int The number of history items loaded + */ + int load_history_items_map (Conf::ConfigTree *history_list, int limit); + + /* + * Inverse method, ie save a data structure containing the history into a file + */ + bool save_history_to_file (Conf::ConfigTree *history_list); + + /** + * @return int The number of history entries successfully saved + */ + int save_history_items_map (Conf::ConfigTree *history_list); + + /** + *@return bool True if the history file has been successfully read + */ + inline bool is_loaded (void) { + return _history_loaded; + } + + inline void set_history_path (std::string filename) { + _history_path = filename; + } + + /* + *@return int The number of items found in the history file + */ + inline int get_history_size (void) { + return _history_items.size (); + } + + std::map <std::string, std::string> get_history_serialized (void); + + int set_serialized_history (std::map <std::string, std::string> history, int limit); + + private: + inline int get_unix_timestamp_equivalent (int days) + { + return days * DAY_UNIX_TIMESTAMP; + } + + int getConfigInt(const std::string& section, const std::string& name, Conf::ConfigTree *history_list); + std::string getConfigString(const std::string& section, const std::string& name, Conf::ConfigTree *history_list); + + /* + * Set the path to the history file + * + * @param path A specific file to use; if empty, use the global one + */ + int create_history_path (std::string path=""); + /* + * Add a new history item in the data structure + */ + void add_new_history_entry (HistoryItem *new_item); + + /* + * Map containing the history items + */ + HistoryItemMap _history_items; + + /* + * The path to the history file + */ + + std::string _history_path; + + /* + * History has been loaded + */ + bool _history_loaded; + + friend class HistoryTest; +}; + +#endif //_HISTORY_MANAGER diff --git a/sflphone-common/src/hooks/urlhook.cpp b/sflphone-common/src/hooks/urlhook.cpp index 5ea82be051405b307673a57be22641962c2ed8c9..cdf27b8fa009be54f15229ee7b4e941641fe173f 100644 --- a/sflphone-common/src/hooks/urlhook.cpp +++ b/sflphone-common/src/hooks/urlhook.cpp @@ -24,7 +24,8 @@ UrlHook::UrlHook () { } UrlHook::~UrlHook () { } -int UrlHook::addAction (std::string field_value, std::string command){ +int UrlHook::addAction (std::string field_value, std::string command) +{ std::string command_bg; diff --git a/sflphone-common/src/iaxaccount.cpp b/sflphone-common/src/iaxaccount.cpp index 504a1cc7106dfa7d1c441a64b7a186fc584152bd..48e2eb691c803759f794de851e345e2f788bbe55 100644 --- a/sflphone-common/src/iaxaccount.cpp +++ b/sflphone-common/src/iaxaccount.cpp @@ -3,17 +3,17 @@ * * Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com> * Author: Alexandre Bourget <alexandre.bourget@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 * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. @@ -22,10 +22,10 @@ #include "iaxaccount.h" #include "iaxvoiplink.h" -IAXAccount::IAXAccount(const AccountID& accountID) - : Account(accountID, "iax2") +IAXAccount::IAXAccount (const AccountID& accountID) + : Account (accountID, "iax2") { - _link = new IAXVoIPLink(accountID); + _link = new IAXVoIPLink (accountID); } @@ -40,26 +40,26 @@ int IAXAccount::registerVoIPLink() _link->init(); // Stuff needed for IAX registration - setHostname(Manager::instance().getConfigString(_accountID, HOSTNAME)); - setUsername(Manager::instance().getConfigString(_accountID, USERNAME)); - setPassword(Manager::instance().getConfigString(_accountID, PASSWORD)); + setHostname (Manager::instance().getConfigString (_accountID, HOSTNAME)); + setUsername (Manager::instance().getConfigString (_accountID, USERNAME)); + setPassword (Manager::instance().getConfigString (_accountID, PASSWORD)); - _link->sendRegister( _accountID ); + _link->sendRegister (_accountID); return SUCCESS; } - int +int IAXAccount::unregisterVoIPLink() { - _link->sendUnregister( _accountID ); + _link->sendUnregister (_accountID); _link->terminate(); return SUCCESS; } - void -IAXAccount::loadConfig() +void +IAXAccount::loadConfig() { // Account generic Account::loadConfig(); diff --git a/sflphone-common/src/iaxcall.cpp b/sflphone-common/src/iaxcall.cpp index c2fc71c6ba70db21e319975479a6a4df8eec571c..bdf93923288a97974da821f01abdd11a9d142892 100644 --- a/sflphone-common/src/iaxcall.cpp +++ b/sflphone-common/src/iaxcall.cpp @@ -21,34 +21,46 @@ #include "iaxcall.h" #include "global.h" // for _debug -IAXCall::IAXCall(const CallID& id, Call::CallType type) : Call(id, type), _session(NULL) +IAXCall::IAXCall (const CallID& id, Call::CallType type) : Call (id, type), _session (NULL) { } -IAXCall::~IAXCall() +IAXCall::~IAXCall() { - _session = NULL; // just to be sure to don't have unknown pointer, do not delete it! + _session = NULL; // just to be sure to don't have unknown pointer, do not delete it! } void -IAXCall::setFormat(int format) +IAXCall::setFormat (int format) { - _format = format; - switch(format) { - case AST_FORMAT_ULAW: - setAudioCodec(PAYLOAD_CODEC_ULAW); break; - case AST_FORMAT_GSM: - setAudioCodec(PAYLOAD_CODEC_GSM); break; - case AST_FORMAT_ALAW: - setAudioCodec(PAYLOAD_CODEC_ALAW); break; - case AST_FORMAT_ILBC: - setAudioCodec(PAYLOAD_CODEC_ILBC_20); break; - case AST_FORMAT_SPEEX: - setAudioCodec(PAYLOAD_CODEC_SPEEX_8000); break; - default: - setAudioCodec((AudioCodecType) -1); - break; - } + _format = format; + + switch (format) { + + case AST_FORMAT_ULAW: + setAudioCodec (PAYLOAD_CODEC_ULAW); + break; + + case AST_FORMAT_GSM: + setAudioCodec (PAYLOAD_CODEC_GSM); + break; + + case AST_FORMAT_ALAW: + setAudioCodec (PAYLOAD_CODEC_ALAW); + break; + + case AST_FORMAT_ILBC: + setAudioCodec (PAYLOAD_CODEC_ILBC_20); + break; + + case AST_FORMAT_SPEEX: + setAudioCodec (PAYLOAD_CODEC_SPEEX_8000); + break; + + default: + setAudioCodec ( (AudioCodecType) -1); + break; + } } @@ -61,66 +73,89 @@ IAXCall::getSupportedFormat() map = getCodecMap().getActiveCodecs(); - for(iter=0 ; iter < map.size() ; iter++){ - switch(map[iter]) { - case PAYLOAD_CODEC_ULAW: - format |= AST_FORMAT_ULAW; break; - case PAYLOAD_CODEC_GSM: - format |= AST_FORMAT_GSM; break; - case PAYLOAD_CODEC_ALAW: - format |= AST_FORMAT_ALAW; break; - case PAYLOAD_CODEC_ILBC_20: - format |= AST_FORMAT_ILBC; break; - case PAYLOAD_CODEC_SPEEX_8000: - format |= AST_FORMAT_SPEEX; - break; - default: - break; + for (iter=0 ; iter < map.size() ; iter++) { + switch (map[iter]) { + + case PAYLOAD_CODEC_ULAW: + format |= AST_FORMAT_ULAW; + break; + + case PAYLOAD_CODEC_GSM: + format |= AST_FORMAT_GSM; + break; + + case PAYLOAD_CODEC_ALAW: + format |= AST_FORMAT_ALAW; + break; + + case PAYLOAD_CODEC_ILBC_20: + format |= AST_FORMAT_ILBC; + break; + + case PAYLOAD_CODEC_SPEEX_8000: + format |= AST_FORMAT_SPEEX; + break; + + default: + break; + } } - } - return format; + + return format; } int -IAXCall::getFirstMatchingFormat(int needles) +IAXCall::getFirstMatchingFormat (int needles) { - CodecOrder map = getCodecMap().getActiveCodecs(); - int format = 0; - unsigned int iter; - - for(iter=0 ; iter < map.size() ; iter++) { - switch(map[iter]) { - case PAYLOAD_CODEC_ULAW: - format = AST_FORMAT_ULAW; break; - case PAYLOAD_CODEC_GSM: - format = AST_FORMAT_GSM; break; - case PAYLOAD_CODEC_ALAW: - format = AST_FORMAT_ALAW; - break; - case PAYLOAD_CODEC_ILBC_20: - format = AST_FORMAT_ILBC; break; - case PAYLOAD_CODEC_SPEEX_8000: - format = AST_FORMAT_SPEEX; break; - default: - break; + CodecOrder map = getCodecMap().getActiveCodecs(); + int format = 0; + unsigned int iter; + + for (iter=0 ; iter < map.size() ; iter++) { + switch (map[iter]) { + + case PAYLOAD_CODEC_ULAW: + format = AST_FORMAT_ULAW; + break; + + case PAYLOAD_CODEC_GSM: + format = AST_FORMAT_GSM; + break; + + case PAYLOAD_CODEC_ALAW: + format = AST_FORMAT_ALAW; + break; + + case PAYLOAD_CODEC_ILBC_20: + format = AST_FORMAT_ILBC; + break; + + case PAYLOAD_CODEC_SPEEX_8000: + format = AST_FORMAT_SPEEX; + break; + + default: + break; + } + + // Return the first that matches + if (format & needles) + return format; + } - // Return the first that matches - if (format & needles) - return format; - - } - return 0; + + return 0; } CodecDescriptor& IAXCall::getCodecMap() { - return _codecMap; + return _codecMap; } AudioCodecType IAXCall::getAudioCodec() { - return _audioCodec; + return _audioCodec; } diff --git a/sflphone-common/src/iaxvoiplink.cpp b/sflphone-common/src/iaxvoiplink.cpp index e15f22f50fb472fb49748505ef4921258d41db2e..a5b29b3850ae9ef94e26194abcaa0b771a04af2f 100644 --- a/sflphone-common/src/iaxvoiplink.cpp +++ b/sflphone-common/src/iaxvoiplink.cpp @@ -2,17 +2,17 @@ * Copyright (C) 2006-2007 Savoir-Faire Linux inc. * Author: Alexandre Bourget <alexandre.bourget@savoirfairelinux.com> * Author: Yan Morin <yan.morin@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 * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. @@ -40,22 +40,22 @@ #define CHK_VALID_CALL if (call == NULL) { _debug("IAX: Call doesn't exists\n"); \ return false; } - IAXVoIPLink::IAXVoIPLink(const AccountID& accountID) -: VoIPLink(accountID) +IAXVoIPLink::IAXVoIPLink (const AccountID& accountID) + : VoIPLink (accountID) { // _debug("IAXVoIPLink::IAXVoIPLink : creating eventhread \n "); - _evThread = new EventThread(this); + _evThread = new EventThread (this); _regSession = NULL; _nextRefreshStamp = 0; // to get random number for RANDOM_PORT - srand (time(NULL)); + srand (time (NULL)); audiolayer = NULL; converter = new SamplerateConverter(); - int nbSamplesMax = (int) ( converter->getFrequence() * converter->getFramesize() / 1000 ); + int nbSamplesMax = (int) (converter->getFrequence() * converter->getFramesize() / 1000); micData = new SFLDataFormat[nbSamplesMax]; micDataConverted = new SFLDataFormat[nbSamplesMax]; @@ -70,7 +70,8 @@ IAXVoIPLink::~IAXVoIPLink() { - delete _evThread; _evThread = NULL; + delete _evThread; + _evThread = NULL; _regSession = NULL; // shall not delete it terminate(); @@ -78,15 +79,20 @@ IAXVoIPLink::~IAXVoIPLink() delete converter; - delete [] micData; micData = NULL; - delete [] micDataConverted; micDataConverted = NULL; - delete [] micDataEncoded; micDataEncoded = NULL; - - delete [] spkrDataDecoded; spkrDataDecoded = NULL; - delete [] spkrDataConverted; spkrDataConverted = NULL; + delete [] micData; + micData = NULL; + delete [] micDataConverted; + micDataConverted = NULL; + delete [] micDataEncoded; + micDataEncoded = NULL; + + delete [] spkrDataDecoded; + spkrDataDecoded = NULL; + delete [] spkrDataConverted; + spkrDataConverted = NULL; } - bool +bool IAXVoIPLink::init() { // If it was done, don't do it again, until we call terminate() @@ -94,24 +100,28 @@ IAXVoIPLink::init() return false; bool returnValue = false; + // _localAddress = "127.0.0.1"; // port 0 is default // iax_enable_debug(); have to enable debug when compiling iax... int port = IAX_DEFAULT_PORTNO; + int last_port = 0; + int nbTry = 3; while (port != IAX_FAILURE && nbTry) { last_port = port; - port = iax_init(port); - if ( port < 0 ) { - _debug("IAX Warning: already initialize on port %d\n", last_port); + port = iax_init (port); + + if (port < 0) { + _debug ("IAX Warning: already initialize on port %d\n", last_port); port = RANDOM_IAX_PORT; } else if (port == IAX_FAILURE) { - _debug("IAX Fail to start on port %d", last_port); + _debug ("IAX Fail to start on port %d", last_port); port = RANDOM_IAX_PORT; } else { - _debug("IAX Info: listening on port %d\n", last_port); + _debug ("IAX Info: listening on port %d\n", last_port); _localPort = last_port; returnValue = true; _evThread->start(); @@ -119,68 +129,77 @@ IAXVoIPLink::init() audiolayer = Manager::instance().getAudioDriver(); break; } + nbTry--; - initDone(true); + initDone (true); } + if (port == IAX_FAILURE || nbTry==0) { - _debug("Fail to initialize iax\n"); + _debug ("Fail to initialize iax\n"); - initDone(false); + initDone (false); } return returnValue; } - void +void IAXVoIPLink::terminate() { // If it was done, don't do it again, until we call init() if (!initDone()) return; - // iaxc_shutdown(); + // iaxc_shutdown(); // Hangup all calls terminateIAXCall(); - initDone(false); + initDone (false); } - void +void IAXVoIPLink::terminateIAXCall() { std::string reason = "Dumped Call"; - ost::MutexLock m(_callMapMutex); + ost::MutexLock m (_callMapMutex); CallMap::iterator iter = _callMap.begin(); IAXCall *call; - while( iter != _callMap.end() ) { - call = dynamic_cast<IAXCall*>(iter->second); + + while (iter != _callMap.end()) { + call = dynamic_cast<IAXCall*> (iter->second); + if (call) { _mutexIAX.enterMutex(); - iax_hangup(call->getSession(), (char*)reason.c_str()); + iax_hangup (call->getSession(), (char*) reason.c_str()); _mutexIAX.leaveMutex(); - call->setSession(NULL); - delete call; call = NULL; + call->setSession (NULL); + delete call; + call = NULL; } + iter++; } + _callMap.clear(); } -void IAXVoIPLink::terminateOneCall(const CallID& id) +void IAXVoIPLink::terminateOneCall (const CallID& id) { - IAXCall* call = getIAXCall(id); - if(call){ - _debug("IAXVoIPLink::terminateOneCall()::the call is deleted, should close recording file \n"); - delete call; call = 0; + IAXCall* call = getIAXCall (id); + + if (call) { + _debug ("IAXVoIPLink::terminateOneCall()::the call is deleted, should close recording file \n"); + delete call; + call = 0; } } - void -IAXVoIPLink::getEvent() +void +IAXVoIPLink::getEvent() { IAXCall* call = NULL; @@ -188,7 +207,7 @@ IAXVoIPLink::getEvent() _mutexIAX.enterMutex(); iax_event* event = NULL; - while ( (event = iax_get_event(IAX_NONBLOCKING)) != NULL ) { + while ( (event = iax_get_event (IAX_NONBLOCKING)) != NULL) { // If we received an 'ACK', libiax2 tells apps to ignore them. if (event->etype == IAX_EVENT_NULL) { continue; @@ -196,53 +215,53 @@ IAXVoIPLink::getEvent() //_debug ("Receive IAX Event: %d (0x%x)\n", event->etype, event->etype); - call = iaxFindCallBySession(event->session); + call = iaxFindCallBySession (event->session); if (call) { // We know that call, deal with it - iaxHandleCallEvent(event, call); - //_audiocodec = Manager::instance().getCodecDescriptorMap().getCodec( call -> getAudioCodec() ); - } - else if (event->session && event->session == _regSession) { + iaxHandleCallEvent (event, call); + //_audiocodec = Manager::instance().getCodecDescriptorMap().getCodec( call -> getAudioCodec() ); + } else if (event->session && event->session == _regSession) { // This is a registration session, deal with it - iaxHandleRegReply(event); - } - else { + iaxHandleRegReply (event); + } else { // We've got an event before it's associated with any call - iaxHandlePrecallEvent(event); + iaxHandlePrecallEvent (event); } // _debug("IAXVoIPLink::getEvent() : timestamp %i \n",event->ts); - iax_event_free(event); + iax_event_free (event); } + _mutexIAX.leaveMutex(); - - if(call){ - call->recAudio.recData(spkrDataConverted,micData,nbSampleForRec_,nbSampleForRec_); + + if (call) { + call->recAudio.recData (spkrDataConverted,micData,nbSampleForRec_,nbSampleForRec_); } // Do the doodle-moodle to send audio from the microphone to the IAX channel. sendAudioFromMic(); // Refresh registration. - if (_nextRefreshStamp && _nextRefreshStamp - 2 < time(NULL)) { - sendRegister(""); + if (_nextRefreshStamp && _nextRefreshStamp - 2 < time (NULL)) { + sendRegister (""); } - + // reinitialize speaker buffer for recording (when recording a voice mail) for (int i = 0; i < nbSampleForRec_; i++) spkrDataConverted[i] = 0; - + // thread wait 3 millisecond - _evThread->sleep(3); - free(event); + _evThread->sleep (3); + + free (event); } - void -IAXVoIPLink::sendAudioFromMic(void) +void +IAXVoIPLink::sendAudioFromMic (void) { // _debug("IAXVoIPLink::sendAudioFromMic"); @@ -254,14 +273,14 @@ IAXVoIPLink::sendAudioFromMic(void) // TODO Find out a better way to do it updateAudiolayer(); - currentCall = getIAXCall(Manager::instance().getCurrentCallId()); + currentCall = getIAXCall (Manager::instance().getCurrentCallId()); if (!currentCall) { // Let's mind our own business. return; } - if( currentCall -> getAudioCodec() < 0 ) + if (currentCall -> getAudioCodec() < 0) return; // Just make sure the currentCall is in state to receive audio right now. @@ -274,13 +293,15 @@ IAXVoIPLink::sendAudioFromMic(void) return; } - ac = currentCall->getCodecMap().getCodec( currentCall -> getAudioCodec() ); + ac = currentCall->getCodecMap().getCodec (currentCall -> getAudioCodec()); + if (!ac) { // Audio codec still not determined. if (audiolayer) { // To keep latency low.. audiolayer->flushMic(); } + return; } @@ -289,7 +310,7 @@ IAXVoIPLink::sendAudioFromMic(void) // we have to get 20ms of data from the mic *20/1000 = /50 // rate/50 shall be lower than IAX__20S_48KHZ_MAX - maxBytesToGet = audiolayer->getSampleRate()* audiolayer->getFrameSize() / 1000 * sizeof(SFLDataFormat); + maxBytesToGet = audiolayer->getSampleRate() * audiolayer->getFrameSize() / 1000 * sizeof (SFLDataFormat); // available bytes inside ringbuffer availBytesFromMic = audiolayer->canGetMic(); @@ -301,57 +322,64 @@ IAXVoIPLink::sendAudioFromMic(void) // take the lowest bytesAvail = (availBytesFromMic < maxBytesToGet) ? availBytesFromMic : maxBytesToGet; + //_debug("available = %d, maxBytesToGet = %d\n", availBytesFromMic, maxBytesToGet); // Get bytes from micRingBuffer to data_from_mic - nbSample_ = audiolayer->getMic( micData, bytesAvail ) / sizeof(SFLDataFormat); - + nbSample_ = audiolayer->getMic (micData, bytesAvail) / sizeof (SFLDataFormat); + // Store the number of samples for recording - nbSampleForRec_ = nbSample_; - - // _debug("IAXVoIPLink::sendAudioFromMic : %i \n",nbSampleForRec_); + nbSampleForRec_ = nbSample_; + + // _debug("IAXVoIPLink::sendAudioFromMic : %i \n",nbSampleForRec_); // resample - nbSample_ = converter->downsampleData( micData , micDataConverted , (int)ac ->getClockRate() , (int)audiolayer->getSampleRate() , nbSample_ ); + nbSample_ = converter->downsampleData (micData , micDataConverted , (int) ac ->getClockRate() , (int) audiolayer->getSampleRate() , nbSample_); // for the mono: range = 0 to IAX_FRAME2SEND * sizeof(int16) - compSize = ac->codecEncode( micDataEncoded, micDataConverted , nbSample_*sizeof(int16)); + compSize = ac->codecEncode (micDataEncoded, micDataConverted , nbSample_*sizeof (int16)); // Send it out! _mutexIAX.enterMutex(); + // Make sure the session and the call still exists. if (currentCall->getSession() && micDataEncoded != NULL) { - if (iax_send_voice(currentCall->getSession(), currentCall->getFormat(), micDataEncoded, compSize, nbSample_) == -1) { - _debug("IAX: Error sending voice data.\n"); + if (iax_send_voice (currentCall->getSession(), currentCall->getFormat(), micDataEncoded, compSize, nbSample_) == -1) { + _debug ("IAX: Error sending voice data.\n"); } } + _mutexIAX.leaveMutex(); } } - IAXCall* -IAXVoIPLink::getIAXCall(const CallID& id) +IAXCall* +IAXVoIPLink::getIAXCall (const CallID& id) { - Call* call = getCall(id); + Call* call = getCall (id); + if (call) { - return dynamic_cast<IAXCall*>(call); + return dynamic_cast<IAXCall*> (call); } + return NULL; } - int -IAXVoIPLink::sendRegister(AccountID id) +int +IAXVoIPLink::sendRegister (AccountID id) { IAXAccount *account; bool result; result = false; account = dynamic_cast<IAXAccount *> (getAccountPtr()); + if (account->getHostname().empty()) { return false; } + if (account->getUsername().empty()) { return false; } @@ -361,23 +389,23 @@ IAXVoIPLink::sendRegister(AccountID id) // Always use a brand new session if (_regSession) { - iax_destroy(_regSession); + iax_destroy (_regSession); } _regSession = iax_session_new(); if (!_regSession) { - _debug("Error when generating new session for register"); + _debug ("Error when generating new session for register"); } else { - _debug("IAX Sending registration to %s with user %s\n", account->getHostname().c_str() , account->getUsername().c_str() ); - int val = iax_register(_regSession, account->getHostname().data(), account->getUsername().data(), account->getPassword().data(), 120); + _debug ("IAX Sending registration to %s with user %s\n", account->getHostname().c_str() , account->getUsername().c_str()); + int val = iax_register (_regSession, account->getHostname().data(), account->getUsername().data(), account->getPassword().data(), 120); _debug ("Return value: %d\n", val); // set the time-out to 15 seconds, after that, resend a registration request. // until we unregister. - _nextRefreshStamp = time(NULL) + 10; + _nextRefreshStamp = time (NULL) + 10; result = true; - account->setRegistrationState(Trying); + account->setRegistrationState (Trying); } // unlock @@ -386,163 +414,174 @@ IAXVoIPLink::sendRegister(AccountID id) return result; } - int -IAXVoIPLink::sendUnregister(AccountID id) +int +IAXVoIPLink::sendUnregister (AccountID id) { IAXAccount *account; - account = dynamic_cast<IAXAccount*>(getAccountPtr()); - if(!account) + account = dynamic_cast<IAXAccount*> (getAccountPtr()); + + if (!account) return 1; _mutexIAX.enterMutex(); + if (_regSession) { /** @todo Should send a REGREL in sendUnregister()... */ //iax_send_regrel(); doesn't exist yet :) - iax_destroy(_regSession); + iax_destroy (_regSession); _regSession = NULL; } + _mutexIAX.leaveMutex(); _nextRefreshStamp = 0; - _debug("IAX2 send unregister\n"); - account->setRegistrationState(Unregistered); + _debug ("IAX2 send unregister\n"); + account->setRegistrationState (Unregistered); return SUCCESS; } - Call* -IAXVoIPLink::newOutgoingCall(const CallID& id, const std::string& toUrl) +Call* +IAXVoIPLink::newOutgoingCall (const CallID& id, const std::string& toUrl) { - IAXCall* call = new IAXCall(id, Call::Outgoing); - call->setCodecMap(Manager::instance().getCodecDescriptorMap()); + IAXCall* call = new IAXCall (id, Call::Outgoing); + call->setCodecMap (Manager::instance().getCodecDescriptorMap()); if (call) { - call->setPeerNumber(toUrl); + call->setPeerNumber (toUrl); call->initRecFileName(); - - if ( iaxOutgoingInvite(call) ) { - call->setConnectionState(Call::Progressing); - call->setState(Call::Active); - addCall(call); + + if (iaxOutgoingInvite (call)) { + call->setConnectionState (Call::Progressing); + call->setState (Call::Active); + addCall (call); } else { - delete call; call = NULL; + delete call; + call = NULL; } } + return call; } - bool -IAXVoIPLink::answer(const CallID& id) +bool +IAXVoIPLink::answer (const CallID& id) { - IAXCall* call = getIAXCall(id); - call->setCodecMap(Manager::instance().getCodecDescriptorMap()); + IAXCall* call = getIAXCall (id); + call->setCodecMap (Manager::instance().getCodecDescriptorMap()); CHK_VALID_CALL; _mutexIAX.enterMutex(); - iax_answer(call->getSession()); + iax_answer (call->getSession()); _mutexIAX.leaveMutex(); - call->setState(Call::Active); - call->setConnectionState(Call::Connected); + call->setState (Call::Active); + call->setConnectionState (Call::Connected); // Start audio audiolayer->startStream(); return true; } - bool -IAXVoIPLink::hangup(const CallID& id) +bool +IAXVoIPLink::hangup (const CallID& id) { - _debug("IAXVoIPLink::hangup() : function called once hangup \n"); - IAXCall* call = getIAXCall(id); + _debug ("IAXVoIPLink::hangup() : function called once hangup \n"); + IAXCall* call = getIAXCall (id); std::string reason = "Dumped Call"; CHK_VALID_CALL; _mutexIAX.enterMutex(); - - iax_hangup(call->getSession(), (char*) reason.c_str()); + + iax_hangup (call->getSession(), (char*) reason.c_str()); _mutexIAX.leaveMutex(); - call->setSession(NULL); - if (Manager::instance().isCurrentCall(id)) { + call->setSession (NULL); + + if (Manager::instance().isCurrentCall (id)) { // stop audio audiolayer->stopStream(); } - terminateOneCall(id); - removeCall(id); - return true; + + terminateOneCall (id); + + removeCall (id); + return true; } -bool -IAXVoIPLink::peerHungup(const CallID& id) +bool +IAXVoIPLink::peerHungup (const CallID& id) { - _debug("IAXVoIPLink::peerHangup() : function called once hangup \n"); - IAXCall* call = getIAXCall(id); + _debug ("IAXVoIPLink::peerHangup() : function called once hangup \n"); + IAXCall* call = getIAXCall (id); std::string reason = "Dumped Call"; CHK_VALID_CALL; _mutexIAX.enterMutex(); - + _mutexIAX.leaveMutex(); - call->setSession(NULL); - if (Manager::instance().isCurrentCall(id)) { + call->setSession (NULL); + + if (Manager::instance().isCurrentCall (id)) { // stop audio audiolayer->stopStream(); } - terminateOneCall(id); - removeCall(id); - return true; + + terminateOneCall (id); + + removeCall (id); + return true; } - bool -IAXVoIPLink::onhold(const CallID& id) +bool +IAXVoIPLink::onhold (const CallID& id) { - IAXCall* call = getIAXCall(id); + IAXCall* call = getIAXCall (id); CHK_VALID_CALL; //if (call->getState() == Call::Hold) { _debug("Call is already on hold\n"); return false; } _mutexIAX.enterMutex(); - iax_quelch_moh(call->getSession() , MUSIC_ONHOLD); + iax_quelch_moh (call->getSession() , MUSIC_ONHOLD); _mutexIAX.leaveMutex(); - call->setState(Call::Hold); + call->setState (Call::Hold); return true; } - bool -IAXVoIPLink::offhold(const CallID& id) +bool +IAXVoIPLink::offhold (const CallID& id) { - IAXCall* call = getIAXCall(id); + IAXCall* call = getIAXCall (id); CHK_VALID_CALL; //if (call->getState() == Call::Active) { _debug("Call is already active\n"); return false; } _mutexIAX.enterMutex(); - iax_unquelch(call->getSession()); + iax_unquelch (call->getSession()); _mutexIAX.leaveMutex(); audiolayer->startStream(); - call->setState(Call::Active); + call->setState (Call::Active); return true; } - bool -IAXVoIPLink::transfer(const CallID& id, const std::string& to) +bool +IAXVoIPLink::transfer (const CallID& id, const std::string& to) { - IAXCall* call = getIAXCall(id); + IAXCall* call = getIAXCall (id); CHK_VALID_CALL; - char callto[to.length()+1]; - strcpy(callto, to.c_str()); + char callto[to.length() +1]; + strcpy (callto, to.c_str()); _mutexIAX.enterMutex(); - iax_transfer(call->getSession(), callto); + iax_transfer (call->getSession(), callto); _mutexIAX.leaveMutex(); return true; @@ -551,143 +590,154 @@ IAXVoIPLink::transfer(const CallID& id, const std::string& to) // removeCall(id); } - bool -IAXVoIPLink::refuse(const CallID& id) +bool +IAXVoIPLink::refuse (const CallID& id) { - IAXCall* call = getIAXCall(id); + IAXCall* call = getIAXCall (id); std::string reason = "Call rejected manually."; CHK_VALID_CALL; _mutexIAX.enterMutex(); - iax_reject(call->getSession(), (char*) reason.c_str()); + iax_reject (call->getSession(), (char*) reason.c_str()); _mutexIAX.leaveMutex(); // terminateOneCall(id); - removeCall(id); + removeCall (id); return true; } -void -IAXVoIPLink::setRecording(const CallID& id) +void +IAXVoIPLink::setRecording (const CallID& id) { - _debug("IAXVoIPLink::setRecording()!"); + _debug ("IAXVoIPLink::setRecording()!"); - IAXCall* call = getIAXCall(id); + IAXCall* call = getIAXCall (id); - call->setRecording(); + call->setRecording(); } -bool -IAXVoIPLink::isRecording(const CallID& id) +bool +IAXVoIPLink::isRecording (const CallID& id) { - _debug("IAXVoIPLink::setRecording()!"); + _debug ("IAXVoIPLink::setRecording()!"); - IAXCall* call = getIAXCall(id); + IAXCall* call = getIAXCall (id); - return call->isRecording(); + return call->isRecording(); } - bool -IAXVoIPLink::carryingDTMFdigits(const CallID& id, char code) +bool +IAXVoIPLink::carryingDTMFdigits (const CallID& id, char code) { - IAXCall* call = getIAXCall(id); + IAXCall* call = getIAXCall (id); CHK_VALID_CALL; _mutexIAX.enterMutex(); - iax_send_dtmf(call->getSession(), code); + iax_send_dtmf (call->getSession(), code); _mutexIAX.leaveMutex(); return true; } -std::string +std::string IAXVoIPLink::getCurrentCodecName() { - IAXCall *call = getIAXCall(Manager::instance().getCurrentCallId()); - - AudioCodec *ac = call->getCodecMap().getCodec(call->getAudioCodec()); - + IAXCall *call = getIAXCall (Manager::instance().getCurrentCallId()); + + AudioCodec *ac = call->getCodecMap().getCodec (call->getAudioCodec()); + return ac->getCodecName(); } - bool -IAXVoIPLink::iaxOutgoingInvite(IAXCall* call) +bool +IAXVoIPLink::iaxOutgoingInvite (IAXCall* call) { + struct iax_session *newsession; - ost::MutexLock m(_mutexIAX); + ost::MutexLock m (_mutexIAX); std::string username, strNum; char *lang=NULL; int wait, audio_format_preferred, audio_format_capability; IAXAccount *account; newsession = iax_session_new(); + if (!newsession) { - _debug("IAX Error: Can't make new session for a new call\n"); + _debug ("IAX Error: Can't make new session for a new call\n"); return false; } - call->setSession(newsession); + + call->setSession (newsession); account = dynamic_cast<IAXAccount*> (getAccountPtr()); username = account->getUsername(); - strNum = username + ":" + account->getPassword() + "@" + account->getHostname() + "/" + call->getPeerNumber(); + strNum = username + ":" + account->getPassword() + "@" + account->getHostname() + "/" + call->getPeerNumber(); wait = 0; /** @todo Make preference dynamic, and configurable */ - audio_format_preferred = call->getFirstMatchingFormat(call->getSupportedFormat()); + audio_format_preferred = call->getFirstMatchingFormat (call->getSupportedFormat()); audio_format_capability = call->getSupportedFormat(); - _debug("IAX New call: %s\n", strNum.c_str()); - iax_call(newsession, username.c_str(), username.c_str(), strNum.c_str(), lang, wait, audio_format_preferred, audio_format_capability); + _debug ("IAX New call: %s\n", strNum.c_str()); + iax_call (newsession, username.c_str(), username.c_str(), strNum.c_str(), lang, wait, audio_format_preferred, audio_format_capability); return true; } - IAXCall* -IAXVoIPLink::iaxFindCallBySession(struct iax_session* session) +IAXCall* +IAXVoIPLink::iaxFindCallBySession (struct iax_session* session) { // access to callMap shoud use that - // the code below is like findSIPCallWithCid() - ost::MutexLock m(_callMapMutex); + // the code below is like findSIPCallWithCid() + ost::MutexLock m (_callMapMutex); IAXCall* call = NULL; CallMap::iterator iter = _callMap.begin(); - while(iter != _callMap.end()) { - call = dynamic_cast<IAXCall*>(iter->second); + + while (iter != _callMap.end()) { + call = dynamic_cast<IAXCall*> (iter->second); + if (call && call->getSession() == session) { return call; } + iter++; } + return NULL; // not found } - void -IAXVoIPLink::iaxHandleCallEvent(iax_event* event, IAXCall* call) +void +IAXVoIPLink::iaxHandleCallEvent (iax_event* event, IAXCall* call) { // call should not be 0 // note activity? // CallID id = call->getCallId(); - switch(event->etype) { + switch (event->etype) { + case IAX_EVENT_HANGUP: - if (Manager::instance().isCurrentCall(id)) { + + if (Manager::instance().isCurrentCall (id)) { // stop audio audiolayer->stopStream(); } - Manager::instance().peerHungupCall(id); + + Manager::instance().peerHungupCall (id); + /* - _debug("IAXVoIPLink::iaxHandleCallEvent, peer hangup have been called"); + _debug("IAXVoIPLink::iaxHandleCallEvent, peer hangup have been called"); std::string reason = "Dumped Call"; _mutexIAX.enterMutex(); iax_hangup(call->getSession(), (char*)reason.c_str()); @@ -695,83 +745,94 @@ IAXVoIPLink::iaxHandleCallEvent(iax_event* event, IAXCall* call) call->setSession(NULL); audiolayer->stopStream(); terminateOneCall(id); - */ - removeCall(id); + */ + removeCall (id); break; case IAX_EVENT_REJECT: - //Manager::instance().peerHungupCall(id); - if (Manager::instance().isCurrentCall(id)) { + //Manager::instance().peerHungupCall(id); + + if (Manager::instance().isCurrentCall (id)) { // stop audio audiolayer->stopStream(); } - call->setConnectionState(Call::Connected); - call->setState(Call::Error); - Manager::instance().callFailure(id); + + call->setConnectionState (Call::Connected); + + call->setState (Call::Error); + Manager::instance().callFailure (id); // terminateOneCall(id); - removeCall(id); + removeCall (id); break; case IAX_EVENT_ACCEPT: // Call accepted over there by the computer, not the user yet. + if (event->ies.format) { - call->setFormat(event->ies.format); + call->setFormat (event->ies.format); } + break; case IAX_EVENT_ANSWER: - if (call->getConnectionState() != Call::Connected){ - call->setConnectionState(Call::Connected); - call->setState(Call::Active); + + if (call->getConnectionState() != Call::Connected) { + call->setConnectionState (Call::Connected); + call->setState (Call::Active); audiolayer->startStream(); if (event->ies.format) { // Should not get here, should have been set in EVENT_ACCEPT - call->setFormat(event->ies.format); + call->setFormat (event->ies.format); } - Manager::instance().peerAnsweredCall(id); + Manager::instance().peerAnsweredCall (id); + // start audio here? } else { // deja connecté ? } + break; case IAX_EVENT_BUSY: - call->setConnectionState(Call::Connected); - call->setState(Call::Busy); - Manager::instance().callBusy(id); + call->setConnectionState (Call::Connected); + call->setState (Call::Busy); + Manager::instance().callBusy (id); // terminateOneCall(id); - removeCall(id); + removeCall (id); break; case IAX_EVENT_VOICE: //if (!audiolayer->isCaptureActive ()) - // audiolayer->startStream (); + // audiolayer->startStream (); // _debug("IAX_EVENT_VOICE: \n"); - iaxHandleVoiceEvent(event, call); + iaxHandleVoiceEvent (event, call); break; case IAX_EVENT_TEXT: break; case IAX_EVENT_RINGA: - call->setConnectionState(Call::Ringing); - Manager::instance().peerRingingCall(call->getCallId()); + call->setConnectionState (Call::Ringing); + Manager::instance().peerRingingCall (call->getCallId()); break; - case IAX_IE_MSGCOUNT: + case IAX_IE_MSGCOUNT: break; + case IAX_EVENT_PONG: break; case IAX_EVENT_URL: + if (Manager::instance().getConfigString (HOOKS, URLHOOK_IAX2_ENABLED) == "1") { - if (strcmp((char*)event->data, "") != 0) { + if (strcmp ( (char*) event->data, "") != 0) { _debug ("> IAX_EVENT_URL received: %s\n", event->data); - urlhook->addAction ((char*)event->data, Manager::instance().getConfigString (HOOKS, URLHOOK_COMMAND)); + urlhook->addAction ( (char*) event->data, Manager::instance().getConfigString (HOOKS, URLHOOK_COMMAND)); } } + break; case IAX_EVENT_TIMEOUT: @@ -781,24 +842,25 @@ IAXVoIPLink::iaxHandleCallEvent(iax_event* event, IAXCall* call) break; default: - _debug("Unknown event type (in call event): %d\n", event->etype); + _debug ("Unknown event type (in call event): %d\n", event->etype); } } /* Handle audio event, VOICE packet received */ - void -IAXVoIPLink::iaxHandleVoiceEvent(iax_event* event, IAXCall* call) -{ +void +IAXVoIPLink::iaxHandleVoiceEvent (iax_event* event, IAXCall* call) +{ unsigned char *data; unsigned int size, max, nbInt16; - int expandedSize, nbSample_; + int expandedSize, nbSample_; AudioCodec *ac; // If we receive datalen == 0, some things of the jitter buffer in libiax2/iax.c // were triggered + if (!event->datalen) { // Skip this empty packet. //_debug("IAX: Skipping empty jitter-buffer interpolated packet\n"); @@ -810,39 +872,43 @@ IAXVoIPLink::iaxHandleVoiceEvent(iax_event* event, IAXCall* call) // as per http://tools.ietf.org/id/draft-guy-iax-03.txt // - subclass holds the voiceformat property. if (event->subclass && event->subclass != call->getFormat()) { - call->setFormat(event->subclass); + call->setFormat (event->subclass); } + //_debug("Receive: len=%d, format=%d, _receiveDataDecoded=%p\n", event->datalen, call->getFormat(), _receiveDataDecoded); - ac = call->getCodecMap().getCodec( call -> getAudioCodec() ); + ac = call->getCodecMap().getCodec (call -> getAudioCodec()); + + data = (unsigned char*) event->data; - data = (unsigned char*)event->data; size = event->datalen; // Decode data with relevant codec - max = (int)( ac->getClockRate() * audiolayer->getFrameSize() / 1000 ); + max = (int) (ac->getClockRate() * audiolayer->getFrameSize() / 1000); if (size > max) { - _debug("The size %d is bigger than expected %d. Packet cropped. Ouch!\n", size, max); + _debug ("The size %d is bigger than expected %d. Packet cropped. Ouch!\n", size, max); size = max; } - expandedSize = ac->codecDecode( spkrDataDecoded , data , size ); - nbInt16 = expandedSize/sizeof(int16); + expandedSize = ac->codecDecode (spkrDataDecoded , data , size); + + nbInt16 = expandedSize/sizeof (int16); if (nbInt16 > max) { - _debug("We have decoded an IAX VOICE packet larger than expected: %i VS %i. Cropping.\n", nbInt16, max); + _debug ("We have decoded an IAX VOICE packet larger than expected: %i VS %i. Cropping.\n", nbInt16, max); nbInt16 = max; } nbSample_ = nbInt16; + // resample - nbInt16 = converter->upsampleData( spkrDataDecoded , spkrDataConverted , ac->getClockRate() , audiolayer->getSampleRate() , nbSample_); + nbInt16 = converter->upsampleData (spkrDataDecoded , spkrDataConverted , ac->getClockRate() , audiolayer->getSampleRate() , nbSample_); /* Write the data to the mic ring buffer */ - audiolayer->putMain (spkrDataConverted , nbInt16 * sizeof(SFLDataFormat)); + audiolayer->putMain (spkrDataConverted , nbInt16 * sizeof (SFLDataFormat)); } else { - _debug("IAX: incoming audio, but no sound card open"); + _debug ("IAX: incoming audio, but no sound card open"); } } @@ -850,25 +916,25 @@ IAXVoIPLink::iaxHandleVoiceEvent(iax_event* event, IAXCall* call) /** * Handle the registration process */ - void -IAXVoIPLink::iaxHandleRegReply(iax_event* event) +void +IAXVoIPLink::iaxHandleRegReply (iax_event* event) { int new_voicemails; std::string account_id; IAXAccount *account; - + account_id = getAccountID(); - account = dynamic_cast<IAXAccount *>(Manager::instance().getAccount(account_id)); + account = dynamic_cast<IAXAccount *> (Manager::instance().getAccount (account_id)); if (event->etype == IAX_EVENT_REGREJ) { /* Authentication failed! */ _mutexIAX.enterMutex(); - iax_destroy(_regSession); + iax_destroy (_regSession); _mutexIAX.leaveMutex(); _regSession = NULL; // Update the account registration state - account->setRegistrationState(ErrorAuth); + account->setRegistrationState (ErrorAuth); } else if (event->etype == IAX_EVENT_REGACK) { @@ -876,25 +942,25 @@ IAXVoIPLink::iaxHandleRegReply(iax_event* event) _mutexIAX.enterMutex(); // Looking for the voicemail information - //if( event->ies != 0 ) + //if( event->ies != 0 ) //new_voicemails = processIAXMsgCount(event->ies.msgcount); //_debug("iax voicemail number notification: %i\n", new_voicemails); // Notify the client if new voicemail waiting for the current account //account_id = getAccountID(); //Manager::instance().startVoiceMessageNotification(account_id.c_str(), new_voicemails); - iax_destroy(_regSession); + iax_destroy (_regSession); _mutexIAX.leaveMutex(); _regSession = NULL; // I mean, save the timestamp, so that we re-register again in the REFRESH time. // Defaults to 60, as per draft-guy-iax-03. - _nextRefreshStamp = time(NULL) + (event->ies.refresh ? event->ies.refresh : 60); - account->setRegistrationState(Registered); + _nextRefreshStamp = time (NULL) + (event->ies.refresh ? event->ies.refresh : 60); + account->setRegistrationState (Registered); } } -int IAXVoIPLink::processIAXMsgCount( int msgcount ) +int IAXVoIPLink::processIAXMsgCount (int msgcount) { // IAX sends the message count under a specific format: @@ -907,7 +973,7 @@ int IAXVoIPLink::processIAXMsgCount( int msgcount ) // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ // For now we just need the new messages informations. - // Thus: + // Thus: // 0 <= msgcount <= 255 => msgcount new messages, 0 old messages // msgcount >= 256 => msgcount/256 old messages , msgcount%256 new messages (RULES) @@ -916,107 +982,114 @@ int IAXVoIPLink::processIAXMsgCount( int msgcount ) } - void -IAXVoIPLink::iaxHandlePrecallEvent(iax_event* event) +void +IAXVoIPLink::iaxHandlePrecallEvent (iax_event* event) { IAXCall* call = NULL; CallID id; std::string reason = "Error ringing user."; - switch(event->etype) { + switch (event->etype) { + case IAX_EVENT_REGACK: + case IAX_EVENT_REGREJ: - _debug("IAX Registration Event in a pre-call setup\n"); + _debug ("IAX Registration Event in a pre-call setup\n"); break; case IAX_EVENT_REGREQ: // Received when someone wants to register to us!?! // Asterisk receives and answers to that, not us, we're a phone. - _debug("Registration by a peer, don't allow it\n"); + _debug ("Registration by a peer, don't allow it\n"); break; case IAX_EVENT_CONNECT: // We've got an incoming call! Yikes! - _debug("> IAX_EVENT_CONNECT (receive)\n"); + _debug ("> IAX_EVENT_CONNECT (receive)\n"); id = Manager::instance().getNewCallID(); - call = new IAXCall(id, Call::Incoming); + call = new IAXCall (id, Call::Incoming); if (!call) { - _debug("! IAX Failure: unable to create an incoming call"); + _debug ("! IAX Failure: unable to create an incoming call"); return; } // Setup the new IAXCall // Associate the call to the session. - call->setSession(event->session); + call->setSession (event->session); // setCallAudioLocal(call); - call->setCodecMap(Manager::instance().getCodecDescriptorMap()); - call->setConnectionState(Call::Progressing); + call->setCodecMap (Manager::instance().getCodecDescriptorMap()); + + call->setConnectionState (Call::Progressing); if (event->ies.calling_number) - call->setPeerNumber(std::string(event->ies.calling_number)); - if (event->ies.calling_name) - call->setPeerName(std::string(event->ies.calling_name)); - + call->setPeerNumber (std::string (event->ies.calling_number)); + + if (event->ies.calling_name) + call->setPeerName (std::string (event->ies.calling_name)); + // if peerNumber exist append it to the name string call->initRecFileName(); - if (Manager::instance().incomingCall(call, getAccountID())) { + if (Manager::instance().incomingCall (call, getAccountID())) { /** @todo Faudra considérer éventuellement le champ CODEC PREFS pour * l'établissement du codec de transmission */ // Remote lists its capabilities - int format = call->getFirstMatchingFormat(event->ies.capability); + int format = call->getFirstMatchingFormat (event->ies.capability); // Remote asks for preferred codec voiceformat - int pref_format = call->getFirstMatchingFormat(event->ies.format); + int pref_format = call->getFirstMatchingFormat (event->ies.format); // Priority to remote's suggestion. In case it's a forwarding, no transcoding // will be needed from the server, thus less latency. + if (pref_format) format = pref_format; - iax_accept(event->session, format); - iax_ring_announce(event->session); + iax_accept (event->session, format); + + iax_ring_announce (event->session); - addCall(call); + addCall (call); } else { // reject call, unable to add it - iax_reject(event->session, (char*)reason.c_str()); + iax_reject (event->session, (char*) reason.c_str()); - delete call; call = NULL; + delete call; + call = NULL; } break; case IAX_EVENT_HANGUP: // Remote peer hung up - call = iaxFindCallBySession(event->session); + call = iaxFindCallBySession (event->session); id = call->getCallId(); - _debug("IAXVoIPLink::hungup::iaxHandlePrecallEvent"); - Manager::instance().peerHungupCall(id); + _debug ("IAXVoIPLink::hungup::iaxHandlePrecallEvent"); + Manager::instance().peerHungupCall (id); // terminateOneCall(id); - removeCall(id); + removeCall (id); break; case IAX_EVENT_TIMEOUT: // timeout for an unknown session break; - case IAX_IE_MSGCOUNT: + case IAX_IE_MSGCOUNT: //_debug("messssssssssssssssssssssssssssssssssssssssssssssssages\n"); break; default: - _debug("Unknown event type (in precall): %d\n", event->etype); + _debug ("Unknown event type (in precall): %d\n", event->etype); } } -void IAXVoIPLink::updateAudiolayer( void ) +void IAXVoIPLink::updateAudiolayer (void) { _mutexIAX.enterMutex(); audiolayer = NULL; diff --git a/sflphone-common/src/main.cpp b/sflphone-common/src/main.cpp index 85f9170e5782cd44b28a9b4297447f4a2408c3ad..5eb4ced27b32e05bef7775f6e650641fe52dbdc9 100644 --- a/sflphone-common/src/main.cpp +++ b/sflphone-common/src/main.cpp @@ -3,17 +3,17 @@ * Author: Alexandre Bourget <alexandre.bourget@savoirfairelinux.com> * Author: Yan Morin <yan.morin@savoirfairelinux.com> * Author: Laurielle Lea <laurielle.lea@savoirfairelinux.com> - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. @@ -35,101 +35,107 @@ #include "audio/audiolayer.h" int -main (int argc, char **argv) { - int exit_code = 0; - - //setlocale (LC_ALL, ""); - //bindtextdomain (PACKAGE, LOCALEDIR); - //textdomain (PACKAGE); - - if (argc == 2 && strcmp(argv[1], "--help") == 0) { - - - printf("%1$s Daemon %2$s, by Savoir-Faire Linux 2004-2009\n\n", - PROGNAME, - SFLPHONED_VERSION); - printf("USAGE: sflphoned [--help]\nParameters: \n --help\tfor this message\n\n --port=3999\tchange the session port\n\n"); - printf("See http://www.sflphone.org/ for more information\n"); - - } else { - FILE *fp; - char homepid[128]; - char sfldir[128]; - - unsigned int iPid = getpid(); - char cPid[64], cOldPid[64]; - sprintf(cPid,"%d", iPid); - - sprintf(homepid, "%s/.%s/%s", HOMEDIR, PROGDIR, PIDFILE); - sprintf(sfldir, "%s/.%s", HOMEDIR, PROGDIR); - - if( (fp = fopen(homepid,"r")) == NULL ){ - // Check if $HOME/.sflphone directory exists or not. - DIR *dir; - if ( (dir = opendir (sfldir)) == NULL) { - //Create it - if ( mkdir(sfldir, 0755) != 0){ - fprintf(stderr, "Creating directory %s failed. Exited.\n", sfldir ); - exit(-1); - } - } - - // PID file doesn't exists, create and write pid in it - if( (fp = fopen(homepid,"w")) == NULL ){ - fprintf(stderr, "Creating PID file %s failed. Exited.\n", homepid); - exit(-1); - } else { - fputs(cPid , fp ); - fclose( fp ); - } +main (int argc, char **argv) +{ + int exit_code = 0; + + //setlocale (LC_ALL, ""); + //bindtextdomain (PACKAGE, LOCALEDIR); + //textdomain (PACKAGE); + + if (argc == 2 && strcmp (argv[1], "--help") == 0) { + + + printf ("%1$s Daemon %2$s, by Savoir-Faire Linux 2004-2009\n\n", + PROGNAME, + SFLPHONED_VERSION); + printf ("USAGE: sflphoned [--help]\nParameters: \n --help\tfor this message\n\n --port=3999\tchange the session port\n\n"); + printf ("See http://www.sflphone.org/ for more information\n"); + } else { - // PID file exists. Check the former process still alive or not. If alive, give user a hint. - fgets( cOldPid, 64, fp ); - fclose(fp); - if (kill(atoi(cOldPid), 0) == SUCCESS) { - fprintf(stderr, "There is already a sflphoned daemon running in the system. Starting Failed.\n"); - exit(-1); - } else { - if( (fp = fopen(homepid,"w")) == NULL ){ - fprintf(stderr, "Writing to PID file %s failed. Exited.\n", homepid); - exit(-1); - } else { - fputs(cPid , fp ); - fclose( fp ); - } - - } - } - - int sessionPort = 0; - if (argc == 2) { - char* ptrPort = strstr(argv[1], "--port="); - if (ptrPort != 0) { - sessionPort = atoi(ptrPort+7); - } - } - bool initOK = false; - try { - _debug("Initialize manager in main \n"); - Manager::instance().initConfigFile(); - Manager::instance().init(); - initOK = true; - } - catch (std::exception &e) { - std::cerr << e.what() << std::endl; - exit_code = -1; - } - catch (...) { - fprintf(stderr, "An exception occured when initializing the system.\n"); - exit_code = -1; - } - if (initOK) { - Manager::instance().setDBusManager(&DBusManager::instance()); - exit_code = DBusManager::instance().exec(); // UI Loop + FILE *fp; + char homepid[128]; + char sfldir[128]; + + unsigned int iPid = getpid(); + char cPid[64], cOldPid[64]; + sprintf (cPid,"%d", iPid); + + sprintf (homepid, "%s/.%s/%s", HOMEDIR, PROGDIR, PIDFILE); + sprintf (sfldir, "%s/.%s", HOMEDIR, PROGDIR); + + if ( (fp = fopen (homepid,"r")) == NULL) { + // Check if $HOME/.sflphone directory exists or not. + DIR *dir; + + if ( (dir = opendir (sfldir)) == NULL) { + //Create it + if (mkdir (sfldir, 0755) != 0) { + fprintf (stderr, "Creating directory %s failed. Exited.\n", sfldir); + exit (-1); + } + } + + // PID file doesn't exists, create and write pid in it + if ( (fp = fopen (homepid,"w")) == NULL) { + fprintf (stderr, "Creating PID file %s failed. Exited.\n", homepid); + exit (-1); + } else { + fputs (cPid , fp); + fclose (fp); + } + } else { + // PID file exists. Check the former process still alive or not. If alive, give user a hint. + fgets (cOldPid, 64, fp); + fclose (fp); + + if (kill (atoi (cOldPid), 0) == SUCCESS) { + fprintf (stderr, "There is already a sflphoned daemon running in the system. Starting Failed.\n"); + exit (-1); + } else { + if ( (fp = fopen (homepid,"w")) == NULL) { + fprintf (stderr, "Writing to PID file %s failed. Exited.\n", homepid); + exit (-1); + } else { + fputs (cPid , fp); + fclose (fp); + } + + } + } + + int sessionPort = 0; + + if (argc == 2) { + char* ptrPort = strstr (argv[1], "--port="); + + if (ptrPort != 0) { + sessionPort = atoi (ptrPort+7); + } + } + + bool initOK = false; + + try { + _debug ("Initialize manager in main \n"); + Manager::instance().initConfigFile(); + Manager::instance().init(); + initOK = true; + } catch (std::exception &e) { + std::cerr << e.what() << std::endl; + exit_code = -1; + } catch (...) { + fprintf (stderr, "An exception occured when initializing the system.\n"); + exit_code = -1; + } + + if (initOK) { + Manager::instance().setDBusManager (&DBusManager::instance()); + exit_code = DBusManager::instance().exec(); // UI Loop + } } - } - return exit_code; + return exit_code; } // EOF diff --git a/sflphone-common/src/managerimpl.cpp b/sflphone-common/src/managerimpl.cpp index 1e9f84e97d7883804a334ae112abc39464f2e127..7a49b2c04a3948237400173cfd5e3859ec6f01c7 100644 --- a/sflphone-common/src/managerimpl.cpp +++ b/sflphone-common/src/managerimpl.cpp @@ -54,62 +54,65 @@ (_config.addConfigTreeItem(section, Conf::ConfigTreeItem(std::string(name), std::string(value), type_int))) ManagerImpl::ManagerImpl (void) - : _hasTriedToRegister(false) + : _hasTriedToRegister (false) , _config() - , _currentCallId2() + , _currentCallId2() , _currentCallMutex() - , _codecBuilder(NULL) - , _audiodriver(NULL) - , _dtmfKey(NULL) + , _codecBuilder (NULL) + , _audiodriver (NULL) + , _dtmfKey (NULL) , _codecDescriptorMap() , _toneMutex() - , _telephoneTone(NULL) + , _telephoneTone (NULL) , _audiofile() - , _spkr_volume(0) - , _mic_volume(0) + , _spkr_volume (0) + , _mic_volume (0) , _mutex() - , _dbus(NULL) + , _dbus (NULL) , _waitingCall() , _waitingCallMutex() - , _nbIncomingWaitingCall(0) - , _path("") - , _exist(0) - , _setupLoaded(false) + , _nbIncomingWaitingCall (0) + , _path ("") + , _exist (0) + , _setupLoaded (false) , _firewallPort() - , _firewallAddr("") - , _hasZeroconf(false) + , _firewallAddr ("") + , _hasZeroconf (false) , _callAccountMap() , _callAccountMapMutex() , _callConfigMap() , _accountMap() , _cleaner (NULL) + , _history (NULL) { // initialize random generator for call id - srand (time(NULL)); + srand (time (NULL)); _cleaner = new NumberCleaner (); + _history = new HistoryManager (); #ifdef TEST - testAccountMap(); - loadAccountMap(); - testCallAccountMap(); - unloadAccountMap(); + testAccountMap(); + loadAccountMap(); + testCallAccountMap(); + unloadAccountMap(); #endif - // should be call before initConfigFile - // loadAccountMap();, called in init() now. + // should be call before initConfigFile + // loadAccountMap();, called in init() now. } // never call if we use only the singleton... ManagerImpl::~ManagerImpl (void) { // terminate(); - delete _cleaner; _cleaner=0; - _debug("%s stop correctly.\n", PROGNAME); + delete _cleaner; + _cleaner=0; + _debug ("%s stop correctly.\n", PROGNAME); } - void +void ManagerImpl::init() { // Load accounts, init map @@ -118,10 +121,11 @@ ManagerImpl::init() initVolume(); if (_exist == 0) { - _debug("Cannot create config file in your home directory\n"); + _debug ("Cannot create config file in your home directory\n"); } initAudioDriver(); + selectAudioDriver(); // Initialize the list of supported audio codecs @@ -132,62 +136,74 @@ ManagerImpl::init() if (audiolayer != 0) { unsigned int sampleRate = audiolayer->getSampleRate(); - _debugInit("Load Telephone Tone"); - std::string country = getConfigString(PREFERENCES, ZONE_TONE); - _telephoneTone = new TelephoneTone(country, sampleRate); + _debugInit ("Load Telephone Tone"); + std::string country = getConfigString (PREFERENCES, ZONE_TONE); + _telephoneTone = new TelephoneTone (country, sampleRate); - _debugInit("Loading DTMF key"); - _dtmfKey = new DTMF(sampleRate); + _debugInit ("Loading DTMF key"); + _dtmfKey = new DTMF (sampleRate); } if (audiolayer == 0) - audiolayer->stopStream(); + audiolayer->stopStream(); + + + // Load the history + _history->load_history (getConfigInt (PREFERENCES, CONFIG_HISTORY_LIMIT)); } void ManagerImpl::terminate() { - _debug("ManagerImpl::terminate \n"); + _debug ("ManagerImpl::terminate \n"); saveConfig(); unloadAccountMap(); - _debug("Unload DTMF Key \n"); + _debug ("Unload DTMF Key \n"); delete _dtmfKey; - _debug("Unload Audio Driver \n"); - delete _audiodriver; _audiodriver = NULL; + _debug ("Unload Audio Driver \n"); + delete _audiodriver; + _audiodriver = NULL; - _debug("Unload Telephone Tone \n"); - delete _telephoneTone; _telephoneTone = NULL; + _debug ("Unload Telephone Tone \n"); + delete _telephoneTone; + _telephoneTone = NULL; - _debug("Unload Audio Codecs \n"); + _debug ("Unload Audio Codecs \n"); _codecDescriptorMap.deleteHandlePointer(); } bool -ManagerImpl::isCurrentCall(const CallID& callId) { - return (_currentCallId2 == callId ? true : false); +ManagerImpl::isCurrentCall (const CallID& callId) +{ + return (_currentCallId2 == callId ? true : false); } bool -ManagerImpl::hasCurrentCall() { - _debug("Current call ID = %s\n", _currentCallId2.c_str()); - if ( _currentCallId2 != "") { - return true; - } - return false; +ManagerImpl::hasCurrentCall() +{ + _debug ("Current call ID = %s\n", _currentCallId2.c_str()); + + if (_currentCallId2 != "") { + return true; + } + + return false; } const CallID& -ManagerImpl::getCurrentCallId() { - return _currentCallId2; +ManagerImpl::getCurrentCallId() +{ + return _currentCallId2; } void -ManagerImpl::switchCall(const CallID& id ) { - ost::MutexLock m(_currentCallMutex); - _currentCallId2 = id; +ManagerImpl::switchCall (const CallID& id) +{ + ost::MutexLock m (_currentCallMutex); + _currentCallId2 = id; } @@ -196,19 +212,20 @@ ManagerImpl::switchCall(const CallID& id ) { /////////////////////////////////////////////////////////////////////////////// /* Main Thread */ - bool -ManagerImpl::outgoingCall(const std::string& accountid, const CallID& id, const std::string& to) +bool +ManagerImpl::outgoingCall (const std::string& accountid, const CallID& id, const std::string& to) { std::string pattern, to_cleaned; Call::CallConfiguration callConfig; SIPVoIPLink *siplink; - _debug("ManagerImpl::outgoingCall() method \n"); + _debug ("ManagerImpl::outgoingCall() method \n"); - if (getConfigString (HOOKS, PHONE_NUMBER_HOOK_ENABLED) == "1") - _cleaner->set_phone_number_prefix (getConfigString (HOOKS, PHONE_NUMBER_HOOK_ADD_PREFIX )); + if (getConfigString (HOOKS, PHONE_NUMBER_HOOK_ENABLED) == "1") + _cleaner->set_phone_number_prefix (getConfigString (HOOKS, PHONE_NUMBER_HOOK_ADD_PREFIX)); else _cleaner->set_phone_number_prefix (""); + to_cleaned = _cleaner->clean (to); /* Check what kind of call we are dealing with */ @@ -217,208 +234,239 @@ ManagerImpl::outgoingCall(const std::string& accountid, const CallID& id, const if (callConfig == Call::IPtoIP) { _debug ("Start IP to IP call\n"); /* We need to retrieve the sip voiplink instance */ - siplink = SIPVoIPLink::instance(""); + siplink = SIPVoIPLink::instance (""); + if (siplink->new_ip_to_ip_call (id, to_cleaned)) { switchCall (id); return true; - } - else { + } else { callFailure (id); } + return false; } - if (!accountExists(accountid)) { - _debug("! Manager Error: Outgoing Call: account doesn't exist\n"); + if (!accountExists (accountid)) { + _debug ("! Manager Error: Outgoing Call: account doesn't exist\n"); return false; } - if (getAccountFromCall(id) != AccountNULL) { - _debug("! Manager Error: Outgoing Call: call id already exists\n"); + if (getAccountFromCall (id) != AccountNULL) { + _debug ("! Manager Error: Outgoing Call: call id already exists\n"); return false; } if (hasCurrentCall()) { - _debug("* Manager Info: there is currently a call, try to hold it\n"); - onHoldCall(getCurrentCallId()); + _debug ("* Manager Info: there is currently a call, try to hold it\n"); + onHoldCall (getCurrentCallId()); } - _debug("- Manager Action: Adding Outgoing Call %s on account %s\n", id.data(), accountid.data()); - associateCallToAccount( id, accountid ); - if ( getAccountLink(accountid)->newOutgoingCall(id, to_cleaned) ) { - switchCall(id); + _debug ("- Manager Action: Adding Outgoing Call %s on account %s\n", id.data(), accountid.data()); + + associateCallToAccount (id, accountid); + + if (getAccountLink (accountid)->newOutgoingCall (id, to_cleaned)) { + switchCall (id); return true; } else { - callFailure(id); - _debug("! Manager Error: An error occur, the call was not created\n"); + callFailure (id); + _debug ("! Manager Error: An error occur, the call was not created\n"); } + return false; } //THREAD=Main : for outgoing Call - bool -ManagerImpl::answerCall(const CallID& id) +bool +ManagerImpl::answerCall (const CallID& id) { - bool isActive = false; + bool isActive = false; + + stopTone (true); - stopTone(true); + AccountID currentaccountid = getAccountFromCall (id); + Call* currentcall = getAccountLink (currentaccountid)->getCall (getCurrentCallId()); + _debug ("ManagerImpl::answerCall :: current call->getState %i \n",currentcall->getState()); - AccountID currentaccountid = getAccountFromCall( id ); - Call* currentcall = getAccountLink(currentaccountid)->getCall(getCurrentCallId()); - _debug("ManagerImpl::answerCall :: current call->getState %i \n",currentcall->getState()); + if (currentcall->getState() == 1) + isActive = true; - if (currentcall->getState() == 1) - isActive = true; + // stopTone(false); + _debug ("Try to answer call: %s\n", id.data()); - // stopTone(false); - _debug("Try to answer call: %s\n", id.data()); - AccountID accountid = getAccountFromCall( id ); - if (accountid == AccountNULL) { - _debug("Answering Call: Call doesn't exists\n"); - //return false; - } + AccountID accountid = getAccountFromCall (id); - // if (id != getCurrentCallId()) { - if (isActive) { - _debug("* Manager Info: there is currently a call, try to hold it\n"); + if (accountid == AccountNULL) { + _debug ("Answering Call: Call doesn't exists\n"); + //return false; + } - onHoldCall(getCurrentCallId()); - } + // if (id != getCurrentCallId()) { + if (isActive) { + _debug ("* Manager Info: there is currently a call, try to hold it\n"); - if (!getAccountLink(accountid)->answer(id)) { - // error when receiving... - removeCallAccount(id); - return false; - } + onHoldCall (getCurrentCallId()); + } + + if (!getAccountLink (accountid)->answer (id)) { + // error when receiving... + removeCallAccount (id); + return false; + } + + // if it was waiting, it's waiting no more + if (_dbus) _dbus->getCallManager()->callStateChanged (id, "CURRENT"); + + removeWaitingCall (id); - // if it was waiting, it's waiting no more - if (_dbus) _dbus->getCallManager()->callStateChanged(id, "CURRENT"); - removeWaitingCall(id); - switchCall(id); + switchCall (id); - // std::string codecName = getCurrentCodecName(id); - // _debug("ManagerImpl::hangupCall(): broadcast codec name %s \n",codecName.c_str()); - // if (_dbus) _dbus->getCallManager()->currentSelectedCodec(id,codecName.c_str()); + // std::string codecName = getCurrentCodecName(id); + // _debug("ManagerImpl::hangupCall(): broadcast codec name %s \n",codecName.c_str()); + // if (_dbus) _dbus->getCallManager()->currentSelectedCodec(id,codecName.c_str()); - return true; + return true; } //THREAD=Main - bool -ManagerImpl::hangupCall(const CallID& id) +bool +ManagerImpl::hangupCall (const CallID& id) { - _debug("ManagerImpl::hangupCall()\n"); + _debug ("ManagerImpl::hangupCall()\n"); PulseLayer *pulselayer; AccountID accountid; bool returnValue; AudioLayer *audiolayer; - stopTone(false); + stopTone (false); /* Broadcast a signal over DBus */ - if (_dbus) _dbus->getCallManager()->callStateChanged(id, "HUNGUP"); - _debug("Stop audio stream\n"); + if (_dbus) _dbus->getCallManager()->callStateChanged (id, "HUNGUP"); + + _debug ("Stop audio stream\n"); + audiolayer = getAudioDriver(); - audiolayer->stopStream(); + + int nbCalls = getCallList().size(); + + _debug ("nbCalls %i \n", nbCalls); + + // stop stream + if (! (nbCalls > 1)) + audiolayer->stopStream(); /* Direct IP to IP call */ if (getConfigFromCall (id) == Call::IPtoIP) { returnValue = SIPVoIPLink::instance (AccountNULL)->hangup (id); } + /* Classic call, attached to an account */ else { - accountid = getAccountFromCall( id ); + accountid = getAccountFromCall (id); + if (accountid == AccountNULL) { - _debug("! Manager Hangup Call: Call doesn't exists\n"); + _debug ("! Manager Hangup Call: Call doesn't exists\n"); return false; } - returnValue = getAccountLink(accountid)->hangup(id); - removeCallAccount(id); + + returnValue = getAccountLink (accountid)->hangup (id); + + removeCallAccount (id); } - switchCall(""); + switchCall (""); - if( _audiodriver->getLayerType() == PULSEAUDIO && getConfigInt( PREFERENCES , CONFIG_PA_VOLUME_CTRL ) ) { + if (_audiodriver->getLayerType() == PULSEAUDIO && getConfigInt (PREFERENCES , CONFIG_PA_VOLUME_CTRL)) { pulselayer = dynamic_cast<PulseLayer *> (getAudioDriver()); - if(pulselayer) pulselayer->restorePulseAppsVolume(); + + if (pulselayer) pulselayer->restorePulseAppsVolume(); } - + return returnValue; } //THREAD=Main - bool +bool ManagerImpl::cancelCall (const CallID& id) { AccountID accountid; bool returnValue; - stopTone(true); + stopTone (true); /* Direct IP to IP call */ + if (getConfigFromCall (id) == Call::IPtoIP) { returnValue = SIPVoIPLink::instance (AccountNULL)->cancel (id); } /* Classic call, attached to an account */ else { - accountid = getAccountFromCall( id ); + accountid = getAccountFromCall (id); + if (accountid == AccountNULL) { - _debug("! Manager Cancel Call: Call doesn't exists\n"); + _debug ("! Manager Cancel Call: Call doesn't exists\n"); return false; } - returnValue = getAccountLink(accountid)->cancel(id); - removeCallAccount(id); + + returnValue = getAccountLink (accountid)->cancel (id); + + removeCallAccount (id); } // it could be a waiting call? - removeWaitingCall(id); - switchCall(""); + removeWaitingCall (id); + + switchCall (""); return returnValue; } //THREAD=Main - bool -ManagerImpl::onHoldCall(const CallID& id) +bool +ManagerImpl::onHoldCall (const CallID& id) { AccountID accountid; bool returnValue; CallID call_id; - stopTone(true); + stopTone (true); call_id = id; /* Direct IP to IP call */ + if (getConfigFromCall (id) == Call::IPtoIP) { returnValue = SIPVoIPLink::instance (AccountNULL)-> onhold (id); } /* Classic call, attached to an account */ else { - accountid = getAccountFromCall( id ); + accountid = getAccountFromCall (id); + if (accountid == AccountNULL) { - _debug("Manager On Hold Call: Account ID %s or callid %s doesn't exists\n", accountid.c_str(), id.c_str()); + _debug ("Manager On Hold Call: Account ID %s or callid %s doesn't exists\n", accountid.c_str(), id.c_str()); return false; } - returnValue = getAccountLink(accountid)->onhold(id); + + returnValue = getAccountLink (accountid)->onhold (id); } - removeWaitingCall(id); - switchCall(""); + removeWaitingCall (id); - if (_dbus) _dbus->getCallManager()->callStateChanged(call_id, "HOLD"); + switchCall (""); + + if (_dbus) _dbus->getCallManager()->callStateChanged (call_id, "HOLD"); return returnValue; } //THREAD=Main - bool -ManagerImpl::offHoldCall(const CallID& id) +bool +ManagerImpl::offHoldCall (const CallID& id) { AccountID accountid; @@ -426,14 +474,14 @@ ManagerImpl::offHoldCall(const CallID& id) std::string codecName; CallID call_id; - stopTone(false); + stopTone (false); call_id = id; //Place current call on hold if it isn't - if (hasCurrentCall()) - { + + if (hasCurrentCall()) { _debug ("Put the current call (ID=%s) on hold\n", getCurrentCallId().c_str()); - onHoldCall(getCurrentCallId()); + onHoldCall (getCurrentCallId()); } /* Direct IP to IP call */ @@ -444,199 +492,243 @@ ManagerImpl::offHoldCall(const CallID& id) /* Classic call, attached to an account */ else { - accountid = getAccountFromCall( id ); + accountid = getAccountFromCall (id); + if (accountid == AccountNULL) { - _debug("Manager OffHold Call: Call doesn't exists\n"); + _debug ("Manager OffHold Call: Call doesn't exists\n"); return false; } - _debug("Setting OFFHOLD, Account %s, callid %s\n", accountid.c_str(), id.c_str()); - rec = getAccountLink(accountid)->isRecording(id); - returnValue = getAccountLink(accountid)->offhold(id); + + _debug ("Setting OFFHOLD, Account %s, callid %s\n", accountid.c_str(), id.c_str()); + + rec = getAccountLink (accountid)->isRecording (id); + returnValue = getAccountLink (accountid)->offhold (id); } - if (_dbus){ + if (_dbus) { if (rec) - _dbus->getCallManager()->callStateChanged(call_id, "UNHOLD_RECORD"); + _dbus->getCallManager()->callStateChanged (call_id, "UNHOLD_RECORD"); else - _dbus->getCallManager()->callStateChanged(call_id, "UNHOLD_CURRENT"); + _dbus->getCallManager()->callStateChanged (call_id, "UNHOLD_CURRENT"); } - switchCall(id); + switchCall (id); - codecName = getCurrentCodecName(id); + codecName = getCurrentCodecName (id); // _debug("ManagerImpl::hangupCall(): broadcast codec name %s \n",codecName.c_str()); - if (_dbus) _dbus->getCallManager()->currentSelectedCodec(id,codecName.c_str()); + + if (_dbus) _dbus->getCallManager()->currentSelectedCodec (id,codecName.c_str()); return returnValue; } //THREAD=Main - bool -ManagerImpl::transferCall(const CallID& id, const std::string& to) +bool +ManagerImpl::transferCall (const CallID& id, const std::string& to) { AccountID accountid; bool returnValue; - stopTone(true); + stopTone (true); /* Direct IP to IP call */ + if (getConfigFromCall (id) == Call::IPtoIP) { returnValue = SIPVoIPLink::instance (AccountNULL)-> transfer (id, to); } /* Classic call, attached to an account */ else { - accountid = getAccountFromCall( id ); + accountid = getAccountFromCall (id); + if (accountid == AccountNULL) { - _debug("! Manager Transfer Call: Call doesn't exists\n"); + _debug ("! Manager Transfer Call: Call doesn't exists\n"); return false; } - returnValue = getAccountLink(accountid)->transfer(id, to); - removeCallAccount(id); + + returnValue = getAccountLink (accountid)->transfer (id, to); + + removeCallAccount (id); } - removeWaitingCall(id); - switchCall(""); + removeWaitingCall (id); + + switchCall (""); + + if (_dbus) _dbus->getCallManager()->callStateChanged (id, "HUNGUP"); - if (_dbus) _dbus->getCallManager()->callStateChanged(id, "HUNGUP"); return returnValue; } +void ManagerImpl::transferFailed() +{ + if (_dbus) _dbus->getCallManager()->transferFailed(); +} + +void ManagerImpl::transferSucceded() +{ + if (_dbus) _dbus->getCallManager()->transferSucceded(); + +} + + //THREAD=Main : Call:Incoming - bool +bool ManagerImpl::refuseCall (const CallID& id) { AccountID accountid; bool returnValue; - stopTone(true); + stopTone (true); + + /* Direct IP to IP call */ - /* Direct IP to IP call */ if (getConfigFromCall (id) == Call::IPtoIP) { returnValue = SIPVoIPLink::instance (AccountNULL)-> refuse (id); } /* Classic call, attached to an account */ else { - accountid = getAccountFromCall( id ); + accountid = getAccountFromCall (id); + if (accountid == AccountNULL) { - _debug("! Manager OffHold Call: Call doesn't exists\n"); + _debug ("! Manager OffHold Call: Call doesn't exists\n"); return false; } - returnValue = getAccountLink(accountid)->refuse(id); - removeCallAccount(id); + + returnValue = getAccountLink (accountid)->refuse (id); + + removeCallAccount (id); } // if the call was outgoing or established, we didn't refuse it // so the method did nothing if (returnValue) { - removeWaitingCall(id); - if (_dbus) _dbus->getCallManager()->callStateChanged(id, "HUNGUP"); - switchCall(""); + removeWaitingCall (id); + + if (_dbus) _dbus->getCallManager()->callStateChanged (id, "HUNGUP"); + + switchCall (""); } + return returnValue; } //THREAD=Main - bool +bool ManagerImpl::saveConfig (void) { - _debug("Saving Configuration...\n"); - setConfig(AUDIO, VOLUME_SPKR, getSpkrVolume()); - setConfig(AUDIO, VOLUME_MICRO, getMicVolume()); + _debug ("Saving Configuration...\n"); + setConfig (AUDIO, VOLUME_SPKR, getSpkrVolume()); + setConfig (AUDIO, VOLUME_MICRO, getMicVolume()); - _setupLoaded = _config.saveConfigTree(_path.data()); - return _setupLoaded; + _setupLoaded = _config.saveConfigTree (_path.data()); + return _setupLoaded; } //THREAD=Main - int +int ManagerImpl::initRegisterAccounts() { int status; bool flag = true; AccountMap::iterator iter; - _debugInit("Initiate VoIP Links Registration"); + _debugInit ("Initiate VoIP Links Registration"); iter = _accountMap.begin(); /* Loop on the account map previously loaded */ - while( iter != _accountMap.end() ) { - if ( iter->second ) { + + while (iter != _accountMap.end()) { + if (iter->second) { iter->second->loadConfig(); /* If the account is set as enabled, try to register */ - if ( iter->second->isEnabled() ) { - status = iter->second->registerVoIPLink(); - if (status != SUCCESS){ - flag = false; + + if (iter->second->isEnabled()) { + status = iter->second->registerVoIPLink(); + + if (status != SUCCESS) { + flag = false; } } } + iter++; } // calls the client notification here in case of errors at startup... - if( _audiodriver -> getErrorMessage() != -1 ) - notifyErrClient( _audiodriver -> getErrorMessage() ); + if (_audiodriver -> getErrorMessage() != -1) + notifyErrClient (_audiodriver -> getErrorMessage()); + + ASSERT (flag, true); - ASSERT( flag, true ); return SUCCESS; } //THREAD=Main - bool -ManagerImpl::sendDtmf(const CallID& id, char code) +bool +ManagerImpl::sendDtmf (const CallID& id, char code) { - AccountID accountid = getAccountFromCall( id ); - if (accountid == AccountNULL) { - //_debug("Send DTMF: call doesn't exists\n"); - playDtmf(code, false); - return false; - } - - int sendType = getConfigInt(SIGNALISATION, SEND_DTMF_AS); - bool returnValue = false; - switch (sendType) { - case 0: // SIP INFO - playDtmf(code , true); - returnValue = getAccountLink(accountid)->carryingDTMFdigits(id, code); - break; - - case 1: // Audio way - break; - case 2: // rfc 2833 - break; - default: // unknown - error config? - break; - } - return returnValue; + AccountID accountid = getAccountFromCall (id); + + if (accountid == AccountNULL) { + //_debug("Send DTMF: call doesn't exists\n"); + playDtmf (code, false); + return false; + } + + int sendType = getConfigInt (SIGNALISATION, SEND_DTMF_AS); + + bool returnValue = false; + + switch (sendType) { + + case 0: // SIP INFO + playDtmf (code , true); + returnValue = getAccountLink (accountid)->carryingDTMFdigits (id, code); + break; + + case 1: // Audio way + break; + + case 2: // rfc 2833 + break; + + default: // unknown - error config? + break; + } + + return returnValue; } //THREAD=Main | VoIPLink - bool -ManagerImpl::playDtmf(char code, bool isTalking) +bool +ManagerImpl::playDtmf (char code, bool isTalking) { int hasToPlayTone, pulselen, layer, size; bool ret = false; AudioLayer *audiolayer; SFLDataFormat *buf; - stopTone(false); + stopTone (false); + + hasToPlayTone = getConfigInt (SIGNALISATION, PLAY_DTMF); - hasToPlayTone = getConfigInt(SIGNALISATION, PLAY_DTMF); if (!hasToPlayTone) return false; // length in milliseconds - pulselen = getConfigInt(SIGNALISATION, PULSE_LENGTH); + pulselen = getConfigInt (SIGNALISATION, PULSE_LENGTH); + if (!pulselen) return false; // numbers of int = length in milliseconds / 1000 (number of seconds) // = number of seconds * SAMPLING_RATE by SECONDS audiolayer = getAudioDriver(); + layer = audiolayer->getLayerType(); // fast return, no sound, so no dtmf @@ -647,61 +739,70 @@ ManagerImpl::playDtmf(char code, bool isTalking) // size (n sampling) = time_ms * sampling/s // --------------------- // ms/s - size = (int)(pulselen * ((float)audiolayer->getSampleRate()/1000)); + size = (int) (pulselen * ( (float) audiolayer->getSampleRate() /1000)); // this buffer is for mono // TODO <-- this should be global and hide if same size buf = new SFLDataFormat[size]; // Handle dtmf - _dtmfKey->startTone(code); + _dtmfKey->startTone (code); // copy the sound - if ( _dtmfKey->generateDTMF(buf, size) ) { + if (_dtmfKey->generateDTMF (buf, size)) { // Put buffer to urgentRingBuffer // put the size in bytes... // so size * 1 channel (mono) * sizeof (bytes for the data) audiolayer->startStream(); - audiolayer->putUrgent (buf, size * sizeof(SFLDataFormat)); + audiolayer->putUrgent (buf, size * sizeof (SFLDataFormat)); } + ret = true; // TODO Cache the DTMF - delete[] buf; buf = 0; + delete[] buf; + buf = 0; return ret; } // Multi-thread bool -ManagerImpl::incomingCallWaiting() { - return (_nbIncomingWaitingCall > 0) ? true : false; +ManagerImpl::incomingCallWaiting() +{ + return (_nbIncomingWaitingCall > 0) ? true : false; } void -ManagerImpl::addWaitingCall(const CallID& id) { - ost::MutexLock m(_waitingCallMutex); - _waitingCall.insert(id); - _nbIncomingWaitingCall++; +ManagerImpl::addWaitingCall (const CallID& id) +{ + ost::MutexLock m (_waitingCallMutex); + _waitingCall.insert (id); + _nbIncomingWaitingCall++; } void -ManagerImpl::removeWaitingCall(const CallID& id) { - ost::MutexLock m(_waitingCallMutex); - // should return more than 1 if it erase a call - if (_waitingCall.erase(id)) { - _nbIncomingWaitingCall--; - } +ManagerImpl::removeWaitingCall (const CallID& id) +{ + ost::MutexLock m (_waitingCallMutex); + // should return more than 1 if it erase a call + + if (_waitingCall.erase (id)) { + _nbIncomingWaitingCall--; + } } bool -ManagerImpl::isWaitingCall(const CallID& id) { - CallIDSet::iterator iter = _waitingCall.find(id); - if (iter != _waitingCall.end()) { - return false; - } - return true; +ManagerImpl::isWaitingCall (const CallID& id) +{ + CallIDSet::iterator iter = _waitingCall.find (id); + + if (iter != _waitingCall.end()) { + return false; + } + + return true; } /////////////////////////////////////////////////////////////////////////////// @@ -709,47 +810,49 @@ ManagerImpl::isWaitingCall(const CallID& id) { //////////////////////////////////////////////////////////////////////////////// // SipEvent Thread bool -ManagerImpl::incomingCall(Call* call, const AccountID& accountId) +ManagerImpl::incomingCall (Call* call, const AccountID& accountId) { PulseLayer *pulselayer; std::string from, number; - stopTone(true); + stopTone (true); - _debug("Incoming call %s for account %s\n", call->getCallId().data(), accountId.c_str()); + _debug ("Incoming call %s for account %s\n", call->getCallId().data(), accountId.c_str()); - associateCallToAccount(call->getCallId(), accountId); + associateCallToAccount (call->getCallId(), accountId); if (accountId==AccountNULL) associateConfigToCall (call->getCallId(), Call::IPtoIP); - _debug("ManagerImpl::incomingCall :: hasCurrentCall() %i \n",hasCurrentCall()); + _debug ("ManagerImpl::incomingCall :: hasCurrentCall() %i \n",hasCurrentCall()); - if ( !hasCurrentCall() ) { - call->setConnectionState(Call::Ringing); + if (!hasCurrentCall()) { + call->setConnectionState (Call::Ringing); ringtone(); - switchCall(call->getCallId()); + switchCall (call->getCallId()); } + /* else { addWaitingCall(call->getCallId()); } */ - addWaitingCall(call->getCallId()); + addWaitingCall (call->getCallId()); from = call->getPeerName(); + number = call->getPeerNumber(); if (from != "" && number != "") { - from.append(" <"); - from.append(number); - from.append(">"); - } else if ( from.empty() ) { - from.append("<"); - from.append(number); - from.append(">"); + from.append (" <"); + from.append (number); + from.append (">"); + } else if (from.empty()) { + from.append ("<"); + from.append (number); + from.append (">"); } /* @@ -762,14 +865,15 @@ ManagerImpl::incomingCall(Call* call, const AccountID& accountId) */ /* Broadcast a signal over DBus */ - if (_dbus) _dbus->getCallManager()->incomingCall(accountId, call->getCallId(), from); + if (_dbus) _dbus->getCallManager()->incomingCall (accountId, call->getCallId(), from); //if (_dbus) _dbus->getCallManager()->callStateChanged(call->getCallId(), "INCOMING"); // Reduce volume of the other pulseaudio-connected audio applications - if( _audiodriver->getLayerType() == PULSEAUDIO && getConfigInt( PREFERENCES , CONFIG_PA_VOLUME_CTRL ) ) { + if (_audiodriver->getLayerType() == PULSEAUDIO && getConfigInt (PREFERENCES , CONFIG_PA_VOLUME_CTRL)) { pulselayer = dynamic_cast<PulseLayer *> (getAudioDriver()); - if(pulselayer) pulselayer->reducePulseAppsVolume(); + + if (pulselayer) pulselayer->reducePulseAppsVolume(); } return true; @@ -777,114 +881,129 @@ ManagerImpl::incomingCall(Call* call, const AccountID& accountId) //THREAD=VoIP void -ManagerImpl::incomingMessage(const AccountID& accountId, const std::string& message) { - if (_dbus) { - _dbus->getCallManager()->incomingMessage(accountId, message); - } +ManagerImpl::incomingMessage (const AccountID& accountId, const std::string& message) +{ + if (_dbus) { + _dbus->getCallManager()->incomingMessage (accountId, message); + } } //THREAD=VoIP CALL=Outgoing - void -ManagerImpl::peerAnsweredCall(const CallID& id) +void +ManagerImpl::peerAnsweredCall (const CallID& id) { - if (isCurrentCall(id)) { - stopTone(false); + if (isCurrentCall (id)) { + stopTone (false); } - if (_dbus) _dbus->getCallManager()->callStateChanged(id, "CURRENT"); + if (_dbus) _dbus->getCallManager()->callStateChanged (id, "CURRENT"); + + std::string codecName = getCurrentCodecName (id); - std::string codecName = getCurrentCodecName(id); - // _debug("ManagerImpl::hangupCall(): broadcast codec name %s \n",codecName.c_str()); - if (_dbus) _dbus->getCallManager()->currentSelectedCodec(id,codecName.c_str()); + // _debug("ManagerImpl::hangupCall(): broadcast codec name %s \n",codecName.c_str()); + if (_dbus) _dbus->getCallManager()->currentSelectedCodec (id,codecName.c_str()); } //THREAD=VoIP Call=Outgoing - void -ManagerImpl::peerRingingCall(const CallID& id) +void +ManagerImpl::peerRingingCall (const CallID& id) { - if (isCurrentCall(id)) { - ringback(); - } - if (_dbus) _dbus->getCallManager()->callStateChanged(id, "RINGING"); + if (isCurrentCall (id)) { + ringback(); + } + + if (_dbus) _dbus->getCallManager()->callStateChanged (id, "RINGING"); } //THREAD=VoIP Call=Outgoing/Ingoing - void -ManagerImpl::peerHungupCall(const CallID& id) +void +ManagerImpl::peerHungupCall (const CallID& id) { PulseLayer *pulselayer; AccountID accountid; bool returnValue; /* Direct IP to IP call */ + if (getConfigFromCall (id) == Call::IPtoIP) { SIPVoIPLink::instance (AccountNULL)->hangup (id); } - else - { - accountid = getAccountFromCall( id ); + else { + accountid = getAccountFromCall (id); + if (accountid == AccountNULL) { - _debug("peerHungupCall: Call doesn't exists\n"); + _debug ("peerHungupCall: Call doesn't exists\n"); return; } - returnValue = getAccountLink(accountid)->peerHungup(id); + + returnValue = getAccountLink (accountid)->peerHungup (id); } /* Broadcast a signal over DBus */ - if (_dbus) _dbus->getCallManager()->callStateChanged(id, "HUNGUP"); + if (_dbus) _dbus->getCallManager()->callStateChanged (id, "HUNGUP"); - if (isCurrentCall(id)) { - stopTone(true); - switchCall(""); + if (isCurrentCall (id)) { + stopTone (true); + switchCall (""); } - removeWaitingCall(id); - removeCallAccount(id); + removeWaitingCall (id); + + removeCallAccount (id); - if( _audiodriver->getLayerType() == PULSEAUDIO && getConfigInt( PREFERENCES , CONFIG_PA_VOLUME_CTRL ) ) { + if (_audiodriver->getLayerType() == PULSEAUDIO && getConfigInt (PREFERENCES , CONFIG_PA_VOLUME_CTRL)) { pulselayer = dynamic_cast<PulseLayer *> (getAudioDriver()); - if(pulselayer) pulselayer->restorePulseAppsVolume(); + + if (pulselayer) pulselayer->restorePulseAppsVolume(); } } //THREAD=VoIP void -ManagerImpl::callBusy(const CallID& id) { - _debug("Call busy\n"); +ManagerImpl::callBusy (const CallID& id) +{ + _debug ("Call busy\n"); + + if (_dbus) _dbus->getCallManager()->callStateChanged (id, "BUSY"); + + if (isCurrentCall (id)) { + playATone (Tone::TONE_BUSY); + switchCall (""); + } + + removeCallAccount (id); - if (_dbus) _dbus->getCallManager()->callStateChanged(id, "BUSY"); - if (isCurrentCall(id) ) { - playATone(Tone::TONE_BUSY); - switchCall(""); - } - removeCallAccount(id); - removeWaitingCall(id); + removeWaitingCall (id); } //THREAD=VoIP - void -ManagerImpl::callFailure(const CallID& id) +void +ManagerImpl::callFailure (const CallID& id) { - if (_dbus) _dbus->getCallManager()->callStateChanged(id, "FAILURE"); - _debug("CALL ID = %s\n" , id.c_str()); - if (isCurrentCall(id) ) { - playATone(Tone::TONE_BUSY); - switchCall(""); - } - removeCallAccount(id); - removeWaitingCall(id); + if (_dbus) _dbus->getCallManager()->callStateChanged (id, "FAILURE"); + + _debug ("CALL ID = %s\n" , id.c_str()); + + if (isCurrentCall (id)) { + playATone (Tone::TONE_BUSY); + switchCall (""); + } + + removeCallAccount (id); + + removeWaitingCall (id); } //THREAD=VoIP - void -ManagerImpl::startVoiceMessageNotification(const AccountID& accountId, int nb_msg) +void +ManagerImpl::startVoiceMessageNotification (const AccountID& accountId, int nb_msg) { - if (_dbus) _dbus->getCallManager()->voiceMailNotify(accountId, nb_msg) ; + if (_dbus) _dbus->getCallManager()->voiceMailNotify (accountId, nb_msg) ; } -void ManagerImpl::connectionStatusNotification( ) +void ManagerImpl::connectionStatusNotification() { if (_dbus) _dbus->getConfigurationManager()->accountsChanged(); @@ -893,14 +1012,15 @@ void ManagerImpl::connectionStatusNotification( ) /** * Multi Thread */ -bool ManagerImpl::playATone(Tone::TONEID toneId) +bool ManagerImpl::playATone (Tone::TONEID toneId) { int hasToPlayTone; AudioLoop *audioloop; AudioLayer *audiolayer; unsigned int nbSamples; - hasToPlayTone = getConfigInt(SIGNALISATION, PLAY_TONES); + hasToPlayTone = getConfigInt (SIGNALISATION, PLAY_TONES); + if (!hasToPlayTone) return false; @@ -908,19 +1028,20 @@ bool ManagerImpl::playATone(Tone::TONEID toneId) if (_telephoneTone != 0) { _toneMutex.enterMutex(); - _telephoneTone->setCurrentTone(toneId); + _telephoneTone->setCurrentTone (toneId); _toneMutex.leaveMutex(); audioloop = getTelephoneTone(); nbSamples = audioloop->getSize(); SFLDataFormat buf[nbSamples]; - if ( audiolayer ){ - audiolayer->putUrgent( buf, nbSamples ); + if (audiolayer) { + audiolayer->putUrgent (buf, nbSamples); } else return false; - } - return true; + } + + return true; } /** @@ -931,19 +1052,23 @@ void ManagerImpl::stopTone (bool stopAudio=true) int hasToPlayTone; AudioLayer *audiolayer; - hasToPlayTone = getConfigInt(SIGNALISATION, PLAY_TONES); + hasToPlayTone = getConfigInt (SIGNALISATION, PLAY_TONES); + if (!hasToPlayTone) return; - if (stopAudio) { - audiolayer = getAudioDriver(); - if (audiolayer) audiolayer->stopStream(); - } + // if (stopAudio) { + // audiolayer = getAudioDriver(); + // if (audiolayer) audiolayer->stopStream(); + // } + _toneMutex.enterMutex(); + if (_telephoneTone != 0) { - _telephoneTone->setCurrentTone(Tone::TONE_NULL); + _telephoneTone->setCurrentTone (Tone::TONE_NULL); } + _toneMutex.leaveMutex(); // for ringing tone.. @@ -955,43 +1080,45 @@ void ManagerImpl::stopTone (bool stopAudio=true) /** * Multi Thread */ - bool +bool ManagerImpl::playTone() { - playATone(Tone::TONE_DIALTONE); - return true; + playATone (Tone::TONE_DIALTONE); + return true; } /** * Multi Thread */ - bool +bool ManagerImpl::playToneWithMessage() { - playATone(Tone::TONE_CONGESTION); - return true; + playATone (Tone::TONE_CONGESTION); + return true; } /** * Multi Thread */ void -ManagerImpl::congestion () { - playATone(Tone::TONE_CONGESTION); +ManagerImpl::congestion () +{ + playATone (Tone::TONE_CONGESTION); } /** * Multi Thread */ void -ManagerImpl::ringback () { - playATone(Tone::TONE_RINGTONE); +ManagerImpl::ringback () +{ + playATone (Tone::TONE_RINGTONE); } /** * Multi Thread */ - void +void ManagerImpl::ringtone() { std::string ringchoice; @@ -1002,29 +1129,34 @@ ManagerImpl::ringtone() // stopTone(true); - if( isRingtoneEnabled() ) - { + if (isRingtoneEnabled()) { //TODO Comment this because it makes the daemon crashes since the main thread //synchronizes the ringtone thread. - ringchoice = getConfigString(AUDIO, RING_CHOICE); + ringchoice = getConfigString (AUDIO, RING_CHOICE); //if there is no / inside the path - if ( ringchoice.find(DIR_SEPARATOR_CH) == std::string::npos ) { + + if (ringchoice.find (DIR_SEPARATOR_CH) == std::string::npos) { // check inside global share directory - ringchoice = std::string(PROGSHAREDIR) + DIR_SEPARATOR_STR + RINGDIR + DIR_SEPARATOR_STR + ringchoice; + ringchoice = std::string (PROGSHAREDIR) + DIR_SEPARATOR_STR + RINGDIR + DIR_SEPARATOR_STR + ringchoice; } audiolayer = getAudioDriver(); + layer = audiolayer->getLayerType(); + if (audiolayer == 0) return; samplerate = audiolayer->getSampleRate(); + codecForTone = _codecDescriptorMap.getFirstCodecAvailable(); _toneMutex.enterMutex(); - loadFile = _audiofile.loadFile(ringchoice, codecForTone , samplerate); + + loadFile = _audiofile.loadFile (ringchoice, codecForTone , samplerate); + _toneMutex.leaveMutex(); if (loadFile) { @@ -1032,115 +1164,119 @@ ManagerImpl::ringtone() _toneMutex.enterMutex(); _audiofile.start(); _toneMutex.leaveMutex(); - if(CHECK_INTERFACE( layer, ALSA )){ + + if (CHECK_INTERFACE (layer, ALSA)) { //ringback(); - } - else{ + } else { audiolayer->startStream(); } } else { ringback(); } - } - else - { + } else { ringback(); } } - AudioLoop* +AudioLoop* ManagerImpl::getTelephoneTone() { - // _debug("ManagerImpl::getTelephoneTone()\n"); - if(_telephoneTone != 0) { - ost::MutexLock m(_toneMutex); - return _telephoneTone->getCurrentTone(); - } - else { - return 0; - } + // _debug("ManagerImpl::getTelephoneTone()\n"); + if (_telephoneTone != 0) { + ost::MutexLock m (_toneMutex); + return _telephoneTone->getCurrentTone(); + } else { + return 0; + } } - AudioLoop* +AudioLoop* ManagerImpl::getTelephoneFile() { - // _debug("ManagerImpl::getTelephoneFile()\n"); - ost::MutexLock m(_toneMutex); - if(_audiofile.isStarted()) { - return &_audiofile; - } else { - return 0; - } + // _debug("ManagerImpl::getTelephoneFile()\n"); + ost::MutexLock m (_toneMutex); + + if (_audiofile.isStarted()) { + return &_audiofile; + } else { + return 0; + } } -void ManagerImpl::notificationIncomingCall(void) +void ManagerImpl::notificationIncomingCall (void) { AudioLayer *audiolayer; std::ostringstream frequency; unsigned int samplerate, nbSampling; audiolayer = getAudioDriver(); + if (audiolayer != 0) { samplerate = audiolayer->getSampleRate(); frequency << "440/" << FRAME_PER_BUFFER; - Tone tone(frequency.str(), samplerate); + Tone tone (frequency.str(), samplerate); nbSampling = tone.getSize(); SFLDataFormat buf[nbSampling]; - tone.getNext(buf, tone.getSize()); + tone.getNext (buf, tone.getSize()); /* Put the data in the urgent ring buffer */ - audiolayer->putUrgent (buf, sizeof(SFLDataFormat)*nbSampling); + audiolayer->putUrgent (buf, sizeof (SFLDataFormat) *nbSampling); } } /** * Multi Thread */ - bool +bool ManagerImpl::getStunInfo (StunAddress4& stunSvrAddr, int port) { - StunAddress4 mappedAddr; - struct in_addr in; - char* addr; - - //int fd3, fd4; - // bool ok = stunOpenSocketPair(stunSvrAddr, &mappedAddr, &fd3, &fd4, port); - int fd1 = stunOpenSocket(stunSvrAddr, &mappedAddr, port); - bool ok = (fd1 == -1 || fd1 == INVALID_SOCKET) ? false : true; - if (ok) { - closesocket(fd1); - //closesocket(fd3); - //closesocket(fd4); - _firewallPort = mappedAddr.port; - // Convert ipv4 address to host byte ordering - in.s_addr = ntohl (mappedAddr.addr); - addr = inet_ntoa(in); - _firewallAddr = std::string(addr); - _debug("STUN Firewall: [%s:%d]\n", _firewallAddr.data(), _firewallPort); - return true; - } else { - _debug("Opening a stun socket pair failed\n"); - } - return false; + StunAddress4 mappedAddr; + + struct in_addr in; + char* addr; + + //int fd3, fd4; + // bool ok = stunOpenSocketPair(stunSvrAddr, &mappedAddr, &fd3, &fd4, port); + int fd1 = stunOpenSocket (stunSvrAddr, &mappedAddr, port); + bool ok = (fd1 == -1 || fd1 == INVALID_SOCKET) ? false : true; + + if (ok) { + closesocket (fd1); + //closesocket(fd3); + //closesocket(fd4); + _firewallPort = mappedAddr.port; + // Convert ipv4 address to host byte ordering + in.s_addr = ntohl (mappedAddr.addr); + addr = inet_ntoa (in); + _firewallAddr = std::string (addr); + _debug ("STUN Firewall: [%s:%d]\n", _firewallAddr.data(), _firewallPort); + return true; + } else { + _debug ("Opening a stun socket pair failed\n"); + } + + return false; } - bool -ManagerImpl::behindNat(const std::string& svr, int port) +bool +ManagerImpl::behindNat (const std::string& svr, int port) { - StunAddress4 stunSvrAddr; - stunSvrAddr.addr = 0; + StunAddress4 stunSvrAddr; + stunSvrAddr.addr = 0; - // Convert char* to StunAddress4 structure - bool ret = stunParseServerName ((char*)svr.data(), stunSvrAddr); - if (!ret) { - _debug("SIP: Stun server address (%s) is not valid\n", svr.data()); - return 0; - } + // Convert char* to StunAddress4 structure + bool ret = stunParseServerName ( (char*) svr.data(), stunSvrAddr); + + if (!ret) { + _debug ("SIP: Stun server address (%s) is not valid\n", svr.data()); + return 0; + } - // Firewall address - _debug("STUN server: %s\n", svr.data()); - return getStunInfo(stunSvrAddr, port); + // Firewall address + _debug ("STUN server: %s\n", svr.data()); + + return getStunInfo (stunSvrAddr, port); } @@ -1153,724 +1289,754 @@ ManagerImpl::behindNat(const std::string& svr, int port) -1: error directory */ int -ManagerImpl::createSettingsPath (void) { - _path = std::string(HOMEDIR) + DIR_SEPARATOR_STR + "." + PROGDIR; +ManagerImpl::createSettingsPath (void) +{ + _path = std::string (HOMEDIR) + DIR_SEPARATOR_STR + "." + PROGDIR; - if (mkdir (_path.data(), 0755) != 0) { - // If directory creation failed - if (errno != EEXIST) { - _debug("Cannot create directory: %s\n", strerror(errno)); - return -1; + if (mkdir (_path.data(), 0755) != 0) { + // If directory creation failed + if (errno != EEXIST) { + _debug ("Cannot create directory: %s\n", strerror (errno)); + return -1; + } } - } - // Load user's configuration - _path = _path + DIR_SEPARATOR_STR + PROGNAME + "rc"; - return 1; + // Load user's configuration + _path = _path + DIR_SEPARATOR_STR + PROGNAME + "rc"; + + return 1; } /** * Initialization: Main Thread */ - void -ManagerImpl::initConfigFile ( bool load_user_value ) -{ - std::string mes = gettext("Init config file\n"); - _debug("%s",mes.c_str()); - - std::string type_str("string"); - std::string type_int("int"); - - std::string section; - - // Default values, that will be overwritten by the call to - // 'populateFromFile' below. - section = SIGNALISATION; - fill_config_int(SYMMETRIC, YES_STR); - fill_config_int(PLAY_DTMF, YES_STR); - fill_config_int(PLAY_TONES, YES_STR); - fill_config_int(PULSE_LENGTH, DFT_PULSE_LENGTH_STR); - fill_config_int(SEND_DTMF_AS, SIP_INFO_STR); - fill_config_int(STUN_ENABLE, DFT_STUN_ENABLE); - fill_config_int(STUN_SERVER, DFT_STUN_SERVER); - - section = AUDIO; - fill_config_int(ALSA_CARD_ID_IN, ALSA_DFT_CARD); - fill_config_int(ALSA_CARD_ID_OUT, ALSA_DFT_CARD); - fill_config_int(ALSA_SAMPLE_RATE, DFT_SAMPLE_RATE); - fill_config_int(ALSA_FRAME_SIZE, DFT_FRAME_SIZE); - fill_config_str(ALSA_PLUGIN, PCM_DEFAULT); - fill_config_str(RING_CHOICE, DFT_RINGTONE); - fill_config_int(VOLUME_SPKR, DFT_VOL_SPKR_STR); - fill_config_int(VOLUME_MICRO, DFT_VOL_MICRO_STR); - fill_config_str(RECORD_PATH,DFT_RECORD_PATH); - - section = PREFERENCES; - fill_config_str(ZONE_TONE, DFT_ZONE); - fill_config_int(CONFIG_ZEROCONF, CONFIG_ZEROCONF_DEFAULT_STR); - fill_config_int(CONFIG_RINGTONE, YES_STR); - fill_config_int(CONFIG_DIALPAD, YES_STR); - fill_config_int(CONFIG_SEARCHBAR, YES_STR); - fill_config_int(CONFIG_START, NO_STR); - fill_config_int(CONFIG_POPUP, YES_STR); - fill_config_int(CONFIG_NOTIFY , YES_STR); - fill_config_int(CONFIG_MAIL_NOTIFY , NO_STR); - fill_config_int(CONFIG_VOLUME , YES_STR); - fill_config_int(CONFIG_HISTORY , DFT_MAX_CALLS); - fill_config_int(REGISTRATION_EXPIRE , DFT_EXPIRE_VALUE); - fill_config_int(CONFIG_AUDIO , DFT_AUDIO_MANAGER); - fill_config_int(CONFIG_PA_VOLUME_CTRL , YES_STR); - fill_config_int(CONFIG_SIP_PORT, DFT_SIP_PORT); - fill_config_str(CONFIG_ACCOUNTS_ORDER, ""); - - section = ADDRESSBOOK; - fill_config_int (ADDRESSBOOK_ENABLE, YES_STR); - fill_config_int (ADDRESSBOOK_MAX_RESULTS, "25"); - fill_config_int (ADDRESSBOOK_DISPLAY_CONTACT_PHOTO, NO_STR); - fill_config_int (ADDRESSBOOK_DISPLAY_PHONE_BUSINESS, YES_STR); - fill_config_int (ADDRESSBOOK_DISPLAY_PHONE_HOME, NO_STR); - fill_config_int (ADDRESSBOOK_DISPLAY_PHONE_MOBILE, NO_STR); - - section = HOOKS; - fill_config_str (URLHOOK_SIP_FIELD, HOOK_DEFAULT_SIP_FIELD); - fill_config_str (URLHOOK_COMMAND, HOOK_DEFAULT_URL_COMMAND); - fill_config_str (URLHOOK_SIP_ENABLED, NO_STR); - fill_config_str (URLHOOK_IAX2_ENABLED, NO_STR); - fill_config_str (PHONE_NUMBER_HOOK_ENABLED, NO_STR); - fill_config_str (PHONE_NUMBER_HOOK_ADD_PREFIX, ""); - - // Loads config from ~/.sflphone/sflphonedrc or so.. - if (createSettingsPath() == 1 && load_user_value) { - _exist = _config.populateFromFile(_path); - } - - _setupLoaded = (_exist == 2 ) ? false : true; +void +ManagerImpl::initConfigFile (bool load_user_value, std::string alternate) +{ + std::string mes = gettext ("Init config file\n"); + _debug ("%s",mes.c_str()); + + std::string type_str ("string"); + std::string type_int ("int"); + + std::string section, path; + + // Default values, that will be overwritten by the call to + // 'populateFromFile' below. + section = SIGNALISATION; + fill_config_int (SYMMETRIC, YES_STR); + fill_config_int (PLAY_DTMF, YES_STR); + fill_config_int (PLAY_TONES, YES_STR); + fill_config_int (PULSE_LENGTH, DFT_PULSE_LENGTH_STR); + fill_config_int (SEND_DTMF_AS, SIP_INFO_STR); + fill_config_int (STUN_ENABLE, DFT_STUN_ENABLE); + fill_config_int (STUN_SERVER, DFT_STUN_SERVER); + + section = AUDIO; + fill_config_int (ALSA_CARD_ID_IN, ALSA_DFT_CARD); + fill_config_int (ALSA_CARD_ID_OUT, ALSA_DFT_CARD); + fill_config_int (ALSA_SAMPLE_RATE, DFT_SAMPLE_RATE); + fill_config_int (ALSA_FRAME_SIZE, DFT_FRAME_SIZE); + fill_config_str (ALSA_PLUGIN, PCM_DEFAULT); + fill_config_str (RING_CHOICE, DFT_RINGTONE); + fill_config_int (VOLUME_SPKR, DFT_VOL_SPKR_STR); + fill_config_int (VOLUME_MICRO, DFT_VOL_MICRO_STR); + fill_config_str (RECORD_PATH,DFT_RECORD_PATH); + + section = PREFERENCES; + fill_config_str (ZONE_TONE, DFT_ZONE); + fill_config_int (CONFIG_ZEROCONF, CONFIG_ZEROCONF_DEFAULT_STR); + fill_config_int (CONFIG_RINGTONE, YES_STR); + fill_config_int (CONFIG_DIALPAD, YES_STR); + fill_config_int (CONFIG_SEARCHBAR, YES_STR); + fill_config_int (CONFIG_START, NO_STR); + fill_config_int (CONFIG_POPUP, YES_STR); + fill_config_int (CONFIG_NOTIFY , YES_STR); + fill_config_int (CONFIG_MAIL_NOTIFY , NO_STR); + fill_config_int (CONFIG_VOLUME , YES_STR); + fill_config_int (CONFIG_HISTORY_LIMIT, DFT_HISTORY_LIMIT); + fill_config_int (CONFIG_HISTORY_ENABLED, YES_STR); + fill_config_int (REGISTRATION_EXPIRE , DFT_EXPIRE_VALUE); + fill_config_int (CONFIG_AUDIO , DFT_AUDIO_MANAGER); + fill_config_int (CONFIG_PA_VOLUME_CTRL , YES_STR); + fill_config_int (CONFIG_SIP_PORT, DFT_SIP_PORT); + fill_config_str (CONFIG_ACCOUNTS_ORDER, ""); + + section = ADDRESSBOOK; + fill_config_int (ADDRESSBOOK_ENABLE, YES_STR); + fill_config_int (ADDRESSBOOK_MAX_RESULTS, "25"); + fill_config_int (ADDRESSBOOK_DISPLAY_CONTACT_PHOTO, NO_STR); + fill_config_int (ADDRESSBOOK_DISPLAY_PHONE_BUSINESS, YES_STR); + fill_config_int (ADDRESSBOOK_DISPLAY_PHONE_HOME, NO_STR); + fill_config_int (ADDRESSBOOK_DISPLAY_PHONE_MOBILE, NO_STR); + + section = HOOKS; + fill_config_str (URLHOOK_SIP_FIELD, HOOK_DEFAULT_SIP_FIELD); + fill_config_str (URLHOOK_COMMAND, HOOK_DEFAULT_URL_COMMAND); + fill_config_str (URLHOOK_SIP_ENABLED, NO_STR); + fill_config_str (URLHOOK_IAX2_ENABLED, NO_STR); + fill_config_str (PHONE_NUMBER_HOOK_ENABLED, NO_STR); + fill_config_str (PHONE_NUMBER_HOOK_ADD_PREFIX, ""); + + // Loads config from ~/.sflphone/sflphonedrc or so.. + + if (createSettingsPath() == 1 && load_user_value) { + + (alternate == "") ? path = _path : path = alternate; + + std::cout << path << std::endl; + + _exist = _config.populateFromFile (path); + } + + _setupLoaded = (_exist == 2) ? false : true; } /** * Initialization: Main Thread */ - void +void ManagerImpl::initAudioCodec (void) { - _debugInit("Active Codecs List"); - // init list of all supported codecs - _codecDescriptorMap.init(); - // if the user never set the codec list, use the default configuration - if(getConfigString(AUDIO, "ActiveCodecs") == ""){ - _codecDescriptorMap.setDefaultOrder(); - } - // else retrieve the one set in the user config file - else{ - std::vector<std::string> active_list = retrieveActiveCodecs(); - setActiveCodecList(active_list); - } + _debugInit ("Active Codecs List"); + // init list of all supported codecs + _codecDescriptorMap.init(); + // if the user never set the codec list, use the default configuration + + if (getConfigString (AUDIO, "ActiveCodecs") == "") { + _codecDescriptorMap.setDefaultOrder(); + } + + // else retrieve the one set in the user config file + else { + std::vector<std::string> active_list = retrieveActiveCodecs(); + setActiveCodecList (active_list); + } } - void -ManagerImpl::setActiveCodecList(const std::vector< std::string >& list) +void +ManagerImpl::setActiveCodecList (const std::vector< std::string >& list) { - _debug("Set active codecs list\n"); - _codecDescriptorMap.saveActiveCodecs(list); - // setConfig - std::string s = serialize(list); - printf("%s\n", s.c_str()); - setConfig("Audio", "ActiveCodecs", s); + _debug ("Set active codecs list\n"); + _codecDescriptorMap.saveActiveCodecs (list); + // setConfig + std::string s = serialize (list); + printf ("%s\n", s.c_str()); + setConfig ("Audio", "ActiveCodecs", s); } - std::vector<std::string> +std::vector<std::string> ManagerImpl::retrieveActiveCodecs() { - std::string s = getConfigString(AUDIO, "ActiveCodecs"); - return unserialize(s); + std::string s = getConfigString (AUDIO, "ActiveCodecs"); + return unserialize (s); } - std::vector<std::string> -ManagerImpl::unserialize(std::string s) { +std::vector<std::string> +ManagerImpl::unserialize (std::string s) +{ - std::vector<std::string> list; - std::string temp; + std::vector<std::string> list; + std::string temp; - while (s.find("/", 0) != std::string::npos) - { - size_t pos = s.find("/", 0); - temp = s.substr(0, pos); - s.erase(0, pos + 1); - list.push_back(temp); - } + while (s.find ("/", 0) != std::string::npos) { + size_t pos = s.find ("/", 0); + temp = s.substr (0, pos); + s.erase (0, pos + 1); + list.push_back (temp); + } - return list; + return list; } - std::string -ManagerImpl::serialize(std::vector<std::string> v) +std::string +ManagerImpl::serialize (std::vector<std::string> v) { - unsigned int i; - std::string res; - for(i=0;i<v.size();i++) - { - res += v[i] + "/"; - } - return res; + unsigned int i; + std::string res; + + for (i=0;i<v.size();i++) { + res += v[i] + "/"; + } + + return res; } - std::vector <std::string> -ManagerImpl::getActiveCodecList( void ) +std::vector <std::string> +ManagerImpl::getActiveCodecList (void) { - _debug("Get Active codecs list\n"); - std::vector< std::string > v; - CodecOrder active = _codecDescriptorMap.getActiveCodecs(); - unsigned int i=0; - size_t size = active.size(); - while(i<size) - { - std::stringstream ss; - ss << active[i]; - v.push_back((ss.str()).data()); - _debug("%s\n", ss.str().data()); - i++; - } - return v; + _debug ("Get Active codecs list\n"); + std::vector< std::string > v; + CodecOrder active = _codecDescriptorMap.getActiveCodecs(); + unsigned int i=0; + size_t size = active.size(); + + while (i<size) { + std::stringstream ss; + ss << active[i]; + v.push_back ( (ss.str()).data()); + _debug ("%s\n", ss.str().data()); + i++; + } + + return v; } /** * Send the list of codecs to the client through DBus. */ - std::vector< std::string > -ManagerImpl::getCodecList( void ) +std::vector< std::string > +ManagerImpl::getCodecList (void) { - std::vector<std::string> list; - //CodecMap codecs = _codecDescriptorMap.getCodecMap(); - CodecsMap codecs = _codecDescriptorMap.getCodecsMap(); - CodecOrder order = _codecDescriptorMap.getActiveCodecs(); - CodecsMap::iterator iter = codecs.begin(); + std::vector<std::string> list; + //CodecMap codecs = _codecDescriptorMap.getCodecMap(); + CodecsMap codecs = _codecDescriptorMap.getCodecsMap(); + CodecOrder order = _codecDescriptorMap.getActiveCodecs(); + CodecsMap::iterator iter = codecs.begin(); - while(iter!=codecs.end()) - { - std::stringstream ss; - if( iter->second != NULL ) - { - ss << iter->first; - list.push_back((ss.str()).data()); + while (iter!=codecs.end()) { + std::stringstream ss; + + if (iter->second != NULL) { + ss << iter->first; + list.push_back ( (ss.str()).data()); + } + + iter++; } - iter++; - } - return list; + + return list; } - std::vector<std::string> -ManagerImpl::getCodecDetails( const int32_t& payload ) +std::vector<std::string> +ManagerImpl::getCodecDetails (const int32_t& payload) { - std::vector<std::string> v; - std::stringstream ss; + std::vector<std::string> v; + std::stringstream ss; - v.push_back(_codecDescriptorMap.getCodecName((AudioCodecType)payload)); - ss << _codecDescriptorMap.getSampleRate((AudioCodecType)payload); - v.push_back((ss.str()).data()); - ss.str(""); - ss << _codecDescriptorMap.getBitRate((AudioCodecType)payload); - v.push_back((ss.str()).data()); - ss.str(""); - ss << _codecDescriptorMap.getBandwidthPerCall((AudioCodecType)payload); - v.push_back((ss.str()).data()); - ss.str(""); + v.push_back (_codecDescriptorMap.getCodecName ( (AudioCodecType) payload)); + ss << _codecDescriptorMap.getSampleRate ( (AudioCodecType) payload); + v.push_back ( (ss.str()).data()); + ss.str (""); + ss << _codecDescriptorMap.getBitRate ( (AudioCodecType) payload); + v.push_back ( (ss.str()).data()); + ss.str (""); + ss << _codecDescriptorMap.getBandwidthPerCall ( (AudioCodecType) payload); + v.push_back ( (ss.str()).data()); + ss.str (""); - return v; + return v; } std::string -ManagerImpl::getCurrentCodecName(const CallID& id) +ManagerImpl::getCurrentCodecName (const CallID& id) { - // _debug("ManagerImpl::getCurrentCodecName method called \n"); - AccountID accountid = getAccountFromCall(id); - // _debug("ManagerImpl::getCurrentCodecName : %s \n",getAccountLink(accountid)->getCurrentCodecName().c_str()); - return getAccountLink(accountid)->getCurrentCodecName(); + // _debug("ManagerImpl::getCurrentCodecName method called \n"); + AccountID accountid = getAccountFromCall (id); + // _debug("ManagerImpl::getCurrentCodecName : %s \n",getAccountLink(accountid)->getCurrentCodecName().c_str()); + return getAccountLink (accountid)->getCurrentCodecName(); } /** * Get list of supported input audio plugin */ - std::vector<std::string> -ManagerImpl::getInputAudioPluginList(void) +std::vector<std::string> +ManagerImpl::getInputAudioPluginList (void) { - std::vector<std::string> v; - _debug("Get input audio plugin list"); + std::vector<std::string> v; + _debug ("Get input audio plugin list\n"); - v.push_back("default"); - v.push_back("surround40"); - v.push_back("plug:hw"); + v.push_back ("default"); + v.push_back ("surround40"); + v.push_back ("plug:hw"); - return v; + return v; } /** * Get list of supported output audio plugin */ - std::vector<std::string> -ManagerImpl::getOutputAudioPluginList(void) +std::vector<std::string> +ManagerImpl::getOutputAudioPluginList (void) { - std::vector<std::string> v; - _debug("Get output audio plugin list"); + std::vector<std::string> v; + _debug ("Get output audio plugin list\n"); - v.push_back( PCM_DEFAULT ); - v.push_back( PCM_DMIX ); + v.push_back (PCM_DEFAULT); + v.push_back (PCM_DMIX); - return v; + return v; } /** * Set input audio plugin */ - void -ManagerImpl::setInputAudioPlugin(const std::string& audioPlugin) -{ - int layer = _audiodriver -> getLayerType(); - if(CHECK_INTERFACE( layer , ALSA )) - { - _debug("Set input audio plugin\n"); - _audiodriver -> setErrorMessage( -1 ); - _audiodriver -> openDevice( _audiodriver -> getIndexIn(), - _audiodriver -> getIndexOut(), - _audiodriver -> getSampleRate(), - _audiodriver -> getFrameSize(), - SFL_PCM_CAPTURE, - audioPlugin); - if( _audiodriver -> getErrorMessage() != -1) - notifyErrClient( _audiodriver -> getErrorMessage() ); -}else{} +void +ManagerImpl::setInputAudioPlugin (const std::string& audioPlugin) +{ + int layer = _audiodriver -> getLayerType(); + + if (CHECK_INTERFACE (layer , ALSA)) { + _debug ("Set input audio plugin\n"); + _audiodriver -> setErrorMessage (-1); + _audiodriver -> openDevice (_audiodriver -> getIndexIn(), + _audiodriver -> getIndexOut(), + _audiodriver -> getSampleRate(), + _audiodriver -> getFrameSize(), + SFL_PCM_CAPTURE, + audioPlugin); + + if (_audiodriver -> getErrorMessage() != -1) + notifyErrClient (_audiodriver -> getErrorMessage()); + } else {} } /** * Set output audio plugin */ - void -ManagerImpl::setOutputAudioPlugin(const std::string& audioPlugin) +void +ManagerImpl::setOutputAudioPlugin (const std::string& audioPlugin) { int res; - _debug("Set output audio plugin\n"); - _audiodriver -> setErrorMessage( -1 ); - res = _audiodriver -> openDevice( _audiodriver -> getIndexIn(), - _audiodriver -> getIndexOut(), - _audiodriver -> getSampleRate(), - _audiodriver -> getFrameSize(), - SFL_PCM_BOTH, - audioPlugin); - if( _audiodriver -> getErrorMessage() != -1) - notifyErrClient( _audiodriver -> getErrorMessage() ); - // set config - if(res) setConfig( AUDIO , ALSA_PLUGIN , audioPlugin ); + _debug ("Set output audio plugin\n"); + _audiodriver -> setErrorMessage (-1); + res = _audiodriver -> openDevice (_audiodriver -> getIndexIn(), + _audiodriver -> getIndexOut(), + _audiodriver -> getSampleRate(), + _audiodriver -> getFrameSize(), + SFL_PCM_BOTH, + audioPlugin); + + if (_audiodriver -> getErrorMessage() != -1) + notifyErrClient (_audiodriver -> getErrorMessage()); + + // set config + if (res) setConfig (AUDIO , ALSA_PLUGIN , audioPlugin); } /** * Get list of supported audio output device */ - std::vector<std::string> -ManagerImpl::getAudioOutputDeviceList(void) +std::vector<std::string> +ManagerImpl::getAudioOutputDeviceList (void) { - _debug("Get audio output device list\n"); - AlsaLayer *layer; + _debug ("Get audio output device list\n"); + AlsaLayer *layer; + + layer = dynamic_cast<AlsaLayer*> (getAudioDriver ()); - layer = dynamic_cast<AlsaLayer*> (getAudioDriver ()); - if (layer) return layer -> getSoundCardsInfo(SFL_PCM_PLAYBACK); + if (layer) return layer -> getSoundCardsInfo (SFL_PCM_PLAYBACK); } /** * Set audio output device */ - void -ManagerImpl::setAudioOutputDevice(const int index) +void +ManagerImpl::setAudioOutputDevice (const int index) { AlsaLayer *alsalayer; std::string alsaplugin; - _debug("Set audio output device: %i\n", index); + _debug ("Set audio output device: %i\n", index); - _audiodriver -> setErrorMessage( -1 ); + _audiodriver -> setErrorMessage (-1); alsalayer = dynamic_cast<AlsaLayer*> (getAudioDriver ()); alsaplugin = alsalayer->getAudioPlugin (); - _audiodriver->openDevice(_audiodriver->getIndexIn(), index, _audiodriver->getSampleRate(), _audiodriver->getFrameSize(), SFL_PCM_PLAYBACK, alsaplugin ); + _audiodriver->openDevice (_audiodriver->getIndexIn(), index, _audiodriver->getSampleRate(), _audiodriver->getFrameSize(), SFL_PCM_PLAYBACK, alsaplugin); - if( _audiodriver -> getErrorMessage() != -1) - notifyErrClient( _audiodriver -> getErrorMessage() ); + if (_audiodriver -> getErrorMessage() != -1) + notifyErrClient (_audiodriver -> getErrorMessage()); // set config - setConfig( AUDIO , ALSA_CARD_ID_OUT , index ); + setConfig (AUDIO , ALSA_CARD_ID_OUT , index); } /** * Get list of supported audio input device */ - std::vector<std::string> -ManagerImpl::getAudioInputDeviceList(void) +std::vector<std::string> +ManagerImpl::getAudioInputDeviceList (void) { - _debug("Get audio input device list\n"); - AlsaLayer *audiolayer; + _debug ("Get audio input device list\n"); + AlsaLayer *audiolayer; + + audiolayer = dynamic_cast<AlsaLayer *> (getAudioDriver()); - audiolayer = dynamic_cast<AlsaLayer *> ( getAudioDriver()); - if(audiolayer) return audiolayer->getSoundCardsInfo(SFL_PCM_CAPTURE); + if (audiolayer) return audiolayer->getSoundCardsInfo (SFL_PCM_CAPTURE); } /** * Set audio input device */ - void -ManagerImpl::setAudioInputDevice(const int index) +void +ManagerImpl::setAudioInputDevice (const int index) { AlsaLayer *alsalayer; std::string alsaplugin; - _debug("Set audio input device %i\n", index); + _debug ("Set audio input device %i\n", index); - _audiodriver -> setErrorMessage( -1 ); + _audiodriver -> setErrorMessage (-1); alsalayer = dynamic_cast<AlsaLayer*> (getAudioDriver ()); alsaplugin = alsalayer->getAudioPlugin (); - _audiodriver->openDevice(index, _audiodriver->getIndexOut(), _audiodriver->getSampleRate(), _audiodriver->getFrameSize(), SFL_PCM_CAPTURE, alsaplugin ); + _audiodriver->openDevice (index, _audiodriver->getIndexOut(), _audiodriver->getSampleRate(), _audiodriver->getFrameSize(), SFL_PCM_CAPTURE, alsaplugin); - if( _audiodriver -> getErrorMessage() != -1) - notifyErrClient( _audiodriver -> getErrorMessage() ); + if (_audiodriver -> getErrorMessage() != -1) + notifyErrClient (_audiodriver -> getErrorMessage()); // set config - setConfig( AUDIO , ALSA_CARD_ID_IN , index ); + setConfig (AUDIO , ALSA_CARD_ID_IN , index); } /** * Get string array representing integer indexes of output and input device */ - std::vector<std::string> +std::vector<std::string> ManagerImpl::getCurrentAudioDevicesIndex() { - _debug("Get current audio devices index\n"); - std::vector<std::string> v; - std::stringstream ssi , sso; - sso << _audiodriver->getIndexOut(); - v.push_back( sso.str() ); - ssi << _audiodriver->getIndexIn(); - v.push_back( ssi.str() ); - return v; + _debug ("Get current audio devices index\n"); + std::vector<std::string> v; + std::stringstream ssi , sso; + sso << _audiodriver->getIndexOut(); + v.push_back (sso.str()); + ssi << _audiodriver->getIndexIn(); + v.push_back (ssi.str()); + return v; } - int -ManagerImpl::isIax2Enabled( void ) +int +ManagerImpl::isIax2Enabled (void) { - //return ( IAX2_ENABLED ) ? true : false; + //return ( IAX2_ENABLED ) ? true : false; #ifdef USE_IAX - return true; + return true; #else - return false; + return false; #endif } - int -ManagerImpl::isRingtoneEnabled( void ) +int +ManagerImpl::isRingtoneEnabled (void) { - return getConfigInt( PREFERENCES , CONFIG_RINGTONE ); + return getConfigInt (PREFERENCES , CONFIG_RINGTONE); } - void -ManagerImpl::ringtoneEnabled( void ) +void +ManagerImpl::ringtoneEnabled (void) { - ( getConfigInt( PREFERENCES , CONFIG_RINGTONE ) == RINGTONE_ENABLED )? setConfig(PREFERENCES , CONFIG_RINGTONE , NO_STR ) : setConfig( PREFERENCES , CONFIG_RINGTONE , YES_STR ); + (getConfigInt (PREFERENCES , CONFIG_RINGTONE) == RINGTONE_ENABLED) ? setConfig (PREFERENCES , CONFIG_RINGTONE , NO_STR) : setConfig (PREFERENCES , CONFIG_RINGTONE , YES_STR); } std::string -ManagerImpl::getRingtoneChoice( void ) -{ - // we need the absolute path - std::string tone_name = getConfigString( AUDIO , RING_CHOICE ); - std::string tone_path ; - if( tone_name.find( DIR_SEPARATOR_CH ) == std::string::npos ) - { - // check in ringtone directory ($(PREFIX)/share/sflphone/ringtones) - tone_path = std::string(PROGSHAREDIR) + DIR_SEPARATOR_STR + RINGDIR + DIR_SEPARATOR_STR + tone_name ; - } - else - { - // the absolute has been saved; do nothing - tone_path = tone_name ; - } - _debug("%s\n", tone_path.c_str()); - return tone_path; +ManagerImpl::getRingtoneChoice (void) +{ + // we need the absolute path + std::string tone_name = getConfigString (AUDIO , RING_CHOICE); + std::string tone_path ; + + if (tone_name.find (DIR_SEPARATOR_CH) == std::string::npos) { + // check in ringtone directory ($(PREFIX)/share/sflphone/ringtones) + tone_path = std::string (PROGSHAREDIR) + DIR_SEPARATOR_STR + RINGDIR + DIR_SEPARATOR_STR + tone_name ; + } else { + // the absolute has been saved; do nothing + tone_path = tone_name ; + } + + _debug ("%s\n", tone_path.c_str()); + + return tone_path; } void -ManagerImpl::setRingtoneChoice( const std::string& tone ) +ManagerImpl::setRingtoneChoice (const std::string& tone) { - // we save the absolute path - setConfig( AUDIO , RING_CHOICE , tone ); + // we save the absolute path + setConfig (AUDIO , RING_CHOICE , tone); } std::string -ManagerImpl::getRecordPath( void ) +ManagerImpl::getRecordPath (void) { - return getConfigString( AUDIO, RECORD_PATH ); + return getConfigString (AUDIO, RECORD_PATH); } void -ManagerImpl::setRecordPath( const std::string& recPath) +ManagerImpl::setRecordPath (const std::string& recPath) { - setConfig( AUDIO, RECORD_PATH, recPath.substr(7)); + _debug ("ManagerImpl::setRecordPath(%s)! \n", recPath.c_str()); + setConfig (AUDIO, RECORD_PATH, recPath); } int -ManagerImpl::getDialpad( void ) +ManagerImpl::getDialpad (void) { - return getConfigInt( PREFERENCES , CONFIG_DIALPAD ); + return getConfigInt (PREFERENCES , CONFIG_DIALPAD); } void -ManagerImpl::setDialpad( void ) +ManagerImpl::setDialpad (void) { - ( getConfigInt( PREFERENCES , CONFIG_DIALPAD ) == DISPLAY_DIALPAD )? setConfig(PREFERENCES , CONFIG_DIALPAD , NO_STR ) : setConfig( PREFERENCES , CONFIG_DIALPAD , YES_STR ); + (getConfigInt (PREFERENCES , CONFIG_DIALPAD) == DISPLAY_DIALPAD) ? setConfig (PREFERENCES , CONFIG_DIALPAD , NO_STR) : setConfig (PREFERENCES , CONFIG_DIALPAD , YES_STR); } -std::string ManagerImpl::getStunServer( void ) +std::string ManagerImpl::getStunServer (void) { - return getConfigString(SIGNALISATION , STUN_SERVER); + return getConfigString (SIGNALISATION , STUN_SERVER); } -void ManagerImpl::setStunServer( const std::string &server ) +void ManagerImpl::setStunServer (const std::string &server) { - setConfig(SIGNALISATION , STUN_SERVER, server ); + setConfig (SIGNALISATION , STUN_SERVER, server); } int ManagerImpl::isStunEnabled (void) { - return getConfigInt(SIGNALISATION , STUN_ENABLE); + return getConfigInt (SIGNALISATION , STUN_ENABLE); } void ManagerImpl::enableStun (void) { /* Update the config */ - ( getConfigInt( SIGNALISATION , STUN_ENABLE ) == STUN_ENABLED )? setConfig(SIGNALISATION , STUN_ENABLE , NO_STR ) : setConfig( SIGNALISATION , STUN_ENABLE , YES_STR ); + (getConfigInt (SIGNALISATION , STUN_ENABLE) == STUN_ENABLED) ? setConfig (SIGNALISATION , STUN_ENABLE , NO_STR) : setConfig (SIGNALISATION , STUN_ENABLE , YES_STR); /* Restart PJSIP */ this->restartPJSIP (); } - int -ManagerImpl::getVolumeControls( void ) +int +ManagerImpl::getVolumeControls (void) { - return getConfigInt( PREFERENCES , CONFIG_VOLUME ); + return getConfigInt (PREFERENCES , CONFIG_VOLUME); } void -ManagerImpl::setVolumeControls( void ) +ManagerImpl::setVolumeControls (void) { - ( getConfigInt( PREFERENCES , CONFIG_VOLUME ) == DISPLAY_VOLUME_CONTROLS )? setConfig(PREFERENCES , CONFIG_VOLUME , NO_STR ) : setConfig( PREFERENCES , CONFIG_VOLUME , YES_STR ); + (getConfigInt (PREFERENCES , CONFIG_VOLUME) == DISPLAY_VOLUME_CONTROLS) ? setConfig (PREFERENCES , CONFIG_VOLUME , NO_STR) : setConfig (PREFERENCES , CONFIG_VOLUME , YES_STR); } void -ManagerImpl::setRecordingCall(const CallID& id) +ManagerImpl::setRecordingCall (const CallID& id) { - _debug("ManagerImpl::setRecording()! \n"); - AccountID accountid = getAccountFromCall( id ); + _debug ("ManagerImpl::setRecording()! \n"); + AccountID accountid = getAccountFromCall (id); - getAccountLink(accountid)->setRecording(id); + getAccountLink (accountid)->setRecording (id); } bool -ManagerImpl::isRecording(const CallID& id) +ManagerImpl::isRecording (const CallID& id) { - _debug("ManagerImpl::isRecording()! \n"); - AccountID accountid = getAccountFromCall( id ); + _debug ("ManagerImpl::isRecording()! \n"); + AccountID accountid = getAccountFromCall (id); - return getAccountLink(accountid)->isRecording(id); + return getAccountLink (accountid)->isRecording (id); } void -ManagerImpl::startHidden( void ) +ManagerImpl::startHidden (void) { - ( getConfigInt( PREFERENCES , CONFIG_START ) == START_HIDDEN)? setConfig(PREFERENCES , CONFIG_START , NO_STR ) : setConfig( PREFERENCES , CONFIG_START , YES_STR ); + (getConfigInt (PREFERENCES , CONFIG_START) == START_HIDDEN) ? setConfig (PREFERENCES , CONFIG_START , NO_STR) : setConfig (PREFERENCES , CONFIG_START , YES_STR); } int -ManagerImpl::isStartHidden( void ) +ManagerImpl::isStartHidden (void) { - return getConfigInt( PREFERENCES , CONFIG_START ); + return getConfigInt (PREFERENCES , CONFIG_START); } void -ManagerImpl::switchPopupMode( void ) +ManagerImpl::switchPopupMode (void) { - ( getConfigInt( PREFERENCES , CONFIG_POPUP ) == WINDOW_POPUP)? setConfig(PREFERENCES , CONFIG_POPUP , NO_STR ) : setConfig( PREFERENCES , CONFIG_POPUP , YES_STR ); + (getConfigInt (PREFERENCES , CONFIG_POPUP) == WINDOW_POPUP) ? setConfig (PREFERENCES , CONFIG_POPUP , NO_STR) : setConfig (PREFERENCES , CONFIG_POPUP , YES_STR); } -void -ManagerImpl::setMaxCalls( const int& calls ) +void ManagerImpl::setHistoryLimit (const int& days) { - setConfig( PREFERENCES , CONFIG_HISTORY , calls ); + setConfig (PREFERENCES, CONFIG_HISTORY_LIMIT, days); } -int -ManagerImpl::getMaxCalls( void ) +int ManagerImpl::getHistoryLimit (void) +{ + return getConfigInt (PREFERENCES , CONFIG_HISTORY_LIMIT); +} + +int ManagerImpl::getHistoryEnabled (void) +{ + return getConfigInt (PREFERENCES, CONFIG_HISTORY_ENABLED); +} + +void ManagerImpl::setHistoryEnabled (void) { - _debug("Max calls = %i\n" , getConfigInt( PREFERENCES , CONFIG_HISTORY )); - return getConfigInt( PREFERENCES , CONFIG_HISTORY ); + (getConfigInt (PREFERENCES, CONFIG_HISTORY_ENABLED) == 1) ? setConfig (PREFERENCES, CONFIG_HISTORY_ENABLED, NO_STR) : setConfig (PREFERENCES, CONFIG_HISTORY_ENABLED, YES_STR); } int -ManagerImpl::getSearchbar( void ) +ManagerImpl::getSearchbar (void) { - return getConfigInt( PREFERENCES , CONFIG_SEARCHBAR ); + return getConfigInt (PREFERENCES , CONFIG_SEARCHBAR); } void -ManagerImpl::setSearchbar( void ) +ManagerImpl::setSearchbar (void) { - ( getConfigInt( PREFERENCES , CONFIG_SEARCHBAR ) == 1)? setConfig(PREFERENCES , CONFIG_SEARCHBAR , NO_STR ) : setConfig( PREFERENCES , CONFIG_SEARCHBAR , YES_STR ); + (getConfigInt (PREFERENCES , CONFIG_SEARCHBAR) == 1) ? setConfig (PREFERENCES , CONFIG_SEARCHBAR , NO_STR) : setConfig (PREFERENCES , CONFIG_SEARCHBAR , YES_STR); } int -ManagerImpl::popupMode( void ) +ManagerImpl::popupMode (void) { - return getConfigInt( PREFERENCES , CONFIG_POPUP ); + return getConfigInt (PREFERENCES , CONFIG_POPUP); } int32_t -ManagerImpl::getNotify( void ) +ManagerImpl::getNotify (void) { - return getConfigInt( PREFERENCES , CONFIG_NOTIFY ); + return getConfigInt (PREFERENCES , CONFIG_NOTIFY); } void -ManagerImpl::setNotify( void ) +ManagerImpl::setNotify (void) { - ( getConfigInt( PREFERENCES , CONFIG_NOTIFY ) == NOTIFY_ALL )? setConfig( PREFERENCES , CONFIG_NOTIFY , NO_STR ) : setConfig( PREFERENCES , CONFIG_NOTIFY , YES_STR ); + (getConfigInt (PREFERENCES , CONFIG_NOTIFY) == NOTIFY_ALL) ? setConfig (PREFERENCES , CONFIG_NOTIFY , NO_STR) : setConfig (PREFERENCES , CONFIG_NOTIFY , YES_STR); } int32_t -ManagerImpl::getMailNotify( void ) +ManagerImpl::getMailNotify (void) { - return getConfigInt( PREFERENCES , CONFIG_MAIL_NOTIFY ); + return getConfigInt (PREFERENCES , CONFIG_MAIL_NOTIFY); } int32_t -ManagerImpl::getPulseAppVolumeControl( void ) +ManagerImpl::getPulseAppVolumeControl (void) { - return getConfigInt( PREFERENCES , CONFIG_PA_VOLUME_CTRL ); + return getConfigInt (PREFERENCES , CONFIG_PA_VOLUME_CTRL); } void -ManagerImpl::setPulseAppVolumeControl( void ) +ManagerImpl::setPulseAppVolumeControl (void) { - (getConfigInt( PREFERENCES , CONFIG_PA_VOLUME_CTRL ) == 1)? setConfig( PREFERENCES , CONFIG_PA_VOLUME_CTRL , NO_STR) : setConfig( PREFERENCES , CONFIG_PA_VOLUME_CTRL , YES_STR) ; + (getConfigInt (PREFERENCES , CONFIG_PA_VOLUME_CTRL) == 1) ? setConfig (PREFERENCES , CONFIG_PA_VOLUME_CTRL , NO_STR) : setConfig (PREFERENCES , CONFIG_PA_VOLUME_CTRL , YES_STR) ; } -void ManagerImpl::setAudioManager( const int32_t& api ) +void ManagerImpl::setAudioManager (const int32_t& api) { int type, samplerate, framesize, numCardIn, numCardOut; std::string alsaPlugin; - _debug( "Setting audio manager \n"); + _debug ("Setting audio manager \n"); - if(!_audiodriver) + if (!_audiodriver) return; type = _audiodriver->getLayerType(); - if(type == api){ - _debug( "Audio manager chosen already in use. No changes made. \n"); + if (type == api) { + _debug ("Audio manager chosen already in use. No changes made. \n"); return; } - setConfig( PREFERENCES , CONFIG_AUDIO , api) ; + setConfig (PREFERENCES , CONFIG_AUDIO , api) ; + switchAudioManager(); return; -/* - int manager; + /* + int manager; - _debug(" ManagerImpl::setAudioManager :: %i \n",api); + _debug(" ManagerImpl::setAudioManager :: %i \n",api); - manager = api; - if( manager == PULSEAUDIO ) - { - if(app_is_running("pulseaudio") != 0) + manager = api; + if( manager == PULSEAUDIO ) { - // The pulseaudio daemon is not running - manager = ALSA; - notifyErrClient(PULSEAUDIO_NOT_RUNNING); + if(app_is_running("pulseaudio") != 0) + { + // The pulseaudio daemon is not running + manager = ALSA; + notifyErrClient(PULSEAUDIO_NOT_RUNNING); + } } - } - if(manager == api) - { - // it means that we can change the audio manager - setConfig( PREFERENCES , CONFIG_AUDIO , api) ; - switchAudioManager(); - } -*/ + if(manager == api) + { + // it means that we can change the audio manager + setConfig( PREFERENCES , CONFIG_AUDIO , api) ; + switchAudioManager(); + } + */ } int32_t -ManagerImpl::getAudioManager( void ) +ManagerImpl::getAudioManager (void) { - return getConfigInt( PREFERENCES , CONFIG_AUDIO ); + return getConfigInt (PREFERENCES , CONFIG_AUDIO); } int -ManagerImpl::getRegistrationExpireValue( void) +ManagerImpl::getRegistrationExpireValue (void) { - return getConfigInt( PREFERENCES , REGISTRATION_EXPIRE ); + return getConfigInt (PREFERENCES , REGISTRATION_EXPIRE); } void -ManagerImpl::setMailNotify( void ) +ManagerImpl::setMailNotify (void) { - ( getConfigInt( PREFERENCES , CONFIG_MAIL_NOTIFY ) == NOTIFY_ALL )? setConfig( PREFERENCES , CONFIG_MAIL_NOTIFY , NO_STR ) : setConfig( PREFERENCES , CONFIG_MAIL_NOTIFY , YES_STR ); + (getConfigInt (PREFERENCES , CONFIG_MAIL_NOTIFY) == NOTIFY_ALL) ? setConfig (PREFERENCES , CONFIG_MAIL_NOTIFY , NO_STR) : setConfig (PREFERENCES , CONFIG_MAIL_NOTIFY , YES_STR); } void -ManagerImpl::notifyErrClient( const int32_t& errCode ) +ManagerImpl::notifyErrClient (const int32_t& errCode) { - if( _dbus ){ - _debug("NOTIFY ERR NUMBER %i\n" , errCode); - _dbus -> getConfigurationManager() -> errorAlert( errCode ); - } + if (_dbus) { + _debug ("NOTIFY ERR NUMBER %i\n" , errCode); + _dbus -> getConfigurationManager() -> errorAlert (errCode); + } } - int -ManagerImpl::getAudioDeviceIndex(const std::string name) +int +ManagerImpl::getAudioDeviceIndex (const std::string name) { AlsaLayer *alsalayer; - _debug("Get audio device index\n"); + _debug ("Get audio device index\n"); alsalayer = dynamic_cast<AlsaLayer *> (getAudioDriver()); - if(alsalayer) return alsalayer -> soundCardGetIndex( name ); + + if (alsalayer) return alsalayer -> soundCardGetIndex (name); } - std::string -ManagerImpl::getCurrentAudioOutputPlugin( void ) +std::string +ManagerImpl::getCurrentAudioOutputPlugin (void) { AlsaLayer *alsalayer; - _debug("Get alsa plugin\n"); + _debug ("Get alsa plugin\n"); alsalayer = dynamic_cast<AlsaLayer *> (getAudioDriver()); - if(alsalayer) return alsalayer -> getAudioPlugin (); - else return getConfigString( AUDIO , ALSA_PLUGIN ); + + if (alsalayer) return alsalayer -> getAudioPlugin (); + else return getConfigString (AUDIO , ALSA_PLUGIN); } -int ManagerImpl::app_is_running( std::string process ) +int ManagerImpl::app_is_running (std::string process) { std::ostringstream cmd; cmd << "ps -C " << process; - return system(cmd.str().c_str()); + return system (cmd.str().c_str()); } @@ -1878,50 +2044,45 @@ int ManagerImpl::app_is_running( std::string process ) * Initialization: Main Thread */ bool -ManagerImpl::initAudioDriver(void) +ManagerImpl::initAudioDriver (void) { int error; - _debugInit("AudioLayer Creation"); + _debugInit ("AudioLayer Creation"); - if( getConfigInt( PREFERENCES , CONFIG_AUDIO ) == ALSA ) - { - _audiodriver = new AlsaLayer( this ); - } - else if( getConfigInt( PREFERENCES , CONFIG_AUDIO ) == PULSEAUDIO ) - { - if( app_is_running("pulseaudio") == 0 ) - { - _audiodriver = new PulseLayer( this ); - } else - { - _audiodriver = new AlsaLayer( this ); - setConfig( PREFERENCES, CONFIG_AUDIO, ALSA); + if (getConfigInt (PREFERENCES , CONFIG_AUDIO) == ALSA) { + _audiodriver = new AlsaLayer (this); + } else if (getConfigInt (PREFERENCES , CONFIG_AUDIO) == PULSEAUDIO) { + if (app_is_running ("pulseaudio") == 0) { + _audiodriver = new PulseLayer (this); + } else { + _audiodriver = new AlsaLayer (this); + setConfig (PREFERENCES, CONFIG_AUDIO, ALSA); } - } - else - _debug("Error - Audio API unknown\n"); + } else + _debug ("Error - Audio API unknown\n"); - if (_audiodriver == 0) { - _debug("Init audio driver error\n"); - return false; - } else { - error = getAudioDriver()->getErrorMessage(); - if (error == -1) { - _debug("Init audio driver: %i\n", error); - return false; + if (_audiodriver == 0) { + _debug ("Init audio driver error\n"); + return false; + } else { + error = getAudioDriver()->getErrorMessage(); + + if (error == -1) { + _debug ("Init audio driver: %i\n", error); + return false; + } } - } - return true; + return true; } /** * Initialization: Main Thread and gui */ - void +void ManagerImpl::selectAudioDriver (void) { int layer, numCardIn, numCardOut, sampleRate, frameSize; @@ -1929,42 +2090,46 @@ ManagerImpl::selectAudioDriver (void) AlsaLayer *alsalayer; layer = _audiodriver->getLayerType(); - _debug("Audio layer type: %i\n" , layer); + _debug ("Audio layer type: %i\n" , layer); /* Retrieve the global devices info from the user config */ - alsaPlugin = getConfigString( AUDIO , ALSA_PLUGIN ); - numCardIn = getConfigInt( AUDIO , ALSA_CARD_ID_IN ); - numCardOut = getConfigInt( AUDIO , ALSA_CARD_ID_OUT ); - sampleRate = getConfigInt( AUDIO , ALSA_SAMPLE_RATE ); + alsaPlugin = getConfigString (AUDIO , ALSA_PLUGIN); + numCardIn = getConfigInt (AUDIO , ALSA_CARD_ID_IN); + numCardOut = getConfigInt (AUDIO , ALSA_CARD_ID_OUT); + sampleRate = getConfigInt (AUDIO , ALSA_SAMPLE_RATE); + if (sampleRate <=0 || sampleRate > 48000) { sampleRate = 44100; } - frameSize = getConfigInt( AUDIO , ALSA_FRAME_SIZE ); + + frameSize = getConfigInt (AUDIO , ALSA_FRAME_SIZE); /* Only for the ALSA layer, we check the sound card information */ - if (layer == ALSA) - { + + if (layer == ALSA) { alsalayer = dynamic_cast<AlsaLayer*> (getAudioDriver ()); - if( !alsalayer -> soundCardIndexExist( numCardIn , SFL_PCM_CAPTURE ) ) - { - _debug(" Card with index %i doesn't exist or cannot capture. Switch to 0.\n", numCardIn); + + if (!alsalayer -> soundCardIndexExist (numCardIn , SFL_PCM_CAPTURE)) { + _debug (" Card with index %i doesn't exist or cannot capture. Switch to 0.\n", numCardIn); numCardIn = ALSA_DFT_CARD_ID ; - setConfig( AUDIO , ALSA_CARD_ID_IN , ALSA_DFT_CARD_ID ); + setConfig (AUDIO , ALSA_CARD_ID_IN , ALSA_DFT_CARD_ID); } - if( !alsalayer -> soundCardIndexExist( numCardOut , SFL_PCM_PLAYBACK ) ) - { - _debug(" Card with index %i doesn't exist or cannot playback . Switch to 0.\n", numCardOut); + + if (!alsalayer -> soundCardIndexExist (numCardOut , SFL_PCM_PLAYBACK)) { + _debug (" Card with index %i doesn't exist or cannot playback . Switch to 0.\n", numCardOut); numCardOut = ALSA_DFT_CARD_ID ; - setConfig( AUDIO , ALSA_CARD_ID_OUT , ALSA_DFT_CARD_ID ); + setConfig (AUDIO , ALSA_CARD_ID_OUT , ALSA_DFT_CARD_ID); } } - _audiodriver->setErrorMessage(-1); + _audiodriver->setErrorMessage (-1); + /* Open the audio devices */ - _audiodriver->openDevice( numCardIn , numCardOut, sampleRate, frameSize, SFL_PCM_BOTH, alsaPlugin ); + _audiodriver->openDevice (numCardIn , numCardOut, sampleRate, frameSize, SFL_PCM_BOTH, alsaPlugin); /* Notify the error if there is one */ - if( _audiodriver -> getErrorMessage() != -1 ) - notifyErrClient( _audiodriver -> getErrorMessage()); + + if (_audiodriver -> getErrorMessage() != -1) + notifyErrClient (_audiodriver -> getErrorMessage()); } @@ -1973,46 +2138,60 @@ void ManagerImpl::switchAudioManager (void) int type, samplerate, framesize, numCardIn, numCardOut; std::string alsaPlugin; - _debug( "Switching audio manager \n"); + _debug ("Switching audio manager \n"); - if(!_audiodriver) + if (!_audiodriver) return; type = _audiodriver->getLayerType(); - samplerate = getConfigInt( AUDIO , ALSA_SAMPLE_RATE ); - framesize = getConfigInt( AUDIO , ALSA_FRAME_SIZE ); - alsaPlugin = getConfigString( AUDIO , ALSA_PLUGIN ); - numCardIn = getConfigInt( AUDIO , ALSA_CARD_ID_IN ); - numCardOut = getConfigInt( AUDIO , ALSA_CARD_ID_OUT ); - _debug("Deleting current layer... \n" ); + samplerate = getConfigInt (AUDIO , ALSA_SAMPLE_RATE); + + framesize = getConfigInt (AUDIO , ALSA_FRAME_SIZE); + + alsaPlugin = getConfigString (AUDIO , ALSA_PLUGIN); + + numCardIn = getConfigInt (AUDIO , ALSA_CARD_ID_IN); + + numCardOut = getConfigInt (AUDIO , ALSA_CARD_ID_OUT); + + _debug ("Deleting current layer... \n"); + //_audiodriver->closeLayer(); - delete _audiodriver; _audiodriver = NULL; + delete _audiodriver; + + _audiodriver = NULL; + + switch (type) { - switch( type ){ case ALSA: - _debug("Creating Pulseaudio layer...\n"); - _audiodriver = new PulseLayer( this ); + _debug ("Creating Pulseaudio layer...\n"); + _audiodriver = new PulseLayer (this); break; + case PULSEAUDIO: - _debug("Creating ALSA layer...\n"); - _audiodriver = new AlsaLayer( this ); + _debug ("Creating ALSA layer...\n"); + _audiodriver = new AlsaLayer (this); break; + default: - _debug("Error: audio layer unknown\n"); + _debug ("Error: audio layer unknown\n"); } - _audiodriver->setErrorMessage(-1); - _audiodriver->openDevice( numCardIn , numCardOut, samplerate, framesize, SFL_PCM_BOTH, alsaPlugin ); - if( _audiodriver -> getErrorMessage() != -1 ) - notifyErrClient( _audiodriver -> getErrorMessage()); + _audiodriver->setErrorMessage (-1); + + _audiodriver->openDevice (numCardIn , numCardOut, samplerate, framesize, SFL_PCM_BOTH, alsaPlugin); + + if (_audiodriver -> getErrorMessage() != -1) + notifyErrClient (_audiodriver -> getErrorMessage()); - _debug("Current device: %i \n", type); - _debug("has current call: %i \n", hasCurrentCall()); + _debug ("Current device: %i \n", type); + + _debug ("has current call: %i \n", hasCurrentCall()); // need to stop audio streams if there is currently no call - if( (type != PULSEAUDIO) && (!hasCurrentCall())) { - // _debug("There is currently a call!!\n"); + if ( (type != PULSEAUDIO) && (!hasCurrentCall())) { + // _debug("There is currently a call!!\n"); _audiodriver->stopStream(); } @@ -2022,16 +2201,16 @@ void ManagerImpl::switchAudioManager (void) * Init the volume for speakers/micro from 0 to 100 value * Initialization: Main Thread */ - void +void ManagerImpl::initVolume() { - _debugInit("Initiate Volume"); - setSpkrVolume(getConfigInt(AUDIO, VOLUME_SPKR)); - setMicVolume(getConfigInt(AUDIO, VOLUME_MICRO)); + _debugInit ("Initiate Volume"); + setSpkrVolume (getConfigInt (AUDIO, VOLUME_SPKR)); + setMicVolume (getConfigInt (AUDIO, VOLUME_MICRO)); } -void ManagerImpl::setSpkrVolume(unsigned short spkr_vol) +void ManagerImpl::setSpkrVolume (unsigned short spkr_vol) { PulseLayer *pulselayer = NULL; @@ -2040,25 +2219,24 @@ void ManagerImpl::setSpkrVolume(unsigned short spkr_vol) /* Only for PulseAudio */ pulselayer = dynamic_cast<PulseLayer*> (getAudioDriver()); - if (pulselayer) - { - if( pulselayer->getLayerType() == PULSEAUDIO ) - { - if(pulselayer) pulselayer->setPlaybackVolume (spkr_vol); + + if (pulselayer) { + if (pulselayer->getLayerType() == PULSEAUDIO) { + if (pulselayer) pulselayer->setPlaybackVolume (spkr_vol); } } } -void ManagerImpl::setMicVolume(unsigned short mic_vol) +void ManagerImpl::setMicVolume (unsigned short mic_vol) { _mic_volume = mic_vol; } -void ManagerImpl::setSipPort( int port ) +void ManagerImpl::setSipPort (int port) { } -int ManagerImpl::getSipPort( void ) +int ManagerImpl::getSipPort (void) { return 5060; } @@ -2068,120 +2246,173 @@ int ManagerImpl::getSipPort( void ) /** * Main Thread */ - bool -ManagerImpl::getCallStatus(const std::string& sequenceId UNUSED) -{ - if (!_dbus) { return false; } - ost::MutexLock m(_callAccountMapMutex); - CallAccountMap::iterator iter = _callAccountMap.begin(); - TokenList tk; - std::string code; - std::string status; - std::string destination; - std::string number; - - while (iter != _callAccountMap.end()) - { - Call* call = getAccountLink(iter->second)->getCall(iter->first); - Call::ConnectionState state = call->getConnectionState(); - if (state != Call::Connected) { - switch(state) { - case Call::Trying: code="110"; status = "Trying"; break; - case Call::Ringing: code="111"; status = "Ringing"; break; - case Call::Progressing: code="125"; status = "Progressing"; break; - case Call::Disconnected: code="125"; status = "Disconnected"; break; - default: code=""; status= ""; - } - } else { - switch (call->getState()) { - case Call::Active: code="112"; status = "Established"; break; - case Call::Hold: code="114"; status = "Held"; break; - case Call::Busy: code="113"; status = "Busy"; break; - case Call::Refused: code="125"; status = "Refused"; break; - case Call::Error: code="125"; status = "Error"; break; - case Call::Inactive: code="125"; status = "Inactive"; break; - } - } - - // No Congestion - // No Wrong Number - // 116 <CSeq> <call-id> <acc> <destination> Busy - destination = call->getPeerName(); - number = call->getPeerNumber(); - if (number!="") { - destination.append(" <"); - destination.append(number); - destination.append(">"); +bool +ManagerImpl::getCallStatus (const std::string& sequenceId UNUSED) +{ + if (!_dbus) { + return false; } - tk.push_back(iter->second); - tk.push_back(destination); - tk.push_back(status); - tk.clear(); - iter++; - } + ost::MutexLock m (_callAccountMapMutex); + + CallAccountMap::iterator iter = _callAccountMap.begin(); + TokenList tk; + std::string code; + std::string status; + std::string destination; + std::string number; + + while (iter != _callAccountMap.end()) { + Call* call = getAccountLink (iter->second)->getCall (iter->first); + Call::ConnectionState state = call->getConnectionState(); + + if (state != Call::Connected) { + switch (state) { + + case Call::Trying: + code="110"; + status = "Trying"; + break; + + case Call::Ringing: + code="111"; + status = "Ringing"; + break; + + case Call::Progressing: + code="125"; + status = "Progressing"; + break; + + case Call::Disconnected: + code="125"; + status = "Disconnected"; + break; + + default: + code=""; + status= ""; + } + } else { + switch (call->getState()) { + + case Call::Active: + code="112"; + status = "Established"; + break; + + case Call::Hold: + code="114"; + status = "Held"; + break; + + case Call::Busy: + code="113"; + status = "Busy"; + break; + + case Call::Refused: + code="125"; + status = "Refused"; + break; + + case Call::Error: + code="125"; + status = "Error"; + break; + + case Call::Inactive: + code="125"; + status = "Inactive"; + break; + } + } + + // No Congestion + // No Wrong Number + // 116 <CSeq> <call-id> <acc> <destination> Busy + destination = call->getPeerName(); + + number = call->getPeerNumber(); + + if (number!="") { + destination.append (" <"); + destination.append (number); + destination.append (">"); + } + + tk.push_back (iter->second); - return true; + tk.push_back (destination); + tk.push_back (status); + tk.clear(); + + iter++; + } + + return true; } //THREAD=Main - bool -ManagerImpl::getConfig(const std::string& section, const std::string& name, TokenList& arg) +bool +ManagerImpl::getConfig (const std::string& section, const std::string& name, TokenList& arg) { - return _config.getConfigTreeItemToken(section, name, arg); + return _config.getConfigTreeItemToken (section, name, arg); } //THREAD=Main // throw an Conf::ConfigTreeItemException if not found - int -ManagerImpl::getConfigInt(const std::string& section, const std::string& name) +int +ManagerImpl::getConfigInt (const std::string& section, const std::string& name) { - try { - return _config.getConfigTreeItemIntValue(section, name); - } catch (Conf::ConfigTreeItemException& e) { - throw e; - } - return 0; + try { + return _config.getConfigTreeItemIntValue (section, name); + } catch (Conf::ConfigTreeItemException& e) { + throw e; + } + + return 0; } //THREAD=Main std::string -ManagerImpl::getConfigString(const std::string& section, const std::string& - name) +ManagerImpl::getConfigString (const std::string& section, const std::string& + name) { - try { - return _config.getConfigTreeItemValue(section, name); - } catch (Conf::ConfigTreeItemException& e) { - throw e; - } - return ""; + try { + return _config.getConfigTreeItemValue (section, name); + } catch (Conf::ConfigTreeItemException& e) { + throw e; + } + + return ""; } //THREAD=Main - bool -ManagerImpl::setConfig(const std::string& section, const std::string& name, const std::string& value) +bool +ManagerImpl::setConfig (const std::string& section, const std::string& name, const std::string& value) { - return _config.setConfigTreeItem(section, name, value); + return _config.setConfigTreeItem (section, name, value); } //THREAD=Main - bool -ManagerImpl::setConfig(const std::string& section, const std::string& name, int value) +bool +ManagerImpl::setConfig (const std::string& section, const std::string& name, int value) { - std::ostringstream valueStream; - valueStream << value; - return _config.setConfigTreeItem(section, name, valueStream.str()); + std::ostringstream valueStream; + valueStream << value; + return _config.setConfigTreeItem (section, name, valueStream.str()); } -void ManagerImpl::setAccountsOrder (const std::string& order) +void ManagerImpl::setAccountsOrder (const std::string& order) { - _debug("Set accounts order : %s\n", order.c_str() ); + _debug ("Set accounts order : %s\n", order.c_str()); // Set the new config setConfig (PREFERENCES, CONFIG_ACCOUNTS_ORDER, order); } - std::vector< std::string > +std::vector< std::string > ManagerImpl::getAccountList() { std::vector< std::string > v; @@ -2193,99 +2424,100 @@ ManagerImpl::getAccountList() // If no order has been set, load the default one // ie according to the creation date. + if (account_order.size () == 0) { iter = _accountMap.begin (); - while ( iter != _accountMap.end() ) { - if ( iter->second != 0 ) { - v.push_back(iter->first.data()); + + while (iter != _accountMap.end()) { + if (iter->second != 0) { + v.push_back (iter->first.data()); } + iter++; - } + } } // Otherelse, load the custom one // ie according to the saved order else { - + for (i=0; i<account_order.size (); i++) { // This account has not been loaded, so we ignore it - if ( (iter=_accountMap.find (account_order[i])) != _accountMap.end() ) - { + if ( (iter=_accountMap.find (account_order[i])) != _accountMap.end()) { // If the account is valid - if (iter->second != 0) - { + if (iter->second != 0) { v.push_back (iter->first.data ()); } } } - + } - + return v; } -std::map< std::string, std::string > ManagerImpl::getAccountDetails(const AccountID& accountID) +std::map< std::string, std::string > ManagerImpl::getAccountDetails (const AccountID& accountID) { - std::map<std::string, std::string> a; - std::string accountType; - RegistrationState state; + std::map<std::string, std::string> a; + std::string accountType; + RegistrationState state; - state = _accountMap[accountID]->getRegistrationState(); - accountType = getConfigString(accountID, CONFIG_ACCOUNT_TYPE); + state = _accountMap[accountID]->getRegistrationState(); + accountType = getConfigString (accountID, CONFIG_ACCOUNT_TYPE); - a.insert( std::pair<std::string, std::string>( CONFIG_ACCOUNT_ALIAS, getConfigString(accountID, CONFIG_ACCOUNT_ALIAS)) ); - a.insert( std::pair<std::string, std::string>( CONFIG_ACCOUNT_ENABLE, getConfigString(accountID, CONFIG_ACCOUNT_ENABLE) == "1" ? "TRUE": "FALSE")); - a.insert( std::pair<std::string, std::string>( - "Status", - (state == Registered ? "REGISTERED": - (state == Unregistered ? "UNREGISTERED": - (state == Trying ? "TRYING": - (state == ErrorAuth ? "ERROR_AUTH": - (state == ErrorNetwork ? "ERROR_NETWORK": - (state == ErrorHost ? "ERROR_HOST": - (state == ErrorExistStun ? "ERROR_EXIST_STUN": - (state == ErrorConfStun ? "ERROR_CONF_STUN": - (state == Error ? "ERROR": "ERROR"))))))))) - ) - ); + a.insert (std::pair<std::string, std::string> (CONFIG_ACCOUNT_ALIAS, getConfigString (accountID, CONFIG_ACCOUNT_ALIAS))); + a.insert (std::pair<std::string, std::string> (CONFIG_ACCOUNT_ENABLE, getConfigString (accountID, CONFIG_ACCOUNT_ENABLE) == "1" ? "TRUE": "FALSE")); + a.insert (std::pair<std::string, std::string> ( + "Status", + (state == Registered ? "REGISTERED": + (state == Unregistered ? "UNREGISTERED": + (state == Trying ? "TRYING": + (state == ErrorAuth ? "ERROR_AUTH": + (state == ErrorNetwork ? "ERROR_NETWORK": + (state == ErrorHost ? "ERROR_HOST": + (state == ErrorExistStun ? "ERROR_EXIST_STUN": + (state == ErrorConfStun ? "ERROR_CONF_STUN": + (state == Error ? "ERROR": "ERROR"))))))))) + ) + ); - a.insert( std::pair<std::string, std::string>( CONFIG_ACCOUNT_TYPE, accountType ) ); - a.insert( std::pair<std::string, std::string>( USERNAME, getConfigString(accountID, USERNAME) ) ); - a.insert( std::pair<std::string, std::string>( PASSWORD, getConfigString(accountID, PASSWORD) ) ); - a.insert( std::pair<std::string, std::string>( HOSTNAME, getConfigString(accountID, HOSTNAME) ) ); - a.insert( std::pair<std::string, std::string>( CONFIG_ACCOUNT_MAILBOX, getConfigString(accountID, CONFIG_ACCOUNT_MAILBOX)) ); + a.insert (std::pair<std::string, std::string> (CONFIG_ACCOUNT_TYPE, accountType)); + a.insert (std::pair<std::string, std::string> (USERNAME, getConfigString (accountID, USERNAME))); + a.insert (std::pair<std::string, std::string> (PASSWORD, getConfigString (accountID, PASSWORD))); + a.insert (std::pair<std::string, std::string> (HOSTNAME, getConfigString (accountID, HOSTNAME))); + a.insert (std::pair<std::string, std::string> (CONFIG_ACCOUNT_MAILBOX, getConfigString (accountID, CONFIG_ACCOUNT_MAILBOX))); - return a; + return a; } -void ManagerImpl::setAccountDetails( const std::string& accountID, const std::map< std::string, std::string >& details ) +void ManagerImpl::setAccountDetails (const std::string& accountID, const std::map< std::string, std::string >& details) { std::string accountType; Account *acc; VoIPLink *link; - accountType = (*details.find(CONFIG_ACCOUNT_TYPE)).second; + accountType = (*details.find (CONFIG_ACCOUNT_TYPE)).second; - setConfig(accountID, CONFIG_ACCOUNT_ALIAS, (*details.find(CONFIG_ACCOUNT_ALIAS)).second); - setConfig(accountID, CONFIG_ACCOUNT_ENABLE, (*details.find(CONFIG_ACCOUNT_ENABLE)).second == "TRUE" ? "1": "0" ); - setConfig(accountID, CONFIG_ACCOUNT_TYPE, accountType); - setConfig(accountID, USERNAME, (*details.find(USERNAME)).second); - setConfig(accountID, PASSWORD, (*details.find(PASSWORD)).second); - setConfig(accountID, HOSTNAME, (*details.find(HOSTNAME)).second); - setConfig(accountID, CONFIG_ACCOUNT_MAILBOX,(*details.find(CONFIG_ACCOUNT_MAILBOX)).second); + setConfig (accountID, CONFIG_ACCOUNT_ALIAS, (*details.find (CONFIG_ACCOUNT_ALIAS)).second); + setConfig (accountID, CONFIG_ACCOUNT_ENABLE, (*details.find (CONFIG_ACCOUNT_ENABLE)).second == "TRUE" ? "1": "0"); + setConfig (accountID, CONFIG_ACCOUNT_TYPE, accountType); + setConfig (accountID, USERNAME, (*details.find (USERNAME)).second); + setConfig (accountID, PASSWORD, (*details.find (PASSWORD)).second); + setConfig (accountID, HOSTNAME, (*details.find (HOSTNAME)).second); + setConfig (accountID, CONFIG_ACCOUNT_MAILBOX, (*details.find (CONFIG_ACCOUNT_MAILBOX)).second); saveConfig(); - acc = getAccount(accountID); + acc = getAccount (accountID); acc->loadConfig(); - if (acc->isEnabled()){ + + if (acc->isEnabled()) { acc->unregisterVoIPLink(); acc->registerVoIPLink(); - } - else + } else acc->unregisterVoIPLink(); // Update account details to the client side @@ -2294,27 +2526,34 @@ void ManagerImpl::setAccountDetails( const std::string& accountID, const std::ma } void -ManagerImpl::sendRegister( const std::string& accountID , const int32_t& expire ) +ManagerImpl::sendRegister (const std::string& accountID , const int32_t& expire) { - // Update the active field - setConfig( accountID, CONFIG_ACCOUNT_ENABLE, expire ); - Account* acc = getAccount(accountID); - acc->loadConfig(); - // Test on the freshly updated value - if ( acc->isEnabled() ) { - // Verify we aren't already registered, then register - _debug("Send register for account %s\n" , accountID.c_str()); - acc->registerVoIPLink(); - } else { - // Verify we are already registered, then unregister - _debug("Send unregister for account %s\n" , accountID.c_str()); - acc->unregisterVoIPLink(); - } + _debug ("ManagerImpl::sendRegister \n"); + // Update the active field + setConfig (accountID, CONFIG_ACCOUNT_ENABLE, expire); + _debug ("ManagerImpl::sendRegister set config done\n"); + + Account* acc = getAccount (accountID); + acc->loadConfig(); + _debug ("ManagerImpl::sendRegister acc->loadconfig done\n"); + + // Test on the freshly updated value + + if (acc->isEnabled()) { + // Verify we aren't already registered, then register + _debug ("Send register for account %s\n" , accountID.c_str()); + acc->registerVoIPLink(); + } else { + // Verify we are already registered, then unregister + _debug ("Send unregister for account %s\n" , accountID.c_str()); + acc->unregisterVoIPLink(); + } + } - std::string -ManagerImpl::addAccount(const std::map< std::string, std::string >& details) +std::string +ManagerImpl::addAccount (const std::map< std::string, std::string >& details) { /** @todo Deal with both the _accountMap and the Configuration */ @@ -2323,33 +2562,33 @@ ManagerImpl::addAccount(const std::map< std::string, std::string >& details) std::stringstream accountID; AccountID newAccountID; - accountID << "Account:" << time(NULL); + accountID << "Account:" << time (NULL); newAccountID = accountID.str(); - + // Get the type - accountType = (*details.find(CONFIG_ACCOUNT_TYPE)).second; + accountType = (*details.find (CONFIG_ACCOUNT_TYPE)).second; /** @todo Verify the uniqueness, in case a program adds accounts, two in a row. */ if (accountType == "SIP") { - newAccount = AccountCreator::createAccount(AccountCreator::SIP_ACCOUNT, newAccountID); - } - else if (accountType == "IAX") { - newAccount = AccountCreator::createAccount(AccountCreator::IAX_ACCOUNT, newAccountID); - } - else { - _debug("Unknown %s param when calling addAccount(): %s\n", CONFIG_ACCOUNT_TYPE, accountType.c_str()); + newAccount = AccountCreator::createAccount (AccountCreator::SIP_ACCOUNT, newAccountID); + } else if (accountType == "IAX") { + newAccount = AccountCreator::createAccount (AccountCreator::IAX_ACCOUNT, newAccountID); + } else { + _debug ("Unknown %s param when calling addAccount(): %s\n", CONFIG_ACCOUNT_TYPE, accountType.c_str()); return ""; } + _accountMap[newAccountID] = newAccount; - setAccountDetails(accountID.str(), details); + + setAccountDetails (accountID.str(), details); // Add the newly created account in the account order list account_list = getConfigString (PREFERENCES, CONFIG_ACCOUNTS_ORDER); - if (account_list != "") - { + + if (account_list != "") { newAccountID += "/"; - // Prepend the new account + // Prepend the new account account_list.insert (0, newAccountID); setConfig (PREFERENCES, CONFIG_ACCOUNTS_ORDER, account_list); } @@ -2357,83 +2596,90 @@ ManagerImpl::addAccount(const std::map< std::string, std::string >& details) saveConfig(); if (_dbus) _dbus->getConfigurationManager()->accountsChanged(); + return newAccountID; } - void -ManagerImpl::removeAccount(const AccountID& accountID) +void +ManagerImpl::removeAccount (const AccountID& accountID) { - // Get it down and dying - Account* remAccount = getAccount(accountID); + // Get it down and dying + Account* remAccount = getAccount (accountID); - if (remAccount) { - remAccount->unregisterVoIPLink(); - _accountMap.erase(accountID); - delete remAccount; - } + if (remAccount) { + remAccount->unregisterVoIPLink(); + _accountMap.erase (accountID); + delete remAccount; + } - _config.removeSection(accountID); + _config.removeSection (accountID); + + saveConfig(); - saveConfig(); + _debug ("REMOVE ACCOUNT\n"); - _debug("REMOVE ACCOUNT\n"); - if (_dbus) _dbus->getConfigurationManager()->accountsChanged(); + if (_dbus) _dbus->getConfigurationManager()->accountsChanged(); } // ACCOUNT handling - bool -ManagerImpl::associateCallToAccount(const CallID& callID, const AccountID& accountID) -{ - if (getAccountFromCall(callID) == AccountNULL) { // nothing with the same ID - if ( accountExists(accountID) ) { // account id exist in AccountMap - ost::MutexLock m(_callAccountMapMutex); - _callAccountMap[callID] = accountID; - _debug("Associate Call %s with Account %s\n", callID.data(), accountID.data()); - return true; +bool +ManagerImpl::associateCallToAccount (const CallID& callID, const AccountID& accountID) +{ + if (getAccountFromCall (callID) == AccountNULL) { // nothing with the same ID + if (accountExists (accountID)) { // account id exist in AccountMap + ost::MutexLock m (_callAccountMapMutex); + _callAccountMap[callID] = accountID; + _debug ("Associate Call %s with Account %s\n", callID.data(), accountID.data()); + return true; + } else { + return false; + } } else { - return false; + return false; } - } else { - return false; - } } - AccountID -ManagerImpl::getAccountFromCall(const CallID& callID) +AccountID +ManagerImpl::getAccountFromCall (const CallID& callID) { - ost::MutexLock m(_callAccountMapMutex); - CallAccountMap::iterator iter = _callAccountMap.find(callID); - if ( iter == _callAccountMap.end()) { - return AccountNULL; - } else { - return iter->second; - } + ost::MutexLock m (_callAccountMapMutex); + CallAccountMap::iterator iter = _callAccountMap.find (callID); + + if (iter == _callAccountMap.end()) { + return AccountNULL; + } else { + return iter->second; + } } - bool -ManagerImpl::removeCallAccount(const CallID& callID) +bool +ManagerImpl::removeCallAccount (const CallID& callID) { - ost::MutexLock m(_callAccountMapMutex); - if ( _callAccountMap.erase(callID) ) { - return true; - } - return false; + ost::MutexLock m (_callAccountMapMutex); + + if (_callAccountMap.erase (callID)) { + return true; + } + + return false; } - CallID +CallID ManagerImpl::getNewCallID() { - std::ostringstream random_id("s"); - random_id << (unsigned)rand(); + std::ostringstream random_id ("s"); + random_id << (unsigned) rand(); + + // when it's not found, it return "" + // generate, something like s10000s20000s4394040 - // when it's not found, it return "" - // generate, something like s10000s20000s4394040 - while (getAccountFromCall(random_id.str()) != AccountNULL) { - random_id.clear(); - random_id << "s"; - random_id << (unsigned)rand(); - } - return random_id.str(); + while (getAccountFromCall (random_id.str()) != AccountNULL) { + random_id.clear(); + random_id << "s"; + random_id << (unsigned) rand(); + } + + return random_id.str(); } std::vector <std::string> ManagerImpl::loadAccountOrder (void) @@ -2447,7 +2693,7 @@ std::vector <std::string> ManagerImpl::loadAccountOrder (void) } - short +short ManagerImpl::loadAccountMap() { @@ -2458,125 +2704,134 @@ ManagerImpl::loadAccountMap() std::vector <std::string> account_order; TokenList::iterator iter = sections.begin(); - - while(iter != sections.end()) { + + while (iter != sections.end()) { // Check if it starts with "Account:" (SIP and IAX pour le moment) - if ((int)(iter->find("Account:")) == -1) { + if ( (int) (iter->find ("Account:")) == -1) { iter++; continue; } - accountType = getConfigString(*iter, CONFIG_ACCOUNT_TYPE); - + accountType = getConfigString (*iter, CONFIG_ACCOUNT_TYPE); + if (accountType == "SIP") { - tmpAccount = AccountCreator::createAccount(AccountCreator::SIP_ACCOUNT, *iter); + tmpAccount = AccountCreator::createAccount (AccountCreator::SIP_ACCOUNT, *iter); } - + else if (accountType == "IAX") { - tmpAccount = AccountCreator::createAccount(AccountCreator::IAX_ACCOUNT, *iter); + tmpAccount = AccountCreator::createAccount (AccountCreator::IAX_ACCOUNT, *iter); } - + else { - _debug("Unknown %s param in config file (%s)\n", CONFIG_ACCOUNT_TYPE, accountType.c_str()); + _debug ("Unknown %s param in config file (%s)\n", CONFIG_ACCOUNT_TYPE, accountType.c_str()); } if (tmpAccount != NULL) { - _debug(" %s \n", iter->c_str()); - _accountMap[iter->c_str()] = tmpAccount; + _debug (" %s \n", iter->c_str()); + _accountMap[iter->c_str() ] = tmpAccount; nbAccount++; } iter++; } - - _debug("nbAccount loaded %i \n",nbAccount); + + _debug ("nbAccount loaded %i \n",nbAccount); + return nbAccount; } - void +void ManagerImpl::unloadAccountMap() { - AccountMap::iterator iter = _accountMap.begin(); - while ( iter != _accountMap.end() ) { + AccountMap::iterator iter = _accountMap.begin(); - _debug("-> Deleting account %s\n", iter->first.c_str()); - delete iter->second; iter->second = 0; + while (iter != _accountMap.end()) { - iter++; - } - _accountMap.clear(); + _debug ("-> Deleting account %s\n", iter->first.c_str()); + delete iter->second; + iter->second = 0; + + iter++; + } + + _accountMap.clear(); } - bool -ManagerImpl::accountExists(const AccountID& accountID) +bool +ManagerImpl::accountExists (const AccountID& accountID) { - AccountMap::iterator iter = _accountMap.find(accountID); - if ( iter == _accountMap.end() ) { - return false; - } - return true; + AccountMap::iterator iter = _accountMap.find (accountID); + + if (iter == _accountMap.end()) { + return false; + } + + return true; } - Account* -ManagerImpl::getAccount(const AccountID& accountID) +Account* +ManagerImpl::getAccount (const AccountID& accountID) { - AccountMap::iterator iter = _accountMap.find(accountID); - if ( iter == _accountMap.end() ) { - return 0; - } - return iter->second; + AccountMap::iterator iter = _accountMap.find (accountID); + + if (iter == _accountMap.end()) { + return 0; + } + + return iter->second; } AccountID -ManagerImpl::getAccountIdFromNameAndServer(const std::string& userName, const std::string& server) -{ - AccountMap::iterator iter; - SIPAccount *account; - _debug("getAccountIdFromNameAndServer : username = %s , server = %s\n", userName.c_str(), server.c_str()); - // Try to find the account id from username and server name by full match - for(iter = _accountMap.begin(); iter != _accountMap.end(); ++iter) { - _debug("for : account = %s\n", iter->first.c_str()); - account = dynamic_cast<SIPAccount *>(iter->second); - _debug("account != NULL = %i\n", (account != NULL)); - if (account != NULL){ - if(account->fullMatch(userName, server)) - { - _debug("fullMatch\n"); - return iter->first; - } - } - } - - // We failed! Then only match the hostname - for(iter = _accountMap.begin(); iter != _accountMap.end(); ++iter) { - account = dynamic_cast<SIPAccount *>(iter->second); - if ( account != NULL ) { - if(account->hostnameMatch(server)) - { - _debug("hostnameMatch\n"); - return iter->first; - } - } - } - - // We failed! Then only match the username - for(iter = _accountMap.begin(); iter != _accountMap.end(); ++iter) { - account = dynamic_cast<SIPAccount *>(iter->second); - if ( account != NULL ) { - if(account->userMatch(userName)) - { - _debug("userMatch\n"); - return iter->first; - } - } - } - - // Failed again! return AccountNULL - return AccountNULL; -} - -AccountMap ManagerImpl::getSipAccountMap( void ) +ManagerImpl::getAccountIdFromNameAndServer (const std::string& userName, const std::string& server) +{ + AccountMap::iterator iter; + SIPAccount *account; + _debug ("getAccountIdFromNameAndServer : username = %s , server = %s\n", userName.c_str(), server.c_str()); + // Try to find the account id from username and server name by full match + + for (iter = _accountMap.begin(); iter != _accountMap.end(); ++iter) { + _debug ("for : account = %s\n", iter->first.c_str()); + account = dynamic_cast<SIPAccount *> (iter->second); + _debug ("account != NULL = %i\n", (account != NULL)); + + if (account != NULL) { + if (account->fullMatch (userName, server)) { + _debug ("fullMatch\n"); + return iter->first; + } + } + } + + // We failed! Then only match the hostname + for (iter = _accountMap.begin(); iter != _accountMap.end(); ++iter) { + account = dynamic_cast<SIPAccount *> (iter->second); + + if (account != NULL) { + if (account->hostnameMatch (server)) { + _debug ("hostnameMatch\n"); + return iter->first; + } + } + } + + // We failed! Then only match the username + for (iter = _accountMap.begin(); iter != _accountMap.end(); ++iter) { + account = dynamic_cast<SIPAccount *> (iter->second); + + if (account != NULL) { + if (account->userMatch (userName)) { + _debug ("userMatch\n"); + return iter->first; + } + } + } + + // Failed again! return AccountNULL + return AccountNULL; +} + +AccountMap ManagerImpl::getSipAccountMap (void) { AccountMap::iterator iter; @@ -2584,13 +2839,14 @@ AccountMap ManagerImpl::getSipAccountMap( void ) AccountID id; Account *account; - for(iter = _accountMap.begin(); iter != _accountMap.end(); ++iter) { - if( iter->second->getType() == "sip" ){ + for (iter = _accountMap.begin(); iter != _accountMap.end(); ++iter) { + if (iter->second->getType() == "sip") { //id = iter->first; //account = iter->second; //sipaccounts.insert( std::pair<id, account> ); } } + return sipaccounts; } @@ -2602,28 +2858,28 @@ void ManagerImpl::restartPJSIP (void) this->unregisterCurSIPAccounts(); /* Terminate and initialize the PJSIP library */ - if (siplink) - { + if (siplink) { siplink->terminate (); - siplink = SIPVoIPLink::instance(""); + siplink = SIPVoIPLink::instance (""); siplink->init (); } /* Then register all enabled SIP accounts */ - this->registerCurSIPAccounts(siplink); + this->registerCurSIPAccounts (siplink); } -VoIPLink* ManagerImpl::getAccountLink(const AccountID& accountID) +VoIPLink* ManagerImpl::getAccountLink (const AccountID& accountID) { if (accountID!=AccountNULL) { - Account* acc = getAccount(accountID); - if ( acc ) { + Account* acc = getAccount (accountID); + + if (acc) { return acc->getVoIPLink(); } + return 0; - } - else - return SIPVoIPLink::instance(""); + } else + return SIPVoIPLink::instance (""); } VoIPLink* ManagerImpl::getSIPAccountLink() @@ -2631,12 +2887,15 @@ VoIPLink* ManagerImpl::getSIPAccountLink() /* We are looking for the first SIP account we met because all the SIP accounts have the same voiplink */ Account *account; AccountMap::iterator iter; - for(iter = _accountMap.begin(); iter != _accountMap.end(); ++iter) { + + for (iter = _accountMap.begin(); iter != _accountMap.end(); ++iter) { account = iter->second; - if( account->getType() == "sip" ){ + + if (account->getType() == "sip") { return account->getVoIPLink(); } } + return NULL; } @@ -2644,12 +2903,12 @@ VoIPLink* ManagerImpl::getSIPAccountLink() pjsip_regc -*getSipRegcFromID(const AccountID& id UNUSED) +*getSipRegcFromID (const AccountID& id UNUSED) { - /*SIPAccount *tmp = dynamic_cast<SIPAccount *>getAccount(id); - if(tmp != NULL) - return tmp->getSipRegc(); - else*/ + /*SIPAccount *tmp = dynamic_cast<SIPAccount *>getAccount(id); + if(tmp != NULL) + return tmp->getSipRegc(); + else*/ return NULL; } @@ -2658,45 +2917,51 @@ void ManagerImpl::unregisterCurSIPAccounts() Account *current; AccountMap::iterator iter = _accountMap.begin(); - while( iter != _accountMap.end() ) { + + while (iter != _accountMap.end()) { current = iter->second; + if (current) { - if ( current->isEnabled() && current->getType() == "sip") { - current->unregisterVoIPLink(); + if (current->isEnabled() && current->getType() == "sip") { + current->unregisterVoIPLink(); } } - iter++; + + iter++; } } -void ManagerImpl::registerCurSIPAccounts(VoIPLink *link) +void ManagerImpl::registerCurSIPAccounts (VoIPLink *link) { Account *current; AccountMap::iterator iter = _accountMap.begin(); - while( iter != _accountMap.end() ) { + while (iter != _accountMap.end()) { current = iter->second; if (current) { if (current->isEnabled() && current->getType() == "sip") { //current->setVoIPLink(link); - current->registerVoIPLink(); + current->registerVoIPLink(); } } + current = NULL; - iter++; + + iter++; } } -std::map<std::string, int32_t> ManagerImpl::getAddressbookSettings () { +std::map<std::string, int32_t> ManagerImpl::getAddressbookSettings () +{ std::map<std::string, int32_t> settings; - settings.insert (std::pair<std::string, int32_t> ("ADDRESSBOOK_ENABLE", getConfigInt (ADDRESSBOOK, ADDRESSBOOK_ENABLE)) ); - settings.insert (std::pair<std::string, int32_t> ("ADDRESSBOOK_MAX_RESULTS", getConfigInt (ADDRESSBOOK, ADDRESSBOOK_MAX_RESULTS)) ); + settings.insert (std::pair<std::string, int32_t> ("ADDRESSBOOK_ENABLE", getConfigInt (ADDRESSBOOK, ADDRESSBOOK_ENABLE))); + settings.insert (std::pair<std::string, int32_t> ("ADDRESSBOOK_MAX_RESULTS", getConfigInt (ADDRESSBOOK, ADDRESSBOOK_MAX_RESULTS))); settings.insert (std::pair<std::string, int32_t> ("ADDRESSBOOK_DISPLAY_CONTACT_PHOTO", getConfigInt (ADDRESSBOOK, ADDRESSBOOK_DISPLAY_CONTACT_PHOTO))); settings.insert (std::pair<std::string, int32_t> ("ADDRESSBOOK_DISPLAY_PHONE_BUSINESS", getConfigInt (ADDRESSBOOK, ADDRESSBOOK_DISPLAY_PHONE_BUSINESS))); settings.insert (std::pair<std::string, int32_t> ("ADDRESSBOOK_DISPLAY_PHONE_HOME", getConfigInt (ADDRESSBOOK, ADDRESSBOOK_DISPLAY_PHONE_HOME))); @@ -2705,55 +2970,60 @@ std::map<std::string, int32_t> ManagerImpl::getAddressbookSettings () { return settings; } -void ManagerImpl::setAddressbookSettings (const std::map<std::string, int32_t>& settings){ +void ManagerImpl::setAddressbookSettings (const std::map<std::string, int32_t>& settings) +{ - setConfig(ADDRESSBOOK, ADDRESSBOOK_ENABLE, (*settings.find("ADDRESSBOOK_ENABLE")).second); - setConfig(ADDRESSBOOK, ADDRESSBOOK_MAX_RESULTS, (*settings.find("ADDRESSBOOK_MAX_RESULTS")).second); - setConfig(ADDRESSBOOK, ADDRESSBOOK_DISPLAY_CONTACT_PHOTO , (*settings.find("ADDRESSBOOK_DISPLAY_CONTACT_PHOTO")).second); - setConfig(ADDRESSBOOK, ADDRESSBOOK_DISPLAY_PHONE_BUSINESS , (*settings.find("ADDRESSBOOK_DISPLAY_PHONE_BUSINESS")).second); - setConfig(ADDRESSBOOK, ADDRESSBOOK_DISPLAY_PHONE_HOME , (*settings.find("ADDRESSBOOK_DISPLAY_PHONE_HOME")).second); - setConfig(ADDRESSBOOK, ADDRESSBOOK_DISPLAY_PHONE_MOBILE , (*settings.find("ADDRESSBOOK_DISPLAY_PHONE_MOBILE")).second); + setConfig (ADDRESSBOOK, ADDRESSBOOK_ENABLE, (*settings.find ("ADDRESSBOOK_ENABLE")).second); + setConfig (ADDRESSBOOK, ADDRESSBOOK_MAX_RESULTS, (*settings.find ("ADDRESSBOOK_MAX_RESULTS")).second); + setConfig (ADDRESSBOOK, ADDRESSBOOK_DISPLAY_CONTACT_PHOTO , (*settings.find ("ADDRESSBOOK_DISPLAY_CONTACT_PHOTO")).second); + setConfig (ADDRESSBOOK, ADDRESSBOOK_DISPLAY_PHONE_BUSINESS , (*settings.find ("ADDRESSBOOK_DISPLAY_PHONE_BUSINESS")).second); + setConfig (ADDRESSBOOK, ADDRESSBOOK_DISPLAY_PHONE_HOME , (*settings.find ("ADDRESSBOOK_DISPLAY_PHONE_HOME")).second); + setConfig (ADDRESSBOOK, ADDRESSBOOK_DISPLAY_PHONE_MOBILE , (*settings.find ("ADDRESSBOOK_DISPLAY_PHONE_MOBILE")).second); // Write it to the configuration file saveConfig (); } - void -ManagerImpl::setAddressbookList(const std::vector< std::string >& list){ +void +ManagerImpl::setAddressbookList (const std::vector< std::string >& list) +{ - std::string s = serialize(list); - setConfig(ADDRESSBOOK, ADDRESSBOOK_LIST, s); + std::string s = serialize (list); + setConfig (ADDRESSBOOK, ADDRESSBOOK_LIST, s); } - std::vector <std::string> -ManagerImpl::getAddressbookList( void ){ +std::vector <std::string> +ManagerImpl::getAddressbookList (void) +{ - std::string s = getConfigString(ADDRESSBOOK, ADDRESSBOOK_LIST); - return unserialize(s); + std::string s = getConfigString (ADDRESSBOOK, ADDRESSBOOK_LIST); + return unserialize (s); } -std::map<std::string, std::string> ManagerImpl::getHookSettings () { +std::map<std::string, std::string> ManagerImpl::getHookSettings () +{ std::map<std::string, std::string> settings; - settings.insert (std::pair<std::string, std::string> ("URLHOOK_SIP_FIELD", getConfigString (HOOKS, URLHOOK_SIP_FIELD)) ); - settings.insert (std::pair<std::string, std::string> ("URLHOOK_COMMAND", getConfigString (HOOKS, URLHOOK_COMMAND)) ); - settings.insert (std::pair<std::string, std::string> ("URLHOOK_SIP_ENABLED", getConfigString (HOOKS, URLHOOK_SIP_ENABLED)) ); - settings.insert (std::pair<std::string, std::string> ("URLHOOK_IAX2_ENABLED", getConfigString (HOOKS, URLHOOK_IAX2_ENABLED)) ); - settings.insert (std::pair<std::string, std::string> ("PHONE_NUMBER_HOOK_ENABLED", getConfigString (HOOKS, PHONE_NUMBER_HOOK_ENABLED)) ); - settings.insert (std::pair<std::string, std::string> ("PHONE_NUMBER_HOOK_ADD_PREFIX", getConfigString (HOOKS, PHONE_NUMBER_HOOK_ADD_PREFIX)) ); + settings.insert (std::pair<std::string, std::string> ("URLHOOK_SIP_FIELD", getConfigString (HOOKS, URLHOOK_SIP_FIELD))); + settings.insert (std::pair<std::string, std::string> ("URLHOOK_COMMAND", getConfigString (HOOKS, URLHOOK_COMMAND))); + settings.insert (std::pair<std::string, std::string> ("URLHOOK_SIP_ENABLED", getConfigString (HOOKS, URLHOOK_SIP_ENABLED))); + settings.insert (std::pair<std::string, std::string> ("URLHOOK_IAX2_ENABLED", getConfigString (HOOKS, URLHOOK_IAX2_ENABLED))); + settings.insert (std::pair<std::string, std::string> ("PHONE_NUMBER_HOOK_ENABLED", getConfigString (HOOKS, PHONE_NUMBER_HOOK_ENABLED))); + settings.insert (std::pair<std::string, std::string> ("PHONE_NUMBER_HOOK_ADD_PREFIX", getConfigString (HOOKS, PHONE_NUMBER_HOOK_ADD_PREFIX))); return settings; } -void ManagerImpl::setHookSettings (const std::map<std::string, std::string>& settings){ +void ManagerImpl::setHookSettings (const std::map<std::string, std::string>& settings) +{ - setConfig(HOOKS, URLHOOK_SIP_FIELD, (*settings.find("URLHOOK_SIP_FIELD")).second); - setConfig(HOOKS, URLHOOK_COMMAND, (*settings.find("URLHOOK_COMMAND")).second); - setConfig(HOOKS, URLHOOK_SIP_ENABLED, (*settings.find("URLHOOK_SIP_ENABLED")).second); - setConfig(HOOKS, URLHOOK_IAX2_ENABLED, (*settings.find("URLHOOK_IAX2_ENABLED")).second); - setConfig(HOOKS, PHONE_NUMBER_HOOK_ENABLED, (*settings.find("PHONE_NUMBER_HOOK_ENABLED")).second); - setConfig(HOOKS, PHONE_NUMBER_HOOK_ADD_PREFIX, (*settings.find("PHONE_NUMBER_HOOK_ADD_PREFIX")).second); + setConfig (HOOKS, URLHOOK_SIP_FIELD, (*settings.find ("URLHOOK_SIP_FIELD")).second); + setConfig (HOOKS, URLHOOK_COMMAND, (*settings.find ("URLHOOK_COMMAND")).second); + setConfig (HOOKS, URLHOOK_SIP_ENABLED, (*settings.find ("URLHOOK_SIP_ENABLED")).second); + setConfig (HOOKS, URLHOOK_IAX2_ENABLED, (*settings.find ("URLHOOK_IAX2_ENABLED")).second); + setConfig (HOOKS, PHONE_NUMBER_HOOK_ENABLED, (*settings.find ("PHONE_NUMBER_HOOK_ENABLED")).second); + setConfig (HOOKS, PHONE_NUMBER_HOOK_ADD_PREFIX, (*settings.find ("PHONE_NUMBER_HOOK_ADD_PREFIX")).second); // Write it to the configuration file saveConfig (); @@ -2762,7 +3032,8 @@ void ManagerImpl::setHookSettings (const std::map<std::string, std::string>& set -void ManagerImpl::check_call_configuration (const CallID& id, const std::string &to, Call::CallConfiguration *callConfig) { +void ManagerImpl::check_call_configuration (const CallID& id, const std::string &to, Call::CallConfiguration *callConfig) +{ std::string pattern; Call::CallConfiguration config; @@ -2770,53 +3041,64 @@ void ManagerImpl::check_call_configuration (const CallID& id, const std::string /* For an IP-to-IP call, we don't need any account */ /* Pattern looked for : ip:xxx.xxx.xxx.xxx */ pattern = to.substr (0,4); + if (pattern==IP_TO_IP_PATTERN) { - _debug("Sending Sip Call \n"); + _debug ("Sending Sip Call \n"); config = Call::IPtoIP; } else { config = Call::Classic; } + associateConfigToCall (id, config); + *callConfig = config; } -bool ManagerImpl::associateConfigToCall (const CallID& callID, Call::CallConfiguration config) { +bool ManagerImpl::associateConfigToCall (const CallID& callID, Call::CallConfiguration config) +{ - if (getConfigFromCall(callID) == CallConfigNULL) { // nothing with the same ID + if (getConfigFromCall (callID) == CallConfigNULL) { // nothing with the same ID _callConfigMap[callID] = config; - _debug("Associate Call %s with config %i\n", callID.data(), config); + _debug ("Associate Call %s with config %i\n", callID.data(), config); return true; } else { return false; } } -Call::CallConfiguration ManagerImpl::getConfigFromCall(const CallID& callID) { +Call::CallConfiguration ManagerImpl::getConfigFromCall (const CallID& callID) +{ + + CallConfigMap::iterator iter = _callConfigMap.find (callID); - CallConfigMap::iterator iter = _callConfigMap.find(callID); - if ( iter == _callConfigMap.end()) { - return (Call::CallConfiguration)CallConfigNULL; + if (iter == _callConfigMap.end()) { + return (Call::CallConfiguration) CallConfigNULL; } else { return iter->second; } } -bool ManagerImpl::removeCallConfig(const CallID& callID) { +bool ManagerImpl::removeCallConfig (const CallID& callID) +{ - if ( _callConfigMap.erase(callID) ) { + if (_callConfigMap.erase (callID)) { return true; } + return false; } -std::map< std::string, std::string > ManagerImpl::getCallDetails(const CallID& callID) { +std::map< std::string, std::string > ManagerImpl::getCallDetails (const CallID& callID) +{ std::map<std::string, std::string> call_details; AccountID accountid; Account *account; VoIPLink *link; - Call *call; + Call *call = NULL; + std::stringstream type; + // We need here to retrieve the call information attached to the call ID // To achieve that, we need to get the voip link attached to the call @@ -2824,30 +3106,61 @@ std::map< std::string, std::string > ManagerImpl::getCallDetails(const CallID& c // So first we fetch the account accountid = getAccountFromCall (callID); - _debug("%s\n",callID.c_str()); + _debug ("%s\n",callID.c_str()); // Then the VoIP link this account is linked with (IAX2 or SIP) + if ( (account=getAccount (accountid)) != 0) { link = account->getVoIPLink (); if (link) { call = link->getCall (callID); } - } - if (call) - { + if (call) { + type << call->getCallType (); call_details.insert (std::pair<std::string, std::string> ("ACCOUNTID", accountid)); call_details.insert (std::pair<std::string, std::string> ("PEER_NUMBER", call->getPeerNumber ())); call_details.insert (std::pair<std::string, std::string> ("PEER_NAME", call->getPeerName ())); - } - else - { + call_details.insert (std::pair<std::string, std::string> ("CALL_STATE", call->getStateStr ())); + call_details.insert (std::pair<std::string, std::string> ("CALL_TYPE", type.str ())); + } else { _debug ("Error: Managerimpl - getCallDetails ()\n"); call_details.insert (std::pair<std::string, std::string> ("ACCOUNTID", AccountNULL)); call_details.insert (std::pair<std::string, std::string> ("PEER_NUMBER", "Unknown")); call_details.insert (std::pair<std::string, std::string> ("PEER_NAME", "Unknown")); + call_details.insert (std::pair<std::string, std::string> ("CALL_STATE", "UNKNOWN")); + call_details.insert (std::pair<std::string, std::string> ("CALL_TYPE", "0")); } return call_details; } + + +std::map<std::string, std::string> ManagerImpl::send_history_to_client (void) +{ + return _history->get_history_serialized (); +} + +void ManagerImpl::receive_history_from_client (std::map<std::string, std::string> history) +{ + _history->set_serialized_history (history, Manager::instance().getConfigInt (PREFERENCES, CONFIG_HISTORY_LIMIT)); + _history->save_history (); +} + + +std::vector< std::string > +ManagerImpl::getCallList (void) +{ + std::vector< std::string > v; + int i; + + CallAccountMap::iterator iter = _callAccountMap.begin (); + + while (iter != _callAccountMap.end ()) { + v.push_back (iter->first.data()); + iter++; + } + + return v; +} diff --git a/sflphone-common/src/managerimpl.h b/sflphone-common/src/managerimpl.h index 10caf62b48c5e85df232aa12820e1398424bb9ae..740d0545c46a6e20a8783520b6f2cc0d75d14c81 100644 --- a/sflphone-common/src/managerimpl.h +++ b/sflphone-common/src/managerimpl.h @@ -37,6 +37,7 @@ #include "account.h" #include "call.h" #include "numbercleaner.h" +#include <history/historymanager.h> #include "audio/tonelist.h" // for Tone::TONEID declaration #include "audio/audiofile.h" @@ -157,6 +158,16 @@ class ManagerImpl { */ bool transferCall(const CallID& id, const std::string& to); + /** + * Notify the client the transfer is successful + */ + void transferSucceded(); + + /** + * Notify the client that the transfer failed + */ + void transferFailed(); + /** * Functions which occur with a user's action * Refuse the call @@ -301,6 +312,12 @@ class ManagerImpl { */ std::map< std::string, std::string > getCallDetails(const CallID& callID); + /** + * Get call list + * @return std::vector<std::string> A list of call IDs + */ + std::vector< std::string > getCallList (void); + /** * Save the details of an existing account, given the account ID * This will load the configuration map with the given data. @@ -504,16 +521,21 @@ class ManagerImpl { bool isRecording(const CallID& id); /** - * Set the maximum number of calls to keep in the history - * @param calls The number of calls + * Set the maximum number of days to keep in the history + * @param calls The number of days */ - void setMaxCalls( const int& calls ); + void setHistoryLimit (const int& days); /** - * Get the maximum number of calls to keep in the history - * @return double The number of calls + * Get the maximum number of days to keep in the history + * @return double The number of days */ - int getMaxCalls( void ); + int getHistoryLimit (void); + + void setHistoryEnabled (void); + + int getHistoryEnabled (void); + /** * Configure the start-up option @@ -837,7 +859,7 @@ class ManagerImpl { * Fills the local _config (Conf::ConfigTree) with the default contents. * Called in main.cpp, just before Manager::init(). */ - void initConfigFile ( bool load_user_value = true ); + void initConfigFile ( bool load_user_value=true, std::string alternate=""); /** * Tell if the setup was already loaded @@ -1082,7 +1104,8 @@ class ManagerImpl { */ void unloadAccountMap(); - /** + public: + /** * Tell if an account exists * @param accountID account ID check * @return bool True if the account exists @@ -1090,8 +1113,9 @@ class ManagerImpl { */ bool accountExists(const AccountID& accountID); + std::map<std::string, std::string> send_history_to_client (void); -public: + void receive_history_from_client (std::map<std::string, std::string> history); /** * Get an account pointer * @param accountID account ID to get @@ -1136,6 +1160,11 @@ private: NumberCleaner *_cleaner; + /** + * To handle the persistent history + */ + HistoryManager *_history; + /** * Check if the call is a classic call or a direct IP-to-IP call */ @@ -1147,6 +1176,7 @@ private: #endif friend class ConfigurationTest; + friend class HistoryTest; }; #endif // __MANAGER_H__ diff --git a/sflphone-common/src/numbercleaner.cpp b/sflphone-common/src/numbercleaner.cpp index afc07724f4ffafff6e7cd3e6f5ba26f94da9f1b5..b583ca594503a1d16985f713e0500a5e3b44d4ae 100644 --- a/sflphone-common/src/numbercleaner.cpp +++ b/sflphone-common/src/numbercleaner.cpp @@ -22,13 +22,16 @@ #include <iostream> -NumberCleaner::NumberCleaner (void) : _prefix("") { +NumberCleaner::NumberCleaner (void) : _prefix ("") +{ } -NumberCleaner::~NumberCleaner (void) { +NumberCleaner::~NumberCleaner (void) +{ } -std::string NumberCleaner::clean (std::string to_clean) { +std::string NumberCleaner::clean (std::string to_clean) +{ strip_char (" ", &to_clean); strip_char ("-", &to_clean); @@ -38,11 +41,12 @@ std::string NumberCleaner::clean (std::string to_clean) { return to_clean.insert (0, this->get_phone_number_prefix ()); } -void NumberCleaner::strip_char (std::string to_strip, std::string *num) { +void NumberCleaner::strip_char (std::string to_strip, std::string *num) +{ std::size_t pos; - - while ( (pos=(*num).find (to_strip)) != std::string::npos) { + + while ( (pos= (*num).find (to_strip)) != std::string::npos) { *num = (*num).erase (pos, 1); } } diff --git a/sflphone-common/src/observer.cpp b/sflphone-common/src/observer.cpp index f7820b5d318e311a0d19e55f8f6780638ca39149..40ac49de63fae065eec174923baf9437a2c270f9 100644 --- a/sflphone-common/src/observer.cpp +++ b/sflphone-common/src/observer.cpp @@ -19,35 +19,40 @@ #include "observer.h" #include <algorithm> -namespace Pattern { -void -Subject::attach(Observer& observer) +namespace Pattern { - if (std::find(_observers.begin(), _observers.end(), &observer) == _observers.end()) { - _observers.push_back(&observer); - } + +void +Subject::attach (Observer& observer) +{ + if (std::find (_observers.begin(), _observers.end(), &observer) == _observers.end()) { + _observers.push_back (&observer); + } } -void -Subject::detach(Observer& observer) +void +Subject::detach (Observer& observer) { - std::list<Observer*>::iterator iter = std::find(_observers.begin(), _observers.end(), &observer); - if ( iter != _observers.end()) { - _observers.erase(iter); - } + std::list<Observer*>::iterator iter = std::find (_observers.begin(), _observers.end(), &observer); + + if (iter != _observers.end()) { + _observers.erase (iter); + } } -void +void Subject::notify() { - std::list<Observer*>::iterator iter = _observers.begin(); - while( iter != _observers.end()) { - if (*iter) { - (*iter)->update(); + std::list<Observer*>::iterator iter = _observers.begin(); + + while (iter != _observers.end()) { + if (*iter) { + (*iter)->update(); + } + + iter++; } - iter++; - } } } // end of namespace diff --git a/sflphone-common/src/plug-in/audiorecorder/audiodsp.cpp b/sflphone-common/src/plug-in/audiorecorder/audiodsp.cpp index 8179df12a82dd3ee81b38786093fe92d9470dbd1..49ea4417cce81a6ee9e15193960b88b6804bba7f 100644 --- a/sflphone-common/src/plug-in/audiorecorder/audiodsp.cpp +++ b/sflphone-common/src/plug-in/audiorecorder/audiodsp.cpp @@ -22,47 +22,48 @@ AudioDSP::AudioDSP() { - bufPointer_ = 0; - bufferLength_ = 1024; - circBuffer_ = new float[bufferLength_]; + bufPointer_ = 0; + bufferLength_ = 1024; + circBuffer_ = new float[bufferLength_]; } AudioDSP::~AudioDSP() { - - delete[] circBuffer_; + + delete[] circBuffer_; } -float AudioDSP::getRMS(int data) +float AudioDSP::getRMS (int data) { - // printf("AudioDSP::getRMS() : bufPointer_ %i \n ", bufPointer_); - printf("AudioDSP::getRMS() : %i \n", data); - circBuffer_[bufPointer_++] = (float)data; - - if(bufPointer_ >= bufferLength_) - bufPointer_ = 0; + // printf("AudioDSP::getRMS() : bufPointer_ %i \n ", bufPointer_); + printf ("AudioDSP::getRMS() : %i \n", data); + circBuffer_[bufPointer_++] = (float) data; + + if (bufPointer_ >= bufferLength_) + bufPointer_ = 0; - return computeRMS(); -} + return computeRMS(); +} float AudioDSP::computeRMS() { - rms = 0.0; + rms = 0.0; + + + for (int i = 0; i < bufferLength_; i++) { + // printf("AudioDSP::computeRMS() : i_ %i \n ", i); + rms += (float) (circBuffer_[i]*circBuffer_[i]); + } + + rms = sqrt (rms / (float) bufferLength_); - - for(int i = 0; i < bufferLength_; i++){ - // printf("AudioDSP::computeRMS() : i_ %i \n ", i); - rms += (float)(circBuffer_[i]*circBuffer_[i]); - } - rms = sqrt(rms / (float)bufferLength_); + // printf("AudioDSP::computeRMS() : RMS VALUE: %f \n", rms); + return rms; - // printf("AudioDSP::computeRMS() : RMS VALUE: %f \n", rms); - return rms; - } diff --git a/sflphone-common/src/plug-in/audiorecorder/audiorecord.cpp b/sflphone-common/src/plug-in/audiorecorder/audiorecord.cpp index 25703101d97e04e9bae349fd92cb7009cc5181dc..44a33bb2808435a151aa7902390557a520c26b43 100644 --- a/sflphone-common/src/plug-in/audiorecorder/audiorecord.cpp +++ b/sflphone-common/src/plug-in/audiorecorder/audiorecord.cpp @@ -20,448 +20,499 @@ #include "audiorecord.h" // structure for the wave header + struct wavhdr { - char riff[4]; // "RIFF" - SINT32 file_size; // in bytes - char wave[4]; // "WAVE" - char fmt[4]; // "fmt " - SINT32 chunk_size; // in bytes (16 for PCM) - SINT16 format_tag; // 1=PCM, 2=ADPCM, 3=IEEE float, 6=A-Law, 7=Mu-Law - SINT16 num_chans; // 1=mono, 2=stereo - SINT32 sample_rate; - SINT32 bytes_per_sec; - SINT16 bytes_per_samp; // 2=16-bit mono, 4=16-bit stereo - SINT16 bits_per_samp; - char data[4]; // "data" - SINT32 data_length; // in bytes + char riff[4]; // "RIFF" + SINT32 file_size; // in bytes + char wave[4]; // "WAVE" + char fmt[4]; // "fmt " + SINT32 chunk_size; // in bytes (16 for PCM) + SINT16 format_tag; // 1=PCM, 2=ADPCM, 3=IEEE float, 6=A-Law, 7=Mu-Law + SINT16 num_chans; // 1=mono, 2=stereo + SINT32 sample_rate; + SINT32 bytes_per_sec; + SINT16 bytes_per_samp; // 2=16-bit mono, 4=16-bit stereo + SINT16 bits_per_samp; + char data[4]; // "data" + SINT32 data_length; // in bytes }; -AudioRecord::AudioRecord(){ - - sndSmplRate_ = 44100; - channels_ = 1; - byteCounter_ = 0; - recordingEnabled_ = false; - fp = 0; - nbSamplesMax_ = 3000; +AudioRecord::AudioRecord() +{ - createFilename(); + sndSmplRate_ = 44100; + channels_ = 1; + byteCounter_ = 0; + recordingEnabled_ = false; + fp = 0; + nbSamplesMax_ = 3000; - mixBuffer_ = new SFLDataFormat[nbSamplesMax_]; - micBuffer_ = new SFLDataFormat[nbSamplesMax_]; - spkBuffer_ = new SFLDataFormat[nbSamplesMax_]; + createFilename(); + + mixBuffer_ = new SFLDataFormat[nbSamplesMax_]; + micBuffer_ = new SFLDataFormat[nbSamplesMax_]; + spkBuffer_ = new SFLDataFormat[nbSamplesMax_]; } -AudioRecord::~AudioRecord() { +AudioRecord::~AudioRecord() +{ delete [] mixBuffer_; delete [] micBuffer_; delete [] spkBuffer_; } -void AudioRecord::setSndSamplingRate(int smplRate){ - sndSmplRate_ = smplRate; +void AudioRecord::setSndSamplingRate (int smplRate) +{ + sndSmplRate_ = smplRate; } -void AudioRecord::setRecordingOption(FILE_TYPE type, SOUND_FORMAT format, int sndSmplRate, std::string path, std::string id){ - - - fileType_ = type; - sndFormat_ = format; - channels_ = 1; - sndSmplRate_ = sndSmplRate; - call_id_ = id; - - savePath_ = path + "/"; - -} +void AudioRecord::setRecordingOption (FILE_TYPE type, SOUND_FORMAT format, int sndSmplRate, std::string path, std::string id) +{ + fileType_ = type; + sndFormat_ = format; + channels_ = 1; + sndSmplRate_ = sndSmplRate; + call_id_ = id; + + savePath_ = path + "/"; -void AudioRecord::initFileName( std::string peerNumber){ - - std::string fName; - - fName = fileName_; - fName.append("-"+peerNumber); - - if (fileType_ == FILE_RAW){ - if ( strstr(fileName_, ".raw") == NULL){ - printf("AudioRecord::openFile::concatenate .raw file extension: name : %s \n", fileName_); - fName.append(".raw"); - } - } - else if (fileType_ == FILE_WAV){ - if ( strstr(fileName_, ".wav") == NULL){ - printf("AudioRecord::openFile::concatenate .wav file extension: name : %s \n", fileName_); - fName.append(".wav"); - } - } - - savePath_.append(fName); } -void AudioRecord::openFile(){ - - - _debug("AudioRecord::openFile()\n"); - - bool result = false; - - _debug("AudioRecord::openFile()\n"); - if(isFileExist()) { - _debug("AudioRecord::Filename does not exist, creating one \n"); - byteCounter_ = 0; - - if(fileType_ == FILE_RAW){ - result = setRawFile(); - } - else if (fileType_ == FILE_WAV){ - result = setWavFile(); - } - } - else { - _debug("AudioRecord::Filename already exist opening it \n"); - if(fileType_ == FILE_RAW){ - result = openExistingRawFile(); - } - else if (fileType_ == FILE_WAV){ - result = openExistingWavFile(); - } - } + + +void AudioRecord::initFileName (std::string peerNumber) +{ + + std::string fName; + + fName = fileName_; + fName.append ("-"+peerNumber); + + if (fileType_ == FILE_RAW) { + if (strstr (fileName_, ".raw") == NULL) { + printf ("AudioRecord::openFile::concatenate .raw file extension: name : %s \n", fileName_); + fName.append (".raw"); + } + } else if (fileType_ == FILE_WAV) { + if (strstr (fileName_, ".wav") == NULL) { + printf ("AudioRecord::openFile::concatenate .wav file extension: name : %s \n", fileName_); + fName.append (".wav"); + } + } + + savePath_.append (fName); } +void AudioRecord::openFile() +{ + + + _debug ("AudioRecord::openFile()\n"); -void AudioRecord::closeFile() { + bool result = false; - if (fp == 0) return; + _debug ("AudioRecord::openFile()\n"); - if (fileType_ == FILE_RAW) - fclose(fp); - else if (fileType_ == FILE_WAV) - this->closeWavFile(); + if (isFileExist()) { + _debug ("AudioRecord::Filename does not exist, creating one \n"); + byteCounter_ = 0; - + if (fileType_ == FILE_RAW) { + result = setRawFile(); + } else if (fileType_ == FILE_WAV) { + result = setWavFile(); + } + } else { + _debug ("AudioRecord::Filename already exist opening it \n"); + if (fileType_ == FILE_RAW) { + result = openExistingRawFile(); + } else if (fileType_ == FILE_WAV) { + result = openExistingWavFile(); + } + } } -bool AudioRecord::isOpenFile() { - - if(fp){ - _debug("AudioRecord::isOpenFile(): file already openend\n"); - return true; - } - else { - _debug("AudioRecord::isOpenFIle(): file not openend \n"); - return false; - } +void AudioRecord::closeFile() +{ + + if (fp == 0) return; + + if (fileType_ == FILE_RAW) + fclose (fp); + else if (fileType_ == FILE_WAV) + this->closeWavFile(); + + + } -bool AudioRecord::isFileExist() { - _debug("AudioRecord::isFileExist(): try to open name : %s \n", fileName_); - - if(fopen(fileName_,"rb")==0) { - return true; - } - - return false; +bool AudioRecord::isOpenFile() +{ + + if (fp) { + _debug ("AudioRecord::isOpenFile(): file already openend\n"); + return true; + } else { + _debug ("AudioRecord::isOpenFIle(): file not openend \n"); + return false; + } } -bool AudioRecord::isRecording() { - _debug("AudioRecording::isRecording() %i \n", recordingEnabled_); - - - if(recordingEnabled_) - return true; - else + +bool AudioRecord::isFileExist() +{ + _debug ("AudioRecord::isFileExist(): try to open name : %s \n", fileName_); + + if (fopen (fileName_,"rb") ==0) { + return true; + } + return false; } +bool AudioRecord::isRecording() +{ + _debug ("AudioRecording::isRecording() %i \n", recordingEnabled_); + -bool AudioRecord::setRecording() { - _debug("AudioRecord::setRecording() \n"); - - if (isOpenFile()){ - _debug("AuioRecord::setRecording()::file already opened \n"); - if(!recordingEnabled_) - recordingEnabled_ = true; - else - recordingEnabled_ = false; - } - else { - _debug("AudioRecord::setRecording():Opening the wave file in call during call instantiation \n"); - openFile(); - - recordingEnabled_ = true; // once opend file, start recording - } - + if (recordingEnabled_) + return true; + else + return false; } -void AudioRecord::stopRecording() { - _debug("AudioRecording::stopRecording() \n"); - if(recordingEnabled_) - recordingEnabled_ = false; +bool AudioRecord::setRecording() +{ + _debug ("AudioRecord::setRecording() \n"); + + if (isOpenFile()) { + _debug ("AuioRecord::setRecording()::file already opened \n"); + + if (!recordingEnabled_) + recordingEnabled_ = true; + else + recordingEnabled_ = false; + } else { + _debug ("AudioRecord::setRecording():Opening the wave file in call during call instantiation \n"); + openFile(); + + recordingEnabled_ = true; // once opend file, start recording + } + +} + +void AudioRecord::stopRecording() +{ + _debug ("AudioRecording::stopRecording() \n"); + + if (recordingEnabled_) + recordingEnabled_ = false; } -void AudioRecord::createFilename(){ - +void AudioRecord::createFilename() +{ + time_t rawtime; + struct tm * timeinfo; - rawtime = time(NULL); - timeinfo = localtime ( &rawtime ); + rawtime = time (NULL); + timeinfo = localtime (&rawtime); stringstream out; - + // DATE out << timeinfo->tm_year+1900; + if (timeinfo->tm_mon < 9) // january is 01, not 1 - out << 0; + out << 0; + out << timeinfo->tm_mon+1; + if (timeinfo->tm_mday < 10) // 01 02 03, not 1 2 3 - out << 0; + out << 0; + out << timeinfo->tm_mday; - + out << '-'; - + // hour if (timeinfo->tm_hour < 10) // 01 02 03, not 1 2 3 - out << 0; + out << 0; + out << timeinfo->tm_hour; + out << ':'; + if (timeinfo->tm_min < 10) // 01 02 03, not 1 2 3 - out << 0; + out << 0; + out << timeinfo->tm_min; + out << ':'; + if (timeinfo->tm_sec < 10) // 01 02 03, not 1 2 3 - out << 0; + out << 0; + out << timeinfo->tm_sec; // fileName_ = out.str(); - strncpy(fileName_, out.str().c_str(), 8192); + strncpy (fileName_, out.str().c_str(), 8192); - printf("AudioRecord::createFilename::filename for this call %s \n",fileName_); + printf ("AudioRecord::createFilename::filename for this call %s \n",fileName_); } -bool AudioRecord::setRawFile() { +bool AudioRecord::setRawFile() +{ - fp = fopen(savePath_.c_str(), "wb"); - if ( !fp ) { - _debug("AudioRecord::setRawFile() : could not create RAW file!\n"); - return false; - } + fp = fopen (savePath_.c_str(), "wb"); - if ( sndFormat_ != INT16 ) { // TODO need to change INT16 to SINT16 - sndFormat_ = INT16; - _debug("AudioRecord::setRawFile() : using 16-bit signed integer data format for file.\n"); - } + if (!fp) { + _debug ("AudioRecord::setRawFile() : could not create RAW file!\n"); + return false; + } + + if (sndFormat_ != INT16) { // TODO need to change INT16 to SINT16 + sndFormat_ = INT16; + _debug ("AudioRecord::setRawFile() : using 16-bit signed integer data format for file.\n"); + } - _debug("AudioRecord:setRawFile() : created RAW file.\n"); - return true; + _debug ("AudioRecord:setRawFile() : created RAW file.\n"); + + return true; } -bool AudioRecord::setWavFile() { - - fp = fopen(savePath_.c_str(), "wb"); - if ( !fp ) { - _debug("AudioRecord::setWavFile() : could not create WAV file.\n"); - return false; - } - - struct wavhdr hdr = {"RIF", 44, "WAV", "fmt", 16, 1, 1, - 44100, 0, 2, 16, "dat", 0}; - hdr.riff[3] = 'F'; - hdr.wave[3] = 'E'; - hdr.fmt[3] = ' '; - hdr.data[3] = 'a'; - hdr.num_chans = channels_; - if ( sndFormat_ == INT16 ) { // TODO need to write INT16 to SINT16 - hdr.bits_per_samp = 16; - } - hdr.bytes_per_samp = (SINT16) (channels_ * hdr.bits_per_samp / 8); - hdr.bytes_per_sec = (SINT32) (hdr.sample_rate * hdr.bytes_per_samp); - - - if ( fwrite(&hdr, 4, 11, fp) != 11) { - _debug("AudioRecord::setWavFile() : could not write WAV header for file. \n"); - return false; - } +bool AudioRecord::setWavFile() +{ + + fp = fopen (savePath_.c_str(), "wb"); + + if (!fp) { + _debug ("AudioRecord::setWavFile() : could not create WAV file.\n"); + return false; + } + + struct wavhdr hdr = {"RIF", 44, "WAV", "fmt", 16, 1, 1, + 44100, 0, 2, 16, "dat", 0 + }; + + hdr.riff[3] = 'F'; + + hdr.wave[3] = 'E'; + + hdr.fmt[3] = ' '; + + hdr.data[3] = 'a'; + + hdr.num_chans = channels_; + + if (sndFormat_ == INT16) { // TODO need to write INT16 to SINT16 + hdr.bits_per_samp = 16; + } + + hdr.bytes_per_samp = (SINT16) (channels_ * hdr.bits_per_samp / 8); + + hdr.bytes_per_sec = (SINT32) (hdr.sample_rate * hdr.bytes_per_samp); + + + if (fwrite (&hdr, 4, 11, fp) != 11) { + _debug ("AudioRecord::setWavFile() : could not write WAV header for file. \n"); + return false; + } + + _debug ("AudioRecord::setWavFile() : created WAV file. \n"); - _debug("AudioRecord::setWavFile() : created WAV file. \n"); - return true; + return true; } bool AudioRecord::openExistingRawFile() -{ - fp = fopen(fileName_, "ab+"); - if ( !fp ) { - _debug("AudioRecord::openExistingRawFile() : could not create RAW file!\n"); - return false; - } +{ + fp = fopen (fileName_, "ab+"); + + if (!fp) { + _debug ("AudioRecord::openExistingRawFile() : could not create RAW file!\n"); + return false; + } } bool AudioRecord::openExistingWavFile() -{ - _debug("AudioRecord::openExistingWavFile() \n"); +{ + _debug ("AudioRecord::openExistingWavFile() \n"); - fp = fopen(fileName_, "rb+"); - if ( !fp ) { - _debug("AudioRecord::openExistingWavFile() : could not open WAV file rb+!\n"); - return false; - } + fp = fopen (fileName_, "rb+"); - printf("AudioRecord::openExistingWavFile()::Tried to open %s \n",fileName_); - - if(fseek(fp, 40, SEEK_SET) != 0) // jump to data length - _debug("AudioRecord::OpenExistingWavFile: 1.Couldn't seek offset 40 in the file \n"); - - if(fread(&byteCounter_, 4, 1, fp)) - _debug("AudioRecord::OpenExistingWavFile : bytecounter Read successfully \n"); - - if(fseek (fp, 0 , SEEK_END) != 0) - _debug("AudioRecors::OpenExistingWavFile : 2.Couldn't seek at the en of the file \n"); + if (!fp) { + _debug ("AudioRecord::openExistingWavFile() : could not open WAV file rb+!\n"); + return false; + } - printf("AudioRecord::OpenExistingWavFile : Byte counter after oppening : %d \n",(int)byteCounter_); + printf ("AudioRecord::openExistingWavFile()::Tried to open %s \n",fileName_); - if ( fclose( fp ) != 0) - _debug("AudioRecord::openExistingWavFile()::ERROR: can't close file r+ \n"); + if (fseek (fp, 40, SEEK_SET) != 0) // jump to data length + _debug ("AudioRecord::OpenExistingWavFile: 1.Couldn't seek offset 40 in the file \n"); + if (fread (&byteCounter_, 4, 1, fp)) + _debug ("AudioRecord::OpenExistingWavFile : bytecounter Read successfully \n"); - - fp = fopen(fileName_, "ab+"); - if ( !fp ) { - _debug("AudioRecord::openExistingWavFile() : could not createopen WAV file ab+!\n"); - return false; - } + if (fseek (fp, 0 , SEEK_END) != 0) + _debug ("AudioRecors::OpenExistingWavFile : 2.Couldn't seek at the en of the file \n"); + + printf ("AudioRecord::OpenExistingWavFile : Byte counter after oppening : %d \n", (int) byteCounter_); + + if (fclose (fp) != 0) + _debug ("AudioRecord::openExistingWavFile()::ERROR: can't close file r+ \n"); + + + + fp = fopen (fileName_, "ab+"); + + if (!fp) { + _debug ("AudioRecord::openExistingWavFile() : could not createopen WAV file ab+!\n"); + return false; + } + + if (fseek (fp, 4 , SEEK_END) != 0) + _debug ("AudioRecors::OpenExistingWavFile : 2.Couldn't seek at the en of the file \n"); - if(fseek (fp, 4 , SEEK_END) != 0) - _debug("AudioRecors::OpenExistingWavFile : 2.Couldn't seek at the en of the file \n"); - } -void AudioRecord::closeWavFile() +void AudioRecord::closeWavFile() { - if (fp == 0){ - _debug("AudioRecord:: Can't closeWavFile, a file has not yet been opened!\n"); - return; - } - - - SINT32 bytes = byteCounter_ * channels_; - - fseek(fp, 40, SEEK_SET); // jump to data length - if (ferror(fp))perror("AudioRecord::closeWavFile()::ERROR: can't reach offset 40\n"); - - fwrite(&bytes, sizeof(SINT32), 1, fp); - if (ferror(fp))perror("AudioRecord::closeWavFile()::ERROR: can't write bytes for data length \n"); - printf("AudioRecord::closeWavFile : data bytes: %i \n",(int)bytes); - - bytes = byteCounter_ * channels_ + 44; // + 44 for the wave header - fseek(fp, 4, SEEK_SET); // jump to file size - if (ferror(fp))perror("AudioRecord::closeWavFile()::ERROR: can't reach offset 4\n"); - - fwrite(&bytes, 4, 1, fp); - if (ferror(fp))perror("AudioRecord::closeWavFile()::ERROR: can't reach offset 4\n"); - - printf("AudioRecord::closeWavFile : bytes : %i \n",(int)bytes); - - if ( fclose( fp ) != 0) - _debug("AudioRecord::closeWavFile()::ERROR: can't close file\n"); - + if (fp == 0) { + _debug ("AudioRecord:: Can't closeWavFile, a file has not yet been opened!\n"); + return; + } -} -void AudioRecord::recSpkrData(SFLDataFormat* buffer, int nSamples) { + SINT32 bytes = byteCounter_ * channels_; - if (recordingEnabled_) { - - nbSamplesMic_ = nSamples; + fseek (fp, 40, SEEK_SET); // jump to data length - for(int i = 0; i < nbSamplesMic_; i++) - micBuffer_[i] = buffer[i]; - } + if (ferror (fp)) perror ("AudioRecord::closeWavFile()::ERROR: can't reach offset 40\n"); - return; -} + fwrite (&bytes, sizeof (SINT32), 1, fp); + + if (ferror (fp)) perror ("AudioRecord::closeWavFile()::ERROR: can't write bytes for data length \n"); + + printf ("AudioRecord::closeWavFile : data bytes: %i \n", (int) bytes); + + bytes = byteCounter_ * channels_ + 44; // + 44 for the wave header + + fseek (fp, 4, SEEK_SET); // jump to file size + if (ferror (fp)) perror ("AudioRecord::closeWavFile()::ERROR: can't reach offset 4\n"); -void AudioRecord::recMicData(SFLDataFormat* buffer, int nSamples) { + fwrite (&bytes, 4, 1, fp); - if (recordingEnabled_) { + if (ferror (fp)) perror ("AudioRecord::closeWavFile()::ERROR: can't reach offset 4\n"); - nbSamplesSpk_ = nSamples; + printf ("AudioRecord::closeWavFile : bytes : %i \n", (int) bytes); - for(int i = 0; i < nbSamplesSpk_; i++) - spkBuffer_[i] = buffer[i]; + if (fclose (fp) != 0) + _debug ("AudioRecord::closeWavFile()::ERROR: can't close file\n"); - } - return; } +void AudioRecord::recSpkrData (SFLDataFormat* buffer, int nSamples) +{ -void AudioRecord::recData(SFLDataFormat* buffer, int nSamples) { + if (recordingEnabled_) { - if (recordingEnabled_) { + nbSamplesMic_ = nSamples; - if (fp == 0){ - _debug("AudioRecord: Can't record data, a file has not yet been opened!\n"); - return; + for (int i = 0; i < nbSamplesMic_; i++) + micBuffer_[i] = buffer[i]; } - - - - if ( sndFormat_ == INT16 ) { // TODO change INT16 to SINT16 - if ( fwrite(buffer, sizeof(SFLDataFormat), nSamples, fp) != nSamples) - _debug("AudioRecord: Could not record data! \n"); - else { - fflush(fp); - byteCounter_ += (unsigned long)(nSamples*sizeof(SFLDataFormat)); - } - } - } - - return; + + return; } -void AudioRecord::recData(SFLDataFormat* buffer_1, SFLDataFormat* buffer_2, int nSamples_1, int nSamples_2) { +void AudioRecord::recMicData (SFLDataFormat* buffer, int nSamples) +{ + + if (recordingEnabled_) { + + nbSamplesSpk_ = nSamples; - if (recordingEnabled_) { + for (int i = 0; i < nbSamplesSpk_; i++) + spkBuffer_[i] = buffer[i]; - if (fp == 0){ - _debug("AudioRecord: Can't record data, a file has not yet been opened!\n"); - return; } + return; +} + + +void AudioRecord::recData (SFLDataFormat* buffer, int nSamples) +{ + + if (recordingEnabled_) { - if ( sndFormat_ == INT16 ) { // TODO change INT16 to SINT16 - for (int k=0; k<nSamples_1; k++){ - - mixBuffer_[k] = (buffer_1[k]+buffer_2[k]); - - - if ( fwrite(&mixBuffer_[k], 2, 1, fp) != 1) - _debug("AudioRecord: Could not record data!\n"); - else { - fflush(fp); + if (fp == 0) { + _debug ("AudioRecord: Can't record data, a file has not yet been opened!\n"); + return; + } + + + + if (sndFormat_ == INT16) { // TODO change INT16 to SINT16 + if (fwrite (buffer, sizeof (SFLDataFormat), nSamples, fp) != nSamples) + _debug ("AudioRecord: Could not record data! \n"); + else { + fflush (fp); + byteCounter_ += (unsigned long) (nSamples*sizeof (SFLDataFormat)); + } } - } } - - byteCounter_ += (unsigned long)(nSamples_1*sizeof(SFLDataFormat)); - } + return; +} + + +void AudioRecord::recData (SFLDataFormat* buffer_1, SFLDataFormat* buffer_2, int nSamples_1, int nSamples_2) +{ + + if (recordingEnabled_) { + + if (fp == 0) { + _debug ("AudioRecord: Can't record data, a file has not yet been opened!\n"); + return; + } + - return; + if (sndFormat_ == INT16) { // TODO change INT16 to SINT16 + for (int k=0; k<nSamples_1; k++) { + + mixBuffer_[k] = (buffer_1[k]+buffer_2[k]); + + + if (fwrite (&mixBuffer_[k], 2, 1, fp) != 1) + _debug ("AudioRecord: Could not record data!\n"); + else { + fflush (fp); + } + } + } + + byteCounter_ += (unsigned long) (nSamples_1*sizeof (SFLDataFormat)); + + } + + return; } diff --git a/sflphone-common/src/plug-in/librarymanager.cpp b/sflphone-common/src/plug-in/librarymanager.cpp index 138b59f5f49b2c2ed19b170deb36dfb373b00846..0c8c1040bde8ac0497d3e7985355629662981faf 100644 --- a/sflphone-common/src/plug-in/librarymanager.cpp +++ b/sflphone-common/src/plug-in/librarymanager.cpp @@ -19,9 +19,9 @@ #include "librarymanager.h" - - LibraryManager::LibraryManager (const std::string &filename) - : _filename(filename), _handlePtr(NULL) + +LibraryManager::LibraryManager (const std::string &filename) + : _filename (filename), _handlePtr (NULL) { _handlePtr = loadLibrary (filename); } @@ -36,16 +36,19 @@ LibraryManager::LibraryHandle LibraryManager::loadLibrary (const std::string &fi LibraryHandle pluginHandlePtr = NULL; const char *error; - _debug("Loading dynamic library %s\n", filename.c_str()); + _debug ("Loading dynamic library %s\n", filename.c_str()); /* Load the library */ - pluginHandlePtr = dlopen( filename.c_str(), RTLD_LAZY ); - if( !pluginHandlePtr ) { + pluginHandlePtr = dlopen (filename.c_str(), RTLD_LAZY); + + if (!pluginHandlePtr) { error = dlerror(); - _debug("Error while opening plug-in: %s\n", error); + _debug ("Error while opening plug-in: %s\n", error); return NULL; } + dlerror(); + return pluginHandlePtr; } @@ -54,13 +57,15 @@ int LibraryManager::unloadLibrary () if (_handlePtr == NULL) return 1; - _debug("Unloading dynamic library ...\n"); - dlclose( _handlePtr ); - if (dlerror()) - { - _debug("Error unloading the library : %s\n...", dlerror()); + _debug ("Unloading dynamic library ...\n"); + + dlclose (_handlePtr); + + if (dlerror()) { + _debug ("Error unloading the library : %s\n...", dlerror()); return 1; } + return 0; } @@ -68,19 +73,18 @@ int LibraryManager::resolveSymbol (const std::string &symbol, SymbolHandle *symb { SymbolHandle sy = 0; - if (_handlePtr){ + if (_handlePtr) { try { - sy = dlsym(_handlePtr, symbol.c_str()); - if(sy != NULL) { + sy = dlsym (_handlePtr, symbol.c_str()); + + if (sy != NULL) { *symbolPtr = sy; return 0; } - } - catch (...) {} - - throw LibraryManagerException ( _filename, symbol, LibraryManagerException::symbolNotFound); - } - else + } catch (...) {} + + throw LibraryManagerException (_filename, symbol, LibraryManagerException::symbolNotFound); + } else return 1; } @@ -88,8 +92,8 @@ int LibraryManager::resolveSymbol (const std::string &symbol, SymbolHandle *symb /************************************************************************************************/ LibraryManagerException::LibraryManagerException (const std::string &libraryName, const std::string &details, Reason reason) : - _reason (reason), _details (""), std::runtime_error ("") - + _reason (reason), _details (""), std::runtime_error ("") + { if (_reason == loadingFailed) _details = "Error when loading " + libraryName + "\n" + details; diff --git a/sflphone-common/src/plug-in/pluginmanager.cpp b/sflphone-common/src/plug-in/pluginmanager.cpp index 9ecf6d99497c5e27f1468a3f42475112390c7df2..80197f6ccef529d2b0d19ef4a415d251923c3858 100644 --- a/sflphone-common/src/plug-in/pluginmanager.cpp +++ b/sflphone-common/src/plug-in/pluginmanager.cpp @@ -24,17 +24,18 @@ PluginManager* PluginManager::_instance = 0; - PluginManager* +PluginManager* PluginManager::instance() { - if(!_instance){ + if (!_instance) { return new PluginManager(); } + return _instance; } PluginManager::PluginManager() -:_loadedPlugins() + :_loadedPlugins() { _instance = this; } @@ -44,7 +45,7 @@ PluginManager::~PluginManager() _instance = 0; } - int +int PluginManager::loadPlugins (const std::string &path) { std::string pluginDir, current; @@ -57,91 +58,92 @@ PluginManager::loadPlugins (const std::string &path) const std::string cDir = "."; /* The directory in which plugins are dropped. Default: /usr/lib/sflphone/plugins/ */ - ( path == "" )? pluginDir = std::string(PLUGINS_DIR).append("/"):pluginDir = path; - _debug("Loading plugins from %s...\n", pluginDir.c_str()); + (path == "") ? pluginDir = std::string (PLUGINS_DIR).append ("/") :pluginDir = path; + _debug ("Loading plugins from %s...\n", pluginDir.c_str()); - dir = opendir( pluginDir.c_str() ); + dir = opendir (pluginDir.c_str()); /* Test if the directory exists or is readable */ - if( dir ){ + + if (dir) { /* Read the directory */ - while( (dirStruct=readdir(dir)) ){ + while ( (dirStruct=readdir (dir))) { /* Get the name of the current item in the directory */ current = dirStruct->d_name; /* Test if the current item is not the parent or the current directory */ - if( current != pDir && current != cDir ){ + + if (current != pDir && current != cDir) { /* Load the dynamic library */ - library = loadDynamicLibrary( pluginDir + current ); + library = loadDynamicLibrary (pluginDir + current); /* Instanciate the plugin object */ - if(instanciatePlugin (library, &plugin) != 0) - { - _debug("Error instanciating the plugin ...\n"); + + if (instanciatePlugin (library, &plugin) != 0) { + _debug ("Error instanciating the plugin ...\n"); return 1; } /* Regitering the current plugin */ - if(registerPlugin (plugin, library) != 0) - { - _debug("Error registering the plugin ...\n"); + if (registerPlugin (plugin, library) != 0) { + _debug ("Error registering the plugin ...\n"); return 1; } } } - } - else + } else return 1; /* Close the directory */ - closedir( dir ); + closedir (dir); return 0; } -int +int PluginManager::unloadPlugins (void) { PluginInfo *info; - if(_loadedPlugins.empty()) return 0; + if (_loadedPlugins.empty()) return 0; /* Use an iterator on the loaded plugins map */ pluginMap::iterator iter; iter = _loadedPlugins.begin(); - while( iter != _loadedPlugins.end() ) { + + while (iter != _loadedPlugins.end()) { info = iter->second; - - if (deletePlugin (info) != 0) - { - _debug("Error deleting the plugin ... \n"); + + if (deletePlugin (info) != 0) { + _debug ("Error deleting the plugin ... \n"); return 1; } - + unloadDynamicLibrary (info->_libraryPtr); - - if (unregisterPlugin (info) != 0) - { - _debug("Error unregistering the plugin ... \n"); + + if (unregisterPlugin (info) != 0) { + _debug ("Error unregistering the plugin ... \n"); return 1; } iter++; } + return 0; } - bool +bool PluginManager::isPluginLoaded (const std::string &name) { - if(_loadedPlugins.empty()) return false; + if (_loadedPlugins.empty()) return false; /* Use an iterator on the loaded plugins map */ pluginMap::iterator iter; + iter = _loadedPlugins.find (name); /* Returns map::end if the specified key has not been found */ - if(iter==_loadedPlugins.end()) + if (iter==_loadedPlugins.end()) return false; /* Returns the plugin pointer */ @@ -149,22 +151,22 @@ PluginManager::isPluginLoaded (const std::string &name) } - LibraryManager* -PluginManager::loadDynamicLibrary (const std::string& filename) +LibraryManager* +PluginManager::loadDynamicLibrary (const std::string& filename) { /* Load the library through the library manager */ return new LibraryManager (filename); } - int -PluginManager::unloadDynamicLibrary (LibraryManager *libraryPtr) +int +PluginManager::unloadDynamicLibrary (LibraryManager *libraryPtr) { - _debug("Unloading dynamic library ...\n"); + _debug ("Unloading dynamic library ...\n"); /* Close it */ return libraryPtr->unloadLibrary (); } - int +int PluginManager::instanciatePlugin (LibraryManager *libraryPtr, Plugin **plugin) { createFunc *createPlugin; @@ -172,12 +174,15 @@ PluginManager::instanciatePlugin (LibraryManager *libraryPtr, Plugin **plugin) if (libraryPtr->resolveSymbol ("createPlugin", &symbol) != 0) return 1; - createPlugin = (createFunc*)symbol; + + createPlugin = (createFunc*) symbol; + *plugin = createPlugin(); + return 0; } - int +int PluginManager::deletePlugin (PluginInfo *plugin) { destroyFunc *destroyPlugin; @@ -185,24 +190,29 @@ PluginManager::deletePlugin (PluginInfo *plugin) if (plugin->_libraryPtr->resolveSymbol ("destroyPlugin", &symbol) != 0) return 1; - destroyPlugin = (destroyFunc*)symbol; + + destroyPlugin = (destroyFunc*) symbol; + /* Call it */ destroyPlugin (plugin->_plugin); + return 0; } - int +int PluginManager::registerPlugin (Plugin *plugin, LibraryManager *library) { std::string key; PluginInfo *p_info; - if( plugin==0 ) + if (plugin==0) return 1; - + p_info = new PluginInfo(); + /* Retrieve information from the plugin */ plugin->initFunc (&p_info); + key = p_info->_name; //p_info->_plugin = plugin; @@ -210,10 +220,11 @@ PluginManager::registerPlugin (Plugin *plugin, LibraryManager *library) /* Add the data in the loaded plugin map */ _loadedPlugins[ key ] = p_info; + return 0; } -int +int PluginManager::unregisterPlugin (PluginInfo *plugin) { pluginMap::iterator iter; @@ -221,10 +232,11 @@ PluginManager::unregisterPlugin (PluginInfo *plugin) key = plugin->_name; - if (!isPluginLoaded(key)) + if (!isPluginLoaded (key)) return 1; iter = _loadedPlugins.find (key); + _loadedPlugins.erase (iter); return 0; diff --git a/sflphone-common/src/plug-in/test/pluginTest.cpp b/sflphone-common/src/plug-in/test/pluginTest.cpp index cbd1b1d760dd79797bdafead09b73fb69c1836a4..9bef60f3a4402cda30872d5ee502ba8d68456d65 100644 --- a/sflphone-common/src/plug-in/test/pluginTest.cpp +++ b/sflphone-common/src/plug-in/test/pluginTest.cpp @@ -22,12 +22,13 @@ #define MAJOR_VERSION 1 #define MINOR_VERSION 0 -class PluginTest : public Plugin { +class PluginTest : public Plugin +{ public: - PluginTest( const std::string &name ) - :Plugin( name ) { - } + PluginTest (const std::string &name) + :Plugin (name) { + } virtual int initFunc (PluginInfo **info) { @@ -40,10 +41,12 @@ class PluginTest : public Plugin { } }; -extern "C" Plugin* createPlugin (void){ - return new PluginTest("mytest"); +extern "C" Plugin* createPlugin (void) +{ + return new PluginTest ("mytest"); } -extern "C" void destroyPlugin (Plugin *p){ +extern "C" void destroyPlugin (Plugin *p) +{ delete p; } diff --git a/sflphone-common/src/samplerateconverter.cpp b/sflphone-common/src/samplerateconverter.cpp index e1990f930e89af183a183d4f55de26cfec82857b..ccdb09da238437baf77d8273298b7774f603368b 100644 --- a/sflphone-common/src/samplerateconverter.cpp +++ b/sflphone-common/src/samplerateconverter.cpp @@ -1,7 +1,7 @@ /* * Copyright (C) 2008 Savoir-Faire Linux inc. * Author: Emmanuel Milou <emmanuel.milou@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 * the Free Software Foundation; either version 3 of the License, or @@ -10,7 +10,7 @@ * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. @@ -18,114 +18,124 @@ #include "samplerateconverter.h" -SamplerateConverter::SamplerateConverter( void ) - : _frequence(Manager::instance().getConfigInt( AUDIO , ALSA_SAMPLE_RATE )) //44100 - , _framesize(Manager::instance().getConfigInt( AUDIO , ALSA_FRAME_SIZE )) - , _floatBufferDownMic(NULL) - , _floatBufferUpMic(NULL) - , _src_state_mic(NULL) - , _floatBufferDownSpkr(NULL) - , _floatBufferUpSpkr(NULL) - , _src_state_spkr(NULL) - , _src_err(0) +SamplerateConverter::SamplerateConverter (void) + : _frequence (Manager::instance().getConfigInt (AUDIO , ALSA_SAMPLE_RATE)) //44100 + , _framesize (Manager::instance().getConfigInt (AUDIO , ALSA_FRAME_SIZE)) + , _floatBufferDownMic (NULL) + , _floatBufferUpMic (NULL) + , _src_state_mic (NULL) + , _floatBufferDownSpkr (NULL) + , _floatBufferUpSpkr (NULL) + , _src_state_spkr (NULL) + , _src_err (0) { - init(); + init(); } -SamplerateConverter::SamplerateConverter( int freq , int fs ) - : _frequence(freq) - , _framesize(fs) - , _floatBufferDownMic(NULL) - , _floatBufferUpMic(NULL) - , _src_state_mic(NULL) - , _floatBufferDownSpkr(NULL) - , _floatBufferUpSpkr(NULL) - , _src_state_spkr(NULL) - , _src_err(0) -{ - init(); +SamplerateConverter::SamplerateConverter (int freq , int fs) + : _frequence (freq) + , _framesize (fs) + , _floatBufferDownMic (NULL) + , _floatBufferUpMic (NULL) + , _src_state_mic (NULL) + , _floatBufferDownSpkr (NULL) + , _floatBufferUpSpkr (NULL) + , _src_state_spkr (NULL) + , _src_err (0) +{ + init(); } -SamplerateConverter::~SamplerateConverter( void ) { +SamplerateConverter::~SamplerateConverter (void) +{ - delete [] _floatBufferUpMic; _floatBufferUpMic = NULL; - delete [] _floatBufferDownMic; _floatBufferDownMic = NULL; + delete [] _floatBufferUpMic; + _floatBufferUpMic = NULL; + delete [] _floatBufferDownMic; + _floatBufferDownMic = NULL; - delete [] _floatBufferUpSpkr; _floatBufferUpSpkr = NULL; - delete [] _floatBufferDownSpkr; _floatBufferDownSpkr = NULL; + delete [] _floatBufferUpSpkr; + _floatBufferUpSpkr = NULL; + delete [] _floatBufferDownSpkr; + _floatBufferDownSpkr = NULL; - // libSamplerateConverter-related - _src_state_mic = src_delete(_src_state_mic); - _src_state_spkr = src_delete(_src_state_spkr); + // libSamplerateConverter-related + _src_state_mic = src_delete (_src_state_mic); + _src_state_spkr = src_delete (_src_state_spkr); } -void SamplerateConverter::init( void ) { - - // libSamplerateConverter-related - // Set the converter type for the upsampling and the downsampling - // interpolator SRC_SINC_BEST_QUALITY - // interpolator SRC_SINC_FASTEST - // interpolator SRC_LINEAR - _src_state_mic = src_new(SRC_SINC_FASTEST, 1, &_src_err); - _src_state_spkr = src_new(SRC_SINC_FASTEST, 1, &_src_err); - - int nbSamplesMax = (int) ( getFrequence() * getFramesize() / 1000 ); - _floatBufferDownMic = new float32[nbSamplesMax]; - _floatBufferUpMic = new float32[nbSamplesMax]; - _floatBufferDownSpkr = new float32[nbSamplesMax]; - _floatBufferUpSpkr = new float32[nbSamplesMax]; +void SamplerateConverter::init (void) +{ + + // libSamplerateConverter-related + // Set the converter type for the upsampling and the downsampling + // interpolator SRC_SINC_BEST_QUALITY + // interpolator SRC_SINC_FASTEST + // interpolator SRC_LINEAR + _src_state_mic = src_new (SRC_SINC_FASTEST, 1, &_src_err); + _src_state_spkr = src_new (SRC_SINC_FASTEST, 1, &_src_err); + + int nbSamplesMax = (int) (getFrequence() * getFramesize() / 1000); + _floatBufferDownMic = new float32[nbSamplesMax]; + _floatBufferUpMic = new float32[nbSamplesMax]; + _floatBufferDownSpkr = new float32[nbSamplesMax]; + _floatBufferUpSpkr = new float32[nbSamplesMax]; } //TODO Add ifdef for int16 or float32 type -int SamplerateConverter::upsampleData( SFLDataFormat* dataIn , SFLDataFormat* dataOut, int samplerate1 , int samplerate2 , int nbSamples ){ - - double upsampleFactor = (double)samplerate2 / samplerate1 ; - //_debug("factor = %f\n" , upsampleFactor); - int nbSamplesMax = (int) ( samplerate2 * getFramesize() / 1000 ); - if( upsampleFactor != 1 && dataIn != NULL ) - { - SRC_DATA src_data; - src_data.data_in = _floatBufferDownSpkr; - src_data.data_out = _floatBufferUpSpkr; - src_data.input_frames = nbSamples; - src_data.output_frames = (int) floor(upsampleFactor * nbSamples); - src_data.src_ratio = upsampleFactor; - src_data.end_of_input = 0; // More data will come - //_debug("upsample %d %d %f %d\n" , src_data.input_frames , src_data.output_frames, src_data.src_ratio , nbSamples); - src_short_to_float_array( dataIn , _floatBufferDownSpkr, nbSamples); - //_debug("upsample %d %f %d\n" , src_data.output_frames, src_data.src_ratio , nbSamples); - src_process(_src_state_spkr, &src_data); - //_debug("upsample %d %d %d\n" , samplerate1, samplerate2 , nbSamples); - nbSamples = ( src_data.output_frames_gen > nbSamplesMax) ? nbSamplesMax : src_data.output_frames_gen; - src_float_to_short_array(_floatBufferUpSpkr, dataOut, nbSamples); - //_debug("upsample %d %d %d\n" , samplerate1, samplerate2 , nbSamples); - } - return nbSamples; +int SamplerateConverter::upsampleData (SFLDataFormat* dataIn , SFLDataFormat* dataOut, int samplerate1 , int samplerate2 , int nbSamples) +{ + + double upsampleFactor = (double) samplerate2 / samplerate1 ; + //_debug("factor = %f\n" , upsampleFactor); + int nbSamplesMax = (int) (samplerate2 * getFramesize() / 1000); + + if (upsampleFactor != 1 && dataIn != NULL) { + SRC_DATA src_data; + src_data.data_in = _floatBufferDownSpkr; + src_data.data_out = _floatBufferUpSpkr; + src_data.input_frames = nbSamples; + src_data.output_frames = (int) floor (upsampleFactor * nbSamples); + src_data.src_ratio = upsampleFactor; + src_data.end_of_input = 0; // More data will come + //_debug("upsample %d %d %f %d\n" , src_data.input_frames , src_data.output_frames, src_data.src_ratio , nbSamples); + src_short_to_float_array (dataIn , _floatBufferDownSpkr, nbSamples); + //_debug("upsample %d %f %d\n" , src_data.output_frames, src_data.src_ratio , nbSamples); + src_process (_src_state_spkr, &src_data); + //_debug("upsample %d %d %d\n" , samplerate1, samplerate2 , nbSamples); + nbSamples = (src_data.output_frames_gen > nbSamplesMax) ? nbSamplesMax : src_data.output_frames_gen; + src_float_to_short_array (_floatBufferUpSpkr, dataOut, nbSamples); + //_debug("upsample %d %d %d\n" , samplerate1, samplerate2 , nbSamples); + } + + return nbSamples; } //TODO Add ifdef for int16 or float32 type -int SamplerateConverter::downsampleData( SFLDataFormat* dataIn , SFLDataFormat* dataOut , int samplerate1 , int samplerate2 , int nbSamples ){ - - double downsampleFactor = (double)samplerate1 / samplerate2; - //_debug("factor = %f\n" , downsampleFactor); - int nbSamplesMax = (int) ( samplerate1 * getFramesize() / 1000 ); - if ( downsampleFactor != 1 ) - { - SRC_DATA src_data; - src_data.data_in = _floatBufferUpMic; - src_data.data_out = _floatBufferDownMic; - src_data.input_frames = nbSamples; - src_data.output_frames = (int) floor(downsampleFactor * nbSamples); - src_data.src_ratio = downsampleFactor; - src_data.end_of_input = 0; // More data will come - //_debug("downsample %d %f %d\n" , src_data.output_frames, src_data.src_ratio , nbSamples); - src_short_to_float_array( dataIn, _floatBufferUpMic, nbSamples ); - //_debug("downsample %d %f %d\n" , src_data.output_frames, src_data.src_ratio , nbSamples); - src_process(_src_state_mic, &src_data); - //_debug("downsample %d %f %d\n" , src_data.output_frames, src_data.src_ratio , nbSamples); - nbSamples = ( src_data.output_frames_gen > nbSamplesMax) ? nbSamplesMax : src_data.output_frames_gen; - //_debug("downsample %d %f %d\n" , src_data.output_frames, src_data.src_ratio , nbSamples); - src_float_to_short_array( _floatBufferDownMic , dataOut , nbSamples ); - } - return nbSamples; +int SamplerateConverter::downsampleData (SFLDataFormat* dataIn , SFLDataFormat* dataOut , int samplerate1 , int samplerate2 , int nbSamples) +{ + + double downsampleFactor = (double) samplerate1 / samplerate2; + //_debug("factor = %f\n" , downsampleFactor); + int nbSamplesMax = (int) (samplerate1 * getFramesize() / 1000); + + if (downsampleFactor != 1) { + SRC_DATA src_data; + src_data.data_in = _floatBufferUpMic; + src_data.data_out = _floatBufferDownMic; + src_data.input_frames = nbSamples; + src_data.output_frames = (int) floor (downsampleFactor * nbSamples); + src_data.src_ratio = downsampleFactor; + src_data.end_of_input = 0; // More data will come + //_debug("downsample %d %f %d\n" , src_data.output_frames, src_data.src_ratio , nbSamples); + src_short_to_float_array (dataIn, _floatBufferUpMic, nbSamples); + //_debug("downsample %d %f %d\n" , src_data.output_frames, src_data.src_ratio , nbSamples); + src_process (_src_state_mic, &src_data); + //_debug("downsample %d %f %d\n" , src_data.output_frames, src_data.src_ratio , nbSamples); + nbSamples = (src_data.output_frames_gen > nbSamplesMax) ? nbSamplesMax : src_data.output_frames_gen; + //_debug("downsample %d %f %d\n" , src_data.output_frames, src_data.src_ratio , nbSamples); + src_float_to_short_array (_floatBufferDownMic , dataOut , nbSamples); + } + + return nbSamples; } diff --git a/sflphone-common/src/sdp.cpp b/sflphone-common/src/sdp.cpp index a0604d6da7416725d64b0806465467dba8ef4675..1a4005d4c722e06fa23ba7e58e18a2674a182820 100644 --- a/sflphone-common/src/sdp.cpp +++ b/sflphone-common/src/sdp.cpp @@ -23,22 +23,25 @@ #include "manager.h" -static const pj_str_t STR_AUDIO = { (char*)"audio", 5}; -static const pj_str_t STR_VIDEO = { (char*)"video", 5}; -static const pj_str_t STR_IN = { (char*)"IN", 2 }; -static const pj_str_t STR_IP4 = { (char*)"IP4", 3}; -static const pj_str_t STR_IP6 = { (char*)"IP6", 3}; -static const pj_str_t STR_RTP_AVP = { (char*)"RTP/AVP", 7 }; -static const pj_str_t STR_SDP_NAME = { (char*)"sflphone", 8 }; -static const pj_str_t STR_SENDRECV = { (char*)"sendrecv", 8 }; - -Sdp::Sdp( pj_pool_t *pool ) - : _local_media_cap(), _session_media(0), _ip_addr( "" ), _local_offer( NULL ), _negociated_offer(NULL), _negociator(NULL), _pool(NULL), _local_extern_audio_port(0) +static const pj_str_t STR_AUDIO = { (char*) "audio", 5}; +static const pj_str_t STR_VIDEO = { (char*) "video", 5}; +static const pj_str_t STR_IN = { (char*) "IN", 2 }; +static const pj_str_t STR_IP4 = { (char*) "IP4", 3}; +static const pj_str_t STR_IP6 = { (char*) "IP6", 3}; +static const pj_str_t STR_RTP_AVP = { (char*) "RTP/AVP", 7 }; +static const pj_str_t STR_SDP_NAME = { (char*) "sflphone", 8 }; +static const pj_str_t STR_SENDRECV = { (char*) "sendrecv", 8 }; +static const pj_str_t STR_RTPMAP = { (char*) "rtpmap", 6 }; + + +Sdp::Sdp (pj_pool_t *pool) + : _local_media_cap(), _session_media (0), _ip_addr (""), _local_offer (NULL), _negociated_offer (NULL), _negociator (NULL), _pool (NULL), _local_extern_audio_port (0) { _pool = pool; } -Sdp::~Sdp() { +Sdp::~Sdp() +{ //unsigned int k; @@ -49,12 +52,13 @@ Sdp::~Sdp() { }*/ //for( k=0; k<_local_media_cap.size(); k++ ){ - // delete _local_media_cap[k]; - //_local_media_cap[k] = 0; + // delete _local_media_cap[k]; + //_local_media_cap[k] = 0; //} } -void Sdp::set_media_descriptor_line( sdpMedia *media, pjmedia_sdp_media** p_med ) { +void Sdp::set_media_descriptor_line (sdpMedia *media, pjmedia_sdp_media** p_med) +{ pjmedia_sdp_media* med; pjmedia_sdp_rtpmap rtpmap; @@ -63,11 +67,11 @@ void Sdp::set_media_descriptor_line( sdpMedia *media, pjmedia_sdp_media** p_med int count, i; std::string tmp; - med = PJ_POOL_ZALLOC_T( _pool, pjmedia_sdp_media ); + med = PJ_POOL_ZALLOC_T (_pool, pjmedia_sdp_media); // Get the right media format - pj_strdup(_pool, &med->desc.media, - ( media->get_media_type() == MIME_TYPE_AUDIO ) ? &STR_AUDIO : &STR_VIDEO ); + pj_strdup (_pool, &med->desc.media, + (media->get_media_type() == MIME_TYPE_AUDIO) ? &STR_AUDIO : &STR_VIDEO); med->desc.port_count = 1; med->desc.port = media->get_port(); pj_strdup (_pool, &med->desc.transport, &STR_RTP_AVP); @@ -77,37 +81,44 @@ void Sdp::set_media_descriptor_line( sdpMedia *media, pjmedia_sdp_media** p_med med->desc.fmt_count = count; // add the payload list - for(i=0; i<count; i++){ - codec = media->get_media_codec_list()[i]; - tmp = this->convert_int_to_string (codec->getPayload ()); + + for (i=0; i<count; i++) { + codec = media->get_media_codec_list() [i]; + tmp = this->convert_int_to_string (codec->getPayload ()); _debug ("%s\n", tmp.c_str()); - pj_strdup2( _pool, &med->desc.fmt[i], tmp.c_str()); + pj_strdup2 (_pool, &med->desc.fmt[i], tmp.c_str()); // Add a rtpmap field for each codec // We could add one only for dynamic payloads because the codecs with static RTP payloads // are entirely defined in the RFC 3351, but if we want to add other attributes like an asymmetric // connection, the rtpmap attribute will be useful to specify for which codec it is applicable rtpmap.pt = med->desc.fmt[i]; - rtpmap.enc_name = pj_str( (char*) codec->getCodecName().c_str() ); + rtpmap.enc_name = pj_str ( (char*) codec->getCodecName().c_str()); rtpmap.clock_rate = codec->getClockRate(); // Add the channel number only if different from 1 - if( codec->getChannel() > 1 ) - rtpmap.param = pj_str( (char*) codec->getChannel() ); + + if (codec->getChannel() > 1) + rtpmap.param = pj_str ( (char*) codec->getChannel()); else rtpmap.param.slen = 0; - pjmedia_sdp_rtpmap_to_attr( _pool, &rtpmap, &attr ); + + pjmedia_sdp_rtpmap_to_attr (_pool, &rtpmap, &attr); + med->attr[med->attr_count++] = attr; } // Add the direction stream - attr = (pjmedia_sdp_attr*)pj_pool_zalloc( _pool, sizeof(pjmedia_sdp_attr) ); - pj_strdup2( _pool, &attr->name, media->get_stream_direction_str().c_str()); + attr = (pjmedia_sdp_attr*) pj_pool_zalloc (_pool, sizeof (pjmedia_sdp_attr)); + + pj_strdup2 (_pool, &attr->name, media->get_stream_direction_str().c_str()); + med->attr[ med->attr_count++] = attr; *p_med = med; } -int Sdp::create_local_offer (){ +int Sdp::create_local_offer () +{ pj_status_t status; _debug ("Create local offer\n"); @@ -117,8 +128,8 @@ int Sdp::create_local_offer (){ // Reference: RFC 4566 [5] /* Create and initialize basic SDP session */ - this->_local_offer = PJ_POOL_ZALLOC_T(_pool, pjmedia_sdp_session); - this->_local_offer->conn = PJ_POOL_ZALLOC_T(_pool, pjmedia_sdp_conn); + this->_local_offer = PJ_POOL_ZALLOC_T (_pool, pjmedia_sdp_session); + this->_local_offer->conn = PJ_POOL_ZALLOC_T (_pool, pjmedia_sdp_conn); /* Initialize the fields of the struct */ sdp_add_protocol(); @@ -127,39 +138,44 @@ int Sdp::create_local_offer (){ sdp_add_connection_info(); sdp_add_timing(); //sdp_addAttributes( _pool ); - sdp_add_media_description( ); + sdp_add_media_description(); //toString (); // Validate the sdp session - status = pjmedia_sdp_validate( this->_local_offer ); + status = pjmedia_sdp_validate (this->_local_offer); + if (status != PJ_SUCCESS) return status; return PJ_SUCCESS; } -int Sdp::create_initial_offer( ){ +int Sdp::create_initial_offer() +{ pj_status_t status; pjmedia_sdp_neg_state state; _debug ("Create initial offer\n"); // Build the SDP session descriptor - status = create_local_offer( ); + status = create_local_offer(); + if (status != PJ_SUCCESS) { - return status; + return status; } // Create the SDP negociator instance with local offer - status = pjmedia_sdp_neg_create_w_local_offer( _pool, get_local_sdp_session(), &_negociator); - state = pjmedia_sdp_neg_get_state( _negociator ); + status = pjmedia_sdp_neg_create_w_local_offer (_pool, get_local_sdp_session(), &_negociator); - PJ_ASSERT_RETURN( status == PJ_SUCCESS, 1 ); + state = pjmedia_sdp_neg_get_state (_negociator); + + PJ_ASSERT_RETURN (status == PJ_SUCCESS, 1); return PJ_SUCCESS; } -int Sdp::receiving_initial_offer( pjmedia_sdp_session* remote ){ +int Sdp::receiving_initial_offer (pjmedia_sdp_session* remote) +{ // Create the SDP negociator instance by calling // pjmedia_sdp_neg_create_w_remote_offer with the remote offer, and by providing the local offer ( optional ) @@ -172,31 +188,36 @@ int Sdp::receiving_initial_offer( pjmedia_sdp_session* remote ){ // pjmedia_sdp_neg_create_w_remote_offer with the remote offer, and by providing the local offer ( optional ) // Build the local offer to respond - status = create_local_offer( ); + status = create_local_offer(); + if (status != PJ_SUCCESS) { - return status; + return status; } // Retrieve some useful remote information this->fetch_media_transport_info_from_remote_sdp (remote); - status = pjmedia_sdp_neg_create_w_remote_offer( _pool, - get_local_sdp_session(), remote, &_negociator ); - state = pjmedia_sdp_neg_get_state( _negociator ); - PJ_ASSERT_RETURN( status == PJ_SUCCESS, 1 ); + status = pjmedia_sdp_neg_create_w_remote_offer (_pool, + get_local_sdp_session(), remote, &_negociator); + + state = pjmedia_sdp_neg_get_state (_negociator); + + PJ_ASSERT_RETURN (status == PJ_SUCCESS, 1); return PJ_SUCCESS; } -void Sdp::sdp_add_protocol( void ){ +void Sdp::sdp_add_protocol (void) +{ this->_local_offer->origin.version = 0; } -void Sdp::sdp_add_origin( void ){ +void Sdp::sdp_add_origin (void) +{ pj_time_val tv; - pj_gettimeofday(&tv); + pj_gettimeofday (&tv); - this->_local_offer->origin.user = pj_str(pj_gethostname()->ptr); + this->_local_offer->origin.user = pj_str (pj_gethostname()->ptr); // Use Network Time Protocol format timestamp to ensure uniqueness. this->_local_offer->origin.id = tv.sec + 2208988800UL; // The type of network ( IN for INternet ) @@ -204,22 +225,25 @@ void Sdp::sdp_add_origin( void ){ // The type of address this->_local_offer->origin.addr_type = STR_IP4; // The address of the machine from which the session was created - this->_local_offer->origin.addr = pj_str( (char*)_ip_addr.c_str() ); + this->_local_offer->origin.addr = pj_str ( (char*) _ip_addr.c_str()); } -void Sdp::sdp_add_session_name( void ){ +void Sdp::sdp_add_session_name (void) +{ this->_local_offer->name = STR_SDP_NAME; } -void Sdp::sdp_add_connection_info( void ){ +void Sdp::sdp_add_connection_info (void) +{ this->_local_offer->conn->net_type = _local_offer->origin.net_type; this->_local_offer->conn->addr_type = _local_offer->origin.addr_type; this->_local_offer->conn->addr = _local_offer->origin.addr; } -void Sdp::sdp_add_timing( void ){ +void Sdp::sdp_add_timing (void) +{ // RFC 3264: An offer/answer model session description protocol // As the session is created and destroyed through an external signaling mean (SIP), the line // should have a value of "0 0". @@ -227,48 +251,55 @@ void Sdp::sdp_add_timing( void ){ this->_local_offer->time.start = this->_local_offer->time.stop = 0; } -void Sdp::sdp_add_attributes( ){ +void Sdp::sdp_add_attributes() +{ pjmedia_sdp_attr *a; this->_local_offer->attr_count = 1; - a = PJ_POOL_ZALLOC_T(_pool, pjmedia_sdp_attr); + a = PJ_POOL_ZALLOC_T (_pool, pjmedia_sdp_attr); a->name=STR_SENDRECV; _local_offer->attr[0] = a; } -void Sdp::sdp_add_media_description( ){ +void Sdp::sdp_add_media_description() +{ pjmedia_sdp_media* med; int nb_media, i; - med = PJ_POOL_ZALLOC_T(_pool, pjmedia_sdp_media); + med = PJ_POOL_ZALLOC_T (_pool, pjmedia_sdp_media); nb_media = get_local_media_cap().size(); this->_local_offer->media_count = nb_media; - for( i=0; i<nb_media; i++ ){ - set_media_descriptor_line( get_local_media_cap()[i], &med ); + for (i=0; i<nb_media; i++) { + set_media_descriptor_line (get_local_media_cap() [i], &med); this->_local_offer->media[i] = med; } } -std::string Sdp::media_to_string( void ){ +std::string Sdp::media_to_string (void) +{ int size, i; std::ostringstream res; size = _local_media_cap.size(); - for( i = 0; i < size ; i++ ){ + + for (i = 0; i < size ; i++) { res << _local_media_cap[i]->to_string(); } res << std::endl; + return res.str(); } -void Sdp::clean_session_media(){ +void Sdp::clean_session_media() +{ _session_media.clear(); } -void Sdp::set_negociated_offer( const pjmedia_sdp_session *sdp ){ +void Sdp::set_negociated_offer (const pjmedia_sdp_session *sdp) +{ int nb_media, nb_codecs; int i,j, port; @@ -278,8 +309,10 @@ void Sdp::set_negociated_offer( const pjmedia_sdp_session *sdp ){ CodecsMap codecs_list; CodecsMap::iterator iter; AudioCodec *codec_to_add; + pjmedia_sdp_attr *attribute; + pjmedia_sdp_rtpmap *rtpmap; - _negociated_offer = (pjmedia_sdp_session*)sdp; + _negociated_offer = (pjmedia_sdp_session*) sdp; //this->fetch_remote_ip_from_sdp ((pjmedia_sdp_session*)sdp); @@ -287,25 +320,38 @@ void Sdp::set_negociated_offer( const pjmedia_sdp_session *sdp ){ // retrieve the media information nb_media = _negociated_offer->media_count; - for( i=0; i<nb_media ; i++ ){ - // Retrieve the media + + for (i=0; i<nb_media ; i++) { + // Retrieve the media current = _negociated_offer->media[i]; type = current->desc.media.ptr; port = current->desc.port; - media = new sdpMedia( type, port ); + media = new sdpMedia (type, port); // Retrieve the payload nb_codecs = current->desc.fmt_count; // Must be one - for( j=0 ; j<nb_codecs ; j++ ){ - iter = codecs_list.find((AudioCodecType)atoi(current->desc.fmt[j].ptr)); + + for (j=0 ; j<nb_codecs ; j++) { + attribute = pjmedia_sdp_media_find_attr (current, &STR_RTPMAP, NULL); + // pj_strtoul(attribute->pt) + pjmedia_sdp_attr_to_rtpmap (_pool, attribute, &rtpmap); + + // _debug("================== set_negociated_offer ===================== %i\n", pj_strtoul(&rtpmap->pt)); + // _debug("================== set_negociated_offer ===================== %s\n", current->desc.fmt[j].ptr); + // _debug("================== set_negociated_offer ===================== %i\n", atoi(current->desc.fmt[j].ptr)); + iter = codecs_list.find ( (AudioCodecType) pj_strtoul (&rtpmap->pt)); + if (iter==codecs_list.end()) return; - media->add_codec(iter->second); + + media->add_codec (iter->second); } - _session_media.push_back(media); + + _session_media.push_back (media); } } -AudioCodec* Sdp::get_session_media( void ){ +AudioCodec* Sdp::get_session_media (void) +{ int nb_media; int nb_codec; @@ -316,18 +362,22 @@ AudioCodec* Sdp::get_session_media( void ){ media_list = get_session_media_list (); nb_media = media_list.size(); + if (nb_media > 0) { nb_codec = media_list[0]->get_media_codec_list().size(); + if (nb_codec > 0) { - codec = media_list[0]->get_media_codec_list()[0]; + codec = media_list[0]->get_media_codec_list() [0]; } } + return codec; } -void Sdp::toString (void) { +void Sdp::toString (void) +{ std::ostringstream sdp; int count, i; @@ -353,16 +403,19 @@ void Sdp::toString (void) { sdp << _local_offer->media[0]->desc.port << " "; sdp << _local_offer->media[0]->desc.transport.ptr << " "; count = _local_offer->media[0]->desc.fmt_count; + for (i=0; i<count; i++) { sdp << _local_offer->media[0]->desc.fmt[i].ptr << " "; } + sdp << "\n"; _debug ("LOCAL SDP: \n%s\n", sdp.str().c_str()); } -void Sdp::set_local_media_capabilities () { +void Sdp::set_local_media_capabilities () +{ CodecOrder selected_codecs; int i; @@ -376,81 +429,95 @@ void Sdp::set_local_media_capabilities () { _debug ("Fetch local media capabilities .......... %i\n" , get_local_extern_audio_port()); /* Only one audio media used right now */ - audio = new sdpMedia(MIME_TYPE_AUDIO); + audio = new sdpMedia (MIME_TYPE_AUDIO); audio->set_port (get_local_extern_audio_port()); /* We retrieve the codecs selected by the user */ - selected_codecs = Manager::instance().getCodecDescriptorMap().getActiveCodecs(); + selected_codecs = Manager::instance().getCodecDescriptorMap().getActiveCodecs(); codecs_list = Manager::instance().getCodecDescriptorMap().getCodecsMap(); - for (i=0; i<selected_codecs.size(); i++){ - iter=codecs_list.find(selected_codecs[i]); - if (iter!=codecs_list.end()){ + + for (i=0; i<selected_codecs.size(); i++) { + iter=codecs_list.find (selected_codecs[i]); + + if (iter!=codecs_list.end()) { audio->add_codec (iter->second); } - } + } + _local_media_cap.push_back (audio); } -void Sdp::attribute_port_to_all_media (int port) { +void Sdp::attribute_port_to_all_media (int port) +{ std::vector<sdpMedia*> medias; - int i, size; + int i, size; set_local_extern_audio_port (port); - medias = get_local_media_cap (); + medias = get_local_media_cap (); size = medias.size(); - for(i=0; i<size; i++) { + for (i=0; i<size; i++) { medias[i]->set_port (port); - } + } } -std::string Sdp::convert_int_to_string (int value) { +std::string Sdp::convert_int_to_string (int value) +{ std::ostringstream result; result << value; return result.str(); } -void Sdp::fetch_remote_ip_from_sdp (pjmedia_sdp_session *r_sdp) { +void Sdp::fetch_remote_ip_from_sdp (pjmedia_sdp_session *r_sdp) +{ std::string remote_ip; remote_ip = r_sdp->conn->addr.ptr; - this->set_remote_ip(remote_ip); + _debug (" Remote IP from fetching SDP: %s\n", remote_ip.c_str()); + this->set_remote_ip (remote_ip); } -void Sdp::fetch_remote_audio_port_from_sdp (pjmedia_sdp_media *r_media){ +void Sdp::fetch_remote_audio_port_from_sdp (pjmedia_sdp_media *r_media) +{ int remote_port; - + remote_port = r_media->desc.port; - _debug(" Remote Audio Port: %d\n", remote_port); - this->set_remote_audio_port(remote_port); + _debug (" Remote Audio Port from fetching SDP: %d\n", remote_port); + this->set_remote_audio_port (remote_port); } -void Sdp::fetch_media_transport_info_from_remote_sdp (pjmedia_sdp_session *remote_sdp) { +void Sdp::fetch_media_transport_info_from_remote_sdp (pjmedia_sdp_session *remote_sdp) +{ + + _debug ("Fetching media from sdp\n"); pjmedia_sdp_media *r_media; this->get_remote_sdp_media_from_offer (remote_sdp, &r_media); - if (r_media==NULL){ - _debug("SDP Failure: no remote sdp media found in the remote offer\n"); + if (r_media==NULL) { + _debug ("SDP Failure: no remote sdp media found in the remote offer\n"); return; } - + this->fetch_remote_audio_port_from_sdp (r_media); + this->fetch_remote_ip_from_sdp (remote_sdp); } -void Sdp::get_remote_sdp_media_from_offer (pjmedia_sdp_session* remote_sdp, pjmedia_sdp_media** r_media){ +void Sdp::get_remote_sdp_media_from_offer (pjmedia_sdp_session* remote_sdp, pjmedia_sdp_media** r_media) +{ int count, i; count = remote_sdp->media_count; *r_media = NULL; - for(i = 0; i < count; ++i) { - if(pj_stricmp2(&remote_sdp->media[i]->desc.media, "audio") == 0) { + + for (i = 0; i < count; ++i) { + if (pj_stricmp2 (&remote_sdp->media[i]->desc.media, "audio") == 0) { *r_media = remote_sdp->media[i]; return; } diff --git a/sflphone-common/src/sdpmedia.cpp b/sflphone-common/src/sdpmedia.cpp index fe2ef7615ca00e81a2de5cbc57c6366bdc6ef26a..4cd5a8b99c7f9b3e99a3134ab3f0b470f660b9e4 100644 --- a/sflphone-common/src/sdpmedia.cpp +++ b/sflphone-common/src/sdpmedia.cpp @@ -23,16 +23,14 @@ #include <sstream> #include <iostream> -static const char* streamDirectionStr[] = -{ +static const char* streamDirectionStr[] = { "sendrecv", "sendonly", "recvonly", "inactive" }; -static const char* mediaTypeStr[] = -{ +static const char* mediaTypeStr[] = { "audio", "video", "application", @@ -41,30 +39,34 @@ static const char* mediaTypeStr[] = "message" }; -sdpMedia::sdpMedia( int type ) - : _media_type( (mediaType)type ), _codec_list(0), _port( 0 ), _stream_type( SEND_RECEIVE ){} +sdpMedia::sdpMedia (int type) + : _media_type ( (mediaType) type), _codec_list (0), _port (0), _stream_type (SEND_RECEIVE) {} -sdpMedia::sdpMedia( std::string type, int port, std::string dir) - : _media_type( (mediaType)-1), _codec_list(0), _port(port), - _stream_type((streamDirection)-1){ +sdpMedia::sdpMedia (std::string type, int port, std::string dir) + : _media_type ( (mediaType)-1), _codec_list (0), _port (port), + _stream_type ( (streamDirection)-1) +{ unsigned int i; const char* tmp; - for( i=0 ; i<MEDIA_COUNT ; i++){ + for (i=0 ; i<MEDIA_COUNT ; i++) { tmp = mediaTypeStr[i]; - if( strcmp(type.c_str(), tmp) == 0 ){ - _media_type = (mediaType)i; + + if (strcmp (type.c_str(), tmp) == 0) { + _media_type = (mediaType) i; break; } } - if( strcmp( dir.c_str(), "default") == 0 ) + if (strcmp (dir.c_str(), "default") == 0) dir = DEFAULT_STREAM_DIRECTION; - for( i=0; i<DIR_COUNT; i++ ){ + + for (i=0; i<DIR_COUNT; i++) { tmp = streamDirectionStr[i]; - if( strcmp(dir.c_str(), tmp) == 0){ - _stream_type = (streamDirection)i; + + if (strcmp (dir.c_str(), tmp) == 0) { + _stream_type = (streamDirection) i; break; } } @@ -74,29 +76,34 @@ sdpMedia::sdpMedia( std::string type, int port, std::string dir) sdpMedia::~sdpMedia() { int i; - for(i=0; i<(int)_codec_list.size(); i++) + + for (i=0; i< (int) _codec_list.size(); i++) delete _codec_list[i]; } -std::string sdpMedia::get_media_type_str( void ){ +std::string sdpMedia::get_media_type_str (void) +{ std::string value; // Test the range to be sure we know the media - if( _media_type >= 0 && _media_type < MEDIA_COUNT ) + + if (_media_type >= 0 && _media_type < MEDIA_COUNT) value = mediaTypeStr[ _media_type ]; else value = "unknown"; + return value; } -void sdpMedia::add_codec( AudioCodec* codec ){ - +void sdpMedia::add_codec (AudioCodec* codec) +{ + _codec_list.push_back (codec); } -void sdpMedia::remove_codec( std::string codecName ) +void sdpMedia::remove_codec (std::string codecName) { // Look for the codec by its encoding name int i; @@ -107,37 +114,43 @@ void sdpMedia::remove_codec( std::string codecName ) size = _codec_list.size(); std::cout << "vector size: " << size << std::endl; - for( i=0 ; i<size ; i++ ){ + for (i=0 ; i<size ; i++) { std::cout << _codec_list[i]->getCodecName().c_str() << std::endl; - if( strcmp(_codec_list[i]->getCodecName().c_str(), codecName.c_str()) == 0 ){ + + if (strcmp (_codec_list[i]->getCodecName().c_str(), codecName.c_str()) == 0) { std::cout << "erase " <<_codec_list[i]->getCodecName() << std::endl; - iter = _codec_list.begin()+i; - _codec_list.erase(iter); + iter = _codec_list.begin() +i; + _codec_list.erase (iter); break; } } } -void sdpMedia::clear_codec_list( void ) { +void sdpMedia::clear_codec_list (void) +{ // Erase every codecs from the list _codec_list.clear(); } -std::string sdpMedia::get_stream_direction_str( void ) { +std::string sdpMedia::get_stream_direction_str (void) +{ std::string value; // Test the range of the value - if( _stream_type >= 0 && _stream_type < DIR_COUNT ) + + if (_stream_type >= 0 && _stream_type < DIR_COUNT) value = streamDirectionStr[ _stream_type ]; else value = "unknown"; + return value; } -std::string sdpMedia::to_string( void ){ +std::string sdpMedia::to_string (void) +{ std::ostringstream display; int size, i; @@ -146,7 +159,8 @@ std::string sdpMedia::to_string( void ){ display << get_media_type_str(); display << ":" << get_port(); display << ":"; - for(i=0; i<size; i++){ + + for (i=0; i<size; i++) { display << _codec_list[i]->getCodecName() << "/"; } diff --git a/sflphone-common/src/sipaccount.cpp b/sflphone-common/src/sipaccount.cpp index 31502460a398788f81478dd451fd3f99ea2718f8..3d141db0ef0c50572fb22aa3ebc6be74aadf56ee 100644 --- a/sflphone-common/src/sipaccount.cpp +++ b/sflphone-common/src/sipaccount.cpp @@ -1,18 +1,18 @@ /* * Copyright (C) 2006-2009 Savoir-Faire Linux inc. - * + * * Author: Emmanuel Milou <emmanuel.milou@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 * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. @@ -22,22 +22,22 @@ #include "manager.h" #include "user_cfg.h" -SIPAccount::SIPAccount(const AccountID& accountID) - : Account(accountID, "sip") - , _cred(NULL) - , _contact("") - , _bRegister(false) - , _regc() +SIPAccount::SIPAccount (const AccountID& accountID) + : Account (accountID, "sip") + , _cred (NULL) + , _contact ("") + , _bRegister (false) + , _regc() { /* SIPVoIPlink is used as a singleton, because we want to have only one link for all the SIP accounts created */ /* So instead of creating a new instance, we just fetch the static instance, or create one if it is not yet */ /* The SIP library initialization is done in the SIPVoIPLink constructor */ /* The SIP voip link is now independant of the account ID as it can manage several SIP accounts */ - _link = SIPVoIPLink::instance(""); - + _link = SIPVoIPLink::instance (""); + /* Represents the number of SIP accounts connected the same link */ dynamic_cast<SIPVoIPLink*> (_link)->incrementClients(); - + } SIPAccount::~SIPAccount() @@ -46,7 +46,8 @@ SIPAccount::~SIPAccount() dynamic_cast<SIPVoIPLink*> (_link)->decrementClients(); /* Delete accounts-related information */ _regc = NULL; - delete _cred; _cred = NULL; + delete _cred; + _cred = NULL; } int SIPAccount::registerVoIPLink() @@ -55,48 +56,47 @@ int SIPAccount::registerVoIPLink() /* Retrieve the account information */ /* Stuff needed for SIP registration */ - setHostname(Manager::instance().getConfigString(_accountID, HOSTNAME)); - setUsername(Manager::instance().getConfigString(_accountID, USERNAME)); - setPassword(Manager::instance().getConfigString(_accountID, PASSWORD)); + setHostname (Manager::instance().getConfigString (_accountID, HOSTNAME)); + setUsername (Manager::instance().getConfigString (_accountID, USERNAME)); + setPassword (Manager::instance().getConfigString (_accountID, PASSWORD)); /* Start registration */ - status = _link->sendRegister( _accountID ); - ASSERT( status , SUCCESS ); + status = _link->sendRegister (_accountID); + ASSERT (status , SUCCESS); return SUCCESS; } int SIPAccount::unregisterVoIPLink() { - _debug("unregister account %s\n" , getAccountID().c_str()); - - if(_link->sendUnregister( _accountID )){ + _debug ("unregister account %s\n" , getAccountID().c_str()); + + if (_link->sendUnregister (_accountID)) { setRegistrationInfo (NULL); return true; - } - else + } else return false; - + } -void SIPAccount::loadConfig() +void SIPAccount::loadConfig() { - // Account generic - Account::loadConfig(); + // Account generic + Account::loadConfig(); } -bool SIPAccount::fullMatch(const std::string& username, const std::string& hostname) +bool SIPAccount::fullMatch (const std::string& username, const std::string& hostname) { - return (userMatch (username) && hostnameMatch (hostname)); + return (userMatch (username) && hostnameMatch (hostname)); } -bool SIPAccount::userMatch(const std::string& username) +bool SIPAccount::userMatch (const std::string& username) { - return (username == getUsername()); + return (username == getUsername()); } -bool SIPAccount::hostnameMatch(const std::string& hostname) +bool SIPAccount::hostnameMatch (const std::string& hostname) { - return (hostname == getHostname()); + return (hostname == getHostname()); } diff --git a/sflphone-common/src/sipcall.cpp b/sflphone-common/src/sipcall.cpp index 43aabe062073070ac69a3b22bdaf8dc945cac5ca..8f1017ce0a314b6051234a6830ef4965f9c1e95b 100644 --- a/sflphone-common/src/sipcall.cpp +++ b/sflphone-common/src/sipcall.cpp @@ -24,23 +24,24 @@ #include "global.h" // for _debug -SIPCall::SIPCall(const CallID& id, Call::CallType type, pj_pool_t *pool) : Call(id, type) - , _cid(0) - , _did(0) - , _tid(0) - , _xferSub(NULL) - , _invSession(NULL) - , _local_sdp(0) +SIPCall::SIPCall (const CallID& id, Call::CallType type, pj_pool_t *pool) : Call (id, type) + , _cid (0) + , _did (0) + , _tid (0) + , _xferSub (NULL) + , _invSession (NULL) + , _local_sdp (0) { _local_sdp = new Sdp (pool); - _debug("SIPCALL::Constructor for this clss is called \n"); + _debug ("SIPCALL::Constructor for this clss is called \n"); } -SIPCall::~SIPCall() +SIPCall::~SIPCall() { - delete _local_sdp; _local_sdp = 0; - _debug("SIPCALL::Destructor for this clss is called \n"); + delete _local_sdp; + _local_sdp = 0; + _debug ("SIPCALL::Destructor for this clss is called \n"); } diff --git a/sflphone-common/src/sipvoiplink.cpp b/sflphone-common/src/sipvoiplink.cpp index 8a1f1976e0c761d8e0c1a921ff8e1d470fd48366..6d8d8f4b964a7754c4ce4baa051be474303c00ad 100644 --- a/sflphone-common/src/sipvoiplink.cpp +++ b/sflphone-common/src/sipvoiplink.cpp @@ -31,7 +31,8 @@ #define CAN_REINVITE 1 -const pj_str_t STR_USER_AGENT = { ( char* ) "User-Agent", 10 }; + +const pj_str_t STR_USER_AGENT = { (char*) "User-Agent", 10 }; /**************** EXTERN VARIABLES AND FUNCTIONS (callbacks) **************************/ @@ -41,7 +42,7 @@ const pj_str_t STR_USER_AGENT = { ( char* ) "User-Agent", 10 }; * @param rdata The request data * @param r_sdp The pjmedia_sdp_media to stock the remote SDP */ -void get_remote_sdp_from_offer ( pjsip_rx_data *rdata, pjmedia_sdp_session** r_sdp ); +void get_remote_sdp_from_offer (pjsip_rx_data *rdata, pjmedia_sdp_session** r_sdp); int getModId(); @@ -51,11 +52,11 @@ int getModId(); * @param call a SIPCall valid pointer * @return bool True */ -bool setCallAudioLocal ( SIPCall* call, std::string localIP, bool stun, std::string server ); +bool setCallAudioLocal (SIPCall* call, std::string localIP, bool stun, std::string server); -void handle_incoming_options ( pjsip_rx_data *rxdata ); +void handle_incoming_options (pjsip_rx_data *rxdata); -std::string fetch_header_value ( pjsip_msg *msg, std::string field ); +std::string fetch_header_value (pjsip_msg *msg, std::string field); /* * The global pool factory @@ -91,7 +92,7 @@ UrlHook *urlhook; /** * Get the number of voicemail waiting in a SIP message */ -void set_voicemail_info ( AccountID account, pjsip_msg_body *body ); +void set_voicemail_info (AccountID account, pjsip_msg_body *body); // Documentated from the PJSIP Developer's Guide, available on the pjsip website/ @@ -102,7 +103,7 @@ void set_voicemail_info ( AccountID account, pjsip_msg_body *body ); * @param inv A pointer on a pjsip_inv_session structure * @param e A pointer on a pjsip_event structure */ -void call_on_state_changed ( pjsip_inv_session *inv, pjsip_event *e ); +void call_on_state_changed (pjsip_inv_session *inv, pjsip_event *e); /* * Session callback @@ -111,7 +112,7 @@ void call_on_state_changed ( pjsip_inv_session *inv, pjsip_event *e ); * @param inv A pointer on a pjsip_inv_session structure * @param status A pj_status_t structure */ -void call_on_media_update ( pjsip_inv_session *inv UNUSED, pj_status_t status UNUSED ); +void call_on_media_update (pjsip_inv_session *inv UNUSED, pj_status_t status UNUSED); /* * Called when the invite usage module has created a new dialog and invite @@ -120,7 +121,7 @@ void call_on_media_update ( pjsip_inv_session *inv UNUSED, pj_status_t status UN * @param inv A pointer on a pjsip_inv_session structure * @param e A pointer on a pjsip_event structure */ -void call_on_forked ( pjsip_inv_session *inv, pjsip_event *e ); +void call_on_forked (pjsip_inv_session *inv, pjsip_event *e); /* * Session callback @@ -131,815 +132,877 @@ void call_on_forked ( pjsip_inv_session *inv, pjsip_event *e ); * @param tsx A pointer on a pjsip_transaction structure * @param e A pointer on a pjsip_event structure */ -void call_on_tsx_changed ( pjsip_inv_session *inv, pjsip_transaction *tsx, pjsip_event *e ); +void call_on_tsx_changed (pjsip_inv_session *inv, pjsip_transaction *tsx, pjsip_event *e); -void on_rx_offer ( pjsip_inv_session *inv, const pjmedia_sdp_session *offer ); +void on_rx_offer (pjsip_inv_session *inv, const pjmedia_sdp_session *offer); /* * Registration callback */ -void regc_cb ( struct pjsip_regc_cbparam *param ); +void regc_cb (struct pjsip_regc_cbparam *param); /* * Called to handle incoming requests outside dialogs * @param rdata * @return pj_bool_t */ -pj_bool_t mod_on_rx_request ( pjsip_rx_data *rdata ); +pj_bool_t mod_on_rx_request (pjsip_rx_data *rdata); /* * Called to handle incoming response * @param rdata * @return pj_bool_t */ -pj_bool_t mod_on_rx_response ( pjsip_rx_data *rdata UNUSED ) ; +pj_bool_t mod_on_rx_response (pjsip_rx_data *rdata UNUSED) ; /* * Transfer callbacks */ -void xfer_func_cb ( pjsip_evsub *sub, pjsip_event *event ); -void xfer_svr_cb ( pjsip_evsub *sub, pjsip_event *event ); -void onCallTransfered ( pjsip_inv_session *inv, pjsip_rx_data *rdata ); +void xfer_func_cb (pjsip_evsub *sub, pjsip_event *event); +void xfer_svr_cb (pjsip_evsub *sub, pjsip_event *event); +void onCallTransfered (pjsip_inv_session *inv, pjsip_rx_data *rdata); /*************************************************************************************************/ SIPVoIPLink* SIPVoIPLink::_instance = NULL; -SIPVoIPLink::SIPVoIPLink ( const AccountID& accountID ) - : VoIPLink ( accountID ) - , _nbTryListenAddr ( 2 ) // number of times to try to start SIP listener - , _stunServer ( "" ) - , _localExternAddress ( "" ) - , _localExternPort ( 0 ) - , _audiortp ( new AudioRtp() ) - ,_regPort ( DEFAULT_SIP_PORT ) - , _useStun ( false ) - , _clients ( 0 ) +SIPVoIPLink::SIPVoIPLink (const AccountID& accountID) + : VoIPLink (accountID) + , _nbTryListenAddr (2) // number of times to try to start SIP listener + , _stunServer ("") + , _localExternAddress ("") + , _localExternPort (0) + , _audiortp (new AudioRtp()) + ,_regPort (DEFAULT_SIP_PORT) + , _useStun (false) + , _clients (0) { - // to get random number for RANDOM_PORT - srand ( time ( NULL ) ); + // to get random number for RANDOM_PORT + srand (time (NULL)); - urlhook = new UrlHook (); + urlhook = new UrlHook (); - /* Start pjsip initialization step */ - init(); + /* Start pjsip initialization step */ + init(); } SIPVoIPLink::~SIPVoIPLink() { - terminate(); + terminate(); } -SIPVoIPLink* SIPVoIPLink::instance ( const AccountID& id ) +SIPVoIPLink* SIPVoIPLink::instance (const AccountID& id) { - if ( !_instance ) - { - _instance = new SIPVoIPLink ( id ); - } + if (!_instance) { + _instance = new SIPVoIPLink (id); + } - return _instance; + return _instance; } -void SIPVoIPLink::decrementClients ( void ) +void SIPVoIPLink::decrementClients (void) { - _clients--; - if ( _clients == 0 ) - { - terminate(); - SIPVoIPLink::_instance=NULL; - } + _clients--; + + if (_clients == 0) { + terminate(); + SIPVoIPLink::_instance=NULL; + } } bool SIPVoIPLink::init() { - if ( initDone() ) - return false; + if (initDone()) + return false; - /* Instanciate the C++ thread */ - _evThread = new EventThread ( this ); + /* Instanciate the C++ thread */ + _evThread = new EventThread (this); - /* Initialize the pjsip library */ - pjsip_init(); - initDone ( true ); + /* Initialize the pjsip library */ + pjsip_init(); - return true; + initDone (true); + + return true; } void SIPVoIPLink::terminate() { - if ( _evThread ) - { - delete _evThread; _evThread = NULL; - } + if (_evThread) { + delete _evThread; + _evThread = NULL; + } + + /* Clean shutdown of pjsip library */ + if (initDone()) { + pjsip_shutdown(); + } - /* Clean shutdown of pjsip library */ - if ( initDone() ) - { - pjsip_shutdown(); - } - initDone ( false ); + initDone (false); } void SIPVoIPLink::terminateSIPCall() { - ost::MutexLock m ( _callMapMutex ); - CallMap::iterator iter = _callMap.begin(); - SIPCall *call; - while ( iter != _callMap.end() ) - { - call = dynamic_cast<SIPCall*> ( iter->second ); - if ( call ) - { - // terminate the sip call - delete call; call = 0; - } - iter++; - } - _callMap.clear(); + ost::MutexLock m (_callMapMutex); + CallMap::iterator iter = _callMap.begin(); + SIPCall *call; + + while (iter != _callMap.end()) { + call = dynamic_cast<SIPCall*> (iter->second); + + if (call) { + // terminate the sip call + delete call; + call = 0; + } + + iter++; + } + + _callMap.clear(); } void -SIPVoIPLink::terminateOneCall ( const CallID& id ) +SIPVoIPLink::terminateOneCall (const CallID& id) { - SIPCall *call = getSIPCall ( id ); - if ( call ) - { - // terminate the sip call - delete call; call = 0; - } + SIPCall *call = getSIPCall (id); + + if (call) { + // terminate the sip call + delete call; + call = 0; + } } -void get_remote_sdp_from_offer ( pjsip_rx_data *rdata, pjmedia_sdp_session** r_sdp ) +void get_remote_sdp_from_offer (pjsip_rx_data *rdata, pjmedia_sdp_session** r_sdp) { - pjmedia_sdp_session *sdp; - pjsip_msg *msg; - pjsip_msg_body *body; + pjmedia_sdp_session *sdp; + pjsip_msg *msg; + pjsip_msg_body *body; + + // Get the message + msg = rdata->msg_info.msg; + // Get the body message + body = msg->body; - // Get the message - msg = rdata->msg_info.msg; - // Get the body message - body = msg->body; + // Parse the remote request to get the sdp session - // Parse the remote request to get the sdp session - if ( body ) - { - pjmedia_sdp_parse ( rdata->tp_info.pool, ( char* ) body->data, body->len, &sdp ); - *r_sdp = sdp; - } + if (body) { + pjmedia_sdp_parse (rdata->tp_info.pool, (char*) body->data, body->len, &sdp); + *r_sdp = sdp; + } - else - *r_sdp = NULL; + else + *r_sdp = NULL; } -std::string SIPVoIPLink::get_useragent_name ( void ) +std::string SIPVoIPLink::get_useragent_name (void) { - std::ostringstream useragent; - useragent << PROGNAME << "/" << SFLPHONED_VERSION; - return useragent.str(); + std::ostringstream useragent; + useragent << PROGNAME << "/" << SFLPHONED_VERSION; + return useragent.str(); } void SIPVoIPLink::getEvent() { - // We have to register the external thread so it could access the pjsip framework - if ( !pj_thread_is_registered() ) - pj_thread_register ( NULL, desc, &thread ); - - // PJSIP polling - pj_time_val timeout = {0, 10}; - pjsip_endpt_handle_events ( _endpt, &timeout ); - -} - -int SIPVoIPLink::sendRegister ( AccountID id ) -{ - pj_status_t status; - int expire_value; - char contactTmp[256]; - pj_str_t svr, aor, contact, useragent; - pjsip_tx_data *tdata; - std::string tmp, hostname, username, password; - SIPAccount *account; - pjsip_regc *regc; - pjsip_generic_string_hdr *h; - pjsip_hdr hdr_list; - - account = dynamic_cast<SIPAccount *> ( Manager::instance().getAccount ( id ) ); - hostname = account->getHostname(); - username = account->getUsername(); - password = account->getPassword(); - - _mutexSIP.enterMutex(); - - /* Get the client registration information for this particular account */ - regc = account->getRegistrationInfo(); - /* TODO If the registration already exists, delete it */ - /*if(regc) { - status = pjsip_regc_destroy(regc); - regc = NULL; - PJ_ASSERT_RETURN( status == PJ_SUCCESS, 1 ); - }*/ - - account->setRegister ( true ); - - /* Set the expire value of the message from the config file */ - expire_value = Manager::instance().getRegistrationExpireValue(); - - /* Update the state of the voip link */ - account->setRegistrationState ( Trying ); - - if ( !validStunServer ) - { - account->setRegistrationState ( ErrorExistStun ); - account->setRegister ( false ); - _mutexSIP.leaveMutex(); - return false; - } - - /* Create the registration according to the account ID */ - status = pjsip_regc_create ( _endpt, ( void* ) account, ®c_cb, ®c ); - if ( status != PJ_SUCCESS ) - { - _debug ( "UserAgent: Unable to create regc.\n" ); - _mutexSIP.leaveMutex(); - return false; - } - - tmp = "sip:" + hostname; - pj_strdup2 ( _pool, &svr, tmp.data() ); - - // tmp = "<sip:" + username + "@" + hostname + ";transport=tls>"; - tmp = "<sip:" + username + "@" + hostname + ">"; - pj_strdup2 ( _pool, &aor, tmp.data() ); - - sprintf ( contactTmp, "<sip:%s@%s:%d>", username.data(), _localExternAddress.data(), _localExternPort ); - pj_strdup2 ( _pool, &contact, contactTmp ); - account->setContact ( contactTmp ); - - status = pjsip_regc_init ( regc, &svr, &aor, &aor, 1, &contact, 600 ); //timeout); - if ( status != PJ_SUCCESS ) - { - _debug ( "UserAgent: Unable to initialize regc. %d\n", status ); //, regc->str_srv_url.ptr); - _mutexSIP.leaveMutex(); - return false; - } - - pjsip_cred_info *cred = account->getCredInfo(); - - if ( !cred ) - cred = new pjsip_cred_info(); - - pj_bzero ( cred, sizeof ( pjsip_cred_info ) ); - pj_strdup2 ( _pool, &cred->username, username.data() ); - cred->data_type = PJSIP_CRED_DATA_PLAIN_PASSWD; - pj_strdup2 ( _pool, &cred->data, password.data() ); - pj_strdup2 ( _pool, &cred->realm, "*" ); - pj_strdup2 ( _pool, &cred->scheme, "digest" ); - pjsip_regc_set_credentials ( regc, 1, cred ); - - account->setCredInfo ( cred ); - - // Add User-Agent Header - pj_list_init ( &hdr_list ); - useragent = pj_str ( ( char* ) get_useragent_name ().c_str() ); - h = pjsip_generic_string_hdr_create ( _pool, &STR_USER_AGENT, &useragent ); - pj_list_push_back ( &hdr_list, ( pjsip_hdr* ) h ); - pjsip_regc_add_headers ( regc, &hdr_list ); - - status = pjsip_regc_register ( regc, PJ_TRUE, &tdata ); - if ( status != PJ_SUCCESS ) - { - _debug ( "UserAgent: Unable to register regc.\n" ); - _mutexSIP.leaveMutex(); - return false; - } - - status = pjsip_regc_send ( regc, tdata ); - if ( status != PJ_SUCCESS ) - { - _debug ( "UserAgent: Unable to send regc request.\n" ); - _mutexSIP.leaveMutex(); - return false; - } - - _mutexSIP.leaveMutex(); - - account->setRegistrationInfo ( regc ); - - return true; + // We have to register the external thread so it could access the pjsip framework + if (!pj_thread_is_registered()) + pj_thread_register (NULL, desc, &thread); + + // PJSIP polling + pj_time_val timeout = {0, 10}; + + pjsip_endpt_handle_events (_endpt, &timeout); + +} + +int SIPVoIPLink::sendRegister (AccountID id) +{ + pj_status_t status; + int expire_value; + char contactTmp[256]; + pj_str_t svr, aor, contact, useragent; + pjsip_tx_data *tdata; + std::string tmp, hostname, username, password; + SIPAccount *account; + pjsip_regc *regc; + pjsip_generic_string_hdr *h; + pjsip_hdr hdr_list; + + account = dynamic_cast<SIPAccount *> (Manager::instance().getAccount (id)); + hostname = account->getHostname(); + username = account->getUsername(); + password = account->getPassword(); + + _mutexSIP.enterMutex(); + + /* Get the client registration information for this particular account */ + regc = account->getRegistrationInfo(); + /* TODO If the registration already exists, delete it */ + /*if(regc) { + status = pjsip_regc_destroy(regc); + regc = NULL; + PJ_ASSERT_RETURN( status == PJ_SUCCESS, 1 ); + }*/ + + account->setRegister (true); + + /* Set the expire value of the message from the config file */ + expire_value = Manager::instance().getRegistrationExpireValue(); + + /* Update the state of the voip link */ + account->setRegistrationState (Trying); + + if (!validStunServer) { + account->setRegistrationState (ErrorExistStun); + account->setRegister (false); + _mutexSIP.leaveMutex(); + return false; + } + + /* Create the registration according to the account ID */ + status = pjsip_regc_create (_endpt, (void*) account, ®c_cb, ®c); + + if (status != PJ_SUCCESS) { + _debug ("UserAgent: Unable to create regc.\n"); + _mutexSIP.leaveMutex(); + return false; + } + + tmp = "sip:" + hostname; + + pj_strdup2 (_pool, &svr, tmp.data()); + + // tmp = "<sip:" + username + "@" + hostname + ";transport=tls>"; + tmp = "<sip:" + username + "@" + hostname + ">"; + pj_strdup2 (_pool, &aor, tmp.data()); + + _debug ("<sip:%s@%s:%d>\n", username.data(), _localExternAddress.data(), _localExternPort); + sprintf (contactTmp, "<sip:%s@%s:%d>", username.data(), _localExternAddress.data(), _localExternPort); + pj_strdup2 (_pool, &contact, contactTmp); + account->setContact (contactTmp); + + status = pjsip_regc_init (regc, &svr, &aor, &aor, 1, &contact, 600); //timeout); + + if (status != PJ_SUCCESS) { + _debug ("UserAgent: Unable to initialize regc. %d\n", status); //, regc->str_srv_url.ptr); + _mutexSIP.leaveMutex(); + return false; + } + + pjsip_cred_info *cred = account->getCredInfo(); + + if (!cred) + cred = new pjsip_cred_info(); + + pj_bzero (cred, sizeof (pjsip_cred_info)); + + pj_strdup2 (_pool, &cred->username, username.data()); + + cred->data_type = PJSIP_CRED_DATA_PLAIN_PASSWD; + + pj_strdup2 (_pool, &cred->data, password.data()); + + pj_strdup2 (_pool, &cred->realm, "*"); + + pj_strdup2 (_pool, &cred->scheme, "digest"); + + pjsip_regc_set_credentials (regc, 1, cred); + + account->setCredInfo (cred); + + // Add User-Agent Header + pj_list_init (&hdr_list); + + useragent = pj_str ( (char*) get_useragent_name ().c_str()); + + h = pjsip_generic_string_hdr_create (_pool, &STR_USER_AGENT, &useragent); + + pj_list_push_back (&hdr_list, (pjsip_hdr*) h); + + pjsip_regc_add_headers (regc, &hdr_list); + + status = pjsip_regc_register (regc, PJ_TRUE, &tdata); + + if (status != PJ_SUCCESS) { + _debug ("UserAgent: Unable to register regc.\n"); + _mutexSIP.leaveMutex(); + return false; + } + + status = pjsip_regc_send (regc, tdata); + + if (status != PJ_SUCCESS) { + _debug ("UserAgent: Unable to send regc request.\n"); + _mutexSIP.leaveMutex(); + return false; + } + + _mutexSIP.leaveMutex(); + + account->setRegistrationInfo (regc); + + return true; } int -SIPVoIPLink::sendUnregister ( AccountID id ) -{ - pj_status_t status = 0; - pjsip_tx_data *tdata = NULL; - SIPAccount *account; - pjsip_regc *regc; - - account = dynamic_cast<SIPAccount *> ( Manager::instance().getAccount ( id ) ); - regc = account->getRegistrationInfo(); - - if ( !account->isRegister() ) - { - account->setRegistrationState ( Unregistered ); - return true; - } - - if ( regc ) - { - status = pjsip_regc_unregister ( regc, &tdata ); - if ( status != PJ_SUCCESS ) - { - _debug ( "UserAgent: Unable to unregister regc.\n" ); - return false; - } - - status = pjsip_regc_send ( regc, tdata ); - if ( status != PJ_SUCCESS ) - { - _debug ( "UserAgent: Unable to send regc request.\n" ); - return false; - } - } - else - { - _debug ( "UserAgent: regc is null!\n" ); - return false; - } - - //account->setRegistrationInfo(regc); - account->setRegister ( false ); - - return true; +SIPVoIPLink::sendUnregister (AccountID id) +{ + pj_status_t status = 0; + pjsip_tx_data *tdata = NULL; + SIPAccount *account; + pjsip_regc *regc; + + account = dynamic_cast<SIPAccount *> (Manager::instance().getAccount (id)); + regc = account->getRegistrationInfo(); + + if (!account->isRegister()) { + account->setRegistrationState (Unregistered); + return true; + } + + if (regc) { + status = pjsip_regc_unregister (regc, &tdata); + + if (status != PJ_SUCCESS) { + _debug ("UserAgent: Unable to unregister regc.\n"); + return false; + } + + status = pjsip_regc_send (regc, tdata); + + if (status != PJ_SUCCESS) { + _debug ("UserAgent: Unable to send regc request.\n"); + return false; + } + } else { + _debug ("UserAgent: regc is null!\n"); + return false; + } + + //account->setRegistrationInfo(regc); + account->setRegister (false); + + return true; } Call* -SIPVoIPLink::newOutgoingCall ( const CallID& id, const std::string& toUrl ) -{ - Account* account; - pj_status_t status; - - SIPCall* call = new SIPCall ( id, Call::Outgoing, _pool ); - - - if ( call ) - { - account = dynamic_cast<SIPAccount *> ( Manager::instance().getAccount ( Manager::instance().getAccountFromCall ( id ) ) ); - if ( !account ) - { - _debug ( "Error retrieving the account to the make the call with\n" ); - call->setConnectionState ( Call::Disconnected ); - call->setState ( Call::Error ); - delete call; call=0; - return call; - } - - call->setPeerNumber ( getSipTo ( toUrl, account->getHostname() ) ); - setCallAudioLocal ( call, getLocalIPAddress(), useStun(), getStunServer() ); - - call->initRecFileName(); - - _debug ( "Try to make a call to: %s with call ID: %s\n", toUrl.data(), id.data() ); - // Building the local SDP offer - call->getLocalSDP()->set_ip_address ( getLocalIP() ); - status = call->getLocalSDP()->create_initial_offer(); - if ( status != PJ_SUCCESS ) - { - delete call; call=0; - return call; - } - - if ( SIPOutgoingInvite ( call ) ) - { - call->setConnectionState ( Call::Progressing ); - call->setState ( Call::Active ); - addCall ( call ); - } - else - { - delete call; call = 0; - } - } - return call; +SIPVoIPLink::newOutgoingCall (const CallID& id, const std::string& toUrl) +{ + Account* account; + pj_status_t status; + + SIPCall* call = new SIPCall (id, Call::Outgoing, _pool); + + + if (call) { + account = dynamic_cast<SIPAccount *> (Manager::instance().getAccount (Manager::instance().getAccountFromCall (id))); + + if (!account) { + _debug ("Error retrieving the account to the make the call with\n"); + call->setConnectionState (Call::Disconnected); + call->setState (Call::Error); + delete call; + call=0; + return call; + } + + call->setPeerNumber (getSipTo (toUrl, account->getHostname())); + + setCallAudioLocal (call, getLocalIPAddress(), useStun(), getStunServer()); + + + try { + _debug ("CREATE NEW RTP SESSION FROM NEWOUTGOINGCALL\n"); + _audiortp->createNewSession (call); + } catch (...) { + _debug ("Failed to create rtp thread from newOutGoingCall\n"); + } + + + + + call->initRecFileName(); + + _debug ("Try to make a call to: %s with call ID: %s\n", toUrl.data(), id.data()); + // Building the local SDP offer + call->getLocalSDP()->set_ip_address (getLocalIP()); + status = call->getLocalSDP()->create_initial_offer(); + + if (status != PJ_SUCCESS) { + delete call; + call=0; + return call; + } + + if (SIPOutgoingInvite (call)) { + + call->setConnectionState (Call::Progressing); + call->setState (Call::Active); + addCall (call); + + // _audiortp->start(); + + // call->setAudioStart ( true ); + + + } else { + delete call; + call = 0; + } + } + + return call; } bool -SIPVoIPLink::answer ( const CallID& id ) -{ - - int i; - SIPCall *call; - pj_status_t status; - pjsip_tx_data *tdata; - Sdp *local_sdp; - pjsip_inv_session *inv_session; - - _debug ( "SIPVoIPLink::answer: start answering \n" ); - - call = getSIPCall ( id ); - - if ( call==0 ) - { - _debug ( "! SIP Failure: SIPCall doesn't exists\n" ); - return false; - } - - local_sdp = call->getLocalSDP(); - inv_session = call->getInvSession(); - status = local_sdp->start_negociation (); - - if ( status == PJ_SUCCESS ) - { - _debug ( "SIPVoIPLink::answer:UserAgent: Negociation success! : call %s \n", call->getCallId().c_str() ); - // Create and send a 200(OK) response - status = pjsip_inv_answer ( inv_session, PJSIP_SC_OK, NULL, NULL, &tdata ); - PJ_ASSERT_RETURN ( status == PJ_SUCCESS, 1 ); - status = pjsip_inv_send_msg ( inv_session, tdata ); - PJ_ASSERT_RETURN ( status == PJ_SUCCESS, 1 ); - - // Start the RTP sessions - _debug ( "SIPVoIPLink::answer: Starting AudioRTP when answering : call %s \n", call->getCallId().c_str() ); - if ( _audiortp->createNewSession ( call ) >= 0 ) - { - call->setAudioStart ( true ); - call->setConnectionState ( Call::Connected ); - call->setState ( Call::Active ); - return true; - } - else - { - _debug ( "SIPVoIPLink::answer: Unable to start sound when answering %s/%d\n", __FILE__, __LINE__ ); - } - } - else - { - // Create and send a 488/Not acceptable here - // because the SDP negociation failed - status = pjsip_inv_answer ( inv_session, PJSIP_SC_NOT_ACCEPTABLE_HERE, NULL, NULL, - &tdata ); - PJ_ASSERT_RETURN ( status == PJ_SUCCESS, 1 ); - status = pjsip_inv_send_msg ( inv_session, tdata ); - PJ_ASSERT_RETURN ( status == PJ_SUCCESS, 1 ); - - // Terminate the call - _debug ( "SIPVoIPLink::answer: fail terminate call %s \n",call->getCallId().c_str() ); - terminateOneCall ( call->getCallId() ); - removeCall ( call->getCallId() ); - return false; - } +SIPVoIPLink::answer (const CallID& id) +{ + + int i; + SIPCall *call; + pj_status_t status; + pjsip_tx_data *tdata; + Sdp *local_sdp; + pjsip_inv_session *inv_session; + + _debug ("SIPVoIPLink::answer: start answering \n"); + + call = getSIPCall (id); + + if (call==0) { + _debug ("! SIP Failure: SIPCall doesn't exists\n"); + return false; + } + + local_sdp = call->getLocalSDP(); + + try { + _audiortp->createNewSession (call); + } catch (...) { + _debug ("Failed to create rtp thread from answer\n"); + } + + inv_session = call->getInvSession(); + + status = local_sdp->start_negociation (); + + if (status == PJ_SUCCESS) { + + _debug ("SIPVoIPLink::answer:UserAgent: Negociation success! : call %s \n", call->getCallId().c_str()); + // Create and send a 200(OK) response + status = pjsip_inv_answer (inv_session, PJSIP_SC_OK, NULL, NULL, &tdata); + PJ_ASSERT_RETURN (status == PJ_SUCCESS, 1); + status = pjsip_inv_send_msg (inv_session, tdata); + PJ_ASSERT_RETURN (status == PJ_SUCCESS, 1); + + call->setConnectionState (Call::Connected); + call->setState (Call::Active); + + ; + + return true; + } else { + // Create and send a 488/Not acceptable here + // because the SDP negociation failed + status = pjsip_inv_answer (inv_session, PJSIP_SC_NOT_ACCEPTABLE_HERE, NULL, NULL, + &tdata); + PJ_ASSERT_RETURN (status == PJ_SUCCESS, 1); + status = pjsip_inv_send_msg (inv_session, tdata); + PJ_ASSERT_RETURN (status == PJ_SUCCESS, 1); + + // Terminate the call + _debug ("SIPVoIPLink::answer: fail terminate call %s \n",call->getCallId().c_str()); + terminateOneCall (call->getCallId()); + removeCall (call->getCallId()); + return false; + } } bool -SIPVoIPLink::hangup ( const CallID& id ) +SIPVoIPLink::hangup (const CallID& id) { - pj_status_t status; - pjsip_tx_data *tdata = NULL; - SIPCall* call; + pj_status_t status; + pjsip_tx_data *tdata = NULL; + SIPCall* call; + + call = getSIPCall (id); - call = getSIPCall ( id ); + if (call==0) { + _debug ("! SIP Error: Call doesn't exist\n"); + return false; + } - if ( call==0 ) { _debug ( "! SIP Error: Call doesn't exist\n" ); return false; } + // User hangup current call. Notify peer + status = pjsip_inv_end_session (call->getInvSession(), 404, NULL, &tdata); - // User hangup current call. Notify peer - status = pjsip_inv_end_session ( call->getInvSession(), 404, NULL, &tdata ); - if ( status != PJ_SUCCESS ) - return false; + if (status != PJ_SUCCESS) + return false; - if ( tdata == NULL ) - return true; - // _debug("Some tdata info: %",); + if (tdata == NULL) + return true; + // _debug("Some tdata info: %",); - status = pjsip_inv_send_msg ( call->getInvSession(), tdata ); - if ( status != PJ_SUCCESS ) - return false; + status = pjsip_inv_send_msg (call->getInvSession(), tdata); + if (status != PJ_SUCCESS) + return false; - call->getInvSession()->mod_data[getModId() ] = NULL; + call->getInvSession()->mod_data[getModId() ] = NULL; - // Release RTP thread - if ( Manager::instance().isCurrentCall ( id ) ) - { - _debug ( "* SIP Info: Stopping AudioRTP for hangup\n" ); - _audiortp->closeRtpSession(); - } - terminateOneCall ( id ); - removeCall ( id ); + // Release RTP thread + if (Manager::instance().isCurrentCall (id)) { + _debug ("* SIP Info: Stopping AudioRTP for hangup\n"); + _audiortp->closeRtpSession(); + } - return true; + terminateOneCall (id); + + removeCall (id); + + return true; } bool -SIPVoIPLink::peerHungup ( const CallID& id ) +SIPVoIPLink::peerHungup (const CallID& id) { - pj_status_t status; - pjsip_tx_data *tdata = NULL; - SIPCall* call; + pj_status_t status; + pjsip_tx_data *tdata = NULL; + SIPCall* call; + + call = getSIPCall (id); + + if (call==0) { + _debug ("! SIP Error: Call doesn't exist\n"); + return false; + } - call = getSIPCall ( id ); + // User hangup current call. Notify peer + status = pjsip_inv_end_session (call->getInvSession(), 404, NULL, &tdata); - if ( call==0 ) { _debug ( "! SIP Error: Call doesn't exist\n" ); return false; } + if (status != PJ_SUCCESS) + return false; - // User hangup current call. Notify peer - status = pjsip_inv_end_session ( call->getInvSession(), 404, NULL, &tdata ); - if ( status != PJ_SUCCESS ) - return false; + if (tdata == NULL) + return true; - if ( tdata == NULL ) - return true; + status = pjsip_inv_send_msg (call->getInvSession(), tdata); - status = pjsip_inv_send_msg ( call->getInvSession(), tdata ); - if ( status != PJ_SUCCESS ) - return false; + if (status != PJ_SUCCESS) + return false; - call->getInvSession()->mod_data[getModId() ] = NULL; + call->getInvSession()->mod_data[getModId() ] = NULL; - // Release RTP thread - if ( Manager::instance().isCurrentCall ( id ) ) - { - _debug ( "* SIP Info: Stopping AudioRTP for hangup\n" ); - _audiortp->closeRtpSession(); - } + // Release RTP thread + if (Manager::instance().isCurrentCall (id)) { + _debug ("* SIP Info: Stopping AudioRTP for hangup\n"); + _audiortp->closeRtpSession(); + } - terminateOneCall ( id ); - removeCall ( id ); + terminateOneCall (id); - return true; + removeCall (id); + + return true; } bool -SIPVoIPLink::cancel ( const CallID& id ) +SIPVoIPLink::cancel (const CallID& id) { - SIPCall* call = getSIPCall ( id ); - if ( call==0 ) { _debug ( "! SIP Error: Call doesn't exist\n" ); return false; } + SIPCall* call = getSIPCall (id); + + if (call==0) { + _debug ("! SIP Error: Call doesn't exist\n"); + return false; + } - _debug ( "- SIP Action: Cancel call %s [cid: %3d]\n", id.data(), call->getCid() ); + _debug ("- SIP Action: Cancel call %s [cid: %3d]\n", id.data(), call->getCid()); - terminateOneCall ( id ); - removeCall ( id ); + terminateOneCall (id); + removeCall (id); - return true; + return true; } bool -SIPVoIPLink::onhold ( const CallID& id ) +SIPVoIPLink::onhold (const CallID& id) { - pj_status_t status; - SIPCall* call; + pj_status_t status; + SIPCall* call; + + call = getSIPCall (id); + + if (call==0) { + _debug ("! SIP Error: call doesn't exist\n"); + return false; + } - call = getSIPCall ( id ); - if ( call==0 ) { _debug ( "! SIP Error: call doesn't exist\n" ); return false; } + // Stop sound + call->setAudioStart (false); + call->setState (Call::Hold); - // Stop sound - call->setAudioStart ( false ); - call->setState ( Call::Hold ); - _debug ( "* SIP Info: Stopping AudioRTP for onhold action\n" ); - _audiortp->closeRtpSession(); + _debug ("* SIP Info: Stopping AudioRTP for onhold action\n"); - /* Create re-INVITE with new offer */ - status = inv_session_reinvite ( call, "sendonly" ); - if ( status != PJ_SUCCESS ) - return false; + _audiortp->closeRtpSession(); - return true; + /* Create re-INVITE with new offer */ + status = inv_session_reinvite (call, "sendonly"); + + if (status != PJ_SUCCESS) + return false; + + return true; } -int SIPVoIPLink::inv_session_reinvite ( SIPCall *call, std::string direction ) +int SIPVoIPLink::inv_session_reinvite (SIPCall *call, std::string direction) { - pj_status_t status; - pjsip_tx_data *tdata; - pjmedia_sdp_session *local_sdp; - pjmedia_sdp_attr *attr; + pj_status_t status; + pjsip_tx_data *tdata; + pjmedia_sdp_session *local_sdp; + pjmedia_sdp_attr *attr; + + local_sdp = call->getLocalSDP()->get_local_sdp_session(); + + if (local_sdp == NULL) { + _debug ("! SIP Failure: unable to find local_sdp\n"); + return !PJ_SUCCESS; + } - local_sdp = call->getLocalSDP()->get_local_sdp_session(); + // reinvite only if connected + // Build the local SDP offer + status = call->getLocalSDP()->create_initial_offer(); - if ( local_sdp == NULL ) - { - _debug ( "! SIP Failure: unable to find local_sdp\n" ); - return !PJ_SUCCESS; - } + if (status != PJ_SUCCESS) + return 1; // !PJ_SUCCESS - // reinvite only if connected - // Build the local SDP offer - status = call->getLocalSDP()->create_initial_offer( ); - if ( status != PJ_SUCCESS ) - return 1; // !PJ_SUCCESS + pjmedia_sdp_media_remove_all_attr (local_sdp->media[0], "sendrecv"); - pjmedia_sdp_media_remove_all_attr ( local_sdp->media[0], "sendrecv" ); - attr = pjmedia_sdp_attr_create ( _pool, direction.c_str(), NULL ); - pjmedia_sdp_media_add_attr ( local_sdp->media[0], attr ); + attr = pjmedia_sdp_attr_create (_pool, direction.c_str(), NULL); - // Build the reinvite request - status = pjsip_inv_reinvite ( call->getInvSession(), NULL, - local_sdp, &tdata ); - if ( status != PJ_SUCCESS ) - return 1; // !PJ_SUCCESS + pjmedia_sdp_media_add_attr (local_sdp->media[0], attr); - // Send it - status = pjsip_inv_send_msg ( call->getInvSession(), tdata ); - if ( status != PJ_SUCCESS ) - return 1; // !PJ_SUCCESS + // Build the reinvite request - return PJ_SUCCESS; + status = pjsip_inv_reinvite (call->getInvSession(), NULL, + local_sdp, &tdata); + + if (status != PJ_SUCCESS) + return 1; // !PJ_SUCCESS + + // Send it + status = pjsip_inv_send_msg (call->getInvSession(), tdata); + + if (status != PJ_SUCCESS) + return 1; // !PJ_SUCCESS + + return PJ_SUCCESS; } bool -SIPVoIPLink::offhold ( const CallID& id ) +SIPVoIPLink::offhold (const CallID& id) { - SIPCall *call; - pj_status_t status; + SIPCall *call; + pj_status_t status; + + call = getSIPCall (id); + + if (call==0) { + _debug ("! SIP Error: Call doesn't exist\n"); + return false; + } + + try { + _audiortp->createNewSession (call); + } catch (...) { + _debug ("! SIP Failure: Unable to create RTP Session (%s:%d)\n", __FILE__, __LINE__); + } + + /* Create re-INVITE with new offer */ + status = inv_session_reinvite (call, "sendrecv"); - call = getSIPCall ( id ); + if (status != PJ_SUCCESS) + return false; - if ( call==0 ) - { - _debug ( "! SIP Error: Call doesn't exist\n" ); - return false; - } + // Enable audio + _debug ("* SIP Info: Starting AudioRTP when offhold\n"); - /* Create re-INVITE with new offer */ - status = inv_session_reinvite ( call, "sendrecv" ); - if ( status != PJ_SUCCESS ) - return false; + call->setState (Call::Active); - // Enable audio - _debug ( "* SIP Info: Starting AudioRTP when offhold\n" ); - call->setState ( Call::Active ); - // it's sure that this is the current call id... - if ( _audiortp->createNewSession ( call ) < 0 ) - { - _debug ( "! SIP Failure: Unable to start sound (%s:%d)\n", __FILE__, __LINE__ ); - return false; - } + // it's sure that this is the current call id... - return true; + _audiortp->start(); + + call->setAudioStart (true); + + return true; } bool -SIPVoIPLink::transfer ( const CallID& id, const std::string& to ) -{ - - SIPCall *call; - std::string tmp_to; - pjsip_evsub *sub; - pjsip_tx_data *tdata; - struct pjsip_evsub_user xfer_cb; - pj_status_t status; - pj_str_t dest; - AccountID account_id; - Account* account; - - call = getSIPCall ( id ); - call->stopRecording(); - account_id = Manager::instance().getAccountFromCall ( id ); - account = dynamic_cast<SIPAccount *> ( Manager::instance().getAccount ( account_id ) ); - - if ( call==0 ) - { - _debug ( "! SIP Failure: Call doesn't exist\n" ); - return false; - } - - tmp_to = SIPToHeader ( to ); - if ( account ) - { - if ( tmp_to.find ( "@" ) == std::string::npos ) - { - tmp_to = tmp_to + "@" + account->getHostname(); - } - } - - else - { - - } - - _debug ( "In transfer, tmp_to is %s\n", tmp_to.data() ); - - pj_strdup2 ( _pool, &dest, tmp_to.data() ); - - /* Create xfer client subscription. */ - pj_bzero ( &xfer_cb, sizeof ( xfer_cb ) ); - xfer_cb.on_evsub_state = &xfer_func_cb; - - status = pjsip_xfer_create_uac ( call->getInvSession()->dlg, &xfer_cb, &sub ); - if ( status != PJ_SUCCESS ) - { - _debug ( "UserAgent: Unable to create xfer -- %d\n", status ); - return false; - } - - /* Associate this voiplink of call with the client subscription - * We can not just associate call with the client subscription - * because after this function, we can not find the cooresponding - * voiplink from the call any more. But the voiplink is useful! - */ - pjsip_evsub_set_mod_data ( sub, getModId(), this ); - - _debug ( "SIP port listener = %i ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++", _localExternPort ); - - /* - * Create REFER request. - */ - status = pjsip_xfer_initiate ( sub, &dest, &tdata ); - if ( status != PJ_SUCCESS ) - { - _debug ( "UserAgent: Unable to create REFER request -- %d\n", status ); - return false; - } - - /* Send. */ - status = pjsip_xfer_send_request ( sub, tdata ); - if ( status != PJ_SUCCESS ) - { - _debug ( "UserAgent: Unable to send REFER request -- %d\n", status ); - return false; - } - - return true; +SIPVoIPLink::transfer (const CallID& id, const std::string& to) +{ + + SIPCall *call; + std::string tmp_to; + pjsip_evsub *sub; + pjsip_tx_data *tdata; + + struct pjsip_evsub_user xfer_cb; + pj_status_t status; + pj_str_t dest; + AccountID account_id; + Account* account; + + call = getSIPCall (id); + call->stopRecording(); + account_id = Manager::instance().getAccountFromCall (id); + account = dynamic_cast<SIPAccount *> (Manager::instance().getAccount (account_id)); + + if (call==0) { + _debug ("! SIP Failure: Call doesn't exist\n"); + return false; + } + + tmp_to = SIPToHeader (to); + + if (account) { + if (tmp_to.find ("@") == std::string::npos) { + tmp_to = tmp_to + "@" + account->getHostname(); + } + } + + else { + + } + + _debug ("In transfer, tmp_to is %s\n", tmp_to.data()); + + pj_strdup2 (_pool, &dest, tmp_to.data()); + + /* Create xfer client subscription. */ + pj_bzero (&xfer_cb, sizeof (xfer_cb)); + xfer_cb.on_evsub_state = &xfer_func_cb; + + status = pjsip_xfer_create_uac (call->getInvSession()->dlg, &xfer_cb, &sub); + + if (status != PJ_SUCCESS) { + _debug ("UserAgent: Unable to create xfer -- %d\n", status); + return false; + } + + /* Associate this voiplink of call with the client subscription + * We can not just associate call with the client subscription + * because after this function, we can not find the cooresponding + * voiplink from the call any more. But the voiplink is useful! + */ + pjsip_evsub_set_mod_data (sub, getModId(), this); + + _debug ("SIP port listener = %i ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++", _localExternPort); + + /* + * Create REFER request. + */ + status = pjsip_xfer_initiate (sub, &dest, &tdata); + + if (status != PJ_SUCCESS) { + _debug ("UserAgent: Unable to create REFER request -- %d\n", status); + return false; + } + + /* Send. */ + status = pjsip_xfer_send_request (sub, tdata); + + if (status != PJ_SUCCESS) { + _debug ("UserAgent: Unable to send REFER request -- %d\n", status); + return false; + } + + return true; } bool SIPVoIPLink::transferStep2() { - _audiortp->closeRtpSession(); - return true; + _audiortp->closeRtpSession(); + return true; } bool -SIPVoIPLink::refuse ( const CallID& id ) +SIPVoIPLink::refuse (const CallID& id) { - SIPCall *call; - pj_status_t status; - pjsip_tx_data *tdata; + SIPCall *call; + pj_status_t status; + pjsip_tx_data *tdata; + + call = getSIPCall (id); - call = getSIPCall ( id ); + if (call==0) { + _debug ("Call doesn't exist\n"); + return false; + } - if ( call==0 ) - { - _debug ( "Call doesn't exist\n" ); - return false; - } + // can't refuse outgoing call or connected + if (!call->isIncoming() || call->getConnectionState() == Call::Connected) { + _debug ("It's not an incoming call, or it's already answered\n"); + return false; + } - // can't refuse outgoing call or connected - if ( !call->isIncoming() || call->getConnectionState() == Call::Connected ) - { - _debug ( "It's not an incoming call, or it's already answered\n" ); - return false; - } + // User refuse current call. Notify peer + status = pjsip_inv_end_session (call->getInvSession(), PJSIP_SC_DECLINE, NULL, &tdata); //603 - // User refuse current call. Notify peer - status = pjsip_inv_end_session ( call->getInvSession(), PJSIP_SC_DECLINE, NULL, &tdata ); //603 - if ( status != PJ_SUCCESS ) - return false; + if (status != PJ_SUCCESS) + return false; - status = pjsip_inv_send_msg ( call->getInvSession(), tdata ); - if ( status != PJ_SUCCESS ) - return false; + status = pjsip_inv_send_msg (call->getInvSession(), tdata); - call->getInvSession()->mod_data[getModId() ] = NULL; + if (status != PJ_SUCCESS) + return false; - terminateOneCall ( id ); - return true; + call->getInvSession()->mod_data[getModId() ] = NULL; + + terminateOneCall (id); + + return true; } void -SIPVoIPLink::setRecording ( const CallID& id ) +SIPVoIPLink::setRecording (const CallID& id) { - SIPCall* call = getSIPCall ( id ); + SIPCall* call = getSIPCall (id); - if ( call ) - call->setRecording(); + if (call) + call->setRecording(); - // _audiortp->setRecording(); + // _audiortp->setRecording(); } bool -SIPVoIPLink::isRecording ( const CallID& id ) +SIPVoIPLink::isRecording (const CallID& id) { - SIPCall* call = getSIPCall ( id ); - _debug ( "call->isRecording() %i \n",call->isRecording() ); - if ( call ) - return call->isRecording(); - else - return false; + SIPCall* call = getSIPCall (id); + _debug ("call->isRecording() %i \n",call->isRecording()); + + if (call) + return call->isRecording(); + else + return false; } @@ -947,1999 +1010,2060 @@ std::string SIPVoIPLink::getCurrentCodecName() { - SIPCall *call; - AudioCodec *ac = NULL; - std::string name = ""; + SIPCall *call; + AudioCodec *ac = NULL; + std::string name = ""; + + call = getSIPCall (Manager::instance().getCurrentCallId()); - call = getSIPCall ( Manager::instance().getCurrentCallId() ); - if ( call ) - ac = call->getLocalSDP()->get_session_media(); + if (call) + ac = call->getLocalSDP()->get_session_media(); - if ( ac ) - name = ac->getCodecName(); + if (ac) + name = ac->getCodecName(); - return name; + return name; } bool -SIPVoIPLink::carryingDTMFdigits ( const CallID& id, char code ) -{ - - SIPCall *call; - int duration; - const int body_len = 1000; - char *dtmf_body; - pj_status_t status; - pjsip_tx_data *tdata; - pj_str_t methodName, content; - pjsip_method method; - pjsip_media_type ctype; - - call = getSIPCall ( id ); - - if ( call==0 ) - { - _debug ( "Call doesn't exist\n" ); - return false; - } - - duration = Manager::instance().getConfigInt ( SIGNALISATION, PULSE_LENGTH ); - dtmf_body = new char[body_len]; - - snprintf ( dtmf_body, body_len - 1, "Signal=%c\r\nDuration=%d\r\n", code, duration ); - - pj_strdup2 ( _pool, &methodName, "INFO" ); - pjsip_method_init_np ( &method, &methodName ); - - /* Create request message. */ - status = pjsip_dlg_create_request ( call->getInvSession()->dlg, &method, -1, &tdata ); - if ( status != PJ_SUCCESS ) - { - _debug ( "UserAgent: Unable to create INFO request -- %d\n", status ); - return false; - } - - /* Get MIME type */ - pj_strdup2 ( _pool, &ctype.type, "application" ); - pj_strdup2 ( _pool, &ctype.subtype, "dtmf-relay" ); - - /* Create "application/dtmf-relay" message body. */ - pj_strdup2 ( _pool, &content, dtmf_body ); - tdata->msg->body = pjsip_msg_body_create ( tdata->pool, &ctype.type, &ctype.subtype, &content ); - if ( tdata->msg->body == NULL ) - { - _debug ( "UserAgent: Unable to create msg body!\n" ); - pjsip_tx_data_dec_ref ( tdata ); - return false; - } - - /* Send the request. */ - status = pjsip_dlg_send_request ( call->getInvSession()->dlg, tdata, getModId(), NULL ); - if ( status != PJ_SUCCESS ) - { - _debug ( "UserAgent: Unable to send MESSAGE request -- %d\n", status ); - return false; - } - - return true; +SIPVoIPLink::carryingDTMFdigits (const CallID& id, char code) +{ + + SIPCall *call; + int duration; + const int body_len = 1000; + char *dtmf_body; + pj_status_t status; + pjsip_tx_data *tdata; + pj_str_t methodName, content; + pjsip_method method; + pjsip_media_type ctype; + + call = getSIPCall (id); + + if (call==0) { + _debug ("Call doesn't exist\n"); + return false; + } + + duration = Manager::instance().getConfigInt (SIGNALISATION, PULSE_LENGTH); + + dtmf_body = new char[body_len]; + + snprintf (dtmf_body, body_len - 1, "Signal=%c\r\nDuration=%d\r\n", code, duration); + + pj_strdup2 (_pool, &methodName, "INFO"); + pjsip_method_init_np (&method, &methodName); + + /* Create request message. */ + status = pjsip_dlg_create_request (call->getInvSession()->dlg, &method, -1, &tdata); + + if (status != PJ_SUCCESS) { + _debug ("UserAgent: Unable to create INFO request -- %d\n", status); + return false; + } + + /* Get MIME type */ + pj_strdup2 (_pool, &ctype.type, "application"); + + pj_strdup2 (_pool, &ctype.subtype, "dtmf-relay"); + + /* Create "application/dtmf-relay" message body. */ + pj_strdup2 (_pool, &content, dtmf_body); + + tdata->msg->body = pjsip_msg_body_create (tdata->pool, &ctype.type, &ctype.subtype, &content); + + if (tdata->msg->body == NULL) { + _debug ("UserAgent: Unable to create msg body!\n"); + pjsip_tx_data_dec_ref (tdata); + return false; + } + + /* Send the request. */ + status = pjsip_dlg_send_request (call->getInvSession()->dlg, tdata, getModId(), NULL); + + if (status != PJ_SUCCESS) { + _debug ("UserAgent: Unable to send MESSAGE request -- %d\n", status); + return false; + } + + return true; } bool -SIPVoIPLink::SIPOutgoingInvite ( SIPCall* call ) +SIPVoIPLink::SIPOutgoingInvite (SIPCall* call) { - // If no SIP proxy setting for direct call with only IP address - if ( !SIPStartCall ( call, "" ) ) - { - _debug ( "! SIP Failure: call not started\n" ); - return false; - } - return true; + // If no SIP proxy setting for direct call with only IP address + if (!SIPStartCall (call, "")) { + _debug ("! SIP Failure: call not started\n"); + return false; + } + + return true; } bool -SIPVoIPLink::SIPStartCall ( SIPCall* call, const std::string& subject UNUSED ) +SIPVoIPLink::SIPStartCall (SIPCall* call, const std::string& subject UNUSED) { - std::string strTo, strFrom; - pj_status_t status; - pjsip_dialog *dialog; - pjsip_tx_data *tdata; - pj_str_t from, to, contact; - AccountID id; - SIPAccount *account; - pjsip_inv_session *inv; + std::string strTo, strFrom; + pj_status_t status; + pjsip_dialog *dialog; + pjsip_tx_data *tdata; + pj_str_t from, to, contact; + AccountID id; + SIPAccount *account; + pjsip_inv_session *inv; + + if (!call) + return false; + + id = Manager::instance().getAccountFromCall (call->getCallId()); + + // Get the basic information about the callee account + account = dynamic_cast<SIPAccount *> (Manager::instance().getAccount (id)); + + strTo = getSipTo (call->getPeerNumber(), account->getHostname()); + + _debug (" To: %s\n", strTo.data()); + + // Generate the from URI + strFrom = "sip:" + account->getUsername() + "@" + account->getHostname(); + + _debug (" From: %s\n", strFrom.c_str()); + + // pjsip need the from and to information in pj_str_t format + pj_strdup2 (_pool, &from, strFrom.data()); + + pj_strdup2 (_pool, &to, strTo.data()); - if ( !call ) - return false; + pj_strdup2 (_pool, &contact, account->getContact().data()); - id = Manager::instance().getAccountFromCall ( call->getCallId() ); - // Get the basic information about the callee account - account = dynamic_cast<SIPAccount *> ( Manager::instance().getAccount ( id ) ); + //_debug("%s %s %s\n", from.ptr, contact.ptr, to.ptr); + // create the dialog (UAC) + status = pjsip_dlg_create_uac (pjsip_ua_instance(), &from, + &contact, + &to, + NULL, + &dialog); - strTo = getSipTo ( call->getPeerNumber(), account->getHostname() ); - _debug ( " To: %s\n", strTo.data() ); + if (status != PJ_SUCCESS) { + _debug ("UAC creation failed\n"); + return false; + } - // Generate the from URI - strFrom = "sip:" + account->getUsername() + "@" + account->getHostname(); + // Create the invite session for this call + status = pjsip_inv_create_uac (dialog, call->getLocalSDP()->get_local_sdp_session(), 0, &inv); - // pjsip need the from and to information in pj_str_t format - pj_strdup2 ( _pool, &from, strFrom.data() ); - pj_strdup2 ( _pool, &to, strTo.data() ); - pj_strdup2 ( _pool, &contact, account->getContact().data() ); + PJ_ASSERT_RETURN (status == PJ_SUCCESS, false); - //_debug("%s %s %s\n", from.ptr, contact.ptr, to.ptr); - // create the dialog (UAC) - status = pjsip_dlg_create_uac ( pjsip_ua_instance(), &from, - &contact, - &to, - NULL, - &dialog ); - if ( status != PJ_SUCCESS ) - { - _debug ( "UAC creation failed\n" ); - return false; - } + // Set auth information + pjsip_auth_clt_set_credentials (&dialog->auth_sess, 1, account->getCredInfo()); - // Create the invite session for this call - status = pjsip_inv_create_uac ( dialog, call->getLocalSDP()->get_local_sdp_session(), 0, &inv ); - PJ_ASSERT_RETURN ( status == PJ_SUCCESS, false ); + // Associate current call in the invite session + inv->mod_data[getModId() ] = call; - // Set auth information - pjsip_auth_clt_set_credentials ( &dialog->auth_sess, 1, account->getCredInfo() ); + status = pjsip_inv_invite (inv, &tdata); - // Associate current call in the invite session - inv->mod_data[getModId() ] = call; + PJ_ASSERT_RETURN (status == PJ_SUCCESS, false); - status = pjsip_inv_invite ( inv, &tdata ); - PJ_ASSERT_RETURN ( status == PJ_SUCCESS, false ); + // Associate current invite session in the call + call->setInvSession (inv); - // Associate current invite session in the call - call->setInvSession ( inv ); + status = pjsip_inv_send_msg (inv, tdata); - status = pjsip_inv_send_msg ( inv, tdata ); - if ( status != PJ_SUCCESS ) - { - return false; - } + if (status != PJ_SUCCESS) { + return false; + } - return true; + return true; } -std::string SIPVoIPLink::getSipTo ( const std::string& to_url, std::string hostname ) +std::string SIPVoIPLink::getSipTo (const std::string& to_url, std::string hostname) { - // Form the From header field basis on configuration panel - //bool isRegistered = (_eXosipRegID == EXOSIP_ERROR_STD) ? false : true; + // Form the From header field basis on configuration panel + //bool isRegistered = (_eXosipRegID == EXOSIP_ERROR_STD) ? false : true; - // add a @host if we are registered and there is no one inside the url - if ( to_url.find ( "@" ) == std::string::npos ) // && isRegistered) { - { - if ( !hostname.empty() ) - { - return SIPToHeader ( to_url + "@" + hostname ); - } - } - return SIPToHeader ( to_url ); + // add a @host if we are registered and there is no one inside the url + if (to_url.find ("@") == std::string::npos) { // && isRegistered) { + if (!hostname.empty()) { + return SIPToHeader (to_url + "@" + hostname); + } + } + + return SIPToHeader (to_url); } -std::string SIPVoIPLink::SIPToHeader ( const std::string& to ) +std::string SIPVoIPLink::SIPToHeader (const std::string& to) { - if ( to.find ( "sip:" ) == std::string::npos ) - { - return ( "sip:" + to ); - } - else - { - return to; - } + if (to.find ("sip:") == std::string::npos) { + return ("sip:" + to); + } else { + return to; + } } bool -SIPVoIPLink::SIPCheckUrl ( const std::string& url UNUSED ) +SIPVoIPLink::SIPCheckUrl (const std::string& url UNUSED) { - return true; + return true; } void -SIPVoIPLink::SIPCallServerFailure ( SIPCall *call ) -{ - //if (!event->response) { return; } - //switch(event->response->status_code) { - //case SIP_SERVICE_UNAVAILABLE: // 500 - //case SIP_BUSY_EVRYWHERE: // 600 - //case SIP_DECLINE: // 603 - //SIPCall* call = findSIPCallWithCid(event->cid); - if ( call != 0 ) - { - _debug ( "Server error!\n" ); - CallID id = call->getCallId(); - Manager::instance().callFailure ( id ); - terminateOneCall ( id ); - removeCall ( id ); - } - //break; - //} +SIPVoIPLink::SIPCallServerFailure (SIPCall *call) +{ + //if (!event->response) { return; } + //switch(event->response->status_code) { + //case SIP_SERVICE_UNAVAILABLE: // 500 + //case SIP_BUSY_EVRYWHERE: // 600 + //case SIP_DECLINE: // 603 + //SIPCall* call = findSIPCallWithCid(event->cid); + if (call != 0) { + _debug ("Server error!\n"); + CallID id = call->getCallId(); + Manager::instance().callFailure (id); + terminateOneCall (id); + removeCall (id); + } + + //break; + //} } void -SIPVoIPLink::SIPCallClosed ( SIPCall *call ) +SIPVoIPLink::SIPCallClosed (SIPCall *call) { - // it was without did before - //SIPCall* call = findSIPCallWithCid(event->cid); - if ( !call ) { return; } + // it was without did before + //SIPCall* call = findSIPCallWithCid(event->cid); + if (!call) { + return; + } + + CallID id = call->getCallId(); + + //call->setDid(event->did); + + if (Manager::instance().isCurrentCall (id)) { + call->setAudioStart (false); + _debug ("* SIP Info: Stopping AudioRTP when closing\n"); + _audiortp->closeRtpSession(); + } - CallID id = call->getCallId(); - //call->setDid(event->did); - if ( Manager::instance().isCurrentCall ( id ) ) - { - call->setAudioStart ( false ); - _debug ( "* SIP Info: Stopping AudioRTP when closing\n" ); - _audiortp->closeRtpSession(); - } - _debug ( "After close RTP\n" ); - Manager::instance().peerHungupCall ( id ); - terminateOneCall ( id ); - removeCall ( id ); - _debug ( "After remove call ID\n" ); + _debug ("After close RTP\n"); + + Manager::instance().peerHungupCall (id); + terminateOneCall (id); + removeCall (id); + _debug ("After remove call ID\n"); } void -SIPVoIPLink::SIPCallReleased ( SIPCall *call ) +SIPVoIPLink::SIPCallReleased (SIPCall *call) { - // do cleanup if exists - // only cid because did is always 0 in these case.. - //SIPCall* call = findSIPCallWithCid(event->cid); - if ( !call ) { return; } + // do cleanup if exists + // only cid because did is always 0 in these case.. + //SIPCall* call = findSIPCallWithCid(event->cid); + if (!call) { + return; + } + + // if we are here.. something when wrong before... + _debug ("SIP call release\n"); + + CallID id = call->getCallId(); + + Manager::instance().callFailure (id); - // if we are here.. something when wrong before... - _debug ( "SIP call release\n" ); - CallID id = call->getCallId(); - Manager::instance().callFailure ( id ); - terminateOneCall ( id ); - removeCall ( id ); + terminateOneCall (id); + + removeCall (id); } void -SIPVoIPLink::SIPCallAnswered ( SIPCall *call, pjsip_rx_data *rdata ) -{ - - pjmedia_sdp_session *r_sdp; - - if ( !call ) - { - _debug ( "! SIP Failure: unknown call\n" ); - return; - } - - if ( call->getConnectionState() != Call::Connected ) - { - _debug ( "Get remote SDP from offer\n" ); - get_remote_sdp_from_offer ( rdata, &r_sdp ); - if ( r_sdp==NULL ) - { - _debug ( "SIP Failure: no remote sdp session\n" ); - return; - } - _debug ( "Get remote media information from offer\n" ); - call->getLocalSDP()->fetch_media_transport_info_from_remote_sdp ( r_sdp ); - - _debug ( "Update call state , id = %s\n", call->getCallId().c_str() ); - call->setConnectionState ( Call::Connected ); - call->setState ( Call::Active ); - - Manager::instance().peerAnsweredCall ( call->getCallId() ); - if ( Manager::instance().isCurrentCall ( call->getCallId() ) ) - { - _debug ( "* SIP Info: Starting AudioRTP when answering\n" ); - if ( _audiortp->createNewSession ( call ) < 0 ) - { - _debug ( "RTP Failure: unable to create new session\n" ); - } - else - { - call->setAudioStart ( true ); - } - } - } - else - { - _debug ( "* SIP Info: Answering call (on/off hold to send ACK)\n" ); - } +SIPVoIPLink::SIPCallAnswered (SIPCall *call, pjsip_rx_data *rdata) +{ + + _debug ("SIPCallAnswered\n"); + + pjmedia_sdp_session *r_sdp; + + if (!call) { + _debug ("! SIP Failure: unknown call\n"); + return; + } + + if (call->getConnectionState() != Call::Connected) { + _debug ("Get remote SDP from offer\n"); + get_remote_sdp_from_offer (rdata, &r_sdp); + + if (r_sdp==NULL) { + _debug ("SIP Failure: no remote sdp session\n"); + return; + } + + _debug ("Get remote media information from offer\n"); + + call->getLocalSDP()->fetch_media_transport_info_from_remote_sdp (r_sdp); + + // _audiortp->getRTX()->setRtpSessionRemoteIp(); + + _debug ("Update call state , id = %s\n", call->getCallId().c_str()); + call->setConnectionState (Call::Connected); + call->setState (Call::Active); + + Manager::instance().peerAnsweredCall (call->getCallId()); + + if (Manager::instance().isCurrentCall (call->getCallId())) { + /* + _debug("CREATE NEW RTP SESSION FROM SIPCALLANSWERED\n"); + try { + _audiortp->createNewSession (call); + call->setAudioStart(true); + } catch (...) { + _debug("Failed to create rtp thread from answer\n"); + } + */ + + call->setAudioStart (true); + + _audiortp->start(); + + } + + } else { + _debug ("* SIP Info: Answering call (on/off hold to send ACK)\n"); + } } SIPCall* -SIPVoIPLink::getSIPCall ( const CallID& id ) +SIPVoIPLink::getSIPCall (const CallID& id) { - Call* call = getCall ( id ); - if ( call ) - { - return dynamic_cast<SIPCall*> ( call ); - } - return NULL; + Call* call = getCall (id); + + if (call) { + return dynamic_cast<SIPCall*> (call); + } + + return NULL; } -void SIPVoIPLink::setStunServer ( const std::string &server ) +void SIPVoIPLink::setStunServer (const std::string &server) { - if ( server != "" ) - { + if (server != "") { - useStun ( true ); - _stunServer = server; - } - else - { - useStun ( false ); - _stunServer = std::string ( "" ); - } + useStun (true); + _stunServer = server; + } else { + useStun (false); + _stunServer = std::string (""); + } } -bool SIPVoIPLink::new_ip_to_ip_call ( const CallID& id, const std::string& to ) +bool SIPVoIPLink::new_ip_to_ip_call (const CallID& id, const std::string& to) { - SIPCall *call; - pj_status_t status; - std::string uri_from, uri_to, hostname; - std::ostringstream uri_contact; - pj_str_t from, str_to, contact; - pjsip_dialog *dialog; - pjsip_inv_session *inv; - pjsip_tx_data *tdata; + SIPCall *call; + pj_status_t status; + std::string uri_from, uri_to, hostname; + std::ostringstream uri_contact; + pj_str_t from, str_to, contact; + pjsip_dialog *dialog; + pjsip_inv_session *inv; + pjsip_tx_data *tdata; - /* Create the call */ - call = new SIPCall ( id, Call::Outgoing, _pool ); + /* Create the call */ + call = new SIPCall (id, Call::Outgoing, _pool); - if ( call ) - { + if (call) { - call->setCallConfiguration ( Call::IPtoIP ); - call->setPeerNumber ( getSipTo ( to, getLocalIPAddress() ) ); + call->setCallConfiguration (Call::IPtoIP); + call->setPeerNumber (getSipTo (to, getLocalIPAddress())); - // Generate the from URI - hostname = pj_gethostname()->ptr; - uri_from = "sip:" + hostname + "@" + getLocalIPAddress() ; + // Generate the from URI + hostname = pj_gethostname()->ptr; + uri_from = "sip:" + hostname + "@" + getLocalIPAddress() ; - // Generate the from URI - uri_to = "sip:" + to.substr ( 4, to.length() ); + // Generate the from URI + uri_to = "sip:" + to.substr (4, to.length()); - _debug ( "get local ip address: %s \n", getLocalIPAddress().c_str() ); - // Generate the to URI - setCallAudioLocal ( call, getLocalIPAddress(), useStun(), getStunServer() ); + _debug ("get local ip address: %s \n", getLocalIPAddress().c_str()); + // Generate the to URI + setCallAudioLocal (call, getLocalIPAddress(), useStun(), getStunServer()); - call->initRecFileName(); + call->initRecFileName(); - // Building the local SDP offer - call->getLocalSDP()->set_ip_address ( getLocalIP() ); - call->getLocalSDP()->create_initial_offer(); + // Building the local SDP offer + call->getLocalSDP()->set_ip_address (getLocalIP()); + call->getLocalSDP()->create_initial_offer(); - // Generate the contact URI - // uri_contact << "<" << uri_from << ":" << call->getLocalSDP()->get_local_extern_audio_port() << ">"; - uri_contact << "<" << uri_from << ":" << _localExternPort << ">"; + try { + _audiortp->createNewSession (call); + } catch (...) { + _debug ("! SIP Failure: Unable to create RTP Session in SIPVoIPLink::new_ip_to_ip_call (%s:%d)\n", __FILE__, __LINE__); + } - // pjsip need the from and to information in pj_str_t format - pj_strdup2 ( _pool, &from, uri_from.data() ); - pj_strdup2 ( _pool, &str_to, uri_to.data() ); - pj_strdup2 ( _pool, &contact, uri_contact.str().data() ); - // create the dialog (UAC) - status = pjsip_dlg_create_uac ( pjsip_ua_instance(), &from, &contact, &str_to, NULL, &dialog ); - PJ_ASSERT_RETURN ( status == PJ_SUCCESS, false ); + // Generate the contact URI + // uri_contact << "<" << uri_from << ":" << call->getLocalSDP()->get_local_extern_audio_port() << ">"; + uri_contact << "<" << uri_from << ":" << _localExternPort << ">"; - // Create the invite session for this call - status = pjsip_inv_create_uac ( dialog, call->getLocalSDP()->get_local_sdp_session(), 0, &inv ); - PJ_ASSERT_RETURN ( status == PJ_SUCCESS, false ); + // pjsip need the from and to information in pj_str_t format + pj_strdup2 (_pool, &from, uri_from.data()); - // Associate current call in the invite session - inv->mod_data[getModId() ] = call; + pj_strdup2 (_pool, &str_to, uri_to.data()); - status = pjsip_inv_invite ( inv, &tdata ); - PJ_ASSERT_RETURN ( status == PJ_SUCCESS, false ); + pj_strdup2 (_pool, &contact, uri_contact.str().data()); - // Associate current invite session in the call - call->setInvSession ( inv ); + // create the dialog (UAC) + status = pjsip_dlg_create_uac (pjsip_ua_instance(), &from, &contact, &str_to, NULL, &dialog); - status = pjsip_inv_send_msg ( inv, tdata ); - if ( status != PJ_SUCCESS ) - { - delete call; call = 0; - return false; - } + PJ_ASSERT_RETURN (status == PJ_SUCCESS, false); - call->setConnectionState ( Call::Progressing ); - call->setState ( Call::Active ); - addCall ( call ); + // Create the invite session for this call + status = pjsip_inv_create_uac (dialog, call->getLocalSDP()->get_local_sdp_session(), 0, &inv); - return true; - } - else - return false; -} + PJ_ASSERT_RETURN (status == PJ_SUCCESS, false); + // Associate current call in the invite session + inv->mod_data[getModId() ] = call; -/////////////////////////////////////////////////////////////////////////////// -// Private functions -/////////////////////////////////////////////////////////////////////////////// + status = pjsip_inv_invite (inv, &tdata); + PJ_ASSERT_RETURN (status == PJ_SUCCESS, false); -bool get_dns_server_addresses ( std::vector<std::string> *servers ) -{ + // Associate current invite session in the call + call->setInvSession (inv); - int server_count, i; - std::vector<std::string> nameservers; - struct sockaddr_in current_server; - in_addr address; + status = pjsip_inv_send_msg (inv, tdata); - // Read configuration files - if ( res_init () != 0 ) - { - _debug ( "Resolver initialization failed\n" ); - return false; - } + if (status != PJ_SUCCESS) { + delete call; + call = 0; + return false; + } - server_count = _res.nscount; - for ( i=0; i<server_count; i++ ) - { - current_server = ( struct sockaddr_in ) _res.nsaddr_list[i]; - address = current_server.sin_addr; - nameservers.push_back ( inet_ntoa ( address ) ); - } + call->setConnectionState (Call::Progressing); - //nameservers.push_back ("192.168.50.3"); - *servers = nameservers; + call->setState (Call::Active); + addCall (call); - return true; -} + // _audiortp->start(); -pj_status_t SIPVoIPLink::enable_dns_srv_resolver ( pjsip_endpoint *endpt, pj_dns_resolver **p_resv ) -{ + // call->setAudioStart ( true ); - pj_status_t status; - pj_dns_resolver *resv; - std::vector <std::string> dns_servers; - pj_uint16_t port = 5353; - pjsip_resolver_t *res; - int scount, i; + return true; + } else + return false; +} - // Create the DNS resolver instance - status = pjsip_endpt_create_resolver ( endpt, &resv ); - if ( status != PJ_SUCCESS ) - { - _debug ( "Error creating the DNS resolver instance\n" ); - return status; - } - if ( !get_dns_server_addresses ( &dns_servers ) ) - { - _debug ( "Error while fetching DNS information\n" ); - return -1; - } +/////////////////////////////////////////////////////////////////////////////// +// Private functions +/////////////////////////////////////////////////////////////////////////////// - // Build the nameservers list needed by pjsip - scount = dns_servers.size (); - pj_str_t nameservers[scount]; - for ( i = 0; i<scount; i++ ) - { - nameservers[i] = pj_str ( ( char* ) dns_servers[i].c_str() ); - } +bool get_dns_server_addresses (std::vector<std::string> *servers) +{ - // Update the name servers for the DNS resolver - status = pj_dns_resolver_set_ns ( resv, scount, nameservers, NULL ); - if ( status != PJ_SUCCESS ) - { - _debug ( "Error updating the name servers for the DNS resolver\n" ); - return status; - } + int server_count, i; + std::vector<std::string> nameservers; - // Set the DNS resolver instance of the SIP resolver engine - status = pjsip_endpt_set_resolver ( endpt, resv ); - if ( status != PJ_SUCCESS ) - { - _debug ( "Error setting the DNS resolver instance of the SIP resolver engine\n" ); - return status; - } + struct sockaddr_in current_server; + in_addr address; - *p_resv = resv; + // Read configuration files - return PJ_SUCCESS; + if (res_init () != 0) { + _debug ("Resolver initialization failed\n"); + return false; + } -} + server_count = _res.nscount; + for (i=0; i<server_count; i++) { + current_server = (struct sockaddr_in) _res.nsaddr_list[i]; + address = current_server.sin_addr; + nameservers.push_back (inet_ntoa (address)); + } -bool SIPVoIPLink::pjsip_init() -{ - pj_status_t status; - int errPjsip = 0; - int port; - pjsip_inv_callback inv_cb; - pj_str_t accepted; - std::string name_mod; - bool useStun; - validStunServer = true; - pj_dns_resolver *p_resv; - - name_mod = "sflphone"; - - // Init PJLIB: must be called before any call to the pjsip library - status = pj_init(); - // Use pjsip macros for sanity check - PJ_ASSERT_RETURN ( status == PJ_SUCCESS, 1 ); - - // Init PJLIB-UTIL library - status = pjlib_util_init(); - PJ_ASSERT_RETURN ( status == PJ_SUCCESS, 1 ); - - // Set the pjsip log level - pj_log_set_level ( PJ_LOG_LEVEL ); - - // Init PJNATH - status = pjnath_init(); - PJ_ASSERT_RETURN ( status == PJ_SUCCESS, 1 ); - - // Create a pool factory to allocate memory - pj_caching_pool_init ( &_cp, &pj_pool_factory_default_policy, 0 ); - - // Create memory pool for application. - _pool = pj_pool_create ( &_cp.factory, "sflphone", 4000, 4000, NULL ); - - if ( !_pool ) - { - _debug ( "UserAgent: Could not initialize memory pool\n" ); - return PJ_ENOMEM; - } - - // Create the SIP endpoint - status = pjsip_endpt_create ( &_cp.factory, pj_gethostname()->ptr, &_endpt ); - PJ_ASSERT_RETURN ( status == PJ_SUCCESS, 1 ); - - /* Start resolving STUN server */ - // if we useStun and we failed to receive something on port 5060, we try a random port - // If use STUN server, firewall address setup - if ( !loadSIPLocalIP() ) - { - _debug ( "UserAgent: Unable to determine network capabilities\n" ); - return false; - } - - port = _regPort; - - /* Retrieve the STUN configuration */ - useStun = Manager::instance().getConfigInt ( SIGNALISATION, SIP_USE_STUN ); - this->setStunServer ( Manager::instance().getConfigString ( SIGNALISATION, SIP_STUN_SERVER ) ); - this->useStun ( useStun!=0 ? true : false ); - - if ( useStun && !Manager::instance().behindNat ( getStunServer(), port ) ) - { - port = RANDOM_SIP_PORT; - if ( !Manager::instance().behindNat ( getStunServer(), port ) ) - { - _debug ( "UserAgent: Unable to check NAT setting\n" ); - validStunServer = false; - return false; // hoho we can't use the random sip port too... - } - } - - _localPort = port; - if ( useStun ) - { - // set by last behindNat() call (ish)... - stunServerResolve(); - _localExternAddress = Manager::instance().getFirewallAddress(); - _localExternPort = Manager::instance().getFirewallPort(); - errPjsip = createUDPServer(); - if ( errPjsip != 0 ) - { - _debug ( "UserAgent: Could not initialize SIP listener on port %d\n", port ); - return errPjsip; - } - } - else - { - _localExternAddress = _localIPAddress; - _localExternPort = _localPort; - errPjsip = createUDPServer(); - if ( errPjsip != 0 ) - { - _debug ( "UserAgent: Could not initialize SIP listener on port %d\n", _localExternPort ); - _localExternPort = _localPort = RANDOM_SIP_PORT; - _debug ( "UserAgent: Try to initialize SIP listener on port %d\n", _localExternPort ); - errPjsip = createUDPServer(); - if ( errPjsip != 0 ) - { - _debug ( "UserAgent: Fail to initialize SIP listener on port %d\n", _localExternPort ); - return errPjsip; - } - } - } - - _debug ( "UserAgent: SIP Init -- listening on port %d\n", _localExternPort ); - - // Initialize transaction layer - status = pjsip_tsx_layer_init_module ( _endpt ); - PJ_ASSERT_RETURN ( status == PJ_SUCCESS, 1 ); - - // Initialize UA layer module - status = pjsip_ua_init_module ( _endpt, NULL ); - PJ_ASSERT_RETURN ( status == PJ_SUCCESS, 1 ); - - // Initialize Replaces support. See the Replaces specification in RFC 3891 - status = pjsip_replaces_init_module ( _endpt ); - PJ_ASSERT_RETURN ( status == PJ_SUCCESS, 1 ); - - // Initialize 100rel support - status = pjsip_100rel_init_module ( _endpt ); - PJ_ASSERT_RETURN ( status == PJ_SUCCESS, 1 ); - - // Initialize and register sflphone module - _mod_ua.name = pj_str ( ( char* ) name_mod.c_str() ); - _mod_ua.id = -1; - _mod_ua.priority = PJSIP_MOD_PRIORITY_APPLICATION; - _mod_ua.on_rx_request = &mod_on_rx_request; - _mod_ua.on_rx_response = &mod_on_rx_response; - - status = pjsip_endpt_register_module ( _endpt, &_mod_ua ); - PJ_ASSERT_RETURN ( status == PJ_SUCCESS, 1 ); - - // Init the event subscription module. - // It extends PJSIP by supporting SUBSCRIBE and NOTIFY methods - status = pjsip_evsub_init_module ( _endpt ); - PJ_ASSERT_RETURN ( status == PJ_SUCCESS, 1 ); - - // Init xfer/REFER module - status = pjsip_xfer_init_module ( _endpt ); - PJ_ASSERT_RETURN ( status == PJ_SUCCESS, 1 ); - - status = enable_dns_srv_resolver (_endpt, &p_resv); - PJ_ASSERT_RETURN( status == PJ_SUCCESS, 1 ); - - // Init the callback for INVITE session: - pj_bzero ( &inv_cb, sizeof ( inv_cb ) ); - - inv_cb.on_state_changed = &call_on_state_changed; - inv_cb.on_new_session = &call_on_forked; - inv_cb.on_media_update = &call_on_media_update; - inv_cb.on_tsx_state_changed = &call_on_tsx_changed; - inv_cb.on_rx_offer = &on_rx_offer; - - // Initialize session invite module - status = pjsip_inv_usage_init ( _endpt, &inv_cb ); - PJ_ASSERT_RETURN ( status == PJ_SUCCESS, 1 ); - - _debug ( "UserAgent: VOIP callbacks initialized\n" ); - - // Add endpoint capabilities (INFO, OPTIONS, etc) for this UA - pj_str_t allowed[] = { { ( char* ) "INFO", 4}, { ( char* ) "REGISTER", 8}, { ( char* ) "OPTIONS", 7} }; // //{"INVITE", 6}, {"ACK",3}, {"BYE",3}, {"CANCEL",6} - accepted = pj_str ( ( char* ) "application/sdp" ); - - // Register supported methods - pjsip_endpt_add_capability ( _endpt, &_mod_ua, PJSIP_H_ALLOW, NULL, PJ_ARRAY_SIZE ( allowed ), allowed ); - - // Register "application/sdp" in ACCEPT header - pjsip_endpt_add_capability ( _endpt, &_mod_ua, PJSIP_H_ACCEPT, NULL, 1, &accepted ); - - _debug ( "UserAgent: pjsip version %s for %s initialized\n", pj_get_version(), PJ_OS_NAME ); - - // Create the secondary thread to poll sip events - _evThread->start(); - - /* Done! */ - return PJ_SUCCESS; + //nameservers.push_back ("192.168.50.3"); + *servers = nameservers; + + return true; } -pj_status_t SIPVoIPLink::stunServerResolve ( void ) +pj_status_t SIPVoIPLink::enable_dns_srv_resolver (pjsip_endpoint *endpt, pj_dns_resolver **p_resv) { - pj_str_t stun_adr; - pj_hostent he; - pj_stun_config stunCfg; - pj_status_t stun_status; - pj_sockaddr stun_srv; - size_t pos; - std::string serverName, serverPort; - int nPort; - std::string stun_server; - stun_server = getStunServer(); + pj_status_t status; + pj_dns_resolver *resv; + std::vector <std::string> dns_servers; + pj_uint16_t port = 5353; + pjsip_resolver_t *res; + int scount, i; - // Initialize STUN configuration - pj_stun_config_init ( &stunCfg, &_cp.factory, 0, pjsip_endpt_get_ioqueue ( _endpt ), pjsip_endpt_get_timer_heap ( _endpt ) ); + // Create the DNS resolver instance + status = pjsip_endpt_create_resolver (endpt, &resv); - stun_status = PJ_EPENDING; + if (status != PJ_SUCCESS) { + _debug ("Error creating the DNS resolver instance\n"); + return status; + } - // Init STUN socket - pos = stun_server.find ( ':' ); - if ( pos == std::string::npos ) - { - pj_strdup2 ( _pool, &stun_adr, stun_server.data() ); - stun_status = pj_sockaddr_in_init ( &stun_srv.ipv4, &stun_adr, ( pj_uint16_t ) 3478 ); - } - else - { - serverName = stun_server.substr ( 0, pos ); - serverPort = stun_server.substr ( pos + 1 ); - nPort = atoi ( serverPort.data() ); - pj_strdup2 ( _pool, &stun_adr, serverName.data() ); - stun_status = pj_sockaddr_in_init ( &stun_srv.ipv4, &stun_adr, ( pj_uint16_t ) nPort ); - } + if (!get_dns_server_addresses (&dns_servers)) { + _debug ("Error while fetching DNS information\n"); + return -1; + } - if ( stun_status != PJ_SUCCESS ) - { - _debug ( "UserAgent: Unresolved stun server!\n" ); - stun_status = pj_gethostbyname ( &stun_adr, &he ); + // Build the nameservers list needed by pjsip + scount = dns_servers.size (); - if ( stun_status == PJ_SUCCESS ) - { - pj_sockaddr_in_init ( &stun_srv.ipv4, NULL, 0 ); - stun_srv.ipv4.sin_addr = * ( pj_in_addr* ) he.h_addr; - stun_srv.ipv4.sin_port = pj_htons ( ( pj_uint16_t ) 3478 ); - } - } + pj_str_t nameservers[scount]; - return stun_status; -} + for (i = 0; i<scount; i++) { + nameservers[i] = pj_str ( (char*) dns_servers[i].c_str()); + } -int SIPVoIPLink::createUDPServer ( void ) -{ + // Update the name servers for the DNS resolver + status = pj_dns_resolver_set_ns (resv, scount, nameservers, NULL); - pj_status_t status; - pj_sockaddr_in bound_addr; - pjsip_host_port a_name; - char tmpIP[32]; - pj_sock_t sock; + if (status != PJ_SUCCESS) { + _debug ("Error updating the name servers for the DNS resolver\n"); + return status; + } + // Set the DNS resolver instance of the SIP resolver engine + status = pjsip_endpt_set_resolver (endpt, resv); - // Init bound address to ANY - pj_memset ( &bound_addr, 0, sizeof ( bound_addr ) ); + if (status != PJ_SUCCESS) { + _debug ("Error setting the DNS resolver instance of the SIP resolver engine\n"); + return status; + } + *p_resv = resv; - bound_addr.sin_addr.s_addr = pj_htonl ( PJ_INADDR_ANY ); - bound_addr.sin_port = pj_htons ( ( pj_uint16_t ) _localPort ); - bound_addr.sin_family = PJ_AF_INET; - pj_bzero ( bound_addr.sin_zero, sizeof ( bound_addr.sin_zero ) ); + return PJ_SUCCESS; - // Create UDP-Server (default port: 5060) - strcpy ( tmpIP, _localExternAddress.data() ); - pj_strdup2 ( _pool, &a_name.host, tmpIP ); - a_name.port = ( pj_uint16_t ) _localExternPort; +} - status = pjsip_udp_transport_start ( _endpt, &bound_addr, &a_name, 1, NULL ); - if ( status != PJ_SUCCESS ) - { - _debug ( "UserAgent: (%d) Unable to start UDP transport!\n", status ); - return -1; - } - else - { - _debug ( "UserAgent: UDP server listening on port %d\n", _localExternPort ); - } +bool SIPVoIPLink::pjsip_init() +{ + pj_status_t status; + int errPjsip = 0; + int port; + pjsip_inv_callback inv_cb; + pj_str_t accepted; + std::string name_mod; + bool useStun; + validStunServer = true; + pj_dns_resolver *p_resv; + + name_mod = "sflphone"; + + // Init PJLIB: must be called before any call to the pjsip library + status = pj_init(); + // Use pjsip macros for sanity check + PJ_ASSERT_RETURN (status == PJ_SUCCESS, 1); + + // Init PJLIB-UTIL library + status = pjlib_util_init(); + PJ_ASSERT_RETURN (status == PJ_SUCCESS, 1); + + // Set the pjsip log level + pj_log_set_level (PJ_LOG_LEVEL); + + // Init PJNATH + status = pjnath_init(); + PJ_ASSERT_RETURN (status == PJ_SUCCESS, 1); + + // Create a pool factory to allocate memory + pj_caching_pool_init (&_cp, &pj_pool_factory_default_policy, 0); + + // Create memory pool for application. + _pool = pj_pool_create (&_cp.factory, "sflphone", 4000, 4000, NULL); + + if (!_pool) { + _debug ("UserAgent: Could not initialize memory pool\n"); + return PJ_ENOMEM; + } + + // Create the SIP endpoint + status = pjsip_endpt_create (&_cp.factory, pj_gethostname()->ptr, &_endpt); + + PJ_ASSERT_RETURN (status == PJ_SUCCESS, 1); + + /* Start resolving STUN server */ + // if we useStun and we failed to receive something on port 5060, we try a random port + // If use STUN server, firewall address setup + if (!loadSIPLocalIP()) { + _debug ("UserAgent: Unable to determine network capabilities\n"); + return false; + } + + port = _regPort; + + /* Retrieve the STUN configuration */ + useStun = Manager::instance().getConfigInt (SIGNALISATION, SIP_USE_STUN); + this->setStunServer (Manager::instance().getConfigString (SIGNALISATION, SIP_STUN_SERVER)); + this->useStun (useStun!=0 ? true : false); + + if (useStun && !Manager::instance().behindNat (getStunServer(), port)) { + port = RANDOM_SIP_PORT; + + if (!Manager::instance().behindNat (getStunServer(), port)) { + _debug ("UserAgent: Unable to check NAT setting\n"); + validStunServer = false; + return false; // hoho we can't use the random sip port too... + } + } + + _localPort = port; + + if (useStun) { + // set by last behindNat() call (ish)... + stunServerResolve(); + _localExternAddress = Manager::instance().getFirewallAddress(); + _localExternPort = Manager::instance().getFirewallPort(); + errPjsip = createUDPServer(); + if (errPjsip != 0) { + _debug ("UserAgent: Could not initialize SIP listener on port %d\n", port); + return errPjsip; + } + } else { + _localExternAddress = _localIPAddress; + _localExternPort = _localPort; + errPjsip = createUDPServer(); + + if (errPjsip != 0) { + _debug ("UserAgent: Could not initialize SIP listener on port %d\n", _localExternPort); + _localExternPort = _localPort = RANDOM_SIP_PORT; + _debug ("UserAgent: Try to initialize SIP listener on port %d\n", _localExternPort); + errPjsip = createUDPServer(); - _debug ( "Transport initialized successfully! \n" ); - return PJ_SUCCESS; -} + if (errPjsip != 0) { + _debug ("UserAgent: Fail to initialize SIP listener on port %d\n", _localExternPort); + return errPjsip; + } + } + } + + _debug ("UserAgent: SIP Init -- listening on port %d\n", _localExternPort); + + // Initialize transaction layer + status = pjsip_tsx_layer_init_module (_endpt); + PJ_ASSERT_RETURN (status == PJ_SUCCESS, 1); + + // Initialize UA layer module + status = pjsip_ua_init_module (_endpt, NULL); + PJ_ASSERT_RETURN (status == PJ_SUCCESS, 1); + + // Initialize Replaces support. See the Replaces specification in RFC 3891 + status = pjsip_replaces_init_module (_endpt); + PJ_ASSERT_RETURN (status == PJ_SUCCESS, 1); + + // Initialize 100rel support + status = pjsip_100rel_init_module (_endpt); + PJ_ASSERT_RETURN (status == PJ_SUCCESS, 1); + + // Initialize and register sflphone module + _mod_ua.name = pj_str ( (char*) name_mod.c_str()); + _mod_ua.id = -1; + _mod_ua.priority = PJSIP_MOD_PRIORITY_APPLICATION; + _mod_ua.on_rx_request = &mod_on_rx_request; + _mod_ua.on_rx_response = &mod_on_rx_response; + status = pjsip_endpt_register_module (_endpt, &_mod_ua); + PJ_ASSERT_RETURN (status == PJ_SUCCESS, 1); + // Init the event subscription module. + // It extends PJSIP by supporting SUBSCRIBE and NOTIFY methods + status = pjsip_evsub_init_module (_endpt); + PJ_ASSERT_RETURN (status == PJ_SUCCESS, 1); + // Init xfer/REFER module + status = pjsip_xfer_init_module (_endpt); + PJ_ASSERT_RETURN (status == PJ_SUCCESS, 1); + status = enable_dns_srv_resolver (_endpt, &p_resv); + PJ_ASSERT_RETURN (status == PJ_SUCCESS, 1); -bool SIPVoIPLink::loadSIPLocalIP() -{ + // Init the callback for INVITE session: + pj_bzero (&inv_cb, sizeof (inv_cb)); - bool returnValue = true; + inv_cb.on_state_changed = &call_on_state_changed; + inv_cb.on_new_session = &call_on_forked; + inv_cb.on_media_update = &call_on_media_update; + inv_cb.on_tsx_state_changed = &call_on_tsx_changed; + inv_cb.on_rx_offer = &on_rx_offer; - if ( _localIPAddress == "127.0.0.1" ) - { - pj_sockaddr ip_addr; - if ( pj_gethostip ( pj_AF_INET(), &ip_addr ) != PJ_SUCCESS ) - { - // Update the registration state if no network capabilities found - _debug ( "UserAgent: Get host ip failed!\n" ); - returnValue = false; - } - else - { - _localIPAddress = std::string ( pj_inet_ntoa ( ip_addr.ipv4.sin_addr ) ); - _debug ( "UserAgent: Checking network, setting local IP address to: %s\n", _localIPAddress.data() ); - } - } - return returnValue; -} + // Initialize session invite module + status = pjsip_inv_usage_init (_endpt, &inv_cb); + PJ_ASSERT_RETURN (status == PJ_SUCCESS, 1); -void SIPVoIPLink::busy_sleep ( unsigned msec ) -{ -#if defined(PJ_SYMBIAN) && PJ_SYMBIAN != 0 - /* Ideally we shouldn't call pj_thread_sleep() and rather - * CActiveScheduler::WaitForAnyRequest() here, but that will - * drag in Symbian header and it doesn't look pretty. - */ - pj_thread_sleep ( msec ); -#else - pj_time_val timeout, now, tv; - - pj_gettimeofday ( &timeout ); - timeout.msec += msec; - pj_time_val_normalize ( &timeout ); - - tv.sec = 0; - tv.msec = 10; - pj_time_val_normalize ( &tv ); - - do - { - pjsip_endpt_handle_events ( _endpt, &tv ); - pj_gettimeofday ( &now ); - } - while ( PJ_TIME_VAL_LT ( now, timeout ) ); -#endif -} + _debug ("UserAgent: VOIP callbacks initialized\n"); -bool SIPVoIPLink::pjsip_shutdown ( void ) -{ - if ( _endpt ) - { - _debug ( "UserAgent: Shutting down...\n" ); - busy_sleep ( 1000 ); - } + // Add endpoint capabilities (INFO, OPTIONS, etc) for this UA + pj_str_t allowed[] = { { (char*) "INFO", 4}, { (char*) "REGISTER", 8}, { (char*) "OPTIONS", 7} }; // //{"INVITE", 6}, {"ACK",3}, {"BYE",3}, {"CANCEL",6} + accepted = pj_str ( (char*) "application/sdp"); - pj_thread_join ( thread ); - pj_thread_destroy ( thread ); - thread = NULL; + // Register supported methods + pjsip_endpt_add_capability (_endpt, &_mod_ua, PJSIP_H_ALLOW, NULL, PJ_ARRAY_SIZE (allowed), allowed); - /* Destroy endpoint. */ - if ( _endpt ) - { - pjsip_endpt_destroy ( _endpt ); - _endpt = NULL; - } + // Register "application/sdp" in ACCEPT header + pjsip_endpt_add_capability (_endpt, &_mod_ua, PJSIP_H_ACCEPT, NULL, 1, &accepted); - /* Destroy pool and pool factory. */ - if ( _pool ) - { - pj_pool_release ( _pool ); - _pool = NULL; - pj_caching_pool_destroy ( &_cp ); - } + _debug ("UserAgent: pjsip version %s for %s initialized\n", pj_get_version(), PJ_OS_NAME); - /* Shutdown PJLIB */ - pj_shutdown(); + // Create the secondary thread to poll sip events + _evThread->start(); - /* Done. */ + /* Done! */ + return PJ_SUCCESS; } -int getModId() +pj_status_t SIPVoIPLink::stunServerResolve (void) { - return _mod_ua.id; -} + pj_str_t stun_adr; + pj_hostent he; + pj_stun_config stunCfg; + pj_status_t stun_status; + pj_sockaddr stun_srv; + size_t pos; + std::string serverName, serverPort; + int nPort; + std::string stun_server; -void set_voicemail_info ( AccountID account, pjsip_msg_body *body ) -{ + stun_server = getStunServer(); - int voicemail, pos_begin, pos_end; - std::string voice_str = "Voice-Message: "; - std::string delimiter = "/"; - std::string msg_body, voicemail_str; + // Initialize STUN configuration + pj_stun_config_init (&stunCfg, &_cp.factory, 0, pjsip_endpt_get_ioqueue (_endpt), pjsip_endpt_get_timer_heap (_endpt)); - _debug ( "UserAgent: checking the voice message!\n" ); - // The voicemail message is formated like that: - // Voice-Message: 1/0 . 1 is the number we want to retrieve in this case + stun_status = PJ_EPENDING; - // We get the notification body - msg_body = ( char* ) body->data; + // Init STUN socket + pos = stun_server.find (':'); - // We need the position of the first character of the string voice_str - pos_begin = msg_body.find ( voice_str ); - // We need the position of the delimiter - pos_end = msg_body.find ( delimiter ); + if (pos == std::string::npos) { + pj_strdup2 (_pool, &stun_adr, stun_server.data()); + stun_status = pj_sockaddr_in_init (&stun_srv.ipv4, &stun_adr, (pj_uint16_t) 3478); + } else { + serverName = stun_server.substr (0, pos); + serverPort = stun_server.substr (pos + 1); + nPort = atoi (serverPort.data()); + pj_strdup2 (_pool, &stun_adr, serverName.data()); + stun_status = pj_sockaddr_in_init (&stun_srv.ipv4, &stun_adr, (pj_uint16_t) nPort); + } - // So our voicemail number between the both index - try - { + if (stun_status != PJ_SUCCESS) { + _debug ("UserAgent: Unresolved stun server!\n"); + stun_status = pj_gethostbyname (&stun_adr, &he); - voicemail_str = msg_body.substr ( pos_begin + voice_str.length(), pos_end - ( pos_begin + voice_str.length() ) ); - std::cout << "voicemail number : " << voicemail_str << std::endl; - voicemail = atoi ( voicemail_str.c_str() ); - } - catch ( std::out_of_range& e ) - { - std::cerr << e.what() << std::endl; - } + if (stun_status == PJ_SUCCESS) { + pj_sockaddr_in_init (&stun_srv.ipv4, NULL, 0); + stun_srv.ipv4.sin_addr = * (pj_in_addr*) he.h_addr; + stun_srv.ipv4.sin_port = pj_htons ( (pj_uint16_t) 3478); + } + } - // We need now to notify the manager - if ( voicemail != 0 ) - Manager::instance().startVoiceMessageNotification ( account, voicemail ); + return stun_status; } -void SIPVoIPLink::handle_reinvite ( SIPCall *call ) +int SIPVoIPLink::createUDPServer (void) { - // Close the previous RTP session - _audiortp->closeRtpSession (); - call->setAudioStart ( false ); - - // Create a new one with new info - if ( _audiortp->createNewSession ( call ) >= 0 ) - { - call->setAudioStart ( true ); - } -} - + pj_status_t status; + pj_sockaddr_in bound_addr; + pjsip_host_port a_name; + char tmpIP[32]; + pj_sock_t sock; -/*******************************/ -/* CALLBACKS IMPLEMENTATION */ -/*******************************/ - -void call_on_state_changed ( pjsip_inv_session *inv, pjsip_event *e ) -{ - - SIPCall *call; - AccountID accId; - SIPVoIPLink *link; - pjsip_rx_data *rdata; - - /* Retrieve the call information */ - call = reinterpret_cast<SIPCall*> ( inv->mod_data[_mod_ua.id] ); - if ( !call ) - return; - - //Retrieve the body message - rdata = e->body.tsx_state.src.rdata; - - - /* If this is an outgoing INVITE that was created because of - * REFER/transfer, send NOTIFY to transferer. - */ - if ( call->getXferSub() && e->type==PJSIP_EVENT_TSX_STATE ) - { - int st_code = -1; - pjsip_evsub_state ev_state = PJSIP_EVSUB_STATE_ACTIVE; - - switch ( call->getInvSession()->state ) - { - case PJSIP_INV_STATE_NULL: - case PJSIP_INV_STATE_CALLING: - /* Do nothing */ - break; - - case PJSIP_INV_STATE_EARLY: - case PJSIP_INV_STATE_CONNECTING: - st_code = e->body.tsx_state.tsx->status_code; - ev_state = PJSIP_EVSUB_STATE_ACTIVE; - break; - - case PJSIP_INV_STATE_CONFIRMED: - /* When state is confirmed, send the final 200/OK and terminate - * subscription. - */ - st_code = e->body.tsx_state.tsx->status_code; - ev_state = PJSIP_EVSUB_STATE_TERMINATED; - break; - - case PJSIP_INV_STATE_DISCONNECTED: - st_code = e->body.tsx_state.tsx->status_code; - ev_state = PJSIP_EVSUB_STATE_TERMINATED; - break; - - case PJSIP_INV_STATE_INCOMING: - /* Nothing to do. Just to keep gcc from complaining about - * unused enums. - */ - break; - } - - if ( st_code != -1 ) - { - pjsip_tx_data *tdata; - pj_status_t status; - - status = pjsip_xfer_notify ( call->getXferSub(), - ev_state, st_code, - NULL, &tdata ); - if ( status != PJ_SUCCESS ) - { - _debug ( "UserAgent: Unable to create NOTIFY -- %d\n", status ); - } - else - { - status = pjsip_xfer_send_request ( call->getXferSub(), tdata ); - if ( status != PJ_SUCCESS ) - { - _debug ( "UserAgent: Unable to send NOTIFY -- %d\n", status ); - } - } - } - } - else - { - - // The call is ringing - We need to handle this case only on outgoing call - if ( inv->state == PJSIP_INV_STATE_EARLY && e->body.tsx_state.tsx->role == PJSIP_ROLE_UAC ) - { - call->setConnectionState ( Call::Ringing ); - Manager::instance().peerRingingCall ( call->getCallId() ); - } - - // We receive a ACK - The connection is established - else if ( inv->state == PJSIP_INV_STATE_CONFIRMED ) - { - - /* If the call is a direct IP-to-IP call */ - if ( call->getCallConfiguration () == Call::IPtoIP ) - { - link = SIPVoIPLink::instance ( "" ); - } - else - { - accId = Manager::instance().getAccountFromCall ( call->getCallId() ); - link = dynamic_cast<SIPVoIPLink *> ( Manager::instance().getAccountLink ( accId ) ); - } - - if ( link ) - link->SIPCallAnswered ( call, rdata ); - } - - else if ( inv->state == PJSIP_INV_STATE_DISCONNECTED ) - { - switch ( inv->cause ) - { - /* The call terminates normally - BYE / CANCEL */ - case PJSIP_SC_OK: - case PJSIP_SC_DECLINE: - case PJSIP_SC_REQUEST_TERMINATED: - - accId = Manager::instance().getAccountFromCall ( call->getCallId() ); - link = dynamic_cast<SIPVoIPLink *> ( Manager::instance().getAccountLink ( accId ) ); - if ( link ) - { - link->SIPCallClosed ( call ); - } - break; - - /* The call connection failed */ - case PJSIP_SC_NOT_FOUND: /* peer not found */ - case PJSIP_SC_REQUEST_TIMEOUT: /* request timeout */ - case PJSIP_SC_NOT_ACCEPTABLE_HERE: /* no compatible codecs */ - case PJSIP_SC_NOT_ACCEPTABLE_ANYWHERE: - case PJSIP_SC_UNSUPPORTED_MEDIA_TYPE: - case PJSIP_SC_UNAUTHORIZED: - accId = Manager::instance().getAccountFromCall ( call->getCallId() ); - link = dynamic_cast<SIPVoIPLink *> ( Manager::instance().getAccountLink ( accId ) ); - if ( link ) - { - link->SIPCallServerFailure ( call ); - } - break; - - default: - _debug ( "sipvoiplink.cpp - line 1635 : Unhandled call state. This is probably a bug.\n" ); - break; - } - } - - - } -} - -void call_on_media_update ( pjsip_inv_session *inv, pj_status_t status ) -{ - - const pjmedia_sdp_session *r_sdp; - SIPCall *call; - - if ( status != PJ_SUCCESS ) - { - _debug ( "Error while negociating the offer\n" ); - return; - } - - // Get the new sdp, result of the negociation - pjmedia_sdp_neg_get_active_local ( inv->neg, &r_sdp ); - - call = reinterpret_cast<SIPCall *> ( inv->mod_data[getModId() ] ); - // Clean the resulting sdp offer to create a new one (in case of a reinvite) - call->getLocalSDP()->clean_session_media(); - // Set the fresh negociated one - call->getLocalSDP()->set_negociated_offer ( r_sdp ); -} - -void call_on_forked ( pjsip_inv_session *inv, pjsip_event *e ) -{ -} - -void call_on_tsx_changed ( pjsip_inv_session *inv, pjsip_transaction *tsx, pjsip_event *e ) -{ - - if ( tsx->role==PJSIP_ROLE_UAS && tsx->state==PJSIP_TSX_STATE_TRYING && - pjsip_method_cmp ( &tsx->method, &pjsip_refer_method ) ==0 ) - { - /** Handle the refer method **/ - onCallTransfered ( inv, e->body.tsx_state.src.rdata ); - } -} - -void regc_cb ( struct pjsip_regc_cbparam *param ) -{ - - - //AccountID *id = static_cast<AccountID *> (param->token); - SIPAccount *account; - - //_debug("UserAgent: Account ID is %s, Register result: %d, Status: %d\n", id->data(), param->status, param->code); - account = static_cast<SIPAccount *> ( param->token ); - if ( !account ) - return; - - if ( param->status == PJ_SUCCESS ) - { - if ( param->code < 0 || param->code >= 300 ) - { - /* Sometimes, the status is OK, but we still failed. - * So checking the code for real result - */ - _debug ( "UserAgent: The error is: %d\n", param->code ); - switch ( param->code ) - { - case 606: - account->setRegistrationState ( ErrorConfStun ); - break; - case 503: - case 408: - account->setRegistrationState ( ErrorHost ); - break; - case 401: - case 403: - case 404: - account->setRegistrationState ( ErrorAuth ); - break; - default: - account->setRegistrationState ( Error ); - break; - } - account->setRegister ( false ); - } - else - { - // Registration/Unregistration is success - - if ( account->isRegister() ) - account->setRegistrationState ( Registered ); - else - { - account->setRegistrationState ( Unregistered ); - account->setRegister ( false ); - } - } - } - else - { - account->setRegistrationState ( ErrorAuth ); - account->setRegister ( false ); - } -} + // Init bound address to ANY + pj_memset (&bound_addr, 0, sizeof (bound_addr)); -pj_bool_t -mod_on_rx_request ( pjsip_rx_data *rdata ) -{ - - pj_status_t status; - pj_str_t reason; - unsigned options = 0; - pjsip_dialog* dialog; - pjsip_tx_data *tdata; - AccountID account_id; - pjsip_uri *uri; - pjsip_sip_uri *sip_uri; - std::string userName, server, caller, callerServer, peerNumber; - SIPVoIPLink *link; - CallID id; - SIPCall* call; - pjsip_inv_session *inv; - pjmedia_sdp_session *r_sdp; - - // voicemail part - std::string method_name; - std::string request; - - // Handle the incoming call invite in this function - _debug ( "UserAgent: Callback on_rx_request is involved! *****************************************************\n" ); - - /* First, let's got the username and server name from the invite. - * We will use them to detect which account is the callee. - */ - uri = rdata->msg_info.to->uri; - sip_uri = ( pjsip_sip_uri * ) pjsip_uri_get_uri ( uri ); - - userName = std::string ( sip_uri->user.ptr, sip_uri->user.slen ); - server = std::string ( sip_uri->host.ptr, sip_uri->host.slen ); - - std::cout << userName << " ------------------ " << server << std::endl; - - // Get the account id of callee from username and server - account_id = Manager::instance().getAccountIdFromNameAndServer ( userName, server ); - - /* If we don't find any account to receive the call */ - if ( account_id == AccountNULL ) - { - _debug ( "UserAgent: Username %s doesn't match any account!\n",userName.c_str() ); - //return false; - } - - /* Get the voip link associated to the incoming call */ - /* The account must before have been associated to the call in ManagerImpl */ - link = dynamic_cast<SIPVoIPLink *> ( Manager::instance().getAccountLink ( account_id ) ); - - /* If we can't find any voIP link to handle the incoming call */ - if ( link == 0 ) - { - _debug ( "ERROR: can not retrieve the voiplink from the account ID...\n" ); - return false; - } - - _debug ( "UserAgent: The receiver is : %s@%s\n", userName.data(), server.data() ); - _debug ( "UserAgent: The callee account id is %s\n", account_id.c_str() ); - - /* Now, it is the time to find the information of the caller */ - uri = rdata->msg_info.from->uri; - sip_uri = ( pjsip_sip_uri * ) pjsip_uri_get_uri ( uri ); - - - /* Retrieve only the fisrt characters */ - caller = std::string ( sip_uri->user.ptr, sip_uri->user.slen ); - callerServer = std::string ( sip_uri->host.ptr, sip_uri->host.slen ); - peerNumber = caller + "@" + callerServer; - - // Get the server voicemail notification - // Catch the NOTIFY message - if ( rdata->msg_info.msg->line.req.method.id == PJSIP_OTHER_METHOD ) - { - method_name = "NOTIFY"; - // Retrieve all the message. Should contains only the method name but ... - request = rdata->msg_info.msg->line.req.method.name.ptr; - // Check if the message is a notification - if ( request.find ( method_name ) != ( size_t )-1 ) - { - /* Notify the right account */ - set_voicemail_info ( account_id, rdata->msg_info.msg->body ); - request.find ( method_name ); - } - pjsip_endpt_respond_stateless ( _endpt, rdata, PJSIP_SC_OK, NULL, NULL, NULL ); - return true; - } - - // Handle an OPTIONS message - if ( rdata->msg_info.msg->line.req.method.id == PJSIP_OPTIONS_METHOD ) - { - handle_incoming_options ( rdata ); - return true; - } - - // Respond statelessly any non-INVITE requests with 500 - if ( rdata->msg_info.msg->line.req.method.id != PJSIP_INVITE_METHOD ) - { - if ( rdata->msg_info.msg->line.req.method.id != PJSIP_ACK_METHOD ) - { - pj_strdup2 ( _pool, &reason, "user agent unable to handle this request " ); - pjsip_endpt_respond_stateless ( _endpt, rdata, PJSIP_SC_METHOD_NOT_ALLOWED, &reason, NULL, - NULL ); - return true; - } - } - - // Verify that we can handle the request - status = pjsip_inv_verify_request ( rdata, &options, NULL, NULL, _endpt, NULL ); - if ( status != PJ_SUCCESS ) - { - pj_strdup2 ( _pool, &reason, "user agent unable to handle this INVITE " ); - pjsip_endpt_respond_stateless ( _endpt, rdata, PJSIP_SC_METHOD_NOT_ALLOWED, &reason, NULL, - NULL ); - return true; - } - - /******************************************* URL HOOK *********************************************/ - - if ( Manager::instance().getConfigString ( HOOKS, URLHOOK_SIP_ENABLED ) == "1" ) - { - - std::string header_value; - - header_value = fetch_header_value ( rdata->msg_info.msg, Manager::instance().getConfigString ( HOOKS, URLHOOK_SIP_FIELD ) ); - - if ( header_value!="" ) - { - urlhook->addAction ( header_value, - Manager::instance().getConfigString ( HOOKS, URLHOOK_COMMAND ) ); - } - } - - /************************************************************************************************/ - - // Generate a new call ID for the incoming call! - id = Manager::instance().getNewCallID(); - call = new SIPCall ( id, Call::Incoming, _pool ); - - /* If an error occured at the call creation */ - if ( !call ) - { - _debug ( "UserAgent: unable to create an incoming call" ); - return false; - } - - // Have to do some stuff with the SDP - // Set the codec map, IP, peer number and so on... for the SIPCall object - setCallAudioLocal ( call, link->getLocalIPAddress(), link->useStun(), link->getStunServer() ); - // We retrieve the remote sdp offer in the rdata struct to begin the negociation - call->getLocalSDP()->set_ip_address ( link->getLocalIPAddress() ); - get_remote_sdp_from_offer ( rdata, &r_sdp ); -// _debug("r_sdp = %s\n", r_sdp); - status = call->getLocalSDP()->receiving_initial_offer ( r_sdp ); - if ( status!=PJ_SUCCESS ) - { - delete call; call=0; - return false; - } - - - call->setConnectionState ( Call::Progressing ); - call->setPeerNumber ( peerNumber ); - - call->initRecFileName(); - - // Notify UI there is an incoming call - if ( Manager::instance().incomingCall ( call, account_id ) ) - { - // Add this call to the callAccountMap in ManagerImpl - Manager::instance().getAccountLink ( account_id )->addCall ( call ); - } - else - { - // Fail to notify UI - delete call; - call = NULL; - _debug ( "UserAgent: Fail to notify UI!\n" ); - return false; - } - - - /* Create the local dialog (UAS) */ - status = pjsip_dlg_create_uas ( pjsip_ua_instance(), rdata, NULL, &dialog ); - if ( status != PJ_SUCCESS ) - { - pjsip_endpt_respond_stateless ( _endpt, rdata, PJSIP_SC_INTERNAL_SERVER_ERROR, &reason, NULL, - NULL ); - return true; - } - - // Specify media capability during invite session creation - status = pjsip_inv_create_uas ( dialog, rdata, call->getLocalSDP()->get_local_sdp_session(), 0, &inv ); - PJ_ASSERT_RETURN ( status == PJ_SUCCESS, 1 ); - - // Associate the call in the invite session - inv->mod_data[_mod_ua.id] = call; - - // Send a 180/Ringing response - status = pjsip_inv_initial_answer ( inv, rdata, PJSIP_SC_RINGING, NULL, NULL, &tdata ); - PJ_ASSERT_RETURN ( status == PJ_SUCCESS, 1 ); - status = pjsip_inv_send_msg ( inv, tdata ); - PJ_ASSERT_RETURN ( status == PJ_SUCCESS, 1 ); - - // Associate invite session to the current call - call->setInvSession ( inv ); - - // Update the connection state - call->setConnectionState ( Call::Ringing ); - - /* Done */ - return true; - -} - -pj_bool_t mod_on_rx_response ( pjsip_rx_data *rdata UNUSED ) -{ - return PJ_SUCCESS; -} - -void onCallTransfered ( pjsip_inv_session *inv, pjsip_rx_data *rdata ) -{ - - pj_status_t status; - pjsip_tx_data *tdata; - SIPCall *existing_call; - const pj_str_t str_refer_to = { ( char* ) "Refer-To", 8}; - const pj_str_t str_refer_sub = { ( char* ) "Refer-Sub", 9 }; - const pj_str_t str_ref_by = { ( char* ) "Referred-By", 11 }; - pjsip_generic_string_hdr *refer_to; - pjsip_generic_string_hdr *refer_sub; - pjsip_hdr *ref_by_hdr; - pj_bool_t no_refer_sub = PJ_FALSE; - char *uri; - std::string tmp; - pjsip_status_code code; - pjsip_evsub *sub; - - existing_call = ( SIPCall * ) inv->mod_data[_mod_ua.id]; - - /* Find the Refer-To header */ - refer_to = ( pjsip_generic_string_hdr* ) - pjsip_msg_find_hdr_by_name ( rdata->msg_info.msg, &str_refer_to, NULL ); - - if ( refer_to == NULL ) - { - /* Invalid Request. - * No Refer-To header! - */ - _debug ( "UserAgent: Received REFER without Refer-To header!\n" ); - pjsip_dlg_respond ( inv->dlg, rdata, 400, NULL, NULL, NULL ); - return; - } - - /* Find optional Refer-Sub header */ - refer_sub = ( pjsip_generic_string_hdr* ) - pjsip_msg_find_hdr_by_name ( rdata->msg_info.msg, &str_refer_sub, NULL ); - - if ( refer_sub ) - { - if ( !pj_strnicmp2 ( &refer_sub->hvalue, "true", 4 ) ==0 ) - no_refer_sub = PJ_TRUE; - } - - /* Find optional Referred-By header (to be copied onto outgoing INVITE - * request. - */ - ref_by_hdr = ( pjsip_hdr* ) - pjsip_msg_find_hdr_by_name ( rdata->msg_info.msg, &str_ref_by, - NULL ); - - /* Notify callback */ - code = PJSIP_SC_ACCEPTED; - - _debug ( "UserAgent: Call to %.*s is being transfered to %.*s\n", - ( int ) inv->dlg->remote.info_str.slen, - inv->dlg->remote.info_str.ptr, - ( int ) refer_to->hvalue.slen, - refer_to->hvalue.ptr ); - - if ( no_refer_sub ) - { - /* - * Always answer with 2xx. - */ - pjsip_tx_data *tdata; - const pj_str_t str_false = { ( char* ) "false", 5}; - pjsip_hdr *hdr; - - status = pjsip_dlg_create_response ( inv->dlg, rdata, code, NULL, - &tdata ); - if ( status != PJ_SUCCESS ) - { - _debug ( "UserAgent: Unable to create 2xx response to REFER -- %d\n", status ); - return; - } - - /* Add Refer-Sub header */ - hdr = ( pjsip_hdr* ) - pjsip_generic_string_hdr_create ( tdata->pool, &str_refer_sub, - &str_false ); - pjsip_msg_add_hdr ( tdata->msg, hdr ); - - - /* Send answer */ - status = pjsip_dlg_send_response ( inv->dlg, pjsip_rdata_get_tsx ( rdata ), - tdata ); - if ( status != PJ_SUCCESS ) - { - _debug ( "UserAgent: Unable to create 2xx response to REFER -- %d\n", status ); - return; - } - - /* Don't have subscription */ - sub = NULL; - - } - else - { - struct pjsip_evsub_user xfer_cb; - pjsip_hdr hdr_list; - - /* Init callback */ - pj_bzero ( &xfer_cb, sizeof ( xfer_cb ) ); - xfer_cb.on_evsub_state = &xfer_svr_cb; - - /* Init addiTHIS_FILE, THIS_FILE, tional header list to be sent with REFER response */ - pj_list_init ( &hdr_list ); - - /* Create transferee event subscription */ - status = pjsip_xfer_create_uas ( inv->dlg, &xfer_cb, rdata, &sub ); - if ( status != PJ_SUCCESS ) - { - _debug ( "UserAgent: Unable to create xfer uas -- %d\n", status ); - pjsip_dlg_respond ( inv->dlg, rdata, 500, NULL, NULL, NULL ); - return; - } - - /* If there's Refer-Sub header and the value is "true", send back - * Refer-Sub in the response with value "true" too. - */ - if ( refer_sub ) - { - const pj_str_t str_true = { ( char* ) "true", 4 }; - pjsip_hdr *hdr; - - hdr = ( pjsip_hdr* ) - pjsip_generic_string_hdr_create ( inv->dlg->pool, - &str_refer_sub, - &str_true ); - pj_list_push_back ( &hdr_list, hdr ); - - } - - /* Accept the REFER request, send 2xx. */ - pjsip_xfer_accept ( sub, rdata, code, &hdr_list ); - - /* Create initial NOTIFY request */ - status = pjsip_xfer_notify ( sub, PJSIP_EVSUB_STATE_ACTIVE, - 100, NULL, &tdata ); - if ( status != PJ_SUCCESS ) - { - _debug ( "UserAgent: Unable to create NOTIFY to REFER -- %d", status ); - return; - } - - /* Send initial NOTIFY request */ - status = pjsip_xfer_send_request ( sub, tdata ); - if ( status != PJ_SUCCESS ) - { - _debug ( "UserAgent: Unable to send NOTIFY to REFER -- %d\n", status ); - return; - } - } - - /* We're cheating here. - * We need to get a null terminated string from a pj_str_t. - * So grab the pointer from the hvalue and NULL terminate it, knowing - * that the NULL position will be occupied by a newline. - */ - uri = refer_to->hvalue.ptr; - uri[refer_to->hvalue.slen] = '\0'; - - /* Now make the outgoing call. */ - tmp = std::string ( uri ); - - if ( existing_call == NULL ) - { - _debug ( "UserAgent: Call doesn't exist!\n" ); - return; - } - - AccountID accId = Manager::instance().getAccountFromCall ( existing_call->getCallId() ); - CallID newCallId = Manager::instance().getNewCallID(); - - if ( !Manager::instance().outgoingCall ( accId, newCallId, tmp ) ) - { - - /* Notify xferer about the error (if we have subscription) */ - if ( sub ) - { - status = pjsip_xfer_notify ( sub, PJSIP_EVSUB_STATE_TERMINATED, - 500, NULL, &tdata ); - if ( status != PJ_SUCCESS ) - { - _debug ( "UserAgent: Unable to create NOTIFY to REFER -- %d\n", status ); - return; - } - status = pjsip_xfer_send_request ( sub, tdata ); - if ( status != PJ_SUCCESS ) - { - _debug ( "UserAgent: Unable to send NOTIFY to REFER -- %d\n", status ); - return; - } - } - return; - } - - SIPCall* newCall; - SIPVoIPLink *link = dynamic_cast<SIPVoIPLink *> ( Manager::instance().getAccountLink ( accId ) ); - if ( link ) - { - newCall = dynamic_cast<SIPCall *> ( link->getCall ( newCallId ) ); - if ( !newCall ) - { - _debug ( "UserAgent: can not find the call from sipvoiplink!\n" ); - return; - } - } - - if ( sub ) - { - /* Put the server subscription in inv_data. - * Subsequent state changed in pjsua_inv_on_state_changed() will be - * reported back to the server subscription. - */ - newCall->setXferSub ( sub ); - - /* Put the invite_data in the subscription. */ - pjsip_evsub_set_mod_data ( sub, _mod_ua.id, - newCall ); - } -} - - - -void xfer_func_cb ( pjsip_evsub *sub, pjsip_event *event ) -{ - - - PJ_UNUSED_ARG ( event ); - - // _debug(" %s \n", event->body.rx_msg.rdata->msg_info.msg_buf); - - - - // _debug("UserAgent: pjsip_evsub_get_state_name: %s \n", pjsip_evsub_get_state_name(sub)); - - /* - * When subscription is accepted (got 200/OK to REFER), check if - * subscription suppressed. - */ - if ( pjsip_evsub_get_state ( sub ) == PJSIP_EVSUB_STATE_ACCEPTED ) - { - - _debug ( "Transfer accepted! Waiting for notifications. \n" ); - - /* - pjsip_rx_data *rdata; - pjsip_generic_string_hdr *refer_sub; - const pj_str_t REFER_SUB = {(char*)"Refer-Sub", 9 }; - - SIPVoIPLink *link = reinterpret_cast<SIPVoIPLink *> (pjsip_evsub_get_mod_data(sub, _mod_ua.id)); - - // Must be receipt of response message - pj_assert(event->type == PJSIP_EVENT_TSX_STATE && event->body.tsx_state.type == PJSIP_EVENT_RX_MSG); - rdata = event->body.tsx_state.src.rdata; - - // Find Refer-Sub header - refer_sub = (pjsip_generic_string_hdr*)pjsip_msg_find_hdr_by_name(rdata->msg_info.msg, &REFER_SUB, NULL); - - // Check if subscription is suppressed - if (refer_sub && pj_stricmp2(&refer_sub->hvalue, "false")==0) { - // Since no subscription is desired, assume that call has been transfered successfully. - - if (link) { - // It's the time to stop the RTP - - link->transferStep2(); - } - - // Yes, subscription is suppressed.Terminate our subscription now. - _debug("UserAgent: Xfer subscription suppressed, terminating event subcription...\n"); - pjsip_evsub_terminate(sub, PJ_TRUE); - } - - - else { - // Notify application about call transfer progress. Initially notify with 100/Accepted status. - - _debug("UserAgent: Xfer subscription 100/Accepted received...\n"); - } - */ - } - /* - * On incoming NOTIFY, notify application about call transfer progress. - */ - else if ( pjsip_evsub_get_state ( sub ) == PJSIP_EVSUB_STATE_ACTIVE || - pjsip_evsub_get_state ( sub ) == PJSIP_EVSUB_STATE_TERMINATED ) - { - pjsip_msg *msg; - pjsip_msg_body *body; - pjsip_status_line status_line; - pj_bool_t is_last; - pj_bool_t cont; - pj_status_t status; - - std::string noresource; - std::string ringing; - std::string request; - - noresource = "noresource"; - ringing = "Ringing"; - - - SIPVoIPLink *link = reinterpret_cast<SIPVoIPLink *> ( pjsip_evsub_get_mod_data ( sub, _mod_ua.id ) ); - - /* When subscription is terminated, clear the xfer_sub member of - * the inv_data. - */ - - if ( pjsip_evsub_get_state ( sub ) == PJSIP_EVSUB_STATE_TERMINATED ) - { - pjsip_evsub_set_mod_data ( sub, _mod_ua.id, NULL ); - _debug ( "UserAgent: Xfer client subscription terminated\n" ); - - } - - if ( !link || !event ) - { - /* Application is not interested with call progress status */ - _debug ( "UserAgent: Either link or event is empty!\n" ); - return; - } - - - - /* This better be a NOTIFY request */ - if ( event->type == PJSIP_EVENT_TSX_STATE && - event->body.tsx_state.type == PJSIP_EVENT_RX_MSG ) - { - - pjsip_rx_data *rdata; - - rdata = event->body.tsx_state.src.rdata; - - - /* Check if there's body */ - msg = rdata->msg_info.msg; - body = msg->body; - if ( !body ) - { - // if (call->getCallConfiguration () == Call::IPtoIP) { - // _debug("UserAgent: IptoIp NOTIFY without message body\n"); - // } - // else{ - _debug ( "UserAgent: Warning! Received NOTIFY without message body\n" ); - return; - // } - } - - - - /* Check for appropriate content */ - if ( pj_stricmp2 ( &body->content_type.type, "message" ) != 0 || - pj_stricmp2 ( &body->content_type.subtype, "sipfrag" ) != 0 ) - { - _debug ( "UserAgent: Warning! Received NOTIFY with non message/sipfrag content\n" ); - return; - } - - /* Try to parse the content */ - status = pjsip_parse_status_line ( ( char* ) body->data, body->len, - &status_line ); - if ( status != PJ_SUCCESS ) - { - _debug ( "UserAgent: Warning! Received NOTIFY with invalid message/sipfrag content\n" ); - return; - } - - } - else - { - _debug ( "UserAgent: Set code to 500!\n" ); - status_line.code = 500; - status_line.reason = *pjsip_get_status_text ( 500 ); - } - - - if ( event->body.rx_msg.rdata->msg_info.msg_buf != NULL ) - { - request = event->body.rx_msg.rdata->msg_info.msg_buf; - if ( request.find ( noresource ) != -1 ) - { - _debug ( "UserAgent: NORESOURCE for transfer!\n" ); - link->transferStep2(); - pjsip_evsub_terminate ( sub, PJ_TRUE ); - return; - } - if ( request.find ( ringing ) != -1 ) - { - _debug ( "UserAgent: transfered call RINGING!\n" ); - link->transferStep2(); - pjsip_evsub_terminate ( sub, PJ_TRUE ); - return; - } - } + bound_addr.sin_addr.s_addr = pj_htonl (PJ_INADDR_ANY); + bound_addr.sin_port = pj_htons ( (pj_uint16_t) _localPort); + bound_addr.sin_family = PJ_AF_INET; + pj_bzero (bound_addr.sin_zero, sizeof (bound_addr.sin_zero)); + // Create UDP-Server (default port: 5060) + strcpy (tmpIP, _localExternAddress.data()); + pj_strdup2 (_pool, &a_name.host, tmpIP); + a_name.port = (pj_uint16_t) _localExternPort; - // Get current call - SIPCall *call = dynamic_cast<SIPCall *> ( link->getCall ( Manager::instance().getCurrentCallId() ) ); - if ( !call ) - { - _debug ( "UserAgent: Call doesn't exit!\n" ); - return; - } + status = pjsip_udp_transport_start (_endpt, &bound_addr, &a_name, 1, NULL); - /* Notify application */ - is_last = ( pjsip_evsub_get_state ( sub ) ==PJSIP_EVSUB_STATE_TERMINATED ); - cont = !is_last; + if (status != PJ_SUCCESS) { + _debug ("UserAgent: (%d) Unable to start UDP transport!\n", status); + return -1; + } else { + _debug ("UserAgent: UDP server listening on port %d\n", _localExternPort); + } - if ( status_line.code/100 == 2 ) - { - _debug ( "UserAgent: Try to stop rtp!\n" ); - pjsip_tx_data *tdata; + _debug ("Transport initialized successfully! \n"); - status = pjsip_inv_end_session ( call->getInvSession(), PJSIP_SC_GONE, NULL, &tdata ); - if ( status != PJ_SUCCESS ) - { - _debug ( "UserAgent: Fail to create end session msg!\n" ); - } - else - { - status = pjsip_inv_send_msg ( call->getInvSession(), tdata ); - if ( status != PJ_SUCCESS ) - _debug ( "UserAgent: Fail to send end session msg!\n" ); - } + return PJ_SUCCESS; +} - link->transferStep2(); - cont = PJ_FALSE; - } - if ( !cont ) - { - pjsip_evsub_set_mod_data ( sub, _mod_ua.id, NULL ); - } - - } -} -void xfer_svr_cb ( pjsip_evsub *sub, pjsip_event *event ) +bool SIPVoIPLink::loadSIPLocalIP() { - PJ_UNUSED_ARG ( event ); + bool returnValue = true; - /* - * When subscription is terminated, clear the xfer_sub member of - * the inv_data. - */ - if ( pjsip_evsub_get_state ( sub ) == PJSIP_EVSUB_STATE_TERMINATED ) - { - SIPCall *call; + if (_localIPAddress == "127.0.0.1") { + pj_sockaddr ip_addr; - call = ( SIPCall* ) pjsip_evsub_get_mod_data ( sub, _mod_ua.id ); - if ( !call ) - return; + if (pj_gethostip (pj_AF_INET(), &ip_addr) != PJ_SUCCESS) { + // Update the registration state if no network capabilities found + _debug ("UserAgent: Get host ip failed!\n"); + returnValue = false; + } else { + _localIPAddress = std::string (pj_inet_ntoa (ip_addr.ipv4.sin_addr)); + _debug ("UserAgent: Checking network, setting local IP address to: %s\n", _localIPAddress.data()); + } + } - pjsip_evsub_set_mod_data ( sub, _mod_ua.id, NULL ); - call->setXferSub ( NULL ); - - _debug ( "UserAgent: Xfer server subscription terminated\n" ); - } + return returnValue; } -void on_rx_offer ( pjsip_inv_session *inv, const pjmedia_sdp_session *offer ) +void SIPVoIPLink::busy_sleep (unsigned msec) { +#if defined(PJ_SYMBIAN) && PJ_SYMBIAN != 0 + /* Ideally we shouldn't call pj_thread_sleep() and rather + * CActiveScheduler::WaitForAnyRequest() here, but that will + * drag in Symbian header and it doesn't look pretty. + */ + pj_thread_sleep (msec); +#else + pj_time_val timeout, now, tv; -#ifdef CAN_REINVITE - _debug ( "reinvite SIP\n" ); - - SIPCall *call; - pj_status_t status; - AccountID accId; - SIPVoIPLink *link; + pj_gettimeofday (&timeout); + timeout.msec += msec; + pj_time_val_normalize (&timeout); - call = ( SIPCall* ) inv->mod_data[getModId() ]; - if ( !call ) - return; + tv.sec = 0; + tv.msec = 10; + pj_time_val_normalize (&tv); - accId = Manager::instance().getAccountFromCall ( call->getCallId() ); - link = dynamic_cast<SIPVoIPLink *> ( Manager::instance().getAccountLink ( accId ) ); + do { + pjsip_endpt_handle_events (_endpt, &tv); + pj_gettimeofday (&now); + } while (PJ_TIME_VAL_LT (now, timeout)); - call->getLocalSDP()->receiving_initial_offer ( ( pjmedia_sdp_session* ) offer ); - status=pjsip_inv_set_sdp_answer ( call->getInvSession(), call->getLocalSDP()->get_local_sdp_session() ); - if ( link ) - link->handle_reinvite ( call ); #endif - } -void handle_incoming_options ( pjsip_rx_data *rdata ) +bool SIPVoIPLink::pjsip_shutdown (void) { + if (_endpt) { + _debug ("UserAgent: Shutting down...\n"); + busy_sleep (1000); + } - pjsip_tx_data *tdata; - pjsip_response_addr res_addr; - const pjsip_hdr *cap_hdr; - pj_status_t status; + pj_thread_join (thread); - /* Create basic response. */ - status = pjsip_endpt_create_response ( _endpt, rdata, PJSIP_SC_OK, NULL, &tdata ); - if ( status != PJ_SUCCESS ) - { - return; - } + pj_thread_destroy (thread); + thread = NULL; - /* Add Allow header */ - cap_hdr = pjsip_endpt_get_capability ( _endpt, PJSIP_H_ALLOW, NULL ); - if ( cap_hdr ) - { - pjsip_msg_add_hdr ( tdata->msg, ( pjsip_hdr* ) pjsip_hdr_clone ( tdata->pool, cap_hdr ) ); - } + /* Destroy endpoint. */ - /* Add Accept header */ - cap_hdr = pjsip_endpt_get_capability ( _endpt, PJSIP_H_ACCEPT, NULL ); - if ( cap_hdr ) - { - pjsip_msg_add_hdr ( tdata->msg, ( pjsip_hdr* ) pjsip_hdr_clone ( tdata->pool, cap_hdr ) ); - } + if (_endpt) { + pjsip_endpt_destroy (_endpt); + _endpt = NULL; + } - /* Add Supported header */ - cap_hdr = pjsip_endpt_get_capability ( _endpt, PJSIP_H_SUPPORTED, NULL ); - if ( cap_hdr ) - { - pjsip_msg_add_hdr ( tdata->msg, ( pjsip_hdr* ) pjsip_hdr_clone ( tdata->pool, cap_hdr ) ); - } + /* Destroy pool and pool factory. */ + if (_pool) { + pj_pool_release (_pool); + _pool = NULL; + pj_caching_pool_destroy (&_cp); + } - /* Add Allow-Events header from the evsub module */ - cap_hdr = pjsip_evsub_get_allow_events_hdr ( NULL ); - if ( cap_hdr ) - { - pjsip_msg_add_hdr ( tdata->msg, ( pjsip_hdr* ) pjsip_hdr_clone ( tdata->pool, cap_hdr ) ); - } + /* Shutdown PJLIB */ + pj_shutdown(); - /* Send response statelessly */ - pjsip_get_response_addr ( tdata->pool, rdata, &res_addr ); - status = pjsip_endpt_send_response ( _endpt, &res_addr, tdata, NULL, NULL ); - if ( status != PJ_SUCCESS ) - pjsip_tx_data_dec_ref ( tdata ); + /* Done. */ +} + +int getModId() +{ + return _mod_ua.id; +} + +void set_voicemail_info (AccountID account, pjsip_msg_body *body) +{ + + int voicemail, pos_begin, pos_end; + std::string voice_str = "Voice-Message: "; + std::string delimiter = "/"; + std::string msg_body, voicemail_str; + + _debug ("UserAgent: checking the voice message!\n"); + // The voicemail message is formated like that: + // Voice-Message: 1/0 . 1 is the number we want to retrieve in this case + + // We get the notification body + msg_body = (char*) body->data; + + // We need the position of the first character of the string voice_str + pos_begin = msg_body.find (voice_str); + // We need the position of the delimiter + pos_end = msg_body.find (delimiter); + + // So our voicemail number between the both index + + try { + + voicemail_str = msg_body.substr (pos_begin + voice_str.length(), pos_end - (pos_begin + voice_str.length())); + std::cout << "voicemail number : " << voicemail_str << std::endl; + voicemail = atoi (voicemail_str.c_str()); + } catch (std::out_of_range& e) { + std::cerr << e.what() << std::endl; + } + + // We need now to notify the manager + if (voicemail != 0) + Manager::instance().startVoiceMessageNotification (account, voicemail); +} + +void SIPVoIPLink::handle_reinvite (SIPCall *call) +{ + + // Close the previous RTP session + _audiortp->closeRtpSession (); + call->setAudioStart (false); + + _debug ("Create new rtp session from handle_reinvite \n"); + + try { + _audiortp->createNewSession (call); + } catch (...) { + _debug ("! SIP Failure: Unable to create RTP Session (%s:%d)\n", __FILE__, __LINE__); + } + + _audiortp->start(); + + call->setAudioStart (true); + + +} + + +/*******************************/ +/* CALLBACKS IMPLEMENTATION */ +/*******************************/ + +void call_on_state_changed (pjsip_inv_session *inv, pjsip_event *e) +{ + + _debug ("--------------------- call_on_state_changed --------------------- %i\n", inv->state); + + SIPCall *call; + AccountID accId; + SIPVoIPLink *link; + pjsip_rx_data *rdata; + + + /* Retrieve the call information */ + call = reinterpret_cast<SIPCall*> (inv->mod_data[_mod_ua.id]); + + if (!call) + return; + + //Retrieve the body message + rdata = e->body.tsx_state.src.rdata; + + + /* If this is an outgoing INVITE that was created because of + * REFER/transfer, send NOTIFY to transferer. + */ + if (call->getXferSub() && e->type==PJSIP_EVENT_TSX_STATE) { + int st_code = -1; + pjsip_evsub_state ev_state = PJSIP_EVSUB_STATE_ACTIVE; + + switch (call->getInvSession()->state) { + + case PJSIP_INV_STATE_NULL: + + case PJSIP_INV_STATE_CALLING: + /* Do nothing */ + break; + + case PJSIP_INV_STATE_EARLY: + + case PJSIP_INV_STATE_CONNECTING: + st_code = e->body.tsx_state.tsx->status_code; + ev_state = PJSIP_EVSUB_STATE_ACTIVE; + break; + + case PJSIP_INV_STATE_CONFIRMED: + /* When state is confirmed, send the final 200/OK and terminate + * subscription. + */ + st_code = e->body.tsx_state.tsx->status_code; + ev_state = PJSIP_EVSUB_STATE_TERMINATED; + break; + + case PJSIP_INV_STATE_DISCONNECTED: + st_code = e->body.tsx_state.tsx->status_code; + ev_state = PJSIP_EVSUB_STATE_TERMINATED; + break; + + case PJSIP_INV_STATE_INCOMING: + /* Nothing to do. Just to keep gcc from complaining about + * unused enums. + */ + break; + } + + if (st_code != -1) { + pjsip_tx_data *tdata; + pj_status_t status; + + status = pjsip_xfer_notify (call->getXferSub(), + ev_state, st_code, + NULL, &tdata); + + if (status != PJ_SUCCESS) { + _debug ("UserAgent: Unable to create NOTIFY -- %d\n", status); + } else { + status = pjsip_xfer_send_request (call->getXferSub(), tdata); + + if (status != PJ_SUCCESS) { + _debug ("UserAgent: Unable to send NOTIFY -- %d\n", status); + } + } + } + } else { + + // The call is ringing - We need to handle this case only on outgoing call + if (inv->state == PJSIP_INV_STATE_EARLY && e->body.tsx_state.tsx->role == PJSIP_ROLE_UAC) { + call->setConnectionState (Call::Ringing); + Manager::instance().peerRingingCall (call->getCallId()); + } + + // We receive a ACK - The connection is established + else if (inv->state == PJSIP_INV_STATE_CONFIRMED) { + + /* If the call is a direct IP-to-IP call */ + if (call->getCallConfiguration () == Call::IPtoIP) { + link = SIPVoIPLink::instance (""); + } else { + accId = Manager::instance().getAccountFromCall (call->getCallId()); + link = dynamic_cast<SIPVoIPLink *> (Manager::instance().getAccountLink (accId)); + } + + if (link) + link->SIPCallAnswered (call, rdata); + } + + else if (inv->state == PJSIP_INV_STATE_DISCONNECTED) { + int count = 0; + _debug ("------------------- Call disconnected ---------------------\n"); + _debug ("State: %i, Disconnection cause: %i\n", inv->state, inv->cause); + + switch (inv->cause) { + /* The call terminates normally - BYE / CANCEL */ + + case PJSIP_SC_OK: + + case PJSIP_SC_DECLINE: + + case PJSIP_SC_REQUEST_TERMINATED: + + accId = Manager::instance().getAccountFromCall (call->getCallId()); + link = dynamic_cast<SIPVoIPLink *> (Manager::instance().getAccountLink (accId)); + + if (link) { + link->SIPCallClosed (call); + } + + break; + + /* The call connection failed */ + + case PJSIP_SC_NOT_FOUND: /* peer not found */ + + case PJSIP_SC_REQUEST_TIMEOUT: /* request timeout */ + + case PJSIP_SC_NOT_ACCEPTABLE_HERE: /* no compatible codecs */ + + case PJSIP_SC_NOT_ACCEPTABLE_ANYWHERE: + + case PJSIP_SC_UNSUPPORTED_MEDIA_TYPE: + + case PJSIP_SC_UNAUTHORIZED: + + case PJSIP_SC_REQUEST_PENDING: + accId = Manager::instance().getAccountFromCall (call->getCallId()); + link = dynamic_cast<SIPVoIPLink *> (Manager::instance().getAccountLink (accId)); + + if (link) { + link->SIPCallServerFailure (call); + } + + break; + + default: + _debug ("sipvoiplink.cpp - line 1635 : Unhandled call state. This is probably a bug.\n"); + break; + } + } + + + } +} + +void call_on_media_update (pjsip_inv_session *inv, pj_status_t status) +{ + + _debug ("--------------------- call_on_media_update --------------------- \n"); + + AccountID accId; + SIPVoIPLink *link; + + const pjmedia_sdp_session *r_sdp; + SIPCall *call; + + if (status != PJ_SUCCESS) { + _debug ("Error while negociating the offer\n"); + return; + } + + // Get the new sdp, result of the negociation + pjmedia_sdp_neg_get_active_local (inv->neg, &r_sdp); + + call = reinterpret_cast<SIPCall *> (inv->mod_data[getModId() ]); + + if (!call) { + _debug ("Call declined by peer, SDP negociation stopped\n"); + return; + } + + // Clean the resulting sdp offer to create a new one (in case of a reinvite) + call->getLocalSDP()->clean_session_media(); + + // Set the fresh negociated one + call->getLocalSDP()->set_negociated_offer (r_sdp); + + // call->getLocalSDP()->fetch_media_transport_info_from_remote_sdp( r_sdp ); + // call->getLocalSDP()->fetch_remote_ip_from_sdp( r_sdp ); + // call->getLocalSDP()->fetch_remote_audio_port_from_sdp( r_sdp ); + + accId = Manager::instance().getAccountFromCall (call->getCallId()); + + link = dynamic_cast<SIPVoIPLink *> (Manager::instance().getAccountLink (accId)); + + if (!link) { + _debug ("No Voip Account Link, impossible to init RTP session with SDP info"); + return; + } + + if (call->getState() != Call::Hold) { + _debug ("Set media parameters in RTP session\n"); + // link->_audiortp->getRTX()->setRtpSessionMedia(); + // link->_audiortp->getRTX()->setRtpSessionRemoteIp(); + + // link->_audiortp->start(); + + // call->setAudioStart ( true ); + // link->_audiortp->start(); + } else { + _debug ("Didn't set RTP parameters since call is on hold\n"); + } + + +} + +void call_on_forked (pjsip_inv_session *inv, pjsip_event *e) +{ +} + +void call_on_tsx_changed (pjsip_inv_session *inv, pjsip_transaction *tsx, pjsip_event *e) +{ + + _debug ("--------------------- call_on_tsx_changed --------------------- %i\n", tsx->state); + + if (tsx->role==PJSIP_ROLE_UAS && tsx->state==PJSIP_TSX_STATE_TRYING && + pjsip_method_cmp (&tsx->method, &pjsip_refer_method) ==0) { + /** Handle the refer method **/ + onCallTransfered (inv, e->body.tsx_state.src.rdata); + } +} + +void regc_cb (struct pjsip_regc_cbparam *param) +{ + + //AccountID *id = static_cast<AccountID *> (param->token); + SIPAccount *account; + + //_debug("UserAgent: Account ID is %s, Register result: %d, Status: %d\n", id->data(), param->status, param->code); + account = static_cast<SIPAccount *> (param->token); + + if (!account) + return; + + if (param->status == PJ_SUCCESS) { + if (param->code < 0 || param->code >= 300) { + /* Sometimes, the status is OK, but we still failed. + * So checking the code for real result + */ + _debug ("UserAgent: The error is: %d\n", param->code); + + switch (param->code) { + + case 606: + account->setRegistrationState (ErrorConfStun); + break; + + case 503: + + case 408: + account->setRegistrationState (ErrorHost); + break; + + case 401: + + case 403: + + case 404: + account->setRegistrationState (ErrorAuth); + break; + + default: + account->setRegistrationState (Error); + break; + } + + account->setRegister (false); + } else { + // Registration/Unregistration is success + + if (account->isRegister()) + account->setRegistrationState (Registered); + else { + account->setRegistrationState (Unregistered); + account->setRegister (false); + } + } + } else { + account->setRegistrationState (ErrorAuth); + account->setRegister (false); + } + +} + +pj_bool_t +mod_on_rx_request (pjsip_rx_data *rdata) +{ + + + pj_status_t status; + pj_str_t reason; + unsigned options = 0; + pjsip_dialog* dialog; + pjsip_tx_data *tdata; + AccountID account_id; + pjsip_uri *uri; + pjsip_sip_uri *sip_uri; + std::string userName, server, caller, callerServer, peerNumber; + SIPVoIPLink *link; + CallID id; + SIPCall* call; + pjsip_inv_session *inv; + pjmedia_sdp_session *r_sdp; + + // voicemail part + std::string method_name; + std::string request; + + // Handle the incoming call invite in this function + _debug ("UserAgent: Callback on_rx_request is involved! \n"); + + /* First, let's got the username and server name from the invite. + * We will use them to detect which account is the callee. + */ + uri = rdata->msg_info.to->uri; + sip_uri = (pjsip_sip_uri *) pjsip_uri_get_uri (uri); + + userName = std::string (sip_uri->user.ptr, sip_uri->user.slen); + server = std::string (sip_uri->host.ptr, sip_uri->host.slen); + + std::cout << userName << " ------------------ " << server << std::endl; + + // Get the account id of callee from username and server + account_id = Manager::instance().getAccountIdFromNameAndServer (userName, server); + + /* If we don't find any account to receive the call */ + + if (account_id == AccountNULL) { + _debug ("UserAgent: Username %s doesn't match any account!\n",userName.c_str()); + //return false; + } + + /* Get the voip link associated to the incoming call */ + /* The account must before have been associated to the call in ManagerImpl */ + link = dynamic_cast<SIPVoIPLink *> (Manager::instance().getAccountLink (account_id)); + + /* If we can't find any voIP link to handle the incoming call */ + if (link == 0) { + _debug ("ERROR: can not retrieve the voiplink from the account ID...\n"); + return false; + } + + _debug ("UserAgent: The receiver is : %s@%s\n", userName.data(), server.data()); + + _debug ("UserAgent: The callee account id is %s\n", account_id.c_str()); + + /* Now, it is the time to find the information of the caller */ + uri = rdata->msg_info.from->uri; + sip_uri = (pjsip_sip_uri *) pjsip_uri_get_uri (uri); + + + /* Retrieve only the fisrt characters */ + caller = std::string (sip_uri->user.ptr, sip_uri->user.slen); + callerServer = std::string (sip_uri->host.ptr, sip_uri->host.slen); + peerNumber = caller + "@" + callerServer; + + // Get the server voicemail notification + // Catch the NOTIFY message + + if (rdata->msg_info.msg->line.req.method.id == PJSIP_OTHER_METHOD) { + method_name = "NOTIFY"; + // Retrieve all the message. Should contains only the method name but ... + request = rdata->msg_info.msg->line.req.method.name.ptr; + // Check if the message is a notification + + if (request.find (method_name) != (size_t)-1) { + /* Notify the right account */ + set_voicemail_info (account_id, rdata->msg_info.msg->body); + request.find (method_name); + } + + pjsip_endpt_respond_stateless (_endpt, rdata, PJSIP_SC_OK, NULL, NULL, NULL); + + return true; + } + + // Handle an OPTIONS message + if (rdata->msg_info.msg->line.req.method.id == PJSIP_OPTIONS_METHOD) { + handle_incoming_options (rdata); + return true; + } + + // Respond statelessly any non-INVITE requests with 500 + if (rdata->msg_info.msg->line.req.method.id != PJSIP_INVITE_METHOD) { + if (rdata->msg_info.msg->line.req.method.id != PJSIP_ACK_METHOD) { + pj_strdup2 (_pool, &reason, "user agent unable to handle this request "); + pjsip_endpt_respond_stateless (_endpt, rdata, PJSIP_SC_METHOD_NOT_ALLOWED, &reason, NULL, + NULL); + return true; + } + } + + // Verify that we can handle the request + status = pjsip_inv_verify_request (rdata, &options, NULL, NULL, _endpt, NULL); + + if (status != PJ_SUCCESS) { + pj_strdup2 (_pool, &reason, "user agent unable to handle this INVITE "); + pjsip_endpt_respond_stateless (_endpt, rdata, PJSIP_SC_METHOD_NOT_ALLOWED, &reason, NULL, + NULL); + return true; + } + + /******************************************* URL HOOK *********************************************/ + + if (Manager::instance().getConfigString (HOOKS, URLHOOK_SIP_ENABLED) == "1") { + + std::string header_value; + + header_value = fetch_header_value (rdata->msg_info.msg, Manager::instance().getConfigString (HOOKS, URLHOOK_SIP_FIELD)); + + if (header_value.size () < header_value.max_size()) { + if (header_value!="") { + urlhook->addAction (header_value, + Manager::instance().getConfigString (HOOKS, URLHOOK_COMMAND)); + } + } else + throw length_error ("Url exceeds std::string max_size\n"); + + } + + /************************************************************************************************/ + + // Generate a new call ID for the incoming call! + id = Manager::instance().getNewCallID(); + + call = new SIPCall (id, Call::Incoming, _pool); + + /* If an error occured at the call creation */ + if (!call) { + _debug ("UserAgent: unable to create an incoming call"); + return false; + } + + // Have to do some stuff with the SDP + // Set the codec map, IP, peer number and so on... for the SIPCall object + setCallAudioLocal (call, link->getLocalIPAddress(), link->useStun(), link->getStunServer()); + + // We retrieve the remote sdp offer in the rdata struct to begin the negociation + call->getLocalSDP()->set_ip_address (link->getLocalIPAddress()); + + get_remote_sdp_from_offer (rdata, &r_sdp); + +// _debug("r_sdp = %s\n", r_sdp); + status = call->getLocalSDP()->receiving_initial_offer (r_sdp); + + if (status!=PJ_SUCCESS) { + delete call; + call=0; + return false; + } + + + call->setConnectionState (Call::Progressing); + + call->setPeerNumber (peerNumber); + + call->initRecFileName(); + + // Notify UI there is an incoming call + + if (Manager::instance().incomingCall (call, account_id)) { + // Add this call to the callAccountMap in ManagerImpl + Manager::instance().getAccountLink (account_id)->addCall (call); + } else { + // Fail to notify UI + delete call; + call = NULL; + _debug ("UserAgent: Fail to notify UI!\n"); + return false; + } + + + /* Create the local dialog (UAS) */ + status = pjsip_dlg_create_uas (pjsip_ua_instance(), rdata, NULL, &dialog); + + if (status != PJ_SUCCESS) { + pjsip_endpt_respond_stateless (_endpt, rdata, PJSIP_SC_INTERNAL_SERVER_ERROR, &reason, NULL, + NULL); + return true; + } + + + // Specify media capability during invite session creation + status = pjsip_inv_create_uas (dialog, rdata, call->getLocalSDP()->get_local_sdp_session(), 0, &inv); + + PJ_ASSERT_RETURN (status == PJ_SUCCESS, 1); + + // Associate the call in the invite session + inv->mod_data[_mod_ua.id] = call; + + // Send a 180/Ringing response + status = pjsip_inv_initial_answer (inv, rdata, PJSIP_SC_RINGING, NULL, NULL, &tdata); + + PJ_ASSERT_RETURN (status == PJ_SUCCESS, 1); + + status = pjsip_inv_send_msg (inv, tdata); + + PJ_ASSERT_RETURN (status == PJ_SUCCESS, 1); + + // Associate invite session to the current call + call->setInvSession (inv); + + // Update the connection state + call->setConnectionState (Call::Ringing); + + /* Done */ + return true; + +} + +pj_bool_t mod_on_rx_response (pjsip_rx_data *rdata UNUSED) +{ + + return PJ_SUCCESS; +} + +void onCallTransfered (pjsip_inv_session *inv, pjsip_rx_data *rdata) +{ + + pj_status_t status; + pjsip_tx_data *tdata; + SIPCall *existing_call; + const pj_str_t str_refer_to = { (char*) "Refer-To", 8}; + const pj_str_t str_refer_sub = { (char*) "Refer-Sub", 9 }; + const pj_str_t str_ref_by = { (char*) "Referred-By", 11 }; + pjsip_generic_string_hdr *refer_to; + pjsip_generic_string_hdr *refer_sub; + pjsip_hdr *ref_by_hdr; + pj_bool_t no_refer_sub = PJ_FALSE; + char *uri; + std::string tmp; + pjsip_status_code code; + pjsip_evsub *sub; + + existing_call = (SIPCall *) inv->mod_data[_mod_ua.id]; + + /* Find the Refer-To header */ + refer_to = (pjsip_generic_string_hdr*) + pjsip_msg_find_hdr_by_name (rdata->msg_info.msg, &str_refer_to, NULL); + + if (refer_to == NULL) { + /* Invalid Request. + * No Refer-To header! + */ + _debug ("UserAgent: Received REFER without Refer-To header!\n"); + pjsip_dlg_respond (inv->dlg, rdata, 400, NULL, NULL, NULL); + return; + } + + /* Find optional Refer-Sub header */ + refer_sub = (pjsip_generic_string_hdr*) + pjsip_msg_find_hdr_by_name (rdata->msg_info.msg, &str_refer_sub, NULL); + + if (refer_sub) { + if (!pj_strnicmp2 (&refer_sub->hvalue, "true", 4) ==0) + no_refer_sub = PJ_TRUE; + } + + /* Find optional Referred-By header (to be copied onto outgoing INVITE + * request. + */ + ref_by_hdr = (pjsip_hdr*) + pjsip_msg_find_hdr_by_name (rdata->msg_info.msg, &str_ref_by, + NULL); + + /* Notify callback */ + code = PJSIP_SC_ACCEPTED; + + _debug ("UserAgent: Call to %.*s is being transfered to %.*s\n", + (int) inv->dlg->remote.info_str.slen, + inv->dlg->remote.info_str.ptr, + (int) refer_to->hvalue.slen, + refer_to->hvalue.ptr); + + if (no_refer_sub) { + /* + * Always answer with 2xx. + */ + pjsip_tx_data *tdata; + const pj_str_t str_false = { (char*) "false", 5}; + pjsip_hdr *hdr; + + status = pjsip_dlg_create_response (inv->dlg, rdata, code, NULL, + &tdata); + + if (status != PJ_SUCCESS) { + _debug ("UserAgent: Unable to create 2xx response to REFER -- %d\n", status); + return; + } + + /* Add Refer-Sub header */ + hdr = (pjsip_hdr*) + pjsip_generic_string_hdr_create (tdata->pool, &str_refer_sub, + &str_false); + + pjsip_msg_add_hdr (tdata->msg, hdr); + + + /* Send answer */ + status = pjsip_dlg_send_response (inv->dlg, pjsip_rdata_get_tsx (rdata), + tdata); + + if (status != PJ_SUCCESS) { + _debug ("UserAgent: Unable to create 2xx response to REFER -- %d\n", status); + return; + } + + /* Don't have subscription */ + sub = NULL; + + } else { + + struct pjsip_evsub_user xfer_cb; + pjsip_hdr hdr_list; + + /* Init callback */ + pj_bzero (&xfer_cb, sizeof (xfer_cb)); + xfer_cb.on_evsub_state = &xfer_svr_cb; + + /* Init addiTHIS_FILE, THIS_FILE, tional header list to be sent with REFER response */ + pj_list_init (&hdr_list); + + /* Create transferee event subscription */ + status = pjsip_xfer_create_uas (inv->dlg, &xfer_cb, rdata, &sub); + + if (status != PJ_SUCCESS) { + _debug ("UserAgent: Unable to create xfer uas -- %d\n", status); + pjsip_dlg_respond (inv->dlg, rdata, 500, NULL, NULL, NULL); + return; + } + + /* If there's Refer-Sub header and the value is "true", send back + * Refer-Sub in the response with value "true" too. + */ + if (refer_sub) { + const pj_str_t str_true = { (char*) "true", 4 }; + pjsip_hdr *hdr; + + hdr = (pjsip_hdr*) + pjsip_generic_string_hdr_create (inv->dlg->pool, + &str_refer_sub, + &str_true); + pj_list_push_back (&hdr_list, hdr); + + } + + /* Accept the REFER request, send 2xx. */ + pjsip_xfer_accept (sub, rdata, code, &hdr_list); + + /* Create initial NOTIFY request */ + status = pjsip_xfer_notify (sub, PJSIP_EVSUB_STATE_ACTIVE, + 100, NULL, &tdata); + + if (status != PJ_SUCCESS) { + _debug ("UserAgent: Unable to create NOTIFY to REFER -- %d", status); + return; + } + + /* Send initial NOTIFY request */ + status = pjsip_xfer_send_request (sub, tdata); + + if (status != PJ_SUCCESS) { + _debug ("UserAgent: Unable to send NOTIFY to REFER -- %d\n", status); + return; + } + } + + /* We're cheating here. + * We need to get a null terminated string from a pj_str_t. + * So grab the pointer from the hvalue and NULL terminate it, knowing + * that the NULL position will be occupied by a newline. + */ + uri = refer_to->hvalue.ptr; + + uri[refer_to->hvalue.slen] = '\0'; + + /* Now make the outgoing call. */ + tmp = std::string (uri); + + if (existing_call == NULL) { + _debug ("UserAgent: Call doesn't exist!\n"); + return; + } + + AccountID accId = Manager::instance().getAccountFromCall (existing_call->getCallId()); + + CallID newCallId = Manager::instance().getNewCallID(); + + if (!Manager::instance().outgoingCall (accId, newCallId, tmp)) { + + /* Notify xferer about the error (if we have subscription) */ + if (sub) { + status = pjsip_xfer_notify (sub, PJSIP_EVSUB_STATE_TERMINATED, + 500, NULL, &tdata); + + if (status != PJ_SUCCESS) { + _debug ("UserAgent: Unable to create NOTIFY to REFER -- %d\n", status); + return; + } + + status = pjsip_xfer_send_request (sub, tdata); + + if (status != PJ_SUCCESS) { + _debug ("UserAgent: Unable to send NOTIFY to REFER -- %d\n", status); + return; + } + } + + return; + } + + SIPCall* newCall; + + SIPVoIPLink *link = dynamic_cast<SIPVoIPLink *> (Manager::instance().getAccountLink (accId)); + + if (link) { + newCall = dynamic_cast<SIPCall *> (link->getCall (newCallId)); + + if (!newCall) { + _debug ("UserAgent: can not find the call from sipvoiplink!\n"); + return; + } + } + + if (sub) { + /* Put the server subscription in inv_data. + * Subsequent state changed in pjsua_inv_on_state_changed() will be + * reported back to the server subscription. + */ + newCall->setXferSub (sub); + + /* Put the invite_data in the subscription. */ + pjsip_evsub_set_mod_data (sub, _mod_ua.id, + newCall); + } +} + + + +void xfer_func_cb (pjsip_evsub *sub, pjsip_event *event) +{ + + + PJ_UNUSED_ARG (event); + + /* + * When subscription is accepted (got 200/OK to REFER), check if + * subscription suppressed. + */ + + if (pjsip_evsub_get_state (sub) == PJSIP_EVSUB_STATE_ACCEPTED) { + + _debug ("Transfer accepted! Waiting for notifications. \n"); + + } + + /* + * On incoming NOTIFY, notify application about call transfer progress. + */ + else if (pjsip_evsub_get_state (sub) == PJSIP_EVSUB_STATE_ACTIVE || + pjsip_evsub_get_state (sub) == PJSIP_EVSUB_STATE_TERMINATED) { + pjsip_msg *msg; + pjsip_msg_body *body; + pjsip_status_line status_line; + pj_bool_t is_last; + pj_bool_t cont; + pj_status_t status; + + std::string noresource; + std::string ringing; + std::string request; + + noresource = "noresource"; + ringing = "Ringing"; + + + SIPVoIPLink *link = reinterpret_cast<SIPVoIPLink *> (pjsip_evsub_get_mod_data (sub, _mod_ua.id)); + + /* When subscription is terminated, clear the xfer_sub member of + * the inv_data. + */ + + if (pjsip_evsub_get_state (sub) == PJSIP_EVSUB_STATE_TERMINATED) { + pjsip_evsub_set_mod_data (sub, _mod_ua.id, NULL); + _debug ("UserAgent: Xfer client subscription terminated\n"); + + } + + if (!link || !event) { + /* Application is not interested with call progress status */ + _debug ("UserAgent: Either link or event is empty!\n"); + return; + } + + + + /* This better be a NOTIFY request */ + if (event->type == PJSIP_EVENT_TSX_STATE && + event->body.tsx_state.type == PJSIP_EVENT_RX_MSG) { + + pjsip_rx_data *rdata; + + rdata = event->body.tsx_state.src.rdata; + + + /* Check if there's body */ + msg = rdata->msg_info.msg; + body = msg->body; + + if (!body) { + // if (call->getCallConfiguration () == Call::IPtoIP) { + // _debug("UserAgent: IptoIp NOTIFY without message body\n"); + // } + // else{ + _debug ("UserAgent: Warning! Received NOTIFY without message body\n"); + return; + // } + } + + + + /* Check for appropriate content */ + if (pj_stricmp2 (&body->content_type.type, "message") != 0 || + pj_stricmp2 (&body->content_type.subtype, "sipfrag") != 0) { + _debug ("UserAgent: Warning! Received NOTIFY with non message/sipfrag content\n"); + return; + } + + /* Try to parse the content */ + status = pjsip_parse_status_line ( (char*) body->data, body->len, + &status_line); + + if (status != PJ_SUCCESS) { + _debug ("UserAgent: Warning! Received NOTIFY with invalid message/sipfrag content\n"); + return; + } + + } else { + _debug ("UserAgent: Set code to 500!\n"); + status_line.code = 500; + status_line.reason = *pjsip_get_status_text (500); + } + + + if (event->body.rx_msg.rdata->msg_info.msg_buf != NULL) { + request = event->body.rx_msg.rdata->msg_info.msg_buf; + + if (request.find (noresource) != -1) { + _debug ("UserAgent: NORESOURCE for transfer!\n"); + link->transferStep2(); + pjsip_evsub_terminate (sub, PJ_TRUE); + + Manager::instance().transferFailed(); + return; + } + + if (request.find (ringing) != -1) { + _debug ("UserAgent: transfered call RINGING!\n"); + link->transferStep2(); + pjsip_evsub_terminate (sub, PJ_TRUE); + + Manager::instance().transferSucceded(); + return; + } + } + + + // Get current call + SIPCall *call = dynamic_cast<SIPCall *> (link->getCall (Manager::instance().getCurrentCallId())); + + if (!call) { + _debug ("UserAgent: Call doesn't exit!\n"); + return; + } + + + /* Notify application */ + is_last = (pjsip_evsub_get_state (sub) ==PJSIP_EVSUB_STATE_TERMINATED); + + cont = !is_last; + + if (status_line.code/100 == 2) { + + _debug ("UserAgent: Try to stop rtp!\n"); + pjsip_tx_data *tdata; + + status = pjsip_inv_end_session (call->getInvSession(), PJSIP_SC_GONE, NULL, &tdata); + + if (status != PJ_SUCCESS) { + _debug ("UserAgent: Fail to create end session msg!\n"); + } else { + status = pjsip_inv_send_msg (call->getInvSession(), tdata); + + if (status != PJ_SUCCESS) + _debug ("UserAgent: Fail to send end session msg!\n"); + } + + link->transferStep2(); + + cont = PJ_FALSE; + } + + if (!cont) { + pjsip_evsub_set_mod_data (sub, _mod_ua.id, NULL); + } + + } + +} + + +void xfer_svr_cb (pjsip_evsub *sub, pjsip_event *event) +{ + + + PJ_UNUSED_ARG (event); + + /* + * When subscription is terminated, clear the xfer_sub member of + * the inv_data. + */ + + if (pjsip_evsub_get_state (sub) == PJSIP_EVSUB_STATE_TERMINATED) { + SIPCall *call; + + call = (SIPCall*) pjsip_evsub_get_mod_data (sub, _mod_ua.id); + + if (!call) + return; + + pjsip_evsub_set_mod_data (sub, _mod_ua.id, NULL); + + call->setXferSub (NULL); + + _debug ("UserAgent: Xfer server subscription terminated\n"); + } +} + +void on_rx_offer (pjsip_inv_session *inv, const pjmedia_sdp_session *offer) +{ + + +#ifdef CAN_REINVITE + _debug ("reinvite SIP\n"); + + SIPCall *call; + pj_status_t status; + AccountID accId; + SIPVoIPLink *link; + + call = (SIPCall*) inv->mod_data[getModId() ]; + + if (!call) + return; + + accId = Manager::instance().getAccountFromCall (call->getCallId()); + + link = dynamic_cast<SIPVoIPLink *> (Manager::instance().getAccountLink (accId)); + + call->getLocalSDP()->receiving_initial_offer ( (pjmedia_sdp_session*) offer); + + status=pjsip_inv_set_sdp_answer (call->getInvSession(), call->getLocalSDP()->get_local_sdp_session()); + + if (link) + link->handle_reinvite (call); + +#endif + +} + +void handle_incoming_options (pjsip_rx_data *rdata) +{ + + + pjsip_tx_data *tdata; + pjsip_response_addr res_addr; + const pjsip_hdr *cap_hdr; + pj_status_t status; + + /* Create basic response. */ + status = pjsip_endpt_create_response (_endpt, rdata, PJSIP_SC_OK, NULL, &tdata); + + if (status != PJ_SUCCESS) { + return; + } + + /* Add Allow header */ + cap_hdr = pjsip_endpt_get_capability (_endpt, PJSIP_H_ALLOW, NULL); + + if (cap_hdr) { + pjsip_msg_add_hdr (tdata->msg, (pjsip_hdr*) pjsip_hdr_clone (tdata->pool, cap_hdr)); + } + + /* Add Accept header */ + cap_hdr = pjsip_endpt_get_capability (_endpt, PJSIP_H_ACCEPT, NULL); + + if (cap_hdr) { + pjsip_msg_add_hdr (tdata->msg, (pjsip_hdr*) pjsip_hdr_clone (tdata->pool, cap_hdr)); + } + + /* Add Supported header */ + cap_hdr = pjsip_endpt_get_capability (_endpt, PJSIP_H_SUPPORTED, NULL); + + if (cap_hdr) { + pjsip_msg_add_hdr (tdata->msg, (pjsip_hdr*) pjsip_hdr_clone (tdata->pool, cap_hdr)); + } + + /* Add Allow-Events header from the evsub module */ + cap_hdr = pjsip_evsub_get_allow_events_hdr (NULL); + + if (cap_hdr) { + pjsip_msg_add_hdr (tdata->msg, (pjsip_hdr*) pjsip_hdr_clone (tdata->pool, cap_hdr)); + } + + /* Send response statelessly */ + pjsip_get_response_addr (tdata->pool, rdata, &res_addr); + + status = pjsip_endpt_send_response (_endpt, &res_addr, tdata, NULL, NULL); + + if (status != PJ_SUCCESS) + pjsip_tx_data_dec_ref (tdata); } /*****************************************************************************************************************/ -bool setCallAudioLocal ( SIPCall* call, std::string localIP, bool stun, std::string server ) +bool setCallAudioLocal (SIPCall* call, std::string localIP, bool stun, std::string server) { - // Setting Audio - unsigned int callLocalAudioPort = RANDOM_LOCAL_PORT; - unsigned int callLocalExternAudioPort = callLocalAudioPort; - if ( stun ) - { - // If use Stun server - if ( Manager::instance().behindNat ( server, callLocalAudioPort ) ) - { - callLocalExternAudioPort = Manager::instance().getFirewallPort(); - } - } - _debug ( " Setting local audio port to: %d\n", callLocalAudioPort ); - _debug ( " Setting local audio port (external) to: %d\n", callLocalExternAudioPort ); - // Set local audio port for SIPCall(id) - call->setLocalIp ( localIP ); - call->setLocalAudioPort ( callLocalAudioPort ); - call->setLocalExternAudioPort ( callLocalExternAudioPort ); + // Setting Audio + unsigned int callLocalAudioPort = RANDOM_LOCAL_PORT; + unsigned int callLocalExternAudioPort = callLocalAudioPort; + + if (stun) { + // If use Stun server + if (Manager::instance().behindNat (server, callLocalAudioPort)) { + callLocalExternAudioPort = Manager::instance().getFirewallPort(); + } + } + + _debug (" Setting local audio port to: %d\n", callLocalAudioPort); - call->getLocalSDP()->attribute_port_to_all_media ( callLocalExternAudioPort ); + _debug (" Setting local audio port (external) to: %d\n", callLocalExternAudioPort); - return true; + // Set local audio port for SIPCall(id) + call->setLocalIp (localIP); + call->setLocalAudioPort (callLocalAudioPort); + call->setLocalExternAudioPort (callLocalExternAudioPort); + + call->getLocalSDP()->attribute_port_to_all_media (callLocalExternAudioPort); + + return true; } -std::string fetch_header_value ( pjsip_msg *msg, std::string field ) +std::string fetch_header_value (pjsip_msg *msg, std::string field) { - pj_str_t name; - pjsip_generic_string_hdr * hdr; - std::string value, url; - size_t pos; - std::cout << "fetch header value" << std::endl; + pj_str_t name; + pjsip_generic_string_hdr * hdr; + std::string value, url; + size_t pos; + + std::cout << "fetch header value" << std::endl; + + /* Convert the field name into pjsip type */ + name = pj_str ( (char*) field.c_str()); + + /* Get the header value and convert into string*/ + hdr = (pjsip_generic_string_hdr*) pjsip_msg_find_hdr_by_name (msg, &name, NULL); - /* Convert the field name into pjsip type */ - name = pj_str ( ( char* ) field.c_str() ); + if (!hdr) + return ""; - /* Get the header value and convert into string*/ - hdr = ( pjsip_generic_string_hdr* ) pjsip_msg_find_hdr_by_name ( msg, &name, NULL ); + value = hdr->hvalue.ptr; - if ( !hdr ) - return ""; + if ( (pos=value.find ("\n")) == std::string::npos) { + return ""; + } - value = hdr->hvalue.ptr; - if ( ( pos=value.find ( "\n" ) ) == std::string::npos ) - { - return ""; - } + url = value.substr (0, pos); - url = value.substr ( 0, pos ); - return url; + return url; } diff --git a/sflphone-common/src/user_cfg.h b/sflphone-common/src/user_cfg.h index ee708017505aac2ce43a148e89b77db15dcb8401..f6dc3ab80703b1f8fc02c3694568933f074ee594 100644 --- a/sflphone-common/src/user_cfg.h +++ b/sflphone-common/src/user_cfg.h @@ -48,7 +48,8 @@ #define PREFERENCES "Preferences" /** Section Preferences */ #define CONFIG_DIALPAD "Dialpad.display" /** Display dialpad preferences */ #define CONFIG_SEARCHBAR "Searchbar.display" /** Whether or nor display the search bar */ -#define CONFIG_HISTORY "History.maxCalls" /** Set the maximum number of calls kept */ +#define CONFIG_HISTORY_LIMIT "History.limit" /** Set the maximum number of days kept */ +#define CONFIG_HISTORY_ENABLED "History.enabled" /** Is the history enabled or not */ #define CONFIG_NOTIFY "Notify.all" /** Desktop notification level */ #define CONFIG_MAIL_NOTIFY "Notify.mails" /** Desktop mail notification level */ #define ZONE_TONE "Options.zoneToneChoice" /** Country tone */ @@ -104,7 +105,7 @@ #define DFT_FRAME_SIZE "20" /** Default frame size in millisecond */ #define DFT_SAMPLE_RATE "44100" /** Default sample rate in HZ */ #define DFT_NOTIF_LEVEL "2" /** Default desktop notification level : maximum */ -#define DFT_MAX_CALLS "20" /** Default maximum calls in history */ +#define DFT_HISTORY_LIMIT "30" /** Default maximum days in history */ #define DFT_EXPIRE_VALUE "180" /** Default expire value for registration */ #define DFT_AUDIO_MANAGER "1" /** Default audio manager */ #define DFT_SIP_PORT "5060" diff --git a/sflphone-common/src/voiplink.cpp b/sflphone-common/src/voiplink.cpp index 77a0c95ed11f7cc05646e0baa21a311501310ab8..52a28cd88fdf634a851394b28de3d8736726c2cd 100644 --- a/sflphone-common/src/voiplink.cpp +++ b/sflphone-common/src/voiplink.cpp @@ -24,63 +24,72 @@ #include "voiplink.h" #include "manager.h" -VoIPLink::VoIPLink(const AccountID& accountID) : _accountID(accountID), _localIPAddress("127.0.0.1"), _localPort(0), _initDone(false) +VoIPLink::VoIPLink (const AccountID& accountID) : _accountID (accountID), _localIPAddress ("127.0.0.1"), _localPort (0), _initDone (false) { } -VoIPLink::~VoIPLink (void) +VoIPLink::~VoIPLink (void) { clearCallMap(); } -bool VoIPLink::addCall(Call* call) +bool VoIPLink::addCall (Call* call) { if (call) { - if (getCall(call->getCallId()) == 0) { - ost::MutexLock m(_callMapMutex); - _callMap[call->getCallId()] = call; + if (getCall (call->getCallId()) == NULL) { + ost::MutexLock m (_callMapMutex); + _callMap[call->getCallId() ] = call; } - } + } + return false; } -bool VoIPLink::removeCall(const CallID& id) +bool VoIPLink::removeCall (const CallID& id) { - ost::MutexLock m(_callMapMutex); - if (_callMap.erase(id)) { + ost::MutexLock m (_callMapMutex); + + if (_callMap.erase (id)) { return true; - } + } + return false; } -Call* VoIPLink::getCall(const CallID& id) +Call* VoIPLink::getCall (const CallID& id) { - ost::MutexLock m(_callMapMutex); - CallMap::iterator iter = _callMap.find(id); - if ( iter != _callMap.end() ) { - return iter->second; - } - return 0; + ost::MutexLock m (_callMapMutex); + CallMap::iterator iter = _callMap.find (id); + + if (iter != _callMap.end()) { + return iter->second; + } + + return NULL; } bool VoIPLink::clearCallMap() { - ost::MutexLock m(_callMapMutex); - CallMap::iterator iter = _callMap.begin(); - while( iter != _callMap.end() ) { - // if (iter) ? - delete iter->second; iter->second = 0; - iter++; - } - _callMap.clear(); - return true; + ost::MutexLock m (_callMapMutex); + CallMap::iterator iter = _callMap.begin(); + + while (iter != _callMap.end()) { + // if (iter) ? + delete iter->second; + iter->second = 0; + iter++; + } + + _callMap.clear(); + + return true; } -Account* VoIPLink::getAccountPtr(void) +Account* VoIPLink::getAccountPtr (void) { Account* account; AccountID id; id = getAccountID(); - return Manager::instance().getAccount(id); + return Manager::instance().getAccount (id); } diff --git a/sflphone-common/test/Makefile.am b/sflphone-common/test/Makefile.am index d44914c98b8eef43b4bb2b4357622c146660b20d..bd6654596bf6cf0ed9ba584eba5b5bb208a7bec6 100644 --- a/sflphone-common/test/Makefile.am +++ b/sflphone-common/test/Makefile.am @@ -1,6 +1,6 @@ include ../globals.mak -bin_PROGRAMS = numbercleanerTester pluginmanagerTester hookmanagerTester audiolayerTester rtpTester +noinst_PROGRAMS = numbercleanerTester pluginmanagerTester hookmanagerTester audiolayerTester rtpTester historyTester OBJECT_FILES= \ ../src/sflphoned-managerimpl.o \ @@ -20,7 +20,8 @@ OBJECT_FILES= \ ../src/sflphoned-samplerateconverter.o \ ../src/sflphoned-sdp.o \ ../src/sflphoned-sdpmedia.o \ - ../src/sflphoned-numbercleaner.o + ../src/sflphoned-numbercleaner.o \ + ../src/history/historymanager.o numbercleanerTester_SOURCES = \ numbercleanerTest.h \ @@ -116,3 +117,22 @@ rtpTester_LDADD = \ -luuid \ $(OBJECT_FILES) +historyTester_SOURCES = \ + historyTest.h \ + historyTest.cpp \ + TestMain.cpp + +historyTester_LDADD = \ + ../src/libsflphone.la \ + $(SFLPHONE_LIBS) $(ZEROCONFLIB) $(LIB_DNSSD) \ + @ALSA_LIBS@ \ + @PULSEAUDIO_LIBS@ \ + @CPPUNIT_LIBS@ \ + @CCEXT2_LIBS@ \ + @CCGNU2_LIBS@ \ + @CCRTP_LIBS@ \ + @SAMPLERATE_LIBS@ \ + $(PJSIP_LIBS) \ + -luuid \ + $(OBJECT_FILES) + diff --git a/sflphone-common/test/TestMain.cpp b/sflphone-common/test/TestMain.cpp index 1bca8aeab19da9bab970ca4a6d462370aa775493..d6e9f932bfb83bbba4442748945c5fd8c53e406b 100644 --- a/sflphone-common/test/TestMain.cpp +++ b/sflphone-common/test/TestMain.cpp @@ -1,10 +1,10 @@ #include <cppunit/TextTestRunner.h> #include <cppunit/extensions/TestFactoryRegistry.h> -int main(int argc, const char* argv[]) +int main (int argc, const char* argv[]) { CppUnit::TextTestRunner runner; - runner.addTest(CppUnit::TestFactoryRegistry::getRegistry().makeTest()); + runner.addTest (CppUnit::TestFactoryRegistry::getRegistry().makeTest()); return runner.run(); diff --git a/sflphone-common/test/audiolayerTest.cpp b/sflphone-common/test/audiolayerTest.cpp index 4a4b6396f32bc50f9f9a036a9455d139dbb8dad1..880ec8474055d517dff3465c88ab915ca9a6bed0 100644 --- a/sflphone-common/test/audiolayerTest.cpp +++ b/sflphone-common/test/audiolayerTest.cpp @@ -30,7 +30,8 @@ using std::endl; -void AudioLayerTest::setUp(){ +void AudioLayerTest::setUp() +{ // Instanciate the manager Manager::instance().initConfigFile(); @@ -57,150 +58,157 @@ void AudioLayerTest::setUp(){ // get a pointer to the audio layer // _audiodriver = Manager::instance().getAudioDriver(); - + } -void AudioLayerTest::testAudioLayerConfig(){ - int sampling_rate = Manager::instance().getConfigInt(AUDIO, ALSA_SAMPLE_RATE); - int frame_size = Manager::instance().getConfigInt(AUDIO, ALSA_FRAME_SIZE); +void AudioLayerTest::testAudioLayerConfig() +{ + int sampling_rate = Manager::instance().getConfigInt (AUDIO, ALSA_SAMPLE_RATE); + int frame_size = Manager::instance().getConfigInt (AUDIO, ALSA_FRAME_SIZE); - CPPUNIT_ASSERT(Manager::instance().getAudioDriver()->getSampleRate() == sampling_rate); - CPPUNIT_ASSERT(Manager::instance().getAudioDriver()->getFrameSize() == frame_size); + CPPUNIT_ASSERT (Manager::instance().getAudioDriver()->getSampleRate() == sampling_rate); + CPPUNIT_ASSERT (Manager::instance().getAudioDriver()->getFrameSize() == frame_size); } -void AudioLayerTest::testAudioLayerSwitch(){ - - _debug("---------- AudioLayerTest::testAudioLayerSwitch ---------------------------\n"); - - - int previous_layer = Manager::instance().getAudioDriver()->getLayerType(); - - for(int i = 0; i < 2; i++) { - _debug("---------- AudioLayerTest::testAudioLayerSwitch - %i -------------\n",i); - Manager::instance().switchAudioManager(); - if(previous_layer == ALSA) { - CPPUNIT_ASSERT(Manager::instance().getAudioDriver()->getLayerType() == PULSEAUDIO); - } - else { - CPPUNIT_ASSERT(Manager::instance().getAudioDriver()->getLayerType() == ALSA); +void AudioLayerTest::testAudioLayerSwitch() +{ + + _debug ("---------- AudioLayerTest::testAudioLayerSwitch ---------------------------\n"); + + + int previous_layer = Manager::instance().getAudioDriver()->getLayerType(); + + for (int i = 0; i < 2; i++) { + _debug ("---------- AudioLayerTest::testAudioLayerSwitch - %i -------------\n",i); + Manager::instance().switchAudioManager(); + + if (previous_layer == ALSA) { + CPPUNIT_ASSERT (Manager::instance().getAudioDriver()->getLayerType() == PULSEAUDIO); + } else { + CPPUNIT_ASSERT (Manager::instance().getAudioDriver()->getLayerType() == ALSA); + } + + previous_layer = Manager::instance().getAudioDriver()->getLayerType(); + + usleep (100000); } - previous_layer = Manager::instance().getAudioDriver()->getLayerType(); - usleep(100000); - } } -void AudioLayerTest::testPulseConnect(){ +void AudioLayerTest::testPulseConnect() +{ - _debug("---------- AudioLayerTest::testPulseConnect ---------------------------\n"); + _debug ("---------- AudioLayerTest::testPulseConnect ---------------------------\n"); - ManagerImpl* manager; - manager = &Manager::instance(); + ManagerImpl* manager; + manager = &Manager::instance(); - _pulselayer = new PulseLayer(manager); + _pulselayer = new PulseLayer (manager); - CPPUNIT_ASSERT(_pulselayer->getLayerType() == PULSEAUDIO); + CPPUNIT_ASSERT (_pulselayer->getLayerType() == PULSEAUDIO); - std::string alsaPlugin; - int numCardIn, numCardOut, sampleRate, frameSize; - - alsaPlugin = manager->getConfigString( AUDIO , ALSA_PLUGIN ); - numCardIn = manager->getConfigInt( AUDIO , ALSA_CARD_ID_IN ); - numCardOut = manager->getConfigInt( AUDIO , ALSA_CARD_ID_OUT ); - sampleRate = manager->getConfigInt( AUDIO , ALSA_SAMPLE_RATE ); - frameSize = manager->getConfigInt(AUDIO, ALSA_FRAME_SIZE ); - - CPPUNIT_ASSERT(_pulselayer->getPlaybackStream() == NULL); - CPPUNIT_ASSERT(_pulselayer->getRecordStream() == NULL); + std::string alsaPlugin; + int numCardIn, numCardOut, sampleRate, frameSize; - _pulselayer->setErrorMessage(-1); - try { - CPPUNIT_ASSERT(_pulselayer->openDevice(numCardIn, numCardOut, sampleRate, frameSize, SFL_PCM_BOTH, alsaPlugin) == true); - } - catch (...) { - _debug("Exception occured wile opening device! \n"); - } + alsaPlugin = manager->getConfigString (AUDIO , ALSA_PLUGIN); + numCardIn = manager->getConfigInt (AUDIO , ALSA_CARD_ID_IN); + numCardOut = manager->getConfigInt (AUDIO , ALSA_CARD_ID_OUT); + sampleRate = manager->getConfigInt (AUDIO , ALSA_SAMPLE_RATE); + frameSize = manager->getConfigInt (AUDIO, ALSA_FRAME_SIZE); - usleep(100000); + CPPUNIT_ASSERT (_pulselayer->getPlaybackStream() == NULL); + CPPUNIT_ASSERT (_pulselayer->getRecordStream() == NULL); - CPPUNIT_ASSERT(_pulselayer->getPlaybackStream() != NULL); - CPPUNIT_ASSERT(_pulselayer->getRecordStream() != NULL); + _pulselayer->setErrorMessage (-1); - CPPUNIT_ASSERT(_pulselayer->getPlaybackStream()->pulseStream() != NULL); - CPPUNIT_ASSERT(_pulselayer->getRecordStream()->pulseStream() != NULL); + try { + CPPUNIT_ASSERT (_pulselayer->openDevice (numCardIn, numCardOut, sampleRate, frameSize, SFL_PCM_BOTH, alsaPlugin) == true); + } catch (...) { + _debug ("Exception occured wile opening device! \n"); + } + + usleep (100000); + + CPPUNIT_ASSERT (_pulselayer->getPlaybackStream() != NULL); + CPPUNIT_ASSERT (_pulselayer->getRecordStream() != NULL); + + CPPUNIT_ASSERT (_pulselayer->getPlaybackStream()->pulseStream() != NULL); + CPPUNIT_ASSERT (_pulselayer->getRecordStream()->pulseStream() != NULL); - // Must return Access failure "PA_ERR_ACCESS" == 2 - CPPUNIT_ASSERT(_pulselayer->getPlaybackStream()->getStreamState() == 2); - CPPUNIT_ASSERT(_pulselayer->getRecordStream()->getStreamState() == 2); + // Must return Access failure "PA_ERR_ACCESS" == 2 + CPPUNIT_ASSERT (_pulselayer->getPlaybackStream()->getStreamState() == 2); + CPPUNIT_ASSERT (_pulselayer->getRecordStream()->getStreamState() == 2); - CPPUNIT_ASSERT(_pulselayer->createStreams(_pulselayer->context) == true); + CPPUNIT_ASSERT (_pulselayer->createStreams (_pulselayer->context) == true); - // usleep(1000000); + // usleep(1000000); - CPPUNIT_ASSERT(_pulselayer->getPlaybackStream()->pulseStream() != NULL); - CPPUNIT_ASSERT(_pulselayer->getPlaybackStream()->pulseStream() != NULL); + CPPUNIT_ASSERT (_pulselayer->getPlaybackStream()->pulseStream() != NULL); + CPPUNIT_ASSERT (_pulselayer->getPlaybackStream()->pulseStream() != NULL); - // Must return No error "PA_OK" == 1 - CPPUNIT_ASSERT(_pulselayer->getPlaybackStream()->getStreamState() == 1); - CPPUNIT_ASSERT(_pulselayer->getRecordStream()->getStreamState() == 1); + // Must return No error "PA_OK" == 1 + CPPUNIT_ASSERT (_pulselayer->getPlaybackStream()->getStreamState() == 1); + CPPUNIT_ASSERT (_pulselayer->getRecordStream()->getStreamState() == 1); - CPPUNIT_ASSERT(_pulselayer->getPlaybackStream()->disconnectStream() == true); - CPPUNIT_ASSERT(_pulselayer->getRecordStream()->disconnectStream() == true); + CPPUNIT_ASSERT (_pulselayer->getPlaybackStream()->disconnectStream() == true); + CPPUNIT_ASSERT (_pulselayer->getRecordStream()->disconnectStream() == true); - // _debug("%i\n",_pulselayer->getPlaybackStream()->getStreamState()); + // _debug("%i\n",_pulselayer->getPlaybackStream()->getStreamState()); - CPPUNIT_ASSERT(_pulselayer->getPlaybackStream()->connectStream() == true); - CPPUNIT_ASSERT(_pulselayer->getRecordStream()->connectStream() == true); + CPPUNIT_ASSERT (_pulselayer->getPlaybackStream()->connectStream() == true); + CPPUNIT_ASSERT (_pulselayer->getRecordStream()->connectStream() == true); - CPPUNIT_ASSERT(_pulselayer->getPlaybackStream()->getStreamState() == 1); - CPPUNIT_ASSERT(_pulselayer->getRecordStream()->getStreamState() == 1); + CPPUNIT_ASSERT (_pulselayer->getPlaybackStream()->getStreamState() == 1); + CPPUNIT_ASSERT (_pulselayer->getRecordStream()->getStreamState() == 1); - CPPUNIT_ASSERT(_pulselayer->getPlaybackStream()->connectStream() == true); - CPPUNIT_ASSERT(_pulselayer->getRecordStream()->connectStream() == true); + CPPUNIT_ASSERT (_pulselayer->getPlaybackStream()->connectStream() == true); + CPPUNIT_ASSERT (_pulselayer->getRecordStream()->connectStream() == true); - CPPUNIT_ASSERT(_pulselayer->getPlaybackStream()->getStreamState() == 1); - CPPUNIT_ASSERT(_pulselayer->getRecordStream()->getStreamState() == 1); + CPPUNIT_ASSERT (_pulselayer->getPlaybackStream()->getStreamState() == 1); + CPPUNIT_ASSERT (_pulselayer->getRecordStream()->getStreamState() == 1); - // usleep(1000000); - CPPUNIT_ASSERT(_pulselayer->disconnectPulseAudioServer() == true); + // usleep(1000000); + CPPUNIT_ASSERT (_pulselayer->disconnectPulseAudioServer() == true); } -void AudioLayerTest::testAlsaConnect(){ +void AudioLayerTest::testAlsaConnect() +{ - _debug("---------- AudioLayerTest::testAlsaConnect ---------------------------\n"); + _debug ("---------- AudioLayerTest::testAlsaConnect ---------------------------\n"); + + int layer = Manager::instance().getAudioDriver()->getLayerType(); + + int type, samplerate, framesize, numCardIn, numCardOut; + std::string alsaPlugin; + + if (layer != ALSA) { + Manager::instance().switchAudioManager(); + usleep (100000); + } - int layer = Manager::instance().getAudioDriver()->getLayerType(); + // _audiolayer = Manager::instance().getAudioDriver(); - int type, samplerate, framesize, numCardIn, numCardOut; - std::string alsaPlugin; + // CPPUNIT_ASSERT(_audiolayer->closeLayer() == true); + // usleep(100000); - if (layer != ALSA) { - Manager::instance().switchAudioManager(); - usleep(100000); - } + // delete _audiolayer; _audiolayer == NULL; - // _audiolayer = Manager::instance().getAudioDriver(); - - // CPPUNIT_ASSERT(_audiolayer->closeLayer() == true); - // usleep(100000); + Manager::instance().setConfig (PREFERENCES, CONFIG_AUDIO, ALSA); - // delete _audiolayer; _audiolayer == NULL; - Manager::instance().setConfig( PREFERENCES, CONFIG_AUDIO, ALSA); + // _audiolayer->setErrorMessage(-1); + // CPPUNIT_ASSERT(Manager::instance().initAudioDriver() == true); - - // _audiolayer->setErrorMessage(-1); - // CPPUNIT_ASSERT(Manager::instance().initAudioDriver() == true); + // _audiolayer = Manager::instance().getAudioDriver(); - // _audiolayer = Manager::instance().getAudioDriver(); - - // CPPUNIT_ASSERT(_audiolayer->getLayerType() == ALSA); + // CPPUNIT_ASSERT(_audiolayer->getLayerType() == ALSA); } -void AudioLayerTest::tearDown(){ +void AudioLayerTest::tearDown() +{ // Delete the audio recorder module // delete _ar; _ar = NULL; } diff --git a/sflphone-common/test/audiorecorderTest.cpp b/sflphone-common/test/audiorecorderTest.cpp index 9c0bf863edb284f29fcd5f7361c6ede3da6b68a8..fc349f08c20745dc684918034cd920705d9dec91 100644 --- a/sflphone-common/test/audiorecorderTest.cpp +++ b/sflphone-common/test/audiorecorderTest.cpp @@ -25,33 +25,37 @@ using std::cout; using std::endl; -void AudioRecorderTest::setUp(){ +void AudioRecorderTest::setUp() +{ // Instanciate the object _ar = new AudioRecord(); } -void AudioRecorderTest::testRecordData(){ - -/* - FILE_TYPE ft = FILE_WAV; - SOUND_FORMAT sf = INT16; - _ar->setSndSamplingRate(44100); - _ar->openFile("theWavFile.wav",ft,sf); - - cout << "file opened!\n"; - - SFLDataFormat buf [2]; - for (SFLDataFormat i = -32768; i < 32767; i++ ){ - buf[0] = i; - buf[1] = i; - _ar->recData(buf,2); - } - - _ar->closeFile(); -*/ +void AudioRecorderTest::testRecordData() +{ + + /* + FILE_TYPE ft = FILE_WAV; + SOUND_FORMAT sf = INT16; + _ar->setSndSamplingRate(44100); + _ar->openFile("theWavFile.wav",ft,sf); + + cout << "file opened!\n"; + + SFLDataFormat buf [2]; + for (SFLDataFormat i = -32768; i < 32767; i++ ){ + buf[0] = i; + buf[1] = i; + _ar->recData(buf,2); + } + + _ar->closeFile(); + */ } -void AudioRecorderTest::tearDown(){ +void AudioRecorderTest::tearDown() +{ // Delete the audio recorder module - delete _ar; _ar = NULL; + delete _ar; + _ar = NULL; } diff --git a/sflphone-common/test/configurationTest.cpp b/sflphone-common/test/configurationTest.cpp index 8208c9944fa6699baa92d5aabf63ff621af995c5..228d6347af09cdb62491f65357890436881c69ec 100644 --- a/sflphone-common/test/configurationTest.cpp +++ b/sflphone-common/test/configurationTest.cpp @@ -25,46 +25,51 @@ using std::cout; using std::endl; -void ConfigurationTest::setUp(){ +void ConfigurationTest::setUp() +{ // Load the default configuration Manager::instance().initConfigFile(); } -void ConfigurationTest::testDefaultValueAudio(){ - CPPUNIT_ASSERT( Manager::instance().getConfigString( AUDIO, ALSA_CARD_ID_IN ) == ALSA_DFT_CARD) ; - CPPUNIT_ASSERT( Manager::instance().getConfigString( AUDIO, ALSA_CARD_ID_OUT ) == ALSA_DFT_CARD ); - CPPUNIT_ASSERT( Manager::instance().getConfigString( AUDIO, ALSA_SAMPLE_RATE ) == DFT_SAMPLE_RATE); - CPPUNIT_ASSERT( Manager::instance().getConfigString( AUDIO, ALSA_FRAME_SIZE ) == DFT_FRAME_SIZE) ; - CPPUNIT_ASSERT( Manager::instance().getConfigString( AUDIO, ALSA_PLUGIN ) == PCM_DEFAULT ); - CPPUNIT_ASSERT( Manager::instance().getConfigString( AUDIO, VOLUME_SPKR ) == DFT_VOL_SPKR_STR); - CPPUNIT_ASSERT( Manager::instance().getConfigString( AUDIO, VOLUME_MICRO ) == DFT_VOL_MICRO_STR); +void ConfigurationTest::testDefaultValueAudio() +{ + CPPUNIT_ASSERT (Manager::instance().getConfigString (AUDIO, ALSA_CARD_ID_IN) == ALSA_DFT_CARD) ; + CPPUNIT_ASSERT (Manager::instance().getConfigString (AUDIO, ALSA_CARD_ID_OUT) == ALSA_DFT_CARD); + CPPUNIT_ASSERT (Manager::instance().getConfigString (AUDIO, ALSA_SAMPLE_RATE) == DFT_SAMPLE_RATE); + CPPUNIT_ASSERT (Manager::instance().getConfigString (AUDIO, ALSA_FRAME_SIZE) == DFT_FRAME_SIZE) ; + CPPUNIT_ASSERT (Manager::instance().getConfigString (AUDIO, ALSA_PLUGIN) == PCM_DEFAULT); + CPPUNIT_ASSERT (Manager::instance().getConfigString (AUDIO, VOLUME_SPKR) == DFT_VOL_SPKR_STR); + CPPUNIT_ASSERT (Manager::instance().getConfigString (AUDIO, VOLUME_MICRO) == DFT_VOL_MICRO_STR); } -void ConfigurationTest::testDefaultValuePreferences(){ - CPPUNIT_ASSERT( Manager::instance().getConfigString( PREFERENCES, ZONE_TONE ) == DFT_ZONE ); - CPPUNIT_ASSERT( Manager::instance().getConfigString( PREFERENCES, CONFIG_ZEROCONF ) == CONFIG_ZEROCONF_DEFAULT_STR ); - CPPUNIT_ASSERT( Manager::instance().getConfigString( PREFERENCES, CONFIG_DIALPAD ) == YES_STR ); - CPPUNIT_ASSERT( Manager::instance().getConfigString( PREFERENCES, CONFIG_RINGTONE ) == YES_STR ); - CPPUNIT_ASSERT( Manager::instance().getConfigString( PREFERENCES, CONFIG_SEARCHBAR ) == YES_STR ); - CPPUNIT_ASSERT( Manager::instance().getConfigString( PREFERENCES, CONFIG_START ) == NO_STR ); - CPPUNIT_ASSERT( Manager::instance().getConfigString( PREFERENCES, CONFIG_POPUP ) == YES_STR ); - CPPUNIT_ASSERT( Manager::instance().getConfigString( PREFERENCES, CONFIG_NOTIFY ) == YES_STR ); - CPPUNIT_ASSERT( Manager::instance().getConfigString( PREFERENCES, CONFIG_MAIL_NOTIFY ) == NO_STR ); - CPPUNIT_ASSERT( Manager::instance().getConfigString( PREFERENCES, CONFIG_VOLUME ) == YES_STR ); - CPPUNIT_ASSERT( Manager::instance().getConfigString( PREFERENCES, REGISTRATION_EXPIRE ) == DFT_EXPIRE_VALUE ); - CPPUNIT_ASSERT( Manager::instance().getConfigString( PREFERENCES, CONFIG_AUDIO ) == DFT_AUDIO_MANAGER ); +void ConfigurationTest::testDefaultValuePreferences() +{ + CPPUNIT_ASSERT (Manager::instance().getConfigString (PREFERENCES, ZONE_TONE) == DFT_ZONE); + CPPUNIT_ASSERT (Manager::instance().getConfigString (PREFERENCES, CONFIG_ZEROCONF) == CONFIG_ZEROCONF_DEFAULT_STR); + CPPUNIT_ASSERT (Manager::instance().getConfigString (PREFERENCES, CONFIG_DIALPAD) == YES_STR); + CPPUNIT_ASSERT (Manager::instance().getConfigString (PREFERENCES, CONFIG_RINGTONE) == YES_STR); + CPPUNIT_ASSERT (Manager::instance().getConfigString (PREFERENCES, CONFIG_SEARCHBAR) == YES_STR); + CPPUNIT_ASSERT (Manager::instance().getConfigString (PREFERENCES, CONFIG_START) == NO_STR); + CPPUNIT_ASSERT (Manager::instance().getConfigString (PREFERENCES, CONFIG_POPUP) == YES_STR); + CPPUNIT_ASSERT (Manager::instance().getConfigString (PREFERENCES, CONFIG_NOTIFY) == YES_STR); + CPPUNIT_ASSERT (Manager::instance().getConfigString (PREFERENCES, CONFIG_MAIL_NOTIFY) == NO_STR); + CPPUNIT_ASSERT (Manager::instance().getConfigString (PREFERENCES, CONFIG_VOLUME) == YES_STR); + CPPUNIT_ASSERT (Manager::instance().getConfigString (PREFERENCES, REGISTRATION_EXPIRE) == DFT_EXPIRE_VALUE); + CPPUNIT_ASSERT (Manager::instance().getConfigString (PREFERENCES, CONFIG_AUDIO) == DFT_AUDIO_MANAGER); } -void ConfigurationTest::testDefaultValueSignalisation(){ - CPPUNIT_ASSERT( Manager::instance().getConfigString( SIGNALISATION , SYMMETRIC ) == YES_STR ); - CPPUNIT_ASSERT( Manager::instance().getConfigString( SIGNALISATION , PLAY_DTMF ) == YES_STR ); - CPPUNIT_ASSERT( Manager::instance().getConfigString( SIGNALISATION , PLAY_TONES ) == YES_STR ); - CPPUNIT_ASSERT( Manager::instance().getConfigString( SIGNALISATION , PULSE_LENGTH ) == DFT_PULSE_LENGTH_STR ); - CPPUNIT_ASSERT( Manager::instance().getConfigString( SIGNALISATION , SEND_DTMF_AS ) == SIP_INFO_STR ); +void ConfigurationTest::testDefaultValueSignalisation() +{ + CPPUNIT_ASSERT (Manager::instance().getConfigString (SIGNALISATION , SYMMETRIC) == YES_STR); + CPPUNIT_ASSERT (Manager::instance().getConfigString (SIGNALISATION , PLAY_DTMF) == YES_STR); + CPPUNIT_ASSERT (Manager::instance().getConfigString (SIGNALISATION , PLAY_TONES) == YES_STR); + CPPUNIT_ASSERT (Manager::instance().getConfigString (SIGNALISATION , PULSE_LENGTH) == DFT_PULSE_LENGTH_STR); + CPPUNIT_ASSERT (Manager::instance().getConfigString (SIGNALISATION , SEND_DTMF_AS) == SIP_INFO_STR); } -void ConfigurationTest::testLoadSIPAccount(){ +void ConfigurationTest::testLoadSIPAccount() +{ AccountMap accounts; Account *current; @@ -73,65 +78,70 @@ void ConfigurationTest::testLoadSIPAccount(){ // Load the account from the user file nb_account = Manager::instance().loadAccountMap(); - CPPUNIT_ASSERT_EQUAL( 1, nb_account ); + CPPUNIT_ASSERT_EQUAL (1, nb_account); // Save the account information accounts = Manager::instance()._accountMap; - - AccountMap::iterator iter = accounts.begin(); - CPPUNIT_ASSERT( Manager::instance().accountExists( iter->first ) == true ); - - while( iter != accounts.end() ){ + + AccountMap::iterator iter = accounts.begin(); + CPPUNIT_ASSERT (Manager::instance().accountExists (iter->first) == true); + + while (iter != accounts.end()) { current = iter->second; - CPPUNIT_ASSERT( iter->first == current->getAccountID() ); - CPPUNIT_ASSERT( 0 == current->getVoIPLink() ); + CPPUNIT_ASSERT (iter->first == current->getAccountID()); + CPPUNIT_ASSERT (0 == current->getVoIPLink()); iter++; } -} +} -void ConfigurationTest::testUnloadSIPAccount(){ +void ConfigurationTest::testUnloadSIPAccount() +{ AccountMap accounts; // Load the accounts from the user file - Manager::instance().loadAccountMap(); + Manager::instance().loadAccountMap(); // Unload the accounts Manager::instance().unloadAccountMap(); // Save the account information accounts = Manager::instance()._accountMap; - - AccountMap::iterator iter = accounts.begin(); - CPPUNIT_ASSERT( Manager::instance().accountExists( iter->first ) == false ); - - if( iter != accounts.end() ){ - CPPUNIT_FAIL("Unload account map failed\n"); + + AccountMap::iterator iter = accounts.begin(); + CPPUNIT_ASSERT (Manager::instance().accountExists (iter->first) == false); + + if (iter != accounts.end()) { + CPPUNIT_FAIL ("Unload account map failed\n"); } } -void ConfigurationTest::testInitVolume(){ - +void ConfigurationTest::testInitVolume() +{ + Manager::instance().initVolume(); - CPPUNIT_ASSERT( Manager::instance().getConfigInt( AUDIO, VOLUME_SPKR) == Manager::instance().getSpkrVolume() ); - CPPUNIT_ASSERT( Manager::instance().getConfigInt( AUDIO, VOLUME_MICRO) == Manager::instance().getMicVolume() ); + CPPUNIT_ASSERT (Manager::instance().getConfigInt (AUDIO, VOLUME_SPKR) == Manager::instance().getSpkrVolume()); + CPPUNIT_ASSERT (Manager::instance().getConfigInt (AUDIO, VOLUME_MICRO) == Manager::instance().getMicVolume()); } -void ConfigurationTest::testInitAudioDriver(){ - +void ConfigurationTest::testInitAudioDriver() +{ + // Load the audio driver Manager::instance().initAudioDriver(); - + // Check the creation - if( Manager::instance().getAudioDriver() == NULL ) - CPPUNIT_FAIL("Error while loading audio layer"); + + if (Manager::instance().getAudioDriver() == NULL) + CPPUNIT_FAIL ("Error while loading audio layer"); // Check if it has been created with the right type - if( Manager::instance().getConfigInt( PREFERENCES, CONFIG_AUDIO ) == ALSA ) - CPPUNIT_ASSERT_EQUAL( Manager::instance().getAudioDriver()->getLayerType(), ALSA ); - else if( Manager::instance().getConfigInt( PREFERENCES, CONFIG_AUDIO ) == PULSEAUDIO ) - CPPUNIT_ASSERT_EQUAL( Manager::instance().getAudioDriver()->getLayerType(), PULSEAUDIO ); + if (Manager::instance().getConfigInt (PREFERENCES, CONFIG_AUDIO) == ALSA) + CPPUNIT_ASSERT_EQUAL (Manager::instance().getAudioDriver()->getLayerType(), ALSA); + else if (Manager::instance().getConfigInt (PREFERENCES, CONFIG_AUDIO) == PULSEAUDIO) + CPPUNIT_ASSERT_EQUAL (Manager::instance().getAudioDriver()->getLayerType(), PULSEAUDIO); else - CPPUNIT_FAIL("Wrong audio layer type"); + CPPUNIT_FAIL ("Wrong audio layer type"); } -void ConfigurationTest::testSelectAudioDriver(){ +void ConfigurationTest::testSelectAudioDriver() +{ } diff --git a/sflphone-common/test/history-sample b/sflphone-common/test/history-sample new file mode 100644 index 0000000000000000000000000000000000000000..a6f39f4ed3316e02f1d5d3b750efc16ad43276d5 --- /dev/null +++ b/sflphone-common/test/history-sample @@ -0,0 +1,21 @@ +[144562436] +accountid= +name=Savoir-faire Linux +number=514-276-5468 +timestamp_stop=144562458 +type=0 + +[747638685] +accountid=Account:1239059899 +name=Emmanuel Milou +number=136 +timestamp_stop=747638765 +type=2 + +[775354456] +accountid=Account:43789459478 +name= +number=5143848557 +timestamp_stop=775354987 +type=1 + diff --git a/sflphone-common/test/history-sample.tpl b/sflphone-common/test/history-sample.tpl new file mode 100644 index 0000000000000000000000000000000000000000..221e449538f4d36e20f35bcb1c6d0dc1721e515e --- /dev/null +++ b/sflphone-common/test/history-sample.tpl @@ -0,0 +1,20 @@ +[144562436] +number=514-276-5468 +name=Savoir-faire Linux +type=0 +timestamp_stop=144562458 +accountid= + +[747638685] +name=Emmanuel Milou +timestamp_stop=747638765 +number=136 +type=2 +accountid=Account:1239059899 + +[775354456] +number=5143848557 +name= +timestamp_stop=775354987 +type=1 +accountid=Account:43789459478 diff --git a/sflphone-common/test/historyTest.cpp b/sflphone-common/test/historyTest.cpp new file mode 100644 index 0000000000000000000000000000000000000000..105cee3001bd29aa9e6ce7ff7d598942e5732275 --- /dev/null +++ b/sflphone-common/test/historyTest.cpp @@ -0,0 +1,210 @@ +/* + * Copyright (C) 2009 Savoir-Faire Linux inc. + * Author: Emmanuel Milou <emmanuel.milou@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 + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include <stdio.h> +#include <sstream> + +#include "historyTest.h" +#include "manager.h" + +using std::cout; +using std::endl; + +#define HOMEDIR (getenv ("HOME")) +#define HISTORY_SAMPLE "history-sample" +#define HISTORY_SAMPLE_SIZE 3 +#define CONFIG_SAMPLE "sflphonedrc-sample" +#define HUGE_HISTORY_LIMIT 20000 + +void HistoryTest::setUp() +{ + // Instanciate the cleaner singleton + history = new HistoryManager (); +} + +void HistoryTest::test_create_history_path () +{ + + int result; + std::string path; + + path = HOMEDIR; + path += "/.sflphone/history"; + result = history->create_history_path (); + CPPUNIT_ASSERT (result == 0); + CPPUNIT_ASSERT (!history->is_loaded ()); + CPPUNIT_ASSERT (history->_history_path == path); +} + +void HistoryTest::test_load_history_from_file () +{ + bool res; + Conf::ConfigTree history_list; + + history->create_history_path (); + res = history->load_history_from_file (&history_list); + + CPPUNIT_ASSERT (history->is_loaded ()); + CPPUNIT_ASSERT (res == true); +} + +void HistoryTest::test_load_history_items_map () +{ + std::string path; + int nb_items; + Conf::ConfigTree history_list; + + history->set_history_path (HISTORY_SAMPLE); + history->load_history_from_file (&history_list); + nb_items = history->load_history_items_map (&history_list, HUGE_HISTORY_LIMIT); + CPPUNIT_ASSERT (nb_items == HISTORY_SAMPLE_SIZE); + CPPUNIT_ASSERT (history->get_history_size () == HISTORY_SAMPLE_SIZE); +} + +void HistoryTest::test_save_history_items_map () +{ + std::string path; + int nb_items_loaded, nb_items_saved; + Conf::ConfigTree history_list, history_list2; + + history->set_history_path (HISTORY_SAMPLE); + history->load_history_from_file (&history_list); + nb_items_loaded = history->load_history_items_map (&history_list, HUGE_HISTORY_LIMIT); + nb_items_saved = history->save_history_items_map (&history_list2); + CPPUNIT_ASSERT (nb_items_loaded == nb_items_saved); +} + +void HistoryTest::test_save_history_to_file () +{ + std::string path; + Conf::ConfigTree history_list, history_list2; + std::map <std::string, std::string> res; + std::map <std::string, std::string>::iterator iter; + + history->set_history_path (HISTORY_SAMPLE); + history->load_history_from_file (&history_list); + history->load_history_items_map (&history_list, HUGE_HISTORY_LIMIT); + history->save_history_items_map (&history_list2); + CPPUNIT_ASSERT (history->save_history_to_file (&history_list2)); +} + +void HistoryTest::test_get_history_serialized () +{ + std::map <std::string, std::string> res; + std::map <std::string, std::string>::iterator iter; + std::string tmp; + + // Load the sample user config + Manager::instance().initConfigFile (true, CONFIG_SAMPLE); + Manager::instance().loadAccountMap (); + + CPPUNIT_ASSERT (history->load_history (HUGE_HISTORY_LIMIT, HISTORY_SAMPLE) == HISTORY_SAMPLE_SIZE); + res = history->get_history_serialized (); + CPPUNIT_ASSERT (res.size() ==HISTORY_SAMPLE_SIZE); + + // Warning - If you change the history-sample file, you must change the following lines also so that the tests could work + // The reference here is the file history-sample in this test directory + // The serialized form is: calltype%to%from%callid + + // Check the first + tmp = "0|514-276-5468|Savoir-faire Linux|144562458|empty"; + CPPUNIT_ASSERT (tmp == res ["144562436"]); + + tmp = "2|136|Emmanuel Milou|747638765|Account:1239059899"; + CPPUNIT_ASSERT (tmp == res ["747638685"]); + + // the account ID does not correspond to a loaded account + tmp = "1|5143848557|empty|775354987|empty"; + CPPUNIT_ASSERT (tmp == res ["775354456"]); +} + +void HistoryTest::test_set_serialized_history () +{ + // We build a map to have an efficient test + std::map <std::string, std::string> map_test; + std::string tmp; + Conf::ConfigTree history_list; + + map_test["144562436"] = "0|514-276-5468|Savoir-faire Linux|144562458|empty"; + map_test["747638685"] = "2|136|Emmanuel Milou|747638765|Account:1239059899"; + map_test["775354456"] = "1|5143848557|empty|775354987|Account:43789459478"; + + CPPUNIT_ASSERT (history->load_history (HUGE_HISTORY_LIMIT, HISTORY_SAMPLE) == HISTORY_SAMPLE_SIZE); + // We use a large history limit to be able to interpret results + CPPUNIT_ASSERT (history->set_serialized_history (map_test, HUGE_HISTORY_LIMIT) == 3); + CPPUNIT_ASSERT (history->get_history_size () == 3); + + map_test.clear (); + map_test = history->get_history_serialized (); + CPPUNIT_ASSERT (map_test.size() ==3); + + // Check the first + tmp = "0|514-276-5468|Savoir-faire Linux|144562458|empty"; + CPPUNIT_ASSERT (tmp == map_test ["144562436"]); + + tmp = "2|136|Emmanuel Milou|747638765|Account:1239059899"; + CPPUNIT_ASSERT (tmp == map_test ["747638685"]); + + // the account ID does not correspond to a loaded account + tmp = "1|5143848557|empty|775354987|empty"; + CPPUNIT_ASSERT (tmp == map_test ["775354456"]); + + history->save_history_items_map (&history_list); + CPPUNIT_ASSERT (history->save_history_to_file (&history_list)); +} + +void HistoryTest::test_set_serialized_history_with_limit () +{ + // We build a map to have an efficient test + std::map <std::string, std::string> map_test; + std::string tmp; + Conf::ConfigTree history_list; + time_t current, day=86400; // One day in unix timestamp + std::stringstream current_1, current_2, current_3; + + (void) time (¤t); + current_1 << (current - 2*day) << std::endl; + current_2 << (current - 5*day) << std::endl; + current_3 << (current - 11*day) << std::endl; + + map_test[current_1.str () ] = "0|514-276-5468|Savoir-faire Linux|144562458|empty"; + map_test[current_2.str () ] = "2|136|Emmanuel Milou|747638765|Account:1239059899"; + map_test[current_3.str () ] = "1|5143848557|empty|775354987|Account:43789459478"; + + CPPUNIT_ASSERT (history->load_history (HUGE_HISTORY_LIMIT, HISTORY_SAMPLE) == HISTORY_SAMPLE_SIZE); + // We use different value of history limit + // 10 days - the last entry should not be saved + CPPUNIT_ASSERT (history->set_serialized_history (map_test, 10) == 2); + CPPUNIT_ASSERT (history->get_history_size () == 2); + + // 4 days - the two last entries should not be saved + CPPUNIT_ASSERT (history->set_serialized_history (map_test, 4) == 1); + CPPUNIT_ASSERT (history->get_history_size () == 1); + + // 1 day - no entry should not be saved + CPPUNIT_ASSERT (history->set_serialized_history (map_test, 1) == 0); + CPPUNIT_ASSERT (history->get_history_size () == 0); +} + +void HistoryTest::tearDown() +{ + // Delete the history object + delete history; + history=0; +} diff --git a/sflphone-common/test/historyTest.h b/sflphone-common/test/historyTest.h new file mode 100644 index 0000000000000000000000000000000000000000..38ac517c9faf9b80b478df268830a8872a086f37 --- /dev/null +++ b/sflphone-common/test/historyTest.h @@ -0,0 +1,93 @@ +/* + * Copyright (C) 2009 Savoir-Faire Linux inc. + * Author: Emmanuel Milou <emmanuel.milou@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 + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +// Cppunit import +#include <cppunit/extensions/HelperMacros.h> +#include <cppunit/TestCaller.h> +#include <cppunit/TestCase.h> +#include <cppunit/TestSuite.h> + +#include <assert.h> + +// Application import +#include "history/historymanager.h" + +/* + * @file historyTest.h + * @brief Regroups unitary tests related to the phone number cleanup function. + */ + +#ifndef _HISTORY_TEST_ +#define _HISTORY_TEST_ + +class HistoryTest : public CppUnit::TestCase { + + /** + * Use cppunit library macros to add unit test the factory + */ + CPPUNIT_TEST_SUITE (HistoryTest); + CPPUNIT_TEST (test_create_history_path); + CPPUNIT_TEST (test_load_history_from_file); + CPPUNIT_TEST (test_load_history_items_map); + CPPUNIT_TEST (test_save_history_items_map); + CPPUNIT_TEST (test_save_history_to_file); + CPPUNIT_TEST (test_get_history_serialized); + CPPUNIT_TEST (test_set_serialized_history); + CPPUNIT_TEST (test_set_serialized_history_with_limit); + CPPUNIT_TEST_SUITE_END (); + + public: + HistoryTest() : CppUnit::TestCase("History Tests") {} + + /* + * Code factoring - Common resources can be initialized here. + * This method is called by unitcpp before each test + */ + void setUp(); + + void test_create_history_path (); + + void test_load_history_from_file (); + + void test_load_history_items_map (); + + void test_save_history_items_map (); + + void test_save_history_to_file (); + + void test_get_history_serialized (); + + void test_set_serialized_history (); + + void test_set_serialized_history_with_limit (); + + /* + * Code factoring - Common resources can be released here. + * This method is called by unitcpp after each test + */ + inline void tearDown (); + + private: + HistoryManager *history; +}; + +/* Register our test module */ +CPPUNIT_TEST_SUITE_REGISTRATION( HistoryTest ); + +#endif diff --git a/sflphone-common/test/hookmanagerTest.cpp b/sflphone-common/test/hookmanagerTest.cpp index 071435db7b4f3d8564624b186cc08d6d35b26976..d5b8cb6a80a4a0fcca0e55c7440a0853d443b66f 100644 --- a/sflphone-common/test/hookmanagerTest.cpp +++ b/sflphone-common/test/hookmanagerTest.cpp @@ -27,20 +27,31 @@ using std::cout; using std::endl; -void HookManagerTest::setUp(){ +void HookManagerTest::setUp() +{ // Instanciate the hook manager singleton urlhook = new UrlHook (); } -void HookManagerTest::testAddAction (){ +void HookManagerTest::testAddAction () +{ int status; - status = urlhook->addAction ("www.google.ca", "gnome-www-browser"); - CPPUNIT_ASSERT (status == 0); + status = urlhook->addAction ("www.google.ca", "x-www-browser"); + CPPUNIT_ASSERT (status == 0); } -void HookManagerTest::tearDown(){ +void HookManagerTest::testLargeUrl () +{ + + std::string url; + std::cout << url.max_size() << std::endl; +} + +void HookManagerTest::tearDown() +{ // Delete the hook manager object - delete urlhook; urlhook=0; + delete urlhook; + urlhook=0; } diff --git a/sflphone-common/test/hookmanagerTest.h b/sflphone-common/test/hookmanagerTest.h index 2c314c7d7f0d8b3f6fe1bfef53e24171167187ec..9c7464125d8dff6f8d63471ace6a476bd1bc550f 100644 --- a/sflphone-common/test/hookmanagerTest.h +++ b/sflphone-common/test/hookmanagerTest.h @@ -43,6 +43,7 @@ class HookManagerTest : public CppUnit::TestCase { */ CPPUNIT_TEST_SUITE (HookManagerTest); CPPUNIT_TEST (testAddAction); + CPPUNIT_TEST (testLargeUrl); CPPUNIT_TEST_SUITE_END (); public: @@ -56,6 +57,7 @@ class HookManagerTest : public CppUnit::TestCase { void testAddAction (); + void testLargeUrl (); /* * Code factoring - Common resources can be released here. * This method is called by unitcpp after each test diff --git a/sflphone-common/test/numbercleanerTest.cpp b/sflphone-common/test/numbercleanerTest.cpp index f6c9a22d8048d1ae2058af8db11f19d6f6363391..03dca416046a62d38c9c49c2efcf34db4031f3ba 100644 --- a/sflphone-common/test/numbercleanerTest.cpp +++ b/sflphone-common/test/numbercleanerTest.cpp @@ -42,70 +42,85 @@ using std::cout; using std::endl; -void NumberCleanerTest::setUp(){ +void NumberCleanerTest::setUp() +{ // Instanciate the cleaner singleton cleaner = new NumberCleaner (); } -void NumberCleanerTest::test_format_1 (void) { +void NumberCleanerTest::test_format_1 (void) +{ CPPUNIT_ASSERT (cleaner->clean (NUMBER_TEST_1) == VALID_NUMBER); } -void NumberCleanerTest::test_format_2 (void) { +void NumberCleanerTest::test_format_2 (void) +{ CPPUNIT_ASSERT (cleaner->clean (NUMBER_TEST_2) == VALID_NUMBER); } -void NumberCleanerTest::test_format_3 (void) { +void NumberCleanerTest::test_format_3 (void) +{ CPPUNIT_ASSERT (cleaner->clean (NUMBER_TEST_3) == VALID_NUMBER); } -void NumberCleanerTest::test_format_4 (void) { +void NumberCleanerTest::test_format_4 (void) +{ CPPUNIT_ASSERT (cleaner->clean (NUMBER_TEST_4) == VALID_NUMBER); } -void NumberCleanerTest::test_format_5 (void) { +void NumberCleanerTest::test_format_5 (void) +{ CPPUNIT_ASSERT (cleaner->clean (NUMBER_TEST_5) == VALID_NUMBER); } -void NumberCleanerTest::test_format_6 (void) { +void NumberCleanerTest::test_format_6 (void) +{ CPPUNIT_ASSERT (cleaner->clean (NUMBER_TEST_6) == VALID_NUMBER); } -void NumberCleanerTest::test_format_7 (void) { +void NumberCleanerTest::test_format_7 (void) +{ CPPUNIT_ASSERT (cleaner->clean (NUMBER_TEST_7) == VALID_NUMBER); } -void NumberCleanerTest::test_format_8 (void) { +void NumberCleanerTest::test_format_8 (void) +{ CPPUNIT_ASSERT (cleaner->clean (NUMBER_TEST_8) == VALID_NUMBER); } -void NumberCleanerTest::test_format_9 (void) { +void NumberCleanerTest::test_format_9 (void) +{ CPPUNIT_ASSERT (cleaner->clean (NUMBER_TEST_9) == VALID_NUMBER); } -void NumberCleanerTest::test_format_10 (void) { +void NumberCleanerTest::test_format_10 (void) +{ cleaner->set_phone_number_prefix ("9"); CPPUNIT_ASSERT (cleaner->get_phone_number_prefix () == "9"); CPPUNIT_ASSERT (cleaner->clean (NUMBER_TEST_1) == VALID_PREPENDED_NUMBER); } -void NumberCleanerTest::test_format_11 (void) { +void NumberCleanerTest::test_format_11 (void) +{ cleaner->set_phone_number_prefix ("9"); CPPUNIT_ASSERT (cleaner->get_phone_number_prefix () == "9"); CPPUNIT_ASSERT (cleaner->clean (NUMBER_TEST_10) == VALID_EXTENSION); } -void NumberCleanerTest::tearDown(){ + +void NumberCleanerTest::tearDown() +{ // Delete the cleaner object - delete cleaner; cleaner=0; + delete cleaner; + cleaner=0; } diff --git a/sflphone-common/test/pluginmanagerTest.cpp b/sflphone-common/test/pluginmanagerTest.cpp index 96994b6925219cfc565906873e8d6574fcc3c238..86b4890c6ffe263a0a750d64a4a09cf3e9ba78cf 100644 --- a/sflphone-common/test/pluginmanagerTest.cpp +++ b/sflphone-common/test/pluginmanagerTest.cpp @@ -31,65 +31,81 @@ using std::endl; #define PLUGIN_TEST_NAME "/usr/lib/sflphone/plugins/libplugintest.so" -void PluginManagerTest::setUp(){ +void PluginManagerTest::setUp() +{ // Instanciate the plugin manager singleton _pm = PluginManager::instance(); library = 0; plugin = 0; } -void PluginManagerTest::testLoadDynamicLibrary(){ - CPPUNIT_ASSERT(_pm->loadDynamicLibrary(PLUGIN_TEST_NAME) != NULL); +void PluginManagerTest::testLoadDynamicLibrary() +{ + CPPUNIT_ASSERT (_pm->loadDynamicLibrary (PLUGIN_TEST_NAME) != NULL); } -void PluginManagerTest::testUnloadDynamicLibrary(){ - library = _pm->loadDynamicLibrary(PLUGIN_TEST_NAME); - CPPUNIT_ASSERT(library != NULL); - CPPUNIT_ASSERT(_pm->unloadDynamicLibrary(library) == 0 ); +void PluginManagerTest::testUnloadDynamicLibrary() +{ + library = _pm->loadDynamicLibrary (PLUGIN_TEST_NAME); + CPPUNIT_ASSERT (library != NULL); + CPPUNIT_ASSERT (_pm->unloadDynamicLibrary (library) == 0); } -void PluginManagerTest::testInstanciatePlugin(){ +void PluginManagerTest::testInstanciatePlugin() +{ library = _pm->loadDynamicLibrary (PLUGIN_TEST_NAME); - CPPUNIT_ASSERT(library != NULL); + CPPUNIT_ASSERT (library != NULL); CPPUNIT_ASSERT (_pm->instanciatePlugin (library, &plugin) == 0); CPPUNIT_ASSERT (plugin!=NULL); } -void PluginManagerTest::testInitPlugin(){ +void PluginManagerTest::testInitPlugin() +{ library = _pm->loadDynamicLibrary (PLUGIN_TEST_NAME); - CPPUNIT_ASSERT(library != NULL); + CPPUNIT_ASSERT (library != NULL); CPPUNIT_ASSERT (_pm->instanciatePlugin (library, &plugin) == 0); CPPUNIT_ASSERT (plugin!=NULL); CPPUNIT_ASSERT (plugin->getPluginName() == PLUGIN_TEST_DESC); } -void PluginManagerTest::testRegisterPlugin(){ +void PluginManagerTest::testRegisterPlugin() +{ library = _pm->loadDynamicLibrary (PLUGIN_TEST_NAME); - CPPUNIT_ASSERT(library != NULL); + CPPUNIT_ASSERT (library != NULL); CPPUNIT_ASSERT (_pm->instanciatePlugin (library, &plugin) == 0); CPPUNIT_ASSERT (_pm->isPluginLoaded (PLUGIN_TEST_DESC) == false); CPPUNIT_ASSERT (_pm->registerPlugin (plugin, library) == 0); CPPUNIT_ASSERT (_pm->isPluginLoaded (PLUGIN_TEST_DESC) == true); } -void PluginManagerTest::testLoadPlugins (){ +void PluginManagerTest::testLoadPlugins () +{ CPPUNIT_ASSERT (_pm->loadPlugins (PLUGIN_TEST_DIR) == 0); CPPUNIT_ASSERT (_pm->isPluginLoaded (PLUGIN_TEST_DESC) == true); } -void PluginManagerTest::testUnloadPlugins (){ +void PluginManagerTest::testUnloadPlugins () +{ CPPUNIT_ASSERT (_pm->loadPlugins (PLUGIN_TEST_DIR) == 0); CPPUNIT_ASSERT (_pm->isPluginLoaded (PLUGIN_TEST_DESC) == true); CPPUNIT_ASSERT (_pm->unloadPlugins () == 0); CPPUNIT_ASSERT (_pm->isPluginLoaded (PLUGIN_TEST_DESC) == false); } -void PluginManagerTest::tearDown(){ +void PluginManagerTest::tearDown() +{ // Delete the plugin manager object - delete _pm; _pm=0; - if(plugin) - delete plugin; plugin = 0; - if(library) - delete library; library = 0; + delete _pm; + _pm=0; + + if (plugin) + delete plugin; + + plugin = 0; + + if (library) + delete library; + + library = 0; } diff --git a/sflphone-common/test/rtpTest.cpp b/sflphone-common/test/rtpTest.cpp index 1f058d1ec87114d879df4c0355e01a9a72ee062c..c2aa396e1b97c244b4fdb07b71ff42248da63d56 100644 --- a/sflphone-common/test/rtpTest.cpp +++ b/sflphone-common/test/rtpTest.cpp @@ -38,9 +38,10 @@ using std::cout; using std::endl; -void RtpTest::setUp(){ +void RtpTest::setUp() +{ - _debug("------ Set up rtp test------\n"); + _debug ("------ Set up rtp test------\n"); Manager::instance().initConfigFile(); Manager::instance().init(); @@ -49,25 +50,26 @@ void RtpTest::setUp(){ CallID cid = "123456"; - sipcall = new SIPCall(cid, Call::Incoming, _pool); - - sipcall->setLocalIp("127.0.0.1"); - sipcall->setLocalAudioPort(RANDOM_LOCAL_PORT); - sipcall->setLocalExternAudioPort(RANDOM_LOCAL_PORT); + sipcall = new SIPCall (cid, Call::Incoming, _pool); + + sipcall->setLocalIp ("127.0.0.1"); + sipcall->setLocalAudioPort (RANDOM_LOCAL_PORT); + sipcall->setLocalExternAudioPort (RANDOM_LOCAL_PORT); + - } -bool RtpTest::pjsipInit(){ +bool RtpTest::pjsipInit() +{ // Create memory cache for pool - pj_caching_pool_init(&_cp, &pj_pool_factory_default_policy, 0); + pj_caching_pool_init (&_cp, &pj_pool_factory_default_policy, 0); - // Create memory pool for application. - _pool = pj_pool_create(&_cp.factory, "rtpTest", 4000, 4000, NULL); + // Create memory pool for application. + _pool = pj_pool_create (&_cp.factory, "rtpTest", 4000, 4000, NULL); if (!_pool) { - _debug("----- RtpTest: Could not initialize pjsip memory pool ------\n"); + _debug ("----- RtpTest: Could not initialize pjsip memory pool ------\n"); return PJ_ENOMEM; } @@ -79,71 +81,157 @@ void RtpTest::testRtpInitClose() audiortp = new AudioRtp(); - _debug("------ void RtpTest::testRtpInit() ------\n"); + _debug ("------ void RtpTest::testRtpInit() ------\n"); + try { - _debug("-------- Open Rtp Session ----------\n"); - CPPUNIT_ASSERT(audiortp->createNewSession(sipcall) == 0); + _debug ("-------- Open Rtp Session ----------\n"); + audiortp->createNewSession (sipcall); + + } catch (...) { + + _debug ("!!! Exception occured while Oppenning Rtp !!!\n"); - } catch(...) { - - _debug("!!! Exception occured while Oppenning Rtp !!!\n"); - } - CPPUNIT_ASSERT(audiortp != NULL); - - _debug("------ Finilize Rtp Initialization ------ \n"); + CPPUNIT_ASSERT (audiortp != NULL); + + audiortp->_RTXThread->computeCodecFrameSize (320,8000); - _debug("------ RtpTest::testRtpClose() ------\n"); + // computeNbByteAudioLayer + + _debug ("------ Finilize Rtp Initialization ------ \n"); + + + _debug ("------ RtpTest::testRtpClose() ------\n"); try { - _debug("------ Close Rtp Session -------\n"); - CPPUNIT_ASSERT(audiortp->closeRtpSession()); + _debug ("------ Close Rtp Session -------\n"); + CPPUNIT_ASSERT (audiortp->closeRtpSession()); - } catch(...) { + } catch (...) { - _debug("!!! Exception occured while closing Rtp !!!\n"); + _debug ("!!! Exception occured while closing Rtp !!!\n"); } - delete audiortp; audiortp = NULL; + delete audiortp; + + audiortp = NULL; } void RtpTest::testRtpThread() { - _debug("------ void RtpTest::testRtpThread ------\n"); + audiortp = new AudioRtp(); + + _debug ("-------- Open Rtp Session ----------\n"); + + try { + + audiortp->createNewSession (sipcall); - + } catch (...) { + + _debug ("!!! Exception occured while Oppenning Rtp !!!\n"); - if(rtpthread != 0){ - _debug("!!! Rtp Thread already exists..., stopping it\n"); - delete rtpthread; rtpthread = 0; } - CPPUNIT_ASSERT(rtpthread == 0); - // CPPUNIT_ASSERT(rtpthread->_sym == NULL); + _debug ("------ void RtpTest::testRtpThread ------\n"); + + CPPUNIT_ASSERT (audiortp->_RTXThread->computeCodecFrameSize (160,8000) == 20.0f); + CPPUNIT_ASSERT (audiortp->_RTXThread->computeCodecFrameSize (320,16000) == 20.0f); + CPPUNIT_ASSERT (audiortp->_RTXThread->computeCodecFrameSize (882,44100) == 20.0f); + + // 20 ms at 44.1 khz corespond to 882 samples (1764 byte) + CPPUNIT_ASSERT (audiortp->_RTXThread->computeNbByteAudioLayer (20.f) == 1764); + + _debug ("------ Close Rtp Session -------\n"); try { - rtpthread = new AudioRtpRTX(sipcall, true); - - } catch(...) { + CPPUNIT_ASSERT (audiortp->closeRtpSession()); - _debug("!!! Exception occured while instanciating AudioRtpRTX !!!\n"); + } catch (...) { + + _debug ("!!! Exception occured while closing Rtp !!!\n"); } - CPPUNIT_ASSERT(rtpthread == 0); + delete audiortp; - delete rtpthread; rtpthread = 0; + audiortp = NULL; } -void RtpTest::tearDown(){ - delete sipcall; sipcall = NULL; +void RtpTest::testRtpResampling() +{ + + int nbSample = 50; + int rsmpl_nbSample = 0; + + SFLDataFormat *data = new SFLDataFormat[1024]; + SFLDataFormat *rsmpl_data = new SFLDataFormat[1024]; + + for (int i = 0; i < nbSample; i++) + data[i] = i; + + + audiortp = new AudioRtp(); + + _debug ("-------- Open Rtp Session ----------\n"); + + try { + + audiortp->createNewSession (sipcall); + + } catch (...) { + + _debug ("!!! Exception occured while Oppenning Rtp !!!\n"); + + } + + _debug ("------ void RtpTest::testRtpResampling ------\n"); + + CPPUNIT_ASSERT (0 == 0); + rsmpl_nbSample = audiortp->_RTXThread->reSampleData (data, rsmpl_data, 8000, nbSample, UP_SAMPLING); + _debug ("ORIGINAL DATA SET\n"); + + for (int i = 0; i < nbSample; i++) + printf (" %i=>%i ", i, data[i]); + + _debug ("RESAMPLED DATA SET\n"); + + for (int i = 0; i < rsmpl_nbSample; i++) + printf (" %i=>%i ", i, rsmpl_data[i]); + + printf ("\n"); + + + _debug ("------ Close Rtp Session -------\n"); + + try { + + CPPUNIT_ASSERT (audiortp->closeRtpSession()); + + } catch (...) { + + _debug ("!!! Exception occured while closing Rtp !!!\n"); + + } + + delete audiortp; + + audiortp = NULL; +} + + +void RtpTest::tearDown() +{ + + delete sipcall; + sipcall = NULL; } diff --git a/sflphone-common/test/rtpTest.h b/sflphone-common/test/rtpTest.h index dec1b9798694eea926e6d9979ba3e6716b77b492..4b49708d3633400d272b1989ef745fc16826f7f5 100644 --- a/sflphone-common/test/rtpTest.h +++ b/sflphone-common/test/rtpTest.h @@ -69,9 +69,11 @@ class RtpTest : public CppUnit::TestCase { CPPUNIT_TEST_SUITE( RtpTest ); CPPUNIT_TEST( testRtpInitClose ); CPPUNIT_TEST( testRtpThread ); + CPPUNIT_TEST( testRtpResampling ); CPPUNIT_TEST_SUITE_END(); public: + RtpTest() : CppUnit::TestCase("Audio Layer Tests") {} /* @@ -92,6 +94,8 @@ class RtpTest : public CppUnit::TestCase { void testRtpThread(); + void testRtpResampling(); + private: diff --git a/sflphone-common/test/sflphonedrc-sample b/sflphone-common/test/sflphonedrc-sample new file mode 100644 index 0000000000000000000000000000000000000000..6d0064a7c50fc350fb1d55aa1faef4002c321427 --- /dev/null +++ b/sflphone-common/test/sflphonedrc-sample @@ -0,0 +1,74 @@ +[Account:1239059899] +Account.alias=1260@sip.sflphone.org +Account.enable=1 +Account.type=SIP +hostname=sflphone.org +password=NIPAgmLo +username=1260 + +[Account:1243544046] +Account.alias=Manu +Account.enable=1 +Account.mailbox=*97 +Account.type=SIP +hostname=192.168.50.3 +password=sfl-137pw +username=137 + +[Addressbook] +Addressbook.contact_photo=0 +Addressbook.enable=1 +Addressbook.list=1243608768.30329.0@emilou-desktop/1243456917.15690.23@emilou-desktop/ +Addressbook.max_results=25 +Addressbook.phone_business=1 +Addressbook.phone_home=0 +Addressbook.phone_mobile=0 + +[Audio] +Alsa.cardID_In=0 +Alsa.cardID_Out=0 +Alsa.framesize=20 +Alsa.plugin=default +Alsa.sampleRate=44100 +Record.path=/home/emilou +Rings.ringChoice=/usr/share/sflphone/ringtones/konga.ul +Volume.micro=100 +Volume.speakers=100 + +[Hooks] +Hooks.iax2_enabled=0 +Hooks.phone_number_add_prefix= +Hooks.phone_number_enabled=0 +Hooks.sip_enabled=0 +Hooks.url_command=x-www-browser +Hooks.url_sip_field=X-sflphone-url + +[Preferences] +Accounts.order=Account:1243544046/Account:1239138829/ +Audio.api=1 +Dialpad.display=0 +History.enabled=1 +History.limit=30 +History.maxCalls=20 +Notify.all=1 +Notify.mails=0 +Options.zoneToneChoice=North America +Pulseaudio.volumeCtrl=1 +Registration.expire=180 +Ringtones.enable=1 +SIP.portNum=5060 +Searchbar.display=1 +Start.hidden=0 +Volume.display=0 +Window.popup=0 +Zeroconf.enable=0 + +[VoIPLink] +DTMF.playDtmf=1 +DTMF.playTones=1 +DTMF.pulseLength=250 +DTMF.sendDTMFas=0 +STUN.enable=0 +STUN.server=stun.sflphone.org +VoIPLink.symmetric=1 + diff --git a/tools/build-system/distributions/mandriva/sflphone-client-kde.spec b/tools/build-system/distributions/mandriva/sflphone-client-kde.spec index 4bd7c29de235dd82aea742a5a3c6d5978c50eddc..a453cf9144f244b82e4e56fd14a168a8ceeaa732 100644 --- a/tools/build-system/distributions/mandriva/sflphone-client-kde.spec +++ b/tools/build-system/distributions/mandriva/sflphone-client-kde.spec @@ -30,6 +30,7 @@ Requires: libqt4-x11 BuildRequires: cmake BuildRequires: libcommoncpp-devel BuildRequires: kdepimlibs4-devel +BuildRequires: libqt4-devel >= 4.3 Conflicts: sflphone Prefix: %{_prefix} diff --git a/tools/build-system/distributions/mandriva/sflphone-common.spec b/tools/build-system/distributions/mandriva/sflphone-common.spec index 5c17144b259d6e142accbe885e74a377fd1a7285..11921a1d76bc92257bd4c53f44c54606aae8debd 100644 --- a/tools/build-system/distributions/mandriva/sflphone-common.spec +++ b/tools/build-system/distributions/mandriva/sflphone-common.spec @@ -59,7 +59,7 @@ Authors: %setup -q %build -cd libs/pjproject-1.0.1 +cd libs/pjproject-1.0.2 ./autogen.sh --prefix=%{_prefix} make dep make clean @@ -69,13 +69,13 @@ cd - make -j %install -cd libs/pjproject-1.0.1 +cd libs/pjproject-1.0.2 make DESTDIR=%{buildroot} install cd - make DESTDIR=%{buildroot} install %clean -cd libs/pjproject-1.0.1 +cd libs/pjproject-1.0.2 make clean cd - make clean diff --git a/tools/build-system/distributions/opensuse/sflphone-client-kde.spec b/tools/build-system/distributions/opensuse/sflphone-client-kde.spec index 0e5bd038db719190716a7f7c9353b4e1f6d251e8..f558d9b0cd6a71d64ad8021412803e2e7b36667a 100644 --- a/tools/build-system/distributions/opensuse/sflphone-client-kde.spec +++ b/tools/build-system/distributions/opensuse/sflphone-client-kde.spec @@ -30,6 +30,7 @@ Requires: libqt4-x11 BuildRequires: cmake BuildRequires: libkdepimlibs4-devel BuildRequires: commoncpp2-devel +BuildRequires: libqt4-devel >= 4.3 BuildRequires: gettext-tools Conflicts: sflphone Prefix: %{_prefix} diff --git a/tools/build-system/distributions/opensuse/sflphone-common.spec b/tools/build-system/distributions/opensuse/sflphone-common.spec index fde81bc3a73f63be66259740a92a56dc9675a4b6..cb92f42505eb4a687576a840ece4ffaf45ffdc97 100644 --- a/tools/build-system/distributions/opensuse/sflphone-common.spec +++ b/tools/build-system/distributions/opensuse/sflphone-common.spec @@ -58,7 +58,7 @@ Authors: %setup -q %build -cd libs/pjproject-1.0.1 +cd libs/pjproject-1.0.2 ./autogen.sh --prefix=%{_prefix} make dep make clean @@ -68,13 +68,13 @@ cd - make -j %install -cd libs/pjproject-1.0.1 +cd libs/pjproject-1.0.2 make DESTDIR=%{buildroot} install cd - make DESTDIR=%{buildroot} install %clean -cd libs/pjproject-1.0.1 +cd libs/pjproject-1.0.2 make clean cd - make clean diff --git a/tools/build-system/distributions/ubuntu/debian-sflphone-client-gnome/manpages b/tools/build-system/distributions/ubuntu/debian-sflphone-client-gnome/manpages index f070887d4e37fdd036f31f26e6e8f46d646d8b4e..7e7594591214b5e3a4c8134fabe9696c84b04907 100644 --- a/tools/build-system/distributions/ubuntu/debian-sflphone-client-gnome/manpages +++ b/tools/build-system/distributions/ubuntu/debian-sflphone-client-gnome/manpages @@ -1,2 +1,2 @@ -debian/sflphone-client-gnome/usr/share/man/man1/sflphone.1 debian/sflphone-client-gnome/usr/share/man/man1/sflphone-client-gnome.1 +debian/sflphone-client-gnome/usr/share/man/man1/sflphone.1 diff --git a/tools/build-system/distributions/ubuntu/debian-sflphone-client-kde/control.intrepid b/tools/build-system/distributions/ubuntu/debian-sflphone-client-kde/control.intrepid index ba8c47ad9af31f6dedbff69a282c521a8265f031..98d0dd6ce21e446e03efea046ee8535370bae3bc 100644 --- a/tools/build-system/distributions/ubuntu/debian-sflphone-client-kde/control.intrepid +++ b/tools/build-system/distributions/ubuntu/debian-sflphone-client-kde/control.intrepid @@ -2,7 +2,7 @@ Source: sflphone-client-kde Maintainer: SavoirFaireLinux Inc <jeremy.quentin@savoirfairelinux.com> Section: kde Priority: optional -Build-Depends: debhelper (>= 5), cmake (>=2.6), kdepimlibs5-dev (>=4.1.4), libcommoncpp2-dev (>=1.6.2) +Build-Depends: debhelper (>= 5), cmake (>=2.6), kdepimlibs5-dev (>=4.1.4), libcommoncpp2-dev (>=1.6.2), libqt4-dev (>=4.3) Standards-Version: 3.7.3 Package: sflphone-client-kde diff --git a/tools/build-system/distributions/ubuntu/debian-sflphone-client-kde/control.jaunty b/tools/build-system/distributions/ubuntu/debian-sflphone-client-kde/control.jaunty index ba8c47ad9af31f6dedbff69a282c521a8265f031..98d0dd6ce21e446e03efea046ee8535370bae3bc 100644 --- a/tools/build-system/distributions/ubuntu/debian-sflphone-client-kde/control.jaunty +++ b/tools/build-system/distributions/ubuntu/debian-sflphone-client-kde/control.jaunty @@ -2,7 +2,7 @@ Source: sflphone-client-kde Maintainer: SavoirFaireLinux Inc <jeremy.quentin@savoirfairelinux.com> Section: kde Priority: optional -Build-Depends: debhelper (>= 5), cmake (>=2.6), kdepimlibs5-dev (>=4.1.4), libcommoncpp2-dev (>=1.6.2) +Build-Depends: debhelper (>= 5), cmake (>=2.6), kdepimlibs5-dev (>=4.1.4), libcommoncpp2-dev (>=1.6.2), libqt4-dev (>=4.3) Standards-Version: 3.7.3 Package: sflphone-client-kde diff --git a/tools/build-system/distributions/ubuntu/debian-sflphone-client-kde/postinst b/tools/build-system/distributions/ubuntu/debian-sflphone-client-kde/postinst index 4598415bee39138b85f9c11668439d680f64e723..20a15b4f8f7d3b61eb5a3632bfa02d0b44cb6bd0 100644 --- a/tools/build-system/distributions/ubuntu/debian-sflphone-client-kde/postinst +++ b/tools/build-system/distributions/ubuntu/debian-sflphone-client-kde/postinst @@ -4,6 +4,6 @@ update-alternatives --install /usr/bin/sflphone sflphone /usr/bin/sflphone-clien --slave /usr/share/man/man1/sflphone.1.gz sflphone.1.gz \ /usr/share/man/man1/sflphone-client-kde.1 -# update-alternatives --set sflphone /usr/bin/sflphone-client-kde +update-alternatives --set sflphone /usr/bin/sflphone-client-kde exit 0 diff --git a/tools/build-system/distributions/ubuntu/debian-sflphone-common/rules b/tools/build-system/distributions/ubuntu/debian-sflphone-common/rules index f2b173aee3e12a2a199398d375f689a53f46a72e..d7235ece2b796b4f95933ac297042bd87a12058f 100755 --- a/tools/build-system/distributions/ubuntu/debian-sflphone-common/rules +++ b/tools/build-system/distributions/ubuntu/debian-sflphone-common/rules @@ -21,7 +21,7 @@ configure-stamp: dh_testdir # Add here commands to configure the package. ./autogen.sh --prefix=/usr - cd libs/pjproject-1.0.1; ./autogen.sh --prefix=/usr + cd libs/pjproject-1.0.2; ./autogen.sh --prefix=/usr touch configure-stamp #Architecture @@ -31,7 +31,7 @@ build-arch: build-arch-stamp build-arch-stamp: configure-stamp # Add here commands to compile the arch part of the package. - cd libs/pjproject-1.0.1; $(MAKE) dep; $(MAKE) clean; $(MAKE) + cd libs/pjproject-1.0.2; $(MAKE) dep; $(MAKE) clean; $(MAKE) cd -; $(MAKE) touch $@ @@ -72,7 +72,7 @@ install-arch: # Add here commands to install the arch part of the package into # debian/tmp. $(MAKE) DESTDIR=$(CURDIR)/debian/$(package) install - cd libs/pjproject-1.0.1; $(MAKE) prefix=$(CURDIR)/debian/$(package)/usr install + cd libs/pjproject-1.0.2; $(MAKE) prefix=$(CURDIR)/debian/$(package)/usr install rm -rf $(CURDIR)/debian/$(package)/usr/include dh_install -s # Must not depend on anything. This is to be called by