Hello Everyone,
I didn't get a reply to my problem below so I'm posting again just in case 
someone who might be able to help missed my previous post.
Thank You...
*************************************************************************************
Hello list,
I'm trying to populate my CDR logs with values which are available after the 
call has started (e.g. signalling IP of remote user, media IP, codec etc.). 
While CHANNEL function give me all I need for the incoming leg (leg A), I can't 
get the relevant values for the outgoing channel. I've tried using the option 
'U' with my dial command (execute subroutine for called channel after called 
channel answered but before the call is bridged). While this throws the correct 
information to the console it does not populate the CDRs accordingly.
Note: Asterisk ver is 1.8.7.1 and CDR's are written to MySQL with adaptive ODBC 
and the table therein contains the relevant fields.

This is the console with 'very-verbose' output for the 'Dial' application where 
office_Admin2, IP 192.168.20.222, is calling office_ServerRoom, IP 
192.168.20.226. My comments added prefixed by ** and on separate line:

** channel here is source channel: SIP/office_Admin2-00000015
[Dec  1 12:14:31]     -- Executing [316@InternalDP:5] 
Dial("SIP/office_Admin2-00000015", "SIP/office_ServerRoom,,FgU(jump2SetVar)") 
in new stack
[Dec  1 12:14:31]   == Using UDPTL CoS mark 5
[Dec  1 12:14:31]   == Using SIP RTP CoS mark 5
[Dec  1 12:14:31]     -- Called SIP/office_ServerRoom
[Dec  1 12:14:31]     -- SIP/office_ServerRoom-00000016 is ringing
[Dec  1 12:14:31]     -- SIP/office_ServerRoom-00000016 is ringing
[Dec  1 12:14:33]     -- SIP/office_ServerRoom-00000016 answered 
SIP/office_Admin2-00000015
** from here the channel is the destination channel: 
SIP/office_ServerRoom-00000016
[Dec  1 12:14:33]     -- Executing [s@jump2SetVar:1] 
Gosub("SIP/office_ServerRoom-00000016", "SetVar,postdial,1") in new stack
** This is how I obtain channel information:
** exten => 
postdial,1,Set(CDR(chanoutsigip)=${CHANNEL(peerip)}:${SIPPEER(${CHANNEL(peername)},port)})
 ; resulting format: <a.b.c.d>:<port>
** same => n,Set(CDR(chanoutmediaip)=${CHANNEL(rtpdest,audio)})
** same => n,Set(CDR(chanoutcodec)=${CHANNEL(audionativeformat)})
[Dec  1 12:14:33]     -- Executing [postdial@SetVar:1] 
Set("SIP/office_ServerRoom-00000016", "CDR(chanoutsigip)=192.168.20.226:5065") 
in new stack
[Dec  1 12:14:33]     -- Executing [postdial@SetVar:2] 
Set("SIP/office_ServerRoom-00000016", 
"CDR(chanoutmediaip)=192.168.20.226:23008") in new stack
[Dec  1 12:14:33]     -- Executing [postdial@SetVar:3] 
Set("SIP/office_ServerRoom-00000016", "CDR(chanoutcodec)=g729") in new stack
[Dec  1 12:14:33]     -- Executing [postdial@SetVar:4] 
Goto("SIP/office_ServerRoom-00000016", "endsub,1") in new stack
[Dec  1 12:14:33]     -- Goto (SetVar,endsub,1)
[Dec  1 12:14:33]     -- Executing [endsub@SetVar:1] 
Return("SIP/office_ServerRoom-00000016", "") in new stack
[Dec  1 12:14:33]     -- Executing [s@jump2SetVar:2] 
Return("SIP/office_ServerRoom-00000016", "") in new stack
[Dec  1 12:14:33]     -- Executing [s@app_dial_gosub_virtual_context:1] 
NoOp("SIP/office_ServerRoom-00000016", "") in new stack
[Dec  1 12:14:33]     -- Auto fallthrough, channel 
'SIP/office_ServerRoom-00000016' status is 'UNKNOWN'
[Dec  1 12:14:33]     -- Remotely bridging SIP/office_Admin2-00000015 and 
SIP/office_ServerRoom-00000016

When call is terminated the relevant fields in the database for 
CDR(chanoutsigip), CDR(chanoutmediaip) and CDR(chanoutcodec) are populated with 
their default values (typically blank or '-----') and NOT with the values above.
Am I doing something wrong or is there a different way to populate CDR's with 
info from called channel (leg B)?

Thank you for your replies...

Harel

--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
               http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Reply via email to