[OpenSIPS-Users] Sad and frustrated: PRESENCE not working
Michele Pinassi
michele.pinassi at unisi.it
Wed Mar 11 09:33:27 CET 2015
Hi all,
my fight to have Presence and BLF working continue. Here's a "step by
step" trace when, on my phone with account 5002, i enabled a BLF for
account 5008. I use OpenSIPS 1.11.3-tls.
First, the phone send SUBSCRIBE packet:
*SUBSCRIBE sip:presence at voip.unisi.it:5060 SIP/2.0 *
Via: SIP/2.0/UDP 172.20.1.10:37508;branch=z9hG4bK-h30k6rwp6oy5;rport
From: <sip:5002 at voip.unisi.it:5060>;tag=pkntk9npjh
To:
<sip:5008 at voip.unisi.it:5060;user=phone>;tag=f315b2d58ae8829149b784764c5a40e3-2387
Call-ID: 54b1fe548d09-v32qemyjagpv
CSeq: 3 SUBSCRIBE
Max-Forwards: 70
Contact: <sip:5002 at 172.20.1.10:37508>;reg-id=1
Event: dialog
Accept: application/dialog-info+xml
User-Agent: snom760/8.7.3.25.9
Expires: 3600
Content-Length: 0
*SIP/2.0 200 OK *
Via: SIP/2.0/UDP
172.20.1.10:37508;received=172.20.1.10;branch=z9hG4bK-h30k6rwp6oy5;rport=37508
From: <sip:5002 at voip.unisi.it:5060>;tag=pkntk9npjh
To:
<sip:5008 at voip.unisi.it:5060;user=phone>;tag=f315b2d58ae8829149b784764c5a40e3-2387
Call-ID: 54b1fe548d09-v32qemyjagpv
CSeq: 3 SUBSCRIBE
Expires: 3600
Contact: <sip:presence at voip.unisi.it:5060>
Server: OpenSIPS (1.11.3-tls (i386/linux))
Content-Length: 0
Afterward, i get a NOTIFY with the state of the phone:
*NOTIFY sip:5002 at 172.20.1.10:37508 SIP/2.0 *
Via: SIP/2.0/UDP 172.20.1.2:5060;branch=z9hG4bK4e24.38cd2ef4.0
To: <sip:5002 at voip.unisi.it>;tag=pkntk9npjh
From: <sip:5008 at voip.unisi.it>;tag=f315b2d58ae8829149b784764c5a40e3-2387
CSeq: 2 NOTIFY
Call-ID: 54b1fe548d09-v32qemyjagpv
Max-Forwards: 70
Content-Length: 147
User-Agent: OpenSIPS (1.11.3-tls (i386/linux))
Event: dialog
Contact: <sip:presence at voip.unisi.it:5060>
Subscription-State: active;expires=3600
Content-Type: application/dialog-info+xml
<?xml version="1.0"?>
<dialog-info xmlns="urn:ietf:params:xml:ns:dialog-info"
version="1" state="full" entity="sip:5008 at voip.unisi.it"/>
*SIP/2.0 200 Ok *
Via: SIP/2.0/UDP 172.20.1.2:5060;branch=z9hG4bK4e24.38cd2ef4.0
From: <sip:5008 at voip.unisi.it>;tag=f315b2d58ae8829149b784764c5a40e3-2387
To: <sip:5002 at voip.unisi.it>;tag=pkntk9npjh
Call-ID: 54b1fe548d09-v32qemyjagpv
CSeq: 2 NOTIFY
Content-Length: 0
At this point i expect a NOTIFY packet when 5008 was busy but none. Of
course i have a row on active_watchers table.
My config for PRESENCE and PUA is:
#### PRESENCE modules
loadmodule "presence.so"
loadmodule "presence_mwi.so"
loadmodule "presence_callinfo.so"
loadmodule "presence_xml.so"
loadmodule "presence_dialoginfo.so"
modparam("presence", "server_address", "sip:presence at voip.unisi.it:5060")
modparam("presence", "notify_offline_body", 1)
modparam("presence", "fallback2db", 1)
modparam("presence", "clean_period", 30)
modparam("presence", "mix_dialog_presence", 1)
modparam("presence_xml","force_active",1)
#### PUA module
loadmodule "pua.so"
loadmodule "pua_dialoginfo.so"
loadmodule "pua_usrloc.so"
modparam("pua_dialoginfo", "presence_server",
"sip:presence at voip.unisi.it:5060")
modparam("pua_dialoginfo", "include_callid", 1)
modparam("pua_dialoginfo", "include_tags", 1)
modparam("pua_dialoginfo", "include_localremote", 1)
modparam("pua_dialoginfo", "publish_on_trying", 1)
modparam("pua_usrloc", "default_domain", "voip.unisi.it")
and on main() route logic i have:
### PRESENCE
if(is_method("PUBLISH|SUBSCRIBE")) {
route(handle_presence);
}
[....]
# Presence route
route[handle_presence] {
xlog("L_INFO","Route PRESENCE on $rm [$fd/$fu/$rd/$ru/$si/]\n");
if(!t_newtran()){
sl_reply_error();
exit;
}
if (is_method("PUBLISH")) {
if($hdr(Sender)!= NULL)
handle_publish("$hdr(Sender)");
else
handle_publish();
}
if (is_method("SUBSCRIBE")) {
if(search("^Event: message-summary")) {
# if there is no R-URI username, grab From URI
if(!uri=~"sip:.+@") { # add From username as R-URI username
avp_pushto("$ruri/username","$fU");
}
# fix some broken subscriptions
if(!search("^Accept: application/simple-message-summary")) {
append_hf("Accept: application/simple-message-summary\r\n");
}
setdsturi("sip:172.20.1.5:5060");
t_relay();
} else {
handle_subscribe();
}
}
exit;
}
Just for info, the MWI (using Asterisk) works perfectly...
Any suggestions ? Hints ?
Thanks, Michele
--
Michele Pinassi
Responsabile Telefonia di Ateneo
Servizio Reti, Sistemi e Sicurezza Informatica - Università degli Studi di Siena
tel: 0577.(23)5000 - fax: 0577.(23)2053
Per trovare una soluzione rapida ai tuoi problemi tecnici
consulta le FAQ di Ateneo, http://www.faq.unisi.it
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20150311/09eb8273/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: OpenPGP digital signature
URL: <http://lists.opensips.org/pipermail/users/attachments/20150311/09eb8273/attachment-0001.pgp>
More information about the Users
mailing list