All pastes #468468 Raw Edit

Someone

public text v1 · immutable
·published 2007-05-03 04:00 UTC
rendered paste body
This belongs in extensions_custom.conf -- search for "GoesHere" and replace accordingly before implementing.

You can copy and paste the TrustedNumberWithoutPasswordCheckGoesHere block for multiple trusted numbers. Since we call them back, incoming CID spoofing is not an issue.

Then point the DID of your choice to context "custom-congestion-callback,s,1" and off you go. :)

[custom-congestion-callback]
exten => s,1,NoOp()
exten => s,n,Congestion()
exten => s,n,Hangup()
exten => h,1,SetVar(CALLFILENAME=${CALLERIDNUM}-${TIMESTAMP})
exten => h,n,System(echo channel: SIP/TrunkNameGoesHere/${CALLERIDNUM} > /tmp/${CALLFILENAME})
exten => h,n,System(echo context: custom-congestion-callback-returncall >> /tmp/${CALLFILENAME})
exten => h,n,System(echo extension: ${CALLERIDNUM} >> /tmp/${CALLFILENAME})
exten => h,n,System(echo priority: 1 >> /tmp/${CALLFILENAME})
exten => h,n,System(echo callerid: NumberOfCallbackDIDGoesHere >> /tmp/${CALLFILENAME})
exten => h,n,System(mv /tmp/${CALLFILENAME} /var/spool/asterisk/outgoing/)
;exten => h,n,System(echo sleep 5 > /tmp/${CALLFILENAME}.2)
;exten => h,n,System(echo mv /tmp/${CALLFILENAME} /var/spool/asterisk/outgoing/ >> /tmp/${CALLFILENAME}.2)
;exten => h,n,System(chmod 770 /tmp/${CALLFILENAME}.2)
;exten => h,n,System(/tmp/${CALLFILENAME}.2)
;exten => h,n,System(rm -f /tmp/${CALLFILENAME}.2)
exten => h,n,Hangup()
; These two contexts belong together
[custom-congestion-callback-returncall]
exten => s,1,Wait(1)
exten => s,n,Background(asterisk-friend)
exten => s,n,Set(CALLERID(name)=)
;exten => s,n,Set(CALLERID(number)=WhateverOutgoingCIDYouWantGoesHere)
exten => s,n,Set(CALLERID(number)=)
exten => s,n,Goto(custom-disa,s,1)
exten => TrustedNumberWithoutPasswordCheckGoesHere,1,Set(TIMEOUT(digit)=10)
exten => TrustedNumberWithoutPasswordCheckGoesHere,n,Set(TIMEOUT(response)=30)
exten => TrustedNumberWithoutPasswordCheckGoesHere,n,Background(asterisk-friend)
exten => TrustedNumberWithoutPasswordCheckGoesHere,n,Set(CALLERID(name)=)
exten => TrustedNumberWithoutPasswordCheckGoesHere,n,Set(CALLERID(number)=)
exten => TrustedNumberWithoutPasswordCheckGoesHere,n,DISA(no-password|from-internal)

[custom-disa] ; allow for DISA via password
exten => s,1,Answer()
exten => s,n,Wait(1)
exten => s,n,Set(TIMEOUT(digit)=10)
exten => s,n,Set(TIMEOUT(response)=30)
; If switching back to Authenticate() then uncomment
; Authenticate() and Playback() and comment-out VMAuthenticate().
;exten => s,n,Playback(enter_pin)
;exten => s,n,Authenticate(1234)
exten => s,n,VMAuthenticate();
;exten => s,n,Background(pls-wait-connect-call)
exten => s,n,DISA(no-password|from-internal)