Re: [OpenSIPS-Users] 401 Unauthorized after Authentication Digest
Hi David, In the scenario you describe, I would expect to see one of the following solutions (but not both at the same time): 1. OpenSIPS acts as the registrar for the SIP phones. Calls (INVITE requests) from SIP phones are routed on via a SIP trunk 2. OpenSIPS acts as a transparent proxy in front of another SIP server such as Asterisk Scenario 1 is the most common. OpenSIPS authenticates calls based on a list of credentials that it holds, normally in the subscriber table. In this case, you really want to avoid the situation where each outbound call triggers an additional authentication request from the SIP trunk. Can you re-configure your Asterisk endpoint so it trusts INVITE requests coming from your OpenSIPS server? E.g. add the line insecure=INVITE to the sip peer definition. In scenario 2, which I would not consider to be the preferred solution, OpenSIPS just passes the SIP messages between the phone and the Asterisk server - in both directions. OpenSIPS does not authenticate calls because that job is done by the Asterisk server and all the credentials are held by Asterisk, not by OpenSIPS. In this case the 401 request would just be passed upstream to the phone. Try to avoid the situation where OpenSIPS is authenticating the INVITE from the SIP phones using its own list of credentials, but then it also has to authenticate each call sent over the SIP trunk. In theory you could use the UAC_AUTH module of OpenSIPS to do this, but in practice I have never been able to make this work because it breaks the CSeq numbering sequence of the SIP request messages. John Quick Smartvox Limited ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
[OpenSIPS-Users] Opensips and clusterer
Hello! Trying to make replication of the dialog using clusterer module and get fail.In syslog i see such message after answer the callee. WARNING:dialog:receive_prof_binary_packet: bad packet type version: opensips 2.2.4 (x86_64/linux)flags: STATS: On, DISABLE_NAGLE, USE_MCAST, SHM_MMAP, PKG_MALLOC, QM_MALLOC, DBG_MALLOC, FAST_LOCK-ADAPTIVE_WAITADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16, MAX_URI_SIZE 1024, BUF_SIZE 65535poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.git revision: 281aef5 Thank you for any help. P.S. usrloc replication working normally. -- С уважением, Денис.Best regards, Denis ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Re: [OpenSIPS-Users] Location table - how to use socket
Hello Bogdan, Here is the code I used to check $(branch(socket)[N]): if (lookup("location")) { set_count("$branch(uri)", "$var(brcnt)"); if ($var(brcnt) > 0) { # More than one contact - not possible to check socket data xlog("L_WARN", "R3 IN: Req.type=$rm R-URI=$ru Br.cnt=$var(brcnt) Sock[0]=$(branch(socket)[0]) Sock[1]=$(branch(socket)[1]) Call-ID=$ci\n"); } else ... And here is the log file output when I have two registrations on the same username R3 IN: Req.type=INVITE R-URI=sip:01NN@12.34.56.245:5060 Br.cnt=1 Sock[0]= Sock[1]= Call-ID=41d17a02...@sip1.mysipdomain.com The records in the location table both have data in the socket field. This is running on version 2.2.4 of OpenSIPS John Quick Smartvox Limited Tel: 01727-221221 -Original Message- From: Bogdan-Andrei Iancu [mailto:bog...@opensips.org] Sent: 29 May 2017 11:32 To: john.qu...@smartvox.co.uk; 'OpenSIPS users mailling list' Subject: Re: [OpenSIPS-Users] Location table - how to use socket Hi John, the only way to share records via DB is to use DB only - the other modes are using the DB just for restart persistence reason (they do not read from DB at runtime, only once, at startup). In DB-only mode, all reads and writes (related to contacts) are done against the DB. In regards to $(branch(socket)[N]) - do you use it after a lookup(location) ? are you sure that the N'th branch exists and have a socket ? You may consider saving some extra attributes next to the contact ( see http://www.opensips.org/html/docs/modules/2.2.x/registrar.html#idp5568288) to identify the pop/host which produced that record. Best regards, Bogdan-Andrei Iancu OpenSIPS Founder and Developer http://www.opensips-solutions.com OpenSIPS Bootcamp 2017, Huston, US http://opensips.org/training/OpenSIPS_Bootcamp_2017.html On 05/26/2017 07:38 PM, John Quick wrote: > Hi Bogdan, > > Yes. I tried with db_mode=1 and it behaved very strangely so I changed it to > db_mode=3 (DB only). > > Also tried $(branch(socket)[N]) to read the socket data within my script, but > it always returns . > > I am now thinking it will be necessary to have one location table per site, > but perhaps you could consider adding options in future releases to allow the > lookup function to only select contacts where the socket matches one that > this server is listening on. > > John Quick > Smartvox Limited > > > -Original Message- > From: Bogdan-Andrei Iancu [mailto:bog...@opensips.org] > Sent: 26 May 2017 17:30 > To: john.qu...@smartvox.co.uk; OpenSIPS users mailling list > > Subject: Re: [OpenSIPS-Users] Location table - how to use socket > > Hi John, > > I suppose you are using usrloc with DB-only to share registrations between > multiples sites, otherwise the socket filter will not make sense, right ? > > Best regards, > > Bogdan-Andrei Iancu > OpenSIPS Founder and Developer > http://www.opensips-solutions.com > > OpenSIPS Bootcamp 2017, Huston, US > http://opensips.org/training/OpenSIPS_Bootcamp_2017.html > > On 05/25/2017 06:16 PM, John Quick wrote: >> The socket field in the location table sometimes contains very useful >> information such as: >> - to see which server received the Registration in a dual site >> scenario >> - to see if the UA registered over UDP, TCP or TLS >> >> However, there does not seem to be any mechanism for using the socket >> information in the USRLOC or REGISTRAR modules. >> For example, it is not possible to call lookup and filter for >> contacts made on the local server's socket or for contacts that used TLS. >> >> Please could the developers look at options to leverage this useful >> data, especially for the lookup function. >> >> Are there any tricks I could employ to achieve the same result. For >> example, if I set a branch flag to indicate which site received this >> registration would it then be possible to filter the results returned >> by lookup and extract the registrations received at site A while >> discarding those received at site B? >> >> To give a practical example: Dual site; Shared location table; User's >> device is registered at site B; Call arrives at site A so I want to >> use 302 redirect to send it over to site B, but I cannot tell from >> the results of a lookup whether the registration was made at A or B >> even though the data is there in the socket field. >> >> John Quick >> Smartvox Limited >> >> >> >> ___ >> Users mailing list >> Users@lists.opensips.org >> http://lists.opensips.org/cgi-bin/mailman/listinfo/users ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
[OpenSIPS-Users] How to see SIP messages in the log ?
Hi. Is it possible to see SIP messages in the OpenSIPS log ? Should I use some specific configuration in my opensips.cfg file? I would like tho see the entire SIP messages that is received and sent by the OpenSIPS. And, if peers are using TLS, is it still possible to see SIP messages from OpenSIPS? Any hint will be very helpful! Best regards. RODRIGO PIMENTA CARVALHO Inatel Competence Center Software Ph: +55 35 3471 9200 RAMAL 979 ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Re: [OpenSIPS-Users] How to see SIP messages in the log ?
Hi Rodrigo, I use $mb to show the whole SIP request in the logs. I think it will also work for TLS. For example: xlog("L_WARN", "SIP Message: $mb"); The formatting is untidy because new line is shown as #015#012, but this would be easy to fix using standard Linux tools. John Quick Smartvox Limited ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Re: [OpenSIPS-Users] How to see SIP messages in the log ?
Hi Rodrigo, Better use the siptrace module that is able to dump the sip trace into a DB or via HEP to a capturing server (sipcapture.org). Regards, Bogdan-Andrei Iancu OpenSIPS Founder and Developer http://www.opensips-solutions.com OpenSIPS Bootcamp 2017, Houston, US http://opensips.org/training/OpenSIPS_Bootcamp_2017.html On 05/31/2017 05:20 PM, Rodrigo Pimenta Carvalho wrote: Hi. Is it possible to see SIP messages in the OpenSIPS log ? Should I use some specific configuration in my opensips.cfg file? I would like tho see the entire SIP messages that is received and sent by the OpenSIPS. And, if peers are using TLS, is it still possible to see SIP messages from OpenSIPS? Any hint will be very helpful! Best regards. RODRIGO PIMENTA CARVALHO Inatel Competence Center Software Ph: +55 35 3471 9200 RAMAL 979 ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Re: [OpenSIPS-Users] How to see SIP messages in the log ?
Hello Rodrigo, Depending on your install directory. Try the path to the file /var/log/syslog Open this in a text editor. This has useful opensips system information for you. Syslog has a lot of general system messages including the opensips messages. It is quite possible to reconfigure to separate out just the opensips messages. You will have to find some reading material and study up a little to do this. The books "Building Telephony Systems with OpenSIPS" are very helpful here. Alex From: Users [mailto:users-boun...@lists.opensips.org] On Behalf Of Rodrigo Pimenta Carvalho Sent: Wednesday, 31 May 2017 11:51 PM To: users@lists.opensips.org Subject: [OpenSIPS-Users] How to see SIP messages in the log ? Hi. Is it possible to see SIP messages in the OpenSIPS log ? Should I use some specific configuration in my opensips.cfg file? I would like tho see the entire SIP messages that is received and sent by the OpenSIPS. And, if peers are using TLS, is it still possible to see SIP messages from OpenSIPS? Any hint will be very helpful! Best regards. RODRIGO PIMENTA CARVALHO Inatel Competence Center Software Ph: +55 35 3471 9200 RAMAL 979 ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Re: [OpenSIPS-Users] How to see SIP messages in the log ?
Hi John. This hint was very helpful! Thanks all of you. Regards. RODRIGO PIMENTA CARVALHO Inatel Competence Center Software Ph: +55 35 3471 9200 RAMAL 979 De: John Quick Enviado: quarta-feira, 31 de maio de 2017 11:41 Para: users@lists.opensips.org Cc: Rodrigo Pimenta Carvalho Assunto: Re: [OpenSIPS-Users] How to see SIP messages in the log ? Hi Rodrigo, I use $mb to show the whole SIP request in the logs. I think it will also work for TLS. For example: xlog("L_WARN", "SIP Message: $mb"); The formatting is untidy because new line is shown as #015#012, but this would be easy to fix using standard Linux tools. John Quick Smartvox Limited ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users