<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <p>Thank you, I just tried your suggestion. Strangely, the
      announcement is played only if I try to dial a SIP peer which is
      not available (not registered to be more precise). If the SIP peer
      is available, I only get the ring tone, and never hear the
      announcement. Here is the dialplan (I had to add an Answer()
      before the Dial, otherwise the announcement is never played, even
      in the first case) :</p>
    <p><tt>exten = 007,1,Answer()<br>
        same  = n,Dial(SIP/foo&Local/s@playme,40)</tt><tt><br>
      </tt></p>
    <p><tt>[playme]</tt><tt><br>
      </tt><tt>exten = s,1,Ringing()</tt><tt><br>
      </tt><tt>same  = n,Wait(10)</tt><tt><br>
      </tt><tt>same  =
        n,Playback(/var/lib/asterisk/sounddir/announce,noanswer)</tt></p>
    When it is working, I can see the following output in the CLI, which
    is not there otherwise :<br>
    <tt>-- SIP/xxxxxxxxx requested media update control 26, passing it
      to Local/s@playme-000005be;1</tt><br>
    <br>
    Otherwise, no error message, Asterisk tells he is playing the
    announcement but I don't hear it.<br>
    <br>
    Best regards<br>
    <br>
    Jean Aunis<br>
    <br>
    <div class="moz-cite-prefix">Le 23/08/2016 à 16:07, David Duffett a
      écrit :<br>
    </div>
    <blockquote
