def managerCB(): response = VoiceResponse() response.dial(owner_number, timeout=30, action=url_for('ownerCB', _scheme='http', _external=True), method="POST") return response
def _forotherquery(): response = VoiceResponse() response.dial(reception_number, timeout=30, action=url_for('receptionCB', _scheme='http', _external=True), method="POST") return response
def _loyality_point(customer_number): response = VoiceResponse() req_body = { 'customer_key': customer_key, 'merchant_id': merchant_id, 'customer_mobile': customer_number } my_headers = { 'x-api-key': x_api_key, 'Content-Type': 'application/json', 'Accept': 'application/json' } custresp = requests.get(customer_check_url, headers=my_headers, json=req_body) if (response.status_code == 200): response.say("Your loyality points are " + response.json().response.details.currentpoints, voice="alice", language="en-GB") # Code here will only run if the request is successful else: response.say("To get to _loyality_point, please visit our website", voice="alice", language="en-GB") response.hangup() return response
def _tableservationtime_tomorrow(): response = VoiceResponse() with response.gather(numDigits=1, action=url_for('tableservationtimetomorrow', _scheme='http', _external=True), method="POST") as g: g.say("Press 1 for breakfast, press 2 for lunch, press 3 for dinner", voice="alice", language="en-GB", loop=3) return response
def _tablereservation(): response = VoiceResponse() with response.gather(numDigits=1, action=url_for('reservation_day', _scheme='http', _external=True), method="POST") as g: g.say("Press 1 for today " + "Press 2 for tomorrow " + "To go back to the main menu " + " press the star key.", voice="alice", language="en-GB", loop=3) return response
def welcome(): response = VoiceResponse() with response.gather(num_digits=1, action=url_for('welcomeCB', _scheme='http', _external=True), method="POST") as g: g.say(message= "Thanks for calling Kolkata Mix Tape E T Phone Home Service. " + "Please press 1 for Table reservation." + "Press 2 for your loyality point." + "Press 2 for any other query.", loop=3) return tiniyoml(response)
def _redirect_welcome(): response = VoiceResponse() response.say("No Digit received. Returning to the main menu", voice="alice", language="en-GB") response.redirect(url_for('welcome', _scheme='http', _external=True)) return tiniyoml(response)
def _redirect_confirmation(time, customer_number): response = VoiceResponse() response.say("Your reservation is successfully booked for " + time + ". You will received sms shortly", voice="alice", language="en-GB") response.say("Good Bye", voice="alice", language="en-GB") client = Client(auth_id, auth_secret) # Send SMS to customer of confirmation. message = client.messages.create( body="Your reservation is successfully booked for " + time + ".", from_=sender_id, to=customer_number) return tiniyoml(response)