Page 1 of 1

need to read a custom header in an incoming csll

Posted: Sat Aug 10, 2013 8:55 pm
by ccwalkerjm
This may be very simple but how I do assign a custom header value to a variable. I am new to both sipsorcery and ruby.

Thanks

Re: need to read a custom header in an incoming csll

Posted: Sat Aug 10, 2013 11:28 pm
by Aaron
You can't do that in the SimpleWizard dialplan but you can in a Ruby dialplan. Below is an example of the Ruby code you can use:

Code: Select all

myVar = req.Header.GetUnknownHeaderValue("Some-Header")

Re: need to read a custom header in an incoming csll

Posted: Sun Aug 11, 2013 7:10 am
by ccwalkerjm
thanks Aaron.

Re: need to read a custom header in an incoming csll

Posted: Sun Aug 11, 2013 7:44 am
by ccwalkerjm
I am trying to do this but without luck. Please tell what I am doing wrong.

myVar = req.Header.GetUnknownHeaderValue("Some-Header")
sys.Dial("${myVar}@provider")

Re: need to read a custom header in an incoming csll

Posted: Sun Aug 11, 2013 8:47 am
by ccwalkerjm
I was able to resolve the problem. Needed to remove the quotes from the header value.