[OpenSIPS-Users] Fwd: Send NOTIFY via mi_xmlrpc t_uac_dlg
Aleksandr Chusov
chusov.alexsandr at gmail.com
Fri Mar 7 11:38:08 CET 2014
Hello
I'm trying to send NOTIFY message via mi_xmlrpc.
Opensips version:
version: opensips 1.10.0-tls (x86_64/linux)
flags: STATS: Off, USE_TCP, USE_TLS, DISABLE_NAGLE, USE_MCAST,
SHM_MEM, SHM_MMAP, PKG_MALLOC, F_MALLOC, FAST_LOCK-ADAPTIVE_WAIT
ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16,
MAX_URI_SIZE 1024, BUF_SIZE 65535
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
git revision: 15f435e
@(#) $Id$
main.c compiled on 07:20:10 Jan 9 2014 with gcc 4.7
First test via opensipsctl fifo, all ok:
opensipsctl fifo t_uac_dlg NOTIFY
"sip:294ee820-3268-11e3-8c04-005056be2a54 at 172.25.16.1:5060;transport=tls"
. . '\"From:<sip:1400 at domain:5061>\r\nTo:<sip:294ee820-3268-11e3-8c04-005056be2a54 at domain:5061>\r\nCseq:
10 NOTIFY\r\nCall-ID: 1625133307-5060-1 at domain\r\nEvent:
check-sync\r\n\r\n\"'
401 Unauthorized
.
.
.
Via: SIP/2.0/TLS 172.25.37.161:5061;branch=z9hG4bKf73b.920831a2.0
From: <sip:1400 at domain:5061>;tag=831b2b61e9ec85ec3ecda03adeff0250-130e
To: <sip:294ee820-3268-11e3-8c04-005056be2a54 at domain:5061>;tag=1634721453
Call-ID: 1625133307-5060-1 at domain
CSeq: 10 NOTIFY
WWW-Authenticate: Digest realm="domain:5061", nonce="1394182133",
algorithm=MD5, qop="auth"
Supported: replaces, path, timer
Server: Grandstream GXP21XX/GXP14XX
Allow: INVITE, ACK, OPTIONS, CANCEL, BYE, SUBSCRIBE, NOTIFY, INFO,
REFER, UPDATE, MESSAGE
Content-Length: 0
Then via python i received empty response:
import xmlrpclib
proxy = 'http://172.25.37.129:8001/opensips_mi_xmlrpc_root'
server = xmlrpclib.ServerProxy(proxy, verbose=True)
response = server.t_uac_dlg(
"NOTIFY",
'sip:294ee820-3268-11e3-8c04-005056be2a54 at 172.25.16.1:5060;transport=tls',
'.',
'.',
'\"From:<sip:1400 at domain:5061>\r\nTo:<sip:294ee820-3268-11e3-8c04-005056be2a54 at domain:5061>\r\nCseq:
10 NOTIFY\r\nCall-ID: 1625133307-5060-1 at domain\r\nEvent:
check-sync\r\n\r\n\"')
print response
send: 'POST /opensips_mi_xmlrpc_root HTTP/1.1\r\nHost:
172.25.37.129:8001\r\nAccept-Encoding: gzip\r\nUser-Agent:
xmlrpclib.py/1.0.1 (by www.pythonware.com)\r\nContent-Type:
text/xml\r\nContent-Length: 622\r\n\r\n<?xml
version=\'1.0\'?>\n<methodCall>\n<methodName>t_uac_dlg</methodName>\n<params>\n<param>\n<value><string>NOTIFY</string></value>\n</param>\n<param>\n<value><string>sip:294ee820-3268-11e3-8c04-005056be2a54 at 172.25.16.1:5060;transport=tls</string></value>\n</param>\n<param>\n<value><string>.</string></value>\n</param>\n<param>\n<value><string>.</string></value>\n</param>\n<param>\n<value><string>"From:<sip:1400 at domain:5061>\r\nTo:<sip:294ee820-3268-11e3-8c04-005056be2a54 at domain:5061>\r\nCseq:
10 NOTIFY\r\nCall-ID: 1625133307-5060-1 at domain\r\nEvent:
check-sync\r\n\r\n"</string></value>\n</param>\n</params>\n</methodCall>\n'
reply: 'HTTP/1.1 200 OK\r\n'
header: Content-Length: 136
header: Content-Type: text/xml; charset=utf-8
header: Date: Fri, 07 Mar 2014 09:58:37 GMT
body: '<?xml version="1.0"
encoding="UTF-8"?><methodResponse><params><param><value><string>\n</string></value></param></params></methodResponse>'
In opensips log no error.
Log debug 9:
DBG:httpd:answer_to_connection: START *** cls=(nil),
connection=0x1894170, url=/opensips_mi_xmlrpc_root, method=POST,
versio=HTTP/1.1, upload_data[
DBG:httpd:answer_to_connection: running MHD_create_post_processor
DBG:httpd:answer_to_connection: START *** cls=(nil),
connection=0x1894170, url=/opensips_mi_xmlrpc_root, method=POST,
versio=HTTP/1.1,
DBG:httpd:answer_to_connection: NOT a regular POST :o)
DBG:httpd:getConnectionHeader: Content-Type=text/xml
DBG:httpd:getConnectionHeader: Content-Length=623
DBG:httpd:answer_to_connection: got ContentType [1] with len [623]:
<?xml version="1.0"?>#012<methodCall>#012<methodName>t_uac_dlg</methodName>#012<params>#012<param><value><string>NOTIFY</string></value></param>#012<param><value><string>sip:294ee820-3268-11e3-8c04-005056be2a54 at 172.25.16.1:5060;transport=tls</string></value></param>#012<param><value><string>.</string></value></param>#012<param><value><string>.</string></value></param>#012<param><value><string>"From:<sip:1400 at domain:5061>#015#012To:<sip:294ee820-3268-11e3-8c04-005056be2a54 at domain:5061>#015#012Cseq:
10 NOTIFY#015#012Call-ID: 1625133307-5060-1 at domain#015#012Event:
check-sync#015#012#015#012"</string></value></param>#012</params>#012</methodCall>#012\n
DBG:httpd:answer_to_connection: START *** cls=(nil),
connection=0x1894170, url=/opensips_mi_xmlrpc_root, method=POST,
versio=HTTP/1.1, upload_data[0]=(nil), *con_cls=0x7faf97ef0158
DBG:httpd:answer_to_connection: normalised_url=[]
DBG:mi_xmlrpc_ng:mi_xmlrpc_http_answer_to_connection: START ***
cls=(nil), connection=0x1894170, url=, method=POST, versio=HTTP/1.1,
upload_data[0]=(nil), *con_cls=0x7faf97ef0190
DBG:httpd:httpd_get_val: DATA=[0x7faf9af0bee8]
[0x7faf9af0bf08][0x7faf9af0bf09] [1]->[<?xml
version="1.0"?>#012<methodCall>#012<methodName>t_uac_dlg</methodName>#012<params>#012<param><value><string>NOTIFY</string></value></param>#012<param><value><string>sip:294ee820-3268-11e3-8c04-005056be2a54 at 172.25.16.1:5060;transport=tls</string></value></param>#012<param><value><string>.</string></value></param>#012<param><value><string>.</string></value></param>#012<param><value><string>"From:<sip:1400 at domain:5061>#015#012To:<sip:294ee820-3268-11e3-8c04-005056be2a54 at domain:5061>#015#012Cseq:
10 NOTIFY#015#012Call-ID: 1625133307-5060-1 at domain#015#012Event:
check-sync#015#012#015#012"</string></value></param>#012</params>#012</methodCall>#012]
DBG:mi_xmlrpc_ng:mi_xmlrpc_http_run_mi_cmd: got methodName=t_uac_dlg
DBG:mi_xmlrpc_ng:mi_xmlrpc_http_build_async_handler: hdl
[0x7faf87200118], hdl->param [0x7faf87200130], *hdl->param [(nil)]
mi_xmlrpc_http_lock=[
DBG:mi_xmlrpc_ng:mi_xmlrpc_http_run_mi_cmd: got string param [NOTIFY]
DBG:mi_xmlrpc_ng:mi_xmlrpc_http_run_mi_cmd: got string param
[sip:294ee820-3268-11e3-8c04-005056be2a54 at 172.25.16.1:5060;transport=tls]
DBG:mi_xmlrpc_ng:mi_xmlrpc_http_run_mi_cmd: got string param [.]
DBG:mi_xmlrpc_ng:mi_xmlrpc_http_run_mi_cmd: got string param [.]
DBG:mi_xmlrpc_ng:mi_xmlrpc_http_run_mi_cmd: got string param
["From:<sip:1400 at domain:5061>#012To:<sip:294ee820-3268-11e3-8c04-005056be2a54 at domain#012Event:
check-sync#012#012"]
DBG:core:parse_headers: flags=ffffffffffffffff
DBG:core:parse_to: end of header reached, state=10
DBG:core:parse_to: display={},
ruri={sip:294ee820-3268-11e3-8c04-005056be2a54 at domain:5061}
DBG:core:get_hdr_field: <To> [60];
uri=[sip:294ee820-3268-11e3-8c04-005056be2a54 at domain:5061]
DBG:core:get_hdr_field: to body
[<sip:294ee820-3268-11e3-8c04-005056be2a54 at domain:5061>#012]
DBG:core:get_hdr_field: cseq <Cseq>: <10> <NOTIFY>
DBG:core:get_hdr_field: found end of header
DBG:mi_xmlrpc_ng:mi_xmlrpc_http_run_mi_cmd: got mi_rpl=[0x7faf9af0ab78]
DBG:mi_xmlrpc_ng:mi_xmlrpc_http_answer_to_connection: building on page
[0x7faf97efe930:0]
DBG:mi_xmlrpc_ng:mi_xmlrpc_http_build_header: return code: 400
Also tried perl script with the same result.
I would be grateful for any hint
More information about the Users
mailing list