Skip to content
Snippets Groups Projects
Commit 41ecf225 authored by kkm's avatar kkm
Browse files

chan_sip: Make autocreated peers send PeerStatus events

Since Stasis has been introduced, an attempt to send AMI messages by an
autocreated peer caused a crash, and all events from autocreated peers were
semi-inadvertently disabled altogether in 0b83761f. This change restores the
disabled functionality.

ASTERISK-25950

Change-Id: Iecc350f23db603fadb2f302064643ebe9664e974
parent 57c908c7
Branches
Tags
No related merge requests found
...@@ -17713,6 +17713,10 @@ static enum check_auth_result register_verify(struct sip_pvt *p, struct ast_sock ...@@ -17713,6 +17713,10 @@ static enum check_auth_result register_verify(struct sip_pvt *p, struct ast_sock
if (!peer && sip_cfg.autocreatepeer != AUTOPEERS_DISABLED) { if (!peer && sip_cfg.autocreatepeer != AUTOPEERS_DISABLED) {
/* Create peer if we have autocreate mode enabled */ /* Create peer if we have autocreate mode enabled */
peer = temp_peer(name); peer = temp_peer(name);
if (peer && !(peer->endpoint = ast_endpoint_create("SIP", name))) {
ao2_t_ref(peer, -1, "failed to allocate Stasis endpoint, drop peer");
peer = NULL;
}
if (peer) { if (peer) {
ao2_t_link(peers, peer, "link peer into peer table"); ao2_t_link(peers, peer, "link peer into peer table");
if (!ast_sockaddr_isnull(&peer->addr)) { if (!ast_sockaddr_isnull(&peer->addr)) {
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment