[asterisk-users] PJSIP not performing outbound authentication

TTT lists at telium.io
Wed Jun 21 12:55:12 CDT 2023


I didn't use pjsip_wizard, I'm kind of crafting this by hand as I learn.  I actually have a plain asterisk, and a FreePBX, system to help me learn.  I sometimes create something in FreePBX to see what it does to the config files.  So that's how I modelled my pjsip.X.conf files

If I issue the command "pjsip show endpoint Twilio" it does show that outbound_auth=Twilio

Does that mean the initial invite will contain authentication info?  Or does Asterisk still wait for a 407??  (I'm wondering if maybe Asterisk is working normally, this is a Twilio config problem).  And I confirmed the CID info matches an account on Twilio, so it's not that.

-----Original Message-----
From: asterisk-users [mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Henning Follmann
Sent: Wednesday, June 21, 2023 1:31 PM
To: asterisk-users at lists.digium.com
Subject: Re: [asterisk-users] PJSIP not performing outbound authentication

On Wed, Jun 21, 2023 at 05:19:11PM +0000, TTT wrote:
> I am using Asterisk 20.3.0 with PJSIP.  I have setup a trunk to my ISP
> (Twilio) who requires outbound authentication.  My pjsip.auth.conf contains:
> 
> [Twilio]
> type=auth
> auth_type=userpass
> password=mysecret
> username=myun
> 
> However, my calls using the trunk are rejected with a 403. Using pjsip 
> logging I notice that the outgoing invite does not have an 
> authentication line. Why is Asterisk not sending credentials to the 
> ISP? SIP transactions
> are:
>  > INVITE
>  < 100 TRYING
>  < 403 FORBIDDEN
> 
> Or is this normal?  Must Twilio respond with a 407 which will cause 
> Asterisk to authenticate?
> 
> 


Twilio has a nice technical document to setup a trunk with PJSIP.
It includes an example for a pjsip_wizard.conf https://assets.cdn.prod.twilio.com/documents/TwilioElasticSIPTrunking-AsteriskPBX-Configuration-Guide-Version2-1-FINAL-09012018.pdf

Maybe that helps.

And make sure for your outgoing calls to set the callerid to a valid caller Id which ist authorized with your twilio account. It will not allow outgoing calls if the number is not recognized by twilio

-H


-- 
Henning Follmann           | hfollmann at itcfollmann.com


--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
      https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users




More information about the asterisk-users mailing list