Please check the code and let me know if I am doing anything wrong.
sub hss_search{ my ($hss_ip,$pw,$subscriber) = @_; $ldap = Net::LDAP->new($hss_ip, port=>$LDAP_PORT) or die "$@"; my $ldapMsg = $ldap->bind(dn => "administratorName=jambala,nodeNam +e=lenxks_rstnva_hss01", password =>$pw ); die $ldapMsg->error if $ldapMsg->is_error; #print "$ldapMsg->is_error \n"; $mesg = $ldap->search(filter => "HSS-PrivateUserID=sip:$subscriber +\@sprint.com", base => $LDAP_BASE, scope => "sub" ); @result = $mesg->entries; foreach $entry (@result) { #print "dn: " . $entry->dn() . "\n"; @attrs = $entry->attributes(); foreach $attr (@attrs) { if ($attr =~ /HSS-PrivateUserID/ ){ printf("\t%s: %s\n", $attr, $entry->get_value($attr)); } } } $mesg = $ldap->search(filter => "HSS-PublicIdValue=sip:$subscriber +\@sprint.com", base => $LDAP_BASE, scope => "sub" ); @result = $mesg->entries; foreach $entry (@result) { #print "dn: " . $entry->dn() . "\n"; @attrs = $entry->attributes(); foreach $attr (@attrs) { if ($attr eq 'HSS-PublicIdValue' ){ printf("\t%s: %s\n", $attr, $entry->get_value($attr)); } } } print "\n"; }
In reply to Ldap search is hanging by shawshankred
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |