Inbound DialPlan improvements; playback without answer


#1

Hello,
I have in production Asterisk 1.8.7 running with A2Billing 1.9.4, where I’m handling incoming and outgoing traffic properly.

My Actual working inbound dialplan is the following:

[quote][inbound-did]
exten => _X.,1,AGI(a2billing.php,1,did)
exten => _X.,2,Hangup()[/quote]

I wanted to do the following:

  1. If user is unavailable, unreachable, play back unavailable IVR- Without Answering the call.
  2. If the user is busy, playback busy IVR- Without answering the call.
  3. If the destination user dosn’t exist (the DID not in use, neither assigned to any user), without answering, playback an IVR as unused/ unvalid preloaded IVR.
  4. If the destination user is congestioned, or if there’s any congestion in my system, playback a preloaded IVR, without answering the call.

So, as not expert, I was readin the dialplan documentation, and I wrote the following (Sorry, it’s simple and so confused):

[quote][inbound-did]
exten => _X.,1,AGI(a2billing.php,1,did)
exten => i,3,Answer
exten => s,n,Goto(s-${DIALSTATUS},1)= “BUSY”]?busy:unavail)
exten => s,n(unavail)Playback(pbx-invalid)
exten => s,n(busy)Playback(busy)
exten => s-NOANSWER,1,Voicemail(u${ARG1})
exten => _X.,2,Hangup()[/quote]

But this one, apparently it’s not working, the playback it’s running, but no voice, as there’s no answer, I guess, or I don’t know, what’s wrong, but not playing any back IVR…

Can any one, please, just advice me, about if this possible, to playback the IVR without answering the call?? The purpose from this, is to play the message from my server, avoid the caller to be billed from his originating carrier, and avoid also, that the originating carrier play him his own message…

Thanks for advice!


#2
  1. To send in band progress on recent versions of Asterisk, you must use the Progress() application explicitly.

  2. Playback should answer, unless you tell it not to. I don’t know why it isn’t in your case.

  3. Unless you have a network operator status yourself, I would expect most network operators to either:
    i) treat Progress as Answer, and start charging; or
    ii) ignore Progress and not set up a speech path.

Anything else allows people to operate free recorded announcement services.


#3

Thanks for your prompt david55,

[quote=“david55”]1) To send in band progress on recent versions of Asterisk, you must use the Progress() application explicitly.
[/quote]
Ok, I just was reading about the progress directive, it seem the be exactly which I wanted to setup, playaudio without answering the call, thanks…

I’m setting the nonnaswer directive with n. as you can see in my dialplan, and the new below which I modified, if destination is correct answer, if not, progress with early media. See below…

Yes we have small network operator, where we just started and for the moment we’re handling small amount if incoming DIDs, so for this reason I wanted to setup this messages, cause users are complaining as there’s no any message showing out of network or coverage, nonavailable, or busy, so for this I wanted to improve the dialplan, the new which I did is below:

[quote][a2billing-did]
exten => _X.,1,AGI(a2billing.php,1,did)
exten => i,3,Answer
exten => _X.,4,Progress()
exten => s,n,Goto(s-${DIALSTATUS},1)= “BUSY”]?busy:unavail)
exten => s,n(unavail)Playback(pbx-invalid)
exten => s,n(busy)Playback(busy)
exten => s-NOANSWER,1,Voicemail(u${ARG1})
exten => _X.,2,Hangup([/quote]

So, dose this correct now, as first option is to lance the a2billing script to check for the destination, and answer if it’s available, if not, go with earlymedia progress message announcing the status, without answering the call…

Dose this correct, please? Or should I use the progress before the answer, it will be contradictory, no??


#4

_X. matches a minumum of two characters, so there is nothing that matches i,1 or i,2, and thus i,3 will note get executed.

Whilst putting priorities out of sequence is, I believe, legal, it is certainly confusing.


#5

Thanks again david55,

So, I’d re-write my dialpla as below:

[quote][inbound-did]
exten => _X.,2,AGI(a2billing.php,1,did)
exten => _X.,2,Hangup()
exten => _i.,1,Progress()
exten => s,n,Goto(s-${DIALSTATUS},1)= “BUSY”]?busy:unavail)
exten => s,n(unavail)Playback(pbx-invalid)
exten => s,n(busy)Playback(busy)
exten => s-NOANSWER,1,Voicemail(u${ARG1})[/quote]

So, dose this order is correct, handling first of the inbound call into a2billing script, if correct, the channel will open, and hangup after closing the call…
If not, _X.,3 to handle the progress directive, without any answer, as I, then dialstatus of the channel, and playback the IVR without answering the call…
Dose this is the correct??

Thanks again?


#6

You don’t seem to understand priorities at all. Please go back and read extensions.conf.sample and/or one of the Asterisk books until you understand how dialplans work.

Basically, if you have a number xxxx, Asterisk looks for the best match for xxxx,1. If it doesn’t find that, it falls back to i,1, or s,1 (or rejects comletely for subroutines) - it actually replaces xxxx by i or s, for these fallbacks. If the match for xxxx,1 runs and returns 0, it looks for the best match xxxx,2, then for xxxx,3, etc.

n is just a shorthand for one more than the number on the previous line (regardless of whether it has the same pattern). So, your first s line is for priority two, so there is no s,1, so the s series entries are useless.