Sunr1ses / google-voice-sipsorcery-dialplans

Automatically exported from code.google.com/p/google-voice-sipsorcery-dialplans
1 stars 0 forks source link

Can we block calls after midnight (people who called the IPKall number, not Google Voice)? #119

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Having a DID number
2. Having a caller call in at 4:14AM!
3. Having a phone that has the ringing sound on

What is the expected output? What do you see instead?
I expect to sleep ;)
Instead, I get annoying callers at 4:14AM. :(

What version of the product are you using? On what operating system?
Linksys PAP2T-NA, N/A

Please provide any additional information below.
Is it possible to stop callers that don't call through Google Voice and instead 
call the DID number directly in SIPSorcery?
I mean, there's nobody I need to or what to talk to after like 11PM, anyway.

I already gave SIPSorcery my time zone, wouldn't it be as simple as having time 
arguments and then a 'error' code to send that will it will not accept or 
something (well, I will admit I don't know all the options of SIPSorcery just 
yet...)?

So, anyhow, I was asleep and then at 4:14AM, some annoying San Fransisco, CA 
number (415-xxx-xxxx) called my DID directly (the chances of them being 
SIP-enabled and directly dialing my SIP URI at that time are really, really, 
really! slim, so that's why I thought that they dialed the IPKall DID number).

I'm actually glad I switched from SIPGate! Periodically, I'd login to their 
website to see what was going on and I would find a *lot* of missed calls from 
numbers I don't know. Now I'm glad that incoming calls weren't coming to my 
phone when I was using a SIPGate account.

I was just wondering if this is possible and if so, how can I set it up (I've 
already got Google Voice to do the same, if only we could stop callers who 
called the DID number itself)?

I realize I simply could just unplug my phone when I go to bed, but I'd rather 
it just be automatic if possible since I do need to be called in the morning 
(about 9AM).

Original issue reported on code.google.com by XANAVi...@gmail.com on 9 Feb 2011 at 3:31

GoogleCodeExporter commented 9 years ago
We can register that as a requested enhancement for Mike to consider. I have a 
lot of family in California so while I don't want most people calling me 
overnight, there are a few people who I want to be able to reach me if an 
emergency strikes in the middle of the night -- like an earthquake.

Original comment by easter...@gmail.com on 9 Feb 2011 at 9:25

GoogleCodeExporter commented 9 years ago

Original comment by easter...@gmail.com on 9 Feb 2011 at 9:56

GoogleCodeExporter commented 9 years ago
This feature has been implemented long time ago:

    callswitch("#{user}@local[fu=#{name}]",45) unless (30..745) === @t.hour*100 + @t.min # forward straight to VM from 0:30a to 7:45a

The above line is present in my Complex dialplan you can find in Contrib 
folder. As to simple dialplan, you can add a similar "unless" clause to 
sys.Dial("#{sys.Username}@local[fu=#{name}]",45) in the inbound call handler 
(you'll also need to "borrow" a few lines used to initialize @t with current 
local time from the Complex dialplan). Of course, you can adjust time interval 
as necessary.

I'd like to clarify about time zone settings in Sipsorcery profile. It affects 
web interface only (for example, the time displayed on the "Calls" page). Ruby 
engine is independent (so far, there is an open "to do" request in that matter) 
and always return server time (which is PST or GMT-8). Therefore, you need to 
adjust "Ruby" clock manually, that's what I do in the Complex dialplan:

 @t = Time.now + ((Tz+8)*60*60) # Get current time and adjust to local (GMT+3). SS Server is in GMT-8

Original comment by mte...@gmail.com on 10 Feb 2011 at 5:27

GoogleCodeExporter commented 9 years ago
Hey, I saw your reply.

I can't seem to see the dialplans in the folders in 'Source'. There's nothing 
there...
Strange. I've tried with Google Chrome and IE and they just don't seem to be 
there to me.

Anyhow, I was trying to put the code into my dial plan (I think it's the 
complex one - I'm not really sure since I can't see the ones in 'Source' - 
though it is 'complex' enough. I haven't updated my dialplan code in a very 
long time, though). I'm in GMT -5 and I'm trying to adjust the line of code 
here: 

(Time.now + ((Tz+8)*60*60) 

but I can't find out the values for my own timezone.

Other than that, the only other question I've on that code is where I do place 
this:

(allswitch("#{user}@local[fu=#{name}]",45) unless (30..745) === @t.hour*100 + 
@t.min # forward straight to VM from 0:30a to 7:45a)

You said something about the inbound call handler. Like I said, I haven't 
touched my dialplan in a very long time, about a year maybe. Can you kindly 
help me out and point me to where it should be?

Original comment by XANAVi...@gmail.com on 10 Feb 2011 at 9:50

GoogleCodeExporter commented 9 years ago
The dialplans dwell here:

http://code.google.com/p/google-voice-sipsorcery-dialplans/source/browse/trunk/S
IP+Sorcery+Dial+Plans/#SIP%20Sorcery%20Dial%20Plans%2FContrib

When you go to "Source", click on "Browse" and then go up one level. Or just 
use the link above :)

My latest flexible (aka Complex) dialplan is available here:

http://forum.sipsorcery.com/viewtopic.php?f=15&t=2623

The timezone settings should be in the "header" portion of your dialplan. For 
EST (GMT-5) it should be:

Tz = -5

> Other than that, the only other question I've on that code is where I do 
place this

There is either callswitch or sys.Dial forwarding incoming calls to bound SIP 
devices (your ATA / softphone). The main code of your dialplan is splitted into 
two chunks with "if sys.In" statement. Incoming call handler immediately 
follows this statement.

It's been a long time since you updated your dialplan. While it sounds silly 
for such a simple task as night calls rejection, it maybe useful to take above 
mentioned flexible dialplan as the base and redo the whole of your dialplan. 
There are detailed instructions in the second post of the thread.

Original comment by mte...@gmail.com on 10 Feb 2011 at 10:21

GoogleCodeExporter commented 9 years ago
Hey everybody, I was without my Internet for a while. 
Sorry about that, but I'm back at my house once again.

Okay, I'll go a head and redo my dialplan.
It'll have to wait until later though, a day or two since I'm pretty busy right 
now, but I'll get right on it. ;)

Original comment by XANAVi...@gmail.com on 18 Feb 2011 at 3:15

GoogleCodeExporter commented 9 years ago
Any updates on this XANAVirus? Do you still want this feature added or has Mike 
already helped you out directly in the SIP Sorcery forum?

Original comment by easter...@gmail.com on 1 Mar 2012 at 10:37

GoogleCodeExporter commented 9 years ago
Closing due to inactivity. Xanavirus can reopen if help is still needed. 
Marking invalid as the feature requested was already present in one of the 
dialplans.

Original comment by easter...@gmail.com on 22 Mar 2012 at 6:30