[Home]

Summary:ASTERISK-04809: [request] Make it possible to retrieve SIP headers on a REFER (SIP transfer)
Reporter:Brett Nemeroff (brettnem)Labels:
Date Opened:2005-08-10 17:11:34Date Closed:2011-06-07 14:10:29
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Channels/chan_sip/Interoperability
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:
Description:I'm trying to redirect a call with a REFER with some custom headers. SIP_HEADER returns these fine on INVITE, but does not on REFERs.

Both the INVITE and the REFER hit this macro.


****** ADDITIONAL INFORMATION ******

REFER sip:15125551003@10.0.0.1 SIP/2.0
Via: SIP/2.0/UDP 10.0.0.1:5061;branch=z9hG4bK448f.36bbb762.0
To: <sip:15125551003@localhost>;tag=as75d0c411
From: <sip:controller@foo.bar>;tag=112366460222004
CSeq: 2 REFER
Call-ID: 112366460222004.fifouacctd
Content-Length: 0
User-Agent: OpenSer (0.10.0-dev5 (i386/linux))
Contact: <sip:caller@10.0.0.1:5061>
Referred-By: <sip:controller@foo.bar>
Refer-To: sip:7135552000@localhost
X-CallLeg: Terminate


Aug 10 05:03:27 DEBUG[19347] chan_sip.c: Header: REFER sip:15125551003@10.0.0.1 SIP/2.0 (43)
Aug 10 05:03:27 DEBUG[19347] chan_sip.c: Header: Via: SIP/2.0/UDP 10.0.0.1:5061;branch=z9hG4bK448f.36bbb762.0 (65)
Aug 10 05:03:27 DEBUG[19347] chan_sip.c: Header: To: <sip:15125551003@localhost>;tag=as75d0c411 (46)
Aug 10 05:03:27 DEBUG[19347] chan_sip.c: Header: From: <sip:controller@foo.bar>;tag=112366460222004 (50)
Aug 10 05:03:27 DEBUG[19347] chan_sip.c: Header: CSeq: 2 REFER (13)
Aug 10 05:03:27 DEBUG[19347] chan_sip.c: Header: Call-ID: 112366460222004.fifouacctd (35)
Aug 10 05:03:27 DEBUG[19347] chan_sip.c: Header: Content-Length: 0 (17)
Aug 10 05:03:27 DEBUG[19347] chan_sip.c: Header: User-Agent: OpenSer (0.10.0-dev5 (i386/linux)) (46)
Aug 10 05:03:27 DEBUG[19347] chan_sip.c: Header: Contact: <sip:caller@10.0.0.1:5061> (40)
Aug 10 05:03:27 DEBUG[19347] chan_sip.c: Header: Referred-By: <sip:controller@foo.bar> (37)
Aug 10 05:03:27 DEBUG[19347] chan_sip.c: Header: Refer-To: sip:7135552000@localhost (34)
Aug 10 05:03:27 DEBUG[19347] chan_sip.c: Header: X-CallLeg: Terminate (20)
Aug 10 05:03:27 DEBUG[19347] chan_sip.c: Header:  (0)
Aug 10 05:03:27 VERBOSE[19347] logger.c: --- (12 headers 0 lines)Aug 10 05:03:27 VERBOSE[19347] logger.c: --- (12 headers 0 lines)---
Aug 10 05:03:27 DEBUG[19347] chan_sip.c: **** Received REFER (9) - Command in SIP REFER
Aug 10 05:03:27 DEBUG[19347] chan_sip.c: SIP call transfer received for call 112366460222004.fifouacctd (REFER)!
Aug 10 05:03:27 VERBOSE[19347] logger.c: Transfer to 7135552000 in ctd_extensions
Aug 10 05:03:27 VERBOSE[19347] logger.c: Transfer from controller in ctd_extensions
Aug 10 05:03:27 DEBUG[19347] chan_sip.c: Unsupervised transfer to (Refer-To): 7135552000
Aug 10 05:03:27 DEBUG[19347] chan_sip.c: Transferred by  (Referred-by: ) controller
Aug 10 05:03:27 DEBUG[19347] chan_sip.c: Transfer Contact Info <sip:caller@10.0.0.1:5061> (REFER_CONTACT)
Aug 10 05:03:27 DEBUG[19347] chan_sip.c: 202 Accepted (blind)
Aug 10 05:03:27 DEBUG[19347] chan_sip.c: Got SIP blind transfer, applying to 'SIP/test-0730'
Aug 10 05:03:27 DEBUG[19347] channel.c: Planning to masquerade SIP/test-0730 into the structure of AsyncGoto/SIP/test-0730
Aug 10 05:03:27 DEBUG[19347] channel.c: Done planning to masquerade AsyncGoto/SIP/test-0730 into the structure of SIP/test-0730
Aug 10 05:03:27 DEBUG[19347] channel.c: Actually Masquerading SIP/test-0730(6) into the structure of AsyncGoto/SIP/test-0730(6)
Aug 10 05:03:27 DEBUG[19347] channel.c: Got clone lock for masquerade on 'SIP/test-0730' at 0x81792fc
Aug 10 05:03:27 DEBUG[19347] channel.c: Set channel SIP/test-0730 to write format ulaw
Aug 10 05:03:27 DEBUG[19347] channel.c: Set channel SIP/test-0730 to read format ulaw
Aug 10 05:03:27 DEBUG[19347] channel.c: Putting channel SIP/test-0730 in 4/4 formats
Aug 10 05:03:27 DEBUG[19347] channel.c: Released clone lock on 'AsyncGoto/SIP/test-0730<ZOMBIE>'
Aug 10 05:03:27 DEBUG[19347] channel.c: Done Masquerading SIP/test-0730 (6)
Aug 10 05:03:27 DEBUG[19341] devicestate.c: Changing state for AsyncGoto/SIP/test - state 4 (Invalid)
Aug 10 05:03:27 VERBOSE[19347] logger.c: Transmitting (no NAT) to 10.0.0.1:5061:
SIP/2.0 202 Accepted
Via: SIP/2.0/UDP 10.0.0.1:5061;branch=z9hG4bK448f.36bbb762.0
From: <sip:controller@foo.bar>;tag=112366460222004
To: <sip:15125551003@localhost>;tag=as75d0c411
Call-ID: 112366460222004.fifouacctd
CSeq: 2 REFER
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY
Contact: <sip:15125551003@10.0.0.1>
Content-Length: 0
X-Asterisk-HangupCause:: Normal Clearing


