# Ex-girlfriend logic not working for one extension

**URL:** <https://community.asterisk.org/t/ex-girlfriend-logic-not-working-for-one-extension/34563>\
**Category:** Asterisk Support\
**Created:** [March 18, 2011, 4:05pm UTC](https://community.asterisk.org/t/ex-girlfriend-logic-not-working-for-one-extension/34563 "2011-03-18T16:05:22Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![slackhead](https://avatars.discourse-cdn.com/v4/letter/s/b9e5f3/32.png) [@slackhead](https://community.asterisk.org/u/slackhead)\
**Post date:** [March 18, 2011, 4:05pm UTC](https://community.asterisk.org/t/ex-girlfriend-logic-not-working-for-one-extension/34563/1 "2011-03-18T16:05:22Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![david55](https://avatars.discourse-cdn.com/v4/letter/d/e19adc/32.png) [@david55](https://community.asterisk.org/u/david55)\
**Post date:** [March 18, 2011, 4:45pm UTC](https://community.asterisk.org/t/ex-girlfriend-logic-not-working-for-one-extension/34563/2 "2011-03-18T16:45:54Z")

</div>

It works on caller ID, not device name.

---

<div class="post-metadata">

**Author:** ![slackhead](https://avatars.discourse-cdn.com/v4/letter/s/b9e5f3/32.png) [@slackhead](https://community.asterisk.org/u/slackhead)\
**Post date:** [March 18, 2011, 6:05pm UTC](https://community.asterisk.org/t/ex-girlfriend-logic-not-working-for-one-extension/34563/3 "2011-03-18T18:05:20Z")

</div>

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](mailto: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?

---

<div class="post-metadata">

**Author:** ![david55](https://avatars.discourse-cdn.com/v4/letter/d/e19adc/32.png) [@david55](https://community.asterisk.org/u/david55)\
**Post date:** [March 21, 2011, 12:27pm UTC](https://community.asterisk.org/t/ex-girlfriend-logic-not-working-for-one-extension/34563/4 "2011-03-21T12:27:38Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/asterisk/original/2X/4/475d0c889911cfb84ac4881ad6df8b523e3f9105.png) [@system](https://community.asterisk.org/u/system)\
**Post date:** [March 21, 2011, 1:20pm UTC](https://community.asterisk.org/t/ex-girlfriend-logic-not-working-for-one-extension/34563/5 "2011-03-21T13:20:08Z")

</div>

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