[Serusers] sems+isdngw 2nd via

Giovanni Balasso giaso at yahoo.it
Thu Jan 13 16:59:10 CET 2005


Sent to sems list but non so great activity there...

Hi serusers!

after reading docs, installing ser + sems + rtpproxy from cvs few days ago, I 
came up with a working ivr answering machine (thanks sems developers!!!), now 
I'm trying to add ISDN gateway. 

First question (easy): can I receive call on isdngw and pass it to IVR? (and a 
hint+link on how to)
Second question (harder): I can't get isdngw to receive calls, outgoing calls 
are ok, but if I register to ser with my isdn phone number an place a call to 
my isdn line, i can get my UAC (kphone) ringing, but i can't accept nor 
reject call. If i press accept button on client, my caller phone keeps 
ringing and nothing happens. Hope somebody can help me...

config files and logs attached, same kind of errors even when using 
nathelper+rtpproxy.

Thank you
-- 
Giovanni Balasso
giaso at mail.com

*********************
ngrep port 5060 ouput
*********************


RECEIVING CALL
#
U 192.168.1.125:5060 -> 192.168.1.253:5062
  INVITE sip:457930175 at 192.168.1.253:5062;transport=udp SIP/2.0..Max-Forwards
  : 10..Record-Route: <sip:192.168.1.125;ftag=00002EF5714696EE;lr=on>..Via: S
  IP/2.0/UDP 192.168.1.125;branch=z9hG4bKb34b.33bcab4.0..Via: SIP/2.0/UDP 192
  .168.1.125;branch=z9hG4bKb34b.23bcab4.0..To: sip:457930175 at 192.168.1.125..F
  rom: sip:3202307659 at 192.168.1.125;tag=00002EF5714696EE..CSeq: 11 INVITE..Ca
  ll-ID: 00002EF5768EDB8D at 192.168.1.125..Content-Length: 203..User-Agent: Sip
   EXpress router(0.10.99-dev0 (i386/linux))..Contact: <sip:isdngw at 192.168.1.
  125:5060>..Content-Type: application/sdp....v=0..o=username 0 0 IN IP4 192.
  168.1.125..s=session..c=IN IP4 192.168.1.125..t=0 0..m=audio 1820 RTP/AVP 0
   3 8 96..a=rtpmap:0 PCMU/8000..a=rtpmap:3 GSM/8000..a=rtpmap:8 PCMA/8000..a
  =rtpmap:96 iLBC/8000..                                                     
#
U 192.168.1.253:5062 -> 192.168.1.125:5060
  SIP/2.0 100 Trying..Via: SIP/2.0/UDP 192.168.1.125;branch=z9hG4bKb34b.33bca
  b4.0..Via: SIP/2.0/UDP 192.168.1.125;branch=z9hG4bKb34b.23bcab4.0..From: <s
  ip:3202307659 at 192.168.1.125>;tag=00002EF5714696EE..CSeq: 11 INVITE..Call-ID
  : 00002EF5768EDB8D at 192.168.1.125..To: "giaso" <sip:457930175 at 192.168.1.125>
  ;tag=57AF5094..Content-Length: 0..User-Agent: kphone/4.1.0..Contact: "giaso
  " <sip:457930175 at 192.168.1.253:5062;transport=udp>..Record-Route: <sip:192.
  168.1.125;ftag=00002EF5714696EE;lr=on>....                                 
#
U 192.168.1.253:5062 -> 192.168.1.125:5060
  SIP/2.0 180 Ringing..Via: SIP/2.0/UDP 192.168.1.125;branch=z9hG4bKb34b.33bc
  ab4.0..Via: SIP/2.0/UDP 192.168.1.125;branch=z9hG4bKb34b.23bcab4.0..From: <
  sip:3202307659 at 192.168.1.125>;tag=00002EF5714696EE..CSeq: 11 INVITE..Call-I
  D: 00002EF5768EDB8D at 192.168.1.125..To: "giaso" <sip:457930175 at 192.168.1.125
  >;tag=57AF5094..Content-Length: 0..User-Agent: kphone/4.1.0..Contact: "gias
  o" <sip:457930175 at 192.168.1.253:5062;transport=udp>..Record-Route: <sip:192
  .168.1.125;ftag=00002EF5714696EE;lr=on>....                                



ACCEPT CALL (on kphone client)
#
U 192.168.1.253:5062 -> 192.168.1.125:5060
  SIP/2.0 200 OK..Via: SIP/2.0/UDP 192.168.1.125;branch=z9hG4bKb34b.33bcab4.0
  ..Via: SIP/2.0/UDP 192.168.1.125;branch=z9hG4bKb34b.23bcab4.0..From: <sip:3
  202307659 at 192.168.1.125>;tag=00002EF5714696EE..CSeq: 11 INVITE..Content-Typ
  e: application/sdp..Call-ID: 00002EF5768EDB8D at 192.168.1.125..To: "giaso" <s
  ip:457930175 at 192.168.1.125>;tag=57AF5094..Content-Length: 187..User-Agent: 
  kphone/4.1.0..Contact: "giaso" <sip:457930175 at 192.168.1.253:5062;transport=
  udp>..Record-Route: <sip:192.168.1.125;ftag=00002EF5714696EE;lr=on>....v=0.
  .o=username 0 0 IN IP4 192.168.1.253..s=The Funky Flow..c=IN IP4 192.168.1.
  253..t=0 0..m=audio 33340 RTP/AVP 0 96 3..a=rtpmap:0 PCMU/8000..a=rtpmap:3 
  GSM/8000..a=rtpmap:96 iLBC/8000..                                          



HANG UP (on kphone client)

#
U 192.168.1.253:5062 -> 192.168.1.125:5060
  BYE sip:isdngw at 192.168.1.125:5060 SIP/2.0..Via: SIP/2.0/UDP 192.168.1.253:5
  062;branch=z9hG4bK36FCFB2F..CSeq: 6766 BYE..To: <sip:3202307659 at 192.168.1.1
  25>;tag=00002EF5714696EE..From: "giaso" <sip:457930175 at 192.168.1.125>;tag=5
  7AF5094..Call-ID: 00002EF5768EDB8D at 192.168.1.125..Route: <sip:192.168.1.125
  ;ftag=00002EF5714696EE;lr=on>..Content-Length: 0..User-Agent: kphone/4.1.0.
  .Contact: "giaso" <sip:457930175 at 192.168.1.253:5062;transport=udp>....     
#
U 192.168.1.125:5060 -> 192.168.1.253:5062
  SIP/2.0 100 Trying - just wait a minute !..Via: SIP/2.0/UDP 192.168.1.253:5
  062;branch=z9hG4bK36FCFB2F..CSeq: 6766 BYE..To: <sip:3202307659 at 192.168.1.1
  25>;tag=00002EF5714696EE..From: "giaso" <sip:457930175 at 192.168.1.125>;tag=5
  7AF5094..Call-ID: 00002EF5768EDB8D at 192.168.1.125..Server: Sip EXpress route
  r (0.10.99-dev0 (i386/linux))..Content-Length: 0..Warning: 392 192.168.1.12
  5:5060 "Noisy feedback tells:  pid=11948 req_src_ip=192.168.1.253 req_src_p
  ort=5062 in_uri=sip:isdngw at 192.168.1.125:5060 out_uri=sip:isdngw at 192.168.1.
  125:5060 via_cnt==1"....                                                   
#
U 192.168.1.125:5060 -> 192.168.1.253:5062
  SIP/2.0 481 Call/Transaction Does Not Exist..Via: SIP/2.0/UDP 192.168.1.253
  :5062;branch=z9hG4bK36FCFB2F..CSeq: 6766 BYE..To: <sip:3202307659 at 192.168.1
  .125>;tag=00002EF5714696EE..From: "giaso" <sip:457930175 at 192.168.1.125>;tag
  =57AF5094..Call-ID: 00002EF5768EDB8D at 192.168.1.125..Contact: <sip:isdngw at 19
  2.168.1.125>..Server: Sip EXpress router (0.10.99-dev0 (i386/linux))..Conte
  nt-Length: 0..Warning: 392 192.168.1.125:5060 "Noisy feedback tells:  pid=1
  1946 req_src_ip=192.168.1.253 req_src_port=5062 in_uri=sip:isdngw at 192.168.1
  .125:5060 out_uri=sip:isdngw at 192.168.1.125:5060 via_cnt==0"....            
  .168.1.125;branch=z9hG4bKb34b.23bcab4.0..To: sip:457930175 at 192.168.1.125..F
  rom: sip:3202307659 at 192.168.1.125;tag=00002EF5714696EE..CSeq: 11 INVITE..Ca
  ll-ID: 00002EF5768EDB8D at 192.168.1.125..Content-Length: 203..User-Agent: Sip
   EXpress router(0.10.99-dev0 (i386/linux))..Contact: <sip:isdngw at 192.168.1.
  125:5060>..Content-Type: application/sdp....v=0..o=username 0 0 IN IP4 192.
  168.1.125..s=session..c=IN IP4 192.168.1.125..t=0 0..m=audio 1820 RTP/AVP 0
   3 8 96..a=rtpmap:0 PCMU/8000..a=rtpmap:3 GSM/8000..a=rtpmap:8 PCMA/8000..a
  =rtpmap:96 iLBC/8000..                                                     
#
U 192.168.1.253:5062 -> 192.168.1.125:5060
  SIP/2.0 100 Trying..Via: SIP/2.0/UDP 192.168.1.125;branch=z9hG4bKb34b.33bca
  b4.0..Via: SIP/2.0/UDP 192.168.1.125;branch=z9hG4bKb34b.23bcab4.0..From: <s
  ip:3202307659 at 192.168.1.125>;tag=00002EF5714696EE..CSeq: 11 INVITE..Call-ID
  : 00002EF5768EDB8D at 192.168.1.125..To: "giaso" <sip:457930175 at 192.168.1.125>
  ;tag=57AF5094..Content-Length: 0..User-Agent: 
kphone/4.  .168.1.125;branch=z9h
G4bKb34b.23bcab4.0..To: sip:457930175 at 192.168.1.125..F
  rom: sip:3202307659 at 192.168.1.125;tag=00002EF5714696EE..CSeq: 11 INVITE..Ca
  ll-ID: 00002EF5768EDB8D at 192.168.1.125..Content-Length: 203..User-Agent: Sip
   EXpress router(0.10.99-dev0 (i386/linux))..Contact: <sip:isdngw at 192.168.1.
  125:5060>..Content-Type: application/sdp....v=0..o=username 0 0 IN IP4 192.
  168.1.125..s=session..c=IN IP4 192.168.1.125..t=0 0..m=audio 1820 RTP/AVP 0
   3 8 96..a=rtpmap:0 PCMU/8000..a=rtpmap:3 GSM/8000..a=rtpmap:8 PCMA/8000..a
  =rtpmap:96 iLBC/8000..                                                     
