Call Us Today! 877.742.2583




Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Add TODO to document Application-UUID (if it's still a thing)

...

Informational Tip

Content-Length is the length of the event beginning AFTER the double LF line ("\n\n") of the event header!


Example:

Content-Length: <size>\n
Content-Type: text/event-plain\n
\n
event-hdr1: a\n       <-- size starts here
event-hdr2: b\n
...
event-hdrN: x\n
\n                    <-- size ends here

Pseudo Code:

Look for \n\n in your receive buffer

Examine data for existence of Content-Length

If NOT present, process event and remove from receive buffer

IF present, Shift buffer to remove 'header'
Evaluate content-length value

Loop until receive buffer size is >= Content-length
Extract content-length bytes from buffer and process

 

 




Channel events

The channel events can be used to monitor which calls an extension gets, and in what state the calls currently are.

...

This event indicates that the PBX is doing something with the call. (Typically looking in the dial plan).

Status
colourYellow
titleTODO
 From the sendmsg section in mod_event_socket:

Panel
borderColorlightgray
bgColor#eeeeff
borderWidth1
titleBGColor#F7F7F7
borderStyledashed

If you would like to correlate the CHANNEL_EXECUTE and CHANNEL_EXECUTE_COMPLETE events that are generated when the command you send using sendmsg is executed you can add an Event-UUID header with a UUID you specify. In the corresponding events, the UUID will be in the Application-UUID header. If you do not specify an Event-UUID, Freeswitch will generate a UUID for the Application-UUID.

Example:

Event-UUID: 22075ce5-b67b-4f04-a6dd-1726ec14c8bf

Although, there is no trace of an Application-UUID header in CHANNEL_EXECUTE and CHANNEL_EXECUTE_COMPLETE sections. 


Example:

Channel-Read-Codec-Name: PCMU
Channel-Read-Codec-Rate: 8000
Channel-Write-Codec-Name: PCMU
Channel-Write-Codec-Rate: 8000
Caller-Username: jonas
Caller-Dialplan: XML
Caller-Caller-ID-Name: jonas
Caller-Caller-ID-Number: jonas
Caller-Network-Addr: 192.168.0.58
Caller-Destination-Number: 541
Caller-Unique-ID: 0dd4e4f7-36ed-a04d-a8f7-7aebb683af50
Caller-Source: mod_sofia
Caller-Context: default
Caller-Channel-Name: sofia/192.168.0.58/jonas%40192.168.0.58%3A5060
Caller-Screen-Bit: yes
Caller-Privacy-Hide-Name: no
Caller-Privacy-Hide-Number: no

CHANNEL_EXECUTE_COMPLETE

This event is emitted when a dialplan application (started with sendmsg  or send (?)) finished running.

Status
colourYellow
titleTODO
 From the sendmsg section in mod_event_socket:

Panel
borderColorlightgray
bgColor#eeeeff
borderWidth1
titleBGColor#F7F7F7
borderStyledashed

If you would like to correlate the CHANNEL_EXECUTE and CHANNEL_EXECUTE_COMPLETE events that are generated when the command you send using sendmsg is executed you can add an Event-UUID header with a UUID you specify. In the corresponding events, the UUID will be in the Application-UUID header. If you do not specify an Event-UUID, Freeswitch will generate a UUID for the Application-UUID.

Example:

Event-UUID: 22075ce5-b67b-4f04-a6dd-1726ec14c8bf

Although, there is no trace of an Application-UUID header in CHANNEL_EXECUTE and CHANNEL_EXECUTE_COMPLETE sections. 


RECV EVENT
Event-Name: CHANNEL_EXECUTE_COMPLETE
Core-UUID: 9b0de0b8-f55e-40d8-a2bd-179310b53493
FreeSWITCH-Hostname: myhost                    
FreeSWITCH-IPv4: 192.168.0.2                   
FreeSWITCH-IPv6: ::1                           
Event-Date-Local: 2009-10-09 20:08:26          
Event-Date-GMT: Sat, 10 Oct 2009 00:08:26 GMT  
Event-Date-Timestamp: 1255133306952270         
Event-Calling-File: switch_core_session.c      
Event-Calling-Function: switch_core_session_exec
Event-Calling-Line-Number: 1480                 
Channel-State: CS_HANGUP                        
Channel-State-Number: 10                        
Channel-Name: sofia/internal/1000@192.168.0.2   
Unique-ID: e5a82e39-6dc1-4d7d-a300-aa9cd4284073 
Call-Direction: inbound                         
Presence-Call-Direction: inbound                
Answer-State: answered                          
Channel-Read-Codec-Name: GSM                    
Channel-Read-Codec-Rate: 8000                   
Channel-Write-Codec-Name: GSM                   
Channel-Write-Codec-Rate: 8000                  
Caller-Username: 1000                           
Caller-Dialplan: XML                            
Caller-Caller-ID-Name: 1000                     
Caller-Caller-ID-Number: 1000                   
Caller-Network-Addr: 192.168.0.104              
Caller-Destination-Number: 3030                 
Caller-Unique-ID: e5a82e39-6dc1-4d7d-a300-aa9cd4284073
Caller-Source: mod_sofia                              
Caller-Context: default                               
Caller-Channel-Name: sofia/internal/1000@192.168.0.2  
Caller-Profile-Index: 1                               
Caller-Profile-Created-Time: 1255133286498223         
Caller-Channel-Created-Time: 1255133286498223         
Caller-Channel-Answered-Time: 1255133286504829        
Caller-Channel-Progress-Time: 0                       
Caller-Channel-Progress-Media-Time: 0                 
Caller-Channel-Hangup-Time: 0                         
Caller-Channel-Transfer-Time: 0                       
Caller-Screen-Bit: true                               
Caller-Privacy-Hide-Name: false                       
Caller-Privacy-Hide-Number: false                     
variable_sip_received_ip: 192.168.0.104               
variable_sip_received_port: 5060                      
variable_sip_via_protocol: udp                        
variable_sip_authorized: true                         
variable_sip_number_alias: 1000                       
variable_sip_auth_username: 1000                      
variable_sip_auth_realm: 192.168.0.2                  
variable_number_alias: 1000                           
variable_user_name: 1000                              
variable_domain_name: 192.168.0.2                     
variable_toll_allow: domestic,international,local     
variable_accountcode: 1000                            
variable_user_context: default                        
variable_effective_caller_id_name: Extension 1000     
variable_effective_caller_id_number: 1000             
variable_outbound_caller_id_name: FreeSWITCH          
variable_outbound_caller_id_number: 0000000000        
variable_callgroup: techsupport                       
variable_record_stereo: true                          
variable_default_gateway: example.com                 
variable_default_areacode: 918                        
variable_transfer_fallback_extension: operator        
variable_sip_from_params: transport=UDP               
variable_sip_from_user: 1000                          
variable_sip_from_uri: 1000@192.168.0.2               
variable_sip_from_host: 192.168.0.2                   
variable_sip_from_user_stripped: 1000                 
variable_sip_from_tag: 7bae8202                       
variable_sofia_profile_name: internal                 
variable_sip_req_params: transport=UDP                
variable_sip_req_user: 3030                           
variable_sip_req_uri: 3030@192.168.0.2                
variable_sip_req_host: 192.168.0.2                    
variable_sip_to_params: transport=UDP                 
variable_sip_to_user: 3030                            
variable_sip_to_uri: 3030@192.168.0.2                 
variable_sip_to_host: 192.168.0.2                     
variable_sip_contact_params: transport=UDP            
variable_sip_contact_user: 1000                       
variable_sip_contact_port: 60780                      
variable_sip_contact_uri: 1000@190.52.138.225:60780   
variable_sip_contact_host: 190.52.138.225             
variable_channel_name: sofia/internal/1000@192.168.0.2
variable_sip_call_id: ODZhNDk5YzlmZDg3YTExOWU4NDU3NmM2ZmI1MzFmNDU.
variable_sip_via_host: 190.52.138.225                             
variable_sip_via_port: 60780                                      
variable_sip_via_rport: 5060                                      
variable_max_forwards: 70                                         
variable_presence_id: 1000@192.168.0.2                            
variable_switch_r_sdp: v=0                                        
o=Z 0 0 IN IP4 190.52.138.225                                     
s=Z                                                               
c=IN IP4 190.52.138.225                                           
t=0 0                                                             
m=audio 60790 RTP/AVP 3 110 98 8 0 101                            
a=rtpmap:3 GSM/8000                                               
a=rtpmap:110 speex/8000                                           
a=rtpmap:98 iLBC/8000                                             
a=fmtp:98 mode=30                                                 
a=rtpmap:8 PCMA/8000                                              
a=rtpmap:0 PCMU/8000                                              
a=rtpmap:101 telephone-event/8000                                 
a=fmtp:101 0-15                                                   

variable_remote_media_ip: 190.52.138.225
variable_remote_media_port: 60790       
variable_write_codec: GSM               
variable_write_rate: 8000               
variable_local_media_ip: 192.168.0.2    
variable_local_media_port: 19878        
variable_endpoint_disposition: ANSWER   
variable_current_application_data: $1-192.168.0.2@default
variable_current_application: conference                 
variable_conference_name: $1-192.168.0.2                 
variable_sip_term_status: 200                            
variable_sip_term_cause: 16                              
variable_sip_user_agent: Zoiper rev.4688                 
variable_sip_hangup_disposition: recv_bye                
variable_read_codec: GSM                                 
variable_read_rate: 8000                                 
Application: conference                                  
Application-Data: $1-192.168.0.2@default                 
Application-Response: _none_                             

...

You can use this to trap some transitions happening in your calls.

 


 Content-Length: 1586
 Content-Type: text/event-plain
 
 Event-Subclass: channel_state_change
 Event-Name: CHANNEL_APPLICATION
 Core-UUID: d5cdc6a2-ec00-46fe-97b0-8bbb734bb1fa
 FreeSWITCH-Hostname: centos53_02005
 FreeSWITCH-IPv4: 192.168.2.5
 FreeSWITCH-IPv6: ::1
 Event-Date-Local: 2010-02-23 00:15:37
 Event-Date-GMT: Mon, 22 Feb 2010 15:15:37 GMT
 Event-Date-Timestamp: 1266851737846113
 Event-Calling-File: mod_dptools.c
 Event-Calling-Function: event_function
 Event-Calling-Line-Number: 981
 State: checking_voicemail.
 Channel-State: CS_EXECUTE
 Channel-State-Number: 4
 Channel-Name: sofia/internal/23702@domain23702.com
 Unique-ID: 482c78ba-a2bf-4324-bf09-388b7b5fbb54
 Call-Direction: inbound
 Presence-Call-Direction: inbound
 Answer-State: ringing
 Channel-Read-Codec-Name: PCMU
 Channel-Read-Codec-Rate: 8000
 Channel-Write-Codec-Name: PCMU
 Channel-Write-Codec-Rate: 8000
 Caller-Username: 23702
 Caller-Dialplan: XML
 Caller-Caller-ID-Name: 23702
 Caller-Caller-ID-Number: 23702
 Caller-Network-Addr: 192.168.2.5
 Caller-ANI: 23702
 Caller-Destination-Number: 2000
 Caller-Unique-ID: 482c78ba-a2bf-4324-bf09-388b7b5fbb54
 Caller-Source: mod_sofia
 Caller-Context: internal
 Caller-Channel-Name: sofia/internal/23702@domain23702.com
 Caller-Profile-Index: 1
 Caller-Profile-Created-Time: 1266851737825925
 Caller-Channel-Created-Time: 1266851737825925
 Caller-Channel-Answered-Time: 0
 Caller-Channel-Progress-Time: 0
 Caller-Channel-Progress-Media-Time: 0
 Caller-Channel-Hangup-Time: 0
 Caller-Channel-Transfer-Time: 0
 Caller-Screen-Bit: true
 Caller-Privacy-Hide-Name: false
 Caller-Privacy-Hide-Number: false

...

Content-Length: 605
Content-Type: text/event-plain

Event-Info: System Ready
Up-Time: 0 years, 0 days, 0 hours, 0 minutes, 40 seconds, 0 milliseconds, 0 microseconds
Session-Count: 0
Session-Per-Sec: 500
Event-Name: HEARTBEAT
Core-UUID: 596ab2fd-14c5-44b5-a02b-93ffb7cd5dd6
FreeSWITCH-Hostname: ********
FreeSWITCH-IPv4: ********
FreeSWITCH-IPv6: 127.0.0.1
Event-Date-Local: 2008-01-23%2013%3A39%3A06
Event-Date-GMT: Wed,%2023%20Jan%202008%2018%3A39%3A06%20GMT
Event-Date-timestamp: 1201113546203319
Event-Calling-File: switch_core.c
Event-Calling-Function: send_heartbeat
Event-Calling-Line-Number: 74

 


DETECTED_TONE

Event sent when a tone detected.

...