[deleted the other topic by mistake, not sure what happened there, sorry for the noise]
Hi,
I am running Asterisk 20.6 with PJSIP on a Docker container and have managed to set it up such that incoming calls are correctly answered using an SBC, where port 5740 has been reserved for me and SBC_HOST_1 is the domain of the SBC which is passed as an environment variable. Now I would like to use call files for outgoing calls. Here is what the relevant part of my pjsip.conf looks like (I am using TLS for transport, this part works for incoming calls and OPTIONS):
[global]
type=global
user_agent=Asterisk
[my-sbc1]
type=endpoint
context=sip-incoming-sbc1
disallow=all
allow=ulaw
allow=alaw
allow=g722
aors=my-sbc1
media_encryption=sdes
media_encryption_optimistic=yes
transport=transport-tls
direct_media=no
dtmf_mode=rfc4733
rtp_symmetric=yes
[my-sbc1]
type=aor
contact=sip:${SBC_HOST_1}:5740
qualify_frequency=30
[my-sbc1]
type=identify
endpoint=my-sbc1
match=${SBC_HOST_1}
srv_lookups=no
My call file looks as follows, where I am trying to call the number +1234567890 and want to use the number +987654321 for the call:
Channel: PJSIP/my-sbc1/sip:+1234567890
Callerid: +987654321
WaitTime: 60
Context: sip-outgoing
Extension: 54321
Priority: 1
And here is my extensions.conf for sip-outgoing, where I am trying to execute a script named my_file.agi using AGI:
[sip-outgoing]
exten => _X.,1,AGI(my_file.agi)
When I do this, I get the following in my logs:
VERBOSE[825][C-00000002]: pbx.c:4439 __ast_pbx_run: Spawn extension (sip-incoming-sbc1, +987654321, 2) exited non-zero on 'PJSIP/my-sbc1-00000001'
VERBOSE[831]: pbx_spool.c:442 attempt_thread: Attempting call on PJSIP/my-sbc1/sip:+1234567890 for 54321@sip-outgoing:1 (Retry 1)
VERBOSE[831]: dial.c:474 begin_dial_channel: Called my-sbc1/sip:+1234567890
NOTICE[831]: pbx_spool.c:450 attempt_thread: Call failed to go through, reason (0) Call Failure (not BUSY, and not NO_ANSWER, maybe Circuit busy or down?)
What could be the cause of this? Is this something that can be fixed within Asterisk itself, or is something that comes from the provider? Since I am new to Asterisk and VoIP in general, I may have some conceptual gaps - any pointers in the right direction are appreciated.