Call Us Today! 877.742.2583




Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Re-format sendmsg

...


Code Block
sendevent <event-name>

For MWI you make the FreeSWITCH event SWITCH_EVENT_MESSAGE_WAITING with headers:

MWI-Messages-Waiting (yes/no)
MWI-Message-Account <any sip url you want>
MWI-Voice-Message x/y (a/b)
read/unread (urgent read/urgent unread)

...

Code Block
sendevent SEND_INFO
profile: external
content-type: text/plain
to-uri: sip:1@2.3.4.5
from-uri: sip:1@1.2.3.4
content-length: 15

test

0. sendmsg

Code Block
titleUsage
sendmsg <uuid>

...

originate a call directly to park by making an ext the ext part of the originate command &park()IMPORTANT!

Note

All sendmsg commands must be followed by 2 returns.

Since messaging format is similar

...

to RFC 2822, if you are using any libraries that follow the line wrapping recommendation of RFC 2822 then make sure that you disable line wrapping as

...

FreeSWITCH will ignore wrapped lines. See "FreeSWITCH EventSocket header length" post for more.


Code Block
titleExample
sendmsg <uuid>
call-command: execute
execute-app-name: playback
execute-app-arg: /tmp/test.wav

call-command

The first command is Call-Command, it can do one of the following subcommands:

execute

...

0.1. Commands

0.1.1. execute

execute is used to execute dialplan applications. Check the Dialplan XML section for more information about all commands XML Dialplan and mod_dptools pages for available applications.

The format should be:

Code Block
titleExecute format
sendmsg <uuid>
call-command: execute
execute-app-name: <one of the applications>
execute-app-arg: <application data>
loops: <number of times to invoke the command, default: 1>

...

Code Block
sendmsg <uuid>
call-command: execute
execute-app-name: <one of the applications>
loops: <number of times to invoke the command, default: 1>
content-type: text/plain
content-length: <content length>

<application data>

If you would like to correlate the When an application is executed via sendmsg, CHANNEL_EXECUTE and CHANNEL_EXECUTE_COMPLETE events that are generated when the command you send using sendmsg is executed you can add going to be generated. If you would like to correlate these two events then add an Event-UUID header with a your custom UUID you specify. In the corresponding events, the UUID will be in the Application-UUID header. If you do not specify an Event-UUID, Freeswitch will automatically generate a UUID for the Application-UUID.

Example:

Event-UUID: 22075ce5-b67b-4f04-a6dd-1726ec14c8bf
0.1.2. hangup

Hangup Hang up the call.

Code Block
titleFormat
sendmsg <uuid>
call-command: hangup
hangup-cause: <one of the causes listed below>

Additional information

0.1.3. unicast

Unicast unicast is used to hook up spandsp for faxing over a socket.

Additional information from Brian:

Panel
borderColor#ddd
bgColor#eee
borderWidth1
titleBGColor#ccc
borderStylesolid
titleBrian's note
"

That is a nice way for a script or app that uses the socket interface to get at the media. It's good because then spandsp isn't living inside of FreeSWITCH and it can run on a box sitting next to it. It scales better.

"


Code Block
titleunicast example
sendmsg <uuid>
call-command: unicast
local-ip: <default is 127.0.0.1>
local-port: <default is 8025>
remote-ip: <default is 127.0.0.1>
remote-port: <default is 8026>
transport: <either "tcp" or "udp", without the quotes>
and optionally
flags: native - don't transcode audio to/from L16

...

0.1.4. noTmedia

No description.

Code Block
sendmsg <uuid>
call-command: nomedia
nomedia-uuid: <noinfo>


Note
titleUndocumented commands

Status
colourYellow
titleTODO

From Stéphane Alnet's comment:

The description is missing `xferext`, which adds `application` to an extension then transfer the channel to that extension (whatever that means! (big grin) ).

From switch_ivr.c:503:

Code Block
languagecpp
	unsigned long CMD_EXECUTE = switch_hashfunc_default("execute", &hlen);
	unsigned long CMD_HANGUP = switch_hashfunc_default("hangup", &hlen);
	unsigned long CMD_NOMEDIA = switch_hashfunc_default("nomedia", &hlen);
	unsigned long CMD_UNICAST = switch_hashfunc_default("unicast", &hlen);
	unsigned long CMD_XFEREXT = switch_hashfunc_default("xferext", &hlen);


exit


Code Block
exit

Close the socket connection.

...