<HTML><HEAD>
<META content="text/html; charset=windows-1252" http-equiv=Content-Type></HEAD>
<BODY dir=ltr bgColor=#ffffff text=#000000>
<DIV dir=ltr>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: 'Calibri'; COLOR: #000000">
<DIV>You need to handle the in-dialog SUBSCRIBE requests. eg:</DIV>
<DIV> </DIV>
<DIV>if has_totag() {</DIV>
<DIV> ...</DIV>
<DIV> if (loose_route()) {</DIV>
<DIV> ...</DIV>
<DIV> } else {</DIV>
<DIV> ... </DIV>
<DIV><TT> if (is_method("SUBSCRIBE")) { </TT></DIV>
<DIV><TT> route(2);</TT></DIV>
<DIV><TT> exit; </TT></DIV>
<DIV><TT></TT><TT> }</TT></DIV>
<DIV><TT> ...</TT></DIV>
<DIV><TT> }</TT></DIV>
<DIV><TT> ... <BR></TT>}</DIV>
<DIV
style="FONT-SIZE: small; FONT-FAMILY: 'Calibri'; FONT-WEIGHT: normal; COLOR: #000000; FONT-STYLE: normal; TEXT-DECORATION: none; DISPLAY: inline">
<DIV style="FONT: 10pt tahoma">
<DIV> </DIV>
<DIV style="BACKGROUND: #f5f5f5">
<DIV style="font-color: black"><B>From:</B> <A title=bogdan@opensips.org
href="mailto:bogdan@opensips.org">Bogdan-Andrei Iancu</A> </DIV>
<DIV><B>Sent:</B> Thursday, February 26, 2015 7:56 AM</DIV>
<DIV><B>To:</B> <A title=users@lists.opensips.org
href="mailto:users@lists.opensips.org">OpenSIPS users mailling list</A> ; <A
title=michele.pinassi@unisi.it
href="mailto:michele.pinassi@unisi.it">mailto:michele.pinassi@unisi.it</A>
</DIV>
<DIV><B>Subject:</B> Re: [OpenSIPS-Users] Again BLF and Presence with Snom 7xx
phones and OpenSips</DIV></DIV></DIV>
<DIV> </DIV></DIV>
<DIV
style="FONT-SIZE: small; FONT-FAMILY: 'Calibri'; FONT-WEIGHT: normal; COLOR: #000000; FONT-STYLE: normal; TEXT-DECORATION: none; DISPLAY: inline">
<DIV class=moz-cite-prefix><TT>Hi Michele,</TT><TT><BR></TT><TT><BR></TT><TT>The
problem in your script is that you do not handle the sequential (in-dialog)
SUBSCRIBE requests (as you have the second one in your </TT><TT>trace, ending
with 404 and terminating the subscription).</TT><TT><BR></TT><TT><BR></TT><TT>In
the " if ( has_totag() ) " </TT><TT>block, you have:</TT><TT>
</TT><TT><BR></TT><TT> </TT><TT>} else {</TT>
<DIV class=de1><TT> if
(is_method("SUBSCRIBE") && $rd == "127.0.0.1:5060") { # CUSTOMIZE
ME</TT><TT><BR></TT><TT><BR></TT><TT>The $rd detection does not cover all your
cases, as you configure the presence module to advertise as SIP contact
"</TT><TT><A class=moz-txt-link-rfc2396E
href="mailto:sip:presence@voip.unisi.it:5060" moz-do-not-send="true">si<FONT
color=#000000>p:presence@voip.unisi.it:5060</FONT></A></TT><TT>". So, the test
fails.</TT><TT><BR></TT><TT><BR></TT><TT>You can adapt the test
like:</TT><TT><BR></TT><TT> if
(is_method("SUBSCRIBE") && $rd == "voip.unisi.it") { # CUSTOMIZE
ME</TT><TT><BR></TT><TT><BR></TT><TT>Or set the contact in presence with the
real IP:</TT><TT><BR></TT><TT>
</TT><TT>modparam("presence", "server_address", <A class=moz-txt-link-rfc2396E
href="mailto:sip:presence@127.0.0.1:5060">mailto:sip:presence@127.0.0.1:5060</A>)</TT></DIV><TT><BR>Best
regards,<BR></TT><PRE class=moz-signature cols="72">Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
<A class=moz-txt-link-freetext href="http://www.opensips-solutions.com">http://www.opensips-solutions.com</A></PRE>On
24.02.2015 12:04, Michele Pinassi wrote:<BR></DIV>
<BLOCKQUOTE cite=mid:54EC4C92.8040204@unisi.it type="cite">Hi all,<BR><BR>I'm
still stuck on this issue: BLF not working. For example, on my SNOM 760 (ext
5002) i activated BLF for some ext, like 5020. Using SIPGREP i
saw:<BR><B><BR></B><B>SUBSCRIBE <A class=moz-txt-link-abbreviated
href="mailto:sip:5020@voip.unisi.it;user=phone"
moz-do-not-send="true">sip:5020@voip.unisi.it;user=phone</A>
SIP/2.0.</B><BR>Via: SIP/2.0/UDP
172.20.1.10:57286;branch=z9hG4bK-nprg3gvnk4q1;rport.<BR>From: <A
class=moz-txt-link-rfc2396E href="mailto:sip:5002@voip.unisi.it:5060"
moz-do-not-send="true">mailto:sip:5002@voip.unisi.it:5060</A>;tag=nyux2omhly.<BR>To:
<A class=moz-txt-link-rfc2396E href="mailto:sip:5020@voip.unisi.it;user=phone"
moz-do-not-send="true">mailto:sip:5020@voip.unisi.it;user=phone</A>.<BR>Call-ID:
3944ec54dc20-pfzjpjhrpm6p.<BR>CSeq: 2 SUBSCRIBE.<BR>Max-Forwards:
70.<BR>Contact: <A class=moz-txt-link-rfc2396E
href="mailto:sip:5002@172.20.1.10:57286"
moz-do-not-send="true">mailto:sip:5002@172.20.1.10:57286</A>;reg-id=1.<BR>Event:
dialog.<BR>Accept: application/dialog-info+xml.<BR>User-Agent:
snom760/8.7.3.25.9.<BR>Proxy-Authorization: Digest <BR>Expires:
3600.<BR>Content-Length: 0.<BR><BR><B>SIP/2.0 200 OK.</B><BR>Via: SIP/2.0/UDP
172.20.1.10:57286;received=172.20.1.10;branch=z9hG4bK-nprg3gvnk4q1;rport=57286.<BR>From:
<A class=moz-txt-link-rfc2396E href="mailto:sip:5002@voip.unisi.it:5060"
moz-do-not-send="true">mailto:sip:5002@voip.unisi.it:5060</A>;tag=nyux2omhly.<BR>To:
<A class=moz-txt-link-rfc2396E href="mailto:sip:5020@voip.unisi.it;user=phone"
moz-do-not-send="true">mailto:sip:5020@voip.unisi.it;user=phone</A>;tag=f315b2d58ae8829149b784764c5a40e3-163d.<BR>Call-ID:
3944ec54dc20-pfzjpjhrpm6p.<BR>CSeq: 2 SUBSCRIBE.<BR>Expires: 3600.<BR>Contact:
<A class=moz-txt-link-rfc2396E href="mailto:sip:presence@voip.unisi.it:5060"
moz-do-not-send="true">mailto:sip:presence@voip.unisi.it:5060</A>.<BR>Server:
OpenSIPS (1.11.3-tls (i386/linux)).<BR>Content-Length: 0.<BR><BR><B>NOTIFY <A
class=moz-txt-link-abbreviated href="mailto:sip:5002@172.20.1.10:57286"
moz-do-not-send="true">sip:5002@172.20.1.10:57286</A> SIP/2.0.</B><BR>Via:
SIP/2.0/UDP 172.20.1.2:5060;branch=z9hG4bKdb02.83d58916.0.<BR>To: <A
class=moz-txt-link-rfc2396E href="mailto:sip:5002@voip.unisi.it"
moz-do-not-send="true">mailto:sip:5002@voip.unisi.it</A>;tag=nyux2omhly.<BR>From:
<A class=moz-txt-link-rfc2396E href="mailto:sip:5020@voip.unisi.it"
moz-do-not-send="true">mailto:sip:5020@voip.unisi.it</A>;tag=f315b2d58ae8829149b784764c5a40e3-163d.<BR>CSeq:
1 NOTIFY.<BR>Call-ID: 3944ec54dc20-pfzjpjhrpm6p.<BR>Max-Forwards:
70.<BR>Content-Length: 147.<BR>User-Agent: OpenSIPS (1.11.3-tls
(i386/linux)).<BR>Event: dialog.<BR>Contact: <A class=moz-txt-link-rfc2396E
href="mailto:sip:presence@voip.unisi.it:5060"
moz-do-not-send="true">mailto:sip:presence@voip.unisi.it:5060</A>.<BR>Subscription-State:
active;expires=3600.<BR>Content-Type:
application/dialog-info+xml.<BR>.<BR><?xml
version="1.0"?><BR><dialog-info
xmlns="urn:ietf:params:xml:ns:dialog-info" version="0" state="full" entity=<A
class=moz-txt-link-rfc2396E href="mailto:sip:5020@voip.unisi.it"
moz-do-not-send="true">mailto:sip:5020@voip.unisi.it</A>/><BR><B><BR></B><B>SIP/2.0
200 Ok.</B><BR>Via: SIP/2.0/UDP
172.20.1.2:5060;branch=z9hG4bKdb02.83d58916.0.<BR>From: <A
class=moz-txt-link-rfc2396E href="mailto:sip:5020@voip.unisi.it"
moz-do-not-send="true">mailto:sip:5020@voip.unisi.it</A>;tag=f315b2d58ae8829149b784764c5a40e3-163d.<BR>To:
<A class=moz-txt-link-rfc2396E href="mailto:sip:5002@voip.unisi.it"
moz-do-not-send="true">mailto:sip:5002@voip.unisi.it</A>;tag=nyux2omhly.<BR>Call-ID:
3944ec54dc20-pfzjpjhrpm6p.<BR>CSeq: 1 NOTIFY.<BR>Content-Length:
0.<BR><BR><B>SUBSCRIBE <A class=moz-txt-link-abbreviated
href="mailto:sip:presence@voip.unisi.it:5060"
moz-do-not-send="true">sip:presence@voip.unisi.it:5060</A>
SIP/2.0.</B><BR>Via: SIP/2.0/UDP
172.20.1.25:32768;branch=z9hG4bK-lbgnea3kuorq;rport.<BR>From: <A
class=moz-txt-link-rfc2396E href="mailto:sip:5007@voip.unisi.it:5060"
moz-do-not-send="true">mailto:sip:5007@voip.unisi.it:5060</A>;tag=w8vp9q5iyn.<BR>To:
<A class=moz-txt-link-rfc2396E href="mailto:sip:5002@voip.unisi.it;user=phone"
moz-do-not-send="true">mailto:sip:5002@voip.unisi.it;user=phone</A>;tag=f315b2d58ae8829149b784764c5a40e3-29cc.<BR>Call-ID:
54ec3a578c9e-klgn0s3i32zo.<BR>CSeq: 75 SUBSCRIBE.<BR>Max-Forwards:
70.<BR>Contact: <A class=moz-txt-link-rfc2396E
href="mailto:sip:5007@172.20.1.25:32768"
moz-do-not-send="true">mailto:sip:5007@172.20.1.25:32768</A>;reg-id=1.<BR>Event:
dialog.<BR>Accept: application/dialog-info+xml.<BR>User-Agent:
snom710/8.7.3.25.9.<BR>Expires: 3600.<BR>Content-Length:
0.<BR><B><BR></B><B>SIP/2.0 404 Not here.</B><BR>Via: SIP/2.0/UDP
172.20.1.25:32768;received=172.20.1.25;branch=z9hG4bK-lbgnea3kuorq;rport=32768.<BR>From:
<A class=moz-txt-link-rfc2396E href="mailto:sip:5007@voip.unisi.it:5060"
moz-do-not-send="true">mailto:sip:5007@voip.unisi.it:5060</A>;tag=w8vp9q5iyn.<BR>To:
<A class=moz-txt-link-rfc2396E href="mailto:sip:5002@voip.unisi.it;user=phone"
moz-do-not-send="true">mailto:sip:5002@voip.unisi.it;user=phone</A>;tag=f315b2d58ae8829149b784764c5a40e3-29cc.<BR>Call-ID:
54ec3a578c9e-klgn0s3i32zo.<BR>CSeq: 75 SUBSCRIBE.<BR>Server: OpenSIPS
(1.11.3-tls (i386/linux)).<BR>Content-Length: 0.<BR><BR><B>NOTIFY <A
class=moz-txt-link-abbreviated href="mailto:sip:5002@172.20.1.10:57286"
moz-do-not-send="true">sip:5002@172.20.1.10:57286</A> SIP/2.0.</B><BR>Via:
SIP/2.0/UDP 172.20.1.2:5060;branch=z9hG4bKdbe9.7966c706.0.<BR>To: <A
class=moz-txt-link-rfc2396E href="mailto:sip:5002@voip.unisi.it"
moz-do-not-send="true">mailto:sip:5002@voip.unisi.it</A>;tag=iklb1qjh1v.<BR>From:
<A class=moz-txt-link-rfc2396E href="mailto:sip:5007@voip.unisi.it"
moz-do-not-send="true">mailto:sip:5007@voip.unisi.it</A>;tag=f315b2d58ae8829149b784764c5a40e3-b571.<BR>CSeq:
2 NOTIFY.<BR>Call-ID: ee35ec54a72b-draf1nwo4qn7.<BR>Max-Forwards:
70.<BR>Content-Length: 0.<BR>User-Agent: OpenSIPS (1.11.3-tls
(i386/linux)).<BR>Event: dialog.<BR>Contact: <A class=moz-txt-link-rfc2396E
href="mailto:sip:presence@voip.unisi.it:5060"
moz-do-not-send="true">mailto:sip:presence@voip.unisi.it:5060</A>.<BR><B>Subscription-State:
terminated;reason=timeout.</B><BR><B><BR></B><B>SIP/2.0 200 Ok.</B><BR>Via:
SIP/2.0/UDP 172.20.1.2:5060;branch=z9hG4bKdbe9.7966c706.0.<BR>From: <A
class=moz-txt-link-rfc2396E href="mailto:sip:5007@voip.unisi.it"
moz-do-not-send="true">mailto:sip:5007@voip.unisi.it</A>;tag=f315b2d58ae8829149b784764c5a40e3-b571.<BR>To:
<A class=moz-txt-link-rfc2396E href="mailto:sip:5002@voip.unisi.it"
moz-do-not-send="true">mailto:sip:5002@voip.unisi.it</A>;tag=iklb1qjh1v.<BR>Call-ID:
ee35ec54a72b-draf1nwo4qn7.<BR>CSeq: 2 NOTIFY.<BR>Content-Length: 0.<BR><BR>The
line 5020 was active but no lamp was powered. Also no NOTIFY or other event
was sent by Opensips server when i try to call (from another phone)
5020.<BR><BR>The full opensips.cfg is available here: <A
class=moz-txt-link-freetext href="http://pastebin.com/e6SfbFfq"
moz-do-not-send="true">http://pastebin.com/e6SfbFfq</A><BR><BR>Thanks for any
help.<BR><BR>Michele<BR><BR><PRE class=moz-signature cols="72">--
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, <A class=moz-txt-link-freetext href="http://www.faq.unisi.it" moz-do-not-send="true">http://www.faq.unisi.it</A> </PRE><BR>
<FIELDSET class=mimeAttachmentHeader></FIELDSET> <BR><PRE wrap="">_______________________________________________
Users mailing list
<A class=moz-txt-link-abbreviated href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</A>
<A class=moz-txt-link-freetext href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</A>
</PRE></BLOCKQUOTE><BR>
<P>
<HR>
_______________________________________________<BR>Users mailing
list<BR>Users@lists.opensips.org<BR>http://lists.opensips.org/cgi-bin/mailman/listinfo/users<BR></DIV></DIV></DIV></BODY></HTML>