cite="mid:CAM3NQMZwYNKVKV4yo_gP9eA8eya5hHF-CEiz9NpSvo-_-DO+AA@mail.gmail.com"
      type="cite">
      <div dir="ltr">How about:
        <div><br>
        </div>
        <div>
          <div style="font-size:12.8px">
            <div>exten =>
              s,1,Dial(SIP/alice&LOCAL/555@delayed-announce,40)<br>
            </div>
            <div><br>
            </div>
            <div>[delayed-announce]</div>
            exten =>  555,1,Wait(20)</div>
          <div style="font-size:12.8px">same =>
            n,Playback(myannouncement,noanswer)<br>
          </div>
          <span style="font-size:12.8px">same => n,NoOP(Whatever else
            you want to do goes here)</span><br>
        </div>
        <div><span style="font-size:12.8px"><br>
          </span></div>
        <div><span style="font-size:12.8px">The 'noanswer' option on the
            Playback means that SIP/alice should continue to ring for
            the remaining 20 of the 40 seconds, as the Playback will not
            answer (terminate) the call.</span></div>
        <div><span style="font-size:12.8px"><br>
          </span></div>
        <div><span style="font-size:12.8px">Don't forget AstriCon this
            year - <a moz-do-not-send="true"
              href="http://www.astricon.net">www.astricon.net</a></span></div>
      </div>
      <div class="gmail_extra"><br>
        <div class="gmail_quote">On 23 August 2016 at 12:52, Israel
          Gottlieb <span dir="ltr"><<a moz-do-not-send="true"
              href="mailto:isrlgb@gmail.com" target="_blank">isrlgb@gmail.com</a>></span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <p dir="ltr">You could m and make a moh file that has
              ringing the first 30 sec and then the anouncment </p>
            <div class="gmail_extra"><br>
              <div class="gmail_quote">בתאריך 22 באוג׳ 2016 7:19 PM,‏
                "Jean Aunis" <<a moz-do-not-send="true"
                  href="mailto:jean.aunis@prescom.fr" target="_blank">jean.aunis@prescom.fr</a>>
                כתב:
                <div>
                  <div class="h5"><br type="attribution">
                    <blockquote class="gmail_quote" style="margin:0 0 0
                      .8ex;border-left:1px #ccc solid;padding-left:1ex">
                      <div bgcolor="#FFFFFF" text="#000000">
                        <p>Thank you for the idea. The problem with
                          RetryDial, is that it will cancel the first
                          call, play the announce and then dial the SIP
                          peer once again, so the telephone will display
                          a missed call. I would prefer to do everything
                          in a single call.<br>
                        </p>
                        <br>
                        <div>Le 22/08/2016 à 17:57, John Kiniston a
                          écrit :<br>
                        </div>
                        <blockquote type="cite">
                          <div dir="ltr">You could try using RetryDial()
                            instead of Dial, It supports playing an
                            announcement.<br>
                            <br>
                          </div>
                          <div class="gmail_extra"><br>
                            <div class="gmail_quote">On Mon, Aug 22,
                              2016 at 8:45 AM, Jean Aunis <span
                                dir="ltr"><<a moz-do-not-send="true"
                                  href="mailto:jean.aunis@prescom.fr"
                                  target="_blank">jean.aunis@prescom.fr</a>></span>
                              wrote:<br>
                              <blockquote class="gmail_quote"
                                style="margin:0 0 0 .8ex;border-left:1px
                                #ccc solid;padding-left:1ex">
                                <div bgcolor="#FFFFFF" text="#000000">
                                  <p>Sorry, I forgot to write that the
                                    SIP peer must keep ringing while the
                                    announcement is being played.<br>
                                  </p>
                                  <div>
                                    <div> <br>
                                      <div>Le 22/08/2016 à 17:42, John
                                        Kiniston a écrit :<br>
                                      </div>
                                      <blockquote type="cite">
                                        <div dir="ltr">
                                          <div>
                                            <div>This seems like the
                                              obvious answer but maybe
                                              I'm misunderstanding the
                                              question.<br>
                                            </div>
                                            <div><br>
                                              exten =>
                                              s,1,Dial(SIP/alice,20)<br>
                                            </div>
                                             same =>  
                                            n,Playback(myannouncement)<br>
                                          </div>
                                           same =>   n,NoOP(Whatever
                                          else you want to do goes here)<br>
                                        </div>
                                        <div class="gmail_extra"><br>
                                          <div class="gmail_quote">On
                                            Mon, Aug 22, 2016 at 8:36
                                            AM, Jean Aunis <span
                                              dir="ltr"><<a
                                                moz-do-not-send="true"
                                                href="mailto:jean.aunis@prescom.fr"
                                                target="_blank">jean.aunis@prescom.fr</a>></span>
                                            wrote:<br>
                                            <blockquote
                                              class="gmail_quote"
                                              style="margin:0 0 0
                                              .8ex;border-left:1px #ccc
                                              solid;padding-left:1ex">Hello,<br>
                                              <br>
                                              I am searching a way to
                                              dial a SIP peer, and if it
                                              does not answer within 20
                                              seconds, play an
                                              announcement to the
                                              caller. This means that
                                              the caller would hear a
                                              ring tone for 20 seconds,
                                              and only then hear the
                                              announcement if the callee
                                              did not answer.<br>
                                              <br>
                                              I know it is possible to
                                              do this with ARI, but in
                                              this particular case I do
                                              not want to use ARI. I
                                              would like to do this
                                              purely with dialplan and
                                              AGI scripts, but I cannot
                                              find a way. I have read
                                              about the "m" option of
                                              Dial application, but it
                                              starts the announcement
                                              immediately, whereas I
                                              would like to start it
                                              after 20 seconds of
                                              timeout.<br>
                                              <br>
                                              Does anybody have an idea
                                              ?<br>
                                              <br>
                                              Best regards,<br>
                                              <br>
                                              Jean Aunis<span><font
                                                  color="#888888"><br>
                                                  <br>
                                                  <br>
                                                  -- <br>
______________________________<wbr>______________________________<wbr>_________<br>
                                                  -- Bandwidth and
                                                  Colocation Provided by
                                                  <a
                                                    moz-do-not-send="true"
href="http://www.api-digital.com" rel="noreferrer" target="_blank">http://www.api-digital.com</a>
                                                  --<br>
                                                  New to Asterisk? Join
                                                  us for a live
                                                  introductory webinar
                                                  every Thurs:<br>
                                                                <a
                                                    moz-do-not-send="true"
href="http://www.asterisk.org/hello" rel="noreferrer" target="_blank">http://www.asterisk.org/hello</a><br>
                                                  <br>
                                                  asterisk-users mailing
                                                  list<br>
                                                  To UNSUBSCRIBE or
                                                  update options visit:<br>
                                                    <a
                                                    moz-do-not-send="true"
