[asterisk-dev] Problem using the sip_header-function

Michael Hirschbichler sipp at hirschbichler.biz
Thu May 8 10:07:10 CDT 2008

Watkins, Bradley schrieb:
> Michael Hirschbichler wrote:
>> The other possibility is to add a second parameter to define, which of
>> the Via-header I want:
>> exten => 1226,n,agi,checksomething.pl|${SIP_HEADER(VIA,1)}
>> exten => 1226,n,agi,checksomething.pl|${SIP_HEADER(VIA,2)}
>> exten => 1226,n,agi,checksomething.pl|${SIP_HEADER(VIA,3)}
>> This does not work, I get an empty string:
> Any possibility it's a timing-related issue such as this one I reported
> awhile back?
> http://bugs.digium.com/view.php?id=9516
> Try doing a NoOp(First Via: ${SIP_HEADER(VIA,1)} Second Via:
> ${SIP_HEADER(VIA,2)} Third Via: ${SIP_HEADER(VIA,3)}) and then watch the
> console to see if the SIP_HEADER function is retrieving the variables
> correctly in the first place.

Yeah! You were right, the console output looks now this way:
  Executing [1226 at sip-incoming:2] NoOp("SIP/1226-081e44b0", "First Via: 
SIP/2.0/UDP;branch=z9hG4bK8c22.c21cc2c2.0 Second Via: 
SIP/2.0/UDP;branch=z9hG4bK8c22.c21cc2c2.0 Third Via: 
SIP/2.0/UDP;received=;branch=z9hG4bK4ce3b398") in 
new stack

Hmm, and how can I solve this problem now? Do you have any ideas? How 
have you solved this issue?


More information about the asterisk-dev mailing list