GSM High-level Tests

This section provides the high-level programming interface of the GSM RF Test Agent. These high level test contructs are the building blocks for test automation scripts.

Voice Services (CS, VoLTE, VoWiFi, VoNR)

call

Call a number and play audio from a given URL.

xg.call('1234567890','www.sample-audio-clip.com/download'):

Parameters

  • number number to be called
  • url URL to fetch audio recording from
  • wait_for_answer (optional, default settings.DEFAULT_CALL_TIMEOUT) Number of seconds to wait for called to be answered
  • call_duration (optional, default settings.DEFAULT_CALL_DURATION )Call duration in seconds

Returns <String> OK if call was succesful


dial

Calls the specified phone number using a voice phone call.

xg.dial('0123456789')

Parameters

  • number MSISDN of the phone number to dial

Returns <String> OK if call was made successfully


answer_call

Answer an incoming call.

xg.answer_call()

Parameters

  • wait_for_answer (optional, default settings.DEFAULT_CALL_TIMEOUT) Number of seconds to wait for called to be answered
  • call_duration (optional, default settings.DEFAULT_CALL_DURATION )Call duration in seconds.
  • network_type (cs|lte optional, default None) answer call only if incoming call is from a specific network type

Returns <String> call details

Example Direction: MT, Status: Incoming, Mode: Voice, Number: 701587094, Type: 128

Direction : MO / MT

Status : Incoming

Mode : Voice / Data / Fax

Number : Caller ID

Type : TO BE EDITED


hang_call

Hang up an existing call.

xg.hang_call()

Returns <String> OK if call was hung up successfully


activate_clip

Activate Calling Line Identification Presentation (CLIP) that enables a called subscriber to get the Calling Line Identity (CLI) of the calling party when receiving a mobile terminated call.

xg.activate_clip()

Returns <String> CLI after every RING


deactivate_clip

Deactivate Calling Line Identification Presentation (CLIP).

xg.deactivate_clip()

Returns <String> OK if CLIP was deactivated successfully


listen_to_calls

Listen to incoming calls for a given period of time and notify when an incoming call.

xg.listen_to_calls()

Parameters

  • expected_respose (optional, default None) expected response from the command
  • time_out (optional, default settings.GLOBAL_DEFAULT_TIMEOUT) Number of seconds to wait for a response

Returns <String> CLI of incoming call


check_call_active

Check if a call is currently Active.

xg.check_call_active()

Parameters

  • expected_respose (optional, default None) expected response from the command
  • timeout (optional, default settings.DEFAULT_CALL_TIMEOUT) Number of seconds to wait for a response

Returns <String> the list of all currently active calls


check_call_busy

Check if the terminating end of an outgoing call is busy.

xg.check_call_busy()

Parameters

  • expected_respose (optional, default None) expected response from the command
  • time_out (optional, default settings.DEFAULT_CALL_TIMEOUT) Number of seconds to wait for a response

Returns <String> BUSY if the terminating end is busy


check_no_carrier

Check if the terminating end of an outgoing call is not a registered subscriber.

xg.check_no_carrier()

Parameters

  • expected_respose (optional, default None) expected response from the command
  • time_out (optional, default settings.DEFAULT_CALL_TIMEOUT) Number of seconds to wait for a response

Returns <String> NO CARRIER if the terminating end is not a registered subscriber


check_not_reachable

Check if the terminating end of an outgoing call is Not Reachable.

xg.check_not_reachable()

Parameters

  • expected_respose (optional, default None) expected response from the command
  • time_out (optional, default settings.DEFAULT_CALL_TIMEOUT) Number of seconds to wait for a response

Returns <String> NOT REACHABLE if the terminating end is Not Reachable


call_waiting_en

Enables Call Waiting feature.

xg.call_waiting_en()

Returns <String> OK if Call Waiting was enabled successfully.


call_waiting_dis

Disables Call Waiting feature.

xg.call_waiting_dis()

Returns <String> OK if Call Waiting was disabled successfully.


call_hold

