diff --git a/mbuni/mmsc/mms_billing.c b/mbuni/mmsc/mms_billing.c index b8d23ed..78c74c9 100644 --- a/mbuni/mmsc/mms_billing.c +++ b/mbuni/mmsc/mms_billing.c @@ -33,7 +33,7 @@ static int mms_billingmodule_fini(void *module_data) return module_data ? fclose(module_data) : -1; } -static double mms_billmsg(Octstr *from, List *to, unsigned long msg_size, Octstr *vaspid, void *module_data) +static int mms_billmsg(Octstr *from, List *to, unsigned long msg_size, Octstr *vaspid, void *module_data) { return 0; } diff --git a/mbuni/mmsc/mms_billing.h b/mbuni/mmsc/mms_billing.h index 5b795b9..af13a16 100644 --- a/mbuni/mmsc/mms_billing.h +++ b/mbuni/mmsc/mms_billing.h @@ -47,7 +47,7 @@ typedef struct MmsBillingFuncStruct { /* Bills a message. Returns >= 0 if billed ok, -1 if message should be rejected, * -2 on internal (temporary) error. */ - double (*mms_billmsg)(Octstr *from, List *to, unsigned long msg_size, Octstr *vaspid, void *module_data); + int (*mms_billmsg)(Octstr *from, List *to, unsigned long msg_size, Octstr *vaspid, void *module_data); int (*mms_billingmodule_fini)(void *module_data); } MmsBillingFuncStruct; diff --git a/mbuni/mmsc/mms_billing_shell.c b/mbuni/mmsc/mms_billing_shell.c index bc43b10..8d8e05d 100644 --- a/mbuni/mmsc/mms_billing_shell.c +++ b/mbuni/mmsc/mms_billing_shell.c @@ -33,7 +33,7 @@ static int mms_billingmodule_fini(void *module_data) return 0; } -static double mms_billmsg(Octstr *from, List *to, unsigned long msg_size, Octstr *vaspid, void *module_data) +static int mms_billmsg(Octstr *from, List *to, unsigned long msg_size, Octstr *vaspid, void *module_data) { int i; @@ -43,8 +43,12 @@ static double mms_billmsg(Octstr *from, List *to, unsigned long msg_size, Octstr Octstr *s; s = octstr_format("%s '%s' '%s'", octstr_get_cstr(script), octstr_get_cstr(from), octstr_get_cstr(list_get(to, i))); if (s) { - system(octstr_get_cstr(s)); + int ret = system(octstr_get_cstr(s)); octstr_destroy(s); + if (ret < 0) + return -2; + else if (WEXITSTATUS(ret) != 0) + return -1; } } return 0;