error send SMS with TCP API

Home Forums iSMS error send SMS with TCP API

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #6169
    fleure fleure
    Participant

    can you help me please, j’essaye d’envoyer un sms avec une socket tcp avec le code java mais j’ai toujours un retour err: 609. voici le message que j’envoie:
    I try to send a sms with tcp socket with the java code but I still have a return err: 609.
    here is the message I send:
    /%20sendmsg?user=admin&passwd=mdp&cat=1&enc=1&priority=3&modem=0&to=%22xxxxxxxx%22&text=Hellow.

    with xxxxxxxx is msisdn number.

    thank you.

    #6170
    fleure fleure
    Participant

    can you help me please,
    I try to send a sms with tcp socket with the java code but I still have a return err: 609.
    here is the message I send:

    /%20sendmsg?user=admin&passwd=mdp&cat=1&enc=1&priority=3&modem=0&to=%22xxxxxxxx%22&text=Hellow.

    with xxxxxxxx is msisdn number.

    thank you.

    #6172
    Bryon Davis
    Moderator

    Hi fleure,
    Everything looks ok, but there shouldn’t be a %20 (space) between the / and sendmsg?

    Try:

    /sendmsg?user=admin&passwd=mdp&cat=1&enc=1&priority=3&modem=0&to=%22xxxxxxxx%22&text=Hellow.

    Regards,
    Bryon

    #6175
    fleure fleure
    Participant

    thank you Bryon, i try this also but a have the same error ( Err: 609).

    #6176
    Bryon Davis
    Moderator

    The 609 error indicates that there was “Timeout waiting for a TCP API request”.

    The “/sendmsg?user=admin&passwd=mdp&cat=1&enc=1&priority=3&modem=0&to=%22xxxxxxxx%22&text=Hellow.” request must end with a carriage return and linefeed. Otherwise the iSMS will wait for more data and eventually timeout.

    #6177
    fleure fleure
    Participant

    i have the same error.
    this is the java code ( i get the first line of response):

    Socket socket=new Socket(ipAdress,2040);
    socket.setSoTimeout(0);
    String sms=”sendmsg?user=admin&passwd=mdp&cat=1&enc=1&priority=3&modem=0&to=%22xxxxxxxx%22&text=HellowviaCode\n”;
    BufferedReader br = new BufferedReader(new InputStreamReader(s.getInputStream()));
    BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(s.getOutputStream()));
    bw.write(sms);
    bw.flush();
    String line;
    StringBuffer Response = new StringBuffer();
    int lineNumber=0;
    while ((line = br.readLine()) != null) {
    System.out.println( “Received line iSMS :”+ line);
    if(line.equals(“”)){
    System.out.println( “end Response “);
    break;
    }
    if(lineNumber==0){
    Response.append(line);
    break;
    }
    else Response.append(line).append(“\n”);
    }
    String responseBody = Response.toString();
    System.out.println( “responseBody “+responseBody);
    bw.close();
    br.close();
    s.close();

    #6178
    Bryon Davis
    Moderator

    Try changing the following line to end with “\r\n” (carriage return and linefeed):

    socket.setSoTimeout(0); String sms=”sendmsg?user=admin&passwd=mdp&cat=1&enc=1&priority=3&modem=0&to=%22xxxxxxxx%22&text=HellowviaCode\r\n”;

    #6179
    fleure fleure
    Participant

    i have Err:602 (parse Error).

    #6180
    fleure fleure
    Participant

    i have a response now with :
    String sms=”/sendmsg?user=admin&passwd=mdp&cat=1&enc=1&priority=3&modem=0&to=%22xxxxxx%22&text=HellowviaCode\r\n”;

    thank you frends for your help.

Viewing 9 posts - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.