<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<style>
<!--
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
p
        {mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman";}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:Arial;
        color:windowtext;}
@page Section1
        {size:595.3pt 841.9pt;
        margin:3.0cm 2.0cm 3.0cm 2.0cm;}
div.Section1
        {page:Section1;}
-->
</style>

</head>

<body lang=DA link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>I have tested how I can control a SIP-phone receiving
a call to go off-hook. &nbsp;This is possible by sending a NOTIFY with the SIP Event-header
set to talk.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>My problem is that the NOTIFY message does not
include exactly the same SIP To-header information as the FS received as a
RINGING response to the INVITE: The tag from the RINGING response, which the
phone adds to the SIP To-header, is not included in the NOTIFY. Snom-phones -
and possibly other SIP phones as well, uses this tag in the SIP To-header to pinpoint
the exact call to be answered.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>The information is actually present before the NOTIFY
is sent. I have tested it in the dialplan using the info application just
before firing off the sendevent NOTIFY.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>Is there any reason for this behaviour, which I
should be aware of before dabbling with the code?<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>I have checked the mod_sofia.c code and have found
the code which sends the NOTIFY (with the uuid, event and message type as input
parameters):<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal style='text-autospace:none'><font size=1 face="Courier New"><span
lang=EN-GB style='font-size:9.0pt;font-family:"Courier New"'>if (uuid
&amp;&amp; ct &amp;&amp; es) {<o:p></o:p></span></font></p>

<p class=MsoNormal style='text-autospace:none'><font size=1 face="Courier New"><span
lang=EN-GB style='font-size:9.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; switch_core_session_t
*session;<o:p></o:p></span></font></p>

<p class=MsoNormal style='text-autospace:none'><font size=1 face="Courier New"><span
lang=EN-GB style='font-size:9.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; private_object_t
*tech_pvt;<o:p></o:p></span></font></p>

<p class=MsoNormal style='text-autospace:none'><font size=1 face="Courier New"><span
lang=EN-GB style='font-size:9.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
//Jon changed:
SIPTAG_SUBSCRIPTION_STATE_STR(&quot;terminated;reason=noresource&quot;) to
SIPTAG_SUBSCRIPTION_STATE_STR(&quot;active&quot;)<o:p></o:p></span></font></p>

<p class=MsoNormal style='text-autospace:none'><font size=1 face="Courier New"><span
lang=EN-GB style='font-size:9.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if
((session = switch_core_session_locate(uuid))) {<o:p></o:p></span></font></p>

<p class=MsoNormal style='text-autospace:none'><font size=1 face="Courier New"><span
lang=EN-GB style='font-size:9.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if
((tech_pvt = switch_core_session_get_private(session))) {<o:p></o:p></span></font></p>

<p class=MsoNormal style='text-autospace:none'><font size=1 face="Courier New"><span
lang=EN-GB style='font-size:9.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; nua_notify(tech_pvt-&gt;nh,<o:p></o:p></span></font></p>

<p class=MsoNormal style='text-autospace:none'><font size=1 face="Courier New"><span
lang=EN-GB style='font-size:9.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;
NUTAG_NEWSUB(1), SIPTAG_SUBSCRIPTION_STATE_STR(&quot;active&quot;),<o:p></o:p></span></font></p>

<p class=MsoNormal style='text-autospace:none'><font size=1 face="Courier New"><span
lang=EN-GB style='font-size:9.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;
SIPTAG_EVENT_STR(es), SIPTAG_CONTENT_TYPE_STR(ct), TAG_IF(!zstr(body),
SIPTAG_PAYLOAD_STR(body)), TAG_END());<o:p></o:p></span></font></p>

<p class=MsoNormal style='text-autospace:none'><font size=1 face="Courier New"><span
lang=EN-GB style='font-size:9.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<o:p></o:p></span></font></p>

<p class=MsoNormal style='text-autospace:none'><font size=1 face="Courier New"><span
lang=EN-GB style='font-size:9.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; switch_core_session_rwunlock(session);<o:p></o:p></span></font></p>

<p class=MsoNormal style='text-autospace:none'><font size=1 face="Courier New"><span
lang=EN-GB style='font-size:9.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=1 face="Courier New"><span lang=EN-GB
style='font-size:9.0pt;font-family:"Courier New"'>}<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>But in order to change the behaviour, I may need to
look somewhere else. Some hints as to where to look would be appreciated!<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>Regards Jon<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=3 face="Times New Roman"><span lang=EN-GB
style='font-size:12.0pt'><o:p>&nbsp;</o:p></span></font></p>

</div>

</body>

</html>