Unable to make voice call from adl_callSetup()

Hello,

I am using function adl_callSetup(“50198***”,ADL_CALL_MODE_VOICE) to make a voice call or data call:
Function return OK, but I cannot call anoter phone number:

I subscribe to adl_callSubscribe(MyCallHandler) to see what’s going on… And I get:

What am I doing wrong? Am I missing something before calling adl_callSetup()?

The code is below:

const u16 wm_apmCustomStackSize = 1024;

s8 ret_value;

s8 MyCallHandler(u16 Event, u32 Call_ID)
{
    switch (Event)
    {
    case ADL_CALL_EVENT_RING_DATA:
           adl_atSendResponse ( ADL_AT_UNS, "ADL_CALL_EVENT_RING_DATA\n\r");
           //adl_callAnswer();
      break;
    case ADL_CALL_EVENT_ANSWER_OK: 
        adl_atSendResponse ( ADL_AT_UNS, "ADL_CALL_EVENT_ANSWER_OK\n\r");
    //V24Handle = adl_fcmSubscribe ( USED_FLOW, V24CtrlHandler, V24DataHandler );
      break;     
    case ADL_CALL_EVENT_RING_VOICE:
           adl_atSendResponse ( ADL_AT_UNS, "ADL_CALL_EVENT_RING_VOICE\n\r");
      break;     
      case ADL_CALL_EVENT_NEW_ID:
           adl_atSendResponse ( ADL_AT_UNS, "ADL_CALL_EVENT_NEW_ID\n\r");          
      break;
      case ADL_CALL_EVENT_RELEASE_ID:
           adl_atSendResponse ( ADL_AT_UNS, "ADL_CALL_EVENT_RELEASE_ID\n\r");
      break;

      case ADL_CALL_EVENT_ALERTING:

           adl_atSendResponse ( ADL_AT_UNS, "ADL_CALL_EVENT_ALERTING\n\r");
      break;
      case ADL_CALL_EVENT_NO_CARRIER:
           adl_atSendResponse ( ADL_AT_UNS, "ADL_CALL_EVENT_NO_CARRIER\n\r");
      break;
      case ADL_CALL_EVENT_NO_ANSWER:
           adl_atSendResponse ( ADL_AT_UNS, "ADL_CALL_EVENT_NO_ANSWER\n\r");
      break;
      case ADL_CALL_EVENT_BUSY:
           adl_atSendResponse ( ADL_AT_UNS, "ADL_CALL_EVENT_BUSY\n\r");
      break;
      case ADL_CALL_EVENT_SETUP_OK:
           adl_atSendResponse ( ADL_AT_UNS, "ADL_CALL_EVENT_SETUP_OK\n\r");
      break;
      case ADL_CALL_EVENT_HANGUP_OK:
           adl_atSendResponse ( ADL_AT_UNS, "ADL_CALL_EVENT_HANGUP_OK\n\r");
      break;
      case ADL_CALL_EVENT_SETUP_OK_FROM_EXT:
           adl_atSendResponse ( ADL_AT_UNS, "ADL_CALL_EVENT_SETUP_OK_FROM_EXT\n\r");
      break;
      case ADL_CALL_EVENT_ANSWER_OK_FROM_EXT:
           adl_atSendResponse ( ADL_AT_UNS, "ADL_CALL_EVENT_ANSWER_OK_FROM_EXT\n\r");
      break;
      case ADL_CALL_EVENT_HANGUP_OK_FROM_EXT:
           adl_atSendResponse ( ADL_AT_UNS, "ADL_CALL_EVENT_HANGUP_OK_FROM_EXT\n\r");
      break;
      case ADL_CALL_EVENT_AUDIO_OPENNED:
           adl_atSendResponse ( ADL_AT_UNS, "ADL_CALL_EVENT_AUDIO_OPENNED\n\r");
      break;
      case ADL_CALL_EVENT_ANSWER_OK_AUTO:
           adl_atSendResponse ( ADL_AT_UNS, "ADL_CALL_EVENT_ANSWER_OK_AUTO\n\r");
      break;
      case ADL_CALL_EVENT_RING_GPRS:
           adl_atSendResponse ( ADL_AT_UNS, "ADL_CALL_EVENT_RING_GPRS\n\r");
      break;
      case ADL_CALL_EVENT_SETUP_FROM_EXT:
           adl_atSendResponse ( ADL_AT_UNS, "ADL_CALL_EVENT_SETUP_FROM_EXT\n\r");
      break;
      case ADL_CALL_EVENT_SETUP_ERROR_NO_SIM:
           adl_atSendResponse ( ADL_AT_UNS, "ADL_CALL_EVENT_SETUP_ERROR_NO_SIM\n\r");
      break;
      case ADL_CALL_EVENT_SETUP_ERROR_PIN_NOT_READY:
           adl_atSendResponse ( ADL_AT_UNS, "ADL_CALL_EVENT_SETUP_ERROR_PIN_NOT_READY\n\r");
      break;
      case ADL_CALL_EVENT_SETUP_ERROR:
           adl_atSendResponse ( ADL_AT_UNS, "ADL_CALL_EVENT_SETUP_ERROR\n\r");
      break;
      case ADL_CALL_EVENT_CIEV:
           adl_atSendResponse ( ADL_AT_UNS, "ADL_CALL_EVENT_CIEV\n\r");
      break;
      case ADL_CALL_EVENT_DTR_RELEASE:
           adl_atSendResponse ( ADL_AT_UNS, "ADL_CALL_EVENT_DTR_RELEASE\n\r");
      break;
    }     
}

/***************************************************************************/
/*  Function   : adl_main                                                  */
/*-------------------------------------------------------------------------*/
/*  Object     : Customer application initialisation                       */
/*                                                                         */
/*-------------------------------------------------------------------------*/
/*  Variable Name     |IN |OUT|GLB|  Utilisation                           */
/*--------------------+---+---+---+----------------------------------------*/
/*  InitType          |   |   |   |  Application start mode reason         */
/*--------------------+---+---+---+----------------------------------------*/
/***************************************************************************/
void adl_main ( adl_InitType_e  InitType )
{
    //ret_value = adl_callSetup("24346***",ADL_CALL_MODE_DATA);

    ret_value = adl_callSetup("50198***",ADL_CALL_MODE_VOICE);//

    if (ret_value == OK )
    adl_atSendResponse ( ADL_AT_UNS, "OK, Data phone call has been succeed\32\r\n" );
    else if (ret_value == ADL_RET_ERR_PARAM )
    adl_atSendResponse ( ADL_AT_UNS, "Some errors while calling ADL_RET_ERR_PARAM \32\r\n" );
    else
    adl_atSendResponse ( ADL_AT_UNS, "ADL_RET_ERR_SERVICE_LOCKED \32\r\n" );

    adl_callSubscribe(MyCallHandler);
}

Thanks in advance for help.
Tom

What happens if you try to call those numbers “manually” with AT commands?

What clearing cause do you see with AT+CEER ?

Well, I haven’t try with AT command, that will be next step.

When I type: at+ceer I got following error:

According to AT_command_Interface_Guide error is defined:

So in Appendix I found only this:

Where can I find Error 0?

Later I have tried:

Or 19? What does it mean?

ok, seems that Wavecom documentation contains wrong information… On page 55 VOLUME2 in 12.9.3 Parameters and Defined Values should be GSM 04.08

Anyway I got GSM 04.08 with all codes from 0 - 127.

But after I have type: at+cfun=1

I got error 226 that is over the range of values defined in GSM 04.08.
Where is the definition for this Cause No.?

Where those numbers are taken from ?

When I try to make a call using AT commands still I don’t receive a ring indication on my mobile phone:

What am I doing wrong?
Example has been taken from APPENDIXES (Page 21):

Thanks in advance for answers.
Tom

Hiya,

It’s my understanding that the Wavecom modem tries to make the call over the DATA bearer by default. If your mobile doesn’t have a DATA number (or your telco doesn’t support DATA calls to a mobile), the mobile won’t answer.

