View previous topic :: View next topic |
Author |
Message |
xrodriguez Guest
|
Posted: Mon Apr 23, 2007 9:06 pm Post subject: How to intercep a call and cancel it |
|
|
Hi,
Is it posible:
1. to intercept a call or a USSD
2. do some action depending on it
3. cancel the call
An exmple: I enter "*12" and then I press the call button, an sms is sent, and the call canceled
Thanks,
Xavier |
|
Back to top |
|
 |
pz Guest
|
Posted: Wed Apr 25, 2007 11:27 am Post subject: |
|
|
You can use so called CALL CONTROL functionalty - when call (or SS/USSD) is initiated it goes to SIM - it can allow /modify/deny it. So you would deny it (based on the number called) and send SMS. Is this what you want? |
|
Back to top |
|
 |
xrodriguez Guest
|
Posted: Wed Apr 25, 2007 11:44 pm Post subject: |
|
|
Thanks,
this looks good!
Is there some primitive availablw to handle the call (acceptance, deny...) or do we need to use a low level method?
thnaks for your support that is very reactive! |
|
Back to top |
|
 |
pz Guest
|
Posted: Sat Apr 28, 2007 2:29 am Post subject: |
|
|
Code: |
#define CALL_STAT_ALLOW 0x00
#define CALL_STAT_CANCEL 0x01
#define CALL_STAT_MODIFY 0x02
u8 *get_resp_call; - malloc it, don't use big global (i.e. buf[100])
u8 get_resp_call_len;
void call_control (u8 * s)
{
// read 11.14 on input/output format
u8 stat=CALL_STAT_ALLOW;
u16 ret;
get_resp_call_len=0;
// make a decision, do what you want if CALL_STAT_MODIFY
if (stat == CALL_STAT_ALLOW)
{
get_resp_call[get_resp_call_len++] = CALL_STAT_ALLOW;
get_resp_call[get_resp_call_len++] = 0x00;
}
if (stat == CALL_STAT_CANCEL)
{
get_resp_call[get_resp_call_len++] = CALL_STAT_CANCEL;
get_resp_call[get_resp_call_len++] = 0x00;
}
ret = 0x9F00 | get_resp_call_len;
get_resp_call[get_resp_call_len++] = 0x90;
get_resp_call[get_resp_call_len++] = 0x00;
retval (ret);
}
void turbo_handler (u8 action, void *data)
{
switch (action)
{
...
case ACTION_APP_INIT:
get_resp_call=malloc(100);
reg_action (ACTION_CALL_CONTROL);
case ACTION_CALL_CONTROL:
call_control (data);
break;
case ACTION_FILE_APDU:
if (((File_apdu_data *) data)->prev_ins == ME_CMD_ENVELOPE
&& ((File_apdu_data *) data)->ins == ME_CMD_GET_RESPONSE)
{
u8 *r = buf_B ();
u8 i;
dbsp ("CALL FILE APDU\n");
for (i = 0; i < get_resp_call_len; i++)
r[i] = get_resp_call[i];
}
break;
....
}
}
|
|
|
Back to top |
|
 |
xrodriguez Guest
|
Posted: Sat Apr 28, 2007 6:24 pm Post subject: |
|
|
Thanks!,
One more question, is there a function to get the MSISDN/USSD from the envelope when ME start a MO call?
Thanks a lot |
|
Back to top |
|
 |
pz Guest
|
Posted: Thu May 03, 2007 5:55 pm Post subject: |
|
|
Yes, use get_tag() to parse the envelope data. |
|
Back to top |
|
 |
|