Hi Simon, where I define this option (_STATIC_LINK) ?<div>And what about my second question. It is very important for me. I appreciate any help. Thanks.<br><br><div class="gmail_quote">2012/4/30 Simon Horne <span dir="ltr"><<a href="mailto:s.horne@packetizer.com" target="_blank">s.horne@packetizer.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="EN-US" link="blue" vlink="purple"><div><div class="im"><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Diego<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p><p>Compile the plugins using _STATIC_LINK option for both G.722 and H.264 this will create static libraries and #define H323_STATIC_H264  and H323_STATIC_G7221 in <a href="http://openh323buildopts.h.in" target="_blank">openh323buildopts.h.in</a> to load them.<u></u><u></u></p>
<p><u></u> <u></u></p></div><p>Simon<u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal">
<span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> <a href="mailto:h323plus-bounces@lists.packetizer.com" target="_blank">h323plus-bounces@lists.packetizer.com</a> [mailto:<a href="mailto:h323plus-bounces@lists.packetizer.com" target="_blank">h323plus-bounces@lists.packetizer.com</a>] <b>On Behalf Of </b>Diego Carvalho</span></p>
<div class="im"><br><b>Sent:</b> 01 May 2012 05:39<br></div><b>To:</b> Simon Horne; <a href="mailto:h323plus@lists.packetizer.com" target="_blank">h323plus@lists.packetizer.com</a><div><div class="h5"><br><b>Subject:</b> Re: [h323plus] H323-SIP Gateway with H264 Support<u></u><u></u></div>
</div><p></p><div><div class="h5"><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Hi Simon,<u></u><u></u></p><div><p class="MsoNormal">I am very grateful for the version of the H264 plugin with the _SGINAL_ONLY option. After using it I finally could make video work on my application.<u></u><u></u></p>
</div><div><p class="MsoNormal">Now I have 2 more challenges:<u></u><u></u></p></div><div><p class="MsoNormal">1 - Link the H264 and G722 plugins statically. How can I do this?<u></u><u></u></p></div><div><p class="MsoNormal">
2 - I still have problems with capability negotiation. You said me to override H323Connection::OnSetLocalCapabilities to remove the codecs that SIP doesn't support. But this function is called in the very beginning of a call, when I don't have SIP info yet. So I answer the call with H323Connection::AnswerCallPending and then start the SIP call. So I will have the SIP info only before sending the Connect PDU (e.g before calling H323Connection::AnswerCallNow). Is there another way to modify the local capabilities with this constraint?<u></u><u></u></p>
</div><div><p class="MsoNormal">I appreciate any help. Thanks in advance.<u></u><u></u></p><div><p class="MsoNormal"><u></u> <u></u></p><div><p class="MsoNormal">2012/4/10 Simon Horne <<a href="mailto:s.horne@packetizer.com" target="_blank">s.horne@packetizer.com</a>><u></u><u></u></p>
<div><div><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Diego</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Today I checked into the CVS a compile directive _<i>SIGNAL</i>_ONLY which will compile the plugin without dependencies on FFMPEG or X264.  You only need h264-x264.h/.cxx. You can use this in conjunction with _<i>STATIC</i>_LINK to build a static library to statically link the codec into the h323plus library.</span><u></u><u></u></p>
<p class="MsoNormal"><a href="http://h323plus.cvs.sourceforge.net/viewvc/h323plus/h323plus/plugins/video/H.264/" target="_blank">http://h323plus.cvs.sourceforge.net/viewvc/h323plus/h323plus/plugins/video/H.264/</a><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">You will need to configure the <a href="http://makefile.in" target="_blank">makefile.in</a> with these switches (not done yet)</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Also G.722 has serious interop issues. Mainly due to IMHO an error in the RFC. Although the codec is a 16k codec the RTP timestamps are incremented as 8k in the RFC. On the H.323 side they almost always use a 16k timestamp while on the SIP side it’s mostly 8k. </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Simon</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span><u></u><u></u></p><p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> <a href="mailto:h323plus-bounces@lists.packetizer.com" target="_blank">h323plus-bounces@lists.packetizer.com</a> [mailto:<a href="mailto:h323plus-bounces@lists.packetizer.com" target="_blank">h323plus-bounces@lists.packetizer.com</a>] <b>On Behalf Of </b>Diego Carvalho<br>
<b>Sent:</b> 10 April 2012 04:41</span><u></u><u></u></p><div><div><p class="MsoNormal"><br><b>To:</b> <a href="mailto:h323plus@lists.packetizer.com" target="_blank">h323plus@lists.packetizer.com</a><br><b>Subject:</b> Re: [h323plus] H323-SIP Gateway with H264 Support<u></u><u></u></p>
</div></div><div><div><p class="MsoNormal"> <u></u><u></u></p><p class="MsoNormal" style="margin-bottom:12.0pt">Hi Simon, thanks a lot for you help, but I will have to bother you again. Now I could compile the H264 plugin after remove the code you told me but I couldn't make my program load it. I tried 3 different things: first I put the .so and the help in the same folder as my app, second I tried to install the plugins in the default folder (/usr/local/lib/opal-1.24.0/) and finally I tried to set PWLIBPLUGINDIR. None of these worked. I also tried to load the G722 plugin and at least this one should work because I didn't change it. Am I missing something?<br>
I also tried to enable the stack's log. At first glance, it didn't show anything about plugins. Then I used the following code, from Simple app:<br><br>PDirectory DefaultDir = PProcess::Current().GetFile().GetDirectory();<br>
PPluginManager & pluginMgr = PPluginManager::GetPluginManager();<br>pluginMgr.LoadPluginDirectory(DefaultDir);<br><br>This makes the app loads the plugins from the current directory. After this the log shows:<br><br>2012/04/09 11:08:17.701    4       pluginmgr.cxx(96)    PLUGIN    Enumerating plugin directory /home/diego/H323Gateway/bin/Debug/<br>
2012/04/09 11:08:17.701    5       pluginmgr.cxx(106)    PLUGIN    Checking /home/diego/H323Gateway/bin/Debug/g722_audio_pwplugin.so against suffix _ptplugin<br>2012/04/09 11:08:17.701    5       pluginmgr.cxx(106)    PLUGIN    Checking /home/diego/H323Gateway/bin/Debug/g722_audio_pwplugin.so against suffix _pwplugin<br>
2012/04/09 11:08:17.702    3    h323pluginmgr.cxx(2529)    H323PLUGIN    Loading plugin codec g722_audio_pwplugin<br>2012/04/09 11:08:17.702    5       pluginmgr.cxx(106)    PLUGIN    Checking /home/diego/H323Gateway/bin/Debug/h264_video_pwplugin_helper against suffix _ptplugin<br>
2012/04/09 11:08:17.702    5       pluginmgr.cxx(106)    PLUGIN    Checking /home/diego/H323Gateway/bin/Debug/h264_video_pwplugin_helper against suffix _pwplugin<br>2012/04/09 11:08:17.702    5       pluginmgr.cxx(106)    PLUGIN    Checking /home/diego/H323Gateway/bin/Debug/h264_video_pwplugin.so against suffix _ptplugin<br>
2012/04/09 11:08:17.702    5       pluginmgr.cxx(106)    PLUGIN    Checking /home/diego/H323Gateway/bin/Debug/h264_video_pwplugin.so against suffix _pwplugin<br>2012/04/09 11:08:18.053    3    h323pluginmgr.cxx(2525)    H323PLUGIN    Plugin Codec DLL h264_video_pwplugin contains no codec definitions<br>
2012/04/09 11:08:18.058    5       pluginmgr.cxx(106)    PLUGIN    Checking /home/diego/H323Gateway/bin/Debug/H323Gateway against suffix _ptplugin<br>2012/04/09 11:08:18.058    5       pluginmgr.cxx(106)    PLUGIN    Checking /home/diego/H323Gateway/bin/Debug/H323Gateway against suffix _pwplugin<br>
<br>So it seems that it loaded G722 correctly and encontered an error while loading H264. But when the app starts, there is no G722 on capabilities table. I also tried to use the G722 plugin in the Simple app and got the same result. The app shows this in its start up:<br>
<br>Codecs (in preference order):<br> Table:<br>   G.711-ALaw-64k <1><br>   G.711-uLaw-64k <2><br>   UserInput/hookflash <3><br>   UserInput/basicString <4><br>   UserInput/dtmf <5><br>   UserInput/RFC2833 <6><br>
   UserInput/Navigation <7><br>   UserInput/Softkey <8><br>   UserInput/PointDevice <9><br>   UserInput/Modal <10><br><br>So, no G722.<br><br>A last thing is how to link the plugins statically. You said something about the CVS. Does it mean that the option to load the plugins statically is not available in the current version (1.24.0)?<br>
