Hi,

I assume that id is defined at the point you call it. You can try the following:

retmsg = octstr_format("<?xml version=\"1.0\" 
?><MO><STATUS>0</STATUS><TRANSID>%ld</TRANSID></MO>", id);

BR,
Nikos
  ----- Original Message ----- 
  From: Benjamin Heryanto 
  To: [email protected] 
  Sent: Sunday, March 01, 2009 2:37 PM
  Subject: http response to smsc with xml


  Dear list

  How can return http response with following format

  <?xml version="1.0" ?>
  <MO>
  <STATUS>0</STATUS>
  <TRANSID>Transaction ID</TRANSID>
  <MSG>Message processed successfully</MSG>
  </MO>

  I already create coding like this below , but still dont get a clue how to 
make Transaction ID(fetch from id variable) dynamic change. 

    id = http_cgi_variable(cgivars, "transid");
    ...
          ret = bb_smscconn_receive(conn, msg);
          retmsg = octstr_create("<?xml version=\"1.0\" 
?><MO><STATUS>0</STATUS><TRANSID>id</TRANSID></MO>");
          status = (ret == 0 ? HTTP_OK : HTTP_FORBIDDEN);
      }

      reply_headers = gwlist_create();
      http_header_add(reply_headers, "Content-Type", "text/xml");
      http_send_reply(client, status, reply_headers, retmsg);


  Best Regards

Reply via email to