Using the Avaya Client SDK, you can easily integrate the ability for users of your application to make and receive audio or video calls.
To receive and answer an incoming audio call, you must complete the following activities:
In order to get notifications for any incoming calls, your application can implements and adds callbacks to the Calls object to receive call service notifications.
calls.addOnIncomingCallCallback(function(call) {
// Called to report that there is an incoming call.
// Add code here to handle this incoming call, eg,
// update UI to alert user, provide options for handling
// the call, ... etc.
});
calls.addOnCallRemovedCallback(function(call) {
// Called to report that the call has been removed before
// answer.
// Add code here to handle the removed call, eg,
// update UI to remove the call... etc.
});
When there is an incoming call, the Calls.addOnIncomingCallCallback() callback function is called with a Call object in the arguments.
To answer the incoming call, you can call the accept() function on the incoming call object.
call.accept();
--- title: JavaScript Communication Services Package version: 4.31.0.0 - Aug 2023 copyright: Copyright © 2013-2023 by Avaya, All Rights Reserved. publisher: devconnectprogram.com publisherAddress: Avaya comments: '' tableOfContents: true tocAccordion: 2 rightPanel: false publicOnly: false leftPanel: true tableOfContentHeader: true showPageTitle: true gridLayout: toc: 2 codePanelPercent: 50 headerHeight: 0 footerHeight: 0 documentSearch: true languageTabs: - javascript: JavaScript laTexMath: false codeHighlight: true codeHighlightTheme: agate tocSelectors: h2,h3,h4 tocFooters: [] versionLinks: - title: Current link: "/site/global/products_resources/avaya_client_sdk/programming_docs/current/introduction/index.gsp" newTab: false siteLinks: - title: Avaya Home link: "/" newTab: false documentCollectionOptions: tabs: false baseUrl: '' documentCollection: [] source_file: "/home/build/.jenkins/workspace/avaya-slate/source/site/global/products_resources/avaya_client_sdk/programming_docs/current/javascript/communication/guide/answering_audio_call.md" sourcePath: "/home/build/.jenkins/workspace/avaya-slate/source/site/global/products_resources/avaya_client_sdk/programming_docs/current/javascript/communication/guide" sourceFileName: answering_audio_call sourceType: ".md" url: site/global/products_resources/avaya_client_sdk/programming_docs/current/javascript/communication/guide/answering_audio_call.gsp urlPath: site/global/products_resources/avaya_client_sdk/programming_docs/current/javascript/communication/guide urlFileName: answering_audio_call urlExtension: ".gsp" titlePage: true gvars: - productFolder: client_sdk - releaseFolder: current BackToPackageOverview: "< Back to Package Overview" BpImages: "/static/images/avaya_client_sdk/programming_docs/current/" DwlAndroidSdk: "Android SDK" DwlIosSdk: "iOS SDK" DwlWindowsSdk: "Windows SDK" DwlMacosSdk: "macOS SDK" DwlJavaScriptSdk: "JavaScript SDK" DwlReleaseNotes: "Avaya Client SDK Release Notes" Renderer_Konva_KonvaSelectionTool: "KonvaSelectionTool" Renderer_Konva_KonvaMarkerTool: "KonvaMarkerTool" Renderer_Konva_KonvaWhiteboardTools: "KonvaWhiteboardTools" Renderer_Konva_KonvaWhiteboardRenderer: "KonvaWhiteboardRenderer" Renderer_Konva_KonvaLineTool: "KonvaLineTool" Renderer: "Renderer" Renderer_Konva_KonvaPenTool: "KonvaPenTool" Renderer_Konva: "Konva" Renderer_Konva_KonvaWhiteboardConverter: "KonvaWhiteboardConverter" Renderer_Konva_KonvaContentSharingRenderer: "KonvaContentSharingRenderer" Renderer_Konva_KonvaTextTool: "KonvaTextTool" Renderer_Konva_KonvaStampTool: "KonvaStampTool" Renderer_Konva_KonvaCircleTool: "KonvaCircleTool" Renderer_Konva_KonvaRectangleTool: "KonvaRectangleTool" Services_Contacts_Terminal: "Terminal" Services_Contacts_EditableContactStringField: "EditableContactStringField" Config_AMMConfiguration: "AMMConfiguration" Config_InvalidCredentialsEvent: "InvalidCredentialsEvent" Services_Contacts_ContactsError: "ContactsError" Base_VideoDevice: "VideoDevice" Services_Collaboration_WhiteboardTools: "WhiteboardTools" Services_Call_CallException: "CallException" Services_Conference_ChatMessage: "ChatMessage" Config_SGConfiguration: "SGConfiguration" Services_Conference_Conference: "Conference" Services_Messaging: "Messaging" Services_Call_AudioDetails: "AudioDetails" Services_Collaboration_PenTool: "PenTool" Services_Call_ConferenceEntryOptions: "ConferenceEntryOptions" Base_Promise: "Promise" Services_Collaboration_Point: "Point" Services_Call_VideoChannel: "VideoChannel" Base_DataSet: "DataSet" Services_Contacts_Contacts: "Contacts" Services_Collaboration_WhiteboardText: "WhiteboardText" Services_Call_RingbackToneURLs: "RingbackToneURLs" Services_Contacts_ContactSearchRequest: "ContactSearchRequest" Services_Collaboration_Circle: "Circle" Services_Collaboration_RectangleTool: "RectangleTool" Services_Contacts_ContactPhoneField: "ContactPhoneField" Services_Collaboration_WhiteboardRenderer: "WhiteboardRenderer" Services_Collaboration_CollaborationError: "CollaborationError" Services_Presence_Presence: "Presence" Services_Messaging_Conversation: "Conversation" Services_Collaboration_ClearTool: "ClearTool" Services_Messaging_ChatStateEvent: "ChatStateEvent" Services_Contacts_ContactNumberField: "ContactNumberField" Services_Collaboration_ContentSharing: "ContentSharing" Services_Presence_PresenceService: "PresenceService" Config_AbstractCredentialProvider: "AbstractCredentialProvider" Services_VoiceMessaging_VoiceMessagingStatusParameters: "VoiceMessagingStatusParameters" Services_Messaging_Messaging: "Messaging" Services_Collaboration_Participant: "Participant" Base_MediaServices: "MediaServices" Services_Collaboration_TextTool: "TextTool" Services_Collaboration_AbstractShape: "AbstractShape" Config_NetworkProviderConfiguration: "NetworkProviderConfiguration" Services_Contacts_ContactStringField: "ContactStringField" Config_CollaborationConfiguration: "CollaborationConfiguration" Services_Messaging_MessagingQuery: "MessagingQuery" Services_Conference_PendingParticipant: "PendingParticipant" Services_Conference: "Conference" Config_VoIPConfigurationVideo: "VoIPConfigurationVideo" AvayaClientServices: "AvayaClientServices" Services_Messaging_Escalation: "Escalation" Base_Capability: "Capability" Base_VideoInterface: "VideoInterface" Config_UCCPConfiguration: "UCCPConfiguration" Config_CallUserConfiguration: "CallUserConfiguration" Base_BaseError: "BaseError" Services_Call_UserToUserInfo: "UserToUserInfo" Services_Collaboration_CircleTool: "CircleTool" Renderer_ContentSharingRenderer: "ContentSharingRenderer" Config_ServerInfo: "ServerInfo" Services_Conference_DroppedParticipant: "DroppedParticipant" Config_AnalyticsConfiguration: "AnalyticsConfiguration" Services_Contacts: "Contacts" Services_Call_CallCreationInfo: "CallCreationInfo" Services_Contacts_EditableContact: "EditableContact" Services_Collaboration_MarkerTool: "MarkerTool" Services_Collaboration_Bitmap: "Bitmap" Services_Collaboration_Collaboration: "Collaboration" Services_Messaging_MessagingError: "MessagingError" Base_AudioOutputInterface: "AudioOutputInterface" Services_Participant: "Participant" Config_ACSConfiguration: "ACSConfiguration" Services_Messaging_Attachment: "Attachment" User: "User" Services_Contacts_MatchedContactsWithMatchLevel: "MatchedContactsWithMatchLevel" Config_CredentialProvider: "CredentialProvider" Config_WCSCredentialTokenProvider: "WCSCredentialTokenProvider" Services_Contacts_ContactBooleanField: "ContactBooleanField" Services_Collaboration_Shape: "Shape" Base_AudioInterface: "AudioInterface" Services_Contacts_ResolveContactsRequest: "ResolveContactsRequest" Services_Presence_PresenceListSubscription: "PresenceListSubscription" Services_Messaging_Participant: "Participant" Services_Collaboration_DeleteTool: "DeleteTool" Services_Call_Call: "Call" Services_Conference_Chat: "Chat" Services_Collaboration: "Collaboration" Services_Contacts_ContactIMAddressField: "ContactIMAddressField" Base_SettingsFileParser: "SettingsFileParser" Services_Presence: "Presence" Services: "Services" Base_LoggerInterface: "LoggerInterface" Services_Presence_SelfPresence: "SelfPresence" Services_Call_VideoDetails: "VideoDetails" Services_Collaboration_Whiteboard: "Whiteboard" Config_CredentialTokenProvider: "CredentialTokenProvider" Services_Contacts_ContactFieldList: "ContactFieldList" Config_MediaConfiguration: "MediaConfiguration" Services_VoiceMessaging_VoiceMessaging: "VoiceMessaging" Config_VoIPConfigurationAudio: "VoIPConfigurationAudio" Services_Collaboration_WhiteboardSurface: "WhiteboardSurface" Services_Contacts_EditableContactBooleanField: "EditableContactBooleanField" Services_Contacts_ContactField: "ContactField" Services_Presence_PresenceError: "PresenceError" Services_Contacts_EditableContactNumberField: "EditableContactNumberField" Config_PresenceConfiguration: "PresenceConfiguration" Services_Collaboration_SelectionTool: "SelectionTool" Services_Contacts_Contact: "Contact" Services_Messaging_Message: "Message" Config_WCSConfiguration: "WCSConfiguration" Services_Collaboration_Frame: "Frame" Base_AudioDevice: "AudioDevice" Services_ContentSharing: "ContentSharing" Config_GuestCredentialProvider: "GuestCredentialProvider" Config: "Config" Services_Call_Calls: "Calls" Services_Contacts_EditableContactIMAddressField: "EditableContactIMAddressField" Base_AudioInputInterface: "AudioInputInterface" Config_UserConfiguration: "UserConfiguration" Services_VoiceMessaging: "VoiceMessaging" Services_Contacts_ResolveContactResult: "ResolveContactResult" Services_Call: "Call" Services_Contacts_EditableContactPhoneField: "EditableContactPhoneField" Services_Collaboration_Collaborations: "Collaborations" Services_Collaboration_StampTool: "StampTool" Services_Conference_Participant: "Participant" Services_Collaboration_LineTool: "LineTool" Services_Conference_ActiveParticipant: "ActiveParticipant" Base: "Base" Base_DataRetrieval: "DataRetrieval" Services_Contacts_EditableContactEmailAddressField: "EditableContactEmailAddressField" Services_Contacts_ContactEmailAddressField: "ContactEmailAddressField"