How to get input channel in the begining of conversation

How do we get the input channel when action_session_start is executed?

We have figured out that we can get latest_input_channel in the tracker, but it’s not the current input channel we want, it’s the previous channel from the previous session.

@annthehuman I am not sure, I get you right on this :frowning: please see this link: Custom Connectors Hope this will help you?

Sessions are independent usually, but you can share slots between them.

Not sure if that would work, but you could set a “channel” slot on every action_session_start after checking its previous value.

Maybe this will clear the situation.

This is body we send to …webhooks/rest/webhook

{
    "sender": "9995358116",
    "message": "/hello",
    "input_channel": "ivr",
    "metadata":{"ucid": "1234789", "LOGIN":"login", "PASSWORD":"pass", "sessionId":"12345"}
}

rasa/rest.py at main · RasaHQ/rasa · GitHub - here rasa reads input_channel

We added logging and can see current input_channel

2021-10-21 08:01:41 INFO rasa.core.channels.rest - Rest request webhook params: sender_id: '9995358116'; text: '/hello; input_channel: 'ivr'; metadata: '{'ucid': '1234789', 'LOGIN': 'login', 'PASSWORD': 'pass', 'sessionId': '12345'}' .

But when we going to action server with body

{
    "next_action": "action_session_start",
    "sender_id": "9995358116",
    "tracker": {
        "active_loop": {},
        "events": None,
        "followup_action": None,
        "latest_action": {
            "action_name": "action_listen"
        },
        "latest_action_name": "action_listen",
        "latest_event_time": 1634803301.7402072,
        "latest_input_channel": "mlk",
        "latest_message": {
            "entities": [],
            "intent": {
                "confidence": 0.9984714388847351,
                "name": "pereoformlenie_dogovora_distancionno"
            },
            "message_id": "fbedf4578de14e528672c4cef6503471",
            "metadata": {
                "LOGIN": "login",
                "PASSWORD": "pass",
                "sessionId": "12345_LK_VHOD",
                "ucid": "1234789"
            },
            "text": "как дистанционно переоформить договор"
        },
        "paused": False,
        "sender_id": "9995358116",
        "slots": {
            "ANOTHER_NUMBER": None,
            "DEVICE": None,
            "LEGAL_TYPE": None,
            "NFC": None,
            "OPTION": None,
            "PHONE_NUMBER": None,
            "afternoon": None,
            "agent": None,
            "alarm-after": None,
            "alarm-before": None,
            "answer1": None,
            "answer2": None,
            "answer3": None,
            "answer4": None,
            "answer5": None,
            "bud-na-svyazi": None,
            "bud-na-svyazi-product-id": None,
            "channel": None,
            "classification-segment-id": 1,
            "conflicts-bns": None,
            "crm-created": None,
            "customer-branch-id": 1,
            "customer-category-id": None,
            "customer-class-id": 1,
            "customer-contract-id": 1,
            "customer-database-id": 1,
            "customer-id": 1,
            "date-changed-limit": None,
            "date-disconnected-limit": None,
            "date-planned-limit": None,
            "day-of-month": None,
            "dnis": None,
            "evening": None,
            "has-product-in-history-bns-30": None,
            "has-product-in-history-bns-60": None,
            "has-product-in-history-vns-60": None,
            "hours": None,
            "infl-OPTION": None,
            "infl-available-credit-limit": None,
            "infl-credit-limit": None,
            "infl-customer-category-id": None,
            "infl-has-product-in-history-bns-30": None,
            "infl-has-product-in-history-vns-60": None,
            "infl-lc-status-id": None,
            "infl-segment": None,
            "infl-segment-group": None,
            "infl-sg-id": None,
            "inquiry-id": None,
            "is-another-phone-number": None,
            "is-invalid-phone-number": None,
            "is-mf": True,
            "is-phone-number-mf": None,
            "is-slot-sg-id-empty": None,
            "lc-status-id": None,
            "limit-changed": None,
            "limit-disconnected": None,
            "limit-planned": None,
            "macro-region-id": 1,
            "morning": None,
            "msisdn": "1",
            "name_connected-product": None,
            "name_connected-product-prosto-rouming": None,
            "need-hello": None,
            "night": None,
            "order-accepted-bns": None,
            "period-length_connected-product": None,
            "period-measure-unit-name_connected-product": None,
            "plati-pozhe": None,
            "predictive-buttons": None,
            "pretense-alarm-after": None,
            "pretense-alarm-before": None,
            "pretense-sms-after": None,
            "pretense-sms-before": None,
            "price_abs-diff-changed-limit": None,
            "price_abs-diff-future-limit": None,
            "price_available-balance": None,
            "price_available-credit-limit": None,
            "price_balance": None,
            "price_common-unpaid-bill": None,
            "price_connected-product-ap": None,
            "price_credit-limit": None,
            "price_current-credit-limit": None,
            "price_disconnected-limit": None,
            "price_expire-unpaid-bill": None,
            "price_limit-before-changing": None,
            "price_planned-limit": None,
            "price_unpaid-bill": None,
            "question1": None,
            "question2": None,
            "question3": None,
            "question4": None,
            "question5": None,
            "requested_slot": None,
            "segment": "V",
            "segment-group": "B",
            "session-id": "12345_LK_VHOD",
            "session_started_metadata": {
                "PASSWORD": "pass",
                "LOGIN": "login",
                "sessionId": "12345",
                "ucid": "1234789"
            },
            "sg-id": None,
            "sms-after": None,
            "sms-before": None,
            "subscriber-age": None,
            "subscriber-id": 213198661,
            "subscriber-lifetime": None,
            "to-operator": True,
            "ucid": "1234789",
            "ui_channel": [{
                    "id": "mlk",
                    "name": "МЛК"
                }, {
                    "id": "ivr",
                    "name": "Голос"
                }, {
                    "id": "sms",
                    "name": "СМС"
                }, {
                    "id": "lk",
                    "name": "ЛК"
                }, {
                    "id": "site",
                    "name": "сайт"
                }
            ],
            "ui_next-action": [{
                    "id": "reply",
                    "name": "ожидание действия"
                }, {
                    "id": "operator",
                    "name": "перевод на оператора"
                }, {
                    "id": "transfer",
                    "name": "перевод в старое решение"
                }
            ],
            "vdn": None,
            "vsegda-na-svyazi": None,
            "working-hours-agent": None,
            "zapret-sms-id": None
        }
    },
    "version": "2.7.0"
}

Where is no information about current input_channel, only latest_input_channel.

We don’t carry_over_slots_to_new_session, it’s value is false un our domain. Can we somehow put current input_channel in body we send to action server without using slots?

Sorry for the super late reply!

Did you solve it by now?

Hi! We seem to have solved this problem.

We decided to pass input_channel via metadata as follows

{
    "sender": "9995358116",
    "message": "/hello",
    "input_channel": "ivr",
    "metadata":{"ucid": "1234789", "input_channel": "ivr", "LOGIN":"login", "PASSWORD":"pass", "sessionId":"12345"}
}

Okay great :slight_smile:

Please mark your answer as solution to mark the thread as solved.