怪我咯2017-04-17 16:18:52
I have figured out the cause of the problem. After checking the source code, I found that when zabbix calls SMS mode, it is indeed initialized. The code is as follows:
zbx_sms_scenario scenario[] =
{
{ZBX_AT_ESC , NULL , 0}, /* Send <ESC> */
{"AT+CMEE=2\r" , ""/*"OK"*/ , 5}, /* verbose error values */
{"ATE0\r" , "OK" , 5}, /* Turn off echo */
{"AT\r" , "OK" , 5}, /* Init modem */
{"AT+CMGF=1\r" , "OK" , 5}, /* Switch to text mode/
{"AT+CMGS=\"" , NULL , 0}, /* Set phone number */
{number , NULL , 0}, /* Write phone number */
{"\"\r" , "> " , 5}, /* Set phone number */
{message , NULL , 0}, /* Write message */
{ZBX_AT_CTRL_Z , "+CMGS: " , 40}, /* Send message */
{NULL , "OK" , 1}, /* ^Z */
{NULL , NULL , 0}
};
Text mode does not support Chinese, just change it to pdu mode.