Playback() doesn't work

sip.conf

[general]
context=default
allowguest=no
allowoverlap=no
bindaddr=0.0.0.0
alwaysauthreject=yes
register=username:password@host/username

[novofon]
host=host
type=friend
insecure=invite,port
fromuser=username
defaultuser=username
fromdomain=host
disallow=all
allow=alaw
allow=ulaw
dtmfmode=auto
secret=password
username=username
nat=force_rport,comedia

extensions.conf

[novofon-out]
exten => _+X.,1,NoOp(Call)
exten => _+X.,n,Playback(hello-world)
exten => _+X.,n,Dial(SIP/novofon/${EXTEN},30)

when I run the command channel originate SIP/novofon/+79XXXXXXXX extension novofon-out I get:

Using SIP RTP CoS mark 5
– Called novofon/+79XXXXXXXX
– SIP/novofon-0000003c is making progress
– SIP/novofon-0000003c answered
– Channel ‘SIP/novofon-0000003c’ sent to invalid extension: context,exten,priority=default,novofon-out,1
– Executing [i@default:1] playback(“SIP/novofon-0000003c”, “invalid”)
Sent RTP packet to 37.139.38.68:26174 (type 08, seq 020811, ts 000160, len 000160)
– <SIP/novofon-0000003c> Playing ‘invalid.gsm’ (language ‘en’)
Got RTP packet from 37.139.38.68:26174 (type 08, seq 030736, ts 1071672368, len 000160)
Sent RTP packet to 37.139.38.68:26174 (type 08, seq 020812, ts 000320, len 000160)
Got RTP packet from 37.139.38.68:26174 (type 08, seq 030737, ts 1071672528, len 000160)
Sent RTP packet to 37.139.38.68:26174 (type 08, seq 020813, ts 000480, len 000160)
Got RTP packet from 37.139.38.68:26174 (type 08, seq 030738, ts 1071672688, len 000160)
Sent RTP packet to 37.139.38.68:26174 (type 08, seq 020814, ts 000640, len 000160)
Got RTP packet from 37.139.38.68:26174 (type 08, seq 030739, ts 1071672848, len 000160)
Sent RTP packet to 37.139.38.68:26174 (type 08, seq 020815, ts 000800, len 000160)
Got RTP packet from 37.139.38.68:26174 (type 08, seq 030740, ts 1071673008, len 000160)
Sent RTP packet to 37.139.38.68:26174 (type 08, seq 020816, ts 000960, len 000160)
Got RTP packet from 37.139.38.68:26174 (type 08, seq 030741, ts 1071673168, len 000160)
Sent RTP packet to 37.139.38.68:26174 (type 08, seq 020817, ts 001120, len 000160)
Got RTP packet from 37.139.38.68:26174 (type 08, seq 030742, ts 1071673328, len 000160)
Sent RTP packet to 37.139.38.68:26174 (type 08, seq 020818, ts 001280, len 000160)
Got RTP packet from 37.139.38.68:26174 (type 08, seq 030743, ts 1071673488, len 000160)
Sent RTP packet to 37.139.38.68:26174 (type 08, seq 020819, ts 001440, len 000160)
Got RTP packet from 37.139.38.68:26174 (type 08, seq 030744, ts 1071673648, len 000160)

And… what are you expecting to happen/what do you want to happen/what actually happens that is contrary?

You told it to originate to SIP/novofon/+79XXXXXXXX which it did, then upon answer it was sent to the extension “novofon-out” in the context “default” at priority 1. That doesn’t exist, so it fell back to invalid which played back an invalid message. According to the output media is both being sent and received.

I call from my sip account to the number +79XXXXXXXX and it plays hello-world.gsm but instead I get invalid.gsm

How to fix it

channel originate SIP/novofon/+79XXXXXXXX extension 10000@novofon-out

That would send the answered call to extension 10000 in context novofon-out.

If you don’t understand contexts and extensions, those are fundamental to Asterisk and base knowledge that you need to have. There is some info here[1].

[1] Dialplan Syntax

what does 10,000 have to do with it?

The “channel originate” CLI command places an outgoing call. Once answered it is directed to an extension and optionally a context. You specified “novofon-out” as the extension in your attempt. It’s a context, not an extension. For mine I pulled 10000 out of thin air with “novofon-out” as the context as an example based on your provided dialplan. I don’t know what it should be. I can say that after finishing playing back “hello-world” it would then attempt to dial out using novofon.

my task was to simply call an external number from my sip account and play some audio and save the recording, how can this be done correctly

This is not a support ticketing system with an SLA. If I wish to respond, then I’ll do so.

This is using an obsolete and no longer supported channel driver. Moreover, using friend when not needed (as appears to be the case here) an introduce security vulnerabilities, and cause mis-operation.

defalutuser and username are current and deprecated names for the same option. Neither is meaningful when the host isn’t dynamic.

This generally looks like copy and paste, as it contains mot of the typical bad practices associated with copying and pasting.

As Joshua has explained, you have no such extension in your default context. In fact, you don’t even seem to have a default context.

This application sounds like cold calling, and whilst I generally don’t give worked solutions, I’m even less likely to do so if I think the application may be cold calling. In any case the dialplan doesn’t do any recording.

what is a cold call

A ‘cold call’ is a call to a person you have no existing relationship with.

Done ‘en masse,’ cold calling can be abusive, intrusive, and illegal.

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