{"id":920,"date":"2024-02-15T14:49:03","date_gmt":"2024-02-15T13:49:03","guid":{"rendered":"https:\/\/www.homeserver.lu\/?p=920"},"modified":"2024-06-05T22:00:54","modified_gmt":"2024-06-05T20:00:54","slug":"define-a-sip-trunk-in-freepbx","status":"publish","type":"post","link":"https:\/\/www.homeserver.lu\/?p=920","title":{"rendered":"Define a SIP trunk in FreePBX"},"content":{"rendered":"\n<p>Go to the <em>Connectivity<\/em> menu, <em>Trunks<\/em> submenu. Click <em>Add trunk<\/em>. Add a S<em>IP (chan_pjsip) Trunk<\/em>. <\/p>\n\n\n\n<p>Define a <em>Trunk Name<\/em> and an <em>Outbound CallerID<\/em>.<\/p>\n\n\n\n<p>Define the <em>Dialed Number Manipulation Rules<\/em> which defines what numbers can be called. Be careful which number structures you allow, as some numbers might become very expensive.<\/p>\n\n\n\n<p>In the <em>pjsip Settings <\/em>under <em>General<\/em>, fill out the <em>Username<\/em>, the <em>Auth username<\/em>, the <em>Secret<\/em> and the <em>SIP Server<\/em>. These information should have been given to you by your VoIP provider. The <em>SIP Server port <\/em>is mostly 5060. <em>Authentication<\/em> should be set to <em>Outbound<\/em>. If your external SIP server has a fixed IP or hostname (and you are on a public dynamic IP), then <em>Registration<\/em> should be set to <em>Send<\/em>.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"632\" src=\"https:\/\/www.homeserver.lu\/wp-content\/uploads\/2024\/02\/Trunk-1-1024x632.png\" alt=\"\" class=\"wp-image-926\" srcset=\"https:\/\/www.homeserver.lu\/wp-content\/uploads\/2024\/02\/Trunk-1-1024x632.png 1024w, https:\/\/www.homeserver.lu\/wp-content\/uploads\/2024\/02\/Trunk-1-300x185.png 300w, https:\/\/www.homeserver.lu\/wp-content\/uploads\/2024\/02\/Trunk-1-768x474.png 768w, https:\/\/www.homeserver.lu\/wp-content\/uploads\/2024\/02\/Trunk-1-1536x948.png 1536w, https:\/\/www.homeserver.lu\/wp-content\/uploads\/2024\/02\/Trunk-1-2048x1265.png 2048w, https:\/\/www.homeserver.lu\/wp-content\/uploads\/2024\/02\/Trunk-1-624x385.png 624w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">SIP Trunk configuration<\/figcaption><\/figure>\n\n\n\n<p>I also filled out the advanced tab information for <em>Contact User<\/em>, <em>From Domain<\/em> and <em>From User<\/em>. Not sure if this is absolutely necessary, but as iI was experimenting a lot to get things going, it is filled out in my case.<\/p>\n\n\n\n<p>When you are done, hit <em>Submit<\/em> and <em>Apply config<\/em>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Configure the SIP settings<\/h2>\n\n\n\n<p>Go to the <em>Settings<\/em> menu, <em>Asterisk SIP settings<\/em> submenu. Go to the <em>General SIP Settings<\/em> tab.<\/p>\n\n\n\n<p>For maximum security, disallow <em>Anonymous Inbound SIP calls<\/em> &amp; <em>SIP Guests<\/em>.<\/p>\n\n\n\n<p>In the NAT settings, enter your <strong>static<\/strong> WAN IP or your <strong>dynamic DNS<\/strong> name.<\/p>\n\n\n\n<p>Optional: In the <em>Audio codecs<\/em>, move the <em>ulaw<\/em> codec to the top of the list.<\/p>\n\n\n\n<p>Now go to the <em>SIP Settings [chan_pjsip]<\/em> tab.<\/p>\n\n\n\n<p><em>udp &#8211; 0.0.0.0. &#8211; All<\/em> should be enabled.<\/p>\n\n\n\n<p><em>0.0.0.0 (udp) Port to Listen On<\/em>: 5060.<\/p>\n\n\n\n<p>Submit and apply these changes. Restart the Asterisk service using the following command in the <em>Admin<\/em> menu, <em>Asterisk CLI<\/em> submenu:<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code>core restart now<\/code><\/pre><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Go to the Connectivity menu, Trunks submenu. Click Add trunk. Add a SIP (chan_pjsip) Trunk. Define a Trunk Name and an Outbound CallerID. Define the Dialed Number Manipulation Rules which defines what numbers can be called. Be careful which number structures you allow, as some numbers might become very expensive. In the pjsip Settings under [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[40],"tags":[],"class_list":["post-920","post","type-post","status-publish","format-standard","hentry","category-freepbx"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.homeserver.lu\/index.php?rest_route=\/wp\/v2\/posts\/920","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.homeserver.lu\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.homeserver.lu\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.homeserver.lu\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.homeserver.lu\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=920"}],"version-history":[{"count":13,"href":"https:\/\/www.homeserver.lu\/index.php?rest_route=\/wp\/v2\/posts\/920\/revisions"}],"predecessor-version":[{"id":1053,"href":"https:\/\/www.homeserver.lu\/index.php?rest_route=\/wp\/v2\/posts\/920\/revisions\/1053"}],"wp:attachment":[{"href":"https:\/\/www.homeserver.lu\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=920"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.homeserver.lu\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=920"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.homeserver.lu\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=920"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}