diff options
author | Corey Farrell <git@cfware.com> | 2015-03-19 09:53:37 +0000 |
---|---|---|
committer | Corey Farrell <git@cfware.com> | 2015-03-19 09:53:37 +0000 |
commit | 958bc84cafd43963f0a016f8979ec962c49af517 (patch) | |
tree | 7f9d8faecc625149da7c4e157bc0837fc46e6c42 /channels/sip/include/dialog.h | |
parent | 7fddae99dd8f3f77245a5d9811734259a5f9e138 (diff) |
chan_sip: Simplify dialog/peer references, improve REF_DEBUG output.
* Replace functions for ref/undef of dialogs and peers with macro's
to call ao2_t_bump/ao2_t_cleanup.
* Enable passthough of REF_DEBUG caller information to sip_alloc and
find_call.
ASTERISK-24882 #close
Reported by: Corey Farrell
Review: https://reviewboard.asterisk.org/r/4189/
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@433115 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels/sip/include/dialog.h')
-rw-r--r-- | channels/sip/include/dialog.h | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/channels/sip/include/dialog.h b/channels/sip/include/dialog.h index ea2fb457c..582841d54 100644 --- a/channels/sip/include/dialog.h +++ b/channels/sip/include/dialog.h @@ -29,13 +29,16 @@ * functions so we keep track of the refcounts. * To simplify the code, we allow a NULL to be passed to dialog_unref(). */ -#define dialog_ref(arg1,arg2) dialog_ref_debug((arg1),(arg2), __FILE__, __LINE__, __PRETTY_FUNCTION__) -#define dialog_unref(arg1,arg2) dialog_unref_debug((arg1),(arg2), __FILE__, __LINE__, __PRETTY_FUNCTION__) -struct sip_pvt *dialog_ref_debug(struct sip_pvt *p, const char *tag, char *file, int line, const char *func); -struct sip_pvt *dialog_unref_debug(struct sip_pvt *p, const char *tag, char *file, int line, const char *func); +#define dialog_ref(dialog, tag) ao2_t_bump(dialog, tag) +#define dialog_unref(dialog, tag) ({ ao2_t_cleanup(dialog, tag); (NULL); }) + +struct sip_pvt *__sip_alloc(ast_string_field callid, struct ast_sockaddr *sin, + int useglobal_nat, const int intended_method, struct sip_request *req, struct ast_callid *logger_callid, + const char *file, int line, const char *func); + +#define sip_alloc(callid, addr, useglobal_nat, intended_method, req, logger_callid) \ + __sip_alloc(callid, addr, useglobal_nat, intended_method, req, logger_callid, __FILE__, __LINE__, __PRETTY_FUNCTION__) -struct sip_pvt *sip_alloc(ast_string_field callid, struct ast_sockaddr *sin, - int useglobal_nat, const int intended_method, struct sip_request *req, struct ast_callid *logger_callid); void sip_scheddestroy_final(struct sip_pvt *p, int ms); void sip_scheddestroy(struct sip_pvt *p, int ms); int sip_cancel_destroy(struct sip_pvt *p); |