Skip to content

Commit

Permalink
Record correct number on outgoing calls
Browse files Browse the repository at this point in the history
  • Loading branch information
chadsmith committed Jul 11, 2012
1 parent 9f6e889 commit 5ab2b3c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions applets/poll/twiml.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
$ci =& get_instance();
$poll = AppletInstance::getValue('poll');
$option = AppletInstance::getValue('option');
$direction = 'inbound';

if(!empty($_REQUEST['From'])) {
$number = normalize_phone_to_E164($_REQUEST['From']);
if(!empty($_REQUEST['Direction'])) {
$direction = $_REQUEST['Direction'];
$number = normalize_phone_to_E164('inbound' == $direction ? $_REQUEST['From'] : $_REQUEST['To']);
$ci->db->delete('polls_responses', array('poll' => $poll, 'value' => $number));
$ci->db->insert('polls_responses', array(
'poll' => $poll,
Expand Down

0 comments on commit 5ab2b3c

Please sign in to comment.