-
Notifications
You must be signed in to change notification settings - Fork 428
Closed
Description
I made a small patch to avoid an early exit of sipp, when the sipp receives a not well formed SIP message. On that situation, SIPP shows "No valid To: header in reply" on console and quits. With the patch the message is discarded even before the To: test on sipMsgCheck method.
I hope someone enjoy this.
$ diff -crB ../../sipp-vanilla/sipp-3.4.1/src/socket.cpp socket.cpp
*** ../../sipp-vanilla/sipp-3.4.1/src/socket.cpp 2014-03-09 16:04:57.000000000 -0300
--- socket.cpp 2015-06-22 16:09:16.853990854 -0300
***************
*** 1079,1084 ****
--- 1079,1086 ----
void process_message(struct sipp_socket *socket, char *msg, ssize_t msg_size, struct sockaddr_storage *src)
{
+ char *hdr = NULL;
+
// TRACE_MSG(" msg_size %d and pollset_index is %d \n", msg_size, pollset_index));
if(msg_size <= 0) {
return;
***************
*** 1091,1096 ****
--- 1093,1104 ----
return;
}
+ if(!hdr) hdr = strcasestr((char *) msg, "\r\nto:");
+ if(!hdr) hdr = strcasestr((char *) msg, "\r\nt:");
+ if(!hdr) {
+ WARNING("SIP nom standart");
+ return;
+ }
char *call_id = get_call_id(msg);
if (call_id[0] == '\0') {
WARNING("SIP message without Call-ID discarded");
Metadata
Metadata
Assignees
Labels
No labels