summaryrefslogtreecommitdiff
path: root/channels
diff options
context:
space:
mode:
authorzuul <zuul@gerrit.asterisk.org>2016-04-29 12:13:57 -0500
committerGerrit Code Review <gerrit2@gerrit.digium.api>2016-04-29 12:13:57 -0500
commit72ee8c1bf9d2cd95f29ff0f79549aed1437f2815 (patch)
treefd390808a7ccdc264662f2235cee2a915c480456 /channels
parent1ce30f1fb5a28541935759953bfb3b0204d1304d (diff)
parent29bab0d1a4d6bbcdbf27fcff49b2e2262f65460e (diff)
Merge "chan_sip: Make autocreated peers send PeerStatus events" into 13
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_sip.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index cbbda4e73..7cc91486a 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -17669,6 +17669,10 @@ static enum check_auth_result register_verify(struct sip_pvt *p, struct ast_sock
if (!peer && sip_cfg.autocreatepeer != AUTOPEERS_DISABLED) {
/* Create peer if we have autocreate mode enabled */
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) {
ao2_t_link(peers, peer, "link peer into peer table");
if (!ast_sockaddr_isnull(&peer->addr)) {