SearchSearch  Log in to check your private messagesLog in to check your private messages  recent posts Recent Posts
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
david_tekOffline



Joined: May 20, 2009
Posts: 14

Status: Offline
Posted: May 20, 2009 - 03:56 PM Reply with quote Back to top
Hello,

I upgrade last night to 1.5.1 ( from 1.4.4 ) and want to take advantage of the presence_dialoginfo and pua_dialoginfo modules.

What I want :

On my SPA 962 lights flash to indicate another phone ringing, green for online, orange for offline and red for on the phone.

General Setup information :

Asterisk is behind Kamailio. Kamailio manages my devices and Asterisk manages the media stuff. I have media proxy for NAT Trav

What I have done so far :

I have read : http://kamailio.org/docs/modules/1.5.x/ ... ginfo.html

I have read : http://kamailio.org/docs/modules/1.5.x/ ... ginfo.html

I have compiled and loaded both modules :

loadmodule "pua_dialoginfo.so"
loadmodule "presence_dialoginfo.so"

I have set this parameter because I have linksys:

modparam("presence_dialoginfo", "force_single_dialog", 1)

Publish and subscribe stuff was found here : http://www.kamailio.org/dokuwiki/doku.p ... ation-file


I capture subscribe and publish :

if( is_method("PUBLISH") || is_method("SUBSCRIBE") )
{
route(5);
}

And process them ( route 5 ) :

if (! t_newtran())
{
sl_reply_error();
exit;
};

append_to_reply("Contact: \r\n");

if(is_method("PUBLISH"))
{
handle_publish();
t_release();
} else if( is_method("SUBSCRIBE")) {
handle_subscribe();
t_release();
}
else
{
# This can't happen Razz
}

exit;

I do nothing with NOTIFY, so I guess it ends up being routed to my asterisk server.

mysql> select presentity_uri, watcher_username from active_watchers where event = 'dialog' and watcher_username = 'lublink.107' limit 1;
+---------------------------------+------------------+
| presentity_uri | watcher_username |
+---------------------------------+------------------+
| sip:lublink.106@myserver.tld | lublink.107 |
+---------------------------------+------------------+
1 row in set (0.00 sec)

But nothing is in presentity :

mysql> select * from presentity where event = 'dialog';
Empty set (0.01 sec)

My thoughts :

Why is there nothing in presentity ?

Have I misunderstood some obvious concept?

What have I done wrong?

Thanks,

David
View user's profile Send private message
david_tekOffline



Joined: May 20, 2009
Posts: 14

Status: Offline
Posted: May 20, 2009 - 04:49 PM Reply with quote Back to top
I found this possibly related post :

http://lists.kamailio.org/pipermail/use ... 18106.html

I am not writing dialog info to the db, perhaps writing this might change something?
View user's profile Send private message
david_tekOffline



Joined: May 20, 2009
Posts: 14

Status: Offline
Posted: May 20, 2009 - 05:00 PM Reply with quote Back to top
david_tek :
I found this possibly related post :

http://lists.kamailio.org/pipermail/use ... 18106.html

I am not writing dialog info to the db, perhaps writing this might change something?


I don't think that this article is related, I implemented the changes to dialog. I now have all my dialogs tracked in dialog table, but this is not useful to me. ( I have acc for CDR ).
View user's profile Send private message
david_tekOffline



Joined: May 20, 2009
Posts: 14

Status: Offline
Posted: May 20, 2009 - 05:15 PM Reply with quote Back to top
I'm gonna dump the TCP packets, I think my phones are supposed to be sending PUBLISH to my server so that the server knows what the phones are doing and NOTIFY the SUBSCRIBEd phones.
View user's profile Send private message
david_tekOffline



Joined: May 20, 2009
Posts: 14

Status: Offline
Posted: May 20, 2009 - 05:22 PM Reply with quote Back to top
david_tek :
I'm gonna dump the TCP packets, I think my phones are supposed to be sending PUBLISH to my server so that the server knows what the phones are doing and NOTIFY the SUBSCRIBEd phones.


Upon rereading the document here : http://kamailio.org/docs/modules/1.5.x/ ... #id2451541

Looks like pua_dialoginfo is supposed to send a PUBLISH packet to the server which is caught in handle_publish(), updates the presentity table and notifies my users.

It would seem that the pua_dialoginfo connects into dialog module via a callback. So the problem appears to be that the pua_dialoginfo method is never called so the publish is never sent and the database is not update.
View user's profile Send private message
david_tekOffline



Joined: May 20, 2009
Posts: 14

Status: Offline
Posted: May 20, 2009 - 05:26 PM Reply with quote Back to top
david_tek :
It would seem that the pua_dialoginfo connects into dialog module via a callback. So the problem appears to be that the pua_dialoginfo method is never called so the publish is never sent and the database is not update.


http://kamailio.org/docs/modules/1.5.x/ ... ginfo.html says I should recompile pua_dialoginfo with debugging information.
View user's profile Send private message
david_tekOffline



Joined: May 20, 2009
Posts: 14

Status: Offline
Posted: May 20, 2009 - 05:28 PM Reply with quote Back to top
david_tek :
david_tek :
It would seem that the pua_dialoginfo connects into dialog module via a callback. So the problem appears to be that the pua_dialoginfo method is never called so the publish is never sent and the database is not update.


http://kamailio.org/docs/modules/1.5.x/ ... ginfo.html says I should recompile pua_dialoginfo with debugging information.


Ok, now I am pretty sure that the problem is that pua_dialoginfo is not being calledback. Anyone have an idea why this might happen? Do I have to specify code to activate the callback ?
View user's profile Send private message
david_tekOffline



Joined: May 20, 2009
Posts: 14

Status: Offline
Posted: May 20, 2009 - 05:56 PM Reply with quote Back to top
david_tek :
david_tek :
david_tek :
It would seem that the pua_dialoginfo connects into dialog module via a callback. So the problem appears to be that the pua_dialoginfo method is never called so the publish is never sent and the database is not update.


http://kamailio.org/docs/modules/1.5.x/ ... ginfo.html says I should recompile pua_dialoginfo with debugging information.


Ok, now I am pretty sure that the problem is that pua_dialoginfo is not being calledback. Anyone have an idea why this might happen? Do I have to specify code to activate the callback ?


So I set the debugging level to 4 and had a look at /var/log/debug

tail -f /var/log/debug | grep dialog :

May 20 13:06:28 abel /usr/sbin/kamailio[10433]: DBG:pua_dialoginfo:__dialog_sendpublish: dialog is early, from=sip:3812@pbx.mydomain.tld
May 20 13:06:28 abel /usr/sbin/kamailio[10433]: DBG:pua_dialoginfo:dialog_publish: do not send PUBLISH to external URI sip:3812@pbx.mydomain.tld
May 20 13:06:28 abel /usr/sbin/kamailio[10433]: DBG:pua_dialoginfo:dialog_publish: do not send PUBLISH to external URI sip:fulluser.3802@proxy.voip.mydomain.tld


pbx.mydomain.tld is my asterisk
proxy.voip.mydomain.tld is my openser, but openser is actually voip.mydomain.tld and I use a dns srv to point to proxy.
View user's profile Send private message
david_tekOffline



Joined: May 20, 2009
Posts: 14

Status: Offline
Posted: May 20, 2009 - 05:59 PM Reply with quote Back to top
david_tek :
pbx.mydomain.tld is my asterisk
proxy.voip.mydomain.tld is my openser, but openser is actually voip.mydomain.tld and I use a dns srv to point to proxy.


So I can not figure out how pua_dialoginfo is seeing proxy.voip.mydomain.tld because it is not mentioned anywhere in the config.

Perhaps this is an issue with pua_dialoginfo?

David
View user's profile Send private message
david_tekOffline



Joined: May 20, 2009
Posts: 14

Status: Offline
Posted: May 20, 2009 - 06:59 PM Reply with quote Back to top
david_tek :
Perhaps this is an issue with pua_dialoginfo


yes, this is an issue with pua_dialoginfo. It says that only domains listed in alias= are allowed.

I changed my configuration to have the domain listed in alias=.

David
View user's profile Send private message
david_tekOffline



Joined: May 20, 2009
Posts: 14

Status: Offline
Posted: May 20, 2009 - 09:23 PM Reply with quote Back to top
Looks like the expiry on the publishes are 0 seconds so PUA is discarding them.
View user's profile Send private message
david_tekOffline



Joined: May 20, 2009
Posts: 14

Status: Offline
Posted: May 20, 2009 - 11:15 PM Reply with quote Back to top
david_tek :
Looks like the expiry on the publishes are 0 seconds so PUA is discarding them.


Ok, now I have a domain name mistmatch. The PUBLISH are for proxy.voip.mydomain.tld and the SUBSCRIBE are for voip.mydomain.tld. How do I change the domain for the publishs?
View user's profile Send private message
david_tekOffline



Joined: May 20, 2009
Posts: 14

Status: Offline
Posted: May 21, 2009 - 12:11 AM Reply with quote Back to top
david_tek :
david_tek :
Looks like the expiry on the publishes are 0 seconds so PUA is discarding them.


Ok, now I have a domain name mistmatch. The PUBLISH are for proxy.voip.mydomain.tld and the SUBSCRIBE are for voip.mydomain.tld. How do I change the domain for the publishs?


I used subst to correct the mismatch. I got the BLF working for my grandstreams and partly for my linksys.


Very Happy
View user's profile Send private message
grayOffline
Site Admin


Joined: Jun 10, 2004
Posts: 3185
Location: Portugal
Status: Offline
Posted: May 21, 2009 - 08:15 AM Reply with quote Back to top
What a great thread ! Well done David, you managed to solve every part of your problem without any help! Thank you for documenting each step, I am sure that will be of interest to others.
View user's profile Send private message
david_tekOffline



Joined: May 20, 2009
Posts: 14

Status: Offline
Posted: May 21, 2009 - 01:36 PM Reply with quote Back to top
Notes :

I never figured out why the packets expired, I looked through the source code of pua_dialoginfo and found references to lifetime, in looking in the doc I found this command :

modparam("pua_dialoginfo", "override_lifetime", 300)

I added this and my expiry was resolved.

I had debug=4 in kamailio.cfg. I was running on debian and using syslog so lots of information was dumped to debug and messages, so I :

tail -f /var/log/debug | grep dialog
tail -f /var/log/messages | grep PRESENCE

Hope this helps someone with this, the documentation for these modules is very good, but I think it is lacking examples.

If I can figure it out, so can you!

David
View user's profile Send private message


View previous topic Printable version Log in to check your private messages View next topic
Goto page 1, 2  Next

Post new topic   Reply to topic
Forum Rules and Guidelines | About VoIP User | Privacy Policy


All logos and trademarks in this site are property of their respective owner.
Comments and posts are property of the poster, all the rest (c) 2003-2008 VoIP User Limited.

VoIP User Limited is incorporated in England and Wales under Company Number 6694577.

No part of this site may be reproduced without our prior consent.