Outbound IVR is starting before answering the call for some service providers

Hi all,

Outbound IVR is starting before answering the call for some service providers.

Please find the dialplan configuration.

[IVR]

exten => s,1,Set(ODBC_SAVE_CDR()={clid},{src},{dst},{dcontext},{channel},{dstchannel},{lastapp},{lastdata},{start},{answer},{end},{duration},{billsec},{disposition},{amaflags},{accountcode},{uniqueid},{userfield},${sequence})

exten => s,n,Set(TIMEOUT(digit)=5)

exten => s,n,Set(TIMEOUT(response)=10)

exten => s,n,Wait(1)

exten => s,n,AMD()
exten => s,n,GotoIf([{AMDSTATUS}=HUMAN]?humn:mach)
exten => s,n(mach),WaitForSilence(1000)

exten => s,n,Background(./custom/Main_Menu)

exten => s,n,Read(NUMBER,1,3,3)
exten => s,n,verbose({NUMBER}) exten => s,n,Set(CDR(userfield)={NUMBER})

exten => s,n,GotoIf(${CDR(userfield)} = 1?one:)

exten => s,n,GotoIf(${CDR(userfield)} = 2?two:)

exten => s,n(one),Playback(./vm-goodbye)
exten => s,n,Hangup()

exten => s,n(two),Playback(./vm-goodbye)
exten => s,n,Hangup()

exten => s,n(humn),WaitForSilence(1000)

exten => s,n,Background(./custom/Main_Menu)

exten => s,n,Read(NUMBER,1,3,3)
exten => s,n,verbose({NUMBER}) exten => s,n,Set(CDR(userfield)={NUMBER})

exten => s,n,GotoIf({CDR(userfield)} = 1?one:) exten => s,n,GotoIf({CDR(userfield)} = 2?two:)

exten => 1,1,Playback(./vm-goodbye)
exten => 1,n,Hangup()

exten => 2,1,Playback(./vm-goodbye)
exten => 2,n,Hangup()

1 Like

What is the console output? What is the technology in use?

Hi jcolp,

Thank you.

I used AMD with WaitForSilence applications for this. For one service provider IVR is playing after answering the call and remaining service providers IVR is starting before answering the call.

Please find the below output of working and non working scenarios.

Not working logs:

DAHDI/3-1 answered
– Executing [s@IVR:1] Set(“DAHDI/3-1”, “ODBC_SAVE_CDR()=,”) in new stack

– Executing [s@IVR:2] AMD(“DAHDI/3-1”, “”) in new stack
– AMD: DAHDI/3-1 9010012162 (N/A) (Fmt: ulaw)
– AMD: initialSilence [2500] greeting [1500] afterGreetingSilence [800] totalAnalysisTime [5000] minimumWordLength [100] betweenWordsSilence [50] maximumNumberOfWords [2] silenceThreshold [256] maximumWordLength [5000]
– AMD: Channel [DAHDI/3-1]. Changed state to STATE_IN_SILENCE
– AMD: Channel [DAHDI/3-1]. Word detected. iWordsCount:1
– AMD: Channel [DAHDI/3-1]. Detected Talk, previous silence duration: 2160
– AMD: Channel [DAHDI/3-1]. Changed state to STATE_IN_SILENCE
– AMD: Channel [DAHDI/3-1]. Detected Talk, previous silence duration: 180
– AMD: Channel [DAHDI/3-1]. Word detected. iWordsCount:2
– AMD: Channel [DAHDI/3-1]. Changed state to STATE_IN_SILENCE
– AMD: Channel [DAHDI/3-1]. HUMAN: silenceDuration:800 afterGreetingSilence:800
– Executing [s@IVR:3] GotoIf(“DAHDI/3-1”, “1?humn:mach”) in new stack
– Goto (IVR,s,15)
– Executing [s@IVR:15] WaitForSilence(“DAHDI/3-1”, “1000”) in new stack
– Waiting 1 time(s) for 1000ms of silence with 0s timeout
Exiting with 1000ms of silence >= 1000ms required
– Executing [s@IVR:16] BackGround(“DAHDI/3-1”, “./custom/Main_Menu”) in new stack
– <DAHDI/3-1> Playing ‘./custom/Main_Menu.gsm’ (language ‘en’)

