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

Eric Chamberlain eric at rf.com
Mon Sep 15 14:09:12 CDT 2008


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?

--
Eric Chamberlain










More information about the asterisk-users mailing list