LED-Controlling on Snom phones. Missing Subject header
Hello, I try to control the LEDs on Snom 370 phones using LUA and event type SEND_MESSAGE. The phone receives this message: MESSAGE sip:2850@85.16.245.213:1051 SIP/2.0 Via: SIP/2.0/UDP 85.16.246.6;rport;branch=z9hG4bKeer7H9cFa85DN Max-Forwards: 70 From: <sip:2850@85.16.246.6>;tag=yH2p954XZZ1tj To: <sip:2850@85.16.246.6> Call-ID: 2a6ed9ba-ef6d-122d-3d83-00144fe6e332 CSeq: 131979517 MESSAGE Contact: <sip:mod_sofia@85.16.246.6:5060> User-Agent: FreeSWITCH-mod_sofia/1.0.head-17097:17188M Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, UPDATE, INFO, REGISTER, REFER, NOTIFY, PUBLISH, SUBSCRIBE Supported: timer, precondition, path, replaces Content-Type: application/x-buttons Content-Length: 10 k=1 c=on and Snom acknowledges this with 200 OK. Unfortunately nothing happens. Snom's howto (http://wiki.snom.com/Category:HowTo:LED_Remote_Control) describes a message like this: MESSAGE sip:44@172.20.25.101:2048;transport=tls;line=44qsudyt SIP/2.0 Via: SIP/2.0/TLS 172.20.25.102:5061;branch=z9hG4bK-2909fe081f8466c9836c3b673f284842;rport From: <sip:44@localhost>;tag=17820 To: <sip:44@localhost> Call-ID: umceg9jb@pbx CSeq: 35160 MESSAGE Max-Forwards: 70 Contact: <sip:172.20.25.102:5061;transport=tls> Subject: buttons Content-Type: application/x-buttons Content-Length: 7 k=3 l=42 Main difference is the subject header containing "buttons" (despite of the body) Is there a way to add subject header as above to the message generated by FS? regards Helmut
diff --git a/src/mod/endpoints/mod_sofia/mod_sofia.c b/src/mod/endpoints/mod_sofia/mod_sofia.c index 026ae42..1d274c2 100644 --- a/src/mod/endpoints/mod_sofia/mod_sofia.c +++ b/src/mod/endpoints/mod_sofia/mod_sofia.c @@ -4082,6 +4082,7 @@ static void general_event_handler(switch_event_t *event) const char *ct = switch_event_get_header(event, "content-type"); const char *user = switch_event_get_header(event, "user"); const char *host = switch_event_get_header(event, "host"); + const char *subject = switch_event_get_header(event, "subject"); const char *body = switch_event_get_body(event); sofia_profile_t *profile; nua_handle_t *nh; @@ -4114,7 +4115,10 @@ static void general_event_handler(switch_event_t *event) nh = nua_handle(profile->nua, NULL, NUTAG_URL(contact), SIPTAG_FROM_STR(id), SIPTAG_TO_STR(id), SIPTAG_CONTACT_STR(profile->url), TAG_END()); - nua_message(nh, NUTAG_NEWSUB(1), SIPTAG_CONTENT_TYPE_STR(ct), TAG_IF(!zstr(body), SIPTAG_PAYLOAD_STR(body)), TAG_END()); + nua_message(nh, NUTAG_NEWSUB(1), SIPTAG_CONTENT_TYPE_STR(ct), + TAG_IF(!zstr(body), SIPTAG_PAYLOAD_STR(body)), + TAG_IF(!zstr(subject), SIPTAG_SUBJECT_STR(subject)), + TAG_END()); free(id); This should work... please try it yourself. I'll push this later if that works. /b On Jun 10, 2010, at 3:38 PM, Helmut Kuper wrote:
Hello,
I try to control the LEDs on Snom 370 phones using LUA and event type SEND_MESSAGE. The phone receives this message:
MESSAGE sip:2850@85.16.245.213:1051 SIP/2.0 Via: SIP/2.0/UDP 85.16.246.6;rport;branch=z9hG4bKeer7H9cFa85DN Max-Forwards: 70 From: <sip:2850@85.16.246.6>;tag=yH2p954XZZ1tj To: <sip:2850@85.16.246.6> Call-ID: 2a6ed9ba-ef6d-122d-3d83-00144fe6e332 CSeq: 131979517 MESSAGE Contact: <sip:mod_sofia@85.16.246.6:5060> User-Agent: FreeSWITCH-mod_sofia/1.0.head-17097:17188M Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, UPDATE, INFO, REGISTER, REFER, NOTIFY, PUBLISH, SUBSCRIBE Supported: timer, precondition, path, replaces Content-Type: application/x-buttons Content-Length: 10
k=1 c=on
and Snom acknowledges this with 200 OK. Unfortunately nothing happens.
Snom's howto (http://wiki.snom.com/Category:HowTo:LED_Remote_Control) describes a message like this:
MESSAGE sip:44@172.20.25.101:2048;transport=tls;line=44qsudyt SIP/2.0 Via: SIP/2.0/TLS 172.20.25.102:5061;branch=z9hG4bK-2909fe081f8466c9836c3b673f284842;rport From: <sip:44@localhost>;tag=17820 To: <sip:44@localhost> Call-ID: umceg9jb@pbx CSeq: 35160 MESSAGE Max-Forwards: 70 Contact: <sip:172.20.25.102:5061;transport=tls> Subject: buttons Content-Type: application/x-buttons Content-Length: 7
k=3 l=42
Main difference is the subject header containing "buttons" (despite of the body)
Is there a way to add subject header as above to the message generated by FS?
regards Helmut
_______________________________________________ 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
Just git pull I just pushed it. /b On Jun 10, 2010, at 3:38 PM, Helmut Kuper wrote:
Main difference is the subject header containing "buttons" (despite of the body)
Is there a way to add subject header as above to the message generated by FS?
if you are playing with buttons stuff you should look into mod_snom where it's abstracted more. On Thu, Jun 10, 2010 at 3:49 PM, Brian West <brian@freeswitch.org> wrote:
Just git pull I just pushed it.
/b
On Jun 10, 2010, at 3:38 PM, Helmut Kuper wrote:
Main difference is the subject header containing "buttons" (despite of the body)
Is there a way to add subject header as above to the message generated by FS?
_______________________________________________ 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
-- Anthony Minessale II FreeSWITCH http://www.freeswitch.org/ ClueCon http://www.cluecon.com/ Twitter: http://twitter.com/FreeSWITCH_wire AIM: anthm MSN:anthony_minessale@hotmail.com <MSN%3Aanthony_minessale@hotmail.com> GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com<PAYPAL%3Aanthony.minessale@gmail.com> IRC: irc.freenode.net #freeswitch FreeSWITCH Developer Conference sip:888@conference.freeswitch.org <sip%3A888@conference.freeswitch.org> googletalk:conf+888@conference.freeswitch.org<googletalk%3Aconf%2B888@conference.freeswitch.org> pstn:+19193869900
Hi Brian, thx for your quick patch. I added it. Subject header is now there :) But still no success. Here the Snom log: Received from udp:85.16.246.6:5060 at 11/6/2010 13:09:58:371 (620 bytes): MESSAGE sip:2850@85.16.245.213:1066 SIP/2.0 Via: SIP/2.0/UDP 85.16.246.6;rport;branch=z9hG4bK763Kg0N1grK6e Max-Forwards: 70 From: <sip:2850@85.16.246.6>;tag=BB5FgvDmS3BHa To: <sip:2850@85.16.246.6> Call-ID: a49b9045-efec-122d-11ba-00144fe6e332 CSeq: 132008799 MESSAGE Contact: <sip:mod_sofia@85.16.246.6:5060> Subject: buttons User-Agent: FreeSWITCH-mod_sofia/1.0.head-17097:17188M Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, UPDATE, INFO, REGISTER, REFER, NOTIFY, PUBLISH, SUBSCRIBE Supported: timer, precondition, path, replaces Content-Type: application/x-buttons Content-Length: 11 k=11 c=on Sent to udp:85.16.246.6:5060 at 11/6/2010 13:09:58:455 (254 bytes): SIP/2.0 200 Ok Via: SIP/2.0/UDP 85.16.246.6;rport=5060;branch=z9hG4bK763Kg0N1grK6e From: <sip:2850@85.16.246.6>;tag=BB5FgvDmS3BHa To: <sip:2850@85.16.246.6> Call-ID: a49b9045-efec-122d-11ba-00144fe6e332 CSeq: 132008799 MESSAGE Content-Length: 0 FKey 11 on Snom is configured as "button" Guess I have to ask Snom ... regrads Helmut On 10.06.2010 22:49, Brian West wrote:
Just git pull I just pushed it.
/b
On Jun 10, 2010, at 3:38 PM, Helmut Kuper wrote:
Main difference is the subject header containing "buttons" (despite of the body)
Is there a way to add subject header as above to the message generated by FS?
_______________________________________________ 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
read my last post On Fri, Jun 11, 2010 at 6:11 AM, Helmut Kuper <helmut.kuper@ewetel.de>wrote:
Hi Brian,
thx for your quick patch.
I added it. Subject header is now there :) But still no success.
Here the Snom log:
Received from udp:85.16.246.6:5060 at 11/6/2010 13:09:58:371 (620 bytes):
MESSAGE sip:2850@85.16.245.213:1066 SIP/2.0 Via: SIP/2.0/UDP 85.16.246.6;rport;branch=z9hG4bK763Kg0N1grK6e Max-Forwards: 70 From: <sip:2850@85.16.246.6 <sip%3A2850@85.16.246.6>>;tag=BB5FgvDmS3BHa To: <sip:2850@85.16.246.6 <sip%3A2850@85.16.246.6>> Call-ID: a49b9045-efec-122d-11ba-00144fe6e332 CSeq: 132008799 MESSAGE Contact: <sip:mod_sofia@85.16.246.6:5060> Subject: buttons User-Agent: FreeSWITCH-mod_sofia/1.0.head-17097:17188M Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, UPDATE, INFO, REGISTER, REFER, NOTIFY, PUBLISH, SUBSCRIBE Supported: timer, precondition, path, replaces Content-Type: application/x-buttons Content-Length: 11
k=11 c=on
Sent to udp:85.16.246.6:5060 at 11/6/2010 13:09:58:455 (254 bytes):
SIP/2.0 200 Ok Via: SIP/2.0/UDP 85.16.246.6;rport=5060;branch=z9hG4bK763Kg0N1grK6e From: <sip:2850@85.16.246.6 <sip%3A2850@85.16.246.6>>;tag=BB5FgvDmS3BHa To: <sip:2850@85.16.246.6 <sip%3A2850@85.16.246.6>> Call-ID: a49b9045-efec-122d-11ba-00144fe6e332 CSeq: 132008799 MESSAGE Content-Length: 0
FKey 11 on Snom is configured as "button"
Guess I have to ask Snom ...
regrads Helmut
On 10.06.2010 22:49, Brian West wrote:
Just git pull I just pushed it.
/b
On Jun 10, 2010, at 3:38 PM, Helmut Kuper wrote:
Main difference is the subject header containing "buttons" (despite of the body)
Is there a way to add subject header as above to the message generated by FS?
_______________________________________________ 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
_______________________________________________ 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
-- Anthony Minessale II FreeSWITCH http://www.freeswitch.org/ ClueCon http://www.cluecon.com/ Twitter: http://twitter.com/FreeSWITCH_wire AIM: anthm MSN:anthony_minessale@hotmail.com <MSN%3Aanthony_minessale@hotmail.com> GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com<PAYPAL%3Aanthony.minessale@gmail.com> IRC: irc.freenode.net #freeswitch FreeSWITCH Developer Conference sip:888@conference.freeswitch.org <sip%3A888@conference.freeswitch.org> googletalk:conf+888@conference.freeswitch.org<googletalk%3Aconf%2B888@conference.freeswitch.org> pstn:+19193869900
Hi Anthony, I did, and I tested it now. Same behavior as my solution: On FS console i did: snom_bind_key 1 on test 2850 85.16.246.6 internal In Snom SIP-log I found: Received from udp:85.16.246.6:5060 at 14/6/2010 10:19:24:249 (608 bytes): MESSAGE sip:2850@85.16.245.213:1073 SIP/2.0 Via: SIP/2.0/UDP 85.16.246.6;rport;branch=z9hG4bKjtNBF9mSHHctK Max-Forwards: 70 From: <sip:2850@85.16.246.6>;tag=ej91NX74DXHrg To: <sip:2850@85.16.246.6> Call-ID: 4f1db2f1-f230-122d-d0aa-00144fe6e332 CSeq: 132133430 MESSAGE Contact: <sip:mod_sofia@85.16.246.6:5060> User-Agent: FreeSWITCH-mod_sofia/1.0.head-17097:17188M Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, UPDATE, INFO, REGISTER, REFER, NOTIFY, PUBLISH, SUBSCRIBE Supported: timer, precondition, path, replaces Content-Type: application/x-buttons Content-Length: 18 k=11 c=on l=test Sent to udp:85.16.246.6:5060 at 14/6/2010 10:19:24:351 (254 bytes): SIP/2.0 200 Ok Via: SIP/2.0/UDP 85.16.246.6;rport=5060;branch=z9hG4bKjtNBF9mSHHctK From: <sip:2850@85.16.246.6>;tag=ej91NX74DXHrg To: <sip:2850@85.16.246.6> Call-ID: 4f1db2f1-f230-122d-d0aa-00144fe6e332 CSeq: 132133430 MESSAGE Content-Length: 0 But no lights on on the phones fkeys I use currently FW 8.4.9 and 8.2.25 on snom 370. On 11.06.2010 20:25, Anthony Minessale wrote:
read my last post
On Fri, Jun 11, 2010 at 6:11 AM, Helmut Kuper <helmut.kuper@ewetel.de <mailto:helmut.kuper@ewetel.de>> wrote:
regards Helmut
Hello brian, yes indeed. But since my message is identical to your message except that mine has a subject header, I guess that your way does not work as well. I send my problem in parallel to Snom. They said, that the 8 experience FWs ;) doesn't handle this correct, but the 7.3.30 fw does. They will work on a patch. Have to test that here. Down#t want to downgrade, but hey ... regards Helmut On 14.06.2010 15:50, Brian West wrote:
Subject just has to be added to the event that is sent.
/b
On Jun 14, 2010, at 3:32 AM, Helmut Kuper wrote:
Hi Anthony,
I did, and I tested it now. Same behavior as my solution:
On FS console i did:
_______________________________________________ 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
Well the subject requirement must be new because it was working fine. /b On Jun 14, 2010, at 9:04 AM, Helmut Kuper wrote:
Hello brian,
yes indeed. But since my message is identical to your message except that mine has a subject header, I guess that your way does not work as well.
I send my problem in parallel to Snom. They said, that the 8 experience FWs ;) doesn't handle this correct, but the 7.3.30 fw does. They will work on a patch.
Have to test that here. Down#t want to downgrade, but hey ...
regards Helmut
Hi Brian, ok, got it. mod_snom and also my solution works perfectly with Snom 7.3.29 firmware. Thx for your help. regards helmut On 14.06.2010 16:04, Helmut Kuper wrote:
Hello brian,
yes indeed. But since my message is identical to your message except that mine has a subject header, I guess that your way does not work as well.
I send my problem in parallel to Snom. They said, that the 8 experience FWs ;) doesn't handle this correct, but the 7.3.30 fw does. They will work on a patch.
Have to test that here. Down#t want to downgrade, but hey ...
Hi Brian, just a new info from Snom: Series 8 works as well. You have to configure snoms fkey to "button" and assign a label aka index to it. The index must be the same as in the "k=" in message body option - and a number!. regards helmut On 14.06.2010 16:43, Helmut Kuper wrote:
Hi Brian,
ok, got it. mod_snom and also my solution works perfectly with Snom 7.3.29 firmware.
Thx for your help.
regards helmut
participants (3)
-
Anthony Minessale
-
Brian West
-
Helmut Kuper