play a paging message

Discussion in 'General' started by Patrick_elx, Feb 19, 2009.

  1. Patrick_elx

    Joined:
    Dec 14, 2008
    Messages:
    1,120
    Likes Received:
    0
    Hi,

    I'm trying to create an extension that will do the following:

    page a page group
    play a recorded voice message
    hangup


    Let's say I have a pagegroup on ext 620.
    When I dial 620 from a phone, I can talk and have my voice broadcasted to all the extensions in the paging group. So far so good.

    Now I want to create an extension 789 that when dialed will play the recorded message.

    In custom extension custom.conf, in the from-internal-custom context I added:

    exten => 789,1,Noop(page recorded message)
    exten => 789,n,gosub(ext-paging,620,1)
    exten => 789,n,Wait(1)
    exten => 789,n,Playback(myrecordedfile)
    exten => 789,n,Hangup

    but now when I'm dialing 789, it correctly page all the paging group, but no message is played (on the paged ext or the phone dialing it).

    I tried to replace the gosub by the Set(_Force_Page=0) and Page(...) functions, but with the same result.

    What am I doing wrong?
     
  2. dicko

    Joined:
    Oct 24, 2008
    Messages:
    4,099
    Likes Received:
    0
    if the "myrecordedfile" was one you did with the "system recordings" thingy then I think you will find it in the custom directory of /var/lib/asterisk/sounds (as a .wav file by default) so try
    .
    .
    exten => 789,n,Playback(custom/myrecordedfile)
    .
    .
    instead.

    (unless you changed the default monitor/recorded message path in amportal.conf or in freepbx anyway)

    and also that the gosub call returns you to the calling context correctly and before hanging up the channel, check the CLI to verify.
     
  3. Patrick_elx

    Joined:
    Dec 14, 2008
    Messages:
    1,120
    Likes Received:
    0
    The problem is that after the Page command, the script does not continue.

    on the CLI I see that after the page I have:

    <SIP/21-09b21838> Playing 'beep' (language 'en')
    -- Created MeetMe conference 1023 for conference '159628618d'
    -- Hungup 'Zap/pseudo-894676874'

    and that's it.

    I need to find a way to stay in the same context or return back to the original one.
    Probably have to rewrite the paging macro
     
  4. dicko

    Joined:
    Oct 24, 2008
    Messages:
    4,099
    Likes Received:
    0
    How about something like:-

    initiating the process with dial(local/<page group>,,G(custom-message,sendmessage,1))

    where

    [custom-message]
    exten => sendmessage,1,Wait(1)
    exten => sendmessage,2,Playback(custom/myrecordedfile)
    exten => sendmessage,3,Hangup()


    This uses the G option in the dial CMD to, on answer, send the caller to sendmessage,1 and the called party (in your case the page group) to sendmessage,2
    sendmessage,1 could be hangup(), but here, you get a confirmation of what is being paged(asynchronously however)

    (perhaps a little convoluted but as you are not needing two way audio it should work efficiently to bridge the two channels (page and playback without you), I'm sure there is a better way, It worked for me YMMV of course ( wasn't physically near my system so I synthesized LOCAL with a SIP dial to my cell phone instead of a page group )

    edit:

    I noted your:
    I need to find a way to stay in the same context or return back to the original one.
    Probably have to rewrite the paging macro

    I interpreted what you wanted to do, to find a way to GET out the context but have the process continue without you, I hope I was right.
     
  5. Patrick_elx

    Joined:
    Dec 14, 2008
    Messages:
    1,120
    Likes Received:
    0
    did not work for me:

    after the dial command the CLI returns

    Everyone is busy/congested at this time (1:0/0/1)
     
  6. dicko

    Joined:
    Oct 24, 2008
    Messages:
    4,099
    Likes Received:
    0
    Well I'm not near a n extension that I can page (and call from)

    but try:

    <initiating the process with dial(local/<page group>,,G(custom-message,sendmessage,1))

    and

    >initiating the process with dial(local/620@ext-paging,,G(custom-message,sendmessage,1))

    from my last post
    (seems to work but only for one extension oh dear, I'll try tomorrow.)
     
  7. Patrick_elx

    Joined:
    Dec 14, 2008
    Messages:
    1,120
    Likes Received:
    0
    Yes that's what I tried. But I have a congested channel message: Everyone is busy/congested at this time (1:0/0/1)
    However when I page only one extension it does work.

    But as you wrote it then does work if I'm adding the right context ;-)

    dial(local/<page group>@ext-paging,,G(custom-message,sendmessage,1))

    thanks


    Patrick
     
  8. dicko

    Joined:
    Oct 24, 2008
    Messages:
    4,099
    Likes Received:
    0
    So it works as you wanted?

    I'm intrigued, what is your use, I'm thinking , .call files scheduled to announce lunch time, or a walmart "special on aisle 5" type concept (an aotomated PA system)

    ( that's what I meant
    < meaning take out
    and
    > meaning put in
    )
     
  9. Patrick_elx

    Joined:
    Dec 14, 2008
    Messages:
    1,120
    Likes Received:
    0
    I'm just interfacing the pbx with my X10 automation, and I'm playing a door bell ring on all the extension when the front door is open.

    I will also use the phone as the main interface to control the alarm system.
     
  10. dicko

    Joined:
    Oct 24, 2008
    Messages:
    4,099
    Likes Received:
    0

Share This Page