Dial from Asterisk (pstn) to opensips users

hi
i installed asterisk and opensips on a same server my opensips server is listening on 5060 and my asterisk server is listening on 6060 . i want route dial from pstn incoming in asterisk to sip users in opensips i change my sip.conf and extension.conf like this:

[general]
bindport=6060
register => 15554551337:123@192.168.1.100:5060
[opensips]
type=friend
secret=123
username=15554551337
host=192.168.1.100
dtmfmode=rfc2833
canreinvite=no
disallow=all
allow=ulaw
allow=alaw
allow=gsm
insecure=port,invite
fromdomain=192.168.1.100

[routDial]
exten => _X.,1,Dial(SIP/opensips/${EXTEN},60,r)

but it didn’t work :frowning: please help me whay doesnt it work and how do i fix it?

Is there any reason not to use type=peer and a static host name, thus eliminating the password, and the insecure? That shuld simplify the problem.

Why do you have insecure=port? Very few people need it.

canreinvite is a deprecated name for directmedia.

If you expect actual debugging, you need to provide some trace output that demonstrates a problem.

tnx david no there is not any reason i only want have connection between pstn user and sip users in opensips server According to You i change it like this:

[general]
bindport=6060
register => 15554551337@192.168.1.100:5060

[opensips]
type=peer
username=15554551337
outboundproxy=192.168.1.100:5060
transport=udp,tcp

[routDial]
exten => _X.,1,Dial(SIP/opensips/${EXTEN},60,r)

but i have problem yet and i think dosent send any invite pkt to opensips from asterisk server!! its my cli trace :

– Executing [6565@routDial:1] Dial(“SIP/192.168.1.100-0000000d”, “SIP/opensips/6565,60,r”) in new stack
[Jan 23 12:18:35] WARNING[8261][C-0000000e]: app_dial.c:2433 dial_exec_full: Unable to create channel of type ‘SIP’ (cause 20 - Subscriber absent)
== Everyone is busy/congested at this time (1:0/0/1)

– Executing [6565@routDial:2] Hangup(“SIP/192.168.1.100-0000000d”, “”) in new stack
== Spawn extension (routDial, 6565, 2) exited non-zero on ‘SIP/192.168.1.100-0000000d’

Can you show the output of the following command on both servers to see if the opensips and the asterisk see each other

sip show peers

in asterisk:
*CLI> sip show peers
Name/username Host Dyn Forcerport ACL Port Status Description
88002/88002 (Unspecified) D a 0 Unmonitored
opensips/15554551337 (Unspecified) N 0 Unmonitored
2 sip peers [Monitored: 0 online, 0 offline Unmonitored: 0 online, 2 offline]

in opensips:
[root@Naji2 ~]# opensipsctl online
6565
8006

tnx tomdemoor
According to you i create the same opensip user in asterisk server but dosent solve my problem :frowning:

Naji2*CLI> sip show peers
Name/username Host Dyn Forcerport ACL Port Status Description
88002/88002 (Unspecified) D a 0 Unmonitored
opensips/15554551337 (Unspecified) N 0 Unmonitored
2 sip peers [Monitored: 0 online, 0 offline Unmonitored: 0 online, 2 offline]

[root@Naji2 ~]# opensipsctl online
8006
88002
[root@Naji2 ~]#

and my cli trace is :
– Executing [88002@opensipsincoming:1] Dial(“SIP/88002-00000016”, “SIP/88002,60,r”) in new stack
Really destroying SIP dialog ‘091bdb317cdaf1aa71ac07bc0207545b@127.0.0.1:6060’ Method: INVITE
[Jan 23 14:04:36] WARNING[10284][C-00000017]: app_dial.c:2433 dial_exec_full: Unable to create channel of type ‘SIP’ (cause 20 - Subscriber absent)
== Everyone is busy/congested at this time (1:0/0/1)

– Executing [88002@opensipsincoming:2] Hangup(“SIP/88002-00000016”, “”) in new stack