NotifyAction - グローバル
NotifyAction API を使用すると、電話通信プロバイダーに送信するアクションを定義できます。
NotifyAction オブジェクトにアクションを追加するには、アクションのタイプごとにそれぞれの add 関数を呼び出します。各 add 関数は、 addSay() メソッドの SayAction オブジェクトなどの Action オブジェクトを返します。返されるオブジェクトの詳細については、各メソッドの例を参照してください。
NotifyAction - addConference()
現在のコールを現在の電話会議に移動する会議アクションを追加します。
| 名前 | タイプ | 説明 |
|---|---|---|
| なし |
| タイプ | 説明 |
|---|---|
| ConferenceAction | 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(ブーリアン muted)
指定した発信者を現在の電話会議内でミュートするかどうかを定義します。
このメソッドを呼び出さない場合、デフォルトで発信者はミュートされません。
| 名前 | タイプ | 説明 |
|---|---|---|
| muted | ブーリアン | 指定した発信者を現在の電話会議内でミュートするかどうかを示すフラグ。
|
| タイプ | 説明 |
|---|---|
| なし |
この例は、会議アクションを追加して指定した発信者をミュートする方法を示します。
// 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)
現在の電話会議の名前を指定された名前に設定します。
| 名前 | タイプ | 説明 |
|---|---|---|
| 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)
関連付けられた電話会議を記録するかどうかを定義します。
このメソッドを呼び出さない場合、デフォルトで電話会議は記録されません。
| 名前 | タイプ | 説明 |
|---|---|---|
| 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()
指定された電話番号または Notify クライアントにコールを転送します。
addDial アクションを作成したら、関連する電話番号 (setPhoneNumber()) または Notify クライアント (setClientRecord()) も設定する必要があります。
| 名前 | タイプ | 説明 |
|---|---|---|
| なし |
| タイプ | 説明 |
|---|---|
| DialAction | 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 を定義します。
| 名前 | タイプ | 説明 |
|---|---|---|
| callerID | 文字列 | 発信コールに設定する発信者識別子。 |
| タイプ | 説明 |
|---|---|
| なし |
この例では、発信コールを行ってコールのタイムアウトを設定する方法を示します。
// 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(文字列 tableName, 文字列 sysID)
Notify の発信者レコードと発信者の一意の識別子を検索するテーブルを指定して、現在の発信者を Notify の発信者に設定します。
| 名前 | タイプ | 説明 |
|---|---|---|
| tableName | 文字列 | 目的の発信者の情報を含むテーブルの名前。 |
| sysID | 文字列 | 目的の Notify 発信者の一意の識別子 (sys_id)。 |
| タイプ | 説明 |
|---|---|
| なし |
この例では、setClientRecord() を使用して現在の発信者を Notify の発信者に設定する方法を示します。
// 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(文字列 value)
コールが接続されたときに再生する 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(文字列 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(ブーリアン record)
発信コールを記録するかどうかを定義します。
| 名前 | タイプ | 説明 |
|---|---|---|
| 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)
発信コールがタイムアウトするまでの時間を秒単位で設定します。
| 名前 | タイプ | 説明 |
|---|---|---|
| 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() メソッドを参照してください。
| 名前 | タイプ | 説明 |
|---|---|---|
| なし |
| タイプ | 説明 |
|---|---|
| PlayAction | 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() メソッドを参照してください。
| 名前 | タイプ | 説明 |
|---|---|---|
| なし |
| タイプ | 説明 |
|---|---|
| SayAction | 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)
入力の終了を示すために発信者が入力するキーを定義します。
| 名前 | タイプ | 説明 |
|---|---|---|
| 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(整数 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)
入力の収集がタイムアウトするまでの時間を定義します。
| 名前 | タイプ | 説明 |
|---|---|---|
| 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()
コールをキューに入れて保留します。
| 名前 | タイプ | 説明 |
|---|---|---|
| なし |
| タイプ | 説明 |
|---|---|
| QueueAction | 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(ブーリアン dequeue)
現在のコールキューからコールを取り出します (「保留」の解除)。
| 名前 | タイプ | 説明 |
|---|---|---|
| dequeue | ブーリアン | 現在のコールをキューから取り出すかどうかを示すフラグ。
|
| タイプ | 説明 |
|---|---|
| なし |
この例は、キューからコールを取り出す方法を示しています。
// instantiate NotifyAction
var notifyAction = new SNC.NotifyAction();
// dequeue the call
var queue = notifyAction.addQueue();
queue.setDequeue(true);
NotifyAction - addQueue.setName(文字列 name)
キューに関連付けられる名前を定義します。
| 名前 | タイプ | 説明 |
|---|---|---|
| name | 文字列 | キューに関連付ける名前。 |
| タイプ | 説明 |
|---|---|
| なし |
この例では、キューの名前を定義する方法を示します。
// instantiate NotifyAction
var notifyAction = new SNC.NotifyAction();
// queue the call
var queue = notifyAction.addQueue();
queue.setName('my queue');
NotifyAction - addPlay()
コール中にオーディオファイルを再生します。
| 名前 | タイプ | 説明 |
|---|---|---|
| なし |
| タイプ | 説明 |
|---|---|
| PlayAction | 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(整数 loop)
オーディオファイルを再生する (ループする) 回数を定義します。
| 名前 | タイプ | 説明 |
|---|---|---|
| loop | 整数 | オーディオファイルの再生回数。 |
| タイプ | 説明 |
|---|---|
| なし |
// 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)
記録を終了するキーを定義します。
| 名前 | タイプ | 説明 |
|---|---|---|
| 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(整数 seconds)
記録の最大長を定義します。
| 名前 | タイプ | 説明 |
|---|---|---|
| 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)
記録が終了するまでの無音の秒数を設定します。
| 名前 | タイプ | 説明 |
|---|---|---|
| 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()
着信コールを拒否します。
| 名前 | タイプ | 説明 |
|---|---|---|
| なし |
| タイプ | 説明 |
|---|---|
| RejectAction | 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)
コールが拒否された理由を定義します。
| 名前 | タイプ | 説明 |
|---|---|---|
| reason | 文字列 | コールが拒否された理由。 有効な値:
|
| タイプ | 説明 |
|---|---|
| なし |
// instantiate NotifyAction
var notifyAction = new SNC.NotifyAction();
// reject the call
var rejectAction = notifyAction.addReject();
rejectAction.setReason('busy'); // 'busy' or 'rejected'
NotifyAction - addSay()
コール中に読み上げるテキスト読み上げを定義します。
テキスト読み上げでは複数の言語がサポートされます。利用可能な言語は電話プロバイダーによって異なります。
| 名前 | タイプ | 説明 |
|---|---|---|
| なし |
| タイプ | 説明 |
|---|---|
| SayAction | 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(文字列 language)
テキストを読み上げる言語を定義します。
このメソッドを 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(文字列 text)
現在のコール内で読み上げるテキストを定義します。
このメソッドを setLanguage() メソッドと併用して、指定したテキストを読み上げる際の言語を定義します。
| 名前 | タイプ | 説明 |
|---|---|---|
| text | 文字列 | 現在のコール内で読み上げるテキスト。 |
| タイプ | 説明 |
|---|---|
| なし |
この例では、複数の言語でテキストを読み上げる方法を示します。
// 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 メッセージを送信します。
| 名前 | タイプ | 説明 |
|---|---|---|
| なし |
| タイプ | 説明 |
|---|---|
| SMSAction | 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(文字列 message)
送信する 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(文字列 to)
SMS メッセージの送信先となる電話番号を設定します。
| 名前 | タイプ | 説明 |
|---|---|---|
| to | 文字列 | 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 action)
指定された NotifyAction オブジェクトを現在のクライアントの NotifyAction オブジェクトに追加します。
- PlayAction
- RecordAction
- SayAction
- SMSAction
他のすべての NotifyAction はターミナルです。ターミナルアクションの後に別の NotifyAction を追加しようとすると、コールが失敗します。
| 名前 | タイプ | 説明 |
|---|---|---|
| action | NotifyAction | 現在の発信者の 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));
出力:*** Script: serialization result: {"fClassName":"NotifyAction","fActions":[{"fClassName":"QueueAction","fDequeue":true,"fQueueName":"myQueueName"}]} *** Script: new serialization result: {"fClassName":"NotifyAction","fActions":[{"fClassName":"QueueAction","fDequeue":true,"fQueueName":"myQueueName"}]} *** Script: the same: true
NotifyAction - setCallRecord(GlideRecord callRecord)
後続のアクションを追加する Notify コールのレコードを定義します。
| 名前 | タイプ | 説明 |
|---|---|---|
| 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));
出力:*** Script: serialization result: {"fClassName":"NotifyAction","fActions":[{"fClassName":"QueueAction","fDequeue":true,"fQueueName":"myQueueName"}]} *** Script: new serialization result: {"fClassName":"NotifyAction","fActions":[{"fClassName":"QueueAction","fDequeue":true,"fQueueName":"myQueueName"}]} *** Script: the same: true