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;branch=z9hG4bK44709d8c
Max-Forwards: 70
From: <sip:+390661*****@telecomitalia .it:5160>;tag=as5f3e947a
To: <sip:187%400661*****@telecomitalia .it>
Contact: sip:+390661*****@
Call-ID: [email protected] .it
CSeq: 102 INVITE
User-Agent: FPBX-
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.


PEER Details


USER Context

USER Details

Register String


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


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 [[email protected]:30] Dial("SIP/2002-00000424", 
"SIP/Telecom/[email protected]******,300,T") in new stack

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

This is the section of the macro involved:


i think the problem is in this variable:

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.