[asterisk-users] How to add SipAddHeader in outgoing call file.

Mian M Asif asif44pk at gmail.com
Mon Jan 19 07:40:25 CST 2009


How to add SipAddHeader in outgoing call file.
I am implementing a Callback scenario, in which a user makes a call to
Local Access Number. The  system have to callback to the user. During
callback a call file is generated. All I want, is to add
SipAddHeader("pchargingvector","val") in outgoing Invite.
How can I achieve this?
Please help me, where can I add SipAddHeader() in below dialplan.


exten => _X.,1,wait(1)
exten => _X.,2,Set(outCallerID=${exten:1})
exten => _X.,3,Busy(1)
exten => _X.,4,Hangup()

exten => h,1,GotoIf($["${InvalidUser}" = "1"]?20:2)
exten => h,2,DeadAGI(STD/STD-CBLeg1-RadAuth.pl|${SIP_HEADER(Call-ID)})
exten => h,3,Set(CALLERID(number)=${CALLERID(number)})
exten => h,4,System(echo channel:
SIP/${CallBackNo}@${LCR_TERMINATOR_STD} > /tmp/${CALLERID(number)})
exten => h,5,System(echo context: STD-callback-leg2 >> /tmp/${CALLERID(number)})
exten => h,6,System(echo extension: s >> /tmp/${CALLERID(number)})
exten => h,7,System(echo priority: 1 >> /tmp/${CALLERID(number)})
exten => h,8,System(echo callerid: ${outCallerID} >>
/tmp/${CALLERID(number)}) ; Your CallerID goes here
exten => h,9,System(echo maxretries: 0 >> /tmp/${CALLERID(number)})
exten => h,10,System(echo retrytime: 3 >> /tmp/${CALLERID(number)})
exten => h,11,System(echo Set: confID=${confID} >> /tmp/${CALLERID(number)})
exten => h,12,System(echo Set: calltime=${calltime} >> /tmp/${CALLERID(number)})
exten => h,13,System(echo Set: CallBackNo=${CALLERID(number)} >>
/tmp/${CALLERID(number)})
exten => h,14,System(echo Set: Leg1CallID=${Leg1CallID} >>
/tmp/${CALLERID(number)})
exten => h,15,System(echo sleep 5 > /tmp/${CALLERID(number)}.2)
exten => h,16,System(echo mv /tmp/${CALLERID(number)}
/var/spool/asterisk/outgoing >> /tmp/${CALLERID(number)}.2)
exten => h,17,System(chmod 775 /tmp/${CALLERID(number)}.2)
exten => h,18,System(/tmp/${CALLERID(number)}.2)
exten => h,19,NoOp(Hanging up ...!!)
exten => h,20,Hangup()

[STD-callback-leg2]

exten => s,1,NoOp(Entering callback-leg2)
exten => s,2,Set(CALLERID(number)=${CallBackNo})

;------ The Script Authorizes the user on Basis of Caller ID------------------
;------ Plays an IVR, gets destination Phno in SIP_Dest variable -------------
exten => s,3,Set(TIME_NOW=${EPOCH})
exten => s,4,DeadAGI(STD/STD-CBLeg2-RadAuthAcc.pl|${confID}|${calltime}|${TIME_NOW}|${SIP_HEADER(Call-ID)}|${Leg1CallID})
exten => s,5,hangup()

Regards,
Asif



More information about the asterisk-users mailing list