Can't make outbound calls via sip trunk

Hello everyone, i’m running a pbx for my volunteer association.
I set up 2 sip trunks and i can receive call without any problem on both.
The only problem is with outbound calls, on one of the two sip trunk.
I give you and exemple of the problem:
If i dial 0187 (0 is the prefix i set for this outbound rule) (187 is the number i want to dial)
in the sip debug log i see something like:
INVITE sip:187%400661***** @ telecomitalia .it SIP/2.0
Via: SIP/2.0/UDP 79.10.39.203:5160;branch=z9hG4bK44709d8c
Max-Forwards: 70
From: <sip:+390661*****@telecomitalia .it:5160>;tag=as5f3e947a
To: <sip:187%400661*****@telecomitalia .it>
Contact: sip:+390661*****@79.10.39.203:5160
Call-ID: 65512baa5728e5811b87d8ba416ef1a7@telecomitalia .it
CSeq: 102 INVITE
User-Agent: FPBX-13.0.192.19(13.14.0)
Date: Wed, 17 Jan 2018 10:51:44 GMT
in the to header after the number i want to dial asterisk append %40 and my did number.
Anyone can help me please?

Sanitize and post your trunk setup.

Outgoing:

PEER Details
username=+39066*******
type=friend
secret=*****************
qualify=yes
outboundproxy=5.97.116.8
insecure=very
host=telecomitalia.it
fromdomain=telecomitalia.it
fromuser=+39066*************
callreinvite=no

Incoming:

USER Context
+39066************

USER Details
fromuser=+39066*******
host=telecomitalia.it
insecure=very
secret=
type=friend
user=+39066*******
username=+39066******
context=from-pstn-toheader

Register String

+39066******@telecomitalia.it:*:+39066@telecomitalia.it@5.97.116.8:5060

Incoming calls work perfectly, the only problem is with outbound calls.

type=peer

Are you actually using a SIP proxy?

The insecure setting has changed semantics.

Is this host the one that your ITSP is telling you to use? Have you tried with an IP address instead?

You may be able to combine your USER and PEER settings into a single “type=friend” configuration in your OUTGOING settings by combining these configs. The “type=friend” setting means that you are using the same server for both incoming and outgoing services, which is what you configuration appears to be doing. If you do that, you can get rid of the USER section altogether.

If your incoming calls are working, your registration is probably OK. What is failing in your outgoing calls, and what do the logs in /var/log/asterisk/full say about the failing calls?

All the above data (proxy, host, username, secret) is provided by the ISP.
The problem with outbound call is:

 -- Executing [s@macro-dialout-trunk:30] Dial("SIP/2002-00000424", 
"SIP/Telecom/187@06614******,300,T") in new stack

The number i dialed is 187 and the pbx added @0661

This is the section of the macro involved:

exten =>s,n,Dial(${OUT_${DIAL_TRUNK}}/${OUTNUM}${OUT_${DIAL_TRUNK}_SUFFIX},${TRUNK_RING_TIMER},${DIAL_TRUNK_OPTIONS})`

i think the problem is in this variable:
${OUT_${DIAL_TRUNK}_SUFFIX}

I’ve seen this before, and I’m wracking my brain trying to remember the fix. Try an Asterisk restart:

fwconsole restart
1 Like

I can’t understand why, but with that it works! Thank you so much for your help :wink:

1 Like

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