[Home]

Summary:ASTERISK-11551: [patch] realtime_multi_ldap and pattern matching
Reporter:Ghulam Mustafa (cyrenity)Labels:
Date Opened:2008-03-01 04:34:12.000-0600Date Closed:2008-03-05 23:23:00.000-0600
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Resources/res_config_ldap
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) res_config_ldap.patch
( 1) res_config_ldap.patch
( 2) res_config_ldap.patch-03-03-2008
Description:i am trying to use realtime ldap driver, everything seems to be fine expect pattern matching, problem is when i try to retrieve patterns ldap lookup works fine, it can fetch vars/attribs from ldap, but it returns with error extensions not found, i think there is something missing, i have tried to debug the problem, but i have no idea what's going on internaly, results returned from realtime_multi_ldap seems ok, i am copying debug log in additional information.

Regards,

****** ADDITIONAL INFORMATION ******

[Mar  1 15:36:20] DEBUG[14006]: res_config_ldap.c:718 realtime_ldap_base_ap: >>***** calling cleaned_basedn from realtime_ldap_base_ap
[Mar  1 15:36:20] DEBUG[14006]: res_config_ldap.c:624 substituted: substituted: string: 'dc=emergen,dc=biz' => 'dc=emergen,dc=biz'
[Mar  1 15:36:20] DEBUG[14006]: res_config_ldap.c:651 cleaned_basedn: basedn: 'dc=emergen,dc=biz' => 'dc=emergen,dc=biz'
[Mar  1 15:36:20] DEBUG[14006]: res_config_ldap.c:725 realtime_ldap_base_ap: we are ready go ahead now
[Mar  1 15:36:20] DEBUG[14006]: res_config_ldap.c:733 realtime_ldap_base_ap:  creating filter str......
[Mar  1 15:36:20] DEBUG[14006]: res_config_ldap.c:753 realtime_ldap_base_ap: out statement is complete now, we are now ready to establish a connection with ldap
[Mar  1 15:36:20] DEBUG[14006]: res_config_ldap.c:1483 ldap_reconnect: Everything seems fine.
[Mar  1 15:36:20] DEBUG[14006]: res_config_ldap.c:687 append_var_and_value_to_filter: name='exten' value='822'
[Mar  1 15:36:20] DEBUG[14006]: res_config_ldap.c:699 append_var_and_value_to_filter: name in after mapping: AstExtension
[Mar  1 15:36:20] DEBUG[14006]: res_config_ldap.c:687 append_var_and_value_to_filter: name='context' value='default'
[Mar  1 15:36:20] DEBUG[14006]: res_config_ldap.c:699 append_var_and_value_to_filter: name in after mapping: AstContext
[Mar  1 15:36:20] DEBUG[14006]: res_config_ldap.c:687 append_var_and_value_to_filter: name='priority' value='1'
[Mar  1 15:36:20] DEBUG[14006]: res_config_ldap.c:699 append_var_and_value_to_filter: name in after mapping: AstPriority
[Mar  1 15:36:20] WARNING[14006]: res_config_ldap.c:822 realtime_ldap_base_ap: Could not find any entry matching (&(objectClass=AsteriskExtension)(AstExtension=822)(AstContext=default)(AstPriority=1)) in base dn dc=emergen,dc=biz.
[Mar  1 15:36:20] DEBUG[14006]: res_config_ldap.c:928 realtime_ldap: >> ***************** RETURNING VAR :
[Mar  1 15:36:20] DEBUG[14006]: res_config_ldap.c:718 realtime_ldap_base_ap: >>***** calling cleaned_basedn from realtime_ldap_base_ap
[Mar  1 15:36:20] DEBUG[14006]: res_config_ldap.c:624 substituted: substituted: string: 'dc=emergen,dc=biz' => 'dc=emergen,dc=biz'
[Mar  1 15:36:20] DEBUG[14006]: res_config_ldap.c:651 cleaned_basedn: basedn: 'dc=emergen,dc=biz' => 'dc=emergen,dc=biz'
[Mar  1 15:36:20] DEBUG[14006]: res_config_ldap.c:725 realtime_ldap_base_ap: we are ready go ahead now
[Mar  1 15:36:20] DEBUG[14006]: res_config_ldap.c:733 realtime_ldap_base_ap:  creating filter str......
[Mar  1 15:36:20] DEBUG[14006]: res_config_ldap.c:753 realtime_ldap_base_ap: out statement is complete now, we are now ready to establish a connection with ldap
[Mar  1 15:36:20] DEBUG[14006]: res_config_ldap.c:1483 ldap_reconnect: Everything seems fine.
[Mar  1 15:36:20] DEBUG[14006]: res_config_ldap.c:687 append_var_and_value_to_filter: name='exten LIKE' value='\_%'
[Mar  1 15:36:20] DEBUG[14006]: res_config_ldap.c:692 append_var_and_value_to_filter: new name in if condition: exten
[Mar  1 15:36:20] DEBUG[14006]: res_config_ldap.c:699 append_var_and_value_to_filter: name in after mapping: AstExtension
[Mar  1 15:36:20] DEBUG[14006]: res_config_ldap.c:687 append_var_and_value_to_filter: name='context' value='default'
[Mar  1 15:36:20] DEBUG[14006]: res_config_ldap.c:699 append_var_and_value_to_filter: name in after mapping: AstContext
[Mar  1 15:36:20] DEBUG[14006]: res_config_ldap.c:687 append_var_and_value_to_filter: name='priority' value='1'
[Mar  1 15:36:20] DEBUG[14006]: res_config_ldap.c:699 append_var_and_value_to_filter: name in after mapping: AstPriority
[Mar  1 15:36:20] DEBUG[14006]: res_config_ldap.c:288 realtime_ldap_entry_to_var: LINE(288) attribute_name: sn LDAP value: 6885
[Mar  1 15:36:20] DEBUG[14006]: res_config_ldap.c:288 realtime_ldap_entry_to_var: LINE(288) attribute_name: priority LDAP value: 1
[Mar  1 15:36:20] DEBUG[14006]: res_config_ldap.c:288 realtime_ldap_entry_to_var: LINE(288) attribute_name: objectClass LDAP value: AsteriskExtension
[Mar  1 15:36:20] DEBUG[14006]: res_config_ldap.c:288 realtime_ldap_entry_to_var: LINE(288) attribute_name: objectClass LDAP value: person
[Mar  1 15:36:20] DEBUG[14006]: res_config_ldap.c:288 realtime_ldap_entry_to_var: LINE(288) attribute_name: objectClass LDAP value: top
[Mar  1 15:36:20] DEBUG[14006]: res_config_ldap.c:288 realtime_ldap_entry_to_var: LINE(288) attribute_name: app LDAP value: Playback
[Mar  1 15:36:20] DEBUG[14006]: res_config_ldap.c:288 realtime_ldap_entry_to_var: LINE(288) attribute_name: context LDAP value: default
[Mar  1 15:36:20] DEBUG[14006]: res_config_ldap.c:288 realtime_ldap_entry_to_var: LINE(288) attribute_name: appdata LDAP value: demo-thanks
[Mar  1 15:36:20] DEBUG[14006]: res_config_ldap.c:288 realtime_ldap_entry_to_var: LINE(288) attribute_name: cn LDAP value: _8XX-1
[Mar  1 15:36:20] DEBUG[14006]: res_config_ldap.c:288 realtime_ldap_entry_to_var: LINE(288) attribute_name: exten LDAP value: _8XX
[Mar  1 15:36:20] DEBUG[14006]: res_config_ldap.c:481 realtime_ldap_result_to_vars: LINE(481) attribute_name: sn value: 6885
[Mar  1 15:36:20] DEBUG[14006]: res_config_ldap.c:481 realtime_ldap_result_to_vars: LINE(481) attribute_name: priority value: 1
[Mar  1 15:36:20] DEBUG[14006]: res_config_ldap.c:481 realtime_ldap_result_to_vars: LINE(481) attribute_name: objectClass value: AsteriskExtension
[Mar  1 15:36:20] DEBUG[14006]: res_config_ldap.c:481 realtime_ldap_result_to_vars: LINE(481) attribute_name: objectClass value: person
[Mar  1 15:36:20] DEBUG[14006]: res_config_ldap.c:481 realtime_ldap_result_to_vars: LINE(481) attribute_name: objectClass value: top
[Mar  1 15:36:20] DEBUG[14006]: res_config_ldap.c:481 realtime_ldap_result_to_vars: LINE(481) attribute_name: app value: Playback
[Mar  1 15:36:20] DEBUG[14006]: res_config_ldap.c:481 realtime_ldap_result_to_vars: LINE(481) attribute_name: context value: default
[Mar  1 15:36:20] DEBUG[14006]: res_config_ldap.c:481 realtime_ldap_result_to_vars: LINE(481) attribute_name: appdata value: demo-thanks
[Mar  1 15:36:20] DEBUG[14006]: res_config_ldap.c:481 realtime_ldap_result_to_vars: LINE(481) attribute_name: cn value: _8XX-1
[Mar  1 15:36:20] DEBUG[14006]: res_config_ldap.c:481 realtime_ldap_result_to_vars: LINE(481) attribute_name: exten value: _8XX
[Mar  1 15:36:20] DEBUG[14006]: res_config_ldap.c:516 realtime_ldap_result_to_vars: LINE(516) Added to vars - non static
[Mar  1 15:36:20] DEBUG[14006]: res_config_ldap.c:523 realtime_ldap_result_to_vars: >> *********return vars
[Mar  1 15:36:20] DEBUG[14006]: res_config_ldap.c:944 realtime_multi_ldap: >> *******GOT multi value vars....
[Mar  1 15:36:20] DEBUG[14006]: res_config_ldap.c:955 realtime_multi_ldap:  New P
[Mar  1 15:36:20] DEBUG[14006]: res_config_ldap.c:971 realtime_multi_ldap: >> ************ ast category append ...
[Mar  1 15:36:20] DEBUG[14006]: res_config_ldap.c:978 realtime_multi_ldap: >> *******returning cfg from multi_ldap...

