Can't register/connect to an iQsim CR250 Gateway device

Good day everyone,
I am having a bit of a problem executing outbound calls from my FreePBX/Asterisk server to a mobile phone (for test purpouses I am using my own phone number, at this time) using an iQsim CR250 device. The device contains two working SIM cards whose Network connectivity was tested sending an SMS through an http request.
In order to communicate with the devide, I created a SIP trunk from my FreePBX server and I am using a softphone conntected to my PBX server to make the calls. The call starts, but my mobile phone never rings and, after a while, it stops giving out a warning “app_dial.c: Unable to create channel of type ‘SIP’ (cause 20 - Subscriber absent)”. I checked to see if I had any sip registered and it doesn’t look like it, although the peers I have are the following:

Name/username             Host                                    Dyn Forcerport Comedia    ACL Port     Status      Description
101/101                   xxx.xxx.xxx.xxx                           D  Yes        Yes         A  32569    OK (3 ms)
sip-trunk/administrator   yyy.yyy.yyy.yyy                              Yes        Yes            5160     UNREACHABLE
2 sip peers [Monitored: 1 online, 1 offline Unmonitored: 0 online, 0 offline]

where the first is my softphone (xxx.xxx.xxx.xxx is the IP of my FreeBPX server) and the second one is the trunk I created to connect to the devide (yyy.yyy.yyy.yyy is the IP address).
The return for sip show registry is

Host                                    dnsmgr Username       Refresh State                Reg.Time
0 SIP registrations.

My sip.conf file is as follows:

[101] //softphone
deny=0.0.0.0/0.0.0.0
secret=seletech
dtmfmode=rfc2833
canreinvite=no
context=outbound
host=dynamic
defaultuser=
trustrpid=yes
user_eq_phone=no
sendrpid=pai
type=peer
session-timers=accept
nat=force_rport,comedia
port=5160
qualify=yes
qualifyfreq=60
transport=udp
avpf=no
force_avp=no
icesupport=no
rtcp_mux=no
encryption=no
namedcallgroup=
namedpickupgroup=
dial=SIP/101
accountcode=
permit=0.0.0.0/0.0.0.0
callerid=A6 <101>
recordonfeature=apprecord
recordofffeature=apprecord
callcounter=yes
faxdetect=no



[sip-trunk] //trunk
disallow=all
type=peer
host=yyy.yyy.yyy.yyy
username=usr
secret=psw
fromuser=usr
port=5160
qualify=yes
dtmfmode=rfc2833
canreinvite=no
allow=ulaw
allow=alaw
allow=gsm
insecure=port,invite
fromdomain=yyy.yyy.yyy.yyy
register=> usr:[email protected]:5160
context=from-trunk-sip-sip-trunk

The dialplan I am using is:

[outbound]
exten => _X.,1,Dial(SIP/sip-trunk/${ESTEN})

Does anyone know how to connect to a device like this one? Which username and passwrd should I use? At hte moment I am using the ones needed to acces the configuration, but I also tried with the login and password of one of the users I created on the device configuration. I also turned on the sip debugging and I will leave the result below.

