Play System Recording on only internal SIP-extention

Hello! I need a setup to play a System Recording or file on SIP extention in my organization.

  1. Someone call a SIP/503
  2. Play Recording
  3. Call continues
    How can i make it? Thanks!

You would do it by configuring the SIP support in Asterisk (pjsip.conf) to connect to whichever other platform or device, and then write dialplan using dialplan applications (Playback at least) to handle the call. Asterisk is a toolkit, up to you to put the pieces together in the way you want.

On Tuesday 18 June 2024 at 12:32:19, diger46 via Asterisk Community wrote:

  1. Someone call a SIP/503
  2. Play Recording
  3. Call continues

What do you mean by “call continues”? What do you want to happen after
they’ve heard the recording?


Just when you think you’re done, a cat floats by with buttered toast strapped
to its back.

  • Steve Krug, “Don’t make me think”

                                                Please reply to the list;
                                                      please *don't* CC me.

Thank to reply. I mean Call continues ringing. I need to play audio file as announcement before call start ringing.
I did that announcement on my inbound routes through IVR. Now i need to do this on my internal SIP number

SIP/503 is an endpoint, not an extension, and it is using a channel driver that is no longer supported.

It is not clear whether it is the incoming or outgoing side, but, as once you get a far as actually using endpoint names, it is too late to play recordings, I’ll assume you mean the incoming side. On the other hand, the fact that it is SIP would seem to be totally irrelevant, in that case.

If you want to do it at the point when the destination endpoint has just answered, you use the A option on Dial.

Playing a message to the caller before continuing with the rest of the dialplan is really basic stuff. You invoke Playback before the main part of the dialplan. Often this is just a case of inserting a new line with priority n, between the priority 1 line (which is often written to do nothing) and the first priority n line.

I do however wonder if you are asking how to do this on FreePBX, or some other product which creates a PABX from Asterisk, in which case you are asking on the wrong forum.

I’m thinking OP’s request is about playing a recording like “This call is being monitored or recorded” and then going on to ring a queue/ring group/extension.

As Asterisk has no IVR primitive, if you did this through an IVR, but don’t know the dialplan used, you are almost certainly using a GUI based PABX and you need to ask on the forum for that product.

Exactly! And i think this can be done on Asterisk GUI. But now i realize that can only be done with tuning Dialplan on FreePBX…

On Wednesday 19 June 2024 at 19:23:45, diger46 via Asterisk Community wrote:

Exactly! And i think this can be done on Asterisk GUI.

Just as a confirmation (that you are using FreePBX, Issabel or similar), there
is no “Asterisk GUI”.

But now i realize that can only be done with tuning Dialplan on FreePBX.

Splendid. Glad we got there.


This is not a rehearsal.
This is Real Life.

                                               Please reply to the list;
                                                     please *don't* CC me.

There was at one time. It was retired, in favour of FreePBX.

in your extensions.conf (or included file)

exten=>s,1, Verbose(3,"argument passed ${ARG1}")
same=>n,GotoIf($[$["${GLOBAL(RECORD_CALLS)}"="1"] | $["${ARG1}"="1"]]?:skip-recording)
;turn on automatic call recording on the next line

then somwhere in your IVR

;ODBC_LOOKUP_NAME returns caller name and 1 for "bad callers" for which we turn on call recording

recording “stereo” subroutine with some sound processing.
DIR_RECORDS must point to the path for recordings.

;calling gosub() from features.conf [applicationmap] does not know argument values?
exten => s,1,Set(fname=${UNIQUEID}-${STRFTIME(${EPOCH},,%Y-%m-%d-%H_%M)}-${FILTER(A-Za-z0-9,${CALLERID(num)})}-${FILTER(A-Za-z0-9,${EXTEN})})
exten => s,n,Verbose(2,"recording arguments: ${ARG1},${ARG2}")

exten => s,n,Set(monopt=nice -n 19 /usr/bin/lame -b 32 --silent "${GLOBAL(DIR_RECORDS)}${fname}.wav" "${GLOBAL(DIR_RECORDS)}${fname}.mp3" && rm -f "${GLOBAL(DIR_RECORDS)}${fname}.wav" && chmod o+r "${GLOBAL(DIR_RECORDS)}${fname}.mp3")
exten => s,n,Set(CDR(recordingfile)=${fname}.mp3)
exten => s,n,Set(CDR(realdst)=${ARG2})
;write in and out files r() and t() options:
same =>n,MixMonitor(,SW(2)r(${GLOBAL(DIR_RECORDS)}${fname}_r.wav)t(${GLOBAL(DIR_RECORDS)}${fname}_t.wav),sox -M ${GLOBAL(DIR_RECORDS)}${fname}_r.wav ${GLOBAL(DIR_RECORDS)}${fname}_t.wav ${GLOBAL(DIR_RECORDS)}${fname}.wav && lame -b 32 -m d ${GLOBAL(DIR_RECORDS)}${fname}.wav ${GLOBAL(DIR_RECORDS)}${fname}.mp3 && rm ${GLOBAL(DIR_RECORDS)}${fname}*.wav)
;this works for mono records ->
;exten => s,n,MixMonitor(${DIR_RECORDS}${fname}.wav,b,${monopt})
;exten => s,n,Monitor(wav,${DIR_RECORDS}${fname},bm);requires soxmix
exten => s,n(no),Verbose(Exit record)
exten => s,n,Return()

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.