[Freeswitch-users] SWITCH_EVENT_NOTIFY will not send 'body' or 'content-length'

Michael Jerris mike at jerris.com
Mon Feb 9 18:37:35 MSK 2015


It should never be looking at a header to determine the content length, but it should probably be calculating it itself.  Patches welcome.

> On Feb 7, 2015, at 4:19 PM, Vik Killa <vipkilla at gmail.com> wrote:
> 
> When firing a NOTIFY event using sendevent, mod_sofia does not accept 'body' or 'content-length' from the event;
> 
> My goal is to be able to send custom 'dialog' events to send NOTIFYs to UAs
> I noticed FS will send the dialog event if I don't include the 'content-length' header and body. 
> 
> Here is an example event that works.
> mod_sofia will parse the event and fire the NOTIFY
> 
> sendevent NOTIFY
> profile: internal
> event-string: dialog
> content-type: application/dialog-info+xml
> user: 1002
> host: 3.local
> to-uri: 1002 at 3.local
> from-uri: 1002 at 3.local
> contact-uri: sip:1002 at 192.168.0.109:10536;fs_path=sip:192.168.207.156:5060 <http://192.168.207.156:5060/>
> 
> if I add content-length and a body, mod_sofia does not fire the NOTIFY:
> 
> content-length: 493
> <?xml version="1.0"?><dialog-info xmlns="urn:ietf:params:xml:ns:dialog-info" version="3" state="full" entity="sip:orbit+lot at 3.local"><dialog id="lot" direction="initiator"><state>early</state><local><identity display="TEST">sip:lot at 3.local;proto=orbit</identity><target uri="sip:lot at 3.local;proto=orbit"><param pname="+sip.rendering" pvalue="no"/></target></local><remote><identity display="park">sip:lot</identity><target uri="sip:park+lot"/></remote></dialog></dialog-info>
> 
> 
> I noticed in mod_sofia.c, where it listens for SWITCH_EVENT_NOTIFY
> it does not parse the 'content-length' header but it does look for the body and even tries to send it in nua_notify()
> 
> Is this the desired behavior? If SWITCH_EVENT_NOTIFY is trying to send the body of the event, shouldn't it look for a content-length header or try to create one based on the body?
> 
> If it is not the desired behavior, could this be a bug? 
> Thank you in advance.
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20150209/344c41e2/attachment.html 


Join us at ClueCon 2016 Aug 8-12, 2016
More information about the FreeSWITCH-users mailing list