?????English

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

IVRS Interactive OBD client


 
              
import java.io.IOException;
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.NameValuePair;
import org.apache.commons.httpclient.methods.PostMethod;


public class PushCall {

     public static void main(String[] args) {
         String accountCode = "xxxxx";
         String voiceCode = "xxx";
         String mobileNo = "xxxx";
         String a = callApi(accountCode, voiceCode, mobileNo);
         System.out.println(a);

     }

     public static String callApi(String accountCode,String voiceCode,String mobileNo) {
         String returnCode="";
         int re = 0;


             HttpClient client = new HttpClient();
             String url1 ="https://services.mgov.gov.in/PushCallAPI/FeedBackCalling";
             PostMethod method = new PostMethod(url1);
             method.addParameter(new NameValuePair("username",accountCode));
             method.addParameter(new NameValuePair("MobileNo", mobileNo));
             method.addParameter(new NameValuePair("voiceCode", voiceCode));


             try {
                 client.executeMethod(method);
                 String a = method.getResponseBodyAsString();
                 if(a.contains("Submitted Successfully")) {
                     re = 1;
                 }
                 System.out.println("OUTPUT a :: "+a);
             } catch (IOException e) {
                 // TODO Auto-generated catch block
                 e.printStackTrace();
             }

         if(re==1){
             returnCode="SUCCESS";
         }else{
             returnCode="FAIL";
         }
         return returnCode;

     }