Initiate outgoing call from a script

Is it Chan or PJSIP?

it’s CHAN_SIP

Try to change the channel to
local/255@from-internal

Just tried that and the only different is at the callerID.
This time I am getting the callerID as unknown instead of Anonymous Caller like before. But there is still no thing being played back.

OK - we’ve been completely around the horn with this and I don’t think you’re getting anywhere.

First - you want to start this from a Shell Script. That’s simple enough - you create a call file in the /tmp directory and move it into the outgoing directory. If you try to build it in the outgoing directory directly, the file will execute before you finish it and the end of the file will not be processed.

Next - You are moving further and further from what you originally asked about. At this point, you’ve got to modify a context and call a fake extension to get your process to work. If you are going to do anything that involves the messing around with the sounds, you’ll need to make this more and more “localed down” instead of a flexible system. For example, to choose the sounds you want to play, which isn’t what you asked about in the first place.

Finally - Your ‘data’ directive should be a full pathname without going through a bunch of symlinks. To satisfy this, you need to put the audio file into a directory and then call for the audio files in that directory. Put the file in /tmp/whatever.sln and call it from the callfile as ‘Data: /tmp/whatever’ - leave off the file extension, since the systes is going to try to append a bunch of different extensions on to find the file. If you specify it as “/tmp/whatever.slin”, the system is going to look for “/tmp/whatever.slin.slin”, which I’m pretty sure doesn’t exist (as the error message above pointed out).

On the “one-way audio” problem you are having: are you sure that a call from the server to your extension can be heard already? You can’t test as a call from the extensions - you have to start up a file from the server and see of the audio will play back onto the extension from there.

1 Like

This helped.
I can now hear the play back. I used the file /var/lib/asterisk/sounds/please-enter-your-extension-then-press-pound

Now the only thing left is how can I locate my custom system recording?
Here is my uploaded custom recording.

/var/lib/asterisk/sounds/custom/

Log in as ‘root’ at the console and enter the following:

find /var/lib/asterisk/sounds -name 'name-of-the-file-without-extension.*'

Single quotes around the filename are important so the * doesn’t get expanded by the shell.

1 Like

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