aws / amazon-chime-sdk-js

A JavaScript client library for integrating multi-party communications powered by the Amazon Chime service.
Apache License 2.0
710 stars 477 forks source link

Create Sip Media Application call invokes wrong event. #2495

Closed Yadukrish closed 1 year ago

Yadukrish commented 1 year ago

What happened and what did you expect to happen?

When you make a sip media application call using https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_CreateSipMediaApplicationCall.html api, if the call is not answered(didn't pick up), instead of invoking HANGUP event it is invoking CALL_ANSWERED event. This is working fine for few users.

Have you reviewed our existing documentation?

Reproduction steps

  1. make a sip media application call using https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_CreateSipMediaApplicationCall.html api
  2. Do not pick(not answer) the call.
  3. Lambda Invoked with CALL_ANSWERED event.

Amazon Chime SDK for JavaScript version

3.8.0

What browsers are you seeing the problem on?

NA

Browser version

NA

Meeting and Attendee ID Information.

No response

Browser console logs

cloud watch logs below.

| 1668005564063 | START RequestId: cb2f00ae-f7b0-4991-9a53-5e2a9f979d2f Version: $LATEST | | 1668005564159 | 2022-11-09T14:52:44.158Z cb2f00ae-f7b0-4991-9a53-5e2a9f979d2f INFO Lambda is invoked with calldetails:{"SchemaVersion":"1.0","Sequence":1,"InvocationEventType":"NEW_OUTBOUND_CALL","CallDetails":{"TransactionId":"c7942500-f035-4738-998d-0f959e94cd52","AwsAccountId":"496536713149","AwsRegion":"us-east-1","SipMediaApplicationId":"b89ecad8-3f43-426b-a778-582a7fdb4db1","Participants":[{"CallId":"2adfe491-55b4-4790-ae82-8f8a0047e202","ParticipantTag":"LEG-A","To":"phone_number","From":"+19142272006","Direction":"Outbound","StartTimeInMilliseconds":"1668005564030"}]}} | | 1668005564567 | 2022-11-09T14:52:44.567Z cb2f00ae-f7b0-4991-9a53-5e2a9f979d2f INFO NEW_OUTBOUND_CALL {"SchemaVersion":"1.0","Sequence":1,"InvocationEventType":"NEW_OUTBOUND_CALL","CallDetails":{"TransactionId":"c7942500-f035-4738-998d-0f959e94cd52","AwsAccountId":"496536713149","AwsRegion":"us-east-1","SipMediaApplicationId":"b89ecad8-3f43-426b-a778-582a7fdb4db1","Participants":[{"CallId":"2adfe491-55b4-4790-ae82-8f8a0047e202","ParticipantTag":"LEG-A","To":"phone_number","From":"+19142272006","Direction":"Outbound","StartTimeInMilliseconds":"1668005564030"}]}} audio/oslive_moh_1.wav | | 1668005564567 | 2022-11-09T14:52:44.567Z cb2f00ae-f7b0-4991-9a53-5e2a9f979d2f INFO Sending response:{"SchemaVersion":"1.0"} | | 1668005564568 | END RequestId: cb2f00ae-f7b0-4991-9a53-5e2a9f979d2f | | 1668005564568 | REPORT RequestId: cb2f00ae-f7b0-4991-9a53-5e2a9f979d2f Duration: 505.47 ms Billed Duration: 506 ms Memory Size: 128 MB Max Memory Used: 61 MB | | 1668005565981 | START RequestId: fbbdf479-5429-4af0-812c-b15928df494a Version: $LATEST | | 1668005565982 | 2022-11-09T14:52:45.981Z fbbdf479-5429-4af0-812c-b15928df494a INFO Lambda is invoked with calldetails:{"SchemaVersion":"1.0","Sequence":2,"InvocationEventType":"RINGING","CallDetails":{"TransactionId":"c7942500-f035-4738-998d-0f959e94cd52","AwsAccountId":"496536713149","AwsRegion":"us-east-1","SipMediaApplicationId":"b89ecad8-3f43-426b-a778-582a7fdb4db1","Participants":[{"CallId":"2adfe491-55b4-4790-ae82-8f8a0047e202","ParticipantTag":"LEG-A","To":"phone_number","From":"+19142272006","Direction":"Outbound","StartTimeInMilliseconds":"1668005564030"}]}} | | 1668005566454 | 2022-11-09T14:52:46.454Z fbbdf479-5429-4af0-812c-b15928df494a INFO Sending response:{"SchemaVersion":"1.0"} | | 1668005566455 | END RequestId: fbbdf479-5429-4af0-812c-b15928df494a | | 1668005566455 | REPORT RequestId: fbbdf479-5429-4af0-812c-b15928df494a Duration: 474.02 ms Billed Duration: 475 ms Memory Size: 128 MB Max Memory Used: 61 MB | | 1668005596390 | START RequestId: f8a10993-f14e-4baa-b5a8-29e853bab2ee Version: $LATEST | | 1668005596390 | 2022-11-09T14:53:16.390Z f8a10993-f14e-4baa-b5a8-29e853bab2ee INFO Lambda is invoked with calldetails:{"SchemaVersion":"1.0","Sequence":3,"InvocationEventType":"CALL_ANSWERED","CallDetails":{"TransactionId":"c7942500-f035-4738-998d-0f959e94cd52","AwsAccountId":"496536713149","AwsRegion":"us-east-1","SipMediaApplicationId":"b89ecad8-3f43-426b-a778-582a7fdb4db1","Participants":[{"CallId":"2adfe491-55b4-4790-ae82-8f8a0047e202","ParticipantTag":"LEG-A","To":"phone_number","From":"+19142272006","Direction":"Outbound","StartTimeInMilliseconds":"1668005564030","Status":"Connected"}]}} | | 1668005597208 | 2022-11-09T14:53:17.208Z f8a10993-f14e-4baa-b5a8-29e853bab2ee INFO CALL_ANSWERED { SchemaVersion: '1.0', Sequence: 3, InvocationEventType: 'CALL_ANSWERED', CallDetails: { TransactionId: 'c7942500-f035-4738-998d-0f959e94cd52', AwsAccountId: '496536713149', AwsRegion: 'us-east-1', SipMediaApplicationId: 'b89ecad8-3f43-426b-a778-582a7fdb4db1', Participants: [ [Object] ] } } { dialInInfo: { transactionId: 'c7942500-f035-4738-998d-0f959e94cd52', from: 'phone_number', callId: '+19142272006', participantTag: '', direction: 'Outbound', startTimeInMilliseconds: 1668005564048, id: 841357075929377, dialInMeetingId: 8943609978, personalMeetingId: null, created: '09-11-2022 14:52', waitingRoomHoldType: 'SIP_MEDIA_CALL' }, activeMeeting: { id: 165200859975282, personalMeetingId: 'yadudev', meeting: { meetingId: 'ba85265f-0884-46fa-adcf-dd6b82310706', externalMeetingId: 'yadudev', mediaPlacement: [Object], mediaRegion: 'us-east-1' }, created: '09-11-2022 14:48', windstreamMeetingAttendees: [], meetingLocked: false, meetingPassword: '', meetingTitle: 'Yadukrishnan sp Meeting', scheduledMeetingId: 0, dialInMeetingPassword: -1, dialInMeetingId: 8943609978, meetingHostName: 'Yadukrishnan sp' } } | | 1668005597208 | 2022-11-09T14:53:17.208Z f8a10993-f14e-4baa-b5a8-29e853bab2ee INFO welcomeMessageDialOut | | 1668005597208 | 2022-11-09T14:53:17.208Z f8a10993-f14e-4baa-b5a8-29e853bab2ee INFO Sending response:{"SchemaVersion":"1.0","Actions":[{"Type":"Speak","Parameters":{"Engine":"neural","LanguageCode":"en-US","Text":"Hello, welcome to office suite liive.. You have a call from Yadukrishnan sp meeting.","TextType":"ssml","VoiceId":"Joanna"}},{"Type":"SpeakAndGetDigits","Parameters":{"CallId":"2adfe491-55b4-4790-ae82-8f8a0047e202","InputDigitsRegex":"^[0-9]{1}$","SpeechParameters":{"Text":"Press one to join the meeting.","Engine":"neural","LanguageCode":"en-US","TextType":"text","VoiceId":"Joanna"},"FailureSpeechParameters":{"Text":"You have entered a wrong input.","Engine":"neural","LanguageCode":"en-US","TextType":"text","VoiceId":"Joanna"},"MinNumberOfDigits":1,"MaxNumberOfDigits":2,"TerminatorDigits":["#"],"InBetweenDigitsDurationInMilliseconds":5000,"Repeat":3,"RepeatDurationInMilliseconds":20000}}]} | | 1668005597217 | END RequestId: f8a10993-f14e-4baa-b5a8-29e853bab2ee | | 1668005597217 | REPORT RequestId: f8a10993-f14e-4baa-b5a8-29e853bab2ee Duration: 827.83 ms Billed Duration: 828 ms Memory Size: 128 MB Max Memory Used: 61 MB

Yadukrish commented 1 year ago

Any update on this issue?

xuesichao commented 1 year ago

Hi @Yadukrish , sorry for the late reply. From our side we did see the call get connected at 2022-11-09T14:53:16.359Z and it stays up for ~ 10 seconds and is then disconnected. Is there anything on your side that could answer the call somehow? Perhaps some voice mail is involved?

Yadukrish commented 1 year ago

I think voice mail is invoked, so even it is invoked by voice mail, we will get the call answered status? Is there a way to differentiate both? @xuesichao

xuesichao commented 1 year ago

From the perspective of the SIP protocol, there is no difference between a normal call answer and a voicemail call answer, as both types of calls are simply audio streams being sent from one party to another. So unfortunately our SDK has no way to differentiate them.