[OpenSIPS-Users] How to identify a 4xx, or 5xx, or 6xx SIP response in OpenSIPS script? Almost there...

Rodrigo Pimenta Carvalho pimenta at inatel.br
Mon Nov 9 14:55:28 CET 2015


Hi.


Thank all of you!

I'm getting success to execute some actions in my OpenSIPS when it get some responses as 4xx, 5xx, 6xx.

I have read about routes and some functions to detect such responses that come from the callee peer.


In my code I have something like this:


-------------------------------------------------------------------------------------------


failure_route[missed_call] {


        if (t_check_status("4[0-9][0-9]")||t_check_status("5[0-9][0-9]")||t_check_status("6[0-9][0-9]") ) {

                if(($fU=="porteirinho") || ($fU=="porteirinho2") || ($tU=="porteirinho") || ($tU=="porteirinho2")){


                          do some actions for me...

                }
        }
}

--------------------------------------------------------------------------------------------



However, some responses seems to be generated internally in OpenSIPS. Ex: 420 (bad extension), 404 (not found), 477, etc. For these internally generated responses, I still have to find a way of detecting it. I will look for it on documentation. However, I suspect that maybe this detection has to be done in another type of route.


Should I use another type of route, shouldn't I? If yes, is there a function there that will tells me about the type of response too?


Any hint will be very helpful!



Best regards.



RODRIGO PIMENTA CARVALHO
Inatel Competence Center
Software
Ph: +55 35 3471 9200 RAMAL 979


________________________________
De: users-bounces at lists.opensips.org <users-bounces at lists.opensips.org> em nome de Annus Fictus <annusfictus at gmail.com>
Enviado: sexta-feira, 6 de novembro de 2015 12:22
Para: OpenSIPS users mailling list
Assunto: Re: [OpenSIPS-Users] How to identify a 4xx, or 5xx, or 6xx SIP response in OpenSIPS script?

Hello Rodrigo,

you have to use failure route:

http://www.opensips.org/Documentation/Script-Routes-2-2#toc3
[http://www.opensips.org/pub/skins/opensips/images/logo2.jpg]<http://www.opensips.org/Documentation/Script-Routes-2-2#toc3>

openSIPS | Documentation / Types of routes - 2.2
OpenSIPS routing logic uses several types of routes. Each type of route is triggered by a certain event and allows you to process a certain type of message (request ...
Leia mais...<http://www.opensips.org/Documentation/Script-Routes-2-2#toc3>



Regards

El 06/11/2015 a las 15:07, Rodrigo Pimenta Carvalho escribió:


Hi OpenSIPS-users,


In the OpenSIPS script I can identify SIP requests, like is_method("INVITE") or is_method("BYE").


How to identify SIP responses, based on its codes that can be 4xx, or 5xx, or 6xx?

For example, how to identify that occurred a SIP response with code 483?


I just need to know that a SIP INVITE didn't succeeded.


What could be a elegant way to detect that a SIP INVITE was not answered?



Best regards.


RODRIGO PIMENTA CARVALHO
Inatel Competence Center
Software
Ph: +55 35 3471 9200 RAMAL 979



_______________________________________________
Users mailing list
Users at lists.opensips.org<mailto:Users at lists.opensips.org>
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20151109/72bf8742/attachment.htm>


More information about the Users mailing list