Re: [OpenSIPS-Users] Get IP/Port of registered user (or from Location table?)
Hello Liviu, thanks for the help. Although one more question, on your "sip:FRANK101@ip"; What is the "@ip"? is that the IP of the "domain" field in the subscriber table, or the IP in the "contact" field of the location table? here is an example of what in my "contact" field of the "location" table: sip:FRANK101@192.168.2.160:5060;transport=udp So, do I put the entire line in the $var(aor) or I have to search for the ";" and then truncate and manipulate the "contact" field to just "sip:FRANK101@192.168.2.160" and then put it in the variable? And sorry, lastly, just a side question regarding the location table, why is it sometime I would see all my data in the "location" table disappear, but when I do a "opensipsctl ul show --brief" I do see all the AOR entry and that all the device are registered with OpenSIP. And then even if I do a "opensipsctl fifo ul_flush" it still does not update the mysql database. Sorry, another question, I also tried to use MS SQL SERVER 2008 as backend database for usr_loc module, but it simply won't start. I have many other module running on SQL SERVER 2008 R2, the only 2 module I have problem is the usr_loc and dialog module. I even did a SQL profilier on the database, I do see opensips query the database (select fields from location), but after that, it just won't start. The only way can use SQL SERVER 2008 as backend for usr_loc is if I do db_mode 3, but I think OpenSIP crashes when it tries to read from the database when in db_mode 3. anyhow. Sorry for all the question, the most important one is the AOR format for the lookup function call, if you can help me out on that, it will be great! Thank you! -- View this message in context: http://opensips-open-sip-server.1449251.n2.nabble.com/Get-IP-Port-of-registered-user-or-from-Location-table-tp7588494p7588543.html Sent from the OpenSIPS - Users mailing list archive at Nabble.com. ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Re: [OpenSIPS-Users] Get IP/Port of registered user (or from Location table?)
Hello bluerain, A couple of useful information: * a user may be subscribed (in the "subscriber" table), but the lookup call may fail, because he is not registered (in the "location" table) * lookup indeed performs a lookup based on the Request-URI username, and rewrites the same URI in case the operation is successful * with "lookup("location","d","FRANK101")", OpenSIPS should not start. Correct this as follows: $var(aor) = "sip:FRANK101@ip"; lookup("location","d","$var(aor)") Notice how the parameter MUST be a pseudo-variable containing a sip URI. Liviu Chircu OpenSIPS Developer http://www.opensips-solutions.com On 11/15/2013 07:30 PM, bluerain wrote: Hello Bogdan, I tried to use lookup("location","d","FRANK101") and it seems opensips can not find the user, even though the username "FRANK101" is in the subcriber table. So it is my syntax is wrong on the "lookup" function call? And please correct me if I am wrong also, I was under the impression that if an INVITE comes in from Asterisk with R-URI: 2135551212@IP TO-URI: 2135551212@IP And obviously opensip will not know who is "2135551212" because "2135551212" is NOT in the subscriber table. So here is my code if (is_method("INVITE")) { if (!lookup("location","m")){ switch($rc) { case -1: if (!lookup("location","d","FRANK101")) { t_reply("404","Not Found"); exit; } case -3: t_newtran(); t_reply("404","Not Found"); exit; case -2: sl_send_reply("405", "Method Not Allowed"); exit; } } route(relay); } So with the code above, I: 1. lookup to see if the INVITE is a valid user in subscriber database 2. If not an valid user, which in this case it is because asterisk sent in an invite with "2135551212" 3. Thus I use the funcation call, lookup("location","d","FRANK101"), which "FRANK101" is a valid user in the "subscriber" table. 4. by calling the funcation call, lookup("location","d","FRANK101"), I am expecting that opensips will NOT TOUCH either the TO-URI NOR the R-URI. It will keep those the same as 2135551212@IP, BUT now opensips will sent the INVTIE to FRANK101 BECAUES the "lookup" function call only change the IP/Port of the INVITE where it suppose to go? Is my assumption correct? Or will "lookup" function also change the R-URI and the TO-URI? If that is the case, then is useless. And if lookup is work the way I thought, then please tell me what is the exact syntax in reference to a user in the subscriber table? What is the AOR parameter for the lookup? Is it not simply as the username? Or do I need to put username@IP then what is the "@IP"? is the "@IP" the "domain" field in the subscriber table? Or is it what is in the location table? and if is in the location table, then do I take the entire "contact" field and stuff that in to the lookup AOR parameter? Thank you! -- View this message in context: http://opensips-open-sip-server.1449251.n2.nabble.com/Get-IP-Port-of-registered-user-or-from-Location-table-tp7588494p7588540.html Sent from the OpenSIPS - Users mailing list archive at Nabble.com. ___ 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] Get IP/Port of registered user (or from Location table?)
sorry I type wrong the syntax for location, please ignore the "d", I got it confused with the db_alias lookup command. I have in my code only lookup("location","","FRANK101") -- View this message in context: http://opensips-open-sip-server.1449251.n2.nabble.com/Get-IP-Port-of-registered-user-or-from-Location-table-tp7588494p7588541.html Sent from the OpenSIPS - Users mailing list archive at Nabble.com. ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Re: [OpenSIPS-Users] Get IP/Port of registered user (or from Location table?)
Hello Bogdan, I tried to use lookup("location","d","FRANK101") and it seems opensips can not find the user, even though the username "FRANK101" is in the subcriber table. So it is my syntax is wrong on the "lookup" function call? And please correct me if I am wrong also, I was under the impression that if an INVITE comes in from Asterisk with R-URI: 2135551212@IP TO-URI: 2135551212@IP And obviously opensip will not know who is "2135551212" because "2135551212" is NOT in the subscriber table. So here is my code if (is_method("INVITE")) { if (!lookup("location","m")){ switch($rc) { case -1: if (!lookup("location","d","FRANK101")) { t_reply("404","Not Found"); exit; } case -3: t_newtran(); t_reply("404","Not Found"); exit; case -2: sl_send_reply("405", "Method Not Allowed"); exit; } } route(relay); } So with the code above, I: 1. lookup to see if the INVITE is a valid user in subscriber database 2. If not an valid user, which in this case it is because asterisk sent in an invite with "2135551212" 3. Thus I use the funcation call, lookup("location","d","FRANK101"), which "FRANK101" is a valid user in the "subscriber" table. 4. by calling the funcation call, lookup("location","d","FRANK101"), I am expecting that opensips will NOT TOUCH either the TO-URI NOR the R-URI. It will keep those the same as 2135551212@IP, BUT now opensips will sent the INVTIE to FRANK101 BECAUES the "lookup" function call only change the IP/Port of the INVITE where it suppose to go? Is my assumption correct? Or will "lookup" function also change the R-URI and the TO-URI? If that is the case, then is useless. And if lookup is work the way I thought, then please tell me what is the exact syntax in reference to a user in the subscriber table? What is the AOR parameter for the lookup? Is it not simply as the username? Or do I need to put username@IP then what is the "@IP"? is the "@IP" the "domain" field in the subscriber table? Or is it what is in the location table? and if is in the location table, then do I take the entire "contact" field and stuff that in to the lookup AOR parameter? Thank you! -- View this message in context: http://opensips-open-sip-server.1449251.n2.nabble.com/Get-IP-Port-of-registered-user-or-from-Location-table-tp7588494p7588540.html Sent from the OpenSIPS - Users mailing list archive at Nabble.com. ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Re: [OpenSIPS-Users] Problem with Opensips-cp CDR And Users registration
you should load this modules on opensips.cfg and configure to work 2013/11/15 Vishnu Vardhan > Hi, > > I installed opensips 1.8 with opensips 5.0.And i integrate with it > asterisk 11.0.3.When i tried to register the users it is not updating > in cdr-viewer and in softphone also users are not registering after > registering in users pannel.Can any one help he to get out of this > problem.And pls see the below log message of opensips which i got. > > Nov 15 05:00:27 developer-asterisk-vm24 > /usr/local/sbin/opensips[3373]: ERROR:mi_fifo:mi_fifo_server: command > sip_trace is not available > > Nov 15 05:01:03 developer-asterisk-vm24 > /usr/local/sbin/opensips[3373]: ERROR:mi_fifo:mi_fifo_server: command > dr_gw_status is not available > > Nov 15 05:01:30 developer-asterisk-vm24 > /usr/local/sbin/opensips[3373]: ERROR:mi_fifo:mi_fifo_server: command > dlg_list is not available > > Nov 15 05:09:37 developer-asterisk-vm24 > /usr/local/sbin/opensips[3373]: ERROR:mi_fifo:mi_fifo_server: command > sip_trace is not available > > Nov 15 05:09:58 developer-asterisk-vm24 > /usr/local/sbin/opensips[3373]: ERROR:mi_fifo:mi_fifo_server: command > dr_gw_status is not available > > Nov 15 05:10:02 developer-asterisk-vm24 > /usr/local/sbin/opensips[3373]: ERROR:mi_fifo:mi_fifo_server: command > dlg_list is not available > > Nov 15 06:08:45 developer-asterisk-vm24 > /usr/local/sbin/opensips[3373]: ERROR:mi_fifo:mi_fifo_server: command > domain_reload is not available > > Nov 15 06:12:23 developer-asterisk-vm24 > /usr/local/sbin/opensips[3373]: ERROR:mi_fifo:mi_fifo_server: command > domain_reload is not available > > Regards, > Vishnu > > ___ > 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] DR and failover
Perfect! Thanks Mike ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Re: [OpenSIPS-Users] DR and failover
on failure route you should use the function use_next_gw if (use_next_gw()) { route(4); } you have a tutorial on opensips website http://www.opensips.org/Documentation/Tutorials#toc2 2013/11/15 Nick Cameo > Hello Everyone, > > We use the DR module and LOVE IT! Quick question regarding failing > over to the next gateway. Do we need to do anything in the failure > route of our script? Or is it just as simple as entering the gateway > in dr_rules.gwlist (ie, 1,2,3.), and having the entry in > dr_gatways? > > Kind Regards, > > Nick. > > ___ > 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] DR and failover
Hello Everyone, We use the DR module and LOVE IT! Quick question regarding failing over to the next gateway. Do we need to do anything in the failure route of our script? Or is it just as simple as entering the gateway in dr_rules.gwlist (ie, 1,2,3.), and having the entry in dr_gatways? Kind Regards, Nick. ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
[OpenSIPS-Users] simple proxy set up
I have installed opensips 1.7 with opensips-cp web control panel. I am hoping to use it simply to distribute incoming calls to 2 different asterisk based pbx's by DID phone number. I will need opensips to register with the sip service provider (Broadvox) and the asterisk boxes to register with Opensips as a provider and then a dial plan to route to the appropriate asterisk box based on phone number dialed. The phones will register with the asterisk boxes (for now). This seems really simple but the terminology is different than I'm used to with asterisk and I'm not sure all the modules are installed to do this. Any thoughts on how to get started with this? I would prefer to use the web based control panel if possible. Thank you Doug ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Re: [OpenSIPS-Users] OpenSIPS not processing responses?
Yes, we are bridging between TCP and UDP. There are no custom scripts being used, just the core OpenSIPS scripting, with OpenSIPS acting just as a proxy. We had another event occur last evening and managed to capture some interesting information that suggests the problem is related to blocking tcp connections: aaa@ip-10-72-7-129:/dir$ grep "ERROR:core:tcp_blocking_connect: timeout 10 s elapsed from 10 s" opensips.log | sed 's/:.. ip.*//'| uniq -c 2 Nov 14 06:50 2 Nov 14 06:53 2 Nov 14 06:55 1 Nov 14 06:56 2 Nov 14 06:57 2 Nov 14 07:00 2 Nov 14 13:53 3 Nov 14 13:54 2 Nov 14 13:55 23 Nov 14 13:56 29 Nov 14 13:57 30 Nov 14 13:58 30 Nov 14 13:59 While I'm not familiar with the inner workings of OpenSIPS, it seems like there is something happening that may be causing all of the child processes to block while trying to establish outbound TCP connections. Unfortunately the "tcp_blocking_connect: timeout" error (and the subsequent "tcp_blocking_connect failed" error) doesn't indicate the address that caused the failure, and there's no way that I can see to correlate the error back to a request being processed. But I suspect it's a case where a client connected via TCP, registered with our registrar (where the path to the client, including the address of the TCP connection endpoint on OpenSIPS that has an ephemeral port, is recorded), but when we go to send a bunch of requests to that client it is no longer there and it causes all of the opensips child processes to effectively block trying to establish a connection to an address it will never be able to connect to. In the end 477 Send Failed is returned in those cases, but I think the child trying to establish the connection is blocked until the connect times out, and things start piling up behind it, leading to a vicious circle. Assuming all of the analysis is correct, can we prevent OpenSIPS from spending time trying to establish a connection that can never be established? Thanks, Gavin On 15/11/2013 7:00 AM, users-requ...@lists.opensips.org wrote: Seems opensips is acting as transport bridge between udp and tcp, so, do the SIP replies actually arrive at same interface (transport + ip + port) from where the request was sent, and opensips is listening to that interface? Can you share SIP trace with us? Also, are you using any custom application, e.g. perl / lua script etc. in opensips dial plan, that might be blocking the opensips thread that is managing this transaction. As far as i remember opensips 1.8.x does not have async processing, therefore, if any script or module command that consumes time e.g. custom sql query, external script or shell command etc. would block opensips and any responses received during that time are likely to be ignored. Thank you. On 2013-11-14 16:05, Gavin Murphy wrote: Hi all, We're seeing a possible issue in OpenSIPS related to the timely processing of replies. For example, OpenSIPS receives a REGISTER and passes it on to our application server (which is the registrar). The registrar receives it within the same second and generates the response (a 401 initially) within 0.003 seconds. However OpenSIPS doesn't appear to receive that message, and half a second after the first REGISTER is sent, there is a retransmission after 0.5 second, which is again received by our registrar and a response is generated very quickly. But still the 401 doesn't get received and/or processed by OpenSIPS. The retransmission happens again a few times as per RFC 3261. Eventually, almost 30 seconds later OpenSIPS logs that the reply to the REGISTER has been received. Based on the evidence it seems that there is no problem with OpenSIPS sending the request and it being received by our registrar. There also doesn't appear to be any issues with the retransmission by OpenSIPS at the right intervals, nor does the registrar appear to be introducing any delays. There is not much other traffic going on at the same time, but there are other REGISTERs that are getting the same result. Here are some logs from OpenSIPS: Initial relay to our registrar: Nov 1 19:14:40 ip-10-72-7-129 rcs-opensips[13839]: RCS INFO: ROUTE[2] (Inbound and Outbound) - REGISTER REQUEST relayed. Exiting. Nov 1 19:14:40 ip-10-72-7-129 rcs-opensips[13839]: DBG:tm:t_unref: UNREF_UNSAFE: [0x7f8f8b8d6518] after is 0 Nov 1 19:14:40 ip-10-72-7-129 rcs-opensips[13839]: DBG:core:destroy_avp_list: destroying list (nil) Retransmissions: Nov 1 19:14:40 ip-10-72-7-129 rcs-opensips[13836]: DBG:tm:retransmission_handler: retransmission_handler : request resending (t=0x7f8f8b8d6518, REGISTER ... ) Nov 1 19:14:41 ip-10-72-7-129 rcs-opensips[13836]: DBG:tm:retransmission_handler: retransmission_handler : request resending (t=0x7f8f8b8d6518, REGISTER ... ) Nov 1 19:14:43 ip-10-72-7-129 rcs-opensips[13836]: DBG:tm:retransmission_handler: retransmission_handler : request resending (t=0x7f
[OpenSIPS-Users] Problem with Opensips-cp CDR And Users registration
Hi, I installed opensips 1.8 with opensips 5.0.And i integrate with it asterisk 11.0.3.When i tried to register the users it is not updating in cdr-viewer and in softphone also users are not registering after registering in users pannel.Can any one help he to get out of this problem.And pls see the below log message of opensips which i got. Nov 15 05:00:27 developer-asterisk-vm24 /usr/local/sbin/opensips[3373]: ERROR:mi_fifo:mi_fifo_server: command sip_trace is not available Nov 15 05:01:03 developer-asterisk-vm24 /usr/local/sbin/opensips[3373]: ERROR:mi_fifo:mi_fifo_server: command dr_gw_status is not available Nov 15 05:01:30 developer-asterisk-vm24 /usr/local/sbin/opensips[3373]: ERROR:mi_fifo:mi_fifo_server: command dlg_list is not available Nov 15 05:09:37 developer-asterisk-vm24 /usr/local/sbin/opensips[3373]: ERROR:mi_fifo:mi_fifo_server: command sip_trace is not available Nov 15 05:09:58 developer-asterisk-vm24 /usr/local/sbin/opensips[3373]: ERROR:mi_fifo:mi_fifo_server: command dr_gw_status is not available Nov 15 05:10:02 developer-asterisk-vm24 /usr/local/sbin/opensips[3373]: ERROR:mi_fifo:mi_fifo_server: command dlg_list is not available Nov 15 06:08:45 developer-asterisk-vm24 /usr/local/sbin/opensips[3373]: ERROR:mi_fifo:mi_fifo_server: command domain_reload is not available Nov 15 06:12:23 developer-asterisk-vm24 /usr/local/sbin/opensips[3373]: ERROR:mi_fifo:mi_fifo_server: command domain_reload is not available Regards, Vishnu ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Re: [OpenSIPS-Users] RES: RES: RES: Crash in Linux 64 bits
Hi, Aldo! I need the command that generates the core dump. You should see it above the line you pasted and should be a C instruction. Best regards, Răzvan Crainea OpenSIPS Core Developer http://www.opensips-solutions.com On 11/11/2013 06:33 PM, Aldo Jose Spanghero Romao wrote: Hi, Răzvan This is the line you need? #0 force_rtp_proxy (msg=0x7ff24237af80, str1=, str2=, offer=, out_newport=, out_newip=) at rtpproxy.c:3347 Regards, Aldo De: users-boun...@lists.opensips.org [users-boun...@lists.opensips.org] em nome de Răzvan Crainea [raz...@opensips.org] Enviado: sexta-feira, 8 de novembro de 2013 7:01 Para: users@lists.opensips.org Assunto: Re: [OpenSIPS-Users] RES: RES: Crash in Linux 64 bits Hi, Aldo! Can you paste the line that generated the crash? It should be printed right after gdb opens the core file, before you execute 'bt full'. Best regards, Răzvan Crainea OpenSIPS Core Developer http://www.opensips-solutions.com On 11/07/2013 06:50 PM, Aldo Jose Spanghero Romao wrote: Hi! This is the back trace: http://pastebin.com/YDkcdqnB We installed from sources. OpenSIPS is crashing in 64 bit only, when returning from function 'force_rtp_proxy_body' (looks like 'return 1;' is the last line executed). Thanks for any tip. Aldo De: users-boun...@lists.opensips.org [users-boun...@lists.opensips.org] em nome de Răzvan Crainea [raz...@opensips.org] Enviado: quarta-feira, 6 de novembro de 2013 8:18 Para: users@lists.opensips.org Assunto: Re: [OpenSIPS-Users] RES: Crash in Linux 64 bits Hi, Aldo! How did you install OpenSIPS? Using DEB files, from sources? If you used the first choice, have you also installed the debug package? How did you narrow down the crash was in the rtpproxy_offer() function? Best regards, Răzvan Crainea OpenSIPS Core Developer http://www.opensips-solutions.com On 11/05/2013 06:55 PM, Aldo Jose Spanghero Romao wrote: Hi, Răzvan. I´m trying to load the core dump using gbd, but gbd isn´t finding the modules. How to start gbd with opensips so it will find the modules also? this is the line I´m using: gdb /path-to-opensips/opensips /path-to-core/core.opensips.28392 Regards, Aldo De: users-boun...@lists.opensips.org [users-boun...@lists.opensips.org] em nome de Răzvan Crainea [raz...@opensips.org] Enviado: terça-feira, 5 de novembro de 2013 15:06 Para: users@lists.opensips.org Assunto: Re: [OpenSIPS-Users] Crash in Linux 64 bits Hi, Aldo! Can you please pastebin the coredump? You can find more info here [1]. [1] http://www.opensips.org/Documentation/TroubleShooting-Crash Best regards, Răzvan Crainea OpenSIPS Core Developer http://www.opensips-solutions.com On 11/05/2013 05:52 PM, Aldo Jose Spanghero Romao wrote: Hi, Opensips is crashing in Linux 64 bits only, in 32 bits not. Looks like it is happening right before it is returning the encryption key in a 200 OK, inside the rtpproxy_offer function. Any tip? Thanks Aldo ___ 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 ___ 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 ___ 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 ___ 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