Giter VIP home page Giter VIP logo

php-bandwidth's People

Contributors

bwdan avatar covati avatar ffranco-daitan avatar gforrest-bw avatar guaycuru avatar jmulford-bw avatar lnunes-daitan avatar nadirhamid avatar smitchell2240 avatar soundslocke avatar tobiaslounsbury avatar troft avatar tylercd100 avatar uakfdotb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

php-bandwidth's Issues

New Release

Can you guys issue a new release? The last release was almost a year ago, so when I run composer update, it's not getting the latest changes (the character limit). Thanks!

having problems playing audio or speaking sentence

while trying to play an audio I get the fileUrl is not valid and only shows the root url passed.
while speakSentence i get "{"category":"forbidden","code":"call-invalid-state","message":"Unable to update call c-XXXXXXXX. Invalid call state COMPLETED","details":[{"name":"callId","value":"c-XXXXXXXX"},{"name":"callState","value":"COMPLETED"},{"name":"requestMethod","value":"POST"},{"name":"remoteAddress","value":"69.64.72.223"},{"name":"requestPath","value":"users/u-ikxknyw3kmvhrgderfslf2q/calls/c-XXXXXXXX/audio/"}]} " Does not matter if the call is active, started or completed.
A little help would help

Composer needs package check

when using "composer require bandwidth/catapult"

the returned result is sometimes "Nothing to install or update" this
needs to be looked into.

function: validate_search_query not found

$phoneNumbers = new PhoneNumbers();

$params = [
     'state' => 'fl',
     'quantity' => 1
];

$numbers = $phoneNumbers->batchAllocateLocal($params);

is throwing

PHP Fatal error:  Uncaught Exception: function: validate_search_query not found in Catapult\PhoneNumbers
  thrown in /vendor/bandwidth/catapult/source/resource/Base.php on line 96

speakSentence fails for Conference and ConferenceMember

The speakSentence function fails for both the Conference and ConferenceMember models. I've traced this to a malformed audio url being returned by ConferenceMember->getAudioUrl() and no implementation of Conference->getAudioUrl.

I've implemented a fix that I have verified on my own system and am initiating a pull request.

Getting Text message was too long error

I was getting this error message when sending text message

(line: 84) - APPLICATION: [Jan/01/17:18:51:18] - Text message was too long. use: warn[FALSE] to omit.

I only have 165 characters in the message. I think the API supposedly should accept strings up to 2048, right?

credentials.json

I don't seem to be able to get around not having this file. The documentation implies that if you supply the credentials to the credentials constructor like

$cred = new Catapult\Credentials($bandwidth_user_id, $bandwidth_api_token, $bandwidth_api_secret);

then you do not need the file. If you look at the constructor

public function __construct($user_token='',
              $api_token='',
              $api_secret='') 
    { 
      $file = self::$credentials_opts['file'];

      /* only consider parameter init if all provided */
      if (isset(self::$credentials_opts['path'])) {
        self::$credentials_opts['path'] = self::$credentials_opts['path'] . DIRECTORY_SEPARATOR . self::$credentials_opts['file'];
      } else {
        self::$credentials_opts['path'] = realpath(getcwd()) . DIRECTORY_SEPARATOR . self::$credentials_opts['file'];
      }

      /**
       * check if the file is accessible
       * when it is "credentials.json"
       * this should 
       *
       * this needs to only validate the directory
       */
      if (!is_file(self::$credentials_opts['path'])) {
        throw new \CatapultApiException("$file was not found in directory " . self::$credentials_opts['path']);
      }

      if ($user_token && $api_token && $api_secret)
        $this->credentials = new CredentialsUser($user_token, $api_token, $api_secret);
      else
        $this->credentials = file_get_contents(self::$credentials_opts['path']);
    } 

it checks for the file no matter what. Would it be possible to change it so we do not have to provide the credentials.json file?

MMS Example broken

The MMS example is not working, two issues

  1. you have to first upload media to Bandwidth servers, otherwise you get an error "must be first stored as a Catapult media"

  2. Example is send to and from the same phone number
    "from" => $argv[1],
    "to" => $argv[1],

Suggested fix, simplify this example into a single message example and combine with /media upload

  1. Upload media using /media
  2. Send MMS message using media just uploaded

Need to add callbackHttpMethod to Catapult\Call

Trying to run this

$call = new Catapult\Call(array(
"from" => new Catapult\PhoneNumber($_POST['fromPhoneNumber']),
"to" => new Catapult\PhoneNumber($_POST['toPhoneNumber']),
"callbackUrl" => "https://".$_SERVER['HTTP_HOST']."/callback.php",
"callbackHttpMethod" => "GET"
));

Produces:
CatapultWarning: callbackHttpMethod is not a valid term in model Catapult\Call

However, callbackHttpMethod is a valid paramter
http://ap.bandwidth.com/docs/rest-api/calls/#resource396

PHP >= 5.3 Strict (2048) Warnings

warnings in Strict(2048) mode that
need to be fixed, (function declation and compatability)

ex:
Strict (2048): Declaration of Catapult\Endpoints::load() should be compatible with Catapult\GenericResource::load($props) [APP/Vendor/Catapult/source/models/Endpoints.php, line 103]

Error when creating and fetching conference members

I encountered two errors with the conference class.
getMembers() relies on the existence of ConferenceMembersCollection extending CollectionObject. This was not implemented and thus caused a missing class error to be thrown.

Conference->addMember does properly create the member, but when attempting to fetch the newly created member information from the API, it fails to pass in the memberId and so causes a resource not found error to be thrown.

I've traced and patched both of these and will initiate a pull request.

PHP 7.2 and Bandwidth

use Catapult\Client;
use Catapult\Message;
use Catapult\PhoneNumber;
use Catapult\TextMessage;

...
    $result = new Message([
      'from' => new PhoneNumber($from),
      'to'   => new PhoneNumber($to),
      'text' => new TextMessage($message),
    ]);
...

Version: 0.8.2

This causes a resolver error on:

[2018-03-13 11:42:09] local.DEBUG: Sleeping extra 3 seconds.
[2018-03-13 11:42:09] local.ERROR: ErrorException: sizeof(): Parameter must be an array or an object that implements Countable in C:\laragon\webroots\playhq\attendence-laravel\vendor\bandwidth\catapult\source\resource\Resolver.php:47
Stack trace:
#0 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(2, 'sizeof(): Param...', 'C:\\laragon\\webr...', 47, Array)
#1 C:\laragon\webroots\playhq\attendence-laravel\vendor\bandwidth\catapult\source\resource\Resolver.php(47): sizeof(Object(Catapult\DataPacket))

Version Update, Notice

Issue: #2
Status: Resolved

Please update to v0.7.3, as the prefixed 'v' in version naming plays better with package management support

SDK Polish and Fixes

We're looking at the shape of our SDKs and seeing if they justify a re-write, or just need better docs, or something else.

Please make some suggestions for the PHP SDK. I'm open to pretty much everything.

  • Do you have any PHP SDKs that were awesome to use and Bandwidth should implement some of those design patterns?
  • Do you have any small gripes with the SDK now that Bandwidth should fix?
  • Any big gripes with the SDK as is now?
  • Do you even want an SDK? I mean it's just HTTP requests ๐Ÿ˜‰ (j.k.)
  • Thoughts on Swagger generated SDKs? ALPHA SWAGGER DOCS

Thanks for your feedback. If you want to hit me up directly feel free (dtolb @ bandwidth.com)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.