Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics 365 | Integration, Dataverse...
Suggested answer

CIF Microsoft.CIFramework.createSession does not create a sessionId

Posted on by 100

Hi All

Following the example to integrate CIF with Twilio here: https://github.com/microsoft/Dynamics365-Apps-Samples/tree/master/customer-service/channel-integration-framework/TwilioSampleInteg_version2

I have built the sales application but having issues with the JS file:

I have traced the issue back to no sessions id in the line:

Microsoft.CIFramework.createSession(inputBag).then(
(sessionId) => {
var sessionPh = new SessionInfo(PhoneState.Dialing, sessionId);

}

The sessionId is always null (full code below). Its not generating an error, just no sessionId. I cannot seem to find any other posts regarding this issue.

function ongoingCall() {
    debugger;
    var sess = phone.listOfSessions.get(phone.currentCallSessioId);
    if (sess == null || sess === undefined) {
        var inputBag = {
            "templateName": "TwilioCallSessionTemplate", "templateParameters": {}, "customerName": phone.name
        };
        Microsoft.CIFramework.createSession(inputBag).then(
            (sessionId) => {
                var sessionPh = new SessionInfo(PhoneState.Dialing, sessionId);
                sessionPh.name = phone.name;
                log("Dialing "   sessionPh.name);
                $('#callNotesField').text("");
                phone.listOfSessions.set(sessionId, sessionPh);
                phone.currentCallSessioId = sessionId;
                sessionPh.isOldSession = false;
                sessionPh.state = PhoneState.Ongoing;
            },
            (error) => {
                log("Error in session creation for dialing "   sessionPh.name);
            });
    }
    else {
        sess.isOldSession = true;
        sess.state = PhoneState.Ongoing;
    }
}

  • Suggested answer
    mauriceCRM Profile Picture
    mauriceCRM 45 on at
    RE: CIF Microsoft.CIFramework.createSession does not create a sessionId

    Hi nwood,

    I figured something out:

    You have to create a record of the Session Template entity.

    But be careful: the unique name must be the same as from the session template (deprecated) (msdyn_recordid without hyphen: msdyn_a95c86160eaee911a984000d3a33efbc):

    TwilioCallSessionTemplate.jpg

    Kind regards

    Maurice

  • mauriceCRM Profile Picture
    mauriceCRM 45 on at
    RE: CIF Microsoft.CIFramework.createSession does not create a sessionId

    Hi nwood,

    I have the same problem. Did you get any further here? Do you maybe even have a solution?

    Kind regards

    Maurice

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans