1

I have a problem: in Asterisk script, i execute a call from A to B by command Dial(SIP/xxx). I want play music during A talking with B.

Fuction Dial only support music begin call OR end Call: https://www.voip-info.org/wiki/view/Asterisk+cmd+Dial

Please help me if you know.

Community
  • 1
  • 1
langiac
  • 317
  • 1
  • 3
  • 16

1 Answers1

1

There is 2 possible variants

1) dial command L param play file at some time before end of call, with repeat option

  L(x[:y[:z]]): 
        x - Maximum call time, in milliseconds

        y - Warning time, in milliseconds

        z - Repeat time, in milliseconds
Limit the call to <x> milliseconds. Play a warning when <y> milliseconds
are left. Repeat the warning every <z> milliseconds until time expires.
    This option is affected by the following variables:
        ${LIMIT_PLAYAUDIO_CALLER}: 
            yes
            no
            If set, this variable causes Asterisk to play the
            prompts to the caller.
        ${LIMIT_PLAYAUDIO_CALLEE}: 
            yes
            no
            If set, this variable causes Asterisk to play the
            prompts to the callee.
        ${LIMIT_TIMEOUT_FILE}: 
            filename
            If specified, <filename> specifies the sound prompt
            to play when the timeout is reached. If not set, the time remaining
            will be announced.
        ${LIMIT_CONNECT_FILE}: 
            filename
            If specified, <filename> specifies the sound prompt
            to play when the call begins. If not set, the time remaining will
            be announced.
        ${LIMIT_WARNING_FILE}: 
            filename
            If specified, <filename> specifies the sound prompt
            to play as a warning when time <x> is reached. If not set, the
            time remaining will be announced.

2) You can orignate new channel, one leg to file, other leg via ChanSpy wisper feature connect to current call. https://www.voip-info.org/wiki/view/Asterisk+cmd+ChanSpy

arheops
  • 15,544
  • 1
  • 21
  • 27
  • thanks, but with option 1, only receiver(B) listen music OR sender(A) listen music, and while A is listening music, don't talk to each other. – langiac Sep 08 '17 at 07:10
  • Yes, but that is much simpler then option 2. Chanspy can speak to both. – arheops Sep 08 '17 at 10:55
  • 1
    I use call group, when A and B is talking, put C to this group and play music. Is is ok but i thinks not best. I'm test with ChanSpy but It don't work. I use Asterisk 11.x – langiac Sep 11 '17 at 02:46