#
U 192.168.1.253:5062 -> 192.168.1.125:5060
  SIP/2.0 100 Trying..Via: SIP/2.0/UDP 192.168.1.125;branch=z9hG4bKb34b.33bca
  b4.0..Via: SIP/2.0/UDP 192.168.1.125;branch=z9hG4bKb34b.23bcab4.0..From: <s
  ip:3202307659 at 192.168.1.125>;tag=00002EF5714696EE..CSeq: 11 INVITE..Call-ID
  : 00002EF5768EDB8D at 192.168.1.125..To: "giaso" <sip:457930175 at 192.168.1.125>
  ;tag=57AF5094..Content-Length: 0..User-Agent: kphone/4.






***************************
sems output
***************************

Configuration:
       configuration file:  /usr/local/etc/sems/sems.conf
       Ser's FIFO:          /tmp/ser_fifo
       our FIFO:            /tmp/am_fifo
       plug-in path:        /usr/lib/sems/plug-in/
       daemon mode:         0
       local IP:            192.168.1.125

(12018) WARNING: reloadModuleConfig (SemsConfiguration.cpp:66): no 
configuration found for module semstalk, maybe you want to specify 
config.semstalk in config file.
(12018) WARNING: onLoad (Semstalk.cpp:70): no configuration specified for 
module ttsannounce.
(12018) WARNING: onLoad (Semstalk.cpp:71): using default configuration:
(12018) WARNING: onLoad (Semstalk.cpp:77): FestivalServer = "localhost"
(12018) WARNING: onLoad (Semstalk.cpp:78): FestivalPort = "1314"
(12018) WARNING: onLoad (Semstalk.cpp:79): FestivalVoice = "rab_diphone"
(12018) WARNING: onLoad (Semstalk.cpp:80): Caching = true
(12018) WARNING: onLoad (Semstalk.cpp:81): CachePath = "/tmp/"
(12018) WARNING: reloadModuleConfig (SemsConfiguration.cpp:66): no 
configuration found for module ttsannounce, maybe you want to specify 
config.ttsannounce in c
onfig file.
(12018) WARNING: onLoad (TTSAnnounce.cpp:74): no configuration specified for 
module ttsannounce.
(12018) WARNING: onLoad (TTSAnnounce.cpp:75): using default configuration:
(12018) WARNING: onLoad (TTSAnnounce.cpp:85): AnnouncePath = "texts/"
(12018) WARNING: onLoad (TTSAnnounce.cpp:86): AnnounceFile = "default.txt"
(12018) WARNING: onLoad (TTSAnnounce.cpp:87): FestivalServer = "localhost"
(12018) WARNING: onLoad (TTSAnnounce.cpp:88): FestivalPort = "1314"
(12018) WARNING: onLoad (TTSAnnounce.cpp:89): FestivalVoice = "rab_diphone"
(12018) WARNING: onLoad (TTSAnnounce.cpp:90): Caching = true
(12018) WARNING: onLoad (TTSAnnounce.cpp:91): CachePath = "/tmp/"
(12018) WARNING: onLoad (AnswerMachine.cpp:125): Voicemail: no 
rec_file_extension specified in configuration
(12018) WARNING: onLoad (AnswerMachine.cpp:126): file for module voicemail: 
using default.
(12018) WARNING: onLoad (AnswerMachine.cpp:164): no email_template_path 
specified in configuration
(12018) WARNING: onLoad (AnswerMachine.cpp:165): file for module voicemail: 
using default.
(12018) WARNING: onLoad (Ivr.cpp:119): No on_load_script will be executed.
RECEIVING CALL
(12021) ERROR: listen (IsdnDeviceIncoming.cpp:264): unknown sequence (too 
short)

ACCEPT CALL (on kphone client)


HANG UP (on kphone client)




*****************
SER output
*****************

starting ser
Jan 13 10:08:59 kaus ser: WARNING: fix_socket_list: could not rev. resolve 
192.168.1.125 
Jan 13 10:09:00 kaus ser: WARNING: fix_socket_list: could not rev. resolve 
192.168.1.125 
Jan 13 10:09:00 kaus ser[11941]: AVPops - initializing 
Jan 13 10:09:00 kaus ser[11941]: Maxfwd module- initializing 
Jan 13 10:09:00 kaus ser[11941]: INFO: udp_init: SO_RCVBUF is initially 65535 
Jan 13 10:09:00 kaus ser[11941]: INFO: udp_init: SO_RCVBUF is finally 131070 
Jan 13 10:09:00 kaus ser[11946]: INFO: fifo process starting: 11946 
Jan 13 10:09:00 kaus ser[11946]: SER: open_uac_fifo: fifo server up 
at /tmp/ser_fifo... 




