[Freeswitch-users] Inbound Event_Socket SendMsg problems
Anthony Knight
tntknight at gmail.com
Fri Jul 18 13:41:01 EDT 2008
Hi
I am having problems using a PHP client (hack using intralanman fs_sock.php)
Using the dialplan I send the call to PARK. When I get the
CHANNEL_PARK event if I issue:
"bgapi uuid_broadcast $uuid /usr/local/freeswitch/socketcode/test.wav\r\n\r\n"
(where I grab uuid from unique-id in CHANNEL_PARK event) I get the
prompt to play back to me.
HOWEVER the following scenarios with SendMsg do not work.
If I send
"SendMsg 60152374-54ec-11dd-8b83-5bb61f67b40f
call_comand: execute
execute-app-name: playback
execute-app-arg: /usr/local/freeswitch/socketcode/test.wav\r\n\r\n"
The reply back is
[Content-Type] => command/reply
[Reply-Text] => -ERR invalid session id
[60152374-54ec-11dd-8b83-5bb61f67b40f
[call_comand] => execute
[execute-app-name] => playback
[execute-app-arg] => /usr/local/freeswitch/socketcode/test.wav]
>From the code, this looks like the uuid is not being seperated from
the rest of the message when it is being read uuid is within the []?
If I add explicit newlines at the end of each line
"SendMsg 60152374-54ec-11dd-8b83-5bb61f67b40f\n
call_comand: execute\n
execute-app-name: playback\n
execute-app-arg: /usr/local/freeswitch/socketcode/test.wav\r\n\r\n"
I get back
[Content-Type] => command/reply
[Reply-Text] => +OK
and slightly later a PRIVATE_COMMAND event,
[Command] => SendMsg d4bb10c6-54ec-11dd-8b83-5bb61f67b40f
[Event-Name] => PRIVATE_COMMAND
[Core-UUID] => 8f70f40c-5480-11dd-8b83-5bb61f67b40f
[FreeSWITCH-Hostname] => standcanada.tknights.com
[FreeSWITCH-IPv4] => 72.249.85.158
[FreeSWITCH-IPv6] => 127.0.0.1
[Event-Date-Local] => 2008-07-18 17:13:24
[Event-Date-GMT] => Fri, 18 Jul 2008 17:13:24 GMT
[Event-Date-timestamp] => 1216401204843801
[Event-Calling-File] => switch_ivr.c
[Event-Calling-Function] => switch_ivr_parse_next_event
[Event-Calling-Line-Number] => 460
and in freeswitch.log I see
2008-07-18 17:13:24 [DEBUG] switch_core_state_machine.c:140
switch_core_standard_on_execute()
sofia/default/1008 at freeswitch.tknights.com Execute park()
2008-07-18 17:13:24 [DEBUG] switch_core_session.c:611
switch_core_session_queue_private_event() Kill
sofia/default/1008 at freeswitch.tknights.com [BREAK]
2008-07-18 17:13:24 [ERR] switch_ivr.c:309 switch_ivr_parse_event()
Invalid Command!
2008-07-18 17:13:24 [DEBUG] sofia.c:2048 sofia_handle_sip_i_state()
Channel sofia/default/1008 at freeswitch.tknights.com entering state
[ready]
2008-07-18 17:13:35 [DEBUG] sofia.c:2048 sofia_handle_sip_i_state()
Channel sofia/default/1008 at freeswitch.tknights.com entering state
[terminated]
which I think means it is not parsing out the "execute"
any suggestions on what I'm doing wrong?
I'm on Debian Etch, trunk 9072
Thanks
Tony
More information about the Freeswitch-users
mailing list