[Asterisk-Users] iax problem

Rich Adamson radamson at routers.com
Sun Sep 25 06:26:12 MST 2005


> I've 3 iax connections to my provider , each of them have own DID ,
> 
> PH1<----|
> 	|
>        \/
> PH2<-->|-----| <---------------------------> |----|<-- DID1
>        |  A1 | <---------------------------> |ISP |<-- DID2
> PH3<-->|-----| <---------------------------> |----|<-- DID3
> 
> I had iax phone on each of this connection , but now I want
> to terminate all on my asterisk box , and send calls to phones connected
> to my asterisk depending to incoming username/DID .
> 
> for example : 
> 
> Call to DID1 must be directed to PH1 , DID2 to PH2 and DID3 to PH3 etc
> 
> In iax.conf I have :
> 
> [Username1] ;DID1
> type=user
> username=Username11
> ;secret=blah
> host=X.X.X.X
> context=fromisp1
> 
> [Username2] ;DID2
> type=user
> username=Username2
> host=X.X.X.X
> context=fromisp1
> 
> 
> [Username3] ;DID3
> type=user
> username=Username3
> host=X.X.X.X
> context=fromisp1
> 
> For each of the iax connection I have defined section with type user. 
> 
> In extension.conf I have :
> 
> [fromisp1]
> exten => s,1,Dial(SIP/1235)
> exten => _X.,1,Dial(SIP/1235)
> exten => h,1,Hangup
> 
> Every incoming call enters context fromisp1 with exten 's' . 
> I can't distinguish incoming DID or username, of couse I've figure out
> that I can create context for each iax connection , but for me I would 
> be wast of cpu cycles :)
> 
> Some other ideas for my problem ?:)

Two approaches that have been rather common are:
 1. use the separate contexts for each did,
 2. in the register statement, add /1234 at the end; like
    register => username:secret at abc.com/6789

For #2, incoming calls would be handled with:
 exten => 6789,1,Dial(SIP/1235)






More information about the asterisk-users mailing list