Sms push after hangup

Tell me how to write the condition correctly. the value of the rating means if the client is asked to choose from 1 to 5, but he just hangs up
[opinion-rus]
exten => 1,1,NoOp(Client’s service rate rus)
exten => 1,n,Read(digit,/var/lib/asterisk/sounds/ivr/rus_opinion,1,2)
exten => 1,n,NoOp(Selected {digit}) exten => 1,n,MYSQL(Connect connid localhost **** **** asterisk) exten => 1,n,MYSQL(Query resultid {connid} INSERT INTO opinion (id, callerid, exten, queues, opinion, datetime) VALUES (NULL, ‘{CALLID}', '{MEMBERINTERFACE}’, ‘{QUEUENAME}', '{digit}’, ‘{STRFTIME({EPOCH},%Y-%m-%d %H:%M)}’))
here it is necessary to set the condition if the value is none, then go to exten => 2 and send SMS
exten => 2,n,System(python3 /root/send_sms.py smstraffic {CALLID} ticket_price) exten => 1,n,Playback(/var/lib/asterisk/sounds/ivr/rus_thank_you) exten => 1,n,Hangup() exten => 0,n,MYSQL(Disconnect {connid})
exten => 0,n,Hangup()

Please mark up your dialplan as preformatted text.

If the user has hungup, any processing will need to be in the h extension, or other hangup handler.

could you tell us in more detail how?

that’s how it generally works. just how you can do it right. after h, the playback is no longer played after all. how best to paint this place?
exten => 1,1,NoOp(Client’s service rate rus)
exten => 1,n,Read(digit,/var/lib/asterisk/sounds/ivr/rus_opinion,1,2)
exten => 1,n,NoOp(Selected {digit}) exten => 1,n,MYSQL(Connect connid localhost *** *** ***) exten => 1,n,MYSQL(Query resultid {connid} INSERT INTO opinion (id, callerid, exten, queues, opinion, datetime) VALUES (NULL, ‘{CALLID}', '{MEMBERINTERFACE}’, ‘{QUEUENAME}', '{digit}’, ‘{STRFTIME({EPOCH},%Y-%m-%d %H:%M)}’))
exten => h,1,GotoIf([{LEN({digit})} = 1]?3:2) same => n,System(python3 /root/send_sms.py smstraffic {CALLID} ticket_price)
same => n,Playback(/var/lib/asterisk/sounds/ivr/rus_thank_you)
same => n,Hangup()
same => n,MYSQL(Disconnect ${connid})
same => n,Hangup()

Please mark up your dialplan as preformatted text.

Playback in the main dialplan and save the result in the h extension.

It’s the hangup that prevents playback from working.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.