<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=ISO-8859-2"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#ffffff" text="#000000">
    Hello,<br>
    <br>
    On 4/11/11 1:10 PM, Martin Pohančeník wrote:
    <blockquote
      cite="mid:BANLkTimEOVii--Ttip5huouF0Noe6xoU9w@mail.gmail.com"
      type="cite">Can somebody please tell me, how is it with the NOTIFY
      messages generated byt handle_publish() and handle_subscribe()
      functions? Do they pass the routing logic or not? If not, is there
      a way to make them go through the routing logic??</blockquote>
    no, they do not pass the routing logic. NOTIFY are within dialog
    requests (dialog created by subscribe) and the entire routing
    information is already known. You can force some outbound proxy so
    the notify is sent there and you do what ever you want, alternative,
    but for limited functionality, define event_route[tm:local-request]
    {... }<br>
    <br>
    Cheers,<br>
    Daniel<br>
    <blockquote
      cite="mid:BANLkTimEOVii--Ttip5huouF0Noe6xoU9w@mail.gmail.com"
      type="cite">
      <div>
        <br>
        Please</div>
      <div>Martin</div>
      <div><br>
        <div class="gmail_quote">2011/4/8 Martin Pohančeník <span
            dir="ltr">&lt;<a moz-do-not-send="true"
              href="mailto:pohancenik.martin@gmail.com">pohancenik.martin@gmail.com</a>&gt;</span><br>
          <blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt
            0.8ex; border-left: 1px solid rgb(204, 204, 204);
            padding-left: 1ex;">
            Hi !
            <div>I have managed to get the XMPP module working for IM.
              Now I am working on Presence service with the pua_xmpp
              module.</div>
            <div>I have experienced some problems and I would like to
              ask some questions to clarify my understandig of Kamailio.</div>
            <div><br>
            </div>
            <div>When a SUBSCRIBE arrives to Kamailio, it adds a
              subscribtion to the watchers table in the database.</div>
            <div>And if the subscriber is online, he is also in the
              active_watchers table, right?</div>
            <div>
              <br>
            </div>
            <div>Next... when a PUBLISH request arrives to Kamailio, by
              default the handle_publish() function is called. This
              function generates</div>
            <div>all NOTIFY msgs (based on the database content of
              watchers and presence rules) and send them to the
              recipients. I wanted to ask if these</div>
            <div>generated NOTIFY msgs go through the routing logic, or
              not ?</div>
            <div><br>
            </div>
            <div>As I was saying, I was trying to get pua_xmpp module
              working, but Kamailio does not seem to send NOTIFY to
              users in XMPP (winfo is sent, bude presence itself is
              not).</div>
            <div><br>
            </div>
            <div>Here is a piece of my configuration file:</div>
            <div><br>
            </div>
            <div>
              <div>if(is_method("NOTIFY"))</div>
              <div>{</div>
              <div><span style="white-space: pre-wrap;"> </span>xlog("
                ==== NOTIFY msg ====\n");</div>
              <div>}</div>
              <div>if(is_method("NOTIFY") &amp;&amp; uri=~"<a class="moz-txt-link-freetext" href="sip:.+">sip:.+</a>[*].+@<a
                  moz-do-not-send="true" href="http://sip.sk"
                  target="_blank">sip.sk</a>")</div>
              <div>{</div>
              <div><span style="white-space: pre-wrap;"> </span>xlog("
                ====== NOTIFY from $fu to $tu ======\n");</div>
              <div><span style="white-space: pre-wrap;"> </span>if(pua_xmpp_notify())</div>
              <div><span style="white-space: pre-wrap;"> </span>{</div>
              <div><span style="white-space: pre-wrap;"> </span>xlog("
                ====== NOTIFY to xmpp domain from $fu to $tu ======\n");</div>
              <div><span style="white-space: pre-wrap;"> </span>  
                 t_reply("200", "OK");</div>
              <div><span style="white-space: pre-wrap;"> </span>}</div>
              <div><span style="white-space: pre-wrap;"> </span>exit;</div>
              <div>}</div>
              <div>if(is_method("PUBLISH"))</div>
              <div>{</div>
              <div><span style="white-space: pre-wrap;"> </span>xlog("=====
                PUBLISH FROM $fu =====");</div>
              <div><span style="white-space: pre-wrap;"> </span>handle_publish();</div>
              <div><span style="white-space: pre-wrap;"> </span>t_release();</div>
              <div>}</div>
              <div>else</div>
              <div>if( is_method("SUBSCRIBE"))</div>
              <div>{</div>
              <div><span style="white-space: pre-wrap;"> </span>handle_subscribe();</div>
              <div><span style="white-space: pre-wrap;"> </span>if(uri=~"<a class="moz-txt-link-freetext" href="sip:.+">sip:.+</a>[*].+@<a
                  moz-do-not-send="true" href="http://sip.sk"
                  target="_blank">sip.sk</a>"  &amp;&amp; $hdr(Event)==
                "presence")</div>
              <div><span style="white-space: pre-wrap;"> </span>{</div>
              <div><span style="white-space: pre-wrap;"> </span>xlog("
                ====== SUBSCRIBE for XMPP domain from $fu to see $tu
                ======\n");</div>
              <div><span style="white-space: pre-wrap;"> </span>pua_xmpp_req_winfo("$ruri",
                "$hdr(Expires)");</div>
              <div><span style="white-space: pre-wrap;"> </span>}</div>
              <div><span style="white-space: pre-wrap;"> </span>t_release();</div>
              <div>}</div>
              <div>exit;</div>
            </div>
            <div><br>
            </div>
            <div>Based on this configuration, I never get the " ====
              NOTIFY msg ====" output to the syslog. So I assume the
              NOTIFY never goes through the routing logic.</div>
            <div>Is that right?? If so, how can I get it to pass the
              routing logic so the pua_xmpp_notify() function can be
              executed ?? Is there any way to do this??</div>
            <div><br>
            </div>
            <div>Regards</div>
            <div>Martin</div>
          </blockquote>
        </div>
        <br>
      </div>
      <pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a>
<a class="moz-txt-link-freetext" href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
Daniel-Constantin Mierla
<a class="moz-txt-link-freetext" href="http://www.asipto.com">http://www.asipto.com</a></pre>
  </body>
</html>