MCPcopy Create free account
hub / github.com/OpenSIPS/opensips / msg_callback_add

Function msg_callback_add

msg_callbacks.c:33–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31};
32
33int
34msg_callback_add(struct sip_msg *msg, cb_type_t cb_type, cb_func_t cb_func, void *cb_arg)
35{
36 struct msg_callback *msg_cb;
37
38 switch (cb_type) {
39 case REQ_PRE_FORWARD:
40 if (msg->first_line.type == SIP_REQUEST)
41 break;
42 LM_ERR("programmatic error - REQ_PRE_FORWARD can only be registered on requests!");
43 return (-1);
44
45 default:
46 break;
47 }
48
49 msg_cb = pkg_malloc(sizeof(*msg_cb));
50 if (msg_cb == NULL) {
51 LM_ERR("can't allocate memory\n");
52 return (-1);
53 }
54 msg_cb->cb_type = cb_type;
55 msg_cb->cb_func = cb_func;
56 msg_cb->cb_arg = cb_arg;
57 msg_cb->next = msg->msg_cb;
58 msg->msg_cb = msg_cb;
59 return 0;
60}
61
62void
63msg_callback_process(struct sip_msg *msg, cb_type_t cb_type, void *core_arg)

Callers 1

force_rtpproxy_body_partFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected