<div dir="ltr"><div>HI Ryan,</div><div>thanks a lot !</div><div>it works like a charm.</div><div><br></div><div><a class="gmail_plusreply" id="plusReplyChip-3">++</a><br></div></div><br><div class="gmail_quote"><div dir="ltr">Le mar. 20 nov. 2018 à 15:40, Ryan Harris <ryharris@airmail.cc> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 11/16/18 3:29 AM, Mickael Hubert wrote:<br>
> Hi all,<br>
> currently, I use asterisk uniqueid to lot of internals processes Ex:<br>
> 001-1542296620.1319230<br>
> I want to change asterisk by FS, but I have to keep this uniqueid format.<br>
> I know the format of the uniqueid : [server id]-[timestamp].[random<br>
> integer]<br>
><br>
> How can I generate it from FS please ?<br>
<br>
Touch and edit /usr/share/freeswitch/scripts/uniqueid.lua<br>
<br>
Write this to the file:<br>
<br>
local server_id = argv[1] or '001' -- defaults system id to '001' if you<br>
don't pass an arg<br>
stream:write(server_id .. '-' .. os.time() .. '.' ..<br>
math.random(1000000,9999999))<br>
<br>
Then use this in your XML dialplan:<br>
<br>
<action application="set" data="server_id=003"/><br>
<br>
<action application="set" data="UNIQUEID=${lua(uniqueid.lua<br>
${server_id})}"/><br>
<br>
Now you have a UNIQUEID channel variable in the format you requested.<br>
<br>
<br>
_________________________________________________________________________<br>
Professional FreeSWITCH Services<br>
<a href="mailto:sales@freeswitch.com" target="_blank">sales@freeswitch.com</a><br>
<a href="https://freeswitch.com" rel="noreferrer" target="_blank">https://freeswitch.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="https://freeswitch.com/oss" rel="noreferrer" target="_blank">https://freeswitch.com/oss</a><br>
<a href="https://freeswitch.org/confluence" rel="noreferrer" target="_blank">https://freeswitch.org/confluence</a><br>
<a href="https://cluecon.com" rel="noreferrer" target="_blank">https://cluecon.com</a><br>
<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" rel="noreferrer" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" rel="noreferrer" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="https://freeswitch.com" rel="noreferrer" target="_blank">https://freeswitch.com</a></blockquote></div>