How to send BYE instead of INVITE or change SDP parameters inside INVITE when MRCP Client receives a COMPLETE from MRCP server or disconnect the phone

154 views
Skip to first unread message

Debasish Chandra

unread,
Nov 28, 2009, 12:35:33 PM11/28/09
to UniMRCP
Dear All,

I am not able to change the SDP parameters or send a BYE instead of
INVITE, when my unimrcp client receives COMPLETE from MRCP server.

I am using loquendo7-mrcp2 for TTS & ASR.

Now when my unimrcp client try to remove channel or I hang up my phone
Freeswitch hang up or dies.

However I could recognise the problem, but unable to rectify as I am
very new to unimrcp and doesn’t know how to change any thing in the
code.

Please find the below scenario where freeswitch dies or hangs.


1) Unimrcp client send an offer (INVITE) to loquendo mrcp server.
v=0
o=FreeSWITCH 0 0 IN IP4 172.30.98.4
s=-
c=IN IP4 172.30.98.4
t=0 0
m=application 9 TCP/MRCPv2 1
a=setup:active
a=connection:new
a=resource:speechsynth
a=cmid:1
m=audio 4000 RTP/AVP 0 8 96
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:96 L16/8000
a=recvonly
a=mid:1
------------------------------------------------------------------------------------------------------------------
2) Mrcp client receives 200 OK.
v=0
o=MRCPv2Server 3468327130 3468327130 IN IP4 172.30.98.18
s=-
c=IN IP4 172.30.98.18
t=3468327130 0
m=application 51000 TCP/MRCPv2 1
a=channel:0613AB904B0FFA5A@speechsynth
a=connection:new
a=setup:passive
a=cmid:1
m=audio 10020 RTP/AVP 0
a=rtpmap:0 PCMU/8000
a=sendonly
a=mid:1
------------------------------------------------------------------------------------------------------------------
3) Mrcp client sends SPEAK

MRCP/2.0 208 SPEAK 1
Channel-Identifier: 0613AB904B0FFA5A@speechsynth
Voice-Name: kate
Content-Type: text/plain
Content-Length: 70

^[\rate=100\Welcome to the funline. First of all, let's select a
sound.
------------------------------------------------------------------------------------------------------------------
4) Mrcp client receives IN-PROGRESS (in my phone i can hear the
speech)

5) Mrcp client receives COMPLETE

6) Mrcp client now send another offer (INVITE) to remove the channel
or close the session from mrcp server

v=0
o=FreeSWITCH 0 0 IN IP4 172.30.98.4
s=-
c=IN IP4 172.30.98.4
t=0 0
m=application 0 TCP/MRCPv2 1
a=resource:speechsynth
a=cmid:1
m=audio 0 RTP/AVP 0
a=mid:1
----------------------------------------------------------------------------------------------------------------------

7) Mrcp client receives Internal Server Error from MRCP server (as
mrcp server doesn’t handle 0 port)

8) Now freeswitch hangs here, as MRCP client gives error while
stopping the channel.


Now, here I want to change that MRCP client send BYE after MRCP client
receives COMPLETER from MRCP server instead of INVITE (at point 6) to
terminate the session or change the SDP in INVITE (instead of setting
the port to 0) like following
v=0
o=FreeSWITCH 0 0 IN IP4 172.30.98.4
s=-
c=IN IP4 172.30.98.4
t=0 0
m=application 0 TCP/MRCPv2 1
a=resource:speechsynth
a=cmid:1
m=audio 4000 RTP/AVP 0 8 96
c=IN IP4 0.0.0.0
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:96 L16/8000

------------------------------------------------------------------------------------------------------------------------

If I disconnect the call or MRCP server send COMPLETE, in
mrcp_client_session.c function mrcp_app_request_dispatch executed,
which receives MRCP_SIG_COMMAND_CHANNEL_REMOVE and it calls
mrcp_client_channel_modify function. Can you please guide me how I can
change here to send BYE instead of sending INVITE, or at least SDP
parameters in the INVITE which MRCP server expects.



With Best Regards,
Debasish Chandra

cmri...@gmail.com

unread,
Nov 28, 2009, 12:55:02 PM11/28/09
to UniMRCP
Post a jira ticket (jira.freeswitch.org) for the freeswitch issue with a link to the pastebin (pastebin.freeswitch.org) of your detailed logs.  I can resolve the hang issue.

