Hi!

Thanks for your interest in sip_reg and sip_monitor!

sip_reg.c is a very old tool in libeXosip. It's runs as a daemon, in background so..., to REGISTER a Contact header.
This Contact header can be a long term static URI, or anything to test.
It will reject any incoming call.
It will log into syslog so you may keep an eye on it and may be monitor connection with a service.
sip_reg.c is working, but I'm not using it and it may be uncomplete for some task.

sip_monitor is a very new version of sip_reg. It's a tool, not running in the background with the goal
of reporting in syslog proper logs on success or failure to connect on a service. I'm using it to monitor
a kamailo service.

In order to use one or the other, you need to install openssl + openssl-dev and libc-ares-dev + libc-ares-dev (https://c-ares.haxx.se/)

$> git clone https://git.savannah.gnu.org/git/osip.git
$> cd osip
$> ./autogen.sh
$> ./configure
$> make
$> make install

$> git clone https://git.savannah.nongnu.org/git/exosip.git
$> cd osip
$> ./autogen.sh
$> ./configure
$> make
$> make install

To make sure you correctly have compiled eXosip with the dependancies, check in exosip-config.h if it contains
 #define HAVE_ARES_H 1
and
 #define HAVE_OPENSSL_SSL_H 1

Then, you can run sip_monitor. You get in syslog various information, including error or duration of the test:

$> /usr/local/bin/sip_monitor -r sip:antisip.com -u sip:test1@antisip.com -U test1 -P THISISTHEPASSWORD -t TLS -s --outbound "<sip:sip.antisip.com;lr>"
sip_monitor[6439]: sip_monitor (5.1.3) up and running [testing on [TLS] REGISTER [sip:antisip.com] From: [sip:test1@antisip.com] Username: [test1:*****] Route: [<sip:sip.antisip.com;lr>]
sip_monitor[6439]: [count=1] socket [sip.antisip.com] [sock=11] [pos=0] connected
sip_monitor[6439]: [count=2] socket [sip.antisip.com] [sock=11] [pos=0] connected (ssl in progress)
sip_monitor[6439]: [count=1] [ssl connect] succeeded [TLSv1.2]
sip_monitor[6439]: [TLS][duration:0,091s] REGISTER [401][Unauthorized]
sip_monitor[6439]: REGISTRATION REPORT:[SUCCESS] [TLS][duration:0,115s] REGISTER [200][OK]

WRONG PASSWORD:

$> /usr/local/bin/sip_monitor -r sip:sip4.antisip.com -u sip:test1@sip.antisip.com -U test1 -P THISISNOTTHEPASSWORD -t TLS -s --outbound "<sip:sip.antisip.com;lr>"
sip_monitor[6357]: sip_monitor (5.1.3) up and running [testing on [TLS] REGISTER [sip:antisip.com] From: [sip:test1@antisip.com] Username: [test1:*****] Route: [<sip:sip.antisip.com;lr>]
sip_monitor[6357]: [count=1] socket [sip.antisip.com] [sock=11] [pos=0] connected
sip_monitor[6357]: [count=2] socket [sip.antisip.com] [sock=11] [pos=0] connected (ssl in progress)
sip_monitor[6357]: [count=1] [ssl connect] succeeded [TLSv1.2]
sip_monitor[6357]: [TLS][duration:0,092s] REGISTER [401][Unauthorized]
sip_monitor[6357]: REGISTRATION REPORT:[FAILURE] [TLS][duration:0,116s] REGISTER [403][Wrong Password] err=Wrong Password


WRONG CERTIFICATE VALIDATION: (Wrong SNI : FQDN is wrong)

$> /usr/local/bin/sip_monitor -r sip:sip4.antisip.com -u sip:test1@sip.antisip.com -U test1 -P THISISTHEPASSWORD -t TLS -s --outbound "<sip:sip4.antisip.com;lr>"
sip_monitor[6496]: sip_monitor (5.1.3) up and running [testing on [TLS] REGISTER [sip:antisip.com] From: [sip:test1@antisip.com] Username: [test1:*****] Route: [<sip:sip4.antisip.com;lr>]
sip_monitor[6496]: [count=1] socket [sip4.antisip.com] [sock=11] [pos=0] connected
sip_monitor[6496]: [count=1] socket [sip4.antisip.com] [sock=11] [pos=0] connected (ssl in progress)
sip_monitor[6496]: [count=1] [TLS] invalid  depth[0] [/CN=antisip.com] [62:Hostname mismatch]
sip_monitor[6496]: [count=1] [ssl connect] error
sip_monitor[6496]: REGISTRATION REPORT:[FAILURE] [TLS][duration:1,391s] REGISTER [408][       ] err=[TLS] invalid  depth[0] [/CN=antisip.com] [62:Hostname mismatch]

"-v 6" option can be used to debug more. And other parameters for Contact, etc... By default, it's only fetching Contact.

About sip_reg.c: There is less options in general, but more option for Contact header manipulation

$> sip_reg -d -r sip:sip.antisip.com -u sip:test1@sip.antisip.com -U test1 -P THISISTHEPASSWORD -t TCP -s -e 180 -m

WIth "-d", it runs in foreground on console. Without "-d", it will fork and run for ever in background (if started correctly)

Unfortunatly, it do not provide much info in the syslog. Only this kind:
Oct  5 13:59:49 antisip sip_reg[8245]: sip_reg (5.1.3) up and running [testing on [TCP] REGISTER [sip:sip.antisip.com] Expires [180] From: [sip:test1@sip.antisip.com] Username: [test1:*****]]
Oct  5 13:59:49 antisip sip_reg[8245]: local port: 5060
Oct  5 13:59:49 antisip sip_reg[8245]: automasquerade enabled
Oct  5 13:59:50 antisip sip_reg[8245]: registrered successfully
Oct  5 13:59:50 antisip sip_reg[8245]: registrered successfully
Oct  5 13:59:50 antisip sip_reg[8245]: registrered successfully


Regards,
Aymeric

Le lun. 5 oct. 2020 à 13:30, Arsen Semenov <arsperger@gmail.com> a écrit :
Hi Aymeric,

Can you please send a link to git repo with this tool?


Thanks

On Sat, Oct 3, 2020 at 9:05 PM Aymeric Moizard <amoizard@gmail.com> wrote:
Hi,

In libeXosip, latest release or git, I have made a new tool named "sip_monitor".

The dependencies are libosip and c-ares.

The tool can build many REGISTER for any protocol (UDP, TCP, TLS) with many variant of request-uri, from and contact or TLS certificate.

It could be extended for more options.

The latest git has also a new outbound proxy setting to have a different request-uri.

Aymeric

Le sam. 3 oct. 2020 à 17:30, luke devon <luke_devon@yahoo.com> a écrit :
Hi Team, 

May I check with you, Is there a SIP message generator available for the Kamailio? I want to test my setup using some test SIP messages.

Many Thanks
Luke. 
_______________________________________________
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
_______________________________________________
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


--
Arsen Semenov

_______________________________________________
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


--
Antisip - http://www.antisip.com