RECEIVING CALL
Jan 13 10:10:01 kaus /USR/SBIN/CRON[12038]: (root) CMD ([ -d /etc/shaper ] 
&& /etc/init.d/shaper timecheck)
Jan 13 10:10:14 kaus kernel: isdn_net: call from 3202307659 -> 0 457930175 
ignored
Jan 13 10:10:14 kaus kernel: isdn_tty: call from 3202307659, -> RING on ttyI2
Jan 13 10:10:14 kaus ser[11947]: *** 
Jan 13 10:10:14 kaus ser[11947]: * 
Jan 13 10:10:14 kaus ser[11947]: *** 
Jan 13 10:10:14 kaus ser[11947]: * 
Jan 13 10:10:14 kaus ser[11947]: *** 
Jan 13 10:10:14 kaus ser[11947]: * 
Jan 13 10:10:14 kaus ser[11947]: *** 
Jan 13 10:10:14 kaus ser[11947]: * 
Jan 13 10:10:14 kaus ser[11947]: *** 
Jan 13 10:10:14 kaus ser[11947]: * 
Jan 13 10:10:14 kaus ser[11947]: *** 
Jan 13 10:10:14 kaus ser[11947]: * 
Jan 13 10:10:14 kaus ser[11947]: *** 
Jan 13 10:10:14 kaus ser[11947]: * 
Jan 13 10:10:14 kaus ser[11947]: *** 
Jan 13 10:10:14 kaus ser[11947]: * 
Jan 13 10:10:14 kaus ser[11947]: *** 
Jan 13 10:10:14 kaus ser[11947]: * 
Jan 13 10:10:14 kaus ser[11947]: *** 
Jan 13 10:10:14 kaus ser[11947]: * 
Jan 13 10:10:14 kaus ser[11947]: *** 
Jan 13 10:10:14 kaus ser[11947]: * 
Jan 13 10:10:14 kaus ser[11947]: *** 
Jan 13 10:10:14 kaus ser[11947]: * 
Jan 13 10:10:14 kaus ser[11947]: *** 
Jan 13 10:10:14 kaus ser[11947]: Benvenuto su ser 
Jan 13 10:10:14 kaus ser[11947]: Stai usando il file di configurazione 
ser.cfg.noproxy con segreteria telefonica 
Jan 13 10:10:14 kaus ser[11947]:    Ricevuto INVITE da 
sip:3202307659 at 192.168.1.125 per sip:457930175 at 192.168.1.125 
Jan 13 10:10:14 kaus ser[11947]:    INVITE received 
Jan 13 10:10:14 kaus ser[11947]: Trovato sip:457930175 at 192.168.1.125  
Jan 13 10:10:14 kaus ser[11947]:    Inizio comunicazione... 
Jan 13 10:10:14 kaus ser[11947]:    Non e' per me 
Jan 13 10:10:14 kaus ser[11947]:    Rilascio e interrompo INVITE 
Jan 13 10:10:14 kaus ser[11947]: ERROR: t_newtran: transaction already in 
process 0x405cbdcc 
Jan 13 10:10:14 kaus ser[11947]: ERROR: sl_reply_error used: I'm terribly 
sorry, server error occurred (1/SL) 
Jan 13 10:10:14 kaus ser[11947]: Warning: run_failure_handlers: no UAC support 
(0, 256)  


ACCEPT CALL (on kphone client)

Jan 13 10:10:30 kaus ser[11955]: ERROR: forward_reply: no 2nd via found in 
reply 



HANG UP (on kphone client)

Jan 13 10:10:49 kaus ser[11948]: *** 
Jan 13 10:10:49 kaus ser[11948]: * 
Jan 13 10:10:49 kaus ser[11948]: *** 
Jan 13 10:10:49 kaus ser[11948]: * 
Jan 13 10:10:49 kaus ser[11948]: *** 
Jan 13 10:10:49 kaus ser[11948]: * 
Jan 13 10:10:49 kaus ser[11948]: *** 
Jan 13 10:10:49 kaus ser[11948]: * 
Jan 13 10:10:49 kaus ser[11948]: *** 
Jan 13 10:10:49 kaus ser[11948]: * 
Jan 13 10:10:49 kaus ser[11948]: *** 
Jan 13 10:10:49 kaus ser[11948]: * 
Jan 13 10:10:49 kaus ser[11948]: *** 
Jan 13 10:10:49 kaus ser[11948]: * 
Jan 13 10:10:49 kaus ser[11948]: *** 
Jan 13 10:10:49 kaus ser[11948]: * 
Jan 13 10:10:49 kaus ser[11948]: *** 
Jan 13 10:10:49 kaus ser[11948]: * 
Jan 13 10:10:49 kaus ser[11948]: *** 
Jan 13 10:10:49 kaus ser[11948]: * 
Jan 13 10:10:49 kaus ser[11948]: *** 
Jan 13 10:10:49 kaus ser[11948]: * 
Jan 13 10:10:49 kaus ser[11948]: *** 
Jan 13 10:10:49 kaus ser[11948]: * 
Jan 13 10:10:49 kaus ser[11948]: *** 
Jan 13 10:10:49 kaus ser[11948]: Benvenuto su ser 
Jan 13 10:10:49 kaus ser[11948]: Stai usando il file di configurazione 
ser.cfg.noproxy con segreteria telefonica 
Jan 13 10:10:49 kaus ser[11948]:    SEMS: termino la chiamata 


***********
isdngw.conf
***********

# required parameter: enablei4l=< yes | no >
#
# enable I4L support?
# For isdn4linux support, you need
#  - the linux kernel drivers for i4l loaded
#  - read/write permissions for sems user on (some) /dev/ttyI* devices 
#  - you can (for whatever reason) use the "capidrv" kernel module
#    to use CAPI based cards with I4L (this is not recommended though)
enablei4l=yes

# required parameter: enablecapi=< yes | no >
#
# enable CAPI20 support? 
# For CAPI support you need 
#  - a sems compiled with CAPI support (-DUSE_CAPI20 uncommented in Makefile) 
#  - the capi20 libraries from the isdn4k package properly installed
#  - the kernel capi drivers loaded (run capiinfo to check!)
# CAPI20 support is experimental, tested with AVM FritzCard PCIV2 and C4
enablecapi=no

