[OpenSIPS-Users] mi_json parameters format

Răzvan Crainea razvan at opensips.org
Tue Sep 23 13:41:49 CEST 2014


Hi, Gary!

Have you tried quoting the entire curl parameter using quotes?

curl 
"127.0.0.1:8888/json/t_uac_dlg?params=OPTIONS,sip:1000001115 at 10.0.0.30,.,.,From: 
sip:1111111111 at 10.0.0.30,To: sip:1000001115 at 10.0.0.30,Content-Type: 
text/plain"

Best regards,

Răzvan Crainea
OpenSIPS Solutions
www.opensips-solutions.com

On 09/22/2014 07:23 PM, Gary Nyquist wrote:
> Hi Răzvan,
> Thanks for the response.
> The "get_statistics" command works fine with the comma-separated params.
> Facing problem with 't_uac_dlg' command.
> Can't figure out how to pass the headers in the params.
> As per the 'tm' module doc:
>
>
>       |t_uac_dlg|
>
> Generates and sends a local SIP request.
>
> Parameters:
>
>  *
>
>     /method/ - request method
>
>  *
>
>     /RURI/ - request SIP URI
>
>  *
>
>     /NEXT HOP/ - next hop SIP URI (OBP); use “.” if no value.
>
>  *
>
>     /socket/ - local socket to be used for sending the request; use
>     “.” if no value.
>
>  *
>
>     /headers/ - set of additional headers to be added to the request;
>     at least “From” and “To” headers must be specify)
>
>  *
>
>     /body/ - (optional, may not be present) request body (if present,
>     requires the “Content-Type” and “Content-length” headers)
>
> I want to send (say) an OPTIONS packet.
> The following fifo commands works fine:
> opensipsctl fifo t_uac_dlg OPTIONS "sip:1000001115 at 10.0.0.30" . . 
> "\"From: sip:1111111111 at 10.0.0.30\r\nTo: 
> sip:1000001115 at 10.0.0.30\r\nContent-Type: text/plain\r\n"\"
> But, 'mi_json' command won't work.
> Have tried (without luck) with several permutations, including the 
> follwoing:
> curl 
> 127.0.0.1:8888/json/t_uac_dlg?params=OPTIONS,sip:1000001115 at 10.0.0.30,.,.,From: 
> sip:1111111111 at 10.0.0.30,To: sip:1000001115 at 10.0.0.30,Content-Type: 
> text/plain
> Have tried with url encoing the complete params query string; but no 
> OPTIONS packet goes out.
> No errors in the log also (debug level 4).
> Any clues?
> Regards
> -Gary
> *Sent:* Monday, September 22, 2014 at 8:11 AM
> *From:* "Răzvan Crainea" <razvan at opensips.org>
> *To:* users at lists.opensips.org
> *Subject:* Re: [OpenSIPS-Users] mi_json parameters format
> Hi, Gary!
>
> As the documentation indicates, you should pass the parameters separated
> by comma. You can try something like this:
>
> curl "http://127.0.0.1:8888/JSON/get_statistics?params=tm:,dialog:"
>
> Best regards,
>
> Răzvan Crainea
> OpenSIPS Solutions
> www.opensips-solutions.com <http://www.opensips-solutions.com>
>
> On 09/18/2014 11:41 PM, Gary Nyquist wrote:
> > Hi,
> >
> > I am trying to use the MI interface to generate SIP MESSAGE packets 
> locally
> > and send out to remote SIP UA.
> >
> > The 'opensipsctl fifo' method works fine.
> > The 'mi_datagram' method works fine.
> >
> > But not able to make "mi_json" work with "t_uac_dlg".
> > Basically, can't figure out how the parameters for "t_uac_dlg" be 
> formatted for the mi_json query.
> >
> > Reading the manual, I understand that the "parameters are to be 
> comma-separated then URI-encoded."
> > The following working fine:
> > curl 10.0.0.30:8888/json/get_statistics?params=all
> >
> > But can't figure out how to pass the parameters for "t_uac_dlg" command.
> >
> > Any help / advice?
> >
> > Thanks
> > -Gary
> >
> > _______________________________________________
> > Users mailing list
> > Users at lists.opensips.org
> > http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20140923/c9a2457e/attachment.htm>


More information about the Users mailing list