Пример #1
0
     printf("{$bldred}FAIL: User listing OR filtering is broken.{$txtrst}\n\n");
 }
 if (strlen($USER_ID) == 0) {
     printf("{$bldred}FATAL: {$bldwht}Could not get a User ID back from (insert response/user listing).{$txtrst}\n");
     exit(-1);
 }
 printf("{$bldblu}TEST: Get User by ID:{$bldred}{$USER_ID}.{$txtrst}\n");
 $user = $XBAR->get_user($USER_ID, $ACCOUNT_ID);
 print_r($user);
 if ($user['status'] == 'success') {
     printf("{$bldgrn}PASS: User found, finding a User by ID is possible.{$txtrst}\n\n");
 } else {
     printf("{$bldred}FAIL: Failed to retrieve User by ID.{$txtrst}\n\n");
 }
 printf("{$bldblu}TEST: Delete User ID:{$bldred}{$USER_ID}.{$txtrst}\n");
 $resp = $XBAR->del_user($USER_ID, $ACCOUNT_ID);
 if ($resp['status'] == 'success') {
     printf("{$bldgrn}PASS: Delete User.{$txtrst}\n\n");
 } else {
     printf("{$bldred}FAIL: Delete User.{$txtrst}\n\n");
 }
 $DEVICE_TEMPLATE = array();
 $DEVICE_TEMPLATE['name'] = $USER_TEMPLATE['usernmae'] . " Device";
 $DEVICE_TEMPLATE['device_type'] = 'sip_device';
 $DEVICE_TEMPLATE['enabled'] = true;
 /* TODO FIGURE OUT WHAT THIS IS */
 $DEVICE_TEMPLATE['provision'] = '';
 $DEVICE_TEMPLATE['suppress_unregister_notifications'] = false;
 $DEVICE_TEMPLATE['call_forward'] = array('enabled' => false, 'number' => '', 'require_keypress' => false, 'keep_caller_id' => true, 'substitute' => false, 'ignore_early_media' => true, 'direct_calls_only' => false);
 $DEVICE_TEMPLATE['caller_id']['internal'] = array('number' => '1234', 'name' => 'test person');
 $DEVICE_TEMPLATE['caller_id']['external'] = array('number' => '1234', 'name' => 'test person');