]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Merge "res/res_pjsip_outbound_registration: Add registration statistics for StatsD...
authorMatt Jordan <mjordan@digium.com>
Mon, 23 Nov 2015 15:26:14 +0000 (09:26 -0600)
committerGerrit Code Review <gerrit2@gerrit.digium.api>
Mon, 23 Nov 2015 15:26:15 +0000 (09:26 -0600)
1  2 
res/res_pjsip_outbound_registration.c

index 9795a5971a053f4c1188d65893d7340206b3d6a1,22657ecd6ed3e87e2f80295aecd4deb03589475a..6f3155d8b7c0ebee67dbb1ae4f866f20b5ac8682
@@@ -796,21 -796,14 +810,21 @@@ static int handle_registration_response
        if (PJSIP_IS_STATUS_IN_CLASS(response->code, 200)) {
                /* Check if this is in regards to registering or unregistering */
                if (response->expiration) {
 +                      int next_registration_round;
 +
                        /* If the registration went fine simply reschedule registration for the future */
                        ast_debug(1, "Outbound registration to '%s' with client '%s' successful\n", server_uri, client_uri);
-                       response->client_state->status = SIP_REGISTRATION_REGISTERED;
+                       update_client_state_status(response->client_state, SIP_REGISTRATION_REGISTERED);
                        response->client_state->retries = 0;
 -                      schedule_registration(response->client_state, response->expiration - REREGISTER_BUFFER_TIME);
 +                      next_registration_round = response->expiration - REREGISTER_BUFFER_TIME;
 +                      if (next_registration_round < 0) {
 +                              /* Re-register immediately. */
 +                              next_registration_round = 0;
 +                      }
 +                      schedule_registration(response->client_state, next_registration_round);
                } else {
                        ast_debug(1, "Outbound unregistration to '%s' with client '%s' successful\n", server_uri, client_uri);
-                       response->client_state->status = SIP_REGISTRATION_UNREGISTERED;
+                       update_client_state_status(response->client_state, SIP_REGISTRATION_UNREGISTERED);
                }
        } else if (response->client_state->destroy) {
                /* We need to deal with the pending destruction instead. */