<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: sendMsg: Sending messages using PHP</title>
	<atom:link href="http://www.fanatic.net.nz/2005/02/15/send-a-message-using-php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.fanatic.net.nz/2005/02/15/send-a-message-using-php/</link>
	<description>All about Windows Live Messenger, providing news, reviews, support, and information for developing and improving your Messenger experience.</description>
	<lastBuildDate>Sun, 21 Jun 2009 05:38:12 +1200</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Arun</title>
		<link>http://www.fanatic.net.nz/2005/02/15/send-a-message-using-php/comment-page-2/#comment-142332</link>
		<dc:creator>Arun</dc:creator>
		<pubDate>Fri, 08 May 2009 07:32:04 +0000</pubDate>
		<guid isPermaLink="false">http://djwinter.net/presstest/?p=38#comment-142332</guid>
		<description>Hi,

How to send msn messages to 2 users. it should send to both users even though the first user offline. any idea on this</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>How to send msn messages to 2 users. it should send to both users even though the first user offline. any idea on this</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nelson</title>
		<link>http://www.fanatic.net.nz/2005/02/15/send-a-message-using-php/comment-page-2/#comment-142314</link>
		<dc:creator>Nelson</dc:creator>
		<pubDate>Mon, 27 Apr 2009 03:22:22 +0000</pubDate>
		<guid isPermaLink="false">http://djwinter.net/presstest/?p=38#comment-142314</guid>
		<description>this script seems all find and dandy but we can NOT send to Offline users. Based on the above messages, this would seem to be a Number One Problem with the script.

Please e-mail me with the solution.

