I have been trying to get the value in the Referred-By header from within the parkandannounce application without success. I first tried getting it via ast_channel assuming the SIP driver would request a channel for the inbound call and Referred-By could be found that way. Maybe it can but I cannot figure out how. I then tried to use get_header(req,"Referred-By") assuming if I have a pointer to the packet get_header would be able to extract the desired value. No good. Has anyone done this? I really need to get the Referred-By value for a local application and I'm out of choices. Thanks,Steve
Im still tring to figure out how to route my calls out of a secondary termination provider when my primary fails. I have no idea how to even attempt this.. It seems like it would be something simple... Regards John -----Original Message----- From: asterisk-users-bounces@lists.digium.com [mailto:asterisk-users-bounces@lists.digium.com] On Behalf Of Steve Blair Sent: Sunday, November 13, 2005 7:00 PM To: Asterisk Users Mailing List - Non-Commercial Discussion; asterisk-dev@lists.digium.com Subject: [Asterisk-Users] How to get Referred-By header I have been trying to get the value in the Referred-By header from within the parkandannounce application without success. I first tried getting it via ast_channel assuming the SIP driver would request a channel for the inbound call and Referred-By could be found that way. Maybe it can but I cannot figure out how. I then tried to use get_header(req,"Referred-By") assuming if I have a pointer to the packet get_header would be able to extract the desired value. No good. Has anyone done this? I really need to get the Referred-By value for a local application and I'm out of choices. Thanks,Steve _______________________________________________ --Bandwidth and Colocation sponsored by Easynews.com -- Asterisk-Users mailing list Asterisk-Users@lists.digium.com http://lists.digium.com/mailman/listinfo/asterisk-users To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Eric "ManxPower" Wieling
2005-Nov-13 18:40 UTC
[Asterisk-Users] How to get Referred-By header
John E. Elkin wrote:> Im still tring to figure out how to route my calls out of a secondary > termination provider when my primary fails. I have no idea how to even > attempt this.. It seems like it would be something simple...Something like this, which is a basic idea, not a totally working script. [macro-dial-result] ; ; Handle Disconnect Cause Codes ; exten => s,1,NoOp(HANGUPCAUSE is ${HANGUPCAUSE} and DIALSTATUS is ${DIALSTATUS}) ;exten => s,2,AbsoluteTimeout(120) exten => s,2,Noop exten => s,3,GotoIf($[${HANGUPCAUSE} = 0]?s,5) exten => s,4,Goto(cause-${HANGUPCAUSE},1) exten => s,5,GotoIf($[${DIALSTATUS} = NOANSWER]?cause-16,1) exten => s,6,GotoIf($[${DIALSTATUS} = BUSY]?cause-17,1) exten => s,7,GotoIf($[${DIALSTATUS} = CHANUNAVAIL]?cause-3,1) exten => s,8,GotoIf($[${DIALSTATUS} = ANSWER]?cause-16,1) exten => s,9,Goto(cause-0,1) exten => cause-0,1,NoOp(AST_CAUSE_NOTDEFINED) exten => cause-0,2,GotoIf($["${SAVED_EXTEN}" != ""]?cause-0,4) exten => cause-0,3,SetVar(SAVED_EXTEN=${MACRO_EXTEN}) exten => cause-0,4,GotoIf($["${SAVED_ARG1}" != ""]?cause-0,6) exten => cause-0,5,SetVar(SAVED_ARG1=${ARG1}) exten => cause-0,6,GotoIf($["${ARG1}" = ""]?cause-0,11) exten => cause-0,7,System(/bin/echo "AST_CAUSE_NOTDEFINED received when dialing ${SAVED_EXTEN} trying again using ${SAVED_ARG1}." | /bin/mail -s "${SITE} PBX ERROR" pbxadmin-pager) ;exten => cause-0,7,Noop exten => cause-0,8,SetVar(ARG1=) exten => cause-0,9,Dial(${SAVED_ARG1}) exten => cause-0,10,Macro(dial-result) exten => cause-0,11,System(/bin/echo "AST_CAUSE_NOTDEFINED received when dialing ${SAVED_ARG1} giving up." | /bin/mail -s "${SITE} PBX ERROR" pbxadmin-pager) ;exten => cause-0,11,Playback(all-circuits-busy-now) exten => cause-0,12,Zapateller(answer) ;exten => cause-0,12,Playback(pls-try-call-later) exten => cause-0,13,Playback(an-error-has-occured) ;exten => cause-0,13,Hangup exten => cause-0,14,Playback(pls-try-call-later) exten => cause-0,15,Wait(3) exten => cause-0,16,Zapateller(answer) exten => cause-0,17,Playback(an-error-has-occured) exten => cause-0,18,Playback(pls-try-call-later) exten => cause-0,19,Wait(3) exten => cause-0,20,Congestion exten => cause-1,1,NoOp(AST_CAUSE_UNALLOCATED) exten => cause-1,2,Macro(number-disconnected,${MACRO_EXTEN}) exten => cause-3,1,NoOp(Channel unavailable) ;exten => cause-3,2,System(/root/aimd/sendIM.pl PBXAdmin "CHANUNAVAIL when Dialing ${SAVED_ARG1}") exten => cause-3,2,Playback(all-circuits-busy-now) exten => cause-3,3,Playback(pls-try-call-later) exten => cause-3,4,Hangup ;exten => cause-3,2,Playback(pls-wait-connect-call) ;exten => cause-3,3,Dial(${ARG1}) ;exten => cause-3,4,Macro(dial-result) exten => cause-16,1,NoOp(AST_CAUSE_NORMAL_CLEARING) exten => cause-16,2,Hangup exten => cause-17,1,NoOp(AST_CAUSE_USER_BUSY) exten => cause-17,2,Busy exten => cause-31,1,Goto(cause-1,1) exten => _cause-.,1,NoOp(AST_UNKNOWN_ERROR) exten => _cause-.,2,Dial(IAX2/${VNEA_AUTH}@172.17.2.7/2120,15) exten => _cause-.,3,SetCallerID(PBX Error <${MACRO_EXTEN}>) exten => _cause-.,4,Hangup