Method #1

Situation: host A is the server which has a normal user added for us, and we want to connect our host B as a client.

Host A’s sip.conf has this entry for the normal user:

1
2
3
4
5
6
[testuser]
type=friend
secret=abcd
host=dynamic
context=foo
qualify=yes

Because the host is defined as dynamic, we have to register with our client. Add this to our host B’s sip.conf (to the [general] section):

1
register => testuser:abcd@hostAipaddress

And add this to the bottom of sip.conf:

1
2
3
4
5
6
7
8
[testuser]
type=peer
username=testuser
secret=abcd
host=hostAipaddress
context=incoming
callbackextension=cba ; this extension will be called on host B when host A calls testuser
qualify=yes

This way we can call any extension on host B (in host B’s foo context) like this:

1
exten => 123,1,Dial(SIP/${EXTEN}@testuser)

Note: ${EXTEN} will be replaced with 123.

We can only call host B’s cba extension from host A using this method.

Method #2

Situation: we want to call any extension on host B (in the specified context) from host A and vica versa.

Add this to host A’s sip.conf, to the [general] section:

1
register => testuser:abcd@hostBipaddress

And this to the bottom of host A’s sip.conf:

1
2
3
4
5
6
7
[hostA2hostB]
type=peer
username=hostA2hostB
secret=abcd
host=dynamic
context=foo
qualify=yes

Add this to host B’s sip.conf, to the [general] section:

1
register => testuser:abcd@hostAipaddress

And this to the bottom of host B’s sip.conf:

1
2
3
4
5
6
7
[hostA2hostB]
type=peer
username=hostA2hostB
secret=abcd
host=dynamic
context=bar
qualify=yes

This case we can call any extension in host B’s bar context from host A, and any extension in host A’s foo context from host B using a command like this:

1
exten => 123,1,Dial(SIP/${EXTEN}@hostA2hostB)
Name (required)
E-mail (required - never shown publicly)
Webpage URL
Comment:
You may use <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> in your comment.

Trackback responses to this post

About me

Nonoo
I'm Nonoo. This is my blog about music, sounds, filmmaking, amateur radio, computers, programming, electronics and other things I'm obsessed with. ... »

Twitter

Listening now

My favorite artists