href="http://lists.digium.com/mailman/listinfo/asterisk-users"
                                                    rel="noreferrer"
                                                    target="_blank">http://lists.digium.com/mailma<wbr>n/listinfo/asterisk-users</a><br>
                                                </font></span></blockquote>
                                          </div>
                                          <br>
                                          <br clear="all">
                                          <br>
                                          -- <br>
                                          <div
                                            data-smartmail="gmail_signature">A
                                            human being should be able
                                            to change a diaper, plan an
                                            invasion, butcher a hog,
                                            conn a ship, design a
                                            building, write a sonnet,
                                            balance accounts, build a
                                            wall, set a bone, comfort
                                            the dying, take orders, give
                                            orders, cooperate, act
                                            alone, solve equations,
                                            analyze a new problem, pitch
                                            manure, program a computer,
                                            cook a tasty meal, fight
                                            efficiently, die gallantly.
                                            Specialization is for
                                            insects.<br>
                                            ---Heinlein</div>
                                        </div>
                                        <br>
                                        <fieldset></fieldset>
                                        <br>
                                      </blockquote>
                                      <br>
                                    </div>
                                  </div>
                                </div>
                                <br>
                                --<br>
                                ______________________________<wbr>______________________________<wbr>_________<br>
                                -- Bandwidth and Colocation Provided by
                                <a moz-do-not-send="true"
                                  href="http://www.api-digital.com"
                                  rel="noreferrer" target="_blank">http://www.api-digital.com</a>
                                --<br>
                                New to Asterisk? Join us for a live
                                introductory webinar every Thurs:<br>
                                               <a moz-do-not-send="true"
                                  href="http://www.asterisk.org/hello"
                                  rel="noreferrer" target="_blank">http://www.asterisk.org/hello</a><br>
                                <br>
                                asterisk-users mailing list<br>
                                To UNSUBSCRIBE or update options visit:<br>
                                   <a moz-do-not-send="true"
                                  href="http://lists.digium.com/mailman/listinfo/asterisk-users"
                                  rel="noreferrer" target="_blank">http://lists.digium.com/mailm<wbr>an/listinfo/asterisk-users</a><br>
                              </blockquote>
                            </div>
                            <br>
                            <br clear="all">
                            <br>
                            -- <br>
                            <div data-smartmail="gmail_signature">A
                              human being should be able to change a
                              diaper, plan an invasion, butcher a hog,
                              conn a ship, design a building, write a
                              sonnet, balance accounts, build a wall,
                              set a bone, comfort the dying, take
                              orders, give orders, cooperate, act alone,
                              solve equations, analyze a new problem,
                              pitch manure, program a computer, cook a
                              tasty meal, fight efficiently, die
                              gallantly. Specialization is for insects.<br>
                              ---Heinlein</div>
                          </div>
                          <br>
                          <fieldset></fieldset>
                          <br>
                        </blockquote>
                        <br>
                      </div>
                      <br>
                      --<br>
                      ______________________________<wbr>______________________________<wbr>_________<br>
                      -- Bandwidth and Colocation Provided by <a
                        moz-do-not-send="true"
                        href="http://www.api-digital.com"
                        rel="noreferrer" target="_blank">http://www.api-digital.com</a>
                      --<br>
                      New to Asterisk? Join us for a live introductory
                      webinar every Thurs:<br>
                                     <a moz-do-not-send="true"
                        href="http://www.asterisk.org/hello"
                        rel="noreferrer" target="_blank">http://www.asterisk.org/hello</a><br>
                      <br>
                      asterisk-users mailing list<br>
                      To UNSUBSCRIBE or update options visit:<br>
                         <a moz-do-not-send="true"
                        href="http://lists.digium.com/mailman/listinfo/asterisk-users"
                        rel="noreferrer" target="_blank">http://lists.digium.com/mailm<wbr>an/listinfo/asterisk-users</a><br>
                    </blockquote>
                  </div>
                </div>
              </div>
            </div>
            <br>
            --<br>
            ______________________________<wbr>______________________________<wbr>_________<br>
            -- Bandwidth and Colocation Provided by <a
              moz-do-not-send="true" href="http://www.api-digital.com"
              rel="noreferrer" target="_blank">http://www.api-digital.com</a>
            --<br>
            <br>
            Join the Asterisk Community at the 13th AstriCon, September
            27-29, 2016<br>
                  <a moz-do-not-send="true"
              href="http://www.asterisk.org/community/astricon-user-conference"
              rel="noreferrer" target="_blank">http://www.asterisk.org/<wbr>community/astricon-user-<wbr>conference</a><br>
            <br>
            New to Asterisk? Start here:<br>
                  <a moz-do-not-send="true"
              href="https://wiki.asterisk.org/wiki/display/AST/Getting+Started"
              rel="noreferrer" target="_blank">https://wiki.asterisk.org/<wbr>wiki/display/AST/Getting+<wbr>Started</a><br>
            <br>
            asterisk-users mailing list<br>
            To UNSUBSCRIBE or update options visit:<br>
               <a moz-do-not-send="true"
              href="http://lists.digium.com/mailman/listinfo/asterisk-users"
              rel="noreferrer" target="_blank">http://lists.digium.com/<wbr>mailman/listinfo/asterisk-<wbr>users</a><br>
          </blockquote>
        </div>
        <br>
        <br clear="all">
        <div><br>
        </div>
        -- <br>
        <div class="gmail_signature" data-smartmail="gmail_signature">
          <div dir="ltr">
            <div>
              <div dir="ltr"><img moz-do-not-send="true" alt="Digium
                  logo"
                  src="http://www.digium.com/images/graphics/digium_RGB_signature.gif"