---
Aug 10 05:03:27 VERBOSE[19347] logger.c: set_destination: Parsing <sip:caller@10.0.0.1:5061> for address/port to send to
Aug 10 05:03:27 VERBOSE[19347] logger.c: set_destination: set destination to 10.0.0.1, port 5061
Aug 10 05:03:27 VERBOSE[19347] logger.c: Reliably Transmitting (no NAT) to 10.0.0.1:5061:
NOTIFY sip:caller@10.0.0.1:5061 SIP/2.0
Via: SIP/2.0/UDP 10.0.0.1:5060;branch=z9hG4bK166dfd7a
From: <sip:15125551003@localhost>;tag=as75d0c411
To: <sip:controller@foo.bar>;tag=112366460222004
Contact: <sip:15125551003@10.0.0.1>
Call-ID: 112366460222004.fifouacctd
CSeq: 102 NOTIFY
User-Agent: Asterisk PBX
Event: refer;id=2
Subscription-state: terminated;reason=noresource
Content-Type: message/sipfrag;version=2.0
Content-Length: 14

SIP/2.0 200 OK
---
Aug 10 05:03:27 VERBOSE[19347] logger.c: set_destination: Parsing <sip:caller@10.0.0.1:5061> for address/port to send to
Aug 10 05:03:27 VERBOSE[19347] logger.c: set_destination: set destination to 10.0.0.1, port 5061
Aug 10 05:03:27 VERBOSE[19347] logger.c: Reliably Transmitting (no NAT) to 10.0.0.1:5061:
BYE sip:caller@10.0.0.1:5061 SIP/2.0
Via: SIP/2.0/UDP 10.0.0.1:5060;branch=z9hG4bK6b5bc330
From: <sip:15125551003@localhost>;tag=as75d0c411
To: <sip:controller@foo.bar>;tag=112366460222004
Contact: <sip:15125551003@10.0.0.1>
Call-ID: 112366460222004.fifouacctd
CSeq: 103 BYE
User-Agent: Asterisk PBX
X-Asterisk-HangupCause:: Normal Clearing
Content-Length: 0


