Solved

(Asterisk / Trixbox) connect OpenSIPS

Posted on 2009-05-17
8
1,833 Views
Last Modified: 2013-12-21
I need settings my SIP server(OpenSIPS) can be make the outbound call to PSTN network via Asterisk Gateway
How to configure the Asterisk and OpenSIPS?

Many Thanks
0
Comment
Question by:ycTIN
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
8 Comments
 
LVL 9

Expert Comment

by:michofreiha
ID: 24407318
Dear Sir,

You are asking for a BIG question here and cannot help you like that..You should begin working on the installation and the configuration and let us know about issues that you are facing

Regards
0
 
LVL 7

Author Comment

by:ycTIN
ID: 24408573
Hi michofreiha,

Thanks for your reply, my case is i has build up two server OpenSIPS and Asterisk(Trixbox), and they are working fine.

I known need settings some  route between OpenSIPS and Asterisk , but in google i only found the out dated information about OpenSER.

Best Regards,
ycTIN
0
 
LVL 9

Expert Comment

by:michofreiha
ID: 24409816
Dear Sir,

Are you making any kind of load balancing between OpenSIPS servers and asterisk?Mean are you using carrierroute module for example on OpenSIPS?

regards
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 7

Author Comment

by:ycTIN
ID: 24409975
No, i only need forward the call to PSTN network.

I don't care the performance and steps, because this just for study


SIP Phone <--> OpenSIPS <--> Asterisk <--> PSTN

SIP Phone connected in OpenSIPS,
make outbound call to PSTN via Asterisk
0
 
LVL 19

Accepted Solution

by:
feptias earned 250 total points
ID: 24413436
Perhaps the answer is something like this (this is for guidance only and is well short of being a complete script):

if (method=="INVITE") {
    rewritehost("<ip_of_asterisk>");
    if (!t_relay()) {
        sl_reply_error();
    };
};

Before accepting the INVITE, you may want to authenticate the calling device using functions such as proxy_authorize and proxy_challenge.

You just need to configure Asterisk like this:
In sip.conf set a default context or specify the context for all calls from the OpenSIPS host address by defining a SIP peer with the correct values for context= and host=.
In extensions.conf, define a section for that context and put steps as follows (this is just an example):
[mycontext]
exten => _0.,1,Dial(DAHDI/g1/${EXTEN},30)

To explain:
_0. will accept any number starting with zero; You can use whatever pattern is needed for your PSTN target numbers. Another example would be _X. which would accept any dialled number. Dial(DAHDI/g1/${EXTEN} will place a call on a free channel in the first DAHDI group. Use Dial(ZAP/g1/${EXTEN} if you are using Zap drivers.
0
 
LVL 9

Expert Comment

by:michofreiha
ID: 24414436
Do you need to match any prefix before sending call to asterisk server or you need to route all numbers to asterisk without checking the prefix?
0
 
LVL 7

Author Comment

by:ycTIN
ID: 24437650
@feptias: many thanks for your reply and clear answer, i will try this late.

@michofreiha: my first goal is can forward the call, if can filter the prefix like PBX is perfect
0
 
LVL 9

Assisted Solution

by:michofreiha
michofreiha earned 250 total points
ID: 24439719
You can use something like the following:
First you should scan the prefix if you have one like all numbers that begin with 00 as follow:

if($rU =~ "^00.*")
{
route(8);
exit;

}

route[8]
{
sethostport("Asterisk_IP");
        record_route();
            append_hf("P-hint: outbound\r\n");
             
}
0

Featured Post

Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Skype for Business 10 91
Using an ASA5505 as a multicast router 2 76
FreePBX Asterisk Cisco ATA-187 Unable to make calls 9 174
Skype for Business - SIP/PSTN Trunk Configuration 38 101
In my office we had 10 Cisco 7940G IP phones that were useless as they were showing PROTOCOL APPLICATION INVALID when started. I searched through Google and worked for a week continuously on those phones, and finally got them working. This is a di…
Article by: user_n
How Sip Phone (User Agent) works and communicates with sip servers 1.  There is a sip server and a sip registrar.  The sip server and sip registrar can be one server or two different servers. The sip registrar is the server on which it is record…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question