Надо определить кто положил трубку.
Вроде простая вещь, а найти как узнать не могу.
Нашел CHANNEL(hangupsource) - но он работает только для SIP устройств.
А как быть с DAHDI устройствами?
это - это что?это присутствует во всех каналах начиная с 1.6.3 и 1.8
Код: Выделить всё
@@ -1283,7 +1283,7 @@
* \param chan channel to set the field on
* \param source a string describing the source of the hangup for this channel
*
- * \since 1.6.3
+ * \since 1.8
*
* Hangupsource is generally the channel name that caused the bridge to be
* hung up, but it can also be other things such as "dialplan/agi"
Код: Выделить всё
exten => h,1,NoOp(hangupsource = ${CHANNEL(hangupsource)})
И не работает для Dahdi:[Jun 21 23:05:08] -- Executing [h@office:1] NoOp("SIP/102-0000002b", "hangupsource = SIP/102-0000002b") in new stack
[Jun 21 23:01:10] -- Executing [h@office:1] NoOp("SIP/102-00000023", "hangupsource = ") in new stack
Код: Выделить всё
[Jun 22 11:47:02] -- Starting simple switch on 'DAHDI/1-1'
[Jun 22 11:47:03] -- Executing [s@trunc-from_dahdi:1] NoOp("DAHDI/1-1", "Incomming call to PSTN from [XXX]") in new stack
[Jun 22 11:47:03] -- Executing [s@trunc-from_dahdi:2] Set("DAHDI/1-1", "CALLERID(all)=PSTN <XXX>") in new stack
[Jun 22 11:47:03] -- Executing [s@trunc-from_dahdi:3] Dial("DAHDI/1-1", "SIP/101&DAHDI/2,,F") in new stack
[Jun 22 11:47:03] == Using SIP RTP CoS mark 5
[Jun 22 11:47:03] -- Called 101
[Jun 22 11:47:03] -- Called 2
[Jun 22 11:47:03] -- DAHDI/2-1 is ringing
[Jun 22 11:47:03] -- SIP/101-00000038 is ringing
[Jun 22 11:47:04] -- DAHDI/2-1 is ringing
[Jun 22 11:47:07] -- DAHDI/2-1 answered DAHDI/1-1
[Jun 22 11:47:10] -- Executing [h@trunc-from_dahdi:1] NoOp("DAHDI/1-1", "hangupsource = ") in new stack
[Jun 22 11:47:10] -- Executing [h@trunc-from_dahdi:2] NoOp("DAHDI/1-1", "checkhangup = 0") in new stack
[Jun 22 11:47:10] -- Hanging up on 'DAHDI/2-1'
[Jun 22 11:47:10] -- Hungup 'DAHDI/2-1'
[Jun 22 11:47:10] == Spawn extension (trunc-from_dahdi, s, 3) exited non-zero on 'DAHDI/1-1'
[Jun 22 11:47:10] -- Hanging up on 'DAHDI/1-1'
[Jun 22 11:47:10] -- Hungup 'DAHDI/1-1'