Two things missing

Comment on Asterisk tips renumber extens
Joined: Mon 16 of Aug, 2004

Two things missing

Posted:Tue 15 of Feb, 2005 (20:57 UTC)
It's a good start. It just needs two little things to be perfect.

1. If there are any BRANCHES (Goto, GotoIf, etc.) then the target of the branch needs to be renumbered to its new number as well.

2. If there are implicit branches (goto ext+101, ext+51, etc.) then those should be renumbered at the same offset, not as a sequence of 1.

So, for example,
exten => 100,1,NoOp,This is an example
exten => 100,3,Dial(SIP/mysipphone) ;;;;; NOTE 100,4,DBGet(voicemail=vmail/mysipphone)
exten => 100,105,Goto(20)
exten => 100,5,Goto(vmail,${voicemail},1)

exten => 100,20,Playback(recorded/no-such-voicemail)
exten => 100,21,Hangup

Would become:
exten => 100,1,NoOp,This is an example
exten => 100,2,Dial(SIP/mysipphone) ;;; RENUMBERED
exten => 100,3,DBGet(voicemail=vmail/mysipphone)
exten => 100,104,Goto(5) ;;;; Branch target renumbered
exten => 100,4,Goto(vmail,${voicemail},1)

exten => 100,5,Playback(recorded/no-such-voicemail)
exten => 100,6,Hangup