[asterisk-bugs] [JIRA] (ASTERISK-21148) [patch] - Asterisk use '(null)' in 'via' header and 'call-id' header when relaying SIP MESSAGE

Jonathan Rose (JIRA) noreply at issues.asterisk.org
Thu Feb 28 15:23:18 CST 2013


    [ https://issues.asterisk.org/jira/browse/ASTERISK-21148?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=203566#comment-203566 ] 

Jonathan Rose edited comment on ASTERISK-21148 at 2/28/13 3:22 PM:
-------------------------------------------------------------------

One thing worth noting is that I really don't think we should allow the update_via function write anything in the event that the ourip value is NULL. That's just asking for trouble.  That said, chan_sip is a fickle beast and the patch provided is relatively harmless (and really we should be changing the via field if we update ourip) while changing the way build_via works seems like it could have a much more widespread effect, so I'm going to go ahead and run with it.



EDIT:  @Zhi Cheng so when I tried to check on your patch license number I noticed that it wasn't marked as a contribution and on attempting to do so JIRA just silently rejected marking it as a contribution.  Have you signed a license agreement? I need you to have a license agreement in order to legally be allowed to commit your code.
                
      was (Author: jrose):
    One thing worth noting is that I really don't think we should allow the update_via function write anything in the event that the ourip value is NULL. That's just asking for trouble.  That said, chan_sip is a fickle beast and the patch provided is relatively harmless (and really we should be changing the via field if we update ourip) while changing the way build_via works seems like it could have a much more widespread effect, so I'm going to go ahead and run with it.
                  
> [patch] - Asterisk use '(null)' in 'via' header and 'call-id' header when relaying SIP MESSAGE
> ----------------------------------------------------------------------------------------------
>
>                 Key: ASTERISK-21148
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-21148
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Channels/chan_sip/Messaging
>    Affects Versions: 11.2.1
>         Environment: openwrt 12.09 beta
>            Reporter: Zhi Cheng
>         Attachments: 700-sip_msg_send_via_fix.patch, debuglog, debuglog_newconfig, voip.cap, voip_newconfig.cap
>
>
> My setup:
> csipsimple at android --> main server --> GSM gateway server(using chan_dongle)
> 192.168.0.83            192.168.0.1        192.168.0.213
> Both servers are running asterisk 11.2.1. When a SMS arrived from GSM network on 192.168.0.213, that message will translate to SIP MESSAGE and passed through main asterisk server(192.168.0.1) to csipsimple, but when main asterisk server relaying the MESSAGE, the 'via' header is '(null)', cause csipsimple simply drop packet.
> extensions.conf on 192.168.0.213
> {noformat}
> [mobile]
> exten => sms,1,Noop(Incoming SMS from ${CALLERID(all)})
> exten => sms,n,Set(MESSAGE(body)=${BASE64_DECODE(${SMS_BASE64})})
> exten => sms,n,Set(ACTUALFROM=${CALLERID(num)})
> exten => sms,n,Set(ACTUALFROM=${STRREPLACE(ACTUALFROM,+86)})
> exten => sms,n,MessageSend(SIP:homemain, "${ACTUALFROM}" <${ACTUALFROM}>)
> exten => sms,n,Hangup()
> [mobilesms]
> exten => _X.,1,NoOp(Send SMS To ${MESSAGE(to)} : ${MESSAGE(body)})
> exten => _X.,n,Set(ACTUALTO=+86${CUT(CUT(MESSAGE(to),@,1),:,2)})
> exten => _X.,n,DongleSendSMS(donglee180,${ACTUALTO},${MESSAGE(body)})
> exten => _X.,n,Hangup()
> {noformat}
> sip.conf on 192.168.0.213
> {noformat}
> [homemain]
> type=friend
> host=192.168.0.1
> fromdomain=192.168.0.213
> directmedia=no
> insecure=port,invite
> qualify=yes
> context=intern
> dtmfmode=rfc2833
> outofcall_message_context=mobilesms
> {noformat}
> dongle.conf on 192.168.0.213
> {noformat}
> [donglee180]
> context=mobile
> dtmf=relax
> rxgain=4
> txgain=0
> audio=/dev/ttyUSB2
> data=/dev/ttyUSB3
> {noformat}
> extensions.conf on 192.168.0.1
> {noformat}
> [outmobilesms]
> exten => _X.,1,NoOp(Send SMS To ${MESSAGE(to)} : ${MESSAGE(body)})
> exten => _X.,n,Set(ACTUALTO=${CUT(MESSAGE(to),@,1)})
> exten => _X.,n,MessageSend(${ACTUALTO}@192.168.0.213, sip:"asterisk" <asterisk>)
> exten => _X.,n,Hangup()
> [inmobilesms]
> exten => s,1,NoOp(Incoming SMS from ${MESSAGE(from)} : ${MESSAGE(body)})
> exten => s,n,Set(ACTUALFROM=${CUT(MESSAGE(from),@,1)})
> exten => s,n,Set(ACTUALFROM=${CUT(ACTUALFROM,:,2)})
> exten => s,n,MessageSend(SIP:2204, "${ACTUALFROM}" <${ACTUALFROM}>)
> exten => s,n,Hangup()
> {noformat}
> sip.conf on 192.168.0.1
> {noformat}
> [mobile-out]
> type=friend
> host=192.168.0.213
> fromdomain=192.168.0.1
> directmedia=no
> insecure=port,invite
> qualify=yes
> dtmfmode=rfc2833
> context=mobile
> outofcall_message_context=inmobilesms
> disallow=gsm
> [2204]
> type=friend
> defaultuser=2204
> secret=pass
> host=dynamic
> context=internmobile
> dtmfmode=rfc2833
> directmedia=no
> nat=force_rport,comedia
> mailbox=2204
> outofcall_message_context=outmobilesms
> {noformat}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira



More information about the asterisk-bugs mailing list