Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
userdoc:tt_ldap_client [2013/10/25 15:38]
droemel [Asterisk Usage Examples]
userdoc:tt_ldap_client [2013/11/18 08:37] (current)
abelbeck [Phone LDAP Directory CLI Scripts]
Line 97: Line 97:
 \\ \\
 \\ \\
-**ldap-phone-name-lookup**+**ldap-phone-num-lookup**
  
-  Usage: ldap-phone-name-lookup [--tls] name+  Usage: ldap-phone-num-lookup ​[-ht] [--tls] ​[-m|--match-num list] [-o|--output-name list] number 
 +   
 +  Options: 
 +      -h, --help ​            Show help 
 +      -t, --tls              Enable TLS using start_tls 
 +      -m, --match-num list   Comma separated list to match number. Default: telephonenumber,​mobile,​cellphone,​homephone 
 +      -o, --output-name list Comma separated list to display the name. Default: displayname,​cn,​sn,​givenname
  
-The 'name' is matched as: ''​(|(cn=$name)(displayname=$name))''​+By default the 'number' is matched as: ''​(|(telephonenumber=$number)(mobile=$number)(cellphone=$number)(homephone=$number))''​
  
-Standard output returns ​(multiple) phone numbers separated by tilde (~).+Standard output returns ​the first ''​displayname/​cn/​sn/​givenname''​ that contains ​matching number.
  
-**ldap-phone-num-lookup**+Use the optional ''​-m|--match-num list''​ and ''​-o|--output-name list''​ options to limit and specify the order of the matching and output. 
 +\\ 
 +\\ 
 +**ldap-phone-name-lookup**
  
-  Usage: ldap-phone-num-lookup [--tls] ​number+  Usage: ldap-phone-name-lookup ​[-ht] [--tls] ​[-m|--match-name list] [-o|--output-num list] name 
 +   
 +  Options: 
 +      -h, --help ​            Show help 
 +      -t, --tls              Enable TLS using start_tls 
 +      -m, --match-name list  Comma separated list to match name. Default: cn,​displayname 
 +      -o, --output-num list  Comma separated list to display numbers. Default: telephonenumber,​mobile,​cellphone,​homephone
  
-The 'number' is matched as: ''​(|(telephonenumber=$number)(mobile=$number)(cellphone=$number)(homephone=$number))''​+By default the 'name' is matched as: ''​(|(cn=$name)(displayname=$name))''​
  
-Standard output returns the first ''​displayname/​cn/​sn/​givenname'' ​that contains a matching ​number.+Standard output returns ​(multiple) phone number(s) separated by a tilde (~). 
 + 
 +Use the optional ​''​-m|--match-name list'' ​and ''​-o|--output-num list''​ options to limit and specify the order of the matching ​and output.
  
 ==== Asterisk Usage Examples ==== ==== Asterisk Usage Examples ====
Line 122: Line 139:
 ; CallerID(num) lookup, first LDAP then AstDB ; CallerID(num) lookup, first LDAP then AstDB
 exten => s,​1,​NoOp(CallerID lookup, first LDAP then AstDB ...) exten => s,​1,​NoOp(CallerID lookup, first LDAP then AstDB ...)
- same => n,ExecIf($[ $["​${CALLERID(num)}"​ != ""​] & $["​${CALLERID(name)}"​ = ""​] ]?​Set(LDAP_Name=${SHELL(ldap-phone-num-lookup '${CALLERID(num)}')})+ same => n,ExecIf($[ $["​${CALLERID(num)}"​ != ""​] & $["​${CALLERID(name)}"​ = ""​] ]?​Set(LDAP_Name=${SHELL(ldap-phone-num-lookup '${ARG1}')})
  same => n,​ExecIf($["​${LDAP_Name}"​ != ""​]?​Set(CALLERID(name)=${LDAP_Name}))  same => n,​ExecIf($["​${LDAP_Name}"​ != ""​]?​Set(CALLERID(name)=${LDAP_Name}))
  same => n,ExecIf($[ $["​${CALLERID(num)}"​ != ""​] & $["​${CALLERID(name)}"​ = ""​] ]?​Set(CALLERID(name)=${DB(cidname/​${CALLERID(num)})}))  same => n,ExecIf($[ $["​${CALLERID(num)}"​ != ""​] & $["​${CALLERID(name)}"​ = ""​] ]?​Set(CALLERID(name)=${DB(cidname/​${CALLERID(num)})}))
Line 129: Line 146:
 And in your incoming context put this line somewhere: And in your incoming context put this line somewhere:
  
-  exten => s,​n,​GoSub(subCID-lookup,​s,​1) +  exten => s,​n,​GoSub(subCID-lookup,​s,​1(${CALLERID(num)}))