Page tree
Skip to end of metadata
Go to start of metadata

Applies to VoipNow 3.x.x!

Call pickup normally works only with short numbers. So when 0003*001 calls 0003*002, a member of the 0003 organization can only pick up the incoming call by dialing *21002. In some situations, customers would rather pick up the call by dialing *210003*002; for example, when a BLF key is monitoring 0003*002 and the phone has the option to pick up on BLF press, the phone will attempt to pick up the call with *210003*002, but it won't work. To make it work, you need to make a couple of dialplan changes that we have described below. Also, basic understanding of the Asterisk dialplan is required.

Step-by-step guide

The following macro checks the $EXT length (the extension to be picked up). If the extension has 8 characters (full number), it strips the first 5 characters (in this case, 0003*) and then follows the original dialplan. This macro works for the classic XXXX*YYY extension format. If you have a different extension format, you need to modify the macro accordingly.

To apply the change:

  1. Paste this macro in /etc/asterisk/extensions_custom.conf.

    [app-pickup]
    ; handles call pickup
    exten => *210,1,Gosub(macro-retry-pickup,s,1(${CALLERCHAN:0:-${EXTLEN}},fifo,*21))
     
    exten => *290,1,Gosub(macro-retry-pickup,s,1(${CALLERCHAN:0:-${EXTLEN}},lifo,*29))
     
    exten => *211,1,GotoIf($[${LEN(${EXT})} = 8]?2:12)
    exten => *211,2,Set(PICKUPPATTERN=${EXT:5})
    exten => *211,3,Set(TOPICKUPEXTEN=${CALLERCHAN:0:-${EXTLEN}}${PICKUPPATTERN})
    exten => *211,4,Gosub(macro-retry-pickup,s,1(${TOPICKUPEXTEN},fifo,*21${PICKUPPATTERN}))
     
    exten => *211,12,Set(PICKUPPATTERN=${EXT})
    exten => *211,13,Set(TOPICKUPEXTEN=${CALLERCHAN:0:-${EXTLEN}}${PICKUPPATTERN})
    exten => *211,14,Gosub(macro-retry-pickup,s,1(${TOPICKUPEXTEN},fifo,*21${PICKUPPATTERN}))
     
    exten => *291,1,Set(PICKUPPATTERN=${EXT})
    exten => *291,2,Set(TOPICKUPEXTEN=${CALLERCHAN:0:-${EXTLEN}}${PICKUPPATTERN})
    exten => *291,3,Gosub(macro-retry-pickup,s,1(${TOPICKUPEXTEN},lifo,*29${PICKUPPATTERN}))
     
    exten => *212,1,Gosub(macro-extisactive,s,1(${CALLERCHAN})) ;verify if extension is active
    exten => *212,2,Gosub(macro-multiperm,s,1)
    exten => *212,3,Gosub(macro-setextenv,s,1(${CALLERCHAN}))
    exten => *212,4,GotoIf($["foo${TARGETVNODE}" != "foo"]?5:7)
    exten => *212,5,PickupVNode(${TARGETVNODE})
    exten => *212,6,Goto(9)
    exten => *212,7,GotoIf($["foo${TOPICKUPCHANNEL}" != "foo"]?8:10)
    exten => *212,8,PickupChan(${TOPICKUPCHANNEL})
    exten => *212,9,GotoIf($["foo${PICKEDUP}" = "foo"]?10:11)
    exten => *212,10,Playback(no-call-pickup)
    exten => *212,11,Hangup
  2. Reload the dialplan.

    asterisk -rx "dialplan reload"

It's always a good ideea to do this test after hours.

#trackbackRdf ($trackbackUtils.getContentIdentifier($page) $page.title $trackbackUtils.getPingUrl($page))

Except where otherwise noted, content in this space is licensed under a Creative Commons Attribution 4.0 International.