Place an active call on Hold and accept the other call (waiting or held) as active call.

xg.call_hold()

Returns <String> OK if Call Hold was successful


res_held

Resume the held call to an active call.

xg.res_held()

Returns <String> OK if Held Call was resumed successfully


conference

Add a held call to the active calls in order to set up a conference (multiparty) call.

xg.conference()

Returns <String> OK if Conference Call was established successfully.


call_forward_unc

Enable Call Forwarding Unconditionally to a specified number.

xg.call_forward_unc('1234567890')

Parameters

  • number Number to forward calls unconditionally

Returns Returns <String> OK if the specific number was registered for call forwarding unconditionally

call_forward_db

Enable Call Forwarding Default Busy to a specified number.

xg.call_forward_db('1234567890')

Parameters

  • number Number to forward calls when busy

Returns Returns <String> OK if the specific number was registered for call forwarding default busy


call_forward_nr

Enable Call Forwarding No Response to a specified number.

xg.call_forward_nr('1234567890')

Parameters

  • number Number to forward calls when no response

Returns Returns <String> OK if the specific number was registered for call forwarding when no response


call_forward_nrch

Enable Call Forwarding Not Reachable to a specified number.

xg.call_forward_nrch('1234567890')

Parameters

  • number Number to forward calls when not reachable

Returns Returns <String> OK if the specific number was registered for call forwarding when not reachable


call_forward_dis

Disable all call forwarding settings.

xg.call_forward_dis

Returns Returns <String> OK if call forwarding settings were disabled successfully


Non IP Messaging (USSD, SMS)

run_ussd

Run a USSD command.

xg.run_ussd('#123#')

Parameters

  • command USSD command
  • expected_respose (optional, default None) expected response from the command
  • time_out (optional, default settings.GLOBAL_DEFAULT_TIMEOUT) Number of seconds to wait for a response

Returns <String> OK if USSD Command was sent successfully


select_menu

Select a menu from the USSD reponse.

xg.select_menu('1')

Parameters

  • option menu selection
  • expected_respose (optional, default None) expected response from the command
  • time_out (optional, default settings.GLOBAL_DEFAULT_TIMEOUT) Number of seconds to wait for a response

Returns <String> OK if USSD menu was selected successfully


enter

Enter a pin or value for a USSD response.

xg.enter('1234')

Parameters

  • pin value to be entered
  • expected_respose (optional, default None) expected response from the command
  • time_out (optional, default settings.GLOBAL_DEFAULT_TIMEOUT) Number of seconds to wait for a response

Returns <String> OK if value was entered successfully


read_notification

Read USSD response from notification.

xg.read_notification()

Parameters

  • expected_respose (optional, default None) expected response from the command
  • time_out (optional, default settings.GLOBAL_DEFAULT_TIMEOUT) Number of seconds to wait for a response

Returns <String> reponse from the USSD


ussd_close

Close USSD Session.

xg.ussd_close()

Returns <String> OK if USSD Session was closed successfully


send_sms

Send an SMS text message

xg.send_sms('0123456789','Text')

Parameters

  • destination MSISDN of the destination
  • text Text message to be sent to the destination

Returns <String> +CMGS: <mr> message reference to indicate successful delivery of sms


read_sms

Returns SMS messages currently stored on the device/SIM card.

xg.read_sms()

Parameters

  • start_time (Datetime optional, default None) Start time of the SMS received time filter
  • end_time (Datetime optional, default None) End time of the SMS received time filter
  • status (int optional, default Sms.STATUS_ALL) Status of the SMS

Returns <list> list of SMS


read_sms_from_notification

Reads SMS from notification if an SMS was received promptly.

xg.read_sms_from_notification()

Returns <String> Content of the SMS

Example From: +94701587094, Received at: 2022-06-16 16:24:13+05:00, Content: Test Message


wait_for_sms

Wait a given period of time for an SMS and read it.

xg.wait_for_sms()

Parameters

  • content (optional, default None) content of the expected SMS
  • timeout (optional, default settings.GLOBAL_DEFAULT_TIMEOUT) Number of seconds to wait for a response

Returns <String> Content of the SMS

Example From: +94701587094, Received at: 2022-06-16 16:24:13+05:00, Content: Test Message


change_pdp_context

Specify the input and output format of the short messages to Text Mode

xg.change_pdp_context()

Returns <String> OK if the mode was changed to Text successfully


select_te_character

Set GSM default alphabet to be used by the TE

xg.select_te_character()

Returns <String> OK if setting was successful


Broadband Data (GPRS, Edge, LTE, 5G, Speed Testing)

attach_5g

Set Internet 5G APN Settings.

xg.attach_5g(apn = 'Sky', user_name = '', password = '', time_out=30)

Parameters

  • apn (default Null) APN
  • username (optional, default Null) username
  • password (optional, default Null) password
  • time_out (optional, default 30) Number of seconds to wait for a response

Returns <String>


query_5g

Query Internet 5G APN Settings.

xg.query_5g()

Returns <String> status of 5G Attachment


ping_query_5g

Ping a host.

xg.ping_query_5g('www.google.com')

Parameters

  • host (default Null) host
  • time_out (optional, default settings.GLOBAL_DEFAULT_TIMEOUT) Number of seconds to wait for a response

Returns <String>


volte_support

Check if the device supports VoLTE.

xg.volte_support()

Parameters

  • expected_respose (optional, default None) expected response from the command
  • time_out (optional, default settings.GLOBAL_DEFAULT_TIMEOUT) Number of seconds to wait for a response

Returns <String> +CIREP: 1,1 if the SIM supports VoLTE


activate_mbn

Selects ROW_Generic_3GPP MBN file

xg.activate_mbn()

Returns <String> OK if MBN file is activated on the module


deactivate_mbn

Deactivates the MBN file that is running on the module.

xg.deactivate_mbn()

Returns <String> OK if MBN file on the module is deactivated


mbn_list

Queries all the MBN files available in the module.

xg.mbn_list()

Parameters

  • expected_respose (optional, default None) expected response from the command
  • time_out (optional, default settings.GLOBAL_DEFAULT_TIMEOUT) Number of seconds to wait for a response

Returns <String> list of MBN files available in the module


check_lte_status

Queries the current operators and checks if network status is LTE.

xg.check_lte_status()

Parameters

  • expected_respose (optional, default None) expected response from the command
  • time_out (optional, default settings.GLOBAL_DEFAULT_TIMEOUT) Number of seconds to wait for a response

Returns <String> the current operator and 7 indicating network status as LTE


check_cs_status

Queries the current operators and checks if network status is CS.

xg.check_cs_status()

Parameters

  • expected_respose (optional, default None) expected response from the command
  • time_out (optional, default settings.GLOBAL_DEFAULT_TIMEOUT) Number of seconds to wait for a response

Returns <String> the current operator and 2 indicating network status as LTE


config_ims_en

Enable IMS function.

xg.config_ims_en()

Returns <String> OK if IMS was enabled successfully


check_ims_en

Query current IMS setting to check if VoLTE is enabled and a VoLTE session is available.

xg.check_ims_en()

Parameters

  • expected_respose (optional, default None) expected response from the command
  • time_out (optional, default settings.GLOBAL_DEFAULT_TIMEOUT) Number of seconds to wait for a response

Returns <String> +QCFG: "ims",1,1 if VoLTE is enabled and a VoLTE session is available


config_ims_dis

Disable IMS function.

xg.config_ims_dis()

Returns <String> OK if IMS was disabled successfully


check_ims_dis

Query current IMS setting to check if VoLTE is disabled and a VoLTE session is unavailable.

xg.check_ims_dis()

Parameters

  • expected_respose (optional, default None) expected response from the command
  • time_out (optional, default settings.GLOBAL_DEFAULT_TIMEOUT) Number of seconds to wait for a response

Returns <String> +QCFG: "ims",2,0 if VoLTE is disabled and a VoLTE session is unavailable


NEXT > VoWifi Test Interface Specification