[asterisk-users] Is there a way to get the remote User-Agent info from an outbound leg?

Tilghman Lesher tilghman at mail.jeffandtilghman.com
Mon Sep 15 15:16:59 CDT 2008


On Monday 15 September 2008 14:09:12 Eric Chamberlain wrote:
> On Sep 15, 2008, at 7:55 AM, Tilghman Lesher wrote:
> > On Sunday 14 September 2008 16:50:23 Eric Chamberlain wrote:
> >> On Sep 12, 2008, at 6:47 PM, Eric Chamberlain wrote:
> >>> Is there a way to get the remote User-Agent info from an outbound
> >>> leg?
> >>>
> >>> ${SIP_HEADER(User-Agent)} after a Dial returns the inbound leg User-
> >>> Agent.
> >>
> >> Still trying to obtain the User-Agent from a remote peer on an
> >> outbound leg, we're probably missing something obvious.
> >>
> >> Using trunk revision 143077.
> >>
> >> extensions.conf:
> >>
> >> exten => s,n(call),Dial(SIP/${ARG2}@${ARG1},,M(set-dst-cdr)) ; use it
> >> to call out.
> >>
> >> [macro-set-dst-cdr]
> >> exten => s,1,NoOp(Set destination CDR information)
> >> exten => s,n,Set(CDR(dst_agent)=${CHANNEL(useragent)})
> >>
> >> Logs show:
> >>
> >>     -- Executing [s at macro-set-dst-cdr:4] Set("SIP/skype2-09cd2398",
> >> "CDR(dst_agent)=") in new stack
> >
> > I think what you missed here is that when you call a macro from
> > Dial, you're
> > calling the Macro on the destination channel, not the source
> > channel, which is
> > why your CDR is unaffected.
>
> Yeah, we realized that when we turned on logging for unanswered
> calls.  We're now using shared variables to pass the data back to the
> parent channel.
>
> Is there a better way to get the data from the destination channel?

No, shared variables are exactly how I would do it, actually.

-- 
Tilghman



More information about the asterisk-users mailing list