O'Reilly logo

Asterisk: The Future of Telephony by Leif Madsen, Jared Smith, Jim Van Meggelen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

StripLSD() — Strips the specified number of trailing (least significant) digits from the current extension

Synopsis

    StripLSD(count)

Strips the trailing count digits from the channel’s associated extension and continues processing at the next priority for the resulting extension. So, for example, if priority 1 of extension 5551212 is StripLSD(4), the last 4 digits will be stripped from 5551212 and the next step executed will be priority 2 of extension 555. If you switch into an extension that has no priority n+1 (where n is the current priority), the PBX will treat it as though the user dialed an invalid extension.

Always returns 0.

This application is deprecated and has been replaced with the substring expression ${EXTEN: X : Y }.

               exten => 5551212,1,StripLSD(4)
    exten => 555,2,SayDigits(${EXTEN})

    ; a better way of doing the same thing
    exten => 5551234,1,SayDigits(${EXTEN::3})

See Also

StripMSD(), README.variables, variable substring syntax

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required