diff --git a/src/plivo/rest/freeswitch/api.py b/src/plivo/rest/freeswitch/api.py index df117100..a7895696 100644 --- a/src/plivo/rest/freeswitch/api.py +++ b/src/plivo/rest/freeswitch/api.py @@ -1888,6 +1888,8 @@ def schedule_play(self): [Mix]: 'true'|'false'. Mix with current audio stream (default 'true') + [Delimiter]: The delimiter used in the sounds list (default: ',') + Returns a scheduled task with id SchedPlayId that you can use to cancel play. """ self._rest_inbound_socket.log.debug("RESTAPI SchedulePlay with %s" \ @@ -1902,6 +1904,7 @@ def schedule_play(self): length = get_post_param(request, 'Length') loop = get_post_param(request, 'Loop') == 'true' mix = get_post_param(request, 'Mix') + delimiter = get_post_param(request, 'Delimiter') if mix == 'false': mix = False else: @@ -1938,7 +1941,9 @@ def schedule_play(self): msg = "Length Parameter must be a positive integer" return self.send_response(Success=result, Message=msg) - sounds_list = sounds.split(',') + if not delimiter: delimiter = ',' + + sounds_list = sounds.split(delimiter) if not sounds_list: msg = "Sounds Parameter is Invalid" return self.send_response(Success=result, Message=msg) diff --git a/src/plivo/rest/freeswitch/elements.py b/src/plivo/rest/freeswitch/elements.py index 419b92b8..455579cd 100644 --- a/src/plivo/rest/freeswitch/elements.py +++ b/src/plivo/rest/freeswitch/elements.py @@ -731,10 +731,7 @@ def _prepare_play_string(self, outbound_socket, remote_url): def create_number(self, number_instance, outbound_socket): num_gw = [] - # skip number object without gateway or number - if not number_instance.gateways: - outbound_socket.log.error("Gateway not defined on Number object !") - return '' + # skip number object without number if not number_instance.number: outbound_socket.log.error("Number not defined on Number object !") return '' @@ -1238,6 +1235,8 @@ def parse_element(self, element, uri=None): if gateways: # get list of gateways self.gateways = gateways.split(',') + else: + self.gateways = [""] # split gw codecs by , but only outside the '' if gateway_codecs: self.gateway_codecs = \