Need to be able to hear a recorded message

Hello, I am new to asterisk and learning as I go. I created a pjsip and attached it to a DID through a voip.ms server. Now I am able to place calls to real telephone numbers from a softphone connected to the pjsip. My question is, I need to be able to play a recorded message when the person on the real phone I’m calling picks up. I’ve done some research and tried out the Playback feature, but I’m not sure how to get it to work. Any help would be appreciated. Thank you.

Look at the A and U options in Asterisk 15 Application_Dial - Asterisk Project - Asterisk Project Wiki

There is an example of the U option.

If you are having specific problems with Playback, get it working as the destination of your, local, call, before trying the more complex cases. There are several examples in asterisk/extensions.conf.sample at master · asterisk/asterisk · GitHub

Hi David, thanks for helping again. So I tried to change my current configuration in extensions.conf to add what they had in that tutorial wiki. For some reason when I tried to make it a similar format to what they had, it stopped placing calls completely. Would you be able to tell me how I can edit this (which is voip.ms default extensions.conf) so that I can add the playback option. I’m still not quite sure what NoOp does either.
My extensions.conf looks as follows.
[internal]
exten => 100,1,Answer()
same = n,Wait(1)
same = n,Playback(hello-world)
same = n,Hangup()

exten => 200,1,Dial(PJSIP/6001)
same n,Wait(20)
same = n,Hangup()

[mycontext]
; Make sure to include inbound prior to outbound because the _NXXNXXXXXX handler will match the incoming call and create a loop
include => voipms-inbound
include => voipms-outbound

[voipms-outbound]
exten => _1NXXNXXXXXX,1,Dial(PJSIP/{EXTEN}@voipms) exten => _1NXXNXXXXXX,n,Hangup() exten => _NXXNXXXXXX,1,Dial(PJSIP/1{EXTEN}@voipms)
exten => _NXXNXXXXXX,n,Hangup()
exten => _011.,1,Dial(PJSIP/{EXTEN}@voipms) exten => _011.,n,Hangup() exten => _00.,1,Dial(PJSIP/{EXTEN}@voipms)
exten => _00.,n,Hangup()

[voipms-inbound]
exten => 8005226262,1,Answer() ;your DID

Hello, even when I change the pjsip.conf file to show exactly what it shows in that tutorial, and then call an extension I had set up already, it willl always dial the correct extension but it doesn’t playback any message that I am trying to play.

That’s because it is a ‘bad established practice’ (IMO) to use a ‘side effect’ of the ‘no operation’ application to output text to the console when there is a ‘best practice,’ purpose built application available – ‘verbose()’ – which has more features.

I’m old enough to remember coding in assembly language and a native English speaker so it’s obvious to me what a ‘noop()’ is. For young, non-native English speakers, not so much. Even Google Translate gives no clues for many languages.

Just for clarity…

Are you wanting to dial a number ‘by hand’ and then play a file before talking with the called party or are you wanting for your system to dial a number and play a file with no interaction from/with you?

I assumed the former, in my reply, as the latter gets quite fiddly. I wouldn’t try the latter until you fully understand how solutions to the former work.

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