这是一个esl的park事件
Event-Name: CHANNEL_PARK
Core-UUID: 85250adc-c5a2-42b2-afc0-00f261fc1546
FreeSWITCH-Hostname: localhost.localdomain
FreeSWITCH-Switchname: localhost.localdomain
FreeSWITCH-IPv4: 192.168.2.215
FreeSWITCH-IPv6: %3A%3A1
Event-Date-Local: 2019-07-12%2012%3A59%3A46
Event-Date-GMT: Fri,%2012%20Jul%202019%2004%3A59%3A46%20GMT
Event-Date-Timestamp: 1562907586285160
Event-Calling-File: switch_ivr.c
Event-Calling-Function: switch_ivr_park
Event-Calling-Line-Number: 950
Event-Sequence: 22750
Channel-State: CS_PARK
Channel-Call-State: ACTIVE
Channel-State-Number: 6
Channel-Name: sofia/internal/1031%40192.168.2.83%3A6781
Unique-ID: 03a1a9de-e736-4ad7-963e-455e913bc2ba
Call-Direction: outbound
Presence-Call-Direction: outbound
Channel-HIT-Dialplan: false
Channel-Presence-ID: 1031%40192.168.2.215
Channel-Call-UUID: 6c69067b-08c7-476e-a0af-06fb4f0482a4
Answer-State: answered
Channel-Read-Codec-Name: PCMA
Channel-Read-Codec-Rate: 8000
Channel-Read-Codec-Bit-Rate: 64000
Channel-Write-Codec-Name: PCMA
Channel-Write-Codec-Rate: 8000
Channel-Write-Codec-Bit-Rate: 64000
Caller-Direction: outbound
Caller-Logical-Direction: outbound
Caller-Caller-ID-Name: 1000
Caller-Caller-ID-Number: 1000
Caller-Orig-Caller-ID-Name: 1000
Caller-Orig-Caller-ID-Number: 1000
Caller-Callee-ID-Name: 1000
Caller-Callee-ID-Number: 1000
Caller-Network-Addr: 192.168.2.83
Caller-ANI: 1000
Caller-Destination-Number: 1031
Caller-Unique-ID: 03a1a9de-e736-4ad7-963e-455e913bc2ba
Caller-Source: src/switch_ivr_originate.c
Caller-Transfer-Source: 1562907583%3Af2f7fed2-ffcd-42ca-8188-e8c9107006a1%3Auuid_br%3A6c69067b-08c7-476e-a0af-06fb4f0482a4
Caller-Context: default
Caller-Channel-Name: sofia/internal/1031%40192.168.2.83%3A6781
Caller-Profile-Index: 20
Caller-Profile-Created-Time: 1562907583445159
Caller-Channel-Created-Time: 1562906514525111
Caller-Channel-Answered-Time: 1562906528205198
Caller-Channel-Progress-Time: 1562906514525111
Caller-Channel-Progress-Media-Time: 0
Caller-Channel-Hangup-Time: 0
Caller-Channel-Transfer-Time: 0
Caller-Channel-Resurrect-Time: 0
Caller-Channel-Bridged-Time: 1562907583525267
Caller-Channel-Last-Hold: 0
Caller-Channel-Hold-Accum: 0
Caller-Screen-Bit: true
Caller-Privacy-Hide-Name: false
Caller-Privacy-Hide-Number: false
Other-Type: originator
Other-Leg-Direction: inbound
Other-Leg-Logical-Direction: inbound
Other-Leg-Username: 1000
Other-Leg-Dialplan: XML
Other-Leg-Caller-ID-Name: 1000
Other-Leg-Caller-ID-Number: 1000
Other-Leg-Orig-Caller-ID-Name: 1000
Other-Leg-Orig-Caller-ID-Number: 1000
Other-Leg-Callee-ID-Name: 1000
Other-Leg-Callee-ID-Number: 1000
Other-Leg-Network-Addr: 192.168.2.214
Other-Leg-ANI: 1000
Other-Leg-Destination-Number: 1031
Other-Leg-Unique-ID: 6c69067b-08c7-476e-a0af-06fb4f0482a4
Other-Leg-Source: mod_sofia
Other-Leg-Context: default
Other-Leg-Channel-Name: sofia/internal/1000%40192.168.2.215
Other-Leg-Profile-Created-Time: 0
Other-Leg-Channel-Created-Time: 0
Other-Leg-Channel-Answered-Time: 0
Other-Leg-Channel-Progress-Time: 0
Other-Leg-Channel-Progress-Media-Time: 0
Other-Leg-Channel-Hangup-Time: 0
Other-Leg-Channel-Transfer-Time: 0
Other-Leg-Channel-Resurrect-Time: 0
Other-Leg-Channel-Bridged-Time: 0
Other-Leg-Channel-Last-Hold: 0
Other-Leg-Channel-Hold-Accum: 0
Other-Leg-Screen-Bit: true
Other-Leg-Privacy-Hide-Name: false
Other-Leg-Privacy-Hide-Number: false
variable_direction: outbound
variable_is_outbound: true
variable_uuid: 03a1a9de-e736-4ad7-963e-455e913bc2ba
variable_session_id: 176
variable_sip_profile_name: internal
variable_video_media_flow: sendrecv
variable_audio_media_flow: sendrecv
variable_channel_name: sofia/internal/1031%40192.168.2.83%3A6781
variable_sip_destination_url: sip%3A1031%40192.168.2.83%3A6781
variable_dialed_user: 1031
variable_dialed_domain: 192.168.2.215
variable_sip_invite_domain: 192.168.2.215
variable_presence_id: 1031%40192.168.2.215
variable_local_video_ip: 192.168.2.215
variable_local_video_port: 17538
variable_rtp_local_sdp_str: v%3D0%0D%0Ao%3DFreeSWITCH%201562887872%201562887873%20IN%20IP4%20192.168.2.215%0D%0As%3DFreeSWITCH%0D%0Ac%3DIN%20IP4%20192.168.2.215%0D%0At%3D0%200%0D%0Am%3Daudio%2018642%20RTP/AVP%2018%20102%20103%209%200%208%203%20101%20105%0D%0Aa%3Drtpmap%3A18%20G729/8000%0D%0Aa%3Dfmtp%3A18%20annexb%3Dno%0D%0Aa%3Drtpmap%3A102%20iLBC/8000%0D%0Aa%3Dfmtp%3A102%20mode%3D30%0D%0Aa%3Drtpmap%3A103%20opus/48000/2%0D%0Aa%3Dfmtp%3A103%20useinbandfec%3D1%3B%20maxaveragebitrate%3D30000%3B%20maxplaybackrate%3D48000%3B%20ptime%3D20%3B%20minptime%3D10%3B%20maxptime%3D40%0D%0Aa%3Drtpmap%3A9%20G722/8000%0D%0Aa%3Drtpmap%3A0%20PCMU/8000%0D%0Aa%3Drtpmap%3A8%20PCMA/8000%0D%0Aa%3Drtpmap%3A3%20GSM/8000%0D%0Aa%3Drtpmap%3A101%20telephone-event/8000%0D%0Aa%3Dfmtp%3A101%200-16%0D%0Aa%3Drtpmap%3A105%20telephone-event/48000%0D%0Aa%3Dfmtp%3A105%200-16%0D%0Aa%3Dptime%3A20%0D%0Aa%3Dsendrecv%0D%0Am%3Dvideo%2017538%20RTP/AVP%20104%0D%0Ab%3DAS%3A1024%0D%0Aa%3Drtpmap%3A104%20VP8/90000%0D%0Aa%3Drtcp-fb%3A104%20ccm%20fir%0D%0Aa%3Drtcp-fb%3A104%20ccm%20tmmbr%0D%0Aa%3Drtcp-fb%3A104%20nack%0D%0Aa%3Drtcp-fb%3A104%20nack%20pli%0D%0A
variable_sip_outgoing_contact_uri: %3Csip%3Amod_sofia%40192.168.2.215%3A2060%3E
variable_sip_req_uri: 1031%40192.168.2.83%3A6781
variable_sofia_profile_name: internal
variable_recovery_profile_name: internal
variable_sip_local_network_addr: 192.168.2.215
variable_sip_reply_host: 192.168.2.83
variable_sip_reply_port: 6781
variable_sip_network_ip: 192.168.2.83
variable_sip_network_port: 6781
variable_ep_codec_string: CORE_PCM_MODULE.PCMA%408000h%4020i%4064000b
variable_sip_allow: INVITE,%20ACK,%20CANCEL,%20OPTIONS,%20BYE,%20REFER,%20NOTIFY,%20MESSAGE,%20SUBSCRIBE,%20INFO
variable_sip_recover_contact: %3Csip%3A1031%40192.168.2.83%3A6781%3E
variable_sip_full_via: SIP/2.0/UDP%20192.168.2.215%3A2060%3Brport%3D2060%3Bbranch%3Dz9hG4bKgcX7m4KeSSKvH%3Breceived%3D192.168.2.215
variable_sip_recover_via: SIP/2.0/UDP%20192.168.2.215%3A2060%3Brport%3D2060%3Bbranch%3Dz9hG4bKgcX7m4KeSSKvH%3Breceived%3D192.168.2.215
variable_sip_from_display: 1000
variable_sip_full_from: %221000%22%20%3Csip%3A1000%40192.168.2.215%3E%3Btag%3DN07ety2UX8DUH
variable_sip_full_to: %3Csip%3A1031%40192.168.2.83%3A6781%3E%3Btag%3Dbf2d5d0a
variable_sip_from_user: 1000
variable_sip_from_uri: 1000%40192.168.2.215
variable_sip_from_host: 192.168.2.215
variable_sip_to_user: 1031
variable_sip_to_port: 6781
variable_sip_to_uri: 1031%40192.168.2.83%3A6781
variable_sip_to_host: 192.168.2.83
variable_sip_contact_user: 1031
variable_sip_contact_port: 6781
variable_sip_contact_uri: 1031%40192.168.2.83%3A6781
variable_sip_contact_host: 192.168.2.83
variable_sip_to_tag: bf2d5d0a
variable_sip_from_tag: N07ety2UX8DUH
variable_sip_cseq: 7022846
variable_sip_call_id: c11ae998-2140-1238-289f-000c29528a7b
variable_switch_r_sdp: v%3D0%0D%0Ao%3D-%207587729044%207587729049%20IN%20IP4%20192.168.2.83%0D%0As%3DeyeBeam%0D%0Ac%3DIN%20IP4%20192.168.2.83%0D%0At%3D0%200%0D%0Am%3Daudio%206902%20RTP/AVP%208%20101%0D%0Aa%3Drtpmap%3A101%20telephone-event/8000%0D%0Aa%3Dfmtp%3A101%200-15%0D%0Aa%3Dalt%3A1%201%20%3A%20DE7F7604%2092694EDD%20192.168.2.83%206902%0D%0A
variable_rtp_use_codec_string: G729,iLBC,OPUS,G722,PCMU,PCMA,VP8,GSM
variable_rtp_audio_recv_pt: 8
variable_rtp_use_codec_name: PCMA
variable_rtp_use_codec_rate: 8000
variable_rtp_use_codec_ptime: 20
variable_rtp_use_codec_channels: 1
variable_rtp_last_audio_codec_string: PCMA%408000h%4020i%401c
variable_read_codec: PCMA
variable_original_read_codec: PCMA
variable_read_rate: 8000
variable_original_read_rate: 8000
variable_write_codec: PCMA
variable_write_rate: 8000
variable_dtmf_type: rfc2833
variable_local_media_ip: 192.168.2.215
variable_local_media_port: 18642
variable_advertised_media_ip: 192.168.2.215
variable_rtp_use_timer_name: soft
variable_rtp_use_pt: 8
variable_rtp_use_ssrc: 3116562093
variable_rtp_2833_send_payload: 101
variable_rtp_2833_recv_payload: 101
variable_remote_media_ip: 192.168.2.83
variable_remote_media_port: 6902
variable_endpoint_disposition: ANSWER
variable_record_stereo: true
variable_default_gateway: example.com
variable_default_areacode: 918
variable_transfer_fallback_extension: operator
variable_toll_allow: domestic,international,local
variable_accountcode: 1031
variable_user_context: default
variable_effective_caller_id_name: Extension%201031
variable_effective_caller_id_number: 1031
variable_outbound_caller_id_name: FreeSWITCH
variable_outbound_caller_id_number: 0000000000
variable_callgroup: techsupport
variable_origination_uuid: 03a1a9de-e736-4ad7-963e-455e913bc2ba
variable_origination_caller_id_name: 1000
variable_origination_caller_id_number: 1000
variable_originate_early_media: true
variable_pre_transfer_caller_id_name: 1000
variable_pre_transfer_caller_id_number: 1000
variable_current_application: park
variable_transfer_history: ARRAY%3A%3A1562906653%3A492ab704-3c04-45c0-8a9b-7a15113600a9%3Auuid_br%3A6629ebf7-f70b-4ab6-80f4-dc4473d62fe9%7C%3A1562906980%3A481b1f59-2578-4f36-8c80-cdaa25fe1080%3Auuid_br%3A6629ebf7-f70b-4ab6-80f4-dc4473d62fe9%7C%3A1562907002%3Ad1865e45-9088-49d1-879e-f1ca9d2cc037%3Auuid_br%3A6629ebf7-f70b-4ab6-80f4-dc4473d62fe9%7C%3A1562907037%3A4b31feb1-b065-4acb-844d-40843c168ae7%3Auuid_br%3A6629ebf7-f70b-4ab6-80f4-dc4473d62fe9%7C%3A1562907061%3Ac43f829f-29d3-41d3-bd44-77e21b7b9792%3Auuid_br%3A6629ebf7-f70b-4ab6-80f4-dc4473d62fe9%7C%3A1562907087%3A923d8499-02e1-4f38-9f75-03dbbad710fb%3Auuid_br%3A6629ebf7-f70b-4ab6-80f4-dc4473d62fe9%7C%3A1562907104%3Ac856e403-e986-488b-b40e-1e8a95a55ffb%3Auuid_br%3A6629ebf7-f70b-4ab6-80f4-dc4473d62fe9%7C%3A1562907293%3A5349247d-486a-4455-970e-99a0cf30a19a%3Auuid_br%3Aed71995d-2fd5-4f17-a554-6dc15e2eeaad%7C%3A1562907299%3Ae8b3d087-8e2f-4d91-bbdc-ed8f98b8f478%3Auuid_br%3Aed71995d-2fd5-4f17-a554-6dc15e2eeaad%7C%3A1562907332%3Aeadf54a6-e541-46cd-a020-23c27474a279%3Auuid_br%3Ae441d19a-d9d7-4cb5-849a-1af5ce3c3ccf%7C%3A1562907339%3Aac8f792f-7865-4d4e-bd55-205afa8febf0%3Auuid_br%3Ae441d19a-d9d7-4cb5-849a-1af5ce3c3ccf%7C%3A1562907341%3A29aa67b1-15bb-4250-9393-63b271db7e48%3Auuid_br%3Ae441d19a-d9d7-4cb5-849a-1af5ce3c3ccf%7C%3A1562907437%3A9233db34-a3b8-4204-86f8-07e1206d4694%3Auuid_br%3Ae441d19a-d9d7-4cb5-849a-1af5ce3c3ccf%7C%3A1562907487%3A90f93dab-ce79-4a6e-8aac-08e8c4747f74%3Auuid_br%3A95afcfb0-73ce-487c-8b20-929975d0ac40%7C%3A1562907500%3Ad12f5022-811c-43a5-8474-7b1951522c78%3Auuid_br%3A95afcfb0-73ce-487c-8b20-929975d0ac40%7C%3A1562907503%3A977f0b46-8e9b-400e-a1db-f3e8913e85a1%3Auuid_br%3A95afcfb0-73ce-487c-8b20-929975d0ac40%7C%3A1562907505%3Ac5006ae9-48f3-4bab-8e4c-c1375d396c6b%3Auuid_br%3A95afcfb0-73ce-487c-8b20-929975d0ac40%7C%3A1562907570%3A705d3055-be78-484d-acb4-8cf239ab9c5a%3Auuid_br%3A6c69067b-08c7-476e-a0af-06fb4f0482a4%7C%3A1562907583%3Af2f7fed2-ffcd-42ca-8188-e8c9107006a1%3Auuid_br%3A6c69067b-08c7-476e-a0af-06fb4f0482a4
variable_last_bridge_hangup_cause: NORMAL_CLEARING
variable_original_destination_number: 1031
variable_original_caller_id_name: 1000
variable_original_caller_id_number: 1000
variable_transfer_source: 1562907583%3Af2f7fed2-ffcd-42ca-8188-e8c9107006a1%3Auuid_br%3A6c69067b-08c7-476e-a0af-06fb4f0482a4
variable_call_uuid: 6c69067b-08c7-476e-a0af-06fb4f0482a4
variable_last_bridge_to: 6c69067b-08c7-476e-a0af-06fb4f0482a4
variable_bridge_channel: sofia/internal/1000%40192.168.2.215
variable_bridge_uuid: 6c69067b-08c7-476e-a0af-06fb4f0482a4
variable_signal_bond: 6c69067b-08c7-476e-a0af-06fb4f0482a4
variable_last_sent_callee_id_name: 1000
variable_last_sent_callee_id_number: 1000
之前的时候我以为里面的Unique-ID 、Caller-Unique-ID 、 variable_uuid 、Channel-Call-UUID、variable_call_uuid 都是一样的。
后来发现特么的不一定啊。
注意:是不一定。
大部分的时候是一样的,只是偶尔出现的。大概10次有两次吧。因为我测试,监听了所有的事件,可能就导致了freeswitch内部没有及时刷新。
总结一下:
正确的应该取:
Unique-ID 、Caller-Unique-ID 、 variable_uuid
不要取:Channel-Call-UUID 、variable_call_uuid。
猜测原因: 里面数据刷新的不及时。或者再进一步猜测,里面也维持着一个map数组指针,里面的数据没有及时更新。