Created
August 8, 2020 11:28
-
-
Save nimishbongale/19d269e3222165da8f6789effcefb2c1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Age/Gender/Area | |
| # Financial/Health/Agricultural/Defence | |
| import os | |
| from flask import Flask,request | |
| from twilio.twiml.voice_response import VoiceResponse,Gather | |
| from twilio.rest import Client | |
| import requests | |
| app = Flask(__name__) | |
| url1 = '' | |
| en = { | |
| 'message0': 'Welcome to Civis Helpline', | |
| 'message1':'Please enter your pincode.', | |
| 'message2':'Press one to give feedback on Financial policies. Press two to give feedback on health policies. Press three to give feedback on Agricultural Policies near you. Press four to give feedback on Defence Policies near you. Press five to know about various schemes', | |
| 'message3': 'Press one to know about Financial schemes. Press two to know about Health schemes. Press three to know about Agricultural schemes. Press four to know about Defence schemes.', | |
| 'message4': 'Thank you for choosing financial schemes.', | |
| 'message5': 'Thank you for choosing health schemes', | |
| 'msg5': 'Thank you for choosing Agricultural schemes', | |
| 'msg6': 'Thank you for choosing Defence schemes', | |
| 'message6': 'If you are from rural india and your gender is male, press one', | |
| 'message7': 'If you are from rural india and your gender is female press two', | |
| 'message8': 'If you are from urban india and you gender is male press three', | |
| 'message9': 'If you are from urban india and your gender is female press four', | |
| 'message10': 'Sorry, I did not understand your choice.', | |
| 'message11': 'Thank you for your selection.', | |
| 'message12': 'How old are you?', | |
| 'message13': 'Thank you for telling us your age.', | |
| 'message19': 'Annapurna Yojna Policy', | |
| 'message20': 'Central Welfare Policy', | |
| 'message21':'Prime Minister Currency Scheme Policy', | |
| 'message22': 'Prime Minister Jeevan Jyoti Insurance Policy', | |
| 'message14': 'Please tell your PINCODE', | |
| 'message15': 'Thank you for telling the PINCODE', | |
| 'message16': 'Pradhan Mantri Jan Dhan Yojana.', | |
| 'message17':'National secondary education campaign', | |
| 'message18': 'Atal Pension Yojna.', | |
| 'message23': 'Indira Gandhi National Old Age Pension Policy', | |
| 'message24': 'Prime Minister Kisan Pension Policy', | |
| 'message25': 'Pradhan Mantri Jan Arogya Yojana', | |
| 'message26': 'National Health Insurance Policy', | |
| 'message27': 'Aam Aadmi Insurance Policy', | |
| 'message28': 'National Health Insurance Policy', | |
| 'message29': 'Prime Minister Jan Aushadhi Policy', | |
| 'message31': 'two', | |
| 'message32': 'three', | |
| 'message30': 'one', | |
| 'message31': 'Thank you for choosing Financial Policies', | |
| 'message32': 'Thank you for choosing Health Policies', | |
| 'message33': 'Thank you for choosing Agricultural Policies', | |
| 'message34': 'Thank you for choosing Defence Policies', | |
| 'message35': 'Thank you for choosing Scheme information', | |
| 'message40': 'The three latest schemes you can comment upon are the following', | |
| 'message41': 'Thank you for contacting us. We hope to serve you in future!', | |
| 'message42': 'Please give us a minute while we do the necessary setup', | |
| 'message43': 'Here are the policies for you to comment upon', | |
| 'message44': 'Press 1 if you are in agreement, Press 2 if you are in opposition, Press 3 if you are neutral', | |
| 'message45': 'Press 1 if you think it could be implemented better, Press 2 if you think it needs to be scrapped', | |
| 'message46': 'Please give a rating from 1 to 5' | |
| } | |
| #To be changed with hindi strings. | |
| hi = {} | |
| # Change this to english tamil strings. | |
| ta = {} | |
| # Change this to english kannada strings. | |
| kn = {} | |
| @app.route('/') | |
| def index(): | |
| return "Welcome to Civis 24/7 Helpline" | |
| @app.route("/makeACall/<phoneNo>",methods=['GET']) | |
| def makeCall(phoneNo): | |
| account_sid = 'AC63307fff7d6088ec61dd563aa8974597' | |
| auth_token = '324512a5713e65838ddd88e6f93c054e' | |
| client = Client(account_sid, auth_token) | |
| toPhoneNo = '+91'+phoneNo | |
| try: | |
| call = client.calls.create( | |
| url='https://jandhan2voice.herokuapp.com/answer', | |
| to=toPhoneNo, | |
| from_='+12054489824' | |
| ) | |
| return "Success" | |
| except: | |
| return "Failure" | |
| @app.route("/answer", methods=['GET', 'POST']) | |
| def gatherLanguage(): | |
| resp = VoiceResponse() | |
| resp.say('Press one for English, Press two for Hindi, Press three for Kannada and Press four for Tamil.', voice='Polly.Aditi',language="hi-IN") | |
| gather = Gather(num_digits=1, action='/gatherPincode') | |
| resp.append(gather) | |
| return str(resp) | |
| @app.route('/gatherPincode',methods=['GET','POST']) | |
| def gatherPincode(): | |
| resp = VoiceResponse() | |
| if 'Digits' in request.values: | |
| language = request.values['Digits'] | |
| if language == '1' or language == '2' or language == '3' or language == '4': | |
| resp.say(en['message0'],voice='Polly.Aditi',language="hi-IN") | |
| resp.say(en['message1'], voice='Polly.Aditi',language="hi-IN") | |
| gather = Gather(num_digits=6, action='/gatherChoice/'+language) | |
| resp.append(gather) | |
| elif language == '2': | |
| resp.say(hi['message0'],voice='Polly.Aditi',language="hi-IN") | |
| resp.say(hi['message1'], voice='Polly.Aditi',language="hi-IN") | |
| gather = Gather(num_digits=6, action='/gatherChoice/'+language) | |
| resp.append(gather) | |
| elif language == '3': | |
| resp.say(kn['message0'],voice='Polly.Aditi',language="kn-IN") | |
| resp.say(kn['message1'], voice='Polly.Aditi',language="hi-IN") | |
| gather = Gather(num_digits=6, action='/gatherChoice/'+language) | |
| resp.append(gather) | |
| elif language == '4': | |
| resp.say(ta['message0'],voice='Polly.Aditi',language="hi-IN") | |
| resp.say(ta['message1'], voice='Polly.Aditi',language="hi-IN") | |
| gather = Gather(num_digits=6, action='/gatherChoice/'+language) | |
| resp.append(gather) | |
| else: | |
| resp.redirect('/answer') | |
| else: | |
| resp.redirect('/answer') | |
| return str(resp) | |
| @app.route('/gatherChoice/<language>', methods=['GET', 'POST']) | |
| def gatherChoice(language): | |
| resp = VoiceResponse() | |
| if 'Digits' in request.values: | |
| choice = request.values['Digits'] | |
| if language == '1': | |
| gather = Gather(num_digits=1, action='/gatherData/'+language + '/'+choice) | |
| gather.say(en['message2'],voice='Polly.Aditi',language="hi-IN") | |
| resp.append(gather) | |
| elif language == '2': | |
| gather = Gather(num_digits=1, action='/gatherData/'+language + '/'+choice) | |
| gather.say(hi['message2'],voice='Polly.Aditi',language="hi-IN") | |
| resp.append(gather) | |
| elif language == '3': | |
| gather = Gather(num_digits=1, action='/gatherData/'+language + '/'+choice) | |
| gather.say(kn['message2'],voice='Polly.Aditi',language="hi-IN") | |
| resp.append(gather) | |
| elif language == '4': | |
| gather = Gather(num_digits=1, action='/gatherData/'+language + '/'+choice) | |
| gather.say(ta['message2'],voice='Polly.Aditi',language="hi-IN") | |
| resp.append(gather) | |
| return str(resp) | |
| @app.route('/gatherData/<language>/<pincode>', methods=['GET', 'POST']) | |
| def gatherData(language,pincode): | |
| response = requests.get('https://maps.googleapis.com/maps/api/geocode/json?address='+pincode+'&sensor=true&key=AIzaSyCILGP87TZPkXUobQfqDp9mkPA7IXnEGXU') | |
| ans = response.json() | |
| lat,long = ans['results'][0]['geometry']['location']['lat'],ans['results'][0]['geometry']['location']['lng'] | |
| lat = str(lat) | |
| long = str(long) | |
| resp = VoiceResponse() | |
| if 'Digits' in request.values: | |
| menuItem = request.values['Digits'] | |
| if language == '1': | |
| if menuItem == '1': | |
| resp.say(en['message42'],voice='Polly.Aditi',language="hi-IN") | |
| response = requests.get('https://maps.googleapis.com/maps/api/place/nearbysearch/json?location='+lat+','+long+'&type=atm&rankby=distance&fields=name,rating&key=AIzaSyCILGP87TZPkXUobQfqDp9mkPA7IXnEGXU') | |
| ans = response.json() | |
| name1,place1 = ans['results'][0]['name'],ans['results'][0]['vicinity'] | |
| name2,place2 = ans['results'][1]['name'],ans['results'][1]['vicinity'] | |
| name3,place3 = ans['results'][2]['name'],ans['results'][2]['vicinity'] | |
| resp.say(en['message43'],voice='Polly.Aditi',language="hi-IN") | |
| resp.say('1'+name1+', '+place1,voice='Polly.Aditi',language="hi-IN") | |
| resp.say('2'+name2+', '+place2,voice='Polly.Aditi',language="hi-IN") | |
| resp.say('3'+name3+', '+place3,voice='Polly.Aditi',language="hi-IN") | |
| resp.say(en['message41'],voice='Polly.Aditi',language="hi-IN") | |
| elif menuItem == '2': | |
| resp.say(en['message42'],voice='Polly.Aditi',language="hi-IN") | |
| response = requests.get('https://maps.googleapis.com/maps/api/place/nearbysearch/json?location='+lat+','+long+'&type=bank&rankby=distance&fields=name,rating&key=AIzaSyCILGP87TZPkXUobQfqDp9mkPA7IXnEGXU') | |
| ans = response.json() | |
| name1,place1 = ans['results'][0]['name'],ans['results'][0]['vicinity'] | |
| name2,place2 = ans['results'][1]['name'],ans['results'][1]['vicinity'] | |
| name3,place3 = ans['results'][2]['name'],ans['results'][2]['vicinity'] | |
| resp.say(en['message43'],voice='Polly.Aditi',language="hi-IN") | |
| resp.say('1'+name1+', '+place1,voice='Polly.Aditi',language="hi-IN") | |
| resp.say('2'+name2+', '+place2,voice='Polly.Aditi',language="hi-IN") | |
| resp.say('3'+name3+', '+place3,voice='Polly.Aditi',language="hi-IN") | |
| resp.say(en['message41'],voice='Polly.Aditi',language="hi-IN") | |
| pass | |
| elif menuItem == '3': | |
| resp.say(en['message42'],voice='Polly.Aditi',language="hi-IN") | |
| response = requests.get('https://maps.googleapis.com/maps/api/place/nearbysearch/json?location='+lat+','+long+'&type=post_office&rankby=distance&fields=name,rating&key=AIzaSyCILGP87TZPkXUobQfqDp9mkPA7IXnEGXU') | |
| ans = response.json() | |
| name1,place1 = ans['results'][0]['name'],ans['results'][0]['vicinity'] | |
| name2,place2 = ans['results'][1]['name'],ans['results'][1]['vicinity'] | |
| name3,place3 = ans['results'][2]['name'],ans['results'][2]['vicinity'] | |
| resp.say(en['message43'],voice='Polly.Aditi',language="hi-IN") | |
| resp.say('1'+name1+', '+place1,voice='Polly.Aditi',language="hi-IN") | |
| resp.say('2'+name2+', '+place2,voice='Polly.Aditi',language="hi-IN") | |
| resp.say('3'+name3+', '+place3,voice='Polly.Aditi',language="hi-IN") | |
| resp.say(en['message41'],voice='Polly.Aditi',language="hi-IN") | |
| elif menuItem == '4': | |
| resp.say(en['message42'],voice='Polly.Aditi',language="hi-IN") | |
| response = requests.get('https://maps.googleapis.com/maps/api/place/nearbysearch/json?location='+lat+','+long+'&type=bm&rankby=distance&fields=name,rating&key=AIzaSyCILGP87TZPkXUobQfqDp9mkPA7IXnEGXU') | |
| ans = response.json() | |
| name1,place1 = ans['results'][0]['name'],ans['results'][0]['vicinity'] | |
| name2,place2 = ans['results'][1]['name'],ans['results'][1]['vicinity'] | |
| name3,place3 = ans['results'][2]['name'],ans['results'][2]['vicinity'] | |
| resp.say(en['message43'],voice='Polly.Aditi',language="hi-IN") | |
| resp.say('1'+name1+', '+place1,voice='Polly.Aditi',language="hi-IN") | |
| resp.say('2'+name2+', '+place2,voice='Polly.Aditi',language="hi-IN") | |
| resp.say('3'+name3+', '+place3,voice='Polly.Aditi',language="hi-IN") | |
| resp.say(en['message41'],voice='Polly.Aditi',language="hi-IN") | |
| message = name1+ " "+ place1 + "\n"+ name2+ " "+ place2 + "\n"+ name3+ " "+ place3 + "\n" | |
| requests.post(url1,{"message":message,"caller":request.values['Caller']}) | |
| pass | |
| elif menuItem == '5': | |
| resp.say(en['message35'],voice='Polly.Aditi',language="hi-IN") | |
| resp.say(en['message3'],voice='Polly.Aditi',language="hi-IN") | |
| url = '/gatherScheme/'+language | |
| gather = Gather(num_digits=1, action=url) | |
| resp.append(gather) | |
| resp.redirect('/answer') | |
| elif language == '2': | |
| if menuItem == '1': | |
| resp.say(hi['message42'],voice='Polly.Aditi',language="hi-IN") | |
| response = requests.get('https://maps.googleapis.com/maps/api/place/nearbysearch/json?location='+lat+','+long+'&type=atm&rankby=distance&fields=name,rating&key=AIzaSyCILGP87TZPkXUobQfqDp9mkPA7IXnEGXU') | |
| ans = response.json() | |
| name1,place1 = ans['results'][0]['name'],ans['results'][0]['vicinity'] | |
| name2,place2 = ans['results'][1]['name'],ans['results'][1]['vicinity'] | |
| name3,place3 = ans['results'][2]['name'],ans['results'][2]['vicinity'] | |
| resp.say(hi['message43'],voice='Polly.Aditi',language="hi-IN") | |
| resp.say('1'+name1+', '+place1,voice='Polly.Aditi',language="hi-IN") | |
| resp.say('2'+name2+', '+place2,voice='Polly.Aditi',language="hi-IN") | |
| resp.say('3'+name3+', '+place3,voice='Polly.Aditi',language="hi-IN") | |
| resp.say(hi['message41'],voice='Polly.Aditi',language="hi-IN") | |
| elif menuItem == '2': | |
| resp.say(hi['message42'],voice='Polly.Aditi',language="hi-IN") | |
| response = requests.get('https://maps.googleapis.com/maps/api/place/nearbysearch/json?location='+lat+','+long+'&type=bank&rankby=distance&fields=name,rating&key=AIzaSyCILGP87TZPkXUobQfqDp9mkPA7IXnEGXU') | |
| ans = response.json() | |
| name1,place1 = ans['results'][0]['name'],ans['results'][0]['vicinity'] | |
| name2,place2 = ans['results'][1]['name'],ans['results'][1]['vicinity'] | |
| name3,place3 = ans['results'][2]['name'],ans['results'][2]['vicinity'] | |
| resp.say(hi['message43'],voice='Polly.Aditi',language="hi-IN") | |
| resp.say('1'+name1+', '+place1,voice='Polly.Aditi',language="hi-IN") | |
| resp.say('2'+name2+', '+place2,voice='Polly.Aditi',language="hi-IN") | |
| resp.say('3'+name3+', '+place3,voice='Polly.Aditi',language="hi-IN") | |
| resp.say(hi['message41'],voice='Polly.Aditi',language="hi-IN") | |
| pass | |
| elif menuItem == '3': | |
| resp.say(hi['message42'],voice='Polly.Aditi',language="hi-IN") | |
| response = requests.get('https://maps.googleapis.com/maps/api/place/nearbysearch/json?location='+lat+','+long+'&type=post_office&rankby=distance&fields=name,rating&key=AIzaSyCILGP87TZPkXUobQfqDp9mkPA7IXnEGXU') | |
| ans = response.json() | |
| name1,place1 = ans['results'][0]['name'],ans['results'][0]['vicinity'] | |
| name2,place2 = ans['results'][1]['name'],ans['results'][1]['vicinity'] | |
| name3,place3 = ans['results'][2]['name'],ans['results'][2]['vicinity'] | |
| resp.say(hi['message43'],voice='Polly.Aditi',language="hi-IN") | |
| resp.say('1'+name1+', '+place1,voice='Polly.Aditi',language="hi-IN") | |
| resp.say('2'+name2+', '+place2,voice='Polly.Aditi',language="hi-IN") | |
| resp.say('3'+name3+', '+place3,voice='Polly.Aditi',language="hi-IN") | |
| resp.say(hi['message41'],voice='Polly.Aditi',language="hi-IN") | |
| elif menuItem == '4': | |
| resp.say(hi['message42'],voice='Polly.Aditi',language="hi-IN") | |
| response = requests.get('https://maps.googleapis.com/maps/api/place/nearbysearch/json?location='+lat+','+long+'&type=bm&rankby=distance&fields=name,rating&key=AIzaSyCILGP87TZPkXUobQfqDp9mkPA7IXnEGXU') | |
| ans = response.json() | |
| name1,place1 = ans['results'][0]['name'],ans['results'][0]['vicinity'] | |
| name2,place2 = ans['results'][1]['name'],ans['results'][1]['vicinity'] | |
| name3,place3 = ans['results'][2]['name'],ans['results'][2]['vicinity'] | |
| resp.say(hi['message43'],voice='Polly.Aditi',language="hi-IN") | |
| resp.say('1'+name1+', '+place1,voice='Polly.Aditi',language="hi-IN") | |
| resp.say('2'+name2+', '+place2,voice='Polly.Aditi',language="hi-IN") | |
| resp.say('3'+name3+', '+place3,voice='Polly.Aditi',language="hi-IN") | |
| resp.say(hi['message41'],voice='Polly.Aditi',language="hi-IN") | |
| message = name1+ " "+ place1 + "\n"+ name2+ " "+ place2 + "\n"+ name3+ " "+ place3 + "\n" | |
| requests.post(url1,{"message":message,"caller":request.values['Caller']}) | |
| pass | |
| elif menuItem == '5': | |
| resp.say(hi['message35'],voice='Polly.Aditi',language="hi-IN") | |
| resp.say(hi['message3'],voice='Polly.Aditi',language="hi-IN") | |
| url = '/gatherScheme/'+language | |
| gather = Gather(num_digits=1, action=url) | |
| resp.append(gather) | |
| resp.redirect('/answer') | |
| elif language == '3': | |
| if menuItem == '1': | |
| resp.say(kn['message42'],voice='Polly.Aditi',language="hi-IN") | |
| response = requests.get('https://maps.googleapis.com/maps/api/place/nearbysearch/json?location='+lat+','+long+'&type=atm&rankby=distance&fields=name,rating&key=AIzaSyCILGP87TZPkXUobQfqDp9mkPA7IXnEGXU') | |
| ans = response.json() | |
| name1,place1 = ans['results'][0]['name'],ans['results'][0]['vicinity'] | |
| name2,place2 = ans['results'][1]['name'],ans['results'][1]['vicinity'] | |
| name3,place3 = ans['results'][2]['name'],ans['results'][2]['vicinity'] | |
| resp.say(kn['message43'],voice='Polly.Aditi',language="hi-IN") | |
| resp.say('1'+name1+', '+place1,voice='Polly.Aditi',language="hi-IN") | |
| resp.say('2'+name2+', '+place2,voice='Polly.Aditi',language="hi-IN") | |
| resp.say('3'+name3+', '+place3,voice='Polly.Aditi',language="hi-IN") | |
| resp.say(kn['message41'],voice='Polly.Aditi',language="hi-IN") | |
| elif menuItem == '2': | |
| resp.say(kn['message42'],voice='Polly.Aditi',language="hi-IN") | |
| response = requests.get('https://maps.googleapis.com/maps/api/place/nearbysearch/json?location='+lat+','+long+'&type=bank&rankby=distance&fields=name,rating&key=AIzaSyCILGP87TZPkXUobQfqDp9mkPA7IXnEGXU') | |
| ans = response.json() | |
| name1,place1 = ans['results'][0]['name'],ans['results'][0]['vicinity'] | |
| name2,place2 = ans['results'][1]['name'],ans['results'][1]['vicinity'] | |
| name3,place3 = ans['results'][2]['name'],ans['results'][2]['vicinity'] | |
| resp.say(kn['message43'],voice='Polly.Aditi',language="hi-IN") | |
| resp.say('1'+name1+', '+place1,voice='Polly.Aditi',language="hi-IN") | |
| resp.say('2'+name2+', '+place2,voice='Polly.Aditi',language="hi-IN") | |
| resp.say('3'+name3+', '+place3,voice='Polly.Aditi',language="hi-IN") | |
| resp.say(kn['message41'],voice='Polly.Aditi',language="hi-IN") | |
| pass | |
| elif menuItem == '3': | |
| resp.say(kn['message42'],voice='Polly.Aditi',language="hi-IN") | |
| response = requests.get('https://maps.googleapis.com/maps/api/place/nearbysearch/json?location='+lat+','+long+'&type=post_office&rankby=distance&fields=name,rating&key=AIzaSyCILGP87TZPkXUobQfqDp9mkPA7IXnEGXU') | |
| ans = response.json() | |
| name1,place1 = ans['results'][0]['name'],ans['results'][0]['vicinity'] | |
| name2,place2 = ans['results'][1]['name'],ans['results'][1]['vicinity'] | |
| name3,place3 = ans['results'][2]['name'],ans['results'][2]['vicinity'] | |
| resp.say(kn['message43'],voice='Polly.Aditi',language="hi-IN") | |
| resp.say('1'+name1+', '+place1,voice='Polly.Aditi',language="hi-IN") | |
| resp.say('2'+name2+', '+place2,voice='Polly.Aditi',language="hi-IN") | |
| resp.say('3'+name3+', '+place3,voice='Polly.Aditi',language="hi-IN") | |
| resp.say(kn['message41'],voice='Polly.Aditi',language="hi-IN") | |
| elif menuItem == '4': | |
| resp.say(kn['message42'],voice='Polly.Aditi',language="hi-IN") | |
| response = requests.get('https://maps.googleapis.com/maps/api/place/nearbysearch/json?location='+lat+','+long+'&type=bm&rankby=distance&fields=name,rating&key=AIzaSyCILGP87TZPkXUobQfqDp9mkPA7IXnEGXU') | |
| ans = response.json() | |
| name1,place1 = ans['results'][0]['name'],ans['results'][0]['vicinity'] | |
| name2,place2 = ans['results'][1]['name'],ans['results'][1]['vicinity'] | |
| name3,place3 = ans['results'][2]['name'],ans['results'][2]['vicinity'] | |
| resp.say(kn['message43'],voice='Polly.Aditi',language="hi-IN") | |
| resp.say('1'+name1+', '+place1,voice='Polly.Aditi',language="hi-IN") | |
| resp.say('2'+name2+', '+place2,voice='Polly.Aditi',language="hi-IN") | |
| resp.say('3'+name3+', '+place3,voice='Polly.Aditi',language="hi-IN") | |
| resp.say(kn['message41'],voice='Polly.Aditi',language="hi-IN") | |
| message = name1+ " "+ place1 + "\n"+ name2+ " "+ place2 + "\n"+ name3+ " "+ place3 + "\n" | |
| requests.post(url1,{"message":message,"caller":request.values['Caller']}) | |
| pass | |
| elif menuItem == '5': | |
| resp.say(kn['message35'],voice='Polly.Aditi',language="hi-IN") | |
| resp.say(kn['message3'],voice='Polly.Aditi',language="hi-IN") | |
| url = '/gatherScheme/'+language | |
| gather = Gather(num_digits=1, action=url) | |
| resp.append(gather) | |
| resp.redirect('/answer') | |
| elif language == '4': | |
| if menuItem == '1': | |
| resp.say(ta['message42'],voice='Polly.Aditi',language="hi-IN") | |
| response = requests.get('https://maps.googleapis.com/maps/api/place/nearbysearch/json?location='+lat+','+long+'&type=atm&rankby=distance&fields=name,rating&key=AIzaSyCILGP87TZPkXUobQfqDp9mkPA7IXnEGXU') | |
| ans = response.json() | |
| name1,place1 = ans['results'][0]['name'],ans['results'][0]['vicinity'] | |
| name2,place2 = ans['results'][1]['name'],ans['results'][1]['vicinity'] | |
| name3,place3 = ans['results'][2]['name'],ans['results'][2]['vicinity'] | |
| resp.say(ta['message43'],voice='Polly.Aditi',language="hi-IN") | |
| resp.say('1'+name1+', '+place1,voice='Polly.Aditi',language="hi-IN") | |
| resp.say('2'+name2+', '+place2,voice='Polly.Aditi',language="hi-IN") | |
| resp.say('3'+name3+', '+place3,voice='Polly.Aditi',language="hi-IN") | |
| resp.say(ta['message41'],voice='Polly.Aditi',language="hi-IN") | |
| elif menuItem == '2': | |
| resp.say(ta['message42'],voice='Polly.Aditi',language="hi-IN") | |
| response = requests.get('https://maps.googleapis.com/maps/api/place/nearbysearch/json?location='+lat+','+long+'&type=bank&rankby=distance&fields=name,rating&key=AIzaSyCILGP87TZPkXUobQfqDp9mkPA7IXnEGXU') | |
| ans = response.json() | |
| name1,place1 = ans['results'][0]['name'],ans['results'][0]['vicinity'] | |
| name2,place2 = ans['results'][1]['name'],ans['results'][1]['vicinity'] | |
| name3,place3 = ans['results'][2]['name'],ans['results'][2]['vicinity'] | |
| resp.say(ta['message43'],voice='Polly.Aditi',language="hi-IN") | |
| resp.say('1'+name1+', '+place1,voice='Polly.Aditi',language="hi-IN") | |
| resp.say('2'+name2+', '+place2,voice='Polly.Aditi',language="hi-IN") | |
| resp.say('3'+name3+', '+place3,voice='Polly.Aditi',language="hi-IN") | |
| resp.say(ta['message41'],voice='Polly.Aditi',language="hi-IN") | |
| pass | |
| elif menuItem == '3': | |
| resp.say(ta['message42'],voice='Polly.Aditi',language="hi-IN") | |
| response = requests.get('https://maps.googleapis.com/maps/api/place/nearbysearch/json?location='+lat+','+long+'&type=post_office&rankby=distance&fields=name,rating&key=AIzaSyCILGP87TZPkXUobQfqDp9mkPA7IXnEGXU') | |
| ans = response.json() | |
| name1,place1 = ans['results'][0]['name'],ans['results'][0]['vicinity'] | |
| name2,place2 = ans['results'][1]['name'],ans['results'][1]['vicinity'] | |
| name3,place3 = ans['results'][2]['name'],ans['results'][2]['vicinity'] | |
| resp.say(ta['message43'],voice='Polly.Aditi',language="hi-IN") | |
| resp.say('1'+name1+', '+place1,voice='Polly.Aditi',language="hi-IN") | |
| resp.say('2'+name2+', '+place2,voice='Polly.Aditi',language="hi-IN") | |
| resp.say('3'+name3+', '+place3,voice='Polly.Aditi',language="hi-IN") | |
| resp.say(ta['message41'],voice='Polly.Aditi',language="hi-IN") | |
| elif menuItem == '4': | |
| resp.say(ta['message42'],voice='Polly.Aditi',language="hi-IN") | |
| response = requests.get('https://maps.googleapis.com/maps/api/place/nearbysearch/json?location='+lat+','+long+'&type=bm&rankby=distance&fields=name,rating&key=AIzaSyCILGP87TZPkXUobQfqDp9mkPA7IXnEGXU') | |
| ans = response.json() | |
| name1,place1 = ans['results'][0]['name'],ans['results'][0]['vicinity'] | |
| name2,place2 = ans['results'][1]['name'],ans['results'][1]['vicinity'] | |
| name3,place3 = ans['results'][2]['name'],ans['results'][2]['vicinity'] | |
| resp.say(ta['message43'],voice='Polly.Aditi',language="hi-IN") | |
| resp.say('1 '+name1+', '+place1,voice='Polly.Aditi',language="hi-IN") | |
| resp.say('2'+name2+', '+place2,voice='Polly.Aditi',language="hi-IN") | |
| resp.say('3'+name3+', '+place3,voice='Polly.Aditi',language="hi-IN") | |
| resp.say(ta['message41'],voice='Polly.Aditi',language="hi-IN") | |
| message = name1+ " "+ place1 + "\n"+ name2+ " "+ place2 + "\n"+ name3+ " "+ place3 + "\n" | |
| requests.post(url1,{"message":message,"caller":request.values['Caller']}) | |
| elif menuItem == '5': | |
| resp.say(ta['message35'],voice='Polly.Aditi',language="hi-IN") | |
| resp.say(ta['message3'],voice='Polly.Aditi',language="hi-IN") | |
| url = '/gatherScheme/'+language | |
| gather = Gather(num_digits=1, action=url) | |
| resp.append(gather) | |
| resp.redirect('/answer') | |
| return str(resp) | |
| @app.route('/gatherScheme/<language>',methods=['GET','POST']) | |
| def gatherScheme(language): | |
| resp = VoiceResponse() | |
| if 'Digits' in request.values: | |
| schemeType = request.values['Digits'] | |
| if language == '1': | |
| if schemeType == '1': | |
| resp.say(en['message4'],voice='Polly.Aditi',language="hi-IN") | |
| resp.say(en['message6'],voice='Polly.Aditi',language="hi-IN") | |
| resp.say(en['message7'],voice='Polly.Aditi',language="hi-IN") | |
| resp.say(en['message8'],voice='Polly.Aditi',language="hi-IN") | |
| resp.say(en['message9'],voice='Polly.Aditi',language="hi-IN") | |
| url = '/gatherStatus/'+language + '/'+schemeType; | |
| gather = Gather(num_digits=1, action=url) | |
| resp.append(gather) | |
| else: | |
| resp.say(en['message5'],voice='Polly.Aditi',language="hi-IN") | |
| resp.say(en['message6'],voice='Polly.Aditi',language="hi-IN") | |
| resp.say(en['message7'],voice='Polly.Aditi',language="hi-IN") | |
| resp.say(en['message8'],voice='Polly.Aditi',language="hi-IN") | |
| resp.say(en['message9'],voice='Polly.Aditi',language="hi-IN") | |
| url = '/gatherStatus/'+language + '/'+schemeType; | |
| gather = Gather(num_digits=1, action=url) | |
| resp.append(gather) | |
| elif language == '2': | |
| if schemeType == '1': | |
| resp.say(hi['message4'],voice='Polly.Aditi',language="hi-IN") | |
| resp.say(hi['message6'],voice='Polly.Aditi',language="hi-IN") | |
| resp.say(hi['message7'],voice='Polly.Aditi',language="hi-IN") | |
| resp.say(hi['message8'],voice='Polly.Aditi',language="hi-IN") | |
| resp.say(hi['message9'],voice='Polly.Aditi',language="hi-IN") | |
| url = '/gatherStatus/'+language + '/'+schemeType; | |
| gather = Gather(num_digits=1, action=url) | |
| resp.append(gather) | |
| else: | |
| resp.say(hi['message5'],voice='Polly.Aditi',language="hi-IN") | |
| resp.say(hi['message6'],voice='Polly.Aditi',language="hi-IN") | |
| resp.say(hi['message7'],voice='Polly.Aditi',language="hi-IN") | |
| resp.say(hi['message8'],voice='Polly.Aditi',language="hi-IN") | |
| resp.say(hi['message9'],voice='Polly.Aditi',language="hi-IN") | |
| url = '/gatherStatus/'+language + '/'+schemeType; | |
| gather = Gather(num_digits=1, action=url) | |
| resp.append(gather) | |
| elif language == '3': | |
| if schemeType == '1': | |
| resp.say(kn['message4'],voice='Polly.Aditi',language="hi-IN") | |
| resp.say(kn['message6'],voice='Polly.Aditi',language="hi-IN") | |
| resp.say(kn['message7'],voice='Polly.Aditi',language="hi-IN") | |
| resp.say(kn['message8'],voice='Polly.Aditi',language="hi-IN") | |
| resp.say(kn['message9'],voice='Polly.Aditi',language="hi-IN") | |
| url = '/gatherStatus/'+language + '/'+schemeType; | |
| gather = Gather(num_digits=1, action=url) | |
| resp.append(gather) | |
| else: | |
| resp.say(kn['message5'],voice='Polly.Aditi',language="hi-IN") | |
| resp.say(kn['message6'],voice='Polly.Aditi',language="hi-IN") | |
| resp.say(kn['message7'],voice='Polly.Aditi',language="hi-IN") | |
| resp.say(kn['message8'],voice='Polly.Aditi',language="hi-IN") | |
| resp.say(kn['message9'],voice='Polly.Aditi',language="hi-IN") | |
| url = '/gatherStatus/'+language + '/'+schemeType; | |
| gather = Gather(num_digits=1, action=url) | |
| resp.append(gather) | |
| elif language == '4': | |
| if schemeType == '1': | |
| resp.say(ta['message4'],voice='Polly.Aditi',language="hi-IN") | |
| resp.say(ta['message6'],voice='Polly.Aditi',language="hi-IN") | |
| resp.say(ta['message7'],voice='Polly.Aditi',language="hi-IN") | |
| resp.say(ta['message8'],voice='Polly.Aditi',language="hi-IN") | |
| resp.say(ta['message9'],voice='Polly.Aditi',language="hi-IN") | |
| url = '/gatherStatus/'+language + '/'+schemeType; | |
| gather = Gather(num_digits=1, action=url) | |
| resp.append(gather) | |
| else: | |
| resp.say(ta['message5'],voice='Polly.Aditi',language="hi-IN") | |
| resp.say(ta['message6'],voice='Polly.Aditi',language="hi-IN") | |
| resp.say(ta['message7'],voice='Polly.Aditi',language="hi-IN") | |
| resp.say(ta['message8'],voice='Polly.Aditi',language="hi-IN") | |
| resp.say(ta['message9'],voice='Polly.Aditi',language="hi-IN") | |
| url = '/gatherStatus/'+language + '/'+schemeType; | |
| gather = Gather(num_digits=1, action=url) | |
| resp.append(gather) | |
| else: | |
| resp.say(en['message10'],voice='Polly.Aditi',language="hi-IN") | |
| resp.redirect('/answer') | |
| return str(resp) | |
| @app.route('/gatherStatus/<language>/<schemeChoice>',methods=['GET', 'POST']) | |
| def gatherStatus(language,schemeChoice): | |
| resp = VoiceResponse() | |
| if 'Digits' in request.values: | |
| if language == '1': | |
| resp.say(en['message11'],voice='Polly.Aditi',language="hi-IN") | |
| statusChoice = request.values['Digits'] | |
| url = '/gatherSchemeFinal/'+language + '/' + schemeChoice+'/'+statusChoice | |
| gather = Gather(num_digits=2, action=url) | |
| gather.say(en['message12'],voice='Polly.Aditi',language="hi-IN") | |
| resp.append(gather) | |
| if language == '2': | |
| resp.say(hi['message11'],voice='Polly.Aditi',language="hi-IN") | |
| statusChoice = request.values['Digits'] | |
| url = '/gatherSchemeFinal/'+language + '/' + schemeChoice+'/'+statusChoice | |
| gather = Gather(num_digits=2, action=url) | |
| gather.say(hi['message12'],voice='Polly.Aditi',language="hi-IN") | |
| resp.append(gather) | |
| if language == '3': | |
| resp.say(kn['message11'],voice='Polly.Aditi',language="hi-IN") | |
| statusChoice = request.values['Digits'] | |
| url = '/gatherSchemeFinal/'+language + '/' + schemeChoice+'/'+statusChoice | |
| gather = Gather(num_digits=2, action=url) | |
| gather.say(kn['message12'],voice='Polly.Aditi',language="hi-IN") | |
| resp.append(gather) | |
| if language == '4': | |
| resp.say(ta['message11'],voice='Polly.Aditi',language="hi-IN") | |
| statusChoice = request.values['Digits'] | |
| url = '/gatherSchemeFinal/'+language + '/' + schemeChoice+'/'+statusChoice | |
| gather = Gather(num_digits=2, action=url) | |
| gather.say(ta['message12'],voice='Polly.Aditi',language="hi-IN") | |
| resp.append(gather) | |
| else: | |
| resp.redirect('/answer') | |
| return str(resp) | |
| @app.route('/getFeedback',methods=['GET','POST']) | |
| def getFeedback(): | |
| resp = VoiceResponse() | |
| resp.say(en['message44'],voice='Polly.Aditi',language="hi-IN") | |
| gather = Gather(num_digits=1) | |
| resp.append(gather) | |
| resp.say(en['message45'],voice='Polly.Aditi',language="hi-IN") | |
| gather = Gather(num_digits=1) | |
| resp.append(gather) | |
| resp.say(en['message46'],voice='Polly.Aditi',language="hi-IN") | |
| gather = Gather(num_digits=1) | |
| resp.append(gather) | |
| resp.redirect('/answer') | |
| return str(resp) | |
| @app.route('/gatherSchemeFinal/<language>/<schemeChoice>/<statusChoice>',methods=['GET', 'POST']) | |
| def gatherSchemeFinal(language,schemeChoice,statusChoice): | |
| resp = VoiceResponse() | |
| if 'Digits' in request.values: | |
| age = request.values['Digits'] | |
| age = int(age) | |
| schemeChoice = int(schemeChoice) | |
| statusChoice = int(statusChoice) | |
| if language == '1': | |
| resp.say(en['message13'],voice='Polly.Aditi',language="hi-IN") | |
| resp.say(en['message40'], voice='Polly.Aditi',language="hi-IN") | |
| if(schemeChoice == 1): | |
| if(statusChoice == 1): | |
| if(age < 60): | |
| resp.say('1'+en['message16'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('2'+en['message17'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('3'+en['message18'], voice='Polly.Aditi',language="hi-IN") | |
| else: | |
| resp.say('1'+en['message18'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('2'+en['message16'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('3'+en['message19'], voice='Polly.Aditi',language="hi-IN") | |
| elif(statusChoice == 2): | |
| if(age < 60): | |
| resp.say('1'+en['message17'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('2'+en['message20'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('3'+en['message16'], voice='Polly.Aditi',language="hi-IN") | |
| else: | |
| resp.say('1'+en['message16'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('2'+en['message19'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('3'+en['message18'], voice='Polly.Aditi',language="hi-IN") | |
| elif(statusChoice == 3): | |
| if(age < 60): | |
| resp.say('1'+en['message16'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('2'+en['message21'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('3'+en['message22'], voice='Polly.Aditi',language="hi-IN") | |
| else: | |
| resp.say('1'+en['message23'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('2'+en['message18'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('3'+en['message24'], voice='Polly.Aditi',language="hi-IN") | |
| elif(statusChoice == 4): | |
| if(age < 60): | |
| resp.say('1.'+en['message20'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('2.'+en['message18'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('3.'+en['message21'], voice='Polly.Aditi',language="hi-IN") | |
| else: | |
| resp.say('1.'+en['message23'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('2.'+en['message19'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('3.'+en['message24'], voice='Polly.Aditi',language="hi-IN") | |
| elif(schemeChoice == 2): | |
| if(statusChoice == 1): | |
| if(age < 60): | |
| resp.say('1.'+en['message25'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('2.'+en['message26'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('3.'+en['message27'], voice='Polly.Aditi',language="hi-IN") | |
| else: | |
| resp.say('1.'+en['message25'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('2.'+en['message28'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('3.'+en['message27'], voice='Polly.Aditi',language="hi-IN") | |
| elif(statusChoice == 2): | |
| if(age < 60): | |
| resp.say('1'+en['message25'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('2'+en['message26'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('3'+en['message29'], voice='Polly.Aditi',language="hi-IN") | |
| else: | |
| resp.say('1'+en['message28'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('2'+en['message26'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('3'+en['message27'], voice='Polly.Aditi',language="hi-IN") | |
| elif(statusChoice == 3): | |
| if(age < 60): | |
| resp.say('1'+en['message25'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('2'+en['message26'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('3'+en['message29'], voice='Polly.Aditi',language="hi-IN") | |
| else: | |
| resp.say('1.'+en['message25'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('2.'+en['message26'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('3.'+en['message29'], voice='Polly.Aditi',language="hi-IN") | |
| elif(statusChoice == 4): | |
| if(age < 60): | |
| resp.say('1'+en['message25'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('2'+en['message26'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('3'+en['message27'], voice='Polly.Aditi',language="hi-IN") | |
| else: | |
| resp.say('1'+en['message25'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('2'+en['message26'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('3'+en['message29'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say(en['message41'],voice='Polly.Aditi',language="hi-IN") | |
| if language == '2': | |
| resp.say(hi['message13'],voice='Polly.Aditi',language="hi-IN") | |
| resp.say(hi['message40'], voice='Polly.Aditi',language="hi-IN") | |
| if(schemeChoice == 1): | |
| if(statusChoice == 1): | |
| if(age < 60): | |
| resp.say('1'+hi['message16'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('2'+hi['message17'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('3'+hi['message18'], voice='Polly.Aditi',language="hi-IN") | |
| else: | |
| resp.say('1'+hi['message18'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('2'+hi['message16'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('3'+hi['message19'], voice='Polly.Aditi',language="hi-IN") | |
| elif(statusChoice == 2): | |
| if(age < 60): | |
| resp.say('1'+hi['message17'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('2'+hi['message20'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('3'+hi['message16'], voice='Polly.Aditi',language="hi-IN") | |
| else: | |
| resp.say('1'+hi['message16'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('2'+hi['message19'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('3'+hi['message18'], voice='Polly.Aditi',language="hi-IN") | |
| elif(statusChoice == 3): | |
| if(age < 60): | |
| resp.say('1'+hi['message16'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('2'+hi['message21'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('3'+hi['message22'], voice='Polly.Aditi',language="hi-IN") | |
| else: | |
| resp.say('1'+hi['message23'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('2'+hi['message18'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('3'+hi['message24'], voice='Polly.Aditi',language="hi-IN") | |
| elif(statusChoice == 4): | |
| if(age < 60): | |
| resp.say('1'+hi['message20'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('2'+hi['message18'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('3'+hi['message21'], voice='Polly.Aditi',language="hi-IN") | |
| else: | |
| resp.say('1'+hi['message23'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('2'+hi['message19'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('3'+hi['message24'], voice='Polly.Aditi',language="hi-IN") | |
| elif(schemeChoice == 2): | |
| if(statusChoice == 1): | |
| if(age < 60): | |
| resp.say('1'+hi['message25'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('2'+hi['message26'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('3'+hi['message27'], voice='Polly.Aditi',language="hi-IN") | |
| else: | |
| resp.say('1'+hi['message25'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('2'+hi['message28'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('3'+hi['message27'], voice='Polly.Aditi',language="hi-IN") | |
| elif(statusChoice == 2): | |
| if(age < 60): | |
| resp.say('1'+hi['message25'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('2'+hi['message26'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('3'+hi['message29'], voice='Polly.Aditi',language="hi-IN") | |
| else: | |
| resp.say('1'+hi['message28'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('2'+hi['message26'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('3'+hi['message27'], voice='Polly.Aditi',language="hi-IN") | |
| elif(statusChoice == 3): | |
| if(age < 60): | |
| resp.say('1'+hi['message25'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('2'+hi['message26'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('3'+hi['message29'], voice='Polly.Aditi',language="hi-IN") | |
| else: | |
| resp.say('1'+hi['message25'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('2'+hi['message26'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('3'+hi['message29'], voice='Polly.Aditi',language="hi-IN") | |
| elif(statusChoice == 4): | |
| if(age < 60): | |
| resp.say('1'+hi['message25'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('2'+hi['message26'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('3'+hi['message27'], voice='Polly.Aditi',language="hi-IN") | |
| else: | |
| resp.say('1'+hi['message25'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('2'+hi['message26'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('3'+hi['message29'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say(hi['message41'],voice='Polly.Aditi',language="hi-IN") | |
| if language == '3': | |
| resp.say(kn['message13'],voice='Polly.Aditi',language="hi-IN") | |
| resp.say(kn['message40'], voice='Polly.Aditi',language="hi-IN") | |
| if(schemeChoice == 1): | |
| if(statusChoice == 1): | |
| if(age < 60): | |
| resp.say('1'+kn['message16'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('2'+kn['message17'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('3'+kn['message18'], voice='Polly.Aditi',language="hi-IN") | |
| else: | |
| resp.say('1'+kn['message18'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('2'+kn['message16'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('3'+kn['message19'], voice='Polly.Aditi',language="hi-IN") | |
| elif(statusChoice == 2): | |
| if(age < 60): | |
| resp.say('1'+kn['message17'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('2'+kn['message20'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('3'+kn['message16'], voice='Polly.Aditi',language="hi-IN") | |
| else: | |
| resp.say('1'+kn['message16'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('2'+kn['message19'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('3'+kn['message18'], voice='Polly.Aditi',language="hi-IN") | |
| elif(statusChoice == 3): | |
| if(age < 60): | |
| resp.say('1'+kn['message16'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('2'+kn['message21'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('3'+kn['message22'], voice='Polly.Aditi',language="hi-IN") | |
| else: | |
| resp.say('1'+kn['message23'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('2'+kn['message18'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('3'+kn['message24'], voice='Polly.Aditi',language="hi-IN") | |
| elif(statusChoice == 4): | |
| if(age < 60): | |
| resp.say('1'+kn['message20'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('2'+kn['message18'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('3'+kn['message21'], voice='Polly.Aditi',language="hi-IN") | |
| else: | |
| resp.say('1'+kn['message23'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('2'+kn['message19'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('3'+kn['message24'], voice='Polly.Aditi',language="hi-IN") | |
| elif(schemeChoice == 2): | |
| if(statusChoice == 1): | |
| if(age < 60): | |
| resp.say('1'+kn['message25'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('2'+kn['message26'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('3'+kn['message27'], voice='Polly.Aditi',language="hi-IN") | |
| else: | |
| resp.say('1'+kn['message25'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('2'+kn['message28'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('3'+kn['message27'], voice='Polly.Aditi',language="hi-IN") | |
| elif(statusChoice == 2): | |
| if(age < 60): | |
| resp.say('1'+kn['message25'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('2'+kn['message26'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('3'+kn['message29'], voice='Polly.Aditi',language="hi-IN") | |
| else: | |
| resp.say('1'+kn['message28'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('2'+kn['message26'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('3'+kn['message27'], voice='Polly.Aditi',language="hi-IN") | |
| elif(statusChoice == 3): | |
| if(age < 60): | |
| resp.say('1'+kn['message25'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('2'+kn['message26'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('3'+kn['message29'], voice='Polly.Aditi',language="hi-IN") | |
| else: | |
| resp.say('1'+kn['message25'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('2'+kn['message26'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('3'+kn['message29'], voice='Polly.Aditi',language="hi-IN") | |
| elif(statusChoice == 4): | |
| if(age < 60): | |
| resp.say('1'+kn['message25'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('2'+kn['message26'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('3'+kn['message27'], voice='Polly.Aditi',language="hi-IN") | |
| else: | |
| resp.say('1'+kn['message25'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('2'+kn['message26'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('3'+kn['message29'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say(kn['message41'],voice='Polly.Aditi',language="hi-IN") | |
| if language == '4': | |
| resp.say(ta['message13'],voice='Polly.Aditi',language="hi-IN") | |
| resp.say(ta['message40'], voice='Polly.Aditi',language="hi-IN") | |
| if(schemeChoice == 1): | |
| if(statusChoice == 1): | |
| if(age < 60): | |
| resp.say('1'+ta['message16'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('2'+ta['message17'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('3'+ta['message18'], voice='Polly.Aditi',language="hi-IN") | |
| else: | |
| resp.say('1'+ta['message18'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('2'+ta['message16'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('3'+ta['message19'], voice='Polly.Aditi',language="hi-IN") | |
| elif(statusChoice == 2): | |
| if(age < 60): | |
| resp.say('1'+ta['message17'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('2'+ta['message20'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('3'+ta['message16'], voice='Polly.Aditi',language="hi-IN") | |
| else: | |
| resp.say('1'+ta['message16'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('2'+ta['message19'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('3'+ta['message18'], voice='Polly.Aditi',language="hi-IN") | |
| elif(statusChoice == 3): | |
| if(age < 60): | |
| resp.say('1'+ta['message16'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('2'+ta['message21'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('3'+ta['message22'], voice='Polly.Aditi',language="hi-IN") | |
| else: | |
| resp.say('1'+ta['message23'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('2'+ta['message18'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('3'+ta['message24'], voice='Polly.Aditi',language="hi-IN") | |
| elif(statusChoice == 4): | |
| if(age < 60): | |
| resp.say('1'+ta['message20'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('2'+ta['message18'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('3'+ta['message21'], voice='Polly.Aditi',language="hi-IN") | |
| else: | |
| resp.say('1'+ta['message23'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('2'+ta['message19'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('3'+ta['message24'], voice='Polly.Aditi',language="hi-IN") | |
| elif(schemeChoice == 2): | |
| if(statusChoice == 1): | |
| if(age < 60): | |
| resp.say('1'+ta['message25'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('2'+ta['message26'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('3'+ta['message27'], voice='Polly.Aditi',language="hi-IN") | |
| else: | |
| resp.say('1'+ta['message25'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('2'+ta['message28'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('3'+ta['message27'], voice='Polly.Aditi',language="hi-IN") | |
| elif(statusChoice == 2): | |
| if(age < 60): | |
| resp.say('1'+ta['message25'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('2'+ta['message26'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('3'+ta['message29'], voice='Polly.Aditi',language="hi-IN") | |
| else: | |
| resp.say('1'+ta['message28'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('2'+ta['message26'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('3'+ta['message27'], voice='Polly.Aditi',language="hi-IN") | |
| elif(statusChoice == 3): | |
| if(age < 60): | |
| resp.say('1'+ta['message25'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('2'+ta['message26'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('3'+ta['message29'], voice='Polly.Aditi',language="hi-IN") | |
| else: | |
| resp.say('1'+ta['message25'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('2'+ta['message26'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('3'+ta['message29'], voice='Polly.Aditi',language="hi-IN") | |
| elif(statusChoice == 4): | |
| if(age < 60): | |
| resp.say('1'+ta['message25'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('2'+ta['message26'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('3'+ta['message27'], voice='Polly.Aditi',language="hi-IN") | |
| else: | |
| resp.say('1'+ta['message25'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('2'+ta['message26'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say('3'+ta['message29'], voice='Polly.Aditi',language="hi-IN") | |
| resp.say(ta['message41'],voice='Polly.Aditi',language="hi-IN") | |
| return str(resp) | |
| if __name__ == "__main__": | |
| port = int(os.environ.get("PORT", 5000)) | |
| app.run(host='0.0.0.0', port=port) | |
| # http://jandhan2.herokuapp.com/account/sendMsg |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment