Asterisk 22 SLA

We are running asterisk certified-asterisk-22-8-cert4.

What we had with asterisk 1.8
1.8> call comes into sla line, answered on 102, put on hold, call drops off of 102 and shows busy on sla key on all phones, pressing sla key on 104 connects you back to the outside call, hold puts it back to the sla line as busy, pressing it on 104 when 102 is active on the call connects both 102 and 104 to the outside party

What asterisk 22 does.
a22 > call comes into sla line, answered on 104, placed on hold on 104, call stays on 104 as on-hold, pressing sla key on 105 connects you to that outside line, hanging up the call on 105 leaves the call up on 104, unhold on 104 connects you back to the outside line again.

What I want to know is how do we get ext 104 when it puts the call on hold to leave the bridge. So that when ext 105 picks up the sla line and hangs up the inbound channel hangs up properly.

Is this some configuration that needs to be done to allow this behavior?

sudo asterisk -rx “sla show trunks”

=============================================================

=== Configured SLA Trunks ===================================

===

=== ---------------------------------------------------------
=== Trunk Name: B064777T4192
=== ==> Device: Local/trunk-4192@vatupullmeow/n
=== ==> AutoContext: (none)
=== ==> RingTimeout: 30 Seconds
=== ==> BargeAllowed: Yes
=== ==> HoldAccess: Open
=== ==> Stations …
=== ==> Station name: B064777D00002L4192
=== ---------------------------------------------------------

=== ---------------------------------------------------------

=== Trunk Name: B064777T4761
=== ==> Device: Local/trunk-4761@vatupullmeow/n
=== ==> AutoContext: (none)
=== ==> RingTimeout: 30 Seconds
=== ==> BargeAllowed: Yes
=== ==> HoldAccess: Open
=== ==> Stations …
=== ==> Station name: B064777D00004L4761
=== ==> Station name: B064777D00005L4761
=== ---------------------------------------------------------

=============================================================

sudo asterisk -rx “sla show stations”

=============================================================

=== Configured SLA Stations =================================

===

=== ---------------------------------------------------------
=== Station Name: B064777D00002L4192
=== ==> Device: PJSIP/sip101_vatupullmeow
=== ==> AutoContext: (none)
=== ==> RingTimeout: (none)
=== ==> RingDelay: (none)
=== ==> HoldAccess: Open
=== ==> Trunks …
=== ==> Trunk Name: B064777T4192
=== ==> State: SLA_TRUNK_STATE_IDLE
=== ==> RingTimeout: (none)
=== ==> RingDelay: (none)
=== ---------------------------------------------------------

=== ---------------------------------------------------------

=== Station Name: B064777D00004L4761
=== ==> Device: PJSIP/sip104_vatupullmeow
=== ==> AutoContext: (none)
=== ==> RingTimeout: (none)
=== ==> RingDelay: (none)
=== ==> HoldAccess: Open
=== ==> Trunks …
=== ==> Trunk Name: B064777T4761
=== ==> State: SLA_TRUNK_STATE_IDLE
=== ==> RingTimeout: (none)
=== ==> RingDelay: (none)
=== ---------------------------------------------------------

=== ---------------------------------------------------------

=== Station Name: B064777D00005L4761
=== ==> Device: PJSIP/sip105_vatupullmeow
=== ==> AutoContext: (none)
=== ==> RingTimeout: (none)
=== ==> RingDelay: (none)
=== ==> HoldAccess: Open
=== ==> Trunks …
=== ==> Trunk Name: B064777T4761
=== ==> State: SLA_TRUNK_STATE_IDLE
=== ==> RingTimeout: (none)
=== ==> RingDelay: (none)
=== ---------------------------------------------------------

============================================================

To anyone who got here.

Here is the case step by step.

Phone number tied to an sla trunk.
Call comes into to that sla trunk
Two stations/endpoints (a,b or 104 and 105) are associated with that trunk.
Two endpoints ring their sla line keys.
First extension 104 answers. (station a)
Then puts the caller on hold.
Then extension 105 (station b) picks up the sla line.
Talks then hangs up.

Caller is still in the sla trunk bridge. Not until extension 104 (station a) picks up and hangs up does the caller get a proper hangup.

The technical issue is that since sla got moved to it’s own app it from meetme it can’t track hold frames from the phone. So what happens in the above is when extension 104 (station a) puts the call on hold that it never leaves the channel bridge. Just goes mute. So a proper hang up of the bridge can’t happen until 104 unholds and hangs up.

More detail…

Bug 1, wrong direction. The framehook only checked frames written to the phone (EVENT_WRITE). A phone’s Hold arrives as a frame read from the phone (EVENT_READ), so it was never seen. We tried change one line from WRITE to READ and it crashed asterisk. So now onto bug 2.

Bug 2, missing data. The framehook interface never set .data, so the callback always received NULL and had no conference name. Fixing only bug 1 would have crashed Asterisk on the first Hold.

We ended up patching app_sla.c to do the right thing. Now when 104 goes on hold it leaves the sla bridge properly. The caller gets music on hold till extension 105 picks up. Then when 105 hangs up the caller get the proper hangup.

I am not sure how to submit a patch for review as the documentation mentions gerrit and has some dead links.

Also note that the sla documentation still references dahdi and could use a more in depth guild on configuring. Mabe covering station status and some of the new options.

For reference the original creation of app_sla.c.

ASTERISK-30309: app_sla: Migrate SLA applications from app_meetme

Your link is to the historical process, the current code contribution process is here:

Code Contribution - Asterisk Documentation

The documentation is also in a repo and accepts pull requests:

asterisk/documentation: The Asterisk Documentation Project.