<div dir="ltr">As per the documentation, $branch(name) provides access to "additional branches", not "main branch". If after lookup you have a single branch (AoR has a single Contact), it would explain why you get NULL.<div><br></div><div><a href="https://www.kamailio.org/wiki/cookbooks/5.3.x/pseudovariables#branch_name_-_branch_attributes">https://www.kamailio.org/wiki/cookbooks/5.3.x/pseudovariables#branch_name_-_branch_attributes</a><br></div><div><br></div><div>Regards.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jun 15, 2020 at 1:07 PM Ilie Soltanici <<a href="mailto:iliusha.md@gmail.com">iliusha.md@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Not, I tried $branch(uri) and I can't get it either. <div><br></div><div>lookup() function seems to be returning true back, this is related config code:</div><div><br></div>lookup("location");<br>switch ($retcode) {<br> case -1:<br> sl_send_reply("404", "Not Found");<br> exit;<br> case -2:<br> sl_send_reply("404", "Method not supported");<br> exit;<br> case -3:<br> sl_send_reply("405", "Internal Error");<br> exit;<br>};<br><br>xlog("Return Code|Branch Count|Branch URI: $retcode|$branch(count)|$branch(uri)\n");<br><div><br></div><div>and in the logs I'm getting this:</div><div>Return Code|Branch Count|Branch URI: 1|<null>|<null><br></div><div><br></div><div>Regards,</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">În lun., 15 iun. 2020 la 17:51, Daniel-Constantin Mierla <<a href="mailto:miconda@gmail.com" target="_blank">miconda@gmail.com</a>> a scris:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div>
<p>Hello,</p>
<p>can you get any other attribute from the variable?</p>
<p> - <a href="https://www.kamailio.org/wiki/cookbooks/devel/pseudovariables#branch_name_-_branch_attributes" target="_blank">https://www.kamailio.org/wiki/cookbooks/devel/pseudovariables#branch_name_-_branch_attributes</a></p>
<p>At least the uri should be set.</p>
<p>Also, have you tested that lookup() was true?</p>
<p>Cheers,<br>
Daniel<br>
</p>
<div>On 15.06.20 18:39, Ilie Soltanici
wrote:<br>
</div>
<blockquote type="cite">
<div dir="ltr">Hello,
<div><br>
</div>
<div>As per documentation after lookup() function I have to get
the number of branches from the main branch by
using $branch(count) variable, but for some reason, I'm
getting always only <null> value, can someone help me to
understand what I'm doing wrong?</div>
<div><br>
</div>
lookup();<br>
xlog("Branch Count: $branch(count)\n");
<div><br>
</div>
<div>Kamailio Version: 5.2.7<br>
<div><br>
</div>
<div>Thanks.</div>
</div>
</div>
<br>
<fieldset></fieldset>
<pre>_______________________________________________
Kamailio (SER) - Users Mailing List
<a href="mailto:sr-users@lists.kamailio.org" target="_blank">sr-users@lists.kamailio.org</a>
<a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
</blockquote>
<pre cols="72">--
Daniel-Constantin Mierla -- <a href="http://www.asipto.com" target="_blank">www.asipto.com</a>
<a href="http://www.twitter.com/miconda" target="_blank">www.twitter.com/miconda</a> -- <a href="http://www.linkedin.com/in/miconda" target="_blank">www.linkedin.com/in/miconda</a>
Funding: <a href="https://www.paypal.me/dcmierla" target="_blank">https://www.paypal.me/dcmierla</a></pre>
</div>
</blockquote></div>
_______________________________________________<br>
Kamailio (SER) - Users Mailing List<br>
<a href="mailto:sr-users@lists.kamailio.org" target="_blank">sr-users@lists.kamailio.org</a><br>
<a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer" target="_blank">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br>
</blockquote></div>