Hi John,<br><br>I would try to use on sip.conf and iax.conf and zapata.conf:<br><br>on every "user (friend or whatever)" defined add this:<br><br>[useraccount]<br>....<br>setvar=mycontext=yourcontext<br><br><br>----------------------------------------------------------
<br>This variable will become available for every user, so you just need to use it in your dialplan in extensions.conf<br><br>Noop(User context:$mycontext)<br><br>This is just an idea, please give some feedback if it helped and some how you will test if the forward number is valid or not :)
<br><br>Probably isn't hard , but is not clear yet for me and i'm busy :)<br><br>Best Regards,<br>Marco Mouta<br><br><br><div><span class="gmail_quote">On 12/15/06, <b class="gmail_sendername">John French</b> <
<a href="mailto:jFrench@vividvoicedata.com">jFrench@vividvoicedata.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I'm simply trying to forward calls to users who have the call forwarding<br>feature enabled (FWD Status and FWD Ph Number kept in the astDB). The<br>problem is that I want users to be able to forward calls to numbers that
<br>they would normally be allowed to dial within their own context. (I<br>don't want a local call only person forwarding to a long dist number,<br>for example.) I'm able to get the channel context for SIP devices but
<br>not for IAX or Zap Devices. I need some pointers on getting IAXPEER to<br>work and how to handle getting the ZAP context info. If there's an<br>easier way, I'm all ears. Thanks.<br><br>; #####################Set Some Variables####################
<br>exten => s,1,Set(DEVICE=${ARG1}) ;i.e. SIP/johns_phone<br>exten => s,n,Set(Protocol=${CUT(DEVICE,/,1)}) ;Parse out SIP<br>exten => s,n,Set(Phone=${CUT(DEVICE,/,2)}) ;Parse out johns_phone<br><br>;Stuff omitted for some amout of brevity....
<br><br>; #####################Make Forward Calls######################<br>; We only want people to be able to forward to numbers they could<br>normally call<br>; We'll have to somehow get their dialing contexts from the channel conf
<br>files.<br>exten => s,n(Forward),NoOp()<br><br>exten => s,n,GotoIf($["${Protocol}" = "SIP"]?SIPDev)<br>exten => s,n,GotoIf($["${Protocol}" = "IAX2"]?IAXDev)<br>exten => s,n,Goto(ZapDev)
<br><br>;ok, they are an IAX device so use IAXPEER<br>exten =><br>s,n(IAXDev),Set(CalledUsersContext=${IAXPEER(${Phone}:context)})<br>exten => s,n,Goto(dial_time)<br><br>;ok, they are an SIP device so use SIPPEER<br>
exten =><br>s,n(SIPDev),Set(CalledUsersContext=${SIPPEER(${Phone}:context)})<br>exten => s,n,Goto(dial_time)<br><br>;ok, they are an Zap device so use... Uhhhhh.<br>exten => s,n(ZapDev),NoOp( I have no clue how to get the zap channel's
<br>context...)<br><br>exten => s,n(dial_time),NoOp(======================> Chan Type<br>${Protocol})<br>exten => s,n,NoOp(======================> Chan Name ${Phone})<br>exten => s,n,NoOp(======================> Channel User's context
<br>${CalledUsersContext})<br>exten => s,n,Dial(Local/${FWDNumber}@${CalledUsersContext}/n)<br><br><br>Results at console on verbosity 9:<br>SIPPEER() Works as advertised when I dial a SIP phone which has been<br>call forwarded
<br> -- Executing NoOp("Zap/1-1", "======================> Chan Type<br>SIP") in new stack<br> -- Executing NoOp("Zap/1-1", "======================> Chan Name<br>jf_linksys") in new stack
<br> -- Executing NoOp("Zap/1-1", "======================> Channel Users<br>context longdistance_users") in new stack<br> -- Executing Dial("Zap/1-1", "Local/5551212@longdistance
_users/n")<br>in new stack<br><br>IAXPEER() Seems to be broken or I don't know how to use it properly.<br> -- Executing NoOp("SIP/jf_linksys-08f20548",<br>"======================> Chan Type IAX2") in new stack
<br> -- Executing NoOp("SIP/jf_linksys-08f20548",<br>"======================> Chan Name johns_pc") in new stack<br> -- Executing NoOp("SIP/jf_linksys-08f20548",<br>"======================> Channel Users context ") in new stack
<br> -- Executing Dial("SIP/jf_linksys-08f20548", "Local/5551212@/n") in<br>new stack<br>_______________________________________________<br>--Bandwidth and Colocation provided by <a href="http://Easynews.com">
Easynews.com</a> --<br><br>asterisk-users mailing list<br>To UNSUBSCRIBE or update options visit:<br> <a href="http://lists.digium.com/mailman/listinfo/asterisk-users">http://lists.digium.com/mailman/listinfo/asterisk-users
</a><br></blockquote></div><br>