---
Aug 10 05:03:27 VERBOSE[19347] logger.c:
<-- SIP read from 10.0.0.1:5061:
SIP/2.0 404 Not Found
Via: SIP/2.0/UDP 10.0.0.1:5060;branch=z9hG4bK166dfd7a
From: <sip:15125551003@localhost>;tag=as75d0c411
To: <sip:controller@foo.bar>;tag=112366460222004
Call-ID: 112366460222004.fifouacctd
CSeq: 102 NOTIFY
Server: OpenSer (0.10.0-dev5 (i386/linux))
Content-Length: 0
Warning: 392 10.0.0.1:5061 "Noisy feedback tells:  pid=18431 req_src_ip=10.0.0.1 req_src_port=5060 in_uri=sip:caller@10.0.0.1:5061 out_uri=sip:caller@10.0.0.1:5061 via_cnt==1"


Aug 10 05:03:27 DEBUG[19347] chan_sip.c: Header: SIP/2.0 404 Not Found (21)
Aug 10 05:03:27 DEBUG[19347] chan_sip.c: Header: Via: SIP/2.0/UDP 10.0.0.1:5060;branch=z9hG4bK166dfd7a (58)
Aug 10 05:03:27 DEBUG[19347] chan_sip.c: Header: From: <sip:15125551003@localhost>;tag=as75d0c411 (48)
Aug 10 05:03:27 DEBUG[19347] chan_sip.c: Header: To: <sip:controller@foo.bar>;tag=112366460222004 (48)
Aug 10 05:03:27 DEBUG[19347] chan_sip.c: Header: Call-ID: 112366460222004.fifouacctd (35)
Aug 10 05:03:27 DEBUG[19347] chan_sip.c: Header: CSeq: 102 NOTIFY (16)
Aug 10 05:03:27 DEBUG[19347] chan_sip.c: Header: Server: OpenSer (0.10.0-dev5 (i386/linux)) (42)
Aug 10 05:03:27 DEBUG[19347] chan_sip.c: Header: Content-Length: 0 (17)
Aug 10 05:03:27 DEBUG[19347] chan_sip.c: Header: Warning: 392 10.0.0.1:5061 "Noisy feedback tells:  pid=18431 req_src_ip=10.0.0.1 req_src_port=5060 in_uri=sip:caller@10.0.0.1:5061 out_uri=sip:caller@10.0.0.1:5061 via_cnt==1" (195)
Aug 10 05:03:27 DEBUG[19347] chan_sip.c: Header:  (0)
Aug 10 05:03:27 VERBOSE[19347] logger.c: --- (9 headers 0 lines)Aug 10 05:03:27 VERBOSE[19347] logger.c: --- (9 headers 0 lines)---
Aug 10 05:03:27 DEBUG[19347] chan_sip.c: Stopping retransmission on '112366460222004.fifouacctd' of Request 102: Found
Aug 10 05:03:27 VERBOSE[19347] logger.c: Response message NOTIFY arrived
Aug 10 05:03:27 VERBOSE[19347] logger.c:
<-- SIP read from 10.0.0.1:5061:
SIP/2.0 404 Not Found
Via: SIP/2.0/UDP 10.0.0.1:5060;branch=z9hG4bK6b5bc330
From: <sip:15125551003@localhost>;tag=as75d0c411
To: <sip:controller@foo.bar>;tag=112366460222004
Call-ID: 112366460222004.fifouacctd
CSeq: 103 BYE
Server: OpenSer (0.10.0-dev5 (i386/linux))
Content-Length: 0
Warning: 392 10.0.0.1:5061 "Noisy feedback tells:  pid=18431 req_src_ip=10.0.0.1 req_src_port=5060 in_uri=sip:caller@10.0.0.1:5061 out_uri=sip:caller@10.0.0.1:5061 via_cnt==1"


