PHP 7.1以降およびjson拡張子。
composer require innoscripta/ sipgate sipgateクラスを初期化します。
$ sipgate = Orkhanahmadov sipgate sipgate ();基本認証
クラスを初期化するときに、基本認証のユーザー名とパスワードを渡すことができます。
$ sipgate = Orkhanahmadov sipgate sipgate ( ' [email protected] ' , ' secret ' );または、 setBasicAuthCredentials()メソッドを使用して基本認証を設定できます。
$ sipgate = Orkhanahmadov sipgate sipgate ();
$ sipgate -> setBasicAuthCredentials ( ' [email protected] ' , ' secret ' );アカウント情報:
$ sipgate -> account ();アカウントの詳細の配列を返します。
ユーザーを取得します。
$ sipgate -> users ();アカウントに登録されているユーザーの配列を返します。配列内の各項目はOrkhanahmadov sipgate ResourcesUserのインスタンスであり、次のプロパティがあります。
$ user -> id ; // string
$ user -> firstname ; // string
$ user -> lastname ; // string
$ user -> email ; // string
$ user -> defaultDevice ; // string
$ user -> busyOnBusy ; // bool
$ user -> addressId ; // string
$ user -> directDialIds ; // array
$ user -> admin ; // boolユーザーデバイスを取得します。
ユーザーのデバイスを取得するには、 devices()メソッドを使用し、ユーザー インスタンスまたはユーザー ID を渡します。
$ sipgate -> devices ( $ user );
// or
$ sipgate -> devices ( ' ABC-123 ' );指定されたユーザーに登録されているデバイスの配列を返します。配列内の各項目はOrkhanahmadov sipgate ResourcesDeviceのインスタンスであり、次のプロパティがあります。
$ device -> id ; // string
$ device -> alias ; // string
$ device -> type ; // string
$ device -> online ; // bool
$ device -> dnd ; // bool
$ device -> activePhonelines ; // array
$ device -> activeGroups ; // array
$ device -> credentials ; // array
$ device -> registered ; // array
$ device -> emergencyAddressId ; // string
$ device -> addressUrl ; // stringアクティブな通話:
現在確立されている呼び出しのリストを取得するには、 calls()メソッドを使用します。
$ sipgate -> calls ();現在確立されている呼び出しの配列を返します。配列内の各項目はOrkhanahmadov sipgate ResourcesCallのインスタンスであり、次のプロパティがあります。
$ call -> id ; // string
$ call -> firstname ; // string
$ call -> lastname ; // string
$ call -> email ; // string
$ call -> defaultDevice ; // string
$ call -> busyOnBusy ; // bool
$ call -> addressId ; // string
$ call -> directDialIds ; // array
$ call -> admin ; // bool新しい通話を開始します:
新しい呼び出しを開始するには、 call()メソッドを使用します。メソッドは 3 つのパラメータを受け入れます。
$device - デバイスまたはデバイス ID のインスタンスを受け入れます。これにより、通話に使用するデバイスが定義されます。$callee - 電話をかけたい電話番号。$callerId (オプション) - 他の呼び出し先に別の番号を表示したい場合は、このパラメータを設定します。スキップすると$device番号が使用されます。 $ sipgate -> call ( $ device , $ callee , $ callerId );呼び出しのセッション ID を返します。
進行中の通話を終了します:
進行中の通話を終了するには、 hangup()メソッドを使用します。メソッドはコール ID をパラメータとして受け取ります。
$ sipgate -> hangup ( ' ABC-123 ' );進行中の通話を録音します。
進行中の通話を記録するには、 record()メソッドを使用します。メソッドは 3 つのパラメータを受け入れます。
$callId - 一意のコール ID。$value - trueまたはfalse 、記録の開始または停止を定義します。$announcement - trueまたはfalse 、録音中の通話に関するアナウンスを再生するかどうかを定義します。 $ sipgate -> record ( $ callId , $ value , $ announcement );通話履歴:
通話履歴を取得するには、 history()メソッドを使用します。メソッドはオプションの配列を受け入れます。
connectionIds - array 、拡張子のリストを定義しますtypes - array 、履歴で受信するタイプのリストを定義します。「CALL」、「VOICEMAIL」、「SMS」、「FAX」の多くの値のうちの 1 つが含まれる場合があります。directions - array 。履歴で受信する通話方向のリストを定義します。次の値のうちの 1 つが含まれる場合があります: "INCOMING"、"OUTGOING"、"MISSED_INCOMING"、"MISSED_OUTGOING"archived - bool 、アーカイブされた履歴アイテムのみを受信する場合はtrueに設定しますstarred - スター付きまたはスターなしの履歴アイテムを受信するかどうかを定義します。「STARRED」、「UNSTARRED」のいずれかです。from - 履歴の開始日を定義します。 ISO8601形式である必要がありますto - 履歴の終了日を定義します。 ISO8601形式である必要がありますphonenumber - 履歴内で検索する電話番号を定義しますlimit - 履歴アイテムの「ページごと」の値を定義しますoffset - 履歴アイテムの「オフセット」値を定義します $ sipgate -> history ([ ' from ' => ' 2019-07-10T19:32:18Z ' , ' to ' => ' 2019-07-22T19:32:18Z ' ]);履歴項目の配列を返します。配列内の各項目はOrkhanahmadov sipgate ResourcesHistoryのインスタンスであり、次のプロパティがあります。
$ history -> id ; // string
$ history -> source ; // string
$ history -> target ; // string
$ history -> sourceAlias ; // string
$ history -> targetAlias ; // string
$ history -> type ; // string
$ history -> created ; // string
$ history -> lastModified ; // string
$ history -> direction ; // string
$ history -> incoming ; // bool
$ history -> status ; // string
$ history -> connectionIds ; // array
$ history -> read ; // bool
$ history -> archived ; // bool
$ history -> note ; // string
$ history -> endpoints ; // array
$ history -> starred ; // bool
$ history -> labels ; // array
$ history -> callId ; // string
$ history -> recordingUrl ; // string
$ history -> recordings ; // array
$ history -> duration ; // int
$ history -> responder ; // string
$ history -> responderAlias ; // string composer test 最近の変更点の詳細については、CHANGELOG を参照してください。
詳細については、「貢献」を参照してください。
セキュリティ関連の問題を発見した場合は、問題トラッカーを使用する代わりに、[email protected] に電子メールを送信してください。
MIT ライセンス (MIT)。詳細については、ライセンス ファイルを参照してください。