Obtaining URL parameters from a sip request

Sorry if this information is somewhere else, but I’ve spent most of my day trying to find it with no success.

I know that a SIP URL can have url parameters included along with it. For example, I could send something that looks like: [color=red]sip:1300@:;param1=value1;param2=value2[/color]

I pass this call along to an AGI script. However, I would like to know what I can do to send the url parameters (param1, param2) along to that AGI script.

I’m hoping that I can do something like this in the extensions.conf

[color=red]exten => 1300,1,Agi(agi://localhost/hello.agi?myFirstParam=${param1}&mySecondParam=${param2})[/color]

where ${param1} is the value in the SIP url’s parameter.

Does anyone know how to do this?

Thanks for any help.

I did some research, and hopefully this helps explain a bit more what I’m looking for.

I noticed that ${SIPDOMAIN} gets me the incoming call’s domain from the SIP URI. I also noticed that their is a SIPURI global that gets me the requests outgoing SIP URI.

Is there a global in Asterisk that gets me the incoming calls full SIP URI?

http://www.voip-info.org/wiki/view/Asterisk+func+sip_header

Although there may be a problem that the URI isn’t actually in a real header.

I don’t think sip_header will do it.

http://www.voip-info.org/wiki/view/Asterisk+func+sipchaninfo might, but the comments say it uses the Contact header. Basically, if this doesn’t do it, the information is not accessible without changing the source code.

Thanks! I’ll give this a shot and see what it gives me.

I appreciate the suggestions!