Connecting baresip to asterisk

I have configured baresip to call a locally running asterisk instance, which has a custom module called app_knisper with dial plan file app_knisper.conf in /etc/asterisk directory.
I have verified that the module is running when asterisk starts.

I would like asterisk to run the app_knisper dialplan when baresip user calls.

  1. in ~/.baresip/accounts I have added a line for the baresip user

<sip:baresip@192.168.2.249:5062>;auth_pass=banana;regint=0;outbound=sip:192.168.2.249;transport=udp

  1. in asterisk pjsip.conf file, I have added
[baresip]
type=endpoint
context=from-internal
disallow=all
allow=ulaw
auth=baresip-auth
aors=baresip

[baresip-auth]
type=auth
auth_type=userpass
password=banana
username=baresip

[baresip]
type=aor
max_contacts=1

When I call from baresip, I enter

d baresip

and asterisk refuses call with error

NOTICE[23543]: res_pjsip_session.c:4000 new_invite: baresip: Call (UDP:192.168.2.249:35527) to extension 'baresip' rejected because extension not found in context 'from-internal'.

The error is pretty clear. It called extension ā€œbaresipā€. There is no dialplan extension named ā€œbaresipā€ in the context ā€œfrom-internalā€.

1 Like

I have configured baresip to call a locally running asterisk instance,

NOTICE[23543]: res_pjsip_session.c:4000 new_invite: baresip: Call
(UDP:192.168.2.249:35527) to extension ā€˜baresipā€™ rejected because
extension not found in context ā€˜from-internalā€™.

I think that message is pretty clear.

Calls from baresip are going into the ā€˜from-internalā€™ context (because you
defined this in pjsip.conf), and the incoming call is trying to reach the
extension ā€˜baresipā€™ which you have not defined in that context.

~/.baresip/accounts` I have added a line for the baresip user

sip:baresip@192.168.2.249:5062

So, that is why baresip is trying to reach the ā€˜baresipā€™ extension in the
context.

Antony.

1 Like

Thanks. So, what must I change in order for the baresip user to connect to app_knisper dial plan ?

You would need to change the dialplan, or have it dial the extension in the dialplan that already exists. The dialplan isnā€™t in this post so we canā€™t say otherwise.

What kind of experience do you have with Asterisk?

Iā€™m not convinced that you are using the term dialplan correctly, here. In any case this feels like Asterisk 101 to me.

Thanks, folks, Iā€™m afraid my knowledge of asterisk is minimal. But, I have made some modifications and now the call goes through. I moved my dialplan code into extensions.conf where it belongs,
and changed the context in pjsip.conf to match the context in extensions.conf

I am using Background to wait for dtmf, is there a default file I can play while running Background ?

Here is the beginning of my app_knisper context section in extensions.conf, which is incorrect
as ask-user file does not exist.

[app_knisper]
exten => s,1,Answer()
same => n,Set(CHANNEL(musicclass)=default)   ; default hold music for now
same => n,Background(ask-user) ; Prompt the user to enter an option

I havenā€™t done an Asterisk install for a long time, but when I did them, the default music class was populated with some CC licensed music (although our marketing people didnā€™t think much of it).

You donā€™t need to set the class to default unless something has changed it.

You can populate the directory with any files in one of the standard Asterisk formats, subject to available codecs, and your having a licence to use its contents.

1 Like

Thanks, thatā€™s working now.

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