Thanks in advance.<u></u><u></u></p><div><p class="MsoNormal">2012/4/3 Simon Horne <<a href="mailto:s.horne@packetizer.com" target="_blank">s.horne@packetizer.com</a>><u></u><u></u></p><div><div><p class="MsoNormal">
<span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Diego</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"">There are 2 functions to load the plugin.</span><u></u><u></u></p><p class="MsoNormal" style="text-autospace:none">
<span style="font-size:11.0pt;font-family:"Calibri","sans-serif"">PLUGIN_CODEC_IMPLEMENT(H264)  </span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"">PLUGIN_CODEC_DLL_API struct PluginCodec_Definition * PLUGIN_CODEC_GET_CODEC_FN(unsigned * count, unsigned version)</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"">These are left as they are (including all the macro associated with them)</span><u></u><u></u></p><p class="MsoNormal">
<span style="font-size:11.0pt;font-family:"Calibri","sans-serif""> </span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"">All Encryption/Decryption is handled by the H264Encoder/H264Decoder classes. Simple remove these classes and everything referenced by the classes.</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"">Where they are instanced.</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"">static void * create_encoder(const struct PluginCodec_Definition * /*codec*/)</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"">static void * create_decoder(const struct PluginCodec_Definition * /*codec*/)</span><u></u><u></u></p><p class="MsoNormal">
<span style="font-size:11.0pt;font-family:"Calibri","sans-serif"">return NULL.</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"">That’s it. It should compile without needing FFMPEG or X264.</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"">Simon</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span><u></u><u></u></p><p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> <a href="mailto:h323plus-bounces@lists.packetizer.com" target="_blank">h323plus-bounces@lists.packetizer.com</a> [mailto:<a href="mailto:h323plus-bounces@lists.packetizer.com" target="_blank">h323plus-bounces@lists.packetizer.com</a>] <b>On Behalf Of </b>Diego Carvalho<br>
<b>Sent:</b> 04 April 2012 03:57</span><u></u><u></u></p><div><div><p class="MsoNormal"><br><b>To:</b> <a href="mailto:h323plus@lists.packetizer.com" target="_blank">h323plus@lists.packetizer.com</a><br><b>Subject:</b> Re: [h323plus] H323-SIP Gateway with H264 Support<u></u><u></u></p>
</div></div><div><div><p class="MsoNormal"> <u></u><u></u></p><p class="MsoNormal" style="margin-bottom:12.0pt">Hi Simon.<br>Again, I would like to thank you because you helped me to solve two problems: make SIP and H323 endpoints exchange media directly and set capabilities by call basis. Actually, the code you showed me didn't work in my tests (remove all capabilities and then add the ones I want) but I could at least remove the capabilities I don't want. Anyway, now my last big problem is the H264 support. I'm totally lost. You said: "<span style="font-size:11.0pt;font-family:"Calibri","sans-serif"">Simply supply the codec definitions and the codec will be available in h323plus. ". But supply where? </span>I don't know where to define the <span style="font-size:11.0pt;font-family:"Calibri","sans-serif"">PluginCodec_Definition or the other things you mentioned. Since I'm not an expert on H264 (I know enough to make things work, lol) I would like to</span> use what is already done, I mean, is it possible to make some changes in the H264 plugin to make it work only for signaling or I need to make something from the scratch? Regardless the answer, give me some instructions, please. Thanks in advance.<u></u><u></u></p>
<div><p class="MsoNormal">2012/3/27 Simon Horne <<a href="mailto:s.horne@packetizer.com" target="_blank">s.horne@packetizer.com</a>><u></u><u></u></p><div><div><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Diego</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Sorry for delay in replying</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">With Reference to the document you linked to</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">The plugin codec exports 2 functions for capability registration</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"">unsigned int PWLibPlugin_GetAPIVersion()</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><a href="http://www.voxgratia.org/docs/codec_plugins.html#PluginCodec_Definition" target="_blank">PluginCodec_Definition</a> * OpalCodecPlugin_GetCodecs(unsigned * count, unsigned version)</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New""> </span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">The </span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"">OpalCodecPlugin_GetCodecs function returns all the information you need on the signaling side. Simply supply the codec definitions and the codec will be available in h323plus. </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"">You DO NOT need to create the Codec Methods which link to FFMPEG/x264.</span><u></u><u></u></p><p class="MsoNormal">
<span style="font-size:11.0pt;font-family:"Calibri","sans-serif""> </span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"">For only supplying the codecs you need rather than removing them for the call. Clone the Capability List then remove all the orginal and add back the ones you want.</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"">In your derived </span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"">void H323Connection::OnSetLocalCapabilities()</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""> </span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:8.0pt;font-family:"Courier New"">H323Capabilities</span><span style="font-size:9.0pt;font-family:"Courier New""> * myCapabilities(localCapabilities);</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Courier New"">localCapabilities.RemoveAll();</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Courier New""> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Courier New"">H323Capability * cap = myCapabilities.FindCapability(“H.264*”);</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Courier New"">If (cap)</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Courier New"">  LocalCapabilities.Add(cap);</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Courier New""> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""> </span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"">Simon</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span><u></u><u></u></p><p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> Diego Carvalho [mailto:<a href="mailto:diego.cdomingos2010@gmail.com" target="_blank">diego.cdomingos2010@gmail.com</a>] <br>
<b>Sent:</b> 28 March 2012 06:37<br><b>To:</b> Simon Horne</span><u></u><u></u></p><div><div><p class="MsoNormal"><br><b>Subject:</b> [h323plus] H323-SIP Gateway with H264 Support<u></u><u></u></p></div></div><div><div><p class="MsoNormal">
 <u></u><u></u></p><p class="MsoNormal">Hi Simon, thanks for answering again. Today I could establish SIP -> H323 audio calls. So now I only need to deal with the 2 points below.<u></u><u></u></p><div><p class="MsoNormal">
