Name

SPRINTF — Formats a string

Synopsis

SPRINTF(format|arg1[|...argN])

Formats a variable or set of variables according to a format string.

The most common case for the use of SPRINTF is to zero-pad a number to a certain length:

; Returns 00123
exten => 123,1,Set(padfive=${SPRINTF(%05d,${EXTEN})})  

Most of the format options listed in the manpage for sprintf(3) are also implemented in this dialplan function.

See Also

STRFTIME()

Get Asterisk: The Future of Telephony, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.