Re: [SR-Users] null branch(count) variable
Yes, you're right, if there is just one branch (main branch), then this variable is null. Thank you, Sergiu. În lun., 15 iun. 2020 la 18:05, Ilie Soltanici a scris: > Not, I tried $branch(uri) and I can't get it either. > > lookup() function seems to be returning true back, this is related config > code: > > lookup("location"); > switch ($retcode) { > case -1: > sl_send_reply("404", "Not Found"); > exit; > case -2: > sl_send_reply("404", "Method not supported"); > exit; > case -3: > sl_send_reply("405", "Internal Error"); > exit; > }; > > xlog("Return Code|Branch Count|Branch URI: > $retcode|$branch(count)|$branch(uri)\n"); > > and in the logs I'm getting this: > Return Code|Branch Count|Branch URI: 1|| > > Regards, > > În lun., 15 iun. 2020 la 17:51, Daniel-Constantin Mierla < > mico...@gmail.com> a scris: > >> Hello, >> >> can you get any other attribute from the variable? >> >> - >> https://www.kamailio.org/wiki/cookbooks/devel/pseudovariables#branch_name_-_branch_attributes >> >> At least the uri should be set. >> >> Also, have you tested that lookup() was true? >> >> Cheers, >> Daniel >> On 15.06.20 18:39, Ilie Soltanici wrote: >> >> Hello, >> >> 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 value, can someone help me to >> understand what I'm doing wrong? >> >> lookup(); >> xlog("Branch Count: $branch(count)\n"); >> >> Kamailio Version: 5.2.7 >> >> Thanks. >> >> ___ >> Kamailio (SER) - Users Mailing >> Listsr-users@lists.kamailio.orghttps://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users >> >> -- >> Daniel-Constantin Mierla -- www.asipto.comwww.twitter.com/miconda -- >> www.linkedin.com/in/miconda >> Funding: https://www.paypal.me/dcmierla >> >> ___ Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Re: [SR-Users] null branch(count) variable
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. https://www.kamailio.org/wiki/cookbooks/5.3.x/pseudovariables#branch_name_-_branch_attributes Regards. On Mon, Jun 15, 2020 at 1:07 PM Ilie Soltanici wrote: > Not, I tried $branch(uri) and I can't get it either. > > lookup() function seems to be returning true back, this is related config > code: > > lookup("location"); > switch ($retcode) { > case -1: > sl_send_reply("404", "Not Found"); > exit; > case -2: > sl_send_reply("404", "Method not supported"); > exit; > case -3: > sl_send_reply("405", "Internal Error"); > exit; > }; > > xlog("Return Code|Branch Count|Branch URI: > $retcode|$branch(count)|$branch(uri)\n"); > > and in the logs I'm getting this: > Return Code|Branch Count|Branch URI: 1|| > > Regards, > > În lun., 15 iun. 2020 la 17:51, Daniel-Constantin Mierla < > mico...@gmail.com> a scris: > >> Hello, >> >> can you get any other attribute from the variable? >> >> - >> https://www.kamailio.org/wiki/cookbooks/devel/pseudovariables#branch_name_-_branch_attributes >> >> At least the uri should be set. >> >> Also, have you tested that lookup() was true? >> >> Cheers, >> Daniel >> On 15.06.20 18:39, Ilie Soltanici wrote: >> >> Hello, >> >> 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 value, can someone help me to >> understand what I'm doing wrong? >> >> lookup(); >> xlog("Branch Count: $branch(count)\n"); >> >> Kamailio Version: 5.2.7 >> >> Thanks. >> >> ___ >> Kamailio (SER) - Users Mailing >> Listsr-users@lists.kamailio.orghttps://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users >> >> -- >> Daniel-Constantin Mierla -- www.asipto.comwww.twitter.com/miconda -- >> www.linkedin.com/in/miconda >> Funding: https://www.paypal.me/dcmierla >> >> ___ > Kamailio (SER) - Users Mailing List > sr-users@lists.kamailio.org > https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users > ___ Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Re: [SR-Users] null branch(count) variable
Not, I tried $branch(uri) and I can't get it either. lookup() function seems to be returning true back, this is related config code: lookup("location"); switch ($retcode) { case -1: sl_send_reply("404", "Not Found"); exit; case -2: sl_send_reply("404", "Method not supported"); exit; case -3: sl_send_reply("405", "Internal Error"); exit; }; xlog("Return Code|Branch Count|Branch URI: $retcode|$branch(count)|$branch(uri)\n"); and in the logs I'm getting this: Return Code|Branch Count|Branch URI: 1|| Regards, În lun., 15 iun. 2020 la 17:51, Daniel-Constantin Mierla a scris: > Hello, > > can you get any other attribute from the variable? > > - > https://www.kamailio.org/wiki/cookbooks/devel/pseudovariables#branch_name_-_branch_attributes > > At least the uri should be set. > > Also, have you tested that lookup() was true? > > Cheers, > Daniel > On 15.06.20 18:39, Ilie Soltanici wrote: > > Hello, > > 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 value, can someone help me to > understand what I'm doing wrong? > > lookup(); > xlog("Branch Count: $branch(count)\n"); > > Kamailio Version: 5.2.7 > > Thanks. > > ___ > Kamailio (SER) - Users Mailing > Listsr-users@lists.kamailio.orghttps://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users > > -- > Daniel-Constantin Mierla -- www.asipto.comwww.twitter.com/miconda -- > www.linkedin.com/in/miconda > Funding: https://www.paypal.me/dcmierla > > ___ Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Re: [SR-Users] null branch(count) variable
Hello, can you get any other attribute from the variable? - https://www.kamailio.org/wiki/cookbooks/devel/pseudovariables#branch_name_-_branch_attributes At least the uri should be set. Also, have you tested that lookup() was true? Cheers, Daniel On 15.06.20 18:39, Ilie Soltanici wrote: > Hello, > > 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 value, can someone > help me to understand what I'm doing wrong? > > lookup(); > xlog("Branch Count: $branch(count)\n"); > > Kamailio Version: 5.2.7 > > Thanks. > > ___ > Kamailio (SER) - Users Mailing List > sr-users@lists.kamailio.org > https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users -- Daniel-Constantin Mierla -- www.asipto.com www.twitter.com/miconda -- www.linkedin.com/in/miconda Funding: https://www.paypal.me/dcmierla ___ Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
[SR-Users] null branch(count) variable
Hello, 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 value, can someone help me to understand what I'm doing wrong? lookup(); xlog("Branch Count: $branch(count)\n"); Kamailio Version: 5.2.7 Thanks. ___ Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users