To force the Wavecom modem to make a call over the VOICE bearer, add a semicolon (:wink: to the end of the number in the ATD command.

i.e. ATD12345678;

and see if that connects to your mobile.

Also, have a look a the BEARER commands in the AT command manual.

Let us know how you get on.

ciao, Dave

Hi Dave, Thanks for answer,

AT commands are working fine, I can make data call and voice call! Send files over XMODEM, etc…

Now I am going to use adl_callSetup() function and see if this is working as well.
I will have more question about redirecting data file from GSM to UART1 but I will open new topic for that.

Thanks a lot for help,

Best regards,
Tom

Hiya,

No Problems. I’d been stuck on this at some stage also.

Great. Glad that your app is moving forwards.

ciao, Dave

This makes sense: the AT command interface on any modem (not just GSM) is basically intended for controlling data calls…

This is not just Wavecom - it’s standard for GSM

Hi again,

Thanks for posts. Well, now I have tried to run application with adl_callSetup(), See below:

#include "adl_global.h"


/***************************************************************************/
/*  Mandatory variables                                                    */
/*-------------------------------------------------------------------------*/
/*  wm_apmCustomStackSize                                                  */
/*-------------------------------------------------------------------------*/
/***************************************************************************/
const u16 wm_apmCustomStackSize = 1024;
s8 ret_value;
s8 FCMHandler;


bool FcmGSMDataHandler (u16 DataLen, u8 * Data)
{
 
    TRACE (( 1, "Data Event %d", DataLen));
 
    char Buffer[150];
 
    sprintf(Buffer," %u : ",DataLen);
//    adl_fcmSendData (FCMHandler,(u8*)&Buffer,(u16)strlen(Buffer));
//    adl_fcmSendData (FCMHandler,Data,DataLen);
 
return TRUE;
}


bool FcmCtrlHandler (adl_fcmEvent_e Event)
{
    s8 s8r;
 
    TRACE (( 1, "Ctrl Event %d", Event));
 
    switch (Event)
    {
 
        case ADL_FCM_RET_ERROR_GSM_GPRS_ALREADY_OPENNED :
      {
         TRACE((1, "Flow GSM already Opened"));
         adl_atSendResponse ( ADL_AT_UNS, "ADL_FCM_RET_ERROR_GSM_GPRS_ALREADY_OPENNED\n\r");
         break ;
      }
   case ADL_RET_ERR_PARAM :
      {
         TRACE((1, "ADL_RET_ERR_PARAM"));
         adl_atSendResponse ( ADL_AT_UNS, "ADL_RET_ERR_PARAM\n\r");
         break ;
      }
   case ADL_RET_ERR_ALREADY_SUBSCRIBED :
      {
         TRACE((1, "ADL_RET_ERR_ALREADY_SUBSCRIBED"));
         adl_atSendResponse ( ADL_AT_UNS, "ADL_RET_ERR_ALREADY_SUBSCRIBED\n\r");
         break ;
      }
   case ADL_FCM_EVENT_FLOW_OPENNED :
      {
         TRACE((1, "ADL_FCM_EVENT_FLOW_OPENNED"));
         adl_atSendResponse(ADL_AT_UNS,"GSM Flow openned\r\n");
            ret_value = adl_callSetup("243460**",ADL_CALL_MODE_DATA);
            //adl_fcmSwitchV24State(FCMHandler,ADL_FCM_V24_STATE_DATA);
         TRACE(( 1, "adl_fcmSwitchV24State Ret= %d", s8r)); 
         break ;
      }
   case ADL_FCM_EVENT_FLOW_CLOSED :
      {
        adl_atSendResponse(ADL_AT_UNS,"fcmSubscribe colsed\r\n");
         TRACE((1, "ADL_FCM_EVENT_FLOW_CLOSED"));
         break ;
      }
   case ADL_FCM_EVENT_RESUME :
      {
        adl_atSendResponse(ADL_AT_UNS,"fcmSubscribe resume\r\n");
         TRACE((1, "ADL_FCM_EVENT_RESUME"));
         break ;
      }
   case ADL_FCM_EVENT_MEM_RELEASE :
      {
        adl_atSendResponse(ADL_AT_UNS,"fcmSubscribe release\r\n");
         TRACE((1, "ADL_FCM_EVENT_MEM_RELEASE"));
         break ;
      }
   case ADL_FCM_EVENT_V24_DATA_MODE:
      {
         TRACE((1, "ADL_FCM_EVENT_V24_DATA_MODE"));
         adl_atSendResponse(ADL_AT_UNS,"now be data_mode2\r\n");
         //s8r=adl_fcmSendData(FCMHandler,"abc",3);
         TRACE(( 1, "adl_fcmSendData Ret= %d", s8r)); 
         break ;
      }
   case ADL_FCM_EVENT_V24_AT_MODE:
      {
         TRACE((1, "ADL_FCM_EVENT_V24_AT_MODE"));
         adl_atSendResponse(ADL_AT_UNS,"now be AT mode\r\n");
         break ;
      }
   default :
      {
         adl_atSendResponse(ADL_AT_UNS,"FCM_ControlHandler Event not processed\r\n");
         TRACE((1, "Embedded : FCM_ControlHandler Event not processed"));
         break ;
      }
 
    }
 
return TRUE;
}


s8 MyCallHandler(u16 Event, u32 Call_ID)
{
    switch (Event)
    {
    case ADL_CALL_EVENT_RING_DATA: 
           adl_atSendResponse ( ADL_AT_UNS, "ADL_CALL_EVENT_RING_DATA\n\r");
           //adl_callAnswer();
      break;
    case ADL_CALL_EVENT_ANSWER_OK:  
        adl_atSendResponse ( ADL_AT_UNS, "ADL_CALL_EVENT_ANSWER_OK\n\r");
    //V24Handle = adl_fcmSubscribe ( USED_FLOW, V24CtrlHandler, V24DataHandler );
      break;
      
    case ADL_CALL_EVENT_RING_VOICE: 
           adl_atSendResponse ( ADL_AT_UNS, "ADL_CALL_EVENT_RING_VOICE\n\r");
      break;
      
      case ADL_CALL_EVENT_NEW_ID: 
           adl_atSendResponse ( ADL_AT_UNS, "ADL_CALL_EVENT_NEW_ID\n\r");
           
      break;
      case ADL_CALL_EVENT_RELEASE_ID: 
           adl_atSendResponse ( ADL_AT_UNS, "ADL_CALL_EVENT_RELEASE_ID\n\r");
           
      break;
      case ADL_CALL_EVENT_ALERTING: 
           adl_atSendResponse ( ADL_AT_UNS, "ADL_CALL_EVENT_ALERTING\n\r");
           
      break;
      case ADL_CALL_EVENT_NO_CARRIER: 
           adl_atSendResponse ( ADL_AT_UNS, "ADL_CALL_EVENT_NO_CARRIER\n\r");
      break;
      case ADL_CALL_EVENT_NO_ANSWER: 
           adl_atSendResponse ( ADL_AT_UNS, "ADL_CALL_EVENT_NO_ANSWER\n\r");
      break;
      case ADL_CALL_EVENT_BUSY: 
           adl_atSendResponse ( ADL_AT_UNS, "ADL_CALL_EVENT_BUSY\n\r");
      break;
      case ADL_CALL_EVENT_SETUP_OK: 
           adl_atSendResponse ( ADL_AT_UNS, "ADL_CALL_EVENT_SETUP_OK\n\r");
      break;
      
      case ADL_CALL_EVENT_HANGUP_OK: 
           adl_atSendResponse ( ADL_AT_UNS, "ADL_CALL_EVENT_HANGUP_OK\n\r");
      break;
      case ADL_CALL_EVENT_SETUP_OK_FROM_EXT: 
           adl_atSendResponse ( ADL_AT_UNS, "ADL_CALL_EVENT_SETUP_OK_FROM_EXT\n\r");
      break;
      case ADL_CALL_EVENT_ANSWER_OK_FROM_EXT: 
           adl_atSendResponse ( ADL_AT_UNS, "ADL_CALL_EVENT_ANSWER_OK_FROM_EXT\n\r");
      break;
      case ADL_CALL_EVENT_HANGUP_OK_FROM_EXT: 
           adl_atSendResponse ( ADL_AT_UNS, "ADL_CALL_EVENT_HANGUP_OK_FROM_EXT\n\r");
      break;
      case ADL_CALL_EVENT_AUDIO_OPENNED: 
           adl_atSendResponse ( ADL_AT_UNS, "ADL_CALL_EVENT_AUDIO_OPENNED\n\r");
      break;
      case ADL_CALL_EVENT_ANSWER_OK_AUTO: 
           adl_atSendResponse ( ADL_AT_UNS, "ADL_CALL_EVENT_ANSWER_OK_AUTO\n\r");
      break;
      case ADL_CALL_EVENT_RING_GPRS: 
           adl_atSendResponse ( ADL_AT_UNS, "ADL_CALL_EVENT_RING_GPRS\n\r");
      break;
      case ADL_CALL_EVENT_SETUP_FROM_EXT: 
           adl_atSendResponse ( ADL_AT_UNS, "ADL_CALL_EVENT_SETUP_FROM_EXT\n\r");
      break;
 
      case ADL_CALL_EVENT_SETUP_ERROR_NO_SIM: 
           adl_atSendResponse ( ADL_AT_UNS, "ADL_CALL_EVENT_SETUP_ERROR_NO_SIM\n\r");
      break;
      case ADL_CALL_EVENT_SETUP_ERROR_PIN_NOT_READY: 
           adl_atSendResponse ( ADL_AT_UNS, "ADL_CALL_EVENT_SETUP_ERROR_PIN_NOT_READY\n\r");
      break;
      case ADL_CALL_EVENT_SETUP_ERROR: 
           adl_atSendResponse ( ADL_AT_UNS, "ADL_CALL_EVENT_SETUP_ERROR\n\r");
      break;
      case ADL_CALL_EVENT_CIEV: 
           adl_atSendResponse ( ADL_AT_UNS, "ADL_CALL_EVENT_CIEV\n\r");
      break;
      case ADL_CALL_EVENT_DTR_RELEASE: 
           adl_atSendResponse ( ADL_AT_UNS, "ADL_CALL_EVENT_DTR_RELEASE\n\r");
      break;
      
    }      
}

/***************************************************************************/
/*  Function   : adl_main                                                  */
/*-------------------------------------------------------------------------*/
/*  Object     : Customer application initialisation                       */
/*                                                                         */
/*-------------------------------------------------------------------------*/
/*  Variable Name     |IN |OUT|GLB|  Utilisation                           */
/*--------------------+---+---+---+----------------------------------------*/
/*  InitType          |   |   |   |  Application start mode reason         */
/*--------------------+---+---+---+----------------------------------------*/
/***************************************************************************/
void adl_main ( adl_InitType_e  InitType )
{
    TRACE (( 1, "Embedded : Appli Init" ));
    
    //FCMHandler = adl_fcmSubscribe( ADL_FCM_FLOW_V24_UART1, FcmCtrlHandler , FcmDataHandler);
    FCMHandler = adl_fcmSubscribe( ADL_PORT_GSM_BASE, FcmCtrlHandler , FcmGSMDataHandler);
    //ret_value = adl_callSetup("24346059",ADL_CALL_MODE_DATA);
    
    if (ret_value == OK )
    adl_atSendResponse ( ADL_AT_UNS, "OK, Data phone call has been succeed\32\r\n" );
    else if (ret_value == ADL_RET_ERR_PARAM )
    adl_atSendResponse ( ADL_AT_UNS, "Some errors while calling ADL_RET_ERR_PARAM \32\r\n" );
    else 
    adl_atSendResponse ( ADL_AT_UNS, "ADL_RET_ERR_SERVICE_LOCKED \32\r\n" );
    
    adl_callSubscribe(MyCallHandler); 
    
}

And I got ADL_CALL_EVENT_SETUP_ERROR.

What am I doing wrong? Shall I register to GSM network or subscribe to SIM?
I have no clue why I cannot call my second terminal. With AT commands I can without any problems.

Thanks in advance for help.
Tom

It looks like the SIM is registering on its own without the need of supplying a PIN. But it seems to me that you do the call too early. After at+wopen=1 the modem resets and you’ll need to wait until the registration with the network. you could either subscribe to the SIM services or the unsolicited +wind: 10 message, after that you should be able to make the call…

Or wait for +CREG: 2 or 5

Thank you Jan for help! I have subscribe for sim events after adl_sim_event_full_init I call adl_callSetup() function. It’s working fine!

Cheers,
Tom

SIM Full Init doesn’t necessarily indicate that you have network registration.

You should really be waiting for network registration before attempting any network operations - including making calls!

You are absolutely right!! Thanks for the addition, how could I have forgotten that :blush:

Thanks for update,
Best regards,
Tom

Hi there,

I have a related question, is it necessary to subscribe before callSetup? I mean:

adl_callSubscribe(CALL_VOICE_HANDLER);

then

adl_callSetup(“0912…”, ADL_CALL_MODE_VOICE)

or not? you know, I firstly subscribed the call service, then I used adl_callSetup, is it correct?

I ask this, because I receive this message: “CALL SETUP ERROR:515”, as you know it means that “wait, init or command set is in progress”, but I really don’t know if this was the cause or not!

any idea?

Hiya,

Have you checked that (a) the SIM has finished initializing; &(b) that you have network attachment?

ciao, Dave

it was exactly the problem!

tnx!

Hiya,

It’s a common complaint…Always check SIM and network connectivity before attempting network operations…

ciao, Dave