<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF" fpstyle="1" ocsi="0">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">HI Daniel,
<div><br>
</div>
<div>thanks, so in the first case instead of assigning the value to the $var(x) can i delete the $var(x) so that comparison works ?</div>
<div><br>
</div>
<div>in the second case (returned value from transform) what value should i compare against to check if returned value was null ?</div>
<div><br>
<div style="font-family: Times New Roman; color: #000000; font-size: 16px">
<hr tabindex="-1">
<div id="divRpF769188" style="direction: ltr;"><font face="Tahoma" size="2" color="#000000"><b>From:</b> sr-dev [sr-dev-bounces@lists.sip-router.org] on behalf of Daniel-Constantin Mierla [miconda@gmail.com]<br>
<b>Sent:</b> Monday, January 05, 2015 3:51 AM<br>
<b>To:</b> Kamailio (SER) - Development Mailing List<br>
<b>Subject:</b> Re: [sr-dev] need help understanding $null<br>
</font><br>
</div>
<div></div>
<div>Hello,<br>
<br>
$var(...) cannot be null by design, setting it to $null makes it 0.<br>
<br>
$null is more for variables that don't exist, e.g., you don't have the $avp(x), then it is null if you compare it.<br>
<br>
Cheers,<br>
Daniel<br>
<br>
<div class="moz-cite-prefix">On 04/01/15 12:35, Luis Azedo wrote:<br>
</div>
<blockquote type="cite"><style type="text/css" id="owaParaStyle"></style>
<div style="direction:ltr; font-family:Tahoma; color:#000000; font-size:10pt">Hi Daniel,
<div><br>
</div>
<div>can you help on this ?</div>
<div><br>
</div>
<div>Thank you<br>
<div style="font-family:Times New Roman; color:#000000; font-size:16px">
<hr tabindex="-1">
<div id="divRpF307304" style="direction:ltr"><font color="#000000" face="Tahoma" size="2"><b>From:</b> sr-dev [<a class="moz-txt-link-abbreviated" href="mailto:sr-dev-bounces@lists.sip-router.org" target="_blank">sr-dev-bounces@lists.sip-router.org</a>] on
 behalf of Luis Azedo [<a class="moz-txt-link-abbreviated" href="mailto:luis@2600hz.com" target="_blank">luis@2600hz.com</a>]<br>
<b>Sent:</b> Wednesday, December 31, 2014 4:19 AM<br>
<b>To:</b> <a class="moz-txt-link-abbreviated" href="mailto:sr-dev@lists.sip-router.org" target="_blank">
sr-dev@lists.sip-router.org</a><br>
<b>Subject:</b> [sr-dev] need help understanding $null<br>
</font><br>
</div>
<div>
<div style="direction:ltr; font-family:Tahoma; color:#000000; font-size:10pt">Hi,
<div><br>
</div>
<div>if we return val.flags = PV_VAL_NULL, does the == $null comparison work ?</div>
<div><br>
</div>
<div>script example</div>
<div><br>
</div>
<div>my_function("some param","$var(result)");</div>
<div>if( $var(result<span style="font-size:10pt">) == $null {</span></div>
<div><span style="font-size:10pt">  do something</span></div>
<div><span style="font-size:10pt">}</span></div>
<div>
<div><span style="font-size:10pt">in code => dst_pv->setf(msg, &dst_pv->pvp, (int)EQ_T, &dst_val);</span></div>
</div>
<div>
<div><span style="font-size:10pt"> should the comparison work if we set </span>dst_val<span style="font-size:10pt">.flags = PV_VAL_NULL ?</span></div>
</div>
<div><span style="font-size:10pt"><br>
</span></div>
<div><br>
</div>
<div>if( $(myPvar{my.mytransform,transformParameter}) == $null) {</div>
<div>  ....</div>
<div>}</div>
<div>should this work if the transform returns <span style="font-size:10pt">val.flags = PV_VAL_NULL ?</span></div>
<div><span style="font-size:10pt"><br>
</span></div>
<div><span style="font-size:10pt"><br>
</span></div>
<div><span style="font-size:10pt">thank you</span></div>
<div><span style="font-size:10pt"><br>
</span></div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
</div>
</div>
</div>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader" target="_blank"></fieldset> <br>
<pre>_______________________________________________
sr-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:sr-dev@lists.sip-router.org" target="_blank">sr-dev@lists.sip-router.org</a>
<a class="moz-txt-link-freetext" href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev</a>
</pre>
</blockquote>
<br>
<pre class="moz-signature" cols="72">-- 
Daniel-Constantin Mierla
<a class="moz-txt-link-freetext" href="http://twitter.com/#!/miconda" target="_blank">http://twitter.com/#!/miconda</a> - <a class="moz-txt-link-freetext" href="http://www.linkedin.com/in/miconda" target="_blank">http://www.linkedin.com/in/miconda</a></pre>
</div>
</div>
</div>
</div>
</body>
</html>