Ex-girlfriend logic not working for one extension

I have set up a filter that when I dial my server from my mobile number it goes straight to VoiceMailMain. It works fine so I’m now trying to get a similar filter for my laptop to do the same.

Laptop is at 192.168.1.3
CID is davejunius
Extension for VM is 100

so here is what I’m trying:

exten => 100/davejunius,1,VoiceMailMain(sdave@default)
exten => 100/davejunius,n,Hangup()

exten => 100,1,Wait(1)
exten => 100,n,VoiceMailMain(dave@default)
exten => 100,n,Hangup()

But for some reason the first 100/davejunius logic is skipped and it goes to the generic 100.

Using asterisk -vvvgc shows:

– Registered SIP ‘davejunius’ at 192.168.1.3:5060
== Using SIP RTP CoS mark 5
– Executing [100@outgoing:1] Wait(“SIP/davejunius-00000000”, “1”) in new stack
– Executing [100@outgoing:2] VoiceMailMain(“SIP/davejunius-00000000”, “dave@default”) in new stack
– <SIP/davejunius-00000000> Playing ‘vm-password.gsm’ (language ‘en’)

Full log shows the same output. What am I missing?

It works on caller ID, not device name.

Ah that explains it.

My Caller ID is set to 'mynick@mydomain.net’ in sip.conf but I couldn’t get this to work in a filter, so I dialed up linphonec running on my server and saw that it had "mynick@mydomain.net" sip:1234567@IP

Setting the dialplan to use 100/1234567 works fine. 1234567 is my voip provider account number. Now if I dial 100@mydomain.net it sees my caller id as ‘dave’ but this isn’t safe enough to use on its own in a filter. Anyone using dave@… dialing my voicemail number would get into it I think.

I don’t want to go through my voip provider for direct calls, only for trunk calls.

I’m sure there’s a way to get this to work.

Any ideas?

*Edit: Well it seems using 100/dave isn’t working either. Is there some way of finding out what asterisk sees my CID as?

Verbose(${CALLERID(num)})

It’s also in the CDRs.

Generally, though, you should not be trusting unauthenticated callers this much. If not rejected, they should end in a context that can do no harm.

I just have to say…I just love the phrase “Ex-Girlfriend logic” :mrgreen: