OK, I think the source of my woes is the SIP trunk itself and how it’s configured. It came up in another thread, and I thought I had properly set it up.
I’m almost sure it actually was working, but I must have screwed it up somewhere at some point…
So let’s first see if I can get the sneaky SIP trunk up and running properly now (I find IAX2 to work out of the box, except video support seems to be an issue – but that’s another topic).
On an Asterisk 16 box, I have this pjsip configuration:
================
ASTERISK 16.11.1
================
/etc/asterisk/pjsip_wizard.conf contains:
[trunk_defaults](!)
type = wizard
transport = transport-udp
endpoint/allow_subscribe = no
endpoint/allow = !all,alaw,ulaw,opus,gsm,vp8,h264
aor/qualify_frequency = 30
registration/expiration = 1800
; aor/max_contacts = 1000
[meetbox](trunk_defaults)
sends_auth = no
accepts_auth = no
sends_registrations = no
accepts_registrations = no
remote_hosts = 10.215.147.115
endpoint/context = custom-newsystem
# asterisk -rx "pjsip show endpoint meetbox"
Endpoint: <Endpoint/CID.....................................> <State.....> <Channels.>
I/OAuth: <AuthId/UserName...........................................................>
Aor: <Aor............................................> <MaxContact>
Contact: <Aor/ContactUri..........................> <Hash....> <Status> <RTT(ms)..>
Transport: <TransportId........> <Type> <cos> <tos> <BindAddress..................>
Identify: <Identify/Endpoint.........................................................>
Match: <criteria.........................>
Channel: <ChannelId......................................> <State.....> <Time.....>
Exten: <DialedExten...........> CLCID: <ConnectedLineCID.......>
==========================================================================================
Endpoint: meetbox Not in use 0 of inf
Aor: meetbox 0
Contact: meetbox/sip:10.215.147.115 92e3d71c31 Avail 2.498
Transport: transport-udp udp 0 0 0.0.0.0:5060
Identify: meetbox-identify/meetbox
Match: 10.215.147.115/32
ParameterName : ParameterValue
==================================================================
100rel : yes
@pjsip_wizard : meetbox
accept_multiple_sdp_answers : false
accountcode :
acl :
aggregate_mwi : true
allow : (alaw|ulaw|opus|gsm|vp8|h264)
allow_overlap : true
allow_subscribe : false
allow_transfer : true
aors : meetbox
asymmetric_rtp_codec : false
auth :
bind_rtp_to_media_address : false
bundle : false
call_group :
callerid : <unknown>
callerid_privacy : allowed_not_screened
callerid_tag :
connected_line_method : invite
contact_acl :
context : custom-newsystem
cos_audio : 0
cos_video : 0
device_state_busy_at : 0
direct_media : true
direct_media_glare_mitigation : none
direct_media_method : invite
disable_direct_media_on_nat : false
dtls_auto_generate_cert : No
dtls_ca_file :
dtls_ca_path :
dtls_cert_file :
dtls_cipher :
dtls_fingerprint : SHA-256
dtls_private_key :
dtls_rekey : 0
dtls_setup : active
dtls_verify : No
dtmf_mode : rfc4733
fax_detect : false
fax_detect_timeout : 0
follow_early_media_fork : true
force_avp : false
force_rport : true
from_domain :
from_user :
g726_non_standard : false
ice_support : false
identify_by : username,ip
ignore_183_without_sdp : false
inband_progress : false
incoming_mwi_mailbox :
language :
mailboxes :
max_audio_streams : 1
max_video_streams : 1
media_address :
media_encryption : no
media_encryption_optimistic : false
media_use_received_transport : false
message_context :
moh_passthrough : false
moh_suggest : default
mwi_from_user :
mwi_subscribe_replaces_unsolicited : no
named_call_group :
named_pickup_group :
notify_early_inuse_ringing : false
one_touch_recording : false
outbound_auth :
outbound_proxy :
pickup_group :
preferred_codec_only : false
record_off_feature : automixmon
record_on_feature : automixmon
refer_blind_progress : true
rewrite_contact : false
rpid_immediate : false
rtcp_mux : false
rtp_engine : asterisk
rtp_ipv6 : false
rtp_keepalive : 0
rtp_symmetric : false
rtp_timeout : 0
rtp_timeout_hold : 0
sdp_owner : -
sdp_session : Asterisk
send_connected_line : yes
send_diversion : true
send_pai : false
send_rpid : false
set_var :
srtp_tag_32 : false
sub_min_expiry : 0
subscribe_context :
suppress_q850_reason_headers : false
t38_udptl : false
t38_udptl_ec : none
t38_udptl_ipv6 : false
t38_udptl_maxdatagram : 0
t38_udptl_nat : false
timers : yes
timers_min_se : 90
timers_sess_expires : 1800
tone_zone :
tos_audio : 0
tos_video : 0
transport : transport-udp
trust_connected_line : yes
trust_id_inbound : false
trust_id_outbound : false
use_avpf : false
use_ptime : false
user_eq_phone : false
voicemail_extension :
webrtc : no
On an Asterisk 1.4 box I this chan_sip configuration:
===============
ASTERISK 1.4.31
===============
/etc/asterisk/sip.conf contains:
[meetbox]
disallow=all
type=peer
host=10.215.144.92
insecure=invite
allow=alaw
allow=ulaw
allow=gsm
allow=opus
allow=vp8
allow=h264
context=custom-newsystem
videosupport=yes
qualify=yes
# asterisk -rx "sip show peer meetbox"
* Name : meetbox
Secret : <Not set>
MD5Secret : <Not set>
Context : custom-newsystem
Subscr.Cont. : <Not set>
Language : es
AMA flags : Unknown
Transfer mode: open
CallingPres : Presentation Allowed, Not Screened
Callgroup :
Pickupgroup :
Mailbox :
VM Extension : *97
LastMsgsSent : 32767/65535
Call limit : 0
Dynamic : No
Callerid : "" <>
MaxCallBR : 384 kbps
Expire : -1
Insecure : invite
Nat : RFC3581
ACL : No
T38 pt UDPTL : Yes
CanReinvite : Yes
PromiscRedir : No
User=Phone : No
Video Support: Yes
Trust RPID : No
Send RPID : No
Subscriptions: Yes
Overlap dial : Yes
DTMFmode : rfc2833
LastMsg : 0
ToHost : 10.215.144.92
Addr->IP : 10.215.144.92 Port 5060
Defaddr->IP : 0.0.0.0 Port 0
Reg. exten :
Def. Username: meetbox
SIP Options : (none)
Codecs : 0x20000e (gsm|ulaw|alaw|h264)
Codec Order : (alaw:20,ulaw:20,gsm:20)
Auto-Framing: No
Status : OK (1 ms)
Useragent :
Reg. Contact :
The idea is for endpoints registered to both Asterisk servers to be able to place calls between them.
I assume the SIP trunk is in a “trusted” network and that its authentication is not necessary.
If I place a call from a webrtc client in Asterisk 16 to an extension in Asterisk 1.4, I get an “unknown peer” there.
In Asterisk 16 I run:
Dial(PJSIP/meetbox/sip:${EXTEN}@10.215.147.115,300,tTWg)
I check that the caller ID name and number are set.
On the other side I receive the call in Asterisk 1.4, but it is not properly sent to the right context (ie. custom-newsystem). Instead, it is sent to a context defined in the [general] section of sip.conf.
In the log I see custom messages such as:
NoOp("SIP/10.215.144.92-000014e0", "whatever")
So, why isn’t Asterisk (1.4) matching the [meetbox] SIP context and sending these calls to the [custom-newsystem] dialplan context?
Yes, I know this is quite different to the original post, but I’m sure if I fix this part then I probably will get to the “Wait()” issue again somehow. I can open a new thread though if you think it’s best.
Would a SIP trace be useful here (Ast 1.4)?