mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-18 07:48:14 +00:00
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 patch makes 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/trunk@372290 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -5263,6 +5263,18 @@ static struct sip_peer *realtime_peer(const char *newpeername, struct ast_sockad
|
|||||||
goto cleanup;
|
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);
|
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) {
|
if (ast_test_flag(&global_flags[1], SIP_PAGE2_RTCACHEFRIENDS) && !devstate_only) {
|
||||||
|
|||||||
@@ -13,6 +13,8 @@
|
|||||||
;
|
;
|
||||||
; In the case of LDAP the last keyword in each line above specifies
|
; In the case of LDAP the last keyword in each line above specifies
|
||||||
; a section in this file.
|
; a section in this file.
|
||||||
|
;
|
||||||
|
; LDAP schema and ldif files can be located in contrib/scripts.
|
||||||
|
|
||||||
; TLS support
|
; TLS support
|
||||||
; -----------
|
; -----------
|
||||||
|
|||||||
Reference in New Issue
Block a user