Custom extension per phone

Hello,

I know how to use custom extensions into my dialplan, in order to - let’s say - activate a special welcome message in some situations :

exten = SetWereClosed,1,NoOp()
 same = n,Set(DEVICE_STATE(Custom:WereClosed)=INUSE)```

I also associate a phone button to this so that users can activate or de-activate, that is fine.

Now I’d like to have the same type of things, but per phone : set a button on each phone to have his incoming phone calls processed differently - for instance forwarded to a cell phone.
In term of dialplan, how can I define a Custom extension per phone ?
Something like :

${DEVICE_STATE(Custom:MySpecialAction_${PJSIP/${EXTEN}})}

Can an Asterisk variable name be composed of a fixed and a variable part ?

Or do I have to declare as many Custom extensions as the number of phones ?

Custom:MySpecialAction_001
Custom:MySpecialAction_002

Thanks !
Michel

All extensions are custom in Asterisk.

The quickest way to answer this would have been to try it, but Asterisk variable names can be macro expanded from other variables and functions.

Thanks ! You’re not completely wrong :slight_smile:

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