Hi Ken,

Here is what we do, if it helps:

For incoming calls (we use some Centrex lines, but want to make them look like 4-digit locals):

; If it looks like one of ours, only show the last 4 digits
exten => s,40,GotoIf($["${CALLERIDNUM:0:8}" = "60498131"]?50:)
exten => s,50,SetCallerID("${CALLERIDNAME}" <${CALLERIDNUM:-4}>)

For outgoing calls:

; If it looks like the local has already been expanded to NANPA, skip to dialing
exten => s,3,GotoIf($["${ARG1:0:3}" = "604"]?20:)
; AllStream DIDs get a 604998 prefix, the rest get 604990
exten => s,4,GotoIf($["${ARG1:0:3}" = "303"]?:10)
exten => s,5,SetCallerID("${CALLERIDNAME}" <604998${CALLERIDNUM}>)
exten => s,6,Goto(20)
exten => s,10,SetCallerID("${CALLERIDNAME}" <604990${CALLERIDNUM}>)
exten => s,11,Goto(20)

Hope this helps - let me know if you need more details.

Regards,
--
Anthony Rodgers
Business Systems Analyst
District of North Vancouver
Web: http://www.dnv.org
RSS Feed: http://www.dnv.org/rss.asp



On 24-Apr-06, at 9:57 AM, Ken D'Ambrosio wrote:

Hey, all.  I'm trying to set my CID such that, internally, I see a
four-digit extension (which is also handy when checking VM), but
externally, I see the full 10-digit number. So I plugged these lines into
my extensions.conf:

exten => _XXXXXXX,1,GotoIf($[ ${CALLERIDNUM} != 1625]?4:2)
exten => _XXXXXXX,2,Set(CALLERIDNUM=6031234${CALLERIDNUM:1})
exten => _XXXXXXX,3,NoOp(${CALLERIDNUM})
exten => _XXXXXXX,4,Dial(${OUTBOUNDTRUNK}/${EXTEN})

(I wanted to test against my own extension, "1625"; if that worked, I
wanted to strip off the "1", and then prepend the 603-123-4 to my
remaining three digits.)

Which is all well and good -- until I actually try to use it. Then, I get:

    -- Executing GotoIf("SIP/1625-f89a", "0?4:2") in new stack
    -- Goto (internal,7654321,2)
-- Executing Set("SIP/1625-f89a", "CALLERIDNUM=6031234625") in new stack
    -- Executing NoOp("SIP/1625-f89a", "1625") in new stack
    -- Executing Dial("SIP/1625-f89a", "Zap/g1/7654321") in new stack

Why does my "NoOp" line show my 1625 extension, when CALLERIDNUM is -- as far as I can tell -- being set to 6031234625? (I looked against the "Set"
command page on the Wiki, and I think I'm doing it right.)

Asterisk 1.2.3, if that matters.

Thanks,

-Ken

_______________________________________________
--Bandwidth and Colocation provided by Easynews.com --

Asterisk-Users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


_______________________________________________
--Bandwidth and Colocation provided by Easynews.com --

Asterisk-Users mailing list
To UNSUBSCRIBE or update options visit:
  http://lists.digium.com/mailman/listinfo/asterisk-users

Reply via email to