VERBOSE[2536] chan_sip.c: Reliably Transmitting (NAT) to yyy.yyy.yyy.yyy:5160:	
21403	OPTIONS sip:yyy.yyy.yyy.yyy SIP/2.0	
21404	Via: SIP/2.0/UDP xxx.xxx.xxx.xxx:5160;branch=z9hG4bK36931901;rport	
21405	Max-Forwards: 70	
21406	From: "Unknown" <sip:[email protected]:5160>;tag=as274bd0bc	
21407	To: <sip:yyy.yyy.yyy.yyy>	
21408	Contact: <sip:[email protected]:5160>	
21409	Call-ID: [email protected]:5160	
21410	CSeq: 102 OPTIONS	
21411	User-Agent: FPBX-15.0.17.55(16.17.0)	
21412	Date: Wed, 10 Nov 2021 10:15:28 GMT	
21413	Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE	
21414	Supported: replaces, timer	
21415	Content-Length: 0	
21416		
21417		
21418	---	
21419	[2021-11-10 10:15:29] VERBOSE[2536] chan_sip.c: Retransmitting #1 (NAT) to yyy.yyy.yyy.yyy:5160:	
21420	OPTIONS sip:yyy.yyy.yyy.yyy SIP/2.0	
21421	Via: SIP/2.0/UDP xxx.xxx.xxx.xxx:5160;branch=z9hG4bK36931901;rport	
21422	Max-Forwards: 70	
21423	From: "Unknown" <sip:[email protected]:5160>;tag=as274bd0bc	
21424	To: <sipyyy.yyy.yyy.yyy>	
21425	Contact: <sip:[email protected]:5160>	
21426	Call-ID: [email protected]:5160	
21427	CSeq: 102 OPTIONS	
21428	User-Agent: FPBX-15.0.17.55(16.17.0)	
21429	Date: Wed, 10 Nov 2021 10:15:28 GMT	
21430	Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE	
21431	Supported: replaces, timer	
21432	Content-Length: 0	
21433		
21434		
21435	---	
21436	[2021-11-10 10:15:30] VERBOSE[2536] chan_sip.c: Retransmitting #2 (NAT) to yyy.yyy.yyy.yyy:5160:	
21437	OPTIONS sip:yyy.yyy.yyy.yyy SIP/2.0	
21438	Via: SIP/2.0/UDP xxx.xxx.xxx.xxx:5160;branch=z9hG4bK36931901;rport	
21439	Max-Forwards: 70	
21440	From: "Unknown" <sip:[email protected]:5160>;tag=as274bd0bc	
21441	To: <sip:yyy.yyy.yyy.yyy>	
21442	Contact: <sip:[email protected]:5160>	
21443	Call-ID: [email protected]:5160	
21444	CSeq: 102 OPTIONS	
21445	User-Agent: FPBX-15.0.17.55(16.17.0)	
21446	Date: Wed, 10 Nov 2021 10:15:28 GMT	
21447	Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE	
21448	Supported: replaces, timer	
21449	Content-Length: 0	
21450		
21451		
21452	---	
21453	[2021-11-10 10:15:31] VERBOSE[2536] chan_sip.c: Retransmitting #3 (NAT) to yyy.yyy.yyy.yyy:5160:	
21454	OPTIONS sip:yyy.yyy.yyy.yyy SIP/2.0	
21455	Via: SIP/2.0/UDP xxx.xxx.xxx.xxx:5160;branch=z9hG4bK36931901;rport	
21456	Max-Forwards: 70	
21457	From: "Unknown" <sip:[email protected]:5160>;tag=as274bd0bc	
21458	To: <sip:yyy.yyy.yyy.yyy>	
21459	Contact: <sip:[email protected]:5160>	
21460	Call-ID: [email protected]:5160	
21461	CSeq: 102 OPTIONS	
21462	User-Agent: FPBX-15.0.17.55(16.17.0)	
21463	Date: Wed, 10 Nov 2021 10:15:28 GMT	
21464	Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE	
21465	Supported: replaces, timer	
21466	Content-Length: 0	
21467		
21468		
21469	---	
21470	[2021-11-10 10:15:32] VERBOSE[2536] chan_sip.c: Retransmitting #4 (NAT) to yyy.yyy.yyy.yyy:5160:	
21471	OPTIONS sip:yyy.yyy.yyy.yyy SIP/2.0	
21472	Via: SIP/2.0/UDP xxx.xxx.xxx.xxx:5160;branch=z9hG4bK36931901;rport	
21473	Max-Forwards: 70	
21474	From: "Unknown" <sip:[email protected]:5160>;tag=as274bd0bc	
21475	To: <sip:yyy.yyy.yyy.yyy>	
21476	Contact: <sip:[email protected]:5160>	
21477	Call-ID: [email protected]:5160	
21478	CSeq: 102 OPTIONS	
21479	User-Agent: FPBX-15.0.17.55(16.17.0)	
21480	Date: Wed, 10 Nov 2021 10:15:28 GMT	
21481	Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE	
21482	Supported: replaces, timer	
21483	Content-Length: 0	
21484		
21485		
21486	---	
21487	[2021-11-10 10:15:32] VERBOSE[2536] chan_sip.c: Really destroying SIP dialog '[email protected]:5160' Method: OPTIONS	
21488	[2021-11-10 10:15:42] VERBOSE[2536] chan_sip.c: Reliably Transmitting (NAT) to 10.182.233.232:5160:	
21489	OPTIONS sip:yyy.yyy.yyy.yyy SIP/2.0	
21490	Via: SIP/2.0/UDP xxx.xxx.xxx.xxx:5160;branch=z9hG4bK10aa98d0;rport	
21491	Max-Forwards: 70	
21492	From: "Unknown" <sip:[email protected]:5160>;tag=as59ccdad0	
21493	To: <sip:yyy.yyy.yyy.yyy>	
21494	Contact: <sip:[email protected]:5160>	
21495	Call-ID: [email protected]:5160	
21496	CSeq: 102 OPTIONS	
21497	User-Agent: FPBX-15.0.17.55(16.17.0)	
21498	Date: Wed, 10 Nov 2021 10:15:42 GMT	
21499	Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE	
21500	Supported: replaces, timer	
21501	Content-Length: 0

