Ticket #5393 (new Patches)

Opened 2 years ago

Last modified 1 year ago

Call waiting indication to caller

Reported by: erm_oren Assigned to:
Priority: minor Milestone: Undetermined
Component: Call Waiting Version: 2.9-branch
Keywords: Cc:
Confirmation: Unreviewed Distro:
Backend Engine: All Distro Ver:
Backend Ver: SVN Revision (if applicable):

Description

In order to add call waiting indications to the caller, I've modified macro-dial-one:

exten => s,n(godial),Dial(${DSTRING},${ARG1},${D_OPTIONS})

is replaced with

exten => s,n,GotoIf($["${EXTENSION_STATE(${DEXTEN})}"="UNAVAILABLE" | "${EXTENSION_STATE(${DEXTEN})}"="NOT_INUSE" | "${EXTENSION_STATE(${DEXTEN})}"="UNKNOWN"]?reallydial)
exten => s,n,Progress()                                   ;; start progress
exten => s,n,Set(DSTRING=${DSTRING}&Local/s@keep-ringing) ;; update dialstring to prevent asterisk from ringing
exten => s,n,Playtones(callwaiting)                       ;; start playing callwaiting tones
exten => s,n(reallydial),Dial(${DSTRING},${ARG1},${D_OPTIONS})
exten => s,n,StopPlaytones()

additionally, I've added the section

[keep-ringing]
exten => s,1,Ringing()
exten => s,n,Wait(600)
exten => s,n,Hangup()

so the dial command could be appended with &Local/s@keep-rining and the progress tones will not be stopped by the Dial command.

Change History

(in reply to: ↑ description ) 03/19/12 17:28:42 changed by danielf

Replying to erm_oren:

Hello,

that seems nice, but I have a better solution:

instead of this line:

exten => s,n(godial),Dial(${DSTRING},${ARG1},${D_OPTIONS})

you can replace this line with this code sample:

exten => s,n(godial),GotoIf($["${EXTENSION_STATE(${DEXTEN})}"="UNAVAILABLE" | "${EXTENSION_STATE(${DEXTEN})}"="NOT_INUSE" | "${EXTENSION_STATE(${DEXTEN})}"="UNKNOWN"]?dial:dialbusy)
exten => s,n(dialbusy),GotoIf($["${EXTENSION_STATE(${DEXTEN})}" = "BUSY"]?dialcallwaiting)
exten => s,n(dialcallwaiting),Dial(${DSTRING},${ARG1},r(callwaiting))
exten => s,n(dial),Dial(${DSTRING},${ARG1},${D_OPTIONS})

There is still a problem with the dialparties.agi. When ever an extension has a followme (that uses the dialparties.agi), this change will not take effect.

Moshe, can you please take a look at that and add a fix to all the dial macros (including the dialparties.agi)? all you need to add when the extension state's in-use or busy is to add the call waiting indication (it will take is from indications.conf).

this is the syntax to add a tone to the r option in the Dial application:

Dial(${DSTRING},${ARG1},r(callwaiting))

Maybe you can add an option in the general settings page to let the users choose if they want to play a call waiting tone when the extension is in-use or busy.

Thank you,

Daniel Friedman
Kollforex

Tel: 972.72.2608333
Mobile: 972.50.6655579

Email: dani@call4ex.com