# optional parameter: i4l_numoutdevices=<number of devices to be used>
#
#  - specifies how many ttyI* devices to use for outgoing telephony calls
#  - devices must be fully accessible by the vm process' user
#  - this number also specified the maximum number of simultaneous 
#    outgoing phone calls (if not otherwise restricted)
#  - you must specify exactly one parameter of i4l_numoutdevices and 
i4l_outdevices, not both
i4l_numoutdevices=2

# optional parameter: i4l_outdevices=<dev1>, <dev2>, <dev3>, ...
#
#  - specifies which ttyI* devices to use for outgoing telephony calls
#  - devices must be fully accessible by the vm process' user
#  - the number of devices listed is the maximum of simultaneous 
#    outgoing phone calls (if not otherwise restricted)
#  - you may not set i4l_numoutdevices if this parameter is set
#  - e.g. i4l_outdevices=/dev/ttyI10, /dev/ttyI11, /dev/ttyI12
i4l_outdevices=

# optional parameter: i4l_numindevices=<number of devices used>
#
#  - specifies how many ttyI* devices to use for incoming telephony calls
#  - devices must be fully accessible by the sems process' user
#  - the number of devices listed is also the maximum of simultaneous 
#    incoming phone calls (if not otherwise restricted)
#  - you may specify only i4l_numindevices OR i4l_indevices, not both.
i4l_numindevices=2

# optional parameter: i4l_indevices=<dev1>, <dev2>, <dev3>, ...
#
#  - specifies which ttyI* devices to use for incoming telephony calls
#  - devices must be fully accessible by the vm process' user
#  - the number of devices listed is the maximum of simultaneous 
#    incoming phone calls (if not otherwise restricted)
#  - you may specify only i4l_numindevices OR i4l_indevices, not both.
#  - e.g. i4l_indevices=/dev/ttyI13, /dev/ttyI14
i4l_indevices=

# optional parameter: i4l_lockdir=/where/to/store/lockfiles
#
#  - specifies the directory where to put the lockfiles
#  - may be useful if not run as root
#  - default: i4l_lockdir=/var/lock
i4l_lockdir=/var/lock

# optional parameter: i4l_inmsn=<msn1>, <msn2>, <msn3>, ...
#
#  - specifies the all msn's the i4l backend listens for calls on
#  - a call is only accepted if the according SIP call is successfully placed
#  - other ISDN equipment *may* also listen on this numbers, the
#    first to accept the call is the lucky one then
#  - IMPORTANT: no other isdn4linux application may bind to any of that 
numbers
#  - wildcards may be specified here like 81462* or *
#  - example: i4l_inmsn=12345, 54321*
i4l_inmsn=*

# optional parameter: i4l_mapping=<number1>, <number2>, ...
#
#  - specifies what numbers are called via the isdn4linux backend
#  - a call is only placed to the PSTN network if it matches one mapping (i4l
#    or capi controller mapping below)
#  - wildcards may be specified here like 81462* or *
#  - A "*" means that all calls are allowed and get routed via i4l
i4l_mapping=*

# optional parameter: i4l_numchannel=<number of available b-channels>
#
#  - specifies how many B-channels should be used with isdn4linux backend
#  - isdngw checks for availability of a channel before trying to route
#    the call, if another backend allows a connection and i4l has no
#    more channels available, other backend will be used
#  - the value does not have to be the real number of channels, you can 
#    limit the max number of simulatenous connections with this parameter
#  - if this parameter is omitted, isdngw tries to detect this number
#    by accessing /dev/isdninfo, this fails if capidrv is used or the 
#    user running sems does not have read permissions on this device
i4l_numchannel=




***********
sems.conf
***********

#
# sems.conf.sample
#
# Sip Express Media Server (sems)
# 
# sample configuration file
# 
#
# whitespaces (spaces and tabs) are ignored
# comments start with a "#" and may be used inline
# 
# example: option=value1, value2  # i like this option
#

##################################
# global parameters              #
##################################

# optional parameter: fork={yes|no}
# 
# - specifies if sems should run in daemon mode (background)
#   (fork=no is the same as -E)
fork=yes

# optional parameter: stderr={yes|no}
#
# - debug mode: do not fork and log to stderr
#   (stderr=yes is the same as -E)
stderr=no

# optional parameter: loglevel={0|1|2|3}
#
# - sets log level (error=0, warning=1, info=2, debug=3)
#   (same as -D)
loglevel=1

# optional parameter: ser_fifo_name=<filename>
#
# - path and file name of Ser's fifo file (same as -o)
ser_fifo_name=/tmp/ser_fifo

# optional parameter: socket_name=<filename>
#
# - path and file name of our unix socket
socket_name=/tmp/am_sock

# optional parameter: ser_socket_name=<filename>
#
# - path and file name of Ser's unix socket
ser_socket_name=/tmp/ser_sock

# optional parameter: send_method=<filename>
#
# - sets which method will be used to contact Ser:
#   FIFO or unix socket server.
# - values: fifo (default), unix_socket
#
# - PLEASE NOTE THAT: if you use 'fifo', make sure that
#   fifo_name and ser_fifo_name have been set. if you use 'unix_socket',
#   make sure that socket_name and ser_socket_name have been set.
# 
send_method=fifo

# optional parameter: plugin_path=<path>
# 
# - sets the path to the plug-ins
# - may be absolute or relative to CWD
plugin_path=/usr/lib/sems/plug-in/

# optional parameter: smtp_server=<hostname>
#
# - sets address of smtp server
smtp_server=localhost
# optional parameter: smtp_port=<port>
#
# - sets port of smtp server
smtp_port=25

# optional parameter: rtp_low_port=<port>
#
# - sets port of rtp lowest server
#rtp_low_port=1024

# optional parameter: rtp_high_port=<port>
#
# - sets port of rtp highest server
#rtp_high_port=65535

##################################
# module specific parameters     #
##################################

# sample voicemail configuration (inline)
config.voicemail=inline

# optional parameter: announce_path=<path>
# 
# - sets the path where announce files are searched for
# - the file to be played is determined the following way:
#   <announce_path>/<domainname>/<username>.wav
#   if this file is not available <announce_path>/<default_anounce> is used
announce_path=/usr/lib/sems/audio/

# parameter: default_announce=<filename>
# 
# - sets the name of the default announce WAV file
default_announce=default_en.wav

# parameter: max_record_time=<seconds>
#
# - maximum record time
max_record_time=30

# parameter: email_template=<filename>
#
# - email template file
# 
# See the README file in <sems-src>/plug-in/voicemail
# for more information on the syntax used.
#
email_template=/usr/lib/sems/plug-in/mail.template

# end of configuration section for voicemail module
config.voicemail=end


# sample announcement configuration (inline)
config.announcement=inline

# optional parameter: announce_path=<path>
# 
# - sets the path where announce files are searched for
announce_path=/usr/lib/sems/audio/

# parameter: default_announce=<filename>
# 
# - sets the name of the default announce WAV file
default_announce=default_en.wav

# end of configuration section for announcement module
config.announcement=end


# sample isdngw module configuration (external file)
  config.isdngw=/etc/sems/isdngw.conf

########## IVR
# sample ivr module configuration (inline)
  config.ivr=inline
  #parameter: ivr_script_path:
  # path to ivr scripts.
  # 
  ivr_script_path=/etc/ivr/
  # default script file: this will be executed if <user>.py does not exist.
  #
  ivr_script_file=ivr.py

  # parameter : tts_caching
  #     y or n
  #       text will be read from waves already synthesized and 
  #     cached in cache_path 
  tts_caching=y

  # parameter : tts_cache_path
  #     path to cache waves
  #     path must exist! 
  tts_cache_path=/tmp/wavs

#parameter: python_script_path=<full path>
#python_script_path=/etc/ivr

#parameter: python_script_file=<filename>
#python_script_file=example.py

# end of configuration section for ivr module
config.ivr=end
############

# sample conference configuration (inline)
config.conference=inline

# parameter: default_announce=<filename>
#
# - sets the full pathed name of the default announce WAV file.
#   Will be played to lonely users.
default_announce=/usr/lib/sems/audio/first_participant.wav

# parameter: join_sound=<filename>
#
# - sets the full pathed name of a WAV file
#   which will be played to conference users 
#   when a new user joins the conference.
join_sound=/usr/lib/sems/audio/beep.wav

# parameter: drop_sound=<filename>
#
# - sets the full pathed name of a WAV file
#   which will be played to conference users 
#   when a user drops the conference.
drop_sound=/usr/lib/sems/audio/beep.wav

# end of configuration section for conference module
config.conference=end

# example configuration for number reader
config.number_reader=inline

number_path=/usr/lib/sems/audio/

prolog_file=welcome_to_number_reader.wav

epilog_file=thanks_calling_number_reader.wav

# end of number_reader configuration
config.number_reader=end

# add more module configurations here (inline or external):
#
# config.mymodule=<filename>
#  or
# config.mymodule=inline
# ...
# config.mymodule=end



**********
ser.cfg
**********

#
# $Id: ser.cfg,v 1.21.4.1 2003/11/10 15:35:15 andrei Exp $
#
# simple quick-start config script
#

# ----------- global configuration parameters ------------------------

debug=3         # debug level (cmd line: -dddddddddd)
fork=yes	
log_stderror=no        # (cmd line: -E)

/* Uncomment these lines to enter debugging mode

debug=3
fork=no
log_stderror=yes
*/

check_via=no    # (cmd. line: -v)
dns=no           # (cmd. line: -r)
rev_dns=no      # (cmd. line: -R)
#port=5060
#children=4
fifo="/tmp/ser_fifo"

listen=192.168.1.125
alias=kaus


# ------------------ module loading ----------------------------------

# Uncomment this if you want to use SQL database
loadmodule "/usr/lib/ser/modules/mysql.so"

loadmodule "/usr/lib/ser/modules/avp.so"
loadmodule "/usr/lib/ser/modules/avpops.so"
loadmodule "/usr/lib/ser/modules/avp_db.so"
loadmodule "/usr/lib/ser/modules/sl.so"
loadmodule "/usr/lib/ser/modules/tm.so"
loadmodule "/usr/lib/ser/modules/rr.so"
loadmodule "/usr/lib/ser/modules/maxfwd.so"
loadmodule "/usr/lib/ser/modules/usrloc.so"
loadmodule "/usr/lib/ser/modules/registrar.so"
loadmodule "/usr/lib/ser/modules/textops.so"
loadmodule "/usr/lib/ser/modules/domain.so"
loadmodule "/usr/lib/ser/modules/xlog.so"
#loadmodule "/usr/lib/ser/modules/vm.so"

# accounting
loadmodule "/usr/lib/ser/modules/acc.so"

