newHelpline: +91-22-26201606 Ext.325/315. +91-22-26201604 Ext.633.
Mobile Seva

How to write PHP Client for accessing IVRS Push Call API?

Note: For using IVRS Push Call API you need Transport Layer Security(TLS) protocol version TLSv1.2

Steps to check whether your system supports TLSv1.2:
1) Run the following command on your system
curl --tlsv1.2 https://msdgweb.mgov.gov.in/esms/sendsmsrequest
2) If you get message "GET Method Not Supported" then it is SUCCESS!!! your system supports TLSv1.2
5) If step 1 is not successful you need to upgrade your openssl libraries for system to suppot TLSv1.2 protocol

Click to download the IVRS Push Call API PHP code file(Size:8KB)
  "",//userid for the services portal          
       "password" => "", //password fro the services portal           
       "MobileNumbers" =>"",//Mobile number to be dialed       
       "voiceCode" =>"",);//Voice for voiceFile available on the services portal
    
        foreach($data as $key => $value) {
           $fields .= $key . '=' . urlencode($value) . '&';
        }
        rtrim($fields, '&');

        $post = curl_init();

    curl_setopt($post, CURLOPT_SSLVERSION, 6); //forces system to use TLSv1.2 protocol
        curl_setopt($post, CURLOPT_URL, $url);
    curl_setopt($post, CURLOPT_SSL_VERIFYPEER, false);
        curl_setopt($post, CURLOPT_POST, count($data));
        curl_setopt($post, CURLOPT_POSTFIELDS, $fields);
        curl_setopt($post, CURLOPT_RETURNTRANSFER, 1);
        $result =curl_exec($post);
    echo"$result";
    if(curl_errno($post))
    {
      echo 'error:' . curl_error($post);
    }
     curl_close($post);
    
}
        post_to_url();

?>