[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 09:55:21 CDT 2008


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.

-- 
Tilghman



More information about the asterisk-users mailing list