Im changing status of the call each time i get a call.
Status has two values and the values are changed on call.
When the call status is changed i send sms as confirmation.
I have made and tested the sms part but now i want to make all this automaticly. The problem is with defining sms auto respond. When the call is recieved i set status and at this point i want to replay to sender but i can’t.
I need to make manual input…
Maybe it would be better if i write some additional details about what im doing
My modul: q2686h.
OpenAT: 4.10.10
Im setting 3 gpio’s ( two inputs and one output ).
The input gpio is used for switching events and sending sms confirmation based on call event. After i get ADL_CALL_EVENT_RING_DATA == OK im setting gpio as input or output, based on the last event and am sending sms as confirmation. Last event is changed on call or per sms.
At the moment am in the part of compleating the input gpio function.
I have defined sms.c as external file and gpio handle is set under main file. Sms and input gpio ( gpio trace is trowing -2, but…) are working, if i try to run them separatly.
If i try to call adl_simSubscribe(SimHandler,NULL) and make auto replay to sender, right after i get RING_DATA i can see a trace but thats it.
There is no auto respond. Program stops at trace. ?
If you need the code please let me know, so i can send it.
It means that on each incomming call sended to q2686 i have to make respond to caller, with sms.
After i get ADL_CALL_EVENT_RING_DATA == OK i set input OR output ( based on last defined event ).
If the last defined event is INPUT then you get two additional options… ON/OFF. This ON/OFF options are changed automaticly each time you enter INPUT part. First call is ON, second call is OFF and so on. Each time you make change in input or output part you get sms confirmation that the change is accepted.
Partly typical example would be those free calls (some show etc. )
You call, you get voice answer from the mashine “your call is registered” and the line is hanged up.
I want to make partly the same but instead voice answer i want to send sms to the original caller.
example for input:
ADL_CALL_EVENT_RING_DATA == OK
if gpio is input
read second handler last state
if last state from second handler == ON
set new state for second handler == OFF
send confirmation SMS to caller that the new state is OFF
AT+CLIP gives you the caller’s number as soon as you get an incoming ring - so all you have to do to reply is send the SMS to that number.
Where’s the problem?
The ADL SMS Service passes the sender’s number as the 1st parameter to the Handler - so all you have to do to reply is send the SMS to that number.
Where’s the problem?
Thank you for your correction i didn’t notice this.
Now, after drinking cup of good old china green tee, lets take a look…
My problem is not in caller ID. Look at the shorted SMS code.
The code execution in emulator goes like this: -App started.
-LCD ON
-PIN OK
-RING
+CLIP=0,1
-Hangup
SMS started (Sms servis pokrenut)
at this point SMS reply to sender and ADL_SMS_EVENT_SENDING_OK should appear but nothing happens and i have to make manual input (CMGS) *
If the upper part would be executed OK i would trigger sms unsubscribe and that’s it.
To ask this super simple and without any additional details:
After you have look at the code, tell me how would you call sms function in openAT, and make reply to sender at this upper defined point ?
// SMS Handler: Send a reply to a received text message.
//
// This is called automatically whenever an SMS is received.
//
// The parameters give the sender's number, the timestamp, and the text.
// So, to reply to the sender, we just have to use these parameters!
//
bool SMSHandler( ascii *SmsTel, ascii *SmsTimeLength, ascii *SmsText )
{
adl_smsSend( Handle, // The handle from your SMS Subscription
SmsTel, // The caller's number
"This is my reply", // The message to send
ADL_SMS_MODE_TEXT ); // Use text mode
return TRUE;
}
Simple as that.
(you should, of course, check the return value from adl_smsSend)
I read the SMS service documentation but i didn’t understand how the SMS subscription works
anyone have an example of using adl_smsSubscribe function with adl_smsSend.
thank you