I don't know much about MRCPv2, so arsen will have to chime in about the channel removal issue.
--

You received this message because you are subscribed to the Google Groups "UniMRCP" group.
To post to this group, send email to uni...@googlegroups.com.
To unsubscribe from this group, send email to unimrcp+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/unimrcp?hl=en.




Arsen Chaloyan

unread,
Nov 28, 2009, 2:48:14 PM11/28/09
to uni...@googlegroups.com
Debasish,

Thanks for the issue report.
It seems Loquendo doesn't support re-Invites. From other side, neither
UniMRCP client stack nor FreeSWITCH should crash whatever server
responds with. Looking at the code, I see it should be easy enough to
fix.


Chris,

Actually, channel removal is an optional procedure. I included it in
the client application to show such an operation exists. It's not
necessary to remove channel first. Instead, you can and probably
should terminate session immediately.
So basically instead of
mrcp_application_channel_remove(schannel->unimrcp_session,
schannel->unimrcp_channel);
call
mrcp_application_session_terminate(schannel->unimrcp_session);

BTW, reading your posts, I feel '/b' should appear somewhere at the
end, but no... it's just feeling. Anyway, say hello to Brian :)
Cheers
--
Arsen Chaloyan
The author of UniMRCP
http://www.unimrcp.org

cmri...@gmail.com

unread,
Nov 28, 2009, 4:34:19 PM11/28/09
to uni...@googlegroups.com
Debasish,

I'm on vacation until Tuesday, so I probably won't have it fixed until then.

Arsen,

Thanks for the tip; I'll try that fix.

Debasish Chandra

unread,
Nov 29, 2009, 8:21:49 AM11/29/09
to UniMRCP
Thanks a lot cmrienzo. Appriciate your quick response.

BR,
Debasish
> ---------------------------------------------------------------------------­---------------------------------------
> 2)      Mrcp client receives 200 OK.
> v=0
> o=MRCPv2Server 3468327130 3468327130 IN IP4 172.30.98.18
> s=-
> c=IN IP4 172.30.98.18
> t=3468327130 0
> m=application 51000 TCP/MRCPv2 1
> a=channel:0613AB904B0FFA5A@speechsynth
> a=connection:new
> a=setup:passive
> a=cmid:1
> m=audio 10020 RTP/AVP 0
> a=rtpmap:0 PCMU/8000
> a=sendonly
> a=mid:1
> ---------------------------------------------------------------------------­---------------------------------------
> 3)      Mrcp client sends SPEAK
>
> MRCP/2.0 208 SPEAK 1
> Channel-Identifier: 0613AB904B0FFA5A@speechsynth
> Voice-Name: kate
> Content-Type: text/plain
> Content-Length: 70
>
> ^[\rate=100\Welcome to the funline. First of all, let's select a
> sound.
> ---------------------------------------------------------------------------­---------------------------------------
> 4)      Mrcp client receives IN-PROGRESS (in my phone i can hear the
> speech)
>
> 5)      Mrcp client receives COMPLETE
>
> 6)      Mrcp client now send another offer (INVITE) to remove the channel
> or close the session from mrcp server
>
> v=0
> o=FreeSWITCH 0 0 IN IP4 172.30.98.4
> s=-
> c=IN IP4 172.30.98.4
> t=0 0
> m=application 0 TCP/MRCPv2 1
> a=resource:speechsynth
> a=cmid:1
> m=audio 0 RTP/AVP 0
> a=mid:1
> ---------------------------------------------------------------------------­-------------------------------------------
>
> 7)      Mrcp client receives Internal Server Error from MRCP server (as
> mrcp server doesn’t handle 0 port)
>
> 8)      Now freeswitch hangs here, as MRCP client gives error while
> stopping the channel.
>
> Now, here I want to change that MRCP client send BYE after MRCP client
> receives COMPLETER from MRCP server instead of INVITE (at point 6) to
> terminate the session or change the SDP in INVITE (instead of setting
> the port to 0) like following
> v=0
> o=FreeSWITCH 0 0 IN IP4 172.30.98.4
> s=-
> c=IN IP4 172.30.98.4
> t=0 0
> m=application 0 TCP/MRCPv2 1
> a=resource:speechsynth
> a=cmid:1
> m=audio 4000 RTP/AVP 0 8 96
> c=IN IP4 0.0.0.0
> a=rtpmap:0 PCMU/8000
> a=rtpmap:8 PCMA/8000
> a=rtpmap:96 L16/8000
>
> ---------------------------------------------------------------------------­---------------------------------------------

