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

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

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

спросил 2014-05-27 16:25:17 +0400

The_KOPACb Gravatar The_KOPACb

манипуляции с CID

В какой момент обновляется переменная? Я пытаюсь приводить CID к "общему" виду, так чтобы можно было перезванивать назад без дополнительных телодвижений.

exten => cid-reread,1,Noop(=== Caller ID manipulation, CID=${CALLERID(num)} ===)
            same => n,Set(CALLERID(num)=${IF([REGEX("^7812[0-9]\{7\}$" , ${CALLERID(num)} ) = 1 ]?${CALLERID(name):3})})
            same => n,NoOp(=== New CID is ${CALLERID(num)} ===)
            same => n,Set(CALLERID(num)=${IF([REGEX("^812[0-9]\{7\}$" , ${CALLERID(num)} ) = 1 ]?${CALLERID(name):3})})
            same => n,NoOp(=== New CID is ${CALLERID(num)} ===)
            same => n,Set(CALLERID(num)=${IF([REGEX("^[0-9]\{10\}$" , ${CALLERID(num)} ) = 1 ]?+7${CALLERID(name)})})
            same => n,NoOp(=== New CID is ${CALLERID(num)} ===)
            same => n,GoTo(incoming,incoming,1)

в логе астериска странные вещи происходят

-- Executing [cid-reread@incoming:1] NoOp("SIP/", "=== Caller ID manipulation, CID=8121234567 ===") in new stack -- Executing [cid-reread@incoming:2] Set("SIP/", "CALLERID(num)=1234567") in new stack -- Executing [cid-reread@incoming:3] NoOp("SIP/", "=== New CID is 1234567 ===") in new stack -- Executing [cid-reread@incoming:4] Set("SIP/", "CALLERID(num)=1234567") in new stack -- Executing [cid-reread@incoming:5] NoOp("SIP/", "=== New CID is 1234567 ===") in new stack -- Executing [cid-reread@incoming:6] Set("SIP/", "CALLERID(num)=+78121234567") in new stack -- Executing [cid-reread@incoming:7] NoOp("SIP/", "=== New CID is +78121234567 ===") in new stack -- Executing [cid-reread@incoming:8] Goto("SIP/", "incoming,incoming,1") in new stack -- Goto (incoming,incoming,1) -- Executing [incoming@incoming:1] NoOp("SIP/", "=== Incoming call from +78121234567 ===") in new stack

как получается что CALLERID(num) каждый раз перезаписывается, но подходит под все регэкспы?

манипуляции с CID

В какой момент обновляется переменная? Я пытаюсь приводить CID к "общему" виду, так чтобы можно было перезванивать назад без дополнительных телодвижений.

exten => cid-reread,1,Noop(=== Caller ID manipulation, CID=${CALLERID(num)} ===)
            same => n,Set(CALLERID(num)=${IF([REGEX("^7812[0-9]\{7\}$" , ${CALLERID(num)} ) = 1 ]?${CALLERID(name):3})})
            same => n,NoOp(=== New CID is ${CALLERID(num)} ===)
            same => n,Set(CALLERID(num)=${IF([REGEX("^812[0-9]\{7\}$" , ${CALLERID(num)} ) = 1 ]?${CALLERID(name):3})})
            same => n,NoOp(=== New CID is ${CALLERID(num)} ===)
            same => n,Set(CALLERID(num)=${IF([REGEX("^[0-9]\{10\}$" , ${CALLERID(num)} ) = 1 ]?+7${CALLERID(name)})})
            same => n,NoOp(=== New CID is ${CALLERID(num)} ===)
            same => n,GoTo(incoming,incoming,1)

в логе астериска странные вещи происходят

