[Freeswitch-users] esl socket inbound + playback

Callum Guy callum.guy at x-on.co.uk
Tue Oct 8 18:29:07 MSD 2013


You are using inbound sockets so you need to tell the system the UUID of
the call you wish to execute the application on.

See:

[pid 32635] recv(6, "Content-Type: command/reply\nReply-Text: -ERR invalid
session id []\n\n", 65535, 0) = 68

You are missing a parameter.

Message should be:
SendMsg 2b06b28a-3018-11e3-959e-8b8d1e220731
call-command: execute
execute-app-name: playback
execute-app-arg: e.wav
event-lock: true

Does that help?


______________________________

Callum Guy
Developer

X-on
Framlingham Technology Centre
Station Road, Framlingham,
Suffolk, IP13 9EZ

T       0333 332 0116
E       callum.guy at x-on.co.uk


X-on is a trading name of Storacall Technology Ltd a limited company
registered in England and Wales
Registered Office : Avaland House, 110 London Road, Apsley, Hemel
Hempstead, Herts, HP3 9SD
Company Registration No. 2578478

This email has been sent from X-on.The contents and attachments are
confidential to the sender and the intended addressees.If the message
is received by anyone other than the addressee please return the
message to the sender by replying to it and then delete the message
from
your computer without copying or disclosing the contents to
anyone.Opinions, conclusions and statements of intent in this email
are those of
the sender and do not bind X-on unless confirmed by authorised
representatives independently of this message.While best endeavours
have
been taken to avoid transmission of viruses, it is the responsibility
of the recipient to scan for these.Please note emails sent to and from
X-on
are routinely monitored for record keeping and quality control, to
ensure regulatory compliance and prevent unauthorised use of our
systems.
Please consider the environment before printing this email.



On 8 October 2013 14:06, Marcin S <ms4esl at gmail.com> wrote:

> Some more info, output from strace:
>
> create_uid/filter/myevents/event - all OK
>
> [pid 32639] recv(6, "Content-Type: auth/request\n\n", 65535, 0) = 28
> [pid 32639] send(6, "auth ClueCon\n\n", 14, 0) = 14
> [pid 32639] recv(6, "Content-Type: command/reply\nReply-Text: +OK
> accepted\n\n", 65535, 0) = 54
> [pid 32639] send(6, "api create_uuid", 15, 0) = 15
> [pid 32639] send(6, "\n\n", 2, 0)       = 2
> [pid 32639] recv(6, "Content-Type: api/response\nContent-Length: 36\n\n",
> 65535, 0) = 47
> [pid 32639] recv(6, "67b9c26c-3018-11e3-87c1-311d1641c437", 65535, 0) = 36
> [pid 32639] send(6, "filter unique-id
> 67b9c26c-3018-11e3-87c1-311d1641c437\n\n", 55, 0) = 55
> [pid 32639] recv(6, "Content-Type: command/reply\nReply-Text: +OK filter
> added. [unique-id]=[67b9c26c-3018-11e3-87c1-311d1641c437]\n\n", 65535, 0) =
> 110
> [pid 32639] send(6, "myevents 67b9c26c-3018-11e3-87c1-311d1641c437", 45,
> 0) = 45
> [pid 32639] send(6, "\n\n", 2, 0)       = 2
> [pid 32639] recv(6, "Content-Type: command/reply\nReply-Text: +OK Events
> Enabled\n\n", 65535, 0) = 60
> [pid 32639] send(6, "event plain ALL\n\n", 17, 0) = 17
> [pid 32639] recv(6, "Content-Type: command/reply\nReply-Text: +OK event
> listener enabled plain\n\n", 65535, 0) = 74
>
>
> linger fails:
> [pid 32639] send(6, "linger", 6, 0)     = 6
> [pid 32639] send(6, "\n\n", 2, 0)       = 2
> [pid 32639] recv(6, "Content-Type: command/reply\nReply-Text: -ERR not
> controlling a session\n\n", 65535, 0) = 72
>
>
> originate - OK
> [pid 32635] send(6, "api originate
> {origination_uuid=67b9c26c-3018-11e3-87c1-311d1641c437}sofia/gateway/aster/473
> &park", 98, 0) = 98
> [pid 32635] send(6, "\n\n", 2, 0)       = 2
> [pid 32635] recv(6, "Content-Type: api/response\nContent-Length: 41\n\n",
> 65535, 0) = 47
> [pid 32635] recv(6, "+OK 67b9c26c-3018-11e3-87c1-311d1641c437\n", 65535,
> 0) = 41
>
>
> After CHANNEL_ANSWER there is a call to "playback"
>
> [pid 32635] send(6, "sendmsg\ncall-command: execute\nexecute-app-name:
> playback\nexecute-app-arg:
> /usrCC/CC/scenariusze/ScenTest-test/play/POLSKI/EWA//menu.wav\n\n", 137, 0)
> = 137
> [pid 32635] recv(6, "Content-Type: command/reply\nReply-Text: -ERR invalid
> session id []\n\n", 65535, 0) = 68
> [pid 32639] recv(6, "Content-Length: 1925\nContent-Type:
> text/event-plain\n\n", 65535, 0) = 53
> [pid 32639] recv(6, "Event-Name: CHANNEL_CALLSTATE\nCore-UUID:
> 00fda624-2a7d-11e3-b4b2-311d1641c437\nFreeSWITCH-Hostname:
> fs-devel.altar\nFreeSWITCH-Switchname: fs-devel.altar\nFreeSWITCH-IPv4:
> 192.168.2.44\nFreeSWITCH-IPv6: %3A%3A1\nEvent-Date-Local:
> 2013-10-08%2014%3A52%3A53\nEvent-Date-GMT:
> Tue,%2008%20Oct%202013%2012%3A52%3A53%20GMT\nEvent-Date-Timestamp:
> 1381236773305888\nEvent-Calling-File:
> switch_channel.c\nEvent-Calling-Function:
> switch_channel_perform_set_callstate\nEvent-Calling-Line-Number:
> 242\nEvent-Sequence: 274033\nOriginal-Channel-Call-State:
> ACTIVE\nChannel-Call-State-Number: 6\nChannel-State:
> CS_EXECUTE\nChannel-Call-State: HANGUP\nChannel-State-Number:
> 10\nChannel-Name: sofia/external/473\nUnique-ID:
> 67b9c26c-3018-11e3-87c1-311d1641c437\nCall-Direction:
> outbound\nPresence-Call-Direction: outbound\nChannel-HIT-Dialplan:
> true\nChannel-Call-UUID:
> 67b9c26c-3018-11e3-87c1-311d1641c437\nAnswer-State:
> hangup\nChannel-Read-Codec-Name: PCMA\nChannel-Read-Codec-Rate:
> 8000\nChannel-Read-Codec-Bit-Rate: 64000\nChannel-Write-Codec-Name:
> PCMA\nChannel-Write-Codec-Rate: 8000\nChannel-Write-Codec-Bit-Rate:
> 64000\nCaller-Direction: outbound\nCaller-Caller-ID-Name:
> Outbound%20Call\nCaller-Caller-ID-Number: 473\nCaller-Network-Addr:
> 192.168.2.97\nCaller-Destination-Number: 473\nCaller-Unique-ID:
> 67b9c26c-3018-11e3-87c1-311d1641c437\nCaller-Source:
> src/switch_ivr_originate.c\nCaller-Context: default\nCaller-Channel-Name:
> sofia/external/473\nCaller-Profile-Index: 1\nCaller-Profile-Created-Time:
> 1381236712904967\nCaller-Channel-Created-Time:
> 1381236712904967\nCaller-Channel-Answered-Time:
> 1381236723045094\nCaller-Channel-Progress-Time:
> 1381236712904967\nCaller-Channel-Progress-Media-Time:
> 0\nCaller-Channel-Hangup-Time: 0\nCaller-Channel-Transfer-Time:
> 0\nCaller-Channel-Resurrect-Time: 0\nCaller-Channel-Bridged-Time:
> 0\nCaller-Channel-Last-Hold: 0\nCaller-Channel-Hold-Accum:
> 0\nCaller-Screen-Bit: true\nCaller-Privacy-Hide-Name:
> false\nCaller-Privacy-Hide-Number: false\n\n", 65535, 0) = 1925
>
> How can I control the session in the same way as with socket outbound?
>
>
>
>
>
>
>
>
>
>
>
>
>
> 2013/10/8 Marcin S <ms4esl at gmail.com>
>
>> Hello,
>>
>> I wrote simple C application, wich opens connection to esl - freeswitch
>> and makes call (originate ... &park). So far so good. I get
>> ESL_EVENT_CHANNEL_ORIGINATE, ESL_EVENT_CHANNEL_ANSWER and
>> ESL_EVENT_CHANNEL_PARK. Then I wan't to play wav file - but playback
>> command returns "-ERR invalid session id []". What is wrong?
>>
>> Specifying "originate ... &playback" is out of question.
>>
>>
>
> _________________________________________________________________________
> Professional FreeSWITCH Consulting Services:
> consulting at freeswitch.org
> http://www.freeswitchsolutions.com
>
> 
> 
>
> Official FreeSWITCH Sites
> http://www.freeswitch.org
> http://wiki.freeswitch.org
> http://www.cluecon.com
>
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20131008/e0a0edcd/attachment.html 


Join us at ClueCon 2013 Aug 6-8, 2013
More information about the FreeSWITCH-users mailing list