[asterisk-users] Handling inbound and outbound calls passed from a proxy

kjcsb kjcsb at orcon.net.nz
Tue Aug 8 18:52:57 MST 2006


I need to handle the following scenarios:
1. UA1 --> SIP Proxy --> Asterisk

2. UA2 --> SIP Proxy --> Asterisk --> PSTN gateway (SIP)

I have configured a trunk to register with the SIP proxy:
trunk1
register=user1:password1 at SIP.Proxy/DID1

UA1 calls user1 at SIP.Proxy and the call is recognised as being to DID1. I set
up an inbound route for DID1 and route the call as appropriate. That deals
with scenario 1.

I then tried to configure another trunk to handle scenario 2:
trunk2
context=from-internal
host=SIP.Proxy
type=peer
register=user2:password2 at SIP.Proxy

A call to PSTN1 from the UA is passed to the SIP proxy which recognises it
as PSTN call. The SIP proxy updates the From details and passes the call to
Asterisk which (I presume) puts the call into the from-internal context and
dials the outbound route appropriately.

However that setup messes up scenario 1 which now gives a 404 back to UA1. I
presume Asterisk is not differentiating between a call made to user1 from
UA1 and a call made to PSTN1 from user2. It's just seeing a call from
SIP.Proxy and putting it into the from-internal context.

Could anyone advise how I would set up Asterisk to cope with both these
scenarios? I could setup DID2 but I don't know how to pass the call onto the
PSTN gateway. I am using AMP/FreePBX but if someone could advise the general 
principles I would appreciate it.

Thanks

Cameron





More information about the asterisk-users mailing list