Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion rootio/configuration/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ def index():
station.gws_in_telephony.append(gw.number_bottom)

if station.gws_in_telephony:
station.host_number = min(station.gws_out_telephony)
# carlos fix
gws_out_telephony = station.gws_out_telephony if len(station.gws_out_telephony) > 0 else [0]
station.host_number = min(gws_out_telephony)
if len(station.gws_in_telephony):
if len(station.gws_in_telephony) > 2:
station.call_in_number = station.gws_in_telephony[1]
Expand Down
8 changes: 4 additions & 4 deletions rootio/static/css/schedule.css
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@
min-width: 10%;
}

#music-program {
background: #3366CC;
.cloud-program { /* try to mimick the look of a real event */
background:rgb(255, 204, 0);
}

#cloud-program {
background: rgb(201, 204, 51);
.music-program { /* try to mimick the look of a real event */
background:#3366CC;
}

#addable-programs li.recurring-button {
Expand Down
4 changes: 2 additions & 2 deletions rootio/templates/radio/music_program.html
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ <h5>
</h5>
<ul style="overflow: auto; max-height: 600px;" data-filtered-by="filter-playlists">
{% for playlist in playlists %}
<li id="draggable" class='external-event'
<li id="draggable" class='external-event music-program'
data-name="{{playlist.title}}"
data-json='{"name":"{{ playlist.title }}","type":"Music", "playlist_id":"{{ playlist.playlist_id}}", "start_time":"00:00:02","duration": 1200, "warning_time": 1140 }'>
{{ playlist.title}} ( {{ playlist.station.name }} )
Expand All @@ -92,7 +92,7 @@ <h5>
</h5>
<ul style="overflow: auto; max-height: 600px;" data-filtered-by="filter-streams">
{% for stream in streams %}
<li id="draggable" class='external-event'
<li id="draggable" class='external-event music-program'
data-name="{{stream.name}}"
data-json='{"name":"{{ stream.name }}","type":"Stream", "stream_url":"{{ stream.uri}}", "start_time":"00:00:02","duration": 1200, "warning_time": 1140 }'>
{{ stream.name}}
Expand Down
12 changes: 6 additions & 6 deletions rootio/templates/radio/program.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ <h5>
</h5>
<ul style="overflow: auto; max-height: 400px;" data-filtered-by="filter-hosts">
{% for host in hosts %}
<li id="draggable" class='external-event'
<li id="draggable" class='external-event cloud-program'
data-name="{{host}}"
data-host-phone="{{host.phonenumber}}"
data-json='{"name":"{{host}}","type":"Outcall","host_id":{{host.id}}, "start_time":"00:00:02","duration": 1200, "warning_time": 1140 }'>
Expand All @@ -86,7 +86,7 @@ <h5>
</h5>
<ul style="overflow: auto; max-height: 400px;" data-filtered-by="filter-news">
{% for new in news %}
<li id="draggable" class='external-event'
<li id="draggable" class='external-event cloud-program'
data-new-id="{{new.id}}"
data-name="{{new.name}}"
data-json='{"name":"{{new.name}}","type":"News","track_id":{{new.id}}, "start_time":"00:00:02","duration": 1200 }'>
Expand All @@ -102,7 +102,7 @@ <h5>
</h5>
<ul style="overflow: auto; max-height: 400px;" data-filtered-by="filter-ads">
{% for ad in ads %}
<li id="draggable" class='external-event'
<li id="draggable" class='external-event cloud-program'
data-new-id="{{ad.id}}"
data-name="{{ad.name}}"
data-json='{"name":"{{ad.name}}","type":"Advertisements","track_id":{{ad.id}}, "start_time":"00:00:02","duration": 1200 }'>{{ad.name}}
Expand All @@ -117,7 +117,7 @@ <h5>
</h5>
<ul style="overflow: auto; max-height: 400px;" data-filtered-by="filter-media">
{% for media in medias %}
<li id="draggable" class='external-event'
<li id="draggable" class='external-event cloud-program'
data-new-id="{{media.id}}"
data-name="{{media.name}}"
data-json='{"name":"{{media.name}}","type":"Media","track_id":{{media.id}}, "start_time":"00:00:02","duration": 1200 }'>
Expand All @@ -134,7 +134,7 @@ <h5>
</h5>
<ul style="overflow: auto; max-height: 400px;" data-filtered-by="filter-podcasts">
{% for podcast in podcasts %}
<li id="draggable" class='external-event'
<li id="draggable" class='external-event cloud-program'
data-new-id="{{podcast.id}}"
data-name="{{podcast.name}}"
data-json='{"name":"{{podcast.name}}","type":"Podcast","track_id":{{podcast.id}}, "start_time":"00:00:02","duration": 1200 }'>
Expand All @@ -152,7 +152,7 @@ <h5>
</h5>
<ul style="overflow: auto; max-height: 400px;" data-filtered-by="filter-community">
{% for community_content in community_contents %}
<li id="draggable" class='external-event'
<li id="draggable" class='external-event cloud-program'
data-name="{{community_content.type}}"
data-json='{"name":"{{ community_content.type }}","type":"Community", "category_id":"{{community_content.category_id}}", "start_time":"00:00:02","duration": 1200, "warning_time": 1140 }'>
{{community_content.type}}
Expand Down
5 changes: 2 additions & 3 deletions rootio/templates/radio/schedule.html
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,10 @@ <h5>
<ul style="overflow: auto; max-height: 600px;">
{% for p in addable_programs | sort(attribute='id', reverse=True)%}
{% if p.program_type.name == 'Music' %}
<li id="music-program"
<li class="external-event music-program"
{% else %}
<li id="cloud-program"
<li class="external-event cloud-program"
{% endif %}
class= 'external-event'
data-program-id="{{p.id}}"
data-station-id="{{station.id}}"
data-program-type-id="{{ p.program_type_id }}"
Expand Down
57 changes: 27 additions & 30 deletions telephony/outcall_action.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,9 @@ def notify_incoming_dtmf(self, dtmf_info):
if dtmf_digit == "1" and self.__in_talkshow_setup:

