i have one question about dialing.
I would like to set the timeout on Dial at 40 if the peer is not using the phone (= it is the first call).
In the meanwhile if a second call arrives, the timeout should be 20.
Is it possibile to do this?
Another question: is there any command to use in the extensions.conf to check if a specific peers (ex: SIP/100) has already a call running (= a channel used)?
There is a DEVICESTATE function (check spelling) that can detect if a peer has an active call. You may still need to set a call limit for that to work.
Because call-limit is deprecated, sometimes you will need to make sure that, if an extension is in use, you will not call it.
The following dialplan entries make sure that extension 100 has only one call at a time.
call limit is deprecated in favour of group counts, but was, I think a pre-requisite for DEVICE_STATE to work properly and may still be. As I said, using group counts is the preferred method now.