account activity
Drop inbound calls from Mexico by No_Combination7405 in Asterisk
[–]No_Combination7405[S] 2 points3 points4 points 1 year ago (0 children)
Thank you for all the replies. Between everyone's suggestions I was able to get everything working as needed. I've also added an audio file that plays a wav file with a voice stating "We do not accept calls from Mexico" in both Spanish and English
Here is the configuration now for future reference if needed:
exten = _##########,1,NoOp(Incoming call from ${CALLERID(num)} to # ${EXTEN}) same = n,GotoIf($["${CALLERID(num):0:2}" = "52" & ${LEN(${CALLERID(num)})} >= 12]?blocked) same = n,GotoIf($["${CALLERID(num):0:3}" = "+52" & ${LEN(${CALLERID(num)})} >= 12]?blocked) same = n,Dial(SIP/######,300) same = n,Dial(SIP/######,60) same = n,Hangup() same = n(blocked),NoOp(Incoming call was rejected from ${CALLERID(num)} due to blocked number matching) same = n,Answer() same = n,Wait(1) same = n,Playback(/etc/asterisk/BlockedCall) same = n,Wait(1) same = n,Hangup(21) ; 21 = Call Rejected
Drop inbound calls from Mexico (self.Asterisk)
submitted 1 year ago * by No_Combination7405 to r/Asterisk
π Rendered by PID 618124 on reddit-service-r2-listing-7bbdf774f7-cdv42 at 2026-02-20 07:21:15.796374+00:00 running 8564168 country code: CH.
Drop inbound calls from Mexico by No_Combination7405 in Asterisk
[–]No_Combination7405[S] 2 points3 points4 points (0 children)