[RESOLVED] Asterisk as an PSTN gateway - Outgoing call ONLY


I have an Asterisk@Home installation v2.7. I really just want to use it as an Internal PBX at home supporting OUT GOING Calls ONLY to PSTN (plus Internal Communication/Paging).

How can I prevent the X100P Card (Asterisk) from Answering the PSTN line for in-bound calls?


I am not sure how to prevent it from answering at all but if you put this code in as your inbound context for the Zap channels, they won’t be off of the hook very long when a call does come in.

exten => s,1,Answer
exten => s,n,Zapateller()
exten => s,n,Hangup

Hi Bubba Geek,

Thanks for the suggestion.

I’ve done that before and lots of my stingy friends got upset.

unlike in the US, we are screwed here twice by the Fix line operator charging us Line rental (e.g. Subscription (Fee) to the Service) + each Calls made.

Originated calls in Australia are charged as soon as the other party answers the call.

i received lots of “nice words” from them when I came back from my month long holiday (the words are still ringing in my brain)

Anyway, any other good suggestion please?


Correct, any “ANSWER” line would cause charging which might be unwanted, so carefull with the “lift, drop” tactic.

If your provider supports “Early inband” you could do this:


(Syntax might be wrong, made out of mind…)

Ok, what happens here ?

A call comes in via ZAP (PSTN).
You catch it via the appropiate extension. Now the important part:
The DIAL string must point to a valid and logged in enddevice, so we get a “ring” and not a “non available” on the device.
This could be a “dummy” soft-sip on a laptop or whatever.

The “,m(filename)” is the secret here:
THis is “early inband” : It doesnt play a calltone/ringtone to the caller, it play MUSIC (M=Music). The music is the same as configured for MOH.

But since we also issued a filename, this particular file is played to the caller.

And THIS file could be a customized announcement of yours:
“Dear Caller - this announcement is not causing any callcosts to you, its free. If you want to call Mary, John and family, dial XXXXXX. This number is for outgoing calls only. Thank you for calling”

You could even extend that:
“Dear Caller - this announcement is not causing any callcosts to you, its free. If you want to call Mary, John and family, dial XXXXXX. If you wait ten more seconds, you get connected and charged for this call. If you dont want that, HANG UP NOW”.

Then you put another branching in the extensions for the timeout, forwarding the call to another (VIP)-enddevice.

Hi All,

Thanks for the contribution.

I was able to resolve my problem by accident!

Within AAH Adminstration page (I upgraded AMP Portal to FreePBX)

I created an entry in the Inbound routes connecting any incoming call to one of my spare SIP Phone, under Options I set Immediate Answer to NO (apparently, you’re suppose to set this to yes if you would like to use the same PSTN line to be able to detect fax calls and received it accordingly.

After i’ve done the above, when ever there is an incoming call from the PSTN, the asterisk system simply alerts my SIP extesion without answering the call.

Thanks for all the effort.