From: Automerge script Date: Thu, 6 Sep 2012 19:22:43 +0000 (+0000) Subject: Merged revisions 372499 via svnmerge from X-Git-Tag: 10.9.0-digiumphones-rc1~19 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dc1031cbf42ce71502040ed8e1dc6584dda7814f;p=thirdparty%2Fasterisk.git Merged revisions 372499 via svnmerge from file:///srv/subversion/repos/asterisk/branches/10 ........ r372499 | dsessions | 2012-09-06 13:54:54 -0500 (Thu, 06 Sep 2012) | 16 lines LDAP Realtime Peers Cannot Register Prior to 1.8, it was not necessary for an explicit "type" to be set for an asterisk LDAP realtime peer. Now the routine find_peer actually checks the type field during registration and fails to find the peer if it is not set. The attached patches make the realtime type equal whatever type is being searched for if the type is 0 upon return from routine build_peer. (closes issue ASTERISK-17222) Reported by: John Covert Patch by: David Vossel Tested by: Darren Sessions Review: https://reviewboard.asterisk.org/r/2095/ ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/10-digiumphones@372516 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/channels/chan_sip.c b/channels/chan_sip.c index d0e71001e6..b2f2ccfdde 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -5079,6 +5079,18 @@ static struct sip_peer *realtime_peer(const char *newpeername, struct ast_sockad goto cleanup; } + /* Previous versions of Asterisk did not require the type field to be + * set for real time peers. This statement preserves that behavior. */ + if (peer->type == 0) { + if (which_objects == FINDUSERS) { + peer->type = SIP_TYPE_USER; + } else if (which_objects == FINDPEERS) { + peer->type = SIP_TYPE_PEER; + } else { + peer->type = SIP_TYPE_PEER | SIP_TYPE_USER; + } + } + ast_debug(3, "-REALTIME- loading peer from database to memory. Name: %s. Peer objects: %d\n", peer->name, rpeerobjs); if (ast_test_flag(&global_flags[1], SIP_PAGE2_RTCACHEFRIENDS) && !devstate_only) { diff --git a/configs/res_ldap.conf.sample b/configs/res_ldap.conf.sample index 4655841ec6..9a2accb80e 100644 --- a/configs/res_ldap.conf.sample +++ b/configs/res_ldap.conf.sample @@ -13,6 +13,8 @@ ; ; In the case of LDAP the last keyword in each line above specifies ; a section in this file. +; +; LDAP schema and ldif files can be located in contrib/scripts. ; TLS support ; -----------