NotifyAction - グローバル

  • リリースバージョン: Zurich
  • 更新日 2025年07月31日
  • 所要時間:46分
  • NotifyAction API を使用すると、電話通信プロバイダーに送信するアクションを定義できます。

    NotifyAction オブジェクトにアクションを追加するには、アクションのタイプごとにそれぞれの add 関数を呼び出します。各 add 関数は、 addSay() メソッドの SayAction オブジェクトなどの Action オブジェクトを返します。返されるオブジェクトの詳細については、各メソッドの例を参照してください。

    注:
    NotifyAction API はグローバルアプリケーション内でのみ有効です。スコープ対象のアプリケーションでこのタイプの機能を使用するには、カスタムの Notify ワークフローアクティビティを作成する必要があります。これらのアクティビティの作成の詳細については、「 通知ワークフローアクティビティ」を参照してください。

    NotifyAction - addConference()

    現在のコールを現在の電話会議に移動する会議アクションを追加します。

    表 : 1. パラメーター
    名前 タイプ 説明
    なし
    表 : 2. 返される内容
    タイプ 説明
    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)

    指定された発信者が電話会議を退出したときに電話会議を終了するかどうかを定義します。

    表 : 3. パラメーター
    名前 タイプ 説明
    endOnExit ブーリアン 指定された発信者が現在の電話会議を退出したときに電話会議を終了するかどうかを示すフラグ。
    • true:指定された発信者が電話会議を退出したときに電話会議を終了する
    • false:デフォルト。すべての参加者が退出したら電話会議を終了する
    表 : 4. 返される内容
    タイプ 説明
    なし

    この例では、電話会議アクションを追加し、指定された発信者が退出したら電話会議を終了するように設定する方法を示します。

    // 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)

    参加者が星印 (*) キーを押したときに電話会議を終了するかどうかを定義します。

    表 : 5. パラメーター
    名前 タイプ 説明
    hangupOnStar ブール 参加者が星印 (*) キーを押したら電話会議を終了するかどうかを示すフラグ。

    有効な値:

    • true:電話会議を終了する
    • false:デフォルト。電話会議を終了しない
    表 : 6. 返される内容
    タイプ 説明
    なし

    この例は、会議アクションを追加して電話会議を記録する方法を示します。

    // 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)

    指定した発信者を現在の電話会議内でミュートするかどうかを定義します。

    このメソッドを呼び出さない場合、デフォルトで発信者はミュートされません。

    表 : 7. パラメーター
    名前 タイプ 説明
    muted ブーリアン 指定した発信者を現在の電話会議内でミュートするかどうかを示すフラグ。
    • true:発信者をミュートする必要あり
    • false:デフォルト。発信者をミュートしない
    表 : 8. 返される内容
    タイプ 説明
    なし

    この例は、会議アクションを追加して指定した発信者をミュートする方法を示します。

    // 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)

    現在の電話会議の名前を指定された名前に設定します。

    表 : 9. パラメーター
    名前 タイプ 説明
    name 文字列 現在の電話会議に関連付ける名前。
    表 : 10. 返される内容
    タイプ 説明
    なし

    この例は、会議アクションを追加して電話会議の名前を設定する方法を示します。

    // 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)

    関連付けられた電話会議を記録するかどうかを定義します。

    このメソッドを呼び出さない場合、デフォルトで電話会議は記録されません。

    表 : 11. パラメーター
    名前 タイプ 説明
    record ブーリアン 現在の電話会議を記録するかどうかを示すフラグ。
    • true:電話会議の記録を開始する
    • false:デフォルト。電話会議は録音されません。記録中の場合は記録が停止されます。
    表 : 12. 返される内容
    タイプ 説明
    なし

    この例は、会議アクションを追加して電話会議を記録する方法を示します。

    // 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」に設定する必要があります。そうすると、目的のユーザーが電話会議に参加するまで電話会議は開始されません。

    表 : 13. パラメーター
    名前 タイプ 説明
    startOnEnter ブーリアン 選択された発信者が現在の電話会議に参加したら電話会議を開始するかどうかを示すフラグ。
    • true:デフォルト。指定された発信者が電話会議に参加したら電話会議を開始する。
    • false:指定された発信者が追加された後に電話会議を開始する
    表 : 14. 返される内容
    タイプ 説明
    なし

    この例では、電話会議アクションを追加し、指定された発信者が参加するまで電話会議が開始しないように設定する方法を示します。

    // 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()) も設定する必要があります。

    表 : 15. パラメーター
    名前 タイプ 説明
    なし
    表 : 16. 返される内容
    タイプ 説明
    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 を定義します。

    表 : 17. パラメーター
    名前 タイプ 説明
    callerID 文字列 発信コールに設定する発信者識別子。
    表 : 18. 返される内容
    タイプ 説明
    なし

    この例では、発信コールを行ってコールのタイムアウトを設定する方法を示します。

    // 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 の発信者に設定します。

    表 : 19. パラメーター
    名前 タイプ 説明
    tableName 文字列 目的の発信者の情報を含むテーブルの名前。
    sysID 文字列 目的の Notify 発信者の一意の識別子 (sys_id)。
    表 : 20. 返される内容
    タイプ 説明
    なし

    この例では、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 トーンを定義します。

    表 : 21. パラメーター
    名前 タイプ 説明
    value 文字列 コールが接続されたときに再生する有効な DTMF の番号。
    表 : 22. 返される内容
    タイプ 説明
    なし

    この例では、発信コールを行ってコールの接続時に再生する 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)

    星印 (*) キーが押されたときにコールを終了するかどうかを定義します。

    表 : 23. パラメーター
    名前 タイプ 説明
    hangupOnStar ブーリアン 星印 (*) キーが押されたときにコールを終了するかどうかを示すフラグ。
    • true:コールを終了する
    • false:コールを終了しない
    表 : 24. 返される内容
    タイプ 説明
    なし

    この例では、発信コールを行って切断キーを星印に設定する方法を示します。

    // 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)

    発信先の電話番号を定義します。

    表 : 25. パラメーター
    名前 タイプ 説明
    phoneNumber 文字列 発信先の E.164 準拠の電話番号。
    表 : 26. 返される内容
    タイプ 説明
    なし

    この例では、発信コールを行ってコールのタイムアウトを設定する方法を示します。

    // 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)

    発信コールを記録するかどうかを定義します。

    表 : 27. パラメーター
    名前 タイプ 説明
    record 発信コールを記録するかどうかを示すフラグ。

    有効な値:

    • true:発信コールを記録する
    • false:発信コールを記録しない
    表 : 28. 返される内容
    タイプ 説明
    なし

    この例では、発信コールを行ってコールを記録する方法を示します。

    // 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)

    発信コールがタイムアウトするまでの時間を秒単位で設定します。

    表 : 29. パラメーター
    名前 タイプ 説明
    timeout 整数 発信コールがタイムアウトするまでの秒数。デフォルト:30
    表 : 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()

    指定したインタラクティブ電話メニューを発信者の画面に表示します。

    表 : 31. パラメーター
    名前 タイプ 説明
    なし
    表 : 32. 返される内容
    タイプ 説明
    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() メソッドを参照してください。

    表 : 33. パラメーター
    名前 タイプ 説明
    なし
    表 : 34. 返される内容
    タイプ 説明
    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() メソッドを参照してください。

    表 : 35. パラメーター
    名前 タイプ 説明
    なし
    表 : 36. 返される内容
    タイプ 説明
    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)

    入力の終了を示すために発信者が入力するキーを定義します。

    表 : 37. パラメーター
    名前 タイプ 説明
    finishKey 文字列 発信者の入力の終了を示すキー。

    有効な値:

    • 0 ~ 9
    • # (デフォルト)
    • *
    表 : 38. 返される内容
    タイプ 説明
    なし

    この例は、収集アクションを追加して、発信者入力の終了を示すキーを定義する方法を示しています。

    // 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)

    収集する桁数を定義します。

    表 : 39. パラメーター
    名前 タイプ 説明
    numberOfDigits 整数 収集する桁数。ゼロは無効な値です。
    表 : 40. 返される内容
    タイプ 説明
    なし

    この例では、収集アクションを追加し、収集するキーストロークの回数を定義する方法を示します。

    // 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)

    入力の収集がタイムアウトするまでの時間を定義します。

    表 : 41. パラメーター
    名前 タイプ 説明
    timeout 整数 発信者の入力がタイムアウトするまでに待機する秒数。デフォルト:10
    表 : 42. 返される内容
    タイプ 説明
    なし

    この例は、収集アクションを追加し、入力のタイムアウトの値を定義する方法を示しています。

    // 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()

    アクティブな通話を終了します。

    表 : 43. パラメーター
    名前 タイプ 説明
    なし
    表 : 44. 返される内容
    タイプ 説明
    HangUpAction NotifyAction オブジェクトに追加されたアクション。
    // instantiate NotifyAction
    var notifyAction = new SNC.NotifyAction();
    
    // hang up
    notifyAction.addHangUp();

    NotifyAction - addQueue()

    コールをキューに入れて保留します。

    表 : 45. パラメーター
    名前 タイプ 説明
    なし
    表 : 46. 返される内容
    タイプ 説明
    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)

    現在のコールキューからコールを取り出します (「保留」の解除)。

    表 : 47. パラメーター
    名前 タイプ 説明
    dequeue ブーリアン 現在のコールをキューから取り出すかどうかを示すフラグ。
    • true:コールをキューから取り出す
    • false:コールをキューに入れておく
    表 : 48. 返される内容
    タイプ 説明
    なし

    この例は、キューからコールを取り出す方法を示しています。

    // instantiate NotifyAction
    var notifyAction = new SNC.NotifyAction();
    
    // dequeue the call
    var queue = notifyAction.addQueue();
    queue.setDequeue(true);

    NotifyAction - addQueue.setName(文字列 name)

    キューに関連付けられる名前を定義します。

    表 : 49. パラメーター
    名前 タイプ 説明
    name 文字列 キューに関連付ける名前。
    表 : 50. 返される内容
    タイプ 説明
    なし

    この例では、キューの名前を定義する方法を示します。

    // instantiate NotifyAction
    var notifyAction = new SNC.NotifyAction();
    
    // queue the call
    var queue = notifyAction.addQueue();
    queue.setName('my queue');

    NotifyAction - addPlay()

    コール中にオーディオファイルを再生します。

    表 : 51. パラメーター
    名前 タイプ 説明
    なし
    表 : 52. 返される内容
    タイプ 説明
    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)

    オーディオファイルを再生する (ループする) 回数を定義します。

    表 : 53. パラメーター
    名前 タイプ 説明
    loop 整数 オーディオファイルの再生回数。
    表 : 54. 返される内容
    タイプ 説明
    なし
    // 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 を定義します。

    表 : 55. パラメーター
    名前 タイプ 説明
    url 文字列 再生するオーディオファイルの URL。
    表 : 56. 返される内容
    タイプ 説明
    なし
    // 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 テーブルに格納されます。

    表 : 57. パラメーター
    名前 タイプ 説明
    なし
    表 : 58. 返される内容
    タイプ 説明
    なし

    この例では、コールを記録する方法を示します。

    // 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)

    記録を終了するキーを定義します。

    表 : 59. パラメーター
    名前 タイプ 説明
    finishKey 文字列 記録を終了するキー。

    有効な値:

    • 0 ~ 9
    • # (デフォルト)
    • *
    表 : 60. 返される内容
    タイプ 説明
    なし

    この例では、コールを記録してコール終了キーを設定する方法を示します。

    // 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)

    記録の最大長を定義します。

    表 : 61. パラメーター
    名前 タイプ 説明
    seconds 整数 記録の最長時間 (単位:秒)。デフォルト:3600
    表 : 62. 返される内容
    タイプ 説明
    なし

    この例では、コールを記録してコール終了キーを設定する方法を示します。

    // 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)

    記録が終了するまでの無音の秒数を設定します。

    表 : 63. パラメーター
    名前 タイプ 説明
    timeout 整数 記録が終了するまでのコールの無音の秒数。デフォルト:10
    表 : 64. 返される内容
    タイプ 説明
    なし

    この例では、コールを記録して記録のタイムアウトの値を設定する方法を示します。

    // 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()

    着信コールを拒否します。

    表 : 65. パラメーター
    名前 タイプ 説明
    なし
    表 : 66. 返される内容
    タイプ 説明
    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)

    コールが拒否された理由を定義します。

    表 : 67. パラメーター
    名前 タイプ 説明
    reason 文字列 コールが拒否された理由。

    有効な値:

    • busy
    • rejected
    他のすべての値は無視されます。
    表 : 68. 返される内容
    タイプ 説明
    なし
    // instantiate NotifyAction
    var notifyAction = new SNC.NotifyAction();
    
    // reject the call
    var rejectAction = notifyAction.addReject();
    rejectAction.setReason('busy'); // 'busy' or 'rejected'

    NotifyAction - addSay()

    コール中に読み上げるテキスト読み上げを定義します。

    テキスト読み上げでは複数の言語がサポートされます。利用可能な言語は電話プロバイダーによって異なります。

    表 : 69. パラメーター
    名前 タイプ 説明
    なし
    表 : 70. 返される内容
    タイプ 説明
    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() メソッドと併用して、読み上げる際の言い回しを定義します。

    表 : 71. パラメーター
    名前 タイプ 説明
    言語 文字列 関連するテキストを読み上げる際の言語を定義する ISO 3166 言語コード。「en-US」や「nl-NL」など。
    表 : 72. 返される内容
    タイプ 説明
    なし

    この例では、複数の言語でテキストを読み上げる方法を示します。

    // 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() メソッドと併用して、指定したテキストを読み上げる際の言語を定義します。

    表 : 73. パラメーター
    名前 タイプ 説明
    text 文字列 現在のコール内で読み上げるテキスト。
    表 : 74. 返される内容
    タイプ 説明
    なし

    この例では、複数の言語でテキストを読み上げる方法を示します。

    // 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 オブジェクトに対して setTo 関数を呼び出す必要はありません。SMS は自動的に発信者に送信されます。
    表 : 75. パラメーター
    名前 タイプ 説明
    なし
    表 : 76. 返される内容
    タイプ 説明
    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 メッセージのテキストを定義します。

    表 : 77. パラメーター
    名前 タイプ 説明
    message 文字列 送信する SMS メッセージのテキスト。
    表 : 78. 返される内容
    タイプ 説明
    なし
    // 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 メッセージの送信先となる電話番号を設定します。

    表 : 79. パラメーター
    名前 タイプ 説明
    to 文字列 SMS メッセージの送信先となる E.164 に準拠した電話番号。
    表 : 80. 返される内容
    タイプ 説明
    なし
    // 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 オブジェクトに追加します。

    NotifyAction には、ターミナルと非ターミナルの 2 つのタイプがあります。クライアントの NotifyAction オブジェクトにターミナルアクションを追加すると、それ以上のアクションを追加できません。非ターミナルアクションは次のとおりです。
    • PlayAction
    • RecordAction
    • SayAction
    • SMSAction

    他のすべての NotifyAction はターミナルです。ターミナルアクションの後に別の NotifyAction を追加しようとすると、コールが失敗します。

    表 : 81. パラメーター
    名前 タイプ 説明
    action NotifyAction 現在の発信者の NotifyAction オブジェクトに追加する NotifyAction オブジェクト。
    表 : 82. 返される内容
    タイプ 説明
    なし

    NotifyAction - fromJson(文字列 json)

    JSON 文字列から NotifyAction オブジェクトを逆シリアル化します。

    表 : 83. パラメーター
    名前 タイプ 説明
    json 文字列 NotifyAction オブジェクトの JSON 文字列表現。
    表 : 84. 返される内容
    タイプ 説明
    なし

    この例では、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 コールのレコードを定義します。

    表 : 85. パラメーター
    名前 タイプ 説明
    callRecord GlideRecord アクションを追加する発信者のレコード (notify_call テーブル内) を含む GlideRecord。この発信者は、このメソッドが別の発信者で再度呼び出されるまで影響を受け続けます。
    表 : 86. 返される内容
    タイプ 説明
    なし

    この例は、アクションを追加する対象の発信者を設定する方法を示しています。

    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 文字列にシリアル化します。

    表 : 87. パラメーター
    名前 タイプ 説明
    なし
    表 : 88. 返される内容
    タイプ 説明
    文字列 この 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