summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCharles Lehner <cel@celehner.com>2015-07-05 13:54:22 -0400
committerCharles Lehner <cel@celehner.com>2015-07-05 13:54:22 -0400
commit5c6821f742c2b3751fff5574bba3666826d723f1 (patch)
tree480891dc59bd45ac2fbc94453c792495e5694c95 /src
parente08bfbd690b5fe1c6566260e0ed8096bf115d571 (diff)
Add transfer failed call event
Diffstat (limited to 'src')
-rw-r--r--src/call.c4
-rw-r--r--src/ua.c23
2 files changed, 18 insertions, 9 deletions
diff --git a/src/call.c b/src/call.c
index d9a4a94..322f468 100644
--- a/src/call.c
+++ b/src/call.c
@@ -1517,6 +1517,8 @@ static void sipsub_notify_handler(struct sip *sip, const struct sip_msg *msg,
if (sc >= 300) {
warning("call: transfer failed: %u %r\n", sc, &reason);
+ call_event_handler(call, CALL_EVENT_TRANSFER_FAILED,
+ "%u %r", sc, &reason);
}
else if (sc >= 200) {
call_event_handler(call, CALL_EVENT_CLOSED, "Call transfered");
@@ -1540,6 +1542,8 @@ static void sipsub_close_handler(int err, const struct sip_msg *msg,
else if (msg && msg->scode >= 300) {
info("call: transfer failed: %u %r\n",
msg->scode, &msg->reason);
+ call_event_handler(call, CALL_EVENT_TRANSFER_FAILED,
+ "%u %r", msg->scode, &msg->reason);
}
}
diff --git a/src/ua.c b/src/ua.c
index 80aedd6..5bdb991 100644
--- a/src/ua.c
+++ b/src/ua.c
@@ -360,6 +360,10 @@ static void call_event_handler(struct call *call, enum call_event ev,
mem_deref(call2);
}
break;
+
+ case CALL_EVENT_TRANSFER_FAILED:
+ ua_event(ua, UA_EVENT_CALL_TRANSFER_FAILED, call, str);
+ break;
}
}
@@ -1420,15 +1424,16 @@ const char *uag_event_str(enum ua_event ev)
{
switch (ev) {
- case UA_EVENT_REGISTERING: return "REGISTERING";
- 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_CALL_INCOMING: return "CALL_INCOMING";
- case UA_EVENT_CALL_RINGING: return "CALL_RINGING";
- case UA_EVENT_CALL_PROGRESS: return "CALL_PROGRESS";
- case UA_EVENT_CALL_ESTABLISHED: return "CALL_ESTABLISHED";
- case UA_EVENT_CALL_CLOSED: return "CALL_CLOSED";
+ case UA_EVENT_REGISTERING: return "REGISTERING";
+ 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_CALL_INCOMING: return "CALL_INCOMING";
+ case UA_EVENT_CALL_RINGING: return "CALL_RINGING";
+ case UA_EVENT_CALL_PROGRESS: return "CALL_PROGRESS";
+ case UA_EVENT_CALL_ESTABLISHED: return "CALL_ESTABLISHED";
+ case UA_EVENT_CALL_CLOSED: return "CALL_CLOSED";
+ case UA_EVENT_CALL_TRANSFER_FAILED: return "TRANSFER_FAILED";
default: return "?";
}
}