[OpenSIPS-Users] Opensips integration with asterisk

Alexey Kazantsev kurgan-rus at inbox.ru
Mon Aug 19 06:08:45 EDT 2019


Hi John!

>i am trying for some time now to integrate Opensips with Asterisk,
> but without success. I have seen the links to the Opensips blog for
> Asterisk integration, but it is outdated both for Opensips and Opensips.

Well, what confused you in this tutorial? It seems to be what you need:
https://www.opensips.org/Documentation/Tutorials#toc18

>What i am trying to achieve is a box running Opensips with control panel 
>and another box with Asterisk. The reason for that is to enhance the users
>with services such as IVR, Voicemail, email to voicemail, faxing,....etc

>Up to now i managed to create users in Opensips and register on that. 
>Also they are able to make calls between them. 

You've written that you don't see such calls on the Asterisk.
It means that you don't route such calls from OpenSIPS to Asterisk.
Check this.

>The numbering plan is 30XX and the port on the system is 5060.
>Then i have another box with Asterisk that has the port as 55060
>and the numbering plan is 30XX

Well.. OK, let it be so.

>and every time a user is created in Opensip's CP
>then i create the same user in Asterisk,
>eg Opensips 3000(port 5060) and Asterisk 3000(port 55060).

But why?! You don't need this. Create SIP accounts either in OpenSIPS,
or in Asterisk.

>Then on the Asterisk box i made the following:
>Created a trunk to Opensips 
>
>[Opensips]
>type=peer
>host=192.168.1.113
>context=from-opensips
>insecure=port,invite
>disallow=all
>allow=alaw, g729, g722, ulaw
>deny= 0.0.0.0/0.0.0.0
>permit= 192.168.1.113/255.255.255.255
>
>
>The problem is that i cannot see the call in Asterisk's terminal when 2 users call each other. 

As I already wrote, it means that the call does not leave OpenSIPS.
I guess you don't route it to Asterisk with smth like this:

   ...
   t_relay(x.x.x.x);   # Asterisk's IP
   ...

>Also , i have a couple of ITSPs in Asterisk that require username/passwd and thet have a FQDN.

If you'd like to use OpenSIPS as the front-end, you'd better connect to ITSPs also from OpenSIPS.
In case of SIP-registration,
use UAC_REGISTRANT https://opensips.org/html/docs/modules/3.0.x/uac_registrant.html module.
In case of SIP trunks just be able to receive SIP traffic from them and control access to your OpenSIPS 
public IP via iptables or PERMISSIONS module https://opensips.org/html/docs/modules/3.0.x/permissions.html.

>While in Asterisk registered the user can access the first ITSP with the following prefixes 0 and 1 respectively.
>Is there any way to allow the Opensips registered users dial 0 or 1 as prefix and place outgoing calls through ITSP 0 or 1, please?

OpenSIPS is _extremely_ flexible.
This could be achieved in many ways, starting from hardcoding in the script (in case of static configuration
without need of changing it often) and ending with appropriate modules using, such as
DROUTING https://opensips.org/html/docs/modules/3.0.x/drouting.html


-----------------------------------------------
BR, Alexey
http://alexeyka.zantsev.com/


More information about the Users mailing list