diff libfdcore/hooks.c @ 1301:50fb308e84f7

Added a new hook to allow extensions act on the error messages being returned in case of parsing error (e.g. if some mandatory AVP are expected in error messages)
author Sebastien Decugis <sdecugis@freediameter.net>
date Sun, 30 Aug 2015 01:58:21 +0800
parents 035f489b845b
children 84a3c9c4b834
line wrap: on
line diff
--- a/libfdcore/hooks.c	Sun Aug 30 01:11:55 2015 +0800
+++ b/libfdcore/hooks.c	Sun Aug 30 01:58:21 2015 +0800
@@ -382,6 +382,14 @@
 				break;
 			}
 			
+			case HOOK_MESSAGE_PARSING_ERROR2: {
+				CHECK_MALLOC_DO(fd_msg_dump_treeview(&hook_default_buf, &hook_default_len, NULL, msg, NULL, 0, 1), break);
+
+				LOG_E("Returning following message after parsing error:");
+				LOG_SPLIT(FD_LOG_ERROR, "   ", hook_default_buf, NULL);
+				break;
+			}
+			
 			case HOOK_MESSAGE_ROUTING_ERROR: {
 				CHECK_MALLOC_DO(fd_msg_dump_treeview(&hook_default_buf, &hook_default_len, NULL, msg, NULL, 0, 1), break);
 				LOG_E("Routing error: '%s' for the following message:", (char *)other);
"Welcome to our mercurial repository"