freeswitch icon indicating copy to clipboard operation
freeswitch copied to clipboard

if the reason text field received is too long, the field is no longer correct.

Open gilles0606 opened this issue 3 years ago • 4 comments
trafficstars

if the reason text field received is too long, the field is no longer correct. Too long Reason header swallowed #1481 A leg not being closed down when B ends call #1293

gilles0606 avatar Sep 02 '22 06:09 gilles0606

I think this needs to be fixed in libsofia, nea_server.c reason_buf is 64, and not in mod_sofia.

briankwest avatar Sep 02 '22 12:09 briankwest

i Brian,

I think this needs to be fixed in libsofia, nea_server.c reason_buf is 64, and not in mod_sofia.

I'm not sure that fixes the problem. I can test your nea_server.c patch if you let me know.

the need here is to be compatible with all freeswitches. if the header is too long, the next freeswitch will have the same problem...

gilles0606 avatar Sep 02 '22 12:09 gilles0606

i Brian,

Or else I can do the test myself. what do you recommend? replace 64 with 128? or 256? I see that some SBC sometimes can exceed 128 in the text cause.

gilles0606 avatar Sep 03 '22 11:09 gilles0606

Brian,

sorry for my not very good english. I tried with 256 in nea_server.c reason_buf but that didn't fix the problem.

we are exactly in line 501 of mod_sofia.c the complete sip header: "reason" is copied into a memory of 128. (char reason[128] = "";)

if this header is truncated, it is no longer correct when the ending quote is missing.

if we enlarge the (char reason[256] = "";) it works, but the next freeswitch that receives the call will have the same problem.

that's why I made this "pull request"

of course, you know freeswitch thousands of times better than me, that's why I'm explaining to you what I saw and understood, but maybe I'm wrong...

thank you very much for your opinion

gilles0606 avatar Sep 03 '22 13:09 gilles0606

Unit-tests failed: https://public-artifacts.signalwire.cloud/drone/signalwire/freeswitch/777/artifacts.html

signalwire-ci[bot] avatar Sep 24 '22 06:09 signalwire-ci[bot]