[prev in list] [next in list] [prev in thread] [next in thread] 

List:       serusers
Subject:    [SR-Users] Can you use the sr.modf() method / function to call append_branch?
From:       J Lee <juleedev () gmail ! com>
Date:       2014-12-31 18:24:06
Message-ID: CALrZDSiN9QbPKP9m9JAqkc99k08hWHUy6VNwoHziVGBJc7FGew () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


I would like to know if there's a way to do parallel forking via lua code.

So specifically, I'd like to be able to do something like this:

  seturi("sip:a@example.com");
  append_branch("sip:b@example.com");
  append_branch("sip:c@example.com");
  append_branch("sip:d@example.com");

  t_relay();

except via lua, because the list of branches is dynamic. I've tried
the following:

   sr.modf("append_branch","sip:10.x.x.x")

but the error message I'm getting is:
/usr/sbin/kamailio[7437]: ERROR: app_lua [app_lua_sr.c:177]:
lua_sr_modf(): function 'append_branch' is not available

Just wondering if I "should" be able to do this.
I've been reading
http://www.kamailio.org/wiki/embeddedapi/devel/lua#srtm_package but
haven't seen any references to append_branch.

The other alternative I'm looking at is to just use lua to generate
the list of destinations and pass back a hashtable of sorts to
the cfg file. Then from there I will try to loop through the hashtable
and do the append_branch command for each entry
in the table.

If you have other suggestions, I'd appreciate it.

Thanks.

[Attachment #5 (text/html)]

<div dir="ltr"><div>I would like to know if there&#39;s a way to do parallel forking \
via lua code. <br><br></div>So specifically, I&#39;d like to be able to do something \
like this: <br><pre class="">  seturi(&quot;<a \
href="mailto:sip%3Aa@example.com">sip:a@example.com</a>&quot;);  \
append_branch(&quot;<a \
href="mailto:sip%3Ab@example.com">sip:b@example.com</a>&quot;);  \
append_branch(&quot;<a \
href="mailto:sip%3Ac@example.com">sip:c@example.com</a>&quot;);  \
append_branch(&quot;<a \
href="mailto:sip%3Ad@example.com">sip:d@example.com</a>&quot;);

  t_relay();<br><br></pre><pre class="">except via lua, because the list of branches \
is dynamic. I&#39;ve tried the following: <br><br></pre><pre class="">   \
sr.modf(&quot;append_branch&quot;,&quot;sip:10.x.x.x&quot;)<br><br></pre><pre \
class="">but the error message I&#39;m getting is: <br>/usr/sbin/kamailio[7437]: \
ERROR: app_lua [app_lua_sr.c:177]: lua_sr_modf(): function &#39;append_branch&#39; is \
not available <br><br></pre><pre class="">Just wondering if I &quot;should&quot; be \
able to do this. <br>I&#39;ve been reading <a \
href="http://www.kamailio.org/wiki/embeddedapi/devel/lua#srtm_package">http://www.kamailio.org/wiki/embeddedapi/devel/lua#srtm_package</a> \
but haven&#39;t seen any references to append_branch. <br><br>The other alternative \
I&#39;m looking at is to just use lua to generate the list of destinations and pass \
back a hashtable of sorts to<br>the cfg file. Then from there I will try to loop \
through the hashtable and do the append_branch command for each entry<br>in the \
table. <br><br></pre><pre class="">If you have other suggestions, I&#39;d appreciate \
it. <br></pre><pre class="">Thanks. </pre></div>



_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic