summaryrefslogtreecommitdiff
path: root/channels
diff options
context:
space:
mode:
authorMatthew Jordan <mjordan@digium.com>2013-08-01 00:07:59 +0000
committerMatthew Jordan <mjordan@digium.com>2013-08-01 00:07:59 +0000
commit0a29f85f8755f3a17cb13c1f96c8266b0ba723eb (patch)
treee1ed2695474541abd82f2f92d1753691cbd12c23 /channels
parent9ea74182ef69aca7f99a578a92ce31a68042f25a (diff)
Raise Registry AMI events on registration failures
This patch makes it so that all registration attempts that fail that also permanently modify the registration state will raise an appropriate AMI event. Note that this patch was forward ported to trunk and the Stasis Core message bus by mjordan. (closes issue ASTERISK-21368) Reported by: Dmitriy Serov patches: chan_sip.c.diff uploaded by Demon (license 6479) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@395907 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_sip.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 8a68f7aa4..c0e4a62fd 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -23667,6 +23667,7 @@ static int handle_response_register(struct sip_pvt *p, int resp, const char *res
ast_log(LOG_WARNING, "Forbidden - wrong password on authentication for REGISTER for '%s' to '%s'\n", p->registry->username, p->registry->hostname);
AST_SCHED_DEL_UNREF(sched, r->timeout, registry_unref(r, "reg ptr unref from handle_response_register 403"));
r->regstate = REG_STATE_NOAUTH;
+ sip_publish_registry(r->username, r->hostname, regstate2str(r->regstate));
pvt_set_needdestroy(p, "received 403 response");
break;
case 404: /* Not found */
@@ -23675,6 +23676,7 @@ static int handle_response_register(struct sip_pvt *p, int resp, const char *res
if (r->call)
r->call = dialog_unref(r->call, "unsetting registry->call pointer-- case 404");
r->regstate = REG_STATE_REJECTED;
+ sip_publish_registry(r->username, r->hostname, regstate2str(r->regstate));
AST_SCHED_DEL_UNREF(sched, r->timeout, registry_unref(r, "reg ptr unref from handle_response_register 404"));
break;
case 407: /* Proxy auth */
@@ -23715,6 +23717,7 @@ static int handle_response_register(struct sip_pvt *p, int resp, const char *res
if (r->call)
r->call = dialog_unref(r->call, "unsetting registry->call pointer-- case 479");
r->regstate = REG_STATE_REJECTED;
+ sip_publish_registry(r->username, r->hostname, regstate2str(r->regstate));
AST_SCHED_DEL_UNREF(sched, r->timeout, registry_unref(r, "reg ptr unref from handle_response_register 479"));
break;
case 200: /* 200 OK */