self.program.log_program_activity("Host is ready, we are calling the station")
self.__call_handler.speak('Please wait while we connect you to the radio station',
self.__available_calls[self.__host.phone.raw_number]['Channel-Call-UUID'])

self.__prompt_engine.play_prompt(self.__prompt_engine.AWAIT_STATION_CONNECTION, self.__call_handler, self.__available_calls[self.__host.phone.raw_number]['Channel-Call-UUID'])

self.__request_station_call()
self.__in_talkshow_setup = False

Expand All @@ -227,35 +228,27 @@ def notify_incoming_dtmf(self, dtmf_info):
elif dtmf_digit == "1": # Wake mode, the station will wake host when someone calls in and host is off air
if self.__phone_status != PhoneStatus.WAKE:
self.__phone_status = PhoneStatus.WAKE
self.__call_handler.speak('Your call will be terminated and you will be called when someone calls into the station',
self.__available_calls[self.__host.phone.raw_number]['Channel-Call-UUID'])
self.__prompt_engine.play_prompt(self.__prompt_engine.ENTERING_WAKE_MODE, self.__call_handler, self.__available_calls[self.__host.phone.raw_number]['Channel-Call-UUID'])
self.hangup_call()
else:
self.__phone_status = PhoneStatus.REJECTING
self.__call_handler.speak('All incoming calls will be rejected',
self.__available_calls[self.__host.phone.raw_number]['Channel-Call-UUID'])
self.__prompt_engine.play_prompt(self.__prompt_engine.ENTERING_REJECT_MODE, self.__call_handler, self.__available_calls[self.__host.phone.raw_number]['Channel-Call-UUID'])

elif dtmf_digit == "3": # put the station =in auto_answer
if self.__phone_status != PhoneStatus.ANSWERING:
self.__phone_status = PhoneStatus.ANSWERING
self.__call_handler.speak('All incoming calls will be automatically answered',
self.__available_calls[self.__host.phone.raw_number]['Channel-Call-UUID'])
self.__prompt_engine.play_prompt(self.__prompt_engine.ENTERING_AUTO_ANSWER_MODE, self.__call_handler, self.__available_calls[self.__host.phone.raw_number]['Channel-Call-UUID'])
else:
self.__phone_status = PhoneStatus.REJECTING
self.__call_handler.speak('All incoming calls will be rejected',
self.__available_calls[self.__host.phone.raw_number]['Channel-Call-UUID'])
self.__prompt_engine.play_prompt(self.__prompt_engine.ENTERING_REJECT_MODE, self.__call_handler, self.__available_calls[self.__host.phone.raw_number]['Channel-Call-UUID'])

elif dtmf_digit == "4": # disable auto answer, reject and record all incoming calls
if self.__phone_status != PhoneStatus.QUEUING:
self.__phone_status = PhoneStatus.QUEUING
self.__call_handler.speak(
'All incoming calls will be queued for call back',
self.__available_calls[self.__host.phone.raw_number]['Channel-Call-UUID'])
self.__prompt_engine.play_prompt(self.__prompt_engine.ENTERING_QUEUING_MODE, self.__call_handler, self.__available_calls[self.__host.phone.raw_number]['Channel-Call-UUID'])
else:
self.__phone_status = PhoneStatus.REJECTING
self.__call_handler.speak(
'All incoming calls will be rejected',
self.__available_calls[self.__host.phone.raw_number]['Channel-Call-UUID'])
self.__prompt_engine.play_prompt(self.__prompt_engine.ENTERING_REJECT_MODE, self.__call_handler, self.__available_calls[self.__host.phone.raw_number]['Channel-Call-UUID'])

elif dtmf_digit == "5": # dequeue and call from queue of calls that were queued
for caller in self.__interested_participants:
Expand All @@ -277,17 +270,17 @@ def notify_incoming_dtmf(self, dtmf_info):
pass

