Phone Integration

From this section, you can learn how to integrate your own phone.

circle-info

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.

chevron-rightno-payphone:call:starthashtag

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)

chevron-rightno-payphone:call:answerhashtag

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)

chevron-rightno-payphone:call:endhashtag

Triggered when payphone ends the call.

Parameters

  • ctx: {number: string; targetNumber: string}

ctx.number is payphone's number.

ctx.targetNumber is the number payphone is calling.

Phone Events


This events expected to triggered by phone.

chevron-rightno-payphone:phone:starthashtag

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.).

chevron-rightno-payphone:phone:answerhashtag

Triggered when phone answers the call.

Parameters

  • ctx: {source: number; number: number}

ctx.source is the caller's server id.

ctx.number is the phone's number.

chevron-rightno-payphone:phone:endhashtag

Triggered when phone ends the call.

Parameters

  • phoneNumber: string

Example


circle-info

This is an example for qb-phone. You can find this integration in

no-payphone/config/integration/phone/qb-phone.lua

Last updated