Hello,
I’m getting my feet wet with Asterisk for our home telephone system and I have a working basic setup.
I do have a question on handling a situation that I assume quite some users have encountered. I have 2 real phones with an ATA that are online whenever Asterisk is up. Next to that, I have two softphones that are not on all the time (they are on when the computers where they are installed on are on). All clients are connected through SIP to Asterisk.
Furthermore I have a POTS trunk for incoming/outgoing calls.
In my extensions.conf I have a dialplan that rings all SIP clients when a call comes in from the POTS. I construct the argument for the Dial command by concatenating all client ID’s with an ampersand:
[globals]
PHONE1=SIP/line1
PHONE2=SIP/line2
…
[pstn_trunk]
exten => s,1,Dial(${PHONE1}&${PHONE2}&${PC_LIVING}&${PC_HOBBY},30)
…
Now, when there is an incoming ring and one of the softphones is not alive, then (of course) there is a notification in the logs of Asterisk like:
app_dial.c:1745 dial_exec_full: Unable to create channel of type ‘SIP’ (cause 20 - Unknown)
This is normal, as the SIP client is not active.
I tried to work around this with the ChanIsAvail application, but this only returns the first available channel. So I guess I will need to make a macro that tests every channel with the ChanIsAvail, and then concatenate the results?
Are there other more elegant solutions to this?
Best regards,
Hollie.