[asterisk-users] originate, local channel and failure extension

Ben Dinnerville ben at voicelogic.com.au
Sun Feb 7 21:06:00 CST 2010


Hi All,

I am in the process of migrating from 1.4.20 to 1.6.2.x and have 
stumbled across a number of "differences" between the 2 versions that 
are forcing me to use local channels in my dialplan (mainly centered 
around the different behavior of CDR fields in the 2 versions) .

Previously, I would place a call via an AMI Originate action similar to:

	action:.Originate..
	actionid:.1306903_89#AJ_ORIGINATE_25
	timeout:.40000
	exten:.s
	async:.true
	callerid:."".<61211111111>
	context:.campaignType_5
	priority:.1
	channel:.SIP/trunk1/61212142321

And the campaignType_5 context would handle the call processing, 
capturing a failed dial attempt in the failed exten :

[campaignType_5_]
exten = s,1,Answer()
...


exten = h,1,Set(timefinished=${STRFTIME(${EPOCH},,%Y%m%d%H%M%S)})
exten = h,2,GotoIf($["${TIMETOPRESS}foo" = "foo"]?h,20)
...

exten = failed,1,Set(DIGITPRESSED=98)
exten = failed,2,Set(TIMETOPRESS=${timestarted})
exten = failed,3,Set(CALLSTATUS=6)
exten = failed,4,Set(timestarted=${STRFTIME(${EPOCH},,%Y%m%d%H%M%S)})
exten = failed,5,Set(timefinished=${STRFTIME(${EPOCH},,%Y%m%d%H%M%S)})

It looks like I am now being forced to use a local exten so I can access 
all the CDR variables I need, with the way the call is established now 
looking like:

	action:.Originate..
	actionid:.1306903_89#AJ_ORIGINATE_25
	timeout:.40000
	exten:.s
	async:.true
	callerid:."".<61211111111>
	context:.campaignType_5
	priority:.1
	channel:.Local/61212142321 at outboundsip/n

And both a campaignType_5 context similar to that above and a 
outboundsip context similar to (an over simplified version):

[outboundsip]
exten = _XX.,1,Dial(SIP/trunk1/${EXTEN})
exten = _XX.,n,Hangup

exten = h,1,NoOp(Billsec is: ${CDR(billsec)})


My question - previously I would handle the failure of the call in the 
campaignType_5 context, now I have 2 contexts where I could possibly get 
a failure - should I be handling the failure in the campaignType_5 
context (the context that is defined in the originate action), 
outboundsip context (the context used for the local channel part of the 
call) or both? and why?

I have to say, the way that Orignate and cdr's used to work in 1.4.20 
was a hell of a lot easier to manage than the current versions.

Cheers,

Ben




More information about the asterisk-users mailing list