S
ssq237712
Unregistered / Unconfirmed
GUEST, unregistred user!
正在写一个CMPP的客户端程序,模拟网关测试一切正常,实际连接过去发送短信的时候总是返回-201,经检查为“未知错误”,不知道什么原因了,我调用的时移动提供的 cmppapi.dll 2.0,发送短信的函数封装如下:
function CMPP_Submit(conn_id: integer; var p_msg_id: int64; msg_level: byte; service_id: pchar;
msg_format: byte; msg_src, fee_type, fee_code, valid_time, at_time: pchar;
tp_pid, udhi, fee_user_type: byte; charge_mobile, src_mobile: pchar;
user_num: byte; dest_mobiles, msg: pchar; msg_len: integer; need_response: byte): integer; stdcall;
implements
function CMPP_Submit; external CMPP_API name 'CMPP_Submit';
调用:
n := CMPP_Submit(cnnID, AMsgID, 0, PChar(DMSys.ConnectParam.ServiceNo), 15,
PChar(DMSys.ConnectParam.CompNo), PChar(DMSys.ConnectParam.FeeType),
PChar(DMSys.ConnectParam.FeeCode), '', '', 0, 0, DMSys.ConnectParam.ChargeType,
PChar(DMSys.ConnectParam.ChargeNum), '0',
1, PChar(edtRecieveMobil.Text),
PChar(s), Length(s), DMSys.ConnectParam.IsReport);
function CMPP_Submit(conn_id: integer; var p_msg_id: int64; msg_level: byte; service_id: pchar;
msg_format: byte; msg_src, fee_type, fee_code, valid_time, at_time: pchar;
tp_pid, udhi, fee_user_type: byte; charge_mobile, src_mobile: pchar;
user_num: byte; dest_mobiles, msg: pchar; msg_len: integer; need_response: byte): integer; stdcall;
implements
function CMPP_Submit; external CMPP_API name 'CMPP_Submit';
调用:
n := CMPP_Submit(cnnID, AMsgID, 0, PChar(DMSys.ConnectParam.ServiceNo), 15,
PChar(DMSys.ConnectParam.CompNo), PChar(DMSys.ConnectParam.FeeType),
PChar(DMSys.ConnectParam.FeeCode), '', '', 0, 0, DMSys.ConnectParam.ChargeType,
PChar(DMSys.ConnectParam.ChargeNum), '0',
1, PChar(edtRecieveMobil.Text),
PChar(s), Length(s), DMSys.ConnectParam.IsReport);