Upgrade 3CX to v18 and get it hosted free!

Asterisk last number repeat

Author image

Asterisk Last Number Repeat

If you use this setup a phone can dial *5 to repeat the last number you dialed (from that callerid).

The configuration is based upon a few steps:

Step 1: Separate the dialling context for phones/users from the ‘actual dialling’ from the macro we will define in Step 2:

[pbx]
include = apps
include = dialpbx

[dialpbx]
exten = _X.,1,Macro(dial)

[router]
include = local
include = apps
include = outbound

exten = t,1,Busy

Step 2: Route all dialling (except for applications/vertical service codes) through a Macro:
If you already had your extensions going to context ‘pbx’, you are already doing this (see Step 1)

[macro-dial]
exten = s,1,DBput(RepeatDial/${CALLERIDNUM}=${MACRO_EXTEN})
exten = s,2,Dial(Local/${MACRO_EXTEN}@router)
exten = s,3,Busy

Notes

  • This macro reads variables stored in the Asterisk database
  • The macro executes ‘Dial(Local/<number>@router)’. This implies the number that was selected is dialable from the [router] context, as shown in Step 1. You may need to change this. (If you only want outbound redirect this could be Dial(Zap/1/<number>) for instance)
  • If the DBget does not find a key, it exists with the result code 101, making the next step in the dial plan the current priority+101

Step 3: Adding the redial shortcode

[apps]
; Repeat last dialled number
exten = *5,1,DBget(temp=RepeatDial/${CALLERIDNUM})
exten = *5,2,Dial(Local/${temp}@router) ; Last known

; No RepeatDial key
exten = *5,102,Congestion

Notes

  • This context implements the functionality to activate the redial. It should be accessible for users as defined in Step 1.
  • This programming does not confirm the setting with an audio prompt. Add this if you want the user to get a confirmation of the new status.


Article Reviews

Write a Review

Your email address will not be published. Required fields are marked *

Required Field. Minimum 5 characters.

Required Field. Minimum 5 characters, maximum 50.

Required field.There is an error with this field.

Required Field.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

There are no reviews for this article. Be the first one to write a review.

Related Posts:

Get 3CX - Absolutely Free!
Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.