<div dir="ltr"><div><div><div><div>I'm trying to address a problem with users transferring to invalid destinations.<br><br></div>In my sip peer I'm setting both __FORWARD_CONTEXT and __TRANSFER_CONTEXT to a context with a extension defined below to set some CDR variables before the call is transferred. <br>
<br></div><div>[customer-forward]<br></div><div>exten => _X.,1,Progress()<br></div>exten => _X.,n,Gosub(do-billing,s,1${EXTEN}))<br></div>exten => _X,n,Goto(customer-internal,${EXTEN},1)<br><br></div>Now if my user Dials an invalid extension, Say '9595' from their sip phone they get back an 'Address Incomplete' message from their phone because it's not a valid extension defined in my dialplan.<br>
<br>If my user Transfers a call to '9595' the call gets transferred and then hung up on as there's no '9595' destination.<br><div><br></div><div>I'd like to reject the calls in my customer-foward context that do not exist in my customer-internal context.<br>
<br></div><div>I've tried doing something like:<br><br>exten => _X.,1,Progress()<br>same => n,ExecIf($[${DIALPLAN_EXISTS(customer-internal,${EXTEN},1)} = 0]?Hangup(28)) <br><br></div><div>But that's still accepting the call as the _X makes it a Valid extension.<br>
</div><div><div><div><div><br></div><div>I'm looking for suggestions or ideas on a better way to do this. <br clear="all"></div><div><div><br>-- <br>A human being should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly. Specialization is for insects.<br>
---Heinlein
</div></div></div></div></div></div>