Call to Trunk refused

Hello everybody,

I’m new to Asterisk and need to recreate a server we no longer have access to.
The problem is, the Trunk provider doesn’t provide much of help for configuring Asterisk servers.
The last information available is way outdated ; however, for the purpose of finding a solution asap, here’s a short explanation of the setup. We have a bunch of VoIP phones that connect to the Asterisk server which in turn forwards the calls to Maniterm (a french service).

They only have this information available for older SIP based setups (ours is PJSIP):
for the sip.conf:

[general]
srvlookup=no
disallow=all
allow=alaw
nat=yes
rtptimeout=60
directmedia=no
[maniterm]
type=peer
disallow=all
allow=g729
directmedia=no
nat=yes
canreinvite=no
qualify=no
host=185.101.180.190

and for the provided extensions.conf:

[mon_context]
exten => _X.,1,Dial(SIP/maniterm/${EXTEN})

I feeded the old sip.conf into the sip_to_pjsip script and modified it so it can communicate with the trunk server. And it seems to work, here’s the updated configuration as of today:

[general]
srvlookup = no

[maniterm]
qualify = yes

[transport-udp]
type = transport
protocol = udp
bind = 0.0.0.0
external_media_address = 185.98.128.128
external_signaling_address = 185.98.128.128

[maniterm]
type = aor
contact = sip:185.101.180.190
qualify_frequency = 60

[maniterm]
type = identify
endpoint = maniterm
match = 185.101.180.190

[maniterm]
type = endpoint
context = orka-maniterm
disallow = all
allow = alaw,ulaw,g729
rtp_symmetric = yes
rewrite_contact = yes
rtp_timeout = 60
direct_media = no
aors = maniterm

Regarding the updated extensions.conf:

[orka-maniterm]
exten => _X.,1,Dial(PJSIP/maniterm/${EXTEN})

The both parties exchange OPTIONS messages and in the Asterisk console, the pjsip show endpoints command gives me satisfying results:

 Endpoint:  maniterm                                             Not in use    0 of inf
        Aor:  maniterm                                           0
      Contact:  maniterm/sip:185.101.180.190               8d2299a3d7 Avail        16.069
   Identify:  maniterm/maniterm
        Match: 185.101.180.190/32

I added an account for a softphone to test my setup (pjsip.conf):

[1101]
type = endpoint
context = orka-maniterm
disallow = all
allow = alaw,ulaw,g729
auth = 1101
aors = 1101

[1101]
type = auth
auth_type = userpass
password = redactedpassword
username = 1101

[1101]
type = aor
max_contacts = 2

Zoiper registers successful to the Asterisk server, and the pjsip show endpoints gives the following:

 Endpoint:  1101                                                 Not in use    0 of inf
     InAuth:  1101/1101
        Aor:  1101                                               2
      Contact:  1101/sip:1101@80.13.91.34:50227;transport= f6429eacce NonQual         nan

Now when I try to test, I use Zoiper to call a number with the campaign prefix provided by Maniterm (5000) followed by the country prefix and the number, so it becomes this number to call: 500033799009900 (as an example), however it doesn’t succeed:

Executing [500033799009900@orka-maniterm:1] Dial("PJSIP/1101-00000001", "PJSIP/maniterm/500033799009900") in new stack
[Jul 12 15:44:29] ERROR[450]: res_pjsip.c:993 ast_sip_create_dialog_uac: Endpoint 'maniterm': Could not create dialog to invalid URI '500033799009900'.  Is endpoint registered and reachable?
[Jul 12 15:44:29] ERROR[450]: chan_pjsip.c:2698 request: Failed to create outgoing session to endpoint 'maniterm'
[Jul 12 15:44:29] NOTICE[1454][C-00000002]: app_dial.c:2750 dial_exec_full: Unable to create channel of type 'PJSIP' (cause 3 - No route to destination)
  == Everyone is busy/congested at this time (1:0/0/1)
    -- Auto fallthrough, channel 'PJSIP/1101-00000001' status is 'CHANUNAVAIL'

I’m on this problem since 2 days, trying everything…

Can anyone of you give me a hint or an idea to follow?
I’d really appreciate it!

Best regards,
Marc-André

This is not correct for PJSIP[1]. You likely want PJSIP/500033799009900@maniterm

[1] Dialing PJSIP Channels - Asterisk Documentation

1 Like

Something so easy to spot, thank you so much, you made my week!

Best regards!
Marc-André

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