You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
sems/apps/examples/di_dialer/Readme.di_dial

104 lines
3.3 KiB

dialout over DI interface
this example lets you trigger creating sessions over
the DI interface. With the DI interface exportde to UDP
in the stats module, you can for example make a simple load
generator test tool.
DI Interface:
-------------
method: "dial"
params:
0 - string application
1 - string user
2 - string from
3 - string to
4 - optional: variable arguments, e.g. dict:
{'somevar':'someval'}
method: "dial_auth"
place a call with uac authentication (see below)
params:
0 - string application
1 - string user
2 - string from
3 - string to
4 - string auth_realm
5 - string auth_user
6 - string auth_pwd
7 - optional: variable arguments, e.g. dict:
{'somevar':'someval'}
method: "dial_pin"
place a call with uac authentication,
credentials from pre-configured dialout PIN (see below)
params:
0 - string application
1 - string dialout pin
1 - string local user
2 - string to user
method: "help"
params: none
return help string
e.g. get help with query_stats -c DI di_dial help
Example
-------
The following line would for example place a call every
second using announcement app from local user 123 to sip:ann@10.0.0.45
while true; do \
../../../core/plug-in/stats/query_stats -c DI di_dial \
dial announcement 123 sip:ann@10.0.0.45 sip:123@83.246.121.43; \
sleep 1; \
done
For dialing DSM scripts, variables can be given to the script:
s.dial('test_di_dial_params', '123', 'sip:35@192.168.5.106', 'sip:5@192.168.5.106', {'somevar':'someval'})
s.dial_auth('test_di_dial_params', '123', 'sip:35@192.168.5.106', 'sip:5@192.168.5.106', 'realm','user','pwd',{'somevar':'someval'})
Outgoing calls with SIP authentication
--------------------------------------
Outgoing calls can be authenticated with SIP authentication. In order for this
to work
o uac_auth module must be loaded
o the application must add the uac_auth session handler to the session and
o the application must somehow know the credentials (user, realm, password).
For example of adding the uac_auth session handler function to the session,
have a look at the announcement or the webconference application.
Dialout PINs
------------
in di_dial.conf you can set dialout pins for accounts which you then can
use to place authenticated calls in that domain. The format is:
dialout_pin<id>=<pin>;<user>;<auth_user>;<domain>;<password>;
This makes it easier and more secure to use authenticated call because
you don't need to specify the domain every time and you don't need to send
the password every time over DI.
If you for example have the account named "sems_account" with
the extension 1551 on siptelephony.net, and set the pin
dialout_pin0=1234;1551;sems_account;siptelephony.net;verysecret;
if you use the pin 1234 the call will be placed
From: 1551@siptelephony.net
To: <to_user>@siptelephony.net
with UAC authentication for the account
realm: siptelephony.net
user: sems_account
pwd: verysecret
you can set several dialout pins, e.g.
dialout_pin0=<pin>;<user>;<auth_user>;<domain>;<password>;
dialout_pin1=<anotherpin>;<anotheruser>;<otherauth_user>;<otherdomain>;<otherpassword>;
Please dont use SEMS for SPIT.
(http://www.google.com/search?q=voip+spit)