elif dtmf_digit == "9": # Take a 5 min music break
self.__call_handler.speak('You will be called back in 5 minutes',
self.__available_calls[self.__host.phone.raw_number]['Channel-Call-UUID'])
self.__prompt_engine.play_prompt(self.__prompt_engine.ENTERING_5_MIN_BREAK, self.__call_handler, self.__available_calls[self.__host.phone.raw_number]['Channel-Call-UUID'])
self.program.log_program_activity("Host is taking a break")
self.__pause_call()
else:
if dtmf_digit == "#": # Call invitee number
if self.__invitee_number == "":
self.__call_handler.speak('Please enter the number to call and press the # key to dial',
self.__available_calls[self.__host.phone.raw_number]['Channel-Call-UUID'])
if self.__invitee_number == "":
self.__prompt_engine.play_prompt(self.__prompt_engine.ENTER_NUMBER_TO_CALL, self.__call_handler, self.__available_calls[self.__host.phone.raw_number]['Channel-Call-UUID'])
else:
self.__call_handler.speak('You are calling "{0}"'.format(self.__invitee_number),
self.__prompt_engine.play_prompt(self.__prompt_engine.CALLING_OUT, self.__call_handler, self.__available_calls[self.__host.phone.raw_number]['Channel-Call-UUID'])
# CARLOS - Should the phone number be passed here - prompt engine??
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@judelove please check this

#self.__call_handler.speak('You are calling "{0}"'.format(self.__invitee_number),
self.__available_calls[self.__host.phone.raw_number]['Channel-Call-UUID'])
result = self.__call_handler.call(self, self.__invitee_number, self.__host.phone.raw_number, False, self.duration)
self.__call_handler.register_for_call_hangup(self, self.__invitee_number)
Expand All @@ -296,7 +289,10 @@ def notify_incoming_dtmf(self, dtmf_info):
# Disable this mode
self.__phone_status = PhoneStatus.REJECTING
else:
self.__call_handler.speak('The call to {0} failed. Please pres the hash key to try again'.format(self.__invitee_number),
# CARLOS TODO - Have to format this!
self.__prompt_engine.play_prompt(self.__prompt_engine.CALL_FAILED, self.__call_handler, self.__available_calls[self.__host.phone.raw_number]['Channel-Call-UUID'])

#self.__call_handler.speak('The call to {0} failed. Please pres the hash key to try again'.format(self.__invitee_number),
self.__available_calls[self.__host.phone.raw_number][
'Channel-Call-UUID'])
else: # Collect digits to call
Expand Down Expand Up @@ -324,9 +320,8 @@ def notify_incoming_call(self, call_info):
"Call from community caller {0} was auto-answered".format(call_info['Caller-Destination-Number']))
elif self.__phone_status == PhoneStatus.QUEUING: # Hangup the phone, call back later
self.__interested_participants.add(call_info['Caller-ANI'])
self.__call_handler.speak(
'You have a new caller on the line',
self.__available_calls[self.__host.phone.raw_number]['Channel-Call-UUID'])
self.__prompt_engine.play_prompt(self.__prompt_engine.INCOMING_CALL_QUEUED, self.__call_handler, self.__available_calls[self.__host.phone.raw_number]['Channel-Call-UUID'])

self.__call_handler.hangup(call_info['Channel-Call-UUID'])
self.program.log_program_activity(
"Call from community caller {0} was queued".format(call_info['Caller-Destination-Number']))
Expand All @@ -336,8 +331,9 @@ def notify_incoming_call(self, call_info):
self.__call_handler.bridge_incoming_call(call_info['Channel-Call-UUID'],
"{0}_temp{1}".format(self.program.id,
self.program.radio_station.id))
self.__call_handler.speak('Thank you for wanting to take part in this program. We will call you back shortly',
call_info['Channel-Call-UUID'])

self.__prompt_engine.play_prompt(self.__prompt_engine.CALL_BACK_NOTIFICATION, self.__call_handler, call_info['Channel-Call-UUID'])

self.__call_handler.register_for_call_hangup(self, call_info['Caller-Destination-Number'])
self.program.log_program_activity(
"Call from community caller {0} was rejected".format(call_info['Caller-Destination-Number']))
Expand All @@ -351,8 +347,9 @@ def notify_incoming_call(self, call_info):
self.__community_call_UUIDs[call_info['Caller-Destination-Number']] = call_info['Channel-Call-UUID']
self.program.log_program_activity(
"Call from community caller {0} was auto-answered".format(call_info['Caller-Destination-Number']))
self.__call_handler.speak('Please wait while we connect you to the host of this program',
call_info['Channel-Call-UUID'])

self.__prompt_engine.play_prompt(self.__prompt_engine.AWAIT_HOST_CONNECTION, self.__call_handler, call_info['Channel-Call-UUID'])

self.request_host_call(True)
#self.__call_handler.speak('Please wait while we connect you to the host', call_info['Channel-Call-UUID'])

Expand Down