[OpenSIPS-Users] Interaction between OpenSIPS as UAC and real UAC

Александр Пучков mailex at poig.ru
Mon Mar 24 12:57:56 CET 2014


A few words about the structure of my network.

I have a very simple structure:

UAC <---> OpenSIPS <---> PSTN

This allows a regular customer to make and receive calls.
I want to provide SOME customers extended service using an asterisk, for 
example - voicemail.

At the moment, I found a way out for these customers (with extended 
service) :

UAC <---> OpenSIPS <---> ASTERISK <---> PSTN

Accordingly , customers (UAC), which should go to the PSTN through 
Asterisk listed in the group "asterisk".

An important point: OpenSIPS must be registered as UAC on how asterisk 
extension, otherwise the service will not be extended to provide.
Also, much easier to make the user to the "asterisk" group, than tweak 
its SIP-client.

In order to do this I used the module "uac_registrant", it allows you to 
register as OpenSIPS to UAC asterisk.

With it, I can make a call :

UAC <--- OpenSIPS <--- ASTERISK <--- PSTN

But such a call can not do :

UAC ---> OpenSIPS ---> ASTERISK ---> PSTN

I tried using topology_hiding () and match_dialog (),

but it does not forward the request "ACK" from OpenSIPS to Asterisk .

24.03.2014 14:50, Bogdan-Andrei Iancu пишет:
> Hello,
>
> Script-wise, what are you trying to do right now by the 
> db_is_user_in() ? If you explain the actual idea you try to implement, 
> I can guide you with the script.
>
> So, when comes to the incoming REGISTER, what you want to change now ?
>
> Regards,
> Bogdan-Andrei Iancu
> OpenSIPS Founder and Developer
> http://www.opensips-solutions.com
> On 21.03.2014 10:37, Александр Пучков wrote:
>> 11.02.2014 19:44, Bogdan-Andrei Iancu пишет:
>>> Hello,
>>>
>>> Please keep the list CC'ed all the time !
>>>
>>> You did no inserted the topo hiding triggering in the write place - 
>>> you need to do it only for initial INVITEs ; for sequential requests 
>>> you need the be sure to invoke the match_dialog() function. See:
>>> http://www.opensips.org/html/docs/modules/1.10.x/dialog.html#id295144
>>>
>>> It will be helpful to provide more info on what "it is not working" 
>>> - like do you see any changes on the INVITE sent out by OpenSIPS, 
>>> any script errors, etc
>> I 'm trying to use your proposed function, but ran into a problem - I 
>> have not triggered the authorization and I can not make an outgoing 
>> call .
>>
>> After making some changes :
>>
>>     if (!db_is_user_in("$fu", "asterisk")) # +++ I ADDED THIS STRING
>>     if (!(method=="REGISTER") && from_uri==myself) /*НЕ multidomain 
>> версия*/
>>
>>     {
>>
>>         if(!check_source_address("0")){
>>             if (!proxy_authorize("", "subscriber")) {
>>
>>
>>                 proxy_challenge("", "0");
>>                 exit;
>>             }
>>                 if (!db_check_from()) {
>>                     sl_send_reply("403","Forbidden auth ID");
>>                     exit;
>>                 }
>>             consume_credentials();
>>         }
>>     }
>>
>> I like making progress , but the analysis of messages using the 
>> program "wireshark", I saw that I had not sent a request "ACK" to the 
>> asterisk. The challenge does not pass.
>>
>> Briefly remind you that I 'm trying to achieve :
>> I would like to make opensips acted as UAC to asterisk , but it was a 
>> server for opensips UAC. This will allow me to introduce UAC, 
>> registered in OpenSIPS like an extension on the asterisk.
>>
>> Please, write a little piece of code for deciding my problem.
>>
>> My configuration file:
>>
>> http://pastebin.com/39vV4eYT
>>
>>> Hello,
>>>
>>> Use the dialog based topology hiding
>>> http://www.opensips.org/html/docs/modules/1.10.x/dialog.html#id296001
>>>
>>> when forwarding the INVITE to Asterisk (in OpenSIPS).
>>>> Thank you.
>>>>
>>>> I tried it like this code fragment:
>>>>
>>>> #--8<----------------------------------------------------------------------------------
>>>>
>>>> route {
>>>>
>>>>
>>>>     if (!mf_process_maxfwd_header("10")) {
>>>>         sl_send_reply("483","Too Many Hops");
>>>>         exit;
>>>>     }
>>>>
>>>>     #force_rport();
>>>>
>>>>     if(avp_db_load("$fu","$avp(trace)")) {
>>>>         $avp(traceuser)=$fu;
>>>>         setflag(22);
>>>>         sip_trace();
>>>>         xlog("L_INFO","User $fu being traced");
>>>>     }
>>>> #...................................................................
>>>>     if (db_is_user_in("$fu", "asterisk"))
>>>>     {
>>>>         if(!has_totag() && is_method("INVITE")) {
>>>>         topology_hiding();
>>>>         }
>>>>     }
>>>>
>>>>     if (has_totag()) {
>>>>     ...
>>>>     }
>>>>
>>>>     ...
>>>> #--8<----------------------------------------------------------------------------------
>>>>
>>>> But it not worked :( Perhaps, this code is wrong.
>>>>
>>>> Could you indicate where the error? Could you indicate where the 
>>>> error? Or do I need to follow the documentation on the function 
>>>> topology_hiding()?
>>>>> On 11.02.2014 10:12, Александр Пучков wrote:
>>>>>>
>>>>>> 10.02.2014 13:24, Bogdan-Andrei Iancu пишет:
>>>>>>> Hello,
>>>>>>>
>>>>>>> In this scenario:
>>>>>>>
>>>>>>>     Astеrisk <-- 3 -- OpenSIPS <-- 4 -- UAC
>>>>>>>
>>>>>>> What SIP requests the UAC is sending ? REGISTER ? INVITES ?
>>>>>> Hello!
>>>>>>
>>>>>> UAC registered to Opensips, Opensips registered as UAC on 
>>>>>> Asterisk. When the INVITE request comes from the UAC, Opensips 
>>>>>> need to sent INVITE to Asterisk as UAC.
>>>>>>
>>>>>> Note that the UAC does not know about Asterisk and Asterisk does 
>>>>>> not know about UAC. Asterisk know about only Opensips.
>>>>>>
>>>>>> It is necessary to any UAC registered on Opensips could imagine 
>>>>>> how extension on Asterisk, without changing the configuration of UAC.
>>>>>>
>>>>>> Thank you.
>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Regards,
>>>>>>> Bogdan-Andrei Iancu
>>>>>>> OpenSIPS Founder and Developer
>>>>>>> http://www.opensips-solutions.com
>>>>>>> On 20.01.2014 13:05, Александр Пучков wrote:
>>>>>>>> Hi!
>>>>>>>>
>>>>>>>> OpenSIPS version 1.8.
>>>>>>>>
>>>>>>>> We have the following diagram:
>>>>>>>>
>>>>>>>> PSTN        <-- 1 --> OpenSIPS    <-- 2 --> Astеrisk    <-- 3 
>>>>>>>> --> UAC
>>>>>>>> 192.168.1.1 <-- 1 --> 192.168.1.2 <-- 2 --> 192.168.1.3 <-- 3 
>>>>>>>> --> 192.168.1.*
>>>>>>>>
>>>>>>>> I would like to make the following scheme:
>>>>>>>>
>>>>>>>> PSTN        <-- 1 --> OpenSIPS    <-- 2 --> Astеrisk    <-- 3 
>>>>>>>> --> OpenSIPS <-- 4 --> UAC
>>>>>>>> 192.168.1.1 <-- 1 --> 192.168.1.2 <-- 2 --> 192.168.1.3 <-- 3 
>>>>>>>> --> 192.168.1.2 <-- 4 --> 192.168.1.*
>>>>>>>>
>>>>>>>> Interestingly the following schema fragment:
>>>>>>>> Astеrisk    <-- 3 --> OpenSIPS    <-- 4 --> UAC
>>>>>>>>
>>>>>>>> Here OpenSIPS need to increase control over the services for 
>>>>>>>> UAC. UAC should not know about the existence of Asterisk and 
>>>>>>>> UAC must be registered on the server OpenSIPS, and any SIP 
>>>>>>>> request OpenSIPS should redirect to Asterisk.
>>>>>>>>
>>>>>>>> I tried to use the module in UAC_REGISTRANT OpenSIPS, it works 
>>>>>>>> fine in the direction:
>>>>>>>>
>>>>>>>> Astеrisk -- 3 --> OpenSIPS -- 4 --> UAC
>>>>>>>>
>>>>>>>> But how to implement the scheme in the direction:
>>>>>>>>
>>>>>>>> Astеrisk <-- 3 -- OpenSIPS <-- 4 -- UAC
>>>>>>>>
>>>>>>>> I do not really imagine. Please tell me how it can be implemented.
>>>>>>>>
>>>>>>>> Thank!
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>
>>
>>
>> *Александр Пучков,
>> Системный администратор,
>> Тел.: +7(496) 569-24-24 доб.тел. 255;
>> *ООО "ПОИГ" (Интернет-провайдер г. Щелково)
>> Факс: +7(496) 569-24-24 доб. 103;
>> Адрес: 141108, М.О., г.Щелково, Пролетарский пр., д.11;
>> WEB: http://www.schelkovo-net.ru
>>
>



--
С уважением,
Александр Пучков,
Системный администратор,
Тел.:      +7(496) 569-24-24 доб.тел. 255;
ООО "ПОИГ" (Интернет-провайдер г. Щелково)
Факс:      +7(496) 569-24-24 доб. 103;
Адрес:     141108, М.О., г.Щелково, Пролетарский пр., д.11;
WEB:       http://www.schelkovo-net.ru
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20140324/98585f46/attachment-0001.htm>


More information about the Users mailing list