Project

General

Profile

Actions

Sip message » History » Revision 4

« Previous | Revision 4/15 (diff) | Next »
Adrian Georgescu, 11/06/2008 02:45 PM


= sip_message =

To use this script you must to have a valid [wiki:configuration_file configuration file].

Description

Source code: [source:scripts/sip_message.py scripts/sip_message.py]

{{{
Usage: sip_message [options] []

This will either sit idle waiting for an incoming MESSAGE request, or send a
MESSAGE request to the specified SIP target. In outgoing mode the program will
read the contents of the messages to be sent from standard input, Ctrl+D
signalling EOF as usual. In listen mode the program will quit when Ctrl+D is
pressed.

Options:
-h, --help show this help message and exit
-a ACCOUNT_NAME, --account-name=ACCOUNT_NAME
The account name from which to read account settings.
Corresponds to section Account_NAME in the
configuration file.
--sip-address=SIP_ADDRESS
SIP login account
-p PASSWORD, --password=PASSWORD
Password to use to authenticate the local account.
This overrides the setting from the config file.
-n DISPLAY_NAME, --display-name=DISPLAY_NAME
Display name to use for the local account. This
overrides the setting from the config file.
-o IP[:PORT], --outbound-proxy=IP[:PORT]
Outbound SIP proxy to use. By default a lookup is
performed based on SRV and A records. This overrides
the setting from the config file.
-s, --trace-sip Dump the raw contents of incoming and outgoing SIP
messages (disabled by default).
-m MESSAGE, --message=MESSAGE
Contents of the message to send. This disables reading
the message from standard input.
-l, --log-pjsip Print PJSIP logging output (disabled by default).
}}}

Example for receiving a message

{{{
adigeo@ag-imac3:~$sip_message
Accounts available: 'alice', 'ew', 'mrg', 'pbx', 'tf', 'umts', 'unet', default
Using default account:
Registering ""Adrian G." <sip:>" at 81.23.228.150:5060
REGISTER was successful
Contact: <sip::51408> (expires in 300 seconds)
Other registered contacts:
<sip::5062;line=634g6j67> (expires in 480 seconds)
<sip::51375> (expires in 95 seconds)
<sip::5060> (expires in 77 seconds)
<sip:;uniq=5B2860C44383A3D6705629A7E1FB8> (expires in 1563 seconds)
<sip::61578> (expires in 3069 seconds)
Press Ctrl+D to stop the program.
Received MESSAGE from ""Adi UMTS" <sip:>", Content-Type: text/plain
dsgsgddsgs
Received MESSAGE from ""Adi UMTS" <sip:>", Content-Type: text/plain
Testing short text messages in page mode!
}}}

=== Example for sending a message ===

{{{
adigeo@ag-imac3:~$sip_message -a umts
Accounts available: 'alice', 'ew', 'mrg', 'pbx', 'tf', 'umts', 'unet', default
Using account 'umts':
Press Ctrl+D on an empty line to end input and send the MESSAGE request.
dsgsgddsgs
Sending MESSAGE from ""Adi UMTS" <sip:>" to "<sip:>" using proxy 81.23.228.150:5060
MESSAGE was accepted by remote party.
adigeo@ag-imac3:~$sip_message -a umts
Accounts available: 'alice', 'ew', 'mrg', 'pbx', 'tf', 'umts', 'unet', default
Using account 'umts':
Press Ctrl+D on an empty line to end input and send the MESSAGE request.
Testing short text messages in page mode!
Sending MESSAGE from ""Adi UMTS" <sip:>" to "<sip:>" using proxy 81.23.228.150:5060
MESSAGE was accepted by remote party.
}}}

Updated by Adrian Georgescu about 16 years ago · 4 revisions