Help me with asterisk dial plan

hi
i need to do customized dial plan as below

i will have 1 DID and caller and i want to do the rule based on the Caller ID

i mean if the caller ID was = something in my list , i want to go to context from-internal and dial from the the destination 30 as an example .

so here what i have tried :
[test1]
exten => s,1,GotoIf($["${CALLERID(num)}" = “2177678”]?30,1@from-internal)
exten => s,1,GotoIf($["${CALLERID(num)}" = “2177676”]?30,1@from-internal)
exten => s,1,GotoIf($["${CALLERID(num)}" = “2177675”]?30,1@from-internal)
exten => s,1,GotoIf($["${CALLERID(num)}" = “2177674”]?30,1@from-internal)

can someone help me whats wrong ? and why it didn’t go to the context from-internal and dialed the # 30 as sip ??

thank you

Try using ‘ex-girlfriend’ logic instead, You can do a match on your S extension for example.
[test1]
exten = s/_217767[4568],1,Dial(LOCAL/30@from-internal)
exten = s,1,Playtones(congestion)

At first the dialplan is wrong you should have different priorities in order to go on with dialplan. You cannot have in the same section for the same extension s the same priority (1 in your case)

[test1]
exten => s,1,GotoIf($["${CALLERID(num)}" = “2177678”]?30,1@from-internal)
exten => s,n,GotoIf($["${CALLERID(num)}" = “2177676”]?30,1@from-internal)
exten => s,n,GotoIf($["${CALLERID(num)}" = “2177675”]?30,1@from-internal)
exten => s,n,GotoIf($["${CALLERID(num)}" = “2177674”]?30,1@from-internal)

Basically with this code you are saying if CallerID = 2177678 or …74 or 75 or 76 goto Line 30 of the same dialplan section, otherwise goto extension 1 in section from internal.

thank you so much so much .

very helpful