Hi, Having checked the documentation for SIP_HEADER: pitux-exercice15*CLI> -= Info about function 'SIP_HEADER' =- [Syntax] SIP_HEADER(<name>) [Synopsis] Gets or sets the specified SIP header I thought I could write some info in SIP_HEADER to retrieve them later. But when I try to write to it: exten => s,n,Set(SIP_HEADER(DN)=toto) exten => s,n,NoOp(Sip DN ${SIP_HEADER(DN)}) Write is refused: 2006-08-02 16:16:09 VERBOSE[5224] logger.c: -- Executing Set("SIP/220-aa94", "SIP_HEADER(DN)=toto") in new stack 2006-08-02 16:16:09 ERROR[5224] pbx.c: Function SIP_HEADER is read-only, it cannot be written to 2006-08-02 16:16:09 DEBUG[5224] pbx.c: Function result is '(null)' Is this function really read-write ? Is there something I could check or modify to achieve my goal (writing to sip header) ? Is there a switch somewhere to allow to write to it ? Any global or channel variable or parameter to set for that ? Thanks for your help and comments. I run asterisk 1.2.4.
There is presently no .write member in the structure declaration for this function in channels/app_sip.c: static struct ast_custom_function sip_header_function = { .name = "SIP_HEADER", .synopsis = "Gets or sets the specified SIP header", .syntax = "SIP_HEADER(<name>)", .read = func_header_read, }; So I imagine the answer to my question is yes SIP_HEADER is a read-only function. There is no implementation equivalent to SipAddHeader() for SIP_HEADER().
Oh... That's real nice. I was considering using SIP instead of IAX to trunk calls between Asterisk boxes as IAX has some severe limitations in regards to passing variables. A few people said 'use SIP!' because you can set the SIP headers. Looks like that isn't an option!> -----Original Message----- > From: Vincent Regnard [mailto:devel@regnard.org] > Sent: Thursday, August 03, 2006 4:29 AM > To: Asterisk Users Mailing List - Non-Commercial Discussion > Subject: Re: [asterisk-users] SIP_HEADER() read-only > > > > > There is presently no .write member in the structure declaration for > this function in channels/app_sip.c: > > static struct ast_custom_function sip_header_function = { > .name = "SIP_HEADER", > .synopsis = "Gets or sets the specified SIP header", > .syntax = "SIP_HEADER(<name>)", > .read = func_header_read, > }; > > So I imagine the answer to my question is yes SIP_HEADER is a > read-only > function. There is no implementation equivalent to SipAddHeader() for > SIP_HEADER(). > > > > _______________________________________________ > --Bandwidth and Colocation provided by Easynews.com -- > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users >
The problem is that I am trying to pass call state variables BETWEEN Asterisk servers. IAX doesn't seem to support this. One option was to add SIP headers on the first system, trunk the call with SIP instead of IAX, and then get them at the other end.> -----Original Message----- > From: Eric "ManxPower" Wieling [mailto:eric@fnords.org] > Sent: Thursday, August 03, 2006 10:38 AM > To: Asterisk Users Mailing List - Non-Commercial Discussion > Subject: Re: [asterisk-users] SIP_HEADER() read-only > > > I don't understand what the problem is. If you want to pass > a variable > set the variable, but prefix it with __ (2 underscores) > > Set(__DNID=${DNID}) > > Douglas Garstang wrote: > > Oh... That's real nice. I was considering using SIP instead > of IAX to trunk calls between Asterisk boxes as IAX has some > severe limitations in regards to passing variables. A few > people said 'use SIP!' because you can set the SIP headers. > Looks like that isn't an option! > > > >> -----Original Message----- > >> From: Vincent Regnard [mailto:devel@regnard.org] > >> Sent: Thursday, August 03, 2006 4:29 AM > >> To: Asterisk Users Mailing List - Non-Commercial Discussion > >> Subject: Re: [asterisk-users] SIP_HEADER() read-only > >> > >> > >> > >> > >> There is presently no .write member in the structure > declaration for > >> this function in channels/app_sip.c: > >> > >> static struct ast_custom_function sip_header_function = { > >> .name = "SIP_HEADER", > >> .synopsis = "Gets or sets the specified SIP header", > >> .syntax = "SIP_HEADER(<name>)", > >> .read = func_header_read, > >> }; > >> > >> So I imagine the answer to my question is yes SIP_HEADER is a > >> read-only > >> function. There is no implementation equivalent to > SipAddHeader() for > >> SIP_HEADER(). > >> > >> > >> > >> _______________________________________________ > >> --Bandwidth and Colocation provided by Easynews.com -- > >> > >> asterisk-users mailing list > >> To UNSUBSCRIBE or update options visit: > >> http://lists.digium.com/mailman/listinfo/asterisk-users > >> > > _______________________________________________ > > --Bandwidth and Colocation provided by Easynews.com -- > > > > asterisk-users mailing list > > To UNSUBSCRIBE or update options visit: > > http://lists.digium.com/mailman/listinfo/asterisk-users > > > > > -- > Now accepting new clients in Birmingham, Atlanta, Huntsville, > Chattanooga, and Montgomery. > _______________________________________________ > --Bandwidth and Colocation provided by Easynews.com -- > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users >