Skip to content
blak3r edited this page Dec 11, 2012 · 12 revisions

This page contains samples of how various logs look in my asteriskLogger.php. Seeing what logs look like with a working implementation might help others find their problems.

My Configuration

Administration Config Screen Trixbox Extension Config

From my extensions.conf (I use Liz Caller Id Plugin)

[sugarsip]
exten => _X.,1,Set(SUGAREXTENSION=${EXTEN}) 
exten => _X.,n,AGI(cid.agi)
exten => _X.,n,Dial(SIP/${EXTEN},,t)
exten => _X.,n,Hangup

Asterisk Log Examples

Outbound Call, Initiated by Dialing Number on Phone, x208 -> 4102152497

  • No SugarCRM User Assigned to extension 208 (hence call is assigned to Administrator)
  • Dial Command = SIP/208
  • Note: 4109429722 is my main PBX phone number.
[2012-08-05 12:37:28] Timeout or Error
! AMI Event 'ExtensionStatus surpressed.
! AMI Event 'ExtensionStatus surpressed.
! AMI Event 'ExtensionStatus surpressed.
! AMI Event 'Newchannel surpressed.
! AMI Event 'ExtensionStatus surpressed.
! AMI Event 'Newstate surpressed.
[2012-08-05 12:37:54]
! --- Event -----------------------------------------------------------
!                Event --> NewCallerid                                       
!            Privilege --> call,all                                          
!              Channel --> SIP/208-00002660                                  
!          CallerIDNum --> 208                                               
!         CallerIDName --> BR Desktop Soft (XLink)                           
!             Uniqueid --> 1344184670.24678                                  
!      CID-CallingPres --> 0 (Presentation Allowed, Not Screened)            
! ---------------------------------------------------------------------
* {e['UniqueId']} CallerID  Changed to: 208
[2012-08-05 12:37:54]
! --- Event -----------------------------------------------------------
!                Event --> NewCallerid                                       
!            Privilege --> call,all                                          
!              Channel --> SIP/208-00002660                                  
!          CallerIDNum --> 4109429722                                        
!         CallerIDName --> Alertus                                           
!             Uniqueid --> 1344184670.24678                                  
!      CID-CallingPres --> 0 (Presentation Allowed, Not Screened)            
! ---------------------------------------------------------------------
* {e['UniqueId']} CallerID  Changed to: 4109429722
! AMI Event 'Newchannel surpressed.
[2012-08-05 12:37:54]
! --- Event -----------------------------------------------------------
!                Event --> Dial                                              
!            Privilege --> call,all                                          
!             SubEvent --> Begin                                             
!              Channel --> SIP/208-00002660                                  
!          Destination --> SIP/Flowroute-00002661                            
!          CallerIDNum --> 4109429722                                        
!         CallerIDName --> Alertus                                           
!             UniqueID --> 1344184670.24678                                  
!         DestUniqueID --> 1344184671.24679                                  
!           Dialstring --> Flowroute/14102152497                             
! ---------------------------------------------------------------------
! Dial Event src=SIP/208-00002660 dest=SIP/Flowroute-00002661
! Successfully created CALL record with id=9ed54308-9490-21c4-cc8c-501ea1977818
* CallerID is: 4109429722
OUTBOUND state detected... /^(sip\/[1-9][0-9][0-9]?[0-9]?-|Local)/i is astMatchInternal eChannel= SIP/208-00002660 eDestination=SIP/Flowroute-00002661
[2012-08-05 12:37:57]
! --- Event -----------------------------------------------------------
!                Event --> NewCallerid                                       
!            Privilege --> call,all                                          
!              Channel --> SIP/Flowroute-00002661                            
!          CallerIDNum --> 4102152497                                        
!         CallerIDName -->                                                   
!             Uniqueid --> 1344184671.24679                                  
!      CID-CallingPres --> 0 (Presentation Allowed, Not Screened)            
! ---------------------------------------------------------------------
* {e['UniqueId']} CallerID  Changed to: 4102152497
! AMI Event 'Newstate surpressed.
! AMI Event 'Newstate surpressed.
! AMI Event 'Newstate surpressed.
[2012-08-05 12:38:20]
! --- Event -----------------------------------------------------------
!                Event --> NewAccountCode                                    
!            Privilege --> call,all                                          
!              Channel --> SIP/Flowroute-00002661                            
!             Uniqueid --> 1344184671.24679                                  
!          AccountCode -->                                                   
!       OldAccountCode -->                                                   
! ---------------------------------------------------------------------
[2012-08-05 12:38:20]
! --- Event -----------------------------------------------------------
!                Event --> Bridge                                            
!            Privilege --> call,all                                          
!          Bridgestate --> Link                                              
!           Bridgetype --> core                                              
!             Channel1 --> SIP/208-00002660                                  
!             Channel2 --> SIP/Flowroute-00002661                            
!            Uniqueid1 --> 1344184670.24678                                  
!            Uniqueid2 --> 1344184671.24679                                  
!            CallerID1 --> 4109429722                                        
!            CallerID2 --> 4102152497                                        
! ---------------------------------------------------------------------
[2012-08-05 12:39:09]
! --- Event -----------------------------------------------------------
!                Event --> Unlink                                            
!            Privilege --> call,all                                          
!             Channel1 --> SIP/208-00002660                                  
!             Channel2 --> SIP/Flowroute-00002661                            
!            Uniqueid1 --> 1344184670.24678                                  
!            Uniqueid2 --> 1344184671.24679                                  
!            CallerID1 --> 4109429722                                        
!            CallerID2 --> 4102152497                                        
! ---------------------------------------------------------------------
[2012-08-05 12:39:09]
! --- Event -----------------------------------------------------------
!                Event --> Hangup                                            
!            Privilege --> call,all                                          
!              Channel --> SIP/Flowroute-00002661                            
!             Uniqueid --> 1344184671.24679                                  
!          CallerIDNum --> 4102152497                                        
!         CallerIDName --> <unknown>                                         
!                Cause --> 16                                                
!            Cause-txt --> Normal Clearing                                   
! ---------------------------------------------------------------------
# +++ findCallByAsteriskId(1344184671.24679)
! Found entry in asterisk_log recordId=9ed54308-9490-21c4-cc8c-501ea1977818
# [1344184671.24679] FOUND outbound CALL
Looking for user extension number in: SIP/208-00002660
Channel Matched SIP/### style regex.  Ext is:208
# +++ findUserByAsteriskExtension(208)
 ! Assigned user will be set to Administrator.
# [1344184671.24679] Measured call duration is 50 seconds
# +++ find AccountByPhoneNumber(4102152497)
! No results returned
# +++ find ContactByPhoneNumber(4102152497)
  findSugarObjectByPhoneNumber: Contact query components- Phone: 2152497   RegEx: (2\[^\d\]*1\[^\d\]*5\[^\d\]*2\[^\d\]*4\[^\d\]*9\[^\d\]*7\[^\d\]*)$
Found multiple contacts -- all belong to same account, associating call with account.
! Invalid Arguments passed to setRelationshipBetweenCallAndBean# [1344184671.24679] (OUTBOUND) Now updating record in /Calls/ id=9ed54308-9490-21c4-cc8c-501ea1977818...
NAME: ** Automatic record **
DESCRIPTION: 
[2012-08-05 12:39:14]
! --- Event -----------------------------------------------------------
!                Event --> Dial                                              
!            Privilege --> call,all                                          
!             SubEvent --> End                                               
!              Channel --> SIP/208-00002660                                  
!             UniqueID --> 1344184670.24678                                  
!           DialStatus --> ANSWER                                            
! ---------------------------------------------------------------------
! AMI Event 'ExtensionStatus surpressed.
[2012-08-05 12:39:14]
! --- Event -----------------------------------------------------------
!                Event --> Hangup                                            
!            Privilege --> call,all                                          
!              Channel --> SIP/208-00002660                                  
!             Uniqueid --> 1344184670.24678                                  
!          CallerIDNum --> 4109429722                                        
!         CallerIDName --> Alertus                                           
!                Cause --> 16                                                
!            Cause-txt --> Normal Clearing                                   
! ---------------------------------------------------------------------
# +++ findCallByAsteriskId(1344184670.24678)
! Warning, results set was empty!
[1344184670.24678] FAILED TO FIND A CALL (note: there are two hangups per call, so this might not be an error)

