Play "Number Not In Service" for dormant DIDs

We have a bunch of DIDs that we purchased but aren’t using, and I’d like to play the default “number not in service” recording if a call comes in for that number. I can’t seem to find the right destination option on the inbound route. Does anyone know what I should use there?

Hi!

I use this:

[custom-blacklist]
exten => s,1,Noop(Old style blacklist)
exten => s,n,Answer
exten => s,n,Wait(1)
exten => s,n,Zapateller()
exten => s,n,Set(CHANNEL(language)=fr)
exten => s,n,Playback(ss-noservice)
exten => s,n,Wait(1)
exten => s,n,Set(CHANNEL(language)=en)
exten => s,n,Playback(ss-noservice)
exten => s,n,Hangup

which I put in extensions_custom.conf.

It’s named custom-blacklist because I wanted to restore the old blacklist functionality in FreePBX 13 (which was to play back the SIT (ie Zapateller()) and the no service message…

I also added it in “Custom Destinations” in FreePBX (target is custom-blacklist,s,1 ).

For your need I would suggest renaming it and if you don’t need to playback the message in two languages like I do (I play it in French and then in English) change it to something like this maybe:

[custom-noservice]
exten => s,1,Noop(Play no service)
exten => s,n,Answer
exten => s,n,Wait(1)
exten => s,n,Zapateller()
exten => s,n,Playback(ss-noservice)
exten => s,n,Hangup

The “target” in Custom Destinations should then be “custom-noservice,s,1” .

Once you have done that you can point your DIDs to this in your inbound routes…

Good luck and have a nice day!

Nick

there is a Freepbx way to do that :wink: (this one based on FreePBX 12.0.76.2 )

Admin->System Recordings->Built-In Recordings (the last link is on right hand side upper corner)

select system recording - click on the drop-down, start typing ss-noservice, should autocomplete/hint - then click ‘go’

then on next screen, give it a name (no spaces allowed - it will prompt you to change if it doesn’t like it), then Save;

then in Connectivity->Inbound Routes, set the DID destination to Announcements, and there you will have the recording you just named, available on the list;

Set other options as neccesary.

Set the destination after announcement, to terminate/hang up.

Thanks for both methods! I know custom dialplan is pretty powerful, but I think this time I’m going to go with the FreePBX method for ease of use. :smile:

No problem…

By the way, the simplified code is essentially what was used (and might still be used with FreePBX 12) for the blacklist…

I am not sure but I think if that code is still there in your FreePBX version you could might be able to directly call that code from a custom destination without needing to edit any custom files, you would only need to figure out what the name to use for the custom destination is…

The main difference between my solution and el_es’ is that you won`t get the SIT tone (actually I think it’s a possible destination but it won’t play before the "no service’ which is what most people would expect…)… Of course you can’t easily handle the multiple language issue I have with the purely FreePBX solution…

The best bet would actually be for the devs to add this to FreePBX itself as one of the possible destinations… When I get a chance I might look at it and submit them a patch for this…

Good luck and have a nice day!

Nick

Hi!

That’s actually what I did yesterday and Andrew (one of the FreePBX devs) just applied it today…

(Thank you Andrew!!!)

The “FreePBX way” :wink: to do this with FreePBX 13 (if you have core 13.0.5 or later) is

“Terminate call, Play no service message”

What it does is play the SIT tone, play the “no service” message and hang up…

Have a nice day!

Nick

Before the line

exten => s,n,Hangup

I like to include about ~ 20 seconds of “congestion” tone/s.
Just in case the caller’s telco fails to provide this important audible clue.

exten => s,n,Congestion(20)

Is that a good/bad idea ?

Hi!

As long as you have the SIT tone and the no service message too I do not think it can hurt…

The SIT tone is not supposed to be used alone so using it alone would not be enough…

Playing only the no service message would not be enough either because a lot of people the world over know that the SIT tone indicates a problem even if they don’t understand the no service message because they don’t speak the language…

Is it too much?

Hey, as mail server admins say, your server, your rules… It’s up to you to decide what you are happy with…

In my case I wanted the no service message to be in the two official languages of my country so I still have custom code to handle this…

Have a nice day!

Nick

Any chance that change will be backported to 12 since 13 is still not production ready?

uhm,
well yeah, right… on my 12.0.76.2, there is a possible destination for Terminate Call → Play SiT tone (Zapateller) but then no go to the announcements…

custom dial-plan it is then…

(crazy idea, but how about a ‘custom dial-plan builder’, where one could add a custom-built destination - like the OP’s described - say include 2 different announcements, zapateller, pause(s), congestion tone(s) and finally a hang-up, all done by ‘pulling (configurable) blocks into the flow’ and managed by FreePBX? essentially, like Miscellaneous Application, but with more destinations allowed to be entered, their options customized, and played out in order of config? less possibility of making typos in dialplan, for sure :wink: )

Hi Josh!

I looked at this a little and the code seemed different so it would not what in git terms they call “cherry picking”, essentially applying the same fix to another branch (ie release).

I could be wrong about it though, I didn’t look at it in great details…

That said I submitted another fix in the same general area in the past and Andrew (one of the FreePBX developers) wasn’t very hot about backporting it to 12… That fix however while it was composed of less source code lines had something in it that made it more complex, more risky… It was OK to apply it to a beta, more risky to apply it to a stable release…

If FreePBX 13 doesn’t get out very soon now and if Andrew says that he would apply a pull request done against FreePBX 12 to implement the same thing I can look at it…

I do expect FreePBX 13 to get out very very soon now… Many FreePBX devs suggested it was close to release and on my box it no longer reports itself as a RC (Release Candidate) but like a stable release…

Have a nice day!

Nick

OK, I was wrong…

I am not sure what happened when I compared those two branches because the code is nearly identical in the places where it’s important that it be…

I tried “cherry-picking” (ie what one would normally do to backport) on my copy of FreePBX repository and it seems to have applied cleanly…

Josh, let me know if you are willing to wait a little to see if FreePBX 13 becomes stable very soon…

If you are not then I will add a comment to my pull request to ask Andrew if he would be willing to backport this to FreePBX 12…

Have a nice day!

Nick

Thanks Nick. I don’t mind waiting for 13 to become stable, but even when it does we will test for a month or so before moving it into production. If Andrew is willing to backport it, it would be nice to have. If not, we’ll live with the solutions we have for now.

It’s no longer necessary to use a custom dial plan under FreePBX 13 with core 13.0.5 and later though (unless you want to do custom stuff like playing the message in two languages like I do) as Andrew merged in my fix and published it…

It sure would be nice but I wonder who would use it…

It might be a little too complex to use for some people and the ones who would know how to use it would most likely be able to do it directly in custom files so I wonder if it would be worth the effort of doing it though…

But it sure sounds nice…

Have a nice day!

Nick

I record " You have reached a non-working number at Big Company, for assistance please dial our main number - 3125431800 Good-bye!" as an announcement. I set all inactive inbound routes (DIDs) to this announcement and then disconnect the call.

SIP SIP