Debasish Chandra

unread,
Nov 29, 2009, 8:34:42 AM11/29/09
to UniMRCP
Dear Arsen,

MNany thanks a lot for your help.
I'll try with terminating the channel instead of modifying it and let
you know whether it works.

Also loquendo does supports re-Invite but doesn't handle 0 port.
Release the audio inserting the 'c=IN IP4 0.0.0.0' line (instead of
setting the port to '0'); here an example of SDP:

v=0
o=FreeSWITCH 2478373678861735015 4062797247706338477 IN IP4
172.30.98.4
s=-
c=IN IP4 172.30.98.4
t=0 0
m=application 0 TCP/MRCPv2 1
a=resource:speechsynth
a=cmid:1
m=audio 4000 RTP/AVP 0 8 96
c=IN IP4 0.0.0.0
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:96 L16/8000
--------------------------------------------------------------------------
Can you please tell me how I can change SDP when modifying the
channel.


Thanks again for your help.

Best Regards,
Debasish
> > ---------------------------------------------------------------------------­---------------------------------------
> > 2) Mrcp client receives 200 OK.
> > v=0
> > o=MRCPv2Server 3468327130 3468327130 IN IP4 172.30.98.18
> > s=-
> > c=IN IP4 172.30.98.18
> > t=3468327130 0
> > m=application 51000 TCP/MRCPv2 1
> > a=channel:0613AB904B0FFA5A@speechsynth
> > a=connection:new
> > a=setup:passive
> > a=cmid:1
> > m=audio 10020 RTP/AVP 0
> > a=rtpmap:0 PCMU/8000
> > a=sendonly
> > a=mid:1
> > ---------------------------------------------------------------------------­---------------------------------------
> > 3) Mrcp client sends SPEAK
>
> > MRCP/2.0 208 SPEAK 1
> > Channel-Identifier: 0613AB904B0FFA5A@speechsynth
> > Voice-Name: kate
> > Content-Type: text/plain
> > Content-Length: 70
>
> > ^[\rate=100\Welcome to the funline. First of all, let's select a
> > sound.
> > ---------------------------------------------------------------------------­---------------------------------------
> > 4) Mrcp client receives IN-PROGRESS (in my phone i can hear the
> > speech)
>
> > 5) Mrcp client receives COMPLETE
>
> > 6) Mrcp client now send another offer (INVITE) to remove the channel
> > or close the session from mrcp server
>
> > v=0
> > o=FreeSWITCH 0 0 IN IP4 172.30.98.4
> > s=-
> > c=IN IP4 172.30.98.4
> > t=0 0
> > m=application 0 TCP/MRCPv2 1
> > a=resource:speechsynth
> > a=cmid:1
> > m=audio 0 RTP/AVP 0
> > a=mid:1
> > ---------------------------------------------------------------------------­-------------------------------------------
>
> > 7) Mrcp client receives Internal Server Error from MRCP server (as
> > mrcp server doesn’t handle 0 port)
>
> > 8) Now freeswitch hangs here, as MRCP client gives error while
> > stopping the channel.
>
> > Now, here I want to change that MRCP client send BYE after MRCP client
> > receives COMPLETER from MRCP server instead of INVITE (at point 6) to
> > terminate the session or change the SDP in INVITE (instead of setting
> > the port to 0) like following
> > v=0
> > o=FreeSWITCH 0 0 IN IP4 172.30.98.4
> > s=-
> > c=IN IP4 172.30.98.4
> > t=0 0
> > m=application 0 TCP/MRCPv2 1
> > a=resource:speechsynth
> > a=cmid:1
> > m=audio 4000 RTP/AVP 0 8 96
> > c=IN IP4 0.0.0.0
> > a=rtpmap:0 PCMU/8000
> > a=rtpmap:8 PCMA/8000
> > a=rtpmap:96 L16/8000
>
> > ---------------------------------------------------------------------------­---------------------------------------------
> The author of UniMRCPhttp://www.unimrcp.org- Hide quoted text -
>
> - Show quoted text -