Aug 10 05:03:27 DEBUG[19347] chan_sip.c: Header: SIP/2.0 404 Not Found (21)
Aug 10 05:03:27 DEBUG[19347] chan_sip.c: Header: Via: SIP/2.0/UDP 10.0.0.1:5060;branch=z9hG4bK6b5bc330 (58)
Aug 10 05:03:27 DEBUG[19347] chan_sip.c: Header: From: <sip:15125551003@localhost>;tag=as75d0c411 (48)
Aug 10 05:03:27 DEBUG[19347] chan_sip.c: Header: To: <sip:controller@foo.bar>;tag=112366460222004 (48)
Aug 10 05:03:27 DEBUG[19347] chan_sip.c: Header: Call-ID: 112366460222004.fifouacctd (35)
Aug 10 05:03:27 DEBUG[19347] chan_sip.c: Header: CSeq: 103 BYE (13)
Aug 10 05:03:27 DEBUG[19347] chan_sip.c: Header: Server: OpenSer (0.10.0-dev5 (i386/linux)) (42)
Aug 10 05:03:27 DEBUG[19347] chan_sip.c: Header: Content-Length: 0 (17)
Aug 10 05:03:27 DEBUG[19347] chan_sip.c: Header: Warning: 392 10.0.0.1:5061 "Noisy feedback tells:  pid=18431 req_src_ip=10.0.0.1 req_src_port=5060 in_uri=sip:caller@10.0.0.1:5061 out_uri=sip:caller@10.0.0.1:5061 via_cnt==1" (195)
Aug 10 05:03:27 DEBUG[19347] chan_sip.c: Header:  (0)
Aug 10 05:03:27 VERBOSE[19347] logger.c: --- (9 headers 0 lines)Aug 10 05:03:27 VERBOSE[19347] logger.c: --- (9 headers 0 lines)---
Aug 10 05:03:27 DEBUG[19347] chan_sip.c: Stopping retransmission on '112366460222004.fifouacctd' of Request 103: Found
Aug 10 05:03:27 VERBOSE[19347] logger.c: Response message BYE arrived
Aug 10 05:03:27 DEBUG[22013] channel.c: Didn't get a frame from channel: AsyncGoto/SIP/test-0730<ZOMBIE>
Aug 10 05:03:27 DEBUG[22013] channel.c: Bridge stops bridging channels SIP/CTD-7b81 and AsyncGoto/SIP/test-0730<ZOMBIE>
Aug 10 05:03:27 DEBUG[22013] channel.c: Hanging up zombie 'AsyncGoto/SIP/test-0730<ZOMBIE>'
Aug 10 05:03:27 DEBUG[22013] app_dial.c: Exiting with DIALSTATUS=ANSWER.
Aug 10 05:03:27 DEBUG[22013] app_macro.c: Spawn extension (macro-CallToSIPProvider,s,9) exited non-zero on 'SIP/CTD-7b81' in macro 'CallToSIPProvider'
Aug 10 05:03:27 DEBUG[22013] pbx.c: Spawn extension (ctd_extensions,15125551003,1) exited non-zero on 'SIP/CTD-7b81'
Aug 10 05:03:27 DEBUG[22013] pbx.c: Function result is 'controller'
Aug 10 05:03:27 DEBUG[22013] pbx.c: Function result is 'controller'
Aug 10 05:03:27 DEBUG[22013] pbx.c: Function result is '15125551003'
Aug 10 05:03:27 DEBUG[22013] pbx.c: Function result is 'ctd_extensions'
Aug 10 05:03:27 DEBUG[22013] pbx.c: Function result is 'SIP/CTD-7b81'
Aug 10 05:03:27 DEBUG[22013] pbx.c: Function result is 'SIP/test-0730'
Aug 10 05:03:27 DEBUG[22013] pbx.c: Function result is 'Dial'
Aug 10 05:03:27 DEBUG[22013] pbx.c: Function result is 'SIP/test/15125551003||d(1234)'
Aug 10 05:03:27 DEBUG[22013] pbx.c: Function result is '2005-08-10 05:03:23'
Aug 10 05:03:27 DEBUG[22013] pbx.c: Function result is '2005-08-10 05:03:27'
Aug 10 05:03:27 DEBUG[22013] pbx.c: Function result is '2005-08-10 05:03:27'
Aug 10 05:03:27 DEBUG[22013] pbx.c: Function result is '4'
Aug 10 05:03:27 DEBUG[22013] pbx.c: Function result is '0'
Aug 10 05:03:27 DEBUG[22013] pbx.c: Function result is 'ANSWERED'
Aug 10 05:03:27 DEBUG[22013] pbx.c: Function result is 'DOCUMENTATION'
Aug 10 05:03:27 DEBUG[22013] pbx.c: Function result is '(null)'
Aug 10 05:03:27 DEBUG[22013] pbx.c: Function result is '1123664603.39'
Aug 10 05:03:27 DEBUG[22013] pbx.c: Function result is '(null)'
Aug 10 05:03:27 DEBUG[22013] channel.c: Hanging up channel 'SIP/CTD-7b81'
Aug 10 05:03:27 DEBUG[22013] chan_sip.c: Hangup call SIP/CTD-7b81, SIP callid 112366460222004.fifouacctd)
Aug 10 05:03:27 DEBUG[22013] chan_sip.c: update_user_counter(CTD) - decrement inUse counter
Aug 10 05:03:27 DEBUG[22013] res_monitor.c: monitor executing ( nice -n 19 soxmix "/var/spool/asterisk/monitor/15125551003-20050810-050323-in.gsm" "/var/spool/asterisk/monitor/15125551003-20050810-050323-out.gsm" "/var/spool/asterisk/monitor/15125551003-20050810-050323.gsm"  && rm -f "/var/spool/asterisk/monitor/15125551003-20050810-050323-"* ) &
Aug 10 05:03:27 NOTICE[19343] res_musiconhold.c: Request to schedule in the past?!?!
Aug 10 05:03:27 DEBUG[22022] pbx.c: Launching 'Macro'
Aug 10 05:03:27 VERBOSE[22022] logger.c:     -- Executing Macro("SIP/test-0730", "CallToSIPProvider|7135552000") in new stack
Aug 10 05:03:27 DEBUG[22022] pbx.c: Launching 'NoOp'
Aug 10 05:03:27 VERBOSE[22022] logger.c:     -- Executing NoOp("SIP/test-0730", "Placing Call to SIPProvider") in new stack
Aug 10 05:03:27 DEBUG[22022] pbx.c: Function result is '(null)'
Aug 10 05:03:27 DEBUG[22022] pbx.c: Launching 'Set'
Aug 10 05:03:27 VERBOSE[22022] logger.c:     -- Executing Set("SIP/test-0730", "CallLeg=") in new stack
Aug 10 05:03:27 DEBUG[22022] pbx.c: Function result is '(null)'
Aug 10 05:03:27 DEBUG[22022] pbx.c: Launching 'Set'
Aug 10 05:03:27 VERBOSE[22022] logger.c:     -- Executing Set("SIP/test-0730", "RecordFlag=") in new stack
Aug 10 05:03:27 DEBUG[22022] pbx.c: Function result is '(null)'
Aug 10 05:03:27 DEBUG[22022] pbx.c: Launching 'Set'
Aug 10 05:03:27 VERBOSE[22022] logger.c:     -- Executing Set("SIP/test-0730", "PBXExten=") in new stack
Aug 10 05:03:27 DEBUG[22022] pbx.c: Launching 'NoOp'
Aug 10 05:03:27 VERBOSE[22022] logger.c:     -- Executing NoOp("SIP/test-0730", "Record Flag is set to ") in new stack
Aug 10 05:03:27 DEBUG[22022] pbx.c: Launching 'NoOp'
Aug 10 05:03:27 VERBOSE[22022] logger.c:     -- Executing NoOp("SIP/test-0730", "Call Leg is ") in new stack
Aug 10 05:03:27 DEBUG[22022] pbx.c: Launching 'Macro'
Aug 10 05:03:27 VERBOSE[22022] logger.c:     -- Executing Macro("SIP/test-0730", "CheckRecord||7135552000") in new stack
Aug 10 05:03:27 WARNING[22022] ast_expr.y: ast_yyerror(): syntax error: syntax error; Input:
= 1

  ^
