<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>Hello,</p>
<p>changes to sip message headers and body are not visible
immediately, see:</p>
<p> * <a
href="https://www.kamailio.org/wiki/tutorials/faq/main#why_changes_made_to_headers_or">https://www.kamailio.org/wiki/tutorials/faq/main#why_changes_made_to_headers_or</a></p>
<p>Use something like $var(x) to see if set is working.</p>
<p>Cheers,<br>
Daniel<br>
</p>
<div class="moz-cite-prefix">On 31.03.19 08:44, Andrew White wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CCBF96F0-8643-4432-AF41-337A3E6E0FF7@uconnected.com.au">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
Hey Daniel,
<div class=""><br class="">
</div>
<div class="">Thanks for the patch!</div>
<div class=""><br class="">
</div>
<div class="">It doesn’t appear to be throwing the error any
longer. However as far as I can see, the value is not being set.
Here’s the code, called from ksr_request_route()</div>
<div class=""><br class="">
</div>
<div class="">
<div style="background-color: rgb(30, 30, 30); line-height:
18px;" class="">
<div style="color: rgb(212, 212, 212); font-family: Menlo, Monaco, "Courier New", monospace; white-space: pre;" class=""><span style="color: #c586c0;" class="">def</span> <span style="color: #dcdcaa;" class="">ksr_route_to_trunk</span>()</div>
<div style="color: rgb(212, 212, 212); font-family: Menlo, Monaco, "Courier New", monospace; white-space: pre;" class=""> <span style="color: #4ec9b0;" class="">KSR</span>.info(<span style="color: #ce9178;" class="">"Route to trunk"</span>)</div>
<div style="color: rgb(212, 212, 212); font-family: Menlo, Monaco, "Courier New", monospace; white-space: pre;" class=""> <span style="color: #c586c0;" class="">if</span> <span style="color: #4ec9b0;" class="">KSR</span>::<span style="color: #4ec9b0;" class="">TM</span>.t_is_set(<span style="color: #ce9178;" class="">"failure_route"</span>) < <span style="color: #b5cea8;" class="">0</span> <span style="color: #c586c0;" class="">then</span></div>
<div style="color: rgb(212, 212, 212); font-family: Menlo, Monaco, "Courier New", monospace; white-space: pre;" class=""> <span style="color: #4ec9b0;" class="">KSR</span>::<span style="color: #4ec9b0;" class="">TM</span>.t_on_failure(<span style="color: #ce9178;" class="">"ksr_failure_manage_trunk"</span>)</div>
<div style="color: rgb(212, 212, 212); font-family: Menlo, Monaco, "Courier New", monospace; white-space: pre;" class=""> <span style="color: #c586c0;" class="">end</span></div>
<br class="">
<div style="color: rgb(212, 212, 212); font-family: Menlo, Monaco, "Courier New", monospace; white-space: pre;" class=""> <span style="color: #6a9955;" class=""># Relay</span></div>
<div style="color: rgb(212, 212, 212); font-family: Menlo, Monaco, "Courier New", monospace; white-space: pre;" class=""> trunk = <span style="color: #9cdcfe;" class="">$redis_local</span>.get(<span style="color: #ce9178;" class="">"trunk"</span>) <span style="color: #6a9955;" class=""># Will probably eventually be a HSET</span></div>
<div style="color: rgb(212, 212, 212); font-family: Menlo, Monaco, "Courier New", monospace; white-space: pre;" class=""><div style="line-height: 18px;" class=""> uacs = get_all_uacs() </div></div>
<div style="color: rgb(212, 212, 212); font-family: Menlo, Monaco, "Courier New", monospace; white-space: pre;" class=""> <span style="color: #4ec9b0;" class="">KSR</span>.info(<span style="color: #ce9178;" class="">"$fu is </span><span style="color: #569cd6;" class="">#{</span><span style="color: #4ec9b0;" class="">KSR</span>::<span style="color: #4ec9b0;" class="">PV</span>.gete(<span style="color: #ce9178;" class="">"$fu"</span>)<span style="color: #569cd6;" class="">}</span><span style="color: #ce9178;" class="">"</span>)</div>
<div class="">
<div style="line-height: 18px;" class="">
<div style="color: rgb(212, 212, 212); font-family: Menlo, Monaco, "Courier New", monospace; white-space: pre;" class=""><span style="color: #4ec9b0;" class=""> KSR</span>.info(<span style="color: #ce9178;" class="">"Updating to </span><span style="color: #569cd6;" class="">#{</span><span style="color: #ce9178;" class="">"sip:</span><span style="color: #569cd6;" class="">#{</span>uacs[trunk][<span style="color: #ce9178;" class="">'r_username'</span>]<span style="color: #569cd6;" class="">}</span><span style="color: #ce9178;" class="">@</span><span style="color: #569cd6;" class="">#{</span>uacs[trunk][<span style="color: #ce9178;" class="">'r_domain'</span>]<span style="color: #569cd6;" class="">}</span><span style="color: #ce9178;" class="">"</span><span style="color: #569cd6;" class="">}</span><span style="color: #ce9178;" class="">"</span>)</div>
<div class=""><span style="color: rgb(78, 201, 176); font-family: Menlo, Monaco, "Courier New", monospace; white-space: pre;" class=""> KSR</span><font
class="" face="Menlo, Monaco, Courier New, monospace"
color="#d4d4d4"><span style="white-space: pre;" class="">::</span></font><span style="color: rgb(78, 201, 176); font-family: Menlo, Monaco, "Courier New", monospace; white-space: pre;" class="">PV</span><font
class="" face="Menlo, Monaco, Courier New, monospace"
color="#d4d4d4"><span style="white-space: pre;" class="">.sets(</span></font><span style="color: rgb(206, 145, 120); font-family: Menlo, Monaco, "Courier New", monospace; white-space: pre;" class="">"$fu"</span><font
class="" face="Menlo, Monaco, Courier New, monospace"
color="#d4d4d4"><span style="white-space: pre;" class="">, </span></font><span style="color: rgb(206, 145, 120); font-family: Menlo, Monaco, "Courier New", monospace; white-space: pre;" class="">"sip:</span><span style="color: rgb(86, 156, 214); font-family: Menlo, Monaco, "Courier New", monospace; white-space: pre;" class="">#{</span><font
class="" face="Menlo, Monaco, Courier New, monospace"
color="#d4d4d4"><span style="white-space: pre;" class="">uacs[trunk][</span></font><span style="color: rgb(206, 145, 120); font-family: Menlo, Monaco, "Courier New", monospace; white-space: pre;" class="">'r_username'</span><font
class="" face="Menlo, Monaco, Courier New, monospace"
color="#d4d4d4"><span style="white-space: pre;" class="">]</span></font><span style="color: rgb(86, 156, 214); font-family: Menlo, Monaco, "Courier New", monospace; white-space: pre;" class="">}</span><span style="color: rgb(206, 145, 120); font-family: Menlo, Monaco, "Courier New", monospace; white-space: pre;" class="">@</span><span style="color: rgb(86, 156, 214); font-family: Menlo, Monaco, "Courier New", monospace; white-space: pre;" class="">#{</span><font
class="" face="Menlo, Monaco, Courier New, monospace"
color="#d4d4d4"><span style="white-space: pre;" class="">uacs[trunk][</span></font><span style="color: rgb(206, 145, 120); font-family: Menlo, Monaco, "Courier New", monospace; white-space: pre;" class="">'r_domain'</span><font
class="" face="Menlo, Monaco, Courier New, monospace"
color="#d4d4d4"><span style="white-space: pre;" class="">]</span></font><span style="color: rgb(86, 156, 214); font-family: Menlo, Monaco, "Courier New", monospace; white-space: pre;" class="">}</span><font
class="" face="Menlo, Monaco, Courier New, monospace"
color="#ce9178"><span style="caret-color: rgb(206, 145, 120); white-space: pre;" class="">”</span></font><font
class="" face="Menlo, Monaco, Courier New, monospace"
color="#d4d4d4"><span style="white-space: pre;" class="">) </span></font></div>
</div>
</div>
<div class=""><span style="color: rgb(78, 201, 176); font-family: Menlo, Monaco, "Courier New", monospace; white-space: pre;" class=""> KSR</span><font
class="" face="Menlo, Monaco, Courier New, monospace"
color="#d4d4d4"><span style="white-space: pre;" class="">.info(</span></font><span style="color: rgb(206, 145, 120); font-family: Menlo, Monaco, "Courier New", monospace; white-space: pre;" class="">"$fu rewritten to </span><span style="color: rgb(86, 156, 214); font-family: Menlo, Monaco, "Courier New", monospace; white-space: pre;" class="">#{</span><span style="color: rgb(78, 201, 176); font-family: Menlo, Monaco, "Courier New", monospace; white-space: pre;" class="">KSR</span><font
class="" face="Menlo, Monaco, Courier New, monospace"
color="#d4d4d4"><span style="white-space: pre;" class="">::</span></font><span style="color: rgb(78, 201, 176); font-family: Menlo, Monaco, "Courier New", monospace; white-space: pre;" class="">PV</span><font
class="" face="Menlo, Monaco, Courier New, monospace"
color="#d4d4d4"><span style="white-space: pre;" class="">.gete(</span></font><span style="color: rgb(206, 145, 120); font-family: Menlo, Monaco, "Courier New", monospace; white-space: pre;" class="">"$fu"</span><font
class="" face="Menlo, Monaco, Courier New, monospace"
color="#d4d4d4"><span style="white-space: pre;" class="">)</span></font><span style="color: rgb(86, 156, 214); font-family: Menlo, Monaco, "Courier New", monospace; white-space: pre;" class="">}</span><font
class="" face="Menlo, Monaco, Courier New, monospace"
color="#ce9178"><span style="caret-color: rgb(206, 145, 120); white-space: pre;" class="">”</span></font><font
class="" face="Menlo, Monaco, Courier New, monospace"
color="#d4d4d4"><span style="white-space: pre;" class="">)</span></font></div>
<div style="color: rgb(212, 212, 212); font-family: Menlo, Monaco, "Courier New", monospace; white-space: pre;" class=""> replace_server_and_uac_header()</div>
<div style="color: rgb(212, 212, 212); font-family: Menlo, Monaco, "Courier New", monospace; white-space: pre;" class=""> <span style="color: #4ec9b0;" class="">KSR</span>::<span style="color: #4ec9b0;" class="">TM</span>.t_relay()</div>
<div style="color: rgb(212, 212, 212); font-family: Menlo, Monaco, "Courier New", monospace; white-space: pre;" class=""> <span style="color: #dcdcaa;" class="">exit</span></div>
<div style="color: rgb(212, 212, 212); font-family: Menlo, Monaco, "Courier New", monospace; white-space: pre;" class=""><span style="color: #c586c0;" class="">end</span></div>
</div>
<div class="">
<div dir="auto" style="text-align: start; text-indent: 0px;
word-wrap: break-word; -webkit-nbsp-mode: space; line-break:
after-white-space;" class="">
<div dir="auto" style="word-wrap: break-word;
-webkit-nbsp-mode: space; line-break: after-white-space;"
class="">
<div style="caret-color: rgb(0, 0, 0); color: rgb(0, 0,
0); letter-spacing: normal; text-transform: none;
white-space: normal; word-spacing: 0px; text-decoration:
none; -webkit-text-stroke-width: 0px; font-family:
Helvetica; font-size: 12px; font-style: normal;
font-variant-caps: normal; font-weight: normal;
text-align: start; text-indent: 0px;"><br class="">
The output I get:</div>
<div style="caret-color: rgb(0, 0, 0); color: rgb(0, 0,
0); letter-spacing: normal; text-transform: none;
white-space: normal; word-spacing: 0px; text-decoration:
none; -webkit-text-stroke-width: 0px; font-family:
Helvetica; font-size: 12px; font-style: normal;
font-variant-caps: normal; font-weight: normal;
text-align: start; text-indent: 0px;"><br class="">
</div>
<div style="text-align: start; text-indent: 0px;">
<div>Mar 31 06:39:25 ip-10-0-0-2
/usr/local/sbin/kamailio[2361]: INFO: {1 102 INVITE
73bda23e5306c6fd4b31a0b615b47c0e} <core>
[core/kemi.c:98]: sr_kemi_core_info(): Route to trunk</div>
<div>Mar 31 06:39:25
ip-10-0-0-2 /usr/local/sbin/kamailio[2361]: INFO: {1
102 INVITE 73bda23e5306c6fd4b31a0b615b47c0e}
<core> [core/kemi.c:98]: sr_kemi_core_info():
$fu is <a href="sip:0390001234@127.0.0.1" class=""
moz-do-not-send="true">sip:0390001234@127.0.0.1</a></div>
<div>Mar 31 06:39:25
ip-10-0-0-2 /usr/local/sbin/kamailio[2361]: INFO: {1
102 INVITE 73bda23e5306c6fd4b31a0b615b47c0e}
<core> [core/kemi.c:98]: sr_kemi_core_info():
Updating to <a
href="sip:123456@sbc-syd-01.carrier.com" class=""
moz-do-not-send="true">sip:123456@sbc-syd-01.carrier.com</a></div>
<div>Mar 31 06:39:25
ip-10-0-0-2 /usr/local/sbin/kamailio[2361]: INFO: {1
102 INVITE 73bda23e5306c6fd4b31a0b615b47c0e}
<core> [core/kemi.c:98]: sr_kemi_core_info():
$fu rewritten to sip: <a
href="mailto:0390001234@127.0.0.1" class=""
moz-do-not-send="true">0390001234@127.0.0.1</a></div>
<div style="text-align: start; text-indent: 0px;"><br
class="">
</div>
<div style="text-align: start; text-indent: 0px;">So it
seems like KSR::PV.sets() is being called without
issue, however when I KSR::PV.gete() for $fu it still
holds the old value.</div>
<br class="">
________________________________<br class="">
<br class="">
Andrew White - Director<br class="">
uConnected<br class="">
<a href="mailto:andrew@uconnected.com.au" class=""
moz-do-not-send="true">Email: andrew@uconnected.com.au</a><br
class="">
Web: <a class="moz-txt-link-abbreviated" href="http://www.uConnected.com.au">www.uConnected.com.au</a><br class="">
</div>
</div>
</div>
</div>
<div><br class="">
<blockquote type="cite" class="">
<div class="">On 31 Mar 2019, at 12:25 am, Daniel-Constantin
Mierla <<a href="mailto:miconda@gmail.com" class=""
moz-do-not-send="true">miconda@gmail.com</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<meta http-equiv="Content-Type" content="text/html;
charset=UTF-8" class="">
<div text="#000000" bgcolor="#FFFFFF" class="">
<p class="">Hello,</p>
<p class="">can you try with master branch or with the
patch from next commit?</p>
<p class=""> * <a
href="https://github.com/kamailio/kamailio/commit/6d43eacd6d5b78fe857267e70b7fa85519a7d5b6"
class="" moz-do-not-send="true">https://github.com/kamailio/kamailio/commit/6d43eacd6d5b78fe857267e70b7fa85519a7d5b6</a></p>
<p class="">While looking at how is exported, I noticed
that some param type checks were wrong. Let's see if
that's fixing it or is something else.</p>
<p class="">Cheers,<br class="">
Daniel<br class="">
</p>
<div class="moz-cite-prefix">On 30.03.19 05:45, Andrew
White wrote:<br class="">
</div>
<blockquote type="cite"
cite="mid:C9F066F9-FD22-4E89-9E81-DFB53E533EE0@uconnected.com.au"
class="">
<meta http-equiv="Content-Type" content="text/html;
charset=UTF-8" class="">
Hi all,
<div class=""><br class="">
</div>
<div class="">I’m trying to set a pseudovariable via
app_ruby. I’m able to retrieve pseudovariables using
PV.gete as such:</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class="">However trying to set these using sets,
I get “No method found”:</div>
<div class=""><br class="">
</div>
<div class="">
<div style="color: rgb(212, 212, 212); background-color: rgb(30, 30, 30); font-family: Menlo, Monaco, "Courier New", monospace; line-height: 18px; white-space: pre;" class=""><span style="color: #4ec9b0;" class="">KSR</span>::<span style="color: #4ec9b0;" class="">PV</span>.sets(<span style="color: #ce9178;" class="">"$fu"</span>, <span style="color: #ce9178;" class="">"sip:</span><span style="color: #569cd6;" class="">#{</span><span style="color: #9cdcfe;" class="">$uacs</span>[trunk][<span style="color: #ce9178;" class="">'r_username'</span>]<span style="color: #569cd6;" class="">}</span><span style="color: #ce9178;" class="">@</span><span style="color: #569cd6;" class="">#{</span><span style="color: #9cdcfe;" class="">$uacs</span>[trunk][<span style="color: #ce9178;" class="">'r_domain'</span>]<span style="color: #569cd6;" class="">}</span><span style="color: #ce9178;" class="">"</span>)</div>
<div class="">
<div dir="auto" style="text-align: start;
text-indent: 0px; word-wrap: break-word;
-webkit-nbsp-mode: space; line-break:
after-white-space;" class="">
<div dir="auto" style="word-wrap: break-word;
-webkit-nbsp-mode: space; line-break:
after-white-space;" class="">
<div style="text-align: start; text-indent:
0px;" class=""><br class="">
Mar 30 04:44:59 ip-10-0-0-2
/usr/local/sbin/kamailio[28421]: ERROR: {1
102 INVITE <a
href="mailto:0fae8097312bec2b5ec79ada30c227e7@127.0.0.1"
class="" moz-do-not-send="true">0fae8097312bec2b5ec79ada30c227e7@127.0.0.1</a>:5060}
app_ruby [app_ruby_api.c:107]:
app_ruby_print_last_exception(): exception:
undefined method `[]' for nil:NilClass<br
class="">
<br class="">
PV.seti appears to work correctly. Am I
calling the wrong method?</div>
<div style="text-align: start; text-indent:
0px;" class=""><br class="">
</div>
<div style="text-align: start; text-indent:
0px;" class="">Thanks!<br class="">
________________________________<br class="">
<br class="">
Andrew White - Director<br class="">
uConnected<br class="">
<a href="mailto:andrew@uconnected.com.au"
class="" moz-do-not-send="true">Email: andrew@uconnected.com.au</a><br
class="">
Web: <a class="moz-txt-link-abbreviated"
href="http://www.uconnected.com.au/"
moz-do-not-send="true">www.uConnected.com.au</a><br
class="">
<br class="">
<br class="">
<br class="">
</div>
</div>
</div>
</div>
</div>
<br class="">
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
Kamailio (SER) - Users Mailing List
<a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.kamailio.org" moz-do-not-send="true">sr-users@lists.kamailio.org</a>
<a class="moz-txt-link-freetext" href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" moz-do-not-send="true">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
</blockquote>
<pre class="moz-signature" cols="72">--
Daniel-Constantin Mierla -- <a class="moz-txt-link-abbreviated" href="http://www.asipto.com/" moz-do-not-send="true">www.asipto.com</a>
<a class="moz-txt-link-abbreviated" href="http://www.twitter.com/miconda" moz-do-not-send="true">www.twitter.com/miconda</a> -- <a class="moz-txt-link-abbreviated" href="http://www.linkedin.com/in/miconda" moz-do-not-send="true">www.linkedin.com/in/miconda</a>
Kamailio World Conference - May 6-8, 2019 -- <a class="moz-txt-link-abbreviated" href="http://www.kamailioworld.com/" moz-do-not-send="true">www.kamailioworld.com</a></pre>
</div>
</div>
</blockquote>
</div>
<br class="">
</div>
</blockquote>
<pre class="moz-signature" cols="72">--
Daniel-Constantin Mierla -- <a class="moz-txt-link-abbreviated" href="http://www.asipto.com">www.asipto.com</a>
<a class="moz-txt-link-abbreviated" href="http://www.twitter.com/miconda">www.twitter.com/miconda</a> -- <a class="moz-txt-link-abbreviated" href="http://www.linkedin.com/in/miconda">www.linkedin.com/in/miconda</a>
Kamailio World Conference - May 6-8, 2019 -- <a class="moz-txt-link-abbreviated" href="http://www.kamailioworld.com">www.kamailioworld.com</a></pre>
</body>
</html>