summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlfred E. Heggestad <aeh@db.org>2015-11-22 17:17:19 +0100
committerAlfred E. Heggestad <aeh@db.org>2015-11-22 17:17:19 +0100
commit93356a9d4721c73fdf9935eea0c2c6c9aced25a3 (patch)
treead7693112e5cd2d31fefa5d70186a91d01143e0c
parentd4aa343472e0ea59e74907afa04a0afb07482d93 (diff)
added UA_EVENT_EXIT
-rw-r--r--include/baresip.h4
-rw-r--r--src/ua.c8
2 files changed, 7 insertions, 5 deletions
diff --git a/include/baresip.h b/include/baresip.h
index 76da052..32a4ee8 100644
--- a/include/baresip.h
+++ b/include/baresip.h
@@ -481,6 +481,9 @@ enum ua_event {
UA_EVENT_REGISTER_OK,
UA_EVENT_REGISTER_FAIL,
UA_EVENT_UNREGISTERING,
+ UA_EVENT_SHUTDOWN,
+ UA_EVENT_EXIT,
+
UA_EVENT_CALL_INCOMING,
UA_EVENT_CALL_RINGING,
UA_EVENT_CALL_PROGRESS,
@@ -489,7 +492,6 @@ enum ua_event {
UA_EVENT_CALL_TRANSFER_FAILED,
UA_EVENT_CALL_DTMF_START,
UA_EVENT_CALL_DTMF_END,
- UA_EVENT_SHUTDOWN,
UA_EVENT_MAX,
};
diff --git a/src/ua.c b/src/ua.c
index 01dd48e..cd49c62 100644
--- a/src/ua.c
+++ b/src/ua.c
@@ -92,6 +92,8 @@ static void exit_handler(void *arg)
{
(void)arg;
+ ua_event(NULL, UA_EVENT_EXIT, NULL, NULL);
+
debug("ua: sip-stack exit\n");
module_app_unload();
@@ -119,9 +121,6 @@ void ua_event(struct ua *ua, enum ua_event ev, struct call *call,
char buf[256];
va_list ap;
- if (!ua)
- return;
-
va_start(ap, fmt);
(void)re_vsnprintf(buf, sizeof(buf), fmt, ap);
va_end(ap);
@@ -1622,6 +1621,8 @@ const char *uag_event_str(enum ua_event ev)
case UA_EVENT_REGISTER_OK: return "REGISTER_OK";
case UA_EVENT_REGISTER_FAIL: return "REGISTER_FAIL";
case UA_EVENT_UNREGISTERING: return "UNREGISTERING";
+ case UA_EVENT_SHUTDOWN: return "SHUTDOWN";
+ case UA_EVENT_EXIT: return "EXIT";
case UA_EVENT_CALL_INCOMING: return "CALL_INCOMING";
case UA_EVENT_CALL_RINGING: return "CALL_RINGING";
case UA_EVENT_CALL_PROGRESS: return "CALL_PROGRESS";
@@ -1630,7 +1631,6 @@ const char *uag_event_str(enum ua_event ev)
case UA_EVENT_CALL_TRANSFER_FAILED: return "TRANSFER_FAILED";
case UA_EVENT_CALL_DTMF_START: return "CALL_DTMF_START";
case UA_EVENT_CALL_DTMF_END: return "CALL_DTMF_END";
- case UA_EVENT_SHUTDOWN: return "SHUTDOWN";
default: return "?";
}
}