Re: Question about how $rc works
Joel Serrano via sr-users <[email protected]>
| Newsgroups | gmane.comp.voip.ser |
|---|---|
| Message-ID | <CAMtXxQmbNVVm1NPgrGo8WakbgsxZmhXzA+gE48r37wJNprMjXQ@mail.gmail.com> |
Hi All, Just to add some context to my previous question: I'm trying to understand the difference between assigning the return value of a function to a variable directly vs assigning the “$rc” value to a variable after the function has run. Rereading my initial email, I hope this makes my question clearer 🤣🤣 Thanks again, Joel On Wed, Jun 11, 2025 at 16:46 Joel Serrano <[email protected]> wrote: > Hi All, > > I have a simple doubt: are these snippets the same? > > *One:* > > secf_check_country($hdr(X-SRC-IP-CC)); > $var(secf_cc_rc) = $rc; > if ($var(secf_cc_rc) == -2) { > ... > > *Two:* > > $var(secf_cc_rc) = secf_check_country($hdr(X-SRC-IP-CC)); > if ($var(secf_cc_rc) == -2) { > ... > > They both seem to work, the docs say to use option -one-. > In case they do the same, is there a reason I should pick one over the > other? Or is this purely cosmetic? > > Thanks, > Joel. > __________________________________________________________ Kamailio - Users Mailing List - Non Commercial Discussions -- [email protected] To unsubscribe send an email to [email protected] Important: keep the mailing list in the recipients, do not reply only to the sender!