Open GoogleCodeExporter opened 9 years ago
I still don't know how to reliably produce this error, happens once a week at
most, but if anyone else experienced something similar - my 'solution' was
creating a watchdog which restarts the software when the UDP-socket seems dead.
More specifically,
I modified tinySIP and added a cronjob which polls the socket with something
like
echo "test" | nc <IP> <port>
and then if webrtc2sip is actually not frozen the new tinySIP will create a
file, which cronjob then checks to see whether or not webrtc2sip is frozen.
Not a good solution though, and not recommended if UDP port is exposed to
public internet, i guess... Anyways, the code change was just in
tsip_parser_message.c
tsk_bool_t tsip_message_parse(tsk_ragel_state_t *state, tsip_message_t
**result, tsk_bool_t extract_content)
{
if(!state || state->pe <= state->p){
return tsk_false;
}
if(!*result){
*result = tsip_message_create();
}
/* Ragel init */
tsip_message_parser_init(state);
/*
* State mechine execution.
*/
tsip_message_parser_execute(state, *result, extract_content);
/* Check result */
if( state->cs <
/* #line 223 "./src/parsers/tsip_parser_message.c" */
37
/* #line 214 "./ragel/tsip_parser_message.rl" */
)
{
//IF result contains WX3
//touch file /var/run/webrtc2sipisalive
FILE *pFile = fopen("/var/run/webrtc2sipisalive", "ab+");
if (pFile!=NULL)
{
//fputs ("fopen example",pFile);
fclose (pFile);
}
//
//ELSE:
//TSK_DEBUG_ERROR("Failed to parse SIP message: %s", state->p);
TSK_OBJECT_SAFE_FREE(*result);
return tsk_false;
}
return tsk_true;
}
Original comment by StefanEn...@gmail.com
on 15 Sep 2014 at 7:44
Original issue reported on code.google.com by
StefanEn...@gmail.com
on 20 Aug 2014 at 2:03