mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-22 20:56:39 +00:00
Add AMI registration events for PJSIP outbound registration attempts
This patch adds AMI events whenever an outbound registration attempt succeeds or fails from res_pjsip_outbound_registration. This brings it inline with the existing SIP channel driver and IAX channel driver. Review: https://reviewboard.asterisk.org/r/2729/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396201 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -31,6 +31,7 @@
|
|||||||
#include "asterisk/module.h"
|
#include "asterisk/module.h"
|
||||||
#include "asterisk/taskprocessor.h"
|
#include "asterisk/taskprocessor.h"
|
||||||
#include "asterisk/cli.h"
|
#include "asterisk/cli.h"
|
||||||
|
#include "asterisk/stasis_system.h"
|
||||||
|
|
||||||
/*** DOCUMENTATION
|
/*** DOCUMENTATION
|
||||||
<configInfo name="res_pjsip_outbound_registration" language="en_US">
|
<configInfo name="res_pjsip_outbound_registration" language="en_US">
|
||||||
@@ -121,6 +122,14 @@ enum sip_outbound_registration_status {
|
|||||||
SIP_REGISTRATION_STOPPED,
|
SIP_REGISTRATION_STOPPED,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static const char *sip_outbound_registration_status_str[] = {
|
||||||
|
[SIP_REGISTRATION_UNREGISTERED] = "Unregistered",
|
||||||
|
[SIP_REGISTRATION_REGISTERED] = "Registered",
|
||||||
|
[SIP_REGISTRATION_REJECTED_TEMPORARY] = "Rejected",
|
||||||
|
[SIP_REGISTRATION_REJECTED_PERMANENT] = "Rejected",
|
||||||
|
[SIP_REGISTRATION_STOPPED] = "Stopped",
|
||||||
|
};
|
||||||
|
|
||||||
/*! \brief Outbound registration client state information (persists for lifetime of regc) */
|
/*! \brief Outbound registration client state information (persists for lifetime of regc) */
|
||||||
struct sip_outbound_registration_client_state {
|
struct sip_outbound_registration_client_state {
|
||||||
/*! \brief Current status of this registration */
|
/*! \brief Current status of this registration */
|
||||||
@@ -386,6 +395,8 @@ static int handle_registration_response(void *data)
|
|||||||
response->code, server_uri, client_uri);
|
response->code, server_uri, client_uri);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ast_system_publish_registry("PJSIP", client_uri, server_uri, sip_outbound_registration_status_str[response->client_state->status], NULL);
|
||||||
|
|
||||||
/* If deferred destruction is in use see if we need to destroy now */
|
/* If deferred destruction is in use see if we need to destroy now */
|
||||||
if (response->client_state->destroy) {
|
if (response->client_state->destroy) {
|
||||||
handle_client_state_destruction(response->client_state);
|
handle_client_state_destruction(response->client_state);
|
||||||
|
Reference in New Issue
Block a user