Video or audio-conferencing between 2 devices

To launch an audio or video conference call, you must first have 2 accounts :

  • One on the device initiating the call

  • Another on the second device picking up the call

 

In many cases, the scenario proceeds as shown in the diagram below:

  1. User 1 initiates call and configures microphone/camera

  2. User 2 joins call and configures microphone/camera

  3. Call time (video or audio conference)

  4. (option 1) User 1 hangs up, disconnecting user 2

  5. (option 2) User 1 hangs up, then user 2 hangs up

The key principle in writing these scenarios in GDSL is to be able to wait for elements or events triggered by the other scenario.

Following this diagram, here's an example of two call scripts via an audio conferencing application between two users.

 

User 1 

############################################################################## # Launch call ############################################################################# waitUntilGoneText,record measureStart,CHRGT_joinCall clickByText,btnLancerAppel waitUntilText,record pause,${PAUSEAFTERLOAD} measureStop measureStart,PAUSE_joinCall pause,${PAUSEDURATION} measureStop ################################################################################ # CALL # Accept camera & microphone use # Wait for second user # Call ################################################################################ # Accept camera & microphone use measureStart,ACTION_callAutorization clickByText,Allow pause,${PAUSEAFTERACTION} waitUntilText,camera pause,${PAUSEAFTERLOAD} measureStop waitUntilGoneText,btnHangUp measureStart,CHRGT_callWaitPractitionerJoin clickByText,Allow waitUntilText,btnHangUp pause,${PAUSEAFTERLOAD} measureStop # Wait for second user while,notExists,text,User2 do     pause,10000 done # Call Time measureStart,PAUSE_call pause,${PAUSEDURATION} measureStop ################################################################################ # CALL END # Hang up ################################################################################ # Hang up waitUntilGoneText,Home measureStart,CHRGT_quitCall clickByText,btnHangUp waitUntilText,Home pause,${PAUSEAFTERLOAD} measureStop measureStart,PAUSE_quitCall pause,${PAUSEDURATION} measureStop

 

User 2 

############################################################################## # WAITING OF CALL # Wait for the first user to launch the call # Join call ############################################################################# while,notExists,text,btnAnswer do     pause,10000 done # Join call measureStart,CHRGT_joinCall clickByText,btnAnswer waitUntilText,record pause,${PAUSEAFTERLOAD} measureStop measureStart,PAUSE_joinCall pause,${PAUSEDURATION} measureStop ################################################################################ # CALL # Accept camera & microphone use # Call ################################################################################ # Accept camera & microphone use measureStart,ACTION_callAutorisation clickByText,Allow pause,${PAUSEAFTERACTION} waitUntilText,camera pause,${PAUSEAFTERLOAD} measureStop waitUntilGoneText,btnHangUp measureStart,CHRGT_callWaitPractitionerJoin clickByText,Allow waitUntilText,btnHangUp pause,${PAUSEAFTERLOAD} measureStop measureStart,PAUSE_call pause,${PAUSEDURATION} measureStop ################################################################################ # CALL END # Wait for the leaving of first user # End or hang up ################################################################################ # Wait for the leaving of first user while,exists,text,User1 do     pause,10000 done # (Option 1) If the call is automatically terminated. #waitUntilText,Home # (Option 2) If the second user needs also to hang up waitUntilGoneText,Home measureStart,CHRGT_quitCall clickByText,btnHangUp waitUntilText,Home pause,${PAUSEAFTERLOAD} measureStop measureStart,PAUSE_quitCall pause,${PAUSEDURATION} measureStop