examples.xml 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <?xml version='1.0' encoding='UTF-8'?>
  2. <!DOCTYPE section PUBLIC '-//OASIS//DTD DocBook XML V4.2//EN'
  3. 'http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd'>
  4. <section><title>Examples</title>
  5. <para>This section is under construction...
  6. </para>
  7. <para>I found a bug during testing sample configs - one TM module change caused
  8. impossibility of sending request to predefined destination. As far as I know
  9. affected modules are presence_b2b and msilo.
  10. </para>
  11. <section><title>Full presence server</title>
  12. <para>This config file has grown from previous versions of presence server
  13. configurations. It has to be re-tested with Ottendorf and de-uglyfied. (TBD soon)
  14. </para>
  15. <para><ulink url="cfg/full_ps.cfg">cfg/full_ps.cfg</ulink>
  16. </para>
  17. </section>
  18. <section><title>Presence server with no authorization and without RLS</title>
  19. <para>Following config file is based on demo config file installed with SIP-router
  20. It is not finished yet. I recommend to use a variant of the config file above right
  21. now.</para>
  22. <para><ulink url="cfg/ps.cfg">cfg/ps.cfg</ulink></para>
  23. </section>
  24. <section><title>Forwarding to presence server</title>
  25. <para>It is good idea to have separated presence stuff from the proxy. You can
  26. use following piece of code for that. Instead of
  27. <function>t_forward_nonack</function> you can use
  28. <function>t_forward_nonack_tcp</function>.
  29. </para>
  30. <example><title>forwarding to presence server</title>
  31. <programlisting><![CDATA[
  32. ...
  33. # forward presence messages to presence server
  34. if ((method=="SUBSCRIBE") || (method=="PUBLISH") || (method=="MESSAGE")) {
  35. log(1, "Forwarding request\n");
  36. if (!t_newtran()) {
  37. log(1, "newtran error\n");
  38. sl_reply_error();
  39. break;
  40. };
  41. if (!t_forward_nonack("presence-server.test-domain.com", "5060")) {
  42. log(1, "Forward to presence server failed\n");
  43. t_reply("500", "forward to presence server failed");
  44. }
  45. break;
  46. };
  47. ]]>
  48. </programlisting>
  49. </example>
  50. </section>
  51. </section>