{"id":33997077,"url":"https://github.com/lukebeer/broadworks-ocip","last_synced_at":"2025-12-13T08:53:28.147Z","repository":{"id":57015760,"uuid":"6433618","full_name":"lukebeer/broadworks-ocip","owner":"lukebeer","description":"PHP Framework for interacting with the Broadworks OCI Provisioning API","archived":false,"fork":false,"pushed_at":"2021-06-15T19:35:03.000Z","size":21005,"stargazers_count":27,"open_issues_count":9,"forks_count":15,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-11-27T15:25:41.590Z","etag":null,"topics":["broadsoft","broadworks","broadworks-api","broadworks-oci","php-framework"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lukebeer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-10-29T00:08:25.000Z","updated_at":"2025-08-26T20:20:53.000Z","dependencies_parsed_at":"2022-08-22T09:31:49.151Z","dependency_job_id":null,"html_url":"https://github.com/lukebeer/broadworks-ocip","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/lukebeer/broadworks-ocip","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukebeer%2Fbroadworks-ocip","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukebeer%2Fbroadworks-ocip/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukebeer%2Fbroadworks-ocip/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukebeer%2Fbroadworks-ocip/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lukebeer","download_url":"https://codeload.github.com/lukebeer/broadworks-ocip/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukebeer%2Fbroadworks-ocip/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27702790,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-12-13T02:00:09.769Z","response_time":147,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["broadsoft","broadworks","broadworks-api","broadworks-oci","php-framework"],"created_at":"2025-12-13T08:53:27.472Z","updated_at":"2025-12-13T08:53:28.139Z","avatar_url":"https://github.com/lukebeer.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Broadworks OCI-P PHP Framework\n\nBTC: bc1q9n0v6l3ch2pjfhld4rj9y2eph3m9wl9xpmznlx\n\n## Features\n\n#### \u003ci class=\"icon-file\"\u003e\u003c/i\u003e SOAP or TCP Stream transport\nIt's now possible to choose between SOAP over HTTPS or a TCP stream (default) for interaction with the Broadworks API. Basic benchmarks suggest 15/requests/second with SOAP and 150/requests/second for TCP Stream. UserGetRequest17sp4 was used for the benchmark.\n\n\n#### \u003ci class=\"icon-folder-open\"\u003e\u003c/i\u003e Session management\nSessions can be exported out of and into the Client, this was added to allow Broadworks OCI-P scripts triggered by methods such as cronjobs to execute using external session data. Porting Sessions are a secure way to execute commands as the user that requested it as the password is not stored, cookies/sessionId are used for authentication.\n\n\n#### \u003ci class=\"icon-pencil\"\u003e\u003c/i\u003e IDE Autocompletion\n\nAll elements of the framework have been built with IDE autocompletion in mind so there isn't a need to remember the details of a data type, below is an example of disabling CallForwardingAlways for all users within a group.\n![](http://lukebeer.github.io/broadworks-ocip/img/cfa-allingroup.gif)\n\n#### \u003ci class=\"icon-refresh\"\u003e\u003c/i\u003eInteractive console\nAn interacting CLI is built in that requires zero programming knowledge. The user navigates through the schema in the same way you would directories and files on a linux file system. Commands can be executed in the CLI with results printed to screen. Tab autocompletion works - (broken in latest release)\n\n\n#### \u003ci class=\"icon-hdd\"\u003e\u003c/i\u003e Data export\n\nObjects support serialisation to allow saving of messages in plain-text format that can be unserialised back into data types the framework can understand then replayed back into Broadworks for example\n\n\n\n----------\n- Friendlier alternative to writing XML directly\n- PHP classes generated from XSD schema files\n- SOAP transport support, good for unreliable connections\n- TCP stream transport support provides minimal overhead \u0026 maximum throughput\n- SimpleTypes may contain Restriction objects for input validation such as maxLength of minLength\n- Automatic mapping of data types (userGetResponse17sp4 --\u003e userAddRequest17sp4)\n- Blood, sweat and tears from countless hours of my time when I should of been at the pub\n\n-------\n## Installation\n###### Use this for master branch\n```\n$ composer require lukebeer/broadworks-ocip\n```\n###### Use this for the development branch with untested fixes\n```\n$ composer require lukebeer/broadworks-ocip:development\n```\n\n-----\n## Basic usage\n\n``` php\n\u003c?php\nrequire_once 'vendor/autoload.php';\n\n// Use the ComplexType required for this example.\nuse Broadworks_OCIP\\api\\Rel_17_sp4_1_197_OCISchemaAS\\OCISchemaUser\\UserServiceGetAssignmentListRequest;\n\n// Create a Client and login. CoreFactory also has getSOAPClient()\n$client = BroadworksOCIP\\Factory::getTCPClient('ocip.example.com');\n$client-\u003elogin('user', 'pass');\n\n// Generate a request, send and assign the response to $response\n$request  = new UserServiceGetAssignmentListRequest('example@example.com');\n$response = $request-\u003eget($client);\n\n// This response type returns a TableType object, getValue() renders a table.\necho $response-\u003egetServicePacksAssignmentTable()-\u003egetValue();\n?\u003e\n\n/* Spits out:\n+--------------------------------------------------+----------+\n| Service Name                                     | Assigned |\n+--------------------------------------------------+----------+\n| Anonymous Call Rejection                         | true     |\n| Authentication                                   | true     |\n| Call Forwarding Always                           | true     |\n| Call Forwarding Busy                             | true     |\n| Call Forwarding No Answer                        | true     |\n| Call Notify                                      | false    |\n| Calling Line ID Delivery Blocking                | true     |\n| CommPilot Express                                | true     |\n| CommPilot Call Manager                           | true     |\n| Do Not Disturb                                   | true     |\n| Intercept User                                   | true     |\n| Last Number Redial                               | true     |\n| Sequential Ring                                  | true     |\n+--------------------------------------------------+----------+\n*/\n```\n-----\n## Main response types\n\n### ComplexType\n\nComplexTypes such as UserGetRequest17sp4 are types that may contain a mixture of element types including ComplexTypes.\nThink of them as XML with nested children.\n\nIf one of the elements to be set is a ComplexType, the ComplexType needs creating before being set in the parent object.\nFor example, StreetAddress is a ComplexType:\n``` php\n\u003c?php\n\n$address = new StreetAddress();\n$address-\u003esetAddressLine1('1337 Street');\n$address-\u003esetCountry('England');\n\n$request = new UserAddRequest17sp4();\n$request-\u003esetStreetAddress($address);\n```\n\n#### ComplexType StreetAddress structure\n```\nBroadworks_OCIP\\api\\Rel_17_sp4_1_197_OCISchemaAS\\OCISchemaDataTypes\\StreetAddress Object\n(\n    [elementName] =\u003e StreetAddress\n    [addressLine1:protected] =\u003e Broadworks_OCIP\\core\\Builder\\Types\\SimpleContent Object\n        (\n            [annontation:protected] =\u003e\n            [attributes:protected] =\u003e\n            [restrictions:protected] =\u003e Array\n                (\n                    [0] =\u003e Broadworks_OCIP\\core\\Builder\\Restrictions\\MinLength Object\n                        (\n                            [value:protected] =\u003e 1\n                            [detail:protected] =\u003e\n                        )\n\n                    [1] =\u003e Broadworks_OCIP\\core\\Builder\\Restrictions\\MaxLength Object\n                        (\n                            [value:protected] =\u003e 80\n                            [detail:protected] =\u003e\n                        )\n\n                )\n\n            [errors:protected] =\u003e\n            [elementValue:protected] =\u003e 1337 Street\n            [elementName:protected] =\u003e addressLine1\n        )\n\n    [addressLine2:protected] =\u003e Broadworks_OCIP\\core\\Builder\\Types\\SimpleContent Object\n        (\n            [annontation:protected] =\u003e\n            [attributes:protected] =\u003e\n            [restrictions:protected] =\u003e Array\n                (\n                    [0] =\u003e Broadworks_OCIP\\core\\Builder\\Restrictions\\MinLength Object\n                        (\n                            [value:protected] =\u003e 1\n                            [detail:protected] =\u003e\n                        )\n\n                    [1] =\u003e Broadworks_OCIP\\core\\Builder\\Restrictions\\MaxLength Object\n                        (\n                            [value:protected] =\u003e 80\n                            [detail:protected] =\u003e\n                        )\n\n                )\n\n            [errors:protected] =\u003e\n            [elementValue:protected] =\u003e\n            [elementName:protected] =\u003e addressLine2\n        )\n\n    [city:protected] =\u003e Broadworks_OCIP\\core\\Builder\\Types\\SimpleContent Object\n        (\n            [annontation:protected] =\u003e\n            [attributes:protected] =\u003e\n            [restrictions:protected] =\u003e Array\n                (\n                    [0] =\u003e Broadworks_OCIP\\core\\Builder\\Restrictions\\MinLength Object\n                        (\n                            [value:protected] =\u003e 1\n                            [detail:protected] =\u003e\n                        )\n\n                    [1] =\u003e Broadworks_OCIP\\core\\Builder\\Restrictions\\MaxLength Object\n                        (\n                            [value:protected] =\u003e 50\n                            [detail:protected] =\u003e\n                        )\n\n                )\n\n            [errors:protected] =\u003e\n            [elementValue:protected] =\u003e\n            [elementName:protected] =\u003e city\n        )\n\n    [stateOrProvince:protected] =\u003e Broadworks_OCIP\\core\\Builder\\Types\\SimpleContent Object\n        (\n            [annontation:protected] =\u003e\n            [attributes:protected] =\u003e\n            [restrictions:protected] =\u003e Array\n                (\n                    [0] =\u003e Broadworks_OCIP\\core\\Builder\\Restrictions\\MinLength Object\n                        (\n                            [value:protected] =\u003e 1\n                            [detail:protected] =\u003e\n                        )\n\n                    [1] =\u003e Broadworks_OCIP\\core\\Builder\\Restrictions\\MaxLength Object\n                        (\n                            [value:protected] =\u003e 50\n                            [detail:protected] =\u003e\n                        )\n\n                )\n\n            [errors:protected] =\u003e\n            [elementValue:protected] =\u003e\n            [elementName:protected] =\u003e stateOrProvince\n        )\n\n    [stateOrProvinceDisplayName:protected] =\u003e Broadworks_OCIP\\core\\Builder\\Types\\SimpleContent Object\n        (\n            [annontation:protected] =\u003e\n            [attributes:protected] =\u003e\n            [restrictions:protected] =\u003e Array\n                (\n                    [0] =\u003e Broadworks_OCIP\\core\\Builder\\Restrictions\\MinLength Object\n                        (\n                            [value:protected] =\u003e 1\n                            [detail:protected] =\u003e\n                        )\n\n                    [1] =\u003e Broadworks_OCIP\\core\\Builder\\Restrictions\\MaxLength Object\n                        (\n                            [value:protected] =\u003e 50\n                            [detail:protected] =\u003e\n                        )\n\n                )\n\n            [errors:protected] =\u003e\n            [elementValue:protected] =\u003e\n            [elementName:protected] =\u003e stateOrProvinceDisplayName\n        )\n\n    [zipOrPostalCode:protected] =\u003e Broadworks_OCIP\\core\\Builder\\Types\\SimpleContent Object\n        (\n            [annontation:protected] =\u003e\n            [attributes:protected] =\u003e\n            [restrictions:protected] =\u003e Array\n                (\n                    [0] =\u003e Broadworks_OCIP\\core\\Builder\\Restrictions\\MinLength Object\n                        (\n                            [value:protected] =\u003e 1\n                            [detail:protected] =\u003e\n                        )\n\n                    [1] =\u003e Broadworks_OCIP\\core\\Builder\\Restrictions\\MaxLength Object\n                        (\n                            [value:protected] =\u003e 50\n                            [detail:protected] =\u003e\n                        )\n\n                )\n\n            [errors:protected] =\u003e\n            [elementValue:protected] =\u003e\n            [elementName:protected] =\u003e zipOrPostalCode\n        )\n\n    [country:protected] =\u003e Broadworks_OCIP\\core\\Builder\\Types\\SimpleContent Object\n        (\n            [annontation:protected] =\u003e\n            [attributes:protected] =\u003e\n            [restrictions:protected] =\u003e Array\n                (\n                    [0] =\u003e Broadworks_OCIP\\core\\Builder\\Restrictions\\MinLength Object\n                        (\n                            [value:protected] =\u003e 1\n                            [detail:protected] =\u003e\n                        )\n\n                    [1] =\u003e Broadworks_OCIP\\core\\Builder\\Restrictions\\MaxLength Object\n                        (\n                            [value:protected] =\u003e 50\n                            [detail:protected] =\u003e\n                        )\n\n                )\n\n            [errors:protected] =\u003e\n            [elementValue:protected] =\u003e Enngland\n            [elementName:protected] =\u003e country\n        )\n\n    [elements:protected] =\u003e Array\n        (\n        )\n\n    [responseType:protected] =\u003e\n    [errors:protected] =\u003e\n    [params:protected] =\u003e Array\n        (\n        )\n\n    [args:protected] =\u003e\n    [elementValue:protected] =\u003e\n)\n\n```\n\n### TableType\n\nTableTypes are used for handling OCITable data. A single dimension array is passed in for column headings and data is\n set by using addRow or addRows with single or multi dimension arrays.\n\nIt's possible to render a pretty ascii table with `echo $table-\u003egetValue()` with the data and also search with\n`$table-\u003efindRow('something')`\n\nIf only a single column is required, method `$table-\u003egetColumn($id)` will return a specific column of data from all\nrows in the dataset. One value can be used for keys and another for values.\n\n``` php\n\u003c?php\n$data = $table-\u003egetColummn(0, 3);\n$newTable = new TableType(['User Id', 'Phone Number');\n$newTable-\u003eaddRows($data);\necho $newTable-\u003egetValue();\n```\nReturns:\n```\n+------------------------+---------------+\n| User Id                | Phone Number  |\n+------------------------+---------------+\n| user-1@example.com     | 01234123456   |\n| user-2@example.com     | 01234123456   |\n| user-3@example.com     | 01234123456   |\n| user-4@example.com     | 01234123456   |\n| user-5@example.com     | 01234123456   |\n| user-6@example.com     | 01234123456   |\n+------------------------+---------------+\n```\n-----\n\n## Contributing\n\n#### Bug Reports \u0026 Feature Requests\n\nPlease use the [issue tracker](https://github.com/lukebeer/broadworks-ocip/issues) to report any bugs or file feature requests.\n\n#### Developing\n\nPRs are welcome. To begin developing, do this:\n\n```bash\n$ curl -X POST -u \"GITHUB_USERNAME:GITHUB_PASSWORD\"  https://api.github.com/repos/lukebeer/broadworks-ocip/forks \u0026\u0026 history -c\n$ git clone github:GITHUB_USERNAME/broadworks-ocip \u0026\u0026\n$ cd broadworks-ocip\n```\n-------\n## Project layout\n```\n Builder\n  Builder.php                # Takes a ComplexType and converts to XML or XML string then wraps it in an envelope ready for shipping.\n  Restrictions\n   Enumeration.php           # Defines a list of acceptable values.\n   Length.php                # Specifies the exact number of characters or list items allowed. Must be equal to or greater than zero.\n   MaxExclusive.php          # Specifies the upper bounds for numeric values (the value must be less than this value).\n   MaxInclusive.php          # Specifies the upper bounds for numeric values (the value must be less than or equal to this value).\n   MaxLength.php             # Specifies the maximum number of characters or list items allowed. Must be equal to or greater than zero.\n   MinExclusive.php          # Specifies the lower bounds for numeric values (the value must be greater than this value).\n   MinInclusive.php          # Specifies the lower bounds for numeric values (the value must be greater than or equal to this value).\n   MinLength.php             # Specifies the minimum number of characters or list items allowed. Must be equal to or greater than zero.\n   Pattern.php               # Defines the exact sequence of characters that are acceptable.\n   Restriction.php           # Abstract base class all restrictions must extend.\n   RestrictionInterface.php  # Interface all Restrictins must implement.\n  Types\n   ComplexInterface.php      # Interface all ComplexTypes must implement.\n   ComplexType.php           # Defines a complex type element.\n   PrimitiveType.php         # Primitive type such as bool/int/string.\n   SimpleContent.php         # Contains extensions or restrictions on a text-only complex type or on a simple type as content and contains no elements.\n   SimpleInterface.php       # Interface all SimpleTypes must implement.\n   SimpleType.php            # Defines a simple type and specifies the constraints and information about the values of attributes or text-only elements.\n   TableType.php             # Used for OCITable responses only, never in requests.\n   TypeCheck.php             # Not implemented yet.\n   TypeMap.php               # Converts xs types to PHP types.\n   TypeTrait.php             # Common trait all types have.\n Client\n  Client.php                 # Main controller for the whole framework exposing methods for requests and responses.\n  Transport\n   SOAPTransport.php         # Communicates with Broadworks via http(s), this is the slowest but most robust transport type.\n   TCPTransport.php          # Communicates with Broadworks via a TCPStream on port 2208, this is the fastest transport type.\n   TransportInterface.php    # Interface all Transport types must implement.\n Console\n  Console.php                # Generates an array of commands for the interactive console.\n Logging\n  ErrorControl.php           # Crappy logging object, needs nuking and starting again.\n Output\n  ConsoleOutput.php          # Output type for the interactive console.\n  JSONOutput.php             # Generates and echos JSON.\n  OutputInterface.php        # Output interface all Outputs must implement.\n Response\n  Response.php               # Takes XML input and returns response object specified or false if error.\n  ResponseOutput.php         # Convenience class for selecting response output format.\n Serializer\n  SerializerInterface.php    # Interface all Serializers must implement.\n  XMLSerializer.php          # Converts XML into the requested object type automatically, very much the brain of this.\n Session\n  Session.php                # Portable Session object used to store details of the current authenticated session.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flukebeer%2Fbroadworks-ocip","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flukebeer%2Fbroadworks-ocip","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flukebeer%2Fbroadworks-ocip/lists"}