<div dir="ltr"><div>Try this for CHAN_SIP:<br><br>same =>     n,Set(Peer=${SIPCHANINFO(peername)}) ; Get the peer<br>same =>     n,Set(MailBox=${SIPPEER(${Peer},mailbox)}); Get the mailbox<br>same =>     n,VoicemailMain(${MailBox}@LocalSets,s)   ; If we have a mailbox defined log into it<br><br></div>If you are using PJSIP it's more complex<br>same =>     n,Set(EndPoint=${CHANNEL(endpoint)}) ; Get the peer<br>same =>     n,Set(MailBox=${PJSIP_ENDPOINT(${EndPoint},mailboxes)})<br>same =>     n,ExecIf($[${ISNULL(${MailBox})} = 1]?Set(MailBox=${AST_SORCERY(res_pjsip,aor,${EndPoint},mailboxes)}))<br>same =>     n,VoicemailMain(${MailBox}@LocalSets,s)   ; If we have a mailbox defined log into it<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jun 12, 2015 at 11:23 AM, D'Arcy J.M. Cain <span dir="ltr"><<a href="mailto:darcy@vex.net" target="_blank">darcy@vex.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I have this in my sip.conf:<br>
<br>
exten => *98,1,Verbose(0,CALLERID number is "${CALLERID(num)}")<br>
    same => n,VoicemailMain(${CALLERID(num)}@LocalSets,s)<br>
    same => n,Hangup<br>
<br>
However, my extensions are set up so that they always show the external<br>
number, not the extension:<br>
<br>
[foobar2](client-phone)<br>
secret=xxxxxxxxxxxxxxxxxxxxxxxxxxxxx<br>
callerid=Candace <5555551212><br>
mailbox=foobar2@LocalSets<br>
<br>
So the caller ID is 5555551212 but the voice mail is foobar2.  Is there<br>
any way to get the actual extension that called?  Can I create a<br>
variable in the extension that I can read instead of ${CALLERID(num)}?<br>
I tried setting a random string (xaccount) and reading it with<br>
${ENV(xaccount)} but it's not an environment variable and didn't work.<br>
<br>
Cheers.<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
D'Arcy J.M. Cain<br>
System Administrator, Vex.Net<br>
<a href="http://www.Vex.Net/" rel="noreferrer" target="_blank">http://www.Vex.Net/</a> IM:darcy@Vex.Net<br>
VoIP: sip:darcy@Vex.Net<br>
<br>
--<br>
_____________________________________________________________________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" rel="noreferrer" target="_blank">http://www.api-digital.com</a> --<br>
New to Asterisk? Join us for a live introductory webinar every Thurs:<br>
               <a href="http://www.asterisk.org/hello" rel="noreferrer" target="_blank">http://www.asterisk.org/hello</a><br>
<br>
asterisk-users mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
   <a href="http://lists.digium.com/mailman/listinfo/asterisk-users" rel="noreferrer" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-users</a><br>
</font></span></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature">A human being should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly. Specialization is for insects.<br>---Heinlein</div>
</div>