[Mar  1 15:36:20] DEBUG[14006]: sched.c:291 ast_sched_del: Attempted to delete nonexistent schedule entry 0!
[Mar  1 15:36:20] DEBUG[14006]: sched.c:291 ast_sched_del: Attempted to delete nonexistent schedule entry 0!
[Mar  1 15:36:20] DEBUG[14006]: sched.c:291 ast_sched_del: Attempted to delete nonexistent schedule entry 0!
[Mar  1 15:36:20] DEBUG[14006]: sched.c:291 ast_sched_del: Attempted to delete nonexistent schedule entry 0!
[Mar  1 15:36:20] DEBUG[14006]: sched.c:291 ast_sched_del: Attempted to delete nonexistent schedule entry 0!
[Mar  1 15:36:20] DEBUG[14006]: sched.c:291 ast_sched_del: Attempted to delete nonexistent schedule entry 0!
[Mar  1 15:36:20] DEBUG[14006]: sched.c:291 ast_sched_del: Attempted to delete nonexistent schedule entry 0!
[Mar  1 15:36:20] DEBUG[14006]: sched.c:291 ast_sched_del: Attempted to delete nonexistent schedule entry 0!
[Mar  1 15:36:20] DEBUG[14006]: sched.c:291 ast_sched_del: Attempted to delete nonexistent schedule entry 0!
[Mar  1 15:36:20] DEBUG[14006]: sched.c:291 ast_sched_del: Attempted to delete nonexistent schedule entry 0!
[Mar  1 15:36:20] DEBUG[14006]: sched.c:291 ast_sched_del: Attempted to delete nonexistent schedule entry 0!
[Mar  1 15:36:20] DEBUG[14006]: chan_sip.c:2510 __sip_xmit: Trying to put 'SIP/2.0 40' onto UDP socket...
[Mar  1 15:36:20] NOTICE[14006]: chan_sip.c:16314 handle_request_invite: Call from '601' to extension '822' rejected because extension not found.
[Mar  1 15:36:20] DEBUG[14006]: chan_sip.c:4353 update_call_counter: Updating call counter for incoming call
[Mar  1 15:36:20] DEBUG[14006]: chan_sip.c:5836 find_call: = Found Their Call ID: 3c29439415f9-qea80pydj66d@IP150-00300A6E5B48 Their Tag 9jxdqsjk07 Our tag: as29bd170c
[Mar  1 15:36:20] DEBUG[14006]: chan_sip.c:17783 handle_incoming: **** Received ACK (6) - Command in SIP ACK
[Mar  1 15:36:20] DEBUG[14006]: chan_sip.c:2967 __sip_ack: Stopping retransmission on '3c29439415f9-qea80pydj66d@IP150-00300A6E5B48' of Response 2: Match Found
Comments:By: Ghulam Mustafa (cyrenity) 2008-03-01 04:46:23.000-0600

please note, there were also two minor bugs in res_config_ldap.c, after little debugging i got them fixed, here is the diff.

(((code removed)))

it will fix ldap lookup problem when querying 'exten LIKE' (paterns) in append_var_and_value_to_filter function, and secondly a missing parenthesis around an if condition in realtime_ldap_base_ap function.


Regards,



By: Tilghman Lesher (tilghman) 2008-03-01 08:52:22.000-0600

Please do not place code in comments.  We have a licensing system in place, and you must pass through the licensing system in order to contribute code.

By: Ghulam Mustafa (cyrenity) 2008-03-03 04:43:14.000-0600

i don't understand "how" do i pass through the licensing system? please guide me.

By: David Woolley (davidw) 2008-03-03 08:56:35.000-0600

To resolve the licensing issue, you need to find out who owns the copyright in your work.  If you are an employee, that is unlikely to be you, and there may also be commercial contracts that affect this.

You then need to find out who has authority to grant licences under those copyrights and get them to follow the Sign License link, at the top of the page, read, understand and agree to the conditions listed on that page, and if they agree, complete the form.

(Often small changes are considered too obvious to be copyrightable, but Digium seem to want to be on the safe side.)

By: Ghulam Mustafa (cyrenity) 2008-03-05 02:33:00.000-0600

