<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p><font face="DejaVu Serif">i had the same problem.. i solve it
setting a sip uri in "to"</font> where the user is
registered... i'm doing it on fs master, not sure if it will work
on 1.6</p>
<p><br>
</p>
<p>example:<br>
event:addHeader("to", <a class="moz-txt-link-rfc2396E" href="mailto:sip:200@192.168.10.2:38592">"sip:200@192.168.10.2:38592"</a>);</p>
<p><br>
</p>
<p>To get the uri in lua:<br>
</p>
<p>contact = api:execute("sofia_contact", <a class="moz-txt-link-rfc2396E" href="mailto:user/200@lab.local">"user/200@lab.local"</a>);<br>
profile = contact:match("sofia/(.*)/") or "";<br>
to = contact:match("sofia/.*/(.*)") or "";</p>
<br>
Probably there is a easier way...<br>
<br>
<br>
<div class="moz-cite-prefix">On 03/13/2018 04:03 PM, Ronnie Beck
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:3bb9f14310dc3c83d826f0dfbbba332f@themenz.biz">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<p><br>
</p>
<p>Hi All,</p>
<p>I am trying to write a LUA script which will slot into a
chatplan whose goal is to simple take a simple text message
(SIMPLE MESSAGE) and then distribute it to multiple recipients.
I wrote a script which takes some arguments (sender, recipieant
list and the body) then would generate new SIP Messages to be
sent to each of the recipient. The code I use to generate the
message (which is more or less the example given in mod_sms for
sending an SMS, not exactly what I want to do):</p>
<p><br>
</p>
<p>local event = freeswitch.Event("CUSTOM", "SMS::SEND_MESSAGE");<br>
event:addHeader("proto", "global");<br>
event:addHeader("dest_proto", "sip");<br>
event:addHeader("from", source);<br>
event:addHeader("to", domain.."/"..recipient);<br>
event:addHeader("type", "text/plain");<br>
event:addHeader("skip_global_process", "true");<br>
event:addBody( body );<br>
event:fire();</p>
<p><br>
</p>
<p>This gives the error:</p>
<p>[WARNING] sofia_presence.c:221 Not sending to local box for <a
href="#NOP" moz-do-not-send="true">XXXX@10.11.12.13</a><br>
[ERR] sofia_presence.c:272 Chat proto [sip]<br>
from [<sip:YYYY@<span>10.11.12.13</span>>;tag=uUQudJKEl1SKjq8wdjqwi68768]<br>
to [XXXX@<span>10.11.12.13</span>]<br>
Some message text<br>
Nobody to send to: Profile internal</p>
<p><br>
</p>
<p>But the message actually arrives successfully. This is fine
but I would prefer not to have lots of error messages. So I
tried to find a more correct way to do this. I tried the
following (based on what I could find in freeswitch 1.6.20
source code):</p>
<p>local event = freeswitch.Event("SWITCH_EVENT_SEND_MESSAGE");<br>
event:addHeader("user", recipient );<br>
event:addHeader("host", domain );<br>
event:addHeader("profile", domain );<br>
event:addHeader("subject", "SIMPLE MESSAGE");<br>
event:addHeader("content-type", "text/plain");<br>
event:addHeader("from", source);<br>
event:addBody( body );<br>
event:fire();</p>
<p>But this gives the same error. </p>
<p>How can I send a simple SIP Message with LUA to a locally
registered user?</p>
<p>Many thanks,</p>
<p>Aaron</p>
<!--'"--><br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
<a class="moz-txt-link-abbreviated" href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a>
<a class="moz-txt-link-freetext" href="http://www.freeswitchsolutions.com">http://www.freeswitchsolutions.com</a>
Official FreeSWITCH Sites
<a class="moz-txt-link-freetext" href="http://www.freeswitch.org">http://www.freeswitch.org</a>
<a class="moz-txt-link-freetext" href="http://confluence.freeswitch.org">http://confluence.freeswitch.org</a>
<a class="moz-txt-link-freetext" href="http://www.cluecon.com">http://www.cluecon.com</a>
FreeSWITCH-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a>
<a class="moz-txt-link-freetext" href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a>
UNSUBSCRIBE:<a class="moz-txt-link-freetext" href="http://lists.freeswitch.org/mailman/options/freeswitch-users">http://lists.freeswitch.org/mailman/options/freeswitch-users</a>
<a class="moz-txt-link-freetext" href="http://www.freeswitch.org">http://www.freeswitch.org</a></pre>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
Saludos / Regards / Cumprimentos
Anónio Silva</pre>
</body>
</html>