DevSnippets

Home » FreeSWITCH » FreeSWITCH Gateway with Username/Password Authentication (Registered SIP Trunk)

FreeSWITCH Gateway with Username/Password Authentication (Registered SIP Trunk)

FreeSWITCH Username/Password-Based Authentication Gateway 11 views

Code

Example Config: sofia/profile/external/gateway/userauth.xml

<gateway name="userauth">
  <param name="username" value="your_sip_username"/>
  <param name="password" value="your_sip_password"/>
  <param name="from-user" value="your_sip_username"/>
  <param name="from-domain" value="provider.com"/>
  <param name="proxy" value="provider.com"/>
  <param name="register" value="true"/>
  <param name="retry-seconds" value="30"/>
</gateway>

✅ Enable and Reload
After saving gateway file in /etc/freeswitch/sip_profiles/external/:

Check syntax:
fs_cli -x "reloadxml"

Reload the SIP profile:
fs_cli -x "reload mod_sofia"

Check gateway status:
fs_cli -x "sofia status gateway userauth"

Explanation

Use this on the external profile.

This FreeSWITCH gateway configuration sets up a registered SIP trunk using username and password authentication. Suitable for connecting to VoIP providers that require SIP registration and credentials. The gateway handles automatic re-registration and outbound call routing.

Rate this snippet

Click to rate

Related Snippets

Have a Better Solution?

Know a more efficient way to solve this problem? Share your own code snippet and help the community!

Submit Your Version