Define Context in Sip.Conf for outbound calls only

Hi,

I have many contexts in the sip.conf but there are some contexts i need to be used for outbound calls only and not receive calls.

This issue is the same IP and port of my caller are the both used in the inbound and outbound contexts so asterisk match the incoming call to the outbound context while i need it to match to inbound context.

chan_sip has been removed from the master version of the Asterisk code on Github and will not be included in the next release.

Additionally chan_pjsip provides more precise control over matching of endpoints and contacts. In particular, static addresses for UAC use go in the type=aor section and static addresses for UAS use go in the type=identify section.

However, I cannot think of a valid reason why you would want different codecs or dtmfmode in the two directions, and most other things are for one or the other direction. There are well established, and better, ways of handling the authentication asymmetry problem.

maybe i didn’t clarify my issue in a correct way. So i will try to explain it again.

in my Sip.conf i have 2 context one use to match incoming calls and one for the outbound calls i need to do.

I’m connected to a client who should calls me on [inbound_calls] using their ip and port. In some cases I will need to do outbound call using [outbound_calls] which calls the same client but on different extension on his side.

The problem is after I added the [outbound_calls] context. All the incoming calls are matched to it not to the [inbound_calls] as before.

So, How to make asterisk match the incoming calls to [inbound_calls] context only and don’t match any incoming calls to [outbound_calls] ?

[inbound_calls]
context=customer_questions
type=peer
host=192.168.66.66
port=5060

[outbound_calls]
host=192.168.66.66
port=5060
type=peer

You don’t. you use only the, so called, inbound context for both. There is nothing here that I can see would require different options for the different directions.

If there were, you would need to do something like:

[inbound_calls]
type=endpoint
context=customer_questions

[inbound_calls]
type=identify
match=192.168.66.66
endpoint=inbound_calls

[outbound_calls]
type=endpoint
aors=outbound_calls

[outbound_calls]
type=aor
contact=sip:192.168.66.66

Using the, currently supported, chan_pjsip driver, (Above is untested and may be incomplete.)

Note that configuration file sections only represent contexts in extension*.conf.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.