Hello,

On 4/11/11 1:10 PM, Martin Pohančeník wrote:
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??
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] {... }

Cheers,
Daniel

Please
Martin

2011/4/8 Martin Pohančeník <pohancenik.martin@gmail.com>
Hi !
I have managed to get the XMPP module working for IM. Now I am working on Presence service with the pua_xmpp module.
I have experienced some problems and I would like to ask some questions to clarify my understandig of Kamailio.

When a SUBSCRIBE arrives to Kamailio, it adds a subscribtion to the watchers table in the database.
And if the subscriber is online, he is also in the active_watchers table, right?

Next... when a PUBLISH request arrives to Kamailio, by default the handle_publish() function is called. This function generates
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
generated NOTIFY msgs go through the routing logic, or not ?

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).

Here is a piece of my configuration file:

if(is_method("NOTIFY"))
{
xlog(" ==== NOTIFY msg ====\n");
}
if(is_method("NOTIFY") && uri=~"sip:.+[*].+@sip.sk")
{
xlog(" ====== NOTIFY from $fu to $tu ======\n");
if(pua_xmpp_notify())
{
xlog(" ====== NOTIFY to xmpp domain from $fu to $tu ======\n");
   t_reply("200", "OK");
}
exit;
}
if(is_method("PUBLISH"))
{
xlog("===== PUBLISH FROM $fu =====");
handle_publish();
t_release();
}
else
if( is_method("SUBSCRIBE"))
{
handle_subscribe();
if(uri=~"sip:.+[*].+@sip.sk"  && $hdr(Event)== "presence")
{
xlog(" ====== SUBSCRIBE for XMPP domain from $fu to see $tu ======\n");
pua_xmpp_req_winfo("$ruri", "$hdr(Expires)");
}
t_release();
}
exit;

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.
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??

Regards
Martin

_______________________________________________ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users

-- 
Daniel-Constantin Mierla
http://www.asipto.com