Arsen Chaloyan

unread,
Nov 30, 2009, 2:59:28 AM11/30/09
to uni...@googlegroups.com
Debasish,

> Thanks a lot cmrienzo. Appriciate your quick response.

I think, probably you may show better appreciation by submitting a
jira ticket as requested.
And see my further comments below.

On Sun, Nov 29, 2009 at 5:34 PM, Debasish Chandra
<debasish...@gmail.com> wrote:
> Dear Arsen,
>
> MNany thanks a lot for your help.
> I'll try with terminating the channel instead of modifying it and let
> you know whether it works.

Well.
>
> Also loquendo does supports re-Invite but doesn't handle 0 port.
> Release the audio inserting the 'c=IN IP4 0.0.0.0' line (instead of
> setting the port to '0'); here an example of SDP:

MRCP specification relies on offer/answer model RFC3264 defines.
See the following section on how a media stream should be removed.
http://tools.ietf.org/html/rfc3264#section-8.2

Currently this is the only option UniMRCP supports.
I don't know why Loquendo accepts only 'c=IN IP4 0.0.0.0', which seems
to be outdated method to me.
Anyway, I'm not going to debate over here, my position remains in tact,
UniMRCP should support every possible, reliable and more or less
reasonable options.

>
> v=0
> o=FreeSWITCH 2478373678861735015 4062797247706338477 IN IP4
> 172.30.98.4
> s=-
> c=IN IP4 172.30.98.4
> t=0 0
> m=application 0 TCP/MRCPv2 1
> a=resource:speechsynth
> a=cmid:1
> m=audio 4000 RTP/AVP 0 8 96
> c=IN IP4 0.0.0.0
> a=rtpmap:0 PCMU/8000
> a=rtpmap:8 PCMA/8000
> a=rtpmap:96 L16/8000
> --------------------------------------------------------------------------
> Can you please tell me how I can change SDP when modifying the
> channel.

You can easily achieve that behavior modifying
sdp_rtp_media_generate() function in mrcp_sdp.c.
Construct an SDP string you need based on audio_media->state ==
MPF_MEDIA_ENABLED

Please try to figure out how to implement this yourself and submit an
issue at this time to
http://code.google.com/p/unimrcp/issues/ with patch if available.
Anyway, there should be a configurable option to alter this behavior
in the future.

Thanks.

Chris Rienzo

unread,
Dec 1, 2009, 10:04:47 AM12/1/09
to UniMRCP
Debasish,

Change to mod_unimrcp has been committed to the FreeSWITCH trunk to
send BYE instead of removing the channel. I still have to fix the
hang issue at some point.



On Nov 30, 2:59 am, Arsen Chaloyan <achalo...@gmail.com> wrote:
> Debasish,
>
> > Thanks a lot cmrienzo. Appriciate your quick response.
>
> I think, probably you may show better appreciation by submitting a
> jira ticket as requested.
> And see my further comments below.
>
> On Sun, Nov 29, 2009 at 5:34 PM, Debasish Chandra
>
> <debasish.chan...@gmail.com> wrote:
> > Dear Arsen,
>
> > MNany thanks a lot for your help.
> > I'll try with terminating the channel instead of modifying it and let
> > you know whether it works.
>
> Well.
>
>
>
> > Also loquendo does supports re-Invite but doesn't handle 0 port.
> > Release the audio inserting the 'c=IN IP4 0.0.0.0' line (instead of
> > setting the port to '0'); here an example of SDP:
>
> MRCP specification relies on offer/answer model RFC3264 defines.
> See the following section on how a media stream should be removed.http://tools.ietf.org/html/rfc3264#section-8.2
> issue at this time tohttp://code.google.com/p/unimrcp/issues/with patch if available.
> >> The author of UniMRCPhttp://www.unimrcp.org-Hide quoted text -
>
> >> - Show quoted text -
>
> > --
>
> > You received this message because you are subscribed to the Google Groups "UniMRCP" group.
> > To post to this group, send email to uni...@googlegroups.com.
> > To unsubscribe from this group, send email to unimrcp+u...@googlegroups.com.
> > For more options, visit this group athttp://groups.google.com/group/unimrcp?hl=en.
Reply all
Reply to author
Forward
0 new messages