Aug 10 05:03:27 DEBUG[22022] pbx.c: Expression is '0'
Aug 10 05:03:27 DEBUG[22022] pbx.c: Launching 'GotoIf'
Aug 10 05:03:27 VERBOSE[22022] logger.c:     -- Executing GotoIf("SIP/test-0730", "0?100:200") in new stack
Aug 10 05:03:27 VERBOSE[22022] logger.c:     -- Goto (macro-CheckRecord,s,200)
Aug 10 05:03:27 DEBUG[22022] pbx.c: Launching 'NoOp'
Aug 10 05:03:27 VERBOSE[22022] logger.c:     -- Executing NoOp("SIP/test-0730", "Recording is not enabled. Skipping") in new stack
Aug 10 05:03:27 DEBUG[22022] pbx.c: Launching 'MacroExit'
Aug 10 05:03:27 VERBOSE[22022] logger.c:     -- Executing MacroExit("SIP/test-0730", "") in new stack
Aug 10 05:03:27 DEBUG[22022] pbx.c: Launching 'SetMusicOnHold'
Aug 10 05:03:27 VERBOSE[22022] logger.c:     -- Executing SetMusicOnHold("SIP/test-0730", "default)") in new stack
Aug 10 05:03:27 DEBUG[22022] pbx.c: Launching 'Dial'
Aug 10 05:03:27 VERBOSE[22022] logger.c:     -- Executing Dial("SIP/test-0730", "SIP/test/7135552000||d()") in new stack
Aug 10 05:03:27 DEBUG[22022] app_dial.c: SIMPLE DIAL (NO URL)
Aug 10 05:03:27 DEBUG[22028] app_queue.c: Device 'AsyncGoto/SIP/test' changed to state '4' (Invalid)
Aug 10 05:03:27 DEBUG[19341] devicestate.c: Changing state for AsyncGoto/SIP/test - state 4 (Invalid)
Aug 10 05:03:27 DEBUG[22022] chan_sip.c: Allocating new SIP dialog for (No Call-ID) - INVITE (With RTP)
Aug 10 05:03:27 DEBUG[22022] chan_sip.c: Setting NAT on RTP to 0
Aug 10 05:03:27 VERBOSE[19347] logger.c: Destroying call '112366460222004.fifouacctd'
Aug 10 05:03:27 DEBUG[22022] channel.c: Not copying variable STACK-macro-CallToSIPProvider-s-9.
Aug 10 05:03:27 DEBUG[22022] channel.c: Not copying variable STACK-macro-CallToSIPProvider-s-8.
Aug 10 05:03:27 DEBUG[22022] channel.c: Not copying variable MACRO_PRIORITY.
Aug 10 05:03:27 DEBUG[22022] channel.c: Not copying variable MACRO_CONTEXT.
Aug 10 05:03:27 DEBUG[22022] channel.c: Not copying variable MACRO_EXTEN.
Aug 10 05:03:27 DEBUG[22022] channel.c: Not copying variable ARG1.
Aug 10 05:03:27 DEBUG[22022] channel.c: Not copying variable STACK-macro-CheckRecord-s-201.
Aug 10 05:03:27 DEBUG[22022] channel.c: Not copying variable STACK-macro-CheckRecord-s-200.
Aug 10 05:03:27 DEBUG[22022] channel.c: Not copying variable STACK-macro-CheckRecord-s-1.
Aug 10 05:03:27 DEBUG[22022] channel.c: Not copying variable STACK-macro-CallToSIPProvider-s-7.
Aug 10 05:03:27 DEBUG[22022] channel.c: Not copying variable STACK-macro-CallToSIPProvider-s-6.
Aug 10 05:03:27 DEBUG[22022] channel.c: Not copying variable STACK-macro-CallToSIPProvider-s-5.
Aug 10 05:03:27 DEBUG[22022] channel.c: Not copying variable PBXExten.
Aug 10 05:03:27 DEBUG[22022] channel.c: Not copying variable STACK-macro-CallToSIPProvider-s-4.
Aug 10 05:03:27 DEBUG[22022] channel.c: Not copying variable RecordFlag.
Aug 10 05:03:27 DEBUG[22022] channel.c: Not copying variable STACK-macro-CallToSIPProvider-s-3.
A