I'm really interested in being able to add H.264 in the capability set without having to link the library with FFMPEG/X264, but I couldn't understand what you explained. I searched on the internet and found this: <a href="http://www.voxgratia.org/docs/codec_plugins.html" target="_blank">http://www.voxgratia.org/docs/codec_plugins.html</a><br>
that I believe is related to what you explained but even with this page I couldn't realize what I have to do. Is it possible to configure the plugin that comes with the source in this way? I mean, use the plugin in h323plus/plugin/video/H.264 for only signaling, without have to link with FFMPEG/X264.<br>
Another question is again about the capabilities. You said that I can remove the capabilities that aren't supported by the SIP endpoint. But this way, I will have to add all possible capabilities to my gateway and them remove the ones that SIP doesn't support. It would be much easier if my gateway could start without any capabilities and then I add the ones that SIP supports. Is that possible? If not, I will have to do what you explained but when I will add all the capabilities again to be ready to handle the next call?<br>
Again, thanks for all the help. <u></u><u></u></p><div><div><p class="MsoNormal" style="margin-bottom:12.0pt"> <u></u><u></u></p><div><p class="MsoNormal">2012/3/23 Simon Horne <<a href="mailto:s.horne@packetizer.com" target="_blank">s.horne@packetizer.com</a>><u></u><u></u></p>
<div><div><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Diego</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">There is some issues with changes in FFMPEG v54 and a number of function names changed and others were depreciated recommend v52. I am currently working through issues with v54. Again X264 is a moving target but last I looked it compiled on Linux. On Windows is a whole different story unfortunately.</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">If you are only using the codec for signaling there should be no need to link to either FFMPEG or X264 and you can gut the plugins and only define the PluginCodec_Definitions,  Plugin_Codec_Implementation() and PLUGIN_CODEC_GET_CODEC_FN. These are the signaling parts of the codec. The Encoder/Decoder contexts can be removed. There is some changes in the CVS to also allow you to load these plugins statically see the <a href="http://openh323buildopt.h.in" target="_blank">openh323buildopt.h.in</a>.</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">To filter capabilities on a call by call basis you can do this by overriding H323Capabilities::OnSetLocalCapabilities() and use the localCapabilities.Remove() function to remove the capabilities not used on the SIP side.</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Simon</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span><u></u><u></u></p><p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> <a href="mailto:h323plus-bounces@lists.packetizer.com" target="_blank">h323plus-bounces@lists.packetizer.com</a> [mailto:<a href="mailto:h323plus-bounces@lists.packetizer.com" target="_blank">h323plus-bounces@lists.packetizer.com</a>] <b>On Behalf Of </b>Diego Carvalho<br>
<b>Sent:</b> 23 March 2012 22:44<br><b>To:</b> <a href="mailto:h323plus@lists.packetizer.com" target="_blank">h323plus@lists.packetizer.com</a></span><u></u><u></u></p><div><div><p class="MsoNormal"><br><b>Subject:</b> Re: [h323plus] H323-SIP Gateway with H264 Support<u></u><u></u></p>
</div></div><div><div><p class="MsoNormal"> <u></u><u></u></p><p class="MsoNormal" style="margin-bottom:12.0pt">Hi Simon and "chr_cb". First of all, thanks for your help. Today I was able to establish an audio only call between H323 and SIP using the gateway I'm developing. This is great but I still have some problems and I appreciate any help on this:<br>
1) Like I said, it was an audio only call. I was able to compile the plugins with the packages from Ubuntu repositories (libx264-dev, libavcodec-dev and libavutil-dev) but my project also uses ffmpeg and x264 so I would like to compile with the latest source code from git we use. The config.log shows some errors and on the internet I saw somebody saying that only a specific version of ffmpeg allows the compilation. Is that true? If so, what would be the version of ffmpeg and x264 I should use? Again, I would like to reiterate that I only want to have H264 on my capabilities list (I don't want to capture/render video). Do I indeed need the plugin? Is there another way?<br>
2) If I set the gateway capabilities in the beginning it works but I want so set them in a later time. Specifically, I receive the call and send an invite on hold to SIP. Then it will answer with 200 OK with SDP. In this moment, when I have the SIP SDP, I want to set the gateway capabilities based on what the SIP side supports. How can I do this? If I try to add in this moment it simply doesn't add them.<br>
Thanks in advance.<u></u><u></u></p><div><p class="MsoNormal">2012/3/13 Simon Horne <<a href="mailto:s.horne@packetizer.com" target="_blank">s.horne@packetizer.com</a>><u></u><u></u></p><p class="MsoNormal">Diego<br>
<br>The plugins load default capability instances into the H323Endpoint.<br>When the H323Connection is created these capabilities are cloned<br>In H323Connection::OnSetLocalCapabilities()<br>Simply remove the unmatched capabilities<br>
localCapabilities.Remove("H.264*");<br><br>The H323_ExternalRTPChannel does not handle RTP but can be used to not use<br>the internal RTP system. You can have your own external RTP stack or not<br>have one at all.<br>
You needed to read and populate H245_H2250LogicalChannelParameters in the<br>send and receive message of the class with those of the SIP Client.<br><br>I do have serious doubts what you are planning will work not because it<br>
can't technically work but because of the differences in H.323 and SIP with<br>Video. H.323 is very strict on rules while SIP is very loose on<br>interpretations.<br>Here are the problems<br>1. RTP packetization H.323 says strictly single NAL SIP is undefined 2<br>
options (Single NAL/Fragmented units) . You will get video on the H.323 side<br>just fine but your SIP side with some devices may not be able to decode.<br>2. Payload Type for H.264 is specified as being flexible but a lot of SIP<br>
implementations have them fixed (usually 96 or 97) so H.323 requests 103<br>SIP always ends 97  no video on the H.323 side. There is no way you can fix<br>this with signaling as SIP tells the other party what it is going to send<br>
and H.323 tells the party what it wants to receive. You have to proxy the<br>media to fix the payload type number.<br><br>Good luck.<br><br>Simon<br><br>============================================================================<br>
=============================================<br><br>From: Diego Carvalho [mailto:<a href="mailto:diego.cdomingos2010@gmail.com" target="_blank">diego.cdomingos2010@gmail.com</a>]<br>Sent: 14 March 2012 06:09<br>To: Simon Horne<br>
Subject: Re: [h323plus] H323-SIP Gateway with H264 Support<u></u><u></u></p><div><div><p class="MsoNormal" style="margin-bottom:12.0pt"><br>Hi Simon, thanks for answering but I still have some doubts:<br>You said that this plugin will add the capability automatically. Actually,<br>
as I said, I'm building a H323-SIP gateway so, for instance, when the SIP<br>endpoint is making a call I want to add the H264 capability only if the SIP<br>endpoint offers it. Will I be able to add the capability manually? For<br>
instance, using localCapabilities.Add(new H323_H264Capability()). To<br>sumarize, I want to be able to add (or remove if it was automatically added<br>and the current call does not offer it) manualy the H264 capability.<br>
Also I don't know if the H323_ExternalRTPChannel applies to my situation.<br>It's used to pass the RTP to another device. I don't want to handle the RTP<br>at all (to be clear: I don't want RTP arriving on the gateway's network<br>
card). I want to send to h323 the RTP address/port SIP offered and<br>vice-versa, so the RTP will flow directly between the endpoints. Any<br>thoughts? Thanks in advance.<br>2012/3/13 Simon Horne <<a href="mailto:s.horne@packetizer.com" target="_blank">s.horne@packetizer.com</a>><br>
Diego<br> <br>H.264 is a video plugin in the plugin/video directory. You will need X264<br>and FFMPEG.  For Ubuntu they are libx264-dev  libavcodec-dev and<br>libavutil-dev.<br> <br>You build the plugin .so and the helper (in the gpl subdirectory) and place<br>
them both in the same directory as you app. The application will load them<br>at startup and automatically add the capability to the capabilityset etc<br> <br>If you don’t want to use the plugin for RTP then have a look at the<br>
H323_ExternalRTPChannel. This will bypass the RTP handling in the codec to<br>whatever you want.<br><a href="http://www.voxgratia.org/docs/external_rtp.html" target="_blank">http://www.voxgratia.org/docs/external_rtp.html</a><br>
(its from 2004 but still current)<br> <br>Simon<br> <br> <br>From: <a href="mailto:h323plus-bounces@lists.packetizer.com" target="_blank">h323plus-bounces@lists.packetizer.com</a><br>[mailto:<a href="mailto:h323plus-bounces@lists.packetizer.com" target="_blank">h323plus-bounces@lists.packetizer.com</a>] On Behalf Of Diego Carvalho<br>
Sent: 14 March 2012 03:05<br>To: <a href="mailto:h323plus@lists.packetizer.com" target="_blank">h323plus@lists.packetizer.com</a><br>Subject: [h323plus] H323-SIP Gateway with H264 Support<br> <br>Hi all,<br>I'm working on a h323-sip gateway with video (H264) support and I'm facing<br>
some problems. I'm new with H323plus and with h323 protocol itself (I'm<br>learning as I go) so excuse me if I say something stupid.<br>First of all, I believe that the stack can be used to build a gateway but it<br>
seems that it's more focused on terminals. Am I right? So is it possible or<br>not to build a gateway using it?<br>Second, there is no native support for H264. The documentation shows the<br>class hierarchy. For audio we have, for instance, H323Cabability -><br>
H323RealTimeCapability -> H323AudioCapability -> H323_G711Cabability but we<br>don't have H323Cabability -> H323RealTimeCapability -> H323VideoCapability<br>-> H323_H264Cabability. I tried to create this one, extending from<br>
H323Cabability -> H323RealTimeCapability -> H323VideoCapability -><br>H323GenericVideoCabability and then I discovered that I would need to<br>override a function called CreateCodec to return a codec that handles the<br>
video. But I don't want to handle the RTP media. I just want to put H264 in<br>the terminal capability set and establish a connection in a way that the<br>H323 and SIP terminals can exchange the media directly. I've heard about a<br>
H264 plugin but it seems that it is for handling the media, so I don't know<br>if it fits my purpose. How can I achieve this? Is there any plan to support<br>H264 natively on H323plus? Also I need to get the remote RTP port. The only<br>
way I found to do this is trough H323Connection::OnStartLocicalChannel but<br>this is called after a channel to handle the data is created and again, I<br>don't want to handle the RTP data. I appreciate any help. Thanks.<u></u><u></u></p>
</div></div></div><p class="MsoNormal"> <u></u><u></u></p></div></div></div></div></div><p class="MsoNormal"> <u></u><u></u></p></div></div></div><p class="MsoNormal"> <u></u><u></u></p></div></div></div></div></div><p class="MsoNormal">
 <u></u><u></u></p></div></div></div></div></div><p class="MsoNormal"> <u></u><u></u></p></div></div></div></div></div><p class="MsoNormal"><u></u> <u></u></p></div></div></div></div></div></div></blockquote></div><br></div>