# Straight to voicemail without inputing box #

**URL:** <https://community.asterisk.org/t/straight-to-voicemail-without-inputing-box/36974>\
**Category:** Asterisk Support\
**Created:** [October 11, 2011, 3:47pm UTC](https://community.asterisk.org/t/straight-to-voicemail-without-inputing-box/36974 "2011-10-11T15:47:22Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![gwedertz](https://avatars.discourse-cdn.com/v4/letter/g/ba8739/32.png) [@gwedertz](https://community.asterisk.org/u/gwedertz)\
**Post date:** [October 11, 2011, 3:47pm UTC](https://community.asterisk.org/t/straight-to-voicemail-without-inputing-box/36974/1 "2011-10-11T15:47:22Z")

</div>

Anyone have any ideas how I can have a user dial the voicemail and have it automatically go to the phones voicemail? The phones I am using (cisco spa502g) have a shortcut button for voicemail. I have programmed the button but it would be nice for the person to skip inputing the mailbox number. Nobody has two extensions or move to different phones.

one of my phones in extension.conf

[LocalSets]  
exten =\> 1000,hint,SIP/user0  
exten =\> 1000,1,Dial(SIP/user0,5)  
same =\> n,GotoIf($["${DIALSTATUS}" = “BUSY”]?busy:unavail)  
same =\> n(unavail),VoiceMail(1000@normMessage,b)  
same =\> n,Hangup()  
same =\> n(busy),VoiceMail(1000@normMessage,b)  
same =\> n,Hangup()

[services]  
exten =\> 6150,1,VoiceMailMain(${EXTEN}@normMessage)

---

<div class="post-metadata">

**Author:** ![abw1oim](https://avatars.discourse-cdn.com/v4/letter/a/8e7dd6/32.png) [@abw1oim](https://community.asterisk.org/u/abw1oim)\
**Post date:** [October 11, 2011, 4:33pm UTC](https://community.asterisk.org/t/straight-to-voicemail-without-inputing-box/36974/2 "2011-10-11T16:33:50Z")

</div>

Assuming the boxnumber is identical to the CALLERID(num) of the phone calling extension 6150 You may do the following:

`[services]
exten => 6150,1,VoiceMailMain(${CALLERID(num)}@normMessage)
`

---

<div class="post-metadata">

**Author:** ![gwedertz](https://avatars.discourse-cdn.com/v4/letter/g/ba8739/32.png) [@gwedertz](https://community.asterisk.org/u/gwedertz)\
**Post date:** [October 11, 2011, 7:37pm UTC](https://community.asterisk.org/t/straight-to-voicemail-without-inputing-box/36974/3 "2011-10-11T19:37:21Z")

</div>

I tried your suggested code but there was no change. Yes, the boxnumber is identical to the CALLERID(num) of the phone calling extension 6150.

It works if I change callerid to the actual extension (see below) but of course everyone would be leaving a voice mail for that one person

[services]  
exten =\> 6150,1,VoiceMailMain(1000@normMessage)

I have “callerid = Random User” in sip.conf. Does this have any impact? I didn’t thinks so because you pull out the number with the code you gave me.

---

<div class="post-metadata">

**Author:** ![gtj0](https://avatars.discourse-cdn.com/v4/letter/g/b3f665/32.png) [@gtj0](https://community.asterisk.org/u/gtj0)\
**Post date:** [October 11, 2011, 8:09pm UTC](https://community.asterisk.org/t/straight-to-voicemail-without-inputing-box/36974/4 "2011-10-11T20:09:02Z")

</div>

exten =\> 6150,1,VoiceMailMain(s${CALLERID(num)}@normMessage)

Note the ‘s’ before ${CALLERID(num)}

---

<div class="post-metadata">

**Author:** ![abw1oim](https://avatars.discourse-cdn.com/v4/letter/a/8e7dd6/32.png) [@abw1oim](https://community.asterisk.org/u/abw1oim)\
**Post date:** [October 11, 2011, 9:00pm UTC](https://community.asterisk.org/t/straight-to-voicemail-without-inputing-box/36974/5 "2011-10-11T21:00:11Z")

</div>

@gtj0: The s-prefix only suppresses the PIN-request but has no impact on the voicebox selected.

@gwedertz: As in Your example in context LocalSets all boxrecordings go to 1000@normMessage, VoiceMailMain will onlx playback Messages for this specific box. If this was Your intention, than Your assumption with VoiceMailMain(1000@normMessage) in Services was correct. But if You prefer individual messages to the persons/extensions that where called, than You have to correct Your LocalSets-Context to direct the messages to the box corresponding to the extension dialed within the context, And in this case my suggestion should lead You to the result You wanted to have if I understood You well 😄

---

<div class="post-metadata">

**Author:** ![dalenoll](https://avatars.discourse-cdn.com/v4/letter/d/51bf81/32.png) [@dalenoll](https://community.asterisk.org/u/dalenoll)\
**Post date:** [October 12, 2011, 1:28am UTC](https://community.asterisk.org/t/straight-to-voicemail-without-inputing-box/36974/6 "2011-10-12T01:28:52Z")

</div>

Perhaps it would help you to better understand what is going on if you change your [services] context as follows:

[services]  
exten =\> 6150,1,NoOp(Access Voicemail)  
same =\> n,NoOp(EXTEN = ${EXTEN})  
same =\> n,NoOp(CALLERID = ${CALLERID(num)})  
same =\> n,VoiceMailMain(${CALLERID(num)}@normMessages)  
same =\> n,Hangup()

Then watch the CLI (with verbose \>=3) when you call 6150.

also,

If you have callerid = “random user” in your sip.conf for the user0 device, perhaps you will want to try setting it to something like…

callerid=Random User \<1000\>

---

<div class="post-metadata">

**Author:** ![gwedertz](https://avatars.discourse-cdn.com/v4/letter/g/ba8739/32.png) [@gwedertz](https://community.asterisk.org/u/gwedertz)\
**Post date:** [October 12, 2011, 12:49pm UTC](https://community.asterisk.org/t/straight-to-voicemail-without-inputing-box/36974/7 "2011-10-12T12:49:32Z")

</div>

Thanks for your help everyone. I was able to get the ip phones working the way I wanted with the help provided.

Interesting note, the ip phones work fine with this setup. I have a few softphones and they always pass the user0@normMessage even with callerid(num). user0 is the id of the phone and changes accordingly with each phone. I think this is a problem on my side with the softphone. Shouldn’t be too hard to figure out 😉 Thanks again guy’s for your help.
