8 Manage calls - Call control examples

This chapter provides examples of call control with sequence diagrams. Moreover, you can refer to examples in the Softphone meta-code for Jabra device interfacing document.

The sequence diagrams depict the user interaction with a device i.e., the communication between the Jabra device and the application.

The following examples are described using a Jabra Evolve2 65 headset with a multi-function button.

8.1 Example 1: Incoming call accepted and ended on device

The following sequence diagram illustrates a situation, where an incoming call is accepted by pressing the Answer button on the headset. The call is terminated by pressing the End button on the headset.

Remember that the Answer/end call functions are served by the same button (the multi-function button), but the signal sent by the Jabra device depends on the call state of the device.

sequenceDiagram
    participant User as User
    participant App as Softphone
    participant Device as Headset

    App ->> App: Incoming call
    Note over App: Acquire call lock
    App -) Device: Ringer = 1
    Note over Device: Headset starts ringing

    User -->> Device: Accepts call by pressing the 'answer' button
    Device ->> App: HookSwitch = 1
    Note over App: App must acknowledge<br>this signal.
    App -) Device: HookSwitch = 1
    App -) Device: Ringer = 0
    App -) App: Establish call
    Device ->> App: LineBusy = 1

    Note over User,Device: Call in progress...

    User -->> Device: Ends call by pressing the 'end' button

    Device ->> App: HookSwitch = 0
    Note over App: App must acknowledge<br>this signal.
    App -) Device: HookSwitch = 0
    App -) App: Terminate call
    Device ->> App: LineBusy = 0
    Note over App: Release Call Lock

8.2 Example 2: Incoming call accepted and ended on softphone UI

The following sequence diagram illustrates a situation, where the user accepts an incoming call on the softphone UI using virtual buttons.

The call is then terminated on the softphone UI. Comparable to example 1, but crucially the messages differ; in example 2, the user accepts the call on the UI i.e., virtual buttons instead of using physical buttons on the headset.

sequenceDiagram
    participant User as User
    participant App as Softphone
    participant Device as Headset

    App ->> App: Incomimg call
    Note over App: Acquire call lock
    App -) Device: Ringer = 1
    Note over Device: Headset starts ringer

    User -->> App: Accepts call via the softphone UI
    App -) Device: OffHook = 1
    App -) Device: Ringer = 0
    App -) App: Establish call
    Note over Device: Headset stops ringing<br>and goes into call state
    Device ->> App: OffHook = 1
    Device ->> App: LineBusy = 1

    Note over User,Device: Call in progress...

    User -->> App: Ends call via the softphone UI
    App -) App: Terminate call
    App -) Device: OffHook = 0
    Device ->> App: OffHook = 0
    Device ->> App: LineBusy = 0
    Note over App: Release Call Lock

8.3 Example 3: Incoming call rejected on the device

The following sequence diagram illustrates a situation where the user rejects a call by double-pressing the multi-function button on the headset.

sequenceDiagram
    participant User as User
    participant App as Softphone
    participant Device as Headset

    App ->> App: Incomimg call
    Note over App: Acquire call lock
    App -) Device: Ringer = 1
    Note over Device: Headset starts ringer

    User -->> Device: Rejects call by double-pressing<br/>the 'multi-function' button
    Device ->> App: Reject
    App -) Device: Ringer = 0
    Note over Device: Headset stops ringing
    Note over App: Release Call Lock

For more information and sample codes on the above examples, refer to the Manage Call chapter in the Developer's guide.