Outbound Call 2, Initiated by Dialing Number on phone. X207 --> 4102152497, x207 is not assigned to any user when call was made.

  • Dial Command = Local/207@sugarsip/n
[2012-08-05 01:59:59] Timeout or Error
! AMI Event 'Newchannel surpressed.
! AMI Event 'Newstate surpressed.
[2012-08-05 02:00:58]
! --- Event -----------------------------------------------------------
!                Event --> NewCallerid                                       
!            Privilege --> call,all                                          
!              Channel --> SIP/207-0000265c                                  
!          CallerIDNum --> 207                                               
!         CallerIDName --> BR Mac Softphone                                  
!             Uniqueid --> 1344146454.24674                                  
!      CID-CallingPres --> 0 (Presentation Allowed, Not Screened)            
! ---------------------------------------------------------------------
* {e['UniqueId']} CallerID  Changed to: 207
[2012-08-05 02:00:58]
! --- Event -----------------------------------------------------------
!                Event --> NewCallerid                                       
!            Privilege --> call,all                                          
!              Channel --> SIP/207-0000265c                                  
!          CallerIDNum --> 4109429722                                        
!         CallerIDName --> Alertus                                           
!             Uniqueid --> 1344146454.24674                                  
!      CID-CallingPres --> 0 (Presentation Allowed, Not Screened)            
! ---------------------------------------------------------------------
* {e['UniqueId']} CallerID  Changed to: 4109429722
! AMI Event 'Newchannel surpressed.
[2012-08-05 02:00:58]
! --- Event -----------------------------------------------------------
!                Event --> Dial                                              
!            Privilege --> call,all                                          
!             SubEvent --> Begin                                             
!              Channel --> SIP/207-0000265c                                  
!          Destination --> SIP/Flowroute-0000265d                            
!          CallerIDNum --> 4109429722                                        
!         CallerIDName --> Alertus                                           
!             UniqueID --> 1344146454.24674                                  
!         DestUniqueID --> 1344146454.24675                                  
!           Dialstring --> Flowroute/14102152497                             
! ---------------------------------------------------------------------
! Dial Event src=SIP/207-0000265c dest=SIP/Flowroute-0000265d
! Successfully created CALL record with id=2cd5b51d-238c-1c2f-85a8-501e0c7e948a
* CallerID is: 4109429722
OUTBOUND state detected... /^(sip\/[1-9][0-9][0-9]?[0-9]?-|Local)/i is astMatchInternal eChannel= SIP/207-0000265c eDestination=SIP/Flowroute-0000265d
[2012-08-05 02:00:59]
! --- Event -----------------------------------------------------------
!                Event --> NewCallerid                                       
!            Privilege --> call,all                                          
!              Channel --> SIP/Flowroute-0000265d                            
!          CallerIDNum --> 4102152497                                        
!         CallerIDName -->                                                   
!             Uniqueid --> 1344146454.24675                                  
!      CID-CallingPres --> 0 (Presentation Allowed, Not Screened)            
! ---------------------------------------------------------------------
* {e['UniqueId']} CallerID  Changed to: 4102152497
! AMI Event 'ExtensionStatus surpressed.
! AMI Event 'ExtensionStatus surpressed.
! AMI Event 'ExtensionStatus surpressed.
! AMI Event 'Newstate surpressed.
! AMI Event 'Newstate surpressed.
! AMI Event 'Newstate surpressed.
[2012-08-05 02:01:16]
! --- Event -----------------------------------------------------------
!                Event --> NewAccountCode                                    
!            Privilege --> call,all                                          
!              Channel --> SIP/Flowroute-0000265d                            
!             Uniqueid --> 1344146454.24675                                  
!          AccountCode -->                                                   
!       OldAccountCode -->                                                   
! ---------------------------------------------------------------------
[2012-08-05 02:01:16]
! --- Event -----------------------------------------------------------
!                Event --> Bridge                                            
!            Privilege --> call,all                                          
!          Bridgestate --> Link                                              
!           Bridgetype --> core                                              
!             Channel1 --> SIP/207-0000265c                                  
!             Channel2 --> SIP/Flowroute-0000265d                            
!            Uniqueid1 --> 1344146454.24674                                  
!            Uniqueid2 --> 1344146454.24675                                  
!            CallerID1 --> 4109429722                                        
!            CallerID2 --> 4102152497                                        
! ---------------------------------------------------------------------
[2012-08-05 02:01:34]
! --- Event -----------------------------------------------------------
!                Event --> Unlink                                            
!            Privilege --> call,all                                          
!             Channel1 --> SIP/207-0000265c                                  
!             Channel2 --> SIP/Flowroute-0000265d                            
!            Uniqueid1 --> 1344146454.24674                                  
!            Uniqueid2 --> 1344146454.24675                                  
!            CallerID1 --> 4109429722                                        
!            CallerID2 --> 4102152497                                        
! ---------------------------------------------------------------------
[2012-08-05 02:01:34]
! --- Event -----------------------------------------------------------
!                Event --> Hangup                                            
!            Privilege --> call,all                                          
!              Channel --> SIP/Flowroute-0000265d                            
!             Uniqueid --> 1344146454.24675                                  
!          CallerIDNum --> 4102152497                                        
!         CallerIDName --> <unknown>                                         
!                Cause --> 16                                                
!            Cause-txt --> Normal Clearing                                   
! ---------------------------------------------------------------------
# +++ findCallByAsteriskId(1344146454.24675)
! Found entry in asterisk_log recordId=2cd5b51d-238c-1c2f-85a8-501e0c7e948a
# [1344146454.24675] FOUND outbound CALL
Looking for user extension number in: SIP/207-0000265c
Channel Matched SIP/### style regex.  Ext is:207
# +++ findUserByAsteriskExtension(207)
! Assigned user id set to 1
# [1344146454.24675] Measured call duration is 18 seconds
# +++ find AccountByPhoneNumber(4102152497)
! No results returned
# +++ find ContactByPhoneNumber(4102152497)
  findSugarObjectByPhoneNumber: Contact query components- Phone: 2152497   RegEx: (2\[^\d\]*1\[^\d\]*5\[^\d\]*2\[^\d\]*4\[^\d\]*9\[^\d\]*7\[^\d\]*)$
Found multiple contacts -- all belong to same account, associating call with account.
! Invalid Arguments passed to setRelationshipBetweenCallAndBean# [1344146454.24675] (OUTBOUND) Now updating record in /Calls/ id=2cd5b51d-238c-1c2f-85a8-501e0c7e948a...
NAME: ** Automatic record **
DESCRIPTION: 
[2012-08-05 02:01:35]
! --- Event -----------------------------------------------------------
!                Event --> Dial                                              
!            Privilege --> call,all                                          
!             SubEvent --> End                                               
!              Channel --> SIP/207-0000265c                                  
!             UniqueID --> 1344146454.24674                                  
!           DialStatus --> ANSWER                                            
! ---------------------------------------------------------------------
[2012-08-05 02:01:35]
! --- Event -----------------------------------------------------------
!                Event --> Hangup                                            
!            Privilege --> call,all                                          
!              Channel --> SIP/207-0000265c                                  
!             Uniqueid --> 1344146454.24674                                  
!          CallerIDNum --> 4109429722                                        
!         CallerIDName --> Alertus                                           
!                Cause --> 16                                                
!            Cause-txt --> Normal Clearing                                   
! ---------------------------------------------------------------------
# +++ findCallByAsteriskId(1344146454.24674)
! Warning, results set was empty!

