Permalink
Browse files

Fix BulkCall Crash, Fix CancelSchedHangup crash

  • Loading branch information...
bevenky
bevenky committed May 19, 2011
1 parent 76b4c25 commit 5ecb3e6afcdcc09a0062e15f434eb4782fd58c85
Showing with 11 additions and 3 deletions.
  1. +11 −3 src/plivo/rest/freeswitch/rest_api.py
@@ -321,8 +321,16 @@ def bulk_calls(self):
time_limit_list = time_limit_str.split(delimiter)
hangup_on_ring_list = hangup_on_ring_str.split(delimiter)
- if len(to_str_list) != len(gw_str_list):
- msg = "Gateway length does not match with number length"
+ if len(to_str_list) < 2:
+ msg = "BulkCall should be used for atleast 2 numbers"
+ elif len(to_str_list) != len(gw_str_list) or \
+ len(to_str_list) != len(gw_codecs_str_list) or \
+ len(to_str_list) != len(gw_timeouts_str_list) or \
+ len(to_str_list) != len(gw_retries_str_list) or \
+ len(to_str_list) != len(send_digits_list) or \
+ len(to_str_list) != len(time_limit_list) or \
+ len(to_str_list) != len(hangup_on_ring_list):
+ msg = "'To' parameter length, not same as other Parameters"
else:
for to in to_str_list:
try:
@@ -531,7 +539,7 @@ def cancel_scheduled_hangup(self):
if not sched_id:
msg = "Id Parameter must be present"
else:
- self._rest_inbound_socket.api("sched_del %s" % sched_id)
+ res = self._rest_inbound_socket.api("sched_del %s" % sched_id)
if res.is_success():
msg = "Scheduled Hangup Canceled"
result = True

0 comments on commit 5ecb3e6

Please sign in to comment.