<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" 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 12 (filtered medium)">
<style>
<!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.MsoPlainText, li.MsoPlainText, div.MsoPlainText
        {mso-style-priority:99;
        mso-style-link:"Plain Text Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.5pt;
        font-family:Consolas;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Balloon Text Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.BalloonTextChar
        {mso-style-name:"Balloon Text Char";
        mso-style-priority:99;
        mso-style-link:"Balloon Text";
        font-family:"Tahoma","sans-serif";}
span.PlainTextChar
        {mso-style-name:"Plain Text Char";
        mso-style-priority:99;
        mso-style-link:"Plain Text";
        font-family:Consolas;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page Section1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang=EN-GB link=blue vlink=purple>
<div class=Section1>
<p class=MsoPlainText>Hello,<o:p></o:p></p>
<p class=MsoPlainText><o:p> </o:p></p>
<p class=MsoPlainText>Sent this post a couple of weeks back. Still trying to
find a solution, so <o:p></o:p></p>
<p class=MsoPlainText>trying again and see if anyone has any thoughts!<o:p></o:p></p>
<p class=MsoPlainText><o:p> </o:p></p>
<p class=MsoPlainText>I am trying to send CUSTOM NOTIFY events to devices,
using the ESL interface <o:p></o:p></p>
<p class=MsoPlainText>with a PHP script of the following form. I am having
partial success, but <o:p></o:p></p>
<p class=MsoPlainText>coming up against problems when using with an outbound
SIP proxy:-<o:p></o:p></p>
<p class=MsoPlainText><o:p> </o:p></p>
<p class=MsoPlainText> $e = new
ESLevent("NOTIFY");<o:p></o:p></p>
<p class=MsoPlainText>
$e->addHeader("profile", "internal");<o:p></o:p></p>
<p class=MsoPlainText> $e->addHeader("from",
"1020");<o:p></o:p></p>
<p class=MsoPlainText> $e->addHeader("to-uri",
"<a href="sip:1019@192.168.2.3:5063;fs_path=sip:82.24.214.226:5063">sip:1019@192.168.2.3:5063;fs_path=sip:82.24.214.226:5063</a>");<o:p></o:p></p>
<p class=MsoPlainText> $e->addHeader("from-uri",
"<a href="sip:1020@pbx.rm.com">sip:1020@pbx.rm.com</a>");<o:p></o:p></p>
<p class=MsoPlainText> $e->addHeader("host",
"pbx.rm.com");<o:p></o:p></p>
<p class=MsoPlainText> $e->addHeader("event-string",
"check-sync");<o:p></o:p></p>
<p class=MsoPlainText> $e->addHeader("content-type",
"application/simple-message-summary");<o:p></o:p></p>
<p class=MsoPlainText> $e->addBody("ok");<o:p></o:p></p>
<p class=MsoPlainText> $res =
$sockFSServerCommand->sendEvent($e);<o:p></o:p></p>
<p class=MsoPlainText><o:p> </o:p></p>
<p class=MsoPlainText>In our setup, we have several FreeSwitch boxes sitting
behind two OpenSIPS load <o:p></o:p></p>
<p class=MsoPlainText>balancers. These Load Balancers handle registrations,
etc. When we originate <o:p></o:p></p>
<p class=MsoPlainText>calls from FreeSwitch, we use an originate URL of the
form <o:p></o:p></p>
<p class=MsoPlainText>(<a
href="mailto:sofia/internal/1001@sip.redmatter.com;fs_path=sip:84.45.30.2">sofia/internal/1001@sip.redmatter.com;fs_path=sip:84.45.30.2</a>),
<o:p></o:p></p>
<p class=MsoPlainText>and use fs_path to push the sip call out via the right
load balancer/ proxy. <o:p></o:p></p>
<p class=MsoPlainText>This works perfectly.<o:p></o:p></p>
<p class=MsoPlainText> <o:p></o:p></p>
<p class=MsoPlainText>So, with the custom NOTIFY’s I also need to make
them follow the same path. <o:p></o:p></p>
<p class=MsoPlainText>As mentioned, we already have the contact string in our
hand from the OpenSIPS <o:p></o:p></p>
<p class=MsoPlainText>registration server, but can’t see how I can use
that plus force the outbound <o:p></o:p></p>
<p class=MsoPlainText>path for the Notify. Was thinking I could use fs_path in
the uri (as above) <o:p></o:p></p>
<p class=MsoPlainText>but doesn’t seem to work, i.e. the wrong IP is
used, and NOTIFY is messed <o:p></o:p></p>
<p class=MsoPlainText>up somewhat (see example below)! Maybe another
combination I am missing! <o:p></o:p></p>
<p class=MsoPlainText><o:p> </o:p></p>
<p class=MsoPlainText>------------------------<o:p></o:p></p>
<p class=MsoPlainText>NOTIFY <a
href="sip:1019@192.168.2.3:5063;fs_path=sip:82.24.214.22:5063">sip:1019@192.168.2.3:5063;fs_path=sip:82.24.214.22:5063</a>
SIP/2.0<o:p></o:p></p>
<p class=MsoPlainText>Via: SIP/2.0/UDP 212.85.24.245;rport;branch=z9hG4bKv268QHcy539yc<o:p></o:p></p>
<p class=MsoPlainText>Max-Forwards: 70<o:p></o:p></p>
<p class=MsoPlainText>From: <sip:1020@pbx.rm.com>;tag=0rer8BS2etmmc<o:p></o:p></p>
<p class=MsoPlainText>To:
<sip:1019@192.168.2.3:5063>;fs_path=sip:82.24.214.22:5063<o:p></o:p></p>
<p class=MsoPlainText>Call-ID: 5a08d5c6-1a8e-122e-3885-0024e86c401a<o:p></o:p></p>
<p class=MsoPlainText>CSeq: 134921 NOTIFY<o:p></o:p></p>
<p class=MsoPlainText>Contact: <sip:mod_sofia@212.85.24.245:5060><o:p></o:p></p>
<p class=MsoPlainText>User-Agent:
FreeSWITCH-mod_sofia/1.0.5-20100211-0400-16602<o:p></o:p></p>
<p class=MsoPlainText>Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE,
UPDATE, INFO, REGISTER, REFER, NOTIFY, PUBLISH, SUBSCRIBE<o:p></o:p></p>
<p class=MsoPlainText>Supported: precondition, path, replaces<o:p></o:p></p>
<p class=MsoPlainText>Event: check-sync<o:p></o:p></p>
<p class=MsoPlainText>Allow-Events: talk, presence, dialog, line-seize,
call-info, sla, include-session-description, presence.winfo, message-summary,
refer<o:p></o:p></p>
<p class=MsoPlainText>Subscription-State: terminated;reason=timeout<o:p></o:p></p>
<p class=MsoPlainText>Content-Type: application/simple-message-summary<o:p></o:p></p>
<p class=MsoPlainText>Content-Length: 2<o:p></o:p></p>
<p class=MsoPlainText><o:p> </o:p></p>
<p class=MsoPlainText>ok<o:p></o:p></p>
<p class=MsoPlainText>------------------<o:p></o:p></p>
<p class=MsoPlainText><o:p> </o:p></p>
<p class=MsoPlainText>Any thoughts gratefully appreciated.<o:p></o:p></p>
<p class=MsoPlainText><o:p> </o:p></p>
<p class=MsoPlainText>Rgds,<o:p></o:p></p>
<p class=MsoPlainText>Neil<o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
</div>
</body>
</html>