# Uncomment this if you want digest authentication
# mysql.so must be loaded !
loadmodule "/usr/lib/ser/modules/auth.so"
loadmodule "/usr/lib/ser/modules/auth_db.so"
#loadmodule "/usr/lib/ser/modules/auth_radius.so"

# Nathelper
#loadmodule "/usr/lib/ser/modules/nathelper.so"

# msilo
#loadmodule "/usr/lib/ser/modules/msilo.so"

fifo_db_url="mysql://ser:heslo@localhost/ser"

# ----------------- setting module-specific parameters ---------------


# -- avp params

# configure avpops db connection
modparam( "avpops", "avp_url", "mysql://ser:heslo@localhost/ser" )
modparam( "avpops", "avp_table", "subscriber" )
modparam( "avpops", "uuid_column", "id" )

# configure aliases, the number doesn't matter as long as there are no 
collisions)
modparam( "avpops", "avp_aliases", "email=i:67 ; language=i:68" )

# scheme to access the database
modparam( "avpops", "db_scheme", 
          "email_scheme:table=subscriber;value_col=email_address;value_type=string")



# -- usrloc params --

#modparam("usrloc", "db_mode",   0)

# Uncomment this if you want to use SQL database
# for persistent storage and comment the previous line
modparam("usrloc", "db_mode", 2)

# -- auth params --

modparam("auth_db", "calculate_ha1", yes)
modparam("auth_db", "password_column", "password")

# -- rr params --
# add value to ;lr param to make some broken UAs happy
modparam("rr", "enable_full_lr", 1)

# -- nathelper params --
#modparam("registrar", "nat_flag", 6)
#modparam("nathelper", "natping_interval", 30)
#modparam("nathelper", "ping_nated_only", 1)

# -- acc params --
modparam("acc", "db_url", "mysql://ser:heslo@localhost/ser")
# -- acc params --
# Useage of flags is as follows:
#       1 ==
#       6 == nathelper
# set the reporting log level
#modparam("acc", "report_ack", 1)
modparam("acc", "log_level", 1)
modparam("acc", "failed_transactions", 1)
# number of flag, which will be used for accounting; if a message is
# labeled with this flag, its completion status will be reported
modparam("acc", "db_flag", 1 )
modparam("acc", "db_missed_flag", 3 )
modparam("acc", "report_ack", 6)        # non traccio gli ack
modparam("acc", "report_cancels", 1)


# -- tm params --
modparam("tm", "tw_append",
               "voicemail_headers:hdr[User-Agent];P-Email-Address=avp[$email];P-Language=avp[english]")


# -------------------------  request routing logic -------------------

# main routing logic