style="color:rgb(0,0,0);font-family:Times;font-size:medium" height="50"
                  width="288"><br>
                <div><span
                    style="color:rgb(0,0,0);font-size:medium;font-family:Times"><font
                      face="Calibri, Helvetica, Arial, Sans"
                      color="#000000"><span
                        style="font-weight:bold;font-size:12px"><b><span>David
                            Duffett</span></b></span><br>
                      <span style="font-size:11px">Digium, Inc. · <span>Director,
                          Worldwide Asterisk Community</span><br>
                        <span>6 Landscape Close </span></span></font></span><span
style="color:rgb(0,0,0);font-family:Calibri,Helvetica,Arial,Sans;font-size:11px">· </span><span
style="font-size:11px;color:rgb(0,0,0);font-family:Calibri,Helvetica,Arial,Sans">Weston
                    on the Green</span><span
style="font-size:11px;color:rgb(0,0,0);font-family:Calibri,Helvetica,Arial,Sans"> · </span><span
style="font-size:11px;color:rgb(0,0,0);font-family:Calibri,Helvetica,Arial,Sans">Bicester </span><span
style="color:rgb(0,0,0);font-family:Calibri,Helvetica,Arial,Sans;font-size:11px">· </span><span
style="font-size:11px;color:rgb(0,0,0);font-family:Calibri,Helvetica,Arial,Sans">Oxfordshire
                    OX25 3SX</span><span
style="font-size:11px;color:rgb(0,0,0);font-family:Calibri,Helvetica,Arial,Sans"> · </span><span
style="font-size:11px;color:rgb(0,0,0);font-family:Calibri,Helvetica,Arial,Sans">UK</span></div>
                <div><span
                    style="color:rgb(0,0,0);font-size:medium;font-family:Times"><font
                      face="Calibri, Helvetica, Arial, Sans"
                      color="#000000"><span style="font-size:11px"><span>direct/fax:</span> <span>+1
                          256 428 6119</span><span> · mobile:</span> <span>+44
                          7722 442236</span><br>
                        <span><span>twitter: </span><span>dduffett</span> <span>·
                            linkedin: </span><span><a
                              moz-do-not-send="true"
                              href="http://www.linkedin.com/in/davidduffett"
                              target="_blank">www.linkedin.com/in/davidduffett</a></span> <span></span><span></span><br>
                        </span><span>Check us out at: <a
                            moz-do-not-send="true"
                            href="http://digium.com/" target="_blank">http://digium.com</a> · <a
                            moz-do-not-send="true"
                            href="http://www.asterisk.org/"
                            target="_blank">http://asterisk.org</a> </span></span></font></span><span
style="color:rgb(0,0,0);font-family:arial,helvetica,sans-serif;font-size:16px"> </span><br>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
    </blockquote>
    <br>
  </body>
</html>