SWITCH_EVENT_NOTIFY will not send 'body' or 'content-length'
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@3.local from-uri: 1002@3.local contact-uri: sip:1002@192.168.0.109:10536;fs_path=sip: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@3.local"><dialog id="lot" direction="initiator"><state>early</state><local><identity display="TEST">sip:lot@3.local;proto=orbit</identity><target uri="sip:lot@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.
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@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@3.local from-uri: 1002@3.local contact-uri: sip:1002@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@3.local"><dialog id="lot" direction="initiator"><state>early</state><local><identity display="TEST">sip:lot@3.local;proto=orbit</identity><target uri="sip:lot@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.
I found that I can send an event with the 'body' in C but not via telnet ESL. I'm going to be writing in C anyway so I'll just leave it at that... strange that I can send a message body via telnet ESL when it's a MESSAGE event but not SWITCH_EVENT_NOTIFY Thanks. On Mon, Feb 9, 2015 at 10:37 AM, Michael Jerris <mike@jerris.com> wrote:
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@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@3.local from-uri: 1002@3.local contact-uri: sip:1002@192.168.0.109:10536;fs_path=sip: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@3.local"><dialog id="lot" direction="initiator"><state>early</state><local><identity display="TEST">sip:lot@3.local;proto=orbit</identity><target uri="sip:lot@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.
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
participants (2)
-
Michael Jerris
-
Vik Killa