Send Text notification to SAMSUNG TV

Support for C series TVs that all user could ask. Please do not ask a questions at other forums.
Post Reply

bilouz
Posts: 3
Joined: Sat May 25, 2013 12:27 pm

Send Text notification to SAMSUNG TV

Post by bilouz »

Hello everybody
I am desperate to try to send a message to my TV.
I have read many articles on the forums but I still can not send a message. I understood that he had to use the messageboxservice. I followed all the tutorial posted on the forum (and other SamyGo) but nothing.
I tried setting my network (IP, port), I tried to send a message using sms4TV software successfully so I do not understand.

My idea is to send message via PHP (from NAS device) so I find this one source language.
Here is the source code for my program.

Has anyone succeeded in sending a message to the TV?
Please help me. Thanks a lot
Bilouz

Code: Select all

<?php 

// Adress of Service Web of my TV ** Tested OK 
$post_url  = "http://192.168.0.15:52235/PMR/control/MessageBoxService";

// Body of xml information to post
$xml_builder  ="<?xml version="1.0" encoding="utf-8"?>
  <s:Envelope s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" >
    <s:Body>
      <u:AddMessage xmlns:u="urn:samsung.com:service:MessageBoxService:1\">
        <MessageType>text/xml</MessageType>
        <MessageID>0</MessageID>
        <Message>
          &lt;Category&gt;SMS&lt;/Category&gt;
          &lt;DisplayType&gt;Maximum&lt;/DisplayType&gt;
          &lt;ReceiveTime&gt;
          &lt;Date&gt;2010-05-04&lt;/Date&gt;
          &lt;Time&gt;01:02:03&lt;/Time&gt;
          &lt;/ReceiveTime&gt;
          &lt;Receiver&gt;
          &lt;Number&gt;12345678&lt;/Number&gt;
          &lt;Name&gt;Receiver&lt;/Name&gt;
          &lt;/Receiver&gt;
          &lt;Sender&gt;
          &lt;Number&gt;11111&lt;/Number&gt;
          &lt;Name&gt;Sender&lt;/Name&gt;
          &lt;/Sender&gt;
          &lt;Body&gt;Hello World!!!&lt;/Body&gt;
        </Message>
      </u:AddMessage>
    </s:Body>
  </s:Envelope>";

$ch = curl_init($post_url);
  curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: text/xml'));
  curl_setopt($ch, CURLOPT_HEADER, 0);
  curl_setopt($ch, CURLOPT_POST, 1);
  curl_setopt($ch, CURLOPT_POSTFIELDS, $xml_builder);
  curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0);
  curl_setopt($ch, CURLOPT_REFERER, 'http://www.bharath..co.uk');
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  $ch_result = curl_exec($ch);
  curl_close($ch);
  // Print CURL result.
  echo $ch_result;
 
?>
User avatar
juusso
SamyGO Moderator
Posts: 10129
Joined: Sun Mar 07, 2010 6:20 pm

Re: Send Text notification to SAMSUNG TV

Post by juusso »

what is your tv model and firmware?
LE40B653T5W,UE40D6750,UE65Q8C
Have questions? Read SamyGO Wiki, Search on forum first!
FFB (v0.8), FFB for CI+ . Get root on: C series, D series, E series, F series, H series. rooting K series, exeDSP/exeTV patches[C/D/E/F/H]

DO NOT EVER INSTALL FIRMWARE UPGRADE
bilouz
Posts: 3
Joined: Sat May 25, 2013 12:27 pm

Re: Send Text notification to SAMSUNG TV

Post by bilouz »

My model is : PS50C7700 but I think it's possible to send message on this TV because with the program SMS4TV it's OK.
So it's my code source which is wrong i think , but where ???
User avatar
juusso
SamyGO Moderator
Posts: 10129
Joined: Sun Mar 07, 2010 6:20 pm

Re: Send Text notification to SAMSUNG TV

Post by juusso »

i`m not really familar with php, but there you could read about some solution in bash.

Code: Select all

#! /bin/sh
# usage: ./makeSoap2 "06.05.10 19:19:50;RING;1;1234;4567;SIP1;" 192.168.178.38

# ENTER NETCAT PATH HERE:
#########################
NETCAT="nc"

# TEST IF MESSAGE TYPE IS RING, OTHERWISE QUIT
case $1 in
*RING*)
# SPLIT MESSAGE STRING
DESTINATION=$2
IFS=";"
set -- $1
DATETIME=$1
CALLEE=$5
CALLER=$4

wget -q --tries=3 --timeout=5 -O "tmpfile" "http://www1.dasoertliche.de/?form_name=search_inv&ph=$CALLER"
SUCHZEILE=`grep "nachname" tmpfile`

TMP1=${SUCHZEILE#*nachname=}

IFS="&"
set -- $TMP1
name=$1
street=$2
nr=$3
plz=$4

rm tmpfile

IFS=" "
set -- $DATETIME
CALLDATE=$1
CALLTIME=$2

# BUILD XML
soap="<?xml version=\"1.0\" encoding=\"utf-8\"?>
<s:Envelope s:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\" xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\" >
<s:Body>
<u:AddMessage xmlns:u=\"urn:samsung.com:service:MessageBoxService:1\\\">
<MessageType>text/xml</MessageType>
<MessageID>'$(date +%H%M%S)'</MessageID>
<Message>
<Category>Incoming Call</Category>
<DisplayType>Maximum</DisplayType>
<CallTime>
<Date>$CALLDATE</Date>
<Time>$CALLTIME</Time>
</CallTime>
<Callee>
<Number>$CALLEE</Number>
<Name>$CALLER</Name>
</Callee>
<Caller>
<Number>$CALLER</Number>
<Name>$name</Name>
</Caller>
</Message>
</u:AddMessage>
</s:Body>
</s:Envelope>
"

# echo $soap
# echo length: ${#soap}

# BUILD HTTP
message="POST /PMR/control/MessageBoxService HTTP/1.0 
Content-Type: text/xml; charset=\"utf-8\" 
HOST: $DESTINATION 
Content-Length: $((${#soap}+0)) 
SOAPACTION: \"urn:samsung.com:service:MessageBoxService:1#AddMessage\" 
Connection: close 

$soap"

echo "CallMessage send"
#echo lenght: ${#soap}

#echo $message >soapTV
# SEND MESSAGE TO TV
echo $message | $NETCAT -n -w 1 $DESTINATION 52235
;;

*)
;;

esac
You do not have the required permissions to view the files attached to this post.
LE40B653T5W,UE40D6750,UE65Q8C
Have questions? Read SamyGO Wiki, Search on forum first!
FFB (v0.8), FFB for CI+ . Get root on: C series, D series, E series, F series, H series. rooting K series, exeDSP/exeTV patches[C/D/E/F/H]

DO NOT EVER INSTALL FIRMWARE UPGRADE
bilouz
Posts: 3
Joined: Sat May 25, 2013 12:27 pm

Re: Send Text notification to SAMSUNG TV

Post by bilouz »

Thanks a lot for your help, I m going to test that , soon and I will be back to give a feedback.
Bye
Bilouz

Post Reply

Return to “[C] Support”