FW: [Asterisk-Users] Need a creative solution - Caller IDanda stupidupstream

Chris A. Icide chris at netgeeks.net
Mon Nov 8 13:38:59 MST 2004


On 11:39 AM 11/8/2004, Paul Rodan wrote:
 >Help anyone? I hate caller ID.

I would do something like this:

Set accountcode to the callerid number for each sip ua.  In other words if 
my callerid for a sip UA was "John F. Doe" <2025551212>, then I would set 
the accountcode to 2025551212

Then I would create an context/extension that people would dial for setting 
a forward number and include it in the contexts available to the SIP UA:
[features]

exten => 1234,1,Answer
exten => 1234,2,Playback(enter-fwd-number-at-tone)
exten => 1234,3,Read(number,,11)   ;set length as you see fit, 11 allows +1 
US dialing
exten => 1234,4,Wait(1)
exten => 1234,5,Playback(You-entered)
exten => 1234,6,SayDigits(${number})
exten => 1234,7,Background(press-1-if-correct-2-if-incorrect)
exten => 1234,8,Goto(7)

exten => 4321,1,Answer
exten => 4321,2,DBPut(${ACCOUNTCODE}/FEATURE/FORWARD=0)
exten => 4321,3,Playback(forwarding-disabled)
exten => 4321,4,Hangup

exten => 1,1,DBPut(${ACCOUNTCODE}/FEATURE/FORWARD=1)
exten => 1,2,DBPut(${ACCOUNTCODE}/FEATURE/FWDNUMBER=${number})
exten => 1,3,Playback(thankyou)
exten => 1,4,Hangup

exten => 2,1,Goto(1234,2)


Then for inbound calls I which go to the SIP UA, I would check forward status:

[macro-ring-sip-ua]
; ARG1 is sip extension, ARG2 is timeout, ATG3 is options, ARG4 is callers 
callerid

exten => s,1,DBGet(FWDSTATUS=${ARG1}/FEATURE/FORWARD)
exten => s,2,GotoIf($[${FWDSTATUS} = 1]?s,20:s,10)
exten => s,102,NoOp(No DB entry FORWARD for ${ARG1})
exten => s,103,Goto(s,10)

exten => s,10,Dial(SIP/${ARG1},${ARG2},${ARG3})
exten => s,11,Voicemail(u${ARG1})
exten => s,12,Hangup
exten => s,111,Voicemail(b${ARG1})
exten => s,112,Hangup

exten => s,20,DBGet(FWDNUM=${ARG1}/FEATURE/FWDNUMBER)
exten => s,21,SetCallerID("${ARG4}" ${ACCOUNTCODE})
exten => s,22,Dial(local/${FWDNUMBER}@outbound-context)
exten => s,121,NoOp(No DB entry for FOWARDNUMBER for ${ARG1})
exten => s,122,Goto(s,10)

The idea here is that you are sending out the original caller's ID as the 
TEXT field and your callerid as the number field.

Please forgive any typos above, I did this in a few minutes.  It should at 
least point you in a good direction if this solution is of interest to you.

-Chris





More information about the asterisk-users mailing list