I am trying to make IVR system GSM modem. I am done with calling on number using code below
SerialPort SP = new SerialPort("COM3");
SP.BaudRate = 9600;
SP.Parity = Parity.None;
SP.DataBits = 8;
SP.StopBits = StopBits.One;
SP.RtsEnable = true;
SP.DtrEnable = true;
SP.Encoding = System.Text.Encoding.Unicode;
SP.ReceivedBytesThreshold = 1;
SP.NewLine = Environment.NewLine;
SP.Open();
SP.WriteLine("ATDT0999182542;"+ Environment.NewLine);
Can query to call status using
string ss= SP.ReadExisting();
State
of the call. Can be one of the following values:
0 - Active 1 - Held 2 - Dialling 3 - Alerting 4 - Incoming 5 - Waiting
Now my question is, How can i play voice message once call is answered, And can I get the number pressed by user (1,2,3).
5) ATD – This command is used to dial or call a number. 6) ATA – This command is used to answer a call. An incoming call is indicated by a message ‘RING’ which is repeated for every ring of the call. When the call ends ‘NO CARRIER’ is displayed on the screen. As ATA followed by enter key is pressed, incoming call is answered.
The characters entered in the AT command must be in the same case, either upper or lower. The command is analyzed by the modem after receiving the ENTER key character. AT commands response always start with <CR><LF>, and after this the response may be different according the execution statement
Similarly ‘AT’ command is sent to Modem, as an attention command to communicate, and a very basic response is ‘OK’ from the modem. By using these commands gsm module can be used to send sms using gsm and many others tasks. You can easily interface gsm with microcontroller by using AT commands.
Write command : This type of command consists of complete command to be executed. It actually sets the parameter values of the command. Execution command : This command is used very rarely. It reads the non-variable parameters of the modem that are only affected by internal processes executed in the GSM Modem.
For voice message read about voice mail numbers and their working. Yes you can get the number pressed by the user.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With