[SR-Users] Send SIP Info within a dialog using $uac_req(method)="INFO"

Daniel-Constantin Mierla miconda at gmail.com
Tue Nov 22 19:46:00 CET 2016


Hello,


got a bit of time to look at the code and discovered that there is a rpc
command tm.t_uac_start added by ser guys that might get you moving
forward. It is not waiting for the reply of the generated request and
you can use it with json rpc exec function in the config, so it avoids
using exec.


Can you give it a try?


Some documentation can be found in the comments of the function used by
this command:

  -
https://github.com/kamailio/kamailio/blob/master/modules/tm/rpc_uac.c#L399

Cheers,
Daniel


On 22/11/2016 18:35, Jonathan Hunter wrote:
>
> Hi Daniel,
>
>
> Thanks here you go;
>
>
> [root at POC_ProxyA kamailio]# kamctl mi t_uac_dlg INFO
> sip:3003 at 193.144.1.112 . udp:10.70.1.136:5060  
>  \"From:sip:1234 at 8.8.8.8"\r\nTo:sip:3003 at 193.144.1.112\r\nContact:sip:daemon at 8.8.8.8\r\n\""
> 404 Invalid local socket
> [root at POC_ProxyA kamailio]# VERBOSE=1 kamctl mi t_uac_dlg INFO
> sip:3003 at 193.144.1.112 . udp:10.70.1.136:5060  
>  \"From:sip:1234 at 8.8.8.8"\r\nTo:sip:3003 at 193.144.1.112\r\nContact:sip:daemon at 8.8.8.8\r\n\""
> database engine 'MYSQL' loaded
> Control engine 'FIFO' loaded
> entering fifo_cmd t_uac_dlg INFO sip:3003 at 193.144.1.112 .
> udp:10.70.1.136:5060 "From:sip:1234 at 8.8.8.8
> To:sip:3003 at 193.144.1.112
> Contact:sip:daemon at 8.8.8.8
> "
> 404 Invalid local socket
> FIFO command was:
> :t_uac_dlg:kamailio_receiver_23469
> INFO
> sip:3003 at 193.144.1.112
> .
> udp:10.70.1.136:5060
> "From:sip:1234 at 8.8.8.8
> To:sip:3003 at 193.144.1.112
> Contact:sip:daemon at 8.8.8.8
> "
>
>
> Thanks
>
>
> Jon
>
>
>
> ------------------------------------------------------------------------
> *From:* Daniel-Constantin Mierla <miconda at gmail.com>
> *Sent:* 22 November 2016 13:10
> *To:* Jonathan Hunter; Kamailio SER - Users Mailing List
> *Subject:* Re: [SR-Users] Send SIP Info within a dialog using
> $uac_req(method)="INFO"
>  
>
> Hello,
>
>
> I am trying to figure out why the kamctl is not passing further the
> params. Can you set VERBOSE=1 in kamctlrc or just run like:
>
>
> VERBOSE=1 kamctl mi ...
>
>
> It should print the command sent over the fifo file. Send the output
> here so I can check it.
>
>
> Cheers,
> Daniel
>
>
> On 21/11/2016 18:38, Jonathan Hunter wrote:
>>
>> Hello,
>>
>>
>> Thanks Daniel, knowing how I should specify all the parameters would
>> be great, just a syntax example, in particular when defining all the
>> sip headers and why their are double quotes/single quotes or what
>> best method is.
>>
>>
>> Thanks again and sorry for the noise!
>>
>>
>> Jon
>>
>>
>>
>>
>>
>> something seems to be strange with interpreting the parameters from
>> command line and forwarding them to kamailio. I will dig a bit into
>> kamctl and come back with some hints.
>>
>>
>> Cheers,
>> Daniel
>>
>>
>> On 21/11/16 13:19, Jonathan Hunter wrote:
>>>
>>> Hello.
>>>
>>>
>>> This is running from command line, not withing the configuration
>>> file, so I am testing before I try to add it in.
>>>
>>>
>>> I have tried with single quotes, but not sure how to enclose the SIP
>>> headers and the r/n , can you please advise?
>>>
>>>
>>> kamctl mi t_uac_dlg INFO sip:3003 at 193.144.1.112 .
>>> udp:10.70.1.136:5060  
>>>  \"From:sip:1234 at 8.8.8.8"\r\nTo:sip:3003 at 193.144.1.112\r\nContact:sip:daemon at 8.8.8.8\r\n\""
>>>
>>>
>>> As I have tried;
>>>
>>>
>>> kamctl mi t_uac_dlg 'INFO' 'sip:3003 at 193.144.1.112' '.'
>>> 'udp:10.70.1.136:5060'  
>>>  'From:sip:1234 at 8.8.8.8'r\n'To:sip:3003 at 193.144.1.112'\r\n'Contact:sip:daemon at 8.8.8.8'\r\n\'
>>>
>>>
>>> And still get invalid socket, as it is including all the SIP headers
>>> in with the port parameter so I presume I am missing an operator?
>>>
>>>
>>> /usr/sbin/kamailio[28999]: ERROR: <core> [main.c:1128]:
>>> parse_phostport(): too many colons in
>>> udp:10.70.1.136:5060From:sip:1234 at 8.8.8.8rnTo:sip:3003 at 193.144.1.112rnContact:sip:daemon at 8.8.8.8rn'
>>>
>>>
>>>
>>> Its including them all as the local socket/port.
>>>
>>> Thanks
>>>
>>> Jon
>>>
>>> ------------------------------------------------------------------------
>>> *From:* Daniel-Constantin Mierla <miconda at gmail.com>
>>> *Sent:* 21 November 2016 11:29
>>> *To:* Jonathan Hunter; Kamailio SER - Users Mailing List
>>> *Subject:* Re: [SR-Users] Send SIP Info within a dialog using
>>> $uac_req(method)="INFO"
>>>  
>>>
>>> Hello,
>>>
>>>
>>> On 20/11/16 16:12, Jonathan Hunter wrote:
>>>>
>>>> Hello,
>>>>
>>>>
>>>> Ok great thanks Daniel.
>>>>
>>>>
>>>> One final thing, I cant seem to get kamilio to except the parameter
>>>> when I add the socket parameter in the kamctl mi t_uac_dlg command.
>>>>
>>>>
>>>> If I add as below I get 404 invalid local socket;
>>>>
>>>>
>>>>  kamctl mi t_uac_dlg INFO sip:3003 at 193.144.1.112 .
>>>> udp:10.70.1.136:5060  
>>>>  \"From:sip:1234 at 8.8.8.8"\r\nTo:sip:3003 at 193.144.1.112\r\nContact:sip:daemon at 8.8.8.8\r\n\""
>>>
>>> do you run this command from command line or from kamailio.cfg? I
>>> think it's good to be sure it works from command line.
>>>
>>> Also, can you try to enclose each parameter in single quotes -- then
>>> it's easier for the command line parser to identify the parameters.
>>>
>>> Cheers,
>>> Daniel
>>>
>>>> 404 Invalid local socket
>>>>
>>>> As its picking up the socket with the from address included as
>>>> well, is this again around syntax?
>>>>
>>>> ERROR: <core> [main.c:1128]: parse_phostport(): too many colons in
>>>> udp:10.70.1.136:5060"From:sip:1234 at 8.8.8.8
>>>>
>>>> As it seems to pick socket up ok;
>>>>
>>>> Nov 20 15:11:36 POC_ProxyA /usr/sbin/kamailio[23175]: DEBUG:
>>>> mi_fifo [mi_parser.c:245]: mi_parse_tree(): adding node <> ; val <INFO>
>>>> Nov 20 15:11:36 POC_ProxyA /usr/sbin/kamailio[23175]: DEBUG:
>>>> mi_fifo [mi_parser.c:245]: mi_parse_tree(): adding node <> ; val
>>>> <sip:3003 at 193.144.1.112>
>>>> Nov 20 15:11:36 POC_ProxyA /usr/sbin/kamailio[23175]: DEBUG:
>>>> mi_fifo [mi_parser.c:245]: mi_parse_tree(): adding node <> ; val <.>
>>>> Nov 20 15:11:36 POC_ProxyA /usr/sbin/kamailio[23175]: DEBUG:
>>>> mi_fifo [mi_parser.c:245]: mi_parse_tree(): adding node <> ; val
>>>> <udp:10.70.1.136:5060>
>>>> Nov 20 15:11:36 POC_ProxyA /usr/sbin/kamailio[23175]: DEBUG:
>>>> mi_fifo [mi_parser.c:245]: mi_parse_tree(): adding node <> ; val
>>>> <From:sip:1234 at 8.8.8.8
>>>> Nov 20 15:11:36 POC_ProxyA /usr/sbin/kamailio[23175]: DEBUG:
>>>> mi_fifo [mi_parser.c:84]: mi_parse_node(): end of fifo input tree
>>>> Nov 20 15:11:36 POC_ProxyA /usr/sbin/kamailio[23175]: DEBUG:
>>>> mi_fifo [fifo_fnc.c:507]: mi_fifo_server(): done parsing the mi tree
>>>> Nov 20 15:11:36 POC_ProxyA /usr/sbin/kamailio[23175]: ERROR: <core>
>>>> [main.c:1128]: parse_phostport(): too many colons in
>>>> udp:10.70.1.136:5060"From:sip:1234 at 8.8.8.8
>>>>
>>>>
>>
>> -- 
>> Daniel-Constantin Mierla
>> http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
>> Kamailio Advanced Training, Berlin, Nov 28-30, 2016 - http://www.asipto.com
>
> -- 
> Daniel-Constantin Mierla
> http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
> Kamailio Advanced Training, Berlin, Nov 28-30, 2016 - http://www.asipto.com

-- 
Daniel-Constantin Mierla
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Kamailio Advanced Training, Berlin, Nov 28-30, 2016 - http://www.asipto.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20161122/8434762e/attachment.html>


More information about the sr-users mailing list