Звонок приходит на мой номер, я поднимаю и кладу трубку.
В формате JSON привожу здесь состав события. Оно появляется дважды - для моего номера и для вызываемого.
Код: Выделить всё
{"variables":{},"event":"Hangup","privilege":"call,all","channel":"PJSIP/119-00003de2","channelstate":"6","channelstatedesc":"Up","calleridnum":"119","calleridname":"device","connectedlinenum":"120","connectedlinename":"0000P8P=P0","language":"ru","accountcode":"","context":"from-internal","exten":"","priority":"1","uniqueid":"1494175166.22321","linkedid":"1494175165.22319","cause":"16","cause_txt":"Normal Clearing"}
{"variables":{},"event":"Hangup","privilege":"call,all","channel":"Local/119@default-000000e9;1","channelstate":"6","channelstatedesc":"Up","calleridnum":"119","calleridname":"\u0002P>P=","connectedlinenum":"120","connectedlinename":"\u0000P8P=P0","language":"ru","accountcode":"","context":"ext-local","exten":"h","priority":"1","uniqueid":"1494175165.22319","linkedid":"1494175165.22319","cause":"16","cause_txt":"Normal Clearing"}
Привожу вывод
Код: Выделить всё
{variables":{},"event":"Hangup","privilege":"call,all","channel":"Local/119@default-000000ea;1","channelstate":"6","channelstatedesc":"Up","calleridnum":"119","calleridname":"0P=Q\u0002P>P=","connectedlinenum":"120","connectedlinename":"\u0000P8P=P0","language":"ru","accountcode":"","context":"ext-local","exten":"h","priority":"1","uniqueid":"1494175528.22323","linkedid":"1494175528.22323","cause":"16","cause_txt":"Normal Clearing"} jssip.html:22:17
{"variables":{},"event":"Hangup","privilege":"call,all","channel":"Local/119@default-000000ea;2","channelstate":"6","channelstatedesc":"Up","calleridnum":"120","calleridname":"u0000P8P=P0","connectedlinenum":"119","connectedlinename":"010P=Q\u0002P>P=","language":"ru","accountcode":"","context":"default","exten":"h","priority":"1","uniqueid":"1494175528.22324","linkedid":"1494175528.22323","cause":"16","cause_txt":"Normal Clearing"}
ПОлучается, что я не могу определить, разговор начался или не начинался... А как узнать?