1
votes

I have implemented a simple blacklist for my incoming calls. The problem I am having is that my phone is no longer ringing when a blacklister calls(this part is good), but the blacklisted phone doesn't hang up (this is the problem).

Incoming context in extensions.conf:

exten => 12225551234,1,Zapateller(nocallerid)
same => n,GotoIf(${BLACKLIST()}?hangup)
same => n,Dial(SIP/myphone)
same => n(hangup),Hangup()

Add a number to blacklist:

CLI> database put blacklist +14445554321 "Blacklisted for testing"

Call 12225551234 from blacklisted 14445554321...

As seen via CLI interface:

== Using SIP RTP CoS mark 5
 -- Executing [12225551234@from-sipProvider:1] GotoIf("SIP/sipProvider_did9-00000738", "1?hangup") in new stack
 -- Goto (from-sipProvider,12225551234,5)
 -- Executing [12225551234@from-sipProvider:5] Hangup("SIP/sipProvider_did9-00000738", "") in new stack
== Spawn extension (from-sipProvider, 12225551234, 5) exited non-zero on 'SIP/sipProvider_did9-00000738'
== Using SIP RTP CoS mark 5
 -- Executing [12225551234@from-sipProvider:1] GotoIf("SIP/sipProvider_did10-00000739", "1?hangup") in new stack
 -- Goto (from-sipProvider,12225551234,5)
 -- Executing [12225551234@from-sipProvider:5] Hangup("SIP/sipProvider_did10-00000739", "") in new stack
== Spawn extension (from-sipProvider, 12225551234, 5) exited non-zero on 'SIP/sipProvider_did10-00000739'
== Using SIP RTP CoS mark 5
 -- Executing [12225551234@from-sipProvider:1] GotoIf("SIP/sipProvider_did9-0000073a", "1?hangup") in new stack
 -- Goto (from-sipProvider,12225551234,5)
 -- Executing [12225551234@from-sipProvider:5] Hangup("SIP/sipProvider_did9-0000073a", "") in new stack
== Spawn extension (from-sipProvider, 12225551234, 5) exited non-zero on 'SIP/sipProvider_did9-0000073a'

This continues until the blocked caller hangs up. Eventually, after about 50 seconds, if the caller hasn't hung up he hears ringing. I need to hang up his phone or I will be charged if he leaves the phone off the hook.

1

1 Answers

1
votes

Try answering the call before hanging up. This is what I use:

exten => 12225551234,1,Zapateller(nocallerid)
same => n,GotoIf(${BLACKLIST()}?badlist,s,1)
same => n,Dial(SIP/myphone)
same => n,Hangup()

[badlist]
exten => s,1,Answer
exten => s,n,Wait(1)
exten => s,n,Playback(ss-noservice)
exten => s,n,Hangup