[Asterisk-Users] beginners question about extension context

Zoltan Szecsei zoltans at geograph.co.za
Sun Jul 17 01:30:43 MST 2005


Rudolf Ladyzhenskii wrote:

> Hi, all
>
> I have couple of SIP phones and they are in [from-sip] context.
> I also have an IAX2 phone. I have put this one in [iax-user] context.
>
> I want to make calls between SIP and IAX2 phones. If I put them all in 
> same context all is fine, however when they are in different contexts 
> they will not call each other and I will get message (in * CLI) that 
> particular extension does not exist in a given context
>
> Here are my contexts definitions:
>
> [from-sip]
> exten =>101,1,Dial(SIP/phone1)
> exten =>102,1,Dial(SIP/phone2)
> exten =>103,1,Dial(SIP/phone3)
>
> [iax-user]
> exten=>201,1,Dial(IAX2/phone4)
> exten=>202,1,Dial(IAX2/phone5)
>
> If I try to call from IAX2 phone to say ext 102, I get "request 
> '102 at iax-user' does not exist"
> I have tried to include iax-user in from-sip and I can make calls from 
> SIP phones to IAX2 ones, but not the other way around.
>
> Now for an interesting bit.
> If I include "from-sip" in tthe "iax-user", all is working fine -- I 
> can make calls in any directions.
>
> If I try to do "cross-include" where one context is included into 
> another and vise versa, IAX2 phone does not even register.
>
> Is there a better than include way to route calls between contexts?
>
> Thanks,
> Rudolf
>
>
>
> _______________________________________________
> Asterisk-Users mailing list
> Asterisk-Users at 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
>
>
Hi,
 From one newbie to another: Hope I don't mis-lead you.

My understanding is that in your dialplan you have options to route 
calls based (amongst other things) on where they originate and where the 
want to terminate.
To this end you should put all your internal phones on the same context 
(lets use from-internal for this example), regardless of whether thay 
are sip, iax or who cares. Note that sip.conf, iax.conf etc define the 
type of phone and will let
Now, in your dialplan (extensions.conf) you set up a from-internal 
context and if anyone in that context dials 201, you route it to phone4, 
101 you route to phone1 etc etc.
This setup also allows you to trap external incoming calls and stop them 
from making an external outgoing call (that you will end up paying for).

(If anyone thinks I've got this wrong, please comment.)

HTH,
Zoltan

-- 

==================================
Geograph (Pty) Ltd
P.O. Box 31255
Tokai
7966
Tel:    +27-21-7018492
Fax:	+27-86-6115323
Mobile: +27-83-6004028
==================================





More information about the asterisk-users mailing list