Noticed some behavior with the U option to Dial that is inconsistent with the documentation.
Below is a sample context which simply calls DIALSTR (with a particular ring cadence), and the U option to do some kind of "call screening".
The end goal is something similar to a Google Voice feature where you can answer and press a digit to accept the call or another digit (or hang up) to reject it.
The accept behavior works; if 1 is pressed, the parties are connected.
Two behaviors here are wrong:
In other words, the ability to "reject" the call doesn't work right.
This can't possibly be related to [ASTREX-4], but that is another instance of strange behavior with the U option.
[sample]
exten => _X,1,InbandDial(${DIALSTR}r$[${EXTEN}+12],,U(screen-incoming)) ; dist ring, with Google Voice like call screening
[screen-incoming]
exten => s,1,ExecIf(${EXISTS(${CONNECTEDLINE(num)})}?SayTelephoneNumber(digits,${CONNECTEDLINE(num)}))
same => n,BackGround(press-1)
same => n,WaitExten(1)
same => n,Goto(1)
exten => 1,1,Return()
exten => 2,1,Return(CONTINUE)
exten => h,1,Return(CONTINUE)
[2024-09-09 20:31:44.730] -- DAHDI/25-1 is ringing
[2024-09-09 20:31:44.846] -- DAHDI/25-1 answered Local/1@sample-00000064;2
[2024-09-09 20:31:44.847] -- DAHDI/25-1 Internal Gosub(screen-incoming,s,1) start
[2024-09-09 20:31:44.847] -- Executing [s@screen-incoming:1] ExecIf("DAHDI/25-1", "1?SayTelephoneNumber(digits,316)") in new stack
[2024-09-09 20:31:44.848] -- <DAHDI/25-1> Playing 'digits/3_.ulaw' (language 'en')
[2024-09-09 20:31:45.446] -- <DAHDI/25-1> Playing 'digits/1_.ulaw' (language 'en')
[2024-09-09 20:31:45.726] -- DAHDI/21-1 is ringing
[2024-09-09 20:31:46.025] -- <DAHDI/25-1> Playing 'digits/6.ulaw' (language 'en')
[2024-09-09 20:31:46.800] -- Executing [s@screen-incoming:2] BackGround("DAHDI/25-1", "press-1") in new stack
[2024-09-09 20:31:46.801] -- <DAHDI/25-1> Playing 'press-1.ulaw' (language 'en')
[2024-09-09 20:31:47.624] -- Executing [s@screen-incoming:3] WaitExten("DAHDI/25-1", "1") in new stack
[2024-09-09 20:31:48.625] -- Timeout on DAHDI/25-1, continuing...
[2024-09-09 20:31:48.625] -- Executing [s@screen-incoming:4] Goto("DAHDI/25-1", "1") in new stack
[2024-09-09 20:31:48.625] -- Goto (screen-incoming,s,1)
[2024-09-09 20:31:48.626] -- Executing [s@screen-incoming:1] ExecIf("DAHDI/25-1", "1?SayTelephoneNumber(digits,316)") in new stack
[2024-09-09 20:31:48.627] -- <DAHDI/25-1> Playing 'digits/3_.ulaw' (language 'en')
[2024-09-09 20:31:49.224] -- <DAHDI/25-1> Playing 'digits/1_.ulaw' (language 'en')
[2024-09-09 20:31:49.684] == Spawn extension (screen-incoming, s, 1) exited non-zero on 'DAHDI/25-1'
[2024-09-09 20:31:49.684] WARNING[207602][C-000000d9]: app_stack.c:1144 gosub_run: DAHDI/25-1 Abnormal 'Gosub(screen-incoming,s,1)' exit. Popping routine return locations.
[2024-09-09 20:31:49.687] -- Local/1@sample-00000064;1 answered DAHDI/16-1
You must be
9/14/2024 2:25 PM — InterLinked
Turned out to be user error. The U option uses
GOSUB_RESULT
, notGOSUB_RETVAL
. Accordingly, changing extension 2 to set that variable instead made things work as expected. The hangup case isn't addressed by doing that, but that wasn't in the scope of how the original feature was supposed to work.