NotifyAction - グローバル
NotifyAction API を使用すると、電話通信プロバイダーに送信するアクションを定義できます。
アクションを NotifyAction オブジェクトに追加するには、アクションのタイプごとにそれぞれの add 関数を呼び出します。各 add 関数は、 addSay() メソッドの SayAction オブジェクトなどの Action オブジェクトを返します。返されるオブジェクトの詳細については、各メソッドの例を参照してください。
NotifyAction - addConference()
現在のコールを現在のカンファレンスに移動する会議アクションを追加します。
| 名前 | タイプ | 説明 |
|---|---|---|
| なし |
| タイプ | 説明 |
|---|---|
| カンファレンスアクション | NotifyAction オブジェクトに追加されたアクション。ConferenceAction オブジェクトを使用して、カンファレンスの名前と、参加者が参加または退出したときのカンファレンスの動作を定義します。 |
この例では、会議アクションを追加し、会議の名前を設定する方法を示します。
// instantiate NotifyAction
var notifyAction = new SNC.NotifyAction();
// add a conference call action and set its name
var conference = notifyAction.addConference();
conference.setName('Brown Bag: Week 3');
NotifyAction - addConference.setEndOnExit(ブール値 endOnExit)
指定された発信者がカンファレンスコールを終了したときにカンファレンスコールを終了するかどうかを定義します。
| 名前 | タイプ | 説明 |
|---|---|---|
| endOnExit | ブーリアン | 指定された発信者が現在のカンファレンスコールを終了したときにカンファレンスコールを終了するかどうかを示すフラグ。
|
| タイプ | 説明 |
|---|---|
| なし |
この例では、カンファレンスアクションを追加し、指定した発信者が退出したときにカンファレンスが終了するように設定する方法を示します。
// instantiate NotifyAction
var notifyAction = new SNC.NotifyAction();
// add a conference call action and set the caller that starts the meeting
var conference = notifyAction.addConference();
// retrieve the participant for which the conference call should exit when they leave
var notifyParticipantGr = new GlideRecord('notify_participant');
notifyParticipantGr.get('active participant sys id');
if (notifyParticipantGr.isValid) {
conference.setEndOnExit(true);
}
NotifyAction - addConference.setHangupOnStar(ブール値 hangupOnStar)
参加者が星 (*) キーを押したときにカンファレンスコールを終了するかどうかを定義します。
| 名前 | タイプ | 説明 |
|---|---|---|
| hangupOnStar | ブーリアン | 参加者がスター (*) キーを押したときにカンファレンスコールを終了するかどうかを示すフラグ。 有効な値:
|
| タイプ | 説明 |
|---|---|
| なし |
この例では、会議アクションを追加してカンファレンスコールを記録する方法を示します。
// instantiate NotifyAction
var notifyAction = new SNC.NotifyAction();
// add a conference call action and set the hang up action
var conference = notifyAction.addConference();
conference.setHangupOnStar(true);
NotifyAction - addConference.setMuted(ブール値ミュート)
現在のカンファレンスコールで指定された発信者をミュートするかどうかを定義します。
このメソッドを呼び出さない場合、呼び出し元はデフォルトでミュートされません。
| 名前 | タイプ | 説明 |
|---|---|---|
| ミュート状態 | ブーリアン | 現在のカンファレンスコールで指定された発信者をミュートするかどうかを示すフラグ。
|
| タイプ | 説明 |
|---|---|
| なし |
この例では、会議アクションを追加してから、指定した発信者をミュートする方法を示します。
// instantiate NotifyAction
var notifyAction = new SNC.NotifyAction();
// add a conference call action and set it to mute the specified participant
var conference = notifyAction.addConference();
var notifyParticipantGr = new GlideRecord('notify_participant');
notifyParticipantGr.get('active participant sys id');
if (notifyParticipantGr.isValid) {
conference.setMuted(true);
}
NotifyAction - addConference.setName(文字列名)
現在のカンファレンスの名前を指定された名前に設定します。
| 名前 | タイプ | 説明 |
|---|---|---|
| name | 文字列 | 現在のカンファレンスコールに関連付ける名前。 |
| タイプ | 説明 |
|---|---|
| なし |
この例では、会議アクションを追加し、カンファレンスの名前を設定する方法を示します。
// instantiate NotifyAction
var notifyAction = new SNC.NotifyAction();
// add a conference call action and set its name
var conference = notifyAction.addConference();
conference.setName('Brown Bag: Week 3');
NotifyAction - addConference.setRecord(ブール record)
関連付けられたカンファレンスコールを録音するかどうかを定義します。
このメソッドを呼び出さない場合、デフォルトではカンファレンスは記録されません。
| 名前 | タイプ | 説明 |
|---|---|---|
| レコード | ブーリアン | 現在のカンファレンスコールを記録するかどうかを示すフラグ。
|
| タイプ | 説明 |
|---|---|
| なし |
この例では、会議アクションを追加してカンファレンスコールを記録する方法を示します。
// instantiate NotifyAction
var notifyAction = new SNC.NotifyAction();
// add a conference call action and set it to be recorded
var conference = notifyAction.addConference();
conference.setRecord(true);
NotifyAction - addConference.setStartOnEnter(ブール値 startOnEnter)
指定された発信者がカンファレンスコールに参加したときにカンファレンスコールを開始するかどうかを定義します。
デフォルトでは、発信者が 2 人以上いると、カンファレンスコールが開始されます。特定の発信者が参加したときにのみカンファレンスコールが開始されるようにするには、他の各発信者に対してこのメソッドを呼び出し、値を「false」に設定する必要があります。これにより、目的のユーザーがカンファレンスコールに参加するまでカンファレンスは開始されません。
| 名前 | タイプ | 説明 |
|---|---|---|
| startOnEnter | ブーリアン | 選択した発信者が現在のカンファレンスコールに参加したときにカンファレンスコールを開始するかどうかを示すフラグ。
|
| タイプ | 説明 |
|---|---|
| なし |
この例では、会議アクションを追加し、指定された発信者が参加するまでカンファレンスが開始されないように設定する方法を示します。
// instantiate NotifyAction
var notifyAction = new SNC.NotifyAction();
// add a conference call action and set the caller that starts the meeting
var conference = notifyAction.addConference();
// retrieve the participant for which the conference call should start when they arrive
var notifyParticipantGr = new GlideRecord('notify_participant');
notifyParticipantGr.get('active participant sys id');
if (notifyParticipantGr.isValid) {
conference.setStartOnEnter(true);
}
NotifyAction - addDial()
指定された電話番号または通知クライアントにコールを転送します。
addDial アクションを作成したら、関連する電話番号 (setPhoneNumber()) または通知クライアント (setClientRecord()) も設定する必要があります。
| 名前 | タイプ | 説明 |
|---|---|---|
| なし |
| タイプ | 説明 |
|---|---|
| ダイヤルアクション | NotifyAction オブジェクトに追加されたアクション。 |
この例では、発信コールを実行し、コールを録音する方法を示します。
// Initialize NotifyAction
var notifyAction = new SNC.NotifyAction();
// Call addDial() to connect to another party – this returns an object of type DialAction
var dialAction = notifyAction.addDial();
// Call setPhoneNumber(String phoneNumber)in DialAction.java to specify the phone number to dial
dialAction.setPhoneNumber('+919765xxxxxxx');
// Invoke setRecord(Boolean record) to record the call to this new number +919765xxxxxxx
dialAction.setRecord(true);
NotifyAction - addDial.setCallerID(文字列 callerID)
発信コールの発信者 ID を定義します。
| 名前 | タイプ | 説明 |
|---|---|---|
| 発信者 ID | 文字列 | 発信コールに設定する発信者識別子。 |
| タイプ | 説明 |
|---|---|
| なし |
この例では、発信コールを実行し、コールタイムアウトを設定する方法を示します。
// Initialize NotifyAction
var notifyAction = new SNC.NotifyAction();
// Call addDial() to connect to another party – this returns an object of type DialAction
var dialAction = notifyAction.addDial();
// Call setPhoneNumber(String phoneNumber)in DialAction.java to specify the phone number to dial
dialAction.setPhoneNumber('+919765xxxxxxx');
// Set the caller ID
dialAction.setCallerID('Planning Conf Call');
NotifyAction - addDial.setClientRecord(String tableName, String sysID)
通知発信者レコードと発信者の一意の識別子を見つけるテーブルを指定して、現在の発信者を通知発信者に設定します。
| 名前 | タイプ | 説明 |
|---|---|---|
| tableName | 文字列 | 目的の発信者の情報を含むテーブルの名前。 |
| sysID | 文字列 | 目的の通知発信者の一意の識別子 (sys_id)。 |
| タイプ | 説明 |
|---|---|
| なし |
この例では、setClientRecord() を使用して現在の発信者を通知発信者に設定する方法を示します。
// set up a dial action to forward the
// call to the specified client
var action = new SNC.NotifyAction();
var dial = action.addDial();
dial.setClientRecord(notifyClientRecord.getTableName(), notifyClientRecord.getUniqueValue());
dial.setTimeout(activity.vars.timeout);
dial.setRecord(activity.vars.record);
NotifyAction - addDial.setDTMF(文字列値)
コールが接続されたときに再生する DTMF トーンを定義します。
| 名前 | タイプ | 説明 |
|---|---|---|
| value | 文字列 | 通話が接続されたときに再生される有効な DTMF 数字。 |
| タイプ | 説明 |
|---|---|
| なし |
この例では、発信コールの発信方法を示し、コールが接続されたときに再生する DTMF トーンを定義します。
// Initialize NotifyAction
var notifyAction = new SNC.NotifyAction();
// Call addDial() to connect to another party - this returns an object of type DialAction
var dialAction = notifyAction.addDial();
// Call setPhoneNumber(String phoneNumber)in DialAction.java to specify the phone number to dial
dialAction.setPhoneNumber('+919765xxxxxxx');
// DTMF tones to play when call connects
dialAction.setDTMF("1246AF");
NotifyAction - addDial.setHangupOnStar(ブール値 hangupOnStar)
星 (*) キーが押されたときにコールを終了するかどうかを定義します。
| 名前 | タイプ | 説明 |
|---|---|---|
| hangupOnStar | ブーリアン | 星 (*) キーが押されたときにコールを終了するかどうかを示すフラグ。
|
| タイプ | 説明 |
|---|---|
| なし |
この例では、発信コールを発信し、切断キーを星印に設定する方法を示します。
// Initialize NotifyAction
var notifyAction = new SNC.NotifyAction();
// Call addDial() to connect to another party – this returns an object of type DialAction
var dialAction = notifyAction.addDial();
// Call setPhoneNumber(String phoneNumber)in DialAction.java to specify the phone number to dial
dialAction.setPhoneNumber('+919765xxxxxxx');
// End call by pressing star
dialAction.setHangupOnStar(true);
NotifyAction - addDial.setPhoneNumber(String phoneNumber)
発信先の電話番号を定義します。
| 名前 | タイプ | 説明 |
|---|---|---|
| phoneNumber | 文字列 | 発信先の E.164 準拠の電話番号。 |
| タイプ | 説明 |
|---|---|
| なし |
この例では、発信コールを実行し、コールタイムアウトを設定する方法を示します。
// Initialize NotifyAction
var notifyAction = new SNC.NotifyAction();
// Call addDial() to connect to another party – this returns an object of type DialAction
var dialAction = notifyAction.addDial();
// Call setPhoneNumber(String phoneNumber)in DialAction.java to specify the phone number to dial
dialAction.setPhoneNumber('+919765xxxxxxx');
NotifyAction - addDial.setRecord(Boolean record)
発信コールを録音するかどうかを定義します。
| 名前 | タイプ | 説明 |
|---|---|---|
| レコード | 発信コールを録音するかどうかを示すフラグ。 有効な値:
|
| タイプ | 説明 |
|---|---|
| なし |
この例では、発信コールを実行し、コールを録音する方法を示します。
// Initialize NotifyAction
var notifyAction = new SNC.NotifyAction();
// Call addDial() to connect to another party – this returns an object of type DialAction
var dialAction = notifyAction.addDial();
// Call setPhoneNumber(String phoneNumber)in DialAction.java to specify the phone number to dial
dialAction.setPhoneNumber('+919765xxxxxxx');
// Record the call
dialAction.setRecord(true);
NotifyAction - addDial.setTimeout(整数タイムアウト)
発信コールがタイムアウトするまでの秒数を設定します。
| 名前 | タイプ | 説明 |
|---|---|---|
| timeout | 整数 | 発信コールがタイムアウトするまでの秒数。デフォルト値:30 |
| タイプ | 説明 |
|---|---|
| なし |
この例では、発信コールを実行し、コールタイムアウトを設定する方法を示します。
// Initialize NotifyAction
var notifyAction = new SNC.NotifyAction();
// Call addDial() to connect to another party – this returns an object of type DialAction
var dialAction = notifyAction.addDial();
// Call setPhoneNumber(String phoneNumber)in DialAction.java to specify the phone number to dial
dialAction.setPhoneNumber('+919765xxxxxxx');
// Set the number of seconds to wait before timing out
dialAction.setTimeout(45);
NotifyAction - addGather()
指定された対話型電話メニューを発信者に表示します。
| 名前 | タイプ | 説明 |
|---|---|---|
| なし |
| タイプ | 説明 |
|---|---|
| GatherAction | NotifyAction オブジェクトに追加されたアクション。GatherAction オブジェクトを使用して、ユーザーに表示するメニュー設定とオプションを定義します。 |
// instantiate NotifyAction
var notifyAction = new SNC.NotifyAction();
// present the user with a menu
var gather = notifyAction.addGather();
gather.setNumberOfDigits(1); // the user can type 1 digit
gather.setFinishKey('#'); // # or *, useful for > 1 digit
gather.setTimeout(10); // time to enter answer, in seconds
// add first menu item
var usSay = gather.addSay();
usSay.setText('Press 1 for english');
usSay.setLanguage('en-US');
// add second menu item
var nlSay = gather.addSay();
nlSay.setText('Kies 2 voor Nederlands');
nlSay.setLanguage('nl-NL');
// add third menu item
var frSay = gather.addSay();
frSay.setText('Choisissez 3 pour le français.');
frSay.setLanguage('fr-FR');
// and finish off with an applause
var play = gather.addPlay();
play.setURL('http://www.wavsource.com/snds_2015-04-12_5971820382841326/sfx/applause_y.wav');
NotifyAction - addGather.addPlay()
通話中にオーディオファイルを再生します。
サポートされている子メソッドの説明については、NotifyAction addPlay() メソッドを参照してください。
| 名前 | タイプ | 説明 |
|---|---|---|
| なし |
| タイプ | 説明 |
|---|---|
| プレイアクション | NotifyAction オブジェクトに追加されたアクション。PlayAction オブジェクトを使用して、オーディオファイルの URL とオーディオをループする回数を定義します。 |
// instantiate NotifyAction
var notifyAction = new SNC.NotifyAction();
// Create the gather action object
var gather = notifyAction.addGather();
// Play an audio file
var play = gather.addPlay();
play.setURL('http://www.wavsource.com/snds_2015-04-12_5971820382841326/sfx/applause_y.wav');
NotifyAction - addGather.addSay()
通話中に読み上げるテキスト読み上げを定義します。
サポートされている子メソッドの説明については、NotifyAction addSay() メソッドを参照してください。
| 名前 | タイプ | 説明 |
|---|---|---|
| なし |
| タイプ | 説明 |
|---|---|
| Sayアクション | NotifyAction オブジェクトに追加されたアクション。SayAction オブジェクトを使用して、読み上げるテキストと言語を定義します。 |
// instantiate NotifyAction
var notifyAction = new SNC.NotifyAction();
// present the user with a menu
var gather = notifyAction.addGather();
gather.setNumberOfDigits(1); // the user can type 1 digit
gather.setTimeout(20); // time to enter answer, in seconds
// add first menu item
var gatherSay = gather.addSay();
gatherSay.setText('Press 1 for english');
gatherSay.setLanguage('en-US');
NotifyAction - addGather.setFinishKey(文字列 finishKey)
発信者が入力の終了を示すキーを定義します。
| 名前 | タイプ | 説明 |
|---|---|---|
| 終了キー | 文字列 | 発信者入力の終了を示すキー。 有効な値:
|
| タイプ | 説明 |
|---|---|
| なし |
この例では、収集アクションを追加し、発信者入力の終了を示すキーを定義する方法を示します。
// instantiate NotifyAction
var notifyAction = new SNC.NotifyAction();
var gather = notifyAction.addGather();
gather.setNumberOfDigits(4); // the user can type four digit
gather.setFinishKey('#'); // # or *, useful for > 1 digit
NotifyAction - addGather.setNumberOfDigits(Integer numberOfDigits)
収集する桁数を定義します。
| 名前 | タイプ | 説明 |
|---|---|---|
| numberOfDigits | 整数 | 収集する桁数。ゼロは無効な値です。 |
| タイプ | 説明 |
|---|---|
| なし |
この例では、収集アクションを追加し、収集するキーストローク数を定義する方法を示します。
// instantiate NotifyAction
var notifyAction = new SNC.NotifyAction();
// present the user with a menu
var gather = notifyAction.addGather();
gather.setNumberOfDigits(4); // the user can type four digit
gather.setFinishKey('#'); // # or *, useful for > 1 digits
gather.setTimeout(20); // time to enter answer, in seconds
NotifyAction - addGather.setTimeout(整数タイムアウト)
入力の収集がタイムアウトするまでの時間を定義します。
| 名前 | タイプ | 説明 |
|---|---|---|
| timeout | 整数 | タイムアウトするまでに発信者入力を待機する秒数。デフォルト値:10 |
| タイプ | 説明 |
|---|---|
| なし |
この例では、収集アクションを追加し、入力タイムアウト値を定義する方法を示します。
// instantiate NotifyAction
var notifyAction = new SNC.NotifyAction();
// present the user with a menu
var gather = notifyAction.addGather();
gather.setNumberOfDigits(4); // the user can type 1 digit
gather.setFinishKey('#'); // # or *, useful for > 1 digits
gather.setTimeout(20); // time to enter answer, in seconds
NotifyAction - addHangUp()
アクティブな電話を終了します。
| 名前 | タイプ | 説明 |
|---|---|---|
| なし |
| タイプ | 説明 |
|---|---|
| HangUpAction | NotifyAction オブジェクトに追加されたアクション。 |
// instantiate NotifyAction
var notifyAction = new SNC.NotifyAction();
// hang up
notifyAction.addHangUp();
NotifyAction - addQueue()
コールをキューに入れ、コールを保留状態にします。
| 名前 | タイプ | 説明 |
|---|---|---|
| なし |
| タイプ | 説明 |
|---|---|
| キューアクション | NotifyAction オブジェクトに追加されたアクション。QueueAction オブジェクトを使用して、キュー名、キューイングまたはキュー取り出しの動作を定義します。 |
この例では、指定したキューにコールを追加する方法を示します。
// instantiate NotifyAction
var notifyAction = new SNC.NotifyAction();
// queue the call
var queue = notifyAction.addQueue();
queue.setName('my queue');
この例では、キューからコールを削除する方法を示します。
// instantiate NotifyAction
var notifyAction = new SNC.NotifyAction();
// dequeue the call
var queue = notifyAction.addQueue();
queue.setDequeue(true);
NotifyAction - addQueue.setDequeue(Boolean dequeue)
現在のコールキューからコールを削除します (「保留」から削除します)。
| 名前 | タイプ | 説明 |
|---|---|---|
| キューから取り出す | ブーリアン | キューから現在のコールを削除するかどうかを示すフラグ。
|
| タイプ | 説明 |
|---|---|
| なし |
この例では、キューからコールを削除する方法を示します。
// instantiate NotifyAction
var notifyAction = new SNC.NotifyAction();
// dequeue the call
var queue = notifyAction.addQueue();
queue.setDequeue(true);
NotifyAction - addQueue.setName(文字列名)
キューに関連付けられた名前を定義します。
| 名前 | タイプ | 説明 |
|---|---|---|
| name | 文字列 | キューに関連付ける名前。 |
| タイプ | 説明 |
|---|---|
| なし |
この例では、キューの名前を定義する方法を示します。
// instantiate NotifyAction
var notifyAction = new SNC.NotifyAction();
// queue the call
var queue = notifyAction.addQueue();
queue.setName('my queue');
NotifyAction - addPlay()
通話中にオーディオファイルを再生します。
| 名前 | タイプ | 説明 |
|---|---|---|
| なし |
| タイプ | 説明 |
|---|---|
| プレイアクション | NotifyAction オブジェクトに追加されたアクション。PlayAction オブジェクトを使用して、オーディオファイルの URL とオーディオをループする回数を定義します。 |
// instantiate NotifyAction
var notifyAction = new SNC.NotifyAction();
// add a play action
var play = notifyAction.addPlay();
play.setURL('http://www.moviesounds.com/2001/imsorry.wav');
play.setLoop(1);
NotifyAction - addPlay.setLoop(整数ループ)
オーディオファイルを再生 (ループスルー) する回数を定義します。
| 名前 | タイプ | 説明 |
|---|---|---|
| ループ | 整数 | オーディオファイルを再生する回数。 |
| タイプ | 説明 |
|---|---|
| なし |
// instantiate NotifyAction
var notifyAction = new SNC.NotifyAction();
// add a play action
var play = notifyAction.addPlay();
play.setURL('http://www.moviesounds.com/2001/imsorry.wav');
play.setLoop(2);
NotifyAction - addPlay.setURL(文字列 url)
再生するオーディオファイルを取得する URL を定義します。
| 名前 | タイプ | 説明 |
|---|---|---|
| URL | 文字列 | 再生するオーディオファイルの URL。 |
| タイプ | 説明 |
|---|---|
| なし |
// instantiate NotifyAction
var notifyAction = new SNC.NotifyAction();
// add a play action
var play = notifyAction.addPlay();
play.setURL('http://www.moviesounds.com/2001/imsorry.wav');
play.setLoop(1);
NotifyAction - addRecord()
現在の NotifyAction オブジェクトへの呼び出しを記録するアクションを追加します。
通話が完了するか、指定された終了 (setFinishKey()) が押されると、記録は自動的に終了します。その後、記録は、関連するコールのnotify_recordテーブルに配置されます。
| 名前 | タイプ | 説明 |
|---|---|---|
| なし |
| タイプ | 説明 |
|---|---|
| なし |
この例では、通話を録音する方法を示します。
// First we initialize NotifyAction
var notifyAction = new SNC.NotifyAction();
// Call addRecord() of NotifyAction – This returns an object of type RecordAction
var recordAction = notifyAction.addRecord();
// Optional. Define the key that callers use to stop the recording
recordAction.setFinishKey('#'); // Stop the call recording when caller presses the '#' key.
NotifyAction - addRecord.setFinishKey(文字列 finishKey)
記録を終了するキーを定義します。
| 名前 | タイプ | 説明 |
|---|---|---|
| 終了キー | 文字列 | 記録を終了するキー。 有効な値:
|
| タイプ | 説明 |
|---|---|
| なし |
この例では、コールを録音し、コール終了キーを設定する方法を示します。
// First we initialize NotifyAction
var notifyAction = new SNC.NotifyAction();
// Then we call addRecord() of NotifyAction
var recordAction = notifyAction.addRecord();
// Set the key that terminates the recording
recordAction.setFinishKey('#'); // This means that we stop the call recording when user presses the '#' key.
NotifyAction - addRecord.setMaxDuration(Integer seconds)
記録の最大長を定義します。
| 名前 | タイプ | 説明 |
|---|---|---|
| 秒 | 整数 | 記録の最大長 (秒)。デフォルト:3600 |
| タイプ | 説明 |
|---|---|
| なし |
この例では、コールを録音し、コール終了キーを設定する方法を示します。
// First we initialize NotifyAction
var notifyAction = new SNC.NotifyAction();
// Then we call addRecord() of NotifyAction
var recordAction = notifyAction.addRecord();
// Set the maximum length of the recording
recordAction.setMaxDuration(4800);
NotifyAction - addRecord.setTimeout(整数タイムアウト)
記録が終了する無音の秒数を設定します。
| 名前 | タイプ | 説明 |
|---|---|---|
| timeout | 整数 | コール中の無音の秒数で、この秒数が経過すると記録が終了します。デフォルト値:10 |
| タイプ | 説明 |
|---|---|
| なし |
この例では、通話を録音し、録音タイムアウト値を設定する方法を示します。
// First we initialize NotifyAction
var notifyAction = new SNC.NotifyAction();
// Then we call addRecord() of NotifyAction
var recordAction = notifyAction.addRecord();
// Set the recoding timeout value
recordAction.setTimeout(360);
NotifyAction:addReject()
着信コールを拒否します。
| 名前 | タイプ | 説明 |
|---|---|---|
| なし |
| タイプ | 説明 |
|---|---|
| アクションを却下 | NotifyAction オブジェクトに追加されたアクション。RejectAction オブジェクトを使用して、コールを拒否する理由を定義します。 |
// instantiate NotifyAction
var notifyAction = new SNC.NotifyAction();
// reject the call
var rejectAction = notifyAction.addReject();
rejectAction.setReason('busy'); // 'busy' or 'rejected'
NotifyActon - addReject.setReason(文字列 reason)
コールが拒否された理由を定義します。
| 名前 | タイプ | 説明 |
|---|---|---|
| 理由 | 文字列 | コールが却下された理由。 有効な値:
|
| タイプ | 説明 |
|---|---|
| なし |
// instantiate NotifyAction
var notifyAction = new SNC.NotifyAction();
// reject the call
var rejectAction = notifyAction.addReject();
rejectAction.setReason('busy'); // 'busy' or 'rejected'
NotifyAction - addSay()
通話中に読み上げるテキスト読み上げを定義します。
テキスト読み上げ機能では、複数の言語がサポートされています。使用可能な言語は、電話通信プロバイダーによって異なります。
| 名前 | タイプ | 説明 |
|---|---|---|
| なし |
| タイプ | 説明 |
|---|---|
| Sayアクション | NotifyAction オブジェクトに追加されたアクション。SayAction オブジェクトを使用して、読み上げるテキストと言語を定義します。 |
この例では、複数の言語のテキストを読み上げる方法を示します。
// instantiate NotifyAction
var notifyAction = new SNC.NotifyAction();
// add a say action to say something in US English
var usSay = notifyAction.addSay();
usSay.setText('Welcome. I can speak english');
usSay.setLanguage('en-US');
// add a say action to say something in Dutch
var nlSay = notifyAction.addSay();
nlSay.setText('Ik spreek ook vloeiend nederlands');
nlSay.setLanguage('nl-NL');
// and german
var deSay = notifyAction.addSay();
deSay.setText('Und ich kan auch deutsch sprechen');
deSay.setLanguage('de-DE');
NotifyAction - addSay.setLanguage(文字列言語)
テキストを読み上げる言語を定義します。
このメソッドを setText() メソッドと組み合わせて使用して、話す表現を定義します。
| 名前 | タイプ | 説明 |
|---|---|---|
| 言語 | 文字列 | 関連するテキストを読み上げる言語を定義する ISO 3166 言語コード。たとえば、「en-US」や「nl-NL」などです。 |
| タイプ | 説明 |
|---|---|
| なし |
この例では、複数の言語のテキストを読み上げる方法を示します。
// instantiate NotifyAction
var notifyAction = new SNC.NotifyAction();
// add a say action to say something in US English
var usSay = notifyAction.addSay();
usSay.setText('Welcome. I can speak english');
usSay.setLanguage('en-US');
// add a say action to say something in Dutch
var nlSay = notifyAction.addSay();
nlSay.setText('Ik spreek ook vloeiend nederlands');
nlSay.setLanguage('nl-NL');
// and german
var deSay = notifyAction.addSay();
deSay.setText('Und ich kan auch deutsch sprechen');
deSay.setLanguage('de-DE');
NotifyAction - addSay.setText(文字列テキスト)
現在のコール内で読み取られるテキストを定義します。
このメソッドを setLanguage() メソッドと組み合わせて使用し、指定されたテキストを読み上げる言語を定義します。
| 名前 | タイプ | 説明 |
|---|---|---|
| テキスト | 文字列 | 現在のコール内で読み上げるテキスト。 |
| タイプ | 説明 |
|---|---|
| なし |
この例では、複数の言語のテキストを読み上げる方法を示します。
// instantiate NotifyAction
var notifyAction = new SNC.NotifyAction();
// add a say action to say something in US English
var usSay = notifyAction.addSay();
usSay.setText('Welcome. I can speak english');
usSay.setLanguage('en-US');
// add a say action to say something in Dutch
var nlSay = notifyAction.addSay();
nlSay.setText('Ik spreek ook vloeiend nederlands');
nlSay.setLanguage('nl-NL');
// and german
var deSay = notifyAction.addSay();
deSay.setText('Und ich kan auch deutsch sprechen');
deSay.setLanguage('de-DE');
NotifyAction - addSMS()
SMS メッセージを送信します。
| 名前 | タイプ | 説明 |
|---|---|---|
| なし |
| タイプ | 説明 |
|---|---|
| SMS アクション | NotifyAction オブジェクトに追加されたアクション。SMSAction オブジェクトを使用して、メッセージの送信先のメッセージテキストと電話番号を定義します。 |
// Instantiate NotifyAction
var notifyAction = new SNC.NotifyAction();
// Define where to send the SMS to
var number = new GlideElementPhoneNumber();
number.setPhoneNumber('+31612345678', true);
// Add an SMS action
var sms = notifyAction.addSMS();
sms.setMessage('Lorem ipsum dolor sit amet, consectetur adipiscing elit.');
sms.setTo(number);
NotifyAction - addSMS.setMessage(文字列メッセージ)
送信する SMS メッセージのテキストを定義します。
| 名前 | タイプ | 説明 |
|---|---|---|
| message | 文字列 | 送信する SMS メッセージのテキスト。 |
| タイプ | 説明 |
|---|---|
| なし |
// instantiate NotifyAction
var notifyAction = new SNC.NotifyAction();
// define where to send the sms to
var number = new GlideElementPhoneNumber();
number.setPhoneNumber('+31612345678', true);
// add a SMS action
var sms = notifyAction.addSMS();
sms.setMessage('Lorem ipsum dolor sit amet, consectetur adipiscing elit.');
sms.setTo(number);
NotifyAction - addSMS.setTo(String to)
SMS メッセージを送信する電話番号を設定します。
| 名前 | タイプ | 説明 |
|---|---|---|
| 次へ | 文字列 | SMS メッセージの送信先の E.164 準拠の電話番号。 |
| タイプ | 説明 |
|---|---|
| なし |
// instantiate NotifyAction
var notifyAction = new SNC.NotifyAction();
// define where to send the sms to
var number = new GlideElementPhoneNumber();
number.setPhoneNumber('+31612345678', true);
// add a SMS action
var sms = notifyAction.addSMS();
sms.setMessage('Lorem ipsum dolor sit amet, consectetur adipiscing elit.');
sms.setTo(number);
NotifyAction - append(NotifyAction アクション)
指定された NotifyAction オブジェクトを現在のクライアントの NotifyAction オブジェクトに追加します。
- プレイアクション
- レコードアクション
- Sayアクション
- SMS アクション
他のすべての NotifyActions はターミナルです。ターミナルアクションの後に別の NotifyAction を追加しようとすると、呼び出しは失敗します。
| 名前 | タイプ | 説明 |
|---|---|---|
| action | 通知アクション | 現在の発信者の NotifyAction オブジェクトに追加する NotifyAction オブジェクト。 |
| タイプ | 説明 |
|---|---|
| なし |
NotifyAction - fromJson(文字列 json)
JSON 文字列から NotifyAction オブジェクトを逆シリアル化します。
| 名前 | タイプ | 説明 |
|---|---|---|
| json | 文字列 | NotifyAction オブジェクトの JSON 文字列表現。 |
| タイプ | 説明 |
|---|---|
| なし |
この例では、NotifyAction オブジェクトの逆シリアル化を示しています。
var json = ".... some json obtained from toJson ....";
// instantiate notify action
var notifyAction = new SNC.NotifyAction();
// deserialize and reconstruct the notify action instance
notifyAction.fromJson(json);
この例では、NotifyAction オブジェクトのシリアル化と逆シリアル化の両方を示しています。
// instantiate notify action
var notifyAction = new SNC.NotifyAction();
// add a queue
var queue = notifyAction.addQueue();
queue.setName('myQueueName');
queue.setDequeue(false);
// serialize to json
var json = notifyAction.toJson();
gs.log('serialization result: ' + json);
// instantiate a new notify action
var newAction = new SNC.NotifyAction();
// deserialize the json generated above
newAction.fromJson(json);
// serialize the new object and log the result
newJson = newAction.toJson();
gs.log('new serialization result: ' + newJson);
gs.log('the same: ' + (json == newJson));
出力: *** スクリプト: シリアル化の結果: {"fClassName":"NotifyAction","fActions":[{"fClassName":"QueueAction","fDequeue":true,"fQueueName":"myQueueName"}]} *** スクリプト: 新しいシリアル化の結果: {"fClassName":"NotifyAction","fActions":[{"fClassName":"QueueAction","fDequeue":true,"fQueueName":"myQueueName"}]} *** スクリプト:同じ:true
NotifyAction - setCallRecord(GlideRecord callRecord)
後続アクションを追加する通知コールレコードを定義します。
| 名前 | タイプ | 説明 |
|---|---|---|
| コールレコード | GlideRecord | アクションを追加する呼び出し元のレコード (notify_callテーブル内) を含む GlideRecord。この呼び出し元は、このメソッドが別の呼び出し元で再度呼び出されるまで有効です。 |
| タイプ | 説明 |
|---|---|
| なし |
この例では、アクションを追加する発信者を設定する方法を示しています。
public NotifyAction runIncomingCallWorkflow(NotifyPhoneNumber notifyPhoneNumber, GlideRecord callRecord) throws NoWorkflowConfiguredException, NoSuchNotifyGroupRecordException {
NotifyAction notifyAction = runWorkflow(notifyPhoneNumber, COL_INCOMING_CALL_WF, callRecord);
notifyAction.setCallRecord(callRecord);
return notifyAction;
}
NotifyAction - toJson()
NotifyAction オブジェクトを JSON 文字列にシリアル化します。
| 名前 | タイプ | 説明 |
|---|---|---|
| なし |
| タイプ | 説明 |
|---|---|
| 文字列 | この NotifyAction オブジェクトの JSON 表現。 |
この例では、NotifyAction オブジェクトをシリアル化する方法を示します。
// instantiate notify action
var notifyAction = new SNC.NotifyAction();
// add one or more notify actions
// ...
// and serialize to json
var json = notifyAction.toJson();
この例では、NotifyAction オブジェクトのシリアル化と逆シリアル化の両方を示しています。
// instantiate notify action
var notifyAction = new SNC.NotifyAction();
// add a queue
var queue = notifyAction.addQueue();
queue.setName('myQueueName');
queue.setDequeue(false);
// serialize to json
var json = notifyAction.toJson();
gs.log('serialization result: ' + json);
// instantiate a new notify action
var newAction = new SNC.NotifyAction();
// deserialize the json generated above
newAction.fromJson(json);
// serialize the new object and log the result
newJson = newAction.toJson();
gs.log('new serialization result: ' + newJson);
gs.log('the same: ' + (json == newJson));
出力: *** スクリプト: シリアル化の結果: {"fClassName":"NotifyAction","fActions":[{"fClassName":"QueueAction","fDequeue":true,"fQueueName":"myQueueName"}]} *** スクリプト: 新しいシリアル化の結果: {"fClassName":"NotifyAction","fActions":[{"fClassName":"QueueAction","fDequeue":true,"fQueueName":"myQueueName"}]} *** スクリプト:同じ:true