Outbound Call initiated by Click To Dial, 207 was assigned to "Blake Robertson" at time of call.

  • Dial Command = Local/207@sugarsip/n
  • Ext 207 was assigned to SugarCRM User "Blake Robertson"
  • Interesting to note that Blake Robertson was logged in to SugarCRM when call was placed. As a result, callListener set the ContactId which this call was associated with. (It does this for performance reasons so it doesn't have to do a lookup each time it runs).
  • At time of call, I was logged in
! AMI Event 'Newchannel surpressed.
[2012-08-05 02:08:32]
! --- Event -----------------------------------------------------------
!                Event --> NewCallerid                                       
!            Privilege --> call,all                                          
!              Channel --> SIP/207-0000265e                                  
!          CallerIDNum --> 207                                               
!         CallerIDName -->                                                   
!             Uniqueid --> 1344146907.24676                                  
!      CID-CallingPres --> 0 (Presentation Allowed, Not Screened)            
! ---------------------------------------------------------------------
* {e['UniqueId']} CallerID  Changed to: 207
[2012-08-05 02:08:32]
! --- Event -----------------------------------------------------------
!                Event --> NewAccountCode                                    
!            Privilege --> call,all                                          
!              Channel --> SIP/207-0000265e                                  
!             Uniqueid --> 1344146907.24676                                  
!          AccountCode -->                                                   
!       OldAccountCode -->                                                   
! ---------------------------------------------------------------------
[2012-08-05 02:08:32]
! --- Event -----------------------------------------------------------
!                Event --> NewCallerid                                       
!            Privilege --> call,all                                          
!              Channel --> SIP/207-0000265e                                  
!          CallerIDNum --> 207                                               
!         CallerIDName -->                                                   
!             Uniqueid --> 1344146907.24676                                  
!      CID-CallingPres --> 0 (Presentation Allowed, Not Screened)            
! ---------------------------------------------------------------------
* {e['UniqueId']} CallerID  Changed to: 207
! AMI Event 'Newstate surpressed.
! AMI Event 'Newstate surpressed.
[2012-08-05 02:08:41]
! --- Event -----------------------------------------------------------
!                Event --> NewCallerid                                       
!            Privilege --> call,all                                          
!              Channel --> SIP/207-0000265e                                  
!          CallerIDNum --> 207                                               
!         CallerIDName --> BR Mac Softphone                                  
!             Uniqueid --> 1344146907.24676                                  
!      CID-CallingPres --> 0 (Presentation Allowed, Not Screened)            
! ---------------------------------------------------------------------
* {e['UniqueId']} CallerID  Changed to: 207
[2012-08-05 02:08:41]
! --- Event -----------------------------------------------------------
!                Event --> NewCallerid                                       
!            Privilege --> call,all                                          
!              Channel --> SIP/207-0000265e                                  
!          CallerIDNum --> 4109429722                                        
!         CallerIDName --> Alertus                                           
!             Uniqueid --> 1344146907.24676                                  
!      CID-CallingPres --> 0 (Presentation Allowed, Not Screened)            
! ---------------------------------------------------------------------
* {e['UniqueId']} CallerID  Changed to: 4109429722
! AMI Event 'Newchannel surpressed.
[2012-08-05 02:08:42]
! --- Event -----------------------------------------------------------
!                Event --> Dial                                              
!            Privilege --> call,all                                          
!             SubEvent --> Begin                                             
!              Channel --> SIP/207-0000265e                                  
!          Destination --> SIP/Flowroute-0000265f                            
!          CallerIDNum --> 4109429722                                        
!         CallerIDName --> Alertus                                           
!             UniqueID --> 1344146907.24676                                  
!         DestUniqueID --> 1344146917.24677                                  
!           Dialstring --> Flowroute/14102152497                             
! ---------------------------------------------------------------------
! Dial Event src=SIP/207-0000265e dest=SIP/Flowroute-0000265f
! Successfully created CALL record with id=4c28d2f2-6d8c-bb29-c445-501e0ddf6b79
* CallerID is: 4109429722
OUTBOUND state detected... /^(sip\/[1-9][0-9][0-9]?[0-9]?-|Local)/i is astMatchInternal eChannel= SIP/207-0000265e eDestination=SIP/Flowroute-0000265f
[2012-08-05 02:08:43]
! --- Event -----------------------------------------------------------
!                Event --> NewCallerid                                       
!            Privilege --> call,all                                          
!              Channel --> SIP/Flowroute-0000265f                            
!          CallerIDNum --> 14102152497                                       
!         CallerIDName -->                                                   
!             Uniqueid --> 1344146917.24677                                  
!      CID-CallingPres --> 0 (Presentation Allowed, Not Screened)            
! ---------------------------------------------------------------------
* {e['UniqueId']} CallerID  Changed to: 4102152497
! AMI Event 'Newstate surpressed.
! AMI Event 'Newstate surpressed.
[2012-08-05 02:08:54]
! --- Event -----------------------------------------------------------
!                Event --> NewAccountCode                                    
!            Privilege --> call,all                                          
!              Channel --> SIP/Flowroute-0000265f                            
!             Uniqueid --> 1344146917.24677                                  
!          AccountCode -->                                                   
!       OldAccountCode -->                                                   
! ---------------------------------------------------------------------
[2012-08-05 02:08:54]
! --- Event -----------------------------------------------------------
!                Event --> Bridge                                            
!            Privilege --> call,all                                          
!          Bridgestate --> Link                                              
!           Bridgetype --> core                                              
!             Channel1 --> SIP/207-0000265e                                  
!             Channel2 --> SIP/Flowroute-0000265f                            
!            Uniqueid1 --> 1344146907.24676                                  
!            Uniqueid2 --> 1344146917.24677                                  
!            CallerID1 --> 4109429722                                        
!            CallerID2 --> 14102152497                                       
! ---------------------------------------------------------------------
[2012-08-05 02:09:47]
! --- Event -----------------------------------------------------------
!                Event --> Unlink                                            
!            Privilege --> call,all                                          
!             Channel1 --> SIP/207-0000265e                                  
!             Channel2 --> SIP/Flowroute-0000265f                            
!            Uniqueid1 --> 1344146907.24676                                  
!            Uniqueid2 --> 1344146917.24677                                  
!            CallerID1 --> 4109429722                                        
!            CallerID2 --> 14102152497                                       
! ---------------------------------------------------------------------
[2012-08-05 02:09:47]
! --- Event -----------------------------------------------------------
!                Event --> Hangup                                            
!            Privilege --> call,all                                          
!              Channel --> SIP/Flowroute-0000265f                            
!             Uniqueid --> 1344146917.24677                                  
!          CallerIDNum --> 14102152497                                       
!         CallerIDName --> <unknown>                                         
!                Cause --> 16                                                
!            Cause-txt --> Normal Clearing                                   
! ---------------------------------------------------------------------
# +++ findCallByAsteriskId(1344146917.24677)
! Found entry in asterisk_log recordId=4c28d2f2-6d8c-bb29-c445-501e0ddf6b79
# [1344146917.24677] FOUND outbound CALL
Looking for user extension number in: SIP/207-0000265e
Channel Matched SIP/### style regex.  Ext is:207
# +++ findUserByAsteriskExtension(207)
! Assigned user id set to f1150f63-6f0e-ae05-7ba3-4ca1158cfa86
# [1344146917.24677] Measured call duration is 54 seconds
Contact Id already set by callListener to: 3373ab58-ec01-c5e1-38f1-4f8f921b535c
# Establishing relation to Contacts... Call ID: 4c28d2f2-6d8c-bb29-c445-501e0ddf6b79 to Bean ID: 3373ab58-ec01-c5e1-38f1-4f8f921b535c
! No results returned
# +++ findAccountForContact(3373ab58-ec01-c5e1-38f1-4f8f921b535c)
! No results returned
# No associated account found
# [1344146917.24677] (OUTBOUND) Now updating record in /Calls/ id=4c28d2f2-6d8c-bb29-c445-501e0ddf6b79...
NAME: ** Automatic record **
DESCRIPTION: 
[2012-08-05 02:09:49]
! --- Event -----------------------------------------------------------
!                Event --> Dial                                              
!            Privilege --> call,all                                          
!             SubEvent --> End                                               
!              Channel --> SIP/207-0000265e                                  
!             UniqueID --> 1344146907.24676                                  
!           DialStatus --> ANSWER                                            
! ---------------------------------------------------------------------
[2012-08-05 02:09:49]
! --- Event -----------------------------------------------------------
!                Event --> Hangup                                            
!            Privilege --> call,all                                          
!              Channel --> SIP/207-0000265e                                  
!             Uniqueid --> 1344146907.24676                                  
!          CallerIDNum --> 4109429722                                        
!         CallerIDName --> Alertus                                           
!                Cause --> 16                                                
!            Cause-txt --> Normal Clearing                                   
! ---------------------------------------------------------------------
# +++ findCallByAsteriskId(1344146907.24676)
! Warning, results set was empty!
[1344146907.24676] FAILED TO FIND A CALL (note: there are two hangups per call, so this might not be an error)

Inbound Call on Nested Ring Group 650 -> RG651,RG652

Here's an example of a complicated inbound call. The user called in to our main line. At the IVR pressed 650 which was assigned to RG650. 650 is a hunt strategy which first calls RG651. RG651 is a ring all strategy and has two extensions configured 52 and 207. If no answer on those it then tries RG652 which only has a single extension 208. I answered the call on 208.

In diagram form:

RG650 --> RG651 --> 52,207
      --> RG652 --> 208

! AMI Event 'Newchannel surpressed.
! AMI Event 'Newstate surpressed.
[2012-08-05 23:51:40]
! --- Event -----------------------------------------------------------
!                Event --> NewCallerid                                       
!            Privilege --> call,all                                          
!              Channel --> SIP/Flowroute-0000268a                            
!          CallerIDNum --> +14102152497                                      
!         CallerIDName --> +14102152497                                      
!             Uniqueid --> 1344225097.24750                                  
!      CID-CallingPres --> 0 (Presentation Allowed, Not Screened)            
! ---------------------------------------------------------------------
* {e['UniqueId']} CallerID  Changed to: +14102152497
! AMI Event 'Newstate surpressed.
! AMI Event 'Newchannel surpressed.
! AMI Event 'Newchannel surpressed.
[2012-08-05 23:51:47]
! --- Event -----------------------------------------------------------
!                Event --> Dial                                              
!            Privilege --> call,all                                          
!             SubEvent --> Begin                                             
!              Channel --> SIP/Flowroute-0000268a                            
!          Destination --> Local/651@from-internal-4590;1                    
!          CallerIDNum --> +14102152497                                      
!         CallerIDName --> +14102152497                                      
!             UniqueID --> 1344225097.24750                                  
!         DestUniqueID --> 1344225104.24751                                  
!           Dialstring --> 651@from-internal/n                               
! ---------------------------------------------------------------------
! Dial Event src=SIP/Flowroute-0000268a dest=Local/651@from-internal-4590;1
! Successfully created CALL record with id=97640bf7-68a4-dda0-465c-501f3f47b158
* CallerID is: +14102152497
Inbound state detected... /^(sip\/[1-9][0-9][0-9]?[0-9]?-|Local)/i is astMatchInternal eChannel= SIP/Flowroute-0000268a eDestination=Local/651@from-internal-4590;1
[2012-08-05 23:51:48]
! --- Event -----------------------------------------------------------
!                Event --> NewCallerid                                       
!            Privilege --> call,all                                          
!              Channel --> Local/651@from-internal-4590;1                    
!          CallerIDNum --> 650                                               
!         CallerIDName -->                                                   
!             Uniqueid --> 1344225104.24751                                  
!      CID-CallingPres --> 0 (Presentation Allowed, Not Screened)            
! ---------------------------------------------------------------------
* {e['UniqueId']} CallerID  Changed to: 650
! AMI Event 'Newchannel surpressed.
! AMI Event 'Newchannel surpressed.
[2012-08-05 23:51:48]
! --- Event -----------------------------------------------------------
!                Event --> Dial                                              
!            Privilege --> call,all                                          
!             SubEvent --> Begin                                             
!              Channel --> Local/651@from-internal-4590;2                    
!          Destination --> Local/52@sugarsip-9cc5;1                          
!          CallerIDNum --> +14102152497                                      
!         CallerIDName --> +14102152497                                      
!             UniqueID --> 1344225104.24752                                  
!         DestUniqueID --> 1344225104.24753                                  
!           Dialstring --> 52@sugarsip/n                                     
! ---------------------------------------------------------------------
! Dial Event src=Local/651@from-internal-4590;2 dest=Local/52@sugarsip-9cc5;1
! Successfully created CALL record with id=7c31c7b0-fe98-2840-4ddc-501f3f0a522d
* CallerID is: +14102152497
INTERNAL call detected, Deleting Call Record 7c31c7b0-fe98-2840-4ddc-501f3f0a522d affected: 1 rows.
[2012-08-05 23:51:48]
! --- Event -----------------------------------------------------------
!                Event --> NewCallerid                                       
!            Privilege --> call,all                                          
!              Channel --> Local/52@sugarsip-9cc5;1                          
!          CallerIDNum --> 651                                               
!         CallerIDName -->                                                   
!             Uniqueid --> 1344225104.24753                                  
!      CID-CallingPres --> 0 (Presentation Allowed, Not Screened)            
! ---------------------------------------------------------------------
* {e['UniqueId']} CallerID  Changed to: 651
! AMI Event 'Newchannel surpressed.
! AMI Event 'Newchannel surpressed.
[2012-08-05 23:51:48]
! --- Event -----------------------------------------------------------
!                Event --> Dial                                              
!            Privilege --> call,all                                          
!             SubEvent --> Begin                                             
!              Channel --> Local/651@from-internal-4590;2                    
!          Destination --> Local/207@sugarsip-10f8;1                         
!          CallerIDNum --> +14102152497                                      
!         CallerIDName --> +14102152497                                      
!             UniqueID --> 1344225104.24752                                  
!         DestUniqueID --> 1344225104.24755                                  
!           Dialstring --> 207@sugarsip/n                                    
! ---------------------------------------------------------------------
! Dial Event src=Local/651@from-internal-4590;2 dest=Local/207@sugarsip-10f8;1
! Successfully created CALL record with id=ef027e0c-e63a-a913-7020-501f3f87da6e
* CallerID is: +14102152497
INTERNAL call detected, Deleting Call Record ef027e0c-e63a-a913-7020-501f3f87da6e affected: 1 rows.
[2012-08-05 23:51:49]
! --- Event -----------------------------------------------------------
!                Event --> NewCallerid                                       
!            Privilege --> call,all                                          
!              Channel --> Local/207@sugarsip-10f8;1                         
!          CallerIDNum --> 651                                               
!         CallerIDName -->                                                   
!             Uniqueid --> 1344225104.24755                                  
!      CID-CallingPres --> 0 (Presentation Allowed, Not Screened)            
! ---------------------------------------------------------------------
* {e['UniqueId']} CallerID  Changed to: 651
! AMI Event 'Newstate surpressed.
[2012-08-05 23:51:50]
! --- Event -----------------------------------------------------------
!                Event --> NewCallerid                                       
!            Privilege --> call,all                                          
!              Channel --> Local/207@sugarsip-10f8;2                         
!          CallerIDNum --> +14102152497                                      
!         CallerIDName --> Mickey Mouse (Magic Kingdom)                      
!             Uniqueid --> 1344225104.24756                                  
!      CID-CallingPres --> 0 (Presentation Allowed, Not Screened)            
! ---------------------------------------------------------------------
* {e['UniqueId']} CallerID  Changed to: +14102152497
[2012-08-05 23:51:50]
! --- Event -----------------------------------------------------------
!                Event --> NewCallerid                                       
!            Privilege --> call,all                                          
!              Channel --> Local/52@sugarsip-9cc5;2                          
!          CallerIDNum --> +14102152497                                      
!         CallerIDName --> Mickey Mouse (Magic Kingdom)                      
!             Uniqueid --> 1344225104.24754                                  
!      CID-CallingPres --> 0 (Presentation Allowed, Not Screened)            
! ---------------------------------------------------------------------
* {e['UniqueId']} CallerID  Changed to: +14102152497
! AMI Event 'Newchannel surpressed.
[2012-08-05 23:51:50]
! --- Event -----------------------------------------------------------
!                Event --> Dial                                              
!            Privilege --> call,all                                          
!             SubEvent --> Begin                                             
!              Channel --> Local/52@sugarsip-9cc5;2                          
!          Destination --> SIP/52-0000268b                                   
!          CallerIDNum --> +14102152497                                      
!         CallerIDName --> Mickey Mouse (Magic Kingdom)                      
!             UniqueID --> 1344225104.24754                                  
!         DestUniqueID --> 1344225107.24757                                  
!           Dialstring --> 52                                                
! ---------------------------------------------------------------------
! Dial Event src=Local/52@sugarsip-9cc5;2 dest=SIP/52-0000268b
! Successfully created CALL record with id=881caed3-d1d5-e39d-6f7b-501f3f302c0b
* CallerID is: +14102152497
INTERNAL call detected, Deleting Call Record 881caed3-d1d5-e39d-6f7b-501f3f302c0b affected: 1 rows.
[2012-08-05 23:51:50]
! --- Event -----------------------------------------------------------
!                Event --> NewCallerid                                       
!            Privilege --> call,all                                          
!              Channel --> SIP/52-0000268b                                   
!          CallerIDNum --> 52                                                
!         CallerIDName -->                                                   
!             Uniqueid --> 1344225107.24757                                  
!      CID-CallingPres --> 0 (Presentation Allowed, Not Screened)            
! ---------------------------------------------------------------------
* {e['UniqueId']} CallerID  Changed to: 52
! AMI Event 'Newchannel surpressed.
[2012-08-05 23:51:50]
! --- Event -----------------------------------------------------------
!                Event --> Dial                                              
!            Privilege --> call,all                                          
!             SubEvent --> Begin                                             
!              Channel --> Local/207@sugarsip-10f8;2                         
!          Destination --> SIP/207-0000268c                                  
!          CallerIDNum --> +14102152497                                      
!         CallerIDName --> Mickey Mouse (Magic Kingdom)                      
!             UniqueID --> 1344225104.24756                                  
!         DestUniqueID --> 1344225107.24758                                  
!           Dialstring --> 207                                               
! ---------------------------------------------------------------------
! Dial Event src=Local/207@sugarsip-10f8;2 dest=SIP/207-0000268c
! Successfully created CALL record with id=eb444cd0-58b9-b5cb-0b5a-501f3f75ae96
* CallerID is: +14102152497
INTERNAL call detected, Deleting Call Record eb444cd0-58b9-b5cb-0b5a-501f3f75ae96 affected: 1 rows.
[2012-08-05 23:51:51]
! --- Event -----------------------------------------------------------
!                Event --> NewCallerid                                       
!            Privilege --> call,all                                          
!              Channel --> SIP/207-0000268c                                  
!          CallerIDNum --> 207                                               
!         CallerIDName -->                                                   
!             Uniqueid --> 1344225107.24758                                  
!      CID-CallingPres --> 0 (Presentation Allowed, Not Screened)            
! ---------------------------------------------------------------------
* {e['UniqueId']} CallerID  Changed to: 207
! AMI Event 'Newstate surpressed.
! AMI Event 'Newstate surpressed.
! AMI Event 'Newstate surpressed.
! AMI Event 'Newstate surpressed.
[2012-08-05 23:52:02]
! --- Event -----------------------------------------------------------
!                Event --> Hangup                                            
!            Privilege --> call,all                                          
!              Channel --> Local/207@sugarsip-10f8;1                         
!             Uniqueid --> 1344225104.24755                                  
!          CallerIDNum --> 651                                               
!         CallerIDName --> <unknown>                                         
!                Cause --> 0                                                 
!            Cause-txt --> Unknown                                           
! ---------------------------------------------------------------------
# +++ findCallByAsteriskId(1344225104.24755)
! Warning, results set was empty!
[1344225104.24755] FAILED TO FIND A CALL (note: there are two hangups per call, so this might not be an error)
[2012-08-05 23:52:02]
! --- Event -----------------------------------------------------------
!                Event --> Hangup                                            
!            Privilege --> call,all                                          
!              Channel --> Local/52@sugarsip-9cc5;1                          
!             Uniqueid --> 1344225104.24753                                  
!          CallerIDNum --> 651                                               
!         CallerIDName --> <unknown>                                         
!                Cause --> 0                                                 
!            Cause-txt --> Unknown                                           
! ---------------------------------------------------------------------
# +++ findCallByAsteriskId(1344225104.24753)
! Warning, results set was empty!
[1344225104.24753] FAILED TO FIND A CALL (note: there are two hangups per call, so this might not be an error)
[2012-08-05 23:52:02]
! --- Event -----------------------------------------------------------
!                Event --> Hangup                                            
!            Privilege --> call,all                                          
!              Channel --> SIP/207-0000268c                                  
!             Uniqueid --> 1344225107.24758                                  
!          CallerIDNum --> 207                                               
!         CallerIDName --> <unknown>                                         
!                Cause --> 16                                                
!            Cause-txt --> Normal Clearing                                   
! ---------------------------------------------------------------------
# +++ findCallByAsteriskId(1344225107.24758)
! Warning, results set was empty!
[1344225107.24758] FAILED TO FIND A CALL (note: there are two hangups per call, so this might not be an error)
[2012-08-05 23:52:02]
! --- Event -----------------------------------------------------------
!                Event --> Dial                                              
!            Privilege --> call,all                                          
!             SubEvent --> End                                               
!              Channel --> Local/651@from-internal-4590;2                    
!             UniqueID --> 1344225104.24752                                  
!           DialStatus --> NOANSWER                                          
! ---------------------------------------------------------------------
[2012-08-05 23:52:02]
! --- Event -----------------------------------------------------------
!                Event --> Hangup                                            
!            Privilege --> call,all                                          
!              Channel --> Local/651@from-internal-4590;2                    
!             Uniqueid --> 1344225104.24752                                  
!          CallerIDNum --> +14102152497                                      
!         CallerIDName --> +14102152497                                      
!                Cause --> 16                                                
!            Cause-txt --> Normal Clearing                                   
! ---------------------------------------------------------------------
# +++ findCallByAsteriskId(1344225104.24752)
! Warning, results set was empty!
[1344225104.24752] FAILED TO FIND A CALL (note: there are two hangups per call, so this might not be an error)
[2012-08-05 23:52:02]
! --- Event -----------------------------------------------------------
!                Event --> Dial                                              
!            Privilege --> call,all                                          
!             SubEvent --> End                                               
!              Channel --> Local/207@sugarsip-10f8;2                         
!             UniqueID --> 1344225104.24756                                  
!           DialStatus --> CANCEL                                            
! ---------------------------------------------------------------------
[2012-08-05 23:52:02]
! --- Event -----------------------------------------------------------
!                Event --> Hangup                                            
!            Privilege --> call,all                                          
!              Channel --> Local/207@sugarsip-10f8;2                         
!             Uniqueid --> 1344225104.24756                                  
!          CallerIDNum --> +14102152497                                      
!         CallerIDName --> Mickey Mouse (Magic Kingdom)                      
!                Cause --> 0                                                 
!            Cause-txt --> Unknown                                           
! ---------------------------------------------------------------------
# +++ findCallByAsteriskId(1344225104.24756)
! Warning, results set was empty!
[1344225104.24756] FAILED TO FIND A CALL (note: there are two hangups per call, so this might not be an error)
[2012-08-05 23:52:02]
! --- Event -----------------------------------------------------------
!                Event --> Hangup                                            
!            Privilege --> call,all                                          
!              Channel --> Local/651@from-internal-4590;1                    
!             Uniqueid --> 1344225104.24751                                  
!          CallerIDNum --> 650                                               
!         CallerIDName --> <unknown>                                         
!                Cause --> 16                                                
!            Cause-txt --> Normal Clearing                                   
! ---------------------------------------------------------------------
# +++ findCallByAsteriskDestId(1344225104.24751)
! FindCallByAsteriskDestId - Found entry in asterisk_log recordId=97640bf7-68a4-dda0-465c-501f3f47b158
Looking for user extension number in: Local/651@from-internal-4590;1
Matched User REGEX.  Regex: 651
# +++ findUserByAsteriskExtension(651)
 ! Assigned user will be set to Administrator.
# Measured call duration is 0 seconds
Adding INBOUND Failed Call, id=1344225104.24751, call_id = 97640bf7-68a4-dda0-465c-501f3f47b158
# +++ find AccountByPhoneNumber(+14102152497)
! No results returned
# +++ find ContactByPhoneNumber(+14102152497)
  findSugarObjectByPhoneNumber: Contact query components- Phone: 2152497   RegEx: (2\[^\d\]*1\[^\d\]*5\[^\d\]*2\[^\d\]*4\[^\d\]*9\[^\d\]*7\[^\d\]*)$
Found multiple contacts (50) -- all belong to same account, associating call with account b9664d2a-2568-5979-8d3b-4f9045ae68ac
# Establishing relation to Accounts... Call ID: 97640bf7-68a4-dda0-465c-501f3f47b158 to Bean ID: b9664d2a-2568-5979-8d3b-4f9045ae68ac
! No results returned
# (INBOUND) now updating record in /Calls/ id=97640bf7-68a4-dda0-465c-501f3f47b158...
NAME: ** Automatic record **
DESCRIPTION: 
Cleaning up Failed Calls part1, asterisk_id = 1344225097.24750
[2012-08-05 23:52:04]
! --- Event -----------------------------------------------------------
!                Event --> Dial                                              
!            Privilege --> call,all                                          
!             SubEvent --> End                                               
!              Channel --> SIP/Flowroute-0000268a                            
!             UniqueID --> 1344225097.24750                                  
!           DialStatus --> NOANSWER                                          
! ---------------------------------------------------------------------
[2012-08-05 23:52:04]
! --- Event -----------------------------------------------------------
!                Event --> Hangup                                            
!            Privilege --> call,all                                          
!              Channel --> SIP/52-0000268b                                   
!             Uniqueid --> 1344225107.24757                                  
!          CallerIDNum --> 52                                                
!         CallerIDName --> <unknown>                                         
!                Cause --> 16                                                
!            Cause-txt --> Normal Clearing                                   
! ---------------------------------------------------------------------
# +++ findCallByAsteriskId(1344225107.24757)
! Warning, results set was empty!
[1344225107.24757] FAILED TO FIND A CALL (note: there are two hangups per call, so this might not be an error)
[2012-08-05 23:52:04]
! --- Event -----------------------------------------------------------
!                Event --> Dial                                              
!            Privilege --> call,all                                          
!             SubEvent --> End                                               
!              Channel --> Local/52@sugarsip-9cc5;2                          
!             UniqueID --> 1344225104.24754                                  
!           DialStatus --> CANCEL                                            
! ---------------------------------------------------------------------
[2012-08-05 23:52:04]
! --- Event -----------------------------------------------------------
!                Event --> Hangup                                            
!            Privilege --> call,all                                          
!              Channel --> Local/52@sugarsip-9cc5;2                          
!             Uniqueid --> 1344225104.24754                                  
!          CallerIDNum --> +14102152497                                      
!         CallerIDName --> Mickey Mouse (Magic Kingdom)                      
!                Cause --> 0                                                 
!            Cause-txt --> Unknown                                           
! ---------------------------------------------------------------------
# +++ findCallByAsteriskId(1344225104.24754)
! Warning, results set was empty!
[1344225104.24754] FAILED TO FIND A CALL (note: there are two hangups per call, so this might not be an error)
! AMI Event 'Newchannel surpressed.
! AMI Event 'Newchannel surpressed.
[2012-08-05 23:52:04]
! --- Event -----------------------------------------------------------
!                Event --> Dial                                              
!            Privilege --> call,all                                          
!             SubEvent --> Begin                                             
!              Channel --> SIP/Flowroute-0000268a                            
!          Destination --> Local/652@from-internal-919c;1                    
!          CallerIDNum --> +14102152497                                      
!         CallerIDName --> +14102152497                                      
!             UniqueID --> 1344225097.24750                                  
!         DestUniqueID --> 1344225119.24759                                  
!           Dialstring --> 652@from-internal/n                               
! ---------------------------------------------------------------------
! Dial Event src=SIP/Flowroute-0000268a dest=Local/652@from-internal-919c;1
! Successfully created CALL record with id=1d800f28-be80-2486-7f13-501f3f7e082d
* CallerID is: +14102152497
Inbound state detected... /^(sip\/[1-9][0-9][0-9]?[0-9]?-|Local)/i is astMatchInternal eChannel= SIP/Flowroute-0000268a eDestination=Local/652@from-internal-919c;1
[2012-08-05 23:52:05]
! --- Event -----------------------------------------------------------
!                Event --> NewCallerid                                       
!            Privilege --> call,all                                          
!              Channel --> Local/652@from-internal-919c;1                    
!          CallerIDNum --> 650                                               
!         CallerIDName -->                                                   
!             Uniqueid --> 1344225119.24759                                  
!      CID-CallingPres --> 0 (Presentation Allowed, Not Screened)            
! ---------------------------------------------------------------------
* {e['UniqueId']} CallerID  Changed to: 650
! AMI Event 'Newchannel surpressed.
[2012-08-05 23:52:05]
! --- Event -----------------------------------------------------------
!                Event --> Dial                                              
!            Privilege --> call,all                                          
!             SubEvent --> Begin                                             
!              Channel --> Local/652@from-internal-919c;2                    
!          Destination --> SIP/208-0000268d                                  
!          CallerIDNum --> +14102152497                                      
!         CallerIDName --> +14102152497                                      
!             UniqueID --> 1344225119.24760                                  
!         DestUniqueID --> 1344225120.24761                                  
!           Dialstring --> 208                                               
! ---------------------------------------------------------------------
! Dial Event src=Local/652@from-internal-919c;2 dest=SIP/208-0000268d
! Successfully created CALL record with id=d478918e-7ece-7f0e-9993-501f3f92b93c
* CallerID is: +14102152497
INTERNAL call detected, Deleting Call Record d478918e-7ece-7f0e-9993-501f3f92b93c affected: 1 rows.
[2012-08-05 23:52:06]
! --- Event -----------------------------------------------------------
!                Event --> NewCallerid                                       
!            Privilege --> call,all                                          
!              Channel --> SIP/208-0000268d                                  
!          CallerIDNum --> 652                                               
!         CallerIDName -->                                                   
!             Uniqueid --> 1344225120.24761                                  
!      CID-CallingPres --> 0 (Presentation Allowed, Not Screened)            
! ---------------------------------------------------------------------
* {e['UniqueId']} CallerID  Changed to: 652
! AMI Event 'Newstate surpressed.
! AMI Event 'ExtensionStatus surpressed.
! AMI Event 'Newstate surpressed.
! AMI Event 'ExtensionStatus surpressed.
! AMI Event 'ExtensionStatus surpressed.
! AMI Event 'ExtensionStatus surpressed.
! AMI Event 'Newstate surpressed.
! AMI Event 'Newstate surpressed.
[2012-08-05 23:52:15]
! --- Event -----------------------------------------------------------
!                Event --> NewAccountCode                                    
!            Privilege --> call,all                                          
!              Channel --> SIP/208-0000268d                                  
!             Uniqueid --> 1344225120.24761                                  
!          AccountCode -->                                                   
!       OldAccountCode -->                                                   
! ---------------------------------------------------------------------
[2012-08-05 23:52:15]
! --- Event -----------------------------------------------------------
!                Event --> Bridge                                            
!            Privilege --> call,all                                          
!          Bridgestate --> Link                                              
!           Bridgetype --> core                                              
!             Channel1 --> Local/652@from-internal-919c;2                    
!             Channel2 --> SIP/208-0000268d                                  
!            Uniqueid1 --> 1344225119.24760                                  
!            Uniqueid2 --> 1344225120.24761                                  
!            CallerID1 --> +14102152497                                      
!            CallerID2 --> 652                                               
! ---------------------------------------------------------------------
Internal Bridge Event Detected
Internal: SELECT id FROM asterisk_log WHERE channel like 'Local/652@from-internal-919c%' and direction='I' 
Internal Changing the channel to: SIP/208-0000268d
UPDATE QUERY: UPDATE asterisk_log SET channel='SIP/208-0000268d' WHERE id='4221'
! AMI Event 'Newstate surpressed.
[2012-08-05 23:52:15]
! --- Event -----------------------------------------------------------
!                Event --> NewAccountCode                                    
!            Privilege --> call,all                                          
!              Channel --> Local/652@from-internal-919c;1                    
!             Uniqueid --> 1344225119.24759                                  
!          AccountCode -->                                                   
!       OldAccountCode -->                                                   
! ---------------------------------------------------------------------
[2012-08-05 23:52:15]
! --- Event -----------------------------------------------------------
!                Event --> Bridge                                            
!            Privilege --> call,all                                          
!          Bridgestate --> Link                                              
!           Bridgetype --> core                                              
!             Channel1 --> SIP/Flowroute-0000268a                            
!             Channel2 --> Local/652@from-internal-919c;1                    
!            Uniqueid1 --> 1344225097.24750                                  
!            Uniqueid2 --> 1344225119.24759                                  
!            CallerID1 --> +14102152497                                      
!            CallerID2 --> 650                                               
! ---------------------------------------------------------------------
Deleting Call Record: 97640bf7-68a4-dda0-465c-501f3f47b158
[2012-08-05 23:52:15]
! --- Event -----------------------------------------------------------
!                Event --> Unlink                                            
!            Privilege --> call,all                                          
!             Channel1 --> SIP/Flowroute-0000268a                            
!             Channel2 --> Local/652@from-internal-919c;1                    
!            Uniqueid1 --> 1344225097.24750                                  
!            Uniqueid2 --> 1344225119.24759                                  
!            CallerID1 --> +14102152497                                      
!            CallerID2 --> 650                                               
! ---------------------------------------------------------------------
[2012-08-05 23:52:15]
! --- Event -----------------------------------------------------------
!                Event --> Bridge                                            
!            Privilege --> call,all                                          
!          Bridgestate --> Link                                              
!           Bridgetype --> core                                              
!             Channel1 --> SIP/Flowroute-0000268a                            
!             Channel2 --> Local/652@from-internal-919c;1                    
!            Uniqueid1 --> 1344225097.24750                                  
!            Uniqueid2 --> 1344225119.24759                                  
!            CallerID1 --> +14102152497                                      
!            CallerID2 --> 650                                               
! ---------------------------------------------------------------------
Deleting Call Record: 97640bf7-68a4-dda0-465c-501f3f47b158
[2012-08-05 23:52:44]
! --- Event -----------------------------------------------------------
!                Event --> Unlink                                            
!            Privilege --> call,all                                          
!             Channel1 --> SIP/Flowroute-0000268a                            
!             Channel2 --> Local/652@from-internal-919c;1                    
!            Uniqueid1 --> 1344225097.24750                                  
!            Uniqueid2 --> 1344225119.24759                                  
!            CallerID1 --> +14102152497                                      
!            CallerID2 --> 650                                               
! ---------------------------------------------------------------------
[2012-08-05 23:52:44]
! --- Event -----------------------------------------------------------
!                Event --> Hangup                                            
!            Privilege --> call,all                                          
!              Channel --> Local/652@from-internal-919c;1                    
!             Uniqueid --> 1344225119.24759                                  
!          CallerIDNum --> 650                                               
!         CallerIDName --> <unknown>                                         
!                Cause --> 16                                                
!            Cause-txt --> Normal Clearing                                   
! ---------------------------------------------------------------------
# +++ findCallByAsteriskDestId(1344225119.24759)
! FindCallByAsteriskDestId - Found entry in asterisk_log recordId=1d800f28-be80-2486-7f13-501f3f7e082d
Looking for user extension number in: SIP/208-0000268d
Channel Matched SIP/### style regex.  Ext is:208
# +++ findUserByAsteriskExtension(208)
! Assigned user id set to f1150f63-6f0e-ae05-7ba3-4ca1158cfa86
# Measured call duration is 29 seconds
Contact Id already set by callListener to: 3373ab58-ec01-c5e1-38f1-4f8f921b535c
# Establishing relation to Contacts... Call ID: 1d800f28-be80-2486-7f13-501f3f7e082d to Bean ID: 3373ab58-ec01-c5e1-38f1-4f8f921b535c
! No results returned
# +++ findAccountForContact(3373ab58-ec01-c5e1-38f1-4f8f921b535c)
! No results returned
# Associated account is b9664d2a-2568-5979-8d3b-4f9045ae68ac
# (INBOUND) now updating record in /Calls/ id=1d800f28-be80-2486-7f13-501f3f7e082d...
NAME: IBC: nice, this was the second RG
DESCRIPTION: nice, this was the second RG
Cleaning up Failed Calls part1, asterisk_id = 1344225097.24750
[2012-08-05 23:52:45]
! --- Event -----------------------------------------------------------
!                Event --> Unlink                                            
!            Privilege --> call,all                                          
!             Channel1 --> Local/652@from-internal-919c;2                    
!             Channel2 --> SIP/208-0000268d                                  
!            Uniqueid1 --> 1344225119.24760                                  
!            Uniqueid2 --> 1344225120.24761                                  
!            CallerID1 --> +14102152497                                      
!            CallerID2 --> 652                                               
! ---------------------------------------------------------------------
[2012-08-05 23:52:45]
! --- Event -----------------------------------------------------------
!                Event --> Dial                                              
!            Privilege --> call,all                                          
!             SubEvent --> End                                               
!              Channel --> SIP/Flowroute-0000268a                            
!             UniqueID --> 1344225097.24750                                  
!           DialStatus --> ANSWER                                            
! ---------------------------------------------------------------------
[2012-08-05 23:52:45]
! --- Event -----------------------------------------------------------
!                Event --> Hangup                                            
!            Privilege --> call,all                                          
!              Channel --> SIP/Flowroute-0000268a                            
!             Uniqueid --> 1344225097.24750                                  
!          CallerIDNum --> +14102152497                                      
!         CallerIDName --> +14102152497                                      
!                Cause --> 16                                                
!            Cause-txt --> Normal Clearing                                   
! ---------------------------------------------------------------------
# +++ findCallByAsteriskDestId(1344225097.24750)
! Warning, FindCallByAsteriskDestId results set was empty!
! AMI Event 'ExtensionStatus surpressed.
[2012-08-05 23:52:45]
! --- Event -----------------------------------------------------------
!                Event --> Hangup                                            
!            Privilege --> call,all                                          
!              Channel --> SIP/208-0000268d                                  
!             Uniqueid --> 1344225120.24761                                  
!          CallerIDNum --> 652                                               
!         CallerIDName --> <unknown>                                         
!                Cause --> 16                                                
!            Cause-txt --> Normal Clearing                                   
! ---------------------------------------------------------------------
# +++ findCallByAsteriskId(1344225120.24761)
! Warning, results set was empty!
[1344225120.24761] FAILED TO FIND A CALL (note: there are two hangups per call, so this might not be an error)
[2012-08-05 23:52:45]
! --- Event -----------------------------------------------------------
!                Event --> Dial                                              
!            Privilege --> call,all                                          
!             SubEvent --> End                                               
!              Channel --> Local/652@from-internal-919c;2                    
!             UniqueID --> 1344225119.24760                                  
!           DialStatus --> ANSWER                                            
! ---------------------------------------------------------------------
[2012-08-05 23:52:45]
! --- Event -----------------------------------------------------------
!                Event --> Hangup                                            
!            Privilege --> call,all                                          
!              Channel --> Local/652@from-internal-919c;2                    
!             Uniqueid --> 1344225119.24760                                  
!          CallerIDNum --> +14102152497                                      
!         CallerIDName --> +14102152497                                      
!                Cause --> 16                                                
!            Cause-txt --> Normal Clearing                                   
! ---------------------------------------------------------------------
# +++ findCallByAsteriskId(1344225119.24760)
! Warning, results set was empty!
[1344225119.24760] FAILED TO FIND A CALL (note: there are two hangups per call, so this might not be an error)
[2012-08-05 23:53:45] Timeout or Error

Here's what Asterisk Logger output looks like on start

******** Asterisk Logger Starting **************
# Sugar root set to [C:\sugarcrm\htdocs\sugarcrm\custom\modules\Asterisk/../../../]
Logging to: c:/asterisk_log.txt
# Callout prefix is [1]
# Callin prefix is [+1]
asteriskMatchInternal = /^(sip\/[1-9][0-9][0-9]?[0-9]?-|Local)/i
# (Config processed)
Selecting DB Name: sugarcrm
! Trying SOAP login endpoint=[http://sugar.alertus.com:80/sugarcrm/soap.php] user=[admin] password=[3a769f7REDACTEDda6ab4]
! Successful SOAP login id=220ejeafpl6i1jqluebh74t314 user=admin GUID=1
# Successfully opened socket connection to ast.alertus.com:5038
! AMI Login action returned with rc=Asterisk Call Manager/1.1

[2012-09-26 23:43:24]
! --- Event -----------------------------------------------------------
!                Event -->

Example DAHDI, Outbound call (For reference purposes... outbound calls didn't set Phone number called in call popups until i added some code see issue #75 for reference)...


! AMI Event 'Newchannel surpressed.
! AMI Event 'Newstate surpressed.
! AMI Event 'ExtensionStatus surpressed.
[2012-10-31 08:20:00]
! --- Event -----------------------------------------------------------
!                Event --> NewCallerid
!            Privilege --> call,all
!              Channel --> SIP/202-00000001
!          CallerIDNum --> 7751112222
!         CallerIDName -->
!             Uniqueid --> 1351671616.2
!      CID-CallingPres --> 0 (Presentation Allowed, Not Screened)
! ---------------------------------------------------------------------
   CallerID  Changed to: 7751112222
! AMI Event 'Newchannel surpressed.
[2012-10-31 08:20:00]
! --- Event -----------------------------------------------------------
!                Event --> DAHDIChannel
!            Privilege --> call,all
!              Channel --> DAHDI/1-1
!             Uniqueid --> 1351671616.3
!            DAHDISpan --> 1
!         DAHDIChannel --> 1
! ---------------------------------------------------------------------
[2012-10-31 08:20:00]
! --- Event -----------------------------------------------------------
!                Event --> NewCallerid
!            Privilege --> call,all
!              Channel --> DAHDI/1-1
!          CallerIDNum --> 914102152497
!         CallerIDName -->
!             Uniqueid --> 1351671616.3
!      CID-CallingPres --> 0 (Presentation Allowed, Not Screened)
! ---------------------------------------------------------------------
* Stripping prefix: 9
   CallerID  Changed to: 14102152497
! AMI Event 'Newstate surpressed.
[2012-10-31 08:20:00]
! --- Event -----------------------------------------------------------
!                Event --> Dial
!            Privilege --> call,all
!             SubEvent --> Begin
!              Channel --> SIP/202-00000001
!          Destination --> DAHDI/1-1
!          CallerIDNum --> 7751112222
!         CallerIDName --> <unknown>
!     ConnectedLineNum --> <unknown>
!    ConnectedLineName --> <unknown>
!             UniqueID --> 1351671616.2
!         DestUniqueID --> 1351671616.3
!           Dialstring --> g0/14102152497
! ---------------------------------------------------------------------
! Dial Event src=SIP/202-00000001 dest=DAHDI/1-1
! Successfully created CALL record with id=bc370e04-ee9b-d9fb-2b6c-5090df97146f
Overriding the caller id.
  DIALSTRING CallerID override, setting it to: 14102152497
  CallerID is: 14102152497
OUTBOUND state detected... /^(sip\/[1-9][0-9][0-9]?[0-9]?-|Local)/i is astMatchInternal eChannel= SIP/202-00000001 eDestination=DAHDI/1-1
! AMI Event 'Newstate surpressed.
! AMI Event 'Newstate surpressed.
[2012-10-31 08:20:05]
! --- Event -----------------------------------------------------------
!                Event --> NewAccountCode
!            Privilege --> call,all
!              Channel --> DAHDI/1-1
!             Uniqueid --> 1351671616.3
!          AccountCode -->
!       OldAccountCode -->
! ---------------------------------------------------------------------
[2012-10-31 08:20:05]
! --- Event -----------------------------------------------------------
!                Event --> Bridge
!            Privilege --> call,all
!          Bridgestate --> Link
!           Bridgetype --> core
!             Channel1 --> SIP/202-00000001
!             Channel2 --> DAHDI/1-1
!            Uniqueid1 --> 1351671616.2
!            Uniqueid2 --> 1351671616.3
!            CallerID1 --> 7751112222
!            CallerID2 --> 914102152497
! ---------------------------------------------------------------------
[2012-10-31 08:21:05] Patiently Waiting...!
[2012-10-31 08:22:05] Patiently Waiting...!
[2012-10-31 08:22:11]
! --- Event -----------------------------------------------------------
!                Event --> Unlink
!            Privilege --> call,all
!             Channel1 --> SIP/202-00000001
!             Channel2 --> DAHDI/1-1
!            Uniqueid1 --> 1351671616.2
!            Uniqueid2 --> 1351671616.3
!            CallerID1 --> 7751112222
!            CallerID2 --> 914102152497
! ---------------------------------------------------------------------
[2012-10-31 08:22:11]
! --- Event -----------------------------------------------------------
!                Event --> Hangup
!            Privilege --> call,all
!              Channel --> DAHDI/1-1
!             Uniqueid --> 1351671616.3
!          CallerIDNum --> 914102152497
!         CallerIDName --> <unknown>
!     ConnectedLineNum --> 7751112222
!    ConnectedLineName --> <unknown>
!                Cause --> 16
!            Cause-txt --> Normal Clearing
! ---------------------------------------------------------------------
# +++ findCallByAsteriskId(1351671616.3)
! Found entry in asterisk_log recordId=bc370e04-ee9b-d9fb-2b6c-5090df97146f
### [1351671616.3] FOUND outbound CALL
Looking for user extension number in: SIP/202-00000001
Channel Matched SIP/### style regex.  Ext is:202
### +++ findUserByAsteriskExtension(202)
 ! Assigned user will be set to Administrator.
  [1351671616.3] Measured call duration is 126 seconds
# +++ find AccountByPhoneNumber(14102152497)
! No results returned
### +++ find ContactByPhoneNumber(14102152497)
  findSugarObjectByPhoneNumber: Contact query components- Phone: 2152497   RegEx: (2\[^\d\]*1\[^\d\]*5\[^\d\]*2\[^\d\]*4\[^\d\]*9\[^\d\]*7\[^\d\]*)$
  Establishing relation to Contacts... Call ID: bc370e04-ee9b-d9fb-2b6c-5090df97146f to Bean ID: db8e06ba-b8d6-ca4c-2c9e-50903df596f9
! No results returned
### +++ findAccountForContact(db8e06ba-b8d6-ca4c-2c9e-50903df596f9)
! No results returned
 + No associated account found
  Call start was 2012-10-31 08:20:00
  [1351671616.3] (OUTBOUND) Now updating record in /Calls/ id=bc370e04-ee9b-d9fb-2b6c-5090df97146f...
NAME: ** Automatic record **
DESCRIPTION:
[2012-10-31 08:22:11]
! --- Event -----------------------------------------------------------
!                Event --> Dial
!            Privilege --> call,all
!             SubEvent --> End
!              Channel --> SIP/202-00000001
!             UniqueID --> 1351671616.2
!           DialStatus --> ANSWER
! ---------------------------------------------------------------------
! AMI Event 'ExtensionStatus surpressed.
[2012-10-31 08:22:11]
! --- Event -----------------------------------------------------------
!                Event --> Hangup
!            Privilege --> call,all
!              Channel --> SIP/202-00000001
!             Uniqueid --> 1351671616.2
!          CallerIDNum --> 7751112222
!         CallerIDName --> <unknown>
!     ConnectedLineNum --> <unknown>
!    ConnectedLineName --> <unknown>
!                Cause --> 16
!            Cause-txt --> Normal Clearing
! ---------------------------------------------------------------------
# +++ findCallByAsteriskId(1351671616.2)
! Warning, results set was empty!
[1351671616.2] FAILED TO FIND A CALL (note: there are two hangups per call, so this might not be an error)
[2012-10-31 08:23:12] Patiently Waiting...!
[2012-10-31 08:24:12] Patiently Waiting...!

gitimg