# Introduction to Initiating Call Interface
The plug-in provides the ability to communicate directly with WeChat users on the device.
# 1. Select Interface
Developers please choose different call interfaces according to the scene.
# 1.1 Android WMPF Device Call Mobile WeChat
use initByCaller
Interface, businessType pass 1。
# 1.2 Linux Device Call Mobile WeChat
Linux Device does not run the Mini Program plug-in, use theMini Program audio and video call SDK (Linux equipment)。
# 1.3 Android phone WeChat call WMPF equipment
- Recommend: Use
callWMPF
Interface. Required plug-in 2.4.0 Start supporting. If used License Billing, this interface must be used. - use
initByCaller
Interface, businessType pass 2。This method is not supported License Billing.
# 1.4 Mobile phone WeChat call Linux equipment
use callDevice
Interface. Required plug-in 2.4.0 Start supporting.
Please Note: Call Linux Device, WeChat does not push messages, the developer needs to add the device side to the parameters required by the room (such as roomId Etc.) from the WeChat end to the device end.
# 2. MUST READ BEFORE USE
# 2.1 Go to Call Page
Several interfaces that initiate calls can be invoked on the Mini Program page or on the plugin page. But the final call flow must be on the plugin page.
- If the call is initiated in the Mini Program page, after the interface is called successfully, the developer needs to manually jump to the plug-in page, and the plug-in page will enter the call flow after the completion of the plug-in page load.
- ifWhen initiating a call, on the plugin page, interface call will be directly into the call flow. herePlease do not repeat the page., otherwise the current call will be interrupted.
- Multiple plug-in page instances within the page stack are not recommended.
// After initiating a successful call, you only need to jump if you are not currently a plugin page.
wx.redirectTo({
// Here you just need to pass in path If the developer has other parameters that need to be passed to the Mini Program, you can also splice them yourself. Query, and through the plug-in getPluginOnloadOptions Interface gets.
url: wmpfVoip.CALL_PAGE_PATH,
// plug-in 2.3.9 Start support CALL_PAGE_PATH, Lower version please. 'plugin-private://wxf830863afde621eb/pages/call-page-plugin/call-page-plugin',
})
# 2.2 Maximum Call Duration
In order to reduce developer development costs, the plug-in provides the ability to limit the maximum call duration. The maximum call length should be > 0 Of the numbers.
The length of the call varies from startVoip
The event starts the timer, after the timeout, the call will automatically end and play toast Prompt the user, while triggering the HangUpVoip
Event, origin for 'timeLimit'
。
# 2.3 groupId and roomId
In Plugins 2.4.0 In the following versions, the call room ID Known as the groupId
, the name is easier to associate withEquipment Groupof ID Produce confusion, and therefore from 2.4.0 Now, the room number has been renamed roomId
, but to maintain backward compatibility, groupId Parameters are retained.
There is no difference between the two except the name.