bladox.com Forum Index bladox.com
Turbo SIM Toolkit Adapter Forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to intercep a call and cancel it

 
Post new topic   Reply to topic    bladox.com Forum Index -> Development
View previous topic :: View next topic  
Author Message
xrodriguez
Guest





PostPosted: Mon Apr 23, 2007 9:06 pm    Post subject: How to intercep a call and cancel it Reply with quote

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





PostPosted: Wed Apr 25, 2007 11:27 am    Post subject: Reply with quote

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





PostPosted: Wed Apr 25, 2007 11:44 pm    Post subject: Reply with quote

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





PostPosted: Sat Apr 28, 2007 2:29 am    Post subject: Reply with quote

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





PostPosted: Sat Apr 28, 2007 6:24 pm    Post subject: Reply with quote

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





PostPosted: Thu May 03, 2007 5:55 pm    Post subject: Reply with quote

Yes, use get_tag() to parse the envelope data.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    bladox.com Forum Index -> Development All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group