ISPConfig 3 Integration

Discussion in 'Installation/Configuration' started by Tsokotsa, Sep 8, 2023.

  1. Tsokotsa

    Tsokotsa New Member

    Good Day, i have installation of ispconfig 3 and all works ok for my DNS servers. I would like to integrate my internal crm into ispconfig so i am able to view and update dns records. I am able to view / add / update / delete records however, when i update / add on the database, although it reflects on the database as well as on the Gui of ispconfig, it does not propagate into the internet, in fact the changes do reflect on the dns_rr table but it does not reflect on the dnsrendered_zone of the soa table.
    What am i doing wrong? It used to work with old install of MydnsConfig.
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    ahrasis likes this.
  3. Tsokotsa

    Tsokotsa New Member

    Hi Till, thank you for your quick reply.
    I might have explained it wrong. The zones are advertised no problem when i update using the Ispconfig Gui interface. However i manage other servers using my own web interface and i am able to update the records using my php code. Problem is even if i update the records the records that i update or insert using my web interface app does not get advertised, it doesnt cause any error as such on the servers.
    bind is installed and enabled working as it should but just want to use this single interface to manage other services.
    When i update the records using Ispconfig Gui interface it creates a job queue which doesnt happen when i use my crm.
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    Then your code does probably not use the ISPConfig remote API to add the records. You can not add records using SQL.
     
    ahrasis likes this.
  5. Tsokotsa

    Tsokotsa New Member



    Hi till,

    ues I am not using the api, indeed I could not find any reference on the ISPConfig 3 book.
    Would you please point me to the api link please.
     
  6. HSorgYves

    HSorgYves Active Member HowtoForge Supporter

  7. till

    till Super Moderator Staff Member ISPConfig Developer

  8. Loucmane KONATE

    Loucmane KONATE New Member

    hi,I'm trying to add a client remotely and for that I got the examples cripts from the API documentation
    ,i'm using te client_add.php file and the soap_config.php, for the connection credentials I have created a remote user through admin panel ,i wanted to know if it work before i can do anything else but i get this error anytime i try executing the code:SOAP Error: Could not connect to host
     
  9. Loucmane KONATE

    Loucmane KONATE New Member

    here is the cliend_add.php file
    <?php

    require 'soap_config.php';
    $client = new SoapClient(null, array('location' => $soap_location,
    'uri' => $soap_uri,
    'trace' => 1,
    'exceptions' => 1));

    try {

    if($session_id = $client->login($username, $password)) {
    echo 'Logged successfull. Session ID:'.$session_id.'<br />';
    }

    //* Set the function parameters.
    $reseller_id = 0; // this id has to be 0 if the client shall not be assigned to admin or if the client is a reseller
    $params = array(
    'company_name' => 'awesomecompany',
    'contact_name' => 'name',
    'customer_no' => '1',
    'vat_id' => '1',
    'street' => 'fleetstreet',
    'zip' => '21337',
    'city' => 'london',
    'state' => 'bavaria',
    'country' => 'GB',
    'telephone' => '123456789',
    'mobile' => '987654321',
    'fax' => '546718293',
    'email' => '[email protected]',
    'internet' => '',
    'icq' => '111111111',
    'notes' => 'awesome',
    'default_mailserver' => 1,
    'limit_maildomain' => -1,
    'limit_mailbox' => -1,
    'limit_mailalias' => -1,
    'limit_mailaliasdomain' => -1,
    'limit_mailforward' => -1,
    'limit_mailcatchall' => -1,
    'limit_mailrouting' => 0,
    'limit_mail_wblist' => 0,
    'limit_mailfilter' => -1,
    'limit_fetchmail' => -1,
    'limit_mailquota' => -1,
    'limit_spamfilter_wblist' => 0,
    'limit_spamfilter_user' => 0,
    'limit_spamfilter_policy' => 1,
    'default_webserver' => 1,
    'limit_web_ip' => '',
    'limit_web_domain' => -1,
    'limit_web_quota' => -1,
    'web_php_options' => 'no,fast-cgi,cgi,mod,suphp',
    'limit_web_subdomain' => -1,
    'limit_web_aliasdomain' => -1,
    'limit_ftp_user' => -1,
    'limit_shell_user' => 0,
    'ssh_chroot' => 'no,jailkit,ssh-chroot',
    'limit_webdav_user' => 0,
    'default_dnsserver' => 1,
    'limit_dns_zone' => -1,
    'limit_dns_slave_zone' => -1,
    'limit_dns_record' => -1,
    'default_dbserver' => 1,
    'limit_database' => -1,
    'limit_cron' => 0,
    'limit_cron_type' => 'url',
    'limit_cron_frequency' => 5,
    'limit_traffic_quota' => -1,
    'limit_client' => 0, // If this value is > 0, then the client is a reseller
    'parent_client_id' => 0,
    'username' => 'guy3',
    'password' => 'brush',
    'language' => 'en',
    'usertheme' => 'default',
    'template_master' => 0,
    'template_additional' => '',
    'created_at' => 0
    );

    $affected_rows = $client->client_add($session_id, $reseller_id, $params);

    echo "Client: ".$affected_rows."<br>";


    if($client->logout($session_id)) {
    echo 'Logged out.<br />';
    }


    } catch (SoapFault $e) {
    echo $client->__getLastResponse();
    die('SOAP Error: '.$e->getMessage());
    }

    ?>
     
  10. Loucmane KONATE

    Loucmane KONATE New Member

  11. till

    till Super Moderator Staff Member ISPConfig Developer

    That's because you use a IP address and not the hostname + valid SSL cert, which means that the SSL cert is invalid and, therefore the PHP soap client rejects the connection. You must disable SSL cert verification in the soap client:

    Example:

    Code:
    <?php
    
    // Disable SSL certificate verification
    $streamContext = stream_context_create([
        'ssl' => [
            'verify_peer' => false,
            'verify_peer_name' => false,
            'allow_self_signed' => true
        ]
    ]);
    
    // Create a new SOAP client instance with the stream context
    $client = new SoapClient("https://your-soap-service-url?wsdl", [
        'stream_context' => $streamContext,
        'cache_wsdl' => WSDL_CACHE_NONE
    ]);
    
    // Now you can use the $client to make SOAP calls
    ?>
    
     
    ahrasis and Loucmane KONATE like this.
  12. till

    till Super Moderator Staff Member ISPConfig Developer

  13. Loucmane KONATE

    Loucmane KONATE New Member

  14. Loucmane KONATE

    Loucmane KONATE New Member

    Hi,I'm still having the same error:SOAP Error: Could not connect to host
     
  15. till

    till Super Moderator Staff Member ISPConfig Developer

    Then you either use the wrong URL to connect to the server, your web server is not started, you block requests in some way, e.g., with a firewall, or you did not disable SSL cert verification for the soap request as shown above while using a self-signed SSL cert or one that does not match the domain you use to connect to the API. Have you considered hiring a developer who has worked with REST and SOAP APIs before and let him code the things you need? There are several freelancer marketplaces on the internet where you can try to find a developer for your project.
     
  16. Loucmane KONATE

    Loucmane KONATE New Member

    okay thanks : please can you introduce me to someone who has worked with REST and SOAP APIs or if you are available for that as you already know about it ,that will be great!I really want to it to be working as soon as possible,I
     

Share This Page