Пожалуйста, войдите здесь. Часто задаваемые вопросы О нас
Задайте Ваш вопрос

История изменений [назад]

нажмите, чтобы скрыть/показать версии 1
изначальная версия
редактировать

ответил 2012-10-10 13:44:56 +0400

zzuz Gravatar zzuz flag of Russian Federation

http://line24.ru/
**core show function CUT** 

  -= Info about function 'CUT' =- 

[Syntax]
CUT(<varname>,<char-delim>,<range-spec>)

[Synopsis]
Slices and dices strings, based upon a named delimiter.

[Description]
  varname    - variable you want cut
  char-delim - defaults to '-'
  range-spec - number of the field you want (1-based offset)
             may also be specified as a range (with -)
             or group of ranges and fields (with &)
**core core show function CUT** CUT 

  -= Info about function 'CUT' =- 

[Syntax]
CUT(<varname>,<char-delim>,<range-spec>)

[Synopsis]
Slices and dices strings, based upon a named delimiter.

[Description]
  varname    - variable you want cut
  char-delim - defaults to '-'
  range-spec - number of the field you want (1-based offset)
             may also be specified as a range (with -)
             or group of ranges and fields (with &)
core show function CUT 

  -= Info about function 'CUT' =- 

[Syntax]
CUT(<varname>,<char-delim>,<range-spec>)

[Synopsis]
Slices and dices strings, based upon a named delimiter.

[Description]
  varname    - variable you want cut
  char-delim - defaults to '-'
  range-spec - number of the field you want (1-based offset)
             may also be specified as a range (with -)
             or group of ranges and fields (with &)

в Вашем случае это будет так

exten => s,n,NoOp(${Dolg})
exten => s,n,GotoIf($[${Dolg}>0]?:200)
exten => s,n,PlayBack(vm-youhave)
exten => s,n,SayNumber(${CUT(${Dolg},\,,1)})
exten => s,n,PlayBack(rubls); rubls.alaw - скажет рублей
exten => s,n,SayNumber(${CUT(${Dolg},\,,2)})
exten => s,n,PlayBack(kopeek); rubls.alaw - скажет рублей
core show function CUT 

  -= Info about function 'CUT' =- 

[Syntax]
CUT(<varname>,<char-delim>,<range-spec>)

[Synopsis]
Slices and dices strings, based upon a named delimiter.

[Description]
  varname    - variable you want cut
  char-delim - defaults to '-'
  range-spec - number of the field you want (1-based offset)
             may also be specified as a range (with -)
             or group of ranges and fields (with &)

в Вашем случае это будет так

exten => s,n,NoOp(${Dolg})
exten => s,n,GotoIf($[${Dolg}>0]?:200)
exten => s,n,PlayBack(vm-youhave)
exten => s,n,SayNumber(${CUT(${Dolg},\,,1)})
exten => s,n,PlayBack(rubls); rubls.alaw - скажет рублей
exten => s,n,SayNumber(${CUT(${Dolg},\,,2)})
exten => s,n,PlayBack(kopeek); rubls.alaw kopeek.alaw - скажет рублей
копеек
core show function CUT 

  -= Info about function 'CUT' =- 

[Syntax]
CUT(<varname>,<char-delim>,<range-spec>)

[Synopsis]
Slices and dices strings, based upon a named delimiter.

[Description]
  varname    - variable you want cut
  char-delim - defaults to '-'
  range-spec - number of the field you want (1-based offset)
             may also be specified as a range (with -)
             or group of ranges and fields (with &)

в Вашем случае это будет так

exten => s,n,NoOp(${Dolg})
exten => s,n,GotoIf($[${Dolg}>0]?:200)
exten => s,n,PlayBack(vm-youhave)
exten => s,n,SayNumber(${CUT(${Dolg},\,,1)})
s,n,SayNumber(${CUT(${Dolg},.,1)})
exten => s,n,PlayBack(rubls); rubls.alaw - скажет рублей
exten => s,n,SayNumber(${CUT(${Dolg},\,,2)})
s,n,SayNumber(${CUT(${Dolg},.,2)})
exten => s,n,PlayBack(kopeek); kopeek.alaw - скажет копеек

Проект компании "АТС Дизайн"
Asterisk® и Digium® являются зарегистрированными торговыми марками компании Digium, Inc., США.
IP АТС Asterisk распространяется под лицензией GNU GPL.