NSLU2-Linux
view · edit · print · history

Optware.AsteriskCallbackMacro History

Hide minor edits - Show changes to markup

January 27, 2007, at 06:56 AM by cdoban -- updated callback macro
Changed lines 13-14 from:
to:

CB_ASTERISK_CID=16045552222

Changed line 25 from:

exten => s,n(do_cb),System(${CB_SCRIPT} ${ARG1?} ${ARG2?} ${CB_CALLING})

to:

exten => s,n(do_cb),System(${CB_SCRIPT} ${ARG1?} ${ARG2?} ${CB_CALLING} ${CB_ASTERISK_CID})

Changed line 66 from:

if [ $# != 3 ]

to:

if [ $# != 4 ]

Added line 90:
January 20, 2007, at 04:45 AM by cdoban -- callback macro
Changed lines 12-14 from:

CB_SCRIPT=/usr/sbin/asterisk-cb

to:

CB_SCRIPT=/opt/sbin/asterisk-cb

Changed line 53 from:

; Callback extensions

to:

; callback extension

Changed line 61 from:
  1. cat /usr/sbin/asterisk-cb
to:
  1. cat /opt/sbin/asterisk-cb
Changed lines 64-65 from:

OUTGOING_SPOOL_DIR="/var/spool/asterisk/outgoing"

to:

OUTGOING_SPOOL_DIR="/opt/var/spool/asterisk/outgoing"

January 20, 2007, at 04:11 AM by cdoban -- callback macro
Changed line 4 from:
  * This stuff has to be added to your extensions.conf (and configure your data in the following constants):
to:
  • This stuff has to be added to your extensions.conf (and configure your data in the following constants):
Changed line 58 from:
  * This is the callback shell script:
to:
  • This is the callback shell script:
January 20, 2007, at 04:09 AM by cdoban -- callback macro
Changed lines 1-5 from:

If you have an unlimited incoming subscription for your cell phone and want to take advantage of the low international rate your VoIP? provider offers, this callback macro might be of interest. You can call from you cell phone home, and when you voicemail answers press * and enter you password. Then Select 3 "advanced options" and 4 "place outgoing call". Then dial the callback extension (555 in this example) and wait for confirmation. You will receive immediately an incomming call on you call phone and when answered you will hear an invitation to dial the number you wish to call.

This stuff has to be added to your extensions.conf (and configure your data in the following constants):

to:

If you have an unlimited incoming subscription for your cell phone and want to take advantage of the low VoIP international rates your Asterisk PBX has, this callback macro might be of interest. You can call from your cell phone home and when your voicemail picks up, press * and enter you password. Then Select 3 "advanced options" and 4 "place outgoing call". Then dial the callback extension (555 in this example) and wait for confirmation. You will receive immediately an incoming call on your cell phone and when answered you will hear an invitation to dial the number you wish to call.

  * This stuff has to be added to your extensions.conf (and configure your data in the following constants):
Changed line 58 from:

This is the callback shell script:

to:
  * This is the callback shell script:
January 20, 2007, at 04:00 AM by cdoban -- callback macro
Changed lines 1-2 from:
to:

If you have an unlimited incoming subscription for your cell phone and want to take advantage of the low international rate your VoIP? provider offers, this callback macro might be of interest. You can call from you cell phone home, and when you voicemail answers press * and enter you password. Then Select 3 "advanced options" and 4 "place outgoing call". Then dial the callback extension (555 in this example) and wait for confirmation. You will receive immediately an incomming call on you call phone and when answered you will hear an invitation to dial the number you wish to call.

This stuff has to be added to your extensions.conf (and configure your data in the following constants):

Changed line 59 from:
to:

This is the callback shell script:

January 20, 2007, at 03:48 AM by cdoban -- callback macro
Added lines 1-94:

; for callback
CB_PROTOCOL=SIP
CB_PROVIDER=gizmo
CB_CALLING_DEFAULT=17475551234
CB_NO_CID=spa3102fxo1
CB_SCRIPT=/usr/sbin/asterisk-cb


[macro-callback]
; Callback macro:
;   ${ARG1} - Callback Channel Type (SIP or IAX2)
;   ${ARG2} - Provider
exten => s,1,Playback(wait-moment)
exten => s,n,GotoIf($["${CALLERID(num)}" = ""]?no_cid)
exten => s,n,GotoIf($["${CALLERID(num)}" = "${CB_NO_CID}"]?no_cid)
exten => s,n,Set(CB_CALLING=${CALLERID(num)})
exten => s,n,Goto(do_cb)
exten => s,n(no_cid),Set(CB_CALLING=${CB_CALLING_DEFAULT})
exten => s,n(do_cb),System(${CB_SCRIPT} ${ARG1} ${ARG2} ${CB_CALLING})
exten => s,n,GotoIf($[${SYSTEMSTATUS} = SUCCESS}]?done)
exten => s,n,Playback(service&privacy-not&activated&vm-goodbye)
exten => s,n,Hangup
exten => s,n(done),Playback(service&activated&vm-goodbye)
exten => s,n,Hangup


[callthrough]
exten => s,1,Set(NR=)
exten => s,2,Background(vm-enter-num-to-call&and-prs-pound-whn-finished)
exten => s,3,Set(TIMEOUT(response)=10)
exten => s,4,WaitExten

exten => *,1,Goto(s,1)
exten => #,1,Playback(vm-dialout)
exten => #,2,Dial(Local/${NR})
exten => #,3,Macro(failann,${DIALSTATUS})

exten => _X,1,Set(NR=${NR}${EXTEN})
exten => _X,2,Goto(s,3)

exten => t,1,Playback(vm-goodbye)
exten => t,2,HangUp


[default]
; ...
; Callback extensions
exten => 555,1,Macro(callback,${CB_PROTOCOL},${CB_PROVIDER})


# cat /usr/sbin/asterisk-cb
#! /bin/sh

OUTGOING_SPOOL_DIR="/var/spool/asterisk/outgoing"

if [ $# != 3 ]
then exit 1
fi

case "$1" in
  SIP)
    ORIGINATING_CHANNEL="SIP/$3@$2"
    ;;
  IAX2)
    ORIGINATING_CHANNEL="IAX2/$2/$3"
    ;;
  *)
    exit 1
    ;;
esac

cat > $OUTGOING_SPOOL_DIR/cb.tmp <<INLINE
Channel: $ORIGINATING_CHANNEL
MaxRetries: 2
RetryTime: 60
WaitTime: 30
Context: callthrough
Extension: s
Priority: 1
INLINE

mv $OUTGOING_SPOOL_DIR/cb.tmp $OUTGOING_SPOOL_DIR/cb.call

exit 0

view · edit · print · history · Last edited by cdoban.
Originally by cdoban.
Page last modified on January 27, 2007, at 06:56 AM