Where xxx.xxx.xxx.xxx = PBX IP and yyy.yyy.yyy.yyy = GATEWAY IP

Can anyone help me figure out why I don’t seem to be able to connect to my gateway?

Is this a FreePBX system? Normally, the data you posted would be in sip_additional.conf.
If not, please post on the appropriate Asterisk or other forum.
If so, post FreePBX and Asterisk version, and if not from the Distro, how installed.

Unless you modified the configuration of the CR250, it would not be listening on that port.

I know nothing about the iQsim device, but similar devices are not SIP servers. You can configure them statically, or have the device register to Asterisk, but it’s usually not possible for Asterisk to register to the device.

This was originally posted to https://community.asterisk.org/t/cant-register-connect-to-an-iqsim-cr250-gateway-device/90566 but the OP mentions FreePBX and also says he has no access to the general section, and also referred to SIP trunks (a FreePBX abstraction), all of which tended to confirm a FreePBX system.

As pointed out there, register isn’t allowed in a peer section; it has to be in the general section.

I took the OP’s word for it on the port number and need for registration. As I understand it, FreePBX isn’t really designed for receiving registrations from “trunks”; the OP may have assumed that registration must be outgoing as that is the normal way of handling provider trunks.

A wrong port number would certainly explain why they are not even getting 403 or 503 back from the OPTIONS.

The Asterisk forum thread also established that the Dial line isn’t the one actually used, which had a literal PSTN number, not ${ESTEN} (sic).

The versions are
FreePBX: 15.0.17.55
Asterisk: 16.20.0
The lines I posted were in the sip_additional.conf, not in the sip.conf.

I did modify the port in the configuration of the device, but I was hoping to be able to do this with a PJSIP trunk. Unfortunately I was informad that the device only takes in SIP trunks, although I am not sure if it would still work wth a PJSIP (I would assume so, but I have very limited info regarding the device).

The point is that it is possible to define a SIP trunk from the device, but I am not sure if it needs to connect to asterisk or not: do I need to define one trunk from my asterisk server to the gateway and one from the gateway to asterisk in which I register the device? I always assumed the registration was the other way around, but I guess it makes sense, since this is not a SIP server…

I am reasonably sure the port is correct, but I will review all the settings, in case I missed something!

Most of the time when people are told this it is wrong. SIP should be SIP whichever driver is used.

If the device is at all sensible, you should only need one bidirectional trunk. Ideally neither side will need to register, if you have static addresses at both ends.

I only need to be able to make calls, I don’t want to receive them. What is really confusing for me at this point is that the device has no proxy for authentication, so even creating a SIP endpoint to connect to, I am confued on how I am supposed to adress it (I tried with another router at home, and I was able to connect through a trunk to the voip I created on the device using username and password). Do you have any idea how I would be able to connect asterisk to something which dieasn’t have username and password? I tried leaving them blanck, but it doesn’t work.

    Name/username             Host                                    Dyn Forcerport Comedia    ACL Port     Status      Description
    gate-sip/user             yyy.yyy.yyy.yyy                              Yes        Yes            5060     UNREACHABLE
    5 sip peers [Monitored: 0 online, 5 offline Unmonitored: 0 online, 0 offline]