diff options
author | George Joseph <george.joseph@fairview5.com> | 2015-05-20 10:11:20 -0600 |
---|---|---|
committer | George Joseph <george.joseph@fairview5.com> | 2015-05-22 10:17:32 -0500 |
commit | 29ef6571cb5628aa4843e1d96916c0510aeb528f (patch) | |
tree | 8b26b4a2c970fa9b862f874468415f9e183aae60 /res/res_pjsip | |
parent | 8e083830e2c933f8c52c58fb31087584ce01d133 (diff) |
res_pjsip: Refactor endpt_send_transaction (qualify_timeout)
This patch refactors the transaction timeout processing to eliminate
calling the lower level public pjsip functions and reverts to calling
pjsip_endpt_send_request again. This is the result of me noticing
a possible incompatibility with pjproject-2.4 which was causing
contact status flapping.
The original version of this feature used the lower level calls to
get access to the tsx structure in order to cancel the transaction
when our own timer expires. Since we no longer have that access,
if our own timer expires before the pjsip timer, we call the callbacks
and just let the pjsip transaction take it's own course. When the
transaction ends, it discovers the callbacks have already been run
and just cleans itself up.
A few messages in pjsip_configuration were also added/cleaned up.
ASTERISK-25105 #close
Change-Id: I0810f3999cf63f3a72607bbecac36af0a957f33e
Reported-by: George Joseph <george.joseph@fairview5.com>
Tested-by: George Joseph <george.joseph@fairview5.com>
Diffstat (limited to 'res/res_pjsip')
-rw-r--r-- | res/res_pjsip/pjsip_configuration.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/res/res_pjsip/pjsip_configuration.c b/res/res_pjsip/pjsip_configuration.c index f147b34d3..9fa18c760 100644 --- a/res/res_pjsip/pjsip_configuration.c +++ b/res/res_pjsip/pjsip_configuration.c @@ -121,9 +121,20 @@ static int persistent_endpoint_update_state(void *obj, void *arg, int flags) /*! \brief Function called when stuff relating to a contact happens (created/deleted) */ static void persistent_endpoint_contact_created_observer(const void *object) { - char *id = ast_strdupa(ast_sorcery_object_get_id(object)), *aor = NULL; + char *id = ast_strdupa(ast_sorcery_object_get_id(object)); + char *aor = NULL; + char *contact = NULL; + + aor = id; + /* Dynamic contacts are delimited with ";@" and static ones with "@@" */ + if ((contact = strstr(id, ";@")) || (contact = strstr(id, "@@"))) { + *contact = '\0'; + contact += 2; + } else { + contact = id; + } - aor = strsep(&id, ";@"); + ast_verb(1, "Contact %s/%s has been created\n", aor, contact); ao2_callback(persistent_endpoints, OBJ_NODATA, persistent_endpoint_update_state, aor); } @@ -144,7 +155,7 @@ static void persistent_endpoint_contact_deleted_observer(const void *object) contact = id; } - ast_verb(1, "Contact %s/%s is now Unavailable\n", aor, contact); + ast_verb(1, "Contact %s/%s has been deleted\n", aor, contact); ao2_callback(persistent_endpoints, OBJ_NODATA, persistent_endpoint_update_state, aor); } |