Greetings,
I'm doing VoiceMail detection using $sipt(redirection_number) from SIPT module and i've been having some false positives on the detection.
I inspected further and noticed that in some cases $sipt(redirection_number) returns old values from previous messages, which makes me think that it's value is not being correctly refreshed. I'm using this variable on a on_reply_route.
As far as i know, $sipt(redirection_number) is read only and can't be refreshed by me in the code.
Here is an example :
Aug 7 16:51:49 dev_sbc_a_vts01 /usr/local/kamailio-5.2/sbin/kamailio[4746]: ERROR: <script>: VMD2 : Reply Code : 180 ; Sipt Redir = 9610050000 and Call ID = 00158FED-98B7-E911-8B3B-4DA50AE2ED72 at 192.168.24.86 and Cseq = 83
Here is the JSON from the 180 message : https://pastebin.com/zFHKxyav
As you can see, there isn't any 9610050000 in the message. What can be causing this issue ?
Best Regards,
Duarte Rocha
I see that in the file sipt/sipt.c, function sipt_get_redirection_number we have this array where redirection number will be written :
static char sb_s_buf[26];
Is there a reason for this to be static and therefore keep its value between function calls ?
I've removed the static and the problem seems to disappear, but i'm worried that there might be consequences for the change, since i'm not too familiar with the code.
That has to stay static, otherwise can end up in strange values, being on stack. I pushed a commit to reset the content of the buffer when using the function, no matter there is or not a value to retrieve. Can you test with master or with the patch to see if all ok? If yes, it will be backported.
Hello Daniel.
Yes, I removed the static and got some garbage values when there wasn't any info.
I tested your commit and it seems to be working correctly. I'll apply to production tomorrow and check with live traffic.
Thank you for the help
Thanks for testing and reporting back.
Closed #2030.