|
Resources -> Documentation -> Tips and FAQaTable of Content (hide) 1. TipsHow to do certain things. 1.1 How to recalculate ha1 and ha1bWhen you change the domain column in the subscriber table, you have to recalculate ha1 and ha1b fields. In order to do that you must have the password of each subscriber. It is stored in the 'password' column if you have set STORE_PLAINTEXT_PW=1 in opensipsctlrc (default). HA1 is a MD5 hash of "username:domain:password". For example, if you have created a SIP account 1000@mydomain.com using password 123456, then HA1 is the MD5 hash of "1000:mydomain.com:123456" (without quotes). On the other hand HA1B is the MD5 hash of "username@domain:domain:password"; so using the same example above, HA1B would be the MD5 hash of "1000@mydomain.com:mydomain.com:123456" (without quotes). To recalculate and update ha1 and ha1b columns in the subscriber table, just execute the following sql statement in mysql: update subscriber set ha1 = md5(concat(username, ':', domain, ':', password)), ha1b = md5(concat(username, '@', domain, ':', domain, ':', password)) Note: the above is only true if you have "use_domain" enabled for auth_db _and_ you do not use a static challenge parameter for www_authorize. If you use a static challenge for www_authorize (i.e. the first parameter of www_authorize is not the empty string), then HA1 is MD5("username:challenge:password") and HA1B is MD5("username@challenge:challenge:password"). If the challenge parameter of www_authorize is empty, OpenSIPS automatically selects the domain as the challenge value, which gives the solution presented above. If "use_domain" is false, then the HA1B field must be computed based on "username@:domain:password" or "username@:challenge:password", depending on whether challenge is empty or defined, respectively. 1.2 PHP example to communicate via mi_xmlrpc
#!/usr/bin/php
<?php
$params[] = "dialog:";
$params[] = "tm:";
$method = "get_statistics";
$request = xmlrpc_encode_request($method,$params);
$context = stream_context_create(array('http' => array(
'method' => "POST",
'header' => "Content-Type: text/xml",
'content' => $request
)));
$file = file_get_contents("http://example.opensips.org:8080/RPC2", false, $context);
$response = xmlrpc_decode($file);
if (is_array($response)) {
trigger_error("xmlrpc: $response[faultString] ($response[faultCode])");
} else {
print_r($response);
}
?>
1.3 Add a new tip here2. FAQSAnswers to the most frequent questions 2.1 Changing FROM headerQ) How does one change the FROM Header in OpenSIPS ? A) Use the uac_replace_from() function in the uac module 2.2 Recalculating HA1 and HA1B hashes when adding a subscriberQ) How do I re-calculate the ha1 and halb values in the subscriber table for a new subscriber? A) Run the following mysql operation: update subscriber set ha1 = md5(concat(username, ':', domain, ':', password)), ha1b = md5(concat(username, '@', domain, ':', domain, ':', password)) This will automatically update the ha1 and ha1b fields for all subscribers. | News OpenSIPS Getting Started21st of April 2012
OpenSIPS Getting Started Video Tutorial about how to do an installation of OpenSIPS and OpenSIPS-CP... OpenSIPS Devel Course12th of April 2012
Learn about OpenSIPS internals both core and modules... OpenSIPS 1.8.022nd of March 2012
OpenSIPS 1.8.0 major release ready... Dynamic Routing20th of March 2012
Enhancements of DR engine... APT repository23nd of February 2012
New official APT repository for Debian & Ubuntu OpenSIPS 1.7.222nd of February 2012
OpenSIPS 1.7.2 minor release out... SIP Validation Support20th of February 2012
Prevent malformed SIP messages from propagating through your network DNS Caching Support13th of February 2012
Cache system for all types of DNS records Distributed Dialog Profiles9th of February 2012
Shared dialog profiles between multiple instances of OpenSIPS Configuration and Scripting Tool19th of January 2012
Graphical Configuration and Scripting Tool for OpenSIPS Cassandra driver05th of January 2012
Cassandra backend for OpenSIPS LUA integration05th of January 2012
Using LUA scripting with OpenSIPS OpenSIPS Pavilion @ ITExpo 201222th of December 2011
OpenSIPS Pavilion booth #535, 1-3 Feb 2012 OpenSIPS and HOMER14th of December 2011
Distributed SIPtracing and SIPcapturing OpenSIPS eBootcamp12th of December 2011
New Ebootcamp session starting on 15th of February 2012. OpenSIPS 1.7.123rd of November 2011
OpenSIPS 1.7.1 minor release out... Ratelimit3rd of November 2011
Dynamic and distributed support... OpenSIPS VM 1.7.01st of November 2011
Live Virtual Machine for OpenSIPS 1.7... MI via HTTP25th of October 2011
Bultin HTTP server for MI... Events via RabbitMQ12th of October 2011
Event Interface can push events via RabbitMQ... Key-Value Cache/DBs6th of October 2011
Script and module support for key-value oriented backend... GRUU support4th of October 2011
OpenSIPS registrar with GRUU / RFC5627... OpenSIPS 1.8.0 preview30th of September 2011
What is set to be done for OpenSIPS 1.8.0... OpenSIPS eBootcamp28th of July 2011
New Ebootcamp session starting on 19th of September. OpenSIPS 1.7.012nd of July 2011
OpenSIPS 1.7.0 major release ready... ClueCon 201111th of July 2011
Talks and one-day free training New in 1.7.06th of July 2011
What is new in OpenSIPS 1.7.0 SVN Freeze30th of June 2011
Testing phase started for 1.7 release Topology Hiding30th of June 2011
Topology Hiding based on dialog module New AVP naming23rd of June 2011
A simpler and more efficient way of naming AVPs DB Optimization22nd of June 2011
Multi-row DB insert operations. Event Notification Interface26th of May 2011
External interaction via the Event Interface. OpenSIPS eBootcamp28th of March 2011
New Ebootcamp session starting on 2nd of May. UAC_REGISTRANT module10th of March 2011
New module to allow OpenSIPS to UAC register. Performance degradation with complexity08th of March 2011
Tests to show how performance is affected with complexity. Load and performance monitoring22nd of February 2011
New statistics and traps for OpenSIPS monitoring. OpenSIPS 2.017th of February 2011
OpenSIPS 2.0 first code release. OpenSIPS Online Meeting15th of February 2011
OpenSIPS Online Monthly Meetings started. OpenSIPS Social Event24th of January 2011
OpenSIPS Social Event - Miami, 3rd of February. OpenSIPS eBootcamp17th of January 2011
New Ebootcamp session starting on 28th of February. OpenSIPS 1.6.420th of December 2010
OpenSIPS 1.6.4 major release ready... OpenSIPS media timeout16th of December 2010
Ghost call hunting with media timeout ... |