Help me in dialplan?

I have such thing in a dialplan:
exten => _XXXXXXXXXXX,n,GotoIf(["{caller}" = “10001”]?dial1)
exten => _XXXXXXXXXXX,n,GotoIf(["{caller}" = “10003”]?dial3)
exten => _XXXXXXXXXXX,n,GotoIf(["{caller}" = “10007”]?dial7)
exten => _XXXXXXXXXXX,n,GotoIf(["{caller}" = “10008”]?dial8)
exten => _XXXXXXXXXXX,n,GotoIf(["{caller}" = “10009”]?dial9)
exten => _XXXXXXXXXXX,n,GotoIf(["{caller}" = “10010”]?dial10)
exten => _XXXXXXXXXXX,n(dial1),Dial(PJSIP/{EXTEN}@10000001) exten => _XXXXXXXXXXX,n(dial3),Dial(PJSIP/{EXTEN}@10000003)
exten => _XXXXXXXXXXX,n(dial7),Dial(PJSIP/{EXTEN}@10000007) exten => _XXXXXXXXXXX,n(dial8),Dial(PJSIP/{EXTEN}@10000008)
exten => _XXXXXXXXXXX,n(dial9),Dial(PJSIP/{EXTEN}@10000009) exten => _XXXXXXXXXXX,n(dial10),Dial(PJSIP/{EXTEN}@10000010)

For example im caller 10001 and my line is busy now, somehow asterisk start to call first ready line (usually its 10000003 or 10000007).
Why so happens?

What is the error? What do you want to do? I can’t understand. Please elaborate.

Hi
$caller = CALLER(num)
this is the implementation if im user 1 on webrtc i call through 10000001 extension
if i user 3 i call through 10000003 extension
but if my line busy somehow - asterisk start to call from the next line in dialplan (if i should call from 10000001 and its busy - it starts to call through 10000003
But i didnt want it

Obviously asterisk works in sequential way, after your dial1 macro place a hangup. anyways in Goto statement you already have dial2 or dial3 macro, if the condition is true it will go to that route by default. Hope this helps.

Just add a Hangup line after each dial.

exten => _XXXXXXXXXXX,n(dial1),Dial(PJSIP/{EXTEN}@10000001)
same => n,Hangup

1 Like

Yes thanks! I think it would be a good idea!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.