Read starting bid and allow opening and closing of bidding

This commit is contained in:
Your Name
2020-12-12 20:49:05 +00:00
parent 25a6e507e9
commit 4e5f2d5f61

View File

@@ -739,11 +739,16 @@ exten => 2,1,Goto(take-question,s,1)
[record-bid] [record-bid]
exten => 1,1,Noop() exten => 1,1,Noop()
same => n(start),Read(money,/etc/asterisk/media/playback/gebot-eingeben,,,1,12) same => n(start),GotoIf($[ "${DB(auction/open)}" != "1" ]?bidding-closed,1)
same => n,Playback(confbridge-begin-leader)
same => n,SayNumber(${DB(auction/bid)})
same => n,Playback(digits/dollars)
same => n,Read(money,/etc/asterisk/media/playback/gebot-eingeben,,,1,12)
same => n,GotoIf($[ "${money}" == "" ]?start) same => n,GotoIf($[ "${money}" == "" ]?start)
same => n,GotoIf($[ ${money} > 0 & ${money} < 10000 ]?:start) same => n,GotoIf($[ ${money} >= ${DB(auction/bid)} & ${money} < 10000 ]?:start)
same => n,Playback(you-entered) same => n,Playback(you-entered)
same => n,SayNumber(${money}) same => n,SayNumber(${money})
same => n,Playback(digits/dollars)
same => n,Read(input,/etc/asterisk/media/playback/gebot-bestaetigen,1,,1,7) same => n,Read(input,/etc/asterisk/media/playback/gebot-bestaetigen,1,,1,7)
same => n,GotoIf($[ "${input}" != "1" ]?start) same => n,GotoIf($[ "${input}" != "1" ]?start)
same => n,Set(FILE(/tmp/money.txt,,,al,u)=${money} ${CALLERID(num)}) same => n,Set(FILE(/tmp/money.txt,,,al,u)=${money} ${CALLERID(num)})
@@ -752,6 +757,10 @@ same => n,Set(QUEUE_PRIO=${money})
same => n,Queue(auction,t) same => n,Queue(auction,t)
same => n,Hangup() same => n,Hangup()
exten => bidding-closed,1,Playback(confbridge-begin-leader)
same => n,Wait(1)
same => n,Goto(1)
[take-question] [take-question]
exten => s,1,Queue(shop,t) exten => s,1,Queue(shop,t)
same => n,Hangup() same => n,Hangup()
@@ -761,6 +770,27 @@ exten => _2X,1,Dial(SIP/${EXTEN})
exten => _0X.,1,Goto(to-eventphone,${EXTEN:1},1) exten => _0X.,1,Goto(to-eventphone,${EXTEN:1},1)
; Open bidding, read start bid
exten => 91,1,Answer()
same => n,Wait(0.5)
same => n(start),Read(startbid,/etc/asterisk/media/playback/gebot-eingeben,,,1,12)
same => n,GotoIf($[ "${startbid}" == "" ]?start)
same => n,GotoIf($[ ${startbid} > 0 & ${startbid} < 10000 ]?:start)
same => n,Playback(you-entered)
same => n,SayNumber(${startbid})
same => n,Read(input,/etc/asterisk/media/playback/gebot-bestaetigen,1,,1,7)
same => n,GotoIf($[ "${input}" != "1" ]?start)
same => n,Set(DB(auction/open)=1)
same => n,Set(DB(auction/bid)=${startbid})
same => n,Playback(queue-thankyou)
; Close bidding
exten => 92,1,Answer()
same => n,Wait(0.5)
same => n,Set(DB(auction/open)=0)
same => n,Playback(queue-thankyou)
same => n,Hangup()
[to-eventphone] [to-eventphone]
exten => _X.,1,SET(CALLERID(all)="Teleshop" <7467>) exten => _X.,1,SET(CALLERID(all)="Teleshop" <7467>)
same => n,Dial(SIP/${EXTEN}@eventphone) same => n,Dial(SIP/${EXTEN}@eventphone)