I am a beginner who has only studied Asterisk for 10 days.
I was writing and executing a simple extensions.conf because something was wrong.
I’m posting a question.
Asterisk installed asterisk-18.23.1 on Fedora.
[default]
include => test01
extend => 100, 1, Answer()
same => n, NoOp(READ…)
same => n, Background(/var/lib/asterisk/sounds/ko/1_information)
same => n, NoOp(READ…)
same => n, NoOp(READ…)
same => n, Read(dig,2, 5)
same => n, NoOp(READ…DONE)
same => n, gotoif( $[${dig} == 11] ?100-1:100-2)
same => n, NoOp(n is ${dig})
same => n(100-1), NoOp(mynumber is {NUMBER})
same => n, Hangup()
same => n(100-2), NoOp(mynumber ###### is ${dig})
same => n, Hangup()
exten => 11,1, NoOp(mynumber ###### is ${dig})
same => n, Background(/var/lib/asterisk/sounds/ko/Thank you, skip)
same => n, Hangup()
When you press DTMF while playing 1_information in backgroup,
The next line
same => n, NoOp(READ…)
Shouldn’t it be executed?
On cli
*CLI> == Using SIP RTP CoS mark 5
0x7faf280084a0 – Strict RTP learning after remote address set to: 172.30.1.70:57369
– Executing [100@default:1] Answer(“SIP/9001-00000002”, “”) in new stack
0x7faf280084a0 – Strict RTP switching to RTP target address 172.30.1.70:57369 as source
– Executing [100@default:2] NoOp(“SIP/9001-00000002”, “READ…”) in new stack
– Executing [100@default:3] BackGround(“SIP/9001-00000002”, “/var/lib/asterisk/sounds/ko/1_information”) in new stack
– <SIP/9001-00000002> Playing ‘/var/lib/asterisk/sounds/ko/1_infromation.slin’ (language ‘en’)
0x7faf280084a0 – Strict RTP learning complete - Locking on source address 172.30.1.70:57369
– Invalid extension ‘12’ in context ‘default’ on SIP/9001-00000002
– Executing [i@default:1] NoOp(“SIP/9001-00000002”, “invalid …”) in new stack
– Executing [i@default:2] Hangup(“SIP/9001-00000002”, “”) in new stack
== Spawn extension (default, i, 2) exited non-zero on ‘SIP/9001-00000002’
It appeared before play, but after play, neither line appears, so I move on to Read and ask a question.
And when you use the Read function, shouldn’t the 2-digit value you pressed be included in the dig value?
If you press 11 in the Read function, it goes to extension 11.
It’s happening and I’m asking for help.
Well then, thank you.