code fixed and tested on all asterisk versions

versions tested:
11.2.1
10.12.1
1.8.20.1
1.6.2.24
1.6.1.25
1.4.44

all with swift5 on debian 6.0.6
app_swift lives on.