route{

   xlog("L_INFO", "***\n");
   xlog("L_INFO", "*\n");
   xlog("L_INFO", "***\n");
   xlog("L_INFO", "*\n");
   xlog("L_INFO", "***\n");               
   xlog("L_INFO", "*\n");
   xlog("L_INFO", "***\n");
   xlog("L_INFO", "*\n");
   xlog("L_INFO", "***\n");               
   xlog("L_INFO", "*\n");
   xlog("L_INFO", "***\n");
   xlog("L_INFO", "*\n");
   xlog("L_INFO", "***\n");               
   xlog("L_INFO", "*\n");
   xlog("L_INFO", "***\n");
   xlog("L_INFO", "*\n");
   xlog("L_INFO", "***\n");               
   xlog("L_INFO", "*\n");
   xlog("L_INFO", "***\n");
   xlog("L_INFO", "*\n");
   xlog("L_INFO", "***\n");               
   xlog("L_INFO", "*\n");
   xlog("L_INFO", "***\n");
   xlog("L_INFO", "*\n");
   xlog("L_INFO", "***\n");               

   xlog("L_INFO", "Benvenuto su ser\n");
   xlog("L_INFO", "Stai usando il file di configurazione ser.cfg.noproxy con 
segreteria telefonica\n");
   # initial sanity checks -- messages with
   # max_forwards==0, or excessively long requests
   if (!mf_process_maxfwd_header("10")) {
      sl_send_reply("483","Too Many Hops");
      break;
   };
   if ( msg:len > max_len ) {
      sl_send_reply("513", "Message too big");
      break;
   };
 
 /******************
   if (nat_uac_test("3")) {

      if (method == "REGISTER" || !search("^Record-Route:")) {
         xlog("L_INFO","  Registrazione da nat...\n");
         log("LOG: NAT!!!...\n");

         fix_nated_contact();
         if (method == "INVITE") {
            fix_nated_sdp("1");
         };
         force_rport();
         setflag(6);
      };
   };
*******************/
   # we record-route all messages -- to make sure that
   # subsequent messages will go through our proxy; that's
   # particularly good if upstream and downstream entities
   # use different transport protocol
   record_route();
   # loose-route processing
   if (loose_route()) {
      xlog("L_INFO","  Chiamo route(1) per loose route\n");
      route(1);
      t_relay();
      break;
   };

   # if the request is for other domain use UsrLoc
   # (in case, it does not work, use the following command
   # with proper names and addresses in it)
   if (method=="REGISTER") {
      if (is_from_local()) {
         xlog("L_INFO", "   Richiesta di registrazione da locale\n");
         log(1,"From local...");

         if (!www_authorize("192.168.1.125", "subscriber")) {
            xlog("L_NOTICE", "      !!!Richiesta di autenticazione da %fu\n");
            log(1, "      Auth: NO - requesting authentification\n");
            www_challenge("192.168.1.125", "0");
            break;
         } else {
            log(1, "      Auth: YES");
            xlog("L_INFO", "      Richiesta login %fu da %is accettata\n");
         };

         if (!save("location")) {
            xlog("L_NOTICE", "      !!!errore registrar\n");
            sl_reply_error();
         };
         xlog("L_INFO","  'location' salvata\n");
         xlog("L_INFO","  procedura REGISTER terminata\n");
         break;
      }; #Fine is_from_local

   }; #Fine method=REGISTER


   if (method=="INVITE") {      

      xlog("L_INFO", "   Ricevuto INVITE da %fu per %tu\n");
      log(1, "   INVITE received\n");


      lookup("aliases");
      xlog("L_INFO", "Trovato %tu \n");



      if (lookup("location"))  {
         xlog("L_INFO", "   Inizio comunicazione...\n");
         setflag(1);
         route(1);
      };
      

      if (uri!=myself) {
         xlog("L_INFO", "   Non e' per me\n");
	 xlog("L_INFO", "   Rilascio e interrompo INVITE\n");
         if (!t_relay()) {
            sl_reply_error();
         };
         break;
      };

   }; #fine method=INVITE
   



   if ( method=="ACK" || method=="INVITE" || method=="BYE" ||
        method=="CANCEL" ){
      # switch to stateful mode:
      if (!t_newtran()){
         sl_send_reply("500","could not create transaction");
         break;
      };

      # prevent timeout on the other side:
      t_reply("100","Trying - just wait a minute !");
           
      if (method=="INVITE"){
         # redirect the call to the 'conference' plug-in
         # if the URI begin with 100
	 xlog("L_INFO", "   INVITE sconoscuto: vai di segreteria!\n");
         if (uri=~"sip:100.*@") {
            # assumes that Sems configuration parameter 'socket_name='
            # has been set to /tmp/am_fifo
            if(!t_write_req("/tmp/am_fifo","conference")) {
               t_reply("500","error contacting sems");
            };
            break;
         };
         	 
         # redirect the call to the 'announcement' plug-in
         # if the URI begin with 200
         if (uri=~"sip:200.*@") {
            if(!t_write_req("/tmp/am_fifo","announcement")) {
               t_reply("500","error contacting sems");
            };
            break;
         };

        
         if(uri=~"^sip:[0-9]+ at .*" && !uri=~"^sip:457930175 at .*"){
	    xlog("L_INFO", "   INVITE per Numero: al gateway ISDN!\n");
            if(!t_write_req("/tmp/am_fifo","isdngw")){
               log("could not contact isdngw\n");
	       xlog("L_INFO", "errore isdngw\n");   
               t_reply("500","could not contact isdngw");
            };
	    break;
	 };
	    

         # no service number, redirect to voicemail.
         # do not forget to load AVPs so that voicemail gets the
         # callee's email address.
         #
	 # La riga qui sotto da' ogni tipo di errore :(
	 # load_avp("ruri","email",0);
	 
	 # vediamo se questa funziona
	 avp_db_load( "$ruri", "$email/$email_scheme");
         avp_db_load( "$ruri", "en/en_scheme");
	 
	 
	 xlog("L_INFO", "   SEMS: Utente non in linea: segreteria interattiva!\n");
	 if(!t_write_req("/tmp/am_fifo","ivr")) {
            t_reply("500","error contacting sems IVR");
         };

	 #if(!t_write_req("/tmp/am_fifo","voicemail/voicemail_headers")) {
         #   t_reply("500","error contacting sems trying ivr");
         #};


         /******
         if(!t_write_unix("/tmp/am_sock","announcement")) {
            t_reply("500","error contacting sems");
         };
	 ******/
         break;
	 
      } else if (method=="BYE" || method=="CANCEL") {
         # Sems should already know which plug-in is handling that
         # call. "bye" is no plug-in name. It is a reserved name which
         # tells Sems to terminate the call.
	 xlog("L_INFO","   SEMS: termino la chiamata\n");
         if(!t_write_unix("/tmp/am_sock","bye")) {
            t_reply("500","error contacting sems");
         };
      };
   };
   

}

route[1] {

    #if (method == "BYE" || method == "CANCEL"){
    #   setflag(1);
    #};

    #if (uri=~"[@:](192\.168\.|10\.|172\.(1[6-9]|2[0-9]|3[0-1])\.)" 
&& !search("^Route:")){
    #   sl_send_reply("479", "      We don't forward to private IP 
addresses");
    #  break;
    #};

/*********************************
    if (isflagset(6)){
        xlog("L_INFO", "      Problema di NAT, passiamo da rtpproxy\n");
        log(1, "      Forcing rtpproxy\n");        
        force_rtp_proxy();
    };
*********************************/
#    t_on_reply("1");

    if (!t_relay()){
        xlog("L_INFO", "      Errore di staffetta\n");
        log(1, "      Relay error\n");        
        sl_reply_error();
    };
    break;
}


/************************
onreply_route[1]
{
    # nated ?
    if (isflagset(6) && status =~ "(183)|2[0-9][0-9]"){
        xlog("L_INFO", "         Nat da sistemare e proxy\n");
        log(1, "         Fix nat and rtpproxy\n");
        fix_nated_contact();
        force_rtp_proxy();
    } else if (nat_uac_test("1")) {
        xlog("L_INFO", "         Nat da sistemare\n");
        log(1, "         Fix nat only\n");
        fix_nated_contact();
    };
}
************************/



-- 
Giovanni Balasso
giaso at yahoo.it




More information about the sr-users mailing list