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

Function mk_action

route_struct.c:92–127  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

90
91
92struct action* mk_action(int type, int n, action_elem_t *elem,
93 int line, char *file)
94{
95 int i;
96 struct action* a;
97
98 if(n>MAX_ACTION_ELEMS)
99 {
100 LM_ERR("too many action elements at %s:%d for %d",
101 file, line, type);
102 return 0;
103 }
104
105 a=(struct action*)pkg_malloc(sizeof(struct action));
106 if (a==0) goto error;
107 memset(a,0,sizeof(struct action));
108 a->type=type;
109
110 for(i=0; i<n; i++)
111 {
112 a->elem[i].type = elem[i].type;
113 a->elem[i].u.data = elem[i].u.data;
114 if(a->elem[i].type==STR_ST && a->elem[i].u.s.s!=NULL)
115 a->elem[i].u.s.len = strlen(a->elem[i].u.s.s);
116 }
117
118 a->line = line;
119 a->file = file;
120 a->next=0;
121 return a;
122
123error:
124 LM_CRIT("pkg memory allocation failure\n");
125 return 0;
126
127}
128
129
130struct action* append_action(struct action* a, struct action* b)

Callers 2

msg_call_functionFunction · 0.85
l_siplua_moduleFuncFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected