How To Dial Extensions Asynchronous-sequentially ?

Home » Asterisk Users » How To Dial Extensions Asynchronous-sequentially ?
Asterisk Users 5 Comments

Hi.

I my dialplan I have :

same = n,Dial(PJSIP/6001,10)
same = n,Dial(PJSIP/6002,30)
same = n,Hangup()

The extension 6002 will not be invited until the called party 6001 hangs up or until 10 seconds if nobody answers the call in 6001.

How to call 6001 and immediately call 6002, having 2 phones ringing at same time, but without doing something like this : same = n,Dial(PJSIP/6001&PJSIP/6002) ?
What I’m asking is if it is possible to call 6001 in an asynchronous way and then call 6002 too. Is it possible?

Any hint will be very helpful!

Best regards.

RODRIGO PIMENTA CARVALHO
Inatel Competence Center Software Ph: +55 35 3471 9200 RAMAL 979

5 thoughts on - How To Dial Extensions Asynchronous-sequentially ?

  • Hi, Even you achieve that, what would be the objective? Do you want to just call the user and Hangup ? or Dial two users and connect them together ? Is this some sort of ring group implementation where users are dialled and first one to answer will get the call ??

    Anyway here’s one way of how I think you can do.

    Have a context created to dial the individual user

    [dial_user]
    exten => _600X.,1,Dial(PJSIP/${EXTEN})

    and in your code change it to.

    same = n,Dial(local/6001@dial_user/n&local/6002@dial_user/n)
    same = n,Hangup()

    On Mon, Jul 13, 2015 at 2:28 PM, Rodrigo Pimenta Carvalho

  • –Apple-Mail=_5E6ACEDD-56B6-473C-8CFA-A238CAEAB814
    Content-Transfer-Encoding: quoted-printable Content-Type: text/plain;
    charset=us-ascii

    Heya Rodrigo

    Not sure, but this expansion on Sammy’s concept may help you achieve the delayed ring on the secondary extensions you were looking for.

    exten => _600.,1,Dial(PJSIP/${EXTEN})
    exten => _600.,n,Hangup

    exten => _600.wait5,1,Wait(5)
    exten => _600.wait5,n,Dial(PJSIP/${EXTEN:0:4})
    exten => _600.wait5,n,Hangup

    exten => 555,1,Dial(LOCAL/6001&LOCAL/6002.wait5)
    exten => 555,n,Hangup

    So you dial ‘555’ and it rings 6001, then 5 second later (assuming 6001 isn’t answered yet) 6002 starts ringing too (first to answer gets it).

    Pete

    –Apple-Mail=_5E6ACEDD-56B6-473C-8CFA-A238CAEAB814
    Content-Transfer-Encoding: quoted-printable Content-Type: text/html;
    charset=us-ascii

    Heya Rodrigo
    Not sure, but this expansion on Sammy’s concept may help you achieve the delayed ring on the secondary extensions you were looking for.
    exten => _600.,1,Dial(PJSIP/${EXTEN})
    exten => _600.,n,Hangup
    exten => _600.wait5,1,Wait(5)
    exten => _600.wait5,n,Dial(PJSIP/${EXTEN:0:4})
    exten => _600.wait5,n,Hangup
    exten => 555,1,Dial(LOCAL/6001&LOCAL/6002.wait5)
    exten => 555,n,Hangup
    So you dial ‘555’ and it rings 6001, then 5 second later (assuming 6001 isn’t answered yet) 6002 starts ringing too (first to answer gets it).

    Pete


    On 14/07/2015, at 7:24 AM, SamyGo <govoiper@gmail.com> wrote:


    Anyway here’s one way of how I think you can do.
    Have a context created to dial the individual user
    [dial_user]
    exten => _600X.,1,Dial(PJSIP/${EXTEN})
    and in your code change it to.
    same = n,Dial(local/6001@dial_user/n&local/6002@dial_user/n)
    same = n,Hangup()


    –Apple-Mail=_5E6ACEDD-56B6-473C-8CFA-A238CAEAB814

  • Hi Sammy and Pete.

    Sammy, you are correct. But your example doesn’t allow Asterisk forward every SIP 183 message to the caller.

    Pete, in fact, I’m not looking for a delayed ring. All extensions must ring at same time. I got a kind of solution by using:

    exten = _6XXX,1,Dial(${PJSIP_DIAL_CONTACTS(${EXTEN})}, 60)

    However, the Asterisk is rewriting the SDP content of SIP 183 messages, before forwarding it to the caller. That is the new question I would like to solve, because in my project the caller must receive the SIP 183 from callee as it was originally wrote.

    Thanks and regards.

    RODRIGO PIMENTA CARVALHO
    Inatel Competence Center Software Ph: +55 35 3471 9200 RAMAL 979 (Brasil)

  • –Apple-Mail=_9C137ED3-5B26-429E-8B49-7C252008D1CB
    Content-Transfer-Encoding: quoted-printable Content-Type: text/plain;
    charset=iso-8859-1

    Heya Rodrigo

    My apologies for the misunderstanding re the delay.

    I think the 183 messages problem stems from Asterisk being a B2BUA not a proxy and therefore not the tool or this job. But others have more skill around that area than I do so please confirm that before accepting it as fact!

    Hope you get it resolved. Sorry to muddy the waters 🙂

    Pete

    –Apple-Mail=_9C137ED3-5B26-429E-8B49-7C252008D1CB
    Content-Transfer-Encoding: quoted-printable Content-Type: text/html;
    charset=iso-8859-1

    Heya Rodrigo

    My apologies for the misunderstanding re the delay.
    I think the 183 messages problem stems from Asterisk being a B2BUA not a proxy and therefore not the tool or this job. But others have more skill around that area than I do so please confirm that before accepting it as fact!
    Hope you get it resolved. Sorry to muddy the waters 🙂
    Pete
    On 16/07/2015, at 9:24 AM, Rodrigo Pimenta Carvalho <pimenta@inatel.br> wrote:

    Hi Sammy and Pete.
    Sammy, you are correct. But your example doesn’t allow Asterisk forward every SIP 183 message to the caller.
    Pete, in fact, I’m not looking for a delayed ring. All extensions must ring at same time. I got  a kind of solution by using:
    exten = _6XXX,1,Dial(${PJSIP_DIAL_CONTACTS(${EXTEN})}, 60)
    However, the Asterisk is rewriting the SDP content of SIP 183 messages, before forwarding it to the caller. That is the new question I would like to solve, because in my project the caller must receive the SIP 183 from callee as it was originally wrote.
    Thanks and regards.

    RODRIGO PIMENTA CARVALHO
    Inatel Competence Center
    Software
    Ph: +55 35 3471 9200 RAMAL 979   (Brasil)


    De: asterisk-users-bounces@lists.digium.com <asterisk-users-bounces@lists.digium.com> em nome de Pete Mundy <pete@fiberphone.co.nz>
    Enviado: quarta-feira, 15 de julho de 2015 18:16
    Para: Asterisk Users Mailing List – Non-Commercial Discussion
    Assunto: Re: [asterisk-users] How to dial extensions asynchronous-sequentially ?

     
    Heya Rodrigo
    Not sure, but this expansion on Sammy’s concept may help you achieve the delayed ring on the secondary extensions you were looking for.
    exten => _600.,1,Dial(PJSIP/${EXTEN})
    exten => _600.,n,Hangup
    exten => _600.wait5,1,Wait(5)
    exten => _600.wait5,n,Dial(PJSIP/${EXTEN:0:4})
    exten => _600.wait5,n,Hangup
    exten => 555,1,Dial(LOCAL/6001&LOCAL/6002.wait5)
    exten => 555,n,Hangup
    So you dial ‘555’ and it rings 6001, then 5 second later (assuming 6001 isn’t answered yet) 6002 starts ringing too (first to answer gets it).

    Pete

    On 14/07/2015, at 7:24 AM, SamyGo <govoiper@gmail.com> wrote:


    Anyway here’s one way of how I think you can do.
    Have a context created to dial the individual user
    [dial_user]
    exten => _600X.,1,Dial(PJSIP/${EXTEN})
    and in your code change it to.
    same = n,Dial(local/6001@dial_user/n&local/6002@dial_user/n)
    same = n,Hangup()

     
    _____________________________________________________________________
    — Bandwidth and Colocation Provided by http://www.api-digital.com 
    New to Asterisk? Join us for a live introductory webinar every Thurs:
                  http://www.asterisk.org/hello

    asterisk-users mailing list
    To UNSUBSCRIBE or update options visit:
      http://lists.digium.com/mailman/listinfo/asterisk-users


    –Apple-Mail=_9C137ED3-5B26-429E-8B49-7C252008D1CB

  • Hi Pete.

    No problem!

    Maybe I will use only OpenSIPS, because it may be enough for me. But I still have to investigate some points.

    As I was learning the past few days, due to the fact that Asterisk is not a SIP Proxy, it might cause some more difficult in my project.

    Best regards.

    RODRIGO PIMENTA CARVALHO
    Inatel Competence Center Software Ph: +55 35 3471 9200 RAMAL 979 (Brasil)