Addressing Peers Dynamically

Home » Asterisk Users » Addressing Peers Dynamically
Asterisk Users 4 Comments

hi, in my small setup (just for home usage) i have 5 phones configured. but only 2 of them are permanent connected to Asterisk. nevertheless i want to address beside those two phones other peers if available. nowadays i address them always, resulting in error messages:
Unable to create channel of type ‘SIP’ (cause 20 – Subscriber absent)
Is there a way to avoid those messages? I think about something like a virtual queue (please excuse if the wording is incorrect, i am not in too deep to asterisk, i am more firm with genesys) that is addressed and peers are registering to that queue. is that the right path, or am i barking the wrong tree?

regards, andre

4 thoughts on - Addressing Peers Dynamically

  • Andre Gronwald wrote:

    Hola,

    Is there any particular reason you don’t want to do this or is it just because you get the “Unable to create channel” message? There’s nothing really *wrong* with that message in your case.

    Cheers,

  • I had a similar problem (I work on 3 lans; when my firewall is down, the two non-native lans are unaccessible) I wrote an AGI to execute “sip show peers” and process only the ones that return OK and pass my peer numbers to the AGI like this –

    [dialall]

    Exten => s,1,AGI(sipcheck.agi,100,200,300)

    exten => s,n,Gotoif($[ “${LEN(${DIAL-100})}” != “7”]?dialall,s,4)

    exten => s,n,Set(TODIAL=${TODIAL}’&’${DIAL-100})

    exten => s,n,Gotoif($[ “${LEN(${DIAL-200})}” != “7”]?dialall,s,6)

    exten => s,n,Set(TODIAL=${TODIAL}’&’${DIAL-200})

    exten => s,n,Gotoif($[ “${LEN(${DIAL-300})}” != “7”]?dialall,s,8)

    exten => s,n,Set(TODIAL=${TODIAL}’&’${DIAL-300)

    exten => s,n,Dial(${TODIAL},40,i,KktTm)

    From: asterisk-users-bounces@lists.digium.com
    [mailto:asterisk-users-bounces@lists.digium.com] On Behalf Of Andre Gronwald Sent: Monday, November 19, 2012 2:00 AM
    To: asterisk-users Subject: [asterisk-users] addressing peers dynamically

    hi, in my small setup (just for home usage) i have 5 phones configured. but only
    2 of them are permanent connected to asterisk. nevertheless i want to address beside those two phones other peers if available. nowadays i address them always, resulting in error messages:
    Unable to create channel of type ‘SIP’ (cause 20 – Subscriber absent)
    Is there a way to avoid those messages? I think about something like a virtual queue (please excuse if the wording is incorrect, i am not in too deep to asterisk, i am more firm with genesys) that is addressed and peers are registering to that queue. is that the right path, or am i barking the wrong tree?

    regards, andre

  • Am 19.11.2012 19:00, schrieb asterisk-users-request@lists.digium.com:
    it is just because i think that something is not wrong (which is correct, because i address a currently not existing peer). and if there is a way to handle it better, then i would like to know it (virtual queues is just oversized, but maybe there is a simple usage of addressing only registered peers…

    regards, andre

  • Andre Gronwald wrote:

    Ultimately something has to check if the peer is available or not, the only difference is instead of having app_dial do it you do it to mask the message.

    You could use ChanIsAvail on each peer you want to dial and use the result to construct a string of available devices.

    Cheers,