Installed voip drupal and voip plivo for drupal 7. Enabling the modules was successful, but when trying to configure the modules all get is an error or a blank screen.

Comments

drupal999’s picture

Clicking on Default call configuration menu item gets this error on fresh install.

"PDOException: SQLSTATE[HY093]: Invalid parameter number: parameter was not defined: SELECT n.title FROM {node} n WHERE n.type = :n.type and n.status = :n.status; Array ( [:n.type] => voipscriptui [:n.status] => 1 ) in voipscriptui_voipscript_get_script_names() (line 11 of /var/www/html/dd/sites/all/modules/voipdrupal/modules/voipscriptui/voipscriptui.module).
The website encountered an unexpected error. Please try again later. "

All other voip drupal menu items show blank screens.

ben.bunk’s picture

Hi drupal999,

The latest 7.x-1.x-dev code should fix this, can you give it a try?

drupal999’s picture

Just noticed the update. download updates via Drush up
3 of the 4 menu items show another admin page which they previously showed white screen.

The first menu item "Default call configuration" shows white screen. No db errors as before.

drupal999’s picture

On voip server config

Selecting Plivo setup

Notice: Uninitialized string offset: 0 in voipplivo_admin_form() (line 31 of /var/www/html/dd/sites/all/modules/voipdrupal/modules/voipplivo/voipplivo.module).
Notice: Uninitialized string offset: 0 in voipplivo_admin_form() (line 38 of /var/www/html/dd/sites/all/modules/voipdrupal/modules/voipplivo/voipplivo.module).
Notice: Uninitialized string offset: 0 in voipplivo_admin_form() (line 45 of /var/www/html/dd/sites/all/modules/voipdrupal/modules/voipplivo/voipplivo.module).
Notice: Uninitialized string offset: 0 in voipplivo_admin_form() (line 83 of /var/www/html/dd/sites/all/modules/voipdrupal/modules/voipplivo/voipplivo.module).
Notice: Uninitialized string offset: 0 in voipplivo_admin_form() (line 90 of /var/www/html/dd/sites/all/modules/voipdrupal/modules/voipplivo/voipplivo.module).
Notice: Uninitialized string offset: 0 in voipplivo_admin_form() (line 97 of /var/www/html/dd/sites/all/modules/voipdrupal/modules/voipplivo/voipplivo.module).
Notice: Uninitialized string offset: 0 in voipplivo_admin_form() (line 104 of /var/www/html/dd/sites/all/modules/voipdrupal/modules/voipplivo/voipplivo.module).

maybe this is a plivo problem??

macneib’s picture

@Drupal999

I've been reviewing the code posted @ 7.x-1.x-dev and I've noticed that the most up-to-date code isn't in the master.

AFAIK the branch located @

https://github.com/sjamescl/voipdrupal

has the most functional code available.

We've been testing the Plivo module and have been able to make calls using this branch.
Everyone seems to be quite busy and the latest code never made it back to the master.
Good luck. let me know how the plivo module works for you.

EDIT1: You must checkout sjamescl branch in order to see the D7 code
EDIT2: We've had some trouble with the default voice configuration. Clicking the 'configure' plivo server option leads to a server timeout created by an endless self referencing loop. Error points to something wrong on line 88 of voipvoice.inc. It's a superficial error:

Voip Plivo Admin form is trying to fetch a previously set voice instance and endlessly tries to fetch until timeout. I'm debating on commenting it out.

We've been unsuccessful solving it and would welcome suggestions.
Code as follows:
EDIT3:

/**
   * Get the VoIP Voice instance associated with the given id
   *
   * @param $voice_id
   *   String representing the voice id
   *
   * @return
   *   VoipVoice instance associated with $voice_id
   */
  public static function getVoice($voice_id = NULL){
    if ($voice_id == 'man') {
      $voice_id = variable_get('voipcall_man_voice_id', '');
    }
    elseif ($voice_id == 'woman') {
      $voice_id = variable_get('voipcall_woman_voice_id', '');
    }
    elseif (empty($voice_id)) {
      $voice_id = variable_get('voipcall_voice_id', '');
    }

    $voipvoices = self::getVoices();
    $voipvoice = $voipvoices[$voice_id];
    if (empty($voipvoice)) {
      //If wrong voice_id
      watchdog('voipcall', 'VoipVoice::getVoice called with non-existing id: '. $voice_id, NULL, WATCHDOG_ERROR);
      //Load default voice instead
      $voipvoice = self::getDefaultVoice();
    }
    return $voipvoice;
  }

EDIT4:

ok... here is the solution to the problem... it's ugly. Children will cry but it works.
when installing for the first time:

in voipplivo.module

Comment out lines 58, 66 and 74
as follows

  $form['voipcall_voice_id'] = array(
    '#type' => 'select',
    '#title' => t('Default voice'),
    '#description' => t('Voice to be used in automatic text-to-speech generation.'),
    '#options' => VoipPlivoServer::getVoicesList(),
    //'#default_value' => VoipVoice::getDefaultVoice()->getVoiceId(),
  );
  
  $form['voipcall_man_voice_id'] = array(
    '#type' => 'select',
    '#title' => t('Default man voice'),
    '#description' => t('Man voice to be used in automatic text-to-speech generation.'),
    '#options' => VoipPlivoServer::getVoicesList(),
   // '#default_value' => VoipVoice::getDefaultManVoice()->getVoiceId(),
  );
  
  $form['voipcall_woman_voice_id'] = array(
    '#type' => 'select',
    '#title' => t('Default woman voice'),
    '#description' => t('Woman voice to be used in automatic text-to-speech generation.'),
    '#options' => VoipPlivoServer::getVoicesList(),
    //'#default_value' => VoipVoice::getDefaultWomanVoice()->getVoiceId(),
  );

Then perform the install and you can go back in and uncomment the lines 58, 66 and 74.
I know it's nasty. but it works for now until we can fix it properly.

Cheers
macneib

macneib’s picture

Status: Active » Needs review
ben.bunk’s picture

This sounds a lot like this bug here http://drupal.org/node/1416534

Also, merging this code branch https://github.com/sjamescl/voipdrupal into 7.x-dev is an ongoing task because of the number of differences between the two branches.

tamerzg’s picture

Status: Needs review » Fixed

Uninitialized string offset: 0 in voipplivo_admin_form() is fixed with latest dev.
Also infinite loop while getting voice was due to this issue: http://drupal.org/node/1416534
Now the solution is merged in D7 dev, so shouldn't be the problem anymore.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.