andrenatal / unimrcp

Automatically exported from code.google.com/p/unimrcp
Apache License 2.0
0 stars 0 forks source link

SIP BYE not send on session terminate required for Nuance Speech Server 5.1.1 #70

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
UniMRCP: 0.10.0 (SVN revision: 1456)
APR: 1.3.8 (unimrcp-deps-0.9.0 package)
APR-Util: 1.3.9 (unimrcp-deps-0.9.0 package)
Sofia-SIP: 1.2.10 (unimrcp-deps-0.9.0 package)
MRCP server: Nuance Speech Server 5.1.1, Nuance Recognizer 9.0.3

Problem:
From the UMC example client application, executing "recog recog nss2"
multiple times after one another in quick succession leads to Nuance Speech
Server running out of end pointing licenses. The client then receives
"Receive SIP Event [nua_r_invite] Status 503 Service Unavailable" and
recognition thus fails. After waiting a minute or so, the end pointers are
release automatically by Nuance and can be used again. This is a problem
for "fast" recognition sessions. The example Nuance Speech Server MRCP
client does not have this problem.

Potential cause:
Nuance requires a "SIP BYE" to be sent, which, it seems, that UniMRCP
doesn't send. This probably causes Nuance not to release the end pointer
resource, leading to a license limit to be reached quickly.

Potential resolution:
When doing a "mrcp_application_session_terminate", send a "SIP BYE" from
the UniMRCP stack.

Attachments:
umc_trace.txt - The trace from running /usr/local/unimrcp/bin/umc.
unimrcpclient.xml - /usr/local/unimrcp/conf/unimrcpclient.xml
umcscenarios.xml - /usr/local/unimrcp/conf/umcscenarios.xml
nuance.xml - /usr/local/unimrcp/conf/client-profiles/nuance.xml
unimrcp.xml - /usr/local/unimrcp/conf/client-profiles/unimrcp.xml
nss.log - /usr/local/Nuance/Speech_Server/server/logs/nss.log
demo.mrcp - /usr/local/Nuance/Speech_Server/client/scripts/demo.mrcp
nss_client_trace.txt - The trace from the example Nuance MRCP client, by
running "cd /usr/local/Nuance/Speech_Server/client/scripts; ../bin/client
demo.mrcp".

Kind regards,
Derik

Original issue reported on code.google.com by thirion...@gmail.com on 24 Feb 2010 at 10:38

Attachments:

GoogleCodeExporter commented 9 years ago
I see from the unimrcp-client source in demo_recog_application.c:

/*
 * Demo recognizer scenario.
 * C -> S: SIP INVITE or RTPS SETUP   (add recognizer channel)
 * S -> C: SIP OK or RTPS OK
 * C -> S: MRCP RECOGNIZE
 * S -> C: MRCP IN-PROGRESS
 * C -> S: RTP Start Transmission
 * S -> C: MRCP START-OF-INPUT
 * S -> C: MRCP RECOGNITION-COMPLETE
 * C -> S: RTP Stop Transmission
 * C -> S: SIP INVITE or RTPS SETUP   (optionally remove recognizer channel)
 * S -> C: SIP OK or RTPS OK
 * C -> S: SIP BYE or RTPS TEARDOWN
 * S -> C: SIP OK or RTPS OK
 */

But not sure exactly why this then happens...

Original comment by thirion...@gmail.com on 24 Feb 2010 at 10:53

GoogleCodeExporter commented 9 years ago
For the Nuance client, I see:

C -> S: SIP REQUEST: INVITE
S -> C: SIP STATUS: OK
C -> S: SIP REQUEST: ACK
S -> C: ACK
C -> S: SIP BYE
S -> C: SIP STATUS: OK

For the UMC client, I see:
C -> S: SIP REQUEST: INVITE
S -> C: SIP STATUS: OK
S -> C: SIP STATUS: OK
S -> C: SIP STATUS: OK
S -> C: SIP STATUS: OK

See the attached wireshark traces.

Original comment by thirion...@gmail.com on 24 Feb 2010 at 11:35

Attachments:

GoogleCodeExporter commented 9 years ago
Hi Derik,

I'd say SIP BYE is required not only for Nuance and generally UniMRCP/Sofia-SIP 
does
send it to terminate session.

However, it seems I know what is going there.
Looking at the umc console output and network trace you attached, I see
nta(0xb42071a0): responding 503 DNS Error to ACK!

which is actually an error condition in Sofia's transaction layer.

Typical SIP session establishment message flow is:
C->S: INVITE
S->C: OK
C->S: ACK

However, in your case, the following happened
C->S: INVITE
S->C: OK
nta(0xb42071a0): responding 503 DNS Error to ACK!

Sofia couldn't resolve hostname in SIP OK message, therefore didn't send ACK.
Nuance didn't receive ACK, therefore continued to send (retransmit) SIP OK with
certain timeouts
S->C: OK
nta(0xb42071a0): responding 503 DNS Error to ACK!

Sooner or later this session will be abnormally terminated and there couldn't 
be any
SIP BYE for this particular case.

You should either "help" Sofia to resolve the hostname (I'm not sure what 
Nuance set
in contacts) or configure Nuance to use IP addresses only. Both are 
achievable...

I'll be out for an hour or so, but keep me updated with the results...

Original comment by achalo...@gmail.com on 24 Feb 2010 at 11:51

GoogleCodeExporter commented 9 years ago
Thanks Arsen. So stupid of me - I should have seen that. I suppose all that's
required is for the DNS server to have my static IP added with the correct 
hostname?
Any other ideas on how to get Sofia SIP to work correctly?

Thanks for the help!

Original comment by thirion...@gmail.com on 24 Feb 2010 at 11:59

GoogleCodeExporter commented 9 years ago
You're welcome, Derik!

BTW, have you configured your DNS settings (/etc/resolv.conf)?

See also how Sofia-SIP's DNS resolver is working
http://sofia-sip.sourceforge.net/refdocs/sresolv/index.html

Perhaps, I'd try to avoid using host names if possible.

Original comment by achalo...@gmail.com on 24 Feb 2010 at 2:36

GoogleCodeExporter commented 9 years ago
Below is the corresponding entry in NSSserver.cfg

# If value is 1 server uses IP address in SIP header Contact, else - host name.
# Default value is 0.
server.mrcp2.sip.contact.useHostIPAddress   VXIInteger    1

Original comment by achalo...@gmail.com on 24 Feb 2010 at 4:17

GoogleCodeExporter commented 9 years ago
Many thanks Arsen. Sorry, this was not a bug then and I shouldn't have added it 
to
the Issue tracker, but it is good news then of course. :-)

Sorry for having wasted your time on this... It totally baffled me. I had the 
entry
in /etc/hosts, but I think there may have been an entry for the host under the
loopback IP as well. The resolv.conf is setup (but the DNS server doesn't know 
about
the IP - busy getting that sorted out (client's server)).

Many thanks again!

Original comment by thirion...@gmail.com on 25 Feb 2010 at 6:35

GoogleCodeExporter commented 9 years ago

Original comment by thirion...@gmail.com on 10 Mar 2010 at 11:01