Affichage des résultats 1 à 10 sur 15

Discussion: Utilisation de res_ldap.conf

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre Senior
    Date d'inscription
    février 2011
    Messages
    141
    Downloads
    0
    Uploads
    0

    Utilisation de res_ldap.conf

    Bonjour,

    je voudrais avoir quelques renseignement sur l'utilisation de res_ldap.conf, après avoir cherche sur la toile j'ai compris que mes soft phone pouvait s'authentifié à travers le LDAP au lieu du sip.conf
    C'est bien ça?
    Merci

    PS: Mon asterisk est bien connecté au serveur LDAP mais je n'arrive pas à m'authentifié à travers
    Dernière modification par ghostrider95 ; 07/05/2011 à 12h20.

  2. #2
    Membre Senior
    Date d'inscription
    février 2011
    Messages
    141
    Downloads
    0
    Uploads
    0
    Bonjour,

    après quelques configurations je n'arrive pas à authentifier mes Users via LDAP, je vous montre mes fichiers de conf qui sera plus précis que des mots:

    sip.conf

    Code:
    [general]
    context=internal
    rtcachefriends=yes
    callevents=yes
    realm=192.168.1.15
    bindport=5060
    srvlookup=yes
    disallow=all
    allow=ulaw
    allow=gsm
    language=en
    trustrpid = yes 
    sendrpid = yes  
    
    register => 2000:Azerty95@192.168.1.15:5060

    extconfig.conf

    Code:
    [sip]
    
    sipusers = ldap,"dc=voip,dc=local",sip
    sippeers = ldap,"dc=voip,dc=local",sip
    res_ldap.conf

    Code:
    [_general]
    ;
    ; Specify one of either host and port OR url.  URL is preferred, as you can
    ; use more options.
    host=192.168.1.15                    ; LDAP host
    port=389
    ;url=ldap://192.168.1.14:389
    protocol=3                          ; Version of the LDAP protocol to use; default is 3.
    basedn=dc=voip,dc=local            ; Base DN
    user=cn=Administrateur,dc=voip,dc=local  ; Bind DN
    pass=Alonso95                     ; Bind password
    
    ; Configuration Table
    [config]
    ;
    ; additionalFilter - This specifies an additional set of criteria to be used
    ; when querying the LDAP server.
    ;
    additionalFilter=(objectClass=AstConfig)
    ;
    ; Attributes mapping (asterisk variable name = ldap attribute name)
    ; When Asterisk requests the variable by the name of the value on the left,
    ; this module will look up the attribute listed on the right.
    ;
    filename = AstConfigFilename
    category = AstConfigCategory
    variable_name = AstConfigVariableName
    variable_value = AstConfigVariableValue
    cat_metric = AstConfigCategoryMetric
    commented = AstConfigCommented
    
    ;
    ; Extensions Table
    ;
    [extensions]
    context  =  AstExtensionContext
    exten  =  AstExtensionExten
    priority = AstExtensionPriority
    app = AstExtensionApplication
    appdata = AstExtensionApplicationData
    additionalFilter=(objectClass=AstExtension)
    
    ;
    ; Sip Users Table
    ;
    [sip]
    
    
    attribute = name => telephoneNumber
    attribute = callerid => telephoneNumber
    attribute = context => info 
    attribute = fullcontact => facsimileTelephoneNumber
    attribute = host => ipPhone
    attribute = mailbox => homePhone
    attribute = md5secret => realmedPassword
    attribute = nat => mobile
    attribute = qualify => pager

    un extrait de la CLI
    Code:
    new-host-2*CLI> realtime show ldap status
    Connected to 'ldap://192.168.1.15:389', baseDN dc=voip,dc=local with username cn=Administrateur,dc=voip,dc=local for 8 minutes, 28 seconds.

    Lorsque je m'identifie sur mon x-lite, dois-je rentrer l'@ip de mon serveur asterisk ou bien LDAP?

    Merci

    PS:@ ip asterisk : 192.168.1.14
    @ ip LDAP: 192.168.1.15
    client x-lite situé sur @ip 192.168.1.11

  3. #3
    Membre Senior
    Date d'inscription
    février 2011
    Messages
    141
    Downloads
    0
    Uploads
    0
    Personne pour m'aider sur ce problème?

  4. #4
    Membre Association
    Date d'inscription
    août 2010
    Messages
    856
    Downloads
    0
    Uploads
    0
    Je te propose de faire d'abord fonctionner quelque chose de plus simple, plus documenté, et plus connu: res_mysql
    A partir de là tu aura une bonne base pour attaquer res_ldap

    Sinon pour la question, c'est bien Asterisk que le téléphone interroge, pas le serveur ldap (celui-ci n'est qu'une base de données, le sip il connait pas)

  5. #5
    Membre Senior
    Date d'inscription
    février 2011
    Messages
    141
    Downloads
    0
    Uploads
    0
    Bonsoir,

    merci pour ta réponse ça fais plaisir

    Le pb c'est que dans le cahier des charges de mon projet en cours, je dois utiliser LDAP, je refais un topo sur ma config :

    res_ldap.conf

    Code:
    ;
    ; Configuration file for res_config_ldap
    ;
    
    ; Realtime configuration
    ; ----------------------
    ; In order to use this module, you start 
    ; in extconfig.conf with a configuration like this:
    ;
    ; 	sipusers = ldap,"dc=myDomain,dc=myDomainExt",sip
    ; 	sippeers = ldap,"dc=myDomain,dc=myDomainExt",sip
    ; 	extensions = ldap,"dc=myDomain,dc=myDomainExt",extensions
    ; 	sip.conf = ldap,"dc=myDomain,dc=myDomainExt",config
    ;
    ; In the case of LDAP the last keyword in each line above specifies
    ; a section in this file.
    
    ; TLS support
    ; -----------
    ; Note that you can configure an ldaps: url here to get TLS support.
    ; Detailed configuration of certificates and supported CAs is done in your 
    ; ldap.conf file for OpenLDAP clients on your system.
    ; This requires that you have OpenLDAP libraries compiled with TLS support
    
    ; *********************************************************************************
    ; NOTE: res_ldap.conf should be chmod 600 because it contains the plain-text LDAP
    ;       password to an account with WRITE access to the asterisk configuration. 
    ; *********************************************************************************
    
    [_general]
    ;
    ; Specify one of either host and port OR url.  URL is preferred, as you can
    ; use more options.
    host=192.168.1.15                    ; LDAP host
    port=389
    ;url=ldap://192.168.1.14:389
    protocol=3                          ; Version of the LDAP protocol to use; default is 3.
    basedn=dc=voip,dc=local            ; Base DN
    user=cn=Administrateur,dc=voip,dc=local  ; Bind DN
    pass=Alonso95                     ; Bind password
    
    [sip]
    
    name = cn       ; We use the "cn" as the default value for name on the line above
                    ; because objectClass=AsteriskSIPUser does not include a uid as an allowed field
                    ; If your entry combines other objectClasses and uid is available, you may
                    ; prefer to change the line to be name = uid, especially if your LDAP entries
                    ; contain spaces in the cn field.
                    ; You may also find it appropriate to use something completely different.
                    ; This is possible by changing the line above to name = AstAccountName (or whatever you
                    ; prefer).
                    ;
    
    callerid = telephoneNumber
    context = info 
    host = ipPhone
    secret = userPassword
    sip.conf

    Code:
    [general]
    rtcachefriends=yes
    callevents=yes
    realm=192.168.1.15
    extconfig.conf

    Code:
    [settings]
    
    sipusers = ldap,"dc=voip,dc=local",sip
    sippeers = ldap,"dc=voip,dc=local",sip
    -Mon LDAP est un active directory donc windows, comme vous avez pu remarqué j'ai mis les attributs en fonction de AD dans mon res_ldap.conf pour communiquer avec Asterisk.

    -J'ai crée un utilisateur toto dans mon AD avec comme numéro ip = 2000@192.168.1.14 ( adresse de mon asterisk)

    - Je rentre donc cette adresse sur mon softphone mais il n'arrive pas à s'enregistrer + mon mot de passe du user LDAP , sur mon Wireshark je vois que il y a comme paquet ( Register to 192.168.1.15(@LDAP) - 100 Trying - 401 Unauthorized)

    un extrait de mes logs

    Code:
    [May  8 23:17:53] ERROR[2845] netsock2.c: getaddrinfo("2000@192.168.1.14", "(null)", ...): Name or service not known
    [May  8 23:17:53] WARNING[2845] acl.c: Unable to lookup '2000@192.168.1.14'
    [May  8 23:17:53] NOTICE[2845] chan_sip.c: Registration from '"2000"<sip:2000@192.168.1.14>' failed for '192.168.1.11:22441' - No matching peer found
    [May  8 23:17:53] WARNING[2845] chan_sip.c: Retransmission timeout reached on transmission 1ef0caba0beb33f55bf69c8c61158baa@192.168.1.14 for seqno 105 (Critical Request) -- See doc/sip-retransmit.txt.
    Packet timed out after 100285ms with no response
    [May  8 23:22:08] NOTICE[2668] cdr.c: CDR simple logging enabled.
    [May  8 23:22:09] NOTICE[2668] loader.c: 211 modules will be loaded.
    [May  8 23:22:14] NOTICE[2668] res_odbc.c: res_odbc loaded.
    [May  8 23:22:14] NOTICE[2668] res_crypto.c: Key 'n' needs passcode.
    [May  8 23:22:14] NOTICE[2668] res_crypto.c: Add the '-i' flag to the asterisk command line if you want to automatically initialize passcodes at launch.
    [May  8 23:22:14] NOTICE[2668] res_crypto.c: Please run the command 'keys init' to enter the passcodes for the keys
    [May  8 23:22:14] NOTICE[2668] res_smdi.c: No SMDI interfaces are available to listen on, not starting SMDI listener.
    [May  8 23:22:14] WARNING[2668] loader.c: Error loading module 'res_pktccops': /usr/lib/asterisk/modules/res_pktccops.so: cannot open shared object file: No such file or directory
    [May  8 23:22:14] WARNING[2668] loader.c: Error loading module 'chan_mgcp.so': /usr/lib/asterisk/modules/chan_mgcp.so: undefined symbol: ast_pktccops_gate_alloc
    [May  8 23:22:14] WARNING[2668] loader.c: Module 'chan_mgcp.so' could not be loaded.
    [May  8 23:22:15] NOTICE[2668] config.c: Registered Config Engine ldap
    [May  8 23:22:15] ERROR[2668] res_config_pgsql.c: PostgreSQL RealTime: Failed to connect database asterisk on 127.0.0.1: 
    [May  8 23:22:15] WARNING[2668] res_config_pgsql.c: PostgreSQL RealTime: Couldn't establish connection. Check debug.
    [May  8 23:22:15] NOTICE[2668] config.c: Registered Config Engine pgsql
    [May  8 23:22:15] NOTICE[2668] config.c: Registered Config Engine curl
    [May  8 23:22:15] NOTICE[2668] config.c: Registered Config Engine odbc
    [May  8 23:22:15] WARNING[2668] chan_dahdi.c: Detected alarm on channel 4: Red Alarm
    [May  8 23:22:15] WARNING[2668] chan_dahdi.c: Ignoring any changes to 'userbase' (on reload) at line 23.
    [May  8 23:22:15] WARNING[2668] chan_dahdi.c: Ignoring any changes to 'vmsecret' (on reload) at line 31.
    [May  8 23:22:15] WARNING[2668] chan_dahdi.c: Ignoring any changes to 'hassip' (on reload) at line 35.
    [May  8 23:22:15] WARNING[2668] chan_dahdi.c: Ignoring any changes to 'hasiax' (on reload) at line 39.
    [May  8 23:22:15] WARNING[2668] chan_dahdi.c: Ignoring any changes to 'hasmanager' (on reload) at line 47.
    [May  8 23:22:16] NOTICE[2668] chan_skinny.c: Configuring skinny from skinny.conf
    [May  8 23:22:16] ERROR[2668] chan_gtalk.c: connection referenced not found!
    [May  8 23:22:16] WARNING[2668] cel_pgsql.c: CEL pgsql config file missing global section.
    [May  8 23:22:16] NOTICE[2668] cel_tds.c: cel_tds has no global category, nothing to configure.
    [May  8 23:22:16] WARNING[2668] cel_tds.c: cel_tds module had config problems; declining load
    [May  8 23:22:16] WARNING[2668] pbx.c: Unable to register extension '2000', priority 1 in 'internal', already in use
    [May  8 23:22:17] NOTICE[2668] pbx_ael.c: Starting AEL load process.
    [May  8 23:22:17] NOTICE[2668] pbx_ael.c: AEL load process: parsed config file name '/etc/asterisk/extensions.ael'.
    [May  8 23:22:17] NOTICE[2668] pbx_ael.c: AEL load process: checked config file name '/etc/asterisk/extensions.ael'.
    [May  8 23:22:17] NOTICE[2668] pbx_ael.c: AEL load process: compiled config file name '/etc/asterisk/extensions.ael'.
    [May  8 23:22:17] NOTICE[2668] pbx_ael.c: AEL load process: merged config file name '/etc/asterisk/extensions.ael'.
    [May  8 23:22:17] NOTICE[2668] pbx_ael.c: AEL load process: verified config file name '/etc/asterisk/extensions.ael'.
    Je sens que je suis prêt du but pourtant ça coince
    Merci de votre aide!

  6. #6
    Membre Senior
    Date d'inscription
    février 2011
    Messages
    141
    Downloads
    0
    Uploads
    0
    J'ai aussi suivi entre autres ces sites:

    http://www.ced-info.com/administrati.../asterisk-ldap

    ( Site de dessus basé sur OpenLDAP , mais pas sur AD mais le système reste le même pour les autres fichiers)

    http://www.dialnode.com/asterisk-fra...ead.php?t=9304

    Merci

Règles de messages

  • Vous ne pouvez pas créer de nouvelles discussions
  • Vous ne pouvez pas envoyer des réponses
  • Vous ne pouvez pas envoyer des pièces jointes
  • Vous ne pouvez pas modifier vos messages
  •