[asterisk-dev] Events generated by followme
BJ Weschke
bweschke at gmail.com
Wed Jan 7 10:33:30 CST 2009
Mirko Tochtermann wrote:
> Hi asterisk-dev mailing list,
>
> at the moment i am in the process of developing a graphical CTI
> Solution based on the asterisk-java framework
> (http://asterisk-java.org/).
>
> As base system we use Ubuntu 8.04 Server, Asterisk 1.4.21 from the
> debian voip tree and freepbx 2.5.1 as configuration front end.
>
> So far development went pretty smooth up to the point where i tried to
> find a logic in the events generated from a call that uses followme.
>
> Example:
> We have 3 Sip Extensions 1000,1001 and 1002.
>
> 1001 has a follow me list with the extension 1001 and 1002 (initial
> ring time is 0 sec).
>
> Now i've made a test call from 1000 to 1001.
>
> Please see the events generated during the call (i filtered all out
> but NewChannelEvent, DialEvent, LinkEvent, UnlinkEvent, RenameEvent
> and HangupEvent):
>
> org.asteriskjava.manager.event.NewChannelEvent[dateReceived=Wed Jan 07
> 14:05:31 CET
> 2009,privilege='call,all',callerid='1000',state='Down',channelstate='0',calleridname='device',timestamp='null',uniqueid='asterisk-1231333567.163',accountcode='null',server='null',calleridnum='1000',channel='SIP/1000-082c38d0',channelstatedesc='Down',systemHashcode=27588373]
>
> org.asteriskjava.manager.event.NewChannelEvent[dateReceived=Wed Jan 07
> 14:05:31 CET
> 2009,privilege='call,all',callerid='null',state='Down',channelstate='0',calleridname='null',timestamp='null',uniqueid='asterisk-1231333567.164',accountcode='null',server='null',calleridnum='null',channel='Local/FMPR-1001 at from-internal-ceba,1',channelstatedesc='Down',systemHashcode=30165025]
>
> org.asteriskjava.manager.event.NewChannelEvent[dateReceived=Wed Jan 07
> 14:05:31 CET
> 2009,privilege='call,all',callerid='null',state='Ring',channelstate='4',calleridname='null',timestamp='null',uniqueid='asterisk-1231333567.165',accountcode='null',server='null',calleridnum='null',channel='Local/FMPR-1001 at from-internal-ceba,2',channelstatedesc='Ring',systemHashcode=9674928]
>
> org.asteriskjava.manager.event.DialEvent[dateReceived=Wed Jan 07
> 14:05:31 CET
> 2009,privilege='call,all',subevent='Begin',callerid='1000',dialstatus='null',destuniqueid='asterisk-1231333567.164',srcuniqueid='asterisk-1231333567.163',destination='Local/FMPR-1001 at from-internal-ceba,1',dialstring='null',calleridname='Test',timestamp='null',uniqueid='asterisk-1231333567.163',server='null',src='SIP/1000-082c38d0',calleridnum='1000',channel='SIP/1000-082c38d0',systemHashcode=1743014]
>
> org.asteriskjava.manager.event.NewChannelEvent[dateReceived=Wed Jan 07
> 14:05:31 CET
> 2009,privilege='call,all',callerid='null',state='Down',channelstate='0',calleridname='null',timestamp='null',uniqueid='asterisk-1231333567.166',accountcode='null',server='null',calleridnum='null',channel='Local/FMGL-1002 at from-internal-a703,1',channelstatedesc='Down',systemHashcode=22640320]
>
> org.asteriskjava.manager.event.NewChannelEvent[dateReceived=Wed Jan 07
> 14:05:31 CET
> 2009,privilege='call,all',callerid='null',state='Ring',channelstate='4',calleridname='null',timestamp='null',uniqueid='asterisk-1231333567.167',accountcode='null',server='null',calleridnum='null',channel='Local/FMGL-1002 at from-internal-a703,2',channelstatedesc='Ring',systemHashcode=8601112]
>
> org.asteriskjava.manager.event.DialEvent[dateReceived=Wed Jan 07
> 14:05:31 CET
> 2009,privilege='call,all',subevent='Begin',callerid='1000',dialstatus='null',destuniqueid='asterisk-1231333567.166',srcuniqueid='asterisk-1231333567.163',destination='Local/FMGL-1002 at from-internal-a703,1',dialstring='null',calleridname='Test',timestamp='null',uniqueid='asterisk-1231333567.163',server='null',src='SIP/1000-082c38d0',calleridnum='1000',channel='SIP/1000-082c38d0',systemHashcode=6410576]
>
> org.asteriskjava.manager.event.NewChannelEvent[dateReceived=Wed Jan 07
> 14:05:31 CET
> 2009,privilege='call,all',callerid='null',state='Down',channelstate='0',calleridname='null',timestamp='null',uniqueid='asterisk-1231333567.168',accountcode='null',server='null',calleridnum='null',channel='SIP/1001-08225df0',channelstatedesc='Down',systemHashcode=27010385]
>
> org.asteriskjava.manager.event.DialEvent[dateReceived=Wed Jan 07
> 14:05:31 CET
> 2009,privilege='call,all',subevent='Begin',callerid='1000',dialstatus='null',destuniqueid='asterisk-1231333567.168',srcuniqueid='asterisk-1231333567.165',destination='SIP/1001-08225df0',dialstring='null',calleridname='Test',timestamp='null',uniqueid='asterisk-1231333567.165',server='null',src='Local/FMPR-1001 at from-internal-ceba,2',calleridnum='1000',channel='Local/FMPR-1001 at from-internal-ceba,2',systemHashcode=5639044]
>
> org.asteriskjava.manager.event.NewChannelEvent[dateReceived=Wed Jan 07
> 14:05:33 CET
> 2009,privilege='call,all',callerid='null',state='Down',channelstate='0',calleridname='null',timestamp='null',uniqueid='asterisk-1231333569.169',accountcode='null',server='null',calleridnum='null',channel='SIP/1002-081c1018',channelstatedesc='Down',systemHashcode=15955757]
>
> org.asteriskjava.manager.event.DialEvent[dateReceived=Wed Jan 07
> 14:05:33 CET
> 2009,privilege='call,all',subevent='Begin',callerid='1000',dialstatus='null',destuniqueid='asterisk-1231333569.169',srcuniqueid='asterisk-1231333567.167',destination='SIP/1002-081c1018',dialstring='null',calleridname='Test',timestamp='null',uniqueid='asterisk-1231333567.167',server='null',src='Local/FMGL-1002 at from-internal-a703,2',calleridnum='1000',channel='Local/FMGL-1002 at from-internal-a703,2',systemHashcode=1403236]
>
> org.asteriskjava.manager.event.LinkEvent[dateReceived=Wed Jan 07
> 14:05:37 CET
> 2009,privilege='call,all',uniqueid1='asterisk-1231333567.165',uniqueid2='asterisk-1231333567.168',bridgestate='Link',bridgetype='null',timestamp='null',channel1='Local/FMPR-1001 at from-internal-ceba,2',channel2='SIP/1001-08225df0',callerid1='1000',server='null',callerid2='FMPR-1001',systemHashcode=12568403]
>
> org.asteriskjava.manager.event.HangupEvent[dateReceived=Wed Jan 07
> 14:05:37 CET
> 2009,privilege='call,all',causetxt='null',callerid='null',cause='0',calleridname='null',timestamp='null',uniqueid='asterisk-1231333567.166',server='null',calleridnum='null',channel='Local/FMGL-1002 at from-internal-a703,1',systemHashcode=28007764]
>
> org.asteriskjava.manager.event.HangupEvent[dateReceived=Wed Jan 07
> 14:05:37 CET 2009,privilege='call,all',causetxt='Normal
> Clearing',callerid='null',cause='16',calleridname='null',timestamp='null',uniqueid='asterisk-1231333569.169',server='null',calleridnum='null',channel='SIP/1002-081c1018',systemHashcode=33119956]
>
> org.asteriskjava.manager.event.HangupEvent[dateReceived=Wed Jan 07
> 14:05:37 CET 2009,privilege='call,all',causetxt='Normal
> Clearing',callerid='null',cause='16',calleridname='null',timestamp='null',uniqueid='asterisk-1231333567.167',server='null',calleridnum='null',channel='Local/FMGL-1002 at from-internal-a703,2',systemHashcode=29283151]
>
> org.asteriskjava.manager.event.LinkEvent[dateReceived=Wed Jan 07
> 14:05:37 CET
> 2009,privilege='call,all',uniqueid1='asterisk-1231333567.163',uniqueid2='asterisk-1231333567.164',bridgestate='Link',bridgetype='null',timestamp='null',channel1='SIP/1000-082c38d0',channel2='Local/FMPR-1001 at from-internal-ceba,1',callerid1='1000',server='null',callerid2='1001',systemHashcode=10500881]
>
> org.asteriskjava.manager.event.RenameEvent[dateReceived=Wed Jan 07
> 14:05:37 CET
> 2009,privilege='call,all',timestamp='null',newname='SIP/1001-08225df0<MASQ>',uniqueid='asterisk-1231333567.168',newuniqueid='null',server='null',oldname='SIP/1001-08225df0',channel='SIP/1001-08225df0',systemHashcode=2464580]
>
> org.asteriskjava.manager.event.RenameEvent[dateReceived=Wed Jan 07
> 14:05:37 CET
> 2009,privilege='call,all',timestamp='null',newname='SIP/1001-08225df0',uniqueid='asterisk-1231333567.164',newuniqueid='null',server='null',oldname='Local/FMPR-1001 at from-internal-ceba,1',channel='Local/FMPR-1001 at from-internal-ceba,1',systemHashcode=16042485]
>
> org.asteriskjava.manager.event.RenameEvent[dateReceived=Wed Jan 07
> 14:05:37 CET
> 2009,privilege='call,all',timestamp='null',newname='Local/FMPR-1001 at from-internal-ceba,1<ZOMBIE>',uniqueid='asterisk-1231333567.168',newuniqueid='null',server='null',oldname='SIP/1001-08225df0<MASQ>',channel='SIP/1001-08225df0<MASQ>',systemHashcode=16188339]
>
> org.asteriskjava.manager.event.UnlinkEvent[dateReceived=Wed Jan 07
> 14:05:37 CET
> 2009,privilege='call,all',uniqueid1='asterisk-1231333567.165',uniqueid2='asterisk-1231333567.168',bridgestate='Unlink',bridgetype='null',timestamp='null',channel1='Local/FMPR-1001 at from-internal-ceba,2',channel2='Local/FMPR-1001 at from-internal-ceba,1<ZOMBIE>',callerid1='1000',server='null',callerid2='1001',systemHashcode=18090598]
>
> org.asteriskjava.manager.event.HangupEvent[dateReceived=Wed Jan 07
> 14:05:37 CET 2009,privilege='call,all',causetxt='Normal
> Clearing',callerid='null',cause='16',calleridname='null',timestamp='null',uniqueid='asterisk-1231333567.168',server='null',calleridnum='null',channel='Local/FMPR-1001 at from-internal-ceba,1<ZOMBIE>',systemHashcode=11980779]
>
> org.asteriskjava.manager.event.HangupEvent[dateReceived=Wed Jan 07
> 14:05:37 CET 2009,privilege='call,all',causetxt='Normal
> Clearing',callerid='null',cause='16',calleridname='null',timestamp='null',uniqueid='asterisk-1231333567.165',server='null',calleridnum='null',channel='Local/FMPR-1001 at from-internal-ceba,2',systemHashcode=19828162]
>
> org.asteriskjava.manager.event.UnlinkEvent[dateReceived=Wed Jan 07
> 14:05:49 CET
> 2009,privilege='call,all',uniqueid1='asterisk-1231333567.163',uniqueid2='asterisk-1231333567.164',bridgestate='Unlink',bridgetype='null',timestamp='null',channel1='SIP/1000-082c38d0',channel2='SIP/1001-08225df0',callerid1='1000',server='null',callerid2='FMPR-1001',systemHashcode=20645227]
>
> org.asteriskjava.manager.event.HangupEvent[dateReceived=Wed Jan 07
> 14:05:49 CET 2009,privilege='call,all',causetxt='Normal
> Clearing',callerid='null',cause='16',calleridname='null',timestamp='null',uniqueid='asterisk-1231333567.164',server='null',calleridnum='null',channel='SIP/1001-08225df0',systemHashcode=31512399]
>
> org.asteriskjava.manager.event.HangupEvent[dateReceived=Wed Jan 07
> 14:05:49 CET 2009,privilege='call,all',causetxt='Normal
> Clearing',callerid='null',cause='16',calleridname='null',timestamp='null',uniqueid='asterisk-1231333567.163',server='null',calleridnum='null',channel='SIP/1000-082c38d0',systemHashcode=27754785]
>
>
> As you can see in the whole process 7 unique IDs are generated. If i
> take a look at it i get the picture how followme is working but what i
> am missing is a definitive link between the caller channel and the
> called channel.
>
> I really hope someone can give me a good hint how i can handle those
> calls in my code so i get a fail-safe output of the call progress?
>
> At the moment i am really stuck!
>
> Thx in advance
> Mirko
>
>
I think I understand what it is that you're trying to do, but I think it's going to be difficult. The reason why you're seeing more unique IDs generated beyond what you'd expect is because of app_followme's use of the Local channel proxy to do what it needs to do in order to make app_followme work. The better way to approach this might be for app_followme to generate it's own events which you can listen for. This might make things far simpler for what it is that you're trying to do through the Manager interface and would probably be a welcome change for app_followme longer term.
--
Bird's The Word Technologies, Inc.
http://www.btwtech.com/
More information about the asterisk-dev
mailing list