-- Executing [cid-reread@incoming:1] NoOp("SIP/", "=== Caller ID manipulation, CID=8121234567 ===") in new stack
-- Executing [cid-reread@incoming:2] Set("SIP/", "CALLERID(num)=1234567") in new stack
-- Executing [cid-reread@incoming:3] NoOp("SIP/", "=== New CID is 1234567 ===") in new stack
-- Executing [cid-reread@incoming:4] Set("SIP/", "CALLERID(num)=1234567") in new stack
-- Executing [cid-reread@incoming:5] NoOp("SIP/", "=== New CID is 1234567 ===") in new stack
-- Executing [cid-reread@incoming:6] Set("SIP/", "CALLERID(num)=+78121234567") in new stack
-- Executing [cid-reread@incoming:7] NoOp("SIP/", "=== New CID is +78121234567 ===") in new stack
-- Executing [cid-reread@incoming:8] Goto("SIP/", "incoming,incoming,1") in new stack
-- Goto (incoming,incoming,1)
-- Executing [incoming@incoming:1] NoOp("SIP/", "=== Incoming call from +78121234567 ===") in new stack

stack

как получается что CALLERID(num) каждый раз перезаписывается, но подходит под все регэкспы?

манипуляции с CID

В какой момент обновляется переменная? Я пытаюсь приводить CID к "общему" виду, так чтобы можно было перезванивать назад без дополнительных телодвижений.

[cid-reread] exten => cid-reread,1,Noop(=== Caller ID manipulation, CID=${CALLERID(num)} ===) same => n,Set(CALLERID(num)=${IF([REGEX("^7812[0-9]\{7\}$" n,Set(CALLERID(num)=${IF([REGEX("\<7812[0-9]\{7\}\>" , ${CALLERID(num)} ) = 1 ]?${CALLERID(name):3})}) ]?${CALLERID(num):4}:${CALLERID(num)})}) same => n,NoOp(=== New CID is ${CALLERID(num)} ===) same => n,Set(CALLERID(num)=${IF([REGEX("^812[0-9]\{7\}$" n,Set(CALLERID(num)=${IF([REGEX("^812[0-9]{7}$" , ${CALLERID(num)} ) = 1 ]?${CALLERID(name):3})}) ]?${CALLERID(num):3}:${CALLERID(num)})}) same => n,NoOp(=== New CID is ${CALLERID(num)} ===) same => n,Set(CALLERID(num)=${IF([REGEX("^[0-9]\{10\}$" n,Set(CALLERID(num)=${IF([REGEX("^[0-9]{10}$" , ${CALLERID(num)} ) = 1 ]?+7${CALLERID(name)})}) ]?+7${CALLERID(num)}:${CALLERID(num)})}) same => n,NoOp(=== New CID is ${CALLERID(num)} ===) same => n,GoTo(incoming,incoming,1)

n,GoTo(incoming,incoming,1)

в логе астериска странные вещи происходят

  -- Executing [6770285@megapolis:1] Goto("SIP/obit-000003d2", "incoming,cid-reread,1") in new stack
    -- Goto (incoming,cid-reread,1)
    -- Executing [cid-reread@incoming:1] NoOp("SIP/", NoOp("SIP/obit-000003d2", "=== Caller ID manipulation, CID=8121234567 ===") in new stack
 -- Executing [cid-reread@incoming:2] Set("SIP/", "CALLERID(num)=1234567") in new stack
Set("SIP/obit-000003d2", "CALLERID(num)=234567") in new stack
    -- Executing [cid-reread@incoming:3] NoOp("SIP/", "=== New CID is 1234567 ===") in new stack
NoOp("SIP/obit-000003d2", "=== New CID is 234567 ===") in new stack
    -- Executing [cid-reread@incoming:4] Set("SIP/", "CALLERID(num)=1234567") in new stack
Set("SIP/obit-000003d2", "CALLERID(num)=567") in new stack
    -- Executing [cid-reread@incoming:5] NoOp("SIP/", "=== New CID is 1234567 ===") in new stack
NoOp("SIP/obit-000003d2", "=== New CID is 567 ===") in new stack
    -- Executing [cid-reread@incoming:6] Set("SIP/", "CALLERID(num)=+78121234567") in new stack
Set("SIP/obit-000003d2", "CALLERID(num)=+7567") in new stack
    -- Executing [cid-reread@incoming:7] NoOp("SIP/", "=== New CID is +78121234567 ===") in new stack
NoOp("SIP/obit-000003d2", "=== New CID is +7567 ===") in new stack
    -- Executing [cid-reread@incoming:8] Goto("SIP/", Goto("SIP/obit-000003d2", "incoming,incoming,1") in new stack
 -- Goto (incoming,incoming,1)
 -- Executing [incoming@incoming:1] NoOp("SIP/", "=== NoOp("SIP/obit-000003d2", "=== Obit: Incoming call from +78121234567 +7567 ===") in new stack

как получается что CALLERID(num) каждый раз перезаписывается, но подходит под все регэкспы?

манипуляции с CID

В какой момент обновляется переменная? Я пытаюсь приводить CID к "общему" виду, так чтобы можно было перезванивать назад без дополнительных телодвижений.

[cid-reread]
exten => cid-reread,1,Noop(=== Caller ID manipulation, CID=${CALLERID(num)} ===)
            same => n,Set(CALLERID(num)=${IF([REGEX("\<7812[0-9]\{7\}\>" , ${CALLERID(num)} ) = 1 ]?${CALLERID(num):4}:${CALLERID(num)})})
            same => n,NoOp(=== New CID is ${CALLERID(num)} ===)
            same => n,Set(CALLERID(num)=${IF([REGEX("^812[0-9]{7}$" n,Set(CALLERID(num)=${IF([REGEX("^812[0-9]\{7\}$" , ${CALLERID(num)} ) = 1 ]?${CALLERID(num):3}:${CALLERID(num)})})
            same => n,NoOp(=== New CID is ${CALLERID(num)} ===)
            same => n,Set(CALLERID(num)=${IF([REGEX("^[0-9]{10}$" n,Set(CALLERID(num)=${IF([REGEX("^[0-9]\{10\}$" , ${CALLERID(num)} ) = 1 ]?+7${CALLERID(num)}:${CALLERID(num)})})
            same => n,NoOp(=== New CID is ${CALLERID(num)} ===)
            same => n,GoTo(incoming,incoming,1)

n,GoTo(incoming,incoming,1)

в логе астериска странные вещи происходят

  -- Executing [6770285@megapolis:1] Goto("SIP/obit-000003d2", Goto("SIP/", "incoming,cid-reread,1") in new stack
    -- Goto (incoming,cid-reread,1)
    -- Executing [cid-reread@incoming:1] NoOp("SIP/obit-000003d2", NoOp("SIP/", "=== Caller ID manipulation, CID=8121234567 ===") in new stack
    -- Executing [cid-reread@incoming:2] Set("SIP/obit-000003d2", Set("SIP/", "CALLERID(num)=234567") in new stack
    -- Executing [cid-reread@incoming:3] NoOp("SIP/obit-000003d2", NoOp("SIP/", "=== New CID is 234567 ===") in new stack
    -- Executing [cid-reread@incoming:4] Set("SIP/obit-000003d2", Set("SIP/", "CALLERID(num)=567") in new stack
    -- Executing [cid-reread@incoming:5] NoOp("SIP/obit-000003d2", NoOp("SIP/", "=== New CID is 567 ===") in new stack
    -- Executing [cid-reread@incoming:6] Set("SIP/obit-000003d2", Set("SIP/", "CALLERID(num)=+7567") in new stack
    -- Executing [cid-reread@incoming:7] NoOp("SIP/obit-000003d2", NoOp("SIP/", "=== New CID is +7567 ===") in new stack
    -- Executing [cid-reread@incoming:8] Goto("SIP/obit-000003d2", Goto("SIP/", "incoming,incoming,1") in new stack
    -- Goto (incoming,incoming,1)
    -- Executing [incoming@incoming:1] NoOp("SIP/obit-000003d2", "=== Obit: Incoming call from +7567 ===") in new stack

как получается что CALLERID(num) каждый раз перезаписывается, но подходит под все регэкспы?

манипуляции с CID

В какой момент обновляется переменная? Я пытаюсь приводить CID к "общему" виду, так чтобы можно было перезванивать назад без дополнительных телодвижений.

[cid-reread]
exten => cid-reread,1,Noop(=== Caller ID manipulation, CID=${CALLERID(num)} ===)
            same => n,Set(CALLERID(num)=${IF([REGEX("\<7812[0-9]\{7\}\>" , ${CALLERID(num)} ) = 1 ]?${CALLERID(num):4}:${CALLERID(num)})})
            same => n,NoOp(=== New CID is ${CALLERID(num)} ===)
            same => n,Set(CALLERID(num)=${IF([REGEX("^812[0-9]\{7\}$" , ${CALLERID(num)} ) = 1 ]?${CALLERID(num):3}:${CALLERID(num)})})
            same => n,NoOp(=== New CID is ${CALLERID(num)} ===)
            same => n,Set(CALLERID(num)=${IF([REGEX("^[0-9]\{10\}$" , ${CALLERID(num)} ) = 1 ]?+7${CALLERID(num)}:${CALLERID(num)})})
            same => n,NoOp(=== New CID is ${CALLERID(num)} ===)
            same => n,GoTo(incoming,incoming,1)

в логе астериска странные вещи происходят

  -- Executing [6770285@megapolis:1] Goto("SIP/", "incoming,cid-reread,1") in new stack
    -- Goto (incoming,cid-reread,1)
    -- Executing [cid-reread@incoming:1] NoOp("SIP/", "=== Caller ID manipulation, CID=8121234567 ===") in new stack
    -- Executing [cid-reread@incoming:2] Set("SIP/", "CALLERID(num)=234567") in new stack
    -- Executing [cid-reread@incoming:3] NoOp("SIP/", "=== New CID is 234567 ===") in new stack
    -- Executing [cid-reread@incoming:4] Set("SIP/", "CALLERID(num)=567") in new stack
    -- Executing [cid-reread@incoming:5] NoOp("SIP/", "=== New CID is 567 ===") in new stack
    -- Executing [cid-reread@incoming:6] Set("SIP/", "CALLERID(num)=+7567") in new stack
    -- Executing [cid-reread@incoming:7] NoOp("SIP/", "=== New CID is +7567 ===") in new stack
    -- Executing [cid-reread@incoming:8] Goto("SIP/", "incoming,incoming,1") in new stack
    -- Goto (incoming,incoming,1)
    -- Executing [incoming@incoming:1] NoOp("SIP/obit-000003d2", "=== Obit: Incoming call from +7567 ===") in new stack

как получается что CALLERID(num) каждый раз перезаписывается, но подходит под все регэкспы?

при этом

root@Bakemono:~# cat test
1234567
8121234567
4951234567
78128128121
7495495495
9211234567
89219219212
79219219212

root@Bakemono:~# grep '^812[0-9]\{7\}$' test
8121234567
root@Bakemono:~# grep '^7812[0-9]\{7\}$' test
78128128121
root@Bakemono:~# grep '^[0-9]\{10\}$' test
8121234567
4951234567
7495495495
9211234567

манипуляции с CIDCID с помощью REGEX

В какой момент обновляется переменная? Я пытаюсь приводить CID к "общему" виду, так чтобы можно было перезванивать назад без дополнительных телодвижений.

[cid-reread]
exten => cid-reread,1,Noop(=== Caller ID manipulation, CID=${CALLERID(num)} ===)
            same => n,Set(CALLERID(num)=${IF([REGEX("\<7812[0-9]\{7\}\>" , ${CALLERID(num)} ) = 1 ]?${CALLERID(num):4}:${CALLERID(num)})})
            same => n,NoOp(=== New CID is ${CALLERID(num)} ===)
            same => n,Set(CALLERID(num)=${IF([REGEX("^812[0-9]\{7\}$" , ${CALLERID(num)} ) = 1 ]?${CALLERID(num):3}:${CALLERID(num)})})
            same => n,NoOp(=== New CID is ${CALLERID(num)} ===)
            same => n,Set(CALLERID(num)=${IF([REGEX("^[0-9]\{10\}$" , ${CALLERID(num)} ) = 1 ]?+7${CALLERID(num)}:${CALLERID(num)})})
            same => n,NoOp(=== New CID is ${CALLERID(num)} ===)
            same => n,GoTo(incoming,incoming,1)

в логе астериска странные вещи происходят

  -- Executing [6770285@megapolis:1] Goto("SIP/", "incoming,cid-reread,1") in new stack
    -- Goto (incoming,cid-reread,1)
    -- Executing [cid-reread@incoming:1] NoOp("SIP/", "=== Caller ID manipulation, CID=8121234567 ===") in new stack
    -- Executing [cid-reread@incoming:2] Set("SIP/", "CALLERID(num)=234567") in new stack
    -- Executing [cid-reread@incoming:3] NoOp("SIP/", "=== New CID is 234567 ===") in new stack
    -- Executing [cid-reread@incoming:4] Set("SIP/", "CALLERID(num)=567") in new stack
    -- Executing [cid-reread@incoming:5] NoOp("SIP/", "=== New CID is 567 ===") in new stack
    -- Executing [cid-reread@incoming:6] Set("SIP/", "CALLERID(num)=+7567") in new stack
    -- Executing [cid-reread@incoming:7] NoOp("SIP/", "=== New CID is +7567 ===") in new stack
    -- Executing [cid-reread@incoming:8] Goto("SIP/", "incoming,incoming,1") in new stack
    -- Goto (incoming,incoming,1)
    -- Executing [incoming@incoming:1] NoOp("SIP/obit-000003d2", "=== Obit: Incoming call from +7567 ===") in new stack

как получается что CALLERID(num) каждый раз перезаписывается, но подходит под все регэкспы?

при этом

root@Bakemono:~# cat test
1234567
8121234567
4951234567
78128128121
7495495495
9211234567
89219219212
79219219212

root@Bakemono:~# grep '^812[0-9]\{7\}$' test
8121234567
root@Bakemono:~# grep '^7812[0-9]\{7\}$' test
78128128121
root@Bakemono:~# grep '^[0-9]\{10\}$' test
8121234567
4951234567
7495495495
9211234567

манипуляции с CID с помощью REGEX

В какой момент обновляется переменная? Я пытаюсь приводить CID к "общему" виду, так чтобы можно было перезванивать назад без дополнительных телодвижений.

[cid-reread]
exten => cid-reread,1,Noop(=== Caller ID manipulation, CID=${CALLERID(num)} ===)
            same => n,Set(CALLERID(num)=${IF([REGEX("\<7812[0-9]\{7\}\>" , ${CALLERID(num)} ) = 1 ]?${CALLERID(num):4}:${CALLERID(num)})})
            same => n,NoOp(=== New CID is ${CALLERID(num)} ===)
            same => n,Set(CALLERID(num)=${IF([REGEX("^812[0-9]\{7\}$" , ${CALLERID(num)} ) = 1 ]?${CALLERID(num):3}:${CALLERID(num)})})
            same => n,NoOp(=== New CID is ${CALLERID(num)} ===)
            same => n,Set(CALLERID(num)=${IF([REGEX("^[0-9]\{10\}$" , ${CALLERID(num)} ) = 1 ]?+7${CALLERID(num)}:${CALLERID(num)})})
            same => n,NoOp(=== New CID is ${CALLERID(num)} ===)
            same => n,GoTo(incoming,incoming,1)

в логе астериска странные вещи происходят

  -- Executing [6770285@megapolis:1] [@:1] Goto("SIP/", "incoming,cid-reread,1") in new stack
    -- Goto (incoming,cid-reread,1)
    -- Executing [cid-reread@incoming:1] NoOp("SIP/", "=== Caller ID manipulation, CID=8121234567 ===") in new stack
    -- Executing [cid-reread@incoming:2] Set("SIP/", "CALLERID(num)=234567") in new stack
    -- Executing [cid-reread@incoming:3] NoOp("SIP/", "=== New CID is 234567 ===") in new stack
    -- Executing [cid-reread@incoming:4] Set("SIP/", "CALLERID(num)=567") in new stack
    -- Executing [cid-reread@incoming:5] NoOp("SIP/", "=== New CID is 567 ===") in new stack
    -- Executing [cid-reread@incoming:6] Set("SIP/", "CALLERID(num)=+7567") in new stack
    -- Executing [cid-reread@incoming:7] NoOp("SIP/", "=== New CID is +7567 ===") in new stack
    -- Executing [cid-reread@incoming:8] Goto("SIP/", "incoming,incoming,1") in new stack
    -- Goto (incoming,incoming,1)
    -- Executing [incoming@incoming:1] NoOp("SIP/obit-000003d2", "=== Obit: Incoming call from +7567 ===") in new stack

как получается что CALLERID(num) каждый раз перезаписывается, но подходит под все регэкспы?

при этом

root@Bakemono:~# cat test
1234567
8121234567
4951234567
78128128121
7495495495
9211234567
89219219212
79219219212

root@Bakemono:~# grep '^812[0-9]\{7\}$' test
8121234567
root@Bakemono:~# grep '^7812[0-9]\{7\}$' test
78128128121
root@Bakemono:~# grep '^[0-9]\{10\}$' test
8121234567
4951234567
7495495495
9211234567

манипуляции с CID с помощью REGEX

В какой момент обновляется переменная? Я пытаюсь приводить CID к "общему" виду, так чтобы можно было перезванивать назад без дополнительных телодвижений.

[cid-reread]
exten => cid-reread,1,Noop(=== Caller ID manipulation, CID=${CALLERID(num)} ===)
            same => n,Set(CALLERID(num)=${IF([REGEX("\<7812[0-9]\{7\}\>" , ${CALLERID(num)} ) = 1 ]?${CALLERID(num):4}:${CALLERID(num)})})
            same => n,NoOp(=== New CID is ${CALLERID(num)} ===)
            same => n,Set(CALLERID(num)=${IF([REGEX("^812[0-9]\{7\}$" , ${CALLERID(num)} ) = 1 ]?${CALLERID(num):3}:${CALLERID(num)})})
            same => n,NoOp(=== New CID is ${CALLERID(num)} ===)
            same => n,Set(CALLERID(num)=${IF([REGEX("^[0-9]\{10\}$" , ${CALLERID(num)} ) = 1 ]?+7${CALLERID(num)}:${CALLERID(num)})})
            same => n,NoOp(=== New CID is ${CALLERID(num)} ===)
            same => n,GoTo(incoming,incoming,1)

в логе астериска странные вещи происходят

  -- Executing [@:1] Goto("SIP/", "incoming,cid-reread,1") in new stack
    -- Goto (incoming,cid-reread,1)
    -- Executing [cid-reread@incoming:1] NoOp("SIP/", "=== Caller ID manipulation, CID=8121234567 ===") in new stack
    -- Executing [cid-reread@incoming:2] Set("SIP/", "CALLERID(num)=234567") in new stack
    -- Executing [cid-reread@incoming:3] NoOp("SIP/", "=== New CID is 234567 ===") in new stack
    -- Executing [cid-reread@incoming:4] Set("SIP/", "CALLERID(num)=567") in new stack
    -- Executing [cid-reread@incoming:5] NoOp("SIP/", "=== New CID is 567 ===") in new stack
    -- Executing [cid-reread@incoming:6] Set("SIP/", "CALLERID(num)=+7567") in new stack
    -- Executing [cid-reread@incoming:7] NoOp("SIP/", "=== New CID is +7567 ===") in new stack
    -- Executing [cid-reread@incoming:8] Goto("SIP/", "incoming,incoming,1") in new stack
    -- Goto (incoming,incoming,1)
    -- Executing [incoming@incoming:1] NoOp("SIP/obit-000003d2", NoOp("SIP/", "=== Obit: Incoming call from +7567 ===") in new stack

как получается что CALLERID(num) каждый раз перезаписывается, но подходит под все регэкспы?

при этом

root@Bakemono:~# cat test
1234567
8121234567
4951234567
78128128121
7495495495
9211234567
89219219212
79219219212

root@Bakemono:~# grep '^812[0-9]\{7\}$' test
8121234567
root@Bakemono:~# grep '^7812[0-9]\{7\}$' test
78128128121
root@Bakemono:~# grep '^[0-9]\{10\}$' test
8121234567
4951234567
7495495495
9211234567

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