[sr-dev] [kamailio/kamailio] pv: log uninit $var() (PR #3114)

Stefan Mititelu notifications at github.com
Tue May 17 14:28:26 CEST 2022


Consider this scenario:
1'st part:
```
if (is_present_hf("SOME_HEADER")) {
    $var(data) = _get_data_from_some_header_;
}
```

2'nd part, later:
```
if ($var(data) != "") {
    _do_something_with_data_
}
```

2'nd part gets called even for SIP that does not have  SOME_HEADER header, with value set in previous SIP that had SOME_HEADER.

I wanted to log a warning for this, so if SIP with no SOME_HEADER header comes in first, in one routing process, I will see the warning log and know to set ```$var(data)="";``` before the 1'st part.

Thank you,
Stefan

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/3114#issuecomment-1128807385
You are receiving this because you are subscribed to this thread.

Message ID: <kamailio/kamailio/pull/3114/c1128807385 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-dev/attachments/20220517/eed962a3/attachment.htm>


More information about the sr-dev mailing list