Phone Integration
From this section, you can learn how to integrate your own phone.
You can find phone implementations in no-payphone/integration/phone
Phone integration can be a little more complicated. To do this we need to add event listeners for payphone events and trigger phone events.
Ready Integrations
Payphone Events
This events will be triggered by payphone.
no-payphone:call:start
Triggered when payphone starts the call.
Parameters
ctx: {source: number; number: string; targetNumber: string; callId: number}
ctx.source is the caller's server id.
ctx.number is payphone's number.
ctx.targetNumber is the number payphone is calling.
ctx.callId is the call Id generated from payphone. (You don't need to use this)
no-payphone:call:answer
Triggered when payphone answers the call.
Parameters
ctx: {source: number; number: string; targetNumber: string; callId: number}
ctx.source is the caller's server id.
ctx.number is payphone's number.
ctx.targetNumber is the number payphone is calling.
ctx.callId is the call Id generated from payphone. (You don't need to use this)
Phone Events
This events expected to triggered by phone.
no-payphone:phone:start
Triggered when phone starts the call.
Parameters
ctx: {source: number; number: string; targetNumber: string; callId?: number}
ctx.source is the caller's server id.
ctx.number is the phone's number.
ctx.targetNumber is the number phone is calling.
ctx.callId: Generated call id (If nil payphone will generate itself.).
Example
This is an example for qb-phone. You can find this integration in
no-payphone/config/integration/phone/qb-phone.lua
Last updated