From b6ec1271940d744dd99beb7b806be6a667cc1f13 Mon Sep 17 00:00:00 2001 From: Stefan Knoblich Date: Tue, 7 Feb 2012 16:44:55 +0100 Subject: [PATCH] [ftmod_misdn] Extend misdn_event_types[] and use a helper macro. Add missing mISDN event/message types (e.g. MPH_INFORMATION_IND) and use a helper macro (MISDN_EVENT_TYPE) to define the entries, like we already do for misdn_control_types[]. Signed-off-by: Stefan Knoblich --- .../src/ftmod/ftmod_misdn/ftmod_misdn.c | 33 ++++++++++++------- 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/libs/freetdm/src/ftmod/ftmod_misdn/ftmod_misdn.c b/libs/freetdm/src/ftmod/ftmod_misdn/ftmod_misdn.c index 9673549f79..e78facf287 100644 --- a/libs/freetdm/src/ftmod/ftmod_misdn/ftmod_misdn.c +++ b/libs/freetdm/src/ftmod/ftmod_misdn/ftmod_misdn.c @@ -96,18 +96,27 @@ const static struct { const int id; const char *name; } misdn_event_types[] = { - { PH_DATA_REQ, "PH_DATA_REQ" }, - { PH_DATA_IND, "PH_DATA_IND" }, - { PH_DATA_CNF, "PH_DATA_CNF" }, - { PH_CONTROL_REQ, "PH_CONTROL_REQ" }, - { PH_CONTROL_IND, "PH_CONTROL_IND" }, - { PH_CONTROL_CNF, "PH_CONTROL_CNF" }, - { PH_ACTIVATE_REQ, "PH_ACTIVATE_REQ" }, - { PH_ACTIVATE_IND, "PH_ACTIVATE_IND" }, - { PH_ACTIVATE_CNF, "PH_ACTIVATE_CNF" }, - { PH_DEACTIVATE_REQ, "PH_DEACTIVATE_REQ" }, - { PH_DEACTIVATE_IND, "PH_DEACTIVATE_IND" }, - { PH_DEACTIVATE_CNF, "PH_DEACTIVATE_CNF" }, +#define MISDN_EVENT_TYPE(x) { x, #x } + MISDN_EVENT_TYPE(PH_DATA_REQ), + MISDN_EVENT_TYPE(PH_DATA_IND), + MISDN_EVENT_TYPE(PH_DATA_CNF), + MISDN_EVENT_TYPE(PH_DATA_E_IND), + MISDN_EVENT_TYPE(PH_CONTROL_REQ), + MISDN_EVENT_TYPE(PH_CONTROL_IND), + MISDN_EVENT_TYPE(PH_CONTROL_CNF), + MISDN_EVENT_TYPE(PH_ACTIVATE_REQ), + MISDN_EVENT_TYPE(PH_ACTIVATE_IND), + MISDN_EVENT_TYPE(PH_ACTIVATE_CNF), + MISDN_EVENT_TYPE(PH_DEACTIVATE_REQ), + MISDN_EVENT_TYPE(PH_DEACTIVATE_IND), + MISDN_EVENT_TYPE(PH_DEACTIVATE_CNF), + MISDN_EVENT_TYPE(MPH_ACTIVATE_REQ), + MISDN_EVENT_TYPE(MPH_ACTIVATE_IND), + MISDN_EVENT_TYPE(MPH_DEACTIVATE_REQ), + MISDN_EVENT_TYPE(MPH_DEACTIVATE_IND), + MISDN_EVENT_TYPE(MPH_INFORMATION_REQ), + MISDN_EVENT_TYPE(MPH_INFORMATION_IND), +#undef MISDN_EVENT_TYPE }; static const char *misdn_event2str(const int event)