Solved it with returning from Dial to Macro
exten => _X.,1,NoOp(SIPID1 = ${SIPCALLID})
exten => _X.,n,Dial(SIP/${EXTEN}@some_IP,120,M(to))
exten => h,1,NoOp
[macro-to]
exten => s,1,NoOp(${DIALSTATUS},1)
exten => s,n,Set(SIPID2=${SIPCALLID})
exten => s,n,Set(CDR(sipid2)=${SIPID2})
exten => s,n,Set(CDR(userfield)=${SIPID2})
SIPID2 will provide Call ID for outbound call leg. I also tryed
${BRIDGEPEER} and ${BRIDGEPVTCALLID} but they don't show anything in my
case.
On Tue, Feb 15, 2011 at 3:15 PM, Borin <katerin.borin at gmail.com> wrote:
> Hello everyone
> Is there a possibility to catch an outbound callleg ID for the follovong
> scenario: some carrier -----> ------(asterisk1) --->-----asterisk2 ?
> I can get inbound callid for asterisk1 with a ${SIPCALLID} in
> extensions.conf or to look it up in cdrs field (are the same). But how
about
> outbound? I have all calls just forwarded through asterisk1, not answered
> and for every call I have 1 cdr record with only inbound call leg callid.
> I can see all the call legs with rasterisk -x "sip show
channels", but I
> would like to get the data in cdrs as well. Does anyone have any idea? I
> have asterisk 1.6.2 and I don't want to fork cdrs, just another field
for
> the came call.
>
> Regards, Kate
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.digium.com/pipermail/asterisk-users/attachments/20110217/24477604/attachment.htm>