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

Function pv_get_formated_time

pvar.c:513–533  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

511}
512
513static int pv_get_formated_time(struct sip_msg *msg, pv_param_t *param,
514 pv_value_t *res)
515{
516 static char buf[128];
517 struct tm ltime;
518 time_t t;
519
520 if(msg==NULL)
521 return -1;
522
523 time( &t );
524 localtime_r(&t, &ltime);
525 res->rs.len = strftime( buf, 127, param->pvn.u.isname.name.s.s, &ltime);
526
527 if (res->rs.len<=0)
528 return pv_get_null(msg, param, res);
529
530 res->rs.s = buf;
531 res->flags = PV_VAL_STR;
532 return 0;
533}
534
535#define CTIME_BUFFER_NO 5
536#define CTIME_BUFFER_SIZE 26

Callers

nothing calls this directly

Calls 1

pv_get_nullFunction · 0.85

Tested by

no test coverage detected