Working logs:

DAHDI/3-1 answered
– Executing [s@IVR:1] Set(“DAHDI/3-1”, “ODBC_SAVE_CDR()=,”) in new stack
– Executing [s@IVR:2] AMD(“DAHDI/3-1”, “”) in new stack
– AMD: DAHDI/3-1 9110578944 (N/A) (Fmt: ulaw)
– AMD: initialSilence [2500] greeting [1500] afterGreetingSilence [800] totalAnalysisTime [5000] minimumWordLength [100] betweenWordsSilence [50] maximumNumberOfWords [2] silenceThreshold [256] maximumWordLength [5000]
– AMD: Channel [DAHDI/3-1]. Changed state to STATE_IN_SILENCE
– AMD: Channel [DAHDI/3-1]. Word detected. iWordsCount:1
– AMD: Channel [DAHDI/3-1]. Detected Talk, previous silence duration: 2420
– AMD: Channel [DAHDI/3-1]. ANSWERING MACHINE: voiceDuration:1500 greeting:1500
– Executing [s@IVR:3] GotoIf(“DAHDI/3-1”, “0?humn:mach”) in new stack
– Goto (IVR,s,4)
– Executing [s@IVR:4] WaitForSilence(“DAHDI/3-1”, “1000”) in new stack
– Waiting 1 time(s) for 1000ms of silence with 0s timeout

After this call is waiting till end user answers the call and then it’s waiting for 1000 ms to play the IVR.

Regards,
Nani

@jcolp,

I am using call files to auto dial.
Please find the below sample call file.

Channel: DAHDI/g0/XXXXXXXXXX
Callerid: 1001
MaxRetries: 5
RetryTime: 60
WaitTime: 30
Context: IVR
Extension: s
Priority: 1
EOF

Are you using analogue or ISDN.

Getting answer supervision on analogue is dependent on the provider.

@david551,
Thank you.
We are using analogue lines.

Regards,
Nani

What answer supervision, if any, do the providers use, and what answer supervision do you have configured in dahdi.conf.

Please note that this sort of application really needs needs an ISDN interface to the public network, either directly or via an ITSP.

@david551,

Thanks for the reply.

Can you please tell me where to configure answer supervision.

Regards,
Nani

dahdi.conf, and at the provider’s exchange.

@david551,

I didn’t find dahdi.conf file in /etc/asterisk.

Please tell me where it was located.

Regards,
Nani

I think it is actually chan_dahdi.conf

@david551,

Please find below chan_dahdi.conf configuration. I haven’t found answer supervision in that.

[trunkgroups]

[channels]
context=default
usecallerid=yes
hidecallerid=no
callwaiting=yes
usecallingpres=yes
callwaitingcallerid=yes
threewaycalling=yes
transfer=yes
canpark=yes
cancallforward=yes
callreturn=yes
echocancel=yes
echocancelwhenbridged=yes
relaxdtmf=yes
rxgain=0.0
txgain=0.0
group=1
callgroup=1
pickupgroup=1
immediate=no

cidstart=polarity_IN
cidsignalling=dtmf
callerid=asreceived
cid_rxgain=5.0

busydetect=yes

callprogress=yes
answeronpolarity=yes

;Sangoma AFT-200 [slot:4 bus:3 span:1]
context=from-pstn
group=0
echocancel=yes
signalling = fxs_ks
channel => 1

context=from-pstn
group=0
echocancel=yes
signalling = fxs_ks
channel => 2

context=from-pstn
group=0
echocancel=yes
signalling = fxs_ks
channel => 3

context=from-pstn
group=0
echocancel=yes
signalling = fxs_ks
channel => 4

Regards,
nani

That’s because you have stripped out the documentation, which is in the comments. It is there and it is enabled, which means your providers must both be doing line reversals. You need to ask them whether they do them on answer, or before. If they weren’t doing them, the call would never be considered answered.

@david551,

Sorry for asking this, which parameter refers answer supervision in chan_dahdi.conf

Regards,

Nani

The one with answer in its name.

@david551,

Thank you David.

I will check with the provider side.

Regards,
Nani

@david551,

I have one more question.

Why it is working for one mobile service provider with the same analogue line provider.

Regards,
Nani

Possibly because they are signalling answer, to the network, before the call is answered.