oh okay, well my license got accepted yesterday, but its still showing Status as need license.

By: Digium Subversion (svnbot) 2008-03-05 23:18:56.000-0600

Repository: asterisk
Revision: 106346

U   trunk/res/res_config_ldap.c

------------------------------------------------------------------------
r106346 | tilghman | 2008-03-05 23:18:45 -0600 (Wed, 05 Mar 2008) | 7 lines

Missing braces, fix parsing
(closes issue ASTERISK-11551)
Reported by: cyrenity
Patches:
      res_config_ldap.patch-03-03-2008 uploaded by cyrenity (license 416)
Tested by: cyrenity, Corydon76

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=106346

By: Digium Subversion (svnbot) 2008-03-05 23:22:59.000-0600

Repository: asterisk
Revision: 106359

_U  branches/1.6.0/
U   branches/1.6.0/res/res_config_ldap.c

------------------------------------------------------------------------
r106359 | tilghman | 2008-03-05 23:22:20 -0600 (Wed, 05 Mar 2008) | 15 lines

Merged revisions 106346 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

........
r106346 | tilghman | 2008-03-05 23:21:39 -0600 (Wed, 05 Mar 2008) | 7 lines

Missing braces, fix parsing
(closes issue ASTERISK-11551)
Reported by: cyrenity
Patches:
      res_config_ldap.patch-03-03-2008 uploaded by cyrenity (license 416)
Tested by: cyrenity, Corydon76

........

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=106359