Here's my macro..
[macro-CallToSIPProvider]
exten => s,1,NoOp(Placing Call to SIPProvider)
exten => s,n,Set(CallLeg=${SIP_HEADER(X-CallLeg)})
exten => s,n,Set(RecordFlag=${SIP_HEADER(X-Record-Flag)})
exten => s,n,Set(PBXExten=${SIP_HEADER(X-PBX-Exten)})
exten => s,n,NoOp(Record Flag is set to ${RecordFlag})
exten => s,n,NoOp(Call Leg is ${CallLeg})
exten => s,n,Macro(CheckRecord,${RecordFlag},${MACRO_EXTEN})
exten => s,n,SetMusicOnHold(default))
exten => s,n,Dial(SIP/test/${ARG1},,d(${PBXExten}))
exten => s,n,Hangup


Comments:By: Mark Spencer (markster) 2005-08-11 01:42:21

SIP_HEADER is only designed to get the headers from an invite, not from any other message.

By: Brett Nemeroff (brettnem) 2005-08-11 01:57:17

Is there a reason that this cannot also work for REFERs? The specific REFER I am doing causes asterisk to process a call in the dialplan, like any other call. I pass arguments into Asterisk from other Proxies with headers.

By: Olle Johansson (oej) 2005-08-11 03:21:22

I understand what you mean, however, it's not a simple task. You might still want to be able to retrieve headers from the original INVITE.

By: Brett Nemeroff (brettnem) 2005-08-11 09:11:29

so, does this turn to a feature request? For an Asterisk only system, I can see how this is not necessary. However if we are to interoperate with other SIP devices out there, this just might be necessary.

What I don't understand, is that the debug log already shows chan_sip.c parsing the headers. Why can't it be stored into a variable at that point? I'm not much of a coder, so I'm sure I'm overlooking the complexity of it.

FWIW. I'm using this for a CTD (Click-To-Dial) application. The Refer sends the CTD originator to their destination. If I were to send my call variables in the original Invite, the REFER becomes a different channel and doesn't inherit the variables from the originate side; which is why I think I need this..

Am I just missing something here?

By: Olle Johansson (oej) 2005-08-11 09:36:47

This is a feature request, because we do not currently support getting a header from any other SIP request than INVITE. As I said, it will require a bit of work to accomplish this.

By: Michael Jerris (mikej) 2005-08-18 07:06:52

Suspending this request due to no response.  I suggest that you try placing a bounty on the wiki, or contracting this work to be completed.