Nelson buck</description>
		<content:encoded><![CDATA[<p>this script seems all find and dandy but we can NOT send to Offline users. Based on the above messages, this would seem to be a Number One Problem with the script.</p>
<p>Please e-mail me with the solution.</p>
<p>Nelson buck</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: vignesh</title>
		<link>http://www.fanatic.net.nz/2005/02/15/send-a-message-using-php/comment-page-2/#comment-142173</link>
		<dc:creator>vignesh</dc:creator>
		<pubDate>Thu, 26 Feb 2009 18:04:49 +0000</pubDate>
		<guid isPermaLink="false">http://djwinter.net/presstest/?p=38#comment-142173</guid>
		<description>Hi... your script work for me well.. but i need to send msg to offline contact as well... is that possible...?

I have searched in google, but unable to get it.
waiting for your reply... Please reply me soon... :(</description>
		<content:encoded><![CDATA[<p>Hi&#8230; your script work for me well.. but i need to send msg to offline contact as well&#8230; is that possible&#8230;?</p>
<p>I have searched in google, but unable to get it.<br />
waiting for your reply&#8230; Please reply me soon&#8230; <img src='http://www.fanatic.net.nz/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mohit</title>
		<link>http://www.fanatic.net.nz/2005/02/15/send-a-message-using-php/comment-page-2/#comment-142137</link>
		<dc:creator>mohit</dc:creator>
		<pubDate>Mon, 16 Feb 2009 06:02:40 +0000</pubDate>
		<guid isPermaLink="false">http://djwinter.net/presstest/?p=38#comment-142137</guid>
		<description>Recieving Error (217) The user appears to be offline. Even if the user is online. Can IM will only be sent to online users and the contacts that are in the contact list.............</description>
		<content:encoded><![CDATA[<p>Recieving Error (217) The user appears to be offline. Even if the user is online. Can IM will only be sent to online users and the contacts that are in the contact list&#8230;&#8230;&#8230;&#8230;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Umberto</title>
		<link>http://www.fanatic.net.nz/2005/02/15/send-a-message-using-php/comment-page-2/#comment-142065</link>
		<dc:creator>Umberto</dc:creator>
		<pubDate>Thu, 08 Jan 2009 22:16:07 +0000</pubDate>
		<guid isPermaLink="false">http://djwinter.net/presstest/?p=38#comment-142065</guid>
		<description>How can I modify it to send multiple messages or a messages to multiple contacts.</description>
		<content:encoded><![CDATA[<p>How can I modify it to send multiple messages or a messages to multiple contacts.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: MeEtc</title>
		<link>http://www.fanatic.net.nz/2005/02/15/send-a-message-using-php/comment-page-2/#comment-142014</link>
		<dc:creator>MeEtc</dc:creator>
		<pubDate>Sat, 13 Dec 2008 06:22:17 +0000</pubDate>
		<guid isPermaLink="false">http://djwinter.net/presstest/?p=38#comment-142014</guid>
		<description>Some updates to the last post, it didn&#039;t format properly:


After sending from the script:
&lt;&lt;&lt; NS CHG 4 NLN
&lt;&lt;&lt; NS XFR 5 SB
&gt;&gt;&gt; NS CHG 4 NLN 0
&gt;&gt;&gt; NS XFR 5 SB 207.46.26.159:1863 CKI 354526828.16034168.884359
The switchboard session is opened, and messages can be sent.

Now, what I discovered is the response to these can get garbled:

&gt;&gt;&gt; NS NOT 340
&gt;&gt;&gt; NS &lt;NOTIFICATION ver=&quot;2&quot; id=&quot;2&quot; siteid=&quot;0&quot; siteurl=&quot;http://g.live.com/&quot;&gt;&lt;TO name=&quot;email at domain.com&quot; pid=&quot;0x0:0x0&quot;/&gt;&lt;MSG pri=&quot;1&quot; id=&quot;2&quot;&gt;&lt;ACTION url=&quot;5meen_ca/80&quot;/&gt;&lt;SUBSCR url=&quot;5meen_ca/80&quot;/&gt;&lt;BODY lang=&quot;1033&quot; icon=&quot;&quot;&gt;&lt;TEXT&gt;To see your offline messages, get the latest version of Windows Live(TM) Messenger.&lt;/TEXT&gt;&lt;/BODY&gt;&lt;/MSG&gt;&lt;/NOTIFICATION&gt;XFR 5 SB 64.4.37.58:1863 CKI 528727238.18922235.378208
&gt;&gt;&gt; NS CHG 4 NLN 0</description>
		<content:encoded><![CDATA[<p>Some updates to the last post, it didn&#8217;t format properly:</p>
<p>After sending from the script:<br />
&lt;&lt;&lt; NS CHG 4 NLN<br />
&lt;&lt;&lt; NS XFR 5 SB<br />
&gt;&gt;&gt; NS CHG 4 NLN 0<br />
&gt;&gt;&gt; NS XFR 5 SB 207.46.26.159:1863 CKI 354526828.16034168.884359<br />
The switchboard session is opened, and messages can be sent.</p>
<p>Now, what I discovered is the response to these can get garbled:</p>
<p>&gt;&gt;&gt; NS NOT 340<br />
&gt;&gt;&gt; NS &lt;NOTIFICATION ver=&#8221;2&#8243; id=&#8221;2&#8243; siteid=&#8221;0&#8243; siteurl=&#8221;http://g.live.com/&#8221;&gt;&lt;TO name=&#8221;email at domain.com&#8221; pid=&#8221;0&#215;0:0&#215;0&#8243;/&gt;&lt;MSG pri=&#8221;1&#8243; id=&#8221;2&#8243;&gt;&lt;ACTION url=&#8221;5meen_ca/80&#8243;/&gt;&lt;SUBSCR url=&#8221;5meen_ca/80&#8243;/&gt;&lt;BODY lang=&#8221;1033&#8243; icon=&#8221;"&gt;&lt;TEXT&gt;To see your offline messages, get the latest version of Windows Live(TM) Messenger.&lt;/TEXT&gt;&lt;/BODY&gt;&lt;/MSG&gt;&lt;/NOTIFICATION&gt;XFR 5 SB 64.4.37.58:1863 CKI 528727238.18922235.378208<br />
&gt;&gt;&gt; NS CHG 4 NLN 0</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: MeEtc</title>
		<link>http://www.fanatic.net.nz/2005/02/15/send-a-message-using-php/comment-page-2/#comment-142013</link>
		<dc:creator>MeEtc</dc:creator>
		<pubDate>Sat, 13 Dec 2008 06:18:26 +0000</pubDate>
		<guid isPermaLink="false">http://djwinter.net/presstest/?p=38#comment-142013</guid>
		<description>Somehow I suspect that this will be a long post...

First I would like to respond to a few of the other comments about receiving 217 even though the contact is online.
The receiving contact must have the sender on their contact list to guarantee to work, OR make sure that &quot;Only people on my Allow List can see my status and send me messages&quot; on Options &gt; Privacy in WLM is disabled. I&#039;d recommend just adding the contact (manually, because this script doesn&#039;t have the functionality to add contacts).

I have been using this class in the project I have been working on over the past year or so, and randomly I kept receiving fputs argument is not a valid stream resource. As the script is in heavy usage, I got a lot of these errors. So finally I added some debugging statements to log all of the protocol messages to file to see where things were breaking. Turns out that MS is adding some unexpected text into the protocol, and the script can&#039;t find what its looking for.
In an ideal situation, here is what is sent in the script
After sending from the script:
&lt;&lt;&lt; NS CHG 4 NLN
&lt;&lt;&gt;&gt; NS CHG 4 NLN 0
&gt;&gt;&gt; NS XFR 5 SB 207.46.26.159:1863 CKI 354526828.16034168.884359
The switchboard session is opened, and messages can be sent.

Now, what I discovered is the response to these can get garbled:

&gt;&gt;&gt; NS NOT 340
&gt;&gt;&gt; NS To see your offline messages, get the latest version of Windows Live(TM) Messenger.XFR 5 SB 64.4.37.58:1863 CKI 528727238.18922235.378208
&gt;&gt;&gt; NS CHG 4 NLN 0


What happened here is a NOT is sent from the server (in this case, string length of 340) with a notification sent on the following line. Immediately following the Notification, on THE SAME LINE, was either the responding CHG or XFR from the NS. The result in the code is the _process_data function does not find the XFR and sits idle until timing out.

Here&#039;s my solution. In the _process_data function&#039;s switch statement, add in a new case. Most of the code is just repeated from _read, except the notification string is truncated. Hopefully this code won&#039;t look horrible after posting

case &#039;NOT&#039;:
   $data = substr(fgets($this-&gt;_sockets[&#039;NS&#039;], 1024), $params[1], -2);
   $r = $this-&gt;_process_data($data);
      while (!feof($this-&gt;_sockets[&#039;NS&#039;]) &amp;&amp; !$r)
      {
         $data = fgets($this-&gt;_sockets[$socket], 1024);
         if (!$data)
         {
            continue;
         }
         $data = substr($data, 0, -2);
         $r = $this-&gt;_process_data($data);
         if ($r)
         {
            return;
         }
      }
   return(true);
break;</description>
		<content:encoded><![CDATA[<p>Somehow I suspect that this will be a long post&#8230;</p>
<p>First I would like to respond to a few of the other comments about receiving 217 even though the contact is online.<br />
The receiving contact must have the sender on their contact list to guarantee to work, OR make sure that &#8220;Only people on my Allow List can see my status and send me messages&#8221; on Options &gt; Privacy in WLM is disabled. I&#8217;d recommend just adding the contact (manually, because this script doesn&#8217;t have the functionality to add contacts).</p>
<p>I have been using this class in the project I have been working on over the past year or so, and randomly I kept receiving fputs argument is not a valid stream resource. As the script is in heavy usage, I got a lot of these errors. So finally I added some debugging statements to log all of the protocol messages to file to see where things were breaking. Turns out that MS is adding some unexpected text into the protocol, and the script can&#8217;t find what its looking for.<br />
In an ideal situation, here is what is sent in the script<br />
After sending from the script:<br />
&lt;&lt;&lt; NS CHG 4 NLN<br />
&lt;&lt;&gt;&gt; NS CHG 4 NLN 0<br />
&gt;&gt;&gt; NS XFR 5 SB 207.46.26.159:1863 CKI 354526828.16034168.884359<br />
The switchboard session is opened, and messages can be sent.</p>
<p>Now, what I discovered is the response to these can get garbled:</p>
<p>&gt;&gt;&gt; NS NOT 340<br />
&gt;&gt;&gt; NS To see your offline messages, get the latest version of Windows Live(TM) Messenger.XFR 5 SB 64.4.37.58:1863 CKI 528727238.18922235.378208<br />
&gt;&gt;&gt; NS CHG 4 NLN 0</p>
<p>What happened here is a NOT is sent from the server (in this case, string length of 340) with a notification sent on the following line. Immediately following the Notification, on THE SAME LINE, was either the responding CHG or XFR from the NS. The result in the code is the _process_data function does not find the XFR and sits idle until timing out.</p>
<p>Here&#8217;s my solution. In the _process_data function&#8217;s switch statement, add in a new case. Most of the code is just repeated from _read, except the notification string is truncated. Hopefully this code won&#8217;t look horrible after posting</p>
<p>case &#8216;NOT&#8217;:<br />
   $data = substr(fgets($this-&gt;_sockets['NS'], 1024), $params[1], -2);<br />
   $r = $this-&gt;_process_data($data);<br />
      while (!feof($this-&gt;_sockets['NS']) &amp;&amp; !$r)<br />
      {<br />
         $data = fgets($this-&gt;_sockets[$socket], 1024);<br />
         if (!$data)<br />
         {<br />
            continue;<br />
         }<br />
         $data = substr($data, 0, -2);<br />
         $r = $this-&gt;_process_data($data);<br />
         if ($r)<br />
         {<br />
            return;<br />
         }<br />
      }<br />
   return(true);<br />
break;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: adil kara</title>
		<link>http://www.fanatic.net.nz/2005/02/15/send-a-message-using-php/comment-page-2/#comment-141968</link>
		<dc:creator>adil kara</dc:creator>
		<pubDate>Wed, 26 Nov 2008 20:17:59 +0000</pubDate>
		<guid isPermaLink="false">http://djwinter.net/presstest/?p=38#comment-141968</guid>
		<description>hi
how can i send auto friendship request to other user?
or
how i accept when i take friendship request?</description>
		<content:encoded><![CDATA[<p>hi<br />
how can i send auto friendship request to other user?<br />
or<br />
how i accept when i take friendship request?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jeroen</title>
		<link>http://www.fanatic.net.nz/2005/02/15/send-a-message-using-php/comment-page-2/#comment-141907</link>
		<dc:creator>jeroen</dc:creator>
		<pubDate>Sat, 01 Nov 2008 17:19:06 +0000</pubDate>
		<guid isPermaLink="false">http://djwinter.net/presstest/?p=38#comment-141907</guid>
		<description>Excellent web site I will be visiting often+</description>
		<content:encoded><![CDATA[<p>Excellent web site I will be visiting often+</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Platon</title>
		<link>http://www.fanatic.net.nz/2005/02/15/send-a-message-using-php/comment-page-2/#comment-141770</link>
		<dc:creator>Platon</dc:creator>
		<pubDate>Thu, 02 Oct 2008 04:31:48 +0000</pubDate>
		<guid isPermaLink="false">http://djwinter.net/presstest/?p=38#comment-141770</guid>
		<description>Thanks mate, i find this class very useful :)</description>
		<content:encoded><![CDATA[<p>Thanks mate, i find this class very useful <img src='http://www.fanatic.net.nz/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
</channel>
</rss>
