[Asterisk-Users] line numbering and gosub

John Brown jmbrown at chagresventures.com
Sun Aug 24 12:46:47 MST 2003


Hi list,

been playing with * for a bit now and have found at 
least two things that make it difficult.

1.  priority numbers in extensions.conf

This line numbering gig can be a PIA.  While I under-
stand there needs to be a way to branch control (ergo
goto), it would seem that line numbering is tied to
1,2,3,4  as in

exten => s,1,doblah
exten => s,2,dofi
exten => s,3 gogetalife
exten => s,4 goto(s,2)

now if you want to insert something you have to renumber
all of the lines below,  ICK  comes to mind.

So I figured I'd try

exten => s,10,doblah
exten => s,15,dofi
exten => s,20,gogetalife
exten => s,25,goto(s,15)

but this doesn't seem to work at all.  * just barfs on the
the call.

I would think that * would read these lines in and order them
as I've labled them.  the * code should do :

when calling an exten:  goto first line in the link list of
lines

when executing a goto: goto the node that matches the label, or
create a quicky hash of lables -> node pointers to match quickly



The second item:

It would be nice to have a Gosub type command.  That
way you could pop off to a standard strain of code, even
nest a bit and then by the magic of a stack pop